fix: lootInventory, prestige, golemancy, attunementStore export, debug components
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s

This commit is contained in:
Refactoring Agent
2026-05-05 15:00:22 +02:00
parent f0532c1673
commit ed616738fd
10 changed files with 171 additions and 68 deletions
+2 -2
View File
@@ -9,10 +9,10 @@ import {
} from 'lucide-react';
import { GOLEMS_DEF, getGolemSlots, isGolemUnlocked, getGolemDamage, getGolemAttackSpeed, getGolemFloorDuration } from '@/lib/game/data/golems';
import { ELEMENTS } from '@/lib/game/constants';
import { useGameStore, useManaStore, useSkillStore, useCombatStore } from '@/lib/game/stores';
import { useGameStore, useManaStore, useSkillStore, useCombatStore, useAttunementStore } from '@/lib/game/stores';
export function GolemancyTab() {
const attunements = useGameStore((s) => s.attunements);
const attunements = useAttunementStore((s) => s.attunements);
const elements = useManaStore((s) => s.elements);
const skills = useSkillStore((s) => s.skills);
const golemancy = useGameStore((s) => s.golemancy);
+5 -5
View File
@@ -1,14 +1,14 @@
'use client';
import { useGameStore, useCraftingStore } from '@/lib/game/stores';
import { useCraftingStore, useManaStore } from '@/lib/game/stores';
import { LootInventoryDisplay } from '@/components/game/LootInventory';
export function LootTab() {
const lootInventory = useGameStore((s) => s.lootInventory);
const elements = useGameStore((s) => s.elements);
const lootInventory = useCraftingStore((s) => s.lootInventory);
const elements = useManaStore((s) => s.elements);
const equipmentInstances = useCraftingStore((s) => s.equipmentInstances);
const deleteMaterial = useGameStore((s) => s.deleteMaterial);
const deleteEquipmentInstance = useGameStore((s) => s.deleteEquipmentInstance);
const deleteMaterial = useCraftingStore((s) => s.deleteMaterial);
const deleteEquipmentInstance = useCraftingStore((s) => s.deleteEquipmentInstance);
return (
<div className="space-y-4">
+14 -5
View File
@@ -3,7 +3,7 @@
'use client';
import { useState } from 'react';
import { useGameStore, usePrestigeStore, useSkillStore, useManaStore } from '@/lib/game/stores';
import { usePrestigeStore, useSkillStore, useManaStore, useCraftingStore } from '@/lib/game/stores';
import { useGameLoop } from '@/lib/game/stores/gameHooks';
import { getUnifiedEffects } from '@/lib/game/effects';
import {
@@ -21,19 +21,28 @@ import { fmt } from '@/lib/game/stores';
export function PrestigeTab() {
const [selectedManaType, setSelectedManaType] = useState<string>('');
const store = useGameStore();
useGameLoop();
const skills = useSkillStore((s) => s.skills);
const prestigeUpgrades = usePrestigeStore((s) => s.prestigeUpgrades);
const rawMana = useManaStore((s) => s.rawMana);
const elements = useManaStore((s) => s.elements);
const skillUpgrades = useSkillStore((s) => s.skillUpgrades);
const skillTiers = useSkillStore((s) => s.skillTiers);
const equipmentInstances = useCraftingStore((s) => s.equipmentInstances);
const equippedInstances = useCraftingStore((s) => s.equippedInstances);
const doPrestige = usePrestigeStore((s) => s.doPrestige);
const upgradeEffects = getUnifiedEffects(store);
const upgradeEffects = getUnifiedEffects({
skillUpgrades,
skillTiers,
equipmentInstances,
equippedInstances,
});
// Get unlocked elements for mana type selector
const unlockedElements = Object.entries(ELEMENTS)
.filter(([id]) => store.elements[id]?.unlocked)
.filter(([id]) => elements[id]?.unlocked)
.map(([id, elem]) => ({
id,
name: elem.name,
@@ -66,7 +75,7 @@ export function PrestigeTab() {
<Button
size="sm"
disabled={!canAfford || level >= def.maxLevel}
onClick={() => store.doPrestige(id)}
onClick={() => doPrestige(id)}
>
{level >= def.maxLevel ? 'Maxed' : `Upgrade (${fmt(def.cost)})`}
</Button>
+2 -2
View File
@@ -19,7 +19,7 @@ import {
} from '@/lib/game/skill-evolution';
import { getUnifiedEffects } from '@/lib/game/effects';
import { getAvailableSkillCategories } from '@/lib/game/data/attunements';
import { fmt, fmtDec } from '@/lib/game/stores';
import { fmt, fmtDec, useAttunementStore } from '@/lib/game/stores';
import type { SkillUpgradeChoice } from '@/lib/game/types';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
@@ -166,7 +166,7 @@ export function SkillsTab() {
};
// Get available skill categories based on attunements
const attunements = useGameStore((s) => s.attunements);
const attunements = useAttunementStore((s) => s.attunements);
const availableCategories = getAvailableSkillCategories(attunements || {});
return (