fix(#170): wire fabricator crafting completion + bonus enchantments + remove dead code
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// ─── Game Store (Coordinator) ─────────────────────────────────────────────────
|
||||
// ─── Game Store (Coordinator) ──────────────────────────────────────
|
||||
// Manages: day, hour, incursionStrength, containmentWards
|
||||
// Orchestrates tick across all stores via a read → compute → write pipeline.
|
||||
// Orchestrates tick across all stores via read → compute → write pipeline.
|
||||
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
@@ -11,13 +11,7 @@ import { computeEquipmentEffects } from '../effects';
|
||||
import type { ComputedEffects } from '../effects/upgrade-effects.types';
|
||||
|
||||
import { computeDisciplineEffects } from '../effects/discipline-effects';
|
||||
import {
|
||||
computeMaxMana,
|
||||
computeRegen,
|
||||
getMeditationBonus,
|
||||
getIncursionStrength,
|
||||
calcInsight
|
||||
} from '../utils';
|
||||
import { computeMaxMana, computeRegen, getMeditationBonus, getIncursionStrength, calcInsight } from '../utils';
|
||||
import { useUIStore } from './uiStore';
|
||||
import { usePrestigeStore } from './prestigeStore';
|
||||
import { useManaStore } from './manaStore';
|
||||
@@ -161,7 +155,6 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
return;
|
||||
}
|
||||
|
||||
// Incursion
|
||||
const incursionStrength = getIncursionStrength(day, hour);
|
||||
|
||||
// Meditation bonus tracking
|
||||
@@ -208,7 +201,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
});
|
||||
let totalManaGathered = ctx.mana.totalManaGathered;
|
||||
|
||||
// Convert action — delegate to manaStore
|
||||
// Convert action
|
||||
if (ctx.combat.currentAction === 'convert') {
|
||||
const convertResult = useManaStore.getState().processConvertAction(rawMana);
|
||||
if (convertResult) {
|
||||
@@ -217,7 +210,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
}
|
||||
}
|
||||
|
||||
// Pact ritual progress
|
||||
// Pact ritual
|
||||
if (ctx.prestige.pactRitualFloor !== null) {
|
||||
const guardian = getGuardianForFloor(ctx.prestige.pactRitualFloor);
|
||||
if (guardian) {
|
||||
@@ -253,7 +246,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
}
|
||||
}
|
||||
|
||||
// Discipline tick — process active disciplines (XP accrual + mana drain)
|
||||
// Discipline tick
|
||||
const disciplineResult = useDisciplineStore.getState().processTick({
|
||||
rawMana,
|
||||
elements,
|
||||
@@ -355,6 +348,14 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
};
|
||||
}
|
||||
|
||||
// Equipment crafting tick — advance progress and complete when done
|
||||
if (ctx.combat.currentAction === 'craft') {
|
||||
const craftingResult = useCraftingStore.getState().processEquipmentCraftingTick();
|
||||
if (craftingResult.logMessage) {
|
||||
addLog(craftingResult.logMessage);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Phase 3: Write — batch all state updates ─────────────────────────
|
||||
writes.game = { day, hour, incursionStrength };
|
||||
writes.mana = {
|
||||
|
||||
Reference in New Issue
Block a user