refactor: remove GUARDIANS constant, consolidate into guardian-data.ts
- Delete src/lib/game/constants/guardians.ts (the old static GUARDIANS constant) - Create src/lib/game/data/guardian-data.ts with BASE_GUARDIANS (same data, new home) - Remove GUARDIANS export from constants/index.ts - Update all 11 files that imported GUARDIANS to use getGuardianForFloor() or BASE_GUARDIANS: - useGameDerived.ts, combat-actions.ts, gameStore.ts, prestigeStore.ts - combat-utils.ts, room-utils.ts, floor-utils.ts, spire-utils.ts - SpireCombatPage.tsx, SpireHeader.tsx - Update 4 test files to use getGuardianForFloor() instead of GUARDIANS constant - guardian-encounters.ts now imports BASE_GUARDIANS from guardian-data.ts - Split room-utils.test.ts (505 lines) into room-utils.test.ts + room-utils-floor-state.test.ts
This commit is contained in:
@@ -18,7 +18,8 @@ import {
|
||||
getElementalBonus,
|
||||
} from '../utils';
|
||||
import { computePactMultiplier, computePactInsightMultiplier } from '../utils/pact-utils';
|
||||
import { ELEMENTS, GUARDIANS, SPELLS_DEF, getStudySpeedMultiplier, getStudyCostMultiplier, HOURS_PER_TICK, TICK_MS } from '../constants';
|
||||
import { ELEMENTS, SPELLS_DEF, getStudySpeedMultiplier, getStudyCostMultiplier, HOURS_PER_TICK, TICK_MS } from '../constants';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import { hasSpecial, SPECIAL_EFFECTS } from '../effects/special-effects';
|
||||
|
||||
/**
|
||||
@@ -123,12 +124,12 @@ export function useCombatStats() {
|
||||
);
|
||||
|
||||
const isGuardianFloor = useMemo(
|
||||
() => !!GUARDIANS[currentFloor],
|
||||
() => !!getGuardianForFloor(currentFloor),
|
||||
[currentFloor]
|
||||
);
|
||||
|
||||
const currentGuardian = useMemo(
|
||||
() => GUARDIANS[currentFloor],
|
||||
() => getGuardianForFloor(currentFloor),
|
||||
[currentFloor]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user