diff --git a/docs/project-structure.txt b/docs/project-structure.txt index 3c6b571..5277d4a 100644 --- a/docs/project-structure.txt +++ b/docs/project-structure.txt @@ -14,7 +14,6 @@ Mana-Loop/ │ ├── circular-deps.txt │ ├── dependency-graph.json │ └── project-structure.txt -├── e2e/ ├── playwright-report/ │ ├── data/ │ │ ├── 1513ea5b9ea5985996f67ca36f2bc4d34add51f1.webm @@ -87,7 +86,6 @@ Mana-Loop/ │ │ │ │ ├── PactDebug.tsx │ │ │ │ ├── debug-context.tsx │ │ │ │ └── index.tsx -│ │ │ ├── shared/ │ │ │ ├── tabs/ │ │ │ │ ├── CraftingTab/ │ │ │ │ │ ├── EnchanterSubTab.tsx @@ -192,207 +190,208 @@ Mana-Loop/ │ ├── hooks/ │ │ ├── use-mobile.ts │ │ └── use-toast.ts -│ └── lib/ -│ ├── game/ -│ │ ├── __tests__/ -│ │ │ ├── store-method-tests/ -│ │ │ ├── achievements.test.ts -│ │ │ ├── activity-log.test.ts -│ │ │ ├── bug-fixes.test.ts -│ │ │ ├── combat-actions.test.ts -│ │ │ ├── combat-utils.test.ts -│ │ │ ├── computed-stats.test.ts -│ │ │ ├── crafting-utils-basic.test.ts -│ │ │ ├── crafting-utils-equipment.test.ts -│ │ │ ├── crafting-utils-recipe.test.ts -│ │ │ ├── crafting-utils-time.test.ts -│ │ │ ├── cross-module-combat-meditation.test.ts -│ │ │ ├── cross-module-helpers.ts -│ │ │ ├── cross-module-lifecycle-consistency.test.ts -│ │ │ ├── cross-module-prestige-discipline.test.ts -│ │ │ ├── discipline-math.test.ts -│ │ │ ├── discipline-prerequisites.test.ts -│ │ │ ├── discipline-reactivate-bug.test.ts -│ │ │ ├── enemy-barrier-utils.test.ts -│ │ │ ├── enemy-generator.test.ts -│ │ │ ├── enemy-utils.test.ts -│ │ │ ├── floor-utils.test.ts -│ │ │ ├── floor-utils.upgraded.test.ts -│ │ │ ├── formatting.test.ts -│ │ │ ├── guardian-names.test.ts -│ │ │ ├── mana-utils.test.ts -│ │ │ ├── pact-utils.test.ts -│ │ │ ├── persistence.test.ts -│ │ │ ├── regression-fixes.test.ts -│ │ │ ├── room-utils-floor-state.test.ts -│ │ │ ├── room-utils.test.ts -│ │ │ ├── spire-utils.test.ts -│ │ │ ├── store-actions-combat-prestige.test.ts -│ │ │ ├── store-actions-discipline.test.ts -│ │ │ ├── store-actions-mana.test.ts -│ │ │ ├── store-actions.test.ts -│ │ │ └── tick-integration.test.ts -│ │ ├── constants/ -│ │ │ ├── spells-modules/ -│ │ │ │ ├── advanced-spells.ts -│ │ │ │ ├── aoe-spells.ts -│ │ │ │ ├── basic-elemental-spells.ts -│ │ │ │ ├── compound-spells.ts -│ │ │ │ ├── enchantment-spells.ts -│ │ │ │ ├── legendary-spells.ts -│ │ │ │ ├── lightning-spells.ts -│ │ │ │ ├── master-spells.ts -│ │ │ │ ├── raw-spells.ts -│ │ │ │ └── utility-spells.ts -│ │ │ ├── core.ts -│ │ │ ├── elements.ts -│ │ │ ├── index.ts -│ │ │ ├── prestige.ts -│ │ │ ├── rooms.ts -│ │ │ └── spells.ts -│ │ ├── crafting-actions/ -│ │ │ ├── application-actions.ts -│ │ │ ├── computed-getters.ts -│ │ │ ├── crafting-equipment-actions.ts -│ │ │ ├── crafting-material-actions.ts -│ │ │ ├── design-actions.ts -│ │ │ ├── disenchant-actions.ts -│ │ │ ├── equipment-actions.ts -│ │ │ ├── index.ts -│ │ │ └── preparation-actions.ts -│ │ ├── data/ -│ │ │ ├── disciplines/ -│ │ │ │ ├── base.ts -│ │ │ │ ├── elemental-regen-advanced.ts -│ │ │ │ ├── elemental-regen.ts -│ │ │ │ ├── elemental.ts -│ │ │ │ ├── enchanter-special.ts -│ │ │ │ ├── enchanter-spells.ts -│ │ │ │ ├── enchanter-utility.ts -│ │ │ │ ├── enchanter.ts -│ │ │ │ ├── fabricator.ts -│ │ │ │ ├── index.ts -│ │ │ │ └── invoker.ts -│ │ │ ├── enchantments/ -│ │ │ │ ├── spell-effects/ -│ │ │ │ │ ├── basic-spells.ts -│ │ │ │ │ ├── index.ts -│ │ │ │ │ ├── legendary-spells.ts -│ │ │ │ │ ├── lightning-spells.ts -│ │ │ │ │ ├── metal-spells.ts -│ │ │ │ │ ├── sand-spells.ts -│ │ │ │ │ ├── tier2-spells.ts -│ │ │ │ │ ├── tier3-spells.ts -│ │ │ │ │ └── types.ts -│ │ │ │ ├── combat-effects.ts -│ │ │ │ ├── defense-effects.ts -│ │ │ │ ├── elemental-effects.ts -│ │ │ │ ├── index.ts -│ │ │ │ ├── mana-effects.ts -│ │ │ │ ├── special-effects.ts -│ │ │ │ └── utility-effects.ts -│ │ │ ├── equipment/ -│ │ │ │ ├── accessories.ts -│ │ │ │ ├── body.ts -│ │ │ │ ├── casters.ts -│ │ │ │ ├── catalysts.ts -│ │ │ │ ├── equipment-types-data.ts -│ │ │ │ ├── feet.ts -│ │ │ │ ├── hands.ts -│ │ │ │ ├── head.ts -│ │ │ │ ├── index.ts -│ │ │ │ ├── shields.ts -│ │ │ │ ├── swords.ts -│ │ │ │ ├── types.ts -│ │ │ │ └── utils.ts -│ │ │ ├── golems/ -│ │ │ │ ├── base-golems.ts -│ │ │ │ ├── elemental-golems.ts -│ │ │ │ ├── golems-data.ts -│ │ │ │ ├── hybrid-golems.ts -│ │ │ │ ├── index.ts -│ │ │ │ ├── types.ts -│ │ │ │ └── utils.ts -│ │ │ ├── achievements.ts -│ │ │ ├── attunements.ts -│ │ │ ├── crafting-recipes.ts -│ │ │ ├── enchantment-effects.ts -│ │ │ ├── enchantment-types.ts -│ │ │ ├── fabricator-material-recipes.ts -│ │ │ ├── fabricator-physical-recipes.ts -│ │ │ ├── fabricator-recipe-types.ts -│ │ │ ├── fabricator-recipes.ts -│ │ │ ├── fabricator-wizard-recipes.ts -│ │ │ ├── guardian-data.ts -│ │ │ ├── guardian-encounters.ts -│ │ │ └── loot-drops.ts -│ │ ├── effects/ -│ │ │ ├── discipline-effects.ts -│ │ │ ├── dynamic-compute.ts -│ │ │ ├── special-effects.ts -│ │ │ ├── upgrade-effects.ts -│ │ │ └── upgrade-effects.types.ts -│ │ ├── hooks/ -│ │ │ └── useGameDerived.ts -│ │ ├── stores/ -│ │ │ ├── pipelines/ -│ │ │ │ └── pact-ritual.ts -│ │ │ ├── attunementStore.ts -│ │ │ ├── combat-actions.ts -│ │ │ ├── combat-state.types.ts -│ │ │ ├── combatStore.ts -│ │ │ ├── crafting-equipment-tick.ts -│ │ │ ├── crafting-initial-state.ts -│ │ │ ├── craftingStore.ts -│ │ │ ├── craftingStore.types.ts -│ │ │ ├── discipline-slice.ts -│ │ │ ├── gameActions.ts -│ │ │ ├── gameHooks.ts -│ │ │ ├── gameLoopActions.ts -│ │ │ ├── gameStore.ts -│ │ │ ├── gameStore.types.ts -│ │ │ ├── index.ts -│ │ │ ├── manaStore.ts -│ │ │ ├── prestigeStore.ts -│ │ │ ├── tick-pipeline.ts -│ │ │ └── uiStore.ts -│ │ ├── types/ -│ │ │ ├── attunements.ts -│ │ │ ├── disciplines.ts -│ │ │ ├── elements.ts -│ │ │ ├── equipment.ts -│ │ │ ├── equipmentSlot.ts -│ │ │ ├── game.ts -│ │ │ ├── index.ts -│ │ │ └── spells.ts -│ │ ├── utils/ -│ │ │ ├── activity-log.ts -│ │ │ ├── combat-utils.ts -│ │ │ ├── discipline-math.ts -│ │ │ ├── element-cap-bonus.ts -│ │ │ ├── enemy-generator.ts -│ │ │ ├── enemy-utils.ts -│ │ │ ├── floor-utils.ts -│ │ │ ├── formatting.ts -│ │ │ ├── index.ts -│ │ │ ├── mana-utils.ts -│ │ │ ├── pact-utils.ts -│ │ │ ├── result.ts -│ │ │ ├── room-utils.ts -│ │ │ ├── safe-persist.ts -│ │ │ └── spire-utils.ts -│ │ ├── constants.ts -│ │ ├── crafting-apply.ts -│ │ ├── crafting-attunements.ts -│ │ ├── crafting-design.ts -│ │ ├── crafting-equipment.ts -│ │ ├── crafting-fabricator.ts -│ │ ├── crafting-loot.ts -│ │ ├── crafting-prep.ts -│ │ ├── crafting-utils.ts -│ │ ├── effects.ts -│ │ └── types.ts -│ └── utils.ts +│ ├── lib/ +│ │ ├── game/ +│ │ │ ├── __tests__/ +│ │ │ │ ├── achievements.test.ts +│ │ │ │ ├── activity-log.test.ts +│ │ │ │ ├── bug-fixes.test.ts +│ │ │ │ ├── combat-actions.test.ts +│ │ │ │ ├── combat-utils.test.ts +│ │ │ │ ├── computed-stats.test.ts +│ │ │ │ ├── crafting-utils-basic.test.ts +│ │ │ │ ├── crafting-utils-equipment.test.ts +│ │ │ │ ├── crafting-utils-recipe.test.ts +│ │ │ │ ├── crafting-utils-time.test.ts +│ │ │ │ ├── cross-module-combat-meditation.test.ts +│ │ │ │ ├── cross-module-helpers.ts +│ │ │ │ ├── cross-module-lifecycle-consistency.test.ts +│ │ │ │ ├── cross-module-prestige-discipline.test.ts +│ │ │ │ ├── discipline-math.test.ts +│ │ │ │ ├── discipline-prerequisites.test.ts +│ │ │ │ ├── discipline-reactivate-bug.test.ts +│ │ │ │ ├── enemy-barrier-utils.test.ts +│ │ │ │ ├── enemy-generator.test.ts +│ │ │ │ ├── enemy-utils.test.ts +│ │ │ │ ├── floor-utils.test.ts +│ │ │ │ ├── floor-utils.upgraded.test.ts +│ │ │ │ ├── formatting.test.ts +│ │ │ │ ├── guardian-names.test.ts +│ │ │ │ ├── mana-utils.test.ts +│ │ │ │ ├── pact-utils.test.ts +│ │ │ │ ├── persistence.test.ts +│ │ │ │ ├── regression-fixes.test.ts +│ │ │ │ ├── room-utils-floor-state.test.ts +│ │ │ │ ├── room-utils.test.ts +│ │ │ │ ├── spire-utils.test.ts +│ │ │ │ ├── store-actions-combat-prestige.test.ts +│ │ │ │ ├── store-actions-discipline.test.ts +│ │ │ │ ├── store-actions-mana.test.ts +│ │ │ │ ├── store-actions.test.ts +│ │ │ │ └── tick-integration.test.ts +│ │ │ ├── constants/ +│ │ │ │ ├── spells-modules/ +│ │ │ │ │ ├── advanced-spells.ts +│ │ │ │ │ ├── aoe-spells.ts +│ │ │ │ │ ├── basic-elemental-spells.ts +│ │ │ │ │ ├── compound-spells.ts +│ │ │ │ │ ├── enchantment-spells.ts +│ │ │ │ │ ├── legendary-spells.ts +│ │ │ │ │ ├── lightning-spells.ts +│ │ │ │ │ ├── master-spells.ts +│ │ │ │ │ ├── raw-spells.ts +│ │ │ │ │ └── utility-spells.ts +│ │ │ │ ├── core.ts +│ │ │ │ ├── elements.ts +│ │ │ │ ├── index.ts +│ │ │ │ ├── prestige.ts +│ │ │ │ ├── rooms.ts +│ │ │ │ └── spells.ts +│ │ │ ├── crafting-actions/ +│ │ │ │ ├── application-actions.ts +│ │ │ │ ├── computed-getters.ts +│ │ │ │ ├── crafting-equipment-actions.ts +│ │ │ │ ├── crafting-material-actions.ts +│ │ │ │ ├── design-actions.ts +│ │ │ │ ├── disenchant-actions.ts +│ │ │ │ ├── equipment-actions.ts +│ │ │ │ ├── index.ts +│ │ │ │ └── preparation-actions.ts +│ │ │ ├── data/ +│ │ │ │ ├── disciplines/ +│ │ │ │ │ ├── base.ts +│ │ │ │ │ ├── elemental-regen-advanced.ts +│ │ │ │ │ ├── elemental-regen.ts +│ │ │ │ │ ├── elemental.ts +│ │ │ │ │ ├── enchanter-special.ts +│ │ │ │ │ ├── enchanter-spells.ts +│ │ │ │ │ ├── enchanter-utility.ts +│ │ │ │ │ ├── enchanter.ts +│ │ │ │ │ ├── fabricator.ts +│ │ │ │ │ ├── index.ts +│ │ │ │ │ └── invoker.ts +│ │ │ │ ├── enchantments/ +│ │ │ │ │ ├── spell-effects/ +│ │ │ │ │ │ ├── basic-spells.ts +│ │ │ │ │ │ ├── index.ts +│ │ │ │ │ │ ├── legendary-spells.ts +│ │ │ │ │ │ ├── lightning-spells.ts +│ │ │ │ │ │ ├── metal-spells.ts +│ │ │ │ │ │ ├── sand-spells.ts +│ │ │ │ │ │ ├── tier2-spells.ts +│ │ │ │ │ │ ├── tier3-spells.ts +│ │ │ │ │ │ └── types.ts +│ │ │ │ │ ├── combat-effects.ts +│ │ │ │ │ ├── defense-effects.ts +│ │ │ │ │ ├── elemental-effects.ts +│ │ │ │ │ ├── index.ts +│ │ │ │ │ ├── mana-effects.ts +│ │ │ │ │ ├── special-effects.ts +│ │ │ │ │ └── utility-effects.ts +│ │ │ │ ├── equipment/ +│ │ │ │ │ ├── accessories.ts +│ │ │ │ │ ├── body.ts +│ │ │ │ │ ├── casters.ts +│ │ │ │ │ ├── catalysts.ts +│ │ │ │ │ ├── equipment-types-data.ts +│ │ │ │ │ ├── feet.ts +│ │ │ │ │ ├── hands.ts +│ │ │ │ │ ├── head.ts +│ │ │ │ │ ├── index.ts +│ │ │ │ │ ├── shields.ts +│ │ │ │ │ ├── swords.ts +│ │ │ │ │ ├── types.ts +│ │ │ │ │ └── utils.ts +│ │ │ │ ├── golems/ +│ │ │ │ │ ├── base-golems.ts +│ │ │ │ │ ├── elemental-golems.ts +│ │ │ │ │ ├── golems-data.ts +│ │ │ │ │ ├── hybrid-golems.ts +│ │ │ │ │ ├── index.ts +│ │ │ │ │ ├── types.ts +│ │ │ │ │ └── utils.ts +│ │ │ │ ├── achievements.ts +│ │ │ │ ├── attunements.ts +│ │ │ │ ├── crafting-recipes.ts +│ │ │ │ ├── enchantment-effects.ts +│ │ │ │ ├── enchantment-types.ts +│ │ │ │ ├── fabricator-material-recipes.ts +│ │ │ │ ├── fabricator-physical-recipes.ts +│ │ │ │ ├── fabricator-recipe-types.ts +│ │ │ │ ├── fabricator-recipes.ts +│ │ │ │ ├── fabricator-wizard-recipes.ts +│ │ │ │ ├── guardian-data.ts +│ │ │ │ ├── guardian-encounters.ts +│ │ │ │ └── loot-drops.ts +│ │ │ ├── effects/ +│ │ │ │ ├── discipline-effects.ts +│ │ │ │ ├── dynamic-compute.ts +│ │ │ │ ├── special-effects.ts +│ │ │ │ ├── upgrade-effects.ts +│ │ │ │ └── upgrade-effects.types.ts +│ │ │ ├── hooks/ +│ │ │ │ └── useGameDerived.ts +│ │ │ ├── stores/ +│ │ │ │ ├── pipelines/ +│ │ │ │ │ └── pact-ritual.ts +│ │ │ │ ├── attunementStore.ts +│ │ │ │ ├── combat-actions.ts +│ │ │ │ ├── combat-state.types.ts +│ │ │ │ ├── combatStore.ts +│ │ │ │ ├── crafting-equipment-tick.ts +│ │ │ │ ├── crafting-initial-state.ts +│ │ │ │ ├── craftingStore.ts +│ │ │ │ ├── craftingStore.types.ts +│ │ │ │ ├── discipline-slice.ts +│ │ │ │ ├── gameActions.ts +│ │ │ │ ├── gameHooks.ts +│ │ │ │ ├── gameLoopActions.ts +│ │ │ │ ├── gameStore.ts +│ │ │ │ ├── gameStore.types.ts +│ │ │ │ ├── index.ts +│ │ │ │ ├── manaStore.ts +│ │ │ │ ├── prestigeStore.ts +│ │ │ │ ├── tick-pipeline.ts +│ │ │ │ └── uiStore.ts +│ │ │ ├── types/ +│ │ │ │ ├── attunements.ts +│ │ │ │ ├── disciplines.ts +│ │ │ │ ├── elements.ts +│ │ │ │ ├── equipment.ts +│ │ │ │ ├── equipmentSlot.ts +│ │ │ │ ├── game.ts +│ │ │ │ ├── index.ts +│ │ │ │ └── spells.ts +│ │ │ ├── utils/ +│ │ │ │ ├── activity-log.ts +│ │ │ │ ├── combat-utils.ts +│ │ │ │ ├── discipline-math.ts +│ │ │ │ ├── element-cap-bonus.ts +│ │ │ │ ├── enemy-generator.ts +│ │ │ │ ├── enemy-utils.ts +│ │ │ │ ├── floor-utils.ts +│ │ │ │ ├── formatting.ts +│ │ │ │ ├── index.ts +│ │ │ │ ├── mana-utils.ts +│ │ │ │ ├── pact-utils.ts +│ │ │ │ ├── result.ts +│ │ │ │ ├── room-utils.ts +│ │ │ │ ├── safe-persist.ts +│ │ │ │ └── spire-utils.ts +│ │ │ ├── constants.ts +│ │ │ ├── crafting-apply.ts +│ │ │ ├── crafting-attunements.ts +│ │ │ ├── crafting-design.ts +│ │ │ ├── crafting-equipment.ts +│ │ │ ├── crafting-fabricator.ts +│ │ │ ├── crafting-loot.ts +│ │ │ ├── crafting-prep.ts +│ │ │ ├── crafting-utils.ts +│ │ │ ├── effects.ts +│ │ │ └── types.ts +│ │ └── utils.ts +│ └── test/ +│ └── setup.ts ├── test-results/ │ └── .last-run.json ├── .dockerignore diff --git a/src/components/game/debug/GameStateDebug.tsx b/src/components/game/debug/GameStateDebug.tsx index 9fb4a08..023f53f 100644 --- a/src/components/game/debug/GameStateDebug.tsx +++ b/src/components/game/debug/GameStateDebug.tsx @@ -186,11 +186,9 @@ function TimeControlSection({ day, hour, paused, onSetDay, onTogglePause }: { // ─── Quick Actions Section ─────────────────────────────────────────────────── -function QuickActionsSection({ onUnlockBase, onUnlockUtility, onSkipToFloor, onResetFloorHP }: { +function QuickActionsSection({ onUnlockBase, onUnlockUtility }: { onUnlockBase: () => void; onUnlockUtility: () => void; - onSkipToFloor: () => void; - onResetFloorHP: () => void; }) { return ( @@ -208,12 +206,6 @@ function QuickActionsSection({ onUnlockBase, onUnlockUtility, onSkipToFloor, onR - - @@ -235,8 +227,7 @@ export function GameStateDebug() { const paused = useUIStore((s) => s.paused); const togglePause = useUIStore((s) => s.togglePause); const resetGame = useGameStore((s) => s.resetGame); - const debugSetFloor = useCombatStore((s) => s.debugSetFloor); - const resetFloorHP = useCombatStore((s) => s.resetFloorHP); + const handleReset = () => { if (confirmReset) { @@ -294,8 +285,6 @@ export function GameStateDebug() { debugSetFloor?.(100)} - onResetFloorHP={() => resetFloorHP?.()} /> diff --git a/src/components/game/tabs/DebugTab.test.ts b/src/components/game/tabs/DebugTab.test.ts index a15416c..b7d5a6c 100644 --- a/src/components/game/tabs/DebugTab.test.ts +++ b/src/components/game/tabs/DebugTab.test.ts @@ -99,17 +99,6 @@ describe('GameStateDebugSection store interactions', () => { expect(mockToggle).toHaveBeenCalledTimes(1); }); - it('debugSetFloor action is callable with floor number', () => { - const mockSetFloor = vi.fn(); - mockSetFloor(100); - expect(mockSetFloor).toHaveBeenCalledWith(100); - }); - - it('resetFloorHP action is callable', () => { - const mockResetHP = vi.fn(); - mockResetHP(); - expect(mockResetHP).toHaveBeenCalledTimes(1); - }); }); describe('DisciplineDebugSection store interactions', () => { diff --git a/src/components/game/tabs/DebugTab/GameStateDebugSection.tsx b/src/components/game/tabs/DebugTab/GameStateDebugSection.tsx index fdd50e5..400eb36 100644 --- a/src/components/game/tabs/DebugTab/GameStateDebugSection.tsx +++ b/src/components/game/tabs/DebugTab/GameStateDebugSection.tsx @@ -168,10 +168,8 @@ function TimeControlSection({ day, hour, paused, onSetDay, onTogglePause }: { // ─── Quick Actions Section ─────────────────────────────────────────────────── -function QuickActionsSection({ onUnlockBase, onSkipToFloor, onResetFloorHP }: { +function QuickActionsSection({ onUnlockBase }: { onUnlockBase: () => void; - onSkipToFloor: () => void; - onResetFloorHP: () => void; }) { return ( @@ -186,12 +184,6 @@ function QuickActionsSection({ onUnlockBase, onSkipToFloor, onResetFloorHP }: { - - @@ -211,8 +203,7 @@ export function GameStateDebugSection() { const togglePause = useUIStore((s) => s.togglePause); const resetGame = useGameStore((s) => s.resetGame); const gatherMana = useGameStore((s) => s.gatherMana); - const debugSetFloor = useCombatStore((s) => s.debugSetFloor); - const resetFloorHP = useCombatStore((s) => s.resetFloorHP); + const elements = useManaStore((s) => s.elements); const unlockElement = useManaStore((s) => s.unlockElement); @@ -262,8 +253,6 @@ export function GameStateDebugSection() { debugSetFloor?.(100)} - onResetFloorHP={() => resetFloorHP?.()} /> diff --git a/src/components/game/tabs/DebugTab/SpireDebugSection.tsx b/src/components/game/tabs/DebugTab/SpireDebugSection.tsx index 639b696..dd48517 100644 --- a/src/components/game/tabs/DebugTab/SpireDebugSection.tsx +++ b/src/components/game/tabs/DebugTab/SpireDebugSection.tsx @@ -1,35 +1,17 @@ 'use client'; -import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Input } from '@/components/ui/input'; -import { Castle, ArrowUp, Eye } from 'lucide-react'; +import { Castle, Eye } from 'lucide-react'; import { useCombatStore } from '@/lib/game/stores'; import { DebugName } from '@/components/game/debug/debug-context'; export function SpireDebugSection() { - const [floorInput, setFloorInput] = useState('50'); - const currentFloor = useCombatStore((s) => s.currentFloor); const maxFloorReached = useCombatStore((s) => s.maxFloorReached); const spireMode = useCombatStore((s) => s.spireMode); - const debugSetFloor = useCombatStore((s) => s.debugSetFloor); - const resetFloorHP = useCombatStore((s) => s.resetFloorHP); const enterSpireMode = useCombatStore((s) => s.enterSpireMode); const exitSpireMode = useCombatStore((s) => s.exitSpireMode); - const setMaxFloorReached = useCombatStore((s) => s.setMaxFloorReached); - - const handleJumpToFloor = () => { - const floor = parseInt(floorInput, 10); - if (isNaN(floor) || floor < 1 || floor > 100) return; - debugSetFloor(floor); - setMaxFloorReached(floor); - }; - - const handleClearFloor = () => { - resetFloorHP(); - }; const handleToggleSpireMode = () => { if (spireMode) { @@ -53,27 +35,7 @@ export function SpireDebugSection() { Current Floor: {currentFloor} | Max Reached: {maxFloorReached} | Spire Mode: {spireMode ? 'ON' : 'OFF'} -
-
- - setFloorInput(e.target.value)} - className="h-8" - /> -
- -
-
-
-
- {[10, 25, 50, 75, 100].map((f) => ( - - ))} -
+ diff --git a/src/lib/game/__tests__/store-actions-combat-prestige.test.ts b/src/lib/game/__tests__/store-actions-combat-prestige.test.ts index 0f7ec95..7626979 100644 --- a/src/lib/game/__tests__/store-actions-combat-prestige.test.ts +++ b/src/lib/game/__tests__/store-actions-combat-prestige.test.ts @@ -133,20 +133,6 @@ describe('CombatStore', () => { }); }); - describe('debugSetFloor / resetFloorHP', () => { - it('should set floor and update HP', () => { - useCombatStore.getState().debugSetFloor(10); - expect(useCombatStore.getState().currentFloor).toBe(10); - expect(useCombatStore.getState().floorHP).toBe(getFloorMaxHP(10)); - }); - - it('should reset floor HP to max', () => { - useCombatStore.setState({ floorHP: 10 }); - useCombatStore.getState().resetFloorHP(); - expect(useCombatStore.getState().floorHP).toBe(useCombatStore.getState().floorMaxHP); - }); - }); - describe('resetCombat', () => { it('should reset to starting floor', () => { useCombatStore.setState({ currentFloor: 50, maxFloorReached: 50 }); diff --git a/src/lib/game/__tests__/store-actions.test.ts b/src/lib/game/__tests__/store-actions.test.ts index 4bb6d86..7a4ced8 100644 --- a/src/lib/game/__tests__/store-actions.test.ts +++ b/src/lib/game/__tests__/store-actions.test.ts @@ -347,20 +347,6 @@ describe('CombatStore', () => { }); }); - describe('debugSetFloor / resetFloorHP', () => { - it('should set floor and update HP', () => { - useCombatStore.getState().debugSetFloor(10); - expect(useCombatStore.getState().currentFloor).toBe(10); - expect(useCombatStore.getState().floorHP).toBe(getFloorMaxHP(10)); - }); - - it('should reset floor HP to max', () => { - useCombatStore.setState({ floorHP: 10 }); - useCombatStore.getState().resetFloorHP(); - expect(useCombatStore.getState().floorHP).toBe(useCombatStore.getState().floorMaxHP); - }); - }); - describe('resetCombat', () => { it('should reset to starting floor', () => { useCombatStore.setState({ currentFloor: 50, maxFloorReached: 50 }); diff --git a/src/lib/game/stores/combat-state.types.ts b/src/lib/game/stores/combat-state.types.ts index 25d3b03..ea63114 100644 --- a/src/lib/game/stores/combat-state.types.ts +++ b/src/lib/game/stores/combat-state.types.ts @@ -122,10 +122,6 @@ export interface CombatActions { // Reset resetCombat: (startFloor: number, spellsToKeep?: string[]) => void; - - // Debug helpers - debugSetFloor: (floor: number) => void; - resetFloorHP: () => void; } // ─── Combined Combat Store Type ─────────────────────────────────────────────── diff --git a/src/lib/game/stores/combatStore.ts b/src/lib/game/stores/combatStore.ts index 623da09..d57938c 100644 --- a/src/lib/game/stores/combatStore.ts +++ b/src/lib/game/stores/combatStore.ts @@ -290,22 +290,6 @@ export const useCombatStore = create()( }); }, - // Debug helpers - debugSetFloor: (floor: number) => { - set({ - currentFloor: floor, - floorHP: getFloorMaxHP(floor), - floorMaxHP: getFloorMaxHP(floor), - }); - }, - - resetFloorHP: () => { - set((state) => ({ - floorHP: state.floorMaxHP, - })); - }, - - }), { storage: createSafeStorage(), diff --git a/src/test/setup.ts b/src/test/setup.ts new file mode 100644 index 0000000..625e427 --- /dev/null +++ b/src/test/setup.ts @@ -0,0 +1 @@ +// Vitest test setup