All items and skills in RPG Maker come with additional "effects".
Effects include gaining HP, learning a skill, gaining a buff in a parameter,
or running a common event.
However, what if you would like a skill to do something that isn't provided
by default?
You could use the damage formula, but what if you would like to create
conditions on those effects? You could include those conditions in the formula
as well, but the problem here is you may end up with a very complex damage
formula.
Instead of using the damage formula for everything, you can create custom
effects that support formulas. If you already knew how to write the formula,
then you can just move it from the damage formula into this formula effect.
Because a formula effect is just another effect, it supports other plugins
that work with effects, such as Conditional Effects, which allows you to
determine whether an effect should be executed based on a condition.
== Terms of Use ==
- Free for use in non-commercial projects with credits
- Contact me for commercial use
== Change Log ==
Feb 11, 2015 - initial release
== Usage ==
To create a formula effect, note-tag items or skills with
<formula effect>
FORMULA
</formula effect>
Where the FORMULA will be evaluated during skill execution and the behavior
is determined by what you write in the formula.
The following formula variables are available
a - attacker
b - target
i - current item or skill
v - game variables
s - game switches
t - game troop
p - game party
So for example, if you wanted to reduce the target's HP by 100, you could
use the formula
b.gainHp(-100);
You can access the result of the action on the target using
var r = b.result()
With this, you can then check how much HP damage or MP damage was dealt
r.hpDamage
r.mpDamage
And then use this in your effect calculations.
Anything that is defined in the code can be used as an effect.