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:
@@ -28,9 +28,9 @@ describe('Tab barrel export', () => {
|
||||
// ─── Test: Prestige upgrade definitions ────────────────────────────────────────
|
||||
|
||||
describe('Prestige upgrade definitions', () => {
|
||||
it('has exactly 14 prestige upgrades', async () => {
|
||||
it('has exactly 13 prestige upgrades', async () => {
|
||||
const { PRESTIGE_DEF } = await import('@/lib/game/constants/prestige');
|
||||
expect(Object.keys(PRESTIGE_DEF).length).toBe(14);
|
||||
expect(Object.keys(PRESTIGE_DEF).length).toBe(13);
|
||||
});
|
||||
|
||||
it('all upgrades have required fields', async () => {
|
||||
@@ -46,7 +46,7 @@ describe('Prestige upgrade definitions', () => {
|
||||
it('all 14 expected upgrade IDs are present', async () => {
|
||||
const { PRESTIGE_DEF } = await import('@/lib/game/constants/prestige');
|
||||
const expectedIds = [
|
||||
'manaWell', 'manaFlow', 'deepMemory', 'insightAmp', 'spireKey',
|
||||
'manaWell', 'manaFlow', 'insightAmp', 'spireKey',
|
||||
'temporalEcho', 'steadyHand', 'ancientKnowledge', 'elementalAttune',
|
||||
'spellMemory', 'guardianPact', 'quickStart', 'elemStart',
|
||||
'unlockedManaTypeCapacity',
|
||||
|
||||
@@ -56,33 +56,6 @@ function InsightSummary({ insight, totalInsight, loopCount, loopInsight }: {
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Memories Card ────────────────────────────────────────────────────────────
|
||||
|
||||
function MemoriesCard({ memories, memorySlots }: { memories: { skillId: string; level: number; tier: number }[]; memorySlots: number }) {
|
||||
return (
|
||||
<Card className="bg-gray-900/60 border-gray-700">
|
||||
<SectionHeader title="🧠 Memories" />
|
||||
<CardContent className="pt-0">
|
||||
<p className="text-xs text-gray-400 mb-2">
|
||||
Skills carried between loops. Slots: {memories.length}/{memorySlots}
|
||||
</p>
|
||||
{memories.length === 0 ? (
|
||||
<p className="text-xs text-gray-500 italic">No memories stored yet.</p>
|
||||
) : (
|
||||
<div className="space-y-1">
|
||||
{memories.map((m) => (
|
||||
<div key={m.skillId} className="text-xs text-gray-300 flex justify-between">
|
||||
<span>{m.skillId}</span>
|
||||
<span className="text-gray-500">Lv.{m.level} T{m.tier}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Pacts Card ───────────────────────────────────────────────────────────────
|
||||
|
||||
function PactsCard({ signedPacts, pactSlots, defeatedGuardians }: {
|
||||
@@ -177,7 +150,7 @@ function ResetLoopSection({ loopInsight, onReset }: { loopInsight: number; onRes
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-red-400">Reset Loop</h3>
|
||||
<p className="text-xs text-gray-400 mt-1">
|
||||
End the current loop and gain {fmt(loopInsight)} insight. Your prestige upgrades, memories, and pacts are preserved.
|
||||
End the current loop and gain {fmt(loopInsight)} insight. Your prestige upgrades and pacts are preserved.
|
||||
</p>
|
||||
</div>
|
||||
<AlertDialog>
|
||||
@@ -191,7 +164,7 @@ function ResetLoopSection({ loopInsight, onReset }: { loopInsight: number; onRes
|
||||
<AlertDialogTitle>Reset the Loop?</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
This will end your current loop and award you <strong className="text-amber-400">{fmt(loopInsight)} insight</strong>.
|
||||
Your prestige upgrades, memories, and pacts will be preserved.
|
||||
Your prestige upgrades and pacts will be preserved.
|
||||
<br /><br />
|
||||
Day, hour, mana, floor progress, and combat state will be reset.
|
||||
</AlertDialogDescription>
|
||||
@@ -221,8 +194,6 @@ export function PrestigeTab() {
|
||||
loopInsight,
|
||||
loopCount,
|
||||
prestigeUpgrades,
|
||||
memorySlots,
|
||||
memories,
|
||||
pactSlots,
|
||||
signedPacts,
|
||||
defeatedGuardians,
|
||||
@@ -233,8 +204,6 @@ export function PrestigeTab() {
|
||||
loopInsight: s.loopInsight,
|
||||
loopCount: s.loopCount,
|
||||
prestigeUpgrades: s.prestigeUpgrades,
|
||||
memorySlots: s.memorySlots,
|
||||
memories: s.memories,
|
||||
pactSlots: s.pactSlots,
|
||||
signedPacts: s.signedPacts,
|
||||
defeatedGuardians: s.defeatedGuardians,
|
||||
@@ -275,10 +244,7 @@ export function PrestigeTab() {
|
||||
loopInsight={loopInsight}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<MemoriesCard memories={memories} memorySlots={memorySlots} />
|
||||
<PactsCard signedPacts={signedPacts} pactSlots={pactSlots} defeatedGuardians={defeatedGuardians} />
|
||||
</div>
|
||||
<PactsCard signedPacts={signedPacts} pactSlots={pactSlots} defeatedGuardians={defeatedGuardians} />
|
||||
|
||||
<Card className="bg-gray-900/60 border-gray-700">
|
||||
<SectionHeader title="⬆️ Prestige Upgrades" />
|
||||
|
||||
@@ -14,7 +14,6 @@ export function LoopStatsSection() {
|
||||
const maxFloorReached = useCombatStore((s) => s.maxFloorReached);
|
||||
const totalManaGathered = useManaStore((s) => s.totalManaGathered);
|
||||
const loopCount = usePrestigeStore((s) => s.loopCount);
|
||||
const memorySlots = usePrestigeStore((s) => s.memorySlots);
|
||||
|
||||
const spellsLearned = Object.values(spells || {}).filter((s: SpellState) => s.learned).length;
|
||||
|
||||
@@ -46,7 +45,7 @@ export function LoopStatsSection() {
|
||||
</div>
|
||||
</div>
|
||||
<Separator className="bg-[var(--border-subtle)] my-3" />
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||
<div className="p-3 bg-[var(--bg-sunken)]/50 rounded text-center">
|
||||
<div className="text-xl font-bold text-[var(--text-secondary)] game-mono">{spellsLearned}</div>
|
||||
<div className="text-xs" style={{ color: 'var(--text-muted)' }}>Spells Learned</div>
|
||||
@@ -55,10 +54,6 @@ export function LoopStatsSection() {
|
||||
<div className="text-xl font-bold text-[var(--text-secondary)] game-mono">{fmt(totalManaGathered)}</div>
|
||||
<div className="text-xs" style={{ color: 'var(--text-muted)' }}>Total Mana Gathered</div>
|
||||
</div>
|
||||
<div className="p-3 bg-[var(--bg-sunken)]/50 rounded text-center">
|
||||
<div className="text-xl font-bold text-[var(--text-secondary)] game-mono">{memorySlots}</div>
|
||||
<div className="text-xs" style={{ color: 'var(--text-muted)' }}>Memory Slots</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user