- Joined
- Dec 22, 2015
- Messages
- 49
- Reaction score
- 3
- First Language
- English
- Primarily Uses
- RMVXA
So I've got a character's skill that uses MP and deals more damage the more MP the character has. I thought this would be simple, but the damage formula doesn't seem to work. I hope someone can tell me what I'm doing wrong.
So if a character has 50 ATK and 50/50 MP, the formula, as *my* brain is reckoning it, should be like:
((50 * (50/50)) * 4)
or (50 * 1) * 4
So 50 * 4
If the character has 45 MP left, the formula should work like
((50 * (45/50)) * 4)
(50 * 0.9) * 4
So 45 * 4
If the character has 12 MP left, the formula should work like
((50 * (12/50)) * 4)
(50 * 0.24) * 4
So 12 * 4
But what's happening in battle is that this attack isn't doing any damage *at all.*
I'm really worried the answer is going to be something like "Ruby can't handle fractions and decimals."
Code:
((a.atk * (a.mp/a.mmp)) * 4) - b.def * 2
((50 * (50/50)) * 4)
or (50 * 1) * 4
So 50 * 4
If the character has 45 MP left, the formula should work like
((50 * (45/50)) * 4)
(50 * 0.9) * 4
So 45 * 4
If the character has 12 MP left, the formula should work like
((50 * (12/50)) * 4)
(50 * 0.24) * 4
So 12 * 4
But what's happening in battle is that this attack isn't doing any damage *at all.*
I'm really worried the answer is going to be something like "Ruby can't handle fractions and decimals."
