[High] [Bug] Golemancy: Combat runtime missing elemental matchup, enchantment effects, and proper spell damage #313

Closed
opened 2026-06-07 17:43:55 +02:00 by Anexim · 4 comments
Owner

Spec: docs/specs/attunements/fabricator/systems/golemancy-spec.md §11
Severity: High

Problem: Multiple combat features are missing or wrong in src/lib/game/stores/golem-combat-actions.ts:

  1. Line 286: Spell damage uses hardcoded 20 * frame.magicAffinity instead of actual spell data
  2. Line 287: Spell mana cost hardcoded to 10 instead of actual spell cost
  3. Lines 298-299: No elemental matchup bonus applied to basic attacks
  4. Lines 298-307: Enchantment effects (burn, slow, shock, etc.) not applied to basic attacks
  5. Line 299: Armor pierce multiplies damage (baseDamage * (1 + armorPierce)) instead of bypassing enemy armor

File: src/lib/game/stores/golem-combat-actions.ts (multiple lines)

**Spec:** docs/specs/attunements/fabricator/systems/golemancy-spec.md §11 **Severity:** High **Problem:** Multiple combat features are missing or wrong in `src/lib/game/stores/golem-combat-actions.ts`: 1. **Line 286**: Spell damage uses hardcoded `20 * frame.magicAffinity` instead of actual spell data 2. **Line 287**: Spell mana cost hardcoded to 10 instead of actual spell cost 3. **Lines 298-299**: No elemental matchup bonus applied to basic attacks 4. **Lines 298-307**: Enchantment effects (burn, slow, shock, etc.) not applied to basic attacks 5. **Line 299**: Armor pierce multiplies damage (`baseDamage * (1 + armorPierce)`) instead of bypassing enemy armor **File:** `src/lib/game/stores/golem-combat-actions.ts` (multiple lines)
Anexim added the ai:todo label 2026-06-07 17:43:55 +02:00
n8n-gitea was assigned by Anexim 2026-06-07 17:43:55 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-08 00:51:01 +02:00
Author
Owner

Starting work on golem-combat-actions.ts fixes. Will address all 5 issues: spell damage, spell mana cost, elemental matchup, enchantment effects, and armor pierce.

Starting work on golem-combat-actions.ts fixes. Will address all 5 issues: spell damage, spell mana cost, elemental matchup, enchantment effects, and armor pierce.
Anexim added ai:review and removed ai:in-progress labels 2026-06-08 10:01:46 +02:00
Author
Owner

All 5 fixes applied and verified. 1038 tests passing (53 files), including 29 new regression tests. Files stay under 400-line limit.

All 5 fixes applied and verified. 1038 tests passing (53 files), including 29 new regression tests. Files stay under 400-line limit.
Author
Owner

Fix committed and pushed. Summary of changes:

Files modified:

  • src/lib/game/stores/golem-combat-actions.ts (366 lines) — Core fixes
  • src/lib/game/stores/golem-combat-helpers.ts (134 lines, new) — Extracted helpers
  • src/lib/game/stores/combat-actions.ts (388 lines) — Updated call site
  • src/lib/game/stores/golem-combat-actions.test.ts (348 lines, new) — Integration tests
  • src/lib/game/stores/golem-combat-helpers.test.ts (143 lines, new) — Unit tests

5 fixes applied:

  1. Spell damage: SPELLS_DEF[spellId].dmg * frame.magicAffinity (was hardcoded 20 * magicAffinity)
  2. Spell mana cost: SPELLS_DEF[spellId].cost.amount (was hardcoded 10)
  3. Elemental matchup: getElementalBonus(frame.element, enemyElement) applied to basic attacks
  4. Enchantment effects: Golem enchantments (burn, slow, shock, etc.) applied to basic attacks via onApplyEnchantmentEffects callback
  5. Armor pierce: baseDamage * (1 - enemyArmor * (1 - armorPierce)) (was baseDamage * (1 + armorPierce))

Test results: 1041 tests passing (54 files), including 32 new regression tests.

**Fix committed and pushed.** Summary of changes: **Files modified:** - `src/lib/game/stores/golem-combat-actions.ts` (366 lines) — Core fixes - `src/lib/game/stores/golem-combat-helpers.ts` (134 lines, new) — Extracted helpers - `src/lib/game/stores/combat-actions.ts` (388 lines) — Updated call site - `src/lib/game/stores/golem-combat-actions.test.ts` (348 lines, new) — Integration tests - `src/lib/game/stores/golem-combat-helpers.test.ts` (143 lines, new) — Unit tests **5 fixes applied:** 1. **Spell damage**: `SPELLS_DEF[spellId].dmg * frame.magicAffinity` (was hardcoded `20 * magicAffinity`) 2. **Spell mana cost**: `SPELLS_DEF[spellId].cost.amount` (was hardcoded `10`) 3. **Elemental matchup**: `getElementalBonus(frame.element, enemyElement)` applied to basic attacks 4. **Enchantment effects**: Golem enchantments (burn, slow, shock, etc.) applied to basic attacks via `onApplyEnchantmentEffects` callback 5. **Armor pierce**: `baseDamage * (1 - enemyArmor * (1 - armorPierce))` (was `baseDamage * (1 + armorPierce)`) **Test results:** 1041 tests passing (54 files), including 32 new regression tests.
Anexim added ai:done and removed ai:review labels 2026-06-08 14:33:33 +02:00
Author
Owner

All fixes verified complete. 1041 tests passing. Closing as done.

All fixes verified complete. 1041 tests passing. Closing as done.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#313