[feature: guardian-elements] Guardian floors should match guardian elements #204
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FEATURE: Floor-wide elemental themes matching guardian elements
Current Behavior
Floor elements cycle through a fixed list
['fire', 'water', 'air', 'earth', 'light', 'dark', 'death']for ALL floors regardless of guardian.Desired Behavior
Technical Changes Needed
src/lib/game/constants/elements.ts- UpdateFLOOR_ELEM_CYCLEto derive from guardian element for guardian floorssrc/lib/game/utils/room-utils.tsor floor generation logic - Make floor element account for guardian elementNotes
Priority
Medium - New gameplay mechanic, enhances thematic consistency
Starting implementation of guardian-element floor theming. Plan:
Completed
Guardian floors now use guardian elements instead of the fixed element cycle.
Changes Made
1.
src/lib/game/utils/floor-utils.ts— UpdatedgetFloorElement()to check for guardians first:getFloorElements(floor): string[]function that returns all guardian elements for multi-element guardians (future-proofing for dual/triple element guardians)2.
src/lib/game/utils/index.ts— AddedgetFloorElementsbarrel export3.
src/lib/game/stores/index.ts— AddedgetFloorElementsto store-level barrel export4. Tests updated:
floor-utils.test.ts— All 13 tests pass ✓floor-utils.upgraded.test.ts— Updated cycle test for guardian-aware elements, added guardian element tests andgetFloorElementstests. All 19 tests pass ✓computed-stats.test.ts— All 35 tests pass ✓How It Works
calcDamage) usegetFloorElement→ now compares spell element vs guardian element for proper elemental bonus/penaltyuseCombatStats) shows guardian element for guardian floorsgetEnemyName(floorElement, floor)→ shows guardian-element-themed names on guardian floorsgetFloorElements()Files Modified (all under 400 lines ✅)
src/lib/game/utils/floor-utils.ts(48 lines)src/lib/game/utils/index.ts(30 lines)src/lib/game/stores/index.ts(52 lines)src/lib/game/__tests__/floor-utils.upgraded.test.ts(188 lines)docs/project-structure.txt,docs/dependency-graph.json,docs/circular-deps.txt(auto-generated)Guardian floors now use guardian elements. All pre-commit checks pass. Tests updated and passing.