查看: 2423|回复: 1

[已经解决] 使用姨妈战斗脚本的问题

[复制链接]
梦石
0
星屑
536
在线时间
69 小时
注册时间
2016-5-5
回帖
16
发表于 2017-10-19 22:31:08 | 显示全部楼层 |阅读模式

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

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

×
战斗中临时增加队员时会造成命令选项错位

像这样
未命名.jpg


  1. #==============================================================================
  2. # ■ 姨媽功能型戰鬥介面          by姨媽
  3. #-----------------------------------------------------------------------------------------------------------------------------
  4. # ・為遏止多數Ace繁體橫向戰鬥RPG介面隨便又簡陋的歪風,姨媽設計了這款戰鬥介面。
  5. # ・雖然是針對橫向戰鬥設計,但傳統第一人稱戰鬥也可用。
  6. # ・不需額外放任何圖檔到遊戲資料夾內,插入此腳本即可使用。
  7. # ・支援544*416跟640*480的畫面大小。
  8. # ・請注意,有更改戰鬥背景放大率時敵人指標會跑位,這時不管怎麼調整都會有誤差。
  9. # ・歡迎轉載但請保留綠字註解。
  10. #
  11. # ・2013/11/15:
  12. #  微調敵人名稱位置,使之較不會遮住血條。
  13. # ・2013/11/18:
  14. #  可以調整敵人指標小箭頭RGB顏色。
  15. # ・2013/11/23:
  16. #  可調整計量表(HP、MP、TP)文字的字體大小。
  17. #  可用圖標取代傳統HP、MP、TP文字。
  18. # ・2013/11/24:
  19. #  對齊調整。
  20. # ・2013/11/26:
  21. #  我方指標追加。
  22. #  會自動判斷選項數而改變指令列選單的長度。
  23. # ・2013/12/2:
  24. #  指標資訊可設定顯示敵人名稱或血量百分比。
  25. # ・2013/12/15:
  26. #  可導入姨媽自訂計量條顏色腳本的設定。
  27. # ・2013/12/26:
  28. #  再次對齊調整。
  29. #  優化戰鬥不顯示TP時的頭像位置。
  30. # ・2014/01/01:
  31. #  優化敵人指標上方的資訊。
  32. # ・2014/01/02:
  33. #  可設定計量表(HP、MP、TP)文字是否使用粗體。
  34. # ・2014/01/05:
  35. #  構造內容整理。
  36. #  支援640*480畫面。
  37. #==============================================================================
  38. #==============================================================================
  39. #●特殊功能:
  40. #
  41. #・敵人圖像過大而指標跑出螢幕外,請在該敵人備註欄裡寫上"大怪"二字來避免此問題。
  42. #・MAXBM可以設定參戰人數,如果隊伍人數多於參戰人數設定,多出的隊友不會參戰。
  43. #・欲使用簡易版角色命令列請將SMALL_ACMD設為true。
  44. #
  45. #・表情改變功能首先要為每個參戰角色各準備一張專屬的八格表情圖檔(如下表)
  46. #
  47. #
  48. #############################
  49. #            #            #            #            #
  50. #     1     #     2     #     3     #     4     #
  51. #            #            #            #            #
  52. #############################
  53. #            #            #            #            #
  54. #     x     #     x     #     x     #     x     #
  55. #            #            #            #            #
  56. #############################
  57. #
  58. #
  59. #1為通常表情(資料庫裡該角色頭像必須設定為此)
  60. #2為低於50%血量的表情
  61. #3為低於25%血量的表情
  62. #4為陣亡時的表情
  63. # x 為腳本不會使用到的部分可任意安排
  64. #
  65. # 要使用隨血量改變表情的功能,請先將下面BFC = false改為BFC = true
  66. #==============================================================================
  67. #==============================================================================

  68. module YM_CURSOR_P
  69.   
  70. #調整敵人指標水平位置(左移:負數,右移:正數)
  71. CURSOR_PX = 0

  72. #調整敵人指標垂直位置(上移:負數,下移:正數)
  73. CURSOR_PY = 62

  74. #調整敵人指標小箭頭RGB顏色
  75. CURSOR_COLOR = Color.new(255,255,255)

  76. #調整我方指標箭頭RGB顏色
  77. CURSOR_COLOR2 = Color.new(255,255,255)

  78. end

  79. module YM_BATTLE_OPTION
  80.   
  81. #最大參戰人數,建議不要超過六人
  82. MAXBM = 6

  83. #設定計量表(HP、MP、TP)文字的字體大小。
  84. GAUGE_TEXTSIZE = 20

  85. #設定計量表(HP、MP、TP)文字是否使用粗體。
  86. GAUGE_TEXTBOLD = true

  87. #是否使用圖標取代傳統HP、MP、TP文字
  88. GAUGE_ICON_USE =  false
  89. #HP圖標編號(GAUGE_ICON_USE =  true才有效)
  90. GAUGE_ICON_HP =  187
  91. #MP圖標編號(GAUGE_ICON_USE =  true才有效)
  92. GAUGE_ICON_MP =  188
  93. #TP圖標編號(GAUGE_ICON_USE =  true才有效)
  94. GAUGE_ICON_TP =  189

  95. #是否使用隨血量改變表情功能
  96. BFC = false

  97. #是否使用簡易版角色指令列,簡易版不支援指令選項加上圖標腳本
  98. SMALL_ACMD = false

  99. #指標資訊顯示敵人名稱或血量百分比(true=敵人名稱,false=血量百分比)
  100. ENEMY_NAMEORPERCENT = true

  101. #是否導入姨媽自訂計量條顏色腳本的設定
  102. GAUGE_COLOR_HAVE = false

  103. #遊戲畫面大小是否為640*480?若是請用true,沒改過請保持false
  104. GW640GH480 = false

  105. end


  106. #==============================================================================
  107. # ■ Game_System
  108. #==============================================================================
  109. class Game_System
  110.   attr_accessor :ba_x
  111.   attr_accessor :ba_y
  112.   attr_accessor :al_x
  113.   attr_accessor :al_y
  114.   attr_accessor :wd_hide
  115.   attr_accessor :face_item_width
  116.   alias yima_bv2_initialize initialize
  117.   def initialize
  118.     yima_bv2_initialize
  119.     @ba_x = 0
  120.     @ba_y = 0
  121.     @al_x = 0
  122.     @al_y = 0
  123.     @wd_hide = 0
  124.     @face_item_width = 0
  125.   end
  126. end

  127. #==============================================================================
  128. # ■ Scene_Battle
  129. #==============================================================================
  130. class Scene_Battle < Scene_Base
  131. include YM_CURSOR_P
  132.   if YM_BATTLE_OPTION::GW640GH480 == false
  133.     GW=12
  134.   else
  135.     GW=4
  136.   end
  137.   #-------------------------------------------------------------------------
  138.   # ● 資訊載入
  139.   #-------------------------------------------------------------------------
  140.   def update_info_viewport
  141.     if YM_BATTLE_OPTION::GW640GH480 == false
  142.       move_info_viewport(560)   if @party_command_window.active
  143.       move_info_viewport(560) if @actor_command_window.active
  144.       move_info_viewport(560)  if BattleManager.in_turn?
  145.     else
  146.       move_info_viewport(656)   if @party_command_window.active
  147.       move_info_viewport(656) if @actor_command_window.active
  148.       move_info_viewport(656)  if BattleManager.in_turn?
  149.     end
  150.     @enemy_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  151.     @enemy_window.y =  $game_system.ba_y+YM_CURSOR_P::CURSOR_PY
  152.     @enemy_cursor_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  153.     @enemy_cursor_window.y =  $game_system.ba_y+28+YM_CURSOR_P::CURSOR_PY
  154.     if $game_party.battle_members.size==4
  155.         @actor_window.x = $game_system.al_x*@actor_window.index-GW
  156.     elsif $game_party.battle_members.size==3
  157.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width
  158.     elsif $game_party.battle_members.size==2
  159.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*2
  160.     elsif $game_party.battle_members.size==1
  161.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*3
  162.     elsif $game_party.battle_members.size==5
  163.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/3
  164.     elsif $game_party.battle_members.size>=6
  165.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/2
  166.     end
  167.     @actor_window.y = Graphics.height/4*3-56
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 調整主狀態欄位置
  171.   #--------------------------------------------------------------------------
  172.   def move_info_viewport(ox)
  173.     current_ox = @info_viewport.ox
  174.      if YM_BATTLE_OPTION::GW640GH480 == false
  175.     @info_viewport.ox = [ox, current_ox + 28].min if current_ox < ox
  176.     @info_viewport.ox = [ox, current_ox - 28].max if current_ox > ox
  177.     else
  178.     @info_viewport.ox = [ox, current_ox + 36].min if current_ox < ox
  179.     @info_viewport.ox = [ox, current_ox - 36].max if current_ox > ox
  180.     end
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ● 主狀態欄
  184.   #--------------------------------------------------------------------------
  185.   def create_status_window
  186.     @status_window = Window_BattleStatus.new
  187.     if YM_BATTLE_OPTION::GW640GH480 == false
  188.         if $game_party.battle_members.size>=4
  189.           @status_window.x = 560
  190.         elsif $game_party.battle_members.size==3
  191.           @status_window.x = 560 + $game_system.face_item_width
  192.         elsif $game_party.battle_members.size==2
  193.           @status_window.x = 560 + $game_system.face_item_width*2
  194.         elsif $game_party.battle_members.size==1
  195.           @status_window.x = 560 + $game_system.face_item_width*3
  196.         end
  197.       else
  198.         if $game_party.battle_members.size>=4
  199.           @status_window.x = 656
  200.         elsif $game_party.battle_members.size==3
  201.           @status_window.x = 656 + $game_system.face_item_width
  202.         elsif $game_party.battle_members.size==2
  203.           @status_window.x = 656 + $game_system.face_item_width*2
  204.         elsif $game_party.battle_members.size==1
  205.           @status_window.x = 656 + $game_system.face_item_width*3
  206.         end
  207.       end
  208.   end
  209.    
  210.   #--------------------------------------------------------------------------
  211.   # ● 角色命令欄
  212.   #--------------------------------------------------------------------------
  213.   def create_actor_command_window
  214.     if YM_BATTLE_OPTION::SMALL_ACMD==true
  215.       @actor_command_window = Window_ActorCommandSmall.new
  216.     else
  217.       @actor_command_window = Window_ActorCommand.new
  218.     end
  219.     @actor_command_window.set_handler(:attack, method(:command_attack))
  220.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  221.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  222.     @actor_command_window.set_handler(:item,   method(:command_item))
  223.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  224.   end
  225.    
  226.   #--------------------------------------------------------------------------
  227.   # ● 小隊命令列
  228.   #--------------------------------------------------------------------------
  229.   def create_party_command_window
  230.     @party_command_window = Window_PartyCommand.new
  231.     @party_command_window.set_handler(:fight,  method(:command_fight))
  232.     @party_command_window.set_handler(:escape, method(:command_escape))
  233.     @party_command_window.unselect
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ● 選擇我方目標的視窗
  237.   #--------------------------------------------------------------------------
  238.   def create_actor_window
  239.     @actor_window = Window_BattleActor_Neo.new(@info_viewport)
  240.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  241.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  242.     if $game_party.battle_members.size==4
  243.         @actor_window.x = $game_system.al_x*@actor_window.index-GW
  244.     elsif $game_party.battle_members.size==3
  245.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width
  246.     elsif $game_party.battle_members.size==2
  247.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*2
  248.     elsif $game_party.battle_members.size==1
  249.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*3
  250.     elsif $game_party.battle_members.size==5
  251.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/3
  252.     elsif $game_party.battle_members.size>=6
  253.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/2
  254.     end
  255.     @actor_window.y = Graphics.height/4*3-56
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 選擇敵方目標的視窗
  259.   #--------------------------------------------------------------------------
  260.   def create_enemy_window
  261.     @enemy_window = Window_BattleEnemy.new(@info_viewport)
  262.     @enemy_cursor_window = Window_EnemyCursor.new(@info_viewport)
  263.     @enemy_window.set_handler(:ok,     method(:on_enemy_ok))
  264.     @enemy_window.set_handler(:cancel, method(:on_enemy_cancel))
  265.     @enemy_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  266.     @enemy_window.y =  $game_system.ba_y+YM_CURSOR_P::CURSOR_PY
  267.     @enemy_cursor_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  268.     @enemy_cursor_window.y =  $game_system.ba_y+20+YM_CURSOR_P::CURSOR_PY
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 下一個隊友
  272.   #--------------------------------------------------------------------------
  273.   def next_command
  274.     if BattleManager.next_command
  275.       start_actor_command_selection
  276.       @actor_command_window.show
  277.     else
  278.       turn_start
  279.     end
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 選擇隊友時
  283.   #--------------------------------------------------------------------------
  284.   alias yima_bv2_select_actor_selection select_actor_selection
  285.   def select_actor_selection
  286.     yima_bv2_select_actor_selection
  287.     @actor_command_window.hide
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # ● 取消選擇隊友
  291.   #--------------------------------------------------------------------------
  292.   alias yima_bv2_on_actor_cancel on_actor_cancel
  293.   def on_actor_cancel
  294.     yima_bv2_on_actor_cancel
  295.     if $game_system.wd_hide==1
  296.     @actor_command_window.show
  297.     else
  298.     @actor_command_window.hide
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ● 選擇敵人
  303.   #--------------------------------------------------------------------------
  304.   alias yima_bv2_select_enemy_selection select_enemy_selection
  305.   def select_enemy_selection
  306.     yima_bv2_select_enemy_selection
  307.     @enemy_cursor_window.refresh
  308.     @enemy_cursor_window.show.activate
  309.     @skill_window.hide
  310.     @item_window.hide
  311.     @actor_command_window.hide
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # ● 敵人決定
  315.   #--------------------------------------------------------------------------
  316.   def on_enemy_ok
  317.     BattleManager.actor.input.target_index = @enemy_window.enemy.index
  318.     @enemy_window.hide
  319.     @enemy_cursor_window.hide
  320.     @skill_window.hide
  321.     @item_window.hide
  322.     next_command
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ●  取消選擇敵人
  326.   #--------------------------------------------------------------------------
  327.   def on_enemy_cancel
  328.     @enemy_window.hide
  329.     @enemy_cursor_window.hide   
  330.     case @actor_command_window.current_symbol
  331.     when :attack
  332.       @actor_command_window.activate
  333.     when :skill
  334.       @skill_window.activate.show
  335.     when :item
  336.       @item_window.activate.show
  337.     end
  338.     if $game_system.wd_hide==1
  339.     @actor_command_window.show
  340.     else
  341.     @actor_command_window.hide
  342.     end
  343.   end

  344.   alias yima_bv2_command_skill  command_skill
  345.   def command_skill
  346.     yima_bv2_command_skill
  347.     if $game_system.wd_hide==1
  348.     @actor_command_window.show.activate
  349.     else
  350.     @actor_command_window.hide
  351.     end
  352.   end

  353.   alias yima_bv2_command_item command_item
  354.   def command_item
  355.     yima_bv2_command_item
  356.     if $game_system.wd_hide==1
  357.     @actor_command_window.show.activate
  358.     else
  359.     @actor_command_window.hide
  360.     end
  361.   end

  362.   def on_skill_cancel
  363.     @skill_window.hide
  364.     if $game_system.wd_hide==1
  365.     @actor_command_window.show.activate
  366.     else
  367.     @actor_command_window.hide
  368.     end
  369.   end

  370.   def on_item_cancel
  371.     @item_window.hide
  372.     if $game_system.wd_hide==1
  373.     @actor_command_window.show.activate
  374.     else
  375.     @actor_command_window.hide
  376.     end
  377.   end
  378.   
  379. end

  380. #==============================================================================
  381. # ■ Window_Base
  382. #==============================================================================
  383. class Window_Base < Window
  384.   include YM_BATTLE_OPTION
  385.   #--------------------------------------------------------------------------
  386.   # ● 臉圖重切,預設96*96太大張會壓在血條下面不好看
  387.   #--------------------------------------------------------------------------
  388.   def draw_actor_face_yima(actor, x, y, enabled = true)
  389.     draw_face_m(actor.face_name, actor.face_index, x, y, enabled)
  390.     contents.font.name="VL Gothic"
  391.     contents.font.bold = YM_BATTLE_OPTION::GAUGE_TEXTBOLD
  392.   end
  393.   def draw_actor_face_yima2(actor, x, y, enabled = true)
  394.     draw_face_m2(actor.face_name, actor.face_index, x, y, enabled)
  395.   end
  396.   def draw_actor_face_yima3(actor, x, y, enabled = true)
  397.     draw_face_m3(actor.face_name, actor.face_index, x, y, enabled)
  398.   end
  399.   def draw_actor_face_yima4(actor, x, y, enabled = true)
  400.     draw_face_m4(actor.face_name, actor.face_index, x, y, enabled)
  401.   end
  402.   def draw_face_m(face_name, face_index, x, y, enabled = true)
  403.     bitmap = Cache.face(face_name)
  404.     rect = Rect.new(face_index % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  405.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  406.     bitmap.dispose
  407.   end
  408.   def draw_face_m2(face_name, face_index, x, y, enabled = true)
  409.     bitmap = Cache.face(face_name)
  410.     rect = Rect.new((face_index+1) % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  411.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  412.     bitmap.dispose
  413.   end
  414.   def draw_face_m3(face_name, face_index, x, y, enabled = true)
  415.     bitmap = Cache.face(face_name)
  416.     rect = Rect.new((face_index+2) % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  417.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  418.     bitmap.dispose
  419.   end
  420.   def draw_face_m4(face_name, face_index, x, y, enabled = true)
  421.     bitmap = Cache.face(face_name)
  422.     rect = Rect.new((face_index+3) % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  423.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  424.     bitmap.dispose
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # ● HP 繪製微調
  428.   #--------------------------------------------------------------------------
  429.   def draw_actor_hp_ym(actor, x, y, width = 124)
  430.     if YM_BATTLE_OPTION::GAUGE_ICON_USE ==  true
  431.         if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  432.           draw_gauge(x+14, y, width-14, actor.hp_rate, YM_GAUGE_COLOR::HP_COLOR1, YM_GAUGE_COLOR::HP_COLOR2)
  433.         else
  434.           draw_gauge(x+14, y, width-14, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  435.         end
  436.     else
  437.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  438.         draw_gauge(x, y, width, actor.hp_rate, YM_GAUGE_COLOR::HP_COLOR1, YM_GAUGE_COLOR::HP_COLOR2)
  439.       else
  440.         draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  441.       end
  442.     end
  443.     change_color(system_color)
  444.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  445.     if YM_BATTLE_OPTION::GAUGE_ICON_USE == true
  446.       draw_icon(YM_BATTLE_OPTION::GAUGE_ICON_HP, x-4, y+2)
  447.     else
  448.       draw_text(x, y+4, 30, line_height, Vocab::hp_a)
  449.     end
  450.     if $game_party.battle_members.size>=5
  451.     draw_current_values_ym(x, y+4, width, actor.hp, actor.mhp,hp_color(actor), normal_color)
  452.     else
  453.     draw_current_and_max_values(x, y+4, width, actor.hp, actor.mhp,hp_color(actor), normal_color)
  454.     end
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● MP 繪製微調
  458.   #--------------------------------------------------------------------------
  459.   def draw_actor_mp_ym(actor, x, y, width = 124)
  460.     if YM_BATTLE_OPTION::GAUGE_ICON_USE ==  true
  461.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  462.         draw_gauge(x+14, y, width-14, actor.mp_rate, YM_GAUGE_COLOR::MP_COLOR1, YM_GAUGE_COLOR::MP_COLOR2)
  463.       else
  464.         draw_gauge(x+14, y, width-14, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  465.       end
  466.     else
  467.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  468.         draw_gauge(x, y, width, actor.mp_rate, YM_GAUGE_COLOR::MP_COLOR1, YM_GAUGE_COLOR::MP_COLOR2)
  469.       else
  470.         draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  471.       end
  472.     end
  473.     change_color(system_color)
  474.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  475.     if YM_BATTLE_OPTION::GAUGE_ICON_USE == true
  476.       draw_icon(YM_BATTLE_OPTION::GAUGE_ICON_MP, x-4, y+2)
  477.     else
  478.       draw_text(x, y+4, 30, line_height, Vocab::mp_a)
  479.     end
  480.     if $game_party.battle_members.size>=5
  481.     draw_current_values_ym(x, y+4, width, actor.mp, actor.mmp,mp_color(actor), normal_color)
  482.     else
  483.     draw_current_and_max_values(x, y+4, width, actor.mp, actor.mmp,mp_color(actor), normal_color)
  484.     end
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # ● TP 繪製微調
  488.   #--------------------------------------------------------------------------
  489.   def draw_actor_tp_ym(actor, x, y, width = 124)
  490.     if YM_BATTLE_OPTION::GAUGE_ICON_USE ==  true
  491.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  492.         draw_gauge(x+14, y, width-14, actor.tp_rate, YM_GAUGE_COLOR::TP_COLOR1, YM_GAUGE_COLOR::TP_COLOR2)
  493.       else
  494.         draw_gauge(x+14, y, width-14, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  495.       end
  496.     else
  497.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  498.         draw_gauge(x, y, width, actor.tp_rate, YM_GAUGE_COLOR::TP_COLOR1, YM_GAUGE_COLOR::TP_COLOR2)
  499.       else
  500.         draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  501.       end
  502.     end
  503.     change_color(system_color)
  504.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  505.     if YM_BATTLE_OPTION::GAUGE_ICON_USE == true
  506.       draw_icon(YM_BATTLE_OPTION::GAUGE_ICON_TP, x-4, y+2)
  507.     else
  508.       draw_text(x, y+4, 30, line_height, Vocab::tp_a)
  509.     end
  510.     change_color(tp_color(actor))
  511.     draw_text(x + width - 42, y+4, 42, line_height, actor.tp.to_i, 2)
  512.   end
  513.   
  514.   #--------------------------------------------------------------------------
  515.   # ● 不顯示最大值時
  516.   #--------------------------------------------------------------------------
  517.   def draw_current_values_ym(x, y, width, current, max, color1, color2)
  518.     change_color(color1)
  519.     xr = x + width
  520.     draw_text(xr - 42, y, 42, line_height, current, 2)
  521.   end
  522.   
  523. end

  524. #==============================================================================
  525. # ■ Window_BattleEnemy 指標上方資訊
  526. #==============================================================================
  527. class Window_BattleEnemy < Window_Selectable
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # ●初始化
  531.   #--------------------------------------------------------------------------
  532.   def initialize(info_viewport)
  533.     super(0,0, window_width, fitting_height(1)+8)
  534.     refresh
  535.     self.visible = false
  536.     self.arrows_visible = false
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # ●行數
  540.   #--------------------------------------------------------------------------
  541.   def col_max
  542.     return 1
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ●寬度
  546.   #--------------------------------------------------------------------------
  547.   def window_width
  548.     return 184
  549.     end
  550.   #--------------------------------------------------------------------------
  551.   # ●每格高度
  552.   #--------------------------------------------------------------------------
  553.   def item_height
  554.     return  32
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # ●視窗顯示
  558.   #--------------------------------------------------------------------------
  559.   def show
  560.       width_remain = Graphics.width - width
  561.       select(0)
  562.       $game_system.ba_x=$game_troop.alive_members[index].screen_x-width/2
  563.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height-70
  564.       if $game_troop.alive_members[index].enemy.note.include?("大怪")
  565.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height
  566.       end
  567.     super
  568.   end
  569.   #--------------------------------------------------------------------------
  570.   # ●移動處理
  571.   #--------------------------------------------------------------------------
  572.   def process_cursor_move
  573.     return unless cursor_movable?
  574.     last_index = @index
  575.     cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
  576.     cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
  577.     cursor_down(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
  578.     cursor_up (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
  579.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
  580.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
  581.     Sound.play_cursor if @index != last_index
  582.   end

  583.   def cursor_down(wrap = false)
  584.     if index < item_max - col_max || (wrap && col_max == 1)
  585.       select((index + col_max) % item_max)
  586.       $game_system.ba_x=$game_troop.alive_members[index].screen_x-width/2
  587.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height-70
  588.       if $game_troop.alive_members[index].enemy.note.include?("大怪")
  589.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height
  590.       end
  591.     end
  592.   end

  593.   def cursor_up(wrap = false)
  594.     if index >= col_max || (wrap && col_max == 1)
  595.       select((index - col_max + item_max) % item_max)
  596.       $game_system.ba_x=$game_troop.alive_members[index].screen_x-width/2
  597.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height-70
  598.       if $game_troop.alive_members[index].enemy.note.include?("大怪")
  599.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height
  600.       end
  601.     end
  602.   end
  603.   
  604.   def update_cursor
  605.     if @cursor_all
  606.       cursor_rect.set(0, 0, contents.width, row_max * item_height)
  607.     self.top_row = 0
  608.     elsif @index < 0
  609.       cursor_rect.empty
  610.     else
  611.       ensure_cursor_visible
  612.     end
  613.   end
  614.   
  615.   def battler_graphic
  616.     Cache.battler(enemy.battler_name, enemy.battler_hue)
  617.   end
  618.   
  619.   #--------------------------------------------------------------------------
  620.   # ● 項目繪製
  621.   #--------------------------------------------------------------------------
  622.   def draw_item(index)
  623.     change_color(normal_color)
  624.     name = $game_troop.alive_members[index].name
  625.     draw_text(item_rect_for_text_1(index), name,1) if YM_BATTLE_OPTION::ENEMY_NAMEORPERCENT == true
  626.     draw_hp(index)

  627.   end
  628.   
  629.   #--------------------------------------------------------------------------
  630.   # ● 微調位置
  631.   #--------------------------------------------------------------------------
  632.   def item_rect_for_text_1(index)
  633.     rect = item_rect(index)
  634.     rect.x += 4
  635.     rect.y -= 6
  636.     rect.width -= 8
  637.     rect
  638.   end

  639.   #--------------------------------------------------------------------------
  640.   # ● 敵HP繪製
  641.   #--------------------------------------------------------------------------
  642.   def draw_hp(index)
  643.     rect = item_rect_for_text(index)
  644.     w = rect.width
  645.     x =  0
  646.     hp = $game_troop.alive_members[index].hp_rate
  647.      if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  648.       draw_gauge(x+3, rect.y+5, w, hp, YM_GAUGE_COLOR::HP_COLOR1,YM_GAUGE_COLOR::HP_COLOR2)
  649.     else
  650.       draw_gauge(x+3, rect.y+5, w, hp, hp_gauge_color1, hp_gauge_color2)
  651.     end
  652.     if YM_BATTLE_OPTION::ENEMY_NAMEORPERCENT == false
  653.     contents.font.name="VL Gothic"
  654.     contents.font.bold = YM_BATTLE_OPTION::GAUGE_TEXTBOLD
  655.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  656.     change_color(system_color)
  657.     draw_text(x+3, rect.y-2, 100, line_height, Vocab::hp_a)
  658.     eee = $game_troop.alive_members[index]
  659.     change_color(normal_color)
  660.     draw_en_hp_values(x+3, rect.y, width, eee.hp, eee.mhp, normal_color, normal_color)
  661.     contents.font.name=Font.default_name
  662.     else
  663.     end
  664.   end
  665.   
  666.   def draw_en_hp_values(x, y, width, current, max, color1, color2)
  667.     change_color(color1)
  668.     xr = x + width
  669.     draw_text(xr-84 , y-2, 42, line_height, current*100/max,2)
  670.     draw_text(xr-72, y-2, 42, line_height, "%", 2)
  671.   end

  672. end

  673. #==============================================================================
  674. # ■ Window_BattleActor_Neo  我方指標製作
  675. #==============================================================================
  676. class Window_BattleActor_Neo < Window_Selectable

  677.   def initialize(info_viewport)
  678.     super(0, info_viewport.rect.y, window_width, fitting_height(4))
  679.     refresh
  680.     self.openness = 255
  681.     self.visible = false
  682.     self.arrows_visible = false
  683.     select(0)
  684.     contents.font.name="VL Gothic"
  685.     self.opacity = 0
  686.   end

  687.   def window_width
  688.    184
  689.   end

  690.   def window_height
  691.     fitting_height(line_number)
  692.   end

  693.   def visible_line_number
  694.     return 4
  695.   end
  696.   
  697.   def item_height
  698.    60
  699.   end
  700.   
  701.   def item_max
  702.    $game_party.battle_members.size
  703. end
  704.   
  705.   def update_cursor
  706.     if @cursor_all
  707.       cursor_rect.set(0, 0, contents.width, row_max * item_height)
  708.       self.top_row = 0
  709.     elsif @index < 0
  710.       cursor_rect.empty
  711.     else
  712.       ensure_cursor_visible
  713.     end
  714.   end
  715.   
  716.   def refresh
  717.     contents.clear
  718.     draw_all_items
  719.   end

  720.   def draw_item(index)
  721.     change_color(normal_color)
  722.     contents.font.size = 50
  723.     contents.font.color.set(YM_CURSOR_P::CURSOR_COLOR2)
  724.     draw_text(item_rect_for_text(index), "▼",1)
  725.   end

  726.   def basic_area_rect(index)
  727.     rect = item_rect_for_text(index)
  728.     rect.width -= gauge_area_width + 10
  729.     rect
  730.   end

  731.   def gauge_area_rect(index)
  732.     rect = item_rect_for_text(index)
  733.     rect.x += rect.width - gauge_area_width
  734.     rect.width = gauge_area_width
  735.     rect
  736.   end

  737.   def gauge_area_width
  738.     return 220
  739.   end
  740.   
  741.   def pos_x
  742.     if $game_party.battle_members.size>=4
  743.       (Graphics.width-24) / $game_party.battle_members.size
  744.     elsif $game_party.battle_members.size==3
  745.       (Graphics.width-22-$game_system.face_item_width*2) / $game_party.battle_members.size
  746.     elsif $game_party.battle_members.size==2
  747.       (Graphics.width-20-$game_system.face_item_width*4) / $game_party.battle_members.size
  748.     elsif $game_party.battle_members.size==1
  749.       (Graphics.width-18-$game_system.face_item_width*6) / $game_party.battle_members.size
  750.     end
  751.   end

  752.   def pos_y
  753.     Graphics.height
  754.   end
  755.   
  756.   #--------------------------------------------------------------------------
  757.   # ●移動處理
  758.   #--------------------------------------------------------------------------
  759.   def process_cursor_move
  760.     return unless cursor_movable?
  761.     last_index = @index
  762.     cursor_down(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
  763.     cursor_up (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
  764.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
  765.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
  766.     Sound.play_cursor if @index != last_index
  767.   end

  768.   def cursor_down(wrap = false)
  769.     if index < item_max - col_max || (wrap && col_max == 1)
  770.       select((index + col_max) % item_max)
  771.     end
  772.   end

  773.   
  774.   def cursor_up(wrap = false)
  775.     if index >= col_max || (wrap && col_max == 1)
  776.       select((index - col_max + item_max) % item_max)
  777.     end
  778.   end
  779.   
  780.   
  781.   def show
  782.     $game_system.al_x=pos_x
  783.     $game_system.al_y=pos_y
  784.     if @info_viewport
  785.       width_remain = Graphics.width - width
  786.       self.x = width_remain
  787.       @info_viewport.rect.width = width_remain
  788.       select(0)
  789.     end
  790.     super
  791.   end

  792.   def hide
  793.     @info_viewport.rect.width = Graphics.width if @info_viewport
  794.     super
  795.   end
  796. end

  797. #==============================================================================
  798. # ■ Window_PartyCommand 小隊命令
  799. #==============================================================================
  800. class Window_PartyCommand < Window_Command
  801.   def initialize
  802.     super(Graphics.width/2-window_width/2, 108)
  803.     self.openness = 0
  804.     deactivate
  805.   end
  806.   def alignment
  807.     return 1
  808.   end
  809.   def window_width
  810.     return 108
  811.   end
  812.   def window_height
  813.     return 72
  814.   end
  815. end

  816. #==============================================================================
  817. # ■ Window_EnemyCursor 指標製作
  818. #==============================================================================
  819. class Window_EnemyCursor < Window_Selectable

  820.   def initialize(info_viewport)
  821.     super(0, 0, window_width, fitting_height(2))
  822.     refresh
  823.     self.visible = false
  824.     self.opacity = 0
  825.   end

  826.   def window_width
  827.     184
  828.   end

  829.   def col_max
  830.     return 1
  831.   end

  832.   def item_height
  833.    48
  834.   end

  835.   def item_max
  836.     1
  837.   end

  838.   def draw_item(index)
  839.     change_color(normal_color)
  840.     contents.font.size = 30
  841.     contents.font.name="Arial"
  842.     contents.font.color.set(YM_CURSOR_P::CURSOR_COLOR)
  843.     draw_text(item_rect_for_text(index), "▼",1)
  844.   end

  845.   def update_cursor
  846.     if @cursor_all
  847.       cursor_rect.set(0, 0, contents.width, row_max * item_height)
  848.       self.top_row = 0
  849.     elsif @index < 0
  850.       cursor_rect.empty
  851.     else
  852.       ensure_cursor_visible
  853.     end
  854.   end

  855.   def show
  856.       width_remain = Graphics.width - width
  857.       self.x = width_remain
  858.       select(0)
  859.     super
  860.   end

  861.   def hide
  862.     super
  863.   end
  864. end

  865. #==============================================================================
  866. # ■ Window_BattleSkill 視窗資訊暫存
  867. #==============================================================================
  868. class Window_BattleSkill < Window_SkillList

  869.   alias yima_bv2_show show
  870.   def show
  871.       $game_system.wd_hide=0
  872.       yima_bv2_show
  873.   end

  874.   alias yima_bv2_hide hide
  875.   def hide
  876.       $game_system.wd_hide=1
  877.       yima_bv2_hide
  878.   end
  879.   
  880. end

  881. #==============================================================================
  882. # ■ Window_BattleItem 視窗資訊暫存
  883. #==============================================================================
  884. class Window_BattleItem < Window_ItemList

  885.   alias yima_bv2_show show
  886.   def show
  887.       $game_system.wd_hide=0
  888.       yima_bv2_show
  889.   end

  890.   alias yima_bv2_hide hide
  891.   def hide
  892.       $game_system.wd_hide=1
  893.       yima_bv2_hide
  894.   end
  895.   
  896. end

  897. #==============================================================================
  898. # ■ Window_ActorCommand 角色指令
  899. #==============================================================================
  900. class Window_ActorCommand < Window_Command
  901.   alias yima_bacmd_initialize initialize
  902.   def initialize
  903.     yima_bacmd_initialize
  904.     self.arrows_visible = false
  905.   end
  906.   #--------------------------------------------------------------------------
  907.   # ●寬
  908.   #--------------------------------------------------------------------------
  909.   def window_width
  910.     return  $game_party.battle_members.size>=6 ? 110 : 128
  911.   end
  912.   #--------------------------------------------------------------------------
  913.   # ●設定位置
  914.   #--------------------------------------------------------------------------
  915.   def setup(actor)
  916.     acmd_arrange = $game_system.face_item_width
  917.     @actor = actor
  918.     if $game_party.battle_members.size==4
  919.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  920.     elsif $game_party.battle_members.size==3
  921.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange
  922.     elsif $game_party.battle_members.size==2
  923.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*2
  924.     elsif $game_party.battle_members.size==1
  925.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*3
  926.     elsif $game_party.battle_members.size>=5
  927.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  928.     end
  929.     self.y = actor.pos_y - self.height-100
  930.     clear_command_list
  931.     make_command_list
  932.     refresh
  933.     self.height = fitting_height(@list.size)
  934.     self.y = actor.pos_y - self.height-100
  935.     select(0)
  936.     activate
  937.     open
  938.   end
  939. end

  940. #==============================================================================
  941. # ■  Game_Actor 設定位置
  942. #==============================================================================
  943. class Game_Actor < Game_Battler
  944.   def pos_x
  945.     if $game_party.battle_members.size>=4
  946.       (Graphics.width-24) / $game_party.battle_members.size
  947.     elsif $game_party.battle_members.size==3
  948.       (Graphics.width-22-$game_system.face_item_width*2) / $game_party.battle_members.size
  949.     elsif $game_party.battle_members.size==2
  950.       (Graphics.width-20-$game_system.face_item_width*4) / $game_party.battle_members.size
  951.     elsif $game_party.battle_members.size==1
  952.       (Graphics.width-18-$game_system.face_item_width*6) / $game_party.battle_members.size
  953.     end
  954.   end
  955.   def pos_y
  956.     Graphics.height
  957.   end
  958. end
  959. #==============================================================================
  960. # ■  Game_Party 參戰人數
  961. #==============================================================================
  962. class Game_Party < Game_Unit
  963.   def max_battle_members
  964.     return YM_BATTLE_OPTION::MAXBM
  965.   end
  966. end

  967. #==============================================================================
  968. # ■ Window_ActorCommandSmall 簡易命令列製作
  969. #==============================================================================
  970. class Window_ActorCommandSmall < Window_HorzCommand
  971.   #--------------------------------------------------------------------------
  972.   # ●初始化
  973.   #--------------------------------------------------------------------------
  974.   def initialize
  975.     super(0, 0)
  976.     self.openness = 0
  977.     deactivate
  978.     @actor = nil
  979.     self.arrows_visible = false
  980.   end
  981.   #--------------------------------------------------------------------------
  982.   # ●移動處理
  983.   #--------------------------------------------------------------------------
  984.   def window_width
  985.     return  $game_party.battle_members.size>=6 ? 110 : 128
  986.   end
  987.   
  988.   def window_height
  989.     return 48
  990.   end
  991.   
  992.   def item_width
  993.     (width - standard_padding * 2 + spacing) /1  - spacing
  994.   end
  995.   
  996.   def col_max
  997.     return @list.size+1
  998.   end
  999.   
  1000.   def row_max
  1001.     1
  1002.   end
  1003.   
  1004.   def page_col_max
  1005.     1
  1006.   end
  1007.   
  1008.   def col
  1009.     index / row_max
  1010.   end
  1011.   
  1012.   def top_col
  1013.     ox / (item_width + spacing)
  1014.   end
  1015.   
  1016.   def bottom_col
  1017.     top_col + page_col_max - 1
  1018.   end

  1019.   def bottom_col=(col)
  1020.     self.top_col = col - (page_col_max - 1)
  1021.   end

  1022.   def ensure_cursor_visible
  1023.     self.top_col = col if col < top_col
  1024.     self.bottom_col = col if col > bottom_col
  1025.   end
  1026.   
  1027.   def visible_line_number
  1028.     return 4
  1029.   end
  1030.   #--------------------------------------------------------------------------
  1031.   # ●箭頭繪製
  1032.   #--------------------------------------------------------------------------
  1033.   def draw_item(index)
  1034.     change_color(normal_color, command_enabled?(index))
  1035.     draw_text(item_rect_for_text(index), command_name(index), alignment)
  1036.     change_color(normal_color)
  1037.     contents.font.size = 16
  1038.     contents.font.name="Arial"
  1039.     if $game_party.battle_members.size>=6
  1040.     draw_text(item_rect_for_text(index), "◄       ►",alignment)
  1041.     else
  1042.     draw_text(item_rect_for_text(index), "◄        ►",alignment)
  1043.     end
  1044.     contents.font.name=Font.default_name
  1045.     contents.font.size = Font.default_size
  1046.     change_color(normal_color, command_enabled?(index))
  1047.   end
  1048.   #--------------------------------------------------------------------------
  1049.   # ●建立指令列
  1050.   #--------------------------------------------------------------------------
  1051.   def make_command_list
  1052.     return unless @actor
  1053.     add_attack_command
  1054.     add_skill_commands
  1055.     add_guard_command
  1056.     add_item_command
  1057.   end
  1058.   #--------------------------------------------------------------------------
  1059.   # ●增加攻擊指令
  1060.   #--------------------------------------------------------------------------
  1061.   def add_attack_command
  1062.     add_command(Vocab::attack, :attack, @actor.attack_usable?)
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # ●增加技能指令
  1066.   #--------------------------------------------------------------------------
  1067.   def add_skill_commands
  1068.     @actor.added_skill_types.sort.each do |stype_id|
  1069.       name = $data_system.skill_types[stype_id]
  1070.       add_command(name, :skill, true, stype_id)
  1071.     end
  1072.   end
  1073.   #--------------------------------------------------------------------------
  1074.   # ●增加防禦指令
  1075.   #--------------------------------------------------------------------------
  1076.   def add_guard_command
  1077.     add_command(Vocab::guard, :guard, @actor.guard_usable?)
  1078.   end
  1079.   #--------------------------------------------------------------------------
  1080.   # ●增加物品指令
  1081.   #--------------------------------------------------------------------------
  1082.   def add_item_command
  1083.     add_command(Vocab::item, :item)
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # ●建立
  1087.   #--------------------------------------------------------------------------
  1088.   def setup(actor)
  1089.     acmd_arrange = $game_system.face_item_width
  1090.     @actor = actor
  1091.     if $game_party.battle_members.size==4
  1092.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  1093.     elsif $game_party.battle_members.size==3
  1094.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange
  1095.     elsif $game_party.battle_members.size==2
  1096.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*2
  1097.     elsif $game_party.battle_members.size==1
  1098.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*3
  1099.     elsif $game_party.battle_members.size>=5
  1100.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  1101.     end
  1102.     self.y = actor.pos_y - self.height-100
  1103.     clear_command_list
  1104.     make_command_list
  1105.     refresh
  1106.     select(0)
  1107.     activate
  1108.     open
  1109.   end
  1110. end


  1111. #==============================================================================
  1112. # ■ Window_BattleStatus
  1113. #==============================================================================
  1114. class Window_BattleStatus < Window_Selectable
  1115.   #--------------------------------------------------------------------------
  1116.   # ● 初始化
  1117.   #--------------------------------------------------------------------------
  1118.   def initialize
  1119.     super(0, 8, Graphics.width, window_height)
  1120.     self.opacity = 0
  1121.     refresh
  1122.     self.openness = 0
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● 高
  1126.   #--------------------------------------------------------------------------
  1127.   def window_height
  1128.     fitting_height(visible_line_number)
  1129.   end
  1130.   #--------------------------------------------------------------------------
  1131.   # ● 三條計量表行高
  1132.   #--------------------------------------------------------------------------
  1133.   def gauge_line_height
  1134.     return 16
  1135.   end
  1136.   #--------------------------------------------------------------------------
  1137.   # ● 行數
  1138.   #--------------------------------------------------------------------------
  1139.   def col_max
  1140.     return [item_max, 4].max
  1141.   end
  1142.   #--------------------------------------------------------------------------
  1143.   # ● 項目間隔
  1144.   #--------------------------------------------------------------------------
  1145.   def spacing
  1146.     return 0
  1147.   end
  1148.   #--------------------------------------------------------------------------
  1149.   # ● 項目繪製區
  1150.   #--------------------------------------------------------------------------
  1151.   def item_rect(index)
  1152.     rect = Rect.new
  1153.     rect.width = item_width
  1154.     rect.height = contents_height
  1155.     rect.x = index % col_max * (item_width + spacing)
  1156.     rect.y = index / col_max * contents_height
  1157.     rect
  1158.   end
  1159.   #--------------------------------------------------------------------------
  1160.   # ● 基本繪製區域
  1161.   #--------------------------------------------------------------------------
  1162.   def basic_area_rect(index)
  1163.     rect = item_rect_for_text(index)
  1164.     rect.height -= gauge_area_height
  1165.     rect
  1166.   end
  1167.   #--------------------------------------------------------------------------
  1168.   # ● 棒條繪製區域
  1169.   #--------------------------------------------------------------------------
  1170.   def gauge_area_rect(index)
  1171.     rect = item_rect_for_text(index)
  1172.     rect.y += contents_height - gauge_area_height - 8
  1173.     rect.height = gauge_area_height
  1174.     rect
  1175.   end
  1176.   #--------------------------------------------------------------------------
  1177.   # ● 棒條繪製區域高
  1178.   #--------------------------------------------------------------------------
  1179.   def gauge_area_height
  1180.     return (gauge_line_height * ($data_system.opt_display_tp ? 3 : 2))
  1181.   end
  1182.   #--------------------------------------------------------------------------
  1183.   # ● 內容繪製
  1184.   #--------------------------------------------------------------------------
  1185.   def draw_basic_area(rect, actor)
  1186.     $game_system.face_item_width=item_width/2
  1187.     bms=$game_party.battle_members.size
  1188.     if $data_system.opt_display_tp
  1189.       notpy=0
  1190.     else
  1191.       notpy=8
  1192.     end
  1193.     if YM_BATTLE_OPTION::BFC==true
  1194.       if actor.hp < actor.mhp / 2 && actor.hp > actor.mhp / 4
  1195.         draw_actor_face_yima2(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1196.       elsif actor.hp < actor.mhp / 4 && actor.hp > 0
  1197.         draw_actor_face_yima3(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1198.       elsif actor.hp == 0
  1199.         draw_actor_face_yima4(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1200.       else
  1201.         draw_actor_face_yima(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1202.       end
  1203.     else
  1204.       draw_actor_face_yima(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1205.     end
  1206.     draw_actor_icons(actor, rect.x, rect.y, rect.width+8)
  1207.   end
  1208.   #--------------------------------------------------------------------------
  1209.   # ● 計量表繪製
  1210.   #--------------------------------------------------------------------------
  1211.   def draw_gauge_area_with_tp(rect, actor)
  1212.     draw_actor_hp_ym(actor, rect.x, rect.y + gauge_line_height * 0, rect.width)
  1213.     draw_actor_mp_ym(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
  1214.     draw_actor_tp_ym(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
  1215.   end
  1216.   #--------------------------------------------------------------------------
  1217.   # ● 計量表繪製(無TP)
  1218.   #--------------------------------------------------------------------------
  1219.   def draw_gauge_area_without_tp(rect, actor)
  1220.     draw_actor_hp_ym(actor, rect.x, rect.y + gauge_line_height * 0-8, rect.width)
  1221.     draw_actor_mp_ym(actor, rect.x, rect.y + gauge_line_height * 1-8, rect.width)
  1222.   end
  1223. end

复制代码
梦石
0
星屑
6375
在线时间
1473 小时
注册时间
2015-7-25
回帖
609

极短25参与开拓者

发表于 2017-10-20 09:37:45 | 显示全部楼层
角色加入队伍后没有更新战斗状态窗口的位置
那就加一个update方法在这个窗口的类里让窗口随时更新x坐标
  1. class Window_BattleStatus < Window_Selectable
  2.   def update
  3.     super
  4.     if YM_BATTLE_OPTION::GW640GH480 == false
  5.         if $game_party.battle_members.size>=4
  6.           self.x = 560
  7.         elsif $game_party.battle_members.size==3
  8.           self.x = 560 + $game_system.face_item_width
  9.         elsif $game_party.battle_members.size==2
  10.           self.x = 560 + $game_system.face_item_width*2
  11.         elsif $game_party.battle_members.size==1
  12.           self.x = 560 + $game_system.face_item_width*3
  13.         end
  14.       else
  15.         if $game_party.battle_members.size>=4
  16.           self.x = 656
  17.         elsif $game_party.battle_members.size==3
  18.           self.x = 656 + $game_system.face_item_width
  19.         elsif $game_party.battle_members.size==2
  20.           self.x = 656 + $game_system.face_item_width*2
  21.         elsif $game_party.battle_members.size==1
  22.           self.x = 656 + $game_system.face_item_width*3
  23.         end
  24.       end
  25.   end
  26. end
复制代码


评分

参与人数 1赞 +1 收起 理由
D-Jack + 1 认可答案

查看全部评分

笨肉包的游戏讨论群932812135 (实时更新) 喜欢的话欢迎加入~
目前的坑
??? #像素风OC游戏 准备中 短篇-约5小时
花城梦之心 #像素风OC游戏 系统开发+素材绘制中
【不可思议的迷宫】幽灵契约外传:歌莉娅 v0.4 游戏文件已更新
同时更新中~ (沉迷摸鱼中~更新速度较慢请见谅w)
这是属于笨肉包一个人的旅行~(这只肉包又在摸鱼!
旅途的最终目标~ ???(保密~
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部