Repository navigation
task 5 brief
Files:
- Modify:
src/lib/engine/core/dungeons/types.ts(ClimbLock, L37) - Modify:
src/lib/services/temples/authoredDoors.ts(climbLockOf),src/lib/engine/dungeons/templeGraph.ts(LockKindL63, stairs door ~L274),src/lib/engine/dungeons/templeSolver.ts(passable) - Modify:
src/lib/services/temples/roomInteractions/travel.ts(stairsSheetL139,climbL154),src/lib/engine/core/dungeons/templeSystem/doors.ts(unlockClimbL333) - Modify: the room context type and its builder (find with
chemx q getLiveContext) to carryfloorCleared?: boolean - Test:
tests/unit/FloorClearedClimb.spec.ts
Interfaces:
-
Produces:
ClimbLock = 'small' | 'master' | 'floorCleared';LockKindgains"floorCleared"; the room context gainsfloorCleared?: boolean(true when every chore on the hero's current floor is done; set by Task 10 for project towers, absent elsewhere). -
Step 1: Write the failing tests
- Solver: a two-floor layout whose 1F stairs carry
content.locked: 'floorCleared'with two monster rooms on 1F issolvable, and itsorderlists both 1F monster rooms before any 2F room; the same layout with one 1F monster room walled off is not solvable and names the stairs inreasons. - Sheet:
stairsSheet(room, ctx, "up")withfloorClearedabsent or false shows the line "Clear every chore on this floor to climb" and no climb action; withfloorCleared: trueit shows the climb action and spends no key. -
unlockClimb(runs, id, level, pos, 'floorCleared')returns false and writes nothing (the climb is never stored as unlocked; it reads the context each time).
- Solver: a two-floor layout whose 1F stairs carry
-
Step 2: Run
chemx test tests/unit/FloorClearedClimb.spec.ts. Expected: FAIL. -
Step 3: Implement. In the solver,
floorClearedpasses once every fight room (monster, miniboss, boss, or a room withcontent.questIds) on the stairs' floor is in the reached set. Intravel.ts, afloorClearedlock readsctx.floorCleared; the line goes in the copy catalogue (three voices). -
Step 4: Run the spec plus
tests/unit/AuthoredBossDoor.spec.tsand the locked-climb specs (chemx q -g "isClimbUnlocked"in tests/unit). Expected: PASS. -
Step 5: Lead commits
feat(temples): a floor-cleared climb lock the solver and the stairs sheet know.
- 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