🐛 FABRICATOR: Crafted equipment stats completely broken — 4 critical breaks #170
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?
Bug
Equipment stats from crafted gear from the fabricator don't work. Investigation reveals 4 critical breaks in the chain.
Break #1:
completeEquipmentCraftingis Dead CodeFile:
src/lib/game/crafting-equipment.ts:93-115The function that converts
EquipmentCraftingProgressinto anEquipmentInstanceis never called anywhere. Zero call sites across the entire repo.Break #2:
gearTraitis Display-Only Flavor TextFile:
src/lib/game/data/fabricator-recipe-types.ts:25,FabricatorSubTab.tsx:85All stat descriptions on fabricator recipes (e.g. "+25 Earth Mana Capacity", "+15% cast speed") are strings displayed as italic amber flavor text. They are never parsed, never converted into actual stats, never applied to the crafted
EquipmentInstance.Break #3:
baseDamage/baseCastSpeedon EquipmentType Are Dead DataFile:
src/lib/game/data/equipment/types.ts:29-30,swords.tsNo combat code reads
equipType.baseDamageorequipType.baseCastSpeed. Combat uses spell base damage + discipline bonuses + skill bonuses only.Break #4: Crafted Equipment Starts with Zero Enchantments
File:
src/lib/game/crafting-equipment.ts:105Even if
completeEquipmentCraftingwere called, the createdEquipmentInstancehasenchantments: []. SincecomputeEquipmentEffects()reads onlyinstance.enchantments[], crafted gear would still have zero effects.The Fix Needs
completeEquipmentCraftingto be called when crafting progress reaches 100%gearTraitstrings into actual enchantments, or add a proper stat system to fabricator recipesbaseDamage/baseCastSpeedfields OR wire them into combat calculationsenchantments[]on crafted instancesFiles
src/lib/game/crafting-equipment.ts:84-115(dead code)src/lib/game/data/fabricator-recipe-types.ts:25src/lib/game/data/equipment/types.ts:29-30src/lib/game/effects.ts:28-72(computeEquipmentEffects)src/lib/game/stores/craftingStore.ts:247-258src/components/game/tabs/CraftingTab/FabricatorSubTab.tsx:85✅ Fix Complete — All 4 Breaks Resolved
Break #1:
completeEquipmentCraftingwas dead code → FIXEDprocessEquipmentCraftingTickaction tocraftingStore.ts(extracted tocrafting-equipment-tick.tsto stay under 400-line limit)gameStore.tstick() — whencurrentAction === 'craft', the tick advancesequipmentCraftingProgressbyHOURS_PER_TICKper tickrequired, resolves the recipe (fabricator or blueprint), creates theEquipmentInstance, adds it toequipmentInstances, clears progress, returns tomeditateBreak #2:
gearTraitwas display-only flavor text → FIXEDbonusEnchantments?: AppliedEnchantment[]field toFabricatorRecipetypeearth_cap_10,mana_regen_1metal_cap_10,mana_cap_50,damage_5mana_cap_50,mana_regen_1/2,crystal_cap_10attack_speed_10,sand_cap_10earth_cap_10,mana_regen_1/2/5,mana_cap_50/100,metal_cap_10,light_cap_10,damage_10damage_5/10,attack_speed_10,mana_cap_50,dark_cap_10,earth_cap_10Break #3:
baseDamage/baseCastSpeedon EquipmentType were dead data → FIXEDbaseDamage?: numberandbaseCastSpeed?: numberfromEquipmentTypeinterface inequipment/types.tsswords.tsequipment definitionsbaseDamageBonus/baseDamageMultiplierfrom enchantments and discipline effects onlyBreak #4: Crafted equipment had
enchantments: []→ FIXEDcompleteEquipmentCraftingnow accepts optionalbonusEnchantments: AppliedEnchantment[]parameterbonusEnchantmentsusedCapacityis computed from enchantment costsFiles Changed (14 files, +230/-34)
src/lib/game/stores/craftingStore.ts— imported extracted tick, added actionsrc/lib/game/stores/crafting-equipment-tick.ts— NEW: extracted tick processing logicsrc/lib/game/stores/craftingStore.types.ts— addedprocessEquipmentCraftingTicktypesrc/lib/game/stores/gameStore.ts— wired crafting tick into main tick pipelinesrc/lib/game/crafting-equipment.ts—completeEquipmentCraftingaccepts bonus enchantmentssrc/lib/game/data/fabricator-recipe-types.ts— addedbonusEnchantmentsfieldsrc/lib/game/data/fabricator-recipes.ts— populated 11 core recipes with bonus enchantmentssrc/lib/game/data/fabricator-wizard-recipes.ts— populated 7 wizard recipessrc/lib/game/data/fabricator-physical-recipes.ts— populated 9 physical recipessrc/lib/game/data/equipment/types.ts— removed deadbaseDamage/baseCastSpeedsrc/lib/game/data/equipment/swords.ts— removed dead stats from 5 sword definitionsTest Results