fix: truncate procedural guardian names to key elements only
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m2s

This commit is contained in:
2026-06-11 12:27:16 +02:00
parent b15dde26b3
commit 048ffa6ab1
3 changed files with 19 additions and 3 deletions
+17 -1
View File
@@ -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;
}