Commit graph

18 commits

Author SHA1 Message Date
GaboGG
1a4f9a80a3 v0.13.26 - Stricter Q debounce: reset timer after each successful action
- executeAction now sets STATE._lastActionTime after dispatching
- Q handler checks this instead of a local var
- When an action executes, the Q debounce resets so the next Q press
  waits the full 300ms before attempting again
- Prevents stale-state queueing when game hasn't processed the
  previous action yet (was sending 12+ 'skill' commands to the
  game, though only 1 actually ran)
2026-07-26 15:23:04 -04:00
GaboGG
8c21920d4b v0.13.25 - Debounce Q key to prevent spam on held-key repeat
- Added _lastQTime debounce (300ms) to the Q key handler
- Holding Q now fires at most ~3 actions per second instead
  of ~20, preventing duplicate actions from stale state reads
- The previous issue: 6 identical Haste casts, then 8 identical
  Spark casts, then 12 identical Heartseeker casts — all from
  state not yet updated by the game
2026-07-26 15:17:27 -04:00
GaboGG
86968f531c 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.
2026-07-26 15:16:07 -04:00
GaboGG
0aa268b3f9 v0.13.23 - Fix affordable MP check using actual current MP from DOM
- Was using vrhd (HP element) instead of vrm (current MP)
- Now reads #vrm textContent for current MP value
- Simply compares mpCost > curMp to skip unaffordable spells
- This prevents the infinite Heartseeker loop when you
  don't have enough MP even though the buff is a good target
2026-07-26 15:09:38 -04:00
GaboGG
31799a7261 v0.13.22 - Cache base MP costs at battle start (dynamic, not hardcoded)
- Removed SPELL_COSTS hardcoded table
- Base MP costs are now read from the magic pane's onmouseover
  tooltip at battle init and cached in STATE._baseMpCosts
- Cache is populated during parseBattleState() and persists
  for the entire battle, avoiding channeling's 1-MP display
- Cache resets on new battle, so level-ups or stat changes
  are picked up when starting a new arena
2026-07-26 15:08:23 -04:00
GaboGG
80fc77600a v0.13.21 - Dynamic base cost read + affordable MP check for channeling
- Removed hardcoded SPELL_COSTS table (was brittle)
- Now reads base MP cost directly from the magic pane's
  onmouseover tooltip (always shows true base cost, unaffected
  by channeling's 1-MP display or Mana Conservation)
- Added affordable check: skip spells where base cost exceeds
  current MP, even though channeling would make it cost 1
- The game's native MP check (shown by "You do not have enough")
  checks against base cost, not channeling-reduced cost
2026-07-26 15:05:20 -04:00
GaboGG
e20fe0495c v0.13.20 - Add SPELL_COSTS fallback for Mana Conservation-reduced MP costs
- Some spells show mp=1 in the DOM due to high Mana Conservation
  proficiency, making fill-level scoring produce near-zero values
- Now: if mpCost < 5, look up the base cost from SPELL_COSTS table
- This ensures Heartseeker (141 MP) scores correctly even when the
  DOM shows it costing 1 MP
2026-07-26 15:01:49 -04:00
GaboGG
e914c08475 v0.13.19 - Fix on-cooldown spells missing from spellsKnown
- Magic pane query used '.btsd[onclick]' which excludes
  on-cooldown spells (opacity:0.5, no onclick attribute)
- Heartseeker was invisible to hasSpell() during its cooldown
  period, which is exactly when channeling procs from it
- Changed to '.btsd' with onmouseover fallback
2026-07-26 14:31:38 -04:00
GaboGG
49c7ce9cab v0.13.18 - Add channeling score debug logging
- Logs the top candidate from findBestChannelingTarget() on every Q press
- Shows: spell, score, dur, maxDur, mpCost, emptiness%
- Next time channeling doesn't fire on a buff, the console will show
  the actual computed scores so we can see what's happening
2026-07-26 14:12:48 -04:00
GaboGG
e74c97f87a v0.13.17 - Fix fill-level scoring when maxBuffDur hasn't been learned
- When maxBuffDur for a buff equals its current duration (first observation
  in a battle), the emptiness was 0 — making the script think all buffs
  are full and skipping them
- Now: if maxDur <= current dur, assume a minimum of 30 turns as the max
- This ensures buffs like Shadow Veil at 8/8 are treated as 8/30 (73% empty)
  instead of 8/8 (0% empty)
2026-07-26 14:08:50 -04:00
GaboGG
3f865ee6fd v0.13.16 - Fix buff duration parsing for set_infopane_effect raw turn count
- The regex only matched 'X turns remaining' text format
- Buffs like channeling and freshly cast spells use the raw third
  parameter of set_infopane_effect('Name','desc',X) without 'turns rem'
- These were defaulting to 50 turns, making all fresh buffs appear
  as having 50 turns when they really had 0-5
- Added fallback to parse the last numeric argument of the function call
2026-07-26 14:05:29 -04:00
GaboGG
25ea8b4543 v0.13.15 - Fix stale Mystic Gem state, add debug logging to Q press
- Mystic Gem usage now tracked with STATE._mysticUsed flag
  Prevents re-triggering the gem check after it's been consumed
  (stale STATE.itemsKnown was causing infinite 'item → p' loops)
- Flag resets on new battle initialization
- Added buff durations + channeling status to Q-key console output
  Shows: ch=true/false mp=X% oc=X buffs: heartseeker=47 haste=24 ...
2026-07-26 14:01:48 -04:00
GaboGG
23f00450be v0.13.14 - Fix observer crash, raise channeling threshold to 30
- Removed call to undefined finalizeBattleLog() that was spamming
  ReferenceErrors and potentially corrupting the MutationObserver
- Raised channeling score threshold from 5 to 30: now only picks a
  buff for channeling if it's at least 30% empty on a 100-MP spell
  or 60% empty on a 50-MP spell
- Spark at 30/60 turns (50% empty, score 44) now falls to cheap
  damage fallback instead of wasting channeling
2026-07-26 13:53:01 -04:00
GaboGG
5f9297435d v0.13.13 - Fix channeling detection from effects pane (not just log)
- Channeling detection was ONLY from battle log text entries
- When log entries scroll off (new round starts), the 'gains the effect'
  message is lost and STATE.channeling stays false permanently
- Added effects pane check: if channeling.png is visible, force channeling=true
- This fixes the root cause of channeling being ignored when the log
  has scrolled past the proc message
- Also bumped version properly this time
2026-07-26 13:49:20 -04:00
GaboGG
47c42ea5fe v0.13.8 - Actually bump version in config.js and header.user.js
- config.js: 0.13.0 -> 0.13.8
- header.user.js: 0.12.0 -> 0.13.8 (was never bumped past 0.12.0)
- Now the @version tag in the userscript header matches the internal VERSION
2026-07-26 13:31:09 -04:00
GaboGG
2107527c72 v0.13.0 - Heartseeker buff, channeling efficiency, 100% buff uptime
- Added Heartseeker to BUFF_PRIORITY (+25% phys dmg, +10% crit self-buff)
- Channeling consumption: mp_cost/(dur+1) scoring, no arbitrary cutoff
- KickstartChanneling: prefers highest-MP-cost buffs for better proc chance
- Raised minTurns on all buffs for 100% uptime (Haste/Protect/Regen/Absorb/Shadow 2->4, Spark 1->3)
- Updated knowledge-base spellUnlocks and milestones
- Removed <10 turn hard cutoff from channeling target selection
2026-07-26 11:25:40 -04:00
GaboGG
e745505c6e Bump version to 0.12.0 2026-07-22 06:15:24 -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