From 7c714eb589131b3971f169e74370fb12485e6aa7 Mon Sep 17 00:00:00 2001 From: GaboGG Date: Tue, 28 Jul 2026 09:19:22 -0400 Subject: [PATCH] v0.14.24 - Fix spirit burst toggle-off (was stuck ON after Rending Blow killed <7 mobs) - The toggle-off (state 2 -> OFF) was inside the monsters.length >= 7 check - If Rending Blow killed enough enemies to drop below 7, the else block reset _spiritForSkill = 0 without toggling spirit off, leaving it ON - Now toggle-off guard runs independently of monster count - Also resets flag if spirit gets toggled externally --- scripts/hv-unified.user.js | 13 +++++++++---- scripts/latest.user.js | 13 +++++++++---- src/config.js | 2 +- src/header.user.js | 2 +- src/strategy-engine.js | 9 +++++++-- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 40fc5b5..ae831e8 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.14.23 +// @version 0.14.24 // @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.14.23'; +const VERSION = '0.14.24'; const CFG = { // — Battle automation @@ -1462,9 +1462,14 @@ function strategyVeteran() { STATE._spiritForSkill = 1; return { type: 'toggle_spirit', _reason: 'spirit_on_7' }; } - } else { - STATE._spiritForSkill = 0; } + // Toggle-off guard: if flag says skill was cast, toggle off even if mob count dropped + if (STATE._spiritForSkill === 2 && STATE.spiritStance) { + STATE._spiritForSkill = 0; + return { type: 'toggle_spirit', _reason: 'spirit_off_7' }; + } + // Reset flag if spirit got turned off externally + if (!STATE.spiritStance) STATE._spiritForSkill = 0; // 0e. HIGH-THREAT WEAPON SKILLS — after survival items/cure const SINGLE_THREAT = Math.round(120 * 90 / 100); diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 40fc5b5..ae831e8 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.23 +// @version 0.14.24 // @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.14.23'; +const VERSION = '0.14.24'; const CFG = { // — Battle automation @@ -1462,9 +1462,14 @@ function strategyVeteran() { STATE._spiritForSkill = 1; return { type: 'toggle_spirit', _reason: 'spirit_on_7' }; } - } else { - STATE._spiritForSkill = 0; } + // Toggle-off guard: if flag says skill was cast, toggle off even if mob count dropped + if (STATE._spiritForSkill === 2 && STATE.spiritStance) { + STATE._spiritForSkill = 0; + return { type: 'toggle_spirit', _reason: 'spirit_off_7' }; + } + // Reset flag if spirit got turned off externally + if (!STATE.spiritStance) STATE._spiritForSkill = 0; // 0e. HIGH-THREAT WEAPON SKILLS — after survival items/cure const SINGLE_THREAT = Math.round(120 * 90 / 100); diff --git a/src/config.js b/src/config.js index 395c3da..70a56db 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.23'; +const VERSION = '0.14.24'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index ab3a1b2..cf0bf36 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.23 +// @version 0.14.24 // @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 a538db3..c4dc54e 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -736,9 +736,14 @@ function strategyVeteran() { STATE._spiritForSkill = 1; return { type: 'toggle_spirit', _reason: 'spirit_on_7' }; } - } else { - STATE._spiritForSkill = 0; } + // Toggle-off guard: if flag says skill was cast, toggle off even if mob count dropped + if (STATE._spiritForSkill === 2 && STATE.spiritStance) { + STATE._spiritForSkill = 0; + return { type: 'toggle_spirit', _reason: 'spirit_off_7' }; + } + // Reset flag if spirit got turned off externally + if (!STATE.spiritStance) STATE._spiritForSkill = 0; // 0e. HIGH-THREAT WEAPON SKILLS — after survival items/cure const SINGLE_THREAT = Math.round(120 * 90 / 100);