@@ -90,11 +92,11 @@ export function PactDebug() {
const addLog = useUIStore((s) => s.addLog);
const forcePact = (floor: number) => {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
if (!guardian) return;
if (signedPacts.includes(floor)) {
- addLog(`⚠️ Already signed pact with ${guardian.name}!`);
+ addLog(`\u26a0\ufe0f Already signed pact with ${guardian.name}!`);
return;
}
@@ -121,7 +123,7 @@ export function PactDebug() {
};
const removePactHandler = (floor: number) => {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
removePact(floor);
@@ -129,7 +131,7 @@ export function PactDebug() {
delete newSignedPactDetails[floor];
debugSetPactDetails(newSignedPactDetails);
- addLog(`📜 DEBUG: Removed pact with ${guardian?.name || 'Unknown'}!`);
+ addLog(`\ud83d\udcdc DEBUG: Removed pact with ${guardian ? guardian.name : 'Unknown'}!`);
};
const clearAllPacts = () => {
diff --git a/src/components/game/tabs/DebugTab/PactDebugSection.tsx b/src/components/game/tabs/DebugTab/PactDebugSection.tsx
index fb6e937..201f492 100644
--- a/src/components/game/tabs/DebugTab/PactDebugSection.tsx
+++ b/src/components/game/tabs/DebugTab/PactDebugSection.tsx
@@ -4,7 +4,8 @@ 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 { GUARDIANS, ELEMENTS } from '@/lib/game/constants';
+import { ELEMENTS } from '@/lib/game/constants';
+import { getGuardianForFloor, getAllGuardianFloors } from '@/lib/game/data/guardian-encounters';
// ─── Guardian Pact Row ───────────────────────────────────────────────────────
@@ -14,7 +15,8 @@ function GuardianPactRow({ floor, isSigned, onForceSign, onRemove }: {
onForceSign: () => void;
onRemove: () => void;
}) {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
+ if (!guardian) return null;
return (
s.addLog);
- const guardianFloors = Object.keys(GUARDIANS || {}).map(Number).sort((a, b) => a - b);
+ const guardianFloors = getAllGuardianFloors();
const forcePact = (floor: number) => {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
if (!guardian) return;
if (signedPacts.includes(floor)) {
@@ -99,7 +101,7 @@ export function PactDebugSection() {
};
const removePactHandler = (floor: number) => {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
removePact(floor);
@@ -107,7 +109,7 @@ export function PactDebugSection() {
delete newSignedPactDetails[floor];
debugSetPactDetails(newSignedPactDetails);
- addLog(`📜 DEBUG: Removed pact with ${guardian?.name || 'Unknown'}!`);
+ addLog(`\ud83d\udcdc DEBUG: Removed pact with ${guardian ? guardian.name : 'Unknown'}!`);
};
const signAllPacts = () => {
diff --git a/src/components/game/tabs/SpireSummaryTab.tsx b/src/components/game/tabs/SpireSummaryTab.tsx
index c5cb633..3a57b90 100644
--- a/src/components/game/tabs/SpireSummaryTab.tsx
+++ b/src/components/game/tabs/SpireSummaryTab.tsx
@@ -3,7 +3,9 @@
import { useState, useEffect, useMemo } from 'react';
import { useShallow } from 'zustand/react/shallow';
import { useCombatStore, usePrestigeStore, fmt } from '@/lib/game/stores';
-import { GUARDIANS, ELEMENT_OPPOSITES, FLOOR_ELEM_CYCLE } from '@/lib/game/constants';
+import { ELEMENT_OPPOSITES, FLOOR_ELEM_CYCLE } from '@/lib/game/constants';
+import { getGuardianForFloor, getAllGuardianFloors } from '@/lib/game/data/guardian-encounters';
+import type { GuardianDef } from '@/lib/game/types';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
@@ -14,9 +16,7 @@ import { Mountain } from 'lucide-react';
// ─── Guardian Data ────────────────────────────────────────────────────────────
-const GUARDIAN_FLOORS = Object.keys(GUARDIANS)
- .map(Number)
- .sort((a, b) => a - b);
+const GUARDIAN_FLOORS = getAllGuardianFloors();
// ─── Helper: Get Counter Element ─────────────────────────────────────────────
@@ -56,7 +56,7 @@ function FloorProgressBar({ maxFloor, clearedFloors }: { maxFloor: number; clear
{row.map((floor) => {
const isCleared = clearedSet.has(floor);
- const isGuardian = !!GUARDIANS[floor];
+ const isGuardian = !!getGuardianForFloor(floor);
const isCurrent = floor === maxFloor;
let bgClass = 'bg-gray-800';
@@ -76,8 +76,8 @@ function FloorProgressBar({ maxFloor, clearedFloors }: { maxFloor: number; clear
isGuardian ? 'font-bold' : ''
}`}
title={
- GUARDIANS[floor]
- ? `Floor ${floor} — ${GUARDIANS[floor].name} (${GUARDIANS[floor].element})`
+ getGuardianForFloor(floor)
+ ? `Floor ${floor} — ${getGuardianForFloor(floor)!.name} (${getGuardianForFloor(floor)!.element})`
: `Floor ${floor}${isCleared ? ' (cleared)' : ''}`
}
>
@@ -148,7 +148,7 @@ function StatCell({ value, label, color }: { value: number | string; label: stri
// ─── Next Guardian Card ──────────────────────────────────────────────────────
-function NextGuardianCard({ nextGuardian, nextGuardianData }: { nextGuardian: number; nextGuardianData: (typeof GUARDIANS)[number] }) {
+function NextGuardianCard({ nextGuardian, nextGuardianData }: { nextGuardian: number; nextGuardianData: GuardianDef }) {
const counterElement = getCounterElement(nextGuardianData.element);
const nextFloorElement = FLOOR_ELEM_CYCLE[(nextGuardian - 1) % FLOOR_ELEM_CYCLE.length];
@@ -244,16 +244,19 @@ function GuardianRoster({ clearedFloors }: { clearedFloors: Record
- {GUARDIAN_FLOORS.map((floor) => (
-
- ))}
+ {GUARDIAN_FLOORS.map((floor) => {
+ const guardian = getGuardianForFloor(floor);
+ return guardian ? (
+
+ ) : null;
+ })}
);
}
-function GuardianRosterItem({ floor, guardian, isDefeated }: { floor: number; guardian: (typeof GUARDIANS)[number]; isDefeated: boolean }) {
+function GuardianRosterItem({ floor, guardian, isDefeated }: { floor: number; guardian: GuardianDef; isDefeated: boolean }) {
return (
!clearedFloors[floor]) || null;
}, [clearedFloors]);
- const nextGuardianData = nextGuardian ? GUARDIANS[nextGuardian] : null;
+ const nextGuardianData = nextGuardian ? getGuardianForFloor(nextGuardian) : null;
const totalFloorsCleared = useMemo(() => {
return Object.values(clearedFloors).filter(Boolean).length;
diff --git a/src/lib/game/utils/pact-utils.ts b/src/lib/game/utils/pact-utils.ts
index ad9542c..f75587d 100644
--- a/src/lib/game/utils/pact-utils.ts
+++ b/src/lib/game/utils/pact-utils.ts
@@ -1,6 +1,6 @@
// ─── Pact Utility Functions ───────────────────────────────────────────────────
-import { GUARDIANS } from '../constants';
+import { getGuardianForFloor } from '../data/guardian-encounters';
export function computePactMultiplier(state: {
signedPacts: number[];
@@ -12,7 +12,7 @@ export function computePactMultiplier(state: {
let baseMult = 1.0;
for (const floor of signedPacts) {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
if (guardian) {
baseMult *= guardian.damageMultiplier;
}
@@ -43,7 +43,7 @@ export function computePactInsightMultiplier(state: {
let mult = 1.0;
for (const floor of signedPacts) {
- const guardian = GUARDIANS[floor];
+ const guardian = getGuardianForFloor(floor);
if (guardian) {
mult *= guardian.insightMultiplier;
}