Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
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
Global Mod
Joined
Mar 2, 2012
Messages
44,089
Reaction score
15,503
First Language
English
Primarily Uses
RMMV
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
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
Thank you very much!


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

Latest Threads

Latest Posts

Latest Profile Posts

I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.

Forum statistics

Threads
117,007
Messages
1,103,781
Members
152,904
Latest member
gumi16
Top