diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 5ea7f06..c50bc6e 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -1006,11 +1006,16 @@ function strategyAdept() { } } - // 6. Spirit Stance at OC 60 — but only if we have SP to sustain it - if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10) + // 6. Spirit Stance at OC 60 — with cooldown to prevent flip-flopping + if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10 && !STATE._spiritCooldown) { + STATE._spiritCooldown = 3; return { type: 'toggle_spirit' }; - if (STATE.sp < 0.03 && STATE.spiritStance) + } + if (STATE.sp < 0.03 && STATE.spiritStance && !STATE._spiritCooldown) { + STATE._spiritCooldown = 3; return { type: 'toggle_spirit' }; + } + if (STATE._spiritCooldown > 0) STATE._spiritCooldown--; // 7. Damage spells const dmg = CFG.useAttackSpells ? getBestDamageSpell() : null; diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 5ea7f06..c50bc6e 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1006,11 +1006,16 @@ function strategyAdept() { } } - // 6. Spirit Stance at OC 60 — but only if we have SP to sustain it - if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10) + // 6. Spirit Stance at OC 60 — with cooldown to prevent flip-flopping + if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10 && !STATE._spiritCooldown) { + STATE._spiritCooldown = 3; return { type: 'toggle_spirit' }; - if (STATE.sp < 0.03 && STATE.spiritStance) + } + if (STATE.sp < 0.03 && STATE.spiritStance && !STATE._spiritCooldown) { + STATE._spiritCooldown = 3; return { type: 'toggle_spirit' }; + } + if (STATE._spiritCooldown > 0) STATE._spiritCooldown--; // 7. Damage spells const dmg = CFG.useAttackSpells ? getBestDamageSpell() : null; diff --git a/src/strategy-engine.js b/src/strategy-engine.js index a313487..d879721 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -363,11 +363,16 @@ function strategyAdept() { } } - // 6. Spirit Stance at OC 60 — but only if we have SP to sustain it - if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10) + // 6. Spirit Stance at OC 60 — with cooldown to prevent flip-flopping + if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10 && !STATE._spiritCooldown) { + STATE._spiritCooldown = 3; return { type: 'toggle_spirit' }; - if (STATE.sp < 0.03 && STATE.spiritStance) + } + if (STATE.sp < 0.03 && STATE.spiritStance && !STATE._spiritCooldown) { + STATE._spiritCooldown = 3; return { type: 'toggle_spirit' }; + } + if (STATE._spiritCooldown > 0) STATE._spiritCooldown--; // 7. Damage spells const dmg = CFG.useAttackSpells ? getBestDamageSpell() : null;