From e437269adb21b39c9ea6d6c126fde8248a6dd832 Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Wed, 13 May 2026 10:30:28 +0200 Subject: [PATCH] fix(store/computed): remove banned 'life' element from getFloorElement() - Removed local FLOOR_ELEM_CYCLE array containing banned 'life' element - Now imports FLOOR_ELEM_CYCLE from ../constants (which already excludes 'life') - Updated getFloorElement() to use imported constant with dynamic length --- src/lib/game/store/computed.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/game/store/computed.ts b/src/lib/game/store/computed.ts index a1e184e..2130e78 100755 --- a/src/lib/game/store/computed.ts +++ b/src/lib/game/store/computed.ts @@ -1,7 +1,7 @@ // ─── Computed Stats Functions ───────────────────────────────────────────────── import type { GameState } from '../types'; -import { ELEMENTS, GUARDIANS, SPELLS_DEF, SKILLS_DEF, PRESTIGE_DEF, ELEMENT_OPPOSITES } from '../constants'; +import { ELEMENTS, GUARDIANS, SPELLS_DEF, SKILLS_DEF, PRESTIGE_DEF, ELEMENT_OPPOSITES, FLOOR_ELEM_CYCLE } from '../constants'; import { computeEffects } from '../upgrade-effects'; import type { ComputedEffects } from '../upgrade-effects.types'; import type { UnifiedEffects } from '../effects'; @@ -284,8 +284,7 @@ export function getFloorMaxHP(floor: number): number { } export function getFloorElement(floor: number): string { - const FLOOR_ELEM_CYCLE = ["fire", "water", "air", "earth", "light", "dark", "life", "death"]; - return FLOOR_ELEM_CYCLE[(floor - 1) % 8]; + return FLOOR_ELEM_CYCLE[(floor - 1) % FLOOR_ELEM_CYCLE.length]; } // Formatting utilities