Commit graph

19 commits

Author SHA1 Message Date
GaboGG
3a041f41da Fix boss detection: remove SP bar check, only use gold border
At Lv100+ / Hell difficulty, all normal monsters also have SP bars
(the red nbarred.png). This made the script think every monster was
a boss, triggering debuffs (Imperil/Weaken) on every fight and
draining MP.

Changes:
- isRareMonster() no longer checks for nbarred.png
- Only gold border (BD7400/E6CCA3) indicates a real boss
- Debuffs now only fire on gold-border bosses, not on ≤2 monsters
2026-07-23 17:53:47 -04:00
GaboGG
3777de77fa Spirit gems: P-slot gem used immediately, draughts/potions at threshold
Spirit item logic split by source:
- P-slot gem (10007): used immediately on every turn, free to refill
  with crystals, keeps SP permanently high for Spark + Stance
- Spirit Draughts/Potions in item slots: only used when SP < threshold (30%)
  to conserve consumable credits
2026-07-22 07:13:55 -04:00
GaboGG
a90dd47ec0 Spirit gems: use whenever available, no SP threshold
Spirit gems now fire whenever one is slotted regardless of SP level.
This keeps SP constantly topped up for:
- Spark of Life (costs 50% SP to trigger)
- Manual Spirit Stance (costs 1 SP + 10% OC per round)
Removed the old SP < 30% threshold check.
2026-07-22 07:11:40 -04:00
GaboGG
cdd0fe5984 Spirit Stance: manual only, auto-disable at 65% SP (Spark needs 50%)
Spark of Life consumes 50% of your SP bar when triggered. If you're in
Spirit Stance with low SP, Spark fails to proc. Changes:
- No auto-activation of Spirit Stance (toggle manually with S key)
- Auto-disable if SP drops below 65% to reserve SP for Spark trigger
- Veteran still has optional auto-activation via CFG.autoSpirit but
  requires SP > 65% (practically never triggers)
2026-07-22 06:50:51 -04:00
GaboGG
0bbdb66b14 Fix Spark of Life icon key: sparklife.png, not fallenshield
The active buff icon is /y/e/sparklife.png -> stored as 'sparklife'.
The 'fallenshield.png' check is for detecting when it has been consumed
(triggered), not for the active buff. This was causing the script to
think Spark of Life was never active, recasting it every turn.
2026-07-22 06:18:39 -04:00
GaboGG
e745505c6e Bump version to 0.12.0 2026-07-22 06:15:24 -04:00
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
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