Commit graph

115 commits

Author SHA1 Message Date
GaboGG
b69eabd1eb Fix: Spark of Life icon key, mana items after buffs
1. Spark of Life icon is 'fallenshield.png' not 'spark_of_life' -
   fixed BUFF_PRIORITY key so buff detection works correctly
2. Mana/spirit items moved to AFTER buffs in all 3 tiers -
   was drinking mana potions on turn 2 before buffs were cast
3. Priority order: Health items -> Cure -> Buffs -> Mana items ->
   Skills -> Spirit Stance -> Damage spells -> Channeling -> Attack
2026-07-22 06:13:54 -04:00
GaboGG
d9fc1e547c Fix channeling: consume charge on useful spell, don't let it wear off
Channeling works: proc on mana-costing spell -> next spell costs 1 MP
and is 50% stronger/longer. The charge lasts 5 ticks (15 with Mystic
Gem) then wears off and is wasted.

Previously the script would basic attack with channeling charged,
wasting the bonus. Now:
- If channeling is active and nothing more urgent, still cast a buff
  (refresh anything under 10 turns) or a cheap damage spell
- Never basic attack while channeling is charged
- Novice/Adept/Veteran all have this protection
2026-07-21 14:45:23 -04:00
GaboGG
7093409580 Fix channeling: wiki-correct formula, Regen/Absorb as best triggers
Channeling wiki fix:
- Procs randomly on any mana-costing spell
- Proc chance = spell_cost / (base_mana * 1.2)
- Higher cost = higher chance (Regen/Absorb at 17 MP = ~6%)
- Cannot re-proc while already channeling
- Duration: 5 ticks (15 with Mystic Gem)
- Effect: next spell costs 1 MP, 50% stronger/longer

Kickstart now only refreshes expiring buffs (missing or < 5 turns)
with decent-cost spells (Regen/Absorb). No more cheap attack spells
at 4 MP = 1.4% proc chance — that was a waste of MP.

Defaults reverted to full-conservative values since the 'mp-focused'
win was based on wrong channeling assumptions.
2026-07-21 14:35:54 -04:00
GaboGG
f060bd31a8 Benchmark v3: 17 configs, chan-mp-focused wins (149 rounds)
Channeling experiments (Lv90, Nightmare, 5 runs each):
1. chan-mp-focused: 149.0 rounds (WINNER)
   - Mana gems at 70%, potions at 50% = stay MP-rich
   - Attack spells on for channeling kickstart
   - Buff refresh at < 15 turns
   - Spirit stance at OC 80, skills at OC 75
2. chan-no-buff-refresh: 143.0 (good, skip buff refresh chan)
3. chan-aggressive-buff: 142.4 (refresh buffs at < 20 turns)
4. chan-buff-only: 140.6 (no attack spells, buff refresh only)
5. conservative-items: 139.8 (old winner)

New defaults set to chan-mp-focused values.
2026-07-21 14:12:54 -04:00
GaboGG
0d57fead61 Shadow Veil fix: use correct icon key 'shadowveil', minTurns=3
Shadow Veil buff icon is stored as 'shadowveil' (from img src filename,
no underscore). Priority list now uses the correct key. minTurns=3
prevents recasting while still active. Also moved to last priority
position — only cast when MP is plentiful.
2026-07-21 14:07:17 -04:00
GaboGG
0ee31b7266 Benchmark v2 with real Lv90 stats, Shadow Veil removed, full-conservative defaults
Shadow Veil removed from BUFF_PRIORITY - was draining MP aggressively.
Player stats updated to match real character (effective values with gear).

Benchmark results (Lv90, Nightmare, 5 runs each):
1. full-conservative: 146 rounds, 4485 dmg/rd — WINNER
2. conservative-items: 143 rounds, 4468 dmg/rd
3. spirit-40: 136 rounds, 4457 dmg/rd

New defaults (full-conservative):
- cureHP: 0.45, cureItemHP: 0.50 (save items use cure)
- manaGemMP: 0.45, manaPotionMP: 0.25
- spiritPotionSP: 0.30, spiritStanceOC: 80
- skillOC: 75
2026-07-21 14:00:44 -04:00
GaboGG
4bc90d9332 Monster Lab floating panel + page detection, Beast recommendation
- Monster Lab page detected via ss=ml
- Floating draggable panel replaces inline UI (was messing layout)
- Feed All + Happy Pills All buttons
- Class recommendation for first monster
- Drag-to-move via header grab
2026-07-20 20:35:14 -04:00
GaboGG
e8c3f465d2 Spirit Stance: 40% SP minimum to toggle on (from 20%)
At 20% SP (~10 SP = 10 rounds of sustain), the player would toggle on
during a Grindfest round, consume SP quickly, toggle off when SP < 3%,
then 3 turns later the cooldown expires and OC is back to 60+ -> toggle
on again. Raising the threshold to 40% means ~20 rounds of sustained
Spirit Stance, making the engagement meaningful and rarely cycling.
2026-07-20 20:19:58 -04:00
GaboGG
a415b932d3 Spirit Stance: require 20% SP to toggle on, prevent flip-flop
Spirit Stance costs 1 SP + 10% OC per round (wiki). Previously toggled
on at 10% SP which meant ~5 rounds of sustain, often running out
immediately. Now requires 20% SP (~10 rounds sustain) to toggle on.
3-turn cooldown still prevents rapid flip-flopping between states.
2026-07-20 20:18:02 -04:00
GaboGG
e415a7660f Fix spirit stance flip-flop: 3-turn cooldown on toggle
Spirit stance was toggling on/off every turn because conditions (OC >= 60,
SP > 10%) would be met immediately after toggling off. Added a 3-turn
cooldown via STATE._spiritCooldown that blocks re-toggling until it
expires. Prevents wasted turns on spirit stance spam.
2026-07-20 20:00:19 -04:00
GaboGG
eb5f99dbfb Fix: skills before spirit stance, Rending Blow priority reorder
Priority order now:
1. Items
2. Cure
3. Buffs
4. Debuffs
5. Weapon skills (BEFORE spirit stance - fixes Rending Blow never firing)
   - Rending Blow first (AoE clear)
   - Shatter Strike second (needs Penetrated Armor)
   - Great Cleave last (single target, bosses only)
6. Spirit Stance (only if OC didn't get spent on skills)
7. Damage spells
8. Channeling kickstart
9. Basic attack
2026-07-20 19:58:27 -04:00
GaboGG
39ad28007c Sim benchmark: full-conservative wins, configurable skill OC
Benchmark results (1000 rounds, Lv64 Nightmare, infinite items):
1. full-conservative: 225.6 rounds, 3141 dmg/rd — BEST
2. conservative-items: 223.6 rounds, 3128 dmg/rd
3. attack-spells: 213.0 rounds, 2974 dmg/rd

Changes:
- Grindfest scaling: monsters +1 per 100 rounds, damage +0.4%/round
- skillOC config option (default: 70) for weapon skill OC threshold
- Spirit gem threshold bumped to 45%
- Simulator uses real monster count/damage scaling from wiki
- Benchmark results saved to simulator/results/benchmark.json
2026-07-20 19:53:03 -04:00
GaboGG
f252fa5566 Wiki-tuned simulator: real monster formulas from EHWiki
- Monster stats: STR/DEX/AGI/END/INT/WIS scaled per wiki formula
- HP = (100 + L*10 + END*5) * level_mod * difficulty_mod * class_mod
- Base damage from log formula, crit from (1 - 3750/(3750+DEX+STR/2))
- Phys/mag mit, evade, parry all from wiki
- Difficulty multipliers from wiki table (exp, credit, hp, dmg)
- Player stats tuned to match real Lv52 character (1804 HP, 93 MP)
- Added health items to default loadout
2026-07-20 19:44:23 -04:00
GaboGG
6c2bb2f8f3 Add battle simulator and Forgejo repo setup
- Simulator: headless HV battle engine in Node.js
  - Player/Entity models with stats, gear, spells
  - Monster definitions and spawning
  - Strategy engine ported from userscript
  - Grindfest simulation with turn-by-turn logging
- Forgejo remote: git@git.gaboggamer.online:gabogg/hv-unified.git
- 3 config presets: default, aggressive, conservative
- Outputs summary stats (kills, damage, survival) per run
2026-07-20 19:36:55 -04:00
GaboGG
402db6bb2f Initial commit: HV Unified v0.11.0 structure
- 23 source files in src/ (build via scripts/build.sh)
- Forum-sourced player knowledge in references/
- DESIGN.md with architecture and corrections
- References to existing scripts (Monsterbation, jpx, HV Utils)
2026-07-20 19:30:26 -04:00