[Low] [Bug] Enchanting: Prep time mana-per-tick calculation doesn't apply floor(capacity/50) #305
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/enchanter/systems/enchanting-spec.md §4.2
Severity: Wrong formula
Problem:
src/lib/game/stores/pipelines/enchanting-tick.ts:99computes mana per tick as:The denominator
2 + instance.totalCapacity / 50does NOT applyMath.floortoinstance.totalCapacity / 50. For capacity 65, this gives2 + 1.3 = 3.3instead of the spec's2 + floor(65/50) = 3.File:
src/lib/game/stores/pipelines/enchanting-tick.ts:99Starting work on prep time mana-per-tick floor calculation fix.
Fix applied and pushed. Added
Math.floor()to capacity/50 in prep time mana-per-tick calculation.Root cause: Code used
2 + instance.totalCapacity / 50but spec says2 + floor(capacity/50).Fix: Changed to
2 + Math.floor(instance.totalCapacity / 50)per spec §4.2.Tests: 1069 passed (58 files).