查看: 1797|回复: 0

[原创发布] Mog_BattleResult与YEP JobPonits的兼容性修正

[复制链接]
梦石
0
星屑
440
在线时间
679 小时
注册时间
2014-3-15
回帖
239

开拓者

发表于 2017-3-19 19:05:23 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
  1. //=============================================================================
  2. // MOG_BattleResult.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.1) Modifica a tela de vítoria.
  6. * @author Moghunter
  7. *
  8. * @param Exp X-Axis
  9. * @desc Posição X-Axis da EXP.
  10. * @default 760
  11. *
  12. * @param Exp Y-Axis
  13. * @desc Posição Y-Axis da EXP.
  14. * @default 160
  15. *
  16. * @param Gold X-Axis
  17. * @desc Posição X-Axis do Gold.
  18. * @default 760
  19. *
  20. * @param Gold Y-Axis
  21. * @desc Posição Y-Axis do Gold.
  22. * @default 230
  23. *
  24. * @param JP X-Axis
  25. * @desc Posição X-Axis do Jp.
  26. * @default 760
  27. *
  28. * @param JP Y-Axis
  29. * @desc Posição Y-Axis do Jp.
  30. * @default 300
  31. *
  32. * @param Treasure -Axis
  33. * @desc Posição X-Axis do tersouro.
  34. * @default 32
  35. *
  36. * @param Treasure Y-Axis
  37. * @desc Posição Y-Axis do tesouro.
  38. * @default 330
  39. *
  40. * @param Actor X-Axis
  41. * @desc Posição X-Axis do personagem.
  42. * @default 250
  43. *
  44. * @param Actor Y-Axis
  45. * @desc Posição Y-Axis do personagem.
  46. * @default 0  
  47. *
  48. * @param Parameter Real X-Axis
  49. * @desc Posição X-Axis dos parâmetros.
  50. * @default 0
  51. *
  52. * @param Parameter Real Y-Axis
  53. * @desc Posição Y-Axis dos parâmetros.
  54. * @default 0
  55. *
  56. * @param Parameter 1 X-Axis
  57. * @desc Posição X-Axis dos parâmetros antes do level-up.
  58. * @default 550
  59. *
  60. * @param Parameter 1 Y-Axis
  61. * @desc Posição Y-Axis dos parâmetros antes do level-up.
  62. * @default 140
  63. *
  64. * @param Parameter 2 X-Axis
  65. * @desc Posição X-Axis dos parâmetros depois do level-up.
  66. * @default 700
  67. *
  68. * @param Parameter 2 Y-Axis
  69. * @desc Posição Y-Axis dos parâmetros depois do level-up.
  70. * @default 140  
  71. *
  72. * @param New Skill X-Axis
  73. * @desc Posição X-Axis da nova habilidade.
  74. * @default 570
  75. *
  76. * @param New Skill Y-Axis
  77. * @desc Posição Y-Axis da nova habilidade.
  78. * @default 520
  79. *
  80. * @param Name X-Axis
  81. * @desc Posição X-Axis do nome do personagem.
  82. * @default 155
  83. *
  84. * @param Name Y-Axis
  85. * @desc Posição Y-Axis do nome do personagem.
  86. * @default 540  
  87. *
  88. * @help  
  89. * =============================================================================
  90. * +++ MOG - Battle Result (v1.1) +++
  91. * By Moghunter
  92. * [url]https://atelierrgss.wordpress.com/[/url]
  93. * =============================================================================
  94. * Modifica a tela de vítoria.
  95. * =============================================================================
  96. * Serão necessários os arquivos. (img/system/)
  97. *
  98. * Result_A.png
  99. * Result_B.png
  100. * Result_C.png
  101. * Result_D.png
  102. * Result_E.png
  103. *
  104. * =============================================================================
  105. * ACTOR PICTURE
  106. * =============================================================================
  107. * As imagens deverão ser gravadas na pasta /img/picture/
  108. * Nomeie as imagens da seguinte forma.
  109. *
  110. * Actor_ ID
  111. *
  112. * Exemplo
  113. *
  114. * Actor_1.png
  115. * Actor_2.png
  116. * Actor_3.png
  117. * ...
  118. *
  119. * =============================================================================
  120. * HISTÓRICO
  121. * =============================================================================
  122. * (v1.1) - Correção de não apresentar a janela de status na batalha seguinte.
  123. */

  124. //=============================================================================
  125. // ** PLUGIN PARAMETERS
  126. //=============================================================================

  127.   var Imported = Imported || {};
  128.   Imported.MOG_BattleResult = true;
  129.   var Moghunter = Moghunter || {};        
  130.         Moghunter.parameters = PluginManager.parameters('MOG_BattleResult');
  131.         Moghunter.bresult_exp_x = Number(Moghunter.parameters['Exp X-Axis'] || 760);
  132.     Moghunter.bresult_exp_y = Number(Moghunter.parameters['Exp Y-Axis'] || 160);
  133.         Moghunter.bresult_gold_x = Number(Moghunter.parameters['Gold X-Axis'] || 760);
  134.     Moghunter.bresult_gold_y = Number(Moghunter.parameters['Gold Y-Axis'] || 230);
  135.         Moghunter.bresult_jp_x = Number(Moghunter.parameters['JP X-Axis'] || 760);
  136.     Moghunter.bresult_jp_y = Number(Moghunter.parameters['JP Y-Axis'] || 300);       
  137.         Moghunter.bresult_treasure_x = Number(Moghunter.parameters['Treasure X-Axis'] || 32);
  138.     Moghunter.bresult_treasure_y = Number(Moghunter.parameters['Treasure Y-Axis'] || 330);
  139.         Moghunter.bresult_actor_x = Number(Moghunter.parameters['Actor X-Axis'] || 250);
  140.     Moghunter.bresult_actor_y = Number(Moghunter.parameters['Actor Y-Axis'] || 0);       
  141.         Moghunter.bresult_par0_x = Number(Moghunter.parameters['Parameter Real X-Axis'] || 0);
  142.     Moghunter.bresult_par0_y = Number(Moghunter.parameters['Parameter Real Y-Axis'] || 0);               
  143.         Moghunter.bresult_par1_x = Number(Moghunter.parameters['Parameter 1 X-Axis'] || 550);
  144.     Moghunter.bresult_par1_y = Number(Moghunter.parameters['Parameter 1 Y-Axis'] || 140);       
  145.         Moghunter.bresult_par2_x = Number(Moghunter.parameters['Parameter 2 X-Axis'] || 700);
  146.     Moghunter.bresult_par2_y = Number(Moghunter.parameters['Parameter 2 Y-Axis'] || 140);               
  147.         Moghunter.bresult_skill_x = Number(Moghunter.parameters['New Skill X-Axis'] || 570);
  148.     Moghunter.bresult_skill_y = Number(Moghunter.parameters['New Skill Y-Axis'] || 520);               
  149.         Moghunter.bresult_name_x = Number(Moghunter.parameters['Name X-Axis'] || 155);
  150.     Moghunter.bresult_name_y = Number(Moghunter.parameters['Name Y-Axis'] || 540);               

  151. //=============================================================================
  152. // ** Game Temp
  153. //=============================================================================

  154. //==============================
  155. // ** Initialize
  156. //==============================
  157. var _mog_bresult_gtemp_initialize = Game_Temp.prototype.initialize;
  158. Game_Temp.prototype.initialize = function() {
  159.     _mog_bresult_gtemp_initialize.call(this);
  160.     this.battleResultClear()
  161. };

  162. //==============================
  163. // ** battle Result Clear
  164. //==============================
  165. Game_Temp.prototype.battleResultClear = function() {
  166.         this._bResult = [false,[],0,0,[]];
  167.         this._battleEnd = false;
  168. };

  169. //=============================================================================
  170. // ** Game Actor
  171. //=============================================================================

  172. //==============================
  173. // ** display LevelUP
  174. //==============================
  175. var _mog_bresult_gact_displayLevelUp = Game_Actor.prototype.displayLevelUp;
  176. Game_Actor.prototype.displayLevelUp = function(newSkills) {
  177.         if ($gameTemp._bResult[0]) {
  178.                 $gameTemp._bResult[5] = newSkills;
  179.                 return;
  180.         };
  181.         _mog_bresult_gact_displayLevelUp.call(this,newSkills);
  182. };


  183. //=============================================================================
  184. // ** BattleManager
  185. //=============================================================================

  186. //==============================
  187. // ** setup
  188. //==============================
  189. var _mog_brt_bmngr_setup = BattleManager.setup;
  190. BattleManager.setup = function(troopId, canEscape, canLose) {
  191.         _mog_brt_bmngr_setup.call(this,troopId, canEscape, canLose);
  192.         $gameTemp.battleResultClear();
  193. };

  194. //==============================
  195. // ** process Victory
  196. //==============================
  197. BattleManager.processVictory = function() {
  198.         if (Imported.MOG_BattleCry) {
  199.             var actor = this.randomActor();
  200.             if (actor) {SoundManager.selectVoice(actor._v_victory)};       
  201.         };
  202.         AudioManager.fadeOutBgm(1);
  203.         $gameTemp._battleEnd = true;
  204.         $gameTemp._battleResult = true;
  205.         this.getResultData();
  206.         $gameParty.removeBattleStates();
  207.         $gameParty.performVictory();
  208.         this.endBattle(0);
  209. };


  210. //==============================
  211. // ** get Result Data
  212. //==============================
  213. BattleManager.getResultData = function() {
  214.          this.makeRewards();
  215.          $gameTemp._bResult[0] = true;         
  216.          $gameTemp._bResult[1] = this._rewards.exp;
  217.          $gameTemp._bResult[2] = this._rewards.gold;
  218.          $gameTemp._bResult[3] = this._rewards.jp;
  219.          $gameTemp._bResult[4] = this._rewards.items;
  220.          $gameTemp._bResult[5] = [];
  221. };

  222. //==============================
  223. // ** Update
  224. //==============================
  225. var _mog_bresult_update = BattleManager.update;
  226. BattleManager.update = function() {
  227.         if ($gameTemp._bResult[0]) {return};
  228.         _mog_bresult_update.call(this);
  229. };

  230. //=============================================================================
  231. // ** Scene Battle
  232. //=============================================================================

  233. //==============================
  234. // ** Terminate
  235. //==============================
  236. var _mog_bresult_terminate = Scene_Battle.prototype.terminate;
  237. Scene_Battle.prototype.terminate = function() {
  238.         _mog_bresult_terminate.call(this);
  239.         $gameTemp._bResult =  [false,[],0,0,[]];
  240. };

  241. //==============================
  242. // ** Update
  243. //==============================
  244. var _mog_bresult_sbat_update = Scene_Battle.prototype.update;
  245. Scene_Battle.prototype.update = function() {
  246.         _mog_bresult_sbat_update.call(this);
  247.         if ($gameTemp._bResult[0]) {this.updateBResult()};
  248. };

  249. //==============================
  250. // ** updateWindow Position
  251. //==============================
  252. var _mog_bresult_updateWindowPositions = Scene_Battle.prototype.updateWindowPositions;
  253. Scene_Battle.prototype.updateWindowPositions = function() {
  254.         _mog_bresult_updateWindowPositions.call(this);
  255.         if ($gameTemp._battleEnd) {
  256.                 this._statusWindow.opacity -= 10;
  257.             this._statusWindow.contentsOpacity -= 10;
  258.         };
  259. };

  260. //==============================
  261. // ** Update BResult
  262. //==============================
  263. Scene_Battle.prototype.updateBResult = function() {
  264.         if (!this._bresult) {this.createBResult()};
  265. };

  266. //==============================
  267. // ** createBresult
  268. //==============================
  269. Scene_Battle.prototype.createBResult = function() {
  270.         this._bresult = new BattleResult();
  271.         this.addChild(this._bresult);
  272. };

  273. //=============================================================================
  274. // * Battle Result
  275. //=============================================================================
  276. function BattleResult() {
  277.     this.initialize.apply(this, arguments);
  278. };

  279. BattleResult.prototype = Object.create(Sprite.prototype);
  280. BattleResult.prototype.constructor = BattleResult;

  281. //==============================
  282. // * Initialize
  283. //==============================
  284. BattleResult.prototype.initialize = function() {
  285.     Sprite.prototype.initialize.call(this);       
  286.         if (BattleManager._spriteset && BattleManager._spriteset.combo_sprite_data) {
  287.                 BattleManager._spriteset.combo_sprite_data[0] = 1;
  288.         };
  289.         this._phase = 0;
  290.         this._actorIndex = 0;
  291.         this._skillIndex = 0;
  292.         this.z = 50;
  293.         this._actor = null;
  294.         this._actopar = [];
  295.         this._playME = 10;
  296.         this.phaseAniClear();
  297.         this._phaseAnime[0] = 1;
  298.         this._phaseAnime[1] = 60;
  299.         this._numbeData = [-1,-1];
  300.         this.loadImages();
  301.         this.createObjects();
  302. };

  303. //==============================
  304. // * Phase Ani Clear
  305. //==============================
  306. BattleResult.prototype.phaseAniClear = function() {
  307.         this._phaseAnime = [0,0,0];
  308. };


  309. //==============================
  310. // * loadImages
  311. //==============================
  312. BattleResult.prototype.loadImages = function() {
  313.         this._icon_img = ImageManager.loadSystem("IconSet");
  314.         this._layout_img = ImageManager.loadSystem("Result_A");
  315.         this._number_img1 = ImageManager.loadSystem("Result_B");
  316.         this._number_img2 = ImageManager.loadSystem("Result_C");
  317.         this._layout2_img = ImageManager.loadSystem("Result_D");
  318.         this._vict_img = ImageManager.loadSystem("Result_E");
  319. };

  320. //==============================
  321. // * Press Any Key
  322. //==============================
  323. BattleResult.prototype.pressAnyKey = function() {
  324.     if (TouchInput.isTriggered()) {return true};
  325.         if (TouchInput.isCancelled()) {return true};
  326.         if (Input.isTriggered("ok")) {return true};
  327.         if (Input.isTriggered("cancel")) {return true};
  328.     return false;
  329. };

  330. //==============================
  331. // * Create Objects
  332. //==============================
  333. BattleResult.prototype.createObjects = function() {
  334.         this.createVict();
  335.         this.createLayout();
  336.         this.createExp();
  337.         this.createGold();
  338.         this.createJp();
  339.         this.createTreasures();
  340. };

  341. //==============================
  342. // * Create Vict
  343. //==============================
  344. BattleResult.prototype.createVict = function() {
  345.         this._vict = new Sprite(this._vict_img);
  346.         this._vict.opacity = 0;
  347.         this._vict.scale.x = 3.0;
  348.         this._vict.scale.y = 3.0;
  349.         this._vict.anchor.x = 0.5;
  350.         this._vict.anchor.y = 0.5;
  351.         this._vict.x = Graphics.boxWidth / 2;
  352.         this._vict.y = Graphics.boxHeight / 2;
  353.         this.addChild(this._vict);
  354. };

  355. //==============================
  356. // * Create Layout
  357. //==============================
  358. BattleResult.prototype.createLayout = function() {
  359.         this._layout = new Sprite(this._layout_img);
  360.         this._layout.opacity = 0;
  361.         this._layout.scale.x = 3.0;
  362.         this._layout.anchor.x = 0.5;
  363.         this._layout.x = Graphics.boxWidth / 2;
  364.         this.addChild(this._layout);
  365. };

  366. //==============================
  367. // * Create Exp
  368. //==============================
  369. BattleResult.prototype.createExp = function() {
  370.     this._expNumber = [];
  371.         this._expOld = 0;
  372.         this._expOrg = [Moghunter.bresult_exp_x,Moghunter.bresult_exp_y];
  373.         for (var i = 0; i < 8; i++) {
  374.            this._expNumber[i] = new Sprite(this._number_img1);
  375.            this._expNumber[i].visible = false;
  376.            this._expNumber[i].x = this._expOrg[0];
  377.            this._expNumber[i].y = this._expOrg[1];
  378.            this.addChild(this._expNumber[i]);
  379.         };               
  380.        
  381. };

  382. //==============================
  383. // * Create Gold
  384. //==============================
  385. BattleResult.prototype.createGold = function() {
  386.     this._goldNumber = [];
  387.         this._goldOld = 0;
  388.         this._goldOrg = [Moghunter.bresult_gold_x,Moghunter.bresult_gold_y];
  389.         for (var i = 0; i < 8; i++) {
  390.            this._goldNumber[i] = new Sprite(this._number_img1);
  391.            this._goldNumber[i].visible = false;
  392.            this._goldNumber[i].x = this._goldOrg[0];
  393.            this._goldNumber[i].y = this._goldOrg[1];
  394.            this.addChild(this._goldNumber[i]);
  395.         };       
  396. };

  397. //==============================
  398. // * Create Jp
  399. //==============================
  400. BattleResult.prototype.createJp = function() {
  401.     this._jpNumber = [];
  402.         this._jpOld = 0;
  403.         this._jpOrg = [Moghunter.bresult_jp_x,Moghunter.bresult_jp_y];
  404.         for (var i = 0; i < 8; i++) {
  405.            this._jpNumber[i] = new Sprite(this._number_img1);
  406.            this._jpNumber[i].visible = false;
  407.            this._jpNumber[i].x = this._jpOrg[0];
  408.            this._jpNumber[i].y = this._jpOrg[1];
  409.            this.addChild(this._jpNumber[i]);
  410.         };       
  411. };

  412. //==============================
  413. // * Add ICon
  414. //==============================
  415. BattleResult.prototype.addIcon = function(sprite,data) {
  416.         var icon = new Sprite(this._icon_img);
  417.         var w = Window_Base._iconWidth;
  418.         var h = Window_Base._iconHeight;
  419.         var sx = data.iconIndex % 16 * w;
  420.         var sy = Math.floor(data.iconIndex / 16) * h;
  421.     icon.setFrame(sx,sy,w,h);
  422.     sprite.addChild(icon);
  423.         var name = new Sprite(new Bitmap(160,32));
  424.         name.bitmap.drawText(data.name,0,0,160,32);
  425.         name.x = w + 4;
  426.         sprite.addChild(name);
  427. };

  428. //==============================
  429. // * Create Treasures
  430. //==============================
  431. BattleResult.prototype.createTreasures = function() {
  432.         this._treasures = [];
  433.         var x = Moghunter.bresult_treasure_x;
  434.         var y = Moghunter.bresult_treasure_y;
  435.         var s = Graphics.boxWidth - 64;
  436.         var w = (s / 3);
  437.         var h = Window_Base._iconHeight + 4;
  438.         for (var i = 0; i < $gameTemp._bResult[4].length; i++) {
  439.               this._treasures[i] = new Sprite();
  440.                   this._treasures[i].opacity = 0;
  441.                   this.addChild(this._treasures[i]);
  442.                   var l = Math.floor(i / 3);
  443.                   this._treasures[i].x = x + (w * i) - Math.floor(l * s);
  444.                   this._treasures[i].y = y + (l * h);
  445.                   this.addIcon(this._treasures[i],$gameTemp._bResult[4][i]);
  446.         };      
  447. };

  448. //==============================
  449. // * getData
  450. //==============================
  451. BattleResult.prototype.getData = function() {
  452.     this._numbeData[0] = this._number_img1.width / 10;
  453.     this._numbeData[1] = this._number_img1.height;
  454. };

  455. //==============================
  456. // * Update Dif
  457. //==============================
  458. BattleResult.prototype.update_dif = function(value,real_value,speed) {
  459.         if (value == real_value) {return value};
  460.         var dnspeed = 1 + (Math.abs(value - real_value) / speed);
  461.         if (value > real_value) {value -= dnspeed;
  462.             if (value < real_value) {value = real_value};}
  463.     else if (value < real_value) {value  += dnspeed;
  464.             if (value  > real_value) {value  = real_value};               
  465.     };
  466.         return Math.floor(value);
  467. };

  468. //==============================
  469. // * Refresh Number
  470. //==============================
  471. BattleResult.prototype.refresh_number = function(sprites,value,img_data,x,center) {
  472.     numbers = Math.abs(value).toString().split("");  
  473.            for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  474.            if (i > numbers.length) {return};
  475.            var n = Number(numbers[i]);
  476.            sprites[i].setFrame(n * img_data[0], 0, img_data[0], img_data[1]);
  477.            sprites[i].visible = true;
  478.            if (center === 0) {
  479.                 var nx = -(img_data[0] * i) + (img_data[0] * numbers.length);
  480.            } else {
  481.                    var nx = -(img_data[0] * i) + ((img_data[0] / 2) * numbers.length);
  482.            };
  483.            sprites[i].x = x - nx;
  484.     };       
  485. };

  486. //==============================
  487. // * Update
  488. //==============================
  489. BattleResult.prototype.update = function() {
  490.         Sprite.prototype.update.call(this);         
  491.         if (this._numbeData[0] === -1 && this._number_img1.isReady() && this._number_img2.isReady()) {this.getData()};
  492.         if (this._numbeData[0] === -1) {return};
  493.         if (this._phaseAnime[1] > 0) {this._phaseAnime[1] --;return};
  494.         if (this._playME > 0) {this.updateME()};
  495.     switch (this._phase) {
  496.                 case 0:
  497.             this.updateStart();
  498.             break;               
  499.         case 1:
  500.             this.updateExp();
  501.             break;
  502.         case 2:
  503.             this.updateGold();
  504.             break;
  505.         case 3:
  506.             this.updateJp();
  507.             break;
  508.         case 4:
  509.             this.updateTreasure();
  510.             break;
  511.         case 5:
  512.             this.updateLevel();
  513.             break;
  514.         case 6:
  515.             this.updateEnd();
  516.             break;                       
  517.         };
  518. };


  519. //==============================
  520. // * update ME
  521. //==============================
  522. BattleResult.prototype.updateME = function() {
  523.         this._playME --
  524.         if (this._playME === 0) {
  525.                 BattleManager.playVictoryMe();
  526.                 BattleManager.replayBgmAndBgs();       
  527.         };
  528. };

  529. //==============================
  530. // * Update Start
  531. //==============================
  532. BattleResult.prototype.updateStart = function() {
  533.         if (this._phaseAnime[0] > 0) {
  534.         this.updateVictAnimation();
  535.     } else {
  536.         this.updateLayoutAnimation();
  537.         };
  538. };


  539. //==============================
  540. // * Update Layout Animation
  541. //==============================
  542. BattleResult.prototype.updateLayoutAnimation = function() {
  543.         this._layout.opacity += 5;
  544.         if (this._layout.scale.x > 1.00) {
  545.                 this._layout.scale.x -= 0.05;
  546.                 if (this._layout.scale.x < 1.00) {this._layout.scale.x = 1.00};
  547.         } else {
  548.                 this.phaseAniClear();
  549.                 this._phase = 1;
  550.         };
  551. };

  552. //==============================
  553. // * Update Vict Animation
  554. //==============================
  555. BattleResult.prototype.updateVictAnimation = function() {
  556.            if (this._phaseAnime[0] === 1) {
  557.                     if (this._vict.scale.x > 1.00) {
  558.                                 this._vict.scale.x -= 0.05;
  559.                                 this._vict.opacity += 15;
  560.                                 if (this._vict.scale.x <= 1.00) {
  561.                                         this._vict.scale.x = 1.00;
  562.                                         this._vict.opacity = 255;
  563.                                         this._phaseAnime[0] = 2;
  564.                                         this._phaseAnime[1] = 40;
  565.                                 };
  566.                         };
  567.            } else {
  568.                     if (this._vict.scale.x < 3.00) {
  569.                                 this._vict.scale.x += 0.05;
  570.                                 this._vict.opacity -= 10;
  571.                                 if (this._vict.scale.x >= 3.00) {
  572.                                         this._vict.scale.x = 3.00;
  573.                                         this._vict.opacity = 0;
  574.                                         this._phaseAnime[0] = 0;
  575.                                 };
  576.                         };                  
  577.            };
  578.            this._vict.scale.y = this._vict.scale.x;
  579. };

  580. //==============================
  581. // * Update Exp
  582. //==============================
  583. BattleResult.prototype.updateExp = function() {
  584.          if (this.pressAnyKey() &&  $gameTemp._bResult[1] > 0) {
  585.          this._expOld = $gameTemp._bResult[1] - 1;
  586.          };
  587.          var dif_number = this.update_dif(this._expOld,$gameTemp._bResult[1],15);
  588.          if (this._expOld != dif_number) {this._expOld = dif_number;
  589.          this.refresh_number(this._expNumber,this._expOld,this._numbeData,this._expOrg[0],0)};
  590.          if (this._expOld === $gameTemp._bResult[1]) {
  591.                  this.phaseAniClear();
  592.                  this._phase = 2;
  593.                  SoundManager.playCursor();         
  594.          };
  595. };

  596. //==============================
  597. // * Update Gold
  598. //==============================
  599. BattleResult.prototype.updateGold = function() {
  600.          if (this.pressAnyKey() &&  $gameTemp._bResult[1] > 0) {
  601.          this._goldOld = $gameTemp._bResult[2] - 1;
  602.          };
  603.          var dif_number = this.update_dif(this._goldOld,$gameTemp._bResult[2],15);
  604.          if (this._goldOld != dif_number) {this._goldOld = dif_number;
  605.          this.refresh_number(this._goldNumber,this._goldOld,this._numbeData,this._goldOrg[0],0)};
  606.          if (this._goldOld === $gameTemp._bResult[2]) {
  607.                  BattleManager.gainGold();
  608.                  this.phaseAniClear();
  609.                  this._phase = 3;
  610.                  SoundManager.playCursor();
  611.          };
  612. };

  613. //==============================
  614. // * Update Jp
  615. //==============================
  616. BattleResult.prototype.updateJp = function() {
  617.          if (this.pressAnyKey() &&  $gameTemp._bResult[1] > 0) {
  618.          this._jpOld = $gameTemp._bResult[3] - 1;
  619.          };
  620.          var dif_number = this.update_dif(this._jpOld,$gameTemp._bResult[3],15);
  621.          if (this._jpOld != dif_number) {this._jpOld = dif_number;
  622.          this.refresh_number(this._jpNumber,this._jpOld,this._numbeData,this._jpOrg[0],0)};
  623.          if (this._jpOld === $gameTemp._bResult[3]) {
  624.                  this.phaseAniClear();
  625.                  this._phase = 4;
  626.                  SoundManager.playCursor();
  627.          };
  628. };

  629. //==============================
  630. // * Update Treasure
  631. //==============================
  632. BattleResult.prototype.updateTreasure = function() {
  633.         if (this._treasures.length > 0) {
  634.                 for (var i = 0; i < this._treasures.length; i++) {
  635.                         this._treasures[i].opacity += 10;
  636.                 };
  637.                 if (this._treasures[0].opacity >= 255 && this._phaseAnime[0] === 0) {
  638.                         this._phaseAnime[0] = 1;
  639.                 };       
  640.         } else {
  641.             this._phaseAnime[0] = 1;
  642.         };
  643.         if (this._phaseAnime[0] === 1 && this.pressAnyKey()) {
  644.                 BattleManager.gainDropItems();
  645.                 this.phaseAniClear();
  646.                 this._phase = 5;
  647.         };
  648. };

  649. //==============================
  650. // * Update Level
  651. //==============================
  652. BattleResult.prototype.updateLevel = function() {
  653.         if (this._layout.opacity > 0) {this.updateFade()};
  654.         if (!this._actor && this._actorIndex >= $gameParty.battleMembers().length) {
  655.                 this._phase = 6;
  656.                 SoundManager.playCursor();
  657.         } else {
  658.                 if (this._actor) {
  659.                         this.updateLevelAnimation();
  660.                 } else {
  661.                         this.gainEXP();
  662.                 };
  663.         };
  664. };

  665. //==============================
  666. // * Create Level Sprites
  667. //==============================
  668. BattleResult.prototype.createLevelSprites = function() {
  669.         this.disposeLevel();
  670.         this._phaseAnime[0] = 0;
  671.         this._phaseAnime[1] = 10;
  672.         this.createActorSprite();
  673.     this.createLevelLayout();   
  674.     this.createParameters();
  675.     this.createActorName();
  676.         this.playVoice();
  677. };

  678. //==============================
  679. // * Play Voice
  680. //==============================
  681. BattleResult.prototype.playVoice = function() {
  682.         if (Imported.MOG_BattleCry) {SoundManager.selectVoice(this._actor._v_levelup)};
  683. };

  684. //==============================
  685. // * Create Level Layout
  686. //==============================
  687. BattleResult.prototype.createLevelLayout = function() {
  688.         this._levelLayout = new Sprite(this._layout2_img);
  689.         this._levelLayout.opacity = 0;
  690.         this._levelLayout.anchor.x = 0.5;
  691.         this._levelLayout.anchor.y = 0.5;
  692.         this._levelLayout.x = Graphics.boxWidth / 2;
  693.         this._levelLayout.y = Graphics.boxHeight / 2;
  694.         this._levelLayout.scale.x = 3.0;
  695.         this.addChild(this._levelLayout);       
  696. };

  697. //==============================
  698. // * Create Actor Name
  699. //==============================
  700. BattleResult.prototype.createActorName = function() {
  701.         this._name = new Sprite(new Bitmap(140,32));
  702.         this._name.opacity = 0;
  703.         this._name.bitmap.drawText(this._actor._name,0,0,140,32);
  704.         this._name.x = Moghunter.bresult_name_x;
  705.         this._name.y = Moghunter.bresult_name_y;
  706.         this.addChild(this._name);       
  707. };

  708. //==============================
  709. // * Create Actor Sprite
  710. //==============================
  711. BattleResult.prototype.createActorSprite = function() {
  712.         var img = ImageManager.loadPicture("Actor_" + this._actor._actorId)
  713.         this._spriteActor = new Sprite(img);
  714.         this._spriteActor.opacity = 0;
  715.         this._spriteActor.anchor.x = 0.5;
  716.         this.addChild(this._spriteActor);
  717. };

  718. //==============================
  719. // * Create Parameters
  720. //==============================
  721. BattleResult.prototype.createParameters = function() {
  722.         var x = Moghunter.bresult_par1_x;
  723.         var y = Moghunter.bresult_par1_y;
  724.         this._par = new Sprite(new Bitmap(Graphics.boxWidth,Graphics.boxHeight));
  725.         this._par.opacity = 0;
  726.         this._par.bitmap.drawText(this._actopar[0],x,y,100, 24, "right");
  727.         this._par.bitmap.drawText(this._actopar[1],x,y + 32 * 1,100, 24, "right");
  728.         this._par.bitmap.drawText(this._actopar[2],x,y + 32 * 2,100, 24, "right");
  729.         this._par.bitmap.drawText(this._actopar[3],x,y + 32 * 3,100, 24, "right");
  730.         this._par.bitmap.drawText(this._actopar[4],x,y + 32 * 4,100, 24, "right");       
  731.         this._par.bitmap.drawText(this._actopar[5],x,y + 32 * 5,100, 24, "right");
  732.         this._par.bitmap.drawText(this._actopar[6],x,y + 32 * 6,100, 24, "right");
  733.         this._par.bitmap.drawText(this._actopar[7],x,y + 32 * 7,100, 24, "right");
  734.         var x = Moghunter.bresult_par2_x;
  735.         var y = Moghunter.bresult_par2_y;       
  736.         this._par.bitmap.drawText(this._actor._level,x,y,100, 24, "right");
  737.         this._par.bitmap.drawText(this._actor.mhp,x,y + 32 * 1,100, 24, "right");
  738.         this._par.bitmap.drawText(this._actor.mmp,x,y + 32 * 2,100, 24, "right");
  739.         this._par.bitmap.drawText(this._actor.atk,x,y + 32 * 3,100, 24, "right");
  740.         this._par.bitmap.drawText(this._actor.def,x,y + 32 * 4,100, 24, "right");       
  741.         this._par.bitmap.drawText(this._actor.mat,x,y + 32 * 5,100, 24, "right");
  742.         this._par.bitmap.drawText(this._actor.mdf,x,y + 32 * 6,100, 24, "right");
  743.         this._par.bitmap.drawText(this._actor.agi,x,y + 32 * 7,100, 24, "right");
  744.         this.addChild(this._par);
  745. };

  746. //==============================
  747. // * Refresh New Skill
  748. //==============================
  749. BattleResult.prototype.refreshNewSkill = function() {
  750.         SoundManager.playUseSkill();
  751.     this.removeChild(this._skill);
  752.         this._skill = new Sprite();
  753.         this._skill.x = Moghunter.bresult_skill_x;
  754.         this._skill.y = Moghunter.bresult_skill_y;
  755.         this._skill.opacity = 0;
  756.         this.addChild(this._skill);
  757.         this.addIcon(this._skill,$gameTemp._bResult[5][this._skillIndex]);
  758.         this._skillIndex += 1;
  759.         this._skillAnime = [0,0];
  760. };

  761. //==============================
  762. // * dispose Level
  763. //==============================
  764. BattleResult.prototype.disposeLevel = function() {
  765.         this.removeChild(this._spriteActor);
  766.     this.removeChild(this._par);
  767.         this.removeChild(this._levelLayout);
  768.         this.removeChild(this._name);
  769.         this.removeChild(this._skill);
  770.         this._skill = null;
  771. };

  772. //==============================
  773. // * Update Animation
  774. //==============================
  775. BattleResult.prototype.updateLevelAnimation = function() {
  776.     this.updateLevelPosition();       
  777.     this._spriteActor.opacity += 10;
  778.         this._levelLayout.opacity += 10;
  779.         this._name.opacity  += 10;
  780.         this._par.opacity += 10;
  781.     if (this._skill) {this.updateSkillAnimation()};
  782.         if (this.pressAnyKey()) {
  783.                 if (this._skillIndex >= $gameTemp._bResult[5].length) {
  784.                 this.clearParData();
  785.                 } else {
  786.                         this.refreshNewSkill();
  787.                 };
  788.         };
  789. };

  790. //==============================
  791. // * Update Level Position
  792. //==============================
  793. BattleResult.prototype.updateLevelPosition = function() {
  794.         if (this._phaseAnime[0] === 0) {
  795.                 this._phaseAnime[0] = 1;
  796.                 this._spriteActor.x = -this._spriteActor.width + Moghunter.bresult_actor_x;
  797.                 this._par.x = this._spriteActor.width + Moghunter.bresult_actor_x;
  798.         };
  799.         this._spriteActor.x = this.sprite_move_to(this._spriteActor.x,Moghunter.bresult_actor_x,20);
  800.         this._spriteActor.y = Graphics.boxHeight - this._spriteActor.height + Moghunter.bresult_actor_y;
  801.         if (this._levelLayout.scale.x > 1.00) {
  802.                 this._levelLayout.scale.x -= 0.05;
  803.                 if (this._levelLayout.scale.x < 1.00) {this._levelLayout.scale.x = 1.00};       
  804.         };
  805.         this._par.x = this.sprite_move_to(this._par.x,Moghunter.bresult_par0_x,20);
  806.         this._par.y = Moghunter.bresult_par0_y;
  807. };

  808. //==============================
  809. // * Update Skill Animation
  810. //==============================
  811. BattleResult.prototype.updateSkillAnimation = function() {
  812.         this._skill.opacity += 10;
  813.         this._skillAnime[0] ++;
  814.         if (this._skillAnime[0] < 20) {
  815.                 this._skill.y -= 2;
  816.         } else if (this._skillAnime[0] < 40) {
  817.                 this._skill.y += 2;
  818.         };       
  819. };

  820. //==============================
  821. // * Sprite Move To
  822. //==============================
  823. BattleResult.prototype.sprite_move_to = function(value,real_value,speed) {
  824.         if (value == real_value) {return value};
  825.         var dnspeed = 5 + (Math.abs(value - real_value) / speed);
  826.         if (value > real_value) {value -= dnspeed;
  827.             if (value < real_value) {value = real_value};}
  828.     else if (value < real_value) {value  += dnspeed;
  829.             if (value  > real_value) {value  = real_value};               
  830.     };
  831.         return Math.floor(value);
  832. };

  833. //==============================
  834. // * clear Par DAta
  835. //==============================
  836. BattleResult.prototype.clearParData = function() {
  837.         this._actor = null;
  838.         this.disposeLevel();
  839.         this._skillIndex = 0;
  840.         $gameTemp._bResult[5] = [];
  841. };

  842. //==============================
  843. // * Gain EXP
  844. //==============================
  845. BattleResult.prototype.gainEXP = function() {
  846.          var actor = $gameParty.battleMembers()[this._actorIndex];
  847.          this._actopar = [actor._level,actor.mhp,actor.mmp,actor.atk,actor.def,actor.mat,actor.mdf,actor.agi];
  848.          var lvOld = actor._level
  849.      actor.gainExp($gameTemp._bResult[1]);
  850.      this._actorIndex += 1;
  851.          if (actor._level > lvOld) {
  852.                  this._actor = actor;
  853.                  this.createLevelSprites();
  854.                  SoundManager.playCursor();
  855.          } else {
  856.          this.clearParData();
  857.          };
  858. };

  859. //==============================
  860. // * Update Fade
  861. //==============================
  862. BattleResult.prototype.updateFade = function() {
  863.         this._layout.opacity -= 10;
  864.         for (var i = 0; i < this._expNumber.length; i++) {
  865.            this._expNumber[i].opacity = this._layout.opacity;
  866.         };       
  867.         for (var i = 0; i < this._goldNumber.length; i++) {
  868.            this._goldNumber[i].opacity = this._layout.opacity;
  869.         };
  870.         for (var i = 0; i < this._jpNumber.length; i++) {
  871.              this._jpNumber[i].opacity = this._layout.opacity;
  872.     };
  873.         for (var i = 0; i < this._treasures.length; i++) {
  874.              this._treasures[i].opacity = this._layout.opacity;
  875.     };
  876.         if (this._phase === 6 && this._layout.opacity <= 0) {
  877.        $gameTemp._bResult = [false,[],0,0,[]];;
  878.         };
  879. };

  880. //==============================
  881. // * Update End
  882. //==============================
  883. BattleResult.prototype.updateEnd = function() {
  884.         if (this._layout.opacity <= 0) {
  885.        $gameTemp._bResult = [false,[],0,0,[]];;
  886.         } else {
  887.            this.updateFade();
  888.         };
  889. };
复制代码

请自行制作Battle Result Layout界面,增加一个JP gain。另外如果不用Job Point千万不要用这个插件,一定会崩溃!
屏幕快照 2017-03-19 下午7.02.40.png

评分

参与人数 2星屑 +30 收起 理由
2577058272 + 20 塞糖
白嫩白嫩的 + 10 辛苦了,楼主大大!

查看全部评分

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部