createDamageText / createPlayerDamageText render -${Math.round(damage)}, but createExperienceText and createGoldText interpolate the raw number:
XP: `+${exp} XP`
gold: `+${gold} G`
A fractional grant (e.g. 10.6 XP or 3.25 gold from a scaled drop) therefore paints +10.6 XP / +3.25 G while damage for the same tick would show a whole number. The original game.js port this file claims to match rounded the combat number; XP/gold were left unrounded in the TypeScript port.
Fix: Math.round (or Math.floor if the economy is integer-only) on both XP and gold labels so HUD text cannot show fractions the rest of the combat UI never does.
Found by Wave 7 coverage tests (floating-text-system.leftovers.spec.ts).
`createDamageText` / `createPlayerDamageText` render `-${Math.round(damage)}`, but `createExperienceText` and `createGoldText` interpolate the raw number:
- XP: `` `+${exp} XP` ``
- gold: `` `+${gold} G` ``
A fractional grant (e.g. 10.6 XP or 3.25 gold from a scaled drop) therefore paints `+10.6 XP` / `+3.25 G` while damage for the same tick would show a whole number. The original `game.js` port this file claims to match rounded the combat number; XP/gold were left unrounded in the TypeScript port.
Fix: `Math.round` (or `Math.floor` if the economy is integer-only) on both XP and gold labels so HUD text cannot show fractions the rest of the combat UI never does.
Found by Wave 7 coverage tests (`floating-text-system.leftovers.spec.ts`).
Resolved in spikersoft-angular PR #819 (merged to master). Floating XP/gold text rounds amounts the same way damage does. Closing.
Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). Floating XP/gold text rounds amounts the same way damage does. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
createDamageText/createPlayerDamageTextrender-${Math.round(damage)}, butcreateExperienceTextandcreateGoldTextinterpolate the raw number:`+${exp} XP``+${gold} G`A fractional grant (e.g. 10.6 XP or 3.25 gold from a scaled drop) therefore paints
+10.6 XP/+3.25 Gwhile damage for the same tick would show a whole number. The originalgame.jsport this file claims to match rounded the combat number; XP/gold were left unrounded in the TypeScript port.Fix:
Math.round(orMath.floorif the economy is integer-only) on both XP and gold labels so HUD text cannot show fractions the rest of the combat UI never does.Found by Wave 7 coverage tests (
floating-text-system.leftovers.spec.ts).Resolved in spikersoft-angular PR #819 (merged to
master). Floating XP/gold text rounds amounts the same way damage does. Closing.