generated from nhcarrigan/template
fix: turn off auto-boss/auto-quest on failure and surface status (#46)
## 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~ 🌸 Reviewed-on: #46 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #46.
This commit is contained in:
@@ -76,6 +76,8 @@ const initialGameState = (
|
||||
achievements: structuredClone(defaultAchievements),
|
||||
adventurers: structuredClone(defaultAdventurers),
|
||||
apotheosis: { ...initialApotheosis },
|
||||
autoBoss: false,
|
||||
autoQuest: false,
|
||||
baseClickPower: 1,
|
||||
bosses: structuredClone(defaultBosses),
|
||||
companions: { activeCompanionId: null, unlockedCompanionIds: [] },
|
||||
|
||||
Reference in New Issue
Block a user