diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index daf950f..b633f36 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.22 +// @version 0.13.23 // @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.22'; +const VERSION = '0.13.23'; const CFG = { // — Battle automation @@ -940,8 +940,9 @@ function findBestChannelingTarget() { } // Skip if we can't afford the base cost — game pre-checks even when // channeling makes the effective cost 1 MP - const maxMp = parseInt((document.getElementById('vrhd') || {}).textContent) || 414; - if (mpCost > 0 && (mpCost / maxMp) > STATE.mp) continue; + const curMp = parseInt((document.getElementById('vrm') || {}).textContent) || 0; + const estMaxMp = (STATE.mp > 0 && curMp > 0) ? Math.round(curMp / STATE.mp) : 414; + if (mpCost > 0 && curMp > 0 && mpCost > curMp) continue; // Fill level: how empty is this buff relative to its max observed duration let maxDur = STATE.maxBuffDur[b.icon] || 0; // If max matches current (first observation, no learning yet), assume min 30 turns diff --git a/scripts/latest.user.js b/scripts/latest.user.js index daf950f..b633f36 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.22 +// @version 0.13.23 // @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.22'; +const VERSION = '0.13.23'; const CFG = { // — Battle automation @@ -940,8 +940,9 @@ function findBestChannelingTarget() { } // Skip if we can't afford the base cost — game pre-checks even when // channeling makes the effective cost 1 MP - const maxMp = parseInt((document.getElementById('vrhd') || {}).textContent) || 414; - if (mpCost > 0 && (mpCost / maxMp) > STATE.mp) continue; + const curMp = parseInt((document.getElementById('vrm') || {}).textContent) || 0; + const estMaxMp = (STATE.mp > 0 && curMp > 0) ? Math.round(curMp / STATE.mp) : 414; + if (mpCost > 0 && curMp > 0 && mpCost > curMp) continue; // Fill level: how empty is this buff relative to its max observed duration let maxDur = STATE.maxBuffDur[b.icon] || 0; // If max matches current (first observation, no learning yet), assume min 30 turns diff --git a/src/config.js b/src/config.js index 3e1b810..520e212 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.22'; +const VERSION = '0.13.23'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index c352ef9..63fba9b 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.22 +// @version 0.13.23 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* diff --git a/src/strategy-engine.js b/src/strategy-engine.js index 513c687..2cb8953 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -255,8 +255,9 @@ function findBestChannelingTarget() { } // Skip if we can't afford the base cost — game pre-checks even when // channeling makes the effective cost 1 MP - const maxMp = parseInt((document.getElementById('vrhd') || {}).textContent) || 414; - if (mpCost > 0 && (mpCost / maxMp) > STATE.mp) continue; + const curMp = parseInt((document.getElementById('vrm') || {}).textContent) || 0; + const estMaxMp = (STATE.mp > 0 && curMp > 0) ? Math.round(curMp / STATE.mp) : 414; + if (mpCost > 0 && curMp > 0 && mpCost > curMp) continue; // Fill level: how empty is this buff relative to its max observed duration let maxDur = STATE.maxBuffDur[b.icon] || 0; // If max matches current (first observation, no learning yet), assume min 30 turns