From f81f32297e071cb5d98ae7efff3f9556968b7897 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 29 Aug 2024 14:27:27 -0400 Subject: [PATCH] v2.5.0: flying mobs now visually fall into chasms if they die on them --- .../shatteredpixel/shatteredpixeldungeon/actors/Char.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index ab3b7bbf4..f0b9e9665 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -127,6 +127,7 @@ import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; import com.shatteredpixel.shatteredpixeldungeon.plants.Swiftthistle; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.MobSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.BArray; @@ -893,7 +894,12 @@ public abstract class Char extends Actor { public void die( Object src ) { destroy(); - if (src != Chasm.class) sprite.die(); + if (src != Chasm.class) { + sprite.die(); + if (flying && Dungeon.level != null && sprite instanceof MobSprite && Dungeon.level.map[pos] == Terrain.CHASM){ + ((MobSprite) sprite).fall(); + } + } } //we cache this info to prevent having to call buff(...) in isAlive.