Repository navigation
task 1 report
Commit: 01da66ca feat(temples): fight rooms can drop keys, and a Bomb found inside a temple opens its cracked walls
Status: DONE_WITH_CONCERNS (see Concerns)
-
types.ts:RoomDrops = Pick<RoomContent, 'chest' | 'dungeon' | 'items' | 'gold'>andRoomContent.drops?: RoomDrops. -
fightDrops.ts(new):FIGHT_ROOM_TYPES,BOMB_ITEM = 'Bomb',roomDrops(room)(the non-emptycontent.dropsof a monster/miniboss/boss room, elsenull; "non-empty" = adungeonstring, a non-emptyitemslist, orgold > 0),dropKey(level, position)=${roomPositionKey(...)}:drop. -
roomGrants.ts:smallKeysGrantedandgrantsBossKeycount the fight drop (ids throughdungeonItemId; "key" rows of a drop count like a loot room's rows); newgrantedDungeonItems(room)(chest's item, then the drop's) andisBombSource(room)(ashop, a loot chest or a fight drop whoseitemsincludeBomb);chestDungeonItemstays chest-only. Header notes updated (three places now; Bomb sources). -
templeGraph.ts:LockKindgains"bomb"; abombableside is a door withlock: "bomb"(awallstays no door);GraphRoom.bombs = isBombSource(room). Header +linkNeighboursnotes updated. -
templeSolver.ts:Region.bombs;passabletakes{ master, bombs };explorekeeps cracked-wall doors waiting (as it does boss doors) until a room withbombsis reached, then walks through them. The way-back check carriesregion.bombs. -
templeAudit.ts: maps and compasses counted withgrantedDungeonItems. -
dungeonCounts.ts: key items listed fromgrantedDungeonItems(plus the master-key Key room as before). -
roomPosition.ts(new leaf) +DungeonManager.ts:roomPositionKeymoved to a module with no imports and re-exported fromDungeonManager, sofightDrops.ts(and so the solver's import chain: templeGraph -> roomGrants -> fightDrops) does not pull inDungeonManager(Vue, ChestSystem) and does not make a cycle (DungeonManager->roomGrants->fightDrops->DungeonManager). Every existingimport { roomPositionKey } from '.../DungeonManager'keeps working.
- A cracked wall into a boss room stays
lock: "master"(walking out of the boss room through one isbomb). The global constraint says every door into a boss room is a Boss door and Bombs never open locked doors; the solver is the stricter reader, so it can only reject, never accept, a temple the engine would let a hero skip the Boss Key in. - A bombable side with a small lock flag on the room is still
bomb(the editor cannot draw both: one value per side). - Bomb doors count as open in
reachableFrom(R1, R4, R7, R9 andisCriticaltreat every door as open, as they do boss and small doors), so a room behind only a cracked wall is no longer "out of reach" (R1), and a cracked-wall detour around the mini-boss now counts as a way around it (R4/R7), which is right once a Bomb is in the temple.
RED (before any source change):
$ chemx test tests/unit/FightDrops.spec.ts
✖ Test suite failed to run
tests/unit/FightDrops.spec.ts:7:10 - error TS2305: Module '"@/lib/services/temples/roomGrants"' has no exported member 'grantedDungeonItems'.
$ chemx test tests/unit/TempleSolver.spec.ts
✖ Test suite failed to run
tests/unit/TempleSolver.spec.ts:349:74 - error TS2339: Property 'bombs' does not exist on type 'GraphRoom'.
GREEN (after the implementation):
$ chemx test tests/unit/FightDrops.spec.ts ✔ All tests passed (19 passed)
$ chemx test tests/unit/TempleSolver.spec.ts ✔ All tests passed (48 passed, 1 skipped)
$ chemx test tests/unit/MinibossBossKey.spec.ts ✔ All tests passed (8 passed)
$ chemx test tests/unit/templeAudit.spec.ts ✔ All tests passed (70 passed)
$ chemx test tests/unit/ShippedTemplesAudit.spec.ts ✔ All tests passed (218 passed)
$ chemx test tests/unit/WindTemple.spec.ts ✔ All tests passed (12 passed)
The one skip in TempleSolver is the pre-existing wind-temple fails the solver title (R5: its two mini-bosses lack
lockOnEnter; nothing to do with Bombs: the Wind Temple no longer fails R2).
- src/lib/engine/core/dungeons/types.ts, roomPosition.ts (new), DungeonManager.ts
- src/lib/services/temples/fightDrops.ts (new), roomGrants.ts, templeAudit.ts
- src/lib/engine/dungeons/generator/templeGraph.ts, templeSolver.ts
- src/app/Admin/XpCompendium/views/XpTemples/hooks/templeData/dungeonCounts.ts
- tests/unit/FightDrops.spec.ts (new), TempleSolver.spec.ts, ShippedTemplesAudit.spec.ts, WindTemple.spec.ts
Spec changes beyond the two new tests in the brief: the TempleSolver.spec.ts describe "walls and bombable sides are walls to the
solver" was rewritten (a bombable side is now a Bomb door; a wall stays a wall; added: Bomb behind the wall no help, Bomb opens no
small lock, boss-door wall stays master, shop and monster-drop Bomb sources). ShippedTemplesAudit.spec.ts: BOMB_SHOP and
withWallsBlown removed, Wind read as shipped, header fixed. WindTemple.spec.ts (not in the brief): its "without a Bomb" block
asserted the old behaviour (cracked wall = no door, Wind unsolvable); it would have gone red, so it now asserts the Boss Key is
unreachable with the bomb doors closed, the shop is a Bomb source, the temple solves, and unsolves with the shop removed.
- Behaviour for rooms without drops is unchanged:
smallKeysGranted/grantsBossKey/chestDungeonItemgive the same answers (MinibossBossKey, templeAudit, ShippedTemplesAudit green);dungeonCountskeeps one key item per room for every room that could give one before. -
import type { GrantingRoom }in fightDrops keeps the fightDrops <-> roomGrants link one-way at runtime. - No new typecheck/lint run (lead's job). TS points I checked by reading:
Carriedis satisfied byRegion; thelockconst inlinkNeighboursisLockKind; the aliased-condition narrowing indropDungeonItemmirrorschestDungeonItem.
-
docs/Temple-Generation-Contract.mdline 28 ("a cracked wall is a wall here ... never a way the solver counts on") is now stale.docs/is a submodule, so I did not touch it. - The engine's
blowBombableSidewrites the door intoopenedDoors, anddoorKindtreats an opened key as an opened boss door, so in play a Bomb on a cracked wall into a boss room would skip the Boss Key. The solver does not count on it (see decisions); the play task that touchesdoors.tsshould refuse that case. -
stuckReasonstill says "no locked door in reach" when a cracked wall with no Bomb is what holds the hero; a hint could be added in a later task if the Game Master's audit should name it. - Ran one spec the brief did not name (
WindTemple.spec.ts) because this change breaks it; no other spec was run.TempleDataModules.spec.ts(coversbuildComposition) andTempleGenerator.spec.tswere not run; the wave's CI run covers them.
- 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