v0.2.3: damage now more frequently interrupts player movement
This commit is contained in:
@@ -132,11 +132,12 @@ public class Hero extends Char {
|
|||||||
|
|
||||||
private int attackSkill = 10;
|
private int attackSkill = 10;
|
||||||
private int defenseSkill = 5;
|
private int defenseSkill = 5;
|
||||||
|
|
||||||
public boolean ready = false;
|
public boolean ready = false;
|
||||||
public HeroAction curAction = null;
|
private boolean damageInterrupt = true;
|
||||||
|
public HeroAction curAction = null;
|
||||||
public HeroAction lastAction = null;
|
public HeroAction lastAction = null;
|
||||||
|
|
||||||
private Char enemy;
|
private Char enemy;
|
||||||
|
|
||||||
public Armor.Glyph killerGlyph = null;
|
public Armor.Glyph killerGlyph = null;
|
||||||
@@ -478,6 +479,7 @@ public class Hero extends Char {
|
|||||||
private void ready() {
|
private void ready() {
|
||||||
sprite.idle();
|
sprite.idle();
|
||||||
curAction = null;
|
curAction = null;
|
||||||
|
damageInterrupt = true;
|
||||||
ready = true;
|
ready = true;
|
||||||
|
|
||||||
GameScene.ready();
|
GameScene.ready();
|
||||||
@@ -493,6 +495,7 @@ public class Hero extends Char {
|
|||||||
public void resume() {
|
public void resume() {
|
||||||
curAction = lastAction;
|
curAction = lastAction;
|
||||||
lastAction = null;
|
lastAction = null;
|
||||||
|
damageInterrupt = false;
|
||||||
act();
|
act();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -890,6 +893,8 @@ public class Hero extends Char {
|
|||||||
@Override
|
@Override
|
||||||
public void damage( int dmg, Object src ) {
|
public void damage( int dmg, Object src ) {
|
||||||
restoreHealth = false;
|
restoreHealth = false;
|
||||||
|
if (damageInterrupt) interrupt();
|
||||||
|
|
||||||
if (this.buff(Drowsy.class) != null){
|
if (this.buff(Drowsy.class) != null){
|
||||||
Buff.detach(this, Drowsy.class);
|
Buff.detach(this, Drowsy.class);
|
||||||
GLog.w("The pain helps you resist the urge to sleep.");
|
GLog.w("The pain helps you resist the urge to sleep.");
|
||||||
|
|||||||
Reference in New Issue
Block a user