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

Project1

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

[已经解决] 该整队脚本如何令右上方窗口里人数比最大战斗人员多1人

[复制链接]

Lv3.寻梦者

虚空人形

梦石
0
星屑
4604
在线时间
2037 小时
注册时间
2011-8-11
帖子
3398

贵宾

跳转到指定楼层
1
发表于 2014-3-1 09:50:47 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

x
本帖最后由 Sion 于 2014-3-7 10:58 编辑

脚本如下,示意图在脚本下方。
本来试着直接修改窗口内容的列数,
但是会发生错误。

如果可以的话,我希望可以直接指出需要修改的位置及内容。
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Party System v1.08
  4. # -- Last Updated: 2012.01.23
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-PartySystem"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.23 - Bug fixed: Party members are now rearranged when newly added.
  17. # 2012.01.14 - New Feature: Maximum Battle Members Variable added.
  18. # 2012.01.07 - Bug fixed: Error with removing members.
  19. # 2012.01.05 - Bug fixed: Escape skill/item effects no longer counts as death.
  20. # 2011.12.26 - Compatibility Update: New Game+
  21. # 2011.12.17 - Updated Spriteset_Battle to have updated sprite counts.
  22. # 2011.12.13 - Updated to provide better visual display when more than 5 pieces
  23. #              of equipment are equipped on an actor at a time.
  24. # 2011.12.05 - Added functionality to display faces in the Party Select Window.
  25. #            - Fixed bug that doesn't refresh the caterpillar when new members
  26. #              join the party.
  27. # 2011.12.04 - Started Script and Finished.
  28. #
  29. #==============================================================================
  30. # ▼ Introduction
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # RPG Maker VX Ace comes with a very nice party system. However, changing the
  33. # maximum number of members isn't possible without the aid of a script. This
  34. # script enables you the ability to change the maximum number of party members,
  35. # change EXP rates, and/or open up a separate party menu (if desired). In
  36. # addition to that, you can lock the position of actors within a party and
  37. # require other actors to be in the active party before continuing.
  38. #
  39. #==============================================================================
  40. # ▼ Instructions
  41. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  42. # To install this script, open up your script editor and copy/paste this script
  43. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  44. #
  45. # -----------------------------------------------------------------------------
  46. # 脚本命令语句 - These commands are used with script calls.
  47. # -----------------------------------------------------------------------------
  48. # *IMPORTANT* These script calls require the new party menu to be enabled to
  49. # use them. Otherwise, nothing will happen.
  50. #
  51. # lock_actor(x)      锁定X角色在队伍中的位置
  52. # unlock_actor(x)
  53. # This will lock actor x in its current position in the party if the actor is
  54. # in the current party. The actor is unable to switch position and must remain
  55. # in that position until the lock is removed. Use the unlock script call to
  56. # remove the locked status. This script requires the actor to have joined and
  57. # in the current party before the script call will work.
  58. #
  59. # require_actor(x)   需要X角色参战
  60. # unrequire_actor(x)
  61. # This will cause the party to require actor x in order to continue. If the
  62. # actor isn't in the current party but is in the reserve party, the party menu
  63. # will open up and prompt the player to add the required actor into the party
  64. # before being able to continue. This script call will not function unless the
  65. # specific actor has joined the party, whether it is in the current or reserve.
  66. #
  67. # call_party_menu    打开队伍菜单
  68. # This will open up the party menu. This script call requires for the party
  69. # menu to be enabled to use.
  70. #
  71. #==============================================================================
  72. # ▼ Compatibility
  73. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  74. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  75. # it will run with RPG Maker VX without adjusting.
  76. #
  77. #==============================================================================
  78.  
  79. module YEA
  80.   module PARTY
  81.  
  82.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  83.     # - General Party Settings -
  84.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  85.     # In this section, you can adjust the general party settings for your game
  86.     # such as the maximum amount of members and whatnot, the EXP rate for
  87.     # party members in the reserve, etc.
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     MAX_BATTLE_MEMBERS   = 5      # 最大参战人员. Default: 4
  90.     SPLIT_EXP            = false  # 平分经验?Splits EXP with more members in the party.
  91.     RESERVE_EXP_RATE     = 0.50   # 休息人员的经验获得率Reserve EXP Rate. Default: 1.00
  92.  
  93.     # If you wish to be able to change the maximum number of battle members
  94.     # during the middle of your game, set this constant to a variable ID. If
  95.     # that variable ID is a number greater than 0, that variable will determine
  96.     # the current maximum number of battle members. Be cautious about using
  97.     # this during battle.
  98.     MAX_MEMBERS_VARIABLE = 0  #设置游戏中改变最大参战人员的变量
  99.  
  100.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  101.     # - Party Menu Settings -
  102.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  103.     # This section contains various menu settings for those who wish to use a
  104.     # menu separate for the party system. Here, adjust the menu command order,
  105.     # icons used, and other settings.
  106.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  107.     ENABLE_MENU = true   # Enables party menu. Default: false
  108.     COMMANDS =[          # The order at which the menu items are shown.
  109.     # [:command,  "Display"],
  110.       [ :change,  "更换",],
  111.       [ :remove,  "移除",],
  112.       [ :revert,  "还原",],
  113.       [ :finish,  "完成",],
  114.     ] # Do not remove this.
  115.     COMMAND_ALIGN    = 1     # 0:左对齐, 1:Center Align, 2:Right Align
  116.  
  117.     # These settings here are used for the upper right window: the Party Select
  118.     # window where the player selects a member to swap out or remove.
  119.     PARTY_FONT_SIZE  = 20    # Font size used for party member names.
  120.     LOCK_FIRST_ACTOR = false # Lock the first actor by default?
  121.     LOCKED_ICON      = 125   # Icon used for locked members.
  122.     REQUIRED_ICON    = 126   # Icon used for required members.
  123.     EMPTY_TEXT = "-Empty-"   # Text used when a member isn't present.
  124.     DISPLAY_FACE     = false # Display faces instead of sprites?
  125.  
  126.     # These settings here are used for the lower left window: the Party List
  127.     # window where the player selects a member to replace.
  128.     REMOVE_ICON      = 185          # Icon used for removing members.
  129.     REMOVE_TEXT      = "-Remove-"   # Text used for remove member command.
  130.     ACTOR_Y_BUFFER   = 12           # Amount the actor graphic be adjusted by.
  131.  
  132.     # These settings here are used for the lower right window: the Party Status
  133.     # window where info about a selected actor is shown.
  134.     NO_DATA         = "- No Data -" # Text used for when no actor is shown.
  135.     IN_PARTY_COLOUR = 6             # Text colour used for in party members.
  136.     STAT_FONT_SIZE  = 20            # Font size used for stats.
  137.     EQUIP_TEXT      = "Equipment"   # Text used to display equipment.
  138.  
  139.   end # PARTY
  140. end # YEA
  141.  
  142. #==============================================================================
  143. # ▼ Editting anything past this point may potentially result in causing
  144. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  145. # halitosis so edit at your own risk.
  146. #==============================================================================
  147.  
  148. #==============================================================================
  149. # ■ Icon
  150. #==============================================================================
  151.  
  152. module Icon
  153.  
  154.   #--------------------------------------------------------------------------
  155.   # self.locked_party
  156.   #--------------------------------------------------------------------------
  157.   def self.locked_party; return YEA::PARTY::LOCKED_ICON; end
  158.  
  159.   #--------------------------------------------------------------------------
  160.   # self.required_party
  161.   #--------------------------------------------------------------------------
  162.   def self.required_party; return YEA::PARTY::REQUIRED_ICON; end
  163.  
  164.   #--------------------------------------------------------------------------
  165.   # self.remove_party
  166.   #--------------------------------------------------------------------------
  167.   def self.remove_party; return YEA::PARTY::REMOVE_ICON; end
  168.  
  169. end # Icon
  170.  
  171. #==============================================================================
  172. # ■ Variable
  173. #==============================================================================
  174.  
  175. module Variable
  176.  
  177.   #--------------------------------------------------------------------------
  178.   # self.max_battle_members
  179.   #--------------------------------------------------------------------------
  180.   def self.max_battle_members
  181.     default = YEA::PARTY::MAX_BATTLE_MEMBERS
  182.     return default if YEA::PARTY::MAX_MEMBERS_VARIABLE <= 0
  183.     return default if $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE] <= 0
  184.     return $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE]
  185.   end
  186.  
  187. end # Variable
  188.  
  189. #==============================================================================
  190. # ■ Numeric
  191. #==============================================================================
  192.  
  193. class Numeric
  194.  
  195.   #--------------------------------------------------------------------------
  196.   # new method: group_digits
  197.   #--------------------------------------------------------------------------
  198.   unless $imported["YEA-CoreEngine"]
  199.   def group; return self.to_s; end
  200.   end # $imported["YEA-CoreEngine"]
  201.  
  202. end # Numeric
  203.  
  204. #==============================================================================
  205. # ■ Game_Actor
  206. #==============================================================================
  207.  
  208. class Game_Actor < Game_Battler
  209.  
  210.   #--------------------------------------------------------------------------
  211.   # public instance variables
  212.   #--------------------------------------------------------------------------
  213.   attr_accessor :locked
  214.   attr_accessor :required
  215.  
  216.   #--------------------------------------------------------------------------
  217.   # alias method: setup
  218.   #--------------------------------------------------------------------------
  219.   alias game_actor_setup_ps setup
  220.   def setup(actor_id)
  221.     game_actor_setup_ps(actor_id)
  222.     @locked = false
  223.     @required = false
  224.   end
  225.  
  226.   #--------------------------------------------------------------------------
  227.   # overwrite method: final_exp_rate
  228.   #--------------------------------------------------------------------------
  229.   def final_exp_rate
  230.     n = exr * (battle_member? ? 1 : reserve_members_exp_rate)
  231.     if $game_party.in_battle
  232.       n /= [$game_party.battle_members.size, 1].max if YEA::PARTY::SPLIT_EXP
  233.     end
  234.     return n
  235.   end
  236.  
  237.   #--------------------------------------------------------------------------
  238.   # overwrite method: reserve_members_exp_rate
  239.   #--------------------------------------------------------------------------
  240.   def reserve_members_exp_rate
  241.     $data_system.opt_extra_exp ? YEA::PARTY::RESERVE_EXP_RATE : 0
  242.   end
  243.  
  244. end # Game_Actor
  245.  
  246. #==============================================================================
  247. # ■ Game_Party
  248. #==============================================================================
  249.  
  250. class Game_Party < Game_Unit
  251.  
  252.   #--------------------------------------------------------------------------
  253.   # public instance variables
  254.   #--------------------------------------------------------------------------
  255.   attr_accessor :battle_members_array
  256.  
  257.   #--------------------------------------------------------------------------
  258.   # alias method: initialize
  259.   #--------------------------------------------------------------------------
  260.   alias game_party_initialize_ps initialize
  261.   def initialize
  262.     game_party_initialize_ps
  263.     @battle_members_array = nil
  264.   end
  265.  
  266.   #--------------------------------------------------------------------------
  267.   # overwrite method: max_battle_members
  268.   #--------------------------------------------------------------------------
  269.   def max_battle_members; return Variable.max_battle_members; end
  270.  
  271.   #--------------------------------------------------------------------------
  272.   # alias method: setup_starting_members
  273.   #--------------------------------------------------------------------------
  274.   alias setup_starting_members_ps setup_starting_members
  275.   def setup_starting_members
  276.     setup_starting_members_ps
  277.     initialize_battle_members
  278.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  279.     return if members[0].nil?
  280.     members[0].locked = true
  281.   end
  282.  
  283.   #--------------------------------------------------------------------------
  284.   # alias method: setup_battle_test_members
  285.   #--------------------------------------------------------------------------
  286.   alias setup_battle_test_members_ps setup_battle_test_members
  287.   def setup_battle_test_members
  288.     setup_battle_test_members_ps
  289.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  290.     return if members[0].nil?
  291.     members[0].locked = true
  292.   end
  293.  
  294.   #--------------------------------------------------------------------------
  295.   # overwrite method: battle_members
  296.   #--------------------------------------------------------------------------
  297.   def battle_members
  298.     initialize_battle_members if initialize_battle_members?
  299.     array = []
  300.     for actor_id in @battle_members_array
  301.       break if array.size > max_battle_members
  302.       next if actor_id.nil?
  303.       next if $game_actors[actor_id].nil?
  304.       next unless $game_actors[actor_id].exist?
  305.       array.push($game_actors[actor_id])
  306.     end
  307.     return array
  308.   end
  309.  
  310.   #--------------------------------------------------------------------------
  311.   # new method: initialize_battle_members?
  312.   #--------------------------------------------------------------------------
  313.   def initialize_battle_members?
  314.     return true if @battle_members_array.nil?
  315.     return @battle_members_array.size != max_battle_members
  316.   end
  317.  
  318.   #--------------------------------------------------------------------------
  319.   # new method: initialize_battle_members
  320.   #--------------------------------------------------------------------------
  321.   def initialize_battle_members
  322.     @battle_members_array = []
  323.     for i in 0...max_battle_members
  324.       @battle_members_array.push(@actors[i]) unless @actors[i].nil?
  325.       @battle_members_array.push(0) if @actors[i].nil?
  326.     end
  327.     $game_player.refresh
  328.   end
  329.  
  330.   #--------------------------------------------------------------------------
  331.   # alias method: add_actor
  332.   #--------------------------------------------------------------------------
  333.   alias game_party_add_actor_ps add_actor
  334.   def add_actor(actor_id)
  335.     game_party_add_actor_ps(actor_id)
  336.     return if @battle_members_array.include?(actor_id)
  337.     return unless @battle_members_array.include?(0)
  338.     index = @battle_members_array.index(0)
  339.     @battle_members_array[index] = actor_id
  340.     $game_player.refresh
  341.     $game_map.need_refresh = true
  342.     rearrange_actors
  343.   end
  344.  
  345.   #--------------------------------------------------------------------------
  346.   # alias method: remove_actor
  347.   #--------------------------------------------------------------------------
  348.   alias game_party_remove_actor_ps remove_actor
  349.   def remove_actor(actor_id)
  350.     game_party_remove_actor_ps(actor_id)
  351.     return unless @battle_members_array.include?(actor_id)
  352.     index = @battle_members_array.index(actor_id)
  353.     @battle_members_array[index] = 0
  354.     $game_player.refresh
  355.     $game_map.need_refresh = true
  356.     rearrange_actors
  357.   end
  358.  
  359.   #--------------------------------------------------------------------------
  360.   # new method: rearrange_actors
  361.   #--------------------------------------------------------------------------
  362.   def rearrange_actors
  363.     initialize_battle_members if @battle_members_array.nil?
  364.     array = []
  365.     for actor_id in @battle_members_array
  366.       next if [0, nil].include?(actor_id)
  367.       next if $game_actors[actor_id].nil?
  368.       array.push(actor_id)
  369.     end
  370.     for actor_id in @actors
  371.       next if array.include?(actor_id)
  372.       next if $game_actors[actor_id].nil?
  373.       array.push(actor_id)
  374.     end
  375.     @actors = array
  376.   end
  377.  
  378. end # Game_Party
  379.  
  380. #==============================================================================
  381. # ■ Game_Interpreter
  382. #==============================================================================
  383.  
  384. class Game_Interpreter
  385.  
  386.   #--------------------------------------------------------------------------
  387.   # new method: lock_actor
  388.   #--------------------------------------------------------------------------
  389.   def lock_actor(actor_id)
  390.     return unless YEA::PARTY::ENABLE_MENU
  391.     actor = $game_actors[actor_id]
  392.     return unless $game_party.battle_members.include?(actor.id)
  393.     actor.locked = true
  394.   end
  395.  
  396.   #--------------------------------------------------------------------------
  397.   # new method: unlock_actor
  398.   #--------------------------------------------------------------------------
  399.   def unlock_actor(actor_id)
  400.     return unless YEA::PARTY::ENABLE_MENU
  401.     actor = $game_actors[actor_id]
  402.     return unless $game_party.battle_members.include?(actor.id)
  403.     actor.locked = false
  404.   end
  405.  
  406.   #--------------------------------------------------------------------------
  407.   # new method: require_actor
  408.   #--------------------------------------------------------------------------
  409.   def require_actor(actor_id)
  410.     return unless YEA::PARTY::ENABLE_MENU
  411.     return if $game_system.formation_disabled
  412.     actor = $game_actors[actor_id]
  413.     return unless $game_party.all_members.include?(actor)
  414.     actor.required = true
  415.     call_party_menu unless $game_party.battle_members.include?(actor)
  416.   end
  417.  
  418.   #--------------------------------------------------------------------------
  419.   # new method: unrequire_actor
  420.   #--------------------------------------------------------------------------
  421.   def unrequire_actor(actor_id)
  422.     return unless YEA::PARTY::ENABLE_MENU
  423.     return if $game_system.formation_disabled
  424.     actor = $game_actors[actor_id]
  425.     return unless $game_party.all_members.include?(actor)
  426.     actor.required = false
  427.     call_party_menu unless $game_party.battle_members.include?(actor)
  428.   end
  429.  
  430.   #--------------------------------------------------------------------------
  431.   # new method: call_party_menu
  432.   #--------------------------------------------------------------------------
  433.   def call_party_menu
  434.     return unless YEA::PARTY::ENABLE_MENU
  435.     return if $game_system.formation_disabled
  436.     SceneManager.call(Scene_Party)
  437.   end
  438.  
  439. end # Game_Interpreter
  440.  
  441. #==============================================================================
  442. # ■ Spriteset_Battle
  443. #==============================================================================
  444.  
  445. class Spriteset_Battle
  446.  
  447.   #--------------------------------------------------------------------------
  448.   # overwrite method: create_actors
  449.   #--------------------------------------------------------------------------
  450.   def create_actors
  451.     total = $game_party.max_battle_members
  452.     @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  453.   end
  454.  
  455. end # Spriteset_Battle
  456.  
  457. #==============================================================================
  458. # ■ Window_PartyMenuCommand
  459. #==============================================================================
  460.  
  461. class Window_PartyMenuCommand < Window_Command
  462.  
  463.   #--------------------------------------------------------------------------
  464.   # window_width
  465.   #--------------------------------------------------------------------------
  466.   def window_width; return 160; end
  467.  
  468.   #--------------------------------------------------------------------------
  469.   # visible_line_number
  470.   #--------------------------------------------------------------------------
  471.   def visible_line_number; 4; end
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # alignment
  475.   #--------------------------------------------------------------------------
  476.   def alignment
  477.     return Menu.command_window_align if $imported["YEA-AceMenuEngine"]
  478.     return YEA::PARTY::COMMAND_ALIGN
  479.   end
  480.  
  481.   #--------------------------------------------------------------------------
  482.   # scene
  483.   #--------------------------------------------------------------------------
  484.   def scene; return SceneManager.scene; end
  485.  
  486.   #--------------------------------------------------------------------------
  487.   # make_command_list
  488.   #--------------------------------------------------------------------------
  489.   def make_command_list
  490.     for command in YEA::PARTY::COMMANDS
  491.       case command[0]
  492.       when :change, :remove, :revert
  493.         add_command(command[1], command[0])
  494.       when :finish
  495.         add_command(command[1], command[0], enable_cancel?)
  496.       else; next
  497.       end
  498.     end
  499.   end
  500.  
  501.   #--------------------------------------------------------------------------
  502.   # process_cancel
  503.   #--------------------------------------------------------------------------
  504.   def process_cancel
  505.     unless enable_cancel?
  506.       Sound.play_buzzer
  507.       return
  508.     end
  509.     super
  510.   end
  511.  
  512.   #--------------------------------------------------------------------------
  513.   # in_party?
  514.   #--------------------------------------------------------------------------
  515.   def in_party?(actor)
  516.     return $game_party.battle_members.include?(actor)
  517.   end
  518.  
  519.   #--------------------------------------------------------------------------
  520.   # enable_cancel?
  521.   #--------------------------------------------------------------------------
  522.   def enable_cancel?
  523.     return false if $game_party.battle_members.size <= 0
  524.     for actor in $game_party.all_members
  525.       next if in_party?(actor)
  526.       return false if actor.required
  527.       return false if actor.locked
  528.     end
  529.     return true
  530.   end
  531.  
  532. end # Window_PartyMenuCommand
  533.  
  534. #==============================================================================
  535. # ■ Window_PartySelect
  536. #==============================================================================
  537.  
  538. class Window_PartySelect < Window_Selectable
  539.  
  540.   #--------------------------------------------------------------------------
  541.   # initialize
  542.   #-------------------------------------------------------------------------
  543.   def initialize(command_window)
  544.     @command_window = command_window
  545.     super(160, 0, window_width, fitting_height(visible_line_number))
  546.     select(0)
  547.     deactivate
  548.     refresh
  549.   end
  550.  
  551.   #--------------------------------------------------------------------------
  552.   # col_max
  553.   #--------------------------------------------------------------------------
  554.   def col_max; return $game_party.max_battle_members; end
  555.  
  556.   #--------------------------------------------------------------------------
  557.   # item_max
  558.   #--------------------------------------------------------------------------
  559.   def item_max; return $game_party.max_battle_members; end
  560.  
  561.   #--------------------------------------------------------------------------
  562.   # window_width
  563.   #--------------------------------------------------------------------------
  564.   def window_width; return Graphics.width - 160; end
  565.  
  566.   #--------------------------------------------------------------------------
  567.   # visible_line_number
  568.   #--------------------------------------------------------------------------
  569.   def visible_line_number; 4; end
  570.  
  571.   #--------------------------------------------------------------------------
  572.   # item_rect
  573.   #--------------------------------------------------------------------------
  574.   def item_rect(index)
  575.     rect = Rect.new
  576.     rect.width = contents.width / item_max
  577.     rect.height = contents.height
  578.     rect.x = index * rect.width
  579.     rect.y = 0
  580.     return rect
  581.   end
  582.  
  583.   #--------------------------------------------------------------------------
  584.   # refresh
  585.   #--------------------------------------------------------------------------
  586.   def refresh
  587.     make_item_list
  588.     create_contents
  589.     draw_all_items
  590.   end
  591.  
  592.   #--------------------------------------------------------------------------
  593.   # make_item_list
  594.   #--------------------------------------------------------------------------
  595.   def make_item_list
  596.     @data = $game_party.battle_members_array.clone
  597.   end
  598.  
  599.   #--------------------------------------------------------------------------
  600.   # draw_item
  601.   #--------------------------------------------------------------------------
  602.   def draw_item(index)
  603.     actor = $game_actors[@data[index]]
  604.     rect = item_rect(index)
  605.     if actor.nil?
  606.       draw_empty(rect.clone)
  607.       return
  608.     end
  609.     dx = rect.width / 2
  610.     dy = rect.height - 16
  611.     draw_actor_face(actor, rect.x, rect.y) if display_face?
  612.     draw_actor_graphic(actor, rect.x + dx, rect.y + dy) unless display_face?
  613.     draw_actor_name(actor, rect)
  614.     draw_locked_icon(actor, rect)
  615.     draw_required_icon(actor, rect)
  616.   end
  617.  
  618.   #--------------------------------------------------------------------------
  619.   # display_face?
  620.   #--------------------------------------------------------------------------
  621.   def display_face?
  622.     return YEA::PARTY::DISPLAY_FACE
  623.   end
  624.  
  625.   #--------------------------------------------------------------------------
  626.   # draw_empty
  627.   #--------------------------------------------------------------------------
  628.   def draw_empty(rect)
  629.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  630.     rect.x += 2
  631.     rect.y += 2
  632.     rect.width -= 4
  633.     rect.height -= 4
  634.     contents.fill_rect(rect, colour)
  635.     reset_font_settings
  636.     change_color(system_color)
  637.     text = YEA::PARTY::EMPTY_TEXT
  638.     draw_text(rect, text, 1)
  639.     reset_font_settings
  640.   end
  641.  
  642.   #--------------------------------------------------------------------------
  643.   # draw_actor_name
  644.   #--------------------------------------------------------------------------
  645.   def draw_actor_name(actor, rect)
  646.     contents.font.size = YEA::PARTY::PARTY_FONT_SIZE
  647.     change_color(normal_color, actor.exist?)
  648.     draw_text(rect.x+4, rect.y, rect.width-8, line_height, actor.name, 1)
  649.   end
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # draw_face
  653.   #--------------------------------------------------------------------------
  654.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  655.     bitmap = Cache.face(face_name)
  656.     dw = [96, item_rect(0).width-4].min
  657.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, dw, 92)
  658.     contents.blt(dx+2, dy+2, bitmap, rect, enabled ? 255 : translucent_alpha)
  659.     bitmap.dispose
  660.   end
  661.  
  662.   #--------------------------------------------------------------------------
  663.   # draw_locked_icon
  664.   #--------------------------------------------------------------------------
  665.   def draw_locked_icon(actor, rect)
  666.     return unless actor_locked?(actor)
  667.     draw_icon(Icon.locked_party, rect.x+rect.width-26, rect.height - 26)
  668.   end
  669.  
  670.   #--------------------------------------------------------------------------
  671.   # draw_required_icon
  672.   #--------------------------------------------------------------------------
  673.   def draw_required_icon(actor, rect)
  674.     return if actor_locked?(actor)
  675.     return unless actor_required?(actor)
  676.     draw_icon(Icon.required_party, rect.x+rect.width-26, rect.height - 26)
  677.   end
  678.  
  679.   #--------------------------------------------------------------------------
  680.   # actor_locked?
  681.   #--------------------------------------------------------------------------
  682.   def actor_locked?(actor); return actor.locked; end
  683.  
  684.   #--------------------------------------------------------------------------
  685.   # actor_required?
  686.   #--------------------------------------------------------------------------
  687.   def actor_required?(actor)
  688.     return false if actor.locked
  689.     return actor.required
  690.   end
  691.  
  692.   #--------------------------------------------------------------------------
  693.   # current_item_enabled?
  694.   #--------------------------------------------------------------------------
  695.   def current_item_enabled?; enable?(@data[index]); end
  696.  
  697.   #--------------------------------------------------------------------------
  698.   # enable?
  699.   #--------------------------------------------------------------------------
  700.   def enable?(item)
  701.     case @command_window.current_symbol
  702.     when :change
  703.       return true if item.nil?
  704.       return true if item == 0
  705.     when :remove
  706.       return false if item.nil?
  707.       return false if item == 0
  708.     end
  709.     actor = $game_actors[item]
  710.     return false if actor.locked
  711.     return false if actor.required
  712.     return true
  713.   end
  714.  
  715.   #--------------------------------------------------------------------------
  716.   # process_handling
  717.   #--------------------------------------------------------------------------
  718.   def process_handling
  719.     return unless open? && active
  720.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  721.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  722.     return process_pagedown if handle?(:pagedown) && Input.repeat?(:R)
  723.     return process_pageup   if handle?(:pageup)   && Input.repeat?(:L)
  724.   end
  725.  
  726.   #--------------------------------------------------------------------------
  727.   # cur_actor
  728.   #--------------------------------------------------------------------------
  729.   def cur_actor
  730.     actor_id = @data[index]
  731.     return $game_actors[actor_id]
  732.   end
  733.  
  734.   #--------------------------------------------------------------------------
  735.   # prev_actor
  736.   #--------------------------------------------------------------------------
  737.   def prev_actor
  738.     id = index == 0 ? @data.size - 1 : index - 1
  739.     actor_id = @data[id]
  740.     return $game_actors[actor_id]
  741.   end
  742.  
  743.   #--------------------------------------------------------------------------
  744.   # next_actor
  745.   #--------------------------------------------------------------------------
  746.   def next_actor
  747.     id = index == @data.size - 1 ? 0 : index + 1
  748.     actor_id = @data[id]
  749.     return $game_actors[actor_id]
  750.   end
  751.  
  752.   #--------------------------------------------------------------------------
  753.   # process_pageup
  754.   #--------------------------------------------------------------------------
  755.   def process_pageup
  756.     allow = true
  757.     allow = false if !prev_actor.nil? && prev_actor.locked
  758.     allow = false if !cur_actor.nil? && cur_actor.locked
  759.     Sound.play_buzzer unless allow
  760.     if allow
  761.       super
  762.       activate
  763.       select(index == 0 ? @data.size - 1 : index - 1)
  764.     end
  765.   end
  766.  
  767.   #--------------------------------------------------------------------------
  768.   # process_pagedown
  769.   #--------------------------------------------------------------------------
  770.   def process_pagedown
  771.     allow = true
  772.     allow = false if !next_actor.nil? && next_actor.locked
  773.     allow = false if !cur_actor.nil? && cur_actor.locked
  774.     Sound.play_buzzer unless allow
  775.     if allow
  776.       super
  777.       activate
  778.       select(index == @data.size - 1 ? 0 : index + 1)
  779.     end
  780.   end
  781.  
  782.   #--------------------------------------------------------------------------
  783.   # item
  784.   #--------------------------------------------------------------------------
  785.   def item; return @data[index]; end
  786.  
  787. end # Window_PartySelect
  788.  
  789. #==============================================================================
  790. # ■ Window_PartyList
  791. #==============================================================================
  792.  
  793. class Window_PartyList < Window_Selectable
  794.  
  795.   #--------------------------------------------------------------------------
  796.   # initialize
  797.   #-------------------------------------------------------------------------
  798.   def initialize(party_window)
  799.     super(0, fitting_height(4), window_width, window_height)
  800.     @party_window = party_window
  801.     select(1)
  802.     deactivate
  803.     refresh
  804.   end
  805.  
  806.   #--------------------------------------------------------------------------
  807.   # window_width
  808.   #--------------------------------------------------------------------------
  809.   def window_width; return 200; end
  810.  
  811.   #--------------------------------------------------------------------------
  812.   # window_height
  813.   #--------------------------------------------------------------------------
  814.   def window_height; return Graphics.height - fitting_height(4); end
  815.  
  816.   #--------------------------------------------------------------------------
  817.   # item_max
  818.   #--------------------------------------------------------------------------
  819.   def item_max; return @data ? @data.size : 1; end
  820.  
  821.   #--------------------------------------------------------------------------
  822.   # refresh
  823.   #--------------------------------------------------------------------------
  824.   def refresh
  825.     make_item_list
  826.     create_contents
  827.     draw_all_items
  828.   end
  829.  
  830.   #--------------------------------------------------------------------------
  831.   # make_item_list
  832.   #--------------------------------------------------------------------------
  833.   def make_item_list
  834.     @data = [0]
  835.     for member in $game_party.all_members
  836.       next if member.nil?
  837.       @data.push(member.id)
  838.     end
  839.     @data.push(0)
  840.   end
  841.  
  842.   #--------------------------------------------------------------------------
  843.   # draw_item
  844.   #--------------------------------------------------------------------------
  845.   def draw_item(index)
  846.     clear_item(index)
  847.     rect = item_rect(index)
  848.     if @data[index] == 0
  849.       draw_remove(rect)
  850.       return
  851.     end
  852.     actor = $game_actors[@data[index]]
  853.     draw_actor(actor, rect)
  854.     draw_actor_locked(actor, rect)
  855.     draw_actor_required(actor, rect)
  856.   end
  857.  
  858.   #--------------------------------------------------------------------------
  859.   # draw_remove
  860.   #--------------------------------------------------------------------------
  861.   def draw_remove(rect)
  862.     reset_font_settings
  863.     draw_icon(Icon.remove_party, rect.x+4, rect.y)
  864.     text = YEA::PARTY::REMOVE_TEXT
  865.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  866.   end
  867.  
  868.   #--------------------------------------------------------------------------
  869.   # draw_actor
  870.   #--------------------------------------------------------------------------
  871.   def draw_actor(actor, rect)
  872.     buffer = YEA::PARTY::ACTOR_Y_BUFFER
  873.     draw_actor_graphic(actor, rect.x + 16, rect.y + rect.height + buffer)
  874.     text = actor.name
  875.     change_color(list_colour(actor), enabled?(actor))
  876.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  877.   end
  878.  
  879.   #--------------------------------------------------------------------------
  880.   # list_colour
  881.   #--------------------------------------------------------------------------
  882.   def list_colour(actor)
  883.     return text_color(YEA::PARTY::IN_PARTY_COLOUR) if in_party?(actor)
  884.     return normal_color
  885.   end
  886.  
  887.   #--------------------------------------------------------------------------
  888.   # draw_actor_locked
  889.   #--------------------------------------------------------------------------
  890.   def draw_actor_locked(actor, rect)
  891.     return unless actor.locked
  892.     draw_icon(Icon.locked_party, rect.width-24, rect.y)
  893.   end
  894.  
  895.   #--------------------------------------------------------------------------
  896.   # draw_actor_required
  897.   #--------------------------------------------------------------------------
  898.   def draw_actor_required(actor, rect)
  899.     return if actor.locked
  900.     return unless actor.required
  901.     draw_icon(Icon.required_party, rect.width-24, rect.y)
  902.   end
  903.  
  904.   #--------------------------------------------------------------------------
  905.   # enabled?
  906.   #--------------------------------------------------------------------------
  907.   def enabled?(actor)
  908.     return false if actor.locked
  909.     return false if actor.required && in_party?(actor)
  910.     return actor.exist?
  911.   end
  912.  
  913.   #--------------------------------------------------------------------------
  914.   # in_party?
  915.   #--------------------------------------------------------------------------
  916.   def in_party?(actor); return $game_party.battle_members.include?(actor); end
  917.  
  918.   #--------------------------------------------------------------------------
  919.   # current_item_enabled?
  920.   #--------------------------------------------------------------------------
  921.   def current_item_enabled?
  922.     actor = $game_actors[item]
  923.     replace = $game_actors[@party_window.item]
  924.     unless actor.nil?
  925.       return false if actor.locked && in_party?(actor)
  926.       return false if actor.required && in_party?(actor)
  927.     end
  928.     return true if replace.nil?
  929.     return false if replace.locked
  930.     return false if replace.required
  931.     return true if actor.nil?
  932.     return actor.exist?
  933.   end
  934.  
  935.   #--------------------------------------------------------------------------
  936.   # item
  937.   #--------------------------------------------------------------------------
  938.   def item; return @data[index]; end
  939.  
  940. end # Window_PartyList
  941.  
  942. #==============================================================================
  943. # ** Window_PartyStatus
  944. #==============================================================================
  945.  
  946. class Window_PartyStatus < Window_Base
  947.  
  948.   #--------------------------------------------------------------------------
  949.   # initialize
  950.   #--------------------------------------------------------------------------
  951.   def initialize(party_window, list_window)
  952.     super(200, fitting_height(4), window_width, window_height)
  953.     @party_window = party_window
  954.     @list_window = list_window
  955.     [url=home.php?mod=space&uid=95897]@actor[/url] = active_actor
  956.     refresh
  957.   end
  958.  
  959.   #--------------------------------------------------------------------------
  960.   # window_width
  961.   #--------------------------------------------------------------------------
  962.   def window_width; Graphics.width - 200; end
  963.  
  964.   #--------------------------------------------------------------------------
  965.   # window_height
  966.   #--------------------------------------------------------------------------
  967.   def window_height; Graphics.height - fitting_height(4); end
  968.  
  969.   #--------------------------------------------------------------------------
  970.   # update
  971.   #--------------------------------------------------------------------------
  972.   def update
  973.     super
  974.     refresh if [url=home.php?mod=space&uid=95897]@actor[/url] != active_actor
  975.   end
  976.  
  977.   #--------------------------------------------------------------------------
  978.   # active_actor
  979.   #--------------------------------------------------------------------------
  980.   def active_actor
  981.     if @list_window.active
  982.       actor = @list_window.item
  983.     else
  984.       actor = @party_window.item
  985.     end
  986.     return nil if [0, nil].include?(actor)
  987.     return actor
  988.   end
  989.  
  990.   #--------------------------------------------------------------------------
  991.   # refresh
  992.   #--------------------------------------------------------------------------
  993.   def refresh
  994.     contents.clear
  995.     [url=home.php?mod=space&uid=95897]@actor[/url] = active_actor
  996.     reset_font_settings
  997.     if @actor.nil?
  998.       draw_nil_actor
  999.       return
  1000.     end
  1001.     actor = $game_actors[@actor]
  1002.     draw_actor_face(actor, 0, 0)
  1003.     draw_actor_name(actor, 108, 0)
  1004.     draw_actor_class(actor, 228, 0, contents.width-232)
  1005.     draw_actor_level(actor, 108, line_height)
  1006.     draw_actor_icons(actor, 228, line_height, contents.width-232)
  1007.     draw_actor_hp(actor, 108, line_height*2, contents.width-112)
  1008.     draw_actor_mp(actor, 108, line_height*3, contents.width-112)
  1009.     draw_actor_parameters(actor, 0, line_height*4 + line_height/2)
  1010.     draw_equipments(actor, contents.width/2, line_height*4 + line_height/2)
  1011.   end
  1012.  
  1013.   #--------------------------------------------------------------------------
  1014.   # draw_nil_actor
  1015.   #--------------------------------------------------------------------------
  1016.   def draw_nil_actor
  1017.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1018.     rect = Rect.new(0, 0, contents.width, contents.height)
  1019.     contents.fill_rect(rect, colour)
  1020.     change_color(system_color)
  1021.     text = YEA::PARTY::NO_DATA
  1022.     draw_text(rect, text, 1)
  1023.   end
  1024.  
  1025.   #--------------------------------------------------------------------------
  1026.   # draw_actor_parameters
  1027.   #--------------------------------------------------------------------------
  1028.   def draw_actor_parameters(actor, dx, dy)
  1029.     dw = contents.width/2 - 4
  1030.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1031.     contents.font.size = YEA::PARTY::STAT_FONT_SIZE
  1032.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1033.     array = [:atk, :def, :mat, :mdf, :agi, :luk]
  1034.     cx = 4
  1035.     for stat in array
  1036.       case stat
  1037.       when :atk
  1038.         param = Vocab::param(2)
  1039.         value = actor.atk.group
  1040.       when :def
  1041.         param = Vocab::param(3)
  1042.         value = actor.def.group
  1043.       when :mat
  1044.         param = Vocab::param(4)
  1045.         value = actor.mat.group
  1046.       when :mdf
  1047.         param = Vocab::param(5)
  1048.         value = actor.mdf.group
  1049.       when :agi
  1050.         param = Vocab::param(6)
  1051.         value = actor.agi.group
  1052.       when :luk
  1053.         param = Vocab::param(7)
  1054.         value = actor.luk.group
  1055.       else; next
  1056.       end
  1057.       contents.fill_rect(rect, colour)
  1058.       change_color(system_color)
  1059.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, param, 0)
  1060.       change_color(normal_color)
  1061.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, value, 2)
  1062.       rect.y += line_height
  1063.     end
  1064.     reset_font_settings
  1065.   end
  1066.  
  1067.   #--------------------------------------------------------------------------
  1068.   # draw_equipments
  1069.   #--------------------------------------------------------------------------
  1070.   def draw_equipments(actor, dx, dy)
  1071.     text = YEA::PARTY::EQUIP_TEXT
  1072.     change_color(system_color)
  1073.     draw_text(dx, dy, contents.width - dx, line_height, text, 1)
  1074.     dy += line_height
  1075.     if actor.equips.size <= 5
  1076.       actor.equips.each_with_index do |item, i|
  1077.         draw_item_name(item, dx, dy + line_height * i)
  1078.       end
  1079.     else
  1080.       orig_x = dx
  1081.       actor.equips.each_with_index do |item, i|
  1082.         next if item.nil?
  1083.         draw_icon(item.icon_index, dx, dy)
  1084.         dy += line_height if dx + 48 > contents.width
  1085.         dx = dx + 48 > contents.width ? orig_x : dx + 24
  1086.       end
  1087.     end
  1088.   end
  1089.  
  1090. end # Window_PartyStatus
  1091.  
  1092. #==============================================================================
  1093. # ■ Scene_Menu
  1094. #==============================================================================
  1095.  
  1096. class Scene_Menu < Scene_MenuBase
  1097.  
  1098.   #--------------------------------------------------------------------------
  1099.   # overwrite method: command_formation
  1100.   #--------------------------------------------------------------------------
  1101.   if YEA::PARTY::ENABLE_MENU
  1102.   def command_formation
  1103.     SceneManager.call(Scene_Party)
  1104.   end
  1105.   end # YEA::PARTY::ENABLE_MENU
  1106.  
  1107. end # Scene_Menu
  1108.  
  1109. #==============================================================================
  1110. # ■ Scene_Party
  1111. #==============================================================================
  1112.  
  1113. class Scene_Party < Scene_MenuBase
  1114.  
  1115.   #--------------------------------------------------------------------------
  1116.   # start
  1117.   #--------------------------------------------------------------------------
  1118.   def start
  1119.     super
  1120.     @former_party = $game_party.battle_members_array.clone
  1121.     create_command_window
  1122.     create_party_window
  1123.     create_list_window
  1124.     create_status_window
  1125.   end
  1126.  
  1127.   #--------------------------------------------------------------------------
  1128.   # create_command_window
  1129.   #--------------------------------------------------------------------------
  1130.   def create_command_window
  1131.     @command_window = Window_PartyMenuCommand.new(0, 0)
  1132.     @command_window.set_handler(:change, method(:adjust_members))
  1133.     @command_window.set_handler(:remove, method(:adjust_members))
  1134.     @command_window.set_handler(:revert, method(:revert_party))
  1135.     @command_window.set_handler(:finish, method(:return_scene))
  1136.     @command_window.set_handler(:cancel, method(:return_scene))
  1137.   end
  1138.  
  1139.   #--------------------------------------------------------------------------
  1140.   # create_party_window
  1141.   #--------------------------------------------------------------------------
  1142.   def create_party_window
  1143.     @party_window = Window_PartySelect.new(@command_window)
  1144.     @party_window.set_handler(:ok,       method(:on_party_ok))
  1145.     @party_window.set_handler(:cancel,   method(:on_party_cancel))
  1146.     @party_window.set_handler(:pageup,   method(:on_party_pageup))
  1147.     @party_window.set_handler(:pagedown, method(:on_party_pagedown))
  1148.   end
  1149.  
  1150.   #--------------------------------------------------------------------------
  1151.   # create_list_window
  1152.   #--------------------------------------------------------------------------
  1153.   def create_list_window
  1154.     @list_window = Window_PartyList.new(@party_window)
  1155.     @list_window.set_handler(:ok,     method(:on_list_ok))
  1156.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  1157.   end
  1158.  
  1159.   #--------------------------------------------------------------------------
  1160.   # create_status_window
  1161.   #--------------------------------------------------------------------------
  1162.   def create_status_window
  1163.     @status_window = Window_PartyStatus.new(@party_window, @list_window)
  1164.   end
  1165.  
  1166.   #--------------------------------------------------------------------------
  1167.   # adjust_members
  1168.   #--------------------------------------------------------------------------
  1169.   def adjust_members
  1170.     @party_window.activate
  1171.   end
  1172.  
  1173.   #--------------------------------------------------------------------------
  1174.   # window_refresh
  1175.   #--------------------------------------------------------------------------
  1176.   def window_refresh
  1177.     $game_party.rearrange_actors
  1178.     @command_window.refresh
  1179.     @party_window.refresh
  1180.     @list_window.refresh
  1181.     $game_player.refresh
  1182.     $game_map.need_refresh = true
  1183.   end
  1184.  
  1185.   #--------------------------------------------------------------------------
  1186.   # revert_party
  1187.   #--------------------------------------------------------------------------
  1188.   def revert_party
  1189.     @command_window.activate
  1190.     $game_party.battle_members_array = @former_party.clone
  1191.     window_refresh
  1192.   end
  1193.  
  1194.   #--------------------------------------------------------------------------
  1195.   # on_party_ok
  1196.   #--------------------------------------------------------------------------
  1197.   def on_party_ok
  1198.     case @command_window.current_symbol
  1199.     when :change
  1200.       @list_window.activate
  1201.     when :remove
  1202.       index = @party_window.index
  1203.       actor = $game_actors[$game_party.battle_members_array[index]]
  1204.       Sound.play_equip
  1205.       $game_party.battle_members_array[index] = 0
  1206.       window_refresh
  1207.       @party_window.activate
  1208.     end
  1209.   end
  1210.  
  1211.   #--------------------------------------------------------------------------
  1212.   # on_party_cancel
  1213.   #--------------------------------------------------------------------------
  1214.   def on_party_cancel
  1215.     @command_window.activate
  1216.   end
  1217.  
  1218.   #--------------------------------------------------------------------------
  1219.   # on_party_pageup
  1220.   #--------------------------------------------------------------------------
  1221.   def on_party_pageup
  1222.     Sound.play_equip
  1223.     actor_id1 = @party_window.item
  1224.     actor_id2 = @party_window.prev_actor.nil? ? 0 : @party_window.prev_actor.id
  1225.     max = @party_window.item_max-1
  1226.     index1 = @party_window.index
  1227.     index2 = @party_window.index == 0 ? max : index1-1
  1228.     $game_party.battle_members_array[index1] = actor_id2
  1229.     $game_party.battle_members_array[index2] = actor_id1
  1230.     window_refresh
  1231.   end
  1232.  
  1233.   #--------------------------------------------------------------------------
  1234.   # on_party_pagedown
  1235.   #--------------------------------------------------------------------------
  1236.   def on_party_pagedown
  1237.     Sound.play_equip
  1238.     actor_id1 = @party_window.item
  1239.     actor_id2 = @party_window.next_actor.nil? ? 0 : @party_window.next_actor.id
  1240.     max = @party_window.item_max-1
  1241.     index1 = @party_window.index
  1242.     index2 = @party_window.index == max ? 0 : index1+1
  1243.     $game_party.battle_members_array[index1] = actor_id2
  1244.     $game_party.battle_members_array[index2] = actor_id1
  1245.     window_refresh
  1246.   end
  1247.  
  1248.   #--------------------------------------------------------------------------
  1249.   # on_list_cancel
  1250.   #--------------------------------------------------------------------------
  1251.   def on_list_cancel
  1252.     @party_window.activate
  1253.   end
  1254.  
  1255.   #--------------------------------------------------------------------------
  1256.   # on_list_ok
  1257.   #--------------------------------------------------------------------------
  1258.   def on_list_ok
  1259.     Sound.play_equip
  1260.     replace = $game_actors[@party_window.item]
  1261.     actor = $game_actors[@list_window.item]
  1262.     index1 = @party_window.index
  1263.     actor_id1 = actor.nil? ? 0 : actor.id
  1264.     if actor.nil?
  1265.       $game_party.battle_members_array[index1] = 0
  1266.       window_refresh
  1267.       @party_window.activate
  1268.       return
  1269.     end
  1270.     actor_id2 = replace.nil? ? 0 : replace.id
  1271.     if $game_party.battle_members_array.include?(actor_id1)
  1272.       index2 = $game_party.battle_members_array.index(actor_id1)
  1273.       $game_party.battle_members_array[index2] = actor_id2
  1274.     end
  1275.     $game_party.battle_members_array[index1] = actor_id1
  1276.     window_refresh
  1277.     @party_window.activate
  1278.   end
  1279.  
  1280. end # Scene_Party
  1281.  
  1282. #==============================================================================
  1283. #
  1284. # ▼ End of File
  1285. #
  1286. #==============================================================================

未命名2.jpg (100.32 KB, 下载次数: 23)

未命名2.jpg

点评

修改321行的 def initialize_battle_members中的battle_members_array生成算法,可以加替补人员。  发表于 2014-3-1 20:22

Lv3.寻梦者

虚空人形

梦石
0
星屑
4604
在线时间
2037 小时
注册时间
2011-8-11
帖子
3398

贵宾

5
 楼主| 发表于 2014-3-3 21:04:23 | 只看该作者
本帖最后由 hcm 于 2014-3-6 21:33 编辑
345912390 发表于 2014-3-3 20:12
@hcm 如果改成 替补成员自动加入战斗序列是可以但这样一来这个脚本就大大的失去了它存在的意义了!  ...


主要是我需要的主角比较多,如果使用默认的在状态菜单的整队方式不便于队伍的管理,
我做的游戏有些原因需要随时保持这种状态。

未命名.jpg (67.93 KB, 下载次数: 70)

未命名.jpg
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
620
在线时间
925 小时
注册时间
2011-5-11
帖子
438
4
发表于 2014-3-3 20:12:41 | 只看该作者
@hcm 如果改成 替补成员自动加入战斗序列是可以但这样一来这个脚本就大大的失去了它存在的意义了!
http://rpg.blue/static/image/smiley/yct/A059.gif中国字认识都不到一半,哪的心情学英语呀!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

虚空人形

梦石
0
星屑
4604
在线时间
2037 小时
注册时间
2011-8-11
帖子
3398

贵宾

3
 楼主| 发表于 2014-3-3 08:41:49 | 只看该作者
本帖最后由 hcm 于 2014-3-3 08:50 编辑

嗯,感觉非常好,
本来还有一项要求我忘记提的,因为如果队员总数小于等于战斗人员的话替补就没意义了。
所以队员小于战斗人数就不该出现替补,你连这个都考虑进去了。

可惜感觉好像和http://rpg.blue/thread-353463-1-1.html略有冲突之处。

点评

没有看明白你的那一个贴子写的什么意思!  发表于 2014-3-3 17:58
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
620
在线时间
925 小时
注册时间
2011-5-11
帖子
438
2
发表于 2014-3-2 18:23:16 | 只看该作者
本帖最后由 345912390 于 2014-3-3 19:50 编辑

脚本已修改!自行测试看是不是自己想要的。
#***#为修改或增加的部分!为排版好看改为4人参战!

修复了后备队员为空的Bug
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Party System v1.08
  4. # -- Last Updated: 2012.01.23
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-PartySystem"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.23 - Bug fixed: Party members are now rearranged when newly added.
  17. # 2012.01.14 - New Feature: Maximum Battle Members Variable added.
  18. # 2012.01.07 - Bug fixed: Error with removing members.
  19. # 2012.01.05 - Bug fixed: Escape skill/item effects no longer counts as death.
  20. # 2011.12.26 - Compatibility Update: New Game+
  21. # 2011.12.17 - Updated Spriteset_Battle to have updated sprite counts.
  22. # 2011.12.13 - Updated to provide better visual display when more than 5 pieces
  23. #              of equipment are equipped on an actor at a time.
  24. # 2011.12.05 - Added functionality to display faces in the Party Select Window.
  25. #            - Fixed bug that doesn't refresh the caterpillar when new members
  26. #              join the party.
  27. # 2011.12.04 - Started Script and Finished.
  28. #
  29. #==============================================================================
  30. # ▼ Introduction
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # RPG Maker VX Ace comes with a very nice party system. However, changing the
  33. # maximum number of members isn't possible without the aid of a script. This
  34. # script enables you the ability to change the maximum number of party members,
  35. # change EXP rates, and/or open up a separate party menu (if desired). In
  36. # addition to that, you can lock the position of actors within a party and
  37. # require other actors to be in the active party before continuing.
  38. #
  39. #==============================================================================
  40. # ▼ Instructions
  41. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  42. # To install this script, open up your script editor and copy/paste this script
  43. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  44. #
  45. # -----------------------------------------------------------------------------
  46. # Script Calls - These commands are used with script calls.
  47. # -----------------------------------------------------------------------------
  48. # *IMPORTANT* These script calls require the new party menu to be enabled to
  49. # use them. Otherwise, nothing will happen.
  50. #
  51. # lock_actor(x)
  52. # unlock_actor(x)
  53. # This will lock actor x in its current position in the party if the actor is
  54. # in the current party. The actor is unable to switch position and must remain
  55. # in that position until the lock is removed. Use the unlock script call to
  56. # remove the locked status. This script requires the actor to have joined and
  57. # in the current party before the script call will work.
  58. #
  59. # require_actor(x)
  60. # unrequire_actor(x)
  61. # This will cause the party to require actor x in order to continue. If the
  62. # actor isn't in the current party but is in the reserve party, the party menu
  63. # will open up and prompt the player to add the required actor into the party
  64. # before being able to continue. This script call will not function unless the
  65. # specific actor has joined the party, whether it is in the current or reserve.
  66. #
  67. # call_party_menu
  68. # This will open up the party menu. This script call requires for the party
  69. # menu to be enabled to use.
  70. #
  71. #==============================================================================
  72. # ▼ Compatibility
  73. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  74. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  75. # it will run with RPG Maker VX without adjusting.
  76. #
  77. #==============================================================================
  78.  
  79. module YEA
  80.   module PARTY
  81.  
  82.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  83.     # - General Party Settings -
  84.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  85.     # In this section, you can adjust the general party settings for your game
  86.     # such as the maximum amount of members and whatnot, the EXP rate for
  87.     # party members in the reserve, etc.
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     MAX_BATTLE_MEMBERS   = 4      # Maximum party members. Default: 4
  90.     SPLIT_EXP            = false  # Splits EXP with more members in the party.
  91.     RESERVE_EXP_RATE     = 0.50   # Reserve EXP Rate. Default: 1.00
  92.  
  93.     # If you wish to be able to change the maximum number of battle members
  94.     # during the middle of your game, set this constant to a variable ID. If
  95.     # that variable ID is a number greater than 0, that variable will determine
  96.     # the current maximum number of battle members. Be cautious about using
  97.     # this during battle.
  98.     MAX_MEMBERS_VARIABLE = 0
  99.  
  100.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  101.     # - Party Menu Settings -
  102.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  103.     # This section contains various menu settings for those who wish to use a
  104.     # menu separate for the party system. Here, adjust the menu command order,
  105.     # icons used, and other settings.
  106.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  107.     ENABLE_MENU = true   # Enables party menu. Default: false
  108.     COMMANDS =[          # The order at which the menu items are shown.
  109.     # [:command,  "Display"],
  110.       [ :change,  "Change",],
  111.       [ :remove,  "Remove",],
  112.       [ :revert,  "Revert",],
  113.       [ :finish,  "Finish",],
  114.     ] # Do not remove this.
  115.     COMMAND_ALIGN    = 1     # 0:Left Align, 1:Center Align, 2:Right Align
  116.  
  117.     # These settings here are used for the upper right window: the Party Select
  118.     # window where the player selects a member to swap out or remove.
  119.     PARTY_FONT_SIZE  = 20    # Font size used for party member names.
  120.     LOCK_FIRST_ACTOR = false # Lock the first actor by default?
  121.     LOCKED_ICON      = 125   # Icon used for locked members.
  122.     REQUIRED_ICON    = 126   # Icon used for required members.
  123.     EMPTY_TEXT = "-Empty-"   # Text used when a member isn't present.
  124.     DISPLAY_FACE     = false # Display faces instead of sprites?
  125.  
  126.     # These settings here are used for the lower left window: the Party List
  127.     # window where the player selects a member to replace.
  128.     REMOVE_ICON      = 185          # Icon used for removing members.
  129.     REMOVE_TEXT      = "-Remove-"   # Text used for remove member command.
  130.     ACTOR_Y_BUFFER   = 12           # Amount the actor graphic be adjusted by.
  131.  
  132.     # These settings here are used for the lower right window: the Party Status
  133.     # window where info about a selected actor is shown.
  134.     NO_DATA         = "- No Data -" # Text used for when no actor is shown.
  135.     IN_PARTY_COLOUR = 6             # Text colour used for in party members.
  136.     STAT_FONT_SIZE  = 20            # Font size used for stats.
  137.     EQUIP_TEXT      = "Equipment"   # Text used to display equipment.
  138.  
  139.   end # PARTY
  140. end # YEA
  141.  
  142. #==============================================================================
  143. # ▼ Editting anything past this point may potentially result in causing
  144. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  145. # halitosis so edit at your own risk.
  146. #==============================================================================
  147.  
  148. #==============================================================================
  149. # ■ Icon
  150. #==============================================================================
  151.  
  152. module Icon
  153.  
  154.   #--------------------------------------------------------------------------
  155.   # self.locked_party
  156.   #--------------------------------------------------------------------------
  157.   def self.locked_party; return YEA::PARTY::LOCKED_ICON; end
  158.  
  159.   #--------------------------------------------------------------------------
  160.   # self.required_party
  161.   #--------------------------------------------------------------------------
  162.   def self.required_party; return YEA::PARTY::REQUIRED_ICON; end
  163.  
  164.   #--------------------------------------------------------------------------
  165.   # self.remove_party
  166.   #--------------------------------------------------------------------------
  167.   def self.remove_party; return YEA::PARTY::REMOVE_ICON; end
  168.  
  169. end # Icon
  170.  
  171. #==============================================================================
  172. # ■ Variable
  173. #==============================================================================
  174.  
  175. module Variable
  176.  
  177.   #--------------------------------------------------------------------------
  178.   # self.max_battle_members
  179.   #--------------------------------------------------------------------------
  180.   def self.max_battle_members
  181.     default = YEA::PARTY::MAX_BATTLE_MEMBERS
  182.     return default if YEA::PARTY::MAX_MEMBERS_VARIABLE <= 0
  183.     return default if $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE] <= 0
  184.     return $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE]
  185.   end
  186.  
  187. end # Variable
  188.  
  189. #==============================================================================
  190. # ■ Numeric
  191. #==============================================================================
  192.  
  193. class Numeric
  194.  
  195.   #--------------------------------------------------------------------------
  196.   # new method: group_digits
  197.   #--------------------------------------------------------------------------
  198.   unless $imported["YEA-CoreEngine"]
  199.   def group; return self.to_s; end
  200.   end # $imported["YEA-CoreEngine"]
  201.  
  202. end # Numeric
  203.  
  204. #==============================================================================
  205. # ■ Game_Actor
  206. #==============================================================================
  207.  
  208. class Game_Actor < Game_Battler
  209.  
  210.   #--------------------------------------------------------------------------
  211.   # public instance variables
  212.   #--------------------------------------------------------------------------
  213.   attr_accessor :locked
  214.   attr_accessor :required
  215.  
  216.   #--------------------------------------------------------------------------
  217.   # alias method: setup
  218.   #--------------------------------------------------------------------------
  219.   alias game_actor_setup_ps setup
  220.   def setup(actor_id)
  221.     game_actor_setup_ps(actor_id)
  222.     @locked = false
  223.     @required = false
  224.   end
  225.  
  226.   #--------------------------------------------------------------------------
  227.   # overwrite method: final_exp_rate
  228.   #--------------------------------------------------------------------------
  229.   def final_exp_rate
  230.     n = exr * (battle_member? ? 1 : reserve_members_exp_rate)
  231.     if $game_party.in_battle
  232.       n /= [$game_party.battle_members.size, 1].max if YEA::PARTY::SPLIT_EXP
  233.     end
  234.     return n
  235.   end
  236.  
  237.   #--------------------------------------------------------------------------
  238.   # overwrite method: reserve_members_exp_rate
  239.   #--------------------------------------------------------------------------
  240.   def reserve_members_exp_rate
  241.     $data_system.opt_extra_exp ? YEA::PARTY::RESERVE_EXP_RATE : 0
  242.   end
  243.  
  244. end # Game_Actor
  245.  
  246. #==============================================================================
  247. # ■ Game_Party
  248. #==============================================================================
  249.  
  250. class Game_Party < Game_Unit
  251.  
  252.   #--------------------------------------------------------------------------
  253.   # public instance variables
  254.   #--------------------------------------------------------------------------
  255.   attr_accessor :battle_members_array
  256.   attr_accessor :tmp_remove_actor#***#
  257.   #--------------------------------------------------------------------------
  258.   # alias method: initialize
  259.   #--------------------------------------------------------------------------
  260.   alias game_party_initialize_ps initialize
  261.   def initialize
  262.     game_party_initialize_ps
  263.     @battle_members_array = nil
  264.     @tmp_remove_actor=nil#***#
  265.   end
  266.  
  267.   #--------------------------------------------------------------------------
  268.   # overwrite method: max_battle_members
  269.   #--------------------------------------------------------------------------
  270.   def max_battle_members; return Variable.max_battle_members; end
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # alias method: setup_starting_members
  274.   #--------------------------------------------------------------------------
  275.   alias setup_starting_members_ps setup_starting_members
  276.   def setup_starting_members
  277.     setup_starting_members_ps
  278.     initialize_battle_members
  279.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  280.     return if members[0].nil?
  281.     members[0].locked = true
  282.   end
  283.  
  284.   #--------------------------------------------------------------------------
  285.   # alias method: setup_battle_test_members
  286.   #--------------------------------------------------------------------------
  287.   alias setup_battle_test_members_ps setup_battle_test_members
  288.   def setup_battle_test_members
  289.     setup_battle_test_members_ps
  290.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  291.     return if members[0].nil?
  292.     members[0].locked = true
  293.   end
  294.  
  295.   #--------------------------------------------------------------------------
  296.   # overwrite method: battle_members
  297.   #--------------------------------------------------------------------------
  298.   def battle_members
  299.     initialize_battle_members if initialize_battle_members?
  300.     array = []
  301.     for actor_id in @battle_members_array
  302.       break if array.size > max_battle_members
  303.       next if actor_id.nil?
  304.       next if $game_actors[actor_id].nil?
  305.       next unless $game_actors[actor_id].exist?
  306.       #array.push($game_actors[actor_id])
  307.       #***#
  308.       if max_battle_members<all_members.size then
  309.         if actor_id !=@battle_members_array[@battle_members_array.size-1] then
  310.           array.push($game_actors[actor_id])
  311.         end
  312.       else
  313.         array.push($game_actors[actor_id])
  314.       end
  315.       #***#
  316.     end
  317.     return array
  318.   end
  319.  
  320.   #--------------------------------------------------------------------------
  321.   # new method: initialize_battle_members?
  322.   #--------------------------------------------------------------------------
  323.   def initialize_battle_members?
  324.     return true if @battle_members_array.nil?
  325.     #return @battle_members_array.size != max_battle_members
  326.     #***#
  327.     if max_battle_members<all_members.size then
  328.       return @battle_members_array.size != max_battle_members+1
  329.     else
  330.       return @battle_members_array.size != max_battle_members
  331.     end
  332.     #***#
  333.   end
  334.  
  335.   #--------------------------------------------------------------------------
  336.   # new method: initialize_battle_members
  337.   #--------------------------------------------------------------------------
  338.   def initialize_battle_members
  339.     @battle_members_array = []
  340.     for i in 0...max_battle_members
  341.       @battle_members_array.push(@actors[i]) unless @actors[i].nil?
  342.       @battle_members_array.push(0) if @actors[i].nil?
  343.     end
  344.     #***#
  345.     if max_battle_members<all_members.size then
  346.       @battle_members_array.push(all_members[max_battle_members].id)
  347.     end
  348.     #***#
  349.     $game_player.refresh
  350.   end
  351.  
  352.   #--------------------------------------------------------------------------
  353.   # alias method: add_actor
  354.   #--------------------------------------------------------------------------
  355.   alias game_party_add_actor_ps add_actor
  356.   def add_actor(actor_id)
  357.     game_party_add_actor_ps(actor_id)
  358.     return if @battle_members_array.include?(actor_id)
  359.     return unless @battle_members_array.include?(0)
  360.     index = @battle_members_array.index(0)
  361.     @battle_members_array[index] = actor_id
  362.     $game_player.refresh
  363.     $game_map.need_refresh = true
  364.     rearrange_actors
  365.   end
  366.  
  367.   #--------------------------------------------------------------------------
  368.   # alias method: remove_actor
  369.   #--------------------------------------------------------------------------
  370.   alias game_party_remove_actor_ps remove_actor
  371.   def remove_actor(actor_id)
  372.     game_party_remove_actor_ps(actor_id)
  373.     return unless @battle_members_array.include?(actor_id)
  374.     index = @battle_members_array.index(actor_id)
  375.     @battle_members_array[index] = 0
  376.     $game_player.refresh
  377.     $game_map.need_refresh = true
  378.     rearrange_actors
  379.   end
  380.  
  381.   #--------------------------------------------------------------------------
  382.   # new method: rearrange_actors
  383.   #--------------------------------------------------------------------------
  384.   def rearrange_actors
  385.     initialize_battle_members if @battle_members_array.nil?
  386.     array = []
  387.     for actor_id in @battle_members_array
  388.       next if [0, nil].include?(actor_id)
  389.       next if $game_actors[actor_id].nil?
  390.       array.push(actor_id)
  391.     end
  392.     for actor_id in @actors
  393.       next if array.include?(actor_id)
  394.       next if $game_actors[actor_id].nil?
  395.       next if tmp_remove_actor==actor_id#***#
  396.       array.push(actor_id)
  397.     end
  398.     if not array.include?(tmp_remove_actor) then
  399.       array.push(tmp_remove_actor) if not [0, nil].include?(tmp_remove_actor)#***#
  400.     end
  401.     @actors = array
  402.   end
  403.  
  404. end # Game_Party
  405.  
  406. #==============================================================================
  407. # ■ Game_Interpreter
  408. #==============================================================================
  409.  
  410. class Game_Interpreter
  411.  
  412.   #--------------------------------------------------------------------------
  413.   # new method: lock_actor
  414.   #--------------------------------------------------------------------------
  415.   def lock_actor(actor_id)
  416.     return unless YEA::PARTY::ENABLE_MENU
  417.     actor = $game_actors[actor_id]
  418.     return unless $game_party.battle_members.include?(actor.id)
  419.     actor.locked = true
  420.   end
  421.  
  422.   #--------------------------------------------------------------------------
  423.   # new method: unlock_actor
  424.   #--------------------------------------------------------------------------
  425.   def unlock_actor(actor_id)
  426.     return unless YEA::PARTY::ENABLE_MENU
  427.     actor = $game_actors[actor_id]
  428.     return unless $game_party.battle_members.include?(actor.id)
  429.     actor.locked = false
  430.   end
  431.  
  432.   #--------------------------------------------------------------------------
  433.   # new method: require_actor
  434.   #--------------------------------------------------------------------------
  435.   def require_actor(actor_id)
  436.     return unless YEA::PARTY::ENABLE_MENU
  437.     return if $game_system.formation_disabled
  438.     actor = $game_actors[actor_id]
  439.     return unless $game_party.all_members.include?(actor)
  440.     actor.required = true
  441.     call_party_menu unless $game_party.battle_members.include?(actor)
  442.   end
  443.  
  444.   #--------------------------------------------------------------------------
  445.   # new method: unrequire_actor
  446.   #--------------------------------------------------------------------------
  447.   def unrequire_actor(actor_id)
  448.     return unless YEA::PARTY::ENABLE_MENU
  449.     return if $game_system.formation_disabled
  450.     actor = $game_actors[actor_id]
  451.     return unless $game_party.all_members.include?(actor)
  452.     actor.required = false
  453.     call_party_menu unless $game_party.battle_members.include?(actor)
  454.   end
  455.  
  456.   #--------------------------------------------------------------------------
  457.   # new method: call_party_menu
  458.   #--------------------------------------------------------------------------
  459.   def call_party_menu
  460.     return unless YEA::PARTY::ENABLE_MENU
  461.     return if $game_system.formation_disabled
  462.     SceneManager.call(Scene_Party)
  463.   end
  464.  
  465. end # Game_Interpreter
  466.  
  467. #==============================================================================
  468. # ■ Spriteset_Battle
  469. #==============================================================================
  470.  
  471. class Spriteset_Battle
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # overwrite method: create_actors
  475.   #--------------------------------------------------------------------------
  476.   def create_actors
  477.     total = $game_party.max_battle_members
  478.     @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  479.   end
  480.  
  481. end # Spriteset_Battle
  482.  
  483. #==============================================================================
  484. # ■ Window_PartyMenuCommand
  485. #==============================================================================
  486.  
  487. class Window_PartyMenuCommand < Window_Command
  488.  
  489.   #--------------------------------------------------------------------------
  490.   # window_width
  491.   #--------------------------------------------------------------------------
  492.   def window_width; return 160; end
  493.  
  494.   #--------------------------------------------------------------------------
  495.   # visible_line_number
  496.   #--------------------------------------------------------------------------
  497.   def visible_line_number; 4; end
  498.  
  499.   #--------------------------------------------------------------------------
  500.   # alignment
  501.   #--------------------------------------------------------------------------
  502.   def alignment
  503.     return Menu.command_window_align if $imported["YEA-AceMenuEngine"]
  504.     return YEA::PARTY::COMMAND_ALIGN
  505.   end
  506.  
  507.   #--------------------------------------------------------------------------
  508.   # scene
  509.   #--------------------------------------------------------------------------
  510.   def scene; return SceneManager.scene; end
  511.  
  512.   #--------------------------------------------------------------------------
  513.   # make_command_list
  514.   #--------------------------------------------------------------------------
  515.   def make_command_list
  516.     for command in YEA::PARTY::COMMANDS
  517.       case command[0]
  518.       when :change, :remove, :revert
  519.         add_command(command[1], command[0])
  520.       when :finish
  521.         add_command(command[1], command[0], enable_cancel?)
  522.       else; next
  523.       end
  524.     end
  525.   end
  526.  
  527.   #--------------------------------------------------------------------------
  528.   # process_cancel
  529.   #--------------------------------------------------------------------------
  530.   def process_cancel
  531.     unless enable_cancel?
  532.       Sound.play_buzzer
  533.       return
  534.     end
  535.     super
  536.   end
  537.  
  538.   #--------------------------------------------------------------------------
  539.   # in_party?
  540.   #--------------------------------------------------------------------------
  541.   def in_party?(actor)
  542.     return $game_party.battle_members.include?(actor)
  543.   end
  544.  
  545.   #--------------------------------------------------------------------------
  546.   # enable_cancel?
  547.   #--------------------------------------------------------------------------
  548.   def enable_cancel?
  549.     return false if $game_party.battle_members.size <= 0
  550.     for actor in $game_party.all_members
  551.       next if in_party?(actor)
  552.       return false if actor.required
  553.       return false if actor.locked
  554.     end
  555.     return true
  556.   end
  557.  
  558. end # Window_PartyMenuCommand
  559.  
  560. #==============================================================================
  561. # ■ Window_PartySelect
  562. #==============================================================================
  563.  
  564. class Window_PartySelect < Window_Selectable
  565.  
  566.   #--------------------------------------------------------------------------
  567.   # initialize
  568.   #-------------------------------------------------------------------------
  569.   def initialize(command_window)
  570.     @command_window = command_window
  571.     super(160, 0, window_width, fitting_height(visible_line_number))
  572.     select(0)
  573.     deactivate
  574.     refresh
  575.   end
  576.  
  577.   #--------------------------------------------------------------------------
  578.   # col_max
  579.   #--------------------------------------------------------------------------
  580.   def col_max#; return $game_party.max_battle_members;
  581.     #***#
  582.     if $game_party.max_battle_members<$game_party.all_members.size then
  583.       return  $game_party.max_battle_members+1
  584.     else
  585.       return  $game_party.max_battle_members
  586.     end
  587.     #***#
  588.   end
  589.  
  590.   #--------------------------------------------------------------------------
  591.   # item_max
  592.   #--------------------------------------------------------------------------
  593.   #def item_max; return $game_party.max_battle_members; end
  594.   #***#
  595.   def item_max
  596.     if $game_party.max_battle_members<$game_party.all_members.size then
  597.       return  $game_party.max_battle_members+1
  598.     else
  599.       return  $game_party.max_battle_members
  600.     end
  601.   end
  602.   #***#
  603.   #--------------------------------------------------------------------------
  604.   # window_width
  605.   #--------------------------------------------------------------------------
  606.   def window_width; return Graphics.width - 160; end
  607.  
  608.   #--------------------------------------------------------------------------
  609.   # visible_line_number
  610.   #--------------------------------------------------------------------------
  611.   def visible_line_number; 4; end
  612.  
  613.   #--------------------------------------------------------------------------
  614.   # item_rect
  615.   #--------------------------------------------------------------------------
  616.   def item_rect(index)
  617.     rect = Rect.new
  618.     rect.width = contents.width / item_max
  619.     rect.height = contents.height
  620.     rect.x = index * rect.width
  621.     rect.y = 0
  622.     return rect
  623.   end
  624.  
  625.   #--------------------------------------------------------------------------
  626.   # refresh
  627.   #--------------------------------------------------------------------------
  628.   def refresh
  629.     make_item_list
  630.     create_contents
  631.     draw_all_items
  632.   end
  633.  
  634.   #--------------------------------------------------------------------------
  635.   # make_item_list
  636.   #--------------------------------------------------------------------------
  637.   def make_item_list
  638.     @data = $game_party.battle_members_array.clone
  639.   end
  640.  
  641.   #--------------------------------------------------------------------------
  642.   # draw_item
  643.   #--------------------------------------------------------------------------
  644.   def draw_item(index)
  645.     actor = $game_actors[@data[index]]
  646.     rect = item_rect(index)
  647.     if actor.nil?
  648.       draw_empty(rect.clone)
  649.       return
  650.     end
  651.     dx = rect.width / 2
  652.     dy = rect.height - line_height*3/2#***#
  653.     draw_actor_face(actor, rect.x, rect.y) if display_face?
  654.     draw_actor_graphic(actor, rect.x + dx, rect.y + dy) unless display_face?
  655.     draw_actor_name(actor, rect)
  656.     draw_locked_icon(actor, rect)
  657.     draw_required_icon(actor, rect)
  658.   end
  659.  
  660.   #--------------------------------------------------------------------------
  661.   # display_face?
  662.   #--------------------------------------------------------------------------
  663.   def display_face?
  664.     return YEA::PARTY::DISPLAY_FACE
  665.   end
  666.  
  667.   #--------------------------------------------------------------------------
  668.   # draw_empty
  669.   #--------------------------------------------------------------------------
  670.   def draw_empty(rect)
  671.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  672.     rect.x += 2
  673.     rect.y += 2
  674.     rect.width -= 4
  675.     rect.height -= 4
  676.     contents.fill_rect(rect, colour)
  677.     reset_font_settings
  678.     change_color(system_color)
  679.     text = YEA::PARTY::EMPTY_TEXT
  680.     draw_text(rect, text, 1)
  681.     reset_font_settings
  682.   end
  683.  
  684.   #--------------------------------------------------------------------------
  685.   # draw_actor_name
  686.   #--------------------------------------------------------------------------
  687.   def draw_actor_name(actor, rect)
  688.     contents.font.size = YEA::PARTY::PARTY_FONT_SIZE
  689.     change_color(normal_color, actor.exist?)
  690.     draw_text(rect.x+4, rect.y, rect.width-8, line_height, actor.name, 1)
  691.     #***#
  692.     if $game_party.battle_members.include?(actor) then
  693.       change_color(text_color(YEA::PARTY::IN_PARTY_COLOUR) )
  694.       draw_text(rect.x+4, rect.y+line_height*3, rect.width-8, line_height, "战斗成员", 1)
  695.       change_color(normal_color)
  696.     else
  697.       draw_text(rect.x+4, rect.y+line_height*3, rect.width-8, line_height,"替补成员", 1)
  698.     end
  699.       #***#
  700.   end
  701.  
  702.   #--------------------------------------------------------------------------
  703.   # draw_face
  704.   #--------------------------------------------------------------------------
  705.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  706.     bitmap = Cache.face(face_name)
  707.     dw = [96, item_rect(0).width-4].min
  708.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, dw, 92)
  709.     contents.blt(dx+2, dy+2, bitmap, rect, enabled ? 255 : translucent_alpha)
  710.     bitmap.dispose
  711.   end
  712.  
  713.   #--------------------------------------------------------------------------
  714.   # draw_locked_icon
  715.   #--------------------------------------------------------------------------
  716.   def draw_locked_icon(actor, rect)
  717.     return unless actor_locked?(actor)
  718.     draw_icon(Icon.locked_party, rect.x+rect.width-26, rect.height - 26)
  719.   end
  720.  
  721.   #--------------------------------------------------------------------------
  722.   # draw_required_icon
  723.   #--------------------------------------------------------------------------
  724.   def draw_required_icon(actor, rect)
  725.     return if actor_locked?(actor)
  726.     return unless actor_required?(actor)
  727.     draw_icon(Icon.required_party, rect.x+rect.width-26, rect.height - 26)
  728.   end
  729.  
  730.   #--------------------------------------------------------------------------
  731.   # actor_locked?
  732.   #--------------------------------------------------------------------------
  733.   def actor_locked?(actor); return actor.locked; end
  734.  
  735.   #--------------------------------------------------------------------------
  736.   # actor_required?
  737.   #--------------------------------------------------------------------------
  738.   def actor_required?(actor)
  739.     return false if actor.locked
  740.     return actor.required
  741.   end
  742.  
  743.   #--------------------------------------------------------------------------
  744.   # current_item_enabled?
  745.   #--------------------------------------------------------------------------
  746.   def current_item_enabled?; enable?(@data[index]); end
  747.  
  748.   #--------------------------------------------------------------------------
  749.   # enable?
  750.   #--------------------------------------------------------------------------
  751.   def enable?(item)
  752.     case @command_window.current_symbol
  753.     when :change
  754.       return true if item.nil?
  755.       return true if item == 0
  756.     when :remove
  757.       return false if item.nil?
  758.       return false if item == 0
  759.     end
  760.     actor = $game_actors[item]
  761.     return false if actor.locked
  762.     return false if actor.required
  763.     return true
  764.   end
  765.  
  766.   #--------------------------------------------------------------------------
  767.   # process_handling
  768.   #--------------------------------------------------------------------------
  769.   def process_handling
  770.     return unless open? && active
  771.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  772.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  773.     return process_pagedown if handle?(:pagedown) && Input.repeat?(:R)
  774.     return process_pageup   if handle?(:pageup)   && Input.repeat?(:L)
  775.   end
  776.  
  777.   #--------------------------------------------------------------------------
  778.   # cur_actor
  779.   #--------------------------------------------------------------------------
  780.   def cur_actor
  781.     actor_id = @data[index]
  782.     return $game_actors[actor_id]
  783.   end
  784.  
  785.   #--------------------------------------------------------------------------
  786.   # prev_actor
  787.   #--------------------------------------------------------------------------
  788.   def prev_actor
  789.     id = index == 0 ? @data.size - 1 : index - 1
  790.     actor_id = @data[id]
  791.     return $game_actors[actor_id]
  792.   end
  793.  
  794.   #--------------------------------------------------------------------------
  795.   # next_actor
  796.   #--------------------------------------------------------------------------
  797.   def next_actor
  798.     id = index == @data.size - 1 ? 0 : index + 1
  799.     actor_id = @data[id]
  800.     return $game_actors[actor_id]
  801.   end
  802.  
  803.   #--------------------------------------------------------------------------
  804.   # process_pageup
  805.   #--------------------------------------------------------------------------
  806.   def process_pageup
  807.     allow = true
  808.     allow = false if !prev_actor.nil? && prev_actor.locked
  809.     allow = false if !cur_actor.nil? && cur_actor.locked
  810.     Sound.play_buzzer unless allow
  811.     if allow
  812.       super
  813.       activate
  814.       select(index == 0 ? @data.size - 1 : index - 1)
  815.     end
  816.   end
  817.  
  818.   #--------------------------------------------------------------------------
  819.   # process_pagedown
  820.   #--------------------------------------------------------------------------
  821.   def process_pagedown
  822.     allow = true
  823.     allow = false if !next_actor.nil? && next_actor.locked
  824.     allow = false if !cur_actor.nil? && cur_actor.locked
  825.     Sound.play_buzzer unless allow
  826.     if allow
  827.       super
  828.       activate
  829.       select(index == @data.size - 1 ? 0 : index + 1)
  830.     end
  831.   end
  832.  
  833.   #--------------------------------------------------------------------------
  834.   # item
  835.   #--------------------------------------------------------------------------
  836.   def item; return @data[index]; end
  837.  
  838. end # Window_PartySelect
  839.  
  840. #==============================================================================
  841. # ■ Window_PartyList
  842. #==============================================================================
  843.  
  844. class Window_PartyList < Window_Selectable
  845.  
  846.   #--------------------------------------------------------------------------
  847.   # initialize
  848.   #-------------------------------------------------------------------------
  849.   def initialize(party_window)
  850.     super(0, fitting_height(4), window_width, window_height)
  851.     @party_window = party_window
  852.     select(1)
  853.     deactivate
  854.     refresh
  855.   end
  856.  
  857.   #--------------------------------------------------------------------------
  858.   # window_width
  859.   #--------------------------------------------------------------------------
  860.   def window_width; return 200; end
  861.  
  862.   #--------------------------------------------------------------------------
  863.   # window_height
  864.   #--------------------------------------------------------------------------
  865.   def window_height; return Graphics.height - fitting_height(4); end
  866.  
  867.   #--------------------------------------------------------------------------
  868.   # item_max
  869.   #--------------------------------------------------------------------------
  870.   def item_max; return @data ? @data.size : 1; end
  871.  
  872.   #--------------------------------------------------------------------------
  873.   # refresh
  874.   #--------------------------------------------------------------------------
  875.   def refresh
  876.     make_item_list
  877.     create_contents
  878.     draw_all_items
  879.   end
  880.  
  881.   #--------------------------------------------------------------------------
  882.   # make_item_list
  883.   #--------------------------------------------------------------------------
  884.   def make_item_list
  885.     @data = [0]
  886.     for member in $game_party.all_members
  887.       next if member.nil?
  888.       @data.push(member.id)
  889.     end
  890.     @data.push(0)
  891.   end
  892.  
  893.   #--------------------------------------------------------------------------
  894.   # draw_item
  895.   #--------------------------------------------------------------------------
  896.   def draw_item(index)
  897.     clear_item(index)
  898.     rect = item_rect(index)
  899.     if @data[index] == 0
  900.       draw_remove(rect)
  901.       return
  902.     end
  903.     actor = $game_actors[@data[index]]
  904.     draw_actor(actor, rect)
  905.     draw_actor_locked(actor, rect)
  906.     draw_actor_required(actor, rect)
  907.   end
  908.  
  909.   #--------------------------------------------------------------------------
  910.   # draw_remove
  911.   #--------------------------------------------------------------------------
  912.   def draw_remove(rect)
  913.     reset_font_settings
  914.     draw_icon(Icon.remove_party, rect.x+4, rect.y)
  915.     text = YEA::PARTY::REMOVE_TEXT
  916.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  917.   end
  918.  
  919.   #--------------------------------------------------------------------------
  920.   # draw_actor
  921.   #--------------------------------------------------------------------------
  922.   def draw_actor(actor, rect)
  923.     buffer = YEA::PARTY::ACTOR_Y_BUFFER
  924.     draw_actor_graphic(actor, rect.x + 16, rect.y + rect.height + buffer)
  925.     text = actor.name
  926.     change_color(list_colour(actor), enabled?(actor))
  927.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  928.   end
  929.  
  930.   #--------------------------------------------------------------------------
  931.   # list_colour
  932.   #--------------------------------------------------------------------------
  933.   def list_colour(actor)
  934.     return text_color(YEA::PARTY::IN_PARTY_COLOUR) if in_party?(actor)
  935.     return normal_color
  936.   end
  937.  
  938.   #--------------------------------------------------------------------------
  939.   # draw_actor_locked
  940.   #--------------------------------------------------------------------------
  941.   def draw_actor_locked(actor, rect)
  942.     return unless actor.locked
  943.     draw_icon(Icon.locked_party, rect.width-24, rect.y)
  944.   end
  945.  
  946.   #--------------------------------------------------------------------------
  947.   # draw_actor_required
  948.   #--------------------------------------------------------------------------
  949.   def draw_actor_required(actor, rect)
  950.     return if actor.locked
  951.     return unless actor.required
  952.     draw_icon(Icon.required_party, rect.width-24, rect.y)
  953.   end
  954.  
  955.   #--------------------------------------------------------------------------
  956.   # enabled?
  957.   #--------------------------------------------------------------------------
  958.   def enabled?(actor)
  959.     return false if actor.locked
  960.     return false if actor.required && in_party?(actor)
  961.     return actor.exist?
  962.   end
  963.  
  964.   #--------------------------------------------------------------------------
  965.   # in_party?
  966.   #--------------------------------------------------------------------------
  967.   def in_party?(actor); return $game_party.battle_members.include?(actor); end
  968.  
  969.   #--------------------------------------------------------------------------
  970.   # current_item_enabled?
  971.   #--------------------------------------------------------------------------
  972.   def current_item_enabled?
  973.     actor = $game_actors[item]
  974.     replace = $game_actors[@party_window.item]
  975.     unless actor.nil?
  976.       return false if actor.locked && in_party?(actor)
  977.       return false if actor.required && in_party?(actor)
  978.     end
  979.     return true if replace.nil?
  980.     return false if replace.locked
  981.     return false if replace.required
  982.     return true if actor.nil?
  983.     return actor.exist?
  984.   end
  985.  
  986.   #--------------------------------------------------------------------------
  987.   # item
  988.   #--------------------------------------------------------------------------
  989.   def item; return @data[index]; end
  990.  
  991. end # Window_PartyList
  992.  
  993. #==============================================================================
  994. # ** Window_PartyStatus
  995. #==============================================================================
  996.  
  997. class Window_PartyStatus < Window_Base
  998.  
  999.   #--------------------------------------------------------------------------
  1000.   # initialize
  1001.   #--------------------------------------------------------------------------
  1002.   def initialize(party_window, list_window)
  1003.     super(200, fitting_height(4), window_width, window_height)
  1004.     @party_window = party_window
  1005.     @list_window = list_window
  1006.     [url=home.php?mod=space&uid=95897]@actor[/url] = active_actor
  1007.     refresh
  1008.   end
  1009.  
  1010.   #--------------------------------------------------------------------------
  1011.   # window_width
  1012.   #--------------------------------------------------------------------------
  1013.   def window_width; Graphics.width - 200; end
  1014.  
  1015.   #--------------------------------------------------------------------------
  1016.   # window_height
  1017.   #--------------------------------------------------------------------------
  1018.   def window_height; Graphics.height - fitting_height(4); end
  1019.  
  1020.   #--------------------------------------------------------------------------
  1021.   # update
  1022.   #--------------------------------------------------------------------------
  1023.   def update
  1024.     super
  1025.     refresh if @actor != active_actor
  1026.   end
  1027.  
  1028.   #--------------------------------------------------------------------------
  1029.   # active_actor
  1030.   #--------------------------------------------------------------------------
  1031.   def active_actor
  1032.     if @list_window.active
  1033.       actor = @list_window.item
  1034.     else
  1035.       actor = @party_window.item
  1036.     end
  1037.     return nil if [0, nil].include?(actor)
  1038.     return actor
  1039.   end
  1040.  
  1041.   #--------------------------------------------------------------------------
  1042.   # refresh
  1043.   #--------------------------------------------------------------------------
  1044.   def refresh
  1045.     contents.clear
  1046.     @actor = active_actor
  1047.     reset_font_settings
  1048.     if @actor.nil?
  1049.       draw_nil_actor
  1050.       return
  1051.     end
  1052.     actor = $game_actors[@actor]
  1053.     draw_actor_face(actor, 0, 0)
  1054.     draw_actor_name(actor, 108, 0)
  1055.     draw_actor_class(actor, 228, 0, contents.width-232)
  1056.     draw_actor_level(actor, 108, line_height)
  1057.     draw_actor_icons(actor, 228, line_height, contents.width-232)
  1058.     draw_actor_hp(actor, 108, line_height*2, contents.width-112)
  1059.     draw_actor_mp(actor, 108, line_height*3, contents.width-112)
  1060.     draw_actor_parameters(actor, 0, line_height*4 + line_height/2)
  1061.     draw_equipments(actor, contents.width/2, line_height*4 + line_height/2)
  1062.   end
  1063.  
  1064.   #--------------------------------------------------------------------------
  1065.   # draw_nil_actor
  1066.   #--------------------------------------------------------------------------
  1067.   def draw_nil_actor
  1068.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1069.     rect = Rect.new(0, 0, contents.width, contents.height)
  1070.     contents.fill_rect(rect, colour)
  1071.     change_color(system_color)
  1072.     text = YEA::PARTY::NO_DATA
  1073.     draw_text(rect, text, 1)
  1074.   end
  1075.  
  1076.   #--------------------------------------------------------------------------
  1077.   # draw_actor_parameters
  1078.   #--------------------------------------------------------------------------
  1079.   def draw_actor_parameters(actor, dx, dy)
  1080.     dw = contents.width/2 - 4
  1081.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1082.     contents.font.size = YEA::PARTY::STAT_FONT_SIZE
  1083.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1084.     array = [:atk, :def, :mat, :mdf, :agi, :luk]
  1085.     cx = 4
  1086.     for stat in array
  1087.       case stat
  1088.       when :atk
  1089.         param = Vocab::param(2)
  1090.         value = actor.atk.group
  1091.       when :def
  1092.         param = Vocab::param(3)
  1093.         value = actor.def.group
  1094.       when :mat
  1095.         param = Vocab::param(4)
  1096.         value = actor.mat.group
  1097.       when :mdf
  1098.         param = Vocab::param(5)
  1099.         value = actor.mdf.group
  1100.       when :agi
  1101.         param = Vocab::param(6)
  1102.         value = actor.agi.group
  1103.       when :luk
  1104.         param = Vocab::param(7)
  1105.         value = actor.luk.group
  1106.       else; next
  1107.       end
  1108.       contents.fill_rect(rect, colour)
  1109.       change_color(system_color)
  1110.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, param, 0)
  1111.       change_color(normal_color)
  1112.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, value, 2)
  1113.       rect.y += line_height
  1114.     end
  1115.     reset_font_settings
  1116.   end
  1117.  
  1118.   #--------------------------------------------------------------------------
  1119.   # draw_equipments
  1120.   #--------------------------------------------------------------------------
  1121.   def draw_equipments(actor, dx, dy)
  1122.     text = YEA::PARTY::EQUIP_TEXT
  1123.     change_color(system_color)
  1124.     draw_text(dx, dy, contents.width - dx, line_height, text, 1)
  1125.     dy += line_height
  1126.     if actor.equips.size <= 5
  1127.       actor.equips.each_with_index do |item, i|
  1128.         draw_item_name(item, dx, dy + line_height * i)
  1129.       end
  1130.     else
  1131.       orig_x = dx
  1132.       actor.equips.each_with_index do |item, i|
  1133.         next if item.nil?
  1134.         draw_icon(item.icon_index, dx, dy)
  1135.         dy += line_height if dx + 48 > contents.width
  1136.         dx = dx + 48 > contents.width ? orig_x : dx + 24
  1137.       end
  1138.     end
  1139.   end
  1140.  
  1141. end # Window_PartyStatus
  1142.  
  1143. #==============================================================================
  1144. # ■ Scene_Menu
  1145. #==============================================================================
  1146.  
  1147. class Scene_Menu < Scene_MenuBase
  1148.  
  1149.   #--------------------------------------------------------------------------
  1150.   # overwrite method: command_formation
  1151.   #--------------------------------------------------------------------------
  1152.   if YEA::PARTY::ENABLE_MENU
  1153.   def command_formation
  1154.     SceneManager.call(Scene_Party)
  1155.   end
  1156.   end # YEA::PARTY::ENABLE_MENU
  1157.  
  1158. end # Scene_Menu
  1159.  
  1160. #==============================================================================
  1161. # ■ Scene_Party
  1162. #==============================================================================
  1163.  
  1164. class Scene_Party < Scene_MenuBase
  1165.  
  1166.   #--------------------------------------------------------------------------
  1167.   # start
  1168.   #--------------------------------------------------------------------------
  1169.   def start
  1170.     super
  1171.     @former_party = $game_party.battle_members_array.clone
  1172.     create_command_window
  1173.     create_party_window
  1174.     create_list_window
  1175.     create_status_window
  1176.   end
  1177.  
  1178.   #--------------------------------------------------------------------------
  1179.   # create_command_window
  1180.   #--------------------------------------------------------------------------
  1181.   def create_command_window
  1182.     @command_window = Window_PartyMenuCommand.new(0, 0)
  1183.     @command_window.set_handler(:change, method(:adjust_members))
  1184.     @command_window.set_handler(:remove, method(:adjust_members))
  1185.     @command_window.set_handler(:revert, method(:revert_party))
  1186.     @command_window.set_handler(:finish, method(:return_scene))
  1187.     @command_window.set_handler(:cancel, method(:return_scene))
  1188.   end
  1189.  
  1190.   #--------------------------------------------------------------------------
  1191.   # create_party_window
  1192.   #--------------------------------------------------------------------------
  1193.   def create_party_window
  1194.     @party_window = Window_PartySelect.new(@command_window)
  1195.     @party_window.set_handler(:ok,       method(:on_party_ok))
  1196.     @party_window.set_handler(:cancel,   method(:on_party_cancel))
  1197.     @party_window.set_handler(:pageup,   method(:on_party_pageup))
  1198.     @party_window.set_handler(:pagedown, method(:on_party_pagedown))
  1199.   end
  1200.  
  1201.   #--------------------------------------------------------------------------
  1202.   # create_list_window
  1203.   #--------------------------------------------------------------------------
  1204.   def create_list_window
  1205.     @list_window = Window_PartyList.new(@party_window)
  1206.     @list_window.set_handler(:ok,     method(:on_list_ok))
  1207.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  1208.   end
  1209.  
  1210.   #--------------------------------------------------------------------------
  1211.   # create_status_window
  1212.   #--------------------------------------------------------------------------
  1213.   def create_status_window
  1214.     @status_window = Window_PartyStatus.new(@party_window, @list_window)
  1215.   end
  1216.  
  1217.   #--------------------------------------------------------------------------
  1218.   # adjust_members
  1219.   #--------------------------------------------------------------------------
  1220.   def adjust_members
  1221.     @party_window.activate
  1222.   end
  1223.  
  1224.   #--------------------------------------------------------------------------
  1225.   # window_refresh
  1226.   #--------------------------------------------------------------------------
  1227.   def window_refresh
  1228.     $game_party.rearrange_actors
  1229.     @command_window.refresh
  1230.     @party_window.refresh
  1231.     @list_window.refresh
  1232.     $game_player.refresh
  1233.     $game_map.need_refresh = true
  1234.   end
  1235.  
  1236.   #--------------------------------------------------------------------------
  1237.   # revert_party
  1238.   #--------------------------------------------------------------------------
  1239.   def revert_party
  1240.     @command_window.activate
  1241.     $game_party.battle_members_array = @former_party.clone
  1242.     window_refresh
  1243.   end
  1244.  
  1245.   #--------------------------------------------------------------------------
  1246.   # on_party_ok
  1247.   #--------------------------------------------------------------------------
  1248.   def on_party_ok
  1249.     case @command_window.current_symbol
  1250.     when :change
  1251.       @list_window.activate
  1252.     when :remove
  1253.       index = @party_window.index
  1254.       actor = $game_actors[$game_party.battle_members_array[index]]
  1255.       Sound.play_equip
  1256.       #$game_party.battle_members_array[index] = 0
  1257.       #***#
  1258.       if $game_party.max_battle_members>index then
  1259.         $game_party.tmp_remove_actor=actor.id
  1260.         $game_party.battle_members_array.delete(actor.id)
  1261.         $game_party.battle_members_array.insert($game_party.max_battle_members-1,0)
  1262.       else
  1263.         $game_party.tmp_remove_actor=$game_party.battle_members_array[index]
  1264.         actor = $game_actors[$game_party.tmp_remove_actor]
  1265.         tmp_index=$game_party.all_members.index(actor)
  1266.         if tmp_index <$game_party.all_members.size-1 then
  1267.           actor =$game_party.all_members[tmp_index+1]
  1268.           $game_party.battle_members_array[index]=actor.id
  1269.         end
  1270.       end
  1271.       #***#
  1272.       window_refresh
  1273.       @party_window.activate
  1274.     end
  1275.   end
  1276.  
  1277.   #--------------------------------------------------------------------------
  1278.   # on_party_cancel
  1279.   #--------------------------------------------------------------------------
  1280.   def on_party_cancel
  1281.     @command_window.activate
  1282.   end
  1283.  
  1284.   #--------------------------------------------------------------------------
  1285.   # on_party_pageup
  1286.   #--------------------------------------------------------------------------
  1287.   def on_party_pageup
  1288.     Sound.play_equip
  1289.     actor_id1 = @party_window.item
  1290.     actor_id2 = @party_window.prev_actor.nil? ? 0 : @party_window.prev_actor.id
  1291.     max = @party_window.item_max-1
  1292.     index1 = @party_window.index
  1293.     index2 = @party_window.index == 0 ? max : index1-1
  1294.     $game_party.battle_members_array[index1] = actor_id2
  1295.     $game_party.battle_members_array[index2] = actor_id1
  1296.     window_refresh
  1297.   end
  1298.  
  1299.   #--------------------------------------------------------------------------
  1300.   # on_party_pagedown
  1301.   #--------------------------------------------------------------------------
  1302.   def on_party_pagedown
  1303.     Sound.play_equip
  1304.     actor_id1 = @party_window.item
  1305.     actor_id2 = @party_window.next_actor.nil? ? 0 : @party_window.next_actor.id
  1306.     max = @party_window.item_max-1
  1307.     index1 = @party_window.index
  1308.     index2 = @party_window.index == max ? 0 : index1+1
  1309.     $game_party.battle_members_array[index1] = actor_id2
  1310.     $game_party.battle_members_array[index2] = actor_id1
  1311.     window_refresh
  1312.   end
  1313.  
  1314.   #--------------------------------------------------------------------------
  1315.   # on_list_cancel
  1316.   #--------------------------------------------------------------------------
  1317.   def on_list_cancel
  1318.     @party_window.activate
  1319.   end
  1320.  
  1321.   #--------------------------------------------------------------------------
  1322.   # on_list_ok
  1323.   #--------------------------------------------------------------------------
  1324.   def on_list_ok
  1325.     Sound.play_equip
  1326.     replace = $game_actors[@party_window.item]
  1327.     actor = $game_actors[@list_window.item]
  1328.     index1 = @party_window.index
  1329.     $game_party.tmp_remove_actor=$game_party.battle_members_array[index1]#***#
  1330.     actor_id1 = actor.nil? ? 0 : actor.id
  1331.     if actor.nil?
  1332.       #***#
  1333.       if $game_party.max_battle_members>index1 then
  1334.         $game_party.battle_members_array[index1] = 0
  1335.         i=index1
  1336.         while i<$game_party.battle_members_array.size-2
  1337.           $game_party.battle_members_array[i], $game_party.battle_members_array[i+1] = $game_party.battle_members_array[i+1], $game_party.battle_members_array[i]
  1338.           i+=1
  1339.         end
  1340.       else
  1341.         actor = $game_actors[$game_party.tmp_remove_actor]
  1342.         tmp_index=$game_party.all_members.index(actor)
  1343.         if tmp_index <$game_party.all_members.size-1 then
  1344.           actor =$game_party.all_members[tmp_index+1]
  1345.           $game_party.battle_members_array[index1]=actor.id
  1346.         end
  1347.       end
  1348.       #***#
  1349.       window_refresh
  1350.       @party_window.activate
  1351.       return
  1352.     end
  1353.     actor_id2 = replace.nil? ? 0 : replace.id
  1354.     if $game_party.battle_members_array.include?(actor_id1)
  1355.       index2 = $game_party.battle_members_array.index(actor_id1)
  1356.       #***#
  1357.       if index2==$game_party.battle_members_array.size-1 then
  1358.         $game_party.tmp_remove_actor=$game_party.battle_members_array[index1]#***#
  1359.       end
  1360.       #***#
  1361.       $game_party.battle_members_array[index2] = actor_id2
  1362.     end
  1363.     $game_party.battle_members_array[index1] = actor_id1
  1364.     #***#
  1365.     if [0, nil].include?(actor_id1)
  1366.       i=index1
  1367.       while i<$game_party.battle_members_array.size-2
  1368.         $game_party.battle_members_array[i], $game_party.battle_members_array[i+1] = $game_party.battle_members_array[i+1], $game_party.battle_members_array[i]
  1369.         i+=1
  1370.       end
  1371.     end
  1372.     #***#
  1373.     window_refresh
  1374.     @party_window.activate
  1375.   end
  1376.  
  1377. end # Scene_Party
  1378.  
  1379. #==============================================================================
  1380. #
  1381. # ▼ End of File
  1382. #
  1383. #==============================================================================

下为图示
队伍排列图

移除队列第一人

移除队列第三人

移除战斗成员

  

点评

hcm
确实有点难说明呢,那就能退而求其次好了:简单地说就是去除该脚本中的“移除”功能,后备队在战斗人员离队后会自动跟进补充战斗人员。  发表于 2014-3-3 18:36

评分

参与人数 2星屑 +300 梦石 +1 收起 理由
迷糊的安安 + 1 认可答案
hcm + 300 认可答案

查看全部评分

http://rpg.blue/static/image/smiley/yct/A059.gif中国字认识都不到一半,哪的心情学英语呀!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-29 18:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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