From 37b502aa650fe99ad637402c833c5feae82e772e Mon Sep 17 00:00:00 2001 From: GaboGG Date: Sun, 26 Jul 2026 13:39:32 -0400 Subject: [PATCH] v0.13.11 - Score threshold for channeling buff consumption - Reverted the >10 turns cutoff (wrong approach) - Instead, added a minimum score threshold of 5 to the best candidate - At score >= 5: a 50-MP spell with <9 turns, a 140-MP spell with <27 turns - Below score 5: falls through to cheap damage spell fallback - This prevents recasting fresh buffs while still considering all spells --- scripts/hv-unified.user.js | 8 +++++--- scripts/latest.user.js | 8 +++++--- src/strategy-engine.js | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 5b3d9bb..66ec63f 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -881,8 +881,6 @@ function findBestChannelingTarget() { if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue; // Skip completely fresh Heartseeker (> 50 turns means just cast) if (b.icon === 'heartseeker' && dur > 50) continue; - // Only consider buffs that would benefit from a refresh - if (dur > 10) continue; // Still fresh, don't waste channeling const sp = findSpell(b.spell); const mpCost = sp ? sp.mp : 0; // Score: higher MP cost + lower remaining turns = better channeling target @@ -892,7 +890,11 @@ function findBestChannelingTarget() { if (candidates.length > 0) { candidates.sort((a, b) => b.score - a.score); - return { type: 'spell', name: candidates[0].spell, selfTarget: true }; + // Only use a buff if it actually needs refreshing (score >= 5 means + // e.g. a 50-MP spell with <9 turns left or a 140-MP spell with <27 turns) + if (candidates[0].score >= 5) { + return { type: 'spell', name: candidates[0].spell, selfTarget: true }; + } } // Fallback: ANY damage spell rather than waste the charge on basic attack diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 5b3d9bb..66ec63f 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -881,8 +881,6 @@ function findBestChannelingTarget() { if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue; // Skip completely fresh Heartseeker (> 50 turns means just cast) if (b.icon === 'heartseeker' && dur > 50) continue; - // Only consider buffs that would benefit from a refresh - if (dur > 10) continue; // Still fresh, don't waste channeling const sp = findSpell(b.spell); const mpCost = sp ? sp.mp : 0; // Score: higher MP cost + lower remaining turns = better channeling target @@ -892,7 +890,11 @@ function findBestChannelingTarget() { if (candidates.length > 0) { candidates.sort((a, b) => b.score - a.score); - return { type: 'spell', name: candidates[0].spell, selfTarget: true }; + // Only use a buff if it actually needs refreshing (score >= 5 means + // e.g. a 50-MP spell with <9 turns left or a 140-MP spell with <27 turns) + if (candidates[0].score >= 5) { + return { type: 'spell', name: candidates[0].spell, selfTarget: true }; + } } // Fallback: ANY damage spell rather than waste the charge on basic attack diff --git a/src/strategy-engine.js b/src/strategy-engine.js index f7edba8..854c22f 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -233,8 +233,6 @@ function findBestChannelingTarget() { if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue; // Skip completely fresh Heartseeker (> 50 turns means just cast) if (b.icon === 'heartseeker' && dur > 50) continue; - // Only consider buffs that would benefit from a refresh - if (dur > 10) continue; // Still fresh, don't waste channeling const sp = findSpell(b.spell); const mpCost = sp ? sp.mp : 0; // Score: higher MP cost + lower remaining turns = better channeling target @@ -244,7 +242,11 @@ function findBestChannelingTarget() { if (candidates.length > 0) { candidates.sort((a, b) => b.score - a.score); - return { type: 'spell', name: candidates[0].spell, selfTarget: true }; + // Only use a buff if it actually needs refreshing (score >= 5 means + // e.g. a 50-MP spell with <9 turns left or a 140-MP spell with <27 turns) + if (candidates[0].score >= 5) { + return { type: 'spell', name: candidates[0].spell, selfTarget: true }; + } } // Fallback: ANY damage spell rather than waste the charge on basic attack