To clarify a bit more, I'm using yanfly's auto passive states plugin and I want to add a custom requirement based on the player's current class. For example, I'm making a berserk state that triggers when you reach max tp but only when you are using the berserker class.
This is the code I'm modifying:
Edit- I think I found a workaround. I'll just turn this state into more of an ultimate trigger and use gilgamar's state common events to determine which ultimate to use based on the player's class. This can be closed.
Edit 2- I had a bit of a brain fart and forgot you can apply the passives to a class so I didn't even need a workaround.
Edit 3- I can't get gilgamar's plugin to work correctly so I guess I'm gonna be putting events in each troop to check for this now unless I can find an alternative.
This is the code I'm modifying:
<Custom Passive Condition>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Default the user's trance state to false.
user._trance = user._trance || false;
// Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.
condition = user._trance || user.tp === user.maxTp();
} else {
// Otherwise, the condition is false.
condition = false;
}
// If the condition passes...
if (condition) {
// And if the user isn't in the trance state...
if (!user._trance) {
// Then play an animation as the user enters trance.
user.startAnimation(120);
}
// Set the user's trance state to true.
user._trance = true;
}
</Custom Passive Condition>
<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 10;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
// ...then turn off trance.
user._trance = false;
}
<Custom Regenerate Effect>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Default the user's trance state to false.
user._trance = user._trance || false;
// Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.
condition = user._trance || user.tp === user.maxTp();
} else {
// Otherwise, the condition is false.
condition = false;
}
// If the condition passes...
if (condition) {
// And if the user isn't in the trance state...
if (!user._trance) {
// Then play an animation as the user enters trance.
user.startAnimation(120);
}
// Set the user's trance state to true.
user._trance = true;
}
</Custom Passive Condition>
<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 10;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
// ...then turn off trance.
user._trance = false;
}
<Custom Regenerate Effect>
Edit- I think I found a workaround. I'll just turn this state into more of an ultimate trigger and use gilgamar's state common events to determine which ultimate to use based on the player's class. This can be closed.
Edit 2- I had a bit of a brain fart and forgot you can apply the passives to a class so I didn't even need a workaround.
Edit 3- I can't get gilgamar's plugin to work correctly so I guess I'm gonna be putting events in each troop to check for this now unless I can find an alternative.
Last edited:


