I'm completely unfamiliar with javascript, so I've been playing by ear, altering some examples by yanfly.
I'm trying to get a skill to do more damage when the target has higher stacks of a state.
I'm unsure if the solution would be to change the state's script or to change the skill's script so I'm adding both here:
State
<Custom Apply Effect>
target._explosiveStacks = target._explosiveStacks || 0;
target._explosiveStacks += 1;
var stacks = target._explosiveStacks.clamp(0, 2);
target.setStateCounter(102, 'x' + stacks);
</Custom Apply Effect>
<Custom Remove Effect>
target._explosiveStacks = 0;
var stacks = target._explosiveStacks.clamp(0, 2);
target.setStateCounter(102, 'x' + stacks);
</Custom Remove Effect>
Skill
<Custom Execution>
if target.isStateAffected(102) {
var rate = 1.00 + stacks * 0.50;
value = Math.ceil(value * rate);
}
</Custom Execution>
I'm trying to get a skill to do more damage when the target has higher stacks of a state.
I'm unsure if the solution would be to change the state's script or to change the skill's script so I'm adding both here:
State
<Custom Apply Effect>
target._explosiveStacks = target._explosiveStacks || 0;
target._explosiveStacks += 1;
var stacks = target._explosiveStacks.clamp(0, 2);
target.setStateCounter(102, 'x' + stacks);
</Custom Apply Effect>
<Custom Remove Effect>
target._explosiveStacks = 0;
var stacks = target._explosiveStacks.clamp(0, 2);
target.setStateCounter(102, 'x' + stacks);
</Custom Remove Effect>
Skill
<Custom Execution>
if target.isStateAffected(102) {
var rate = 1.00 + stacks * 0.50;
value = Math.ceil(value * rate);
}
</Custom Execution>