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:
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