Bug: Guardians never marked as defeated — pact ritual unreachable #220

Closed
opened 2026-05-30 21:10:32 +02:00 by Anexim · 1 comment
Owner

Bug Description

When a guardian is defeated during combat, the prestige store is never notified. The onFloorCleared callback in gameStore.ts only logs a message and resets shield/barrier state — it never calls defeatGuardian() or addDefeatedGuardian().

Code Location

src/lib/game/stores/gameStore.ts lines 270-277:

(floor, wasGuardian) => {
  if (wasGuardian) {
    const defeatedGuardian = getGuardianForFloor(floor);
    addLog((defeatedGuardian?.name || 'Unknown') + ' defeated! Visit the Grimoire to sign a pact.');
  }
  // Missing: usePrestigeStore.getState().defeatGuardian(floor);
}

Impact

Critical. The defeatedGuardians array is never populated during normal gameplay. Since startPactRitual checks defeatedGuardians.includes(floor), players can never start a pact ritual through normal gameplay. The entire pact-signing flow is unreachable without debug commands.

Fix Required

Add usePrestigeStore.getState().defeatGuardian(floor) (or equivalent) to the wasGuardian branch of the onFloorCleared callback.

## Bug Description When a guardian is defeated during combat, the prestige store is never notified. The `onFloorCleared` callback in `gameStore.ts` only logs a message and resets shield/barrier state — it never calls `defeatGuardian()` or `addDefeatedGuardian()`. ## Code Location `src/lib/game/stores/gameStore.ts` lines 270-277: ```typescript (floor, wasGuardian) => { if (wasGuardian) { const defeatedGuardian = getGuardianForFloor(floor); addLog((defeatedGuardian?.name || 'Unknown') + ' defeated! Visit the Grimoire to sign a pact.'); } // Missing: usePrestigeStore.getState().defeatGuardian(floor); } ``` ## Impact **Critical.** The `defeatedGuardians` array is never populated during normal gameplay. Since `startPactRitual` checks `defeatedGuardians.includes(floor)`, players can never start a pact ritual through normal gameplay. The entire pact-signing flow is unreachable without debug commands. ## Fix Required Add `usePrestigeStore.getState().defeatGuardian(floor)` (or equivalent) to the `wasGuardian` branch of the `onFloorCleared` callback.
Anexim added the ai:todo label 2026-05-30 21:10:32 +02:00
n8n-gitea was assigned by Anexim 2026-05-30 21:10:32 +02:00
Author
Owner

Fixed: Added usePrestigeStore.getState().addDefeatedGuardian(floor) call in the onFloorCleared callback in gameStore.ts. Guardians are now properly tracked as defeated, making the pact ritual reachable.

Fixed: Added usePrestigeStore.getState().addDefeatedGuardian(floor) call in the onFloorCleared callback in gameStore.ts. Guardians are now properly tracked as defeated, making the pact ritual reachable.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#220