diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2012-06-04 12:56:50 -0400 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2012-06-04 12:56:50 -0400 |
commit | ff100d50d611db8ae0541e67c652c7cfe63c3d1c (patch) | |
tree | 4dc8aaa41f85b71f3cab5bed4990062a28a0c623 | |
parent | fac33bc82aaa8d7282600f6322279612858297ec (diff) | |
download | frigidearth-ff100d50d611db8ae0541e67c652c7cfe63c3d1c.tar.gz frigidearth-ff100d50d611db8ae0541e67c652c7cfe63c3d1c.tar.bz2 frigidearth-ff100d50d611db8ae0541e67c652c7cfe63c3d1c.zip |
Tweaked battle system
There is now an upper limit on mobs in a level, experience gained is now inversely proportional to the level SQUARED, and the player's attack power is now the square root of their level.
-rw-r--r-- | src/com/fourisland/frigidearth/MapViewGameState.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/com/fourisland/frigidearth/MapViewGameState.java b/src/com/fourisland/frigidearth/MapViewGameState.java index 0b61a19..64ac2de 100644 --- a/src/com/fourisland/frigidearth/MapViewGameState.java +++ b/src/com/fourisland/frigidearth/MapViewGameState.java | |||
@@ -787,12 +787,12 @@ public class MapViewGameState implements GameState | |||
787 | if (mob.getPosition().equals(to)) | 787 | if (mob.getPosition().equals(to)) |
788 | { | 788 | { |
789 | printMessage("You hit the " + mob.getName().toLowerCase()); | 789 | printMessage("You hit the " + mob.getName().toLowerCase()); |
790 | mob.health -= level; | 790 | mob.health -= (int) (Math.floor(Math.sqrt(level))); |
791 | 791 | ||
792 | if (mob.health <= 0) | 792 | if (mob.health <= 0) |
793 | { | 793 | { |
794 | printMessage("You killed the " + mob.getName().toLowerCase() + "!"); | 794 | printMessage("You killed the " + mob.getName().toLowerCase() + "!"); |
795 | experience += (mob.getBaseExperience()/level); | 795 | experience += (mob.getBaseExperience()/(level*level)); |
796 | mobs.remove(mob); | 796 | mobs.remove(mob); |
797 | 797 | ||
798 | if (experience >= 1000) | 798 | if (experience >= 1000) |
@@ -976,13 +976,16 @@ public class MapViewGameState implements GameState | |||
976 | { | 976 | { |
977 | spawnTimer = 0; | 977 | spawnTimer = 0; |
978 | 978 | ||
979 | Room r = rooms.get(Functions.random(0, rooms.size()-1)); | 979 | if (mobs.size() < (rooms.size()*2)) |
980 | if (r.canGenerateMonsters()) | ||
981 | { | 980 | { |
982 | Mob m = createInDepthMonster(r); | 981 | Room r = rooms.get(Functions.random(0, rooms.size()-1)); |
983 | if (!gridLighting[m.x][m.y]) | 982 | if (r.canGenerateMonsters()) |
984 | { | 983 | { |
985 | mobs.add(m); | 984 | Mob m = createInDepthMonster(r); |
985 | if (!gridLighting[m.x][m.y]) | ||
986 | { | ||
987 | mobs.add(m); | ||
988 | } | ||
986 | } | 989 | } |
987 | } | 990 | } |
988 | } else { | 991 | } else { |