v2.0.2: fixed flail ability triggering ability use even if it fails

This commit is contained in:
Evan Debenham
2023-04-03 15:45:36 -04:00
parent 22790c406e
commit c799475637
@@ -105,23 +105,24 @@ public class Flail extends MeleeWeapon {
@Override @Override
protected void duelistAbility(Hero hero, Integer target) { protected void duelistAbility(Hero hero, Integer target) {
beforeAbilityUsed(hero);
SpinAbilityTracker spin = hero.buff(SpinAbilityTracker.class); SpinAbilityTracker spin = hero.buff(SpinAbilityTracker.class);
if (spin != null && spin.spins >= 3){
GLog.w(Messages.get(this, "spin_warn"));
return;
}
beforeAbilityUsed(hero);
if (spin == null){ if (spin == null){
spin = Buff.affect(hero, SpinAbilityTracker.class, 3f); spin = Buff.affect(hero, SpinAbilityTracker.class, 3f);
} }
if (spin.spins < 3){ spin.spins++;
spin.spins++; Buff.prolong(hero, SpinAbilityTracker.class, 3f);
Buff.prolong(hero, SpinAbilityTracker.class, 3f); Sample.INSTANCE.play(Assets.Sounds.CHAINS, 1, 1, 0.9f + 0.1f*spin.spins);
Sample.INSTANCE.play(Assets.Sounds.CHAINS, 1, 1, 0.9f + 0.1f*spin.spins); hero.sprite.operate(hero.pos);
hero.sprite.operate(hero.pos); hero.spendAndNext(Actor.TICK);
hero.spendAndNext(Actor.TICK); BuffIndicator.refreshHero();
BuffIndicator.refreshHero();
} else {
GLog.w(Messages.get(this, "spin_warn"));
}
afterAbilityUsed(hero); afterAbilityUsed(hero);
} }