fix: turn off auto-boss/auto-quest on failure and surface status #46

Merged
naomi merged 1 commits from fix/failure into main 2026-03-09 21:12:03 -07:00
Owner

Summary

  • Auto-boss now turns itself off when a boss fight is lost, so the player can reassess rather than the system silently looping. A "πŸ€– Last fight: [Boss] β€” ❌ Lost" status line appears in the boss panel.
  • Auto-boss also turns off (with an ⚠️ error message) when the API call fails outright (e.g. party has no adventurers), replacing the previous behaviour of silently hammering the API every animation frame.
  • Auto-quest now turns itself off whenever a quest fails the random-chance check, detected inside the tick's setState callback immediately after applyTick.
  • autoBoss: false and autoQuest: false are now part of initialGameState, so these fields persist through save/load cycles from the very first session β€” preventing a race window where the boss-route DB write could strip them before the first auto-save.
  • toggleAutoBoss clears both autoBossLastResult and autoBossError on each toggle so the panel always reflects the current session cleanly.

Test plan

  • pnpm lint β€” 0 errors, 0 warnings
  • pnpm build β€” all packages clean
  • pnpm test β€” 100% coverage maintained across the board

Closes #40

✨ This issue was created with help from Hikari~ 🌸

## Summary - Auto-boss now turns itself **off** when a boss fight is **lost**, so the player can reassess rather than the system silently looping. A "πŸ€– Last fight: [Boss] β€” ❌ Lost" status line appears in the boss panel. - Auto-boss also turns off (with an ⚠️ error message) when the API call fails outright (e.g. party has no adventurers), replacing the previous behaviour of silently hammering the API every animation frame. - Auto-quest now turns itself **off** whenever a quest fails the random-chance check, detected inside the tick's `setState` callback immediately after `applyTick`. - `autoBoss: false` and `autoQuest: false` are now part of `initialGameState`, so these fields persist through save/load cycles from the very first session β€” preventing a race window where the boss-route DB write could strip them before the first auto-save. - `toggleAutoBoss` clears both `autoBossLastResult` and `autoBossError` on each toggle so the panel always reflects the current session cleanly. ## Test plan - [x] `pnpm lint` β€” 0 errors, 0 warnings - [x] `pnpm build` β€” all packages clean - [x] `pnpm test` β€” 100% coverage maintained across the board Closes #40 ✨ This issue was created with help from Hikari~ 🌸
hikari added 1 commit 2026-03-09 21:00:33 -07:00
fix: turn off auto-boss/auto-quest on failure and surface status
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m14s
CI / Lint, Build & Test (pull_request) Successful in 1m16s
3ba0e2ec89
Auto-boss now disables itself when a boss fight is lost (instead of
silently looping), and turns off with an error message when the API
call itself fails (e.g. party has no adventurers). Auto-quest disables
itself whenever a quest fails the random chance check. In both cases
the player sees a clear status/error line in the boss panel rather than
a silent toggle, and can re-enable when ready.

Also initialises autoBoss/autoQuest to false in initialGameState so
these fields survive save/load cycles from the very first session.

Closes #40
naomi merged commit 4d7e624358 into main 2026-03-09 21:12:03 -07:00
naomi deleted branch fix/failure 2026-03-09 21:12:03 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/elysium#46