balancing, tweaks

v5stable
ondra 11 years ago
parent f27e9884d2
commit 922f2d67f1
  1. 9
      src/mightypork/gamecore/gui/screens/ScreenRegistry.java
  2. 2
      src/mightypork/rogue/world/entity/impl/BrownRatAi.java
  3. 4
      src/mightypork/rogue/world/entity/impl/EntityBrownRat.java
  4. 4
      src/mightypork/rogue/world/entity/impl/EntityGrayRat.java
  5. 2
      src/mightypork/rogue/world/entity/impl/GrayRatAi.java
  6. 40
      src/mightypork/rogue/world/gen/WorldCreator.java
  7. 2
      src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java
  8. 20
      src/mightypork/rogue/world/gen/rooms/StorageRoom.java

@ -83,6 +83,9 @@ public class ScreenRegistry extends AppModule implements ScreenRequestListener,
toShow.setActive(true);
active = toShow;
// update layout for screen
fireLayoutUpdateEvent();
}
@ -109,6 +112,12 @@ public class ScreenRegistry extends AppModule implements ScreenRequestListener,
@Override
public void onViewportChanged(ViewportChangeEvent event)
{
fireLayoutUpdateEvent();
}
private void fireLayoutUpdateEvent()
{
getEventBus().sendDirectToChildren(this, new LayoutChangeEvent());
}

@ -26,7 +26,7 @@ public class BrownRatAi extends GrayRatAi {
@Override
protected int getAttackStrength()
{
return Calc.randInt(1, 4);
return Calc.randInt(2, 4);
}

@ -30,8 +30,8 @@ public class EntityBrownRat extends Entity {
setDespawnDelay(1);
health.setHealthMax(16);
health.setHealth(Calc.randInt(10, 16)); // tougher to kill
health.setHealthMax(18);
health.setHealth(Calc.randInt(12, 18)); // tougher to kill
health.setHitCooldownTime(0.35); // a bit longer than gray rat
}

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

@ -47,6 +47,6 @@ public class GrayRatAi extends MonsterAi {
@Override
protected double getStepTime()
{
return isIdle() ? 0.7 : 0.5;
return isIdle() ? 0.7 : 0.34;
}
}

@ -53,39 +53,33 @@ public class WorldCreator {
weaponsBasic.add(Items.BONE);
weaponsBasic.add(Items.TWIG);
final List<ItemModel> weaponsMedium = new ArrayList<>();
weaponsMedium.add(Items.CLUB);
weaponsMedium.add(Items.KNIFE);
final List<ItemModel> weaponsGood = new ArrayList<>();
weaponsGood.add(Items.AXE);
weaponsGood.add(Items.SWORD);
weaponsGood.add(Items.KNIFE);
for (int i = 0; i < Calc.randInt(rand, 8, 13); i++) {
final Item item = Calc.pick(rand, weaponsBasic).createItemDamaged(50);
for (int i = 0; i < Calc.randInt(rand, 12, 20); i++) {
final Item item = Calc.pick(rand, weaponsBasic).createItemDamaged(40);
final LevelBuilder lb = levelBuilders[-1 + Calc.randInt(1, 7)];
lb.addItem(item, false);
}
for (int i = 0; i < Calc.randInt(rand, 1, 2); i++) {
final Item item = Calc.pick(rand, weaponsMedium).createItemDamaged(60);
final LevelBuilder lb = levelBuilders[-1 + Calc.randInt(1, 3)];
lb.addItem(item, false);
for (int i = 0; i < Calc.randInt(rand, 2, 4); i++) {
final Item item = Calc.pick(rand, weaponsMedium).createItemDamaged(40);
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 LevelBuilder lb = levelBuilders[-1 + Calc.randInt(4, 7)];
for (int i = 0; i < Calc.randInt(rand, 2, 3); i++) {
final Item item = Calc.pick(rand, weaponsGood).createItemDamaged(60);
final LevelBuilder lb = levelBuilders[-1 + Calc.randInt(3, 7)];
lb.addRoom(Rooms.treasure(item), BuildOrder.MIDDLE, true);
lb.addRoom(Rooms.treasure(item), BuildOrder.LAST, true);
}
// place random foods
final List<ItemModel> randomFood = new ArrayList<>();
randomFood.add(Items.CHEESE);
@ -93,14 +87,13 @@ public class WorldCreator {
for (int level = 1; level <= 7; level++) {
final LevelBuilder lb = levelBuilders[level - 1];
final Range amount = Range.make(1, level);
final Range amount = Range.make(1, level+2);
for (int i = 0; i < amount.randInt(rand); i++) {
lb.addItem(Calc.pick(rand, randomFood).createItem(), false);
}
}
// place monsters
Log.f3("Placing monsters...");
@ -108,12 +101,12 @@ public class WorldCreator {
final LevelBuilder lb = levelBuilders[level - 1];
final Range amount = Range.make(2 + level * 2, 5 + level * 3.5);
final Range amount = Range.make(3 + (level) * 2, 3 + level * 3);
for (int i = 0; i < amount.randInt(rand); i++) {
Entity e;
if (level > 2 && rand.nextInt(7 - level + 1) == 0) {
if (level >= 2 && Calc.randInt(rand, 0, (int) (3.5 - (level / 2D))) == 0) {
e = Entities.RAT_BROWN.createEntity();
} else {
e = Entities.RAT_GRAY.createEntity();
@ -123,7 +116,6 @@ public class WorldCreator {
}
}
// compile levels
Log.f3("Building levels...");
int i = 1;
@ -148,8 +140,8 @@ public class WorldCreator {
lb.addRoom(Rooms.ENTRANCE, BuildOrder.FIRST, true);
lb.addRoom(Rooms.BASIC, Range.make(1 + floor, 1 + floor * 1.5), BuildOrder.MIDDLE, false);
lb.addRoom(Rooms.DEAD_END, Range.make(0, 1 + floor), BuildOrder.MIDDLE, false);
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.STORAGE, Range.make(1, Math.ceil(floor / 3D)), BuildOrder.MIDDLE, false);
if (lastLevel) lb.addRoom(Rooms.BOSS, BuildOrder.LAST, true);

@ -16,7 +16,7 @@ public class DeadEndRoom implements RoomBuilder {
public RoomEntry buildRoom(ScratchMap map, MapTheme theme, Random rand, Coord center)
{
final Coord low = center.add(-1, -1);
final Coord high = center;
final Coord high = center.add(1, 1);
if (!map.isClear(low, high)) return null;
map.set(center, theme.floor());

@ -15,7 +15,17 @@ public class StorageRoom extends SecretRoom {
@Override
protected void buildExtras(ScratchMap map, MapTheme theme, Random rand, Coord min, Coord max)
{
int maxStuff = 4;
int maxStuff = Calc.randInt(rand, 2, 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, 1); i++) {
map.addItemInArea(Items.ROCK.createItemDamaged(30), min, max, 50);
if (--maxStuff == 0) return;
}
for (int i = 0; i < Calc.randInt(rand, 0, 1); i++) {
map.addItemInArea(Items.SANDWICH.createItem(), min, max, 50);
@ -32,19 +42,11 @@ public class StorageRoom extends SecretRoom {
if (--maxStuff == 0) return;
}
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;
}
}
}

Loading…
Cancel
Save