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.
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
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
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.
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.
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.
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.
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.
- 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
- 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)