Round all damage to the 10s digit

alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
277
Reaction score
165
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
237
Reaction score
49
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
165
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,948
Reaction score
1,397
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
165
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

been a while since i posted here my coding class got ****ed because of covid and i did not learn much java script and the little stuff that i did learn i forgot by now
Yosh! :LZScheeze: Made a video with some cool tips and tricks for MV & MZ.
As you watch, I'm curious to know how many tips you already knew. :LZSyum:


Lol. Just got an Apple support scam... is that a thing now? Well, I trolled them good. I played "H.O.L.I.D.A.Y." by The Wiggles and then told them that the supposed victim wasn't at the call center anymore. He was confused so I let it slip that I knew the scam. He hung up on me.
Tired of scammers? Just troll them. They'll run for the hills.
I'm going to schedule my shuttle to the train station today... after I vote. It's not a pleasant thing to do, since I hate politics. So much negative talk. I can see why it's not allowed here. But about the shuttle. My county has a service called PalmTran, and it's really convenient. They pick you up at your home and drop you off where you need to be. Just give them a date and time.

Forum statistics

Threads
104,517
Messages
1,006,877
Members
136,013
Latest member
richracer2
Top