fix: guardian pact signing now unlocks mana types via unlockElement
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s

This commit is contained in:
2026-05-26 17:02:36 +02:00
parent b402b8f56e
commit ae30c4770c
5 changed files with 23 additions and 3 deletions
+10
View File
@@ -229,6 +229,16 @@ export const useGameStore = create<GameCoordinatorStore>()(
if (newProgress >= requiredTime) {
addLog(`📜 Pact signed with ${guardian.name}! You have gained their boons.`);
// Unlock mana types granted by this guardian
const manaStore = useManaStore.getState();
for (const manaType of guardian.unlocksMana || []) {
const result = manaStore.unlockElement(manaType, 0);
if (result.ok) {
addLog(`${manaType.charAt(0).toUpperCase() + manaType.slice(1)} mana unlocked!`);
}
}
writes.prestige = {
...(writes.prestige || {}),
signedPacts: [...ctx.prestige.signedPacts, ctx.prestige.pactRitualFloor],
+10
View File
@@ -6,6 +6,7 @@ import { persist } from 'zustand/middleware';
import { createSafeStorage } from '../utils/safe-persist';
import { PRESTIGE_DEF } from '../constants';
import { getGuardianForFloor } from '../data/guardian-encounters';
import { useManaStore } from './manaStore';
import { okVoid, fail, ErrorCode } from '../utils/result';
import type { Result } from '../utils/result';
@@ -151,6 +152,15 @@ export const usePrestigeStore = create<PrestigeStore>()(
const guardian = getGuardianForFloor(state.pactRitualFloor);
if (!guardian) return;
// Unlock mana types granted by this guardian
const manaStore = useManaStore.getState();
for (const manaType of guardian.unlocksMana || []) {
const result = manaStore.unlockElement(manaType, 0);
if (result.ok) {
addLog(`${manaType.charAt(0).toUpperCase() + manaType.slice(1)} mana unlocked!`);
}
}
set({
signedPacts: [...state.signedPacts, state.pactRitualFloor],
defeatedGuardians: state.defeatedGuardians.filter(f => f !== state.pactRitualFloor),