RPG Maker Forums

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.

Code:
((a.atk * (a.mp/a.mmp)) * 4) - b.def * 2
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."

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top