chore: remove unused imports, vars, and params — 84 imports, 7 vars, 16 params across 45+ files
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m25s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m25s
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import { Gem, Sparkles, Scroll, Droplet, Trash2, Search,
|
||||
Package, Sword, Shield, Shirt, Crown, ArrowUpDown,
|
||||
Wrench, AlertTriangle } from 'lucide-react';
|
||||
import type { EquipmentCategory } from '@/lib/game/data/equipment';
|
||||
import {
|
||||
Gem,
|
||||
Sparkles,
|
||||
Package,
|
||||
Sword,
|
||||
Shield,
|
||||
Shirt,
|
||||
Crown,
|
||||
Wrench
|
||||
} from 'lucide-react';
|
||||
|
||||
export const CATEGORY_ICONS: Record<string, typeof Sword> = {
|
||||
caster: Sword,
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import type { LootInventory as LootInventoryType, EquipmentInstance, ElementState } from '@/lib/game/types';
|
||||
import { LOOT_DROPS } from '@/lib/game/data/loot-drops';
|
||||
import { EQUIPMENT_TYPES } from '@/lib/game/data/equipment';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
|
||||
export type SortMode = 'name' | 'rarity' | 'count';
|
||||
export type FilterMode = 'all' | 'materials' | 'essence' | 'blueprints' | 'equipment';
|
||||
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { ActionButton } from '@/components/ui/action-button';
|
||||
import { GameCard } from '@/components/ui/game-card';
|
||||
import { SectionHeader } from '@/components/ui/section-header';
|
||||
import { StatRow } from '@/components/ui/stat-row';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { ENCHANTMENT_EFFECTS } from '@/lib/game/data/enchantment-effects';
|
||||
import type { EquipmentInstance, EnchantmentDesign, AppliedEnchantment, LootInventory, EquipmentCraftingProgress } from '@/lib/game/types';
|
||||
import type { EquipmentSlot } from '@/lib/game/data/equipment';
|
||||
import { fmt } from '@/lib/game/stores';
|
||||
import { CheckCircle, Sparkles } from 'lucide-react';
|
||||
import { useGameStore, useCraftingStore, useManaStore } from '@/lib/game/stores';
|
||||
import { useCraftingStore, useManaStore } from '@/lib/game/stores';
|
||||
|
||||
export interface EnchantmentApplierProps {
|
||||
selectedEquipmentInstance: string | null;
|
||||
@@ -36,7 +33,7 @@ export function EnchantmentApplier({
|
||||
const equipmentInstances = useCraftingStore((s) => s.equipmentInstances);
|
||||
const enchantmentDesigns = useCraftingStore((s) => s.enchantmentDesigns);
|
||||
const applicationProgress = useCraftingStore((s) => s.applicationProgress);
|
||||
const rawMana = useManaStore((s) => s.rawMana);
|
||||
const _rawMana = useManaStore((s) => s.rawMana);
|
||||
const startApplying = useCraftingStore((s) => s.startApplying);
|
||||
const pauseApplication = useCraftingStore((s) => s.pauseApplication);
|
||||
const resumeApplication = useCraftingStore((s) => s.resumeApplication);
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useMemo } from 'react';
|
||||
import { GameCard } from '@/components/ui/game-card';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { EQUIPMENT_TYPES } from '@/lib/game/data/equipment';
|
||||
import { ENCHANTMENT_EFFECTS } from '@/lib/game/data/enchantment-effects';
|
||||
import type { EquipmentInstance, EnchantmentDesign, DesignEffect, EquipmentCraftingProgress, EquipmentCategory } from '@/lib/game/types';
|
||||
import type { EnchantmentDesignerProps } from './EnchantmentDesigner/types';
|
||||
import { EquipmentTypeSelector } from './EnchantmentDesigner/EquipmentTypeSelector';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
'use client';
|
||||
|
||||
import { GameCard } from '@/components/ui/game-card';
|
||||
import { SectionHeader } from '@/components/ui/section-header';
|
||||
import { ActionButton } from '@/components/ui/action-button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
|
||||
@@ -10,11 +10,9 @@ import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@/components/ui/alert-dialog';
|
||||
import { Trash2, CheckCircle, AlertTriangle } from 'lucide-react';
|
||||
import { EQUIPMENT_TYPES } from '@/lib/game/data/equipment';
|
||||
import type { EquipmentInstance, AppliedEnchantment, LootInventory, EquipmentCraftingProgress } from '@/lib/game/types';
|
||||
import type { EquipmentSlot } from '@/lib/game/types';
|
||||
import { fmt } from '@/lib/game/stores';
|
||||
import { useGameStore, useCraftingStore, useManaStore } from '@/lib/game/stores';
|
||||
import { useCraftingStore, useManaStore } from '@/lib/game/stores';
|
||||
import { useGameToast } from '@/components/game/GameToast';
|
||||
|
||||
export interface EnchantmentPreparerProps {
|
||||
|
||||
@@ -36,18 +36,17 @@ function CraftingProgress({ progress }: { progress: { blueprintId: string; progr
|
||||
|
||||
// ─── Blueprint Card ───────────────────────────────────────────────────────────
|
||||
|
||||
function BlueprintCard({ bpId, lootInventory, rawMana, isCrafting, startCraftingEquipment, currentAction }: {
|
||||
function BlueprintCard({ bpId, lootInventory, rawMana, isCrafting, startCraftingEquipment }: {
|
||||
bpId: string;
|
||||
lootInventory: LootInventory;
|
||||
rawMana: number;
|
||||
isCrafting: boolean;
|
||||
startCraftingEquipment: (id: string) => void;
|
||||
currentAction: string | null;
|
||||
}) {
|
||||
const recipe = CRAFTING_RECIPES[bpId];
|
||||
if (!recipe) return null;
|
||||
|
||||
const { canCraft, missingMaterials } = canCraftRecipe(recipe, lootInventory.materials, rawMana);
|
||||
const { canCraft } = canCraftRecipe(recipe, lootInventory.materials, rawMana);
|
||||
const rarityStyle = LOOT_RARITY_COLORS[recipe.rarity];
|
||||
|
||||
return (
|
||||
@@ -137,7 +136,6 @@ function BlueprintList({ lootInventory, rawMana, startCraftingEquipment, current
|
||||
rawMana={rawMana}
|
||||
isCrafting={currentAction === 'craft'}
|
||||
startCraftingEquipment={startCraftingEquipment}
|
||||
currentAction={currentAction}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -186,8 +186,7 @@ function TimeControlSection({ day, hour, paused, onSetDay, onTogglePause }: {
|
||||
|
||||
// ─── Quick Actions Section ───────────────────────────────────────────────────
|
||||
|
||||
function QuickActionsSection({ elements, onUnlockBase, onUnlockUtility, onSkipToFloor, onResetFloorHP }: {
|
||||
elements: Record<string, { unlocked?: boolean }>;
|
||||
function QuickActionsSection({ onUnlockBase, onUnlockUtility, onSkipToFloor, onResetFloorHP }: {
|
||||
onUnlockBase: () => void;
|
||||
onUnlockUtility: () => void;
|
||||
onSkipToFloor: () => void;
|
||||
@@ -292,7 +291,6 @@ export function GameStateDebug() {
|
||||
<ManaDebugSection rawMana={rawMana} onAddMana={handleAddMana} onFillMana={handleFillMana} />
|
||||
<TimeControlSection day={day} hour={hour} paused={paused} onSetDay={handleSetDay} onTogglePause={togglePause} />
|
||||
<QuickActionsSection
|
||||
elements={elements}
|
||||
onUnlockBase={handleUnlockBase}
|
||||
onUnlockUtility={handleUnlockUtility}
|
||||
onSkipToFloor={() => debugSetFloor?.(100)}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Bug } from 'lucide-react';
|
||||
import { usePrestigeStore, useManaStore, useUIStore, useGameStore } from '@/lib/game/stores';
|
||||
import { usePrestigeStore, useUIStore, useGameStore } from '@/lib/game/stores';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
import { getGuardianForFloor, getAllGuardianFloors } from '@/lib/game/data/guardian-encounters';
|
||||
|
||||
@@ -80,14 +80,13 @@ function GuardianPactList({ signedPacts, onForceSign, onRemove }: {
|
||||
export function PactDebug() {
|
||||
const signedPacts = usePrestigeStore((s) => s.signedPacts);
|
||||
const signedPactDetails = usePrestigeStore((s) => s.signedPactDetails);
|
||||
const elements = useManaStore((s) => s.elements);
|
||||
const prestigeUpgrades = usePrestigeStore((s) => s.prestigeUpgrades);
|
||||
|
||||
const addSignedPact = usePrestigeStore((s) => s.addSignedPact);
|
||||
const removePact = usePrestigeStore((s) => s.removePact);
|
||||
const debugSetSignedPacts = usePrestigeStore((s) => s.debugSetSignedPacts);
|
||||
const debugSetPactDetails = usePrestigeStore((s) => s.debugSetPactDetails);
|
||||
const unlockElement = useManaStore((s) => s.unlockElement);
|
||||
|
||||
|
||||
const addLog = useUIStore((s) => s.addLog);
|
||||
|
||||
|
||||
Executable → Regular
+6
-1
@@ -1,6 +1,11 @@
|
||||
'use client';
|
||||
|
||||
import { createContext, useContext, useState, useEffect, type ReactNode } from 'react';
|
||||
import {
|
||||
createContext,
|
||||
useContext,
|
||||
useState,
|
||||
type ReactNode
|
||||
} from 'react';
|
||||
|
||||
interface DebugContextType {
|
||||
showComponentNames: boolean;
|
||||
|
||||
@@ -8,7 +8,6 @@ import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Progress } from '@/components/ui/progress';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { SectionHeader } from '@/components/ui/section-header';
|
||||
import { DebugName } from '@/components/game/debug/debug-context';
|
||||
import { fmt } from '@/lib/game/stores';
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('Fabricator recipes data', () => {
|
||||
});
|
||||
|
||||
it('getRecipesByManaType filters correctly', async () => {
|
||||
const { getRecipesByManaType, FABRICATOR_RECIPES } = await import('@/lib/game/data/fabricator-recipes');
|
||||
const { getRecipesByManaType } = await import('@/lib/game/data/fabricator-recipes');
|
||||
const earthRecipes = getRecipesByManaType('earth');
|
||||
expect(earthRecipes.length).toBeGreaterThan(0);
|
||||
for (const r of earthRecipes) {
|
||||
|
||||
@@ -37,7 +37,7 @@ function RecipeCard({
|
||||
onCraft: (recipe: FabricatorRecipe) => void;
|
||||
isCrafting: boolean;
|
||||
}) {
|
||||
const { canCraft, missingMaterials, missingMana } = canCraftRecipe(
|
||||
const { canCraft } = canCraftRecipe(
|
||||
recipe,
|
||||
materials,
|
||||
manaAmount,
|
||||
|
||||
@@ -13,7 +13,7 @@ export function DisciplineDebugSection() {
|
||||
const activate = useDisciplineStore((s) => s.activate);
|
||||
const deactivate = useDisciplineStore((s) => s.deactivate);
|
||||
|
||||
const handleTogglePause = (id: string) => {
|
||||
const _handleTogglePause = (id: string) => {
|
||||
const disc = disciplines[id];
|
||||
if (!disc) return;
|
||||
if (disc.paused) {
|
||||
@@ -77,7 +77,6 @@ export function DisciplineDebugSection() {
|
||||
const disc = disciplines[def.id];
|
||||
const isActive = activeIds.includes(def.id);
|
||||
const xp = disc?.xp || 0;
|
||||
const isPaused = disc?.paused ?? true;
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -168,8 +168,7 @@ function TimeControlSection({ day, hour, paused, onSetDay, onTogglePause }: {
|
||||
|
||||
// ─── Quick Actions Section ───────────────────────────────────────────────────
|
||||
|
||||
function QuickActionsSection({ elements, onUnlockBase, onSkipToFloor, onResetFloorHP }: {
|
||||
elements: Record<string, { unlocked?: boolean }>;
|
||||
function QuickActionsSection({ onUnlockBase, onSkipToFloor, onResetFloorHP }: {
|
||||
onUnlockBase: () => void;
|
||||
onSkipToFloor: () => void;
|
||||
onResetFloorHP: () => void;
|
||||
@@ -261,7 +260,6 @@ export function GameStateDebugSection() {
|
||||
<ManaDebugSection rawMana={rawMana} onAddMana={handleAddMana} onFillMana={handleFillMana} />
|
||||
<TimeControlSection day={day} hour={hour} paused={paused} onSetDay={handleSetDay} onTogglePause={togglePause} />
|
||||
<QuickActionsSection
|
||||
elements={elements}
|
||||
onUnlockBase={handleUnlockBase}
|
||||
onSkipToFloor={() => debugSetFloor?.(100)}
|
||||
onResetFloorHP={() => resetFloorHP?.()}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Bug } from 'lucide-react';
|
||||
import { usePrestigeStore, useManaStore, useUIStore, useGameStore } from '@/lib/game/stores';
|
||||
import { usePrestigeStore, useUIStore, useGameStore } from '@/lib/game/stores';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
import { getGuardianForFloor, getAllGuardianFloors } from '@/lib/game/data/guardian-encounters';
|
||||
|
||||
@@ -56,15 +56,12 @@ function GuardianPactRow({ floor, isSigned, onForceSign, onRemove }: {
|
||||
export function PactDebugSection() {
|
||||
const signedPacts = usePrestigeStore((s) => s.signedPacts);
|
||||
const signedPactDetails = usePrestigeStore((s) => s.signedPactDetails);
|
||||
const elements = useManaStore((s) => s.elements);
|
||||
const prestigeUpgrades = usePrestigeStore((s) => s.prestigeUpgrades);
|
||||
|
||||
const addSignedPact = usePrestigeStore((s) => s.addSignedPact);
|
||||
const removePact = usePrestigeStore((s) => s.removePact);
|
||||
const debugSetSignedPacts = usePrestigeStore((s) => s.debugSetSignedPacts);
|
||||
const debugSetPactDetails = usePrestigeStore((s) => s.debugSetPactDetails);
|
||||
const unlockElement = useManaStore((s) => s.unlockElement);
|
||||
|
||||
const addLog = useUIStore((s) => s.addLog);
|
||||
|
||||
const guardianFloors = getAllGuardianFloors();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
// ─── Test: EquipmentTab barrel export ──────────────────────────────────────────
|
||||
|
||||
|
||||
Executable → Regular
+1
-1
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { canAffordSpellCost, fmt } from '@/lib/game/stores';
|
||||
import { canAffordSpellCost } from '@/lib/game/stores';
|
||||
import { useCombatStore, useManaStore } from '@/lib/game/stores';
|
||||
import { ELEMENTS, SPELLS_DEF } from '@/lib/game/constants';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Progress } from '@/components/ui/progress';
|
||||
import { getSpireRoomTypeDisplay } from '@/lib/game/utils/spire-utils';
|
||||
import { getModifierDisplay, getModifierDescription } from '@/lib/game/utils/enemy-generator';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
import { fmt } from '@/lib/game/stores';
|
||||
|
||||
@@ -14,7 +13,7 @@ interface RoomDisplayProps {
|
||||
floor: number;
|
||||
}
|
||||
|
||||
function EnemyRow({ enemy, floor }: { enemy: EnemyState; floor: number }) {
|
||||
function EnemyRow({ enemy }: { enemy: EnemyState }) {
|
||||
const elemDef = ELEMENTS[enemy.element];
|
||||
const hpPercent = enemy.maxHP > 0 ? (enemy.hp / enemy.maxHP) * 100 : 0;
|
||||
const barrierVal = enemy.barrier ?? 0;
|
||||
@@ -192,7 +191,7 @@ export function RoomDisplay({ floorState, floor }: RoomDisplayProps) {
|
||||
<div className="text-xs text-gray-500 italic">Room cleared!</div>
|
||||
) : (
|
||||
enemies.map((enemy) => (
|
||||
<EnemyRow key={enemy.id} enemy={enemy} floor={floor} />
|
||||
<EnemyRow key={enemy.id} enemy={enemy} />
|
||||
))
|
||||
)}
|
||||
</CardContent>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import { useCombatStore, useManaStore, canAffordSpellCost, fmt } from '@/lib/game/stores';
|
||||
import { useCombatStore, useManaStore, canAffordSpellCost } from '@/lib/game/stores';
|
||||
import { SPELLS_DEF, ELEMENTS } from '@/lib/game/constants';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Progress } from '@/components/ui/progress';
|
||||
import { GOLEMS_DEF } from '@/lib/game/data/golems';
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ export function SpireCombatPage() {
|
||||
setAction('climb');
|
||||
}, [currentFloor, totalRooms, setCurrentRoom, setAction]);
|
||||
|
||||
const handleRoomCleared = () => {
|
||||
const _handleRoomCleared = () => {
|
||||
const nextRoomIndex = roomsCleared + 1;
|
||||
|
||||
if (nextRoomIndex >= totalRooms) {
|
||||
|
||||
Executable → Regular
+1
-2
@@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { usePrestigeStore, fmt, fmtDec } from '@/lib/game/stores';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
import { usePrestigeStore } from '@/lib/game/stores';
|
||||
import { useManaStats, useCombatStats, useStudyStats } from '@/lib/game/hooks/useGameDerived';
|
||||
import { ManaStatsSection } from './StatsTab/ManaStatsSection';
|
||||
import { CombatStatsSection } from './StatsTab/CombatStatsSection';
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { FlaskConical } from 'lucide-react';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
import { fmt, fmtDec } from '@/lib/game/stores';
|
||||
import { usePrestigeStore, useManaStore } from '@/lib/game/stores';
|
||||
import type { ElementState } from '@/lib/game/types';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user