[High] [Bug] Golemancy spec vs code: slot cap 7 vs 9, AoE not implemented, armor pierce formula mismatch #326
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec:
docs/specs/attunements/fabricator/systems/golemancy-spec.mdDiscrepancies found:
D-SLOT-01 [HIGH] — Golem slot cap is 7 in code but spec allows up to 9
golemCapacity: +2+ up to+2from capped perk = max +4 discipline bonus. With attunement max of 5, spec implies maximum 9 golem slotsgolem-combat-actions.tscaps atMath.min(7, baseSlots + disciplineSlotsBonus)— maximum 7D-COMB-03 [HIGH] — AoE frames don't actually hit multiple targets
processGolemAttackstargets a single enemy viagetTargetEnemy()—aoeTargetsfield is computed in stats but never used in the combat loopaoeTargetsD-COMB-01 [HIGH] — Armor pierce formula differs between specs
dmg = golem.frame.baseDamage(no armor pierce in damage formula)dmg = frame.baseDamage × (1 + frame.armorPierce)(armor pierce increases damage)golem-combat-helpers.ts): Uses armor pierce to reduce enemy armor's damage reduction effect (third interpretation)D-CIRC-01 [MEDIUM] — Simple Logic Circuit summon cost is raw mana, not earth mana
mindCircuits.ts): UsesrawCost(3)(raw mana)elemCost('earth', 3)to match specD-ENCHANT-03 [MEDIUM] — Golem enchantments have no unlock requirement in data model
golemEnchantments.ts): NounlockRequirementfield on enchantment definitionsD-CORE-01/D-CORE-02 [LOW] — Guardian Core uses placeholder values
cores.ts): UseselemCost('earth', 50)andprimaryManaType: 'earth'as placeholdersStarting work on golecmancy spec vs code discrepancies. Analyzing all 6 issues: D-SLOT-01, D-COMB-03, D-COMB-01, D-CIRC-01, D-ENCHANT-03, D-CORE-01/02.
Progress update — All 6 discrepancies addressed:
D-SLOT-01 [HIGH] — No code change needed
Spec §2.2 says max 7 golem slots (5 attunement + 2 discipline). Code already caps at
Math.min(7, ...). The issue description misread the spec — both agree on max 7.D-COMB-03 [HIGH] — AoE damage distribution implemented ✅
Added
getTargetEnemiesparameter toprocessGolemAttacks. Frames withaoeTargets > 1(Sand, Shadowglass) now distribute damage evenly across up toaoeTargetsliving enemies. Updated store wrapper to provide enemy list.D-COMB-01 [HIGH] — Armor pierce formula reconciled ✅
Changed
computeBasicAttackDamagefrom "armor pierce reduces enemy armor effectiveness" to spire-combat spec §9.4 formula:dmg = baseDamage × (1 + armorPierce). Enemy armor reduction is handled separately inonDamageDealt.D-CIRC-01 [MEDIUM] — Simple Logic Circuit cost fixed ✅
Changed from
rawCost(3)toelemCost('earth', 3)to match spec §6.1 ("Cost is Earth Mana").D-ENCHANT-03 [MEDIUM] — Golem enchantment unlock requirements added ✅
Added
unlockRequirement: { type: 'dual_attunement', attunements: ['enchanter', 'fabricator'], levels: [5, 5] }to all 8 golem enchantment definitions, matching spec §7.D-CORE-01/02 [LOW] — Guardian Core runtime override mechanism ✅
Added
guardianSummonCostandguardianPrimaryManaTypeoptional fields toGolemDesignandSerializedDesigninterfaces.computeGolemStatsnow uses these overrides when core is 'guardian', allowing runtime guardian-specific mana types instead of placeholder earth mana.Tests: All 135 golem-related tests pass. Updated tests for new armor pierce formula and Simple Logic Circuit cost change.
All 6 discrepancies have been addressed and committed. See commit
b0e553c.Summary of changes:
All 1086 tests pass. Files refactored to stay under 400-line limit.