Repository navigation
task 3 brief
Files:
- Modify:
-
src/lib/engine/core/dungeons/templeSystem/chests.ts,src/lib/engine/core/dungeons/TempleSystem.ts -
src/lib/services/temples/RoomInteractions.ts(themonster/miniboss/bosscase),src/lib/services/temples/roomInteractions/vocabulary.ts(RoomIntent,RoomSheet) -
src/hooks/temples/useTemple.ts(claimChestItems),src/app/Console/TempleGrounds/templeGrounds/templeReveals.ts(useChestReveal),src/app/Console/TempleGrounds/templeGrounds/useRoomOutcomes.ts(theopenChestcase) - the engine's doors code (
src/lib/engine/core/dungeons/templeSystem/doors.ts) for the bug below
-
- Test:
tests/unit/RoomInteractions.spec.ts,tests/unit/FightDrops.spec.ts
Interfaces:
-
Consumes:
roomDrops,dropKey,BOMB_ITEM(src/lib/services/temples/fightDrops.ts, in master);chestLoot(src/lib/services/temples/ChestLoot.ts). -
Produces:
-
markDropTaken(runs, templeId, level, position): voidandisDropTaken(runs, templeId, level, position): booleaninchests.ts, filed inTempleState.openedChestsunderdropKey.TempleSystemhas public wrappers with the same names (withoutruns). -
RoomIntentgains'takeDrop';RoomSheetgainsdrop?: 'waiting'. -
useTemple:dropContents: ComputedRef<ChestLoot[]>andclaimDropItems(selected: string[]): void. -
useChestReveal:showDropReveal(): void; the reveal's Take routes toclaimDropItemswhile a drop is shown.
-
-
Step 1: Write failing tests in
RoomInteractions.spec.ts, each a monster quest room with a small-key drop:- Status
lurking: no "Take it" action and nodrop. - Status
cleared: a "Take it" action with intenttakeDropanddrop: 'waiting'. - Status
notYoursand statusaway: "Take it" too. - A classic room not yet cleared: no "Take it".
- After
markDropTaken: no "Take it", and "Search the room" is still offered. The keys are separate:isRoomSpentstaysfalse.
In
FightDrops.spec.ts, withTempleSystem:- A blood-moon restart (
openedChestscleared) makesisDropTakenfalse again. - A daily quest restoring the room does not.
For the doors bug (below), in the spec that covers
doors.ts(find it withchemx q blowBombableSide): a cracked side into a boss room, once blown by a Bomb, still needs the Boss Key (doorKindreports it as the Boss door). - Status
-
Step 2: Run
chemx test tests/unit/RoomInteractions.spec.ts. Expected: FAIL. -
Step 3: Implement.
-
The sheet: offers the drop when
roomDrops(room) && !isDropTaken(...) && !fightIsLive. The fight is live for a quest room whenquestWords.fight; for a classic room, while!isRoomCleared. The sheet line is "Something glints where the beast fell." as a raw string like the rest of the file (lead ruling: the file's idiom wins for this one line). -
claimDropItems: hands items out exactly asclaimChestItemsdoes, through one extracted localhandOutItems(selected), then callsmarkDropTaken.- A drop is taken whole: if any restorative or Bomb has no room in the bag or storage, nothing is taken and the message says the bag is full.
- A Bomb from a chest or a drop goes into the bag as
{ name: 'Bomb', kind: 'consumable', faIcon: 'bomb', qty: 1 }, as the temple shop does.claimChestItemsgains that too.
-
The doors bug (pre-existing, lead ruling):
blowBombableSiderecords the blown side inopenedDoors, sodoorKindlets a Bomb open a cracked wall into a boss room without the Boss Key. Bombs never open locked doors: a cracked side into a boss room stays a Boss door after the blast. -
useTemple.tsis large: extracthandOutItemsand the drop logic into a small helper module beside it if that keeps every file under 500 lines.
-
The sheet: offers the drop when
-
Step 4: Run both specs (and the doors spec). Expected: PASS.
-
Step 5: Commit
feat(temples): a beaten beast drops what its room holds, and it waits there for a hero with no fight.
- Architecture
- Component-Library
- Hooks-Reference
- Temple-System
- Battle-Field-Architecture
- current_context - For AI/Human Handoff
- User Menu
- General Settings
- Family Settings
- Sound Settings
- Notification Settings
- Reward Settings
- Party Settings
- Theme Settings
- Chore Settings