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,8 +1,8 @@
|
||||
# Circular Dependencies
|
||||
Generated: 2026-05-25T15:37:17.998Z
|
||||
Generated: 2026-05-25T16:26:37.693Z
|
||||
Found: 6 circular chain(s) — these MUST be fixed before modifying involved files.
|
||||
|
||||
1. Processed 135 files (1.7s) (2 warnings)
|
||||
1. Processed 135 files (1.6s) (2 warnings)
|
||||
2. 1) utils/floor-utils.ts > utils/room-utils.ts > utils/enemy-utils.ts
|
||||
3. 2) utils/floor-utils.ts > utils/room-utils.ts
|
||||
4. 3) stores/gameStore.ts > stores/gameActions.ts
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"_meta": {
|
||||
"generated": "2026-05-25T15:37:16.139Z",
|
||||
"generated": "2026-05-25T16:26:35.898Z",
|
||||
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
||||
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
||||
},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
@@ -10,7 +10,6 @@ import { AttunementStatus } from '@/components/game/AttunementStatus';
|
||||
import { ActivityLogPanel } from '@/components/game/ActivityLogPanel';
|
||||
import { DebugName } from '@/components/game/debug/debug-context';
|
||||
import { useGameStore, useManaStore, useCombatStore, useCraftingStore, usePrestigeStore } from '@/lib/game/stores';
|
||||
import { computeDisciplineEffects } from '@/lib/game/effects/discipline-effects';
|
||||
import { getUnifiedEffects } from '@/lib/game/effects';
|
||||
import { getMeditationBonus, getIncursionStrength } from '@/lib/game/stores';
|
||||
import { computeTotalMaxMana, computeTotalRegen, computeTotalClickMana } from '@/lib/game/effects';
|
||||
|
||||
+1
-3
@@ -10,12 +10,11 @@ import {
|
||||
useCombatStore,
|
||||
usePrestigeStore,
|
||||
useCraftingStore,
|
||||
fmt,
|
||||
computeMaxMana,
|
||||
computeRegen,
|
||||
computeClickMana,
|
||||
getMeditationBonus,
|
||||
getIncursionStrength,
|
||||
getIncursionStrength
|
||||
} from '@/lib/game/stores';
|
||||
import { computeDisciplineEffects } from '@/lib/game/effects/discipline-effects';
|
||||
import { useGameLoop } from '@/lib/game/stores/gameHooks';
|
||||
@@ -26,7 +25,6 @@ import { TimeDisplay } from '@/components/game';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { TooltipProvider } from '@/components/ui/tooltip';
|
||||
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
||||
import { DebugName } from '@/components/game/debug/debug-context';
|
||||
|
||||
import { GameOverScreen } from './components/GameOverScreen';
|
||||
import { LeftPanel } from './components/LeftPanel';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -10,11 +10,10 @@ import {
|
||||
Skull,
|
||||
Zap,
|
||||
Waves,
|
||||
Star,
|
||||
CloudLightning,
|
||||
Snowflake,
|
||||
Sparkles,
|
||||
Globe,
|
||||
Globe
|
||||
} from "lucide-react";
|
||||
|
||||
interface ElementBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Check, Circle, ArrowRight } from "lucide-react";
|
||||
import { Check } from "lucide-react";
|
||||
|
||||
interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
steps: string[];
|
||||
|
||||
Executable → Regular
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { calculateEffectCapacityCost, ENCHANTMENT_EFFECTS } from '../data/enchantment-effects';
|
||||
import { calculateEffectCapacityCost } from '../data/enchantment-effects';
|
||||
import { EQUIPMENT_TYPES } from '../data/equipment';
|
||||
import { ATTUNEMENTS_DEF, getAttunementConversionRate } from '../data/attunements';
|
||||
import { getFloorMaxHP } from '../utils';
|
||||
|
||||
Executable → Regular
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
getMeditationBonus,
|
||||
getIncursionStrength,
|
||||
} from '../utils';
|
||||
import { MAX_DAY, INCURSION_START_DAY, HOURS_PER_TICK } from '../constants';
|
||||
import { MAX_DAY, INCURSION_START_DAY } from '../constants';
|
||||
|
||||
describe('fmt', () => {
|
||||
it('should format numbers < 1000 as integers', () => {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { useGameStore } from '../stores/gameStore';
|
||||
import { useManaStore } from '../stores/manaStore';
|
||||
import { useCombatStore } from '../stores/combatStore';
|
||||
import { useUIStore } from '../stores/uiStore';
|
||||
import { MAX_DAY } from '../constants';
|
||||
import { getFloorMaxHP } from '../utils';
|
||||
import { resetAllStores, tickN } from './cross-module-helpers';
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
vi,
|
||||
afterEach
|
||||
} from 'vitest';
|
||||
import { getEnemyName, generateSwarmEnemies } from '../utils/enemy-utils';
|
||||
import { FLOOR_ELEM_CYCLE } from '../constants';
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { getFloorMaxHP, getFloorElement } from '../utils/floor-utils';
|
||||
import { FLOOR_ELEM_CYCLE } from '../constants';
|
||||
|
||||
// Helper: compute expected guardian HP (same formula as guardian-data.ts)
|
||||
function guardianHP(floor: number): number {
|
||||
|
||||
@@ -20,7 +20,7 @@ function getDamageMult(mult: number, extraPacts: number, mitigation: number): nu
|
||||
}
|
||||
|
||||
// Apply the actual calculation to test values
|
||||
function computeTestResult( multipliers: number[], extraPacts: number, mitigation: number): number {
|
||||
function _computeTestResult( multipliers: number[], extraPacts: number, mitigation: number): number {
|
||||
const baseMult = multipliers.reduce((a, b) => a * b, 1);
|
||||
return getDamageMult(baseMult, extraPacts, mitigation);
|
||||
}
|
||||
@@ -118,7 +118,6 @@ describe('computePactMultiplier', () => {
|
||||
const floor10 = getGuardianForFloor(10)!;
|
||||
const floor20 = getGuardianForFloor(20)!;
|
||||
const floor30 = getGuardianForFloor(30)!;
|
||||
const baseMult = floor10.damageMultiplier * floor20.damageMultiplier * floor30.damageMultiplier;
|
||||
|
||||
// 3 pacts: numAdditional = 2, basePenalty = 1.0, effectivePenalty = 1.0
|
||||
// result = baseMult * (1 - 1.0) = 0
|
||||
@@ -229,7 +228,6 @@ describe('computePactInsightMultiplier', () => {
|
||||
const floor10 = getGuardianForFloor(10)!;
|
||||
const floor20 = getGuardianForFloor(20)!;
|
||||
const floor30 = getGuardianForFloor(30)!;
|
||||
const baseMult = floor10.insightMultiplier * floor20.insightMultiplier * floor30.insightMultiplier;
|
||||
|
||||
const result = computePactInsightMultiplier({
|
||||
signedPacts: [10, 20, 30],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { readFileSync } from 'fs';
|
||||
import { computeDynamicRegen } from '../effects/dynamic-compute';
|
||||
import { SPECIAL_EFFECTS, hasSpecial } from '../effects/special-effects';
|
||||
import { SPECIAL_EFFECTS } from '../effects/special-effects';
|
||||
import type { ComputedEffects } from '../effects/upgrade-effects.types';
|
||||
|
||||
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { generateFloorState } from '../utils/room-utils';
|
||||
import { PUZZLE_ROOMS, SWARM_CONFIG, SPEED_ROOM_CONFIG } from '../constants';
|
||||
import { SWARM_CONFIG } from '../constants';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import { getFloorMaxHP } from '../utils/floor-utils';
|
||||
import { getDodgeChance } from '../utils/room-utils';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
getDodgeChance,
|
||||
getPuzzleProgressSpeed,
|
||||
} from '../utils/room-utils';
|
||||
import { PUZZLE_ROOMS, SWARM_CONFIG, SPEED_ROOM_CONFIG, FLOOR_ARMOR_CONFIG } from '../constants';
|
||||
import { PUZZLE_ROOMS, SPEED_ROOM_CONFIG, FLOOR_ARMOR_CONFIG } from '../constants';
|
||||
import { getAllGuardianFloors } from '../data/guardian-encounters';
|
||||
|
||||
// ─── generateRoomType ─────────────────────────────────────────────────────────
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
// Design system functions: calculateDesignTime, capacity cost, XP, etc.
|
||||
|
||||
import type { EnchantmentDesign, DesignEffect, AppliedEnchantment, DesignProgress } from './types';
|
||||
import type { EquipmentInstance } from './types';
|
||||
import type { ComputedEffects } from './effects/upgrade-effects.types';
|
||||
import { calculateEnchantingXP } from './data/attunements';
|
||||
import { ENCHANTMENT_EFFECTS, calculateEffectCapacityCost } from './data/enchantment-effects';
|
||||
import { hasSpecial, SPECIAL_EFFECTS } from './effects/special-effects';
|
||||
import { EQUIPMENT_TYPES, type EquipmentCategory } from './data/equipment';
|
||||
import { EQUIPMENT_TYPES } from './data/equipment';
|
||||
|
||||
// ─── Design Creation & Calculation ──────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
import type { EquipmentInstance, EquipmentCraftingProgress } from './types';
|
||||
import { CRAFTING_RECIPES, canCraftRecipe, type CraftingRecipe } from './data/crafting-recipes';
|
||||
import { EQUIPMENT_TYPES } from './data/equipment';
|
||||
import { generateInstanceId } from './crafting-utils';
|
||||
import { ok, fail, ErrorCode } from './utils/result';
|
||||
import type { Result } from './utils/result';
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ export function removeBlueprint(inventory: LootInventory, blueprintId: string):
|
||||
}
|
||||
|
||||
// Check and remove consumed blueprint (if single-use)
|
||||
export function consumeBlueprint(inventory: LootInventory, blueprintId: string): LootInventory {
|
||||
export function consumeBlueprint(inventory: LootInventory, _blueprintId: string): LootInventory {
|
||||
// Blueprints are persistent for now, but this function provides future flexibility
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { EquipmentInstance, EnchantmentDesign } from './types';
|
||||
import { EQUIPMENT_TYPES, type EquipmentCategory, type EquipmentSlot } from './data/equipment';
|
||||
import { CRAFTING_RECIPES, canCraftRecipe, type CraftingRecipe } from './data/crafting-recipes';
|
||||
import { type CraftingRecipe } from './data/crafting-recipes';
|
||||
|
||||
// ─── Instance/ID Generation ──────────────────────────────────────────────────
|
||||
|
||||
|
||||
Executable → Regular
-2
@@ -1,8 +1,6 @@
|
||||
// ─── Crafting Recipes ─────────────────────────────────────────────────────────
|
||||
// Defines what materials are needed to craft equipment from blueprints
|
||||
|
||||
import type { EquipmentSlot } from './equipment/types';
|
||||
|
||||
export interface CraftingRecipe {
|
||||
id: string; // Blueprint ID (matches loot drop)
|
||||
equipmentTypeId: string; // Resulting equipment type ID
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// All defense-related enchantment effects that can be applied to equipment
|
||||
// Currently empty - no defense effects defined in the original enchantment-effects.ts
|
||||
|
||||
import type { EquipmentCategory } from '../equipment'
|
||||
import type { EnchantmentEffectDef } from '../enchantment-types'
|
||||
|
||||
export const DEFENSE_EFFECTS: Record<string, EnchantmentEffectDef> = {};
|
||||
|
||||
Executable → Regular
-1
@@ -7,7 +7,6 @@
|
||||
import type { EquipmentInstance } from './types';
|
||||
import { ENCHANTMENT_EFFECTS } from './data/enchantment-effects';
|
||||
import { computeEffects } from './effects/upgrade-effects';
|
||||
import { hasSpecial, SPECIAL_EFFECTS } from './effects/special-effects';
|
||||
import { computeDisciplineEffects } from './effects/discipline-effects';
|
||||
import type { ComputedEffects } from './effects/upgrade-effects.types';
|
||||
|
||||
|
||||
Executable → Regular
+1
-1
@@ -8,7 +8,7 @@ import type { ActiveUpgradeEffect, ComputedEffects } from './upgrade-effects.typ
|
||||
// ─── Upgrade Definition Cache ───────────────────────────
|
||||
|
||||
// No-op: skill evolution paths have been removed
|
||||
function buildUpgradeCache(): void {
|
||||
function _buildUpgradeCache(): void {
|
||||
// No-op: no upgrade definitions to cache
|
||||
}
|
||||
|
||||
|
||||
Executable → Regular
+1
-1
@@ -27,7 +27,7 @@ import { hasSpecial, SPECIAL_EFFECTS } from '../effects/special-effects';
|
||||
*/
|
||||
export function useManaStats() {
|
||||
const prestigeUpgrades = usePrestigeStore((s) => s.prestigeUpgrades);
|
||||
const rawMana = useManaStore((s) => s.rawMana);
|
||||
const _rawMana = useManaStore((s) => s.rawMana);
|
||||
const meditateTicks = useManaStore((s) => s.meditateTicks);
|
||||
const day = useGameStore((s) => s.day);
|
||||
const hour = useGameStore((s) => s.hour);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import { createSafeStorage } from '../utils/safe-persist';
|
||||
import type { AttunementState } from '../types';
|
||||
import { ATTUNEMENTS_DEF, getAttunementXPForLevel, MAX_ATTUNEMENT_LEVEL } from '../data/attunements';
|
||||
import { getAttunementXPForLevel, MAX_ATTUNEMENT_LEVEL } from '../data/attunements';
|
||||
|
||||
export interface AttunementStoreState {
|
||||
attunements: Record<string, AttunementState>;
|
||||
|
||||
@@ -8,7 +8,6 @@ import type { CombatStore, CombatState } from './combat-state.types';
|
||||
import type { SpellState } from '../types';
|
||||
import { getFloorMaxHP, getFloorElement, calcDamage, canAffordSpellCost, deductSpellCost } from '../utils';
|
||||
import { computeDisciplineEffects } from '../effects/discipline-effects';
|
||||
import { ErrorCode } from '../utils/result';
|
||||
|
||||
/**
|
||||
* Create a default CombatTickResult for safe fallback on error.
|
||||
|
||||
Executable → Regular
-1
@@ -6,7 +6,6 @@ import { persist } from 'zustand/middleware';
|
||||
import { createSafeStorage } from '../utils/safe-persist';
|
||||
import type { GameAction, SpellState, FloorState, GolemancyState, ActivityLogEntry, AchievementState, EquipmentSpellState, ActivityEventType } from '../types';
|
||||
import { getFloorMaxHP } from '../utils';
|
||||
import { usePrestigeStore } from './prestigeStore';
|
||||
import { generateFloorState } from '../utils/room-utils';
|
||||
import { addActivityLogEntry } from '../utils/activity-log';
|
||||
import { processCombatTick, makeInitialSpells } from './combat-actions';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// ─── Crafting Store ─────────────────────────────────────────────────────
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import type { DesignProgress, EnchantmentDesign, DesignEffect } from '../types';
|
||||
import type { EquipmentSlot } from '../types/equipmentSlot';
|
||||
import type { CraftingStore, CraftingState } from './craftingStore.types';
|
||||
import * as CraftingUtils from '../crafting-utils';
|
||||
@@ -16,7 +15,6 @@ import * as CraftingEquipment from '../crafting-equipment';
|
||||
import { equipItem as equipItemAction, unequipItem as unequipItemAction } from '../crafting-actions/equipment-actions';
|
||||
import { ErrorCode } from '../utils/result';
|
||||
import { createSafeStorage } from '../utils/safe-persist';
|
||||
import type { Result } from '../utils/result';
|
||||
import { createInitialEquipmentInstances } from './crafting-initial-state';
|
||||
|
||||
export const useCraftingStore = create<CraftingStore>()(
|
||||
|
||||
@@ -6,10 +6,9 @@ import type { DisciplineState } from '../types/disciplines';
|
||||
import type { ElementState } from '../types';
|
||||
import {
|
||||
calculateManaDrain,
|
||||
calculateStatBonus,
|
||||
canProceedDiscipline,
|
||||
checkDisciplinePrerequisites,
|
||||
getUnlockedPerks,
|
||||
getUnlockedPerks
|
||||
} from '../utils/discipline-math';
|
||||
import { baseDisciplines } from '../data/disciplines/base';
|
||||
import { elementalAttunementDisciplines } from '../data/disciplines/elemental';
|
||||
|
||||
@@ -5,7 +5,6 @@ import { usePrestigeStore } from './prestigeStore';
|
||||
import { useManaStore } from './manaStore';
|
||||
import { useCombatStore } from './combatStore';
|
||||
import { computeDisciplineEffects } from '../effects/discipline-effects';
|
||||
import { useDisciplineStore } from './discipline-slice';
|
||||
|
||||
export const createResetGame = (set: (state: Partial<GameCoordinatorState>) => void, initialState: GameCoordinatorState) => () => {
|
||||
// Clear all persisted state
|
||||
|
||||
@@ -2,11 +2,8 @@ import { useEffect } from 'react';
|
||||
import { useGameStore } from './gameStore';
|
||||
import { useManaStore } from './manaStore';
|
||||
import { usePrestigeStore } from './prestigeStore';
|
||||
import { useCombatStore } from './combatStore';
|
||||
import { useUIStore } from './uiStore';
|
||||
import { useCraftingStore } from './craftingStore';
|
||||
import { useDisciplineStore } from './discipline-slice';
|
||||
import { getUnifiedEffects, type UnifiedEffects } from '../effects';
|
||||
import { getUnifiedEffects } from '../effects';
|
||||
import { computeDisciplineEffects } from '../effects/discipline-effects';
|
||||
import {
|
||||
computeMaxMana,
|
||||
|
||||
@@ -7,7 +7,6 @@ import { usePrestigeStore } from './prestigeStore';
|
||||
import { useManaStore } from './manaStore';
|
||||
import { useCombatStore } from './combatStore';
|
||||
import { computeDisciplineEffects } from '../effects/discipline-effects';
|
||||
import { useDisciplineStore } from './discipline-slice';
|
||||
|
||||
export const createStartNewLoop = (set: (state: Partial<GameCoordinatorState>) => void) => () => {
|
||||
const prestigeState = usePrestigeStore.getState();
|
||||
|
||||
Executable → Regular
+3
-8
@@ -4,7 +4,7 @@
|
||||
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import { TICK_MS, HOURS_PER_TICK, MAX_DAY, getStudySpeedMultiplier } from '../constants';
|
||||
import { HOURS_PER_TICK, MAX_DAY } from '../constants';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import { hasSpecial, SPECIAL_EFFECTS } from '../effects/special-effects';
|
||||
import { computeEquipmentEffects } from '../effects';
|
||||
@@ -14,19 +14,14 @@ import { computeDisciplineEffects } from '../effects/discipline-effects';
|
||||
import {
|
||||
computeMaxMana,
|
||||
computeRegen,
|
||||
getFloorElement,
|
||||
getFloorMaxHP,
|
||||
getMeditationBonus,
|
||||
getIncursionStrength,
|
||||
calcInsight,
|
||||
calcDamage,
|
||||
deductSpellCost,
|
||||
canAffordSpellCost,
|
||||
calcInsight
|
||||
} from '../utils';
|
||||
import { useUIStore } from './uiStore';
|
||||
import { usePrestigeStore } from './prestigeStore';
|
||||
import { useManaStore } from './manaStore';
|
||||
import { useCombatStore, makeInitialSpells } from './combatStore';
|
||||
import { useCombatStore } from './combatStore';
|
||||
import { useAttunementStore } from './attunementStore';
|
||||
import { useCraftingStore } from './craftingStore';
|
||||
import { useDisciplineStore } from './discipline-slice';
|
||||
|
||||
Executable → Regular
+1
-1
@@ -6,7 +6,7 @@ import { persist } from 'zustand/middleware';
|
||||
import { createSafeStorage } from '../utils/safe-persist';
|
||||
import { PRESTIGE_DEF } from '../constants';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import { ok, okVoid, fail, ErrorCode } from '../utils/result';
|
||||
import { okVoid, fail, ErrorCode } from '../utils/result';
|
||||
import type { Result } from '../utils/result';
|
||||
|
||||
// ─── Prestige State (data only) ──────────────────────────────────────────────
|
||||
|
||||
@@ -2,7 +2,15 @@
|
||||
// Moved from store-modules/room-utils.ts to eliminate legacy dependencies
|
||||
|
||||
import type { RoomType, FloorState, EnemyState } from '../types';
|
||||
import { FLOOR_ELEM_CYCLE, PUZZLE_ROOMS, PUZZLE_ROOM_INTERVAL, PUZZLE_ROOM_CHANCE, SWARM_ROOM_CHANCE, SPEED_ROOM_CHANCE, FLOOR_ARMOR_CONFIG, SWARM_CONFIG, SPEED_ROOM_CONFIG } from '../constants';
|
||||
import {
|
||||
PUZZLE_ROOMS,
|
||||
PUZZLE_ROOM_INTERVAL,
|
||||
PUZZLE_ROOM_CHANCE,
|
||||
SWARM_ROOM_CHANCE,
|
||||
SPEED_ROOM_CHANCE,
|
||||
FLOOR_ARMOR_CONFIG,
|
||||
SPEED_ROOM_CONFIG
|
||||
} from '../constants';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import { getFloorMaxHP } from './floor-utils';
|
||||
import { getFloorElement } from './floor-utils';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Spire-specific utility functions for room generation, enemy stat scaling, etc.
|
||||
|
||||
import type { RoomType, FloorState, EnemyState } from '../types';
|
||||
import { FLOOR_ELEM_CYCLE, PUZZLE_ROOMS } from '../constants';
|
||||
import { PUZZLE_ROOMS } from '../constants';
|
||||
import { getFloorMaxHP, getFloorElement } from './floor-utils';
|
||||
import { getEnemyName } from './enemy-utils';
|
||||
import { getGuardianForFloor, isGuardianFloor } from '../data/guardian-encounters';
|
||||
@@ -62,7 +62,7 @@ export function generateSpireRoomType(floor: number, roomIndex: number, totalRoo
|
||||
return generateCombatRoomType(floor);
|
||||
}
|
||||
|
||||
function generateCombatRoomType(floor: number): RoomType {
|
||||
function generateCombatRoomType(_floor: number): RoomType {
|
||||
const roll = Math.random();
|
||||
if (roll < 0.12) return 'swarm';
|
||||
if (roll < 0.22) return 'speed';
|
||||
|
||||
Reference in New Issue
Block a user