fix: resolve 7 medium-priority bugs from audit #372
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m1s

- #371: Replace Math.random() with seeded PRNG in getSpireEnemyArmor/Barrier
- #370: Add mana refund when cancelling pact ritual in cancelPactRitual
- #367: Add ENCHANT_MASTERY check for design slot 2 in crafting store
- #364: Fix useGameDerived to read crafting data from useCraftingStore
- #363: Clamp recovery room regen delta to prevent negative mana loss
- #365: Add shield/barrier/healthRegen fields to all procedural guardians
- #362: Refactor enchanting tick pipeline to return writes instead of direct store calls

Extracted procedural guardian generators into guardian-procedural.ts to stay under 400-line limit.

All 1158 tests pass.
This commit is contained in:
2026-06-11 11:37:06 +02:00
parent 2d9f0042ef
commit 9476e92a4b
11 changed files with 253 additions and 319 deletions
+9
View File
@@ -144,6 +144,15 @@ export const usePrestigeStore = create<PrestigeStore>()(
},
cancelPactRitual: () => {
const state = get();
if (state.pactRitualFloor !== null) {
const guardian = getGuardianForFloor(state.pactRitualFloor);
if (guardian) {
useManaStore.setState((s) => ({
rawMana: s.rawMana + guardian.pactCost,
}));
}
}
set({
pactRitualFloor: null,
pactRitualProgress: 0,