diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 9d89d1e..ec45c86 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.16 +// @version 0.13.17 // @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.16'; +const VERSION = '0.13.17'; const CFG = { // — Battle automation @@ -903,7 +903,9 @@ function findBestChannelingTarget() { const sp = findSpell(b.spell); const mpCost = sp ? sp.mp : 0; // Fill level: how empty is this buff relative to its max observed duration - const maxDur = STATE.maxBuffDur[b.icon] || (dur + 10); // fallback if unknown + let maxDur = STATE.maxBuffDur[b.icon] || 0; + // If max matches current (first observation, no learning yet), assume min 30 turns + if (maxDur <= dur) maxDur = Math.max(dur + 1, 30); const emptiness = maxDur > 0 ? Math.min(1, (maxDur - dur) / maxDur) : 1; // Score: emptiness × mp_cost — an empty expensive buff is best const score = emptiness * mpCost; diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 9d89d1e..ec45c86 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.16 +// @version 0.13.17 // @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.16'; +const VERSION = '0.13.17'; const CFG = { // — Battle automation @@ -903,7 +903,9 @@ function findBestChannelingTarget() { const sp = findSpell(b.spell); const mpCost = sp ? sp.mp : 0; // Fill level: how empty is this buff relative to its max observed duration - const maxDur = STATE.maxBuffDur[b.icon] || (dur + 10); // fallback if unknown + let maxDur = STATE.maxBuffDur[b.icon] || 0; + // If max matches current (first observation, no learning yet), assume min 30 turns + if (maxDur <= dur) maxDur = Math.max(dur + 1, 30); const emptiness = maxDur > 0 ? Math.min(1, (maxDur - dur) / maxDur) : 1; // Score: emptiness × mp_cost — an empty expensive buff is best const score = emptiness * mpCost; diff --git a/src/config.js b/src/config.js index dc586d9..c3e785d 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.16'; +const VERSION = '0.13.17'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index 61f5e99..9e955d6 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.16 +// @version 0.13.17 // @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 c5fbbb4..cc20624 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -240,7 +240,9 @@ function findBestChannelingTarget() { const sp = findSpell(b.spell); const mpCost = sp ? sp.mp : 0; // Fill level: how empty is this buff relative to its max observed duration - const maxDur = STATE.maxBuffDur[b.icon] || (dur + 10); // fallback if unknown + let maxDur = STATE.maxBuffDur[b.icon] || 0; + // If max matches current (first observation, no learning yet), assume min 30 turns + if (maxDur <= dur) maxDur = Math.max(dur + 1, 30); const emptiness = maxDur > 0 ? Math.min(1, (maxDur - dur) / maxDur) : 1; // Score: emptiness × mp_cost — an empty expensive buff is best const score = emptiness * mpCost;