From 86968f531c4b4f47678bb58dd1345dc697a4796e Mon Sep 17 00:00:00 2001 From: GaboGG Date: Sun, 26 Jul 2026 15:16:07 -0400 Subject: [PATCH] v0.13.24 - Fix castInitialBuffs sorting (was most-expensive-first, not cheapest-first) - castInitialBuffs was sorting by mpCost descending (b.mpCost - a.mpCost) - So it picked Spark of Life (70) before Haste (41), defeating the whole purpose of casting cheapest-first to proc channeling - Changed to ascending sort (a.mpCost - b.mpCost): Haste first, then Spark, etc. --- scripts/hv-unified.user.js | 7 ++++--- scripts/latest.user.js | 7 ++++--- src/config.js | 2 +- src/header.user.js | 2 +- src/strategy-engine.js | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index b633f36..e3a8bba 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.23 +// @version 0.13.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.13.23'; +const VERSION = '0.13.24'; const CFG = { // — Battle automation @@ -890,7 +890,8 @@ function kickstartChanneling() { } } if (candidates.length > 0) { - candidates.sort((a, b) => b.mpCost - a.mpCost); + // Cheapest first to maximize channeling proc chance + candidates.sort((a, b) => a.mpCost - b.mpCost); return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } } diff --git a/scripts/latest.user.js b/scripts/latest.user.js index b633f36..e3a8bba 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.23 +// @version 0.13.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.13.23'; +const VERSION = '0.13.24'; const CFG = { // — Battle automation @@ -890,7 +890,8 @@ function kickstartChanneling() { } } if (candidates.length > 0) { - candidates.sort((a, b) => b.mpCost - a.mpCost); + // Cheapest first to maximize channeling proc chance + candidates.sort((a, b) => a.mpCost - b.mpCost); return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } } diff --git a/src/config.js b/src/config.js index 520e212..b829d83 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.23'; +const VERSION = '0.13.24'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index 63fba9b..1bd55c6 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.23 +// @version 0.13.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 2cb8953..3d12a82 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -205,7 +205,8 @@ function kickstartChanneling() { } } if (candidates.length > 0) { - candidates.sort((a, b) => b.mpCost - a.mpCost); + // Cheapest first to maximize channeling proc chance + candidates.sort((a, b) => a.mpCost - b.mpCost); return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } }