[priority: high] Remove debug "Skip to Floor 100" and "Reset Floor HP" buttons #207

Closed
opened 2026-05-29 13:59:41 +02:00 by Anexim · 1 comment
Owner

BUG: Two debug buttons create inconsistent game states and break progression.

Buttons to Remove

  1. "Skip to Floor 100"src/components/game/tabs/DebugTab/GameStateDebugSection.tsx line 175, wired to debugSetFloor(100) at line 265. Also present in src/components/game/debug/GameStateDebug.tsx line 297 (legacy duplicate), and quick-jump floor 100 button in src/components/game/tabs/DebugTab/SpireDebugSection.tsx line ~95.

  2. "Reset Floor HP"src/components/game/tabs/DebugTab/GameStateDebugSection.tsx line 176, wired to resetFloorHP() at line 266. Also present in src/components/game/debug/GameStateDebug.tsx line 298 (legacy duplicate) and src/components/game/tabs/DebugTab/SpireDebugSection.tsx line 31.

Why "Skip to Floor 100" Is Dangerous

debugSetFloor (stores/combatStore.ts lines 294-300) only sets currentFloor, floorHP, and floorMaxHP. It does not:

  • Set spireMode or climbDirection (combat state may be inconsistent)
  • Set currentRoom (floor 100 should be a guardian floor but room type is wrong)
  • Clear or populate clearedFloors
  • Generate guardian encounters or sign any pacts
  • Trigger any progression rewards from floors 1–99

This teleports the player into a broken state where the tick pipeline may crash trying to process combat on a floor that was never properly initialized.

Why "Reset Floor HP" Is Dangerous

resetFloorHP() (stores/combatStore.ts lines 302-306) restores floorHP to floorMaxHP with a simple set(). This:

  • Heals the enemy to full HP without resetting castProgress, combo counters, or equipment spell states — creating a desync between player progress and enemy state
  • Soft-locks guardian encounters by resetting guardian HP without the proper defeat/respawn flow
  • Can be spammed to infinitely retry any floor for free, completely breaking game balance
  • The name is misleading — it doesn't "reset" the floor, it heals the enemy

Files to Modify

  • src/components/game/tabs/DebugTab/GameStateDebugSection.tsx — Remove onSkipToFloor and onResetFloorHP props and their button elements (lines 168-177), remove wiring (lines 265-266)
  • src/components/game/debug/GameStateDebug.tsx — Remove buttons at lines 297-298 (legacy duplicate panel)
  • src/components/game/tabs/DebugTab/SpireDebugSection.tsx — Remove floor 100 quick-jump button and "Reset Floor HP" button (lines 24-33, 88-99)
  • src/lib/game/stores/combatStore.ts — Remove debugSetFloor and resetFloorHP actions (lines 294-306) and their type definitions in combat-state.types.ts (lines 127-128)
  • src/components/game/tabs/DebugTab.test.ts — Remove/update tests at lines 98-111
  • src/lib/game/__tests__/store-actions.test.ts — Remove/update tests at lines 350-358
  • src/lib/game/__tests__/store-actions-combat-prestige.test.ts — Remove/update tests at lines 136-147

Priority

HIGH — These buttons can crash the game or corrupt save state.

**BUG: Two debug buttons create inconsistent game states and break progression.** ### Buttons to Remove 1. **"Skip to Floor 100"** — `src/components/game/tabs/DebugTab/GameStateDebugSection.tsx` line 175, wired to `debugSetFloor(100)` at line 265. Also present in `src/components/game/debug/GameStateDebug.tsx` line 297 (legacy duplicate), and quick-jump floor 100 button in `src/components/game/tabs/DebugTab/SpireDebugSection.tsx` line ~95. 2. **"Reset Floor HP"** — `src/components/game/tabs/DebugTab/GameStateDebugSection.tsx` line 176, wired to `resetFloorHP()` at line 266. Also present in `src/components/game/debug/GameStateDebug.tsx` line 298 (legacy duplicate) and `src/components/game/tabs/DebugTab/SpireDebugSection.tsx` line 31. ### Why "Skip to Floor 100" Is Dangerous `debugSetFloor` (`stores/combatStore.ts` lines 294-300) only sets `currentFloor`, `floorHP`, and `floorMaxHP`. It does **not**: - Set `spireMode` or `climbDirection` (combat state may be inconsistent) - Set `currentRoom` (floor 100 should be a guardian floor but room type is wrong) - Clear or populate `clearedFloors` - Generate guardian encounters or sign any pacts - Trigger any progression rewards from floors 1–99 This teleports the player into a broken state where the tick pipeline may crash trying to process combat on a floor that was never properly initialized. ### Why "Reset Floor HP" Is Dangerous `resetFloorHP()` (`stores/combatStore.ts` lines 302-306) restores `floorHP` to `floorMaxHP` with a simple `set()`. This: - Heals the enemy to full HP **without** resetting `castProgress`, combo counters, or equipment spell states — creating a desync between player progress and enemy state - Soft-locks guardian encounters by resetting guardian HP without the proper defeat/respawn flow - Can be spammed to infinitely retry any floor for free, completely breaking game balance - The name is misleading — it doesn't "reset" the floor, it heals the enemy ### Files to Modify - `src/components/game/tabs/DebugTab/GameStateDebugSection.tsx` — Remove `onSkipToFloor` and `onResetFloorHP` props and their button elements (lines 168-177), remove wiring (lines 265-266) - `src/components/game/debug/GameStateDebug.tsx` — Remove buttons at lines 297-298 (legacy duplicate panel) - `src/components/game/tabs/DebugTab/SpireDebugSection.tsx` — Remove floor 100 quick-jump button and "Reset Floor HP" button (lines 24-33, 88-99) - `src/lib/game/stores/combatStore.ts` — Remove `debugSetFloor` and `resetFloorHP` actions (lines 294-306) and their type definitions in `combat-state.types.ts` (lines 127-128) - `src/components/game/tabs/DebugTab.test.ts` — Remove/update tests at lines 98-111 - `src/lib/game/__tests__/store-actions.test.ts` — Remove/update tests at lines 350-358 - `src/lib/game/__tests__/store-actions-combat-prestige.test.ts` — Remove/update tests at lines 136-147 ### Priority HIGH — These buttons can crash the game or corrupt save state.
Anexim added the ai:todo label 2026-05-29 13:59:41 +02:00
n8n-gitea was assigned by Anexim 2026-05-29 13:59:41 +02:00
Author
Owner

Fix Complete

Removed the dangerous debug "Skip to Floor 100" and "Reset Floor HP" buttons that could crash the game or corrupt save state.

Files Modified (8):

  1. src/lib/game/stores/combatStore.ts — Removed debugSetFloor and resetFloorHP actions
  2. src/lib/game/stores/combat-state.types.ts — Removed their type definitions from CombatActions
  3. src/components/game/tabs/DebugTab/GameStateDebugSection.tsx — Removed onSkipToFloor and onResetFloorHP props and buttons
  4. src/components/game/debug/GameStateDebug.tsx — Removed same buttons from legacy debug panel
  5. src/components/game/tabs/DebugTab/SpireDebugSection.tsx — Removed floor jump input/buttons, Reset Floor HP button
  6. src/components/game/tabs/DebugTab.test.ts — Removed 2 tests for the deleted actions
  7. src/lib/game/__tests__/store-actions.test.ts — Removed debugSetFloor / resetFloorHP describe block (2 tests)
  8. src/lib/game/__tests__/store-actions-combat-prestige.test.ts — Removed same describe block (2 tests)

Additional fix:

  • src/test/setup.ts — Created missing setup file referenced by vitest.config.ts (all tests were failing without it)

Test Results:

All 122 tests pass across the 3 affected test files:

  • store-actions.test.ts — 44 tests
  • store-actions-combat-prestige.test.ts — 35 tests
  • DebugTab.test.ts — 43 tests

Pre-commit hook verified all files under 400 lines, no circular dependencies.

Commit: e0e7beb

## Fix Complete ✅ Removed the dangerous debug "Skip to Floor 100" and "Reset Floor HP" buttons that could crash the game or corrupt save state. ### Files Modified (8): 1. **`src/lib/game/stores/combatStore.ts`** — Removed `debugSetFloor` and `resetFloorHP` actions 2. **`src/lib/game/stores/combat-state.types.ts`** — Removed their type definitions from `CombatActions` 3. **`src/components/game/tabs/DebugTab/GameStateDebugSection.tsx`** — Removed `onSkipToFloor` and `onResetFloorHP` props and buttons 4. **`src/components/game/debug/GameStateDebug.tsx`** — Removed same buttons from legacy debug panel 5. **`src/components/game/tabs/DebugTab/SpireDebugSection.tsx`** — Removed floor jump input/buttons, Reset Floor HP button 6. **`src/components/game/tabs/DebugTab.test.ts`** — Removed 2 tests for the deleted actions 7. **`src/lib/game/__tests__/store-actions.test.ts`** — Removed `debugSetFloor / resetFloorHP` describe block (2 tests) 8. **`src/lib/game/__tests__/store-actions-combat-prestige.test.ts`** — Removed same describe block (2 tests) ### Additional fix: - **`src/test/setup.ts`** — Created missing setup file referenced by `vitest.config.ts` (all tests were failing without it) ### Test Results: All 122 tests pass across the 3 affected test files: - `store-actions.test.ts` — 44 tests ✅ - `store-actions-combat-prestige.test.ts` — 35 tests ✅ - `DebugTab.test.ts` — 43 tests ✅ Pre-commit hook verified all files under 400 lines, no circular dependencies. Commit: `e0e7beb`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#207