From d2d28887b12359f3f940aa651185bdc418c7d240 Mon Sep 17 00:00:00 2001 From: Refactoring Agent <[email protected]> Date: Sat, 2 May 2026 17:35:03 +0200 Subject: [PATCH] Refactor large files into modular components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Refactored page.tsx (613→252 lines) with GameOverScreen and LeftPanel extracted - Refactored StatsTab.tsx (584→92 lines) with section components - Refactored SkillsTab.tsx (434→54 lines) with sub-components - Created modular structure for GameContext, LootInventory, and other components - All extracted components organized into feature directories --- docs/project-structure.txt | 259 +- src/app/components/GameOverScreen.tsx | 57 + src/app/components/LeftPanel.tsx | 107 + src/app/page.tsx | 636 +--- src/components/game/GameContext.tsx | 430 +-- src/components/game/GameContext/Provider.tsx | 287 ++ .../game/GameContext/context-create.ts | 4 + src/components/game/GameContext/hooks.ts | 13 + src/components/game/GameContext/types.ts | 159 + .../game/LootInventory/BlueprintsSection.tsx | 46 + .../game/LootInventory/EquipmentItem.tsx | 87 + .../game/LootInventory/EssenceItem.tsx | 55 + .../LootInventoryDisplay.tsx} | 267 +- .../game/LootInventory/MaterialItem.tsx | 86 + src/components/game/LootInventory/icons.ts | 15 + src/components/game/LootInventory/index.tsx | 318 ++ src/components/game/LootInventory/types.ts | 39 + src/components/game/SkillsTab.tsx | 428 +-- .../game/SkillsTab/SkillCategory.tsx | 39 + src/components/game/SkillsTab/SkillRow.tsx | 197 + .../game/SkillsTab/SkillStudyProgress.tsx | 46 + .../game/SkillsTab/SkillUpgradeDialog.tsx | 129 + src/components/game/SkillsTab/skills-utils.ts | 82 + src/components/game/StatsTab.tsx | 588 +-- .../game/StatsTab/ActiveUpgradesSection.tsx | 71 + .../game/StatsTab/CombatStatsSection.tsx | 76 + .../game/StatsTab/ElementStatsSection.tsx | 77 + .../game/StatsTab/LoopStatsSection.tsx | 65 + .../game/StatsTab/ManaStatsSection.tsx | 241 ++ .../game/StatsTab/PactStatusSection.tsx | 74 + .../game/StatsTab/StudyStatsSection.tsx | 54 + .../game/crafting/EnchantmentDesigner.tsx | 433 +-- .../EnchantmentDesigner/DesignForm.tsx | 52 + .../EnchantmentDesigner/EffectSelector.tsx | 152 + .../EquipmentTypeSelector.tsx | 67 + .../EnchantmentDesigner/SavedDesigns.tsx | 69 + .../crafting/EnchantmentDesigner/types.ts | 55 + .../crafting/EnchantmentDesigner/utils.ts | 164 + src/components/game/tabs/PrestigeTab.tsx | 3 +- .../skills-tests/ascension-skills.test.ts | 122 + .../integration-and-evolution.test.ts | 95 + .../skills-tests/mana-skills.test.ts | 222 ++ .../skills-tests/prestige-upgrades.test.ts | 120 + .../skills-tests/skill-prerequisites.test.ts | 30 + .../skills-tests/specialized-skills.test.ts | 64 + .../skills-tests/study-skills.test.ts | 120 + .../skills-tests/study-times.test.ts | 24 + src/lib/game/__tests__/skills.test.ts | 599 +--- .../{attunements.ts => attunements/data.ts} | 222 +- src/lib/game/attunements/index.ts | 30 + src/lib/game/attunements/types.ts | 100 + src/lib/game/attunements/utils.ts | 94 + .../spells-modules/advanced-spells.ts | 151 + .../constants/spells-modules/aoe-spells.ts | 93 + .../spells-modules/basic-elemental-spells.ts | 161 + .../spells-modules/compound-spells.ts | 110 + .../spells-modules/enchantment-spells.ts | 59 + .../spells-modules/legendary-spells.ts | 41 + .../spells-modules/lightning-spells.ts | 76 + .../constants/spells-modules/master-spells.ts | 85 + .../constants/spells-modules/raw-spells.ts | 29 + .../spells-modules/utility-spells.ts | 53 + src/lib/game/constants/spells.ts | 857 +---- src/lib/game/crafting-actions.ts | 513 --- .../crafting-actions/application-actions.ts | 72 + .../game/crafting-actions/computed-getters.ts | 56 + .../crafting-equipment-actions.ts | 89 + .../game/crafting-actions/design-actions.ts | 113 + .../crafting-actions/disenchant-actions.ts | 34 + .../crafting-actions/equipment-actions.ts | 103 + src/lib/game/crafting-actions/index.ts | 11 + .../crafting-actions/preparation-actions.ts | 44 + .../game/data/enchantments/spell-effects.ts | 473 --- .../spell-effects/basic-spells.ts | 162 + .../data/enchantments/spell-effects/index.ts | 8 + .../spell-effects/lightning-spells.ts | 58 + .../spell-effects/metal-spells.ts | 48 + .../enchantments/spell-effects/sand-spells.ts | 48 + .../spell-effects/tier2-spells.ts | 129 + .../spell-effects/tier3-spells.ts | 37 + .../data/enchantments/spell-effects/types.ts | 20 + src/lib/game/data/equipment.ts | 497 --- src/lib/game/data/equipment/accessories.ts | 87 + src/lib/game/data/equipment/body.ts | 47 + src/lib/game/data/equipment/casters.ts | 59 + src/lib/game/data/equipment/catalysts.ts | 31 + src/lib/game/data/equipment/feet.ts | 39 + src/lib/game/data/equipment/hands.ts | 39 + src/lib/game/data/equipment/head.ts | 47 + src/lib/game/data/equipment/index.ts | 28 + src/lib/game/data/equipment/shields.ts | 39 + src/lib/game/data/equipment/swords.ts | 59 + src/lib/game/data/equipment/types.ts | 31 + src/lib/game/data/equipment/utils.ts | 62 + src/lib/game/data/golems.ts | 471 --- src/lib/game/data/golems/base-golems.ts | 30 + src/lib/game/data/golems/elemental-golems.ts | 71 + src/lib/game/data/golems/hybrid-golems.ts | 139 + src/lib/game/data/golems/index.ts | 23 + src/lib/game/data/golems/types.ts | 42 + src/lib/game/data/golems/utils.ts | 204 ++ .../elemental-attunement.ts | 127 + .../enchanting-skills.ts | 282 ++ .../skill-evolution-modules/focused-mind.ts | 127 + .../guardian-skills.ts | 79 + .../skill-evolution-modules/hybrid-skills.ts | 372 ++ src/lib/game/skill-evolution-modules/index.ts | 382 ++ .../insight-harvest.ts | 127 + .../invocation-skills.ts | 249 ++ .../knowledge-retention.ts | 81 + .../learning-skills.ts | 11 + .../skill-evolution-modules/magic-skills.ts | 9 + .../mana-utility-skills.ts | 139 + .../skill-evolution-modules/mana-well-flow.ts | 250 ++ .../skill-evolution-modules/quick-learner.ts | 127 + src/lib/game/skill-evolution-modules/types.ts | 16 + src/lib/game/skill-evolution-modules/utils.ts | 29 + src/lib/game/skill-evolution.ts | 2237 +----------- .../ascension-specialized-skills.test.ts | 170 + .../skills-split-tests/mana-skills.test.ts | 224 ++ ...es-studytimes-prestige-integration.test.ts | 212 ++ .../skills-split-tests/study-skills.test.ts | 115 + src/lib/game/skills.test.ts | 549 +-- src/lib/game/store-modules/activity-log.ts | 29 + src/lib/game/store-modules/computed-stats.ts | 233 ++ src/lib/game/store-modules/enemy-utils.ts | 58 + src/lib/game/store-modules/initial-state.ts | 223 ++ src/lib/game/store-modules/room-utils.ts | 222 ++ src/lib/game/store-modules/store-actions.ts | 120 + src/lib/game/store-modules/tick-logic.ts | 230 ++ .../store-tests/damage-calculation.test.ts | 69 + .../game/store-tests/element-recipes.test.ts | 32 + src/lib/game/store-tests/floor.test.ts | 58 + src/lib/game/store-tests/formatting.test.ts | 50 + .../game/store-tests/game-constants.test.ts | 115 + .../store-tests/individual-skills.test.ts | 272 ++ .../insight-meditation-incursion.test.ts | 116 + src/lib/game/store-tests/integration.test.ts | 43 + .../game/store-tests/mana-calculation.test.ts | 92 + .../game/store-tests/skill-evolution.test.ts | 40 + .../store-tests/skill-requirements.test.ts | 28 + src/lib/game/store-tests/spell-cost.test.ts | 60 + src/lib/game/store-tests/study-speed.test.ts | 30 + src/lib/game/store-tests/test-utils.ts | 72 + src/lib/game/store.test.ts | 1052 +----- src/lib/game/store.ts | 3187 +---------------- .../store/crafting-modules/initial-state.ts | 23 + .../game/store/crafting-modules/selectors.ts | 49 + .../store/crafting-modules/slice-logic.ts | 252 ++ .../crafting-modules/starting-equipment.ts | 51 + .../store/crafting-modules/tick-processors.ts | 178 + src/lib/game/store/crafting-modules/types.ts | 66 + src/lib/game/store/crafting-modules/utils.ts | 167 + src/lib/game/store/craftingSlice.ts | 669 +--- .../stores-split-tests/combat-store.test.ts | 64 + .../stores-split-tests/integration.test.ts | 122 + .../stores-split-tests/mana-store.test.ts | 137 + .../stores-split-tests/prestige-store.test.ts | 110 + .../stores-split-tests/skill-store.test.ts | 176 + .../game/stores-split-tests/ui-store.test.ts | 67 + src/lib/game/stores.test.ts | 502 +-- .../index-tests/combat-calculations.test.ts | 148 + .../__tests__/index-tests/definitions.test.ts | 97 + .../index-tests/mana-calculations.test.ts | 171 + .../meditation-insight-incursion.test.ts | 180 + .../__tests__/index-tests/spell-cost.test.ts | 53 + .../__tests__/index-tests/study-speed.test.ts | 34 + .../index-tests/utility-functions.test.ts | 39 + .../store-method-tests/combat-store.test.ts | 93 + .../store-method-tests/mana-store.test.ts | 140 + .../store-method-tests/prestige-store.test.ts | 150 + .../store-method-tests/skill-store.test.ts | 172 + .../store-method-tests/ui-store.test.ts | 65 + .../stores/__tests__/store-methods.test.ts | 595 +-- .../stores-tests/damage-calculation.test.ts | 96 + .../__tests__/stores-tests/floor.test.ts | 40 + .../__tests__/stores-tests/formatting.test.ts | 49 + .../__tests__/stores-tests/guardians.test.ts | 26 + .../__tests__/stores-tests/incursion.test.ts | 26 + .../stores-tests/insight-calculation.test.ts | 96 + .../stores-tests/mana-calculation.test.ts | 144 + .../__tests__/stores-tests/meditation.test.ts | 36 + .../stores-tests/prestige-upgrades.test.ts | 17 + .../stores-tests/skill-definitions.test.ts | 24 + .../__tests__/stores-tests/spell-cost.test.ts | 41 + .../stores-tests/spell-definitions.test.ts | 22 + .../stores-tests/study-speed.test.ts | 32 + src/lib/game/stores/__tests__/stores.test.ts | 473 +-- src/lib/game/stores/gameActions.ts | 58 + src/lib/game/stores/gameHooks.ts | 13 + src/lib/game/stores/gameLoopActions.ts | 95 + src/lib/game/stores/gameStore.ts | 156 +- src/lib/game/stores/index.test.ts | 582 +-- src/lib/game/stores/index.ts | 3 +- 194 files changed, 16862 insertions(+), 15729 deletions(-) create mode 100644 src/app/components/GameOverScreen.tsx create mode 100644 src/app/components/LeftPanel.tsx create mode 100644 src/components/game/GameContext/Provider.tsx create mode 100644 src/components/game/GameContext/context-create.ts create mode 100644 src/components/game/GameContext/hooks.ts create mode 100644 src/components/game/GameContext/types.ts create mode 100644 src/components/game/LootInventory/BlueprintsSection.tsx create mode 100644 src/components/game/LootInventory/EquipmentItem.tsx create mode 100644 src/components/game/LootInventory/EssenceItem.tsx rename src/components/game/{LootInventory.tsx => LootInventory/LootInventoryDisplay.tsx} (54%) create mode 100644 src/components/game/LootInventory/MaterialItem.tsx create mode 100644 src/components/game/LootInventory/icons.ts create mode 100644 src/components/game/LootInventory/index.tsx create mode 100644 src/components/game/LootInventory/types.ts create mode 100644 src/components/game/SkillsTab/SkillCategory.tsx create mode 100644 src/components/game/SkillsTab/SkillRow.tsx create mode 100644 src/components/game/SkillsTab/SkillStudyProgress.tsx create mode 100644 src/components/game/SkillsTab/SkillUpgradeDialog.tsx create mode 100644 src/components/game/SkillsTab/skills-utils.ts create mode 100644 src/components/game/StatsTab/ActiveUpgradesSection.tsx create mode 100644 src/components/game/StatsTab/CombatStatsSection.tsx create mode 100644 src/components/game/StatsTab/ElementStatsSection.tsx create mode 100644 src/components/game/StatsTab/LoopStatsSection.tsx create mode 100644 src/components/game/StatsTab/ManaStatsSection.tsx create mode 100644 src/components/game/StatsTab/PactStatusSection.tsx create mode 100644 src/components/game/StatsTab/StudyStatsSection.tsx create mode 100644 src/components/game/crafting/EnchantmentDesigner/DesignForm.tsx create mode 100644 src/components/game/crafting/EnchantmentDesigner/EffectSelector.tsx create mode 100644 src/components/game/crafting/EnchantmentDesigner/EquipmentTypeSelector.tsx create mode 100644 src/components/game/crafting/EnchantmentDesigner/SavedDesigns.tsx create mode 100644 src/components/game/crafting/EnchantmentDesigner/types.ts create mode 100644 src/components/game/crafting/EnchantmentDesigner/utils.ts create mode 100644 src/lib/game/__tests__/skills-tests/ascension-skills.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/integration-and-evolution.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/mana-skills.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/prestige-upgrades.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/skill-prerequisites.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/specialized-skills.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/study-skills.test.ts create mode 100644 src/lib/game/__tests__/skills-tests/study-times.test.ts rename src/lib/game/{attunements.ts => attunements/data.ts} (50%) mode change 100755 => 100644 create mode 100644 src/lib/game/attunements/index.ts create mode 100644 src/lib/game/attunements/types.ts create mode 100644 src/lib/game/attunements/utils.ts create mode 100644 src/lib/game/constants/spells-modules/advanced-spells.ts create mode 100644 src/lib/game/constants/spells-modules/aoe-spells.ts create mode 100644 src/lib/game/constants/spells-modules/basic-elemental-spells.ts create mode 100644 src/lib/game/constants/spells-modules/compound-spells.ts create mode 100644 src/lib/game/constants/spells-modules/enchantment-spells.ts create mode 100644 src/lib/game/constants/spells-modules/legendary-spells.ts create mode 100644 src/lib/game/constants/spells-modules/lightning-spells.ts create mode 100644 src/lib/game/constants/spells-modules/master-spells.ts create mode 100644 src/lib/game/constants/spells-modules/raw-spells.ts create mode 100644 src/lib/game/constants/spells-modules/utility-spells.ts delete mode 100644 src/lib/game/crafting-actions.ts create mode 100644 src/lib/game/crafting-actions/application-actions.ts create mode 100644 src/lib/game/crafting-actions/computed-getters.ts create mode 100644 src/lib/game/crafting-actions/crafting-equipment-actions.ts create mode 100644 src/lib/game/crafting-actions/design-actions.ts create mode 100644 src/lib/game/crafting-actions/disenchant-actions.ts create mode 100644 src/lib/game/crafting-actions/equipment-actions.ts create mode 100644 src/lib/game/crafting-actions/index.ts create mode 100644 src/lib/game/crafting-actions/preparation-actions.ts delete mode 100644 src/lib/game/data/enchantments/spell-effects.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/basic-spells.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/index.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/lightning-spells.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/metal-spells.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/sand-spells.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/tier2-spells.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/tier3-spells.ts create mode 100644 src/lib/game/data/enchantments/spell-effects/types.ts delete mode 100755 src/lib/game/data/equipment.ts create mode 100644 src/lib/game/data/equipment/accessories.ts create mode 100644 src/lib/game/data/equipment/body.ts create mode 100644 src/lib/game/data/equipment/casters.ts create mode 100644 src/lib/game/data/equipment/catalysts.ts create mode 100644 src/lib/game/data/equipment/feet.ts create mode 100644 src/lib/game/data/equipment/hands.ts create mode 100644 src/lib/game/data/equipment/head.ts create mode 100644 src/lib/game/data/equipment/index.ts create mode 100644 src/lib/game/data/equipment/shields.ts create mode 100644 src/lib/game/data/equipment/swords.ts create mode 100644 src/lib/game/data/equipment/types.ts create mode 100644 src/lib/game/data/equipment/utils.ts delete mode 100755 src/lib/game/data/golems.ts create mode 100644 src/lib/game/data/golems/base-golems.ts create mode 100644 src/lib/game/data/golems/elemental-golems.ts create mode 100644 src/lib/game/data/golems/hybrid-golems.ts create mode 100644 src/lib/game/data/golems/index.ts create mode 100644 src/lib/game/data/golems/types.ts create mode 100644 src/lib/game/data/golems/utils.ts create mode 100644 src/lib/game/skill-evolution-modules/elemental-attunement.ts create mode 100644 src/lib/game/skill-evolution-modules/enchanting-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/focused-mind.ts create mode 100644 src/lib/game/skill-evolution-modules/guardian-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/hybrid-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/index.ts create mode 100644 src/lib/game/skill-evolution-modules/insight-harvest.ts create mode 100644 src/lib/game/skill-evolution-modules/invocation-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/knowledge-retention.ts create mode 100644 src/lib/game/skill-evolution-modules/learning-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/magic-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/mana-utility-skills.ts create mode 100644 src/lib/game/skill-evolution-modules/mana-well-flow.ts create mode 100644 src/lib/game/skill-evolution-modules/quick-learner.ts create mode 100644 src/lib/game/skill-evolution-modules/types.ts create mode 100644 src/lib/game/skill-evolution-modules/utils.ts create mode 100644 src/lib/game/skills-split-tests/ascension-specialized-skills.test.ts create mode 100644 src/lib/game/skills-split-tests/mana-skills.test.ts create mode 100644 src/lib/game/skills-split-tests/prerequisites-studytimes-prestige-integration.test.ts create mode 100644 src/lib/game/skills-split-tests/study-skills.test.ts create mode 100644 src/lib/game/store-modules/activity-log.ts create mode 100644 src/lib/game/store-modules/computed-stats.ts create mode 100644 src/lib/game/store-modules/enemy-utils.ts create mode 100644 src/lib/game/store-modules/initial-state.ts create mode 100644 src/lib/game/store-modules/room-utils.ts create mode 100644 src/lib/game/store-modules/store-actions.ts create mode 100644 src/lib/game/store-modules/tick-logic.ts create mode 100644 src/lib/game/store-tests/damage-calculation.test.ts create mode 100644 src/lib/game/store-tests/element-recipes.test.ts create mode 100644 src/lib/game/store-tests/floor.test.ts create mode 100644 src/lib/game/store-tests/formatting.test.ts create mode 100644 src/lib/game/store-tests/game-constants.test.ts create mode 100644 src/lib/game/store-tests/individual-skills.test.ts create mode 100644 src/lib/game/store-tests/insight-meditation-incursion.test.ts create mode 100644 src/lib/game/store-tests/integration.test.ts create mode 100644 src/lib/game/store-tests/mana-calculation.test.ts create mode 100644 src/lib/game/store-tests/skill-evolution.test.ts create mode 100644 src/lib/game/store-tests/skill-requirements.test.ts create mode 100644 src/lib/game/store-tests/spell-cost.test.ts create mode 100644 src/lib/game/store-tests/study-speed.test.ts create mode 100644 src/lib/game/store-tests/test-utils.ts create mode 100644 src/lib/game/store/crafting-modules/initial-state.ts create mode 100644 src/lib/game/store/crafting-modules/selectors.ts create mode 100644 src/lib/game/store/crafting-modules/slice-logic.ts create mode 100644 src/lib/game/store/crafting-modules/starting-equipment.ts create mode 100644 src/lib/game/store/crafting-modules/tick-processors.ts create mode 100644 src/lib/game/store/crafting-modules/types.ts create mode 100644 src/lib/game/store/crafting-modules/utils.ts create mode 100644 src/lib/game/stores-split-tests/combat-store.test.ts create mode 100644 src/lib/game/stores-split-tests/integration.test.ts create mode 100644 src/lib/game/stores-split-tests/mana-store.test.ts create mode 100644 src/lib/game/stores-split-tests/prestige-store.test.ts create mode 100644 src/lib/game/stores-split-tests/skill-store.test.ts create mode 100644 src/lib/game/stores-split-tests/ui-store.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/combat-calculations.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/definitions.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/mana-calculations.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/meditation-insight-incursion.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/spell-cost.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/study-speed.test.ts create mode 100644 src/lib/game/stores/__tests__/index-tests/utility-functions.test.ts create mode 100644 src/lib/game/stores/__tests__/store-method-tests/combat-store.test.ts create mode 100644 src/lib/game/stores/__tests__/store-method-tests/mana-store.test.ts create mode 100644 src/lib/game/stores/__tests__/store-method-tests/prestige-store.test.ts create mode 100644 src/lib/game/stores/__tests__/store-method-tests/skill-store.test.ts create mode 100644 src/lib/game/stores/__tests__/store-method-tests/ui-store.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/damage-calculation.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/floor.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/formatting.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/guardians.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/incursion.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/insight-calculation.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/mana-calculation.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/meditation.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/prestige-upgrades.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/skill-definitions.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/spell-cost.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/spell-definitions.test.ts create mode 100644 src/lib/game/stores/__tests__/stores-tests/study-speed.test.ts create mode 100644 src/lib/game/stores/gameActions.ts create mode 100644 src/lib/game/stores/gameHooks.ts create mode 100644 src/lib/game/stores/gameLoopActions.ts diff --git a/docs/project-structure.txt b/docs/project-structure.txt index f5dc14f..cc9eb89 100644 --- a/docs/project-structure.txt +++ b/docs/project-structure.txt @@ -12,14 +12,34 @@ Mana-Loop/ │ └── custom.db ├── docs/ │ ├── task5/ +│ │ ├── subtask_11_context.md │ │ ├── subtask_12_context.md │ │ ├── subtask_13_context.md │ │ ├── subtask_14_context.md -│ │ └── subtask_17_context.md +│ │ ├── subtask_15_context.md +│ │ ├── subtask_16_context.md +│ │ ├── subtask_17_context.md +│ │ ├── subtask_18_context.md +│ │ ├── subtask_19_context.md +│ │ ├── subtask_5_context.md +│ │ ├── subtask_6_context.md +│ │ └── subtask_9_context.md +│ ├── task6/ +│ │ └── subtask_1_context.md +│ ├── task7/ +│ │ ├── ctx_page.md +│ │ ├── ctx_skillstab.md +│ │ ├── ctx_upgrade_effects.md +│ │ ├── plan_page.md +│ │ ├── plan_skillstab.md +│ │ └── plan_upgrade_effects.md │ ├── GAME_BRIEFING.md │ ├── project-structure.txt │ ├── skills.md -│ └── task5.md +│ ├── task5.md +│ ├── task5_insight_proposals.md +│ ├── task6.md +│ └── task7.md ├── download/ │ └── README.md ├── examples/ @@ -37,12 +57,50 @@ Mana-Loop/ │ ├── app/ │ │ ├── api/ │ │ │ └── route.ts +│ │ ├── components/ +│ │ │ ├── GameOverScreen.tsx +│ │ │ └── LeftPanel.tsx │ │ ├── globals.css │ │ ├── layout.tsx │ │ └── page.tsx │ ├── components/ │ │ ├── game/ +│ │ │ ├── GameContext/ +│ │ │ │ ├── Provider.tsx +│ │ │ │ ├── context-create.ts +│ │ │ │ ├── hooks.ts +│ │ │ │ └── types.ts +│ │ │ ├── LootInventory/ +│ │ │ │ ├── BlueprintsSection.tsx +│ │ │ │ ├── EquipmentItem.tsx +│ │ │ │ ├── EssenceItem.tsx +│ │ │ │ ├── LootInventoryDisplay.tsx +│ │ │ │ ├── MaterialItem.tsx +│ │ │ │ ├── icons.ts +│ │ │ │ ├── index.tsx +│ │ │ │ └── types.ts +│ │ │ ├── SkillsTab/ +│ │ │ │ ├── SkillCategory.tsx +│ │ │ │ ├── SkillRow.tsx +│ │ │ │ ├── SkillStudyProgress.tsx +│ │ │ │ ├── SkillUpgradeDialog.tsx +│ │ │ │ └── skills-utils.ts +│ │ │ ├── StatsTab/ +│ │ │ │ ├── ActiveUpgradesSection.tsx +│ │ │ │ ├── CombatStatsSection.tsx +│ │ │ │ ├── ElementStatsSection.tsx +│ │ │ │ ├── LoopStatsSection.tsx +│ │ │ │ ├── ManaStatsSection.tsx +│ │ │ │ ├── PactStatusSection.tsx +│ │ │ │ └── StudyStatsSection.tsx │ │ │ ├── crafting/ +│ │ │ │ ├── EnchantmentDesigner/ +│ │ │ │ │ ├── DesignForm.tsx +│ │ │ │ │ ├── EffectSelector.tsx +│ │ │ │ │ ├── EquipmentTypeSelector.tsx +│ │ │ │ │ ├── SavedDesigns.tsx +│ │ │ │ │ ├── types.ts +│ │ │ │ │ └── utils.ts │ │ │ │ ├── EnchantmentApplier.tsx │ │ │ │ ├── EnchantmentDesigner.tsx │ │ │ │ ├── EnchantmentPreparer.tsx @@ -72,16 +130,32 @@ Mana-Loop/ │ │ │ │ └── index.tsx │ │ │ ├── tabs/ │ │ │ │ ├── AchievementsTab.tsx +│ │ │ │ ├── ActivityLog.tsx │ │ │ │ ├── AttunementsTab.tsx │ │ │ │ ├── AttunementsTab.tsx.backup +│ │ │ │ ├── CategorySkillsList.tsx +│ │ │ │ ├── CombatStatsPanel.tsx │ │ │ │ ├── CraftingTab.tsx │ │ │ │ ├── DebugTab.tsx +│ │ │ │ ├── EnchantmentsPanel.tsx +│ │ │ │ ├── EquipmentControls.tsx +│ │ │ │ ├── EquipmentInventory.tsx +│ │ │ │ ├── EquipmentSlotGrid.tsx │ │ │ │ ├── EquipmentTab.tsx +│ │ │ │ ├── FloorControls.tsx │ │ │ │ ├── GolemancyTab.tsx +│ │ │ │ ├── GuardianPanel.tsx │ │ │ │ ├── LabTab.tsx │ │ │ │ ├── LootTab.tsx +│ │ │ │ ├── MilestoneProgress.tsx +│ │ │ │ ├── PrestigeTab.tsx +│ │ │ │ ├── RoomDisplay.tsx +│ │ │ │ ├── SkillCategoryHeader.tsx +│ │ │ │ ├── SkillMultipliers.tsx +│ │ │ │ ├── SkillRow.tsx │ │ │ │ ├── SkillsTab.tsx │ │ │ │ ├── SpellsTab.tsx +│ │ │ │ ├── SpireHeader.tsx │ │ │ │ ├── SpireTab.tsx │ │ │ │ ├── StatsTab.tsx │ │ │ │ ├── StudyProgress.tsx @@ -96,7 +170,6 @@ Mana-Loop/ │ │ │ ├── GameContext.tsx │ │ │ ├── GameToast.tsx │ │ │ ├── LabTab.tsx -│ │ │ ├── LootInventory.tsx │ │ │ ├── ManaDisplay.tsx │ │ │ ├── SkillsTab.tsx │ │ │ ├── SpellsTab.tsx @@ -143,11 +216,37 @@ Mana-Loop/ │ └── lib/ │ ├── game/ │ │ ├── __tests__/ +│ │ │ ├── skills-tests/ +│ │ │ │ ├── ascension-skills.test.ts +│ │ │ │ ├── integration-and-evolution.test.ts +│ │ │ │ ├── mana-skills.test.ts +│ │ │ │ ├── prestige-upgrades.test.ts +│ │ │ │ ├── skill-prerequisites.test.ts +│ │ │ │ ├── specialized-skills.test.ts +│ │ │ │ ├── study-skills.test.ts +│ │ │ │ └── study-times.test.ts +│ │ │ ├── store-method-tests/ │ │ │ ├── bug-fixes.test.ts │ │ │ ├── computed-stats.test.ts │ │ │ ├── skill-system.test.ts │ │ │ └── skills.test.ts +│ │ ├── attunements/ +│ │ │ ├── data.ts +│ │ │ ├── index.ts +│ │ │ ├── types.ts +│ │ │ └── utils.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 │ │ │ ├── guardians.ts @@ -156,27 +255,93 @@ Mana-Loop/ │ │ │ ├── rooms.ts │ │ │ ├── skills.ts │ │ │ └── spells.ts +│ │ ├── crafting-actions/ +│ │ │ ├── application-actions.ts +│ │ │ ├── computed-getters.ts +│ │ │ ├── crafting-equipment-actions.ts +│ │ │ ├── design-actions.ts +│ │ │ ├── disenchant-actions.ts +│ │ │ ├── equipment-actions.ts +│ │ │ ├── index.ts +│ │ │ └── preparation-actions.ts │ │ ├── data/ │ │ │ ├── enchantments/ +│ │ │ │ ├── spell-effects/ +│ │ │ │ │ ├── basic-spells.ts +│ │ │ │ │ ├── index.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 -│ │ │ │ ├── spell-effects.ts │ │ │ │ └── utility-effects.ts +│ │ │ ├── equipment/ +│ │ │ │ ├── accessories.ts +│ │ │ │ ├── body.ts +│ │ │ │ ├── casters.ts +│ │ │ │ ├── catalysts.ts +│ │ │ │ ├── feet.ts +│ │ │ │ ├── hands.ts +│ │ │ │ ├── head.ts +│ │ │ │ ├── index.ts +│ │ │ │ ├── shields.ts +│ │ │ │ ├── swords.ts +│ │ │ │ ├── types.ts +│ │ │ │ └── utils.ts +│ │ │ ├── golems/ +│ │ │ │ ├── base-golems.ts +│ │ │ │ ├── elemental-golems.ts +│ │ │ │ ├── hybrid-golems.ts +│ │ │ │ ├── index.ts +│ │ │ │ ├── types.ts +│ │ │ │ └── utils.ts │ │ │ ├── achievements.ts │ │ │ ├── attunements.ts │ │ │ ├── crafting-recipes.ts │ │ │ ├── enchantment-effects.ts │ │ │ ├── enchantment-types.ts -│ │ │ ├── equipment.ts -│ │ │ ├── golems.ts │ │ │ └── loot-drops.ts │ │ ├── hooks/ -│ │ │ └── useGameDerived.ts +│ │ │ ├── useGameDerived.ts +│ │ │ └── useSkillUpgradeSelection.ts +│ │ ├── skill-evolution-modules/ +│ │ │ ├── elemental-attunement.ts +│ │ │ ├── enchanting-skills.ts +│ │ │ ├── focused-mind.ts +│ │ │ ├── guardian-skills.ts +│ │ │ ├── hybrid-skills.ts +│ │ │ ├── index.ts +│ │ │ ├── insight-harvest.ts +│ │ │ ├── invocation-skills.ts +│ │ │ ├── knowledge-retention.ts +│ │ │ ├── learning-skills.ts +│ │ │ ├── magic-skills.ts +│ │ │ ├── mana-utility-skills.ts +│ │ │ ├── mana-well-flow.ts +│ │ │ ├── quick-learner.ts +│ │ │ ├── types.ts +│ │ │ └── utils.ts +│ │ ├── skills-split-tests/ +│ │ │ ├── ascension-specialized-skills.test.ts +│ │ │ ├── mana-skills.test.ts +│ │ │ ├── prerequisites-studytimes-prestige-integration.test.ts +│ │ │ └── study-skills.test.ts │ │ ├── store/ +│ │ │ ├── crafting-modules/ +│ │ │ │ ├── initial-state.ts +│ │ │ │ ├── selectors.ts +│ │ │ │ ├── slice-logic.ts +│ │ │ │ ├── starting-equipment.ts +│ │ │ │ ├── tick-processors.ts +│ │ │ │ ├── types.ts +│ │ │ │ └── utils.ts │ │ │ ├── combatSlice.ts │ │ │ ├── computed.ts │ │ │ ├── craftingSlice.ts @@ -186,11 +351,71 @@ Mana-Loop/ │ │ │ ├── prestigeSlice.ts │ │ │ ├── skillSlice.ts │ │ │ └── timeSlice.ts +│ │ ├── store-modules/ +│ │ │ ├── {room-utils,enemy-utils,initial-state,activity-log,store-actions}/ +│ │ │ ├── activity-log.ts +│ │ │ ├── computed-stats.ts +│ │ │ ├── enemy-utils.ts +│ │ │ ├── initial-state.ts +│ │ │ ├── room-utils.ts +│ │ │ ├── store-actions.ts +│ │ │ └── tick-logic.ts +│ │ ├── store-tests/ +│ │ │ ├── damage-calculation.test.ts +│ │ │ ├── element-recipes.test.ts +│ │ │ ├── floor.test.ts +│ │ │ ├── formatting.test.ts +│ │ │ ├── game-constants.test.ts +│ │ │ ├── individual-skills.test.ts +│ │ │ ├── insight-meditation-incursion.test.ts +│ │ │ ├── integration.test.ts +│ │ │ ├── mana-calculation.test.ts +│ │ │ ├── skill-evolution.test.ts +│ │ │ ├── skill-requirements.test.ts +│ │ │ ├── spell-cost.test.ts +│ │ │ ├── study-speed.test.ts +│ │ │ └── test-utils.ts │ │ ├── stores/ │ │ │ ├── __tests__/ +│ │ │ │ ├── combat-store-tests/ +│ │ │ │ ├── index-tests/ +│ │ │ │ │ ├── combat-calculations.test.ts +│ │ │ │ │ ├── definitions.test.ts +│ │ │ │ │ ├── mana-calculations.test.ts +│ │ │ │ │ ├── meditation-insight-incursion.test.ts +│ │ │ │ │ ├── spell-cost.test.ts +│ │ │ │ │ ├── study-speed.test.ts +│ │ │ │ │ └── utility-functions.test.ts +│ │ │ │ ├── mana-store-tests/ +│ │ │ │ ├── prestige-store-tests/ +│ │ │ │ ├── store-method-tests/ +│ │ │ │ │ ├── combat-store.test.ts +│ │ │ │ │ ├── mana-store.test.ts +│ │ │ │ │ ├── prestige-store.test.ts +│ │ │ │ │ ├── skill-store.test.ts +│ │ │ │ │ └── ui-store.test.ts +│ │ │ │ ├── stores-split-tests/ +│ │ │ │ ├── stores-tests/ +│ │ │ │ │ ├── damage-calculation.test.ts +│ │ │ │ │ ├── floor.test.ts +│ │ │ │ │ ├── formatting.test.ts +│ │ │ │ │ ├── guardians.test.ts +│ │ │ │ │ ├── incursion.test.ts +│ │ │ │ │ ├── insight-calculation.test.ts +│ │ │ │ │ ├── mana-calculation.test.ts +│ │ │ │ │ ├── meditation.test.ts +│ │ │ │ │ ├── prestige-upgrades.test.ts +│ │ │ │ │ ├── skill-definitions.test.ts +│ │ │ │ │ ├── spell-cost.test.ts +│ │ │ │ │ ├── spell-definitions.test.ts +│ │ │ │ │ └── study-speed.test.ts +│ │ │ │ ├── ui-store-tests/ │ │ │ │ ├── store-methods.test.ts │ │ │ │ └── stores.test.ts │ │ │ ├── combatStore.ts +│ │ │ ├── gameActions.ts +│ │ │ ├── gameHooks.ts +│ │ │ ├── gameLoopActions.ts │ │ │ ├── gameStore.ts │ │ │ ├── index.test.ts │ │ │ ├── index.ts @@ -198,6 +423,13 @@ Mana-Loop/ │ │ │ ├── prestigeStore.ts │ │ │ ├── skillStore.ts │ │ │ └── uiStore.ts +│ │ ├── stores-split-tests/ +│ │ │ ├── combat-store.test.ts +│ │ │ ├── integration.test.ts +│ │ │ ├── mana-store.test.ts +│ │ │ ├── prestige-store.test.ts +│ │ │ ├── skill-store.test.ts +│ │ │ └── ui-store.test.ts │ │ ├── types/ │ │ │ ├── attunements.ts │ │ │ ├── elements.ts @@ -212,22 +444,31 @@ Mana-Loop/ │ │ │ ├── formatting.ts │ │ │ ├── index.ts │ │ │ └── mana-utils.ts -│ │ ├── attunements.ts │ │ ├── computed-stats.ts │ │ ├── constants.ts +│ │ ├── crafting-apply.ts +│ │ ├── crafting-attunements.ts +│ │ ├── crafting-design.ts +│ │ ├── crafting-equipment.ts +│ │ ├── crafting-loot.ts +│ │ ├── crafting-prep.ts │ │ ├── crafting-slice.ts +│ │ ├── crafting-utils.ts │ │ ├── debug-context.tsx +│ │ ├── dynamic-compute.ts │ │ ├── effects.ts │ │ ├── formatting.ts │ │ ├── navigation-slice.ts │ │ ├── skill-evolution.ts │ │ ├── skills.test.ts +│ │ ├── special-effects.ts │ │ ├── store.test.ts │ │ ├── store.ts │ │ ├── stores.test.ts │ │ ├── study-slice.ts │ │ ├── types.ts -│ │ └── upgrade-effects.ts +│ │ ├── upgrade-effects.ts +│ │ └── upgrade-effects.types.ts │ ├── db.ts │ └── utils.ts ├── .accesslog diff --git a/src/app/components/GameOverScreen.tsx b/src/app/components/GameOverScreen.tsx new file mode 100644 index 0000000..31cb728 --- /dev/null +++ b/src/app/components/GameOverScreen.tsx @@ -0,0 +1,57 @@ +'use client'; + +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import type { GameStore } from '@/lib/game/store'; + +interface GameOverScreenProps { + store: GameStore; +} + +export function GameOverScreen({ store }: GameOverScreenProps) { + return ( +
+ {store.victory + ? 'The Awakened One falls! Your power echoes through eternity.' + : 'The time loop resets... but you remember.'} +
+ +- {store.victory - ? 'The Awakened One falls! Your power echoes through eternity.' - : 'The time loop resets... but you remember.'} -
- -A vast tome of arcane knowledge. Study carefully — each spell costs insight to transcribe into your repertoire.
-Available pages: {availablePages}. Spells in grimoire: {grimoireSpells.length}.
-{spell.desc}
-A vast tome of arcane knowledge. Study carefully — each spell costs insight to transcribe into your repertoire.
+Available pages: {availablePages}. Spells in grimoire: {grimoireSpells.length}.
{spell.desc}
+Cannot switch topics while studying {SKILLS_DEF[store.currentStudyTarget?.id || '']?.name || 'another skill'}
-Study in parallel (50% speed)
-Cannot switch topics while studying {SKILLS_DEF[store.currentStudyTarget?.id || '']?.name || 'another skill'}
+Study in parallel (50% speed)
+Learn Enchanting skill to design enchantments
-Incompatible Effect
-{reason}
-Learn Enchanting skill to design enchantments
+Incompatible Effect
+{reason}
+