[RMVX ACE] SIMPLE BATTLE FORMULA

Posts

Pages: 1
Hello everyone, I just needed to ask a real quick question about the battle formulas in Ace. I have searched and searched for an answer to my issue but I can seem to find anything so here I go. I intend for my game to use a very simple damage formula but no matter how hard I try it does not always work. What I have currently is (a.atk - b.def) + (a.mat - b.mdf) but the issue is that one type of defense is blocking damage from the other form of attack. For instance if Mat is super low but the target has super high MDF that part of the formula returns a negative number so no matter that the attack has tons of ATK and the target has basically no DEF the attack still does no damage. I want a way to make it that each half will not return less than zero so that extra Def or Mdf does not roll over so to speak and block damage from the other damage type sorry for the lengthy post any and all help is greatly appreciated.
a.atk < b.def ? r = 0 : r = a.atk - b.def; a.mat < b.mdf ? s = 0 : s = a.mat - b.mdf; r+s

This should work
Thank you so much I am not at my computer right now but I will test it as soon as I can. Just out of curiousity say I wanted to make a special that used double their atk would it be a.atk < b.def ? R=0 : 2 * a.atk-b.def;a.mat < b.mdf ? S=0 : s=a.mat - b.mdf; r+s

I think that is right but I just want to make sure thanks for any help in advance
Alternatively:
[a.atk - b.def, 0].max + [a.mat - b.mdf, 0].max


Will do it without getting into trinary operations
Oh thank you so much GRS thats a lot simpler to understand and it looks really easy edit if i need to add multipliers or additions to any of the particular stats. Thanks again this will help me out a lot.
The above is better if you need to check for more complex things - the syntax is as this:

[is x true?] ? [x is true] : [x is false]
Okay thanks now that you show me the syntax it makes a lot more sense thanks to both of you. This will be a big help

Pages: 1