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
232
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,913
Reaction score
1,361
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 Posts

Latest Profile Posts

Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
Made a HUGE (YYOOOOJJ) Update to Monstructs and moving towards a Steam Early Access release!
A skill type called: "Rumagic". The intention is Magic with Rum(that pirates drink)
Does it sound strange in English?
So I'm having issues with my steam account... so I can't use MZ right now, so I can't work on my game until its solved, so it be harder to be ready for 31... guess I'll get ice cream :kaopride:
Motivation! Inspiration! There you are. I was worried you guys weren't going to show up today. Let's get this thing going!

Forum statistics

Threads
104,217
Messages
1,004,757
Members
135,725
Latest member
Sark1017
Top