[priority: 5] Special effects (Executioner/Berserker) completely broken — hasSpecial({}) always false #68
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?
Severity: 5 — Critical
File:
src/lib/game/stores/gameStore.ts, lines ~222-228Description:
In the
tick()method's combatonDamageDealtcallback,hasSpecialis called with an empty object{}:The
hasSpecialfunction checkseffects?.specials?.has(specialId). Since{}has nospecialsproperty, this always returnsfalse. The Executioner (+100% damage to low-HP enemies) and Berserker (+50% damage when low mana) special effects are completely non-functional.Fix: Compute actual effects at the top of
tick()and pass them tohasSpecial:✅ Fixed. In
gameStore.tstick(), replacedhasSpecial({}, ...)with real effect computation:computeEquipmentEffectsfromeffectsandcomputeDisciplineEffectsfromeffects/discipline-effectsuseCraftingStoreanduseDisciplineStoreSet<string>and pass tohasSpecial(effects, ...)Executioner (+100% damage to low-HP enemies) and Berserker (+50% damage when low mana) now correctly trigger when the player has the corresponding enchantment or discipline perk.
Also fixed pre-existing typo:
attunement→attunementsin computeRegen call.TypeScript compiles clean for gameStore.ts. All 60 existing tests still pass.