Custom Attack Damage

AcousticJamm

YouTuber
Veteran
Joined
Jun 1, 2019
Messages
176
Reaction score
10
First Language
English
Primarily Uses
RMMV
So here's what I want the formula based around:

Subtract target defense from two times enemy attack. If difference is less than 1, damage is 1, else the damage is the difference.

Example 1:

Player ATK: 10
Enemy DMG: 6

20 - 6 = 14

14 > 1

DMG is 14

Example 2:

Enemy ATK: 10
Player DEF: 30

20 - 30 = -10

-10 < 1

DMG = 1

Can someone help me with this?
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
386
Reaction score
204
First Language
English
Primarily Uses
RMMV
JavaScript:
Math.max(a.atk*2 - b.def, 1);
I'd advise giving this page a read if you're struggling with the damage formulas.

 

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

Latest Posts

Latest Profile Posts

so, ive been gone for too long when i log in and see that everything is where is shouldn't be. XD
Steam killing my eyes.. I forgot why I use it only when I have no other choice
Making a map, my brain went "Look, Mjölnir!" as I plotted out a sacrificial entrance.

Actually, it went, "Look, hammer. Wait, Thor's hammer!"
CG tile rendering, take 3: windows.
which section you guys think looks more accurate to the perspective? left or right?

for reference, this is what it looks like "at street level"
Okay, Animal Crossing is remarkably addictive and exceptionally calming. I've been playing it pretty exclusively... like... 6 hours a day. Been a while since I've been this engrossed.

Forum statistics

Threads
95,402
Messages
928,922
Members
125,622
Latest member
Komalis
Top