Okay, so here's what I'm trying to do. In my RPG, when someone (either an actor or an enemy) gets to max TP, they instantly (disregarding turn order) and automatically trigger a powerful special move. I want different characters and enemies to have different specials with different effects, but at its most basic, its a high damaging finisher. The move drains all of the character's TP and they enter a Weakened state, then the regular turn order resumes.
So I guess what I need is a script that activates a Forced Action when a battler has 100 TP, the parameters of which I can manipulate with Visustella's BattleCore.
////
Here's my attempt. I based it on the Trance state from the Tips & Tricks thread.
And it worked! ...almost sorta. But there were a few major issues with the code.
1) First of all, the animation activates like a 100 times, creating this supernova-like effect that looks cool, but is obviously busted.
2) I have trouble getting rid of the "Trance" state. Enemies will never lose their their Trance state and attack continuously. My character will use the attack properly once, but every subsequent Trance will just endlessly loop until all enemies are dead.
3) Even if it worked properly, this script only ever triggers one action: Action26. I want to be able to use different actions depending on who gets max TP.
This mechanic is at the core of my battle system, so if anyone can help me get this to working I'd appreciate it.
So I guess what I need is a script that activates a Forced Action when a battler has 100 TP, the parameters of which I can manipulate with Visustella's BattleCore.
////
Here's my attempt. I based it on the Trance state from the Tips & Tricks thread.
JavaScript:
JS Passive Condition>
if ($gameParty.inBattle()) {
user._trance ??= false;
condition = user._trance || user.tp === user.maxTp();
} else {
condition = false;
}
if (condition) {
if (!user._trance) {
$gameTemp.requestAnimation([user], 120);
user.forceAction(26, a.index);
BattleManager.forceAction(user);
this.setWaitMode('action');
user._trance = false;
}
}
</JS Passive Condition>
<JS Pre-Regenerate>
if (user.tp === 0) {
user._trance = false;
}
</JS Pre-Regenerate>
And it worked! ...almost sorta. But there were a few major issues with the code.
1) First of all, the animation activates like a 100 times, creating this supernova-like effect that looks cool, but is obviously busted.
2) I have trouble getting rid of the "Trance" state. Enemies will never lose their their Trance state and attack continuously. My character will use the attack properly once, but every subsequent Trance will just endlessly loop until all enemies are dead.
3) Even if it worked properly, this script only ever triggers one action: Action26. I want to be able to use different actions depending on who gets max TP.
This mechanic is at the core of my battle system, so if anyone can help me get this to working I'd appreciate it.