How to fix "Decimals" in Health?

Mahoken

Veteran
I made this formula that deals damage, and then deals 1/3 of the damage back to the user. Unfortunately, the recoil damage is giving me a percent, so it's leaving my HP in a really long number string. How can I make it so this skill rounds up with whatever the recoil damage would be?

Here's the formula:

var d = ((a.level*20)+(1.2*a.atk))*(100/(100+b.def)); a.gainHp(-d / 3); d

Shaz

Global Moderators
var d = parseInt(((a.level*20)+(1.2*a.atk))*(100/(100+b.def))); a.gainHp(-d / 3); d

Assuming you're using MV (which is where you posted) rather than Ace (which is what your profile says).

Last edited by a moderator:

Mahoken

Veteran
Thank you very much!

Yeah, I did mean MV, I just haven't updated my profile to match that yet.

Latest Profile Posts

Well, someone "reviewed" my game. Didn't credit me anywhere in the video and spent 2 minutes insulting it. Going to ignore that and move on.
To cut down on map lag, I've been researching how to implement a lighting layer as a single map overlay instead of a bunch of individual lights. Hopefully I'll have a screenshot soon!
Imagine having a game broken up into a whole bunch of chapters? Like Chapter 11 should be about the party members going bankrupt.
Over 1/4th of the calendars are already out Have you already put something to a good use?