From d030edbec74a55cc495927c13a1e9a5e0e9000d6 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 4 May 2019 14:20:27 -0400 Subject: [PATCH] v0.7.3: bugfixes: - fixed prismatic images not properly dieing when falling into chasms - fixed secret room distributions being skewed towards later floors --- .../actors/mobs/npcs/PrismaticImage.java | 9 +++++++-- .../levels/rooms/secret/SecretRoom.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java index 4cb6d9057..bf3aba82d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java @@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.PrismaticSprite; import com.watabou.noosa.audio.Sample; @@ -106,8 +107,12 @@ public class PrismaticImage extends NPC { @Override public void die(Object cause) { if (deathTimer == -1) { - deathTimer = 5; - sprite.add(CharSprite.State.PARALYSED); + if (cause == Chasm.class){ + super.die( cause ); + } else { + deathTimer = 5; + sprite.add(CharSprite.State.PARALYSED); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java index 4faa9f139..6fe710634 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java @@ -82,7 +82,7 @@ public abstract class SecretRoom extends SpecialRoom { if (floorsLeft == 0) { secrets = regionSecretsThisRun[region]; } else { - secrets = regionSecretsThisRun[region] / floorsLeft; + secrets = regionSecretsThisRun[region] / (float)floorsLeft; if (Random.Float() < secrets % 1f){ secrets = (float)Math.ceil(secrets); } else {