查看: 6407|回复: 8

[有事请教] 战斗显示敌人血条

[复制链接]
梦石
0
星屑
79
在线时间
24 小时
注册时间
2016-8-9
回帖
9
发表于 2017-11-9 22:25:26 | 显示全部楼层 |阅读模式

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

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

×
怎样利用YEP插件如何做到显示敌人血条,求详解,提前谢谢大佬!
梦石
0
星屑
271
在线时间
45 小时
注册时间
2017-10-25
回帖
50
发表于 2017-11-9 22:28:16 | 显示全部楼层
http://www.jianshu.com/p/96a3f87a06f5
这里有教程,好好看下吧。
回复

使用道具 举报

梦石
0
星屑
79
在线时间
24 小时
注册时间
2016-8-9
回帖
9
 楼主| 发表于 2017-11-9 22:30:33 | 显示全部楼层
380617414 发表于 2017-11-9 22:28
http://www.jianshu.com/p/96a3f87a06f5
这里有教程,好好看下吧。

这个我看过,就是没给看懂。希望大佬知道一次,然后会用一条之后其它都会用了。还有谢谢你的回复!!
回复

使用道具 举报

梦石
0
星屑
29220
在线时间
1535 小时
注册时间
2006-1-10
回帖
1898

开拓者第一届地图绘制大赛RTP组第四名

发表于 2017-11-9 23:33:46 | 显示全部楼层
http://www.jianshu.com/p/e2035484dbfa
数据库——敌人——注释

在注释方框里面写上

<Show HP Gauge>
<HP Gauge Width: 300>
<HP Gauge Color 1: 10>
<HP Gauge Color 2: 12>
测试一下就知道了!


MV帮助 http://miaowm5.github.io/RMMV-F1/日复一日,年复一年人还是保留一点自我兴趣的好啊~~~忘记过去 ,这样我就可以  放弃未来了……哭~~终于找回以前的头像了,哎~~原来我是那么的想念阿……
画地图没灵感?很烦?很无聊 【 戳 我 】一 大 波 地 图 在 等 你  \^0^/
我的游戏
回复 1 0

使用道具 举报

梦石
0
星屑
2787
在线时间
216 小时
注册时间
2017-9-28
回帖
255
发表于 2017-11-10 11:23:47 | 显示全部楼层
我记得我是开了插件ON之后把Show参数改成true之后就出来了,没写注释。。。
要放在战斗引擎核心插件下面。。。
试试看吧
回复

使用道具 举报

梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-11-11 02:25:58 | 显示全部楼层
本帖最后由 j296196585 于 2017-11-11 02:27 编辑

不知道你需要MOG 不
  1. //=============================================================================
  2. // MOG_HPGauge.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.0) Apresenta um medidor de HP do alvo.
  6. * @author Moghunter
  7. *
  8. * @param Gauge For Actors
  9. * @desc Apresentar o HP nos aliados .
  10. * @default true
  11. *
  12. * @param Gauge For Enemies
  13. * @desc Apresentar o HP nos inimigos.
  14. * @default true
  15. *
  16. * @param Show HP On Selection
  17. * @desc Apresentar o HP na seleção do alvo.
  18. * @default true
  19. *
  20. * @param Fade Duration
  21. * @desc Definição do tempo para ativar o fade.
  22. * @default 90
  23. *
  24. * @param Slide Animation
  25. * @desc Ativar animação de deslize.
  26. * @default true
  27. *  
  28. * @param Show HP Number Actor
  29. * @desc Apresentar o número de HP para o ator.
  30. * @default false
  31. *
  32. * @param Show HP Number Enemy
  33. * @desc Apresentar o número de HP para o inimigo.
  34. * @default true
  35. *
  36. * @param Required to Kill
  37. * @desc Requer derrotar o inimigo para mostrar o HP.
  38. * @default false
  39. *
  40. * @param Actor Layout X-Axis
  41. * @desc Posição X-Axis do layout.
  42. * @default 0
  43. *
  44. * @param Actor Layout Y-Axis
  45. * @desc Posição Y-Axis do layout.
  46. * @default 0
  47. *
  48. * @param Actor Meter X-Axis
  49. * @desc Posição X-Axis do medidor.
  50. * @default 0
  51. *
  52. * @param Actor Meter Y-Axis
  53. * @desc Posição Y-Axis do medidor.
  54. * @default 3
  55. *
  56. * @param Actor HP Number X-Axis
  57. * @desc Posição X-Axis do numero de HP.
  58. * @default -25
  59. *
  60. * @param Actor HP Number Y-Axis
  61. * @desc Posição Y-Axis do numero de HP.
  62. * @default -22
  63. *
  64. * @param Enemy Layout X-Axis
  65. * @desc Posição X-Axis do layout.
  66. * @default 0
  67. *
  68. * @param Enemy Layout Y-Axis
  69. * @desc Posição Y-Axis do layout.
  70. * @default 0
  71. *
  72. * @param Enemy Meter X-Axis
  73. * @desc Posição X-Axis do medidor.
  74. * @default 8
  75. *
  76. * @param Enemy Meter Y-Axis
  77. * @desc Posição Y-Axis do medidor.
  78. * @default 10
  79. *
  80. * @param Enemy HP Number X-Axis
  81. * @desc Posição X-Axis do numero de HP.
  82. * @default -25
  83. *
  84. * @param Enemy HP Number Y-Axis
  85. * @desc Posição Y-Axis do numero de HP.
  86. * @default -19
  87. *  
  88. * @help  
  89. * =============================================================================
  90. * +++ MOG - HP Gauge (v1.0) +++
  91. * By Moghunter
  92. * [url=https://atelierrgss.wordpress.com/]https://atelierrgss.wordpress.com/[/url]
  93. * =============================================================================
  94. * Apresenta um medidor de HP do alvo.
  95. * Serão necessários os arquivos. (img/system/)
  96. *
  97. * HPGaugeActor_A.png
  98. * HPGaugeActor_B.png
  99. * HPGaugeActor_C.png
  100. * HPGaugeEnemy_A.png
  101. * HPGaugeEnemy_B.png
  102. * HPGaugeEnemy_C.png  
  103. *
  104. * =============================================================================
  105. * NOTETAGS
  106. * =============================================================================
  107. * Para ocultar o HP do inimigo use a seguinte Tag na caixa de notas
  108. *
  109. * Hide HP
  110. *
  111. * -----------------------------------------------------------------------------
  112. * Para ajustar a posição do medidor use a Tag abaixo.
  113. *
  114. * Hp Gauge Offset: X:Y
  115. *
  116. * Exemplo
  117. *
  118. * Hp Gauge Offset: 130:40
  119. *
  120. */

  121. //=============================================================================
  122. // ** PLUGIN PARAMETERS
  123. //=============================================================================
  124.   var Imported = Imported || {};
  125.   Imported.MOG_HPGauge = true;
  126.   var Moghunter = Moghunter || {};

  127.    Moghunter.parameters = PluginManager.parameters('MOG_HPGauge');
  128.     Moghunter.hpgauge_actors = String(Moghunter.parameters['Gauge For Actors'] || "true");
  129.         Moghunter.hpgauge_enemies = String(Moghunter.parameters['Gauge For Enemies'] || "true");
  130.         Moghunter.hpgauge_selection = String(Moghunter.parameters['Show HP On Selection'] || "true");
  131.         Moghunter.hpgauge_slide = String(Moghunter.parameters['Slide Animation'] || "true");
  132.         Moghunter.hpgauge_showNumberActor = String(Moghunter.parameters['Show HP Number Actor'] || "false");
  133.         Moghunter.hpgauge_showNumberEnemy = String(Moghunter.parameters['Show HP Number Enemy'] || "true");
  134.         Moghunter.hpgauge_NumberAfter = String(Moghunter.parameters['Required to Kill'] || "false");
  135.     Moghunter.hpgauge_a_x = Number(Moghunter.parameters['Enemy Layout X-Axis'] || 0);
  136.     Moghunter.hpgauge_a_y = Number(Moghunter.parameters['Enemy Layout Y-Axis'] || 0);
  137.     Moghunter.hpgauge_b_x = Number(Moghunter.parameters['Enemy Meter X-Axis'] || 8);
  138.     Moghunter.hpgauge_b_y = Number(Moghunter.parameters['Enemy Meter Y-Axis'] || 10);        
  139.     Moghunter.hpgauge_c_x = Number(Moghunter.parameters['Enemy HP Number X-Axis'] || -30);
  140.     Moghunter.hpgauge_c_y = Number(Moghunter.parameters['Enemy HP Number Y-Axis'] || -19);        
  141.     Moghunter.hpgauge_a_xa = Number(Moghunter.parameters['Actor Layout X-Axis'] || 0);
  142.     Moghunter.hpgauge_a_ya = Number(Moghunter.parameters['Actor Layout Y-Axis'] || 0);
  143.     Moghunter.hpgauge_b_xa = Number(Moghunter.parameters['Actor Meter X-Axis'] || 0);
  144.     Moghunter.hpgauge_b_ya = Number(Moghunter.parameters['Actor Meter Y-Axis'] || 3);        
  145.     Moghunter.hpgauge_c_xa = Number(Moghunter.parameters['Actor HP Number X-Axis'] || -25);
  146.     Moghunter.hpgauge_c_ya = Number(Moghunter.parameters['Actor HP Number Y-Axis'] || -19);               
  147.         Moghunter.hpgauge_duration = Number(Moghunter.parameters['Fade Duration'] || 90);

  148. //=============================================================================
  149. // ** Game_Temp
  150. //=============================================================================

  151. //==============================
  152. // * Initialize
  153. //==============================
  154. var _mog_hpgauge_temp_initialize = Game_Temp.prototype.initialize;
  155. Game_Temp.prototype.initialize = function() {
  156.         _mog_hpgauge_temp_initialize.call(this);
  157.     this._hpGauge = [true,false];
  158. };

  159. //=============================================================================
  160. // ** Game_System
  161. //=============================================================================

  162. //==============================
  163. // * Initialize
  164. //==============================
  165. var _mog_hpgauge_sys_initialize = Game_System.prototype.initialize;
  166. Game_System.prototype.initialize = function() {
  167.         _mog_hpgauge_sys_initialize.call(this);
  168.     this._hpGaugeEDef = [];
  169. };

  170. //=============================================================================
  171. // ** BattleManager
  172. //=============================================================================

  173. //==============================
  174. // * processVictory
  175. //==============================
  176. var _mog_hpGauge_processVictory = BattleManager.processVictory;
  177. BattleManager.processVictory = function() {
  178.          $gameTemp._hpGauge[0] = false;
  179.          _mog_hpGauge_processVictory.call(this);         
  180. };

  181. //==============================
  182. // * processAbort
  183. //==============================
  184. var _mog_hpGauge_processAbort = BattleManager.processAbort;
  185. BattleManager.processAbort = function() {
  186.          $gameTemp._hpGauge[0] = false;
  187.          _mog_hpGauge_processAbort.call(this);         
  188. };

  189. //==============================
  190. // * processDefeat
  191. //==============================
  192. var _mog_hpGauge_processDefeat = BattleManager.processDefeat;
  193. BattleManager.processDefeat = function() {
  194.          $gameTemp._hpGauge[0] = false;
  195.          _mog_hpGauge_processDefeat.call(this);         
  196. };

  197. //=============================================================================
  198. // ** Game Battler
  199. //=============================================================================

  200. //==============================
  201. // * init Members
  202. //==============================
  203. var _mog_hpgauge_gbat_initMembers = Game_Battler.prototype.initMembers;
  204. Game_Battler.prototype.initMembers = function() {
  205.     _mog_hpgauge_gbat_initMembers.call(this);
  206.     this._ehpgauge = [false,0,0,false,false];
  207. };

  208. //==============================
  209. // * check HP Gauge Notes
  210. //==============================
  211. Game_Battler.prototype.checkHPGaugeNotes = function() {
  212.         this.notetags().forEach(function(note) {
  213.                 if (note == "Hide HP") {this._ehpgauge[0] = false};
  214.          var note_data = note.split(': ')
  215.                  if (note_data[0].toLowerCase() == "hp gauge offset"){
  216.                          var par = note_data[1].split(':');
  217.                      this._ehpgauge[1] = Number(par[0]);
  218.                          this._ehpgauge[2] = Number(par[1]);
  219.                  };               
  220.         },this);
  221. };

  222. //==============================
  223. // * Notetags
  224. //==============================
  225. Game_Battler.prototype.notetags = function() {
  226.         if (this.isEnemy()) {return this.enemy().note.split(/[\r\n]+/)};
  227.         if (this.isActor()) {return this.actor().note.split(/[\r\n]+/)};
  228. };

  229. //=============================================================================
  230. // ** Game_Actor
  231. //=============================================================================

  232. //==============================
  233. // * Setup
  234. //==============================
  235. var _mog_hp_gauge_gactor_setup = Game_Actor.prototype.setup;
  236. Game_Actor.prototype.setup = function(actorId) {
  237.         _mog_hp_gauge_gactor_setup.call(this,actorId);
  238.         if (String(Moghunter.hpgauge_actors) === "true") {this._ehpgauge[0] = true};
  239.         this.checkHPGaugeNotes();
  240. };

  241. //=============================================================================
  242. // ** Game_Enemy
  243. //=============================================================================

  244. //==============================
  245. // * Setup
  246. //==============================
  247. var _mog_hpgauge_genemy_setup = Game_Enemy.prototype.setup;
  248. Game_Enemy.prototype.setup = function(enemyId, x, y) {
  249.         _mog_hpgauge_genemy_setup.call(this,enemyId, x, y);
  250.         if (String(Moghunter.hpgauge_enemies) === "true") {this._ehpgauge[0] = true};
  251.         this.checkHPGaugeNotes();
  252. };

  253. //==============================
  254. // * Die
  255. //==============================
  256. var _mog_hpgauge_genemy_die = Game_Enemy.prototype.die;
  257. Game_Enemy.prototype.die = function() {
  258.         _mog_hpgauge_genemy_die.call(this);
  259.         $gameSystem._hpGaugeEDef[this._enemyId] = true;
  260. };

  261. //=============================================================================
  262. // ** Game Action
  263. //=============================================================================

  264. //==============================
  265. // * Apply
  266. //==============================
  267. var _mog_hpgauge_gaction_apply = Game_Action.prototype.apply;
  268. Game_Action.prototype.apply = function(target) {
  269.          _mog_hpgauge_gaction_apply.call(this,target);
  270.      if (target) {
  271.                  if (this.isHpRecover()) {
  272.                          target._ehpgauge[4] = true;
  273.                  } else if (this.item() && this.item().damage.type === 5) {
  274.                          target._ehpgauge[4] = true;
  275.                          var subj = this.subject();
  276.                          if (subj) {subj._ehpgauge[4] = true};
  277.                  };
  278.           };
  279. };

  280. //=============================================================================
  281. // ** Spriteset_Battle
  282. //=============================================================================        

  283. //==============================
  284. // * CreateLowerLayer
  285. //==============================
  286. var _mog_hpgauge_createUpperLayer = Spriteset_Battle.prototype.createUpperLayer
  287. Spriteset_Battle.prototype.createUpperLayer = function() {
  288.         this.create_HPGauge();
  289.         _mog_hpgauge_createUpperLayer.call(this);        
  290. };

  291. //==============================
  292. // * Create HP Gauge
  293. //==============================
  294. Spriteset_Battle.prototype.create_HPGauge = function() {
  295.     this.createHPField();
  296.         this.createHPSprites()
  297. };

  298. //==============================
  299. // * Create EHP Field
  300. //==============================
  301. Spriteset_Battle.prototype.createHPField = function() {
  302.     this._hpField = new Sprite();
  303.         this._hpField.z = 100;
  304.         this.addChild(this._hpField);
  305. };

  306. //==============================
  307. // * Create HP Sprites
  308. //==============================
  309. Spriteset_Battle.prototype.createHPSprites = function() {
  310.         $gameTemp._hpGauge[0] = true;
  311.         this._HPSprites = [];
  312.         if (String(Moghunter.hpgauge_actors) === "true") {
  313.                 for (var i = 0; i < this._actorSprites.length; i++) {
  314.                          this._HPSprites[i] = new HPGaugeSprite(this._actorSprites[i],0);
  315.                          this._hpField.addChild(this._HPSprites[i]);        
  316.                 };
  317.         };
  318.         if (String(Moghunter.hpgauge_enemies) === "true") {
  319.                 for (var i = 0; i < this._enemySprites.length; i++) {
  320.                          this._HPSprites[i] = new HPGaugeSprite(this._enemySprites[i],1);
  321.                          this._hpField.addChild(this._HPSprites[i]);
  322.                 };
  323.         };
  324. };

  325. //==============================
  326. // * Update
  327. //==============================
  328. var _mog_hpGauge_sprBat_update = Spriteset_Battle.prototype.update;
  329. Spriteset_Battle.prototype.update = function() {
  330.         _mog_hpGauge_sprBat_update.call(this);
  331.         if (Imported.MOG_BattleCamera && this._hpField) {this.updateHPField()};
  332. };

  333. //==============================
  334. // * Update
  335. //==============================
  336. Spriteset_Battle.prototype.updateHPField = function() {
  337.     this._hpField.x = this._battleField.x
  338.         this._hpField.y = this._battleField.y
  339. };

  340. //=============================================================================
  341. // ** HP Gauge Sprite
  342. //=============================================================================
  343. function HPGaugeSprite() {
  344.     this.initialize.apply(this, arguments);
  345. };

  346. HPGaugeSprite.prototype = Object.create(Sprite.prototype);
  347. HPGaugeSprite.prototype.constructor = HPGaugeSprite;

  348. //==============================
  349. // * Initialize
  350. //==============================
  351. HPGaugeSprite.prototype.initialize = function(sprite,type) {
  352.     Sprite.prototype.initialize.call(this);
  353.     this._sprite = sprite;
  354.         this._slideX = 0;
  355.         this._duration = 0;
  356.         this.opacity = 0;
  357.         this.type = type;
  358.         this.z = 100;
  359.         this._slideA = String(Moghunter.hpgauge_slide) === "true" ? true : false;
  360.         this._selectionHP = String(Moghunter.hpgauge_selection) === "true" ? true : false;
  361.         if (type === 0) {
  362.             this._showHPNumber = String(Moghunter.hpgauge_showNumberActor) === "true" ? true : false;
  363.         } else {
  364.             this._showHPNumber = String(Moghunter.hpgauge_showNumberEnemy) === "true" ? true : false;
  365.         };
  366.         this._IDA = type === 0 ? true : this.enemyIDA();
  367.         if (type === 1 && String(Moghunter.hpgauge_NumberAfter) != "true") {this._IDA = true};
  368.         this._data = [0,0,0,0,0];
  369.         this.loadBitmaps();
  370. };
  371.    
  372. //==============================
  373. // * Battler
  374. //==============================
  375. HPGaugeSprite.prototype.battler = function() {
  376.     return this._sprite._battler;
  377. };

  378. //==============================
  379. // * Load Bitmaps
  380. //==============================
  381. HPGaugeSprite.prototype.loadBitmaps = function() {
  382.         if (this.type === 0) {
  383.         this._layImg = ImageManager.loadSystem("HPGaugeActor_A");
  384.             this._meterImg = ImageManager.loadSystem("HPGaugeActor_B");
  385.                 this._numberImg = ImageManager.loadSystem("HPGaugeActor_C");
  386.         } else {
  387.         this._layImg = ImageManager.loadSystem("HPGaugeEnemy_A");
  388.             this._meterImg = ImageManager.loadSystem("HPGaugeEnemy_B");        
  389.                 this._numberImg = ImageManager.loadSystem("HPGaugeEnemy_C");        
  390.         };
  391. };

  392. //==============================
  393. // * createSprites
  394. //==============================
  395. HPGaugeSprite.prototype.createSprites = function() {
  396.         this.createLayout();
  397.         this.createMeter();
  398.         if (this._showHPNumber) {this.createNumber()};
  399. };

  400. //==============================
  401. // * Create Layout
  402. //==============================
  403. HPGaugeSprite.prototype.createLayout = function() {
  404.     this._layout = new Sprite(this._layImg);
  405.         if (this.type === 0) {
  406.             this._layout.x = Moghunter.hpgauge_a_xa - this._layImg.width / 2;
  407.             this._layout.y = Moghunter.hpgauge_a_ya - this._layImg.height / 2;
  408.         } else {
  409.             this._layout.x = Moghunter.hpgauge_a_x - this._layImg.width / 2;
  410.             this._layout.y = Moghunter.hpgauge_a_y - this._layImg.height / 2;
  411.         };
  412.         this.addChild(this._layout);
  413. };

  414. //==============================
  415. // * Create Gauge
  416. //==============================
  417. HPGaugeSprite.prototype.createMeter = function() {
  418.         this._meter = [];
  419.         for (var i = 0; i < 2; i++) {
  420.                 this._meter[i] = new Sprite(this._meterImg);
  421.                 this._meter[i].value1 = this.battler().hp;
  422.                 this._meter[i].value2 = this.battler().mhp;
  423.                 this._meter[i].ds = 0;
  424.                 this._meter[i].w = this._meterImg.width;
  425.                 this._meter[i].h = this._meterImg.height / 2;
  426.                 if (this.type === 0) {
  427.                     this._meter[i].x = Moghunter.hpgauge_a_xa + Moghunter.hpgauge_b_xa - this._meterImg.width / 2;
  428.                     this._meter[i].y = Moghunter.hpgauge_a_ya + Moghunter.hpgauge_b_ya - this._meterImg.height / 2;
  429.                 } else {
  430.                     this._meter[i].x = Moghunter.hpgauge_a_x + Moghunter.hpgauge_b_x - this._meterImg.width / 2;
  431.                     this._meter[i].y = Moghunter.hpgauge_a_y + Moghunter.hpgauge_b_y - this._meterImg.height / 2;
  432.             };
  433.                 this.addChild(this._meter[i]);
  434.         };
  435.     this.refreshMeter(this._meter[0],this._meter[0].value1,this.battler().mhp,1);
  436.         this.refreshMeter(this._meter[1],this.battler().hp,this.battler().mhp,0);        
  437.         this.updateMeter();
  438. };

  439. //==============================
  440. // * Need Refresh Blue Meter
  441. //==============================
  442. HPGaugeSprite.prototype.needRefreshBlueMeter = function() {
  443.         if (this.battler()._ehpgauge[4]) {return true};
  444.     if (this._meter[1].value1 != this.battler().hp) {return true};
  445.         if (this._meter[1].value2 != this.battler().mhp) {return true};
  446.         return false
  447. };

  448. //==============================
  449. // * refresh Blue Meter
  450. //==============================
  451. HPGaugeSprite.prototype.refreshBlueMeter = function() {
  452.          this.battler()._ehpgauge[4] = false;
  453.      this._meter[1].value1 = this.battler().hp;
  454.          this._meter[1].value2 = this.battler().mhp;
  455.          if (!$gameTemp._hpGauge[0]) {return};
  456.          this.refreshMeter(this._meter[0],this._meter[0].value1,this.battler().mhp,1);
  457.          this.refreshMeter(this._meter[1],this.battler().hp,this.battler().mhp,0);
  458.          this.prepareSlide();
  459. };

  460. //==============================
  461. // * prepare Slide
  462. //==============================
  463. HPGaugeSprite.prototype.prepareSlide = function() {
  464.         if (this.opacity < 100 || this._slideX > 0) {
  465.             this._slideX = this._slideA ? -50 : -0.01;
  466.             this.opacity = 0;
  467.         };
  468.         this._duration = Math.min(Math.max(Moghunter.hpgauge_duration,1),999);
  469. };

  470. //==============================
  471. // * Update Dif
  472. //==============================
  473. HPGaugeSprite.prototype.update_dif = function(value,real_value,speed,type) {
  474.         if (value == real_value) {return value};
  475.         var mr = type === 0 ? 1 : 0.1;
  476.     var dnspeed = mr + (Math.abs(value - real_value) / speed);
  477.         if (value > real_value) {value -= dnspeed;
  478.             if (value < real_value) {value = real_value};
  479.         } else if (value < real_value) {value  += dnspeed;
  480.             if (value  > real_value) {value  = real_value};               
  481.     };
  482.         if (type === 0) {
  483.             return Math.floor(value);
  484.         } else {
  485.                 return value;
  486.         };
  487. };

  488. //==============================
  489. // * Need Refresh Red Meter
  490. //==============================
  491. HPGaugeSprite.prototype.needRefreshRedMeter = function() {
  492.      if (this._meter[0].value1 != this.battler().hp) {return true};
  493.          return false;
  494. };

  495. //==============================
  496. // * refresh Red Meter
  497. //==============================
  498. HPGaugeSprite.prototype.refreshRedMeter = function() {
  499.            this._meter[0].value1 = this.update_dif(this._meter[0].value1,this.battler().hp, 60,1);
  500.          this.refreshMeter(this._meter[0],this._meter[0].value1,this.battler().mhp,1);
  501. };

  502. //==============================
  503. // * Update Meter
  504. //==============================
  505. HPGaugeSprite.prototype.updateMeter = function() {
  506.          if (this.needRefreshRedMeter()) {this.refreshRedMeter()};
  507.          if (this.needRefreshBlueMeter()) {this.refreshBlueMeter()};
  508. };

  509. //==============================
  510. // * Refresh Meter
  511. //==============================
  512. HPGaugeSprite.prototype.refreshMeter = function(sprite,value1,value2,h) {
  513.      var wd = value1 * sprite.w / value2
  514.          sprite.setFrame(0,sprite.h * h,wd,sprite.h);  
  515. };

  516. //==============================
  517. // * create Number
  518. //==============================
  519. HPGaugeSprite.prototype.createNumber = function() {
  520.         this._hp_number = [];
  521.         this._numberData = [this.battler().hp - 1,this._numberImg.width / 11,this._numberImg.height]
  522.         for (var i = 0; i < 6; i++) {
  523.                  this._hp_number[i] = new Sprite(this._numberImg);
  524.                  this._hp_number[i].visible = false;
  525.                  if (this.type === 0) {
  526.                      this._hp_number[i].x = Moghunter.hpgauge_a_xa + Moghunter.hpgauge_c_xa;
  527.                      this._hp_number[i].y = Moghunter.hpgauge_a_ya + Moghunter.hpgauge_c_ya;
  528.                  } else {
  529.                      this._hp_number[i].x = Moghunter.hpgauge_a_x + Moghunter.hpgauge_c_x;
  530.                      this._hp_number[i].y = Moghunter.hpgauge_a_y + Moghunter.hpgauge_c_y;
  531.                  };
  532.                  this._hp_number[i].org = [this._hp_number[i].x,this._hp_number[i].y];
  533.                  this.addChild(this._hp_number[i]);                 
  534.         };
  535. };

  536. //==============================
  537. // * update Number
  538. //==============================
  539. HPGaugeSprite.prototype.updateNumber = function() {
  540.         if (this._numberData[0] != this.battler().hp) {this.refreshNumber()};
  541. };

  542. //==============================
  543. // * enemy IDA
  544. //==============================
  545. HPGaugeSprite.prototype.enemyIDA = function() {
  546.          if (this.battler().isActor()) {return true};
  547.      return $gameSystem._hpGaugeEDef[this.battler()._enemyId];
  548. };

  549. //==============================
  550. // * ID available
  551. //==============================
  552. HPGaugeSprite.prototype.idIsAvailable = function() {
  553.         return this._IDA;
  554. };

  555. //==============================
  556. // * refresh Number
  557. //==============================
  558. HPGaugeSprite.prototype.refreshNumber = function() {
  559.         this._numberData[0] = this.update_dif(this._numberData[0],this.battler().hp, 40,0);
  560.     var w = this._numberData[1];
  561.         var h = this._numberData[2];
  562.         var number = Math.abs(this._numberData[0]).toString().split("");
  563.     for (var i = 0; i < this._hp_number.length; i++) {
  564.            this._hp_number[i].visible = false;         
  565.            if (this.idIsAvailable()) {        
  566.                    if (i <  number.length) {
  567.                            var n = Number(number[i]);
  568.                            this._hp_number[i].setFrame(n * w, 0, w, h);
  569.                            this._hp_number[i].visible = true;           
  570.                            this._hp_number[i].x = this._hp_number[i].org[0] + (w * i);
  571.                    };
  572.            } else {
  573.                    if (i === 0) {
  574.                            this._hp_number[0].setFrame(10 * w, 0, w, h);
  575.                            this._hp_number[0].visible = true;           
  576.                            this._hp_number[0].x = this._hp_number[0].org[0] + (w * 2);                             
  577.                    };
  578.            };
  579.     };        
  580. };

  581. //==============================
  582. // * Is Visible
  583. //==============================
  584. HPGaugeSprite.prototype.isVisible = function() {
  585.         if (!this.battler()) {return false};
  586.         if (this.battler().isHidden()) {return false};
  587.     if (!this.battler()._ehpgauge[0]) {return false};
  588.         return true;
  589. };

  590. //==============================
  591. // * force Visible
  592. //==============================
  593. HPGaugeSprite.prototype.forceVisible = function() {
  594.      if (this.battler()._ehpgauge[3]) {return true};
  595.          if (this._selectionHP && this.battler().isSelected() && !this.battler().isDead()) {return true};
  596.          return false;
  597. };

  598. //==============================
  599. // * pos X
  600. //==============================
  601. HPGaugeSprite.prototype.posX = function() {
  602.         var xs = this.forceVisible() ? 0 : this._slideX;
  603.     return this._sprite.x + xs + this.battler()._ehpgauge[1];
  604. };

  605. //==============================
  606. // * pos Y
  607. //==============================
  608. HPGaugeSprite.prototype.posY = function() {
  609.     return this._sprite.y + this.battler()._ehpgauge[2];
  610. };

  611. //==============================
  612. // * Update Slide
  613. //==============================
  614. HPGaugeSprite.prototype.updateSlide = function() {
  615.         this._slideX += 2;
  616.         this.opacity += 10;
  617.         if (this._slideX >= 0) {
  618.                 this._slideX = 0;
  619.                 this.opacity = 255;
  620.         };
  621. };

  622. //==============================
  623. // * Update Fade
  624. //==============================
  625. HPGaugeSprite.prototype.updateFade = function() {
  626.         if (this._slideA) {this._slideX += 2};
  627.         this.opacity -= 10;
  628. };

  629. //==============================
  630. // * Update Slide
  631. //==============================
  632. HPGaugeSprite.prototype.updateAnimation = function() {
  633.     if (this._slideX < 0) {this.updateSlide();return};
  634.         if (this._duration > 0) {this._duration--;return};
  635.         if (this.opacity > 0) {this.updateFade()};        
  636. };

  637. //==============================
  638. // * Update Force Visible
  639. //==============================
  640. HPGaugeSprite.prototype.updateForceVisible = function() {
  641.     this.opacity = 255;
  642.     this._duration = 0;
  643.     this._slideX = 0;
  644. };

  645. //==============================
  646. // * Update Position
  647. //==============================
  648. HPGaugeSprite.prototype.updatePosition = function() {
  649.    if (this.forceVisible()) {
  650.        this.updateForceVisible();
  651.    } else {
  652.            this.updateAnimation();
  653.    };
  654.    this.x = this.posX();
  655.    this.y = this.posY();
  656. };

  657. //==============================
  658. // * Update
  659. //==============================
  660. HPGaugeSprite.prototype.update = function() {
  661.     Sprite.prototype.update.call(this);
  662.         this.visible = this.isVisible();
  663.         if (!this.battler()) {return};
  664.         if (!this._layout && this._meterImg.isReady()) {this.createSprites()};
  665.         if (this._meter) {this.updateMeter()};
  666.         if (this._hp_number) {this.updateNumber()};
  667.     this.updatePosition();
  668. };
复制代码

更多图片 小图 大图
组图打开中,请稍候......
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
回复

使用道具 举报

梦石
0
星屑
240
在线时间
125 小时
注册时间
2013-12-20
回帖
44
发表于 2017-11-11 15:16:26 | 显示全部楼层
事件 添加插件命令 设置怪物
360截图20171111151508245.jpg
回复 0 1

使用道具 举报

梦石
0
星屑
740
在线时间
98 小时
注册时间
2017-2-21
回帖
21

开拓者

发表于 2017-11-12 18:48:09 | 显示全部楼层
king 发表于 2017-11-9 23:33
http://www.jianshu.com/p/e2035484dbfa
数据库——敌人——注释

没必要,在插件设置里把Always Visible写成true就行,如果Boss不希望就在敌人注释那里写<Hide HP Gauge>

点评

我是针对三楼,他说看不懂……我叫他测试一下插件设置  发表于 2017-11-13 09:18
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部