diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/fourisland/frigidearth/MapViewGameState.java | 14 | ||||
-rw-r--r-- | src/com/fourisland/frigidearth/mobs/FireSnake.java | 55 | ||||
-rw-r--r-- | src/com/fourisland/frigidearth/mobs/IceSnake.java | 55 |
3 files changed, 123 insertions, 1 deletions
diff --git a/src/com/fourisland/frigidearth/MapViewGameState.java b/src/com/fourisland/frigidearth/MapViewGameState.java index c5e1d47..0e136d5 100644 --- a/src/com/fourisland/frigidearth/MapViewGameState.java +++ b/src/com/fourisland/frigidearth/MapViewGameState.java | |||
@@ -4,6 +4,8 @@ | |||
4 | */ | 4 | */ |
5 | package com.fourisland.frigidearth; | 5 | package com.fourisland.frigidearth; |
6 | 6 | ||
7 | import com.fourisland.frigidearth.mobs.FireSnake; | ||
8 | import com.fourisland.frigidearth.mobs.IceSnake; | ||
7 | import com.fourisland.frigidearth.mobs.Mouse; | 9 | import com.fourisland.frigidearth.mobs.Mouse; |
8 | import com.fourisland.frigidearth.mobs.Rat; | 10 | import com.fourisland.frigidearth.mobs.Rat; |
9 | import com.fourisland.frigidearth.mobs.Spider; | 11 | import com.fourisland.frigidearth.mobs.Spider; |
@@ -761,8 +763,16 @@ public class MapViewGameState implements GameState | |||
761 | g.drawImage(SystemFont.getCharacter(healthText.charAt(i), healthColor), (i+2)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null); | 763 | g.drawImage(SystemFont.getCharacter(healthText.charAt(i), healthColor), (i+2)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null); |
762 | } | 764 | } |
763 | 765 | ||
764 | g.drawImage(SystemFont.getCharacter((char) 5, Color.GRAY), (healthText.length()+3)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null); | 766 | g.drawImage(SystemFont.getCharacter('/', Color.ORANGE), (healthText.length()+3)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null); |
765 | int b = healthText.length()+4; | 767 | int b = healthText.length()+4; |
768 | String powerText = Integer.toString(Main.currentGame.getAttackPower()); | ||
769 | for (int i=0; i<powerText.length(); i++) | ||
770 | { | ||
771 | g.drawImage(SystemFont.getCharacter(powerText.charAt(i), Color.WHITE), (i+b)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null); | ||
772 | } | ||
773 | |||
774 | g.drawImage(SystemFont.getCharacter((char) 5, Color.GRAY), (b+powerText.length()+1)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null); | ||
775 | b += powerText.length()+2; | ||
766 | String defenseText = Integer.toString(Main.currentGame.getDefense()); | 776 | String defenseText = Integer.toString(Main.currentGame.getDefense()); |
767 | for (int i=0; i<defenseText.length(); i++) | 777 | for (int i=0; i<defenseText.length(); i++) |
768 | { | 778 | { |
@@ -1425,6 +1435,8 @@ public class MapViewGameState implements GameState | |||
1425 | case 4: | 1435 | case 4: |
1426 | case 3: | 1436 | case 3: |
1427 | case 2: | 1437 | case 2: |
1438 | mobTypes.add(FireSnake.class); | ||
1439 | mobTypes.add(IceSnake.class); | ||
1428 | case 1: | 1440 | case 1: |
1429 | mobTypes.add(Mouse.class); | 1441 | mobTypes.add(Mouse.class); |
1430 | mobTypes.add(Rat.class); | 1442 | mobTypes.add(Rat.class); |
diff --git a/src/com/fourisland/frigidearth/mobs/FireSnake.java b/src/com/fourisland/frigidearth/mobs/FireSnake.java new file mode 100644 index 0000000..83cc2a6 --- /dev/null +++ b/src/com/fourisland/frigidearth/mobs/FireSnake.java | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * To change this template, choose Tools | Templates | ||
3 | * and open the template in the editor. | ||
4 | */ | ||
5 | package com.fourisland.frigidearth.mobs; | ||
6 | |||
7 | import com.fourisland.frigidearth.Functions; | ||
8 | import com.fourisland.frigidearth.Mob; | ||
9 | import java.awt.Color; | ||
10 | |||
11 | /** | ||
12 | * | ||
13 | * @author hatkirby | ||
14 | */ | ||
15 | public class FireSnake extends Mob | ||
16 | { | ||
17 | public FireSnake(int x, int y) | ||
18 | { | ||
19 | super(x, y); | ||
20 | |||
21 | health = Functions.rollDice(2, 5); | ||
22 | hostile = true; | ||
23 | } | ||
24 | |||
25 | public char getDisplayCharacter() | ||
26 | { | ||
27 | return 's'; | ||
28 | } | ||
29 | |||
30 | public Color getDisplayColor() | ||
31 | { | ||
32 | return Color.RED; | ||
33 | } | ||
34 | |||
35 | public String getName() | ||
36 | { | ||
37 | return "Fire Snake"; | ||
38 | } | ||
39 | |||
40 | public String getBattleMessage() | ||
41 | { | ||
42 | return "The fire snake bites you"; | ||
43 | } | ||
44 | |||
45 | public int getAttackPower() | ||
46 | { | ||
47 | return Functions.rollDice(1, 4); | ||
48 | } | ||
49 | |||
50 | public int getBaseExperience() | ||
51 | { | ||
52 | return 200; | ||
53 | } | ||
54 | |||
55 | } | ||
diff --git a/src/com/fourisland/frigidearth/mobs/IceSnake.java b/src/com/fourisland/frigidearth/mobs/IceSnake.java new file mode 100644 index 0000000..778d498 --- /dev/null +++ b/src/com/fourisland/frigidearth/mobs/IceSnake.java | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * To change this template, choose Tools | Templates | ||
3 | * and open the template in the editor. | ||
4 | */ | ||
5 | package com.fourisland.frigidearth.mobs; | ||
6 | |||
7 | import com.fourisland.frigidearth.Functions; | ||
8 | import com.fourisland.frigidearth.Mob; | ||
9 | import java.awt.Color; | ||
10 | |||
11 | /** | ||
12 | * | ||
13 | * @author hatkirby | ||
14 | */ | ||
15 | public class IceSnake extends Mob | ||
16 | { | ||
17 | public IceSnake(int x, int y) | ||
18 | { | ||
19 | super(x, y); | ||
20 | |||
21 | health = Functions.rollDice(3, 4); | ||
22 | hostile = true; | ||
23 | } | ||
24 | |||
25 | public char getDisplayCharacter() | ||
26 | { | ||
27 | return 's'; | ||
28 | } | ||
29 | |||
30 | public Color getDisplayColor() | ||
31 | { | ||
32 | return Color.BLUE; | ||
33 | } | ||
34 | |||
35 | public String getName() | ||
36 | { | ||
37 | return "Ice Snake"; | ||
38 | } | ||
39 | |||
40 | public String getBattleMessage() | ||
41 | { | ||
42 | return "The ice snake bites you"; | ||
43 | } | ||
44 | |||
45 | public int getAttackPower() | ||
46 | { | ||
47 | return Functions.rollDice(1, 4); | ||
48 | } | ||
49 | |||
50 | public int getBaseExperience() | ||
51 | { | ||
52 | return 450; | ||
53 | } | ||
54 | |||
55 | } | ||