[medium] Discipline stat bonuses use raw stat keys instead of player-friendly text #135
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?
UI Issue: Discipline cards show raw stat keys like "elementCap_fire" instead of readable text
Description
The
DisciplineCardcomponent rendersdisc.statBonusdirectly, which contains raw internal stat keys likeelementCap_fire,maxManaBonus,enchantPower, etc. These are not player-friendly.Current State
In
DisciplinesTab.tsx:Where
statBonusisdisc.statBonus.stat— the raw key from the discipline definition.Example outputs players see:
elementCap_fire(should be "Fire Mana Capacity")maxManaBonus(should be "Max Mana")enchantPower(should be "Enchantment Power")clickManaMultiplier(should be "Click Mana Multiplier")baseDamageBonus(should be "Base Damage")golemCapacity(should be "Golem Capacity")craftingCostReduction(should be "Crafting Cost Reduction")Expected Behavior
All stat bonus descriptions should use human-readable, properly formatted text. Either:
statBonus.nameorstatBonus.labelfield toDisciplineDefinitionwith display textdisplayNamefield to thestatBonusobject in the type definitionFiles Involved
src/lib/game/types/disciplines.ts—statBonus: { stat: string; baseValue: number }needs a display name fieldsrc/lib/game/data/disciplines/*.ts— all discipline definitions need display namessrc/components/game/tabs/DisciplinesTab.tsx—DisciplineCardDefinition.statBonusshould be the display name, not the keysrc/lib/game/effects/discipline-effects.ts— usesdef.statBonus.statinternally (should keep using the key for computation, display separately)Suggested Fix (Option A — add label to type)
Then in each discipline:
Suggested Fix (Option B — mapping object)
Create a
STAT_DISPLAY_NAMESmapping in a utility file and use it in the UI component. This avoids changing the type definition but requires maintaining a separate mapping.Fix applied for Issue #135: Discipline stat bonuses now show player-friendly labels
Changes Made
Type definition (
src/lib/game/types/disciplines.ts):label: stringtostatBonusinDisciplineDefinitionAll discipline data files — added
labelfield to everystatBonusobject:base.ts— "Max Mana", "Fire Mana Capacity"elemental-regen.ts— dynamic${name} Regen/tick(Fire/Water/Air/Earth/Light/Dark/Death), "Transference Regen/tick"elemental-regen-advanced.ts— "Metal/Sand/Lightning/Crystal/Stellar/Void Regen/tick"enchanter.ts— "Enchantment Power" (×3), "Click Mana Multiplier"enchanter-special.ts— "Enchantment Power"enchanter-spells.ts— "Enchantment Power" (×3)enchanter-utility.ts— "Study Speed", "Max Mana"fabricator.ts— "Golem Capacity", "Crafting Cost Reduction"invoker.ts— "Base Damage", "Base Damage Multiplier"UI component (
DisciplinesTab.tsx):statBonusLabel: stringtoDisciplineCardDefinitioninterfaceDisciplineCardto destructure and displaystatBonusLabelinstead of rawstatBonuskeydisc.statBonus.labelVerification: TypeScript compiles cleanly, all 42 discipline-math tests pass.
Fixed — all discipline stat bonuses now display player-friendly labels instead of raw stat keys.