Advertisement
Guest User

MOG_BattleTransitions.js

a guest
Feb 8th, 2019
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // MOG_BattleTransitions.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc (v1.5 *) Novas transições de batalha.
  7.  * @author Moghunter
  8.  *
  9.  * @param Default Transition
  10.  * @desc Definição da transição padrão.
  11.  * (-1 = Default) (0..3 New Trasitions) (4 = Random)
  12.  * @default 4
  13.  * @type select
  14.  * @option Default
  15.  * @value -1
  16.  * @option Shatter 1
  17.  * @value 0
  18.  * @option Shatter 2
  19.  * @value 1
  20.  * @option Blur
  21.  * @value 2
  22.  * @option Noise
  23.  * @value 3
  24.  * @option Random
  25.  * @value 4
  26.  *
  27.  * @help  
  28.  * =============================================================================
  29.  * +++ MOG - Battle Transitions(v1.5) +++
  30.  * By Moghunter
  31.  * https://atelierrgss.wordpress.com/
  32.  * =============================================================================
  33.  * Adiciona novas transições de batalha.
  34.  *
  35.  * =============================================================================
  36.  * - PLUGIN COMMAND
  37.  * =============================================================================
  38.  * Use o comando abaixo para definir uma transição.
  39.  *
  40.  * transition_effect : X
  41.  *
  42.  * X - Tipo de transição.
  43.  *
  44.  * -1 = Default.
  45.  *  0 = Shatter 1.
  46.  *  1 = Shatter 2.
  47.  *  2 = Blur.
  48.  *  3 = Noise.
  49.  *  4 = Random.
  50.  *
  51.  * EG
  52.  *
  53.  * transition_effect : 3
  54.  *
  55.  * ============================================================================
  56.  * - WHAT'S  NEW (version 1.5)
  57.  * ============================================================================
  58.  * - (NEW) - Plugins parameters compatíveis com RM1.5+
  59.  * - (BUG FIX) - Correção de ativar o comando inicial com o plugin
  60.  *               MOG_EmergeMotion.
  61.  *  
  62.  */
  63.  
  64. //=============================================================================
  65. // ** PLUGIN PARAMETERS
  66. //=============================================================================
  67.   var Imported = Imported || {};
  68.   Imported.MOG_BattleTransitions = true;
  69.   var Moghunter = Moghunter || {};
  70.  
  71.     Moghunter.parameters = PluginManager.parameters('MOG_BattleTransitions');
  72.     Moghunter.btrEffectsDefault = Number(Moghunter.parameters['Default Transition'] || 4);
  73.  
  74. //=============================================================================
  75. // ** Game_Interpreter
  76. //=============================================================================
  77.  
  78. //==============================
  79. // * PluginCommand
  80. //==============================
  81. var _mog_trefct_pluginCommand = Game_Interpreter.prototype.pluginCommand
  82. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  83.     _mog_trefct_pluginCommand.call(this,command, args)
  84.     if (command == "transition_effect")  {
  85.         var type = Math.min(Math.max(args[1], -1),4);
  86.         $gameSystem._treType[1] = type;
  87.     };
  88.     return true;
  89. };
  90.  
  91. //=============================================================================
  92. // ** Game System
  93. //=============================================================================
  94.  
  95. //==============================
  96. // * Initialize
  97. //==============================
  98. var _mog_trefct_initialize = Game_System.prototype.initialize;
  99. Game_System.prototype.initialize = function() {
  100.     _mog_trefct_initialize.call(this);
  101.     this._treSpriteData = null;
  102.     this._treType = [0,Moghunter.btrEffectsDefault];   
  103.     this.trefctClear();
  104.     this._treCP = false;
  105. };
  106.  
  107. //==============================
  108. // * trefctClear
  109. //==============================
  110. Game_System.prototype.trefctClear = function() {
  111.     this._trefctData = [false,0,0,0];
  112. };
  113.  
  114. //==============================
  115. // * set Transition R
  116. //==============================
  117. Game_System.prototype.setTransitionR = function() {
  118.     if (this._treType[1] >= 4) {  
  119.        this._treType[0] = Math.randomInt(4);
  120.     } else {
  121.        this._treType[0] = this._treType[1];
  122.     };
  123.     return this._treType[0];
  124. };
  125.  
  126. //=============================================================================
  127. // ** SceneManager
  128. //=============================================================================
  129.  
  130. //==============================
  131. // * Need Transition
  132. //==============================
  133. SceneManager.needTrasition = function() {
  134.    if (BattleManager.isBattleTest()) {return false};
  135.    if (!$gameSystem) {return false};
  136.    if (!$gameSystem._trefctData[0]) {return false};  
  137.    if ($gameSystem._treCP) {return false};
  138.    return true;
  139. };
  140.  
  141. //==============================
  142. // * setTR Bitmap
  143. //==============================
  144. SceneManager.setTRBitmap = function(bitmap) {
  145.      this._trbitmap = bitmap;
  146. };
  147.  
  148. //==============================
  149. // * setTR Bitmap
  150. //==============================
  151. SceneManager.TRBitmap = function() {
  152.      return this._trbitmap;
  153. };
  154.  
  155. //=============================================================================
  156. // ** Scene Base
  157. //=============================================================================
  158.  
  159. //==============================
  160. // * TRS Data
  161. //==============================
  162. Scene_Base.prototype.trsData = function() {
  163.      return $gameSystem._trefctData;
  164. };
  165.  
  166. //==============================
  167. // * TRS Data
  168. //==============================
  169. Scene_Base.prototype.trsType = function() {
  170.      return Number(this.trsData()[1]);
  171. };
  172.  
  173. //==============================
  174. // * TRS Data
  175. //==============================
  176. Scene_Base.prototype.trsPhase = function() {
  177.      return Number(this.trsData()[3]);
  178. };
  179.  
  180. //==============================
  181. // * Tr Filter
  182. //==============================
  183. Scene_Base.prototype.trfilter = function() {   
  184.     return this._spriteTrasition[0].filters[0];
  185. };
  186.  
  187. //==============================
  188. // * clearTREffects
  189. //==============================
  190. Scene_Base.prototype.clearTREffects = function() {
  191.     if (this.trsPhase() === 1) {this.removeTRSprites()};
  192.     this._TRblackScreenD = 2;
  193.     this._encounterEffectDuration = 0;
  194.     $gameSystem.trefctClear();
  195. };
  196.  
  197. //==============================
  198. // * removeTRSprites
  199. //==============================
  200. Scene_Base.prototype.removeTRSprites = function() {
  201.     if ($gameSystem._trefctData[3] === 1) {$gameSystem._treCP = true};
  202.     $gameSystem._trefctData[3] = 0;
  203.     for (var i = 0; i < this._spriteTrasition.length; i++) {
  204.        this.removeChild(this._spriteTrasition[i]);
  205.        this._spriteTrasition[i] = null;
  206.     }; 
  207.     this._spriteTrasition = null;
  208.     this._bitmapTransition = null;
  209.     if (this._spriteset && this._preTRFilters) {
  210.         this._spriteset.filters = this._preTRFilters;
  211.     };
  212.     if (this._dummyTR) {
  213.         this.removeChild(this._dummyTR);
  214.         this._dummyTR = null;
  215.     };
  216.     if (this._dummyTR2) {
  217.         this.removeChild(this._dummyTR2);
  218.         this._dummyTR2 = null;
  219.     }; 
  220.     for (var i = 0; i < $gameSystem._treSpriteData.length; i++) {
  221.         $gameSystem._treSpriteData[i] = null;
  222.     }; 
  223.     $gameSystem._treSpriteData = null;
  224.     if (Imported.MOG_BattleCry) {
  225.        var actor = BattleManager.randomActor();
  226.        if (actor) {SoundManager.selectVoice(actor._v_start)};
  227.     };
  228.     if (Imported.MOG_EmergeMotion) {$gameTemp._emergingInt = 30};
  229. };
  230.  
  231. //==============================
  232. // * create TR Bitmap
  233. //==============================
  234. Scene_Base.prototype.createTRBitmap = function() { 
  235.    this._fadeDuration = 0;
  236.    if (this._fadeSprite) {this._fadeSprite.opacity = 0};
  237.    if (this.trsPhase() === 0) {      
  238.        if (!$dataMap.specifyBattleback) {
  239.            this._spriteset.hideCharacters();
  240.        };
  241.        this.snapForBattleBackground();
  242.        SceneManager.setTRBitmap(SceneManager.snap());
  243.    };
  244.    if (SceneManager.TRBitmap()) {
  245.        this._bitmapTransition = SceneManager.TRBitmap();
  246.    } else {
  247.        this._bitmapTransition = SceneManager.snap();
  248.    };
  249.    this.createTRDummyBitmap();
  250. };
  251.    
  252. //==============================
  253. // * create TR Dummy Bitmap
  254. //==============================
  255. Scene_Base.prototype.createTRDummyBitmap = function() {
  256.    this._dummyTR = new Sprite(new Bitmap(Graphics.boxWidth,Graphics.boxHeight));
  257.    this._dummyTR.bitmap.fillAll('black');
  258.    this.addChild(this._dummyTR);
  259. };
  260.  
  261. //==============================
  262. // * create TR Black Screen
  263. //==============================
  264. Scene_Base.prototype.createTRBlackScreen = function() {
  265.    this._dummyTR2 = new Sprite(new Bitmap(Graphics.boxWidth,Graphics.boxHeight));
  266.    this._dummyTR2.bitmap.fillAll('black');
  267.    this.addChild(this._dummyTR2);
  268.    this._dummyTR2.opacity = this.trsPhase() === 0 ? 0 : 255;
  269.    this._TRblackScreenD = 2;
  270. };
  271.  
  272. //==============================
  273. // * Setup Transition
  274. //==============================
  275. Scene_Base.prototype.setupTrasition = function() {
  276.     this.getDataTransition();
  277.     if ($gameSystem._treSpriteData) {this.loadTRPreData();return};
  278.     if (this.trsType() === 0 || this.trsType() === 1) {
  279.         this.setupTRShatter();
  280.     } else if (this.trsType() === 2) {
  281.         this.setupTRBlur();
  282.     } else if (this.trsType() === 3) {
  283.         this.setupTRNoise();
  284.     } else if (this.trsType() === 4) {
  285.         this.setupTRDoubleSlide();     
  286.     };
  287.     if (this.needTRcreateBlackScreen()) {
  288.         this.createTRBlackScreen();
  289.         this._TRblackScreenD = 75;
  290.     }; 
  291. };
  292.  
  293. //==============================
  294. // * need TR Create Bk Screen
  295. //==============================
  296. Scene_Base.prototype.needTRcreateBlackScreen = function() {
  297.     if (this.trsType() === 2) {return true};
  298.     return false;
  299. };
  300.  
  301. //==============================
  302. // * need TR Load Filter
  303. //==============================
  304. Scene_Base.prototype.needTRLoadFilter = function() {
  305.     if (!this._spriteset) {return false};
  306.     if (this.trsType() === 2) {return true};
  307.     if (this.trsType() === 3) {return true};
  308.     if (this.trsType() === 4) {return true};
  309.     return false;
  310. };
  311.  
  312. //==============================
  313. // * get Data Transition
  314. //==============================
  315. Scene_Base.prototype.getDataTransition = function() {
  316.     this._trData = [0,0,0,0,0,0];
  317.     this._trData[0] = this._bitmapTransition.width;
  318.     this._trData[1] = this._bitmapTransition.height;
  319.     this._trData[2] = this._bitmapTransition.width / 2;
  320.     this._trData[3] = this._bitmapTransition.height / 2;
  321.     this._trData[4] = this.trsPhase() === 0 ? 10 : 0;
  322.     this._trData[5] = 0;
  323.     this._spriteTrasition = [];
  324. }; 
  325.  
  326. //==============================
  327. // * Execute Transition Effect
  328. //==============================
  329. Scene_Base.prototype.executeTransitionEffect = function() {
  330.     if (this._spriteset) {this._spriteset.update()};
  331.     if (!this._bitmapTransition) {this.createTRBitmap()};
  332.     if (!this._bitmapTransition.isReady()) {return};       
  333.     if (!this._spriteTrasition) {this.setupTrasition()};
  334.     this.updateTransitionEffects();
  335. };
  336.  
  337. //==============================
  338. // * Setup TRSimpleSlide
  339. //==============================
  340. Scene_Base.prototype.setupTRSimpleSlide = function() {     
  341.     this._spriteTrasition[0] = new Sprite(this._bitmapTransition);
  342.     this._spriteTrasition[0].scX = Graphics.boxWidth;
  343.     this._spriteTrasition[0].speed = Math.floor(this._spriteTrasition[0].scX / 90) + 1;
  344.     this.addChild(this._spriteTrasition[0]);
  345. };
  346.    
  347. //==============================
  348. // * Setup TRDoubleSlide
  349. //==============================
  350. Scene_Base.prototype.setupTRDoubleSlide = function() { 
  351.     for (var i = 0; i < 2; i++) {
  352.         this._spriteTrasition[i] = new Sprite(this._bitmapTransition);
  353.         this._spriteTrasition[i].scX = Graphics.boxWidth;
  354.         this._spriteTrasition[i].speed = Math.floor(this._spriteTrasition[i].scX / 180) + 1;
  355.         this._spriteTrasition[i].setFrame(this._trData[2] * i,0,this._trData[2],this._trData[1]);
  356.         this._spriteTrasition[i].x = this._trData[2] * i;      
  357.         this.addChild(this._spriteTrasition[i]);
  358.     };
  359.      for (var i = 0; i < 5; i++) {
  360.          this.updateTRDoubleSlide()
  361.      };
  362.      this._trData[4] = 1;
  363.      this._trData[5] = 40; 
  364.    
  365. };
  366.  
  367. //==============================
  368. // * Setup TRPixilate
  369. //==============================
  370. Scene_Base.prototype.setupTRNoise = function() {   
  371.      this._spriteTrasition[0] = new Sprite(this._bitmapTransition);
  372.      this._spriteTrasition[0].duration = 0;
  373.      this.addChild(this._spriteTrasition[0]);
  374.      var filter = new PIXI.filters.NoiseFilter();
  375.      filter.noise = 0;
  376.      this._spriteTrasition[0].filters = [filter];    
  377.      if (this._spriteset) {this._spriteset.filters = [filter];};
  378.      this._trData[4] = 90;
  379. };         
  380.    
  381. //==============================
  382. // * Setup TRBlur
  383. //==============================
  384. Scene_Base.prototype.setupTRBlur = function() {
  385.      this._spriteTrasition[0] = new Sprite(this._bitmapTransition);
  386.      this._spriteTrasition[0].duration = 0;
  387.      this.addChild(this._spriteTrasition[0]);
  388.      var filter = new PIXI.filters.BlurFilter();
  389.      filter.blurX = 0;
  390.      filter.blurY = 0;   
  391.      this._spriteTrasition[0].filters = [filter];    
  392.      if (this._spriteset) {this._spriteset.filters = [filter];};
  393.      this._trData[4] = 90;
  394. };
  395.  
  396. //==============================
  397. // * Setup TR Shatter
  398. //==============================
  399. Scene_Base.prototype.setupTRShatter = function() {     
  400.      var frag_size = 32;
  401.      for (var i = 0; i >= 0; i++) {
  402.          this._spriteTrasition[i] = new Sprite(this._bitmapTransition);
  403.          var l = Math.floor((i * frag_size) / this._bitmapTransition.width);
  404.          var x = Math.floor(i * frag_size) - Math.floor(l * this._bitmapTransition.width);
  405.          var y = Math.floor(l * frag_size);
  406.          this._spriteTrasition[i].x = x + Math.floor(frag_size / 2);
  407.          this._spriteTrasition[i].y = y + Math.floor(frag_size / 2);         
  408.          this._spriteTrasition[i].anchor.x = 0.5;
  409.          this._spriteTrasition[i].anchor.y = 0.5;
  410.          this._spriteTrasition[i].sx = (Math.random() * 2) + 3;
  411.          this._spriteTrasition[i].sy = (Math.random() * 1.5) + 3;
  412.          this._spriteTrasition[i].op = Math.randomInt(3) + 3;
  413.          this._spriteTrasition[i].init = Math.randomInt(20)
  414.          this._spriteTrasition[i].rot = (Math.random() * 0.001) + 0.001;
  415.          this._spriteTrasition[i].setFrame(x,y,frag_size,frag_size);
  416.          if (this.trsType() === 1) {
  417.              this._spriteTrasition[i].init = Math.randomInt(40)
  418.              var d = Math.randomInt(2);
  419.              this._spriteTrasition[i].sx = d === 0 ? this._spriteTrasition[i].sx : -this._spriteTrasition[i].sx;
  420.              this._spriteTrasition[i].rot = this._spriteTrasition[i].sx > 0 ? this._spriteTrasition[i].rot : -this._spriteTrasition[i].rot;
  421.          };
  422.          this.addChild(this._spriteTrasition[i]);
  423.          if (this._spriteTrasition[i].y > this._bitmapTransition.height) {break};
  424.      };
  425.      for (var i = 0; i < 5; i++) {
  426.          this.updateTRShatter2()
  427.      };
  428.      this._trData[4] = 1;
  429.      this._trData[5] = 40;
  430. };     
  431.    
  432. //==============================
  433. // * Update TR Noise
  434. //==============================
  435. Scene_Base.prototype.updateTRNoise = function() {
  436.     this._spriteTrasition[0].duration ++;
  437.     if (this._spriteTrasition[0].duration >= 90) {
  438.         this.trfilter().noise -= 0.01;
  439.         this._spriteTrasition[0].opacity -= 5;
  440.     } else {
  441.         this.trfilter().noise += 0.01;
  442.     };
  443.     if (this.trfilter().noise <= 0) {
  444.         this.trfilter().noise = 0; 
  445.         this.clearTREffects();
  446.     };
  447. };
  448.    
  449. //==============================
  450. // * Update TR Blur
  451. //==============================
  452. Scene_Base.prototype.updateTRBlur = function() {
  453.     this._spriteTrasition[0].duration ++;
  454.     if (this._spriteTrasition[0].duration >= 90) {
  455.         this.trfilter().blurX -= 8;
  456.         this._spriteTrasition[0].opacity -= 5;
  457.     } else {
  458.         this.trfilter().blurX += 8;
  459.     };
  460.     if (this.trfilter().blurX <= 0) {
  461.         this.trfilter().blurX = 0; 
  462.         this.clearTREffects();
  463.     };
  464. }; 
  465.    
  466. //==============================
  467. // * Update TR Shatter 1
  468. //==============================
  469. Scene_Base.prototype.updateTRShatter1 = function() {
  470.     var trdone = true;
  471.     for (var i = 0; i < this._spriteTrasition.length; i++) {
  472.         this._spriteTrasition[i].init ++;
  473.          if (this._spriteTrasition[i].init < 60) {
  474.              this._spriteTrasition[i].x += this._spriteTrasition[i].sx;
  475.          } else if (this._spriteTrasition[i].init < 90) {
  476.              this._spriteTrasition[i].x -= this._spriteTrasition[i].sx * 3;
  477.              this._spriteTrasition[i].rotation += 0.1;
  478.          } else {
  479.              this._spriteTrasition[i].x -= this._spriteTrasition[i].sx * 4;
  480.              this._spriteTrasition[i].rotation += 0.1;
  481.              this._spriteTrasition[i].opacity -= this._spriteTrasition[i].op;
  482.          };
  483.          if (this._spriteTrasition[i].x > 0) {trdone = false};  
  484.     };
  485.     if (trdone) {this.clearTREffects()};
  486. };
  487.    
  488. //==============================
  489. // * Update TR Shatter 2
  490. //==============================
  491. Scene_Base.prototype.updateTRShatter2 = function() {
  492.     var trdone = true;
  493.     for (var i = 0; i < this._spriteTrasition.length; i++) {
  494.          this._spriteTrasition[i].init ++;
  495.          if (this._spriteTrasition[i].sx > 0) {
  496.             this._spriteTrasition[i].sx -= 0.05;
  497.          } else if (this._spriteTrasition[i].sx < 0) {
  498.             this._spriteTrasition[i].sx += 0.05;
  499.          };
  500.          this._spriteTrasition[i].x += this._spriteTrasition[i].sx;
  501.          if (this._spriteTrasition[i].init < 60) {
  502.             this._spriteTrasition[i].y -= this._spriteTrasition[i].sy;
  503.          } else if (this._spriteTrasition[i].init < 90) {
  504.             this._spriteTrasition[i].y += this._spriteTrasition[i].sy * 2;
  505.             this._spriteTrasition[i].rotation -= this._spriteTrasition[i].rot;
  506.          } else {
  507.             this._spriteTrasition[i].y += this._spriteTrasition[i].sy * 2;
  508.             this._spriteTrasition[i].opacity -= this._spriteTrasition[i].op;
  509.          };
  510.          if (this._spriteTrasition[i].opacity > 0) {trdone = false};  
  511.     };
  512.     if (trdone) {this.clearTREffects()};
  513. }; 
  514.    
  515. //==============================
  516. // * update TR Simple Slide
  517. //==============================
  518. Scene_Base.prototype.updateTRSimpleSlide = function() {
  519.     this._spriteTrasition[0].x += this._spriteTrasition[0].speed;
  520.     if (this._spriteTrasition[0].x > this._spriteTrasition[0].scX + 16) {this.clearTREffects()};
  521. };
  522.  
  523. //==============================
  524. // * update TR Double Slide
  525. //==============================
  526. Scene_Base.prototype.updateTRDoubleSlide = function() {
  527.     this._spriteTrasition[0].x -= this._spriteTrasition[0].speed;
  528.     this._spriteTrasition[1].x += this._spriteTrasition[1].speed;
  529.     if (this._spriteTrasition[0].x < -(this._trData[2] + 16)) {this.clearTREffects()};
  530. };
  531.  
  532.  
  533. //==============================
  534. // * Update TR Phase One
  535. //==============================
  536. Scene_Base.prototype.updateTRPhaseOne = function() {
  537.     this._trData[4] --
  538.     if (this._trData[4] <= 0) {this.prepareTRSecondPhase();};
  539. };
  540.  
  541. //==============================
  542. // * Prepare TR Second Phase
  543. //==============================
  544. Scene_Base.prototype.prepareTRSecondPhase = function() {
  545.     $gameSystem._treSpriteData = [];
  546.     for (var i = 0; i < this._spriteTrasition.length; i++) {
  547.         this.trRecordData(i);      
  548.     };
  549.     this.clearTREffects();
  550.     $gameSystem._trefctData[3] = 1;
  551. };
  552.  
  553. //==============================
  554. // * Prepare TR record Data
  555. //==============================
  556. Scene_Base.prototype.trRecordData = function(i) {
  557.      $gameSystem._treSpriteData[i] = this._spriteTrasition[i];
  558. };
  559.  
  560. //==============================
  561. // * Load TR pre DAta
  562. //==============================
  563. Scene_Base.prototype.loadTRPreData = function() {
  564.     for (var i = 0; i < $gameSystem._treSpriteData.length; i++) {
  565.         this._spriteTrasition[i] = $gameSystem._treSpriteData[i];
  566.         this.addChild(this._spriteTrasition[i]);
  567.     };
  568.     if (this.needTRcreateBlackScreen()) {this.createTRBlackScreen();};
  569.     if (this.needTRLoadFilter()) {this._spriteset.filters = this._spriteTrasition[0].filters;};
  570. };
  571.  
  572. //==============================
  573. // * Load TR pre DAta
  574. //==============================
  575. Scene_Base.prototype.updateTRBlackScreen = function() {
  576.    if (this._TRblackScreenD > 0) {this._TRblackScreenD--;return};
  577.    if (this.trsPhase() === 0) {
  578.       this._dummyTR2.opacity += 18;
  579.    } else {
  580.       this._dummyTR2.opacity -= 18;
  581.    };
  582. };
  583.  
  584. //==============================
  585. // * Update Transition Effect
  586. //==============================
  587. Scene_Base.prototype.updateTransitionEffects = function() {
  588.     if (this.trsPhase() === 1) {this._dummyTR.opacity -= 3;
  589.         if (this._dummyTR.opacity > 150) {return}
  590.     } ;
  591.     if (this._trData[5] > 0) {this._trData[5] --;
  592.        if (this._trData[5] === 0) {this.prepareTRSecondPhase();}
  593.        return
  594.     };
  595.     if (this.trsType() === 0) {
  596.         this.updateTRShatter1();
  597.     } else if (this.trsType() === 1) {
  598.         this.updateTRShatter2();
  599.     } else if (this.trsType() === 2) {
  600.         this.updateTRBlur();
  601.     } else if (this.trsType() === 3) {
  602.         this.updateTRNoise();
  603.     } else if (this.trsType() === 5) {
  604.         this.updateTRDoubleSlide();    
  605.            
  606.     };
  607.     if (this._trData[4] > 0) {this.updateTRPhaseOne()};
  608.     if (this._dummyTR2) {this.updateTRBlackScreen()};
  609. };
  610.  
  611. //=============================================================================
  612. // ** Scene Map
  613. //=============================================================================
  614.  
  615. //==============================
  616. // * Initialize
  617. //==============================
  618. var _mog_trefct_scmap_initialize = Scene_Map.prototype.initialize;
  619. Scene_Map.prototype.initialize = function() {
  620.     _mog_trefct_scmap_initialize.call(this);
  621.     $gameSystem.trefctClear();
  622. };
  623.  
  624. //==============================
  625. // * Initialize
  626. //==============================
  627. var _mog_trefct_scmap_create = Scene_Map.prototype.create;
  628. Scene_Map.prototype.create = function() {
  629.     _mog_trefct_scmap_create.call(this);
  630.     $gameSystem._treCP = false;
  631. };
  632.  
  633. //==============================
  634. // * Update
  635. //==============================
  636. var _mog_trefct_scmap_update = Scene_Map.prototype.update;
  637. Scene_Map.prototype.update = function() {
  638.     if (SceneManager.needTrasition()) {this.executeTransitionEffect();return};
  639.     _mog_trefct_scmap_update.call(this);
  640. };
  641.  
  642. //==============================
  643. // * start Encounter Effect
  644. //==============================
  645. var _mog_tre_scmap_startEncounterEffect = Scene_Map.prototype.startEncounterEffect;
  646. Scene_Map.prototype.startEncounterEffect = function() {
  647.    this.setTRType();
  648.    if ($gameSystem._treType[0] >= 0) {
  649.        this._encounterEffectDuration = 5;  
  650.        return;
  651.    };
  652.    $gameSystem._trefctData[0] = false;
  653.    _mog_tre_scmap_startEncounterEffect.call(this);
  654. };
  655.  
  656. //==============================
  657. // * setTRType
  658. //==============================
  659. Scene_Map.prototype.setTRType = function() {
  660.    $gameSystem._trefctData[0] = true;
  661.    $gameSystem._trefctData[1] = $gameSystem.setTransitionR();      
  662.    $gameSystem._trefctData[2] = 0;
  663. };
  664.  
  665. //==============================
  666. // * updateEncounterEffect
  667. //==============================
  668. var _mog_tre_scmap_updateEncounterEffect = Scene_Map.prototype.updateEncounterEffect;
  669. Scene_Map.prototype.updateEncounterEffect = function() {
  670.     if ($gameSystem._treType[0] >= 0) {return};
  671.     _mog_tre_scmap_updateEncounterEffect.call(this);
  672. };
  673.  
  674. //=============================================================================
  675. // ** Scene Battle
  676. //=============================================================================
  677.  
  678. //==============================
  679. // * Update
  680. //==============================
  681. var _mog_trefct_scbattle_update = Scene_Battle.prototype.update;
  682. Scene_Battle.prototype.update = function() {
  683.     if (SceneManager.needTrasition()) {this.executeTransitionEffect();return};
  684.     _mog_trefct_scbattle_update.call(this);
  685. };
  686.  
  687. //==============================
  688. // * Create
  689. //==============================
  690. var _mog_trefct_scbattle_create = Scene_Battle.prototype.create;
  691. Scene_Battle.prototype.create = function() {
  692.     _mog_trefct_scbattle_create.call(this);
  693.     if (!BattleManager.isBattleTest() && $gameSystem._treType[0] >= 0) {
  694.         $gameSystem._trefctData[0] = true;
  695.         $gameSystem._trefctData[1] = $gameSystem._treType[0];
  696.         $gameSystem._trefctData[2] = 1;
  697.     };
  698. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement