🐛 Guardian pacts tab locked to old 100-floor system; needs dynamic procedural guardians #124

Closed
opened 2026-05-22 13:20:56 +02:00 by Anexim · 5 comments
Owner

Bug / Refactor Request

The GuardianPactsTab only shows guardians from the static GUARDIANS constant (floors 10-100), but the game has an extended guardian system in guardian-encounters.ts with 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: Static GUARDIANS record with floors 10, 20, 30, 40, 50, 60, 80, 90, 100
  • data/guardian-encounters.ts: Extended guardians (compound, exotic, combo) with procedural generation functions (getExtendedGuardian, getComboGuardian, generateGuardianName)
  • GuardianPactsTab.tsx: Only reads from GUARDIANS constant, groups floors into Early (10-40), Mid (50-60), Late (80-100) tiers
  • The extended guardians from guardian-encounters.ts are never used in the Pacts tab UI

Requested Behavior

  1. Pacts tab should show all guardians — including compound, exotic, and combination guardians from guardian-encounters.ts
  2. Dynamic/procedural guardians — guardians should be generated procedurally based on floor number, with elemental types first, then compound, then exotic, then multi-mana-type
  3. Tier filtering should be updated — the current Early/Mid/Late tiers only go up to floor 100

Files Involved

  • src/components/game/tabs/GuardianPactsTab.tsx
  • src/components/game/tabs/guardian-pacts-components.tsx
  • src/lib/game/constants/guardians.ts
  • src/lib/game/data/guardian-encounters.ts
  • src/lib/game/utils/floor-utils.ts
  • src/lib/game/utils/room-utils.ts

Suggested Approach

  1. Merge GUARDIANS constant and guardian-encounters.ts into a single unified guardian system
  2. Create a function that generates/looks up guardians for any floor dynamically
  3. Update GuardianPactsTab to use the unified system with extended tier filters
  4. Ensure the spire combat system uses the same guardian definitions
## Bug / Refactor Request The GuardianPactsTab only shows guardians from the static `GUARDIANS` constant (floors 10-100), but the game has an extended guardian system in `guardian-encounters.ts` with 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`: Static `GUARDIANS` record with floors 10, 20, 30, 40, 50, 60, 80, 90, 100 - `data/guardian-encounters.ts`: Extended guardians (compound, exotic, combo) with procedural generation functions (`getExtendedGuardian`, `getComboGuardian`, `generateGuardianName`) - `GuardianPactsTab.tsx`: Only reads from `GUARDIANS` constant, groups floors into Early (10-40), Mid (50-60), Late (80-100) tiers - The extended guardians from `guardian-encounters.ts` are never used in the Pacts tab UI ## Requested Behavior 1. **Pacts tab should show all guardians** — including compound, exotic, and combination guardians from `guardian-encounters.ts` 2. **Dynamic/procedural guardians** — guardians should be generated procedurally based on floor number, with elemental types first, then compound, then exotic, then multi-mana-type 3. **Tier filtering should be updated** — the current Early/Mid/Late tiers only go up to floor 100 ## Files Involved - `src/components/game/tabs/GuardianPactsTab.tsx` - `src/components/game/tabs/guardian-pacts-components.tsx` - `src/lib/game/constants/guardians.ts` - `src/lib/game/data/guardian-encounters.ts` - `src/lib/game/utils/floor-utils.ts` - `src/lib/game/utils/room-utils.ts` ## Suggested Approach 1. Merge `GUARDIANS` constant and `guardian-encounters.ts` into a single unified guardian system 2. Create a function that generates/looks up guardians for any floor dynamically 3. Update `GuardianPactsTab` to use the unified system with extended tier filters 4. Ensure the spire combat system uses the same guardian definitions
Anexim added the ai:todo label 2026-05-22 13:20:56 +02:00
n8n-gitea was assigned by Anexim 2026-05-22 13:20:56 +02:00
Author
Owner

Starting 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.

Starting 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.
Author
Owner

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:

  • Added getGuardianForFloor(floor) — unified lookup that merges static GUARDIANS (floors 10-100) with extended procedural system (compound 110, exotic 120-140, combo 150+)
  • Added getAllGuardianFloors() — returns all guardian floors from both systems
  • Fixed ALL_GUARDIAN_FLOORS to include all static floors (was missing floor 80)

src/components/game/tabs/GuardianPactsTab.tsx:

  • Now uses getGuardianForFloor() and getAllGuardianFloors() instead of just GUARDIANS constant
  • Updated tier filters to cover the full floor range:
    • Early Spire (10–40)
    • Mid Spire (50–80)
    • Late Spire (90–100)
    • Compound (110)
    • Exotic (120–140)
    • Transcendent (150+)
  • Cumulative boons calculation now uses unified lookup

src/components/game/tabs/guardian-pacts-components.tsx:

  • Added getElementDisplays() helper that parses combo elements like "fire+water" into individual element data
  • Guardian cards now display multiple element symbols side-by-side for combo guardians
  • Combo guardians show "✦ Combo" badge and element names joined with " + " (e.g., "Fire + Water")
  • Exported FloorTier interface for use in parent component

Test Results

  • All 32 spire-utils tests pass
  • All 13 GuardianPactsTab tests pass
  • No guardian-related type errors
  • Pre-commit checks pass (all files under 400 lines)

Bundled in same commit

  • craftingStore.ts: Extracted initial equipment instances to new crafting-initial-state.ts file (from previous session work)
## 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`:** - Added `getGuardianForFloor(floor)` — unified lookup that merges static `GUARDIANS` (floors 10-100) with extended procedural system (compound 110, exotic 120-140, combo 150+) - Added `getAllGuardianFloors()` — returns all guardian floors from both systems - Fixed `ALL_GUARDIAN_FLOORS` to include all static floors (was missing floor 80) **`src/components/game/tabs/GuardianPactsTab.tsx`:** - Now uses `getGuardianForFloor()` and `getAllGuardianFloors()` instead of just `GUARDIANS` constant - Updated tier filters to cover the full floor range: - Early Spire (10–40) - Mid Spire (50–80) - Late Spire (90–100) - Compound (110) - Exotic (120–140) - Transcendent (150+) - Cumulative boons calculation now uses unified lookup **`src/components/game/tabs/guardian-pacts-components.tsx`:** - Added `getElementDisplays()` helper that parses combo elements like `"fire+water"` into individual element data - Guardian cards now display multiple element symbols side-by-side for combo guardians - Combo guardians show "✦ Combo" badge and element names joined with " + " (e.g., "Fire + Water") - Exported `FloorTier` interface for use in parent component ### Test Results - All 32 spire-utils tests pass ✅ - All 13 GuardianPactsTab tests pass ✅ - No guardian-related type errors ✅ - Pre-commit checks pass (all files under 400 lines) ✅ ### Bundled in same commit - `craftingStore.ts`: Extracted initial equipment instances to new `crafting-initial-state.ts` file (from previous session work)
Author
Owner

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.

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.
Anexim added ai:review and removed ai:todo labels 2026-05-23 14:05:55 +02:00
Author
Owner

Additional Fixes Applied

The initial implementation (comments #781, #782) correctly unified the GuardianPactsTab with getGuardianForFloor() and getAllGuardianFloors(), but several other files still referenced the static GUARDIANS constant directly. This meant pact multipliers, the Spire Summary tab, and debug tools would not work for extended guardians (floors 110+).

Changes Made

  1. src/lib/game/utils/pact-utils.ts — Replaced GUARDIANS[floor] with getGuardianForFloor(floor) in both computePactMultiplier() and computePactInsightMultiplier(). This was the most critical bug: pact multipliers for floors 110+ were silently returning 1.0 (no bonus).

  2. src/components/game/tabs/SpireSummaryTab.tsx — Replaced all GUARDIANS references with getGuardianForFloor()/getAllGuardianFloors(). Updated type annotations from typeof GUARDIANS[number] to GuardianDef. The floor progress bar, guardian roster, and next guardian card now show all guardians including compound/exotic/combo.

  3. src/components/game/debug/PactDebug.tsx — Switched to unified lookup; added null guards since getGuardianForFloor() can return null.

  4. src/components/game/tabs/DebugTab/PactDebugSection.tsx — Same fixes as PactDebug.tsx.

Test Results

  • All 64 guardian/spire/pact tests pass
  • All files under 400 lines
  • No new TypeScript errors in changed files
  • Pre-commit checks pass
## Additional Fixes Applied The initial implementation (comments #781, #782) correctly unified the GuardianPactsTab with `getGuardianForFloor()` and `getAllGuardianFloors()`, but several other files still referenced the static `GUARDIANS` constant directly. This meant pact multipliers, the Spire Summary tab, and debug tools would not work for extended guardians (floors 110+). ### Changes Made 1. **`src/lib/game/utils/pact-utils.ts`** — Replaced `GUARDIANS[floor]` with `getGuardianForFloor(floor)` in both `computePactMultiplier()` and `computePactInsightMultiplier()`. This was the most critical bug: pact multipliers for floors 110+ were silently returning 1.0 (no bonus). 2. **`src/components/game/tabs/SpireSummaryTab.tsx`** — Replaced all `GUARDIANS` references with `getGuardianForFloor()`/`getAllGuardianFloors()`. Updated type annotations from `typeof GUARDIANS[number]` to `GuardianDef`. The floor progress bar, guardian roster, and next guardian card now show all guardians including compound/exotic/combo. 3. **`src/components/game/debug/PactDebug.tsx`** — Switched to unified lookup; added null guards since `getGuardianForFloor()` can return null. 4. **`src/components/game/tabs/DebugTab/PactDebugSection.tsx`** — Same fixes as PactDebug.tsx. ### Test Results - All 64 guardian/spire/pact tests pass ✅ - All files under 400 lines ✅ - No new TypeScript errors in changed files ✅ - Pre-commit checks pass ✅
Author
Owner

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+).

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+).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#124