查看: 3583|回复: 0

[已经解决] soulsaga

[复制链接]
梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-7-28 14:10:47 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 j296196585 于 2017-7-30 10:46 编辑

MOG_EnemyHP请问如何破限
最大显示6位数 根本太少了吗 可以破限显示更多吗


  1. //=============================================================================
  2. // MOG_EnemyHP.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.4) Apresenta o HP do inimigo ao ataca-lo.
  6. * @author Moghunter
  7. *
  8. * @param EHP Fade Duration
  9. * @desc Definição do tempo para ativar o fade.
  10. * (Default = 120)
  11. * @default 120
  12. *
  13. * @param EHP Layout X-Axis
  14. * @desc Posição X-Axis do layout.
  15. * @default 0
  16. *
  17. * @param EHP Layout Y-Axis
  18. * @desc Posição Y-Axis do layout.
  19. * @default 0
  20. *
  21. * @param EHP Meter X-Axis
  22. * @desc Posição X-Axis do medidor.
  23. * @default 4
  24. *
  25. * @param EHP Meter Y-Axis
  26. * @desc Posição Y-Axis do medidor.
  27. * @default 2
  28. +
  29. * @help  
  30. * =============================================================================
  31. * +++ MOG - Enemy HP Meter (v1.4) +++
  32. * By Moghunter
  33. * [url]https://atelierrgss.wordpress.com/[/url]
  34. * =============================================================================
  35. * Apresenta o HP do inimigo ao ataca-lo.
  36. * Serão necessários os arquivos. (img/system/)
  37. *
  38. * EnemyHP_A.png
  39. * EnemyHP_B.png
  40. *
  41. * Para ocultar o HP do inimigo use a seguinte Tag na caixa de notas
  42. *
  43. * Hide HP
  44. *
  45. * =============================================================================
  46. * ** Histórico **
  47. * =============================================================================
  48. * (v1.4) Melhoria na compatibilidade de plugins.   
  49. * (v1.3) Correção do Crash relativo as Notetags.  
  50. * (v1.2) Melhoria na codificação.
  51. * (v1.1) - Melhoria na animação do medidor vermelho.
  52. *      - Mudança da Tag para ocular o hp para HIDE HP.
  53. *      - Melhoria na codificação.
  54. */

  55. //=============================================================================
  56. // ** PLUGIN PARAMETERS
  57. //=============================================================================
  58.   var Imported = Imported || {};
  59.   Imported.MOG_EnemyHP = true;
  60.   var Moghunter = Moghunter || {};

  61.    Moghunter.parameters = PluginManager.parameters('MOG_EnemyHP');
  62.     Moghunter.enemyhp_a_x = Number(Moghunter.parameters['EHP Layout X-Axis'] || 0);
  63.     Moghunter.enemyhp_a_y = Number(Moghunter.parameters['EHP Layout Y-Axis'] || 0);
  64.     Moghunter.enemyhp_b_x = Number(Moghunter.parameters['EHP Meter X-Axis'] || 4);
  65.     Moghunter.enemyhp_b_y = Number(Moghunter.parameters['EHP Meter Y-Axis'] || 2);       
  66.     Moghunter.enemyhp_duration = Number(Moghunter.parameters['EHP Fade Duration'] || 120);

  67. //=============================================================================
  68. // ** Game Battler
  69. //=============================================================================

  70. //==============================
  71. // * Notetags
  72. //==============================
  73. Game_Battler.prototype.notetags = function() {
  74.         if (this.isEnemy()) {return this.enemy().note.split(/[\r\n]+/)};
  75.         if (this.isActor()) {return this.actor().note.split(/[\r\n]+/)};
  76. };

  77. //=============================================================================
  78. // ** Game_Enemy
  79. //=============================================================================

  80. //==============================
  81. // * Setup
  82. //==============================
  83. var _alias_mog_gba_setup = Game_Enemy.prototype.setup;
  84. Game_Enemy.prototype.setup = function(enemyId, x, y) {
  85.         _alias_mog_gba_setup.call(this,enemyId, x, y);
  86.         this._hp_meter = true
  87.         for (var i = 0; i < this.notetags().length; i++) {
  88.                 if (this.notetags()[i] == "Hide HP") {this._hp_meter = false};
  89.         };               
  90. };

  91. //=============================================================================
  92. // ** Spriteset_Battle
  93. //=============================================================================       

  94. //==============================
  95. // * CreateLowerLayer
  96. //==============================
  97. var _alias_mog_enemyhp_createUpperLayer = Spriteset_Battle.prototype.createUpperLayer
  98. Spriteset_Battle.prototype.createUpperLayer = function() {
  99.         this.create_ehp_sprites();
  100.         _alias_mog_enemyhp_createUpperLayer.call(this);       
  101. };

  102. //==============================
  103. // * Update
  104. //==============================
  105. var _alias_mog_enemyhp_update = Spriteset_Battle.prototype.update
  106. Spriteset_Battle.prototype.update = function() {
  107.         _alias_mog_enemyhp_update.call(this);
  108.         this.update_ehp_sprites();
  109. };

  110. //==============================
  111. // * Create EHP Sprites
  112. //==============================
  113. Spriteset_Battle.prototype.create_ehp_sprites = function() {
  114.         this._ehp_sprites_a = [];
  115.         this._ehp_sprites_b = [];
  116.         this._ehp_sprites_c = [];
  117.         this._ehp_sprites_data = [];
  118.     for (var i = 0; i < this._enemySprites.length; i++) {
  119.                 if (this._enemySprites[i]._battler == null) {return;};
  120.         this._ehp_sprites_a[i] = new Sprite(ImageManager.loadSystem("EnemyHP_A"));
  121.                 this._ehp_sprites_b[i] = new Sprite(ImageManager.loadSystem("EnemyHP_B"));
  122.                 this._ehp_sprites_c[i] = new Sprite(ImageManager.loadSystem("EnemyHP_B"));
  123.         this._ehp_sprites_a[i].opacity = 0;
  124.                 this._ehp_sprites_b[i].opacity = 0;
  125.                 this._ehp_sprites_c[i].opacity = 0;               
  126.                 this._ehp_sprites_a[i].z = 50;
  127.                 this._ehp_sprites_b[i].z = 51;
  128.                 this._ehp_sprites_c[i].z = 52;
  129.                 if (!this._enemySprites[i]._battler._hp_meter) {this._ehp_sprites_a[i].visible = false};
  130.                 this._ehp_sprites_b[i].visible = this._ehp_sprites_a[i].visible
  131.                 this._ehp_sprites_c[i].visible = this._ehp_sprites_a[i].visible
  132.                 this._battleField.addChild(this._ehp_sprites_a[i]);
  133.                 this._battleField.addChild(this._ehp_sprites_b[i]);       
  134.                 this._battleField.addChild(this._ehp_sprites_c[i]);       
  135.                 this._ehp_sprites_data[i] = [this._enemySprites[i]._battler.hp,0,0,Math.max(Moghunter.enemyhp_duration,32),this._enemySprites[i]._battler.hp,];
  136.     };
  137. };

  138. //==============================
  139. // * Update EHP Sprites
  140. //==============================
  141. Spriteset_Battle.prototype.update_ehp_sprites = function() {
  142.         for (var i = 0; i < this._enemySprites.length; i++) {
  143.                 if (this._ehp_sprites_a[i] == null) {return;};
  144.                 if (!this._ehp_sprites_a[i].bitmap.isReady()) {return};               
  145.                 this._ehp_sprites_a[i].x = this._enemySprites[i].x + Moghunter.enemyhp_a_x +this._ehp_sprites_data[i][1] - (this._ehp_sprites_a[i].bitmap.width / 2);
  146.                 this._ehp_sprites_a[i].y = this._enemySprites[i].y + Moghunter.enemyhp_a_y;
  147.                 this._ehp_sprites_b[i].x = this._ehp_sprites_a[i].x + Moghunter.enemyhp_b_x;
  148.                 this._ehp_sprites_b[i].y = this._ehp_sprites_a[i].y + Moghunter.enemyhp_b_y;
  149.                 this._ehp_sprites_c[i].x = this._ehp_sprites_a[i].x + Moghunter.enemyhp_b_x;
  150.                 this._ehp_sprites_c[i].y = this._ehp_sprites_a[i].y + Moghunter.enemyhp_b_y;               
  151.                 this._ehp_sprites_b[i].opacity = this._ehp_sprites_a[i].opacity;
  152.                 this._ehp_sprites_c[i].opacity = this._ehp_sprites_a[i].opacity;
  153.                 this.update_ehp_red_bar(i);
  154.                 this.update_ehp_blue_bar(i)        ;
  155.     };
  156. };

  157. //==============================
  158. // * Update EHP Blue Bar
  159. //==============================
  160. Spriteset_Battle.prototype.update_ehp_blue_bar = function(i) {
  161.                 if (this._enemySprites[i]._battler.isDead()) {
  162.                         this._ehp_sprites_a[i].opacity -= 2;
  163.                 };
  164.                 if (this._ehp_sprites_data[i][2] > 0) {
  165.                         this._ehp_sprites_data[i][2] -= 1
  166.                 };                 
  167.                 if (this._ehp_sprites_data[i][2] > this._ehp_sprites_data[i][3]) {
  168.                         this._ehp_sprites_data[i][1] += 2;
  169.                         this._ehp_sprites_a[i].opacity += 17
  170.                 } else {
  171.                         if (this._ehp_sprites_data[i][1] < 30 && this._ehp_sprites_data[i][2] <= 15) {
  172.                                 this._ehp_sprites_data[i][1] += 2;this._ehp_sprites_a[i].opacity -= 17
  173.                         };
  174.                 }               
  175.                 if (this._ehp_sprites_data[i][0] != this._enemySprites[i]._battler.hp) {               
  176.                
  177.                         if (this._ehp_sprites_data[i][2] > 15 && this._ehp_sprites_data[i][2] <= this._ehp_sprites_data[i][3]) {
  178.                                 this._ehp_sprites_data[i][2] = this._ehp_sprites_data[i][3]
  179.                         } else {
  180.                                 this._ehp_sprites_data[i][1] = -30;
  181.                                 this._ehp_sprites_data[i][2] = this._ehp_sprites_data[i][3] + 15;
  182.                         }                               
  183.                 }
  184.                 this._ehp_sprites_data[i][0] = this._enemySprites[i]._battler.hp;                    
  185.                 var meter_rate = this._ehp_sprites_c[i].bitmap.width * this._enemySprites[i]._battler.hp / this._enemySprites[i]._battler.mhp;
  186.             this._ehp_sprites_c[i].setFrame(0, 0, meter_rate, this._ehp_sprites_c[i].bitmap.height / 2);
  187. };

  188. //==============================
  189. // * Update EHP Red Bar
  190. //==============================
  191. Spriteset_Battle.prototype.update_ehp_red_bar = function(i) {
  192.                 if (this._ehp_sprites_data[i][4] != this._enemySprites[i]._battler.hp) {
  193.                                         var dnspeed = 1 + (Math.abs(this._ehp_sprites_data[i][4] - this._enemySprites[i]._battler.hp) / (Moghunter.enemyhp_duration / 2));
  194.                         if (this._ehp_sprites_data[i][4] > this._enemySprites[i]._battler.hp) {
  195.                             this._ehp_sprites_data[i][4] -= dnspeed;
  196.                                 if (this._ehp_sprites_data[i][4] < this._enemySprites[i]._battler.hp ) {
  197.                                     this._ehp_sprites_data[i][4] = this._enemySprites[i]._battler.hp};
  198.                         }
  199.                         else if (this._ehp_sprites_data[i][4] < this._enemySprites[i]._battler.hp) {
  200.                             this._ehp_sprites_data[i][4] += dnspeed;
  201.                                 if (this._ehp_sprites_data[i][4] > this._enemySprites[i]._battler.hp ) {
  202.                                     this._ehp_sprites_data[i][4] = this._enemySprites[i]._battler.hp};                       
  203.                         }
  204.                         var meter_rate = this._ehp_sprites_b[i].bitmap.width * this._ehp_sprites_data[i][4] / this._enemySprites[i]._battler.mhp;
  205.                      this._ehp_sprites_b[i].setFrame(0, this._ehp_sprites_b[i].bitmap.height / 2, meter_rate, this._ehp_sprites_b[i].bitmap.height / 2);
  206.             };       
  207. };
复制代码
360截图20170728140817029.jpg
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部