- Joined
- Feb 2, 2014
- Messages
- 28
- Reaction score
- 4
- First Language
- English
- Primarily Uses
I checked out this thread earlier today: https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/
My game uses low damage numbers, and after a bit of testing, I found out that any decimal .5 or over rounds damage values up, while I want all non-whole numbers to round down. Damage values scale on a .2, .25, .33 and .5 basis (5 points for 1 extra damage, 4 points, 3, 2, etc). Armor works in a similar way- every 10 points of def is supposed to give one flat Armor that reduces all damage taken by 1. If you have 9 def, you're not supposed to get it- but having 5 - 10 def gives you the armor anyway since it rounds up.
As such, all my damage formulas look like some variation on this basic setup: (a.atk * 0.33) - (b.def / 10). My question: How can I integrate Math.floor into my damage formulas to ensure all non-whole numbers are rounded down? I tinkered with it and read above linked threat and couldn't find a clear way to integrate it.
My game uses low damage numbers, and after a bit of testing, I found out that any decimal .5 or over rounds damage values up, while I want all non-whole numbers to round down. Damage values scale on a .2, .25, .33 and .5 basis (5 points for 1 extra damage, 4 points, 3, 2, etc). Armor works in a similar way- every 10 points of def is supposed to give one flat Armor that reduces all damage taken by 1. If you have 9 def, you're not supposed to get it- but having 5 - 10 def gives you the armor anyway since it rounds up.
As such, all my damage formulas look like some variation on this basic setup: (a.atk * 0.33) - (b.def / 10). My question: How can I integrate Math.floor into my damage formulas to ensure all non-whole numbers are rounded down? I tinkered with it and read above linked threat and couldn't find a clear way to integrate it.

