From 59341628bc299dd68e6d05be3e422f495a236846 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 1 Aug 2022 17:43:30 -0400 Subject: [PATCH] v1.4.0: reduced cases where piranha would live in land for a turn --- .../shatteredpixeldungeon/levels/Level.java | 5 +++ .../levels/traps/DistortionTrap.java | 39 +------------------ 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 52dd87fc2..de44d3ca7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -48,6 +48,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bestiary; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogFist; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlowParticle; @@ -1056,6 +1057,10 @@ public abstract class Level implements Bundlable { Door.enter( ch.pos ); } } + + if (ch.isAlive() && ch instanceof Piranha && !water[ch.pos]){ + ch.die(null); + } } //public method for forcing the hard press of a cell. e.g. when an item lands on it diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java index 6f903f9c3..6fc7378fe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java @@ -100,42 +100,8 @@ public class DistortionTrap extends Trap{ for (Integer point : respawnPoints) { summoned++; Mob mob; - switch (summoned){ - case 1: - if (Dungeon.depth != 5 && Random.Int(100) == 0){ - mob = new RatKing(); - break; - } - case 3: case 5 : default: - int floor; - do { - floor = Random.Int(25); - } while( Dungeon.bossLevel(floor)); - mob = Reflection.newInstance(Bestiary.getMobRotation(floor).get(0)); - break; - case 2: - switch (Random.Int(4)){ - case 0: default: - Wraith.spawnAt(point); - continue; //wraiths spawn themselves, no need to do more - case 1: - //yes it's intended that these are likely to die right away - mob = new Piranha(); - break; - case 2: - mob = Mimic.spawnAt(point, new ArrayList<>()); - ((Mimic)mob).stopHiding(); - mob.alignment = Char.Alignment.ENEMY; - break; - case 3: - mob = Statue.random(); - break; - } - break; - case 4: - mob = Reflection.newInstance(Random.element(RARE)); - break; - } + mob = new Piranha(); + if (Char.hasProp(mob, Char.Property.LARGE) && !Dungeon.level.openSpace[point]){ continue; @@ -158,7 +124,6 @@ public class DistortionTrap extends Trap{ t.activate(); } ScrollOfTeleportation.appear(mob, mob.pos); - Dungeon.level.occupyCell(mob); } }