Round all damage to the 10s digit

alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
276
Reaction score
163
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
234
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
276
Reaction score
163
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,920
Reaction score
1,365
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
276
Reaction score
163
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 Profile Posts


Only 99 more battlers to go :dizzy:
Stream will be live shortly with some game development! Feel free to drop by!
it took soooo long to get character assist to work right in my game. like certain fighting games, a team mate can hop in, do an attack, then leave. it works since these are all one on one fights (usually)
Honestly. Didn't sleep for a day. ONCE

Forum statistics

Threads
104,260
Messages
1,005,033
Members
135,771
Latest member
Yeah_That_1
Top