From dd29262806bc3e159efb4c76391729d53f69db2a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 29 Nov 2014 15:14:56 -0500 Subject: [PATCH] v0.2.3: damage now more frequently interrupts player movement --- .../shatteredpixeldungeon/actors/hero/Hero.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 2f491b757..c6283879c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -132,11 +132,12 @@ public class Hero extends Char { private int attackSkill = 10; private int defenseSkill = 5; - + public boolean ready = false; - public HeroAction curAction = null; + private boolean damageInterrupt = true; + public HeroAction curAction = null; public HeroAction lastAction = null; - + private Char enemy; public Armor.Glyph killerGlyph = null; @@ -478,6 +479,7 @@ public class Hero extends Char { private void ready() { sprite.idle(); curAction = null; + damageInterrupt = true; ready = true; GameScene.ready(); @@ -493,6 +495,7 @@ public class Hero extends Char { public void resume() { curAction = lastAction; lastAction = null; + damageInterrupt = false; act(); } @@ -890,6 +893,8 @@ public class Hero extends Char { @Override public void damage( int dmg, Object src ) { restoreHealth = false; + if (damageInterrupt) interrupt(); + if (this.buff(Drowsy.class) != null){ Buff.detach(this, Drowsy.class); GLog.w("The pain helps you resist the urge to sleep.");