Skip to content

task 5 brief

Xopher edited this page Oct 28, 2026 · 1 revision

Task 5: The floor-cleared climb lock

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 (LockKind L63, stairs door ~L274), src/lib/engine/dungeons/templeSolver.ts (passable)
  • Modify: src/lib/services/temples/roomInteractions/travel.ts (stairsSheet L139, climb L154), src/lib/engine/core/dungeons/templeSystem/doors.ts (unlockClimb L333)
  • Modify: the room context type and its builder (find with chemx q getLiveContext) to carry floorCleared?: boolean
  • Test: tests/unit/FloorClearedClimb.spec.ts

Interfaces:

  • Produces: ClimbLock = 'small' | 'master' | 'floorCleared'; LockKind gains "floorCleared"; the room context gains floorCleared?: 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 is solvable, and its order lists 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 in reasons.
    • Sheet: stairsSheet(room, ctx, "up") with floorCleared absent or false shows the line "Clear every chore on this floor to climb" and no climb action; with floorCleared: true it 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).
  • Step 2: Run chemx test tests/unit/FloorClearedClimb.spec.ts. Expected: FAIL.

  • Step 3: Implement. In the solver, floorCleared passes once every fight room (monster, miniboss, boss, or a room with content.questIds) on the stairs' floor is in the reached set. In travel.ts, a floorCleared lock reads ctx.floorCleared; the line goes in the copy catalogue (three voices).

  • Step 4: Run the spec plus tests/unit/AuthoredBossDoor.spec.ts and 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.

Table of Contents


Home - See Pages

Developer Docs

Start Screen

User Management

My Portal

My Home

The City (Hometown)

The World Map

The Dungeon

Game Master

Settings

Support & Glossary

About XP

Clone this wiki locally