Loading

ITB Confusion Fixes

  1. /*:
  2.  * @plugindesc N1.00 (Requires DreamX_ITB) Fixes auto-battle and confusion states.
  3.  * @author ThinkNathan
  4.  
  5.  * @help Fixes auto-battle and confusion states under ITB.
  6.  
  7.  * Intended for DreamX_ITB v1.19. Future updates may obsolete this plugin.
  8.  */
  9.  
  10. (function () {
  11.  
  12.   // Fix: Actors now take turns when in autobattle
  13.   var n_oldMakeAutoBattleActions = Game_Actor.prototype.makeAutoBattleActions;
  14.   Game_Actor.prototype.makeAutoBattleActions = function () {
  15.     n_oldMakeAutoBattleActions.call(this);
  16.     if (BattleManager.isITB()) {
  17.       BattleManager.startITBAction(this);
  18.     }
  19.   };
  20.  
  21.   // Fix: Actors now take turns when confused (attack an enemy / attack anyone / attack an ally)
  22.   var n_oldMakeConfusionActions = Game_Actor.prototype.makeConfusionActions;
  23.   Game_Actor.prototype.makeConfusionActions = function () {
  24.     n_oldMakeConfusionActions.call(this);
  25.     if (BattleManager.isITB()) {
  26.       BattleManager.startITBAction(this);
  27.     }
  28.   };
  29.  
  30.   // Fix: Enemies are restricted to regular attacks when confused (attack an enemy / attack anyone / attack an ally)
  31.   var n_oldMakeActions = Game_Enemy.prototype.makeActions;
  32.   Game_Enemy.prototype.makeActions = function () {
  33.     n_oldMakeActions.call(this);
  34.     if (BattleManager.isITB()) {
  35.       // Copied from Game_Actor.prototype.makeConfusionActions
  36.       if (this.isConfused()) {
  37.         for (var i = 0; i < this.numActions(); i++) {
  38.           this.action(i).setConfusion();
  39.         }
  40.       }
  41.     }
  42.   };
  43.  
  44. })();