refactor: remove memory slot system and Memories section from PrestigeTab
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m26s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m26s
- Remove deepMemory prestige upgrade from constants/prestige.ts - Remove Memory interface from types.ts - Remove memorySlots, memories, addMemory, removeMemory, clearMemories from prestigeStore.ts - Remove deepMemory/memory references from gameLoopActions.ts - Remove MemoriesCard component and its usage from PrestigeTab.tsx - Remove memorySlots display from LoopStatsSection.tsx - Update tests: store-actions-combat-prestige.test.ts, PrestigeTab.test.ts, tick-integration.test.ts The memory slot system was fully wired but had no gameplay mechanic — addMemory() was never called outside tests. This removes dead code across 9 files.
This commit is contained in:
@@ -39,8 +39,6 @@ export const createStartNewLoop = (set: (state: Partial<GameCoordinatorState>) =
|
||||
usePrestigeStore.getState().resetPrestigeForNewLoop(
|
||||
total,
|
||||
pu,
|
||||
prestigeState.memories,
|
||||
3 + (pu.deepMemory || 0)
|
||||
);
|
||||
usePrestigeStore.getState().incrementLoopCount();
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// ─── Prestige Store ───────────────────────────────────────────────────────────
|
||||
// Handles insight, prestige upgrades, memories, loops, pacts
|
||||
// Handles insight, prestige upgrades, loops, pacts
|
||||
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import { createSafeStorage } from '../utils/safe-persist';
|
||||
import type { Memory } from '../types';
|
||||
import { PRESTIGE_DEF } from '../constants';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import { ok, okVoid, fail, ErrorCode } from '../utils/result';
|
||||
@@ -23,12 +22,8 @@ export interface PrestigeState {
|
||||
|
||||
// Prestige upgrades
|
||||
prestigeUpgrades: Record<string, number>;
|
||||
memorySlots: number;
|
||||
pactSlots: number;
|
||||
|
||||
// Memories (skills preserved across loops)
|
||||
memories: Memory[];
|
||||
|
||||
// Guardian pacts
|
||||
defeatedGuardians: number[];
|
||||
signedPacts: number[];
|
||||
@@ -46,9 +41,6 @@ export interface PrestigeState {
|
||||
|
||||
export interface PrestigeActions {
|
||||
doPrestige: (id: string) => Result<void>;
|
||||
addMemory: (memory: Memory) => void;
|
||||
removeMemory: (skillId: string) => void;
|
||||
clearMemories: () => void;
|
||||
startPactRitual: (floor: number, rawMana: number) => Result<void>;
|
||||
cancelPactRitual: () => void;
|
||||
completePactRitual: (addLog: (msg: string) => void) => void;
|
||||
@@ -65,8 +57,6 @@ export interface PrestigeActions {
|
||||
resetPrestigeForNewLoop: (
|
||||
totalInsight: number,
|
||||
prestigeUpgrades: Record<string, number>,
|
||||
memories: Memory[],
|
||||
memorySlots: number
|
||||
) => void;
|
||||
|
||||
// Loop management
|
||||
@@ -98,9 +88,7 @@ const initialState: PrestigeState = {
|
||||
totalInsight: 0,
|
||||
loopInsight: 0,
|
||||
prestigeUpgrades: {},
|
||||
memorySlots: 3,
|
||||
pactSlots: 1,
|
||||
memories: [],
|
||||
defeatedGuardians: [],
|
||||
signedPacts: [],
|
||||
signedPactDetails: {},
|
||||
@@ -126,30 +114,11 @@ export const usePrestigeStore = create<PrestigeStore>()(
|
||||
set({
|
||||
insight: state.insight - pd.cost,
|
||||
prestigeUpgrades: newPU,
|
||||
memorySlots: id === 'deepMemory' ? state.memorySlots + 1 : state.memorySlots,
|
||||
pactSlots: id === 'pactBinding' ? state.pactSlots + 1 : state.pactSlots,
|
||||
});
|
||||
return okVoid();
|
||||
},
|
||||
|
||||
addMemory: (memory: Memory) => {
|
||||
const state = get();
|
||||
if (state.memories.length >= state.memorySlots) return;
|
||||
if (state.memories.some(m => m.skillId === memory.skillId)) return;
|
||||
|
||||
set({ memories: [...state.memories, memory] });
|
||||
},
|
||||
|
||||
removeMemory: (skillId: string) => {
|
||||
set((state) => ({
|
||||
memories: state.memories.filter(m => m.skillId !== skillId),
|
||||
}));
|
||||
},
|
||||
|
||||
clearMemories: () => {
|
||||
set({ memories: [] });
|
||||
},
|
||||
|
||||
startPactRitual: (floor: number, rawMana: number) => {
|
||||
const state = get();
|
||||
const guardian = getGuardianForFloor(floor);
|
||||
@@ -242,14 +211,10 @@ export const usePrestigeStore = create<PrestigeStore>()(
|
||||
resetPrestigeForNewLoop: (
|
||||
totalInsight: number,
|
||||
prestigeUpgrades: Record<string, number>,
|
||||
memories: Memory[],
|
||||
memorySlots: number
|
||||
) => {
|
||||
set({
|
||||
insight: totalInsight,
|
||||
prestigeUpgrades,
|
||||
memories,
|
||||
memorySlots,
|
||||
// Reset loop-specific state
|
||||
defeatedGuardians: [],
|
||||
signedPacts: [],
|
||||
@@ -304,9 +269,7 @@ export const usePrestigeStore = create<PrestigeStore>()(
|
||||
totalInsight: state.totalInsight,
|
||||
loopInsight: state.loopInsight,
|
||||
prestigeUpgrades: state.prestigeUpgrades,
|
||||
memorySlots: state.memorySlots,
|
||||
pactSlots: state.pactSlots,
|
||||
memories: state.memories,
|
||||
defeatedGuardians: state.defeatedGuardians,
|
||||
signedPacts: state.signedPacts,
|
||||
signedPactDetails: state.signedPactDetails,
|
||||
|
||||
Reference in New Issue
Block a user