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
239
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,959
Reaction score
1,406
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

Little early but to all of you that celebrate it :

Tomorrow is Halloween! I can't wait to go to Boxi Park and show off my costume! Also one of Dad's friends is staying the night, so he might get to see the show.
Here's the title-screen for the game I'm working on: :LZSgrin:
Oh man I've been struggling with event spawners and Qmovement compatibility for quite a while- went as far as to use a tool just to pick crops :kaocry: but Ritter got their spawner to work with Qmove and I'm screeing! It's still in testing period but just- the feeling of getting over a large gameplay hurdle is a HUGE relief, I'm so thankful to Ritter! It's a cheap paid plugin but totally worth it!
Welp, I just finished my favorite part of RPG making which is creating skills, now onto the tasks I like less so the motivation is lower. At least I'll get to create new ones while designing enemies!

Forum statistics

Threads
104,660
Messages
1,007,916
Members
136,148
Latest member
valval
Top