v2.0.2: fixed flail ability triggering ability use even if it fails
This commit is contained in:
@@ -105,23 +105,24 @@ public class Flail extends MeleeWeapon {
|
||||
@Override
|
||||
protected void duelistAbility(Hero hero, Integer target) {
|
||||
|
||||
beforeAbilityUsed(hero);
|
||||
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){
|
||||
spin = Buff.affect(hero, SpinAbilityTracker.class, 3f);
|
||||
}
|
||||
|
||||
if (spin.spins < 3){
|
||||
spin.spins++;
|
||||
Buff.prolong(hero, SpinAbilityTracker.class, 3f);
|
||||
Sample.INSTANCE.play(Assets.Sounds.CHAINS, 1, 1, 0.9f + 0.1f*spin.spins);
|
||||
hero.sprite.operate(hero.pos);
|
||||
hero.spendAndNext(Actor.TICK);
|
||||
BuffIndicator.refreshHero();
|
||||
} else {
|
||||
GLog.w(Messages.get(this, "spin_warn"));
|
||||
}
|
||||
spin.spins++;
|
||||
Buff.prolong(hero, SpinAbilityTracker.class, 3f);
|
||||
Sample.INSTANCE.play(Assets.Sounds.CHAINS, 1, 1, 0.9f + 0.1f*spin.spins);
|
||||
hero.sprite.operate(hero.pos);
|
||||
hero.spendAndNext(Actor.TICK);
|
||||
BuffIndicator.refreshHero();
|
||||
|
||||
afterAbilityUsed(hero);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user