Bug: Multi-element guardians only use first element for damage calculation #227

Closed
opened 2026-05-30 21:10:35 +02:00 by Anexim · 1 comment
Owner

Bug Description

For guardian floors with multiple elements (e.g. floor 230 guardian with ['crystal', 'stellar', 'void']), only the first element is used for elemental damage bonus calculations. The getFloorElement function returns guardian.element[0], and getElementalBonus only checks against a single element.

Code Location

src/lib/game/utils/floor-utils.ts lines ~22-28:

// For guardian floors:
return guardian.element[0]; // Only first element!

Impact

Medium. Multi-element guardians at floors 230-240 (and procedural guardians with 2+) are no harder than single-element guardians in terms of elemental counter-play. A guardian with ['crystal', 'stellar', 'void'] is treated as just crystal, making spells that counter stellar or void useless against them.

Fix Required

Either:

  1. Compute the best/worst elemental bonus across all guardian elements
  2. Use average bonus across elements
  3. Pick a random element per cast

The most balanced approach would be Math.min(...elements.map(e => getElementalBonus(spellElem, e))) so players get the best counter-play opportunity.

## Bug Description For guardian floors with multiple elements (e.g. floor 230 guardian with `['crystal', 'stellar', 'void']`), only the **first** element is used for elemental damage bonus calculations. The `getFloorElement` function returns `guardian.element[0]`, and `getElementalBonus` only checks against a single element. ## Code Location `src/lib/game/utils/floor-utils.ts` lines ~22-28: ```typescript // For guardian floors: return guardian.element[0]; // Only first element! ``` ## Impact **Medium.** Multi-element guardians at floors 230-240 (and procedural guardians with 2+) are no harder than single-element guardians in terms of elemental counter-play. A guardian with `['crystal', 'stellar', 'void']` is treated as just `crystal`, making spells that counter stellar or void useless against them. ## Fix Required Either: 1. Compute the best/worst elemental bonus across all guardian elements 2. Use average bonus across elements 3. Pick a random element per cast The most balanced approach would be `Math.min(...elements.map(e => getElementalBonus(spellElem, e)))` so players get the best counter-play opportunity.
Anexim added the ai:todo label 2026-05-30 21:10:35 +02:00
n8n-gitea was assigned by Anexim 2026-05-30 21:10:35 +02:00
Author
Owner

Fixed: New getMultiElementBonus() computes elemental bonus across all guardian elements using Math.min, making multi-element guardians properly challenging.

Fixed: New getMultiElementBonus() computes elemental bonus across all guardian elements using Math.min, making multi-element guardians properly challenging.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#227