From 4beb089f3a2dca105f64b53df44351049be2e730 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 24 Mar 2016 19:31:15 -0400 Subject: [PATCH] v0.3.5: Grim Trap bugfixes --- .../shatteredpixeldungeon/levels/traps/GrimTrap.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/GrimTrap.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/GrimTrap.java index 77adac9f1..9492895fa 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/GrimTrap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/GrimTrap.java @@ -65,6 +65,7 @@ public class GrimTrap extends Trap { if (target != null){ final Char finalTarget = target; + final GrimTrap trap = this; MagicMissile.shadow(target.sprite.parent, pos, target.pos, new Callback() { @Override public void call() { @@ -72,21 +73,22 @@ public class GrimTrap extends Trap { if (finalTarget == Dungeon.hero) { //almost kill the player if (((float)finalTarget.HP/finalTarget.HT) >= 0.9f){ - finalTarget.damage((finalTarget.HP-1), this); + finalTarget.damage((finalTarget.HP-1), trap); //kill 'em } else { - finalTarget.damage(finalTarget.HP, this); + finalTarget.damage(finalTarget.HP, trap); } Sample.INSTANCE.play(Assets.SND_CURSED); if (!finalTarget.isAlive()) { - Dungeon.fail( getClass() ); - GLog.n( Messages.get(this, "ondeath") ); + Dungeon.fail( GrimTrap.class ); + GLog.n( Messages.get(GrimTrap.class, "ondeath") ); } } else { finalTarget.damage(finalTarget.HP, this); Sample.INSTANCE.play(Assets.SND_BURNING); } finalTarget.sprite.emitter().burst(ShadowParticle.UP, 10); + if (!finalTarget.isAlive()) finalTarget.next(); } }); } else {