v0.14.18 - Spirit Stance burst toggle for 7+ mob Rending Blow

- When 7+ enemies and OC >= 60: toggles Spirit Stance ON before casting
  Rending Blow, then toggles OFF after one skill
- Uses 3-state flag: press1=toggleON, press2=castSkill, press3=toggleOFF
- Only triggers on normal (non-panic) Rending Blow — step 0e emergency
  skill still fires without spirit to avoid delay
- Resets on battle init and when conditions change
This commit is contained in:
GaboGG 2026-07-27 20:14:21 -04:00
parent f2f296274c
commit 94ab29a82c
7 changed files with 93 additions and 15 deletions

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name HV Unified
// @namespace hvunified
// @version 0.14.17
// @version 0.14.18
// @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.17';
const VERSION = '0.14.18';
const CFG = {
// — Battle automation
@ -78,7 +78,8 @@ const STATE = {
battleInitialized: false,
_mysticUsed: false, // Track if Mystic Gem has been used this battle
_lastActionTime: 0, // Timestamp of last dispatched action (for Q debounce)
_lastActionTime: 0,
_spiritForSkill: 0, // 3-state flag for burst spirit toggle (0=off, 1=toggle-on, 2=cast-done) // Timestamp of last dispatched action (for Q debounce)
_baseMpCosts: {}, // Cached base MP costs for buff spells (read from magic pane at battle start)
@ -1427,8 +1428,32 @@ function strategyVeteran() {
if (STATE.spiritStance && STATE.sp < 0.60) {
return { type: 'toggle_spirit', _reason: 'sp_safety' };
}
// 0d. HIGH-THREAT WEAPON SKILLS — before buffs/items/debuffs
// 0d. Spirit Stance for burst clear — toggle on for 7+ mob, off after one skill
// 3-state flag: 0=normal, 1=toggle-on sent, 2=skill-cast done (toggle-off pending)
const is2H = STATE.skillsKnown.includes('Great Cleave') || STATE.skillsKnown.includes('Rending Blow');
if (is2H && STATE.monsters && STATE.monsters.length >= 7 && STATE.oc >= (CFG.skillOC || 60)) {
if (STATE._spiritForSkill >= 1 && STATE.spiritStance) {
// Spirit is on for our burst — advance state and let weapon skills fire
if (STATE._spiritForSkill === 1) {
// First press with spirit on — just let weapon skills fire
STATE._spiritForSkill = 2;
} else if (STATE._spiritForSkill === 2) {
// Skill was already cast — toggle off now
STATE._spiritForSkill = 0;
return { type: 'toggle_spirit', _reason: 'spirit_off_7' };
}
} else if (!STATE.spiritStance && STATE._spiritForSkill === 0) {
// Toggle on first, mark to toggle off after skill
STATE._spiritForSkill = 1;
return { type: 'toggle_spirit', _reason: 'spirit_on_7' };
}
} else {
// Reset if conditions no longer met
STATE._spiritForSkill = 0;
}
// 0e. HIGH-THREAT WEAPON SKILLS — before buffs/items/debuffs
// If enemies have high SP bars, kill/stun them NOW before they
// use special attacks. Don't waste turns buffing while monsters charge.
const SINGLE_THREAT = Math.round(120 * 90 / 100); // 108px = one monster about to special
@ -3890,6 +3915,7 @@ function initializeBattle() {
STATE.page = 'battle';
STATE.inBattle = true;
STATE._mysticUsed = false; // Reset Mystic Gem tracking on new battle
STATE._spiritForSkill = 0; // Reset spirit burst toggle
STATE._baseMpCosts = {}; // Reset base cost cache
parseBattleState();

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name HV Unified
// @namespace hvunified
// @version 0.14.17
// @version 0.14.18
// @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.17';
const VERSION = '0.14.18';
const CFG = {
// — Battle automation
@ -78,7 +78,8 @@ const STATE = {
battleInitialized: false,
_mysticUsed: false, // Track if Mystic Gem has been used this battle
_lastActionTime: 0, // Timestamp of last dispatched action (for Q debounce)
_lastActionTime: 0,
_spiritForSkill: 0, // 3-state flag for burst spirit toggle (0=off, 1=toggle-on, 2=cast-done) // Timestamp of last dispatched action (for Q debounce)
_baseMpCosts: {}, // Cached base MP costs for buff spells (read from magic pane at battle start)
@ -1427,8 +1428,32 @@ function strategyVeteran() {
if (STATE.spiritStance && STATE.sp < 0.60) {
return { type: 'toggle_spirit', _reason: 'sp_safety' };
}
// 0d. HIGH-THREAT WEAPON SKILLS — before buffs/items/debuffs
// 0d. Spirit Stance for burst clear — toggle on for 7+ mob, off after one skill
// 3-state flag: 0=normal, 1=toggle-on sent, 2=skill-cast done (toggle-off pending)
const is2H = STATE.skillsKnown.includes('Great Cleave') || STATE.skillsKnown.includes('Rending Blow');
if (is2H && STATE.monsters && STATE.monsters.length >= 7 && STATE.oc >= (CFG.skillOC || 60)) {
if (STATE._spiritForSkill >= 1 && STATE.spiritStance) {
// Spirit is on for our burst — advance state and let weapon skills fire
if (STATE._spiritForSkill === 1) {
// First press with spirit on — just let weapon skills fire
STATE._spiritForSkill = 2;
} else if (STATE._spiritForSkill === 2) {
// Skill was already cast — toggle off now
STATE._spiritForSkill = 0;
return { type: 'toggle_spirit', _reason: 'spirit_off_7' };
}
} else if (!STATE.spiritStance && STATE._spiritForSkill === 0) {
// Toggle on first, mark to toggle off after skill
STATE._spiritForSkill = 1;
return { type: 'toggle_spirit', _reason: 'spirit_on_7' };
}
} else {
// Reset if conditions no longer met
STATE._spiritForSkill = 0;
}
// 0e. HIGH-THREAT WEAPON SKILLS — before buffs/items/debuffs
// If enemies have high SP bars, kill/stun them NOW before they
// use special attacks. Don't waste turns buffing while monsters charge.
const SINGLE_THREAT = Math.round(120 * 90 / 100); // 108px = one monster about to special
@ -3890,6 +3915,7 @@ function initializeBattle() {
STATE.page = 'battle';
STATE.inBattle = true;
STATE._mysticUsed = false; // Reset Mystic Gem tracking on new battle
STATE._spiritForSkill = 0; // Reset spirit burst toggle
STATE._baseMpCosts = {}; // Reset base cost cache
parseBattleState();

View file

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

View file

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

View file

@ -50,6 +50,7 @@ function initializeBattle() {
STATE.page = 'battle';
STATE.inBattle = true;
STATE._mysticUsed = false; // Reset Mystic Gem tracking on new battle
STATE._spiritForSkill = 0; // Reset spirit burst toggle
STATE._baseMpCosts = {}; // Reset base cost cache
parseBattleState();

View file

@ -14,7 +14,8 @@ const STATE = {
battleInitialized: false,
_mysticUsed: false, // Track if Mystic Gem has been used this battle
_lastActionTime: 0, // Timestamp of last dispatched action (for Q debounce)
_lastActionTime: 0,
_spiritForSkill: 0, // 3-state flag for burst spirit toggle (0=off, 1=toggle-on, 2=cast-done) // Timestamp of last dispatched action (for Q debounce)
_baseMpCosts: {}, // Cached base MP costs for buff spells (read from magic pane at battle start)

View file

@ -702,8 +702,32 @@ function strategyVeteran() {
if (STATE.spiritStance && STATE.sp < 0.60) {
return { type: 'toggle_spirit', _reason: 'sp_safety' };
}
// 0d. HIGH-THREAT WEAPON SKILLS — before buffs/items/debuffs
// 0d. Spirit Stance for burst clear — toggle on for 7+ mob, off after one skill
// 3-state flag: 0=normal, 1=toggle-on sent, 2=skill-cast done (toggle-off pending)
const is2H = STATE.skillsKnown.includes('Great Cleave') || STATE.skillsKnown.includes('Rending Blow');
if (is2H && STATE.monsters && STATE.monsters.length >= 7 && STATE.oc >= (CFG.skillOC || 60)) {
if (STATE._spiritForSkill >= 1 && STATE.spiritStance) {
// Spirit is on for our burst — advance state and let weapon skills fire
if (STATE._spiritForSkill === 1) {
// First press with spirit on — just let weapon skills fire
STATE._spiritForSkill = 2;
} else if (STATE._spiritForSkill === 2) {
// Skill was already cast — toggle off now
STATE._spiritForSkill = 0;
return { type: 'toggle_spirit', _reason: 'spirit_off_7' };
}
} else if (!STATE.spiritStance && STATE._spiritForSkill === 0) {
// Toggle on first, mark to toggle off after skill
STATE._spiritForSkill = 1;
return { type: 'toggle_spirit', _reason: 'spirit_on_7' };
}
} else {
// Reset if conditions no longer met
STATE._spiritForSkill = 0;
}
// 0e. HIGH-THREAT WEAPON SKILLS — before buffs/items/debuffs
// If enemies have high SP bars, kill/stun them NOW before they
// use special attacks. Don't waste turns buffing while monsters charge.
const SINGLE_THREAT = Math.round(120 * 90 / 100); // 108px = one monster about to special