🐛 Guardian pacts tab locked to old 100-floor system; needs dynamic procedural guardians #124
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?
Bug / Refactor Request
The GuardianPactsTab only shows guardians from the static
GUARDIANSconstant (floors 10-100), but the game has an extended guardian system inguardian-encounters.tswith compound (90-110), exotic (120-140), and combination (150+) guardians. The Pacts tab does not reflect this extended system.Additionally, the user requested a refactor to a room-based system (X rooms per floor, guardian every 10 floors) with elemental → compound → exotic → multi-mana-type guardian progression. This refactor may not have been fully implemented.
Current State
constants/guardians.ts: StaticGUARDIANSrecord with floors 10, 20, 30, 40, 50, 60, 80, 90, 100data/guardian-encounters.ts: Extended guardians (compound, exotic, combo) with procedural generation functions (getExtendedGuardian,getComboGuardian,generateGuardianName)GuardianPactsTab.tsx: Only reads fromGUARDIANSconstant, groups floors into Early (10-40), Mid (50-60), Late (80-100) tiersguardian-encounters.tsare never used in the Pacts tab UIRequested Behavior
guardian-encounters.tsFiles Involved
src/components/game/tabs/GuardianPactsTab.tsxsrc/components/game/tabs/guardian-pacts-components.tsxsrc/lib/game/constants/guardians.tssrc/lib/game/data/guardian-encounters.tssrc/lib/game/utils/floor-utils.tssrc/lib/game/utils/room-utils.tsSuggested Approach
GUARDIANSconstant andguardian-encounters.tsinto a single unified guardian systemGuardianPactsTabto use the unified system with extended tier filtersStarting work on this issue. The GuardianPactsTab only shows floors 10-100 from the static GUARDIANS constant. The extended guardian system in guardian-encounters.ts (compound 90-110, exotic 120-140, combo 150+) exists but is never used in the Pacts tab. Plan: create a unified guardian lookup, update the Pacts tab to show all guardians with updated tier filters.
Fix Implemented and Pushed
Successfully unified the guardian system so the Pacts tab shows all guardians across all floor ranges.
Changes Made
src/lib/game/data/guardian-encounters.ts:getGuardianForFloor(floor)— unified lookup that merges staticGUARDIANS(floors 10-100) with extended procedural system (compound 110, exotic 120-140, combo 150+)getAllGuardianFloors()— returns all guardian floors from both systemsALL_GUARDIAN_FLOORSto include all static floors (was missing floor 80)src/components/game/tabs/GuardianPactsTab.tsx:getGuardianForFloor()andgetAllGuardianFloors()instead of justGUARDIANSconstantsrc/components/game/tabs/guardian-pacts-components.tsx:getElementDisplays()helper that parses combo elements like"fire+water"into individual element dataFloorTierinterface for use in parent componentTest Results
Bundled in same commit
craftingStore.ts: Extracted initial equipment instances to newcrafting-initial-state.tsfile (from previous session work)Fix implemented and pushed to branch desloppify/issue-116. The GuardianPactsTab now uses a unified guardian lookup that merges the static GUARDIANS constant (floors 10-100) with the extended procedural system (compound 110, exotic 120-140, combo 150+). Tier filters updated to cover all floor ranges. Combo guardians display dual-element symbols and a "✦ Combo" badge. All tests pass. Ready for review.
Additional Fixes Applied
The initial implementation (comments #781, #782) correctly unified the GuardianPactsTab with
getGuardianForFloor()andgetAllGuardianFloors(), but several other files still referenced the staticGUARDIANSconstant directly. This meant pact multipliers, the Spire Summary tab, and debug tools would not work for extended guardians (floors 110+).Changes Made
src/lib/game/utils/pact-utils.ts— ReplacedGUARDIANS[floor]withgetGuardianForFloor(floor)in bothcomputePactMultiplier()andcomputePactInsightMultiplier(). This was the most critical bug: pact multipliers for floors 110+ were silently returning 1.0 (no bonus).src/components/game/tabs/SpireSummaryTab.tsx— Replaced allGUARDIANSreferences withgetGuardianForFloor()/getAllGuardianFloors(). Updated type annotations fromtypeof GUARDIANS[number]toGuardianDef. The floor progress bar, guardian roster, and next guardian card now show all guardians including compound/exotic/combo.src/components/game/debug/PactDebug.tsx— Switched to unified lookup; added null guards sincegetGuardianForFloor()can return null.src/components/game/tabs/DebugTab/PactDebugSection.tsx— Same fixes as PactDebug.tsx.Test Results
Issue fully resolved. All guardian-related code now uses the unified
getGuardianForFloor()system. The Pacts tab, Spire Summary tab, pact multiplier calculations, and debug tools all support the full guardian range (floors 10-100 static + compound 110 + exotic 120-140 + combo 150+).