YEP Auto Passive States + "Trance" Effect

Drunken Paladin

Veteran
Veteran
Joined
Jul 20, 2012
Messages
84
Reaction score
55
First Language
English
Primarily Uses
Hello, I'm using Yanfly's Auto Passive State to create the FFIX-style trance effect to the game from this video.

The code below is what it recommends adding to the State note box, but it doesn't work quite as advertised in the video, so I'm looking for a bit of help fine-tuning it. For starters, even though it has a condition to check if you're in combat, it doesn't actually remove the state when combat ends, so it can carry over from encounter to encounter. There is no way to remove the state manually through traditional means, either.

In addition, it also overrides the settings in Yanfly's "Enhanced TP" plugin which is supposed to reset the party's TP to 0 after every encounter.

Any tips you have to correct or modify the javascript below would be appreciated!


Code:
<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(338);
  }
  // Set the user's trance state to true.
  user._trance = true;
$gameSwitches.setValue(686, true)
}
</Custom Passive Condition>

<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 25;
// 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>
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top