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

Project1

 找回密码
 注册会员
搜索

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

查看数: 1102 | 评论数: 4 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
hcm
发布时间: 2014-3-1 09:50

正文摘要:

本帖最后由 Sion 于 2014-3-7 10:58 编辑 脚本如下,示意图在脚本下方。 本来试着直接修改窗口内容的列数, 但是会发生错误。 如果可以的话,我希望可以直接指出需要修改的位置及内容。 RUBY 代码&# ...

回复

345912390 发表于 2014-3-3 20:12:41
@hcm 如果改成 替补成员自动加入战斗序列是可以但这样一来这个脚本就大大的失去了它存在的意义了!
hcm 发表于 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
345912390 发表于 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 认可答案

查看全部评分

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

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

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

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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