v2.0.2: fixed monk's meditate resistance persisting longer than intended

This commit is contained in:
Evan Debenham
2023-04-03 16:20:25 -04:00
parent 59a953c648
commit 61fa0543a9
@@ -602,22 +602,27 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
} }
} }
//we process this as 5x wait actions instead of one 5 tick action to prevent
// effects like time freeze from eating the whole action duration
for (int i = 0; i < 5; i++) hero.spendConstant(Actor.TICK);
if (Buff.affect(hero, MonkEnergy.class).abilitiesEmpowered(hero)){ if (Buff.affect(hero, MonkEnergy.class).abilitiesEmpowered(hero)){
int toHeal = Math.round((hero.HT - hero.HP)/5f); int toHeal = Math.round((hero.HT - hero.HP)/5f);
if (toHeal > 0) { if (toHeal > 0) {
Buff.affect(hero, Healing.class).setHeal(toHeal, 0, 1); Buff.affect(hero, Healing.class).setHeal(toHeal, 0, 1);
} }
Buff.affect(hero, MeditateResistance.class, 5f); Buff.affect(hero, MeditateResistance.class, hero.cooldown());
} }
//we process this as 5x wait actions instead of one 5 tick action to prevent
// effects like time freeze from eating the whole action duration
for (int i = 0; i < 5; i++) hero.spendConstant(Actor.TICK);
hero.next(); hero.next();
Buff.affect(hero, MonkEnergy.class).abilityUsed(this); Buff.affect(hero, MonkEnergy.class).abilityUsed(this);
} }
public static class MeditateResistance extends FlavourBuff{}; public static class MeditateResistance extends FlavourBuff{
{
actPriority = HERO_PRIO+1; //ends just before the hero acts
}
};
} }
} }