YEP Auto Passive States + "Trance" Effect

Discussion in 'Javascript/Plugin Support' started by Drunken Paladin, Feb 2, 2019.

  1. Drunken Paladin

    Drunken Paladin Veteran Veteran

    Likes Received:
    First Language:
    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!

    <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.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.
      // 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.
    // If the user's TP is 0...
    if ( === 0) {
      // ...then turn off trance.
      user._trance = false;
    </Custom Regenerate Effect>
    Sauteed_Onion likes this.

Share This Page