查看: 1024|回复: 6

[有事请教] 战斗结算MOG_BattleResult 的问题

[复制链接]
梦石
0
星屑
1336
在线时间
158 小时
注册时间
2006-2-12
回帖
157
发表于 2023-7-18 16:33:14 | 显示全部楼层 |阅读模式

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

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

×
如图所示,这个战斗美化插件是用的一张png图作为界面,底下默认是“新技能”,但如果当前升级没有新技能学习,那个位置就是空的,有什么办法加入字符(比如写一个“空”、“无”字)进去那个位置呢?
  1. //=============================================================================
  2. // MOG_BattleResult.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.1) Modifies the display screen.定制战斗结果显示界面
  6. * @author Moghunter
  7. *
  8. * @param Exp X-Axis
  9. * @desc X-Axis position of EXP.
  10. * @default 760
  11. *
  12. * @param Exp Y-Axis
  13. * @desc Y-Axis position of EXP.
  14. * @default 160
  15. *
  16. * @param Gold X-Axis
  17. * @desc Position X-Axis of Gold.
  18. * @default 760
  19. *
  20. * @param Gold Y-Axis
  21. * @desc Position Y-Axis of Gold.
  22. * @default 230
  23. *
  24. * @param Treasure -Axis
  25. * @desc X-Axis position of the tersouro.
  26. * @default 32
  27. *
  28. * @param Treasure Y-Axis
  29. * @desc Position Y-Axis of the treasure.
  30. * @default 330
  31. *
  32. * @param Actor X-Axis
  33. * @desc X-Axis character position.
  34. * @default 250
  35. *
  36. * @param Actor Y-Axis
  37. * @desc Position Y-Axis character.
  38. * @default 0
  39. *
  40. * @param Real X-Axis Parameter
  41. * @desc X-Axis position of the parameters.
  42. * @default 0
  43. *
  44. * @param Real Y-Axis Parameter
  45. * @desc Y-Axis position of the parameters.
  46. * @default 0
  47. *
  48. * @param Parameter 1 X-Axis
  49. * @desc X-Axis position of the parameters before the level-up.
  50. * @default 550
  51. *
  52. * @param Parameter 1 Y-Axis
  53. * @desc Y-Axis position of the parameters before the level-up.
  54. * @default 140
  55. *
  56. * @param Parameter 2 X-Axis
  57. * @desc X-Axis position of the parameters after the level-up.
  58. * @default 700
  59. *
  60. * @param Parameter 2 Y-Axis
  61. * @desc Y-Axis position of the parameters after the level-up.
  62. * @default 140
  63. *
  64. * @param New Skill X-Axis
  65. * @desc X-Axis position of the new ability.
  66. * @default 570
  67. *
  68. * @param New Skill Y-Axis
  69. * @desc Position Y-Axis of the new ability.
  70. * @default 520
  71. *
  72. * @param Name X-Axis
  73. * @desc Position X-Axis of the character's name.
  74. * @default 155
  75. *
  76. * @param Name Y-Axis
  77. * @desc Position Y-Axis of the character's name.
  78. * @default 540
  79. *
  80. * @help
  81. * ================================================================= ============================
  82. * +++ MOG - Battle Result (v1.1) +++
  83. * By Moghunter
  84. * [url]https://atelierrgss.wordpress.com/[/url]
  85. * ================================================================= ============================
  86. * Modifies the display screen.定制战斗结果显示界面
  87. * ================================================================= ============================
  88. * The files will be needed. (Img/system/)
  89. * (img/system需要以下图片文件:)
  90. * Result_A.png
  91. * Result_B.png
  92. * Result_C.png
  93. * Result_D.png
  94. * Result_E.png
  95. *
  96. * ================================================================= ============================
  97. * ACTOR PICTURE
  98. * ================================================================= ============================
  99. * Images should be saved in the /img/picture/
  100. * Name the images as follows.
  101. * (角色图片需保存在/img/picture目录下.命名格式如下:)
  102. * Actor_ ID
  103. *
  104. * Example(比如:)
  105. * Actor_1.png
  106. * Actor_2.png
  107. * Actor_3.png
  108. * ...
  109. *
  110. * ================================================================= ============================
  111. * HISTORIC
  112. * ================================================================= ============================
  113. * (V1.1) - Correction of not displaying the status window in the next battle.
  114. *
  115. * 更多翻译插件:[url]https://github.com/misuqian/MVPlugins-CN[/url]
  116. */

  117. //=============================================================================
  118. // ** PLUGIN PARAMETERS
  119. //=============================================================================

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

  143. //=============================================================================
  144. // ** Game Temp
  145. //=============================================================================

  146. //==============================
  147. // ** Initialize
  148. //==============================
  149. var _mog_bresult_gtemp_initialize = Game_Temp.prototype.initialize;
  150. Game_Temp.prototype.initialize = function() {
  151.     _mog_bresult_gtemp_initialize.call(this);
  152.     this.battleResultClear()
  153. };

  154. //==============================
  155. // ** battle Result Clear
  156. //==============================
  157. Game_Temp.prototype.battleResultClear = function() {
  158.         this._bResult = [false,[],0,0,[]];
  159.         this._battleEnd = false;
  160. };

  161. //=============================================================================
  162. // ** Game Actor
  163. //=============================================================================

  164. //==============================
  165. // ** display LevelUP
  166. //==============================
  167. var _mog_bresult_gact_displayLevelUp = Game_Actor.prototype.displayLevelUp;
  168. Game_Actor.prototype.displayLevelUp = function(newSkills) {
  169.         if ($gameTemp._bResult[0]) {
  170.                 $gameTemp._bResult[4] = newSkills;
  171.                 return;
  172.         };
  173.         _mog_bresult_gact_displayLevelUp.call(this,newSkills);
  174. };


  175. //=============================================================================
  176. // ** BattleManager
  177. //=============================================================================

  178. //==============================
  179. // ** setup
  180. //==============================
  181. var _mog_brt_bmngr_setup = BattleManager.setup;
  182. BattleManager.setup = function(troopId, canEscape, canLose) {
  183.         _mog_brt_bmngr_setup.call(this,troopId, canEscape, canLose);
  184.         $gameTemp.battleResultClear();
  185. };

  186. //==============================
  187. // ** process Victory
  188. //==============================
  189. BattleManager.processVictory = function() {
  190.         if (Imported.MOG_BattleCry) {
  191.             var actor = this.randomActor();
  192.         if (actor) {SoundManager.selectVoice(actor._v_victory)};       
  193.         };
  194.         AudioManager.fadeOutBgm(1);
  195.         $gameTemp._battleEnd = true;
  196.         $gameTemp._battleResult = true;
  197.         this.getResultData();
  198.     $gameParty.removeBattleStates();
  199.     $gameParty.performVictory();
  200.         this.endBattle(0);       
  201. };


  202. //==============================
  203. // ** get Result Data
  204. //==============================
  205. BattleManager.getResultData = function() {
  206.          this.makeRewards();
  207.      $gameTemp._bResult[0] = true;         
  208.          $gameTemp._bResult[1] = this._rewards.exp;
  209.          $gameTemp._bResult[2] = this._rewards.gold;
  210.          $gameTemp._bResult[3] = this._rewards.items;
  211.          $gameTemp._bResult[4] = [];
  212. };

  213. //==============================
  214. // ** Update
  215. //==============================
  216. var _mog_bresult_update = BattleManager.update;
  217. BattleManager.update = function() {
  218.         if ($gameTemp._bResult[0]) {return};
  219.         _mog_bresult_update.call(this);
  220. };

  221. //=============================================================================
  222. // ** Scene Battle
  223. //=============================================================================

  224. //==============================
  225. // ** Terminate
  226. //==============================
  227. var _mog_bresult_terminate = Scene_Battle.prototype.terminate;
  228. Scene_Battle.prototype.terminate = function() {
  229.         _mog_bresult_terminate.call(this);
  230.         $gameTemp._bResult =  [false,[],0,0,[]];
  231. };

  232. //==============================
  233. // ** Update
  234. //==============================
  235. var _mog_bresult_sbat_update = Scene_Battle.prototype.update;
  236. Scene_Battle.prototype.update = function() {
  237.         _mog_bresult_sbat_update.call(this);
  238.         if ($gameTemp._bResult[0]) {this.updateBResult()};
  239. };

  240. //==============================
  241. // ** updateWindow Position
  242. //==============================
  243. var _mog_bresult_updateWindowPositions = Scene_Battle.prototype.updateWindowPositions;
  244. Scene_Battle.prototype.updateWindowPositions = function() {
  245.         _mog_bresult_updateWindowPositions.call(this);
  246.         if ($gameTemp._battleEnd) {
  247.                 this._statusWindow.opacity -= 10;
  248.             this._statusWindow.contentsOpacity -= 10;
  249.         };
  250. };

  251. //==============================
  252. // ** Update BResult
  253. //==============================
  254. Scene_Battle.prototype.updateBResult = function() {
  255.         if (!this._bresult) {this.createBResult()};
  256. };

  257. //==============================
  258. // ** createBresult
  259. //==============================
  260. Scene_Battle.prototype.createBResult = function() {
  261.         this._bresult = new BattleResult();
  262.         this.addChild(this._bresult);
  263. };

  264. //=============================================================================
  265. // * Battle Result
  266. //=============================================================================
  267. function BattleResult() {
  268.     this.initialize.apply(this, arguments);
  269. };

  270. BattleResult.prototype = Object.create(Sprite.prototype);
  271. BattleResult.prototype.constructor = BattleResult;

  272. //==============================
  273. // * Initialize
  274. //==============================
  275. BattleResult.prototype.initialize = function() {
  276.     Sprite.prototype.initialize.call(this);       
  277.         if (BattleManager._spriteset && BattleManager._spriteset.combo_sprite_data) {
  278.                 BattleManager._spriteset.combo_sprite_data[0] = 1;
  279.         };
  280.         this._phase = 0;
  281.         this._actorIndex = 0;
  282.         this._skillIndex = 0;
  283.         this.z = 50;
  284.         this._actor = null;
  285.         this._actopar = [];
  286.         this._playME = 10;
  287.         this.phaseAniClear();
  288.         this._phaseAnime[0] = 1;
  289.         this._phaseAnime[1] = 60;
  290.         this._numbeData = [-1,-1];
  291.         this.loadImages();
  292.         this.createObjects();
  293. };

  294. //==============================
  295. // * Phase Ani Clear
  296. //==============================
  297. BattleResult.prototype.phaseAniClear = function() {
  298.         this._phaseAnime = [0,0,0];
  299. };


  300. //==============================
  301. // * loadImages
  302. //==============================
  303. BattleResult.prototype.loadImages = function() {
  304.         this._icon_img = ImageManager.loadSystem("IconSet");
  305.         this._layout_img = ImageManager.loadSystem("Result_A");
  306.         this._number_img1 = ImageManager.loadSystem("Result_B");
  307.         this._number_img2 = ImageManager.loadSystem("Result_C");
  308.         this._layout2_img = ImageManager.loadSystem("Result_D");
  309.         this._vict_img = ImageManager.loadSystem("Result_E");
  310. };

  311. //==============================
  312. // * Press Any Key
  313. //==============================
  314. BattleResult.prototype.pressAnyKey = function() {
  315.     if (TouchInput.isTriggered()) {return true};
  316.         if (TouchInput.isCancelled()) {return true};
  317.         if (Input.isTriggered("ok")) {return true};
  318.         if (Input.isTriggered("cancel")) {return true};
  319.     return false;
  320. };

  321. //==============================
  322. // * Create Objects
  323. //==============================
  324. BattleResult.prototype.createObjects = function() {
  325.         this.createVict();
  326.         this.createLayout();
  327.         this.createExp();
  328.         this.createGold();
  329.         this.createTreasures();
  330. };

  331. //==============================
  332. // * Create Vict
  333. //==============================
  334. BattleResult.prototype.createVict = function() {
  335.         this._vict = new Sprite(this._vict_img);
  336.         this._vict.opacity = 0;
  337.         this._vict.scale.x = 3.0;
  338.         this._vict.scale.y = 3.0;
  339.         this._vict.anchor.x = 0.5;
  340.         this._vict.anchor.y = 0.5;
  341.         this._vict.x = Graphics.boxWidth / 2;
  342.         this._vict.y = Graphics.boxHeight / 2;
  343.         this.addChild(this._vict);
  344. };

  345. //==============================
  346. // * Create Layout
  347. //==============================
  348. BattleResult.prototype.createLayout = function() {
  349.         this._layout = new Sprite(this._layout_img);
  350.         this._layout.opacity = 0;
  351.         this._layout.scale.x = 3.0;
  352.         this._layout.anchor.x = 0.5;
  353.         this._layout.x = Graphics.boxWidth / 2;
  354.         this.addChild(this._layout);
  355. };

  356. //==============================
  357. // * Create Exp
  358. //==============================
  359. BattleResult.prototype.createExp = function() {
  360.     this._expNumber = [];
  361.         this._expOld = 0;
  362.         this._expOrg = [Moghunter.bresult_exp_x,Moghunter.bresult_exp_y];
  363.         for (var i = 0; i < 8; i++) {
  364.            this._expNumber[i] = new Sprite(this._number_img1);
  365.            this._expNumber[i].visible = false;
  366.            this._expNumber[i].x = this._expOrg[0];
  367.            this._expNumber[i].y = this._expOrg[1];
  368.            this.addChild(this._expNumber[i]);
  369.         };               
  370.        
  371. };

  372. //==============================
  373. // * Create Gold
  374. //==============================
  375. BattleResult.prototype.createGold = function() {
  376.     this._goldNumber = [];
  377.     this._goldNumber = [];
  378.         this._goldOld = 0;
  379.         this._goldOrg = [Moghunter.bresult_gold_x,Moghunter.bresult_gold_y];
  380.         for (var i = 0; i < 8; i++) {
  381.            this._goldNumber[i] = new Sprite(this._number_img1);
  382.            this._goldNumber[i].visible = false;
  383.            this._goldNumber[i].x = this._goldOrg[0];
  384.            this._goldNumber[i].y = this._goldOrg[1];
  385.            this.addChild(this._goldNumber[i]);
  386.         };       
  387. };

  388. //==============================
  389. // * Add ICon
  390. //==============================
  391. BattleResult.prototype.addIcon = function(sprite,data) {
  392.         var icon = new Sprite(this._icon_img);
  393.         var w = Window_Base._iconWidth;
  394.         var h = Window_Base._iconHeight;
  395.         var sx = data.iconIndex % 16 * w;
  396.         var sy = Math.floor(data.iconIndex / 16) * h;
  397.     icon.setFrame(sx,sy,w,h);
  398.     sprite.addChild(icon);
  399.         var name = new Sprite(new Bitmap(160,32));
  400.         name.bitmap.drawText(data.name,0,0,160,32);
  401.         name.x = w + 4;
  402.         sprite.addChild(name);
  403. };

  404. //==============================
  405. // * Create Treasures
  406. //==============================
  407. BattleResult.prototype.createTreasures = function() {
  408.         this._treasures = [];
  409.         var x = Moghunter.bresult_treasure_x;
  410.         var y = Moghunter.bresult_treasure_y;
  411.         var s = Graphics.boxWidth - 64;
  412.         var w = (s / 3);
  413.         var h = Window_Base._iconHeight + 4;
  414.         for (var i = 0; i < $gameTemp._bResult[3].length; i++) {
  415.               this._treasures[i] = new Sprite();
  416.                   this._treasures[i].opacity = 0;
  417.                   this.addChild(this._treasures[i]);
  418.                   var l = Math.floor(i / 3);
  419.                   this._treasures[i].x = x + (w * i) - Math.floor(l * s);
  420.                   this._treasures[i].y = y + (l * h);
  421.                   this.addIcon(this._treasures[i],$gameTemp._bResult[3][i]);
  422.         };      
  423. };

  424. //==============================
  425. // * getData
  426. //==============================
  427. BattleResult.prototype.getData = function() {
  428.     this._numbeData[0] = this._number_img1.width / 10;
  429.     this._numbeData[1] = this._number_img1.height;
  430. };

  431. //==============================
  432. // * Update Dif
  433. //==============================
  434. BattleResult.prototype.update_dif = function(value,real_value,speed) {
  435.         if (value == real_value) {return value};
  436.         var dnspeed = 1 + (Math.abs(value - real_value) / speed);
  437.         if (value > real_value) {value -= dnspeed;
  438.             if (value < real_value) {value = real_value};}
  439.     else if (value < real_value) {value  += dnspeed;
  440.             if (value  > real_value) {value  = real_value};               
  441.     };
  442.         return Math.floor(value);
  443. };

  444. //==============================
  445. // * Refresh Number
  446. //==============================
  447. BattleResult.prototype.refresh_number = function(sprites,value,img_data,x,center) {
  448.     numbers = Math.abs(value).toString().split("");  
  449.            for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  450.            if (i > numbers.length) {return};
  451.            var n = Number(numbers[i]);
  452.            sprites[i].setFrame(n * img_data[0], 0, img_data[0], img_data[1]);
  453.            sprites[i].visible = true;
  454.            if (center === 0) {
  455.                 var nx = -(img_data[0] * i) + (img_data[0] * numbers.length);
  456.            } else {
  457.                    var nx = -(img_data[0] * i) + ((img_data[0] / 2) * numbers.length);
  458.            };
  459.            sprites[i].x = x - nx;
  460.     };       
  461. };

  462. //==============================
  463. // * Update
  464. //==============================
  465. BattleResult.prototype.update = function() {
  466.         Sprite.prototype.update.call(this);         
  467.         if (this._numbeData[0] === -1 && this._number_img1.isReady() && this._number_img2.isReady()) {this.getData()};
  468.         if (this._numbeData[0] === -1) {return};
  469.         if (this._phaseAnime[1] > 0) {this._phaseAnime[1] --;return};
  470.         if (this._playME > 0) {this.updateME()};
  471.     switch (this._phase) {
  472.                 case 0:
  473.             this.updateStart();
  474.             break;               
  475.         case 1:
  476.             this.updateExp();
  477.             break;
  478.         case 2:
  479.             this.updateGold();
  480.             break;
  481.         case 3:
  482.             this.updateTreasure();
  483.             break;
  484.         case 4:
  485.             this.updateLevel();
  486.             break;
  487.         case 5:
  488.             this.updateEnd();
  489.             break;                       
  490.         };
  491. };


  492. //==============================
  493. // * update ME
  494. //==============================
  495. BattleResult.prototype.updateME = function() {
  496.         this._playME --
  497.         if (this._playME === 0) {
  498.                 BattleManager.playVictoryMe();
  499.                 BattleManager.replayBgmAndBgs();       
  500.         };
  501. };

  502. //==============================
  503. // * Update Start
  504. //==============================
  505. BattleResult.prototype.updateStart = function() {
  506.         if (this._phaseAnime[0] > 0) {
  507.         this.updateVictAnimation();
  508.     } else {
  509.         this.updateLayoutAnimation();
  510.         };
  511. };


  512. //==============================
  513. // * Update Layout Animation
  514. //==============================
  515. BattleResult.prototype.updateLayoutAnimation = function() {
  516.         this._layout.opacity += 5;
  517.         if (this._layout.scale.x > 1.00) {
  518.                 this._layout.scale.x -= 0.05;
  519.                 if (this._layout.scale.x < 1.00) {this._layout.scale.x = 1.00};
  520.         } else {
  521.                 this.phaseAniClear();
  522.                 this._phase = 1;
  523.         };
  524. };

  525. //==============================
  526. // * Update Vict Animation
  527. //==============================
  528. BattleResult.prototype.updateVictAnimation = function() {
  529.            if (this._phaseAnime[0] === 1) {
  530.                     if (this._vict.scale.x > 1.00) {
  531.                                 this._vict.scale.x -= 0.05;
  532.                                 this._vict.opacity += 15;
  533.                                 if (this._vict.scale.x <= 1.00) {
  534.                                         this._vict.scale.x = 1.00;
  535.                                         this._vict.opacity = 255;
  536.                                         this._phaseAnime[0] = 2;
  537.                                         this._phaseAnime[1] = 40;
  538.                                 };
  539.                         };
  540.            } else {
  541.                     if (this._vict.scale.x < 3.00) {
  542.                                 this._vict.scale.x += 0.05;
  543.                                 this._vict.opacity -= 10;
  544.                                 if (this._vict.scale.x >= 3.00) {
  545.                                         this._vict.scale.x = 3.00;
  546.                                         this._vict.opacity = 0;
  547.                                         this._phaseAnime[0] = 0;
  548.                                 };
  549.                         };                  
  550.            };
  551.            this._vict.scale.y = this._vict.scale.x;
  552. };

  553. //==============================
  554. // * Update Exp
  555. //==============================
  556. BattleResult.prototype.updateExp = function() {
  557.          if (this.pressAnyKey() &&  $gameTemp._bResult[1] > 0) {
  558.          this._expOld = $gameTemp._bResult[1] - 1;
  559.          };
  560.          var dif_number = this.update_dif(this._expOld,$gameTemp._bResult[1],15);
  561.          if (this._expOld != dif_number) {this._expOld = dif_number;
  562.          this.refresh_number(this._expNumber,this._expOld,this._numbeData,this._expOrg[0],0)};
  563.          if (this._expOld === $gameTemp._bResult[1]) {
  564.                  this.phaseAniClear();
  565.                  this._phase = 2;
  566.                  SoundManager.playCursor();         
  567.          };
  568. };

  569. //==============================
  570. // * Update Gold
  571. //==============================
  572. BattleResult.prototype.updateGold = function() {
  573.          if (this.pressAnyKey() &&  $gameTemp._bResult[1] > 0) {
  574.          this._goldOld = $gameTemp._bResult[2] - 1;
  575.          };
  576.          var dif_number = this.update_dif(this._goldOld,$gameTemp._bResult[2],15);
  577.          if (this._goldOld != dif_number) {this._goldOld = dif_number;
  578.          this.refresh_number(this._goldNumber,this._goldOld,this._numbeData,this._goldOrg[0],0)};
  579.          if (this._goldOld === $gameTemp._bResult[2]) {
  580.                  BattleManager.gainGold();
  581.                  this.phaseAniClear();
  582.                  this._phase = 3;
  583.                  SoundManager.playCursor();
  584.          };
  585. };

  586. //==============================
  587. // * Update Treasure
  588. //==============================
  589. BattleResult.prototype.updateTreasure = function() {
  590.         if (this._treasures.length > 0) {
  591.                 for (var i = 0; i < this._treasures.length; i++) {
  592.                         this._treasures[i].opacity += 10;
  593.                 };
  594.                 if (this._treasures[0].opacity >= 255 && this._phaseAnime[0] === 0) {
  595.                         this._phaseAnime[0] = 1;
  596.                 };       
  597.         } else {
  598.             this._phaseAnime[0] = 1;
  599.         };
  600.         if (this._phaseAnime[0] === 1 && this.pressAnyKey()) {
  601.                 BattleManager.gainDropItems();
  602.                 this.phaseAniClear();
  603.                 this._phase = 4;
  604.         };
  605. };

  606. //==============================
  607. // * Update Level
  608. //==============================
  609. BattleResult.prototype.updateLevel = function() {
  610.         if (this._layout.opacity > 0) {this.updateFade()};
  611.         if (!this._actor && this._actorIndex >= $gameParty.battleMembers().length) {
  612.                 this._phase = 5;
  613.                 SoundManager.playCursor();
  614.         } else {
  615.                 if (this._actor) {
  616.                         this.updateLevelAnimation();
  617.                 } else {
  618.                         this.gainEXP();
  619.                 };
  620.         };
  621. };

  622. //==============================
  623. // * Create Level Sprites
  624. //==============================
  625. BattleResult.prototype.createLevelSprites = function() {
  626.         this.disposeLevel();
  627.         this._phaseAnime[0] = 0;
  628.         this._phaseAnime[1] = 10;
  629.         this.createActorSprite();
  630.     this.createLevelLayout();   
  631.     this.createParameters();
  632.     this.createActorName();
  633.         this.playVoice();
  634. };

  635. //==============================
  636. // * Play Voice
  637. //==============================
  638. BattleResult.prototype.playVoice = function() {
  639.         if (Imported.MOG_BattleCry) {SoundManager.selectVoice(this._actor._v_levelup)};
  640. };

  641. //==============================
  642. // * Create Level Layout
  643. //==============================
  644. BattleResult.prototype.createLevelLayout = function() {
  645.         this._levelLayout = new Sprite(this._layout2_img);
  646.         this._levelLayout.opacity = 0;
  647.         this._levelLayout.anchor.x = 0.5;
  648.         this._levelLayout.anchor.y = 0.5;
  649.         this._levelLayout.x = Graphics.boxWidth / 2;
  650.         this._levelLayout.y = Graphics.boxHeight / 2;
  651.         this._levelLayout.scale.x = 3.0;
  652.         this.addChild(this._levelLayout);       
  653. };

  654. //==============================
  655. // * Create Actor Name
  656. //==============================
  657. BattleResult.prototype.createActorName = function() {
  658.         this._name = new Sprite(new Bitmap(140,32));
  659.         this._name.opacity = 0;
  660.         this._name.bitmap.drawText(this._actor._name,0,0,140,32);
  661.         this._name.x = Moghunter.bresult_name_x;
  662.         this._name.y = Moghunter.bresult_name_y;
  663.         this.addChild(this._name);       
  664. };

  665. //==============================
  666. // * Create Actor Sprite
  667. //==============================
  668. BattleResult.prototype.createActorSprite = function() {
  669.         var img = ImageManager.loadPicture("Actor_" + this._actor._actorId)
  670.         this._spriteActor = new Sprite(img);
  671.         this._spriteActor.opacity = 0;
  672.         this._spriteActor.anchor.x = 0.5;
  673.         this.addChild(this._spriteActor);
  674. };

  675. //==============================
  676. // * Create Parameters
  677. //==============================
  678. BattleResult.prototype.createParameters = function() {
  679.         var x = Moghunter.bresult_par1_x;
  680.         var y = Moghunter.bresult_par1_y;
  681.         this._par = new Sprite(new Bitmap(Graphics.boxWidth,Graphics.boxHeight));
  682.         this._par.opacity = 0;
  683.         this._par.bitmap.drawText(this._actopar[0],x,y,100,32);
  684.         this._par.bitmap.drawText(this._actopar[1],x,y + 32 * 1,100,32);
  685.         this._par.bitmap.drawText(this._actopar[2],x,y + 32 * 2,100,32);
  686.         this._par.bitmap.drawText(this._actopar[3],x,y + 32 * 3,100,32);
  687.         this._par.bitmap.drawText(this._actopar[4],x,y + 32 * 4,100,32);       
  688.         this._par.bitmap.drawText(this._actopar[5],x,y + 32 * 5,100,32);
  689.         this._par.bitmap.drawText(this._actopar[6],x,y + 32 * 6,100,32);
  690.         this._par.bitmap.drawText(this._actopar[7],x,y + 32 * 7,100,32);
  691.         this._par.bitmap.drawText(this._actopar[8],x,y + 32 * 8,100,32);
  692.         var x = Moghunter.bresult_par2_x;
  693.         var y = Moghunter.bresult_par2_y;       
  694.         this._par.bitmap.drawText(this._actor._level,x,y,100,32);
  695.         this._par.bitmap.drawText(this._actor.mhp,x,y + 32 * 1,100,32);
  696.         this._par.bitmap.drawText(this._actor.mmp,x,y + 32 * 2,100,32);
  697.         this._par.bitmap.drawText(this._actor.atk,x,y + 32 * 3,100,32);
  698.         this._par.bitmap.drawText(this._actor.def,x,y + 32 * 4,100,32);       
  699.         this._par.bitmap.drawText(this._actor.mat,x,y + 32 * 5,100,32);
  700.         this._par.bitmap.drawText(this._actor.mdf,x,y + 32 * 6,100,32);
  701.         this._par.bitmap.drawText(this._actor.agi,x,y + 32 * 7,100,32);
  702.         this._par.bitmap.drawText(this._actor.luk,x,y + 32 * 8,100,32);       
  703.         this.addChild(this._par);
  704. };

  705. //==============================
  706. // * Refresh New Skill
  707. //==============================
  708. BattleResult.prototype.refreshNewSkill = function() {
  709.         SoundManager.playUseSkill();
  710.     this.removeChild(this._skill);
  711.         this._skill = new Sprite();
  712.         this._skill.x = Moghunter.bresult_skill_x;
  713.         this._skill.y = Moghunter.bresult_skill_y;
  714.         this._skill.opacity = 0;
  715.         this.addChild(this._skill);
  716.     this.addIcon(this._skill,$gameTemp._bResult[4][this._skillIndex]);
  717.         this._skillIndex += 1;
  718.         this._skillAnime = [0,0];
  719. };

  720. //==============================
  721. // * dispose Level
  722. //==============================
  723. BattleResult.prototype.disposeLevel = function() {
  724.         this.removeChild(this._spriteActor);
  725.     this.removeChild(this._par);
  726.         this.removeChild(this._levelLayout);
  727.         this.removeChild(this._name);
  728.         this.removeChild(this._skill);
  729.         this._skill = null;
  730. };

  731. //==============================
  732. // * Update Animation
  733. //==============================
  734. BattleResult.prototype.updateLevelAnimation = function() {
  735.     this.updateLevelPosition();       
  736.     this._spriteActor.opacity += 10;
  737.         this._levelLayout.opacity += 10;
  738.         this._name.opacity  += 10;
  739.         this._par.opacity += 10;
  740.     if (this._skill) {this.updateSkillAnimation()};
  741.         if (this.pressAnyKey()) {
  742.                 if (this._skillIndex >= $gameTemp._bResult[4].length) {
  743.                 this.clearParData();
  744.                 } else {
  745.                         this.refreshNewSkill();
  746.                 };
  747.         };
  748. };

  749. //==============================
  750. // * Update Level Position
  751. //==============================
  752. BattleResult.prototype.updateLevelPosition = function() {
  753.         if (this._phaseAnime[0] === 0) {
  754.                 this._phaseAnime[0] = 1;
  755.                 this._spriteActor.x = -this._spriteActor.width + Moghunter.bresult_actor_x;
  756.                 this._par.x = this._spriteActor.width + Moghunter.bresult_actor_x;
  757.         };
  758.         this._spriteActor.x = this.sprite_move_to(this._spriteActor.x,Moghunter.bresult_actor_x,20);
  759.         this._spriteActor.y = Graphics.boxHeight - this._spriteActor.height + Moghunter.bresult_actor_y;
  760.         if (this._levelLayout.scale.x > 1.00) {
  761.                 this._levelLayout.scale.x -= 0.05;
  762.                 if (this._levelLayout.scale.x < 1.00) {this._levelLayout.scale.x = 1.00};       
  763.         };
  764.         this._par.x = this.sprite_move_to(this._par.x,Moghunter.bresult_par0_x,20);
  765.         this._par.y = Moghunter.bresult_par0_y;
  766. };

  767. //==============================
  768. // * Update Skill Animation
  769. //==============================
  770. BattleResult.prototype.updateSkillAnimation = function() {
  771.         this._skill.opacity += 10;
  772.         this._skillAnime[0] ++;
  773.         if (this._skillAnime[0] < 20) {
  774.                 this._skill.y -= 2;
  775.         } else if (this._skillAnime[0] < 40) {
  776.                 this._skill.y += 2;
  777.         };       
  778. };

  779. //==============================
  780. // * Sprite Move To
  781. //==============================
  782. BattleResult.prototype.sprite_move_to = function(value,real_value,speed) {
  783.         if (value == real_value) {return value};
  784.         var dnspeed = 5 + (Math.abs(value - real_value) / speed);
  785.         if (value > real_value) {value -= dnspeed;
  786.             if (value < real_value) {value = real_value};}
  787.     else if (value < real_value) {value  += dnspeed;
  788.             if (value  > real_value) {value  = real_value};               
  789.     };
  790.         return Math.floor(value);
  791. };

  792. //==============================
  793. // * clear Par DAta
  794. //==============================
  795. BattleResult.prototype.clearParData = function() {
  796.         this._actor = null;
  797.         this.disposeLevel();
  798.         this._skillIndex = 0;
  799.         $gameTemp._bResult[4] = [];
  800. };

  801. //==============================
  802. // * Gain EXP
  803. //==============================
  804. BattleResult.prototype.gainEXP = function() {
  805.          var actor = $gameParty.battleMembers()[this._actorIndex];
  806.          this._actopar = [actor._level,actor.mhp,actor.mmp,actor.atk,actor.def,actor.mat,actor.mdf,actor.agi,actor.luk];
  807.          var lvOld = actor._level
  808.      actor.gainExp($gameTemp._bResult[1]);
  809.      this._actorIndex += 1;
  810.          if (actor._level > lvOld) {
  811.                  this._actor = actor;
  812.                  this.createLevelSprites();
  813.                  SoundManager.playCursor();
  814.          } else {
  815.          this.clearParData();
  816.          };
  817. };

  818. //==============================
  819. // * Update Fade
  820. //==============================
  821. BattleResult.prototype.updateFade = function() {
  822.         this._layout.opacity -= 10;
  823.         for (var i = 0; i < this._expNumber.length; i++) {
  824.            this._expNumber[i].opacity = this._layout.opacity;
  825.         };       
  826.         for (var i = 0; i < this._goldNumber.length; i++) {
  827.            this._goldNumber[i].opacity = this._layout.opacity;
  828.         };
  829.         for (var i = 0; i < this._treasures.length; i++) {
  830.              this._treasures[i].opacity = this._layout.opacity;
  831.     };
  832.         if (this._phase === 5 && this._layout.opacity <= 0) {
  833.        $gameTemp._bResult = [false,[],0,0,[]];;
  834.         };
  835. };

  836. //==============================
  837. // * Update End
  838. //==============================
  839. BattleResult.prototype.updateEnd = function() {
  840.         if (this._layout.opacity <= 0) {
  841.        $gameTemp._bResult = [false,[],0,0,[]];;
  842.         } else {
  843.            this.updateFade();
  844.         };
  845. };
复制代码
WechatIMG481.jpg
梦石
0
星屑
5487
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-7-18 17:28:15 | 显示全部楼层
代码在177到180那几行,你自己改改就行
回复

使用道具 举报

梦石
0
星屑
1336
在线时间
158 小时
注册时间
2006-2-12
回帖
157
 楼主| 发表于 2023-7-18 22:09:31 | 显示全部楼层
余杭 发表于 2023-7-18 17:28
代码在177到180那几行,你自己改改就行

求点拨一下思路  因为我是部分级别有新技能的(比如2级、5级)那么当3级、4级没有新技能的时候才需要显示“无”字 这样~ 谢谢
回复

使用道具 举报

梦石
0
星屑
5274
在线时间
733 小时
注册时间
2013-1-18
回帖
525
发表于 2023-7-19 11:49:49 | 显示全部楼层
douqunbo 发表于 2023-7-18 22:09
求点拨一下思路  因为我是部分级别有新技能的(比如2级、5级)那么当3级、4级没有新技能的时候 ...

3,4级都学一个名字为<无>的技能,然后公共事件里判定某某角色达到3,4级后,自动删除一个<无>的技能。

我不会插件,我只能这么想了
回复 0 1

使用道具 举报

梦石
0
星屑
5487
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-7-19 13:40:28 | 显示全部楼层
douqunbo 发表于 2023-7-18 22:09
求点拨一下思路  因为我是部分级别有新技能的(比如2级、5级)那么当3级、4级没有新技能的时候 ...

177和178之间加一行代码,这个后面的    无    ,就是你想要显示的文字


  1. if (newSkills.length === 0) newSkills.push({name:"无"});
复制代码

点评

还是技术大佬牛B啊!  发表于 2023-7-19 18:35
回复

使用道具 举报

梦石
0
星屑
1336
在线时间
158 小时
注册时间
2006-2-12
回帖
157
 楼主| 发表于 2023-7-20 12:21:12 | 显示全部楼层
余杭 发表于 2023-7-19 13:40
177和178之间加一行代码,这个后面的    无    ,就是你想要显示的文字

膜拜大佬,解决了感谢!
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部