I'm trying to create an effect similar to the Runic effect from Final Fantasy 6. The idea is to absorb and negate magical attacks, but instead of gaining magic, the Power Meter increases. The Power Meter is basically a modified use of Yanfly's Party Limit system.
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
http://yanfly.moe/2016/02/06/yep-67-party-limit-gauge/
<Magical Taunt>
<Custom React Effect>
if (this.isMagical() && this.isHpEffect() && value > 0) {
var ratio = value / target.mhp;
value = 0;
var power = Math.floor(100 * ratio);
power = Math.clamp(power, 10, 50);
$gameParty.gainPartyLimitGauge(power);
target.startAnimation(53);
target.removeState(19);
}
</Custom React Effect>
The React effect has an error somewhere in it, but I can't figure out where. My theory is that value can't be used to create the ratio variable, but I see no reason that I can't do that. The error I see in the console is that "undefined is not a function", but I don't know what's undefined. Am I missing something?
EDIT: After some experimenting, the primary issue is:
power = Math.clamp(power, 10, 50);
Once I removed that line, the error went away. Does anyone know the correct syntax for that part?
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
http://yanfly.moe/2016/02/06/yep-67-party-limit-gauge/
<Magical Taunt>
<Custom React Effect>
if (this.isMagical() && this.isHpEffect() && value > 0) {
var ratio = value / target.mhp;
value = 0;
var power = Math.floor(100 * ratio);
power = Math.clamp(power, 10, 50);
$gameParty.gainPartyLimitGauge(power);
target.startAnimation(53);
target.removeState(19);
}
</Custom React Effect>
The React effect has an error somewhere in it, but I can't figure out where. My theory is that value can't be used to create the ratio variable, but I see no reason that I can't do that. The error I see in the console is that "undefined is not a function", but I don't know what's undefined. Am I missing something?
EDIT: After some experimenting, the primary issue is:
power = Math.clamp(power, 10, 50);
Once I removed that line, the error went away. Does anyone know the correct syntax for that part?