From a90dd47ec0d28c39f17387f331109fa356a046a5 Mon Sep 17 00:00:00 2001 From: GaboGG Date: Wed, 22 Jul 2026 07:11:40 -0400 Subject: [PATCH] Spirit gems: use whenever available, no SP threshold Spirit gems now fire whenever one is slotted regardless of SP level. This keeps SP constantly topped up for: - Spark of Life (costs 50% SP to trigger) - Manual Spirit Stance (costs 1 SP + 10% OC per round) Removed the old SP < 30% threshold check. --- scripts/hv-unified.user.js | 25 +++++++++++-------------- scripts/latest.user.js | 25 +++++++++++-------------- src/strategy-engine.js | 25 +++++++++++-------------- 3 files changed, 33 insertions(+), 42 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index ee142d5..bb8c6a7 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -863,16 +863,15 @@ function strategyNovice() { } } - // 4. Mana/spirit items — AFTER buffs, so we don't waste a potion - // before casting spells + // 4. Mana/spirit items — AFTER buffs if (STATE.mp < CFG.manaGemMP) { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever we have one, regardless of SP + // Keeps SP topped for Spirit Stance and Spark of Life (50% cost) + const spiritItem = hasUsableGem('spirit'); + if (spiritItem) return { type: 'item', id: spiritItem.id, selfTarget: true }; // 5. Spirit Stance at OC 60 — but only if we have SP to sustain it if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10) @@ -978,10 +977,9 @@ function strategyAdept() { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever available (tops SP for Spark + Stance) + const aspiritItem = hasUsableGem('spirit'); + if (aspiritItem) return { type: 'item', id: aspiritItem.id, selfTarget: true }; // 4. Debuffs — only on important fights (rare/boss/ultimate monsters) // In random mob fights, just attack through them @@ -1104,10 +1102,9 @@ function strategyVeteran() { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever available + const vspiritItem = hasUsableGem('spirit'); + if (vspiritItem) return { type: 'item', id: vspiritItem.id, selfTarget: true }; // 4. Debuffs — only on important fights (rare/boss) if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) { diff --git a/scripts/latest.user.js b/scripts/latest.user.js index ee142d5..bb8c6a7 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -863,16 +863,15 @@ function strategyNovice() { } } - // 4. Mana/spirit items — AFTER buffs, so we don't waste a potion - // before casting spells + // 4. Mana/spirit items — AFTER buffs if (STATE.mp < CFG.manaGemMP) { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever we have one, regardless of SP + // Keeps SP topped for Spirit Stance and Spark of Life (50% cost) + const spiritItem = hasUsableGem('spirit'); + if (spiritItem) return { type: 'item', id: spiritItem.id, selfTarget: true }; // 5. Spirit Stance at OC 60 — but only if we have SP to sustain it if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10) @@ -978,10 +977,9 @@ function strategyAdept() { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever available (tops SP for Spark + Stance) + const aspiritItem = hasUsableGem('spirit'); + if (aspiritItem) return { type: 'item', id: aspiritItem.id, selfTarget: true }; // 4. Debuffs — only on important fights (rare/boss/ultimate monsters) // In random mob fights, just attack through them @@ -1104,10 +1102,9 @@ function strategyVeteran() { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever available + const vspiritItem = hasUsableGem('spirit'); + if (vspiritItem) return { type: 'item', id: vspiritItem.id, selfTarget: true }; // 4. Debuffs — only on important fights (rare/boss) if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) { diff --git a/src/strategy-engine.js b/src/strategy-engine.js index 34829b4..5213643 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -218,16 +218,15 @@ function strategyNovice() { } } - // 4. Mana/spirit items — AFTER buffs, so we don't waste a potion - // before casting spells + // 4. Mana/spirit items — AFTER buffs if (STATE.mp < CFG.manaGemMP) { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever we have one, regardless of SP + // Keeps SP topped for Spirit Stance and Spark of Life (50% cost) + const spiritItem = hasUsableGem('spirit'); + if (spiritItem) return { type: 'item', id: spiritItem.id, selfTarget: true }; // 5. Spirit Stance at OC 60 — but only if we have SP to sustain it if (STATE.oc >= 60 && !STATE.spiritStance && STATE.sp > 0.10) @@ -333,10 +332,9 @@ function strategyAdept() { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever available (tops SP for Spark + Stance) + const aspiritItem = hasUsableGem('spirit'); + if (aspiritItem) return { type: 'item', id: aspiritItem.id, selfTarget: true }; // 4. Debuffs — only on important fights (rare/boss/ultimate monsters) // In random mob fights, just attack through them @@ -459,10 +457,9 @@ function strategyVeteran() { const gem = hasUsableGem('mana'); if (gem) return { type: 'item', id: gem.id, selfTarget: true }; } - if (STATE.sp < CFG.spiritPotionSP) { - const gem = hasUsableGem('spirit'); - if (gem) return { type: 'item', id: gem.id, selfTarget: true }; - } + // Spirit gem — use whenever available + const vspiritItem = hasUsableGem('spirit'); + if (vspiritItem) return { type: 'item', id: vspiritItem.id, selfTarget: true }; // 4. Debuffs — only on important fights (rare/boss) if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) {