v0.9.0b: adjusted visual paralysis logic to prevent freeze+para bugs

This commit is contained in:
Evan Debenham 2020-10-14 15:20:02 -04:00
parent 833b182d75
commit 74f6df7b6b
3 changed files with 11 additions and 7 deletions

View File

@ -125,8 +125,13 @@ public class Frost extends FlavourBuff {
@Override @Override
public void fx(boolean on) { public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.FROZEN); if (on) {
else target.sprite.remove(CharSprite.State.FROZEN); target.sprite.add(CharSprite.State.FROZEN);
target.sprite.add(CharSprite.State.PARALYSED);
} else {
target.sprite.remove(CharSprite.State.FROZEN);
if (target.paralysed <= 1) target.sprite.remove(CharSprite.State.FROZEN);
}
} }
@Override @Override

View File

@ -82,8 +82,8 @@ public class Paralysis extends FlavourBuff {
@Override @Override
public void fx(boolean on) { public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.PARALYSED); if (on) target.sprite.add(CharSprite.State.PARALYSED);
else target.sprite.remove(CharSprite.State.PARALYSED); else if (target.paralysed <= 1) target.sprite.remove(CharSprite.State.PARALYSED);
} }
@Override @Override

View File

@ -82,6 +82,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
public enum State { public enum State {
BURNING, LEVITATING, INVISIBLE, PARALYSED, FROZEN, ILLUMINATED, CHILLED, DARKENED, MARKED, HEALING, SHIELDED BURNING, LEVITATING, INVISIBLE, PARALYSED, FROZEN, ILLUMINATED, CHILLED, DARKENED, MARKED, HEALING, SHIELDED
} }
private int stunStates = 0;
protected Animation idle; protected Animation idle;
protected Animation run; protected Animation run;
@ -369,7 +370,6 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
break; break;
case FROZEN: case FROZEN:
iceBlock = IceBlock.freeze( this ); iceBlock = IceBlock.freeze( this );
paused = true;
break; break;
case ILLUMINATED: case ILLUMINATED:
GameScene.effect( light = new TorchHalo( this ) ); GameScene.effect( light = new TorchHalo( this ) );
@ -417,14 +417,13 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
alpha( 1f ); alpha( 1f );
break; break;
case PARALYSED: case PARALYSED:
paused = false; if (iceBlock != null) paused = false;
break; break;
case FROZEN: case FROZEN:
if (iceBlock != null) { if (iceBlock != null) {
iceBlock.melt(); iceBlock.melt();
iceBlock = null; iceBlock = null;
} }
paused = false;
break; break;
case ILLUMINATED: case ILLUMINATED:
if (light != null) { if (light != null) {