From 7f5493f4d87c694c185e95eaf2e196672ec20c3a Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Mon, 8 Jun 2026 14:40:53 +0200 Subject: [PATCH] fix: initialize guardian defensive state for uncleared guardian rooms on descent --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- src/lib/game/stores/combat-descent-actions.ts | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 2fd0067..e3ecb0f 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-08T12:28:09.613Z +Generated: 2026-06-08T12:36:38.273Z Found: 1 circular chain(s) — these MUST be fixed before modifying involved files. 1. 1) stores/golem-combat-actions.ts > stores/golem-combat-helpers.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 31a4ff6..e5ef880 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-08T12:28:07.502Z", + "generated": "2026-06-08T12:36:36.211Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, diff --git a/src/lib/game/stores/combat-descent-actions.ts b/src/lib/game/stores/combat-descent-actions.ts index 085f38a..396e257 100644 --- a/src/lib/game/stores/combat-descent-actions.ts +++ b/src/lib/game/stores/combat-descent-actions.ts @@ -194,6 +194,19 @@ export function onEnterRoomDescend(get: GetFn, set: SetFn): void { if (!wasCleared) { get().addActivityLog('floor_transition', `Floor ${s.currentFloor} Room ${s.currentRoomIndex + 1} was not cleared — enemies present`); + + // Initialize guardian defensive state for uncleared guardian rooms + if (s.currentRoom.roomType === 'guardian') { + const guardian = getGuardianForFloor(s.currentFloor); + if (guardian) { + set({ + guardianShield: guardian.shield ?? 0, + guardianShieldMax: guardian.shield ?? 0, + guardianBarrier: guardian.barrier ?? 0, + guardianBarrierMax: guardian.barrier ?? 0, + }); + } + } return; }