[priority: highest] fix: Guardian pact signing does not unlock mana types (unlocksMana field is dead code) #138

Closed
opened 2026-05-26 15:26:04 +02:00 by Anexim · 2 comments
Owner

Problem

Every guardian definition in guardian-data.ts has an unlocksMana: string[] field listing which mana types are granted when the pact is signed (e.g. Ignis Prime at floor 10 grants ['fire', 'lightning']). However, neither the tick pipeline in gameStore.ts nor the completePactRitual action in prestigeStore.ts ever reads this field or calls unlockElement().

A search for unlocksMana across all store files returns zero results. The field is pure data with no runtime consumer.

As a result, signing a pact with any guardian does NOT grant the player access to the corresponding mana type. Fire mana, for instance, can only be obtained through debug panels.

What Needs to Change

  1. In src/lib/game/stores/gameStore.ts tick pipeline, after signing a pact:

    • Read guardian.unlocksMana from guardian-data.ts
    • Call useManaStore.getState().unlockElement(manaType) for each mana type
  2. In src/lib/game/stores/prestigeStore.ts completePactRitual():

    • Same: read guardian.unlocksMana and call unlockElement() for each

Guardian → Mana Mapping (from data)

Floor Guardian unlocksMana
10 Ignis Prime ['fire', 'lightning']
20 Aqua Regia ['water', 'sand']
30 Ventus Rex ['air']
40 Terra Firma ['earth', 'metal']
50 Lux Aeterna ['light', 'crystal']
60 Umbra Mortis ['dark', 'void']
70 Mors Ultima ['death']
80 Vinculum Arcana ['transference']
90-140 Procedural One mana type each

Files

  • src/lib/game/stores/gameStore.ts — tick pipeline pact signing (~line 223-240)
  • src/lib/game/stores/prestigeStore.tscompletePactRitual() (~line 147-160)
  • src/lib/game/stores/manaStore.tsunlockElement() (already exists, only used by debug)

Test References

  • src/lib/game/__tests__/cross-module-prestige-discipline.test.ts — pact signing tests exist but don't verify mana unlocks
## Problem Every guardian definition in `guardian-data.ts` has an `unlocksMana: string[]` field listing which mana types are granted when the pact is signed (e.g. Ignis Prime at floor 10 grants `['fire', 'lightning']`). However, **neither the tick pipeline in `gameStore.ts` nor the `completePactRitual` action in `prestigeStore.ts` ever reads this field or calls `unlockElement()`**. A search for `unlocksMana` across all store files returns **zero results**. The field is pure data with no runtime consumer. As a result, signing a pact with any guardian does NOT grant the player access to the corresponding mana type. Fire mana, for instance, can only be obtained through debug panels. ## What Needs to Change 1. In `src/lib/game/stores/gameStore.ts` tick pipeline, after signing a pact: - Read `guardian.unlocksMana` from `guardian-data.ts` - Call `useManaStore.getState().unlockElement(manaType)` for each mana type 2. In `src/lib/game/stores/prestigeStore.ts` `completePactRitual()`: - Same: read `guardian.unlocksMana` and call `unlockElement()` for each ## Guardian → Mana Mapping (from data) | Floor | Guardian | unlocksMana | |-------|----------|-------------| | 10 | Ignis Prime | `['fire', 'lightning']` | | 20 | Aqua Regia | `['water', 'sand']` | | 30 | Ventus Rex | `['air']` | | 40 | Terra Firma | `['earth', 'metal']` | | 50 | Lux Aeterna | `['light', 'crystal']` | | 60 | Umbra Mortis | `['dark', 'void']` | | 70 | Mors Ultima | `['death']` | | 80 | Vinculum Arcana | `['transference']` | | 90-140 | Procedural | One mana type each | ## Files - `src/lib/game/stores/gameStore.ts` — tick pipeline pact signing (~line 223-240) - `src/lib/game/stores/prestigeStore.ts` — `completePactRitual()` (~line 147-160) - `src/lib/game/stores/manaStore.ts` — `unlockElement()` (already exists, only used by debug) ## Test References - `src/lib/game/__tests__/cross-module-prestige-discipline.test.ts` — pact signing tests exist but don't verify mana unlocks
Anexim added the ai:todo label 2026-05-26 15:26:04 +02:00
n8n-gitea was assigned by Anexim 2026-05-26 15:26:04 +02:00
Anexim changed title from fix: Guardian pact signing does not unlock mana types (unlocksMana field is dead code) to [priority: highest] fix: Guardian pact signing does not unlock mana types (unlocksMana field is dead code) 2026-05-26 15:29:09 +02:00
Author
Owner

Starting fix for guardian pact signing not unlocking mana types. Will modify gameStore.ts tick pipeline and prestigeStore.ts completePactRitual to call unlockElement() for each mana type in guardian.unlocksMana.

Starting fix for guardian pact signing not unlocking mana types. Will modify gameStore.ts tick pipeline and prestigeStore.ts completePactRitual to call unlockElement() for each mana type in guardian.unlocksMana.
Author
Owner

Fixed. Guardian pact signing now calls unlockElement(manaType, 0) for each mana type in guardian.unlocksMana in both:

  • gameStore.ts tick pipeline (pact ritual completion path)
  • prestigeStore.ts completePactRitual() (UI-triggered path)

Committed as ae30c47. All 885 tests pass.

Fixed. Guardian pact signing now calls `unlockElement(manaType, 0)` for each mana type in `guardian.unlocksMana` in both: - `gameStore.ts` tick pipeline (pact ritual completion path) - `prestigeStore.ts` `completePactRitual()` (UI-triggered path) Committed as ae30c47. All 885 tests pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#138