设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1388|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
536
在线时间
69 小时
注册时间
2016-5-5
帖子
31
跳转到指定楼层
1
发表于 2017-10-19 22:31:08 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

像这样



RUBY 代码复制
  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.  
  69. module YM_CURSOR_P
  70.  
  71. #調整敵人指標水平位置(左移:負數,右移:正數)
  72. CURSOR_PX = 0
  73.  
  74. #調整敵人指標垂直位置(上移:負數,下移:正數)
  75. CURSOR_PY = 62
  76.  
  77. #調整敵人指標小箭頭RGB顏色
  78. CURSOR_COLOR = Color.new(255,255,255)
  79.  
  80. #調整我方指標箭頭RGB顏色
  81. CURSOR_COLOR2 = Color.new(255,255,255)
  82.  
  83. end
  84.  
  85. module YM_BATTLE_OPTION
  86.  
  87. #最大參戰人數,建議不要超過六人
  88. MAXBM = 6
  89.  
  90. #設定計量表(HP、MP、TP)文字的字體大小。
  91. GAUGE_TEXTSIZE = 20
  92.  
  93. #設定計量表(HP、MP、TP)文字是否使用粗體。
  94. GAUGE_TEXTBOLD = true
  95.  
  96. #是否使用圖標取代傳統HP、MP、TP文字
  97. GAUGE_ICON_USE =  false
  98. #HP圖標編號(GAUGE_ICON_USE =  true才有效)
  99. GAUGE_ICON_HP =  187
  100. #MP圖標編號(GAUGE_ICON_USE =  true才有效)
  101. GAUGE_ICON_MP =  188
  102. #TP圖標編號(GAUGE_ICON_USE =  true才有效)
  103. GAUGE_ICON_TP =  189
  104.  
  105. #是否使用隨血量改變表情功能
  106. BFC = false
  107.  
  108. #是否使用簡易版角色指令列,簡易版不支援指令選項加上圖標腳本
  109. SMALL_ACMD = false
  110.  
  111. #指標資訊顯示敵人名稱或血量百分比(true=敵人名稱,false=血量百分比)
  112. ENEMY_NAMEORPERCENT = true
  113.  
  114. #是否導入姨媽自訂計量條顏色腳本的設定
  115. GAUGE_COLOR_HAVE = false
  116.  
  117. #遊戲畫面大小是否為640*480?若是請用true,沒改過請保持false
  118. GW640GH480 = false
  119.  
  120. end
  121.  
  122.  
  123. #==============================================================================
  124. # ■ Game_System
  125. #==============================================================================
  126. class Game_System
  127.   attr_accessor :ba_x
  128.   attr_accessor :ba_y
  129.   attr_accessor :al_x
  130.   attr_accessor :al_y
  131.   attr_accessor :wd_hide
  132.   attr_accessor :face_item_width
  133.   alias yima_bv2_initialize initialize
  134.   def initialize
  135.     yima_bv2_initialize
  136.     @ba_x = 0
  137.     @ba_y = 0
  138.     @al_x = 0
  139.     @al_y = 0
  140.     @wd_hide = 0
  141.     @face_item_width = 0
  142.   end
  143. end
  144.  
  145. #==============================================================================
  146. # ■ Scene_Battle
  147. #==============================================================================
  148. class Scene_Battle < Scene_Base
  149. include YM_CURSOR_P
  150.   if YM_BATTLE_OPTION::GW640GH480 == false
  151.     GW=12
  152.   else
  153.     GW=4
  154.   end
  155.   #-------------------------------------------------------------------------
  156.   # ● 資訊載入
  157.   #-------------------------------------------------------------------------
  158.   def update_info_viewport
  159.     if YM_BATTLE_OPTION::GW640GH480 == false
  160.       move_info_viewport(560)   if @party_command_window.active
  161.       move_info_viewport(560) if @actor_command_window.active
  162.       move_info_viewport(560)  if BattleManager.in_turn?
  163.     else
  164.       move_info_viewport(656)   if @party_command_window.active
  165.       move_info_viewport(656) if @actor_command_window.active
  166.       move_info_viewport(656)  if BattleManager.in_turn?
  167.     end
  168.     @enemy_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  169.     @enemy_window.y =  $game_system.ba_y+YM_CURSOR_P::CURSOR_PY
  170.     @enemy_cursor_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  171.     @enemy_cursor_window.y =  $game_system.ba_y+28+YM_CURSOR_P::CURSOR_PY
  172.     if $game_party.battle_members.size==4
  173.         @actor_window.x = $game_system.al_x*@actor_window.index-GW
  174.     elsif $game_party.battle_members.size==3
  175.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width
  176.     elsif $game_party.battle_members.size==2
  177.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*2
  178.     elsif $game_party.battle_members.size==1
  179.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*3
  180.     elsif $game_party.battle_members.size==5
  181.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/3
  182.     elsif $game_party.battle_members.size>=6
  183.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/2
  184.     end
  185.     @actor_window.y = Graphics.height/4*3-56
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ● 調整主狀態欄位置
  189.   #--------------------------------------------------------------------------
  190.   def move_info_viewport(ox)
  191.     current_ox = @info_viewport.ox
  192.      if YM_BATTLE_OPTION::GW640GH480 == false
  193.     @info_viewport.ox = [ox, current_ox + 28].min if current_ox < ox
  194.     @info_viewport.ox = [ox, current_ox - 28].max if current_ox > ox
  195.     else
  196.     @info_viewport.ox = [ox, current_ox + 36].min if current_ox < ox
  197.     @info_viewport.ox = [ox, current_ox - 36].max if current_ox > ox
  198.     end
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 主狀態欄
  202.   #--------------------------------------------------------------------------
  203.   def create_status_window
  204.     @status_window = Window_BattleStatus.new
  205.     if YM_BATTLE_OPTION::GW640GH480 == false
  206.         if $game_party.battle_members.size>=4
  207.           @status_window.x = 560
  208.         elsif $game_party.battle_members.size==3
  209.           @status_window.x = 560 + $game_system.face_item_width
  210.         elsif $game_party.battle_members.size==2
  211.           @status_window.x = 560 + $game_system.face_item_width*2
  212.         elsif $game_party.battle_members.size==1
  213.           @status_window.x = 560 + $game_system.face_item_width*3
  214.         end
  215.       else
  216.         if $game_party.battle_members.size>=4
  217.           @status_window.x = 656
  218.         elsif $game_party.battle_members.size==3
  219.           @status_window.x = 656 + $game_system.face_item_width
  220.         elsif $game_party.battle_members.size==2
  221.           @status_window.x = 656 + $game_system.face_item_width*2
  222.         elsif $game_party.battle_members.size==1
  223.           @status_window.x = 656 + $game_system.face_item_width*3
  224.         end
  225.       end
  226.   end
  227.  
  228.   #--------------------------------------------------------------------------
  229.   # ● 角色命令欄
  230.   #--------------------------------------------------------------------------
  231.   def create_actor_command_window
  232.     if YM_BATTLE_OPTION::SMALL_ACMD==true
  233.       @actor_command_window = Window_ActorCommandSmall.new
  234.     else
  235.       @actor_command_window = Window_ActorCommand.new
  236.     end
  237.     @actor_command_window.set_handler(:attack, method(:command_attack))
  238.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  239.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  240.     @actor_command_window.set_handler(:item,   method(:command_item))
  241.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  242.   end
  243.  
  244.   #--------------------------------------------------------------------------
  245.   # ● 小隊命令列
  246.   #--------------------------------------------------------------------------
  247.   def create_party_command_window
  248.     @party_command_window = Window_PartyCommand.new
  249.     @party_command_window.set_handler(:fight,  method(:command_fight))
  250.     @party_command_window.set_handler(:escape, method(:command_escape))
  251.     @party_command_window.unselect
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 選擇我方目標的視窗
  255.   #--------------------------------------------------------------------------
  256.   def create_actor_window
  257.     @actor_window = Window_BattleActor_Neo.new(@info_viewport)
  258.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  259.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  260.     if $game_party.battle_members.size==4
  261.         @actor_window.x = $game_system.al_x*@actor_window.index-GW
  262.     elsif $game_party.battle_members.size==3
  263.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width
  264.     elsif $game_party.battle_members.size==2
  265.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*2
  266.     elsif $game_party.battle_members.size==1
  267.         @actor_window.x = $game_system.al_x*@actor_window.index-GW+$game_system.face_item_width*3
  268.     elsif $game_party.battle_members.size==5
  269.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/3
  270.     elsif $game_party.battle_members.size>=6
  271.         @actor_window.x = $game_system.al_x*@actor_window.index-GW-$game_system.face_item_width/2
  272.     end
  273.     @actor_window.y = Graphics.height/4*3-56
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 選擇敵方目標的視窗
  277.   #--------------------------------------------------------------------------
  278.   def create_enemy_window
  279.     @enemy_window = Window_BattleEnemy.new(@info_viewport)
  280.     @enemy_cursor_window = Window_EnemyCursor.new(@info_viewport)
  281.     @enemy_window.set_handler(:ok,     method(:on_enemy_ok))
  282.     @enemy_window.set_handler(:cancel, method(:on_enemy_cancel))
  283.     @enemy_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  284.     @enemy_window.y =  $game_system.ba_y+YM_CURSOR_P::CURSOR_PY
  285.     @enemy_cursor_window.x =  $game_system.ba_x+YM_CURSOR_P::CURSOR_PX
  286.     @enemy_cursor_window.y =  $game_system.ba_y+20+YM_CURSOR_P::CURSOR_PY
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 下一個隊友
  290.   #--------------------------------------------------------------------------
  291.   def next_command
  292.     if BattleManager.next_command
  293.       start_actor_command_selection
  294.       @actor_command_window.show
  295.     else
  296.       turn_start
  297.     end
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● 選擇隊友時
  301.   #--------------------------------------------------------------------------
  302.   alias yima_bv2_select_actor_selection select_actor_selection
  303.   def select_actor_selection
  304.     yima_bv2_select_actor_selection
  305.     @actor_command_window.hide
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 取消選擇隊友
  309.   #--------------------------------------------------------------------------
  310.   alias yima_bv2_on_actor_cancel on_actor_cancel
  311.   def on_actor_cancel
  312.     yima_bv2_on_actor_cancel
  313.     if $game_system.wd_hide==1
  314.     @actor_command_window.show
  315.     else
  316.     @actor_command_window.hide
  317.     end
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 選擇敵人
  321.   #--------------------------------------------------------------------------
  322.   alias yima_bv2_select_enemy_selection select_enemy_selection
  323.   def select_enemy_selection
  324.     yima_bv2_select_enemy_selection
  325.     @enemy_cursor_window.refresh
  326.     @enemy_cursor_window.show.activate
  327.     @skill_window.hide
  328.     @item_window.hide
  329.     @actor_command_window.hide
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ● 敵人決定
  333.   #--------------------------------------------------------------------------
  334.   def on_enemy_ok
  335.     BattleManager.actor.input.target_index = @enemy_window.enemy.index
  336.     @enemy_window.hide
  337.     @enemy_cursor_window.hide
  338.     @skill_window.hide
  339.     @item_window.hide
  340.     next_command
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ●  取消選擇敵人
  344.   #--------------------------------------------------------------------------
  345.   def on_enemy_cancel
  346.     @enemy_window.hide
  347.     @enemy_cursor_window.hide   
  348.     case @actor_command_window.current_symbol
  349.     when :attack
  350.       @actor_command_window.activate
  351.     when :skill
  352.       @skill_window.activate.show
  353.     when :item
  354.       @item_window.activate.show
  355.     end
  356.     if $game_system.wd_hide==1
  357.     @actor_command_window.show
  358.     else
  359.     @actor_command_window.hide
  360.     end
  361.   end
  362.  
  363.   alias yima_bv2_command_skill  command_skill
  364.   def command_skill
  365.     yima_bv2_command_skill
  366.     if $game_system.wd_hide==1
  367.     @actor_command_window.show.activate
  368.     else
  369.     @actor_command_window.hide
  370.     end
  371.   end
  372.  
  373.   alias yima_bv2_command_item command_item
  374.   def command_item
  375.     yima_bv2_command_item
  376.     if $game_system.wd_hide==1
  377.     @actor_command_window.show.activate
  378.     else
  379.     @actor_command_window.hide
  380.     end
  381.   end
  382.  
  383.   def on_skill_cancel
  384.     @skill_window.hide
  385.     if $game_system.wd_hide==1
  386.     @actor_command_window.show.activate
  387.     else
  388.     @actor_command_window.hide
  389.     end
  390.   end
  391.  
  392.   def on_item_cancel
  393.     @item_window.hide
  394.     if $game_system.wd_hide==1
  395.     @actor_command_window.show.activate
  396.     else
  397.     @actor_command_window.hide
  398.     end
  399.   end
  400.  
  401. end
  402.  
  403. #==============================================================================
  404. # ■ Window_Base
  405. #==============================================================================
  406. class Window_Base < Window
  407.   include YM_BATTLE_OPTION
  408.   #--------------------------------------------------------------------------
  409.   # ● 臉圖重切,預設96*96太大張會壓在血條下面不好看
  410.   #--------------------------------------------------------------------------
  411.   def draw_actor_face_yima(actor, x, y, enabled = true)
  412.     draw_face_m(actor.face_name, actor.face_index, x, y, enabled)
  413.     contents.font.name="VL Gothic"
  414.     contents.font.bold = YM_BATTLE_OPTION::GAUGE_TEXTBOLD
  415.   end
  416.   def draw_actor_face_yima2(actor, x, y, enabled = true)
  417.     draw_face_m2(actor.face_name, actor.face_index, x, y, enabled)
  418.   end
  419.   def draw_actor_face_yima3(actor, x, y, enabled = true)
  420.     draw_face_m3(actor.face_name, actor.face_index, x, y, enabled)
  421.   end
  422.   def draw_actor_face_yima4(actor, x, y, enabled = true)
  423.     draw_face_m4(actor.face_name, actor.face_index, x, y, enabled)
  424.   end
  425.   def draw_face_m(face_name, face_index, x, y, enabled = true)
  426.     bitmap = Cache.face(face_name)
  427.     rect = Rect.new(face_index % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  428.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  429.     bitmap.dispose
  430.   end
  431.   def draw_face_m2(face_name, face_index, x, y, enabled = true)
  432.     bitmap = Cache.face(face_name)
  433.     rect = Rect.new((face_index+1) % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  434.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  435.     bitmap.dispose
  436.   end
  437.   def draw_face_m3(face_name, face_index, x, y, enabled = true)
  438.     bitmap = Cache.face(face_name)
  439.     rect = Rect.new((face_index+2) % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  440.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  441.     bitmap.dispose
  442.   end
  443.   def draw_face_m4(face_name, face_index, x, y, enabled = true)
  444.     bitmap = Cache.face(face_name)
  445.     rect = Rect.new((face_index+3) % 4 * 96,  face_index>=4 ? (face_index+16) / 4 * 24 : (face_index+4) / 4 * 24, 96, 48)
  446.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  447.     bitmap.dispose
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # ● HP 繪製微調
  451.   #--------------------------------------------------------------------------
  452.   def draw_actor_hp_ym(actor, x, y, width = 124)
  453.     if YM_BATTLE_OPTION::GAUGE_ICON_USE ==  true
  454.         if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  455.           draw_gauge(x+14, y, width-14, actor.hp_rate, YM_GAUGE_COLOR::HP_COLOR1, YM_GAUGE_COLOR::HP_COLOR2)
  456.         else
  457.           draw_gauge(x+14, y, width-14, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  458.         end
  459.     else
  460.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  461.         draw_gauge(x, y, width, actor.hp_rate, YM_GAUGE_COLOR::HP_COLOR1, YM_GAUGE_COLOR::HP_COLOR2)
  462.       else
  463.         draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  464.       end
  465.     end
  466.     change_color(system_color)
  467.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  468.     if YM_BATTLE_OPTION::GAUGE_ICON_USE == true
  469.       draw_icon(YM_BATTLE_OPTION::GAUGE_ICON_HP, x-4, y+2)
  470.     else
  471.       draw_text(x, y+4, 30, line_height, Vocab::hp_a)
  472.     end
  473.     if $game_party.battle_members.size>=5
  474.     draw_current_values_ym(x, y+4, width, actor.hp, actor.mhp,hp_color(actor), normal_color)
  475.     else
  476.     draw_current_and_max_values(x, y+4, width, actor.hp, actor.mhp,hp_color(actor), normal_color)
  477.     end
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # ● MP 繪製微調
  481.   #--------------------------------------------------------------------------
  482.   def draw_actor_mp_ym(actor, x, y, width = 124)
  483.     if YM_BATTLE_OPTION::GAUGE_ICON_USE ==  true
  484.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  485.         draw_gauge(x+14, y, width-14, actor.mp_rate, YM_GAUGE_COLOR::MP_COLOR1, YM_GAUGE_COLOR::MP_COLOR2)
  486.       else
  487.         draw_gauge(x+14, y, width-14, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  488.       end
  489.     else
  490.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  491.         draw_gauge(x, y, width, actor.mp_rate, YM_GAUGE_COLOR::MP_COLOR1, YM_GAUGE_COLOR::MP_COLOR2)
  492.       else
  493.         draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  494.       end
  495.     end
  496.     change_color(system_color)
  497.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  498.     if YM_BATTLE_OPTION::GAUGE_ICON_USE == true
  499.       draw_icon(YM_BATTLE_OPTION::GAUGE_ICON_MP, x-4, y+2)
  500.     else
  501.       draw_text(x, y+4, 30, line_height, Vocab::mp_a)
  502.     end
  503.     if $game_party.battle_members.size>=5
  504.     draw_current_values_ym(x, y+4, width, actor.mp, actor.mmp,mp_color(actor), normal_color)
  505.     else
  506.     draw_current_and_max_values(x, y+4, width, actor.mp, actor.mmp,mp_color(actor), normal_color)
  507.     end
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # ● TP 繪製微調
  511.   #--------------------------------------------------------------------------
  512.   def draw_actor_tp_ym(actor, x, y, width = 124)
  513.     if YM_BATTLE_OPTION::GAUGE_ICON_USE ==  true
  514.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  515.         draw_gauge(x+14, y, width-14, actor.tp_rate, YM_GAUGE_COLOR::TP_COLOR1, YM_GAUGE_COLOR::TP_COLOR2)
  516.       else
  517.         draw_gauge(x+14, y, width-14, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  518.       end
  519.     else
  520.       if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  521.         draw_gauge(x, y, width, actor.tp_rate, YM_GAUGE_COLOR::TP_COLOR1, YM_GAUGE_COLOR::TP_COLOR2)
  522.       else
  523.         draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  524.       end
  525.     end
  526.     change_color(system_color)
  527.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  528.     if YM_BATTLE_OPTION::GAUGE_ICON_USE == true
  529.       draw_icon(YM_BATTLE_OPTION::GAUGE_ICON_TP, x-4, y+2)
  530.     else
  531.       draw_text(x, y+4, 30, line_height, Vocab::tp_a)
  532.     end
  533.     change_color(tp_color(actor))
  534.     draw_text(x + width - 42, y+4, 42, line_height, actor.tp.to_i, 2)
  535.   end
  536.  
  537.   #--------------------------------------------------------------------------
  538.   # ● 不顯示最大值時
  539.   #--------------------------------------------------------------------------
  540.   def draw_current_values_ym(x, y, width, current, max, color1, color2)
  541.     change_color(color1)
  542.     xr = x + width
  543.     draw_text(xr - 42, y, 42, line_height, current, 2)
  544.   end
  545.  
  546. end
  547.  
  548. #==============================================================================
  549. # ■ Window_BattleEnemy 指標上方資訊
  550. #==============================================================================
  551. class Window_BattleEnemy < Window_Selectable
  552.  
  553.   #--------------------------------------------------------------------------
  554.   # ●初始化
  555.   #--------------------------------------------------------------------------
  556.   def initialize(info_viewport)
  557.     super(0,0, window_width, fitting_height(1)+8)
  558.     refresh
  559.     self.visible = false
  560.     self.arrows_visible = false
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ●行數
  564.   #--------------------------------------------------------------------------
  565.   def col_max
  566.     return 1
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # ●寬度
  570.   #--------------------------------------------------------------------------
  571.   def window_width
  572.     return 184
  573.     end
  574.   #--------------------------------------------------------------------------
  575.   # ●每格高度
  576.   #--------------------------------------------------------------------------
  577.   def item_height
  578.     return  32
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ●視窗顯示
  582.   #--------------------------------------------------------------------------
  583.   def show
  584.       width_remain = Graphics.width - width
  585.       select(0)
  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.     super
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # ●移動處理
  595.   #--------------------------------------------------------------------------
  596.   def process_cursor_move
  597.     return unless cursor_movable?
  598.     last_index = @index
  599.     cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
  600.     cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
  601.     cursor_down(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
  602.     cursor_up (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
  603.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
  604.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
  605.     Sound.play_cursor if @index != last_index
  606.   end
  607.  
  608.   def cursor_down(wrap = false)
  609.     if index < item_max - col_max || (wrap && col_max == 1)
  610.       select((index + col_max) % item_max)
  611.       $game_system.ba_x=$game_troop.alive_members[index].screen_x-width/2
  612.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height-70
  613.       if $game_troop.alive_members[index].enemy.note.include?("大怪")
  614.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height
  615.       end
  616.     end
  617.   end
  618.  
  619.   def cursor_up(wrap = false)
  620.     if index >= col_max || (wrap && col_max == 1)
  621.       select((index - col_max + item_max) % item_max)
  622.       $game_system.ba_x=$game_troop.alive_members[index].screen_x-width/2
  623.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height-70
  624.       if $game_troop.alive_members[index].enemy.note.include?("大怪")
  625.       $game_system.ba_y=$game_troop.alive_members[index].screen_y-battler_graphic.height
  626.       end
  627.     end
  628.   end
  629.  
  630.   def update_cursor
  631.     if @cursor_all
  632.       cursor_rect.set(0, 0, contents.width, row_max * item_height)
  633.     self.top_row = 0
  634.     elsif @index < 0
  635.       cursor_rect.empty
  636.     else
  637.       ensure_cursor_visible
  638.     end
  639.   end
  640.  
  641.   def battler_graphic
  642.     Cache.battler(enemy.battler_name, enemy.battler_hue)
  643.   end
  644.  
  645.   #--------------------------------------------------------------------------
  646.   # ● 項目繪製
  647.   #--------------------------------------------------------------------------
  648.   def draw_item(index)
  649.     change_color(normal_color)
  650.     name = $game_troop.alive_members[index].name
  651.     draw_text(item_rect_for_text_1(index), name,1) if YM_BATTLE_OPTION::ENEMY_NAMEORPERCENT == true
  652.     draw_hp(index)
  653.  
  654.   end
  655.  
  656.   #--------------------------------------------------------------------------
  657.   # ● 微調位置
  658.   #--------------------------------------------------------------------------
  659.   def item_rect_for_text_1(index)
  660.     rect = item_rect(index)
  661.     rect.x += 4
  662.     rect.y -= 6
  663.     rect.width -= 8
  664.     rect
  665.   end
  666.  
  667.   #--------------------------------------------------------------------------
  668.   # ● 敵HP繪製
  669.   #--------------------------------------------------------------------------
  670.   def draw_hp(index)
  671.     rect = item_rect_for_text(index)
  672.     w = rect.width
  673.     x =  0
  674.     hp = $game_troop.alive_members[index].hp_rate
  675.      if YM_BATTLE_OPTION::GAUGE_COLOR_HAVE == true
  676.       draw_gauge(x+3, rect.y+5, w, hp, YM_GAUGE_COLOR::HP_COLOR1,YM_GAUGE_COLOR::HP_COLOR2)
  677.     else
  678.       draw_gauge(x+3, rect.y+5, w, hp, hp_gauge_color1, hp_gauge_color2)
  679.     end
  680.     if YM_BATTLE_OPTION::ENEMY_NAMEORPERCENT == false
  681.     contents.font.name="VL Gothic"
  682.     contents.font.bold = YM_BATTLE_OPTION::GAUGE_TEXTBOLD
  683.     contents.font.size=YM_BATTLE_OPTION::GAUGE_TEXTSIZE
  684.     change_color(system_color)
  685.     draw_text(x+3, rect.y-2, 100, line_height, Vocab::hp_a)
  686.     eee = $game_troop.alive_members[index]
  687.     change_color(normal_color)
  688.     draw_en_hp_values(x+3, rect.y, width, eee.hp, eee.mhp, normal_color, normal_color)
  689.     contents.font.name=Font.default_name
  690.     else
  691.     end
  692.   end
  693.  
  694.   def draw_en_hp_values(x, y, width, current, max, color1, color2)
  695.     change_color(color1)
  696.     xr = x + width
  697.     draw_text(xr-84 , y-2, 42, line_height, current*100/max,2)
  698.     draw_text(xr-72, y-2, 42, line_height, "%", 2)
  699.   end
  700.  
  701. end
  702.  
  703. #==============================================================================
  704. # ■ Window_BattleActor_Neo  我方指標製作
  705. #==============================================================================
  706. class Window_BattleActor_Neo < Window_Selectable
  707.  
  708.   def initialize(info_viewport)
  709.     super(0, info_viewport.rect.y, window_width, fitting_height(4))
  710.     refresh
  711.     self.openness = 255
  712.     self.visible = false
  713.     self.arrows_visible = false
  714.     select(0)
  715.     contents.font.name="VL Gothic"
  716.     self.opacity = 0
  717.   end
  718.  
  719.   def window_width
  720.    184
  721.   end
  722.  
  723.   def window_height
  724.     fitting_height(line_number)
  725.   end
  726.  
  727.   def visible_line_number
  728.     return 4
  729.   end
  730.  
  731.   def item_height
  732.    60
  733.   end
  734.  
  735.   def item_max
  736.    $game_party.battle_members.size
  737. end
  738.  
  739.   def update_cursor
  740.     if @cursor_all
  741.       cursor_rect.set(0, 0, contents.width, row_max * item_height)
  742.       self.top_row = 0
  743.     elsif @index < 0
  744.       cursor_rect.empty
  745.     else
  746.       ensure_cursor_visible
  747.     end
  748.   end
  749.  
  750.   def refresh
  751.     contents.clear
  752.     draw_all_items
  753.   end
  754.  
  755.   def draw_item(index)
  756.     change_color(normal_color)
  757.     contents.font.size = 50
  758.     contents.font.color.set(YM_CURSOR_P::CURSOR_COLOR2)
  759.     draw_text(item_rect_for_text(index), "▼",1)
  760.   end
  761.  
  762.   def basic_area_rect(index)
  763.     rect = item_rect_for_text(index)
  764.     rect.width -= gauge_area_width + 10
  765.     rect
  766.   end
  767.  
  768.   def gauge_area_rect(index)
  769.     rect = item_rect_for_text(index)
  770.     rect.x += rect.width - gauge_area_width
  771.     rect.width = gauge_area_width
  772.     rect
  773.   end
  774.  
  775.   def gauge_area_width
  776.     return 220
  777.   end
  778.  
  779.   def pos_x
  780.     if $game_party.battle_members.size>=4
  781.       (Graphics.width-24) / $game_party.battle_members.size
  782.     elsif $game_party.battle_members.size==3
  783.       (Graphics.width-22-$game_system.face_item_width*2) / $game_party.battle_members.size
  784.     elsif $game_party.battle_members.size==2
  785.       (Graphics.width-20-$game_system.face_item_width*4) / $game_party.battle_members.size
  786.     elsif $game_party.battle_members.size==1
  787.       (Graphics.width-18-$game_system.face_item_width*6) / $game_party.battle_members.size
  788.     end
  789.   end
  790.  
  791.   def pos_y
  792.     Graphics.height
  793.   end
  794.  
  795.   #--------------------------------------------------------------------------
  796.   # ●移動處理
  797.   #--------------------------------------------------------------------------
  798.   def process_cursor_move
  799.     return unless cursor_movable?
  800.     last_index = @index
  801.     cursor_down(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
  802.     cursor_up (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
  803.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
  804.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
  805.     Sound.play_cursor if @index != last_index
  806.   end
  807.  
  808.   def cursor_down(wrap = false)
  809.     if index < item_max - col_max || (wrap && col_max == 1)
  810.       select((index + col_max) % item_max)
  811.     end
  812.   end
  813.  
  814.  
  815.   def cursor_up(wrap = false)
  816.     if index >= col_max || (wrap && col_max == 1)
  817.       select((index - col_max + item_max) % item_max)
  818.     end
  819.   end
  820.  
  821.  
  822.   def show
  823.     $game_system.al_x=pos_x
  824.     $game_system.al_y=pos_y
  825.     if @info_viewport
  826.       width_remain = Graphics.width - width
  827.       self.x = width_remain
  828.       @info_viewport.rect.width = width_remain
  829.       select(0)
  830.     end
  831.     super
  832.   end
  833.  
  834.   def hide
  835.     @info_viewport.rect.width = Graphics.width if @info_viewport
  836.     super
  837.   end
  838. end
  839.  
  840. #==============================================================================
  841. # ■ Window_PartyCommand 小隊命令
  842. #==============================================================================
  843. class Window_PartyCommand < Window_Command
  844.   def initialize
  845.     super(Graphics.width/2-window_width/2, 108)
  846.     self.openness = 0
  847.     deactivate
  848.   end
  849.   def alignment
  850.     return 1
  851.   end
  852.   def window_width
  853.     return 108
  854.   end
  855.   def window_height
  856.     return 72
  857.   end
  858. end
  859.  
  860. #==============================================================================
  861. # ■ Window_EnemyCursor 指標製作
  862. #==============================================================================
  863. class Window_EnemyCursor < Window_Selectable
  864.  
  865.   def initialize(info_viewport)
  866.     super(0, 0, window_width, fitting_height(2))
  867.     refresh
  868.     self.visible = false
  869.     self.opacity = 0
  870.   end
  871.  
  872.   def window_width
  873.     184
  874.   end
  875.  
  876.   def col_max
  877.     return 1
  878.   end
  879.  
  880.   def item_height
  881.    48
  882.   end
  883.  
  884.   def item_max
  885.     1
  886.   end
  887.  
  888.   def draw_item(index)
  889.     change_color(normal_color)
  890.     contents.font.size = 30
  891.     contents.font.name="Arial"
  892.     contents.font.color.set(YM_CURSOR_P::CURSOR_COLOR)
  893.     draw_text(item_rect_for_text(index), "▼",1)
  894.   end
  895.  
  896.   def update_cursor
  897.     if @cursor_all
  898.       cursor_rect.set(0, 0, contents.width, row_max * item_height)
  899.       self.top_row = 0
  900.     elsif @index < 0
  901.       cursor_rect.empty
  902.     else
  903.       ensure_cursor_visible
  904.     end
  905.   end
  906.  
  907.   def show
  908.       width_remain = Graphics.width - width
  909.       self.x = width_remain
  910.       select(0)
  911.     super
  912.   end
  913.  
  914.   def hide
  915.     super
  916.   end
  917. end
  918.  
  919. #==============================================================================
  920. # ■ Window_BattleSkill 視窗資訊暫存
  921. #==============================================================================
  922. class Window_BattleSkill < Window_SkillList
  923.  
  924.   alias yima_bv2_show show
  925.   def show
  926.       $game_system.wd_hide=0
  927.       yima_bv2_show
  928.   end
  929.  
  930.   alias yima_bv2_hide hide
  931.   def hide
  932.       $game_system.wd_hide=1
  933.       yima_bv2_hide
  934.   end
  935.  
  936. end
  937.  
  938. #==============================================================================
  939. # ■ Window_BattleItem 視窗資訊暫存
  940. #==============================================================================
  941. class Window_BattleItem < Window_ItemList
  942.  
  943.   alias yima_bv2_show show
  944.   def show
  945.       $game_system.wd_hide=0
  946.       yima_bv2_show
  947.   end
  948.  
  949.   alias yima_bv2_hide hide
  950.   def hide
  951.       $game_system.wd_hide=1
  952.       yima_bv2_hide
  953.   end
  954.  
  955. end
  956.  
  957. #==============================================================================
  958. # ■ Window_ActorCommand 角色指令
  959. #==============================================================================
  960. class Window_ActorCommand < Window_Command
  961.   alias yima_bacmd_initialize initialize
  962.   def initialize
  963.     yima_bacmd_initialize
  964.     self.arrows_visible = false
  965.   end
  966.   #--------------------------------------------------------------------------
  967.   # ●寬
  968.   #--------------------------------------------------------------------------
  969.   def window_width
  970.     return  $game_party.battle_members.size>=6 ? 110 : 128
  971.   end
  972.   #--------------------------------------------------------------------------
  973.   # ●設定位置
  974.   #--------------------------------------------------------------------------
  975.   def setup(actor)
  976.     acmd_arrange = $game_system.face_item_width
  977.     @actor = actor
  978.     if $game_party.battle_members.size==4
  979.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  980.     elsif $game_party.battle_members.size==3
  981.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange
  982.     elsif $game_party.battle_members.size==2
  983.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*2
  984.     elsif $game_party.battle_members.size==1
  985.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*3
  986.     elsif $game_party.battle_members.size>=5
  987.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  988.     end
  989.     self.y = actor.pos_y - self.height-100
  990.     clear_command_list
  991.     make_command_list
  992.     refresh
  993.     self.height = fitting_height(@list.size)
  994.     self.y = actor.pos_y - self.height-100
  995.     select(0)
  996.     activate
  997.     open
  998.   end
  999. end
  1000.  
  1001. #==============================================================================
  1002. # ■  Game_Actor 設定位置
  1003. #==============================================================================
  1004. class Game_Actor < Game_Battler
  1005.   def pos_x
  1006.     if $game_party.battle_members.size>=4
  1007.       (Graphics.width-24) / $game_party.battle_members.size
  1008.     elsif $game_party.battle_members.size==3
  1009.       (Graphics.width-22-$game_system.face_item_width*2) / $game_party.battle_members.size
  1010.     elsif $game_party.battle_members.size==2
  1011.       (Graphics.width-20-$game_system.face_item_width*4) / $game_party.battle_members.size
  1012.     elsif $game_party.battle_members.size==1
  1013.       (Graphics.width-18-$game_system.face_item_width*6) / $game_party.battle_members.size
  1014.     end
  1015.   end
  1016.   def pos_y
  1017.     Graphics.height
  1018.   end
  1019. end
  1020. #==============================================================================
  1021. # ■  Game_Party 參戰人數
  1022. #==============================================================================
  1023. class Game_Party < Game_Unit
  1024.   def max_battle_members
  1025.     return YM_BATTLE_OPTION::MAXBM
  1026.   end
  1027. end
  1028.  
  1029. #==============================================================================
  1030. # ■ Window_ActorCommandSmall 簡易命令列製作
  1031. #==============================================================================
  1032. class Window_ActorCommandSmall < Window_HorzCommand
  1033.   #--------------------------------------------------------------------------
  1034.   # ●初始化
  1035.   #--------------------------------------------------------------------------
  1036.   def initialize
  1037.     super(0, 0)
  1038.     self.openness = 0
  1039.     deactivate
  1040.     @actor = nil
  1041.     self.arrows_visible = false
  1042.   end
  1043.   #--------------------------------------------------------------------------
  1044.   # ●移動處理
  1045.   #--------------------------------------------------------------------------
  1046.   def window_width
  1047.     return  $game_party.battle_members.size>=6 ? 110 : 128
  1048.   end
  1049.  
  1050.   def window_height
  1051.     return 48
  1052.   end
  1053.  
  1054.   def item_width
  1055.     (width - standard_padding * 2 + spacing) /1  - spacing
  1056.   end
  1057.  
  1058.   def col_max
  1059.     return @list.size+1
  1060.   end
  1061.  
  1062.   def row_max
  1063.     1
  1064.   end
  1065.  
  1066.   def page_col_max
  1067.     1
  1068.   end
  1069.  
  1070.   def col
  1071.     index / row_max
  1072.   end
  1073.  
  1074.   def top_col
  1075.     ox / (item_width + spacing)
  1076.   end
  1077.  
  1078.   def bottom_col
  1079.     top_col + page_col_max - 1
  1080.   end
  1081.  
  1082.   def bottom_col=(col)
  1083.     self.top_col = col - (page_col_max - 1)
  1084.   end
  1085.  
  1086.   def ensure_cursor_visible
  1087.     self.top_col = col if col < top_col
  1088.     self.bottom_col = col if col > bottom_col
  1089.   end
  1090.  
  1091.   def visible_line_number
  1092.     return 4
  1093.   end
  1094.   #--------------------------------------------------------------------------
  1095.   # ●箭頭繪製
  1096.   #--------------------------------------------------------------------------
  1097.   def draw_item(index)
  1098.     change_color(normal_color, command_enabled?(index))
  1099.     draw_text(item_rect_for_text(index), command_name(index), alignment)
  1100.     change_color(normal_color)
  1101.     contents.font.size = 16
  1102.     contents.font.name="Arial"
  1103.     if $game_party.battle_members.size>=6
  1104.     draw_text(item_rect_for_text(index), "◄       ►",alignment)
  1105.     else
  1106.     draw_text(item_rect_for_text(index), "◄        ►",alignment)
  1107.     end
  1108.     contents.font.name=Font.default_name
  1109.     contents.font.size = Font.default_size
  1110.     change_color(normal_color, command_enabled?(index))
  1111.   end
  1112.   #--------------------------------------------------------------------------
  1113.   # ●建立指令列
  1114.   #--------------------------------------------------------------------------
  1115.   def make_command_list
  1116.     return unless @actor
  1117.     add_attack_command
  1118.     add_skill_commands
  1119.     add_guard_command
  1120.     add_item_command
  1121.   end
  1122.   #--------------------------------------------------------------------------
  1123.   # ●增加攻擊指令
  1124.   #--------------------------------------------------------------------------
  1125.   def add_attack_command
  1126.     add_command(Vocab::attack, :attack, @actor.attack_usable?)
  1127.   end
  1128.   #--------------------------------------------------------------------------
  1129.   # ●增加技能指令
  1130.   #--------------------------------------------------------------------------
  1131.   def add_skill_commands
  1132.     @actor.added_skill_types.sort.each do |stype_id|
  1133.       name = $data_system.skill_types[stype_id]
  1134.       add_command(name, :skill, true, stype_id)
  1135.     end
  1136.   end
  1137.   #--------------------------------------------------------------------------
  1138.   # ●增加防禦指令
  1139.   #--------------------------------------------------------------------------
  1140.   def add_guard_command
  1141.     add_command(Vocab::guard, :guard, @actor.guard_usable?)
  1142.   end
  1143.   #--------------------------------------------------------------------------
  1144.   # ●增加物品指令
  1145.   #--------------------------------------------------------------------------
  1146.   def add_item_command
  1147.     add_command(Vocab::item, :item)
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ●建立
  1151.   #--------------------------------------------------------------------------
  1152.   def setup(actor)
  1153.     acmd_arrange = $game_system.face_item_width
  1154.     @actor = actor
  1155.     if $game_party.battle_members.size==4
  1156.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  1157.     elsif $game_party.battle_members.size==3
  1158.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange
  1159.     elsif $game_party.battle_members.size==2
  1160.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*2
  1161.     elsif $game_party.battle_members.size==1
  1162.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2+acmd_arrange*3
  1163.     elsif $game_party.battle_members.size>=5
  1164.         self.x = actor.pos_x*@actor.index+acmd_arrange - item_width/2
  1165.     end
  1166.     self.y = actor.pos_y - self.height-100
  1167.     clear_command_list
  1168.     make_command_list
  1169.     refresh
  1170.     select(0)
  1171.     activate
  1172.     open
  1173.   end
  1174. end
  1175.  
  1176.  
  1177. #==============================================================================
  1178. # ■ Window_BattleStatus
  1179. #==============================================================================
  1180. class Window_BattleStatus < Window_Selectable
  1181.   #--------------------------------------------------------------------------
  1182.   # ● 初始化
  1183.   #--------------------------------------------------------------------------
  1184.   def initialize
  1185.     super(0, 8, Graphics.width, window_height)
  1186.     self.opacity = 0
  1187.     refresh
  1188.     self.openness = 0
  1189.   end
  1190.   #--------------------------------------------------------------------------
  1191.   # ● 高
  1192.   #--------------------------------------------------------------------------
  1193.   def window_height
  1194.     fitting_height(visible_line_number)
  1195.   end
  1196.   #--------------------------------------------------------------------------
  1197.   # ● 三條計量表行高
  1198.   #--------------------------------------------------------------------------
  1199.   def gauge_line_height
  1200.     return 16
  1201.   end
  1202.   #--------------------------------------------------------------------------
  1203.   # ● 行數
  1204.   #--------------------------------------------------------------------------
  1205.   def col_max
  1206.     return [item_max, 4].max
  1207.   end
  1208.   #--------------------------------------------------------------------------
  1209.   # ● 項目間隔
  1210.   #--------------------------------------------------------------------------
  1211.   def spacing
  1212.     return 0
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ● 項目繪製區
  1216.   #--------------------------------------------------------------------------
  1217.   def item_rect(index)
  1218.     rect = Rect.new
  1219.     rect.width = item_width
  1220.     rect.height = contents_height
  1221.     rect.x = index % col_max * (item_width + spacing)
  1222.     rect.y = index / col_max * contents_height
  1223.     rect
  1224.   end
  1225.   #--------------------------------------------------------------------------
  1226.   # ● 基本繪製區域
  1227.   #--------------------------------------------------------------------------
  1228.   def basic_area_rect(index)
  1229.     rect = item_rect_for_text(index)
  1230.     rect.height -= gauge_area_height
  1231.     rect
  1232.   end
  1233.   #--------------------------------------------------------------------------
  1234.   # ● 棒條繪製區域
  1235.   #--------------------------------------------------------------------------
  1236.   def gauge_area_rect(index)
  1237.     rect = item_rect_for_text(index)
  1238.     rect.y += contents_height - gauge_area_height - 8
  1239.     rect.height = gauge_area_height
  1240.     rect
  1241.   end
  1242.   #--------------------------------------------------------------------------
  1243.   # ● 棒條繪製區域高
  1244.   #--------------------------------------------------------------------------
  1245.   def gauge_area_height
  1246.     return (gauge_line_height * ($data_system.opt_display_tp ? 3 : 2))
  1247.   end
  1248.   #--------------------------------------------------------------------------
  1249.   # ● 內容繪製
  1250.   #--------------------------------------------------------------------------
  1251.   def draw_basic_area(rect, actor)
  1252.     $game_system.face_item_width=item_width/2
  1253.     bms=$game_party.battle_members.size
  1254.     if $data_system.opt_display_tp
  1255.       notpy=0
  1256.     else
  1257.       notpy=8
  1258.     end
  1259.     if YM_BATTLE_OPTION::BFC==true
  1260.       if actor.hp < actor.mhp / 2 && actor.hp > actor.mhp / 4
  1261.         draw_actor_face_yima2(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1262.       elsif actor.hp < actor.mhp / 4 && actor.hp > 0
  1263.         draw_actor_face_yima3(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1264.       elsif actor.hp == 0
  1265.         draw_actor_face_yima4(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1266.       else
  1267.         draw_actor_face_yima(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1268.       end
  1269.     else
  1270.       draw_actor_face_yima(actor, rect.x+item_width/2-52, rect.y+2, !actor.dead?)
  1271.     end
  1272.     draw_actor_icons(actor, rect.x, rect.y, rect.width+8)
  1273.   end
  1274.   #--------------------------------------------------------------------------
  1275.   # ● 計量表繪製
  1276.   #--------------------------------------------------------------------------
  1277.   def draw_gauge_area_with_tp(rect, actor)
  1278.     draw_actor_hp_ym(actor, rect.x, rect.y + gauge_line_height * 0, rect.width)
  1279.     draw_actor_mp_ym(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
  1280.     draw_actor_tp_ym(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # ● 計量表繪製(無TP)
  1284.   #--------------------------------------------------------------------------
  1285.   def draw_gauge_area_without_tp(rect, actor)
  1286.     draw_actor_hp_ym(actor, rect.x, rect.y + gauge_line_height * 0-8, rect.width)
  1287.     draw_actor_mp_ym(actor, rect.x, rect.y + gauge_line_height * 1-8, rect.width)
  1288.   end
  1289. end

Lv4.逐梦者

梦石
0
星屑
6260
在线时间
1481 小时
注册时间
2015-7-25
帖子
652

开拓者

2
发表于 2017-10-20 09:37:45 | 只看该作者
角色加入队伍后没有更新战斗状态窗口的位置
那就加一个update方法在这个窗口的类里让窗口随时更新x坐标
RUBY 代码复制
  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 认可答案

查看全部评分

笨肉包的首款像素OC游戏《花城梦之心》尝试制作中~
目前的坑 【不可思议的迷宫】幽灵契约外传:歌莉娅
持续更新中~ 当前进度 v0.28
大版本更新时才会更新网盘文件,预计下次大版本更新:v0.30
完成度:
主线 15% 支线 0% 数据库 6% 系统 86% 美术 6%
两边同时填坑~
( 这里是笨肉包~专修魔法!目标是大魔法师!
( 坑太大啦,一个人填不完啦hhh 一定会填完的嗯...
( 每天都和bug们比试魔力~吾之魔法将扫平一切!
( 弱点是美术,魔法修行之余再补补课吧~
( 哼哼哼~这便是魔法的力量!
大家都离开啦,笨肉包也不知道还能坚持多久呀...
这是属于笨肉包一个人的旅行(再见了...蚊子湯,七重酱,笨肉包永远想你们!TwT
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-17 16:48

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表