[Bug] GuardianDef missing multiple properties — breaks GuardianPanel, pactSlice, computed, EquipmentTab #10
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:
GuardianDeftype is missing many properties that are accessed at runtimeImpact
TypeScript errors across multiple files referencing
GuardianDef:src/components/game/tabs/GuardianPanel.tsx— accessesguardian.power,guardian.armor,guardian.effectssrc/lib/game/store/pactSlice.ts— accessesguardian.signingCost,guardian.unlocksManasrc/lib/game/store/computed.ts— accessesguardian.damageMultiplier,guardian.insightMultipliersrc/lib/game/store-modules/computed-stats.ts— accessesGUARDIANS[floor]?.pactError Messages
Root Cause
The
GuardianDefinterface insrc/lib/game/types/attunements.tsonly defines:name,element,hp,pact,color,boons,pactCost,pactTime,uniquePerk,armor?But the codebase accesses additional properties:
power,effects,signingCost(object with.manaand.time),unlocksMana(string[]),damageMultiplier,insightMultiplier.These were likely part of a previous GuardianDef shape and were either renamed/removed from the type but left in the code, or never added to the type.
To Fix
Update
GuardianDefintypes/attunements.tsto include all properties actually used:power: numbereffects: { type: string; value: number }[]signingCost: { mana: number; time: number }unlocksMana: string[]damageMultiplier: numberinsightMultiplier: numberVerification
After fix,
npx tsc --noEmitshould show 0 GuardianDef-related errors.Starting fix: GuardianDef type missing properties (power, effects, signingCost, unlocksMana, damageMultiplier, insightMultiplier). Will read all affected files and update the type.
Fix in progress. Updated
GuardianDefinterface with missing properties:power: number— combat power for display (GuardianPanel.tsx)effects: { type: string; value: number }[]— passive combat effects (GuardianPanel.tsx)signingCost: { mana: number; time: number }— pact ritual cost (pactSlice.ts)unlocksMana: string[]— mana types unlocked on pact (pactSlice.ts)damageMultiplier: number— pact damage multiplier (computed.ts)insightMultiplier: number— pact insight multiplier (computed.ts)Updated all 9 guardian data entries in
constants/guardians.tswith the new properties. Running TypeScript type checker now.Fix committed:
6ad48efChanges made:
src/lib/game/types/attunements.ts— Added 6 missing properties toGuardianDefinterface:power,effects,signingCost,unlocksMana,damageMultiplier,insightMultipliersrc/lib/game/constants/guardians.ts— Populated all 9 guardian entries with the new propertiesVerification: