diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 33d730c..5171948 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -708,16 +708,14 @@ function isRareMonster(idx) { // Boss/rare monsters have distinct visual cues: // 1. Gold border: style="border-color:#BD7400" // 2. Gold background on label: style="background:#E6CCA3" - // 3. SP bar present (third btm5 child with nbarred.png) + // NOTE: At high levels/difficulties, normal monsters also get SP bars, + // so we can't use nbarred.png as a boss indicator anymore. const style = m.getAttribute('style') || ''; const inner = m.innerHTML || ''; - // Check for gold border (boss indicator) + // Check for gold border (boss indicator — still reliable) if (style.includes('BD7400') || style.includes('E6CCA3')) return true; - // Check for SP bar (only bosses have all 3 bars: HP, MP, SP) - if (inner.includes('nbarred.png')) return true; - // Fallback: check name from DOM const n = m.querySelector('.btm3'); if (!n) return false; @@ -1006,9 +1004,10 @@ function strategyAdept() { } } - // 4. Debuffs — only on important fights (rare/boss/ultimate monsters) - // In random mob fights, just attack through them - if (anyRareMonster() || STATE.monsters.length <= 2) { + // 4. Debuffs — only on actual boss fights (gold border style) + // At high levels/difficulties, all monsters have SP bars, so + // we only debuff when a gold-bordered rare/boss is present. + if (anyRareMonster()) { if (hasSpell('Imperil')) { const b = findStrongestMonster(); if (b >= 0 && !checkMonsterDebuff(b, 'imperil')) @@ -1142,8 +1141,8 @@ function strategyVeteran() { } } - // 4. Debuffs — only on important fights (rare/boss) - if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) { + // 4. Debuffs — only on actual boss fights (gold border) + if (CFG.autoDebuff && STATE.mp > 0.2 && anyRareMonster()) { if (hasSpell('Imperil')) { const b = findStrongestMonster(); if (b >= 0 && !checkMonsterDebuff(b, 'imperil')) diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 33d730c..5171948 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -708,16 +708,14 @@ function isRareMonster(idx) { // Boss/rare monsters have distinct visual cues: // 1. Gold border: style="border-color:#BD7400" // 2. Gold background on label: style="background:#E6CCA3" - // 3. SP bar present (third btm5 child with nbarred.png) + // NOTE: At high levels/difficulties, normal monsters also get SP bars, + // so we can't use nbarred.png as a boss indicator anymore. const style = m.getAttribute('style') || ''; const inner = m.innerHTML || ''; - // Check for gold border (boss indicator) + // Check for gold border (boss indicator — still reliable) if (style.includes('BD7400') || style.includes('E6CCA3')) return true; - // Check for SP bar (only bosses have all 3 bars: HP, MP, SP) - if (inner.includes('nbarred.png')) return true; - // Fallback: check name from DOM const n = m.querySelector('.btm3'); if (!n) return false; @@ -1006,9 +1004,10 @@ function strategyAdept() { } } - // 4. Debuffs — only on important fights (rare/boss/ultimate monsters) - // In random mob fights, just attack through them - if (anyRareMonster() || STATE.monsters.length <= 2) { + // 4. Debuffs — only on actual boss fights (gold border style) + // At high levels/difficulties, all monsters have SP bars, so + // we only debuff when a gold-bordered rare/boss is present. + if (anyRareMonster()) { if (hasSpell('Imperil')) { const b = findStrongestMonster(); if (b >= 0 && !checkMonsterDebuff(b, 'imperil')) @@ -1142,8 +1141,8 @@ function strategyVeteran() { } } - // 4. Debuffs — only on important fights (rare/boss) - if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) { + // 4. Debuffs — only on actual boss fights (gold border) + if (CFG.autoDebuff && STATE.mp > 0.2 && anyRareMonster()) { if (hasSpell('Imperil')) { const b = findStrongestMonster(); if (b >= 0 && !checkMonsterDebuff(b, 'imperil')) diff --git a/src/strategy-engine.js b/src/strategy-engine.js index 4afde98..9e37c72 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -63,16 +63,14 @@ function isRareMonster(idx) { // Boss/rare monsters have distinct visual cues: // 1. Gold border: style="border-color:#BD7400" // 2. Gold background on label: style="background:#E6CCA3" - // 3. SP bar present (third btm5 child with nbarred.png) + // NOTE: At high levels/difficulties, normal monsters also get SP bars, + // so we can't use nbarred.png as a boss indicator anymore. const style = m.getAttribute('style') || ''; const inner = m.innerHTML || ''; - // Check for gold border (boss indicator) + // Check for gold border (boss indicator — still reliable) if (style.includes('BD7400') || style.includes('E6CCA3')) return true; - // Check for SP bar (only bosses have all 3 bars: HP, MP, SP) - if (inner.includes('nbarred.png')) return true; - // Fallback: check name from DOM const n = m.querySelector('.btm3'); if (!n) return false; @@ -361,9 +359,10 @@ function strategyAdept() { } } - // 4. Debuffs — only on important fights (rare/boss/ultimate monsters) - // In random mob fights, just attack through them - if (anyRareMonster() || STATE.monsters.length <= 2) { + // 4. Debuffs — only on actual boss fights (gold border style) + // At high levels/difficulties, all monsters have SP bars, so + // we only debuff when a gold-bordered rare/boss is present. + if (anyRareMonster()) { if (hasSpell('Imperil')) { const b = findStrongestMonster(); if (b >= 0 && !checkMonsterDebuff(b, 'imperil')) @@ -497,8 +496,8 @@ function strategyVeteran() { } } - // 4. Debuffs — only on important fights (rare/boss) - if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) { + // 4. Debuffs — only on actual boss fights (gold border) + if (CFG.autoDebuff && STATE.mp > 0.2 && anyRareMonster()) { if (hasSpell('Imperil')) { const b = findStrongestMonster(); if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))