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

Project1

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

[已经解决] RMVA横版战斗系统问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
跳转到指定楼层
1
发表于 2013-12-3 20:50:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这个我知道,“后知后觉”的横版战斗系统有BUG,就是当战斗人数超过4个人时,多余的人都是不显示的,但在战斗框还是可以看到新多的角色,请问这个脚本问题怎么解决?

点评

hcm
然后呢?  发表于 2013-12-6 21:28
hcm
一般来说其他脚本就算冲突也不会针对第五人吧,你的数据怎么设置的?  发表于 2013-12-6 21:13
hcm
我这边可是轻轻松松显示出来了。  发表于 2013-12-6 20:53

Lv3.寻梦者

虚空人形

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

贵宾

2
发表于 2013-12-6 17:41:30 | 只看该作者
有吗?我用的时候完全没问题哦。
那个第四人以上的战斗图坐标之类的你是怎么设定的?

点评

要不加Q吧,我弄给你看... 767214481  发表于 2013-12-6 21:19
我就直接复制第一个角色,然后粘贴。因为范例也有用到重复的角色。然后在系统那里我设置为5人  发表于 2013-12-6 21:18
为啥?是不是不能用其他脚本,还是数据设置出问题了  发表于 2013-12-6 21:03
ActorsBattlePosition[5] = [360, 235]  发表于 2013-12-6 19:51
回复 支持 反对

使用道具 举报

Lv3.寻梦者

虚空人形

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

贵宾

3
发表于 2013-12-6 22:53:34 | 只看该作者
把这脚本放到横版脚本下面试试:
  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. $imported = {} if $imported.nil?
  10. $imported["YEA-PartySystem"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.23 - Bug fixed: Party members are now rearranged when newly added.
  15. # 2012.01.14 - New Feature: Maximum Battle Members Variable added.
  16. # 2012.01.07 - Bug fixed: Error with removing members.
  17. # 2012.01.05 - Bug fixed: Escape skill/item effects no longer counts as death.
  18. # 2011.12.26 - Compatibility Update: New Game+
  19. # 2011.12.17 - Updated Spriteset_Battle to have updated sprite counts.
  20. # 2011.12.13 - Updated to provide better visual display when more than 5 pieces
  21. #              of equipment are equipped on an actor at a time.
  22. # 2011.12.05 - Added functionality to display faces in the Party Select Window.
  23. #            - Fixed bug that doesn't refresh the caterpillar when new members
  24. #              join the party.
  25. # 2011.12.04 - Started Script and Finished.
  26. #
  27. #==============================================================================
  28. # ▼ Introduction
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # RPG Maker VX Ace comes with a very nice party system. However, changing the
  31. # maximum number of members isn't possible without the aid of a script. This
  32. # script enables you the ability to change the maximum number of party members,
  33. # change EXP rates, and/or open up a separate party menu (if desired). In
  34. # addition to that, you can lock the position of actors within a party and
  35. # require other actors to be in the active party before continuing.
  36. #
  37. #==============================================================================
  38. # ▼ Instructions
  39. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. # To install this script, open up your script editor and copy/paste this script
  41. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  42. #
  43. # -----------------------------------------------------------------------------
  44. # 脚本命令语句 - These commands are used with script calls.
  45. # -----------------------------------------------------------------------------
  46. # *IMPORTANT* These script calls require the new party menu to be enabled to
  47. # use them. Otherwise, nothing will happen.
  48. #
  49. # lock_actor(x)      锁定X角色在队伍中的位置
  50. # unlock_actor(x)
  51. # This will lock actor x in its current position in the party if the actor is
  52. # in the current party. The actor is unable to switch position and must remain
  53. # in that position until the lock is removed. Use the unlock script call to
  54. # remove the locked status. This script requires the actor to have joined and
  55. # in the current party before the script call will work.
  56. #
  57. # require_actor(x)   需要X角色参战
  58. # unrequire_actor(x)
  59. # This will cause the party to require actor x in order to continue. If the
  60. # actor isn't in the current party but is in the reserve party, the party menu
  61. # will open up and prompt the player to add the required actor into the party
  62. # before being able to continue. This script call will not function unless the
  63. # specific actor has joined the party, whether it is in the current or reserve.
  64. #
  65. # call_party_menu    打开队伍菜单
  66. # This will open up the party menu. This script call requires for the party
  67. # menu to be enabled to use.
  68. #
  69. #==============================================================================
  70. # ▼ Compatibility
  71. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  72. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  73. # it will run with RPG Maker VX without adjusting.
  74. #
  75. #==============================================================================

  76. module YEA
  77.   module PARTY
  78.    
  79.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  80.     # - General Party Settings -
  81.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82.     # In this section, you can adjust the general party settings for your game
  83.     # such as the maximum amount of members and whatnot, the EXP rate for
  84.     # party members in the reserve, etc.
  85.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  86.     MAX_BATTLE_MEMBERS   = 5      # 最大参战人员. Default: 4
  87.     SPLIT_EXP            = false  # 平分经验?Splits EXP with more members in the party.
  88.     RESERVE_EXP_RATE     = 0.50   # 休息人员的经验获得率Reserve EXP Rate. Default: 1.00
  89.    
  90.     # If you wish to be able to change the maximum number of battle members
  91.     # during the middle of your game, set this constant to a variable ID. If
  92.     # that variable ID is a number greater than 0, that variable will determine
  93.     # the current maximum number of battle members. Be cautious about using
  94.     # this during battle.
  95.     MAX_MEMBERS_VARIABLE = 0  #设置游戏中改变最大参战人员的变量
  96.    
  97.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  98.     # - Party Menu Settings -
  99.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  100.     # This section contains various menu settings for those who wish to use a
  101.     # menu separate for the party system. Here, adjust the menu command order,
  102.     # icons used, and other settings.
  103.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104.     ENABLE_MENU = true   # Enables party menu. Default: false
  105.     COMMANDS =[          # The order at which the menu items are shown.
  106.     # [:command,  "Display"],
  107.       [ :change,  "替换",],
  108.      [ :remove,  "退下",],
  109.       [ :revert,  "还原",],
  110.       [ :finish,  "完成",],
  111.     ] # Do not remove this.
  112.     COMMAND_ALIGN    = 1     # 0:左对齐, 1:Center Align, 2:Right Align
  113.    
  114.     # These settings here are used for the upper right window: the Party Select
  115.     # window where the player selects a member to swap out or remove.
  116.     PARTY_FONT_SIZE  = 16    # Font size used for party member names.
  117.     LOCK_FIRST_ACTOR = true # Lock the first actor by default?
  118.     LOCKED_ICON      = 125   # Icon used for locked members.
  119.     REQUIRED_ICON    = 126   # Icon used for required members.
  120.     EMPTY_TEXT = "-Empty-"   # Text used when a member isn't present.
  121.     DISPLAY_FACE     = false # Display faces instead of sprites?
  122.    
  123.     # These settings here are used for the lower left window: the Party List
  124.     # window where the player selects a member to replace.
  125.     REMOVE_ICON      = 186          # Icon used for removing members.
  126.     REMOVE_TEXT      = "-重新移动-"   # Text used for remove member command.
  127.     ACTOR_Y_BUFFER   = 25           # Amount the actor graphic be adjusted by.
  128.    
  129.     # These settings here are used for the lower right window: the Party Status
  130.     # window where info about a selected actor is shown.
  131.     NO_DATA         = "- No Data -" # Text used for when no actor is shown.
  132.     IN_PARTY_COLOUR = 6             # Text colour used for in party members.
  133.     STAT_FONT_SIZE  = 24            # Font size used for stats.
  134.     EQUIP_TEXT      = "Equipment"   # Text used to display equipment.
  135.    
  136.   end # PARTY
  137. end # YEA

  138. #==============================================================================
  139. # ▼ Editting anything past this point may potentially result in causing
  140. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  141. # halitosis so edit at your own risk.
  142. #==============================================================================

  143. #==============================================================================
  144. # ■ Icon
  145. #==============================================================================

  146. module Icon
  147.   
  148.   #--------------------------------------------------------------------------
  149.   # self.locked_party
  150.   #--------------------------------------------------------------------------
  151.   def self.locked_party; return YEA::PARTY::LOCKED_ICON; end
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # self.required_party
  155.   #--------------------------------------------------------------------------
  156.   def self.required_party; return YEA::PARTY::REQUIRED_ICON; end
  157.   
  158.   #--------------------------------------------------------------------------
  159.   # self.remove_party
  160.   #--------------------------------------------------------------------------
  161.   def self.remove_party; return YEA::PARTY::REMOVE_ICON; end
  162.    
  163. end # Icon

  164. #==============================================================================
  165. # ■ Variable
  166. #==============================================================================

  167. module Variable
  168.   
  169.   #--------------------------------------------------------------------------
  170.   # self.max_battle_members
  171.   #--------------------------------------------------------------------------
  172.   def self.max_battle_members
  173.     default = YEA::PARTY::MAX_BATTLE_MEMBERS
  174.     return default if YEA::PARTY::MAX_MEMBERS_VARIABLE <= 0
  175.     return default if $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE] <= 0
  176.     return $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE]
  177.   end
  178.   
  179. end # Variable

  180. #==============================================================================
  181. # ■ Numeric
  182. #==============================================================================

  183. class Numeric
  184.   
  185.   #--------------------------------------------------------------------------
  186.   # new method: group_digits
  187.   #--------------------------------------------------------------------------
  188.   unless $imported["YEA-CoreEngine"]
  189.   def group; return self.to_s; end
  190.   end # $imported["YEA-CoreEngine"]
  191.    
  192. end # Numeric

  193. #==============================================================================
  194. # ■ Game_Actor
  195. #==============================================================================

  196. class Game_Actor < Game_Battler
  197.   
  198.   #--------------------------------------------------------------------------
  199.   # public instance variables
  200.   #--------------------------------------------------------------------------
  201.   attr_accessor :locked
  202.   attr_accessor :required
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # alias method: setup
  206.   #--------------------------------------------------------------------------
  207.   alias game_actor_setup_ps setup
  208.   def setup(actor_id)
  209.     game_actor_setup_ps(actor_id)
  210.     @locked = false
  211.     @required = false
  212.   end
  213.   
  214.   #--------------------------------------------------------------------------
  215.   # overwrite method: final_exp_rate
  216.   #--------------------------------------------------------------------------
  217.   def final_exp_rate
  218.     n = exr * (battle_member? ? 1 : reserve_members_exp_rate)
  219.     if $game_party.in_battle
  220.       n /= [$game_party.battle_members.size, 1].max if YEA::PARTY::SPLIT_EXP
  221.     end
  222.     return n
  223.   end
  224.   
  225.   #--------------------------------------------------------------------------
  226.   # overwrite method: reserve_members_exp_rate
  227.   #--------------------------------------------------------------------------
  228.   def reserve_members_exp_rate
  229.     $data_system.opt_extra_exp ? YEA::PARTY::RESERVE_EXP_RATE : 0
  230.   end
  231.   
  232. end # Game_Actor

  233. #==============================================================================
  234. # ■ Game_Party
  235. #==============================================================================

  236. class Game_Party < Game_Unit
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # public instance variables
  240.   #--------------------------------------------------------------------------
  241.   attr_accessor :battle_members_array
  242.   
  243.   #--------------------------------------------------------------------------
  244.   # alias method: initialize
  245.   #--------------------------------------------------------------------------
  246.   alias game_party_initialize_ps initialize
  247.   def initialize
  248.     game_party_initialize_ps
  249.     @battle_members_array = nil
  250.   end
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # overwrite method: max_battle_members
  254.   #--------------------------------------------------------------------------
  255.   def max_battle_members; return Variable.max_battle_members; end
  256.   
  257.   #--------------------------------------------------------------------------
  258.   # alias method: setup_starting_members
  259.   #--------------------------------------------------------------------------
  260.   alias setup_starting_members_ps setup_starting_members
  261.   def setup_starting_members
  262.     setup_starting_members_ps
  263.     initialize_battle_members
  264.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  265.     return if members[0].nil?
  266.     members[0].locked = true
  267.   end
  268.   
  269.   #--------------------------------------------------------------------------
  270.   # alias method: setup_battle_test_members
  271.   #--------------------------------------------------------------------------
  272.   alias setup_battle_test_members_ps setup_battle_test_members
  273.   def setup_battle_test_members
  274.     setup_battle_test_members_ps
  275.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  276.     return if members[0].nil?
  277.     members[0].locked = true
  278.   end
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # overwrite method: battle_members
  282.   #--------------------------------------------------------------------------
  283.   def battle_members
  284.     initialize_battle_members if initialize_battle_members?
  285.     array = []
  286.     for actor_id in @battle_members_array
  287.       break if array.size > max_battle_members
  288.       next if actor_id.nil?
  289.       next if $game_actors[actor_id].nil?
  290.       next unless $game_actors[actor_id].exist?
  291.       array.push($game_actors[actor_id])
  292.     end
  293.     return array
  294.   end
  295.   
  296.   #--------------------------------------------------------------------------
  297.   # new method: initialize_battle_members?
  298.   #--------------------------------------------------------------------------
  299.   def initialize_battle_members?
  300.     return true if @battle_members_array.nil?
  301.     return @battle_members_array.size != max_battle_members
  302.   end
  303.   
  304.   #--------------------------------------------------------------------------
  305.   # new method: initialize_battle_members
  306.   #--------------------------------------------------------------------------
  307.   def initialize_battle_members
  308.     @battle_members_array = []
  309.     for i in 0...max_battle_members
  310.       @battle_members_array.push(@actors[i]) unless @actors[i].nil?
  311.       @battle_members_array.push(0) if @actors[i].nil?
  312.     end
  313.     $game_player.refresh
  314.   end
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # alias method: add_actor
  318.   #--------------------------------------------------------------------------
  319.   alias game_party_add_actor_ps add_actor
  320.   def add_actor(actor_id)
  321.     game_party_add_actor_ps(actor_id)
  322.     return if @battle_members_array.include?(actor_id)
  323.     return unless @battle_members_array.include?(0)
  324.     index = @battle_members_array.index(0)
  325.     @battle_members_array[index] = actor_id
  326.     $game_player.refresh
  327.     $game_map.need_refresh = true
  328.     rearrange_actors
  329.   end
  330.   
  331.   #--------------------------------------------------------------------------
  332.   # alias method: remove_actor
  333.   #--------------------------------------------------------------------------
  334.   alias game_party_remove_actor_ps remove_actor
  335.   def remove_actor(actor_id)
  336.     game_party_remove_actor_ps(actor_id)
  337.     return unless @battle_members_array.include?(actor_id)
  338.     index = @battle_members_array.index(actor_id)
  339.     @battle_members_array[index] = 0
  340.     $game_player.refresh
  341.     $game_map.need_refresh = true
  342.     rearrange_actors
  343.   end
  344.   
  345.   #--------------------------------------------------------------------------
  346.   # new method: rearrange_actors
  347.   #--------------------------------------------------------------------------
  348.   def rearrange_actors
  349.     initialize_battle_members if @battle_members_array.nil?
  350.     array = []
  351.     for actor_id in @battle_members_array
  352.       next if [0, nil].include?(actor_id)
  353.       next if $game_actors[actor_id].nil?
  354.       array.push(actor_id)
  355.     end
  356.     for actor_id in @actors
  357.       next if array.include?(actor_id)
  358.       next if $game_actors[actor_id].nil?
  359.       array.push(actor_id)
  360.     end
  361.     @actors = array
  362.   end
  363.   
  364. end # Game_Party

  365. #==============================================================================
  366. # ■ Game_Interpreter
  367. #==============================================================================

  368. class Game_Interpreter
  369.   
  370.   #--------------------------------------------------------------------------
  371.   # new method: lock_actor
  372.   #--------------------------------------------------------------------------
  373.   def lock_actor(actor_id)
  374.     return unless YEA::PARTY::ENABLE_MENU
  375.     actor = $game_actors[actor_id]
  376.     return unless $game_party.battle_members.include?(actor.id)
  377.     actor.locked = true
  378.   end
  379.   
  380.   #--------------------------------------------------------------------------
  381.   # new method: unlock_actor
  382.   #--------------------------------------------------------------------------
  383.   def unlock_actor(actor_id)
  384.     return unless YEA::PARTY::ENABLE_MENU
  385.     actor = $game_actors[actor_id]
  386.     return unless $game_party.battle_members.include?(actor.id)
  387.     actor.locked = false
  388.   end
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # new method: require_actor
  392.   #--------------------------------------------------------------------------
  393.   def require_actor(actor_id)
  394.     return unless YEA::PARTY::ENABLE_MENU
  395.     return if $game_system.formation_disabled
  396.     actor = $game_actors[actor_id]
  397.     return unless $game_party.all_members.include?(actor)
  398.     actor.required = true
  399.     call_party_menu unless $game_party.battle_members.include?(actor)
  400.   end
  401.   
  402.   #--------------------------------------------------------------------------
  403.   # new method: unrequire_actor
  404.   #--------------------------------------------------------------------------
  405.   def unrequire_actor(actor_id)
  406.     return unless YEA::PARTY::ENABLE_MENU
  407.     return if $game_system.formation_disabled
  408.     actor = $game_actors[actor_id]
  409.     return unless $game_party.all_members.include?(actor)
  410.     actor.required = false
  411.     call_party_menu unless $game_party.battle_members.include?(actor)
  412.   end
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # new method: call_party_menu
  416.   #--------------------------------------------------------------------------
  417.   def call_party_menu
  418.     return unless YEA::PARTY::ENABLE_MENU
  419.     return if $game_system.formation_disabled
  420.     SceneManager.call(Scene_Party)
  421.   end
  422.   
  423. end # Game_Interpreter

  424. #==============================================================================
  425. # ■ Spriteset_Battle
  426. #==============================================================================

  427. class Spriteset_Battle
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # overwrite method: create_actors
  431.   #--------------------------------------------------------------------------
  432.   def create_actors
  433.     total = $game_party.max_battle_members
  434.     @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  435.   end
  436.   
  437. end # Spriteset_Battle

  438. #==============================================================================
  439. # ■ Window_PartyMenuCommand
  440. #==============================================================================

  441. class Window_PartyMenuCommand < Window_Command
  442.   
  443.   #--------------------------------------------------------------------------
  444.   # window_width
  445.   #--------------------------------------------------------------------------
  446.   def window_width; return 120; end#160; end
  447.   
  448.   #--------------------------------------------------------------------------
  449.   # visible_line_number
  450.   #--------------------------------------------------------------------------
  451.   def visible_line_number; 4; end
  452.   
  453.   #--------------------------------------------------------------------------
  454.   # alignment
  455.   #--------------------------------------------------------------------------
  456.   def alignment
  457.     return Menu.command_window_align if $imported["YEA-AceMenuEngine"]
  458.     return YEA::PARTY::COMMAND_ALIGN
  459.   end
  460.   
  461.   #--------------------------------------------------------------------------
  462.   # scene
  463.   #--------------------------------------------------------------------------
  464.   def scene; return SceneManager.scene; end
  465.   
  466.   #--------------------------------------------------------------------------
  467.   # make_command_list
  468.   #--------------------------------------------------------------------------
  469.   def make_command_list
  470.     for command in YEA::PARTY::COMMANDS
  471.       case command[0]
  472.       when :change, :remove, :revert
  473.         add_command(command[1], command[0])
  474.       when :finish
  475.         add_command(command[1], command[0], enable_cancel?)
  476.       else; next
  477.       end
  478.     end
  479.   end
  480.   
  481.   #--------------------------------------------------------------------------
  482.   # process_cancel
  483.   #--------------------------------------------------------------------------
  484.   def process_cancel
  485.     unless enable_cancel?
  486.       Sound.play_buzzer
  487.       return
  488.     end
  489.     super
  490.   end
  491.   
  492.   #--------------------------------------------------------------------------
  493.   # in_party?
  494.   #--------------------------------------------------------------------------
  495.   def in_party?(actor)
  496.     return $game_party.battle_members.include?(actor)
  497.   end
  498.   
  499.   #--------------------------------------------------------------------------
  500.   # enable_cancel?
  501.   #--------------------------------------------------------------------------
  502.   def enable_cancel?
  503.     return false if $game_party.battle_members.size <= 0
  504.     for actor in $game_party.all_members
  505.       next if in_party?(actor)
  506.       return false if actor.required
  507.       return false if actor.locked
  508.     end
  509.     return true
  510.   end
  511.   
  512. end # Window_PartyMenuCommand

  513. #==============================================================================
  514. # ■ Window_PartySelect
  515. #==============================================================================

  516. class Window_PartySelect < Window_Selectable
  517.   
  518.   #--------------------------------------------------------------------------
  519.   # initialize
  520.   #-------------------------------------------------------------------------
  521.   def initialize(command_window)
  522.     @command_window = command_window
  523.     super(120, 0, window_width, fitting_height(visible_line_number))
  524.     select(0)
  525.     deactivate

  526.     refresh
  527.   end
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # col_max
  531.   #--------------------------------------------------------------------------
  532.   def col_max; return $game_party.max_battle_members; end
  533.   
  534.   #--------------------------------------------------------------------------
  535.   # item_max
  536.   #--------------------------------------------------------------------------
  537.   def item_max; return $game_party.max_battle_members; end
  538.   
  539.   #--------------------------------------------------------------------------
  540.   # window_width
  541.   #--------------------------------------------------------------------------
  542.   def window_width; return Graphics.width - 220; end#160; end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # visible_line_number
  546.   #--------------------------------------------------------------------------
  547.   def visible_line_number; 4; end
  548.   
  549.   #--------------------------------------------------------------------------
  550.   # item_rect
  551.   #--------------------------------------------------------------------------
  552.   def item_rect(index)
  553.     rect = Rect.new
  554.     rect.width = contents.width / item_max
  555.     rect.height = contents.height
  556.     rect.x = index * rect.width
  557.     rect.y = 0
  558.     return rect
  559.   end
  560.   
  561.   #--------------------------------------------------------------------------
  562.   # refresh
  563.   #--------------------------------------------------------------------------
  564.   def refresh
  565.     make_item_list
  566.     create_contents
  567.     draw_all_items
  568.   end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # make_item_list
  572.   #--------------------------------------------------------------------------
  573.   def make_item_list
  574.     @data = $game_party.battle_members_array.clone
  575.   end
  576.   
  577.   #--------------------------------------------------------------------------
  578.   # ●人物信息
  579.   #--------------------------------------------------------------------------
  580.   def draw_item(index)
  581.     actor = $game_actors[@data[index]]
  582.     rect = item_rect(index)
  583.     if actor.nil?
  584.       draw_empty(rect.clone)
  585.       return
  586.     end
  587.     dx = rect.width / 2
  588.     dy = rect.height - 16
  589.     draw_actor_face(actor, rect.x, rect.y) if display_face?
  590.     draw_actor_graphic(actor, rect.x + dx, rect.y + dy) unless display_face?
  591.     draw_actor_name(actor, rect)
  592.     draw_locked_icon(actor, rect)
  593.     draw_required_icon(actor, rect)
  594.   end
  595.   
  596.   #--------------------------------------------------------------------------
  597.   # display_face?
  598.   #--------------------------------------------------------------------------
  599.   def display_face?
  600.     return YEA::PARTY::DISPLAY_FACE
  601.   end
  602.   
  603.   #--------------------------------------------------------------------------
  604.   # draw_empty
  605.   #--------------------------------------------------------------------------
  606.   def draw_empty(rect)
  607.     colour = Color.new(0, 0, 0, translucent_alpha/100000000)
  608.     rect.x += 2
  609.     rect.y += 2
  610.     rect.width -= 4
  611.     rect.height -= 4
  612.     contents.fill_rect(rect, colour)
  613.     reset_font_settings
  614.     change_color(system_color)
  615.     text = YEA::PARTY::EMPTY_TEXT
  616.     draw_text(rect, text, 1)
  617.     reset_font_settings
  618.   end
  619.   
  620.   #--------------------------------------------------------------------------
  621.   # draw_actor_name
  622.   #--------------------------------------------------------------------------
  623.   def draw_actor_name(actor, rect)
  624.     contents.font.size = YEA::PARTY::PARTY_FONT_SIZE
  625.     change_color(normal_color, actor.exist?)
  626.     draw_text(rect.x+4, rect.y, rect.width-8, line_height, actor.name, 1)
  627.   end
  628.   
  629.   #--------------------------------------------------------------------------
  630.   # draw_face
  631.   #--------------------------------------------------------------------------
  632.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  633.     bitmap = Cache.face(face_name)
  634.     dw = [96, item_rect(0).width-4].min
  635.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, dw, 92)
  636.     contents.blt(dx+2, dy+2, bitmap, rect, enabled ? 255 : translucent_alpha)
  637.     bitmap.dispose
  638.   end
  639.   
  640.   #--------------------------------------------------------------------------
  641.   # draw_locked_icon
  642.   #--------------------------------------------------------------------------
  643.   def draw_locked_icon(actor, rect)
  644.     return unless actor_locked?(actor)
  645.     draw_icon(Icon.locked_party, rect.x+rect.width-26, rect.height - 26)
  646.   end
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # draw_required_icon
  650.   #--------------------------------------------------------------------------
  651.   def draw_required_icon(actor, rect)
  652.     return if actor_locked?(actor)
  653.     return unless actor_required?(actor)
  654.     draw_icon(Icon.required_party, rect.x+rect.width-26, rect.height - 26)
  655.   end
  656.   
  657.   #--------------------------------------------------------------------------
  658.   # actor_locked?
  659.   #--------------------------------------------------------------------------
  660.   def actor_locked?(actor); return actor.locked; end
  661.   
  662.   #--------------------------------------------------------------------------
  663.   # actor_required?
  664.   #--------------------------------------------------------------------------
  665.   def actor_required?(actor)
  666.     return false if actor.locked
  667.     return actor.required
  668.   end
  669.   
  670.   #--------------------------------------------------------------------------
  671.   # current_item_enabled?
  672.   #--------------------------------------------------------------------------
  673.   def current_item_enabled?; enable?(@data[index]); end
  674.   
  675.   #--------------------------------------------------------------------------
  676.   # enable?
  677.   #--------------------------------------------------------------------------
  678.   def enable?(item)
  679.     case @command_window.current_symbol
  680.     when :change
  681.       return true if item.nil?
  682.       return true if item == 0
  683.     when :remove
  684.       return false if item.nil?
  685.       return false if item == 0
  686.     end
  687.     actor = $game_actors[item]
  688.     return false if actor.locked
  689.     return false if actor.required
  690.     return true
  691.   end
  692.   
  693.   #--------------------------------------------------------------------------
  694.   # process_handling
  695.   #--------------------------------------------------------------------------
  696.   def process_handling
  697.     return unless open? && active
  698.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  699.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  700.     return process_pagedown if handle?(:pagedown) && Input.repeat?(:R)
  701.     return process_pageup   if handle?(:pageup)   && Input.repeat?(:L)
  702.   end
  703.   
  704.   #--------------------------------------------------------------------------
  705.   # cur_actor
  706.   #--------------------------------------------------------------------------
  707.   def cur_actor
  708.     actor_id = @data[index]
  709.     return $game_actors[actor_id]
  710.   end
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # prev_actor
  714.   #--------------------------------------------------------------------------
  715.   def prev_actor
  716.     id = index == 0 ? @data.size - 1 : index - 1
  717.     actor_id = @data[id]
  718.     return $game_actors[actor_id]
  719.   end
  720.   
  721.   #--------------------------------------------------------------------------
  722.   # next_actor
  723.   #--------------------------------------------------------------------------
  724.   def next_actor
  725.     id = index == @data.size - 1 ? 0 : index + 1
  726.     actor_id = @data[id]
  727.     return $game_actors[actor_id]
  728.   end
  729.   
  730.   #--------------------------------------------------------------------------
  731.   # process_pageup
  732.   #--------------------------------------------------------------------------
  733.   def process_pageup
  734.     allow = true
  735.     allow = false if !prev_actor.nil? && prev_actor.locked
  736.     allow = false if !cur_actor.nil? && cur_actor.locked
  737.     Sound.play_buzzer unless allow
  738.     if allow
  739.       super
  740.       activate
  741.       select(index == 0 ? @data.size - 1 : index - 1)
  742.     end
  743.   end
  744.   
  745.   #--------------------------------------------------------------------------
  746.   # process_pagedown
  747.   #--------------------------------------------------------------------------
  748.   def process_pagedown
  749.     allow = true
  750.     allow = false if !next_actor.nil? && next_actor.locked
  751.     allow = false if !cur_actor.nil? && cur_actor.locked
  752.     Sound.play_buzzer unless allow
  753.     if allow
  754.       super
  755.       activate
  756.       select(index == @data.size - 1 ? 0 : index + 1)
  757.     end
  758.   end
  759.   
  760.   #--------------------------------------------------------------------------
  761.   # item
  762.   #--------------------------------------------------------------------------
  763.   def item; return @data[index]; end
  764.   
  765. end # Window_PartySelect

  766. #==============================================================================
  767. # ■ Window_PartyList
  768. #==============================================================================

  769. class Window_PartyList < Window_Selectable
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # initialize
  773.   #-------------------------------------------------------------------------
  774.   def initialize(party_window)
  775.     super(0, fitting_height(4), window_width, window_height)
  776.     @party_window = party_window
  777.     select(1)
  778.     deactivate
  779.     refresh
  780.   end
  781.   
  782.   #--------------------------------------------------------------------------
  783.   # window_width
  784.   #--------------------------------------------------------------------------
  785.   def window_width; return 200; end
  786.   
  787.   #--------------------------------------------------------------------------
  788.   # window_height
  789.   #--------------------------------------------------------------------------
  790.   def window_height; return Graphics.height - fitting_height(4); end
  791.   
  792.   #--------------------------------------------------------------------------
  793.   # item_max
  794.   #--------------------------------------------------------------------------
  795.   def item_max; return @data ? @data.size : 1; end
  796.   
  797.   #--------------------------------------------------------------------------
  798.   # refresh
  799.   #--------------------------------------------------------------------------
  800.   def refresh
  801.     make_item_list
  802.     create_contents
  803.     draw_all_items
  804.   end
  805.   
  806.   #--------------------------------------------------------------------------
  807.   # make_item_list
  808.   #--------------------------------------------------------------------------
  809.   def make_item_list
  810.     @data = [0]
  811.     for member in $game_party.all_members
  812.       next if member.nil?
  813.       @data.push(member.id)
  814.     end
  815.     @data.push(0)
  816.   end
  817.   
  818.   #--------------------------------------------------------------------------
  819.   # draw_item
  820.   #--------------------------------------------------------------------------
  821.   def draw_item(index)
  822.     clear_item(index)
  823.     rect = item_rect(index)
  824.     if @data[index] == 0
  825.       draw_remove(rect)
  826.       return
  827.     end
  828.     actor = $game_actors[@data[index]]
  829.     draw_actor(actor, rect)
  830.     draw_actor_locked(actor, rect)
  831.     draw_actor_required(actor, rect)
  832.   end
  833.   
  834.   #--------------------------------------------------------------------------
  835.   # draw_remove
  836.   #--------------------------------------------------------------------------
  837.   def draw_remove(rect)
  838.     reset_font_settings
  839.     draw_icon(Icon.remove_party, rect.x+4, rect.y)
  840.     text = YEA::PARTY::REMOVE_TEXT
  841.    draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  842.   end
  843.   
  844.   #--------------------------------------------------------------------------
  845.   # draw_actor
  846.   #--------------------------------------------------------------------------
  847.   def draw_actor(actor, rect)
  848.     buffer = YEA::PARTY::ACTOR_Y_BUFFER
  849.     draw_actor_graphic(actor, rect.x + 16, rect.y + rect.height + buffer)
  850.     text = actor.name
  851.     change_color(list_colour(actor), enabled?(actor))
  852.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  853.   end
  854.   
  855.   #--------------------------------------------------------------------------
  856.   # list_colour
  857.   #--------------------------------------------------------------------------
  858.   def list_colour(actor)
  859.     return text_color(YEA::PARTY::IN_PARTY_COLOUR) if in_party?(actor)
  860.     return normal_color
  861.   end
  862.   
  863.   #--------------------------------------------------------------------------
  864.   # draw_actor_locked
  865.   #--------------------------------------------------------------------------
  866.   def draw_actor_locked(actor, rect)
  867.     return unless actor.locked
  868.     draw_icon(Icon.locked_party, rect.width-24, rect.y)
  869.   end
  870.   
  871.   #--------------------------------------------------------------------------
  872.   # draw_actor_required
  873.   #--------------------------------------------------------------------------
  874.   def draw_actor_required(actor, rect)
  875.     return if actor.locked
  876.     return unless actor.required
  877.     draw_icon(Icon.required_party, rect.width-24, rect.y)
  878.   end
  879.   
  880.   #--------------------------------------------------------------------------
  881.   # enabled?
  882.   #--------------------------------------------------------------------------
  883.   def enabled?(actor)
  884.     return false if actor.locked
  885.     return false if actor.required && in_party?(actor)
  886.     return actor.exist?
  887.   end
  888.   
  889.   #--------------------------------------------------------------------------
  890.   # in_party?
  891.   #--------------------------------------------------------------------------
  892.   def in_party?(actor); return $game_party.battle_members.include?(actor); end
  893.   
  894.   #--------------------------------------------------------------------------
  895.   # current_item_enabled?
  896.   #--------------------------------------------------------------------------
  897.   def current_item_enabled?
  898.     actor = $game_actors[item]
  899.     replace = $game_actors[@party_window.item]
  900.     unless actor.nil?
  901.       return false if actor.locked && in_party?(actor)
  902.       return false if actor.required && in_party?(actor)
  903.     end
  904.     return true if replace.nil?
  905.     return false if replace.locked
  906.     return false if replace.required
  907.     return true if actor.nil?
  908.     return actor.exist?
  909.   end
  910.   
  911.   #--------------------------------------------------------------------------
  912.   # item
  913.   #--------------------------------------------------------------------------
  914.   def item; return @data[index]; end
  915.   
  916. end # Window_PartyList

  917. #==============================================================================
  918. # ** Window_PartyStatus
  919. #==============================================================================

  920. class Window_PartyStatus < Window_Base
  921.   
  922.   #--------------------------------------------------------------------------
  923.   # initialize
  924.   #--------------------------------------------------------------------------
  925.   def initialize(party_window, list_window)
  926.     super(200, fitting_height(4), window_width, window_height)
  927.     @party_window = party_window
  928.     @list_window = list_window
  929.     [url=home.php?mod=space&uid=95897]@actor[/url] = active_actor
  930.     refresh
  931.   end
  932.   
  933.   #--------------------------------------------------------------------------
  934.   # window_width
  935.   #--------------------------------------------------------------------------
  936.   def window_width; Graphics.width - 275; end#200; end
  937.   
  938.   #--------------------------------------------------------------------------
  939.   # window_height
  940.   #--------------------------------------------------------------------------
  941.   def window_height; Graphics.height - fitting_height(4) - 75; end
  942.   
  943.   #--------------------------------------------------------------------------
  944.   # update
  945.   #--------------------------------------------------------------------------
  946.   def update
  947.     super
  948.     refresh if @actor != active_actor
  949.   end
  950.   
  951.   #--------------------------------------------------------------------------
  952.   # active_actor
  953.   #--------------------------------------------------------------------------
  954.   def active_actor
  955.     if @list_window.active
  956.       actor = @list_window.item
  957.     else
  958.       actor = @party_window.item
  959.     end
  960.     return nil if [0, nil].include?(actor)
  961.     return actor
  962.   end
  963.   
  964.   #--------------------------------------------------------------------------
  965.   # refresh●人物信息
  966.   #--------------------------------------------------------------------------
  967.   def refresh
  968.     contents.clear
  969.     @actor = active_actor
  970.     reset_font_settings
  971.     if @actor.nil?
  972.       draw_nil_actor
  973.       return
  974.     end
  975.     actor = $game_actors[@actor]
  976.     draw_actor_HalfBody(actor, 0, 20)
  977.     draw_actor_name(actor, 15, 257)
  978.     draw_actor_class(actor, 158-30, 20, contents.width-232)
  979.     draw_actor_level(actor, 158, line_height+20)
  980.     draw_actor_icons(actor, 258, line_height+20, contents.width-232)
  981.     draw_actor_hp(actor, 158-30, line_height*2+20, contents.width-170)
  982.     draw_actor_mp(actor, 158-30, line_height*3+20, contents.width-170)
  983.     draw_actor_tp(actor, 158-30, line_height*4+20, contents.width-170)
  984.     draw_actor_parameters(actor, 158, line_height*5 + line_height/2+20)
  985.     draw_equipments(actor, contents.width/2+60, line_height*5 + line_height/2+20)
  986.   end
  987.   
  988.   #--------------------------------------------------------------------------
  989.   # draw_nil_actor
  990.   #--------------------------------------------------------------------------
  991.   def draw_nil_actor
  992.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  993.     rect = Rect.new(0, 0, contents.width, contents.height)
  994.     contents.fill_rect(rect, colour)
  995.     change_color(system_color)
  996.     text = YEA::PARTY::NO_DATA
  997.     draw_text(rect, text, 1)
  998.   end
  999.   
  1000.   #--------------------------------------------------------------------------
  1001.   # draw_actor_parameters
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_actor_parameters(actor, dx, dy)
  1004.     dw = contents.width/2 - 100
  1005.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1006.     contents.font.size = YEA::PARTY::STAT_FONT_SIZE
  1007.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1008.     array = [:atk, :def, :mat, :mdf, :agi, :luk]
  1009.     cx = 4
  1010.     for stat in array
  1011.       case stat
  1012.       when :atk
  1013.         param = Vocab::param(2)
  1014.         value = actor.atk.group
  1015.       when :def
  1016.         param = Vocab::param(3)
  1017.         value = actor.def.group
  1018.       when :mat
  1019.         param = Vocab::param(4)
  1020.         value = actor.mat.group
  1021.       when :mdf
  1022.         param = Vocab::param(5)
  1023.         value = actor.mdf.group
  1024.       when :agi
  1025.         param = Vocab::param(6)
  1026.         value = actor.agi.group
  1027.       when :luk
  1028.         param = Vocab::param(7)
  1029.         value = actor.luk.group
  1030.       else; next
  1031.       end
  1032.       contents.fill_rect(rect, colour)
  1033.       change_color(system_color)
  1034.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, param, 0)
  1035.       change_color(normal_color)
  1036.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, value, 2)
  1037.       rect.y += line_height
  1038.     end
  1039.     reset_font_settings
  1040.   end
  1041.   
  1042.   #--------------------------------------------------------------------------
  1043.   # draw_equipments
  1044.   #--------------------------------------------------------------------------
  1045.   def draw_equipments(actor, dx, dy)
  1046.     text = YEA::PARTY::EQUIP_TEXT
  1047.     change_color(system_color)
  1048.     draw_text(dx, dy, contents.width - dx, line_height, text, 1)
  1049.     dy += line_height
  1050.     if actor.equips.size <= 5
  1051.       actor.equips.each_with_index do |item, i|
  1052.         draw_item_name(item, dx, dy + line_height * i)
  1053.       end
  1054.     else
  1055.       orig_x = dx
  1056.       actor.equips.each_with_index do |item, i|
  1057.         next if item.nil?
  1058.         draw_icon(item.icon_index, dx, dy)
  1059.         dy += line_height if dx + 48 > contents.width
  1060.         dx = dx + 48 > contents.width ? orig_x : dx + 24
  1061.       end
  1062.     end
  1063.   end
  1064.   
  1065. end # Window_PartyStatus

  1066. #==============================================================================
  1067. # ■ Scene_Menu
  1068. #==============================================================================

  1069. class Scene_Menu < Scene_MenuBase
  1070.   
  1071.   #--------------------------------------------------------------------------
  1072.   # overwrite method: command_formation
  1073.   #--------------------------------------------------------------------------
  1074.   if YEA::PARTY::ENABLE_MENU
  1075.   def command_formation
  1076.     SceneManager.call(Scene_Party)
  1077.   end
  1078.   end # YEA::PARTY::ENABLE_MENU
  1079.   
  1080. end # Scene_Menu

  1081. #==============================================================================
  1082. # ■ Scene_Party
  1083. #==============================================================================

  1084. class Scene_Party < Scene_MenuBase
  1085.   
  1086.   #--------------------------------------------------------------------------
  1087.   # start
  1088.   #--------------------------------------------------------------------------
  1089.   def start
  1090.     super
  1091.     @former_party = $game_party.battle_members_array.clone
  1092.     create_command_window
  1093.     create_party_window
  1094.     create_list_window
  1095.     create_status_window
  1096.   end
  1097.   
  1098.   #--------------------------------------------------------------------------
  1099.   # ● 生成背景
  1100.   #--------------------------------------------------------------------------
  1101.   def create_background
  1102.     @background_sprite = Sprite.new
  1103.     @background_sprite.bitmap =Cache.load_bitmap("Graphics/System/","WallpaperRANK")
  1104.     @background_sprite.color.set(0,0, 0,0)
  1105.   end
  1106.   #--------------------------------------------------------------------------
  1107.   # create_command_window
  1108.   #--------------------------------------------------------------------------
  1109.   def create_command_window
  1110.     @command_window = Window_PartyMenuCommand.new(0, 0)
  1111.     @command_window.set_handler(:change, method(:adjust_members))
  1112.     @command_window.set_handler(:remove, method(:adjust_members))
  1113.     @command_window.set_handler(:revert, method(:revert_party))
  1114.     @command_window.set_handler(:finish, method(:return_scene))
  1115.     @command_window.set_handler(:cancel, method(:return_scene))
  1116.     @command_window.opacity = 0
  1117.   end
  1118.   
  1119.   #--------------------------------------------------------------------------
  1120.   # create_party_window
  1121.   #--------------------------------------------------------------------------
  1122.   def create_party_window
  1123.     @party_window = Window_PartySelect.new(@command_window)
  1124.     @party_window.set_handler(:ok,       method(:on_party_ok))
  1125.     @party_window.set_handler(:cancel,   method(:on_party_cancel))
  1126.     @party_window.set_handler(:pageup,   method(:on_party_pageup))
  1127.     @party_window.set_handler(:pagedown, method(:on_party_pagedown))
  1128.     @party_window.opacity = 0
  1129.   end
  1130.   
  1131.   #--------------------------------------------------------------------------
  1132.   # create_list_window
  1133.   #--------------------------------------------------------------------------
  1134.   def create_list_window
  1135.     @list_window = Window_PartyList.new(@party_window)
  1136.     @list_window.set_handler(:ok,     method(:on_list_ok))
  1137.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  1138.     @list_window.opacity = 0
  1139.   end
  1140.   
  1141.   #--------------------------------------------------------------------------
  1142.   # create_status_window
  1143.   #--------------------------------------------------------------------------
  1144.   def create_status_window
  1145.     @status_window = Window_PartyStatus.new(@party_window, @list_window)
  1146.     @status_window.opacity = 0
  1147.   end
  1148.   
  1149.   #--------------------------------------------------------------------------
  1150.   # adjust_members
  1151.   #--------------------------------------------------------------------------
  1152.   def adjust_members
  1153.     @party_window.activate
  1154.   end
  1155.   
  1156.   #--------------------------------------------------------------------------
  1157.   # window_refresh
  1158.   #--------------------------------------------------------------------------
  1159.   def window_refresh
  1160.     $game_party.rearrange_actors
  1161.     @command_window.refresh
  1162.     @party_window.refresh
  1163.     @list_window.refresh
  1164.     $game_player.refresh
  1165.     $game_map.need_refresh = true
  1166.   end
  1167.   
  1168.   #--------------------------------------------------------------------------
  1169.   # revert_party
  1170.   #--------------------------------------------------------------------------
  1171.   def revert_party
  1172.     @command_window.activate
  1173.     $game_party.battle_members_array = @former_party.clone
  1174.     window_refresh
  1175.   end
  1176.   
  1177.   #--------------------------------------------------------------------------
  1178.   # on_party_ok
  1179.   #--------------------------------------------------------------------------
  1180.   def on_party_ok
  1181.     case @command_window.current_symbol
  1182.     when :change
  1183.       @list_window.activate
  1184.     when :remove
  1185.       index = @party_window.index
  1186.       actor = $game_actors[$game_party.battle_members_array[index]]
  1187.       Sound.play_equip
  1188.       $game_party.battle_members_array[index] = 0
  1189.       window_refresh
  1190.       @party_window.activate
  1191.     end
  1192.   end
  1193.   
  1194.   #--------------------------------------------------------------------------
  1195.   # on_party_cancel
  1196.   #--------------------------------------------------------------------------
  1197.   def on_party_cancel
  1198.     @command_window.activate
  1199.   end
  1200.   
  1201.   #--------------------------------------------------------------------------
  1202.   # on_party_pageup
  1203.   #--------------------------------------------------------------------------
  1204.   def on_party_pageup
  1205.     Sound.play_equip
  1206.     actor_id1 = @party_window.item
  1207.     actor_id2 = @party_window.prev_actor.nil? ? 0 : @party_window.prev_actor.id
  1208.     max = @party_window.item_max-1
  1209.     index1 = @party_window.index
  1210.     index2 = @party_window.index == 0 ? max : index1-1
  1211.     $game_party.battle_members_array[index1] = actor_id2
  1212.     $game_party.battle_members_array[index2] = actor_id1
  1213.     window_refresh
  1214.   end
  1215.   
  1216.   #--------------------------------------------------------------------------
  1217.   # on_party_pagedown
  1218.   #--------------------------------------------------------------------------
  1219.   def on_party_pagedown
  1220.     Sound.play_equip
  1221.     actor_id1 = @party_window.item
  1222.     actor_id2 = @party_window.next_actor.nil? ? 0 : @party_window.next_actor.id
  1223.     max = @party_window.item_max-1
  1224.     index1 = @party_window.index
  1225.     index2 = @party_window.index == max ? 0 : index1+1
  1226.     $game_party.battle_members_array[index1] = actor_id2
  1227.     $game_party.battle_members_array[index2] = actor_id1
  1228.     window_refresh
  1229.   end
  1230.   
  1231.   #--------------------------------------------------------------------------
  1232.   # on_list_cancel
  1233.   #--------------------------------------------------------------------------
  1234.   def on_list_cancel
  1235.     @party_window.activate
  1236.   end
  1237.   
  1238.   #--------------------------------------------------------------------------
  1239.   # on_list_ok
  1240.   #--------------------------------------------------------------------------
  1241.   def on_list_ok
  1242.     Sound.play_equip
  1243.     replace = $game_actors[@party_window.item]
  1244.     actor = $game_actors[@list_window.item]
  1245.     index1 = @party_window.index
  1246.     actor_id1 = actor.nil? ? 0 : actor.id
  1247.     if actor.nil?
  1248.       $game_party.battle_members_array[index1] = 0
  1249.       window_refresh
  1250.       @party_window.activate
  1251.       return
  1252.     end
  1253.     actor_id2 = replace.nil? ? 0 : replace.id
  1254.     if $game_party.battle_members_array.include?(actor_id1)
  1255.       index2 = $game_party.battle_members_array.index(actor_id1)
  1256.       $game_party.battle_members_array[index2] = actor_id2
  1257.     end
  1258.     $game_party.battle_members_array[index1] = actor_id1
  1259.     window_refresh
  1260.     @party_window.activate
  1261.   end
  1262.   
  1263. end # Scene_Party

  1264. #==============================================================================
  1265. #
  1266. # ▼ End of File
  1267. #
  1268. #==============================================================================
复制代码

点评

辛苦了,谢谢,马上试试  发表于 2013-12-6 22:54
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
4
 楼主| 发表于 2013-12-6 22:56:29 | 只看该作者
hcm 发表于 2013-12-6 22:53
把这脚本放到横版脚本下面试试:

回复 支持 反对

使用道具 举报

Lv3.寻梦者

虚空人形

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

贵宾

5
发表于 2013-12-6 23:42:18 | 只看该作者
(QQ上解决了,版主结帖)

评分

参与人数 1梦石 +1 收起 理由
熊喵酱 + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
6
 楼主| 发表于 2013-12-7 00:09:22 | 只看该作者
这个是解决办法 @后知后觉  @版主
  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. $imported = {} if $imported.nil?
  10. $imported["YEA-PartySystem"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.23 - Bug fixed: Party members are now rearranged when newly added.
  15. # 2012.01.14 - New Feature: Maximum Battle Members Variable added.
  16. # 2012.01.07 - Bug fixed: Error with removing members.
  17. # 2012.01.05 - Bug fixed: Escape skill/item effects no longer counts as death.
  18. # 2011.12.26 - Compatibility Update: New Game+
  19. # 2011.12.17 - Updated Spriteset_Battle to have updated sprite counts.
  20. # 2011.12.13 - Updated to provide better visual display when more than 5 pieces
  21. #              of equipment are equipped on an actor at a time.
  22. # 2011.12.05 - Added functionality to display faces in the Party Select Window.
  23. #            - Fixed bug that doesn't refresh the caterpillar when new members
  24. #              join the party.
  25. # 2011.12.04 - Started Script and Finished.
  26. #
  27. #==============================================================================
  28. # ▼ Introduction
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # RPG Maker VX Ace comes with a very nice party system. However, changing the
  31. # maximum number of members isn't possible without the aid of a script. This
  32. # script enables you the ability to change the maximum number of party members,
  33. # change EXP rates, and/or open up a separate party menu (if desired). In
  34. # addition to that, you can lock the position of actors within a party and
  35. # require other actors to be in the active party before continuing.
  36. #
  37. #==============================================================================
  38. # ▼ Instructions
  39. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. # To install this script, open up your script editor and copy/paste this script
  41. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  42. #
  43. # -----------------------------------------------------------------------------
  44. # 脚本命令语句 - These commands are used with script calls.
  45. # -----------------------------------------------------------------------------
  46. # *IMPORTANT* These script calls require the new party menu to be enabled to
  47. # use them. Otherwise, nothing will happen.
  48. #
  49. # lock_actor(x)      锁定X角色在队伍中的位置
  50. # unlock_actor(x)
  51. # This will lock actor x in its current position in the party if the actor is
  52. # in the current party. The actor is unable to switch position and must remain
  53. # in that position until the lock is removed. Use the unlock script call to
  54. # remove the locked status. This script requires the actor to have joined and
  55. # in the current party before the script call will work.
  56. #
  57. # require_actor(x)   需要X角色参战
  58. # unrequire_actor(x)
  59. # This will cause the party to require actor x in order to continue. If the
  60. # actor isn't in the current party but is in the reserve party, the party menu
  61. # will open up and prompt the player to add the required actor into the party
  62. # before being able to continue. This script call will not function unless the
  63. # specific actor has joined the party, whether it is in the current or reserve.
  64. #
  65. # call_party_menu    打开队伍菜单
  66. # This will open up the party menu. This script call requires for the party
  67. # menu to be enabled to use.
  68. #
  69. #==============================================================================
  70. # ▼ Compatibility
  71. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  72. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  73. # it will run with RPG Maker VX without adjusting.
  74. #
  75. #==============================================================================

  76. module YEA
  77.   module PARTY
  78.    
  79.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  80.     # - General Party Settings -
  81.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82.     # In this section, you can adjust the general party settings for your game
  83.     # such as the maximum amount of members and whatnot, the EXP rate for
  84.     # party members in the reserve, etc.
  85.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  86.     MAX_BATTLE_MEMBERS   = 5      # 最大参战人员. Default: 4
  87.     SPLIT_EXP            = false  # 平分经验?Splits EXP with more members in the party.
  88.     RESERVE_EXP_RATE     = 0.50   # 休息人员的经验获得率Reserve EXP Rate. Default: 1.00
  89.    
  90.     # If you wish to be able to change the maximum number of battle members
  91.     # during the middle of your game, set this constant to a variable ID. If
  92.     # that variable ID is a number greater than 0, that variable will determine
  93.     # the current maximum number of battle members. Be cautious about using
  94.     # this during battle.
  95.     MAX_MEMBERS_VARIABLE = 0  #设置游戏中改变最大参战人员的变量
  96.    
  97.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  98.     # - Party Menu Settings -
  99.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  100.     # This section contains various menu settings for those who wish to use a
  101.     # menu separate for the party system. Here, adjust the menu command order,
  102.     # icons used, and other settings.
  103.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104.     ENABLE_MENU = true   # Enables party menu. Default: false
  105.     COMMANDS =[          # The order at which the menu items are shown.
  106.     # [:command,  "Display"],
  107.       [ :change,  "替换",],
  108.      [ :remove,  "退下",],
  109.       [ :revert,  "还原",],
  110.       [ :finish,  "完成",],
  111.     ] # Do not remove this.
  112.     COMMAND_ALIGN    = 1     # 0:左对齐, 1:Center Align, 2:Right Align
  113.    
  114.     # These settings here are used for the upper right window: the Party Select
  115.     # window where the player selects a member to swap out or remove.
  116.     PARTY_FONT_SIZE  = 16    # Font size used for party member names.
  117.     LOCK_FIRST_ACTOR = true # Lock the first actor by default?
  118.     LOCKED_ICON      = 125   # Icon used for locked members.
  119.     REQUIRED_ICON    = 126   # Icon used for required members.
  120.     EMPTY_TEXT = "-Empty-"   # Text used when a member isn't present.
  121.     DISPLAY_FACE     = false # Display faces instead of sprites?
  122.    
  123.     # These settings here are used for the lower left window: the Party List
  124.     # window where the player selects a member to replace.
  125.     REMOVE_ICON      = 186          # Icon used for removing members.
  126.     REMOVE_TEXT      = "-重新移动-"   # Text used for remove member command.
  127.     ACTOR_Y_BUFFER   = 25           # Amount the actor graphic be adjusted by.
  128.    
  129.     # These settings here are used for the lower right window: the Party Status
  130.     # window where info about a selected actor is shown.
  131.     NO_DATA         = "- No Data -" # Text used for when no actor is shown.
  132.     IN_PARTY_COLOUR = 6             # Text colour used for in party members.
  133.     STAT_FONT_SIZE  = 24            # Font size used for stats.
  134.     EQUIP_TEXT      = "Equipment"   # Text used to display equipment.
  135.    
  136.   end # PARTY
  137. end # YEA

  138. #==============================================================================
  139. # ▼ Editting anything past this point may potentially result in causing
  140. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  141. # halitosis so edit at your own risk.
  142. #==============================================================================

  143. #==============================================================================
  144. # ■ Icon
  145. #==============================================================================

  146. module Icon
  147.   
  148.   #--------------------------------------------------------------------------
  149.   # self.locked_party
  150.   #--------------------------------------------------------------------------
  151.   def self.locked_party; return YEA::PARTY::LOCKED_ICON; end
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # self.required_party
  155.   #--------------------------------------------------------------------------
  156.   def self.required_party; return YEA::PARTY::REQUIRED_ICON; end
  157.   
  158.   #--------------------------------------------------------------------------
  159.   # self.remove_party
  160.   #--------------------------------------------------------------------------
  161.   def self.remove_party; return YEA::PARTY::REMOVE_ICON; end
  162.    
  163. end # Icon

  164. #==============================================================================
  165. # ■ Variable
  166. #==============================================================================

  167. module Variable
  168.   
  169.   #--------------------------------------------------------------------------
  170.   # self.max_battle_members
  171.   #--------------------------------------------------------------------------
  172.   def self.max_battle_members
  173.     default = YEA::PARTY::MAX_BATTLE_MEMBERS
  174.     return default if YEA::PARTY::MAX_MEMBERS_VARIABLE <= 0
  175.     return default if $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE] <= 0
  176.     return $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE]
  177.   end
  178.   
  179. end # Variable

  180. #==============================================================================
  181. # ■ Numeric
  182. #==============================================================================

  183. class Numeric
  184.   
  185.   #--------------------------------------------------------------------------
  186.   # new method: group_digits
  187.   #--------------------------------------------------------------------------
  188.   unless $imported["YEA-CoreEngine"]
  189.   def group; return self.to_s; end
  190.   end # $imported["YEA-CoreEngine"]
  191.    
  192. end # Numeric

  193. #==============================================================================
  194. # ■ Game_Actor
  195. #==============================================================================

  196. class Game_Actor < Game_Battler
  197.   
  198.   #--------------------------------------------------------------------------
  199.   # public instance variables
  200.   #--------------------------------------------------------------------------
  201.   attr_accessor :locked
  202.   attr_accessor :required
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # alias method: setup
  206.   #--------------------------------------------------------------------------
  207.   alias game_actor_setup_ps setup
  208.   def setup(actor_id)
  209.     game_actor_setup_ps(actor_id)
  210.     @locked = false
  211.     @required = false
  212.   end
  213.   
  214.   #--------------------------------------------------------------------------
  215.   # overwrite method: final_exp_rate
  216.   #--------------------------------------------------------------------------
  217.   def final_exp_rate
  218.     n = exr * (battle_member? ? 1 : reserve_members_exp_rate)
  219.     if $game_party.in_battle
  220.       n /= [$game_party.battle_members.size, 1].max if YEA::PARTY::SPLIT_EXP
  221.     end
  222.     return n
  223.   end
  224.   
  225.   #--------------------------------------------------------------------------
  226.   # overwrite method: reserve_members_exp_rate
  227.   #--------------------------------------------------------------------------
  228.   def reserve_members_exp_rate
  229.     $data_system.opt_extra_exp ? YEA::PARTY::RESERVE_EXP_RATE : 0
  230.   end
  231.   
  232. end # Game_Actor

  233. #==============================================================================
  234. # ■ Game_Party
  235. #==============================================================================

  236. class Game_Party < Game_Unit
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # public instance variables
  240.   #--------------------------------------------------------------------------
  241.   attr_accessor :battle_members_array
  242.   
  243.   #--------------------------------------------------------------------------
  244.   # alias method: initialize
  245.   #--------------------------------------------------------------------------
  246.   alias game_party_initialize_ps initialize
  247.   def initialize
  248.     game_party_initialize_ps
  249.     @battle_members_array = nil
  250.   end
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # overwrite method: max_battle_members
  254.   #--------------------------------------------------------------------------
  255.   def max_battle_members; return Variable.max_battle_members; end
  256.   
  257.   #--------------------------------------------------------------------------
  258.   # alias method: setup_starting_members
  259.   #--------------------------------------------------------------------------
  260.   alias setup_starting_members_ps setup_starting_members
  261.   def setup_starting_members
  262.     setup_starting_members_ps
  263.     initialize_battle_members
  264.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  265.     return if members[0].nil?
  266.     members[0].locked = true
  267.   end
  268.   
  269.   #--------------------------------------------------------------------------
  270.   # alias method: setup_battle_test_members
  271.   #--------------------------------------------------------------------------
  272.   alias setup_battle_test_members_ps setup_battle_test_members
  273.   def setup_battle_test_members
  274.     setup_battle_test_members_ps
  275.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  276.     return if members[0].nil?
  277.     members[0].locked = true
  278.   end
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # overwrite method: battle_members
  282.   #--------------------------------------------------------------------------
  283.   def battle_members
  284.     initialize_battle_members if initialize_battle_members?
  285.     array = []
  286.     for actor_id in @battle_members_array
  287.       break if array.size > max_battle_members
  288.       next if actor_id.nil?
  289.       next if $game_actors[actor_id].nil?
  290.       next unless $game_actors[actor_id].exist?
  291.       array.push($game_actors[actor_id])
  292.     end
  293.     return array
  294.   end
  295.   
  296.   #--------------------------------------------------------------------------
  297.   # new method: initialize_battle_members?
  298.   #--------------------------------------------------------------------------
  299.   def initialize_battle_members?
  300.     return true if @battle_members_array.nil?
  301.     return @battle_members_array.size != max_battle_members
  302.   end
  303.   
  304.   #--------------------------------------------------------------------------
  305.   # new method: initialize_battle_members
  306.   #--------------------------------------------------------------------------
  307.   def initialize_battle_members
  308.     @battle_members_array = []
  309.     for i in 0...max_battle_members
  310.       @battle_members_array.push(@actors[i]) unless @actors[i].nil?
  311.       @battle_members_array.push(0) if @actors[i].nil?
  312.     end
  313.     $game_player.refresh
  314.   end
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # alias method: add_actor
  318.   #--------------------------------------------------------------------------
  319.   alias game_party_add_actor_ps add_actor
  320.   def add_actor(actor_id)
  321.     game_party_add_actor_ps(actor_id)
  322.     return if @battle_members_array.include?(actor_id)
  323.     return unless @battle_members_array.include?(0)
  324.     index = @battle_members_array.index(0)
  325.     @battle_members_array[index] = actor_id
  326.     $game_player.refresh
  327.     $game_map.need_refresh = true
  328.     rearrange_actors
  329.   end
  330.   
  331.   #--------------------------------------------------------------------------
  332.   # alias method: remove_actor
  333.   #--------------------------------------------------------------------------
  334.   alias game_party_remove_actor_ps remove_actor
  335.   def remove_actor(actor_id)
  336.     game_party_remove_actor_ps(actor_id)
  337.     return unless @battle_members_array.include?(actor_id)
  338.     index = @battle_members_array.index(actor_id)
  339.     @battle_members_array[index] = 0
  340.     $game_player.refresh
  341.     $game_map.need_refresh = true
  342.     rearrange_actors
  343.   end
  344.   
  345.   #--------------------------------------------------------------------------
  346.   # new method: rearrange_actors
  347.   #--------------------------------------------------------------------------
  348.   def rearrange_actors
  349.     initialize_battle_members if @battle_members_array.nil?
  350.     array = []
  351.     for actor_id in @battle_members_array
  352.       next if [0, nil].include?(actor_id)
  353.       next if $game_actors[actor_id].nil?
  354.       array.push(actor_id)
  355.     end
  356.     for actor_id in @actors
  357.       next if array.include?(actor_id)
  358.       next if $game_actors[actor_id].nil?
  359.       array.push(actor_id)
  360.     end
  361.     @actors = array
  362.   end
  363.   
  364. end # Game_Party

  365. #==============================================================================
  366. # ■ Game_Interpreter
  367. #==============================================================================

  368. class Game_Interpreter
  369.   
  370.   #--------------------------------------------------------------------------
  371.   # new method: lock_actor
  372.   #--------------------------------------------------------------------------
  373.   def lock_actor(actor_id)
  374.     return unless YEA::PARTY::ENABLE_MENU
  375.     actor = $game_actors[actor_id]
  376.     return unless $game_party.battle_members.include?(actor.id)
  377.     actor.locked = true
  378.   end
  379.   
  380.   #--------------------------------------------------------------------------
  381.   # new method: unlock_actor
  382.   #--------------------------------------------------------------------------
  383.   def unlock_actor(actor_id)
  384.     return unless YEA::PARTY::ENABLE_MENU
  385.     actor = $game_actors[actor_id]
  386.     return unless $game_party.battle_members.include?(actor.id)
  387.     actor.locked = false
  388.   end
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # new method: require_actor
  392.   #--------------------------------------------------------------------------
  393.   def require_actor(actor_id)
  394.     return unless YEA::PARTY::ENABLE_MENU
  395.     return if $game_system.formation_disabled
  396.     actor = $game_actors[actor_id]
  397.     return unless $game_party.all_members.include?(actor)
  398.     actor.required = true
  399.     call_party_menu unless $game_party.battle_members.include?(actor)
  400.   end
  401.   
  402.   #--------------------------------------------------------------------------
  403.   # new method: unrequire_actor
  404.   #--------------------------------------------------------------------------
  405.   def unrequire_actor(actor_id)
  406.     return unless YEA::PARTY::ENABLE_MENU
  407.     return if $game_system.formation_disabled
  408.     actor = $game_actors[actor_id]
  409.     return unless $game_party.all_members.include?(actor)
  410.     actor.required = false
  411.     call_party_menu unless $game_party.battle_members.include?(actor)
  412.   end
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # new method: call_party_menu
  416.   #--------------------------------------------------------------------------
  417.   def call_party_menu
  418.     return unless YEA::PARTY::ENABLE_MENU
  419.     return if $game_system.formation_disabled
  420.     SceneManager.call(Scene_Party)
  421.   end
  422.   
  423. end # Game_Interpreter

  424. #==============================================================================
  425. # ■ Spriteset_Battle
  426. #==============================================================================

  427. class Spriteset_Battle
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # overwrite method: create_actors
  431.   #--------------------------------------------------------------------------
  432.   def create_actors
  433.     total = $game_party.max_battle_members
  434.     @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  435.   end
  436.   
  437. end # Spriteset_Battle

  438. #==============================================================================
  439. # ■ Window_PartyMenuCommand
  440. #==============================================================================

  441. class Window_PartyMenuCommand < Window_Command
  442.   
  443.   #--------------------------------------------------------------------------
  444.   # window_width
  445.   #--------------------------------------------------------------------------
  446.   def window_width; return 120; end#160; end
  447.   
  448.   #--------------------------------------------------------------------------
  449.   # visible_line_number
  450.   #--------------------------------------------------------------------------
  451.   def visible_line_number; 4; end
  452.   
  453.   #--------------------------------------------------------------------------
  454.   # alignment
  455.   #--------------------------------------------------------------------------
  456.   def alignment
  457.     return Menu.command_window_align if $imported["YEA-AceMenuEngine"]
  458.     return YEA::PARTY::COMMAND_ALIGN
  459.   end
  460.   
  461.   #--------------------------------------------------------------------------
  462.   # scene
  463.   #--------------------------------------------------------------------------
  464.   def scene; return SceneManager.scene; end
  465.   
  466.   #--------------------------------------------------------------------------
  467.   # make_command_list
  468.   #--------------------------------------------------------------------------
  469.   def make_command_list
  470.     for command in YEA::PARTY::COMMANDS
  471.       case command[0]
  472.       when :change, :remove, :revert
  473.         add_command(command[1], command[0])
  474.       when :finish
  475.         add_command(command[1], command[0], enable_cancel?)
  476.       else; next
  477.       end
  478.     end
  479.   end
  480.   
  481.   #--------------------------------------------------------------------------
  482.   # process_cancel
  483.   #--------------------------------------------------------------------------
  484.   def process_cancel
  485.     unless enable_cancel?
  486.       Sound.play_buzzer
  487.       return
  488.     end
  489.     super
  490.   end
  491.   
  492.   #--------------------------------------------------------------------------
  493.   # in_party?
  494.   #--------------------------------------------------------------------------
  495.   def in_party?(actor)
  496.     return $game_party.battle_members.include?(actor)
  497.   end
  498.   
  499.   #--------------------------------------------------------------------------
  500.   # enable_cancel?
  501.   #--------------------------------------------------------------------------
  502.   def enable_cancel?
  503.     return false if $game_party.battle_members.size <= 0
  504.     for actor in $game_party.all_members
  505.       next if in_party?(actor)
  506.       return false if actor.required
  507.       return false if actor.locked
  508.     end
  509.     return true
  510.   end
  511.   
  512. end # Window_PartyMenuCommand

  513. #==============================================================================
  514. # ■ Window_PartySelect
  515. #==============================================================================

  516. class Window_PartySelect < Window_Selectable
  517.   
  518.   #--------------------------------------------------------------------------
  519.   # initialize
  520.   #-------------------------------------------------------------------------
  521.   def initialize(command_window)
  522.     @command_window = command_window
  523.     super(120, 0, window_width, fitting_height(visible_line_number))
  524.     select(0)
  525.     deactivate

  526.     refresh
  527.   end
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # col_max
  531.   #--------------------------------------------------------------------------
  532.   def col_max; return $game_party.max_battle_members; end
  533.   
  534.   #--------------------------------------------------------------------------
  535.   # item_max
  536.   #--------------------------------------------------------------------------
  537.   def item_max; return $game_party.max_battle_members; end
  538.   
  539.   #--------------------------------------------------------------------------
  540.   # window_width
  541.   #--------------------------------------------------------------------------
  542.   def window_width; return Graphics.width - 220; end#160; end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # visible_line_number
  546.   #--------------------------------------------------------------------------
  547.   def visible_line_number; 4; end
  548.   
  549.   #--------------------------------------------------------------------------
  550.   # item_rect
  551.   #--------------------------------------------------------------------------
  552.   def item_rect(index)
  553.     rect = Rect.new
  554.     rect.width = contents.width / item_max
  555.     rect.height = contents.height
  556.     rect.x = index * rect.width
  557.     rect.y = 0
  558.     return rect
  559.   end
  560.   
  561.   #--------------------------------------------------------------------------
  562.   # refresh
  563.   #--------------------------------------------------------------------------
  564.   def refresh
  565.     make_item_list
  566.     create_contents
  567.     draw_all_items
  568.   end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # make_item_list
  572.   #--------------------------------------------------------------------------
  573.   def make_item_list
  574.     @data = $game_party.battle_members_array.clone
  575.   end
  576.   
  577.   #--------------------------------------------------------------------------
  578.   # ●人物信息
  579.   #--------------------------------------------------------------------------
  580.   def draw_item(index)
  581.     actor = $game_actors[@data[index]]
  582.     rect = item_rect(index)
  583.     if actor.nil?
  584.       draw_empty(rect.clone)
  585.       return
  586.     end
  587.     dx = rect.width / 2
  588.     dy = rect.height - 16
  589.     draw_actor_face(actor, rect.x, rect.y) if display_face?
  590.     draw_actor_graphic(actor, rect.x + dx, rect.y + dy) unless display_face?
  591.     draw_actor_name(actor, rect)
  592.     draw_locked_icon(actor, rect)
  593.     draw_required_icon(actor, rect)
  594.   end
  595.   
  596.   #--------------------------------------------------------------------------
  597.   # display_face?
  598.   #--------------------------------------------------------------------------
  599.   def display_face?
  600.     return YEA::PARTY::DISPLAY_FACE
  601.   end
  602.   
  603.   #--------------------------------------------------------------------------
  604.   # draw_empty
  605.   #--------------------------------------------------------------------------
  606.   def draw_empty(rect)
  607.     colour = Color.new(0, 0, 0, translucent_alpha/100000000)
  608.     rect.x += 2
  609.     rect.y += 2
  610.     rect.width -= 4
  611.     rect.height -= 4
  612.     contents.fill_rect(rect, colour)
  613.     reset_font_settings
  614.     change_color(system_color)
  615.     text = YEA::PARTY::EMPTY_TEXT
  616.     draw_text(rect, text, 1)
  617.     reset_font_settings
  618.   end
  619.   
  620.   #--------------------------------------------------------------------------
  621.   # draw_actor_name
  622.   #--------------------------------------------------------------------------
  623.   def draw_actor_name(actor, rect)
  624.     contents.font.size = YEA::PARTY::PARTY_FONT_SIZE
  625.     change_color(normal_color, actor.exist?)
  626.     draw_text(rect.x+4, rect.y, rect.width-8, line_height, actor.name, 1)
  627.   end
  628.   
  629.   #--------------------------------------------------------------------------
  630.   # draw_face
  631.   #--------------------------------------------------------------------------
  632.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  633.     bitmap = Cache.face(face_name)
  634.     dw = [96, item_rect(0).width-4].min
  635.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, dw, 92)
  636.     contents.blt(dx+2, dy+2, bitmap, rect, enabled ? 255 : translucent_alpha)
  637.     bitmap.dispose
  638.   end
  639.   
  640.   #--------------------------------------------------------------------------
  641.   # draw_locked_icon
  642.   #--------------------------------------------------------------------------
  643.   def draw_locked_icon(actor, rect)
  644.     return unless actor_locked?(actor)
  645.     draw_icon(Icon.locked_party, rect.x+rect.width-26, rect.height - 26)
  646.   end
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # draw_required_icon
  650.   #--------------------------------------------------------------------------
  651.   def draw_required_icon(actor, rect)
  652.     return if actor_locked?(actor)
  653.     return unless actor_required?(actor)
  654.     draw_icon(Icon.required_party, rect.x+rect.width-26, rect.height - 26)
  655.   end
  656.   
  657.   #--------------------------------------------------------------------------
  658.   # actor_locked?
  659.   #--------------------------------------------------------------------------
  660.   def actor_locked?(actor); return actor.locked; end
  661.   
  662.   #--------------------------------------------------------------------------
  663.   # actor_required?
  664.   #--------------------------------------------------------------------------
  665.   def actor_required?(actor)
  666.     return false if actor.locked
  667.     return actor.required
  668.   end
  669.   
  670.   #--------------------------------------------------------------------------
  671.   # current_item_enabled?
  672.   #--------------------------------------------------------------------------
  673.   def current_item_enabled?; enable?(@data[index]); end
  674.   
  675.   #--------------------------------------------------------------------------
  676.   # enable?
  677.   #--------------------------------------------------------------------------
  678.   def enable?(item)
  679.     case @command_window.current_symbol
  680.     when :change
  681.       return true if item.nil?
  682.       return true if item == 0
  683.     when :remove
  684.       return false if item.nil?
  685.       return false if item == 0
  686.     end
  687.     actor = $game_actors[item]
  688.     return false if actor.locked
  689.     return false if actor.required
  690.     return true
  691.   end
  692.   
  693.   #--------------------------------------------------------------------------
  694.   # process_handling
  695.   #--------------------------------------------------------------------------
  696.   def process_handling
  697.     return unless open? && active
  698.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  699.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  700.     return process_pagedown if handle?(:pagedown) && Input.repeat?(:R)
  701.     return process_pageup   if handle?(:pageup)   && Input.repeat?(:L)
  702.   end
  703.   
  704.   #--------------------------------------------------------------------------
  705.   # cur_actor
  706.   #--------------------------------------------------------------------------
  707.   def cur_actor
  708.     actor_id = @data[index]
  709.     return $game_actors[actor_id]
  710.   end
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # prev_actor
  714.   #--------------------------------------------------------------------------
  715.   def prev_actor
  716.     id = index == 0 ? @data.size - 1 : index - 1
  717.     actor_id = @data[id]
  718.     return $game_actors[actor_id]
  719.   end
  720.   
  721.   #--------------------------------------------------------------------------
  722.   # next_actor
  723.   #--------------------------------------------------------------------------
  724.   def next_actor
  725.     id = index == @data.size - 1 ? 0 : index + 1
  726.     actor_id = @data[id]
  727.     return $game_actors[actor_id]
  728.   end
  729.   
  730.   #--------------------------------------------------------------------------
  731.   # process_pageup
  732.   #--------------------------------------------------------------------------
  733.   def process_pageup
  734.     allow = true
  735.     allow = false if !prev_actor.nil? && prev_actor.locked
  736.     allow = false if !cur_actor.nil? && cur_actor.locked
  737.     Sound.play_buzzer unless allow
  738.     if allow
  739.       super
  740.       activate
  741.       select(index == 0 ? @data.size - 1 : index - 1)
  742.     end
  743.   end
  744.   
  745.   #--------------------------------------------------------------------------
  746.   # process_pagedown
  747.   #--------------------------------------------------------------------------
  748.   def process_pagedown
  749.     allow = true
  750.     allow = false if !next_actor.nil? && next_actor.locked
  751.     allow = false if !cur_actor.nil? && cur_actor.locked
  752.     Sound.play_buzzer unless allow
  753.     if allow
  754.       super
  755.       activate
  756.       select(index == @data.size - 1 ? 0 : index + 1)
  757.     end
  758.   end
  759.   
  760.   #--------------------------------------------------------------------------
  761.   # item
  762.   #--------------------------------------------------------------------------
  763.   def item; return @data[index]; end
  764.   
  765. end # Window_PartySelect

  766. #==============================================================================
  767. # ■ Window_PartyList
  768. #==============================================================================

  769. class Window_PartyList < Window_Selectable
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # initialize
  773.   #-------------------------------------------------------------------------
  774.   def initialize(party_window)
  775.     super(0, fitting_height(4), window_width, window_height)
  776.     @party_window = party_window
  777.     select(1)
  778.     deactivate
  779.     refresh
  780.   end
  781.   
  782.   #--------------------------------------------------------------------------
  783.   # window_width
  784.   #--------------------------------------------------------------------------
  785.   def window_width; return 200; end
  786.   
  787.   #--------------------------------------------------------------------------
  788.   # window_height
  789.   #--------------------------------------------------------------------------
  790.   def window_height; return Graphics.height - fitting_height(4); end
  791.   
  792.   #--------------------------------------------------------------------------
  793.   # item_max
  794.   #--------------------------------------------------------------------------
  795.   def item_max; return @data ? @data.size : 1; end
  796.   
  797.   #--------------------------------------------------------------------------
  798.   # refresh
  799.   #--------------------------------------------------------------------------
  800.   def refresh
  801.     make_item_list
  802.     create_contents
  803.     draw_all_items
  804.   end
  805.   
  806.   #--------------------------------------------------------------------------
  807.   # make_item_list
  808.   #--------------------------------------------------------------------------
  809.   def make_item_list
  810.     @data = [0]
  811.     for member in $game_party.all_members
  812.       next if member.nil?
  813.       @data.push(member.id)
  814.     end
  815.     @data.push(0)
  816.   end
  817.   
  818.   #--------------------------------------------------------------------------
  819.   # draw_item
  820.   #--------------------------------------------------------------------------
  821.   def draw_item(index)
  822.     clear_item(index)
  823.     rect = item_rect(index)
  824.     if @data[index] == 0
  825.       draw_remove(rect)
  826.       return
  827.     end
  828.     actor = $game_actors[@data[index]]
  829.     draw_actor(actor, rect)
  830.     draw_actor_locked(actor, rect)
  831.     draw_actor_required(actor, rect)
  832.   end
  833.   
  834.   #--------------------------------------------------------------------------
  835.   # draw_remove
  836.   #--------------------------------------------------------------------------
  837.   def draw_remove(rect)
  838.     reset_font_settings
  839.     draw_icon(Icon.remove_party, rect.x+4, rect.y)
  840.     text = YEA::PARTY::REMOVE_TEXT
  841.    draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  842.   end
  843.   
  844.   #--------------------------------------------------------------------------
  845.   # draw_actor
  846.   #--------------------------------------------------------------------------
  847.   def draw_actor(actor, rect)
  848.     buffer = YEA::PARTY::ACTOR_Y_BUFFER
  849.     draw_actor_graphic(actor, rect.x + 16, rect.y + rect.height + buffer)
  850.     text = actor.name
  851.     change_color(list_colour(actor), enabled?(actor))
  852.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  853.   end
  854.   
  855.   #--------------------------------------------------------------------------
  856.   # list_colour
  857.   #--------------------------------------------------------------------------
  858.   def list_colour(actor)
  859.     return text_color(YEA::PARTY::IN_PARTY_COLOUR) if in_party?(actor)
  860.     return normal_color
  861.   end
  862.   
  863.   #--------------------------------------------------------------------------
  864.   # draw_actor_locked
  865.   #--------------------------------------------------------------------------
  866.   def draw_actor_locked(actor, rect)
  867.     return unless actor.locked
  868.     draw_icon(Icon.locked_party, rect.width-24, rect.y)
  869.   end
  870.   
  871.   #--------------------------------------------------------------------------
  872.   # draw_actor_required
  873.   #--------------------------------------------------------------------------
  874.   def draw_actor_required(actor, rect)
  875.     return if actor.locked
  876.     return unless actor.required
  877.     draw_icon(Icon.required_party, rect.width-24, rect.y)
  878.   end
  879.   
  880.   #--------------------------------------------------------------------------
  881.   # enabled?
  882.   #--------------------------------------------------------------------------
  883.   def enabled?(actor)
  884.     return false if actor.locked
  885.     return false if actor.required && in_party?(actor)
  886.     return actor.exist?
  887.   end
  888.   
  889.   #--------------------------------------------------------------------------
  890.   # in_party?
  891.   #--------------------------------------------------------------------------
  892.   def in_party?(actor); return $game_party.battle_members.include?(actor); end
  893.   
  894.   #--------------------------------------------------------------------------
  895.   # current_item_enabled?
  896.   #--------------------------------------------------------------------------
  897.   def current_item_enabled?
  898.     actor = $game_actors[item]
  899.     replace = $game_actors[@party_window.item]
  900.     unless actor.nil?
  901.       return false if actor.locked && in_party?(actor)
  902.       return false if actor.required && in_party?(actor)
  903.     end
  904.     return true if replace.nil?
  905.     return false if replace.locked
  906.     return false if replace.required
  907.     return true if actor.nil?
  908.     return actor.exist?
  909.   end
  910.   
  911.   #--------------------------------------------------------------------------
  912.   # item
  913.   #--------------------------------------------------------------------------
  914.   def item; return @data[index]; end
  915.   
  916. end # Window_PartyList

  917. #==============================================================================
  918. # ** Window_PartyStatus
  919. #==============================================================================

  920. class Window_PartyStatus < Window_Base
  921.   
  922.   #--------------------------------------------------------------------------
  923.   # initialize
  924.   #--------------------------------------------------------------------------
  925.   def initialize(party_window, list_window)
  926.     super(200, fitting_height(4), window_width, window_height)
  927.     @party_window = party_window
  928.     @list_window = list_window
  929.     [url=home.php?mod=space&uid=95897]@actor[/url] = active_actor
  930.     refresh
  931.   end
  932.   
  933.   #--------------------------------------------------------------------------
  934.   # window_width
  935.   #--------------------------------------------------------------------------
  936.   def window_width; Graphics.width - 275; end#200; end
  937.   
  938.   #--------------------------------------------------------------------------
  939.   # window_height
  940.   #--------------------------------------------------------------------------
  941.   def window_height; Graphics.height - fitting_height(4) - 75; end
  942.   
  943.   #--------------------------------------------------------------------------
  944.   # update
  945.   #--------------------------------------------------------------------------
  946.   def update
  947.     super
  948.     refresh if @actor != active_actor
  949.   end
  950.   
  951.   #--------------------------------------------------------------------------
  952.   # active_actor
  953.   #--------------------------------------------------------------------------
  954.   def active_actor
  955.     if @list_window.active
  956.       actor = @list_window.item
  957.     else
  958.       actor = @party_window.item
  959.     end
  960.     return nil if [0, nil].include?(actor)
  961.     return actor
  962.   end
  963.   
  964.   #--------------------------------------------------------------------------
  965.   # refresh●人物信息
  966.   #--------------------------------------------------------------------------
  967.   def refresh
  968.     contents.clear
  969.     @actor = active_actor
  970.     reset_font_settings
  971.     if @actor.nil?
  972.       draw_nil_actor
  973.       return
  974.     end
  975.     actor = $game_actors[@actor]
  976.     draw_actor_HalfBody(actor, 0, 20)
  977.     draw_actor_name(actor, 15, 257)
  978.     draw_actor_class(actor, 158-30, 20, contents.width-232)
  979.     draw_actor_level(actor, 158, line_height+20)
  980.     draw_actor_icons(actor, 258, line_height+20, contents.width-232)
  981.     draw_actor_hp(actor, 158-30, line_height*2+20, contents.width-170)
  982.     draw_actor_mp(actor, 158-30, line_height*3+20, contents.width-170)
  983.     draw_actor_tp(actor, 158-30, line_height*4+20, contents.width-170)
  984.     draw_actor_parameters(actor, 158, line_height*5 + line_height/2+20)
  985.     draw_equipments(actor, contents.width/2+60, line_height*5 + line_height/2+20)
  986.   end
  987.   
  988.   #--------------------------------------------------------------------------
  989.   # draw_nil_actor
  990.   #--------------------------------------------------------------------------
  991.   def draw_nil_actor
  992.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  993.     rect = Rect.new(0, 0, contents.width, contents.height)
  994.     contents.fill_rect(rect, colour)
  995.     change_color(system_color)
  996.     text = YEA::PARTY::NO_DATA
  997.     draw_text(rect, text, 1)
  998.   end
  999.   
  1000.   #--------------------------------------------------------------------------
  1001.   # draw_actor_parameters
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_actor_parameters(actor, dx, dy)
  1004.     dw = contents.width/2 - 100
  1005.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1006.     contents.font.size = YEA::PARTY::STAT_FONT_SIZE
  1007.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1008.     array = [:atk, :def, :mat, :mdf, :agi, :luk]
  1009.     cx = 4
  1010.     for stat in array
  1011.       case stat
  1012.       when :atk
  1013.         param = Vocab::param(2)
  1014.         value = actor.atk.group
  1015.       when :def
  1016.         param = Vocab::param(3)
  1017.         value = actor.def.group
  1018.       when :mat
  1019.         param = Vocab::param(4)
  1020.         value = actor.mat.group
  1021.       when :mdf
  1022.         param = Vocab::param(5)
  1023.         value = actor.mdf.group
  1024.       when :agi
  1025.         param = Vocab::param(6)
  1026.         value = actor.agi.group
  1027.       when :luk
  1028.         param = Vocab::param(7)
  1029.         value = actor.luk.group
  1030.       else; next
  1031.       end
  1032.       contents.fill_rect(rect, colour)
  1033.       change_color(system_color)
  1034.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, param, 0)
  1035.       change_color(normal_color)
  1036.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, value, 2)
  1037.       rect.y += line_height
  1038.     end
  1039.     reset_font_settings
  1040.   end
  1041.   
  1042.   #--------------------------------------------------------------------------
  1043.   # draw_equipments
  1044.   #--------------------------------------------------------------------------
  1045.   def draw_equipments(actor, dx, dy)
  1046.     text = YEA::PARTY::EQUIP_TEXT
  1047.     change_color(system_color)
  1048.     draw_text(dx, dy, contents.width - dx, line_height, text, 1)
  1049.     dy += line_height
  1050.     if actor.equips.size <= 5
  1051.       actor.equips.each_with_index do |item, i|
  1052.         draw_item_name(item, dx, dy + line_height * i)
  1053.       end
  1054.     else
  1055.       orig_x = dx
  1056.       actor.equips.each_with_index do |item, i|
  1057.         next if item.nil?
  1058.         draw_icon(item.icon_index, dx, dy)
  1059.         dy += line_height if dx + 48 > contents.width
  1060.         dx = dx + 48 > contents.width ? orig_x : dx + 24
  1061.       end
  1062.     end
  1063.   end
  1064.   
  1065. end # Window_PartyStatus

  1066. #==============================================================================
  1067. # ■ Scene_Menu
  1068. #==============================================================================

  1069. class Scene_Menu < Scene_MenuBase
  1070.   
  1071.   #--------------------------------------------------------------------------
  1072.   # overwrite method: command_formation
  1073.   #--------------------------------------------------------------------------
  1074.   if YEA::PARTY::ENABLE_MENU
  1075.   def command_formation
  1076.     SceneManager.call(Scene_Party)
  1077.   end
  1078.   end # YEA::PARTY::ENABLE_MENU
  1079.   
  1080. end # Scene_Menu

  1081. #==============================================================================
  1082. # ■ Scene_Party
  1083. #==============================================================================

  1084. class Scene_Party < Scene_MenuBase
  1085.   
  1086.   #--------------------------------------------------------------------------
  1087.   # start
  1088.   #--------------------------------------------------------------------------
  1089.   def start
  1090.     super
  1091.     @former_party = $game_party.battle_members_array.clone
  1092.     create_command_window
  1093.     create_party_window
  1094.     create_list_window
  1095.     create_status_window
  1096.   end
  1097.   
  1098.   #--------------------------------------------------------------------------
  1099.   # ● 生成背景
  1100.   #--------------------------------------------------------------------------
  1101.   def create_background
  1102.     @background_sprite = Sprite.new
  1103.     @background_sprite.bitmap =Cache.load_bitmap("Graphics/System/","WallpaperRANK")
  1104.     @background_sprite.color.set(0,0, 0,0)
  1105.   end
  1106.   #--------------------------------------------------------------------------
  1107.   # create_command_window
  1108.   #--------------------------------------------------------------------------
  1109.   def create_command_window
  1110.     @command_window = Window_PartyMenuCommand.new(0, 0)
  1111.     @command_window.set_handler(:change, method(:adjust_members))
  1112.     @command_window.set_handler(:remove, method(:adjust_members))
  1113.     @command_window.set_handler(:revert, method(:revert_party))
  1114.     @command_window.set_handler(:finish, method(:return_scene))
  1115.     @command_window.set_handler(:cancel, method(:return_scene))
  1116.     @command_window.opacity = 0
  1117.   end
  1118.   
  1119.   #--------------------------------------------------------------------------
  1120.   # create_party_window
  1121.   #--------------------------------------------------------------------------
  1122.   def create_party_window
  1123.     @party_window = Window_PartySelect.new(@command_window)
  1124.     @party_window.set_handler(:ok,       method(:on_party_ok))
  1125.     @party_window.set_handler(:cancel,   method(:on_party_cancel))
  1126.     @party_window.set_handler(:pageup,   method(:on_party_pageup))
  1127.     @party_window.set_handler(:pagedown, method(:on_party_pagedown))
  1128.     @party_window.opacity = 0
  1129.   end
  1130.   
  1131.   #--------------------------------------------------------------------------
  1132.   # create_list_window
  1133.   #--------------------------------------------------------------------------
  1134.   def create_list_window
  1135.     @list_window = Window_PartyList.new(@party_window)
  1136.     @list_window.set_handler(:ok,     method(:on_list_ok))
  1137.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  1138.     @list_window.opacity = 0
  1139.   end
  1140.   
  1141.   #--------------------------------------------------------------------------
  1142.   # create_status_window
  1143.   #--------------------------------------------------------------------------
  1144.   def create_status_window
  1145.     @status_window = Window_PartyStatus.new(@party_window, @list_window)
  1146.     @status_window.opacity = 0
  1147.   end
  1148.   
  1149.   #--------------------------------------------------------------------------
  1150.   # adjust_members
  1151.   #--------------------------------------------------------------------------
  1152.   def adjust_members
  1153.     @party_window.activate
  1154.   end
  1155.   
  1156.   #--------------------------------------------------------------------------
  1157.   # window_refresh
  1158.   #--------------------------------------------------------------------------
  1159.   def window_refresh
  1160.     $game_party.rearrange_actors
  1161.     @command_window.refresh
  1162.     @party_window.refresh
  1163.     @list_window.refresh
  1164.     $game_player.refresh
  1165.     $game_map.need_refresh = true
  1166.   end
  1167.   
  1168.   #--------------------------------------------------------------------------
  1169.   # revert_party
  1170.   #--------------------------------------------------------------------------
  1171.   def revert_party
  1172.     @command_window.activate
  1173.     $game_party.battle_members_array = @former_party.clone
  1174.     window_refresh
  1175.   end
  1176.   
  1177.   #--------------------------------------------------------------------------
  1178.   # on_party_ok
  1179.   #--------------------------------------------------------------------------
  1180.   def on_party_ok
  1181.     case @command_window.current_symbol
  1182.     when :change
  1183.       @list_window.activate
  1184.     when :remove
  1185.       index = @party_window.index
  1186.       actor = $game_actors[$game_party.battle_members_array[index]]
  1187.       Sound.play_equip
  1188.       $game_party.battle_members_array[index] = 0
  1189.       window_refresh
  1190.       @party_window.activate
  1191.     end
  1192.   end
  1193.   
  1194.   #--------------------------------------------------------------------------
  1195.   # on_party_cancel
  1196.   #--------------------------------------------------------------------------
  1197.   def on_party_cancel
  1198.     @command_window.activate
  1199.   end
  1200.   
  1201.   #--------------------------------------------------------------------------
  1202.   # on_party_pageup
  1203.   #--------------------------------------------------------------------------
  1204.   def on_party_pageup
  1205.     Sound.play_equip
  1206.     actor_id1 = @party_window.item
  1207.     actor_id2 = @party_window.prev_actor.nil? ? 0 : @party_window.prev_actor.id
  1208.     max = @party_window.item_max-1
  1209.     index1 = @party_window.index
  1210.     index2 = @party_window.index == 0 ? max : index1-1
  1211.     $game_party.battle_members_array[index1] = actor_id2
  1212.     $game_party.battle_members_array[index2] = actor_id1
  1213.     window_refresh
  1214.   end
  1215.   
  1216.   #--------------------------------------------------------------------------
  1217.   # on_party_pagedown
  1218.   #--------------------------------------------------------------------------
  1219.   def on_party_pagedown
  1220.     Sound.play_equip
  1221.     actor_id1 = @party_window.item
  1222.     actor_id2 = @party_window.next_actor.nil? ? 0 : @party_window.next_actor.id
  1223.     max = @party_window.item_max-1
  1224.     index1 = @party_window.index
  1225.     index2 = @party_window.index == max ? 0 : index1+1
  1226.     $game_party.battle_members_array[index1] = actor_id2
  1227.     $game_party.battle_members_array[index2] = actor_id1
  1228.     window_refresh
  1229.   end
  1230.   
  1231.   #--------------------------------------------------------------------------
  1232.   # on_list_cancel
  1233.   #--------------------------------------------------------------------------
  1234.   def on_list_cancel
  1235.     @party_window.activate
  1236.   end
  1237.   
  1238.   #--------------------------------------------------------------------------
  1239.   # on_list_ok
  1240.   #--------------------------------------------------------------------------
  1241.   def on_list_ok
  1242.     Sound.play_equip
  1243.     replace = $game_actors[@party_window.item]
  1244.     actor = $game_actors[@list_window.item]
  1245.     index1 = @party_window.index
  1246.     actor_id1 = actor.nil? ? 0 : actor.id
  1247.     if actor.nil?
  1248.       $game_party.battle_members_array[index1] = 0
  1249.       window_refresh
  1250.       @party_window.activate
  1251.       return
  1252.     end
  1253.     actor_id2 = replace.nil? ? 0 : replace.id
  1254.     if $game_party.battle_members_array.include?(actor_id1)
  1255.       index2 = $game_party.battle_members_array.index(actor_id1)
  1256.       $game_party.battle_members_array[index2] = actor_id2
  1257.     end
  1258.     $game_party.battle_members_array[index1] = actor_id1
  1259.     window_refresh
  1260.     @party_window.activate
  1261.   end
  1262.   
  1263. end # Scene_Party

  1264. #==============================================================================
  1265. #
  1266. # ▼ End of File
  1267. #
  1268. #==============================================================================
复制代码

点评

第956行改为 @actor = active_actor  发表于 2013-12-7 00:14
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 06:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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