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
This commit is contained in:
GaboGG 2026-07-26 13:39:32 -04:00
parent e13b4c5206
commit 37b502aa65
3 changed files with 15 additions and 9 deletions

View file

@ -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,8 +890,12 @@ function findBestChannelingTarget() {
if (candidates.length > 0) {
candidates.sort((a, b) => b.score - a.score);
// 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
// Try elementals first (cheapest), then any spell we know

View file

@ -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,8 +890,12 @@ function findBestChannelingTarget() {
if (candidates.length > 0) {
candidates.sort((a, b) => b.score - a.score);
// 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
// Try elementals first (cheapest), then any spell we know

View file

@ -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,8 +242,12 @@ function findBestChannelingTarget() {
if (candidates.length > 0) {
candidates.sort((a, b) => b.score - a.score);
// 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
// Try elementals first (cheapest), then any spell we know