Hi, I'm looking for a way to run some code as state ends before it actually does. <Custom Remove Effect> runs after the state has gone, so it doesn't quite work.
- YEP Buff Core
- YEP Absorption Barrier
- (YEP CTB Battler)
Here's more details:
I'm trying to recreate the Haima skill from FFXIV. You get a small barrier and everytime it breaks, a new one gets automatically generated. I made this bit work through different states (to use different icons for better readability).
Here's my state 164 :
Sadly that last part doesn't work. I've managed to sneak my way outside of this problem by having different barriers not stackable, the state removes every barrier point the battler may have on applying and removing. I'll keep it that way for other characters as the game has been balanced with that in mind, but I'd like this one character to be able to stack both of his small barriers...
I've tried using barrier turns, but they somehow end up not matching the state turn count...
I thought if I could just get that state counter as it runs out, I could make it work (putting a condition on the other skill in case both of them are active so damage don't get taken out of both counters).
Maybe the solution is somewhere else altogether and I need a new perspective, if any of you have any idea I'd be glad :'(
- YEP Buff Core
- YEP Absorption Barrier
- (YEP CTB Battler)
Here's more details:
I'm trying to recreate the Haima skill from FFXIV. You get a small barrier and everytime it breaks, a new one gets automatically generated. I made this bit work through different states (to use different icons for better readability).
Here's my state 164 :
JavaScript:
//Set the barrier and stores the barrier points in the state counter, to keep the player informed.
<Custom Apply Effect>
var barrier = $gameActors.actor(3).mat * 1
target.gainBarrier(barrier)
target.setStateCounter(164, barrier);
</Custom Apply Effect>
//Checks if the damage recieved is higher than the current barrier, if so the state is removed, if not updates the counter.
<Custom Respond Effect>
if (value > 0 && this.isHpEffect() && target.hp > 0) {
if (value >= target.getStateCounter(164)) {
target.removeState(164);
} else {
target.addStateCounter(164, value * -1);
}
}
</Custom Respond Effect>
//If the state is expired, battler will loose the same amount of barrier points that were stored in the counter. Applies the second barrier through state 165.
<Custom Remove Effect>
battler.gainBarrier(target.getStateCounter(164) * -1)
target.startAnimation(128, true, 1);
target.addState(165);
</Custom Remove Effect>
Sadly that last part doesn't work. I've managed to sneak my way outside of this problem by having different barriers not stackable, the state removes every barrier point the battler may have on applying and removing. I'll keep it that way for other characters as the game has been balanced with that in mind, but I'd like this one character to be able to stack both of his small barriers...
I've tried using barrier turns, but they somehow end up not matching the state turn count...
I thought if I could just get that state counter as it runs out, I could make it work (putting a condition on the other skill in case both of them are active so damage don't get taken out of both counters).
Maybe the solution is somewhere else altogether and I need a new perspective, if any of you have any idea I'd be glad :'(