diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index c597e30..9637290 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.30 +// @version 0.13.31 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.30'; +const VERSION = '0.13.31'; const CFG = { // — Battle automation @@ -1260,8 +1260,10 @@ function strategyAdept() { // 5. Weapon skills — prioritize high-threat monsters (high SP/OC bar) const isHighThreat = hasHighThreat(THREAT_PX); + if (isHighThreat) console.log('%c[HV] ⚠ HIGH THREAT (Adept): 2+ monsters with SP >85%', 'color:#f44'); const skillOC_N = CFG.skillOC || 75; if (STATE.oc >= skillOC_N || isHighThreat) { + if (isHighThreat && STATE.oc < skillOC_N) console.log('%c[HV] ⚠ emergency skill at OC=' + STATE.oc.toFixed(0), 'color:#f80'); // Rending Blow: AoE armor pen vs 5+ enemies (highest priority in Grindfest) if (STATE.monsters.length >= 5 && STATE.skillsKnown.includes('Rending Blow')) { const t = isHighThreat ? findDangerousMonster() : findStrongestMonster(); @@ -1395,9 +1397,11 @@ function strategyVeteran() { // 5. Weapon skills — prioritize high-threat monsters (high SP/OC bar) // If 2+ enemies have >85% SP bar, they're about to special — emergency const isHighThreat = hasHighThreat(THREAT_PX); + if (isHighThreat) console.log('%c[HV] ⚠ HIGH THREAT: 2+ monsters with SP >85%', 'color:#f44'); const askillOC3 = CFG.skillOC || 80; if (STATE.oc >= askillOC3 || isHighThreat) { + if (isHighThreat && STATE.oc < askillOC3) console.log('%c[HV] ⚠ emergency: using skill at OC=' + STATE.oc.toFixed(0), 'color:#f80'); // Emergency: 2+ monsters about to special — spend OC to kill them fast // Rending Blow: AoE armor pen vs 5+ enemies (highest priority in Grindfest) if (STATE.monsters.length >= 5 && STATE.skillsKnown.includes('Rending Blow')) { @@ -1626,11 +1630,24 @@ function setupKeybindings() { console.log('%c[HV] Q pressed — checking action...', 'color:#888'); parseBattleState(); - // Debug: show active buffs and channeling status + // Debug: show full battle state const activeBuffs = Object.entries(STATE.buffs) .filter(([k, v]) => v > 0 && k !== 'regen' || v > 0) .map(([k, v]) => `${k}=${v}`).join(' '); - console.log(`%c[HV] ch=${STATE.channeling} mp=${(STATE.mp*100).toFixed(0)}% oc=${STATE.oc.toFixed(0)} buffs: ${activeBuffs}`, 'color:#888'); + // Monster SP bars (threat levels) + const threatLevels = STATE.monsters.map((m, i) => { + const sp = STATE.monsterSp[i] || 0; + return `${i}:${sp}`; + }).join(' '); + const curMp = parseInt((document.getElementById('vrm') || {}).textContent) || 0; + const curHp = parseInt((document.getElementById('vrhd') || {}).textContent) || 0; + console.log( + `%c[HV] ch=${STATE.channeling} hp=${curHp} mp=${curMp}(${(STATE.mp*100).toFixed(0)}%) ` + + `sp=${(STATE.sp*100).toFixed(0)}% oc=${STATE.oc.toFixed(0)} ` + + `mon:${STATE.monsters.length} ` + + `buffs: ${activeBuffs} | spBars: ${threatLevels}`, + 'color:#888' + ); const a = getRecommendedAction(); if (a) { e.preventDefault(); diff --git a/scripts/latest.user.js b/scripts/latest.user.js index c597e30..9637290 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.30 +// @version 0.13.31 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.30'; +const VERSION = '0.13.31'; const CFG = { // — Battle automation @@ -1260,8 +1260,10 @@ function strategyAdept() { // 5. Weapon skills — prioritize high-threat monsters (high SP/OC bar) const isHighThreat = hasHighThreat(THREAT_PX); + if (isHighThreat) console.log('%c[HV] ⚠ HIGH THREAT (Adept): 2+ monsters with SP >85%', 'color:#f44'); const skillOC_N = CFG.skillOC || 75; if (STATE.oc >= skillOC_N || isHighThreat) { + if (isHighThreat && STATE.oc < skillOC_N) console.log('%c[HV] ⚠ emergency skill at OC=' + STATE.oc.toFixed(0), 'color:#f80'); // Rending Blow: AoE armor pen vs 5+ enemies (highest priority in Grindfest) if (STATE.monsters.length >= 5 && STATE.skillsKnown.includes('Rending Blow')) { const t = isHighThreat ? findDangerousMonster() : findStrongestMonster(); @@ -1395,9 +1397,11 @@ function strategyVeteran() { // 5. Weapon skills — prioritize high-threat monsters (high SP/OC bar) // If 2+ enemies have >85% SP bar, they're about to special — emergency const isHighThreat = hasHighThreat(THREAT_PX); + if (isHighThreat) console.log('%c[HV] ⚠ HIGH THREAT: 2+ monsters with SP >85%', 'color:#f44'); const askillOC3 = CFG.skillOC || 80; if (STATE.oc >= askillOC3 || isHighThreat) { + if (isHighThreat && STATE.oc < askillOC3) console.log('%c[HV] ⚠ emergency: using skill at OC=' + STATE.oc.toFixed(0), 'color:#f80'); // Emergency: 2+ monsters about to special — spend OC to kill them fast // Rending Blow: AoE armor pen vs 5+ enemies (highest priority in Grindfest) if (STATE.monsters.length >= 5 && STATE.skillsKnown.includes('Rending Blow')) { @@ -1626,11 +1630,24 @@ function setupKeybindings() { console.log('%c[HV] Q pressed — checking action...', 'color:#888'); parseBattleState(); - // Debug: show active buffs and channeling status + // Debug: show full battle state const activeBuffs = Object.entries(STATE.buffs) .filter(([k, v]) => v > 0 && k !== 'regen' || v > 0) .map(([k, v]) => `${k}=${v}`).join(' '); - console.log(`%c[HV] ch=${STATE.channeling} mp=${(STATE.mp*100).toFixed(0)}% oc=${STATE.oc.toFixed(0)} buffs: ${activeBuffs}`, 'color:#888'); + // Monster SP bars (threat levels) + const threatLevels = STATE.monsters.map((m, i) => { + const sp = STATE.monsterSp[i] || 0; + return `${i}:${sp}`; + }).join(' '); + const curMp = parseInt((document.getElementById('vrm') || {}).textContent) || 0; + const curHp = parseInt((document.getElementById('vrhd') || {}).textContent) || 0; + console.log( + `%c[HV] ch=${STATE.channeling} hp=${curHp} mp=${curMp}(${(STATE.mp*100).toFixed(0)}%) ` + + `sp=${(STATE.sp*100).toFixed(0)}% oc=${STATE.oc.toFixed(0)} ` + + `mon:${STATE.monsters.length} ` + + `buffs: ${activeBuffs} | spBars: ${threatLevels}`, + 'color:#888' + ); const a = getRecommendedAction(); if (a) { e.preventDefault(); diff --git a/src/config.js b/src/config.js index 4f1b700..eaa0f36 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.30'; +const VERSION = '0.13.31'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index f6985bb..0babdae 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.30 +// @version 0.13.31 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* diff --git a/src/keybindings.js b/src/keybindings.js index 9c8a13f..78e3919 100644 --- a/src/keybindings.js +++ b/src/keybindings.js @@ -30,11 +30,24 @@ function setupKeybindings() { console.log('%c[HV] Q pressed — checking action...', 'color:#888'); parseBattleState(); - // Debug: show active buffs and channeling status + // Debug: show full battle state const activeBuffs = Object.entries(STATE.buffs) .filter(([k, v]) => v > 0 && k !== 'regen' || v > 0) .map(([k, v]) => `${k}=${v}`).join(' '); - console.log(`%c[HV] ch=${STATE.channeling} mp=${(STATE.mp*100).toFixed(0)}% oc=${STATE.oc.toFixed(0)} buffs: ${activeBuffs}`, 'color:#888'); + // Monster SP bars (threat levels) + const threatLevels = STATE.monsters.map((m, i) => { + const sp = STATE.monsterSp[i] || 0; + return `${i}:${sp}`; + }).join(' '); + const curMp = parseInt((document.getElementById('vrm') || {}).textContent) || 0; + const curHp = parseInt((document.getElementById('vrhd') || {}).textContent) || 0; + console.log( + `%c[HV] ch=${STATE.channeling} hp=${curHp} mp=${curMp}(${(STATE.mp*100).toFixed(0)}%) ` + + `sp=${(STATE.sp*100).toFixed(0)}% oc=${STATE.oc.toFixed(0)} ` + + `mon:${STATE.monsters.length} ` + + `buffs: ${activeBuffs} | spBars: ${threatLevels}`, + 'color:#888' + ); const a = getRecommendedAction(); if (a) { e.preventDefault(); diff --git a/src/strategy-engine.js b/src/strategy-engine.js index 56a09f6..19c77ec 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -560,8 +560,10 @@ function strategyAdept() { // 5. Weapon skills — prioritize high-threat monsters (high SP/OC bar) const isHighThreat = hasHighThreat(THREAT_PX); + if (isHighThreat) console.log('%c[HV] ⚠ HIGH THREAT (Adept): 2+ monsters with SP >85%', 'color:#f44'); const skillOC_N = CFG.skillOC || 75; if (STATE.oc >= skillOC_N || isHighThreat) { + if (isHighThreat && STATE.oc < skillOC_N) console.log('%c[HV] ⚠ emergency skill at OC=' + STATE.oc.toFixed(0), 'color:#f80'); // Rending Blow: AoE armor pen vs 5+ enemies (highest priority in Grindfest) if (STATE.monsters.length >= 5 && STATE.skillsKnown.includes('Rending Blow')) { const t = isHighThreat ? findDangerousMonster() : findStrongestMonster(); @@ -695,9 +697,11 @@ function strategyVeteran() { // 5. Weapon skills — prioritize high-threat monsters (high SP/OC bar) // If 2+ enemies have >85% SP bar, they're about to special — emergency const isHighThreat = hasHighThreat(THREAT_PX); + if (isHighThreat) console.log('%c[HV] ⚠ HIGH THREAT: 2+ monsters with SP >85%', 'color:#f44'); const askillOC3 = CFG.skillOC || 80; if (STATE.oc >= askillOC3 || isHighThreat) { + if (isHighThreat && STATE.oc < askillOC3) console.log('%c[HV] ⚠ emergency: using skill at OC=' + STATE.oc.toFixed(0), 'color:#f80'); // Emergency: 2+ monsters about to special — spend OC to kill them fast // Rending Blow: AoE armor pen vs 5+ enemies (highest priority in Grindfest) if (STATE.monsters.length >= 5 && STATE.skillsKnown.includes('Rending Blow')) {