Loading

BattleAICore_ITB_Compat

  1. /*:
  2.  * @plugindesc N1.00 (Requires YEP_BattleAICore & DreamX_ITB) Fixes compatibility.
  3.  * @author Think_Nathan
  4.  
  5.  * @help Fixes compatibility between DreamX_ITB and YEP_BattleAICore.
  6.  
  7.  * Reverts YEP_BattleAICore to its older behaviour.
  8.  * This will result in worse performance, but (hopefully) no change
  9.  * in functionality.
  10.  
  11.  * Intended for DreamX_ITB v1.19 and YEP_BattleAICore v1.10.
  12.  * Future updates may obsolete this plugin.
  13.  */
  14.  
  15. (function () {
  16.  
  17.   if (Yanfly.Param.CoreAIDynamic) {
  18.     // Fix: Revert to old style of getNextSubject if using ITB
  19.     var n_oldGetNextSubject = BattleManager.getNextSubject;
  20.     BattleManager.getNextSubject = function () {
  21.       if (BattleManager.isITB()) {
  22.         this.updateAIPatterns();
  23.         return Yanfly.CoreAI.BattleManager_getNextSubject.call(this);
  24.       } else {
  25.         n_oldGetNextSubject.call(this);
  26.       }
  27.     }
  28.   };
  29.  
  30. })();