Round all damage to the 10s digit

alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
277
Reaction score
164
First Language
English
Primarily Uses
RMMV
Is it possible to round all damage done to the 10s digit, as in 374 damage does 370 damage instead? I don't want anything to deal less than 10 damage either. I have access to all of Yanfly's plugins if that helps.
 

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
236
Reaction score
48
First Language
English
Primarily Uses
RMMV
I'd imagine something with math.round, although I don't know if you can set what it rounds to, you'd probably have to look into that to see how JS works.
I hope you find what you looking for.
 

alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
277
Reaction score
164
First Language
English
Primarily Uses
RMMV
Yeah I know it has something to do with Math.round() and I know it's possible. I just need the exact code for it.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,938
Reaction score
1,387
First Language
EN
Primarily Uses
RMMZ
You could add a step in Yanfly's Damage Core plugin:
Code:
value = 10 * Math.round(value / 10);

Edit: or, without plugins, edit all your skill formulae, e.g.
Code:
10 * Math.round((a.atk * 4 - b.def * 2) / 10)
 

alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
277
Reaction score
164
First Language
English
Primarily Uses
RMMV
Which damage step should I put it in?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Yesterday I made my first step towards eating more healthily.
I saw candy on discount and did not buy it.
"They yearn for what they fear for."
I always told my DA fans how much I hate slot machines. They're fine in games as a risk-and-reward system. But when you're spending REAL MONEY in a Vegas casino to try and hit the jackpot (which very, very few people will), it can really hurt your budget. Gambling is a bad habit, and I don't like wasting my money on a slim chance. Go to Vegas for the experience, not the jackpot.
Took the kids to a corn maze. They gave us a map and had lights at certain points in the maze. Not overwhelming... or underwhelming... just... whelming.

Forum statistics

Threads
104,400
Messages
1,006,111
Members
135,929
Latest member
uuu
Top