From bc44c11b60cd93bd2ce3d5bb59f5ed4a9c72acd0 Mon Sep 17 00:00:00 2001 From: ondra Date: Tue, 20 May 2014 10:58:31 +0200 Subject: [PATCH] rebalancing, more food, --- .../rogue/world/entity/impl/BossRatAi.java | 6 ++-- .../world/entity/impl/EntityBrownRat.java | 5 ++- .../world/entity/impl/EntityGrayRat.java | 1 - .../entity/modules/EntityModuleHealth.java | 2 +- .../rogue/world/gen/WorldCreator.java | 16 +++++---- .../rogue/world/gen/rooms/DeadEndRoom.java | 34 +++++++++++++------ .../rogue/world/gen/rooms/SecretRoom.java | 2 +- .../rogue/world/gen/rooms/StorageRoom.java | 12 +++---- 8 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/mightypork/rogue/world/entity/impl/BossRatAi.java b/src/mightypork/rogue/world/entity/impl/BossRatAi.java index 8b54ba2..c078146 100644 --- a/src/mightypork/rogue/world/entity/impl/BossRatAi.java +++ b/src/mightypork/rogue/world/entity/impl/BossRatAi.java @@ -22,14 +22,14 @@ public class BossRatAi extends GrayRatAi { { super(entity); - setAttackTime(0.2); + setAttackTime(0.3); } @Override protected int getAttackStrength() { - return Calc.randInt(1, 6); + return Calc.randInt(2, 3); } @@ -52,6 +52,6 @@ public class BossRatAi extends GrayRatAi { @Override protected double getStepTime() { - return isIdle() ? 0.6 : 0.37; + return isIdle() ? 0.6 : 0.4; } } diff --git a/src/mightypork/rogue/world/entity/impl/EntityBrownRat.java b/src/mightypork/rogue/world/entity/impl/EntityBrownRat.java index 7308e91..b9354cb 100644 --- a/src/mightypork/rogue/world/entity/impl/EntityBrownRat.java +++ b/src/mightypork/rogue/world/entity/impl/EntityBrownRat.java @@ -30,9 +30,8 @@ public class EntityBrownRat extends Entity { setDespawnDelay(1); - health.setHealthMax(18); - health.setHealth(Calc.randInt(12, 18)); // tougher to kill - health.setHitCooldownTime(0.35); // a bit longer than gray rat + health.setHealthMax(16); + health.setHealth(Calc.randInt(10, 16)); // tougher to kill } diff --git a/src/mightypork/rogue/world/entity/impl/EntityGrayRat.java b/src/mightypork/rogue/world/entity/impl/EntityGrayRat.java index 2077f35..966bdd3 100644 --- a/src/mightypork/rogue/world/entity/impl/EntityGrayRat.java +++ b/src/mightypork/rogue/world/entity/impl/EntityGrayRat.java @@ -32,7 +32,6 @@ public class EntityGrayRat extends Entity { health.setHealthMax(7); health.setHealth(Calc.randInt(4, 7)); - health.setHitCooldownTime(0.3); } diff --git a/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java b/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java index 3b15d2a..8ea07ad 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java +++ b/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java @@ -19,7 +19,7 @@ public class EntityModuleHealth extends EntityModule { protected int health = 1; protected int maxHealth = 1; - private double hitCooldownTime = 0.3; + private double hitCooldownTime = 0.36; protected boolean dead = false; private double timeSinceLastDamage = Integer.MAX_VALUE; diff --git a/src/mightypork/rogue/world/gen/WorldCreator.java b/src/mightypork/rogue/world/gen/WorldCreator.java index 61edb64..bb8e10d 100644 --- a/src/mightypork/rogue/world/gen/WorldCreator.java +++ b/src/mightypork/rogue/world/gen/WorldCreator.java @@ -68,13 +68,13 @@ public class WorldCreator { } for (int i = 0; i < Calc.randInt(rand, 2, 4); i++) { - final Item item = Calc.pick(rand, weaponsMedium).createItemDamaged(40); + final Item item = Calc.pick(rand, weaponsMedium).createItemDamaged(50); final LevelBuilder lb = levelBuilders[-1 + Calc.randInt(3, 5)]; lb.addRoom(Rooms.treasure(item), BuildOrder.MIDDLE, true); } for (int i = 0; i < Calc.randInt(rand, 2, 4); i++) { - final Item item = Calc.pick(rand, weaponsGood).createItemDamaged(50); + final Item item = Calc.pick(rand, weaponsGood).createItemDamaged(60); final LevelBuilder lb = levelBuilders[-1 + Calc.randInt(4, 7)]; lb.addRoom(Rooms.treasure(item), BuildOrder.LAST, true); @@ -87,7 +87,7 @@ public class WorldCreator { for (int level = 1; level <= 7; level++) { final LevelBuilder lb = levelBuilders[level - 1]; - final Range amount = Range.make(1, level+2); + final Range amount = Range.make(level/2D, level*2); for (int i = 0; i < amount.randInt(rand); i++) { lb.addItem(Calc.pick(rand, randomFood).createItem(), false); @@ -140,15 +140,17 @@ public class WorldCreator { lb.addRoom(Rooms.ENTRANCE, BuildOrder.FIRST, true); - lb.addRoom(Rooms.BASIC, Range.make(floor+1, 2 + floor * 1.5), BuildOrder.MIDDLE, false); - lb.addRoom(Rooms.DEAD_END, Range.make(2, 1 + floor*1), BuildOrder.MIDDLE, false); + lb.addRoom(Rooms.BASIC, Range.make(floor/2, 2 + floor), BuildOrder.MIDDLE, false); + lb.addRoom(Rooms.DEAD_END, Range.make(1, floor), BuildOrder.MIDDLE, false); lb.addRoom(Rooms.STORAGE, Range.make(1, Math.ceil(floor / 3D)), BuildOrder.MIDDLE, false); if (lastLevel) lb.addRoom(Rooms.BOSS, BuildOrder.LAST, true); if (!lastLevel) lb.addRoom(Rooms.EXIT, BuildOrder.LAST, true); - final RoomBuilder heartRoom = Rooms.shrine(Items.HEART_PIECE.createItem()); - lb.addRoom(heartRoom, BuildOrder.LAST, true); + if (floor % 2 == 0) { + final RoomBuilder heartRoom = Rooms.shrine(Items.HEART_PIECE.createItem()); + lb.addRoom(heartRoom, BuildOrder.LAST, true); + } return lb; } diff --git a/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java b/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java index 3aa001a..25059d2 100644 --- a/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java +++ b/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java @@ -8,19 +8,33 @@ import mightypork.rogue.world.gen.MapTheme; import mightypork.rogue.world.gen.RoomBuilder; import mightypork.rogue.world.gen.RoomEntry; import mightypork.rogue.world.gen.ScratchMap; +import mightypork.rogue.world.gen.TileProtectLevel; +import mightypork.rogue.world.tile.TileModel; -public class DeadEndRoom implements RoomBuilder { - +public class DeadEndRoom extends AbstractRectRoom { + + @Override + protected Coord getInnerSize(Random rand) + { + return Coord.make(1,1); + } + + @Override + protected TileProtectLevel getWallProtectionLevel() + { + return TileProtectLevel.STRONG; + } + + @Override + protected TileModel getDoorType(MapTheme theme, Random rand) + { + return theme.floor(); + } + @Override - public RoomEntry buildRoom(ScratchMap map, MapTheme theme, Random rand, Coord center) + protected int getDoorCount(Random rand) { - final Coord low = center.add(-1, -1); - final Coord high = center.add(1, 1); - if (!map.isClear(low, high)) return null; - - map.set(center, theme.floor()); - - return new RoomEntry(low, high); + return 1; } } diff --git a/src/mightypork/rogue/world/gen/rooms/SecretRoom.java b/src/mightypork/rogue/world/gen/rooms/SecretRoom.java index e951bc3..cc1dacc 100644 --- a/src/mightypork/rogue/world/gen/rooms/SecretRoom.java +++ b/src/mightypork/rogue/world/gen/rooms/SecretRoom.java @@ -15,7 +15,7 @@ public abstract class SecretRoom extends AbstractRectRoom { @Override protected TileModel getDoorType(MapTheme theme, Random rand) { - return theme.secretDoor(); + return rand.nextInt(5) == 0 ? theme.passage() : theme.secretDoor(); } diff --git a/src/mightypork/rogue/world/gen/rooms/StorageRoom.java b/src/mightypork/rogue/world/gen/rooms/StorageRoom.java index 3c0942b..509256f 100644 --- a/src/mightypork/rogue/world/gen/rooms/StorageRoom.java +++ b/src/mightypork/rogue/world/gen/rooms/StorageRoom.java @@ -15,13 +15,18 @@ public class StorageRoom extends SecretRoom { @Override protected void buildExtras(ScratchMap map, MapTheme theme, Random rand, Coord min, Coord max) { - int maxStuff = Calc.randInt(rand, 2, 5); + int maxStuff = Calc.randInt(rand, 3, 5); for (int i = 0; i < Calc.randInt(rand, 0, 2); i++) { map.addItemInArea(Items.MEAT.createItem(), min, max, 50); if (--maxStuff == 0) return; } + for (int i = 0; i < Calc.randInt(rand, 0, 2); i++) { + map.addItemInArea(Items.CHEESE.createItem(), min, max, 50); + if (--maxStuff == 0) return; + } + for (int i = 0; i < Calc.randInt(rand, 0, 1); i++) { map.addItemInArea(Items.ROCK.createItemDamaged(30), min, max, 50); if (--maxStuff == 0) return; @@ -43,10 +48,5 @@ public class StorageRoom extends SecretRoom { } - for (int i = 0; i < Calc.randInt(rand, 0, 2); i++) { - map.addItemInArea(Items.CHEESE.createItem(), min, max, 50); - if (--maxStuff == 0) return; - } - } }