I'm just wondering how or if it is even possible to write damage formulas like this:
if b has state(1) = damage formula 1.
if b has state(2) = damage formula 2.
if b has state(3) = damage formula 3.
and so on...
I'm basically looking for a universal way of making many of my skills change effects depending on which state has been applied to the enemy beforehand.
Thanks forumers!
Can you provide the damage formula for each state? There are other ways of writing it, and you may get away with something much shorter, depending on what you want the calculation to be.
Thanks for the replies everyone, I'll have to have a play around and see what works best.
I don't have the exact formulas that I'll be using yet but it will pretty much be a standard attack formula ( a.atk * 2 - b.def * 1 ) that simply adds a specific state depending on if another specific state is already on the target.
For example:
You use Skill A which causes the target to become Blinded, then you use Skill B on the following turn, which causes the target to become Shocked. When both of these states are on the target, they essentially add a third state, in this case Startled.
All of the skills that give the initial states will need these tailored damage formulas to determine which third state to add to the target when they are hit by the second state.
Edit3: I'm attempting to add damage into the equation without success, apparently you must add the damage afterwards? When using this formula the states work together fine but no damage is added...
(b.state?(41)) ? (b.add_state(40) + b.add_state(42) + a.atk * 2 - b.def * 1) : (b.add_state(40))
+ means addition, not "and do this as well"
What means "and do this as well"? 🙂
;
but I don't know if it can be used in that context - maybe if you keep the brackets, and you would also need a damage formula (even if it's 0) for the "else" part