Hello !
I wish a skill that add +1 to a variable, but only if the damage is 1 or more.
Cause I dont want increase it, if the skill failed or is not strong enough.
a.mat * 5 - b.mdf * 3;b.damage? v[4] += 1 : v[4] += 0
That's just the image of what I mean, I know that's wrong.
Thanks in advance !
So fast Heirukichi, thank you !
It works, but I have questions.
1# What means the "r" and "a" from (a = r*b.element_rate(3); a>1 ?) ?
2# The "3" from "b.element_rate(3)" is fire? What if "Normal Attack" or "None" ?
3# Are you sure the "a>1" is correct ? May I do it that way : "a>=1" ?
Well, first of all I corrected my code above (it was working but since a is used to refer to the caster I changed it to x when it was not related to the caster).
1.
To answer your 1st question they mean nothing but since I had to write their value more than once and formulae have a limited ammount of characters is better to avoid using the full formula used to assign that value. Is shorter to write (r = a.atk*5 - b.def*2; r) instead of (a.atk*5 - b.def*2; a.atk*5 - b.def*2). This will decrease the need of a script for just one formula.
2.
About your second question: element 3 is any element you want since you can change your element names in the terms tab (F9). If your attack element is none then just skip that part and use r (or any variable you used to store the formula) when comparing it later.
3.
In the end what you use in that part is up to you. If you use x >= 1 (I am using x since I changed it above) it will work. In my example I used > 1 just to show you how to use it. You can set it to be > 1, or even use a different value (for example 300). This way you can increase your variable only if the damage is greater than a certain ammount you set.
Yes, but it is not necessarly fire since you can change its name as you please (just edit it in the box below). However you should use the one related to your skill element. For example, if your skill element is Light you should use b.element_rate(9).
Thank you very much for your help !