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);