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,192
Reaction score
15,545
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 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 :eek: Have you already put something to a good use?

Forum statistics

Threads
117,261
Messages
1,105,921
Members
153,431
Latest member
shadowking1901
Top