fix: complete golemancy component-based redesign cleanup
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m18s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m18s
- Fix summonGolemsForRoom to use golemLoadout instead of removed enabledGolems - Fix discBonus hardcoded to 0 in golem-combat.ts pipeline (now computed from discipline effects) - Remove deprecated types: SummonedGolem, ActiveGolem, GolemDef - Remove legacy GolemancyState fields: enabledGolems, summonedGolems, legacyActiveGolems - Remove orphaned store actions: toggleGolem, setEnabledGolems - Delete orphaned legacy data files: base-golems.ts, elemental-golems.ts, hybrid-golems.ts - Update GolemDebugSection to use new golemLoadout system - Update golemancy-spec.md §17 to reflect all features as complete - Update all test files to match new type shapes - All 958 tests passing
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import { createSafeStorage } from '../utils/safe-persist';
|
||||
import type { GameAction, SpellState, FloorState, GolemancyState, ActivityLogEntry, AchievementState, EquipmentSpellState, ActivityEventType, ActiveGolem, RuntimeActiveGolem, EnemyState, EquipmentInstance } from '../types';
|
||||
import type { GameAction, SpellState, FloorState, GolemancyState, ActivityLogEntry, AchievementState, EquipmentSpellState, ActivityEventType, RuntimeActiveGolem, EnemyState, EquipmentInstance } from '../types';
|
||||
import { getFloorMaxHP } from '../utils';
|
||||
import { generateSpireFloorState, getRoomsForFloor } from '../utils/spire-utils';
|
||||
import { addActivityLogEntry } from '../utils/activity-log';
|
||||
@@ -55,15 +55,10 @@ export const useCombatStore = create<CombatStore>()(
|
||||
|
||||
// Golemancy (component-based)
|
||||
golemancy: {
|
||||
// New component-based fields
|
||||
golemDesigns: {},
|
||||
golemLoadout: [],
|
||||
activeGolems: [] as RuntimeActiveGolem[],
|
||||
lastSummonFloor: 0,
|
||||
// Legacy fields (deprecated)
|
||||
enabledGolems: [],
|
||||
summonedGolems: [],
|
||||
legacyActiveGolems: [],
|
||||
},
|
||||
|
||||
// Equipment spell states
|
||||
@@ -204,7 +199,7 @@ export const useCombatStore = create<CombatStore>()(
|
||||
currentRoomIndex: 0,
|
||||
roomsPerFloor: 1,
|
||||
maxFloorReached: Math.max(s.maxFloorReached, 1),
|
||||
golemancy: { ...s.golemancy, activeGolems: [] as RuntimeActiveGolem[], summonedGolems: [], legacyActiveGolems: [] },
|
||||
golemancy: { ...s.golemancy, activeGolems: [] as RuntimeActiveGolem[] },
|
||||
};
|
||||
});
|
||||
},
|
||||
@@ -224,27 +219,6 @@ export const useCombatStore = create<CombatStore>()(
|
||||
stayLongerInRoom: () => stayLongerInRoom(get, set),
|
||||
|
||||
// Golemancy
|
||||
toggleGolem: (golemId: string) => {
|
||||
set((s) => {
|
||||
const enabledGolems = s.golemancy?.enabledGolems || [];
|
||||
const isEnabled = enabledGolems.includes(golemId);
|
||||
return {
|
||||
golemancy: {
|
||||
...s.golemancy,
|
||||
enabledGolems: isEnabled
|
||||
? enabledGolems.filter(id => id !== golemId)
|
||||
: [...enabledGolems, golemId]
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
setEnabledGolems: (golemIds: string[]) => {
|
||||
set((s) => ({
|
||||
golemancy: { ...s.golemancy, enabledGolems: golemIds },
|
||||
}));
|
||||
},
|
||||
|
||||
addGolemDesign: (d) => addGolemDesign(set, d),
|
||||
removeGolemDesign: (id) => removeGolemDesign(set, id),
|
||||
toggleGolemLoadoutEntry: (id) => toggleGolemLoadoutEntry(set, id),
|
||||
|
||||
Reference in New Issue
Block a user