[feature: guardian-restructure] Restructure guardian progression system #201

Closed
opened 2026-05-29 13:05:09 +02:00 by Anexim · 2 comments
Owner

FEATURE: Complete guardian progression restructure for dynamic element support

Current Guardian Layout

Floors 10-140: Base elements (fire, water, air, earth, light, dark, death) → Utility (transference) → Composite (metal, sand, lightning) → Exotic (crystal, stellar, void)
Floors 150-240: Dual-element combo guardians cycling through 9 pairs

Desired Guardian Progression

New progression should be:

  1. Base Elements (🔥💧🌬️⛰️🔗☀️🌑💀) - floors ~10-80
  2. Composite Mana Types (⚙️ + new types) - floors ~90-120
  3. Composite + Components (e.g., fire+earth+metal) - floors ~130-160
  4. Exotic Mana Types (💎🕳️ + new types) - floors ~170-200
  5. Dual Element (element pairs) - floors ~210+
  6. Dual Composite + Components (e.g., metal+sand+fire+earth+water) - floors ~250+
  7. Exotic + Components (e.g., crystal+sand+light+earth+water) - floors ~300+
  8. Exotic + Composite + Components - floors ~350+
  9. 1 Exotic + 2 Composite + All Components - floors ~400+

Technical Requirements

  • Guardian element field must become an array (currently single string)
  • System must be dynamic to accommodate future new elements
  • Guardian floors must always match guardian element(s)
  • Guardian name generation must support multi-element names
  • unlocksMana must unlock ALL component chain elements
  • getAllGuardianFloors() must be computed dynamically, not hardcoded

Touchpoints

  • src/lib/game/types/attunements.ts - GuardianDef.element type
  • src/lib/game/data/guardian-data.ts - Static guardian definitions
  • src/lib/game/data/guardian-encounters.ts - Procedural guardian generation

Priority

Core feature for game depth expansion

**FEATURE: Complete guardian progression restructure for dynamic element support** ### Current Guardian Layout Floors 10-140: Base elements (fire, water, air, earth, light, dark, death) → Utility (transference) → Composite (metal, sand, lightning) → Exotic (crystal, stellar, void) Floors 150-240: Dual-element combo guardians cycling through 9 pairs ### Desired Guardian Progression **New progression should be:** 1. **Base Elements** (🔥💧🌬️⛰️🔗☀️🌑💀) - floors ~10-80 2. **Composite Mana Types** (⚙️⏳⚡ + new types) - floors ~90-120 3. **Composite + Components** (e.g., fire+earth+metal) - floors ~130-160 4. **Exotic Mana Types** (💎⭐🕳️ + new types) - floors ~170-200 5. **Dual Element** (element pairs) - floors ~210+ 6. **Dual Composite + Components** (e.g., metal+sand+fire+earth+water) - floors ~250+ 7. **Exotic + Components** (e.g., crystal+sand+light+earth+water) - floors ~300+ 8. **Exotic + Composite + Components** - floors ~350+ 9. **1 Exotic + 2 Composite + All Components** - floors ~400+ ### Technical Requirements - Guardian `element` field must become an array (currently single `string`) - System must be **dynamic** to accommodate future new elements - Guardian floors must always match guardian element(s) - Guardian name generation must support multi-element names - `unlocksMana` must unlock ALL component chain elements - `getAllGuardianFloors()` must be computed dynamically, not hardcoded ### Touchpoints - `src/lib/game/types/attunements.ts` - GuardianDef.element type - `src/lib/game/data/guardian-data.ts` - Static guardian definitions - `src/lib/game/data/guardian-encounters.ts` - Procedural guardian generation ### Priority Core feature for game depth expansion
Anexim added the ai:todo label 2026-05-29 13:05:09 +02:00
n8n-gitea was assigned by Anexim 2026-05-29 13:05:09 +02:00
Author
Owner

Starting work on guardian progression restructure. Plan:

  1. Update GuardianDef.element from string → string[]
  2. Add resolveUnlockChain() utility for component chain resolution
  3. Restructure guardian-data.ts with new 9-tier progression
  4. Rewrite guardian-encounters.ts with dynamic procedural generation
  5. Update all consumers (room-utils, spire-utils, combat-utils, debug components)
  6. Verify tests pass
Starting work on guardian progression restructure. Plan: 1. Update GuardianDef.element from string → string[] 2. Add resolveUnlockChain() utility for component chain resolution 3. Restructure guardian-data.ts with new 9-tier progression 4. Rewrite guardian-encounters.ts with dynamic procedural generation 5. Update all consumers (room-utils, spire-utils, combat-utils, debug components) 6. Verify tests pass
Author
Owner

Guardian Progression Restructure — Complete

What was done

Type change: GuardianDef.element changed from stringstring[] in types/attunements.ts

New 9-tier guardian progression:

  • Tier 1: Base + Utility (floors 10–80) — 8 static guardians
  • Tier 2: Composite (floors 90–110) — 3 static guardians
  • Tier 3: Composite + Components (floors 130–160) — 4 static guardians
  • Tier 4: Exotic (floors 170–200) — 4 static guardians
  • Tier 5: Dual Element Pairs (floors 210–240) — procedural
  • Tier 6: Dual Composite + Components (floors 250–290) — procedural
  • Tier 7: Exotic + Components (floors 300–340) — procedural
  • Tier 8: Exotic + Composite + Components (floors 350–390) — procedural
  • Tier 9: Full Fusion — 1 Exotic + 2 Composite + All Components (floors 400+) — procedural

New utility: guardian-utils.ts with:

  • resolveUnlockChain(element) — walks ELEMENTS recipe tree to collect all base components
  • resolveMultiUnlockChain(elements) — union of chains for multi-element guardians
  • computeGuardianFloors(maxFloor) — dynamic floor computation

Key design decisions:

  • unlocksMana now automatically resolves full component chains (e.g., metal guardian → unlocks fire, earth, metal)
  • getAllGuardianFloors() is dynamically computed from static + procedural definitions
  • isGuardianFloor() uses floor % 10 === 0 && floor >= 10 — no upper bound
  • Enemy state stores element as '+'-joined string for backward compat with EnemyState.element: string
  • Multi-element guardian names use hyphenated prefixes: "Ignis-Aqua the Warden"
  • Color blending for dual-element guardians via midpoint RGB

Files changed (19):

  • src/lib/game/types/attunements.ts — element type change
  • src/lib/game/data/guardian-data.ts — full rewrite with new tier layout and mk() helper
  • src/lib/game/data/guardian-encounters.ts — procedural tiers 5-9, dynamic getAllGuardianFloors()
  • src/lib/game/utils/guardian-utils.ts — NEW: unlock chain resolution + floor computation
  • src/lib/game/utils/room-utils.ts.join('+') for enemy element
  • src/lib/game/utils/spire-utils.ts.join('+') for enemy element
  • src/lib/game/utils/combat-utils.ts.includes() instead of === for element check
  • Debug components (PactDebug, PactDebugSection, SpireSummaryTab) — array-aware rendering
  • guardian-pacts-components.tsx — getElementDisplays accepts string | string[]
  • Test files updated for new API and floor layout

**All 895 tests passing. All files under 400 lines. No circular dependencies.

## Guardian Progression Restructure — Complete ✅ ### What was done **Type change:** `GuardianDef.element` changed from `string` → `string[]` in `types/attunements.ts` **New 9-tier guardian progression:** - Tier 1: Base + Utility (floors 10–80) — 8 static guardians - Tier 2: Composite (floors 90–110) — 3 static guardians - Tier 3: Composite + Components (floors 130–160) — 4 static guardians - Tier 4: Exotic (floors 170–200) — 4 static guardians - Tier 5: Dual Element Pairs (floors 210–240) — procedural - Tier 6: Dual Composite + Components (floors 250–290) — procedural - Tier 7: Exotic + Components (floors 300–340) — procedural - Tier 8: Exotic + Composite + Components (floors 350–390) — procedural - Tier 9: Full Fusion — 1 Exotic + 2 Composite + All Components (floors 400+) — procedural **New utility:** `guardian-utils.ts` with: - `resolveUnlockChain(element)` — walks ELEMENTS recipe tree to collect all base components - `resolveMultiUnlockChain(elements)` — union of chains for multi-element guardians - `computeGuardianFloors(maxFloor)` — dynamic floor computation **Key design decisions:** - `unlocksMana` now automatically resolves full component chains (e.g., metal guardian → unlocks fire, earth, metal) - `getAllGuardianFloors()` is dynamically computed from static + procedural definitions - `isGuardianFloor()` uses `floor % 10 === 0 && floor >= 10` — no upper bound - Enemy state stores element as `'+'`-joined string for backward compat with `EnemyState.element: string` - Multi-element guardian names use hyphenated prefixes: `"Ignis-Aqua the Warden"` - Color blending for dual-element guardians via midpoint RGB **Files changed (19):** - `src/lib/game/types/attunements.ts` — element type change - `src/lib/game/data/guardian-data.ts` — full rewrite with new tier layout and `mk()` helper - `src/lib/game/data/guardian-encounters.ts` — procedural tiers 5-9, dynamic `getAllGuardianFloors()` - `src/lib/game/utils/guardian-utils.ts` — NEW: unlock chain resolution + floor computation - `src/lib/game/utils/room-utils.ts` — `.join('+')` for enemy element - `src/lib/game/utils/spire-utils.ts` — `.join('+')` for enemy element - `src/lib/game/utils/combat-utils.ts` — `.includes()` instead of `===` for element check - Debug components (PactDebug, PactDebugSection, SpireSummaryTab) — array-aware rendering - guardian-pacts-components.tsx — `getElementDisplays` accepts `string | string[]` - Test files updated for new API and floor layout **All 895 tests passing. All files under 400 lines. No circular dependencies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#201