From 048ffa6ab1e61842ebfccc9b15f55735eaa50457 Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Thu, 11 Jun 2026 12:27:16 +0200 Subject: [PATCH] fix: truncate procedural guardian names to key elements only --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- src/lib/game/data/guardian-procedural.ts | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index f597514..f488b1e 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-11T09:55:02.653Z +Generated: 2026-06-11T10:10:52.183Z Found: 4 circular chain(s) — these MUST be fixed before modifying involved files. 1. 1) data/guardian-encounters.ts > data/guardian-procedural.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 9661e5d..4fa70cc 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-11T09:55:00.412Z", + "generated": "2026-06-11T10:10:50.083Z", "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." }, diff --git a/src/lib/game/data/guardian-procedural.ts b/src/lib/game/data/guardian-procedural.ts index ce8fd35..e0bffbb 100644 --- a/src/lib/game/data/guardian-procedural.ts +++ b/src/lib/game/data/guardian-procedural.ts @@ -159,6 +159,22 @@ export function getProceduralGuardian(floor: number): GuardianDef | null { const tier = floor >= 440 ? 8 : floor >= 390 ? 7 : floor >= 340 ? 6 : floor >= 290 ? 5 : floor >= 250 ? 4 : 0; if (tier === 0) return null; const g = tier === 4 ? getTier4Guardian(floor) : tier === 5 ? getTier5Guardian(floor) : tier === 6 ? getTier6Guardian(floor) : tier === 7 ? getTier7Guardian(floor) : getTier8Guardian(floor); - if (!g.name) g.name = generateGuardianName(g.element, floor); + if (!g.name) { + // Use only the primary (key) elements for name generation, not the full + // component chain from resolveMultiUnlockChain(). This keeps names concise + // (e.g. "Ignis-Aqua the Warden" instead of "Ignis-Petra-Marina the Warden"). + const compositesInChain = g.element.filter((e) => COMPOSITE_ELEMENTS.includes(e)); + const exoticsInChain = g.element.filter((e) => EXOTIC_ELEMENTS.includes(e)); + const keyElements = tier === 4 + ? g.element.slice(0, 2) + : tier === 5 + ? compositesInChain.slice(0, 2) + : tier === 6 + ? exoticsInChain.slice(0, 1) + : tier === 7 + ? [...exoticsInChain.slice(0, 1), ...compositesInChain.slice(0, 1)] + : [...exoticsInChain.slice(0, 1), ...compositesInChain.slice(0, 2)]; + g.name = generateGuardianName(keyElements, floor); + } return g; }