rebalancing, more food,

v5stable
ondra 11 years ago
parent 922f2d67f1
commit bc44c11b60
  1. 6
      src/mightypork/rogue/world/entity/impl/BossRatAi.java
  2. 5
      src/mightypork/rogue/world/entity/impl/EntityBrownRat.java
  3. 1
      src/mightypork/rogue/world/entity/impl/EntityGrayRat.java
  4. 2
      src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java
  5. 16
      src/mightypork/rogue/world/gen/WorldCreator.java
  6. 34
      src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java
  7. 2
      src/mightypork/rogue/world/gen/rooms/SecretRoom.java
  8. 12
      src/mightypork/rogue/world/gen/rooms/StorageRoom.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;
}
}

@ -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
}

@ -32,7 +32,6 @@ public class EntityGrayRat extends Entity {
health.setHealthMax(7);
health.setHealth(Calc.randInt(4, 7));
health.setHitCooldownTime(0.3);
}

@ -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;

@ -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;
}

@ -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;
}
}

@ -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();
}

@ -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;
}
}
}

Loading…
Cancel
Save