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.
This commit is contained in:
GaboGG 2026-07-26 15:16:07 -04:00
parent 0aa268b3f9
commit 86968f531c
5 changed files with 12 additions and 9 deletions

View file

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name HV Unified // @name HV Unified
// @namespace hvunified // @namespace hvunified
// @version 0.13.23 // @version 0.13.24
// @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse
// @author GaboGG + Hermes // @author GaboGG + Hermes
// @match *://*.hentaiverse.org/* // @match *://*.hentaiverse.org/*
@ -17,7 +17,7 @@
// CONFIG — default settings // CONFIG — default settings
// ═══════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════
const VERSION = '0.13.23'; const VERSION = '0.13.24';
const CFG = { const CFG = {
// — Battle automation // — Battle automation
@ -890,7 +890,8 @@ function kickstartChanneling() {
} }
} }
if (candidates.length > 0) { 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 }; return { type: 'spell', name: candidates[0].spell, selfTarget: true };
} }
} }

View file

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name HV Unified // @name HV Unified
// @namespace hvunified // @namespace hvunified
// @version 0.13.23 // @version 0.13.24
// @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse
// @author GaboGG + Hermes // @author GaboGG + Hermes
// @match *://*.hentaiverse.org/* // @match *://*.hentaiverse.org/*
@ -17,7 +17,7 @@
// CONFIG — default settings // CONFIG — default settings
// ═══════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════
const VERSION = '0.13.23'; const VERSION = '0.13.24';
const CFG = { const CFG = {
// — Battle automation // — Battle automation
@ -890,7 +890,8 @@ function kickstartChanneling() {
} }
} }
if (candidates.length > 0) { 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 }; return { type: 'spell', name: candidates[0].spell, selfTarget: true };
} }
} }

View file

@ -2,7 +2,7 @@
// CONFIG — default settings // CONFIG — default settings
// ═══════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════
const VERSION = '0.13.23'; const VERSION = '0.13.24';
const CFG = { const CFG = {
// — Battle automation // — Battle automation

View file

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name HV Unified // @name HV Unified
// @namespace hvunified // @namespace hvunified
// @version 0.13.23 // @version 0.13.24
// @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse
// @author GaboGG + Hermes // @author GaboGG + Hermes
// @match *://*.hentaiverse.org/* // @match *://*.hentaiverse.org/*

View file

@ -205,7 +205,8 @@ function kickstartChanneling() {
} }
} }
if (candidates.length > 0) { 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 }; return { type: 'spell', name: candidates[0].spell, selfTarget: true };
} }
} }