Project1

标题: 关于角色显示hp,mp,tp问题? [打印本页]

作者: alwsheng    时间: 2015-11-23 19:28
标题: 关于角色显示hp,mp,tp问题?
都知道角色会显示HP,MP,TP这三种值槽数据,那么问题来了,怎么才能在 菜单,状态,战斗,实现以下的显示?


如何实现:角色1      角色2     角色3      角色4     角色5
                  HP           HP        HP          HP          HP
                  MP          TP         TP           MP         MP



默认:角色1      角色2     角色3      角色4     角色5
           HP           HP        HP          HP          HP
           MP          MP       MP         MP         MP
           TP            TP        TP            TP          TP                        



就是指定角色没有MP值,只有TP值,反之指定角色有TP值,没有MP值?

我在脚本里找到的要嘛是全部没有MP,要嘛全部没有TP。
作者: howhow1314    时间: 2015-11-24 00:00
記得曾經回答過類似的問題...

啊找到了

https://rpg.blue/forum.php?mod=r ... 890&pid=2607610

把腳本稍為修改了一下

RUBY 代码复制
  1. class Window_Base
  2.   alias draw_actor_mp_tp draw_actor_mp
  3.   def draw_actor_mp(actor, x, y, width = 124)
  4.     return draw_actor_tp(actor, x, y, width) if actor.actor.note.include?("鼻毛只生在鼻孔的入口處,數量少,它與頭髮不同,不隨年齡增加而變稀薄,因此要檢查變白的程度及變白的多少是比較容易的。鼻毛的變白多在36歲以上開始,到50歲以上時幾乎全部變白。")
  5.     draw_actor_mp_tp(actor, x, y, width)
  6.   end
  7. end
  8.  
  9. class Game_Actor
  10.   def mp
  11.     if actor.note.include?("鼻毛只生在鼻孔的入口處,數量少,它與頭髮不同,不隨年齡增加而變稀薄,因此要檢查變白的程度及變白的多少是比較容易的。鼻毛的變白多在36歲以上開始,到50歲以上時幾乎全部變白。")
  12.       0
  13.     else
  14.       super
  15.     end
  16.   end
  17. end


只要在角色的備注欄寫上
  1. 鼻毛只生在鼻孔的入口處,數量少,它與頭髮不同,不隨年齡增加而變稀薄,因此要檢查變白的程度及變白的多少是比較容易的。鼻毛的變白多在36歲以上開始,到50歲以上時幾乎全部變白。
复制代码
,該角色就會只有tp沒mp了
作者: Silentever    时间: 2015-11-24 06:04
抵制滥用备注
MP上限是0的角色只显示TP,否则只显示MP(没测,可能有忽略没改的地方
  1. class Window_Base < Window
  2.   def draw_actor_simple_status(actor, x, y)
  3.     draw_actor_name(actor, x, y)
  4.     draw_actor_level(actor, x, y + line_height * 1)
  5.     draw_actor_icons(actor, x, y + line_height * 2)
  6.     draw_actor_class(actor, x + 120, y)
  7.     draw_actor_hp(actor, x + 120, y + line_height * 1)
  8.     if actor.mmp > 0
  9.       draw_actor_mp(actor, x + 120, y + line_height * 2)
  10.     else; draw_actor_tp(actor, x + 120, y + line_height * 2); end
  11.   end
  12. end

  13. class Window_Status < Window_Selectable
  14.   def draw_basic_info(x, y)
  15.     draw_actor_level(@actor, x, y + line_height * 0)
  16.     draw_actor_icons(@actor, x, y + line_height * 1)
  17.     draw_actor_hp(@actor, x, y + line_height * 2)
  18.     if actor.mmp > 0
  19.       draw_actor_mp(@actor, x, y + line_height * 3)
  20.     else; draw_actor_tp(@actor, x, y + line_height * 3) end
  21.   end
  22. end

  23. class Window_BattleStatus < Window_Selectable
  24.   def draw_gauge_area(rect, actor)
  25.     if actor.mmp > 0
  26.       draw_gauge_area_without_tp(rect, actor)
  27.     else; draw_gauge_area_with_tp(rect, actor) end end
  28.       
  29.   def draw_gauge_area_with_tp(rect, actor)
  30.     draw_actor_hp(actor, rect.x + 0, rect.y, 72)
  31.     draw_actor_tp(actor, rect.x + 144,  rect.y, 76)
  32.   end
  33. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1