Honour the effective windup instead of the raw field

start() and tick() compared against the raw windUpTicks, but when the windup is
synced to an animation the value that applies comes from getWindUpTicks(). An
ability configured that way skipped its windup entirely and fired on the first
tick. The telegraph duration used the raw field too, so it disagreed with the
phase it was meant to cover.
This commit is contained in:
KAMKEEL committed 2026-08-11 05:01:50 -04:00
1 parent 677d50fa03
commit 71bb4b451e
1 file changed
+7 -4
@@ -1050,10 +1050,11 @@ public abstract class Ability implements IAbility, IAbilityAction {
return null;
}
telegraph.setDurationTicks(windUpTicks);
int windUp = getWindUpTicks();
telegraph.setDurationTicks(windUp);
telegraph.setColor(windUpColor);
telegraph.setWarningColor(activeColor);
telegraph.setWarningStartTick(Math.max(5, windUpTicks / 4));
telegraph.setWarningStartTick(Math.max(5, windUp / 4));
telegraph.setHeightOffset(telegraphHeightOffset);
TelegraphInstance instance = new TelegraphInstance(telegraph, x, y, z, yaw);
@@ -1171,7 +1172,9 @@ public abstract class Ability implements IAbility, IAbilityAction {
this.burstIndex = 0;
this.burstEntities.clear();
if (windUpTicks <= 0) {
// Use the effective windup, not the raw field: when the windup is synced to an
// animation the raw field is not the duration that actually applies.
if (getWindUpTicks() <= 0) {
this.phase = AbilityPhase.ACTIVE;
} else {
this.phase = AbilityPhase.WINDUP;
@@ -1193,7 +1196,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
switch (phase) {
case WINDUP:
if (currentTick >= windUpTicks) {
if (currentTick >= getWindUpTicks()) {
phase = AbilityPhase.ACTIVE;
currentTick = 0;
return true;