task 2 brief - xopherdeep/do-it-for-the-xp GitHub Wiki
Files:
- Create:
src/app/Admin/XpCompendium/views/XpTemples/components/XpTempleCreator/components/RoomDropsConfig.vue - Modify:
.../XpTempleCreator/components/index.ts,.../XpTempleCreator/XpRoomEditorPage.vue(next toRoomMonsterConfig, ~line 61) - Test:
.../XpTempleCreator/components/__tests__/RoomDropsConfig.spec.ts
Interfaces:
-
Consumes:
RoomDrops(src/lib/engine/core/dungeons/types.ts, in master) andFIGHT_ROOM_TYPES(src/lib/services/temples/fightDrops.ts, in master);DUNGEON_ITEMSandCONSUMABLE_ITEMSfrom../hooks(the listsRoomLootConfig.vueshows). -
Produces:
RoomDropsConfig, which takes props{ drops: RoomDrops | null }and emitsupdate:dropswithRoomDrops | null. It's mounted for room types inFIGHT_ROOM_TYPESwithv-model:dropsbound toroomData.content.drops. -
Step 1: Write failing tests:
- Picking "Small Key" emits
{ chest: 'dungeon', dungeon: 'small-key' }. - Picking "None" with no gold or items emits
null. - Typing gold
30onto a key drop emits{ chest: 'dungeon', dungeon: 'small-key', gold: 30 }. - Ticking
Bombemitsitems: ['Bomb'].
- Picking "Small Key" emits
-
Step 2: Run
chemx test <that spec>. Expected: FAIL. -
Step 3: Implement a "Drops" section with the dungeon-item row (None first), the consumables row including Bomb, and a gold field, styled like
RoomLootConfig.vue. Mount it in the room editor for fight rooms, both classic and quest rooms.XpRoomEditorPage.vueanduseTempleRoomEditor.tsare already large: add as few lines there as possible (the component owns its logic; the page only mounts it). -
Step 4: Run the spec. Expected: PASS.
-
Step 5: Commit
feat(temple-creator): fight rooms pick what their beast drops.