damage formula

another newbie question for you guys =), i've wanted a hybrid skill, so it should deal both magic and physical damage so i thought of this formula


50 + a.mat * 2 + a.atk *2 - b.mdf * 2 - b.def * 2


does it work?
Yeah, it should work fine; when doing math you follow a rule of parenthesis, exponents, multiplication, division, addition, subtraction in order of operation; of course the exponents aren't something you would see in rpg maker.


So in your formula the multiplication occurs first, then the addition and lastly the subtraction. Plugging in some arbitrary numbers as an example:


a.mat=2, a.atk=5, b.df=4, b.mdf=3


50+2*2+5*2-3*2-4*2


50+4+10-6-8


64-6-8


50
i see thanks for the help =)

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula.69861/