v1.4.0: fixed various visual errors with stacking barrier buffs

This commit is contained in:
Evan Debenham
2022-09-20 13:35:26 -04:00
parent aa3a56c083
commit 7f9ef66525
2 changed files with 10 additions and 3 deletions

View File

@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blocking;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -68,8 +69,11 @@ public class Barrier extends ShieldBuff {
@Override
public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.SHIELDED);
else target.sprite.remove(CharSprite.State.SHIELDED);
if (on) {
target.sprite.add(CharSprite.State.SHIELDED);
} else if (target.buff(Blocking.BlockBuff.class) == null) {
target.sprite.remove(CharSprite.State.SHIELDED);
}
}
@Override

View File

@@ -401,7 +401,10 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
healing.pour(Speck.factory(Speck.HEALING), 0.5f);
break;
case SHIELDED:
GameScene.effect( shield = new ShieldHalo( this ));
if (shield != null) {
shield.killAndErase();
}
GameScene.effect(shield = new ShieldHalo(this));
break;
case HEARTS:
hearts = emitter();