[High] [Bug] Golemancy: Enchantment capacity formula produces near-zero values #310

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

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

Problem: src/lib/game/data/golems/utils.ts:107-108 computes enchantment capacity as frame.magicAffinity * core.tierMultiplier. The magicAffinity values are decimals (0.3, 0.5, 0.9), so capacity is fractional (0.3, 0.45, 1.5, 2.7, etc.). Since enchantments cost 8-14 capacity, the system is nearly unusable. The spec likely intends magicAffinity as a percentage (30, 50, etc.) or the formula should use Math.round(frame.magicAffinity * 100) * core.tierMultiplier.

File: src/lib/game/data/golems/utils.ts:107-108

**Spec:** docs/specs/attunements/fabricator/systems/golemancy-spec.md §7 **Severity:** High **Problem:** `src/lib/game/data/golems/utils.ts:107-108` computes enchantment capacity as `frame.magicAffinity * core.tierMultiplier`. The magicAffinity values are decimals (0.3, 0.5, 0.9), so capacity is fractional (0.3, 0.45, 1.5, 2.7, etc.). Since enchantments cost 8-14 capacity, the system is nearly unusable. The spec likely intends magicAffinity as a percentage (30, 50, etc.) or the formula should use `Math.round(frame.magicAffinity * 100) * core.tierMultiplier`. **File:** `src/lib/game/data/golems/utils.ts:107-108`
Anexim added the ai:todo label 2026-06-07 17:43:54 +02:00
n8n-gitea was assigned by Anexim 2026-06-07 17:43:54 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-08 10:19:44 +02:00
Author
Owner

Starting fix for enchantment capacity formula. Root cause: magicAffinity stored as decimal (0.3) but spec describes it as percentage (30%). Capacity = 0.3 × 1.0 = 0.3, far below enchantment costs of 8-14. Fix: multiply by 100 in formula.

Starting fix for enchantment capacity formula. Root cause: `magicAffinity` stored as decimal (0.3) but spec describes it as percentage (30%). Capacity = 0.3 × 1.0 = 0.3, far below enchantment costs of 8-14. Fix: multiply by 100 in formula.
Anexim added ai:done and removed ai:in-progress labels 2026-06-08 10:21:05 +02:00
Author
Owner

Fixed enchantment capacity formula in src/lib/game/data/golems/utils.ts:107-108. Changed from frame.magicAffinity * core.tierMultiplier to Math.round(frame.magicAffinity * 100) * core.tierMultiplier. Root cause: magicAffinity stored as decimal (0.3) but spec describes it as percentage (30%). Updated 3 test assertions in golemancy-data.test.ts to match new values (30, 100, 300). All 34 tests pass.

Fixed enchantment capacity formula in `src/lib/game/data/golems/utils.ts:107-108`. Changed from `frame.magicAffinity * core.tierMultiplier` to `Math.round(frame.magicAffinity * 100) * core.tierMultiplier`. Root cause: magicAffinity stored as decimal (0.3) but spec describes it as percentage (30%). Updated 3 test assertions in golemancy-data.test.ts to match new values (30, 100, 300). All 34 tests pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#310