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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: brackwind
打印 上一主题 下一主题

[已经过期] 請問這些功能該怎麼做

 关闭 [复制链接]

Lv6.析梦学徒

老鹰

梦石
40
星屑
34725
在线时间
6740 小时
注册时间
2012-5-26
帖子
3259

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

11
发表于 2012-10-6 12:14:15 | 只看该作者
多人战斗脚本。。。
及战斗中换人脚本
  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   = 4      # 最大参战人员. Default: 4
  87.     SPLIT_EXP            = false  # 平分经验?Splits EXP with more members in the party.
  88.     RESERVE_EXP_RATE     = 0.90   # 休息人员的经验获得率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 = 45  #设置游戏中改变最大参战人员的变量
  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  = 20    # Font size used for party member names.
  117.     LOCK_FIRST_ACTOR = false # 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 = "-空-"   # 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      = 185          # Icon used for removing members.
  126.     REMOVE_TEXT      = "-移除-"   # Text used for remove member command.
  127.     ACTOR_Y_BUFFER   = 12           # 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         = "- 无 -" # Text used for when no actor is shown.
  132.     IN_PARTY_COLOUR = 6             # Text colour used for in party members.
  133.     STAT_FONT_SIZE  = 20            # Font size used for stats.
  134.     EQUIP_TEXT      = "装备"   # 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 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(160, 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 - 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.   # draw_item
  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/2)
  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.     @actor = active_actor
  930.     refresh
  931.   end
  932.   
  933.   #--------------------------------------------------------------------------
  934.   # window_width
  935.   #--------------------------------------------------------------------------
  936.   def window_width; Graphics.width - 200; end
  937.   
  938.   #--------------------------------------------------------------------------
  939.   # window_height
  940.   #--------------------------------------------------------------------------
  941.   def window_height; Graphics.height - fitting_height(4); 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_face(actor, 0, 0)
  977.     draw_actor_name(actor, 108, 0)
  978.     draw_actor_class(actor, 228, 0, contents.width-232)
  979.     draw_actor_level(actor, 108, line_height)
  980.     draw_actor_icons(actor, 228, line_height, contents.width-232)
  981.     draw_actor_hp(actor, 108, line_height*2, contents.width-112)
  982.     draw_actor_mp(actor, 108, line_height*3, contents.width-112)
  983.     draw_actor_parameters(actor, 0, line_height*4 + line_height/2)
  984.     draw_equipments(actor, contents.width/2, line_height*4 + line_height/2)
  985.   end
  986.   
  987.   #--------------------------------------------------------------------------
  988.   # draw_nil_actor
  989.   #--------------------------------------------------------------------------
  990.   def draw_nil_actor
  991.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  992.     rect = Rect.new(0, 0, contents.width, contents.height)
  993.     contents.fill_rect(rect, colour)
  994.     change_color(system_color)
  995.     text = YEA::PARTY::NO_DATA
  996.     draw_text(rect, text, 1)
  997.   end
  998.   
  999.   #--------------------------------------------------------------------------
  1000.   # draw_actor_parameters
  1001.   #--------------------------------------------------------------------------
  1002.   def draw_actor_parameters(actor, dx, dy)
  1003.     dw = contents.width/2 - 4
  1004.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1005.     contents.font.size = YEA::PARTY::STAT_FONT_SIZE
  1006.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1007.     array = [:atk, :def, :mat, :mdf, :agi, :luk]
  1008.     cx = 4
  1009.     for stat in array
  1010.       case stat
  1011.       when :atk
  1012.         param = Vocab::param(2)
  1013.         value = actor.atk.group
  1014.       when :def
  1015.         param = Vocab::param(3)
  1016.         value = actor.def.group
  1017.       when :mat
  1018.         param = Vocab::param(4)
  1019.         value = actor.mat.group
  1020.       when :mdf
  1021.         param = Vocab::param(5)
  1022.         value = actor.mdf.group
  1023.       when :agi
  1024.         param = Vocab::param(6)
  1025.         value = actor.agi.group
  1026.       when :luk
  1027.         param = Vocab::param(7)
  1028.         value = actor.luk.group
  1029.       else; next
  1030.       end
  1031.       contents.fill_rect(rect, colour)
  1032.       change_color(system_color)
  1033.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, param, 0)
  1034.       change_color(normal_color)
  1035.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, value, 2)
  1036.       rect.y += line_height
  1037.     end
  1038.     reset_font_settings
  1039.   end
  1040.   
  1041.   #--------------------------------------------------------------------------
  1042.   # draw_equipments
  1043.   #--------------------------------------------------------------------------
  1044.   def draw_equipments(actor, dx, dy)
  1045.     text = YEA::PARTY::EQUIP_TEXT
  1046.     change_color(system_color)
  1047.     draw_text(dx, dy, contents.width - dx, line_height, text, 1)
  1048.     dy += line_height
  1049.     if actor.equips.size <= 5
  1050.       actor.equips.each_with_index do |item, i|
  1051.         draw_item_name(item, dx, dy + line_height * i)
  1052.       end
  1053.     else
  1054.       orig_x = dx
  1055.       actor.equips.each_with_index do |item, i|
  1056.         next if item.nil?
  1057.         draw_icon(item.icon_index, dx, dy)
  1058.         dy += line_height if dx + 48 > contents.width
  1059.         dx = dx + 48 > contents.width ? orig_x : dx + 24
  1060.       end
  1061.     end
  1062.   end
  1063.   
  1064. end # Window_PartyStatus

  1065. #==============================================================================
  1066. # ■ Scene_Menu
  1067. #==============================================================================

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

  1080. #==============================================================================
  1081. # ■ Scene_Party
  1082. #==============================================================================

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

  1251. #==============================================================================
  1252. #
  1253. # ▼ End of File
  1254. #
  1255. #==============================================================================
复制代码
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Party System Add-On: Command Party v1.01
  4. # -- Last Updated: 2012.01.10
  5. # -- Level: Easy, Normal
  6. # -- Requires: YEA - Party System v1.00+
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-CommandParty"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.10 - Compatibility Update: Ace Battle Engine v1.15+
  15. # 2011.12.13 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # An add-on to the Yanfly Engine Ace - Party System script. This script allows
  21. # the player to change party members during the middle of battle from the
  22. # Party Command Window (the Fight/Escape window).
  23. # 允许战斗中更换队员
  24. #==============================================================================
  25. # ▼ Instructions
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # To install this script, open up your script editor and copy/paste this script
  28. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  29. #
  30. # Note, if you do not give your player access to the party formation menu
  31. # available in the Party System script, this script will disable itself.
  32. #
  33. #==============================================================================
  34. # ▼ Compatibility
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  37. # it will run with RPG Maker VX without adjusting.
  38. #
  39. # This script requires Yanfly Engine Ace - Party System v1.00+.
  40. #
  41. #==============================================================================

  42. module YEA
  43.   module COMMAND_PARTY
  44.    
  45.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  46.     # - Command Party Settings -
  47.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  48.     # This is just how the text appears visually in battle for your party and
  49.     # how often the can change party in battle. Furthermore, there's two
  50.     # switches that may be enabled or disabled to add the command to the
  51.     # game. Adjust it as you see fit. Set the switches to 0 to not use them.
  52.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  53.     COMMAND_TEXT   = "队列"    # Text used for the command.
  54.     PARTY_COOLDOWN = 1          # Turns that must pass between each change.
  55.     SHOW_SWITCH    = 0          # If switch is on, show command. 0 to disable.
  56.     ENABLE_SWITCH  = 0          # If switch is on, enable command. 0 to disable.
  57.    
  58.   end # COMMAND_PARTY
  59. end # YEA

  60. #==============================================================================
  61. # ▼ Editting anything past this point may potentially result in causing
  62. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  63. # halitosis so edit at your own risk.
  64. #==============================================================================

  65. if $imported["YEA-PartySystem"]

  66. #==============================================================================
  67. # ■ SceneManager
  68. #==============================================================================

  69. module SceneManager
  70.   
  71.   #--------------------------------------------------------------------------
  72.   # new method: self.force_recall
  73.   #--------------------------------------------------------------------------
  74.   def self.force_recall(scene_class)
  75.     @scene = scene_class
  76.   end
  77.   
  78. end # SceneManager

  79. #==============================================================================
  80. # ■ Game_Unit
  81. #==============================================================================

  82. class Game_Unit
  83.   
  84.   #--------------------------------------------------------------------------
  85.   # alias method: on_battle_start
  86.   #--------------------------------------------------------------------------
  87.   alias game_unit_on_battle_start_cpt on_battle_start
  88.   def on_battle_start
  89.     game_unit_on_battle_start_cpt
  90.     reset_party_cooldown
  91.   end
  92.   
  93.   #--------------------------------------------------------------------------
  94.   # new method: reset_party_cooldown
  95.   #--------------------------------------------------------------------------
  96.   def reset_party_cooldown
  97.     @party_cooldown = 0
  98.   end
  99.   
  100.   #--------------------------------------------------------------------------
  101.   # new method: update_party_cooldown
  102.   #--------------------------------------------------------------------------
  103.   def update_party_cooldown
  104.     reset_party_cooldown if @party_cooldown.nil?
  105.     @party_cooldown = [@party_cooldown - 1, 0].max
  106.   end
  107.   
  108.   #--------------------------------------------------------------------------
  109.   # new method: battle_party_change?
  110.   #--------------------------------------------------------------------------
  111.   def battle_party_change?
  112.     switch = YEA::COMMAND_PARTY::ENABLE_SWITCH
  113.     enabled = switch <= 0 ? true : $game_switches[switch]
  114.     return false unless enabled
  115.     reset_party_cooldown if @party_cooldown.nil?
  116.     return @party_cooldown <= 0
  117.   end
  118.   
  119.   #--------------------------------------------------------------------------
  120.   # new method: set_party_cooldown
  121.   #--------------------------------------------------------------------------
  122.   def set_party_cooldown
  123.     @party_cooldown = YEA::COMMAND_PARTY::PARTY_COOLDOWN
  124.   end
  125.   
  126.   #--------------------------------------------------------------------------
  127.   # alias method: on_battle_end
  128.   #--------------------------------------------------------------------------
  129.   alias game_unit_on_battle_end_cpt on_battle_end
  130.   def on_battle_end
  131.     game_unit_on_battle_end_cpt
  132.     reset_party_cooldown
  133.   end
  134.   
  135. end # Game_Unit

  136. #==============================================================================
  137. # ■ Window_PartyCommand
  138. #==============================================================================

  139. class Window_PartyCommand < Window_Command
  140.   
  141.   #--------------------------------------------------------------------------
  142.   # alias method: make_command_list
  143.   #--------------------------------------------------------------------------
  144.   alias window_partycommand_make_command_list_cpt make_command_list
  145.   def make_command_list
  146.     window_partycommand_make_command_list_cpt
  147.     return if $imported["YEA-BattleCommandList"]
  148.     add_party_command
  149.   end
  150.   
  151.   #--------------------------------------------------------------------------
  152.   # new method: add_party_command
  153.   #--------------------------------------------------------------------------
  154.   def add_party_command
  155.     return unless YEA::PARTY::ENABLE_MENU
  156.     show = YEA::COMMAND_PARTY::SHOW_SWITCH
  157.     continue = show == 0 ? true : $game_switches[show]
  158.     continue = false if $game_party.all_members.size < 2
  159.     return unless continue
  160.     text = YEA::COMMAND_PARTY::COMMAND_TEXT
  161.     add_command(text, :party, $game_party.battle_party_change?)
  162.   end
  163.   
  164. end # Window_PartyCommand

  165. #==============================================================================
  166. # ■ Scene_Battle
  167. #==============================================================================

  168. class Scene_Battle < Scene_Base
  169.   
  170.   #--------------------------------------------------------------------------
  171.   # alias method: create_party_command_window
  172.   #--------------------------------------------------------------------------
  173.   alias create_party_command_window_cpt create_party_command_window
  174.   def create_party_command_window
  175.     create_party_command_window_cpt
  176.     @party_command_window.set_handler(:party, method(:command_party))
  177.   end
  178.   
  179.   #--------------------------------------------------------------------------
  180.   # new method: command_party
  181.   #--------------------------------------------------------------------------
  182.   def command_party
  183.     Graphics.freeze
  184.     @info_viewport.visible = false
  185.     hide_extra_gauges if $imported["YEA-BattleEngine"]
  186.     SceneManager.snapshot_for_background
  187.     previous_party = $game_party.battle_members.clone
  188.     index = @party_command_window.index
  189.     oy = @party_command_window.oy
  190.     #---
  191.     SceneManager.call(Scene_Party)
  192.     SceneManager.scene.main
  193.     SceneManager.force_recall(self)
  194.     #---
  195.     show_extra_gauges if $imported["YEA-BattleEngine"]
  196.     if previous_party != $game_party.battle_members
  197.       $game_party.make_actions
  198.       $game_party.set_party_cooldown
  199.     end
  200.     @info_viewport.visible = true
  201.     @status_window.refresh
  202.     @party_command_window.setup
  203.     @party_command_window.select(index)
  204.     @party_command_window.oy = oy
  205.     perform_transition
  206.   end
  207.   
  208.   #--------------------------------------------------------------------------
  209.   # alias method: turn_end
  210.   #--------------------------------------------------------------------------
  211.   alias scene_battle_turn_end_cpt turn_end
  212.   def turn_end
  213.     scene_battle_turn_end_cpt
  214.     return if $imported["YEA-BattleEngine"]
  215.     update_party_cooldowns
  216.   end
  217.   
  218.   #--------------------------------------------------------------------------
  219.   # new method: update_party_cooldowns
  220.   #--------------------------------------------------------------------------
  221.   def update_party_cooldowns
  222.     $game_party.update_party_cooldown
  223.     $game_troop.update_party_cooldown
  224.   end
  225.   
  226. end # Scene_Battle
  227. end # $imported["YEA-PartySystem"]

  228. #==============================================================================
  229. #
  230. # ▼ End of File
  231. #
  232. #==============================================================================
复制代码
于是无耻求糖……

点评

[url=home.php?mod=space&username=百里_飞柳]@百里_飞柳[/url]  发表于 2012-10-24 19:20
請問在戰鬥中怎麼更換夥伴?  发表于 2012-10-24 19:20
这就是va的 不过能不能用于横版就不知道了。。你可以新开工程一试。  发表于 2012-10-24 12:42
[url=home.php?mod=space&username=百里_飞柳]@百里_飞柳[/url]  发表于 2012-10-24 07:09
請問這腳本能用在VA版本,而且是橫板戰鬥上嗎?  发表于 2012-10-24 07:09
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
116 小时
注册时间
2012-10-4
帖子
193
12
 楼主| 发表于 2012-10-24 20:32:07 | 只看该作者
百里_飞柳 发表于 2012-10-6 12:14
多人战斗脚本。。。
及战斗中换人脚本于是无耻求糖……

我用你的戰鬥中更換隊員腳本進入橫板戰鬥沒問題
不過使用多人戰鬥設為6人時,進入戰鬥發生BUG
是橫板腳本222行發生問題"can't dup NilClass"

以下是橫板腳本

#==============================================================================
# ■ Sideview
#------------------------------------------------------------------------------
#  サイドビューバトラーを管理するクラスです。
#==============================================================================
class SideView
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数 
  #--------------------------------------------------------------------------
  attr_accessor   :x                    # 画面X座標
  attr_accessor   :y                    # 画面Y座標
  attr_accessor   :z                    # 画面Z座標
  attr_accessor   :h                    # 高さ座標
  attr_accessor   :j                    # ジャンプ座標
  attr_accessor   :c                    # カーブ座標
  attr_accessor   :ox                   # 横原点
  attr_accessor   :oy                   # 縦原点
  attr_accessor   :oy_adjust            # 縦原点補正
  attr_accessor   :angle                # 回転角度
  attr_accessor   :zoom_x               # 横の拡大率
  attr_accessor   :zoom_y               # 縦の拡大率
  attr_accessor   :pattern_w            # セル横位置(矩形内)
  attr_accessor   :pattern_h            # セル縦位置(矩形内)
  attr_accessor   :sx                   # セル横位置(画像全体)
  attr_accessor   :sy                   # セル縦位置(画像全体)
  attr_accessor   :pattern_type         # セル更新タイプ
  attr_accessor   :pattern_time         # セル更新間隔
  attr_accessor   :graphic_name         # バトラー画像ファイル名
  attr_accessor   :graphic_file_index   # バトラー画像ファイル名インデックス
  attr_accessor   :graphic_index        # バトラー画像インデックス
  attr_accessor   :cw                   # セル横矩形
  attr_accessor   :ch                   # セル縦矩形
  attr_accessor   :shadow_visible       # 影表示
  attr_accessor   :weapon_visible       # 武器表示
  
  attr_accessor   :wait                 # 次の動作待ち時間
  attr_accessor   :weapon_index         # 表示中の武器画像インデックス配列
  attr_accessor   :weapon_end           # 武器アニメ終了フラグ
  attr_accessor   :force_action         # 強制アクション
  attr_accessor   :target_battler       # ターゲットバトラー情報
  attr_accessor   :second_targets       # セカンドターゲット情報
  attr_accessor   :m_a_targets          # アニメ飛ばしターゲット情報
  attr_accessor   :individual_targets   # 個別処理ターゲットバトラー情報
  attr_accessor   :effect_data          # エフェクトデータ
  attr_accessor   :anime_id             # アニメID配列
  attr_accessor   :anime_move_id        # 飛ばしアニメID配列
  attr_accessor   :mirror               # 反転フラグ
  attr_accessor   :opacity              # 透明度
  attr_accessor   :opacity_data         # 透明度操作情報
  attr_accessor   :set_damage           # バトルシーンでのダメージ処理
  attr_accessor   :m_a_data             # アニメ飛ばし情報
  attr_accessor   :m_a_starter          # アニメ飛ばし開始ターゲット情報
  attr_accessor   :action_end           # バトルシーンでの行動終了
  attr_accessor   :damage_anime_data    # ダメージ戦闘アニメのデータ
  attr_accessor   :anime_no_mirror      # 戦闘アニメの反転禁止フラグ
  attr_accessor   :anime_horming        # 戦闘アニメのホーミングフラグ
  attr_accessor   :anime_camera_zoom    # 戦闘アニメがカメラに合わせて拡大縮小するか
  attr_accessor   :anime_plus_z         # 戦闘アニメZ座標補正
  attr_accessor   :derivation_skill_id  # スキル派生ID
  attr_accessor   :immortal             # 不死身フラグ
  attr_accessor   :mirage               # 残像データ
  attr_accessor   :balloon_data         # ふきだしデータ
  attr_accessor   :timing               # 別バトラーからのタイミングデータ
  attr_accessor   :timing_targets       # タイミングデータを渡す別バトラー
  attr_accessor   :color_set            # 色調変更データ
  attr_accessor   :color                # 色調データ
  attr_accessor   :change_up            # 画像変更フラグ
  attr_accessor   :hit                  # 被攻撃回数
  attr_accessor   :add_state            # 何度も付加ステートの表示を防ぐフラグ
  attr_accessor   :counter_id           # カウンター時のスキルID
  attr_accessor   :reflection_id        # 魔法反射時のアニメID
  attr_accessor   :result_damage        # ターン終了時のHP変動データ
  attr_accessor   :active               # 行動権
  attr_accessor   :anime_off            # 戦闘アニメ消去
  attr_accessor   :command_action       # コマンドアクションフラグ
   
  attr_accessor   :base_x               # 初期位置 X座標
  attr_accessor   :base_y               # 初期位置 Y座標
  attr_accessor   :base_h               # 初期位置 高さ座標
  attr_accessor   :max_pattern_w        # セルの横分割数
  attr_accessor   :max_pattern_h        # セルの縦分割数
  
  attr_reader     :collapse             # コラプスフラグ
  attr_reader     :picture              # ピクチャ表示フラグ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(battler)
    @battler = battler
    reset
  end
  #--------------------------------------------------------------------------
  # ● 初期化
  #--------------------------------------------------------------------------
  def reset
    @x = 0
    @y = 0
    @z = 0
    @h = 0
    @j = 0
    @c = 0
    @jump = []
    @curve = []
    @ox = 0
    @oy = 0
    @oy_adjust = 0
    @z_plus = 0
    @move_time = 0
    @angle = 0
    @angle_time = 0
    @zoom_x = 1
    @zoom_y = 1
    @zoom_time = 0
    @pattern_w = 0
    @pattern_h = 0
    @sx = 0
    @sy = 0
    @pattern_type = 0
    @pattern_time = 0
    @pattern_rest_time = 0
    @graphic_name = ""
    @graphic_file_index = ""
    @graphic_index = 0
    @cw = 0
    @ch = 0
    @shadow_visible = false
    @weapon_visible = true
   
    @wait = 0
    @weapon_index = []
    @weapon_end = true
    @full_action = []
    @action = []
    @force_action = ""
    @target_battler = []
    @second_targets = []
    @individual_targets = []
    @m_a_targets = []
    @effect_data = []
    @anime_id = []
    @anime_move_id = []
    @opacity = 255
    @opacity_data = []
    @set_damage = false
    @m_a_data = []
    @m_a_starter = []
    @action_end = false
    @damage_anime_data = []
    @anime_no_mirror = false
    @anime_horming = false
    @anime_camera_zoom = false
    @anime_plus_z = true
    @derivation_skill_id = 0
    @immortal = false
    @mirage = []
    @play_data = []
    @balloon_data = []
    @picture = false
    @timing = []
    @timing_targets = []
    @color_set = []
    @color = []
    @change_up = false
    @non_motion = false
    @graphics_change = false
    @hit = 0
    @add_state = []
    @collapse = false
    @counter_id = 0
    @reflection_id = 0
    @result_damage = [0,0]
    @active = false
    @anime_off = false
    @command_action = false
   
    @base_x = 0
    @base_y = 0
    @base_z = 0
    @base_h = 0
    @max_pattern_w = 0
    @max_pattern_h = 0
    @pattern_kind = 0
    @pattern_count = 0
    @move_time = 0
    @mirror = false
    @battler.set_graphic(@pre_change_data[0], @pre_change_data[1], @pre_change_data[2], @pre_change_data[3]) if @pre_change_data != nil
    @pre_change_data = nil
  end  
  #--------------------------------------------------------------------------
  # ● セットアップ
  #--------------------------------------------------------------------------
  def setup(bitmap_width, bitmap_height, first_action_flag)
    reset if first_action_flag
    set_data
    set_base_position if !@graphics_change
    set_graphics(bitmap_width, bitmap_height)
    set_target
    setup_graphics_change if @graphics_change
    first_battler_anime_set if first_action_flag
  end  
  #--------------------------------------------------------------------------
  # ● バトラーデータ取得
  #--------------------------------------------------------------------------
  def set_data
    return if @battler == nil
    if @battler.actor?
      @graphic_name = @battler.character_name
      @graphic_index = @battler.character_index
    else
      @graphic_name = @battler.battler_name
      @graphic_index = 0
    end
    @max_pattern_w = max_pattern[0]
    @max_pattern_h = max_pattern[1]
  end
  #--------------------------------------------------------------------------
  # ● ベース座標をセット data = [X軸, Y軸, H軸]  moment_set…瞬間配置
  #--------------------------------------------------------------------------
  def set_base_position(moment_set = true)
    mirroring_reset
    if @battler.actor?
      data = N03::ACTOR_POSITION[@battler.index].dup
      @base_x = data[0] * 100 if !@mirror
      @base_x = (Graphics.width - data[0]) * 100 if @mirror
    else
      data = [@battler.screen_x, @battler.screen_y, 0].dup
      @base_x = data[0] * 100 if !$sv_camera.mirror
      @base_x = (Graphics.width - data[0]) * 100 if $sv_camera.mirror
    end
    @base_y = data[1] * 100
    @base_h = data[2] * 100
    @base_z = @y
    return if !moment_set
    @x = @base_x
    @y = @base_y
    @z = @base_z
  end
  #--------------------------------------------------------------------------
  # ● グラフィックデータ取得
  #--------------------------------------------------------------------------
  def set_graphics(bitmap_width, bitmap_height)
    sign = @graphic_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap_width / @max_pattern_w
      @ch = bitmap_height / @max_pattern_h
    elsif @max_pattern_w == 1 && @max_pattern_h == 1
      @cw = bitmap_width
      @ch = bitmap_height
    else
      @cw = bitmap_width / (@max_pattern_w * 4)
      @ch = bitmap_height / (@max_pattern_h * 2)
    end
    @ox = @cw / 2
    @oy = @ch
    @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
    @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  end
  #--------------------------------------------------------------------------
  # ● ターゲットをセット
  #--------------------------------------------------------------------------
  def set_target(target = nil)
    @target_battler = target
    @target_battler = [@battler] if target == nil
    @second_targets = @target_battler
  end
  #--------------------------------------------------------------------------
  # ● 画像変更用のセットアップ
  #--------------------------------------------------------------------------
  def setup_graphics_change
    @graphics_change = false
    @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
    @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  end  
  #--------------------------------------------------------------------------
  # ● 戦闘開始時の待機アニメ画像データ取得
  #--------------------------------------------------------------------------
  def first_battler_anime_set
    loop do
      update
      break if @action_data[0] == "motion"
      break if @action_data[0] == "move" && @action_data[8] != ""
      break if @full_action == []
    end
    start_action(first_action) if @battler.movable?
  end
  #--------------------------------------------------------------------------
  # ● アクション開始
  #--------------------------------------------------------------------------
  def start_action(kind = nil)
    return if @event_fix && $game_troop.interpreter.running?
    # ウェイト中の場合キャンセル
    return @wait -= 1 if @wait > 0 && kind == nil
    action_setup if kind != nil
    set_action(kind)
    @action = kind if @action == nil
    # 行動配列が無い場合は行動終了処理へ移行
    action_terminate if @action == nil
    # 次のアクション決定
    @action_data = N03::ACTION[@action]
    next_action
  end
  #--------------------------------------------------------------------------
  # ● 行動パラメータの初期化
  #--------------------------------------------------------------------------
  def action_setup
    @event_fix = false
    @set_damage = false
    @action_end = false
    @balloon_data = []
    @loop_act = []
    angle_reset
    zoom_reset
    opacity_reset
    @curve = []
    @c = 0
    convert_jump
  end  
  #--------------------------------------------------------------------------
  # ● 行動終了処理
  #--------------------------------------------------------------------------
  def action_terminate
    @mirage = [] if @mirage_end
    mirroring_reset
    @picture = false
    @individual_targets = []
    action_setup
    # 待機アクションへ移行
    stand_by_action if !@non_motion
    # 戦闘行動のアクティブ権を終了
    next_battler
  end  
  #--------------------------------------------------------------------------
  # ● 新しいアクション内容の決定
  #--------------------------------------------------------------------------
  def set_action(kind = nil)
    full_act = N03::FULLACTION[kind]
    @full_action = full_act.dup if full_act != nil
    @action = @full_action.shift
    # 参照したアクションがフルアクションであれば全体のアクションを統合
    full_act2 = N03::FULLACTION[@action]
    @full_action = full_act2.dup + @full_action if full_act2 != nil
  end
  #--------------------------------------------------------------------------
  # ● 次のアクションへ
  #--------------------------------------------------------------------------
  def next_action
    @wait = 0
    # ショートカット確認
    eval(@action) if @action != nil && @action_data == nil && N03::FULLACTION[@action] == nil
    # ウエイト設定
    @wait = @action.to_i if @wait == 0 && @action_data == nil
    @wait = rand(@wait.abs + 1) if @wait < 0
    # アクション開始
    action_play
  end
  #--------------------------------------------------------------------------
  # ● 待機アクションへ移行
  #--------------------------------------------------------------------------
  def stand_by_action
    # 通常待機に
    stand_by_act = normal
    # HPが1/4でピンチアクションに
    stand_by_act = pinch if @battler.hp <= @battler.mhp / 4
    # ステートチェック
    stand_by_act = state(@battler.states[0].id) if @battler.states[0] != nil && state(@battler.states[0].id) != nil
    # コマンドチェック
    stand_by_act = command if @command_action && command != nil
    set_action(stand_by_act)
    @action = stand_by_act if @action == nil
  end
  #--------------------------------------------------------------------------
  # ● 強制アクション開始
  #--------------------------------------------------------------------------
  def start_force_action
    return if @active
    start_action(@force_action)
    @force_action = ""
  end  
  #--------------------------------------------------------------------------
  # ● アクション追加
  #--------------------------------------------------------------------------
  def add_action(kind)
    @full_action.push(kind)
  end  
  #--------------------------------------------------------------------------
  # ● アクションの挿入
  #--------------------------------------------------------------------------
  def unshift_action(kind)
    @full_action.unshift(kind)
  end  
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # アクション開始
    start_action
    # 強制アクション開始
    start_force_action if @force_action != ""
    # アニメパターン更新
    update_pattern
    # 移動更新
    update_move
    # 回転更新
    update_angle if @angle_time != 0
    # 拡大縮小更新
    update_zoom if @zoom_time != 0
    # 透明度更新
    update_opacity if @opacity_data != []
  end
  #--------------------------------------------------------------------------
  # ● アニメパターン更新
  #--------------------------------------------------------------------------
  def update_pattern
    return @pattern_rest_time -= 1 if @pattern_rest_time != 0
    return if @max_pattern_w == 1 && @max_pattern_h == 1
    @pattern_rest_time = @pattern_time
    # 再生開始・終了セル位置を取得
    if @pattern_kind > 0 # 通常再生中
      @pattern_start = 0
      @pattern_end = @max_pattern_w - 1
    elsif @pattern_kind < 0 # 逆転再生中
      @pattern_start = @max_pattern_w - 1
      @pattern_end = 0
    end
    # 片道の再生が終了
    @pattern_count += 1 if @pattern_w == @pattern_end && @pattern_kind != 0
    # ループ処理
    case @pattern_type.abs
    when  1,3 # 片道
      @pattern_kind =  0 if @pattern_count != 0 && @pattern_type ==  1
      @pattern_kind =  0 if @pattern_count != 0 && @pattern_type == -1
      @pattern_kind =  1 if @pattern_count != 0 && @pattern_type ==  3
      @pattern_kind = -1 if @pattern_count != 0 && @pattern_type == -3
      @pattern_w = @pattern_start - @pattern_kind if @pattern_count != 0 && @pattern_type.abs == 3
      @pattern_count = 0
    when  2,4 # 往復
      @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  2
      @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -2
      @pattern_kind =  0 if @pattern_count == 2 && @pattern_type ==  2
      @pattern_kind =  0 if @pattern_count == 2 && @pattern_type == -2
      @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  4
      @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -4
      @pattern_kind =  1 if @pattern_count == 2 && @pattern_type ==  4
      @pattern_kind = -1 if @pattern_count == 2 && @pattern_type == -4
      @pattern_count = 0 if @pattern_count == 2
    end
    # セル更新
    @pattern_w += 1 * @pattern_kind
    @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  end
  #--------------------------------------------------------------------------
  # ● 移動の更新
  #--------------------------------------------------------------------------
  def update_move
    @z = @y / 100 + @z_plus
    return if @move_time == 0
    target_position_set if @horming_move
    @x = (@x * (@move_time - 1) + @target_x) / @move_time
    @y = (@y * (@move_time - 1) + @target_y) / @move_time
    @h = (@h * (@move_time - 1) + @target_h) / @move_time if @move_h != nil
    @c += @curve[@move_time - 1] if @curve[@move_time - 1] != nil
    @j += @jump[@move_time - 1] if @jump[@move_time - 1] != nil
    @move_time -= 1
    convert_jump if @move_time == 0
  end
  #--------------------------------------------------------------------------
  # ● 移動目標の更新
  #--------------------------------------------------------------------------
  def target_position_set
    target_position = N03.get_targets_position(@move_targets, @horming_move)
    @target_x = target_position[0] + @move_x
    @target_y = target_position[1] + @move_y
    @target_h = target_position[2] + @move_h if @move_h != nil
  end  
  #--------------------------------------------------------------------------
  # ● 回転更新
  #--------------------------------------------------------------------------
  def update_angle
    @angle += @angling
    @angle_time -= 1
    return if @angle_time != 0
    return angle_reset if @angle_data[4] == 0
    angling(@angle_data) if @angle_data[4] == 2
  end  
  #--------------------------------------------------------------------------
  # ● 拡大縮小更新
  #--------------------------------------------------------------------------
  def update_zoom
    @zoom_x += @zooming_x
    @zoom_y += @zooming_y
    @zoom_time -= 1
    return if @zoom_time != 0
    return zoom_reset if @zoom_data[4] == 0
    zooming(@zoom_data) if @zoom_data[4] == 2
  end
  #--------------------------------------------------------------------------
  # ● 透明度更新
  #--------------------------------------------------------------------------
  def update_opacity
    @opacity += @opacity_data[2]
    @opacity_data[0] -= 1
    return if @opacity_data[0] != 0
    return if !@opacity_data[5]
    @opacity_data[2] *= -1
    @opacity_data[0] = @opacity_data[1]
  end
  #--------------------------------------------------------------------------
  # ● アクション実行
  #--------------------------------------------------------------------------
  def action_play
    return if @action_data == nil
    action = @action_data[0]
    # バトラー反転の場合
    return mirroring                    if action == "mirror"
    # 残像の場合
    return mirage_set                   if action == "mirage"
    # 回転の場合  
    return angling                      if action == "angle"
    # 拡大縮小の場合  
    return zooming                      if action == "zoom"
    # 透明度操作の場合  
    return set_opacity                  if action == "opacity"
    # バトラーアニメの場合
    return battler_anime                if action == "motion"
    # 移動の場合
    return move                         if action == "move"
    # 武器アニメの場合
    return weapon_anime([@action_data]) if action == "wp"
    # アニメ飛ばしの場合
    return move_anime                   if action == "m_a"
    # 戦闘シーン通信の場合(コラプス)
    return set_play_data                if action == "collapse" or action == "no_collapse"
    # データベース戦闘アニメ表示の場合  
    return battle_anime                 if action == "anime"
    # カメラワークの場合
    return camera                       if action == "camera"
    # 画面のシェイクの場合
    return shake                        if action == "shake"
    # 画面色調変更の場合
    return color_effect                 if action == "color"
    # トランジションの場合
    return transition                   if action == "ts"
    # ふきだしアニメ表示の場合  
    return balloon_anime                if action == "balloon"
    # ピクチャ表示の場合
    return picture_set                  if action == "pic"
    # ステート操作の場合
    return state_set                    if action == "sta"
    # FPS変更の場合
    return fps                          if action == "fps"
    # バトラー画像変更の場合  
    return graphics_change              if action == "change"
    # スキル派生の場合  
    return derivating_skill             if action == "der"
    # BGM/BGS/SE演奏の場合  
    return sound                        if action == "sound"
    # ムービー再生の場合  
    return movie                        if action == "movie"
    # ゲームスイッチ操作の場合  
    return switches                     if action == "switch"
    # ゲーム変数操作の場合  
    return variable                     if action == "variable"
    # 条件分岐(ゲームスイッチ)の場合
    return nece_1                       if action == "n_1"
    # 条件分岐(ゲーム変数)の場合
    return nece_2                       if action == "n_2"
    # 条件分岐(ステート)の場合
    return nece_3                       if action == "n_3"
    # 条件分岐(スキル)の場合
    return nece_4                       if action == "n_4"
    # 条件分岐(パラメータ)の場合
    return nece_5                       if action == "n_5"
    # 条件分岐(装備)の場合
    return nece_6                       if action == "n_6"
    # 条件分岐(スクリプト)の場合
    return nece_7                       if action == "n_7"
    # セカンドターゲット操作の場合  
    return second_targets_set           if action == "s_t"
    # コモンイベント呼び出しの場合  
    return call_common_event            if action == "common"
    # 戦闘アニメ消去の場合  
    return @anime_off = true            if action == "anime_off"
    # 強制戦闘終了の場合  
    return BattleManager.process_abort  if action == "battle_end"
    # 画面固定の場合  
    return Graphics.freeze              if action == "graphics_freeze"
    # ダメージアニメの場合  
    return damage_anime                 if action == "damage_anime"
    # 武器消去の場合  
    return @weapon_visible = false      if action == "weapon_off"
    # 武器消去解除の場合  
    return @weapon_visible = true       if action == "weapon_on"
    # 待機キャンセルの場合
    return @non_motion = true           if action == "non_motion"
    # 待機キャンセル解除の場合
    return @non_motion = false          if action == "non_motion_cancel"
    # 初期位置変更の場合
    return change_base_position         if action == "change_base_position"
    # 初期位置変更解除の場合
    return set_base_position(false)     if action == "set_base_position"
    # 強制アクションの場合  
    return force_act                    if action == "force_action"
    # 強制アクションの場合 (セカンドターゲット)
    return force_act2                   if action == "force_action2"
    # 個別開始の場合
    return individual_start             if action == "individual_start"
    # 個別終了の場合
    return individual_end               if action == "individual_end"
    # ループ開始の場合
    return loop_start                   if action == "loop_start"
    # ループ終了の場合
    return loop_end                     if action == "loop_end"
    # 自分のみ更新の場合
    return only_action_on               if action == "only_action_on"
    # 自分のみ更新解除の場合
    return only_action_off              if action == "only_action_off"
    # 次の行動者へ移行の場合
    return next_battler                 if action == "next_battler"
    # 画像変更フラグの場合
    return set_change                   if action == "set_change"
    # スクリプト操作の場合   
    return eval(@action_data[0])
  end
  #--------------------------------------------------------------------------
  # ● バトラー反転実行
  #--------------------------------------------------------------------------
  def mirroring
    @mirror = !@mirror
  end  
  #--------------------------------------------------------------------------
  # ● 反転初期化
  #--------------------------------------------------------------------------
  def mirroring_reset
    @mirror = false
    mirroring if [email protected]? && N03::ENEMY_MIRROR
    mirroring if $sv_camera.mirror
  end  
  #--------------------------------------------------------------------------
  # ● 残像実行
  #--------------------------------------------------------------------------
  def mirage_set
    @mirage = @action_data.dup
    @mirage_end = @mirage[3]
    @mirage = [] if @mirage[1] == 0
  end  
  #--------------------------------------------------------------------------
  # ● 回転実行
  #--------------------------------------------------------------------------
  def angling(data = @action_data)
    @angle_data = data.dup
    @oy = @ch / 2
    @oy_adjust = @ch * 50
    @angle_time = data[1]
    start_angle = data[2] * N03.mirror_num(@mirror)
    end_angle = data[3] * N03.mirror_num(@mirror)
    # 時間が0以下なら即座に最終角度へ
    @angle_time = 1 if @angle_time <= 0
    # 回転時間から1フレームあたりの角度を出す
    @angling = (end_angle - start_angle) / @angle_time
    # 割り切れない余りを初期角度に
    @angle = (end_angle - start_angle) % @angle_time + start_angle
  end
  #--------------------------------------------------------------------------
  # ● 回転初期化
  #--------------------------------------------------------------------------
  def angle_reset
    @oy = @ch
    @angle = @angle_time = @oy_adjust = 0
  end  
  #--------------------------------------------------------------------------
  # ● 拡大縮小実行
  #--------------------------------------------------------------------------
  def zooming(data = @action_data)
    @zoom_data = data.dup
    @zoom_time = data[1]
    start_zoom_x = data[2][0]
    start_zoom_y = data[2][1]
    end_zoom_x = data[3][0]
    end_zoom_y = data[3][1]
    # 時間が0以下なら即座に最終サイズへ
    @zoom_time = 1 if @zoom_time <= 0
    # 拡大縮小時間から1フレームあたりの拡大縮小率を出す
    @zooming_x = (end_zoom_x - start_zoom_x) / @zoom_time
    @zooming_y = (end_zoom_y - start_zoom_y) / @zoom_time
    # 開始サイズに
    @zoom_x = start_zoom_x
    @zoom_y = start_zoom_y
  end  
  #--------------------------------------------------------------------------
  # ● 拡大縮小初期化
  #--------------------------------------------------------------------------
  def zoom_reset
    @zoom_x = @zoom_y = 1
    @zoom_time = 0
  end  
  #--------------------------------------------------------------------------
  # ● バトラー透明度操作
  #--------------------------------------------------------------------------
  def set_opacity
    data = @action_data.dup
    @opacity = data[2]
    opacity_move = (data[3] - data[2])/ data[1]
    @opacity_data = [data[1], data[1], opacity_move, data[4], data[5], data[6]]
    @wait = data[1] if data[7]
    @wait *= 2 if data[6] && data[7]
  end
  #--------------------------------------------------------------------------
  # ● 透明度操作初期化
  #--------------------------------------------------------------------------
  def opacity_reset
    @opacity = 255
    @opacity = 0 if @battler.hidden?
    @opacity_data = []
  end
  #--------------------------------------------------------------------------
  # ● バトラーアニメ実行
  #--------------------------------------------------------------------------
  def battler_anime(anime_data = nil)
    anime_data = @action_data.dup if anime_data == nil
    @graphic_file_index = anime_data[1] if !graphic_fix
    @pattern_h = anime_data[2]
    @pattern_w = anime_data[3]
    @pattern_h = 0 if @max_pattern_w == 1
    @pattern_w = 0 if @max_pattern_h == 1
    @pattern_type = anime_data[4]
    @pattern_time = anime_data[5]
    @pattern_rest_time = anime_data[5]
    @pattern_count = 0
    @pattern_kind = 1
    @pattern_kind = -1 if @pattern_type < 0
    @pattern_kind = 0 if @pattern_type == 0
    @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
    @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
    @z_plus = anime_data[6]
    @wait = set_anime_wait if anime_data[7]
    @shadow_visible = anime_data[8]
    weapon_anime(anime_data)
  end
  #--------------------------------------------------------------------------
  # ● アニメウエイト計算
  #--------------------------------------------------------------------------
  def set_anime_wait
    if @pattern_type > 0
      pattern_time_a = @max_pattern_w - @pattern_w.abs
    elsif @pattern_type < 0
      pattern_time_a = @pattern_w.abs + 1
    else
      return @pattern_time if @pattern_type == 0
    end
    case @pattern_type
    when 1,-1, 3,-3
      return pattern_time_a * @pattern_time
    when 2,-2, 4,-4
      return pattern_time_a * @pattern_time + (@max_pattern_w - 2) * @pattern_time
    end
  end  
  #--------------------------------------------------------------------------
  # ● 移動実行
  #--------------------------------------------------------------------------
  def move
    @move_targets = N03.get_targets(@action_data[1].abs, @battler)
    return if @move_targets == []
    @move_targets = [@battler] if @action_data[1].abs == 7
    @move_x = @action_data[2] * 100 * N03.mirror_num(@mirror)
    @move_y = @action_data[3] * 100
    @move_h = @action_data[4] * 100 if @action_data[4] != nil
    @move_h = nil if @action_data[4] == nil
    battler_anime(N03::ACTION[@action_data[8]].dup) if N03::ACTION[@action_data[8]] != nil
    @horming_move = true
    @horming_move = false if @action_data[1] < 0 or @action_data[1].abs == 7
    target_position_set
    target_position = [@target_x, @target_y, @target_z]
    distanse_move = @action_data[5] > 0
    @move_time = N03.distanse_calculation(@action_data[5].abs, target_position, [@x, @y, @z], distanse_move)
    @wait = @move_time
    curve
    jump
    @move_time = 1 if @move_time == 0
    @horming_move = false if !@move_targets or @move_targets.include?(@battler)
    update_move if @move_time == 1
  end  
  #--------------------------------------------------------------------------
  # ● カーブ実行
  #--------------------------------------------------------------------------
  def curve
    @c = 0
    return if @action_data[6] == 0
    @curve = N03.parabola([@action_data[6], -@action_data[6]], @move_time, 100, 4)
  end  
  #--------------------------------------------------------------------------
  # ● ジャンプ実行
  #--------------------------------------------------------------------------
  def jump
    convert_jump
    return if @action_data[7] == [0,0]
    @jump = N03.parabola(@action_data[7].dup, @move_time, 100)
  end  
  #--------------------------------------------------------------------------
  # ● J座標(ジャンプ高度)をH座標に変換
  #--------------------------------------------------------------------------
  def convert_jump
    @h += @j
    @j = 0
    @jump = []
  end  
  #--------------------------------------------------------------------------
  # ● データベース戦闘アニメ実行
  #--------------------------------------------------------------------------
  def battle_anime
    data = @action_data.dup
    targets = N03.get_targets(data[2], @battler)
    return if targets == []
    data[8] = !data[8] if @mirror
    @set_damage           = data[5]
    @damage_anime_data[0] = N03.get_attack_anime_id(data[1], @battler)
    @damage_anime_data[1] = data[8]
    @damage_anime_data[2] = data[7]
    @damage_anime_data[3] = data[6]
    @damage_anime_data[4] = data[9]
    @wait = N03.get_anime_time(@damage_anime_data[0]) - 2 if data[4]
    return if @set_damage
    for target in targets do display_anime(targets, target, data) end
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメ開始
  #--------------------------------------------------------------------------
  def weapon_anime(anime_data)
    @weapon_end = true
    for i in 9...anime_data.size
      set_effect_data(anime_data) if anime_data != ""
    end
  end
  #--------------------------------------------------------------------------
  # ● アニメ飛ばし開始
  #--------------------------------------------------------------------------
  def move_anime
    @m_a_starter = []
    @m_a_targets = []
    starters = N03.get_targets(@action_data[2], @battler)
    targets = N03.get_targets(@action_data[3], @battler)
    return if starters == [] or targets == []
    single_start = true if starters != nil && @action_data[2] < 0
    single_start = true if @action_data[1][0] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][0], @battler)].position == 3
    starters = [starters[0]] if single_start
    single_end = true if targets != nil && @action_data[3] < 0
    single_end = true if @action_data[1][1] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][1], @battler)].position == 3
    targets = [targets[0]] if single_end
    se_flag = true
    for starter in starters
      for target in targets
        data = @action_data.dup
        data[17] = se_flag
        @effect_data.push(data)
        @m_a_targets.push(target)
        @m_a_starter.push(starter)
        se_flag = false
      end
    end  
  end
  #--------------------------------------------------------------------------
  # ● スプライトセット通信
  #--------------------------------------------------------------------------
  def set_effect_data(data = @action)
    action_data = N03::ACTION[data]
    return if action_data == nil
    @effect_data.push(action_data.dup)
  end
  #--------------------------------------------------------------------------
  # ● 戦闘シーン通信のデータを格納
  #--------------------------------------------------------------------------
  def set_play_data(data = @action_data)
    @play_data = data.dup
  end
  #--------------------------------------------------------------------------
  # ● 戦闘アニメの表示
  #--------------------------------------------------------------------------
  def display_anime(targets, target, data)
    return if !N03.first_of_all_screen_anime(data[1], target, targets)
    target.animation_id         = N03.get_attack_anime_id(data[1], @battler)
    target.animation_mirror     = data[8]
    target.sv.anime_horming     = data[3]
    target.sv.anime_camera_zoom = data[6]
    target.sv.anime_no_mirror   = data[7]
    target.sv.anime_plus_z      = data[9]
  end
  #--------------------------------------------------------------------------
  # ● 戦闘アニメ拡張データの初期化
  #--------------------------------------------------------------------------
  def reset_anime_data
    @anime_no_mirror = false
    @anime_horming = false
    @anime_camera_zoom = false
    @timing_targets = []
    @anime_plus_z = true
  end  
  #--------------------------------------------------------------------------
  # ● カメラワーク
  #--------------------------------------------------------------------------
  def camera
    data = @action_data.dup
    N03.camera(@battler, data)
    @wait = data[4] if data[5]
  end  
  #--------------------------------------------------------------------------
  # ● 画面のシェイク
  #--------------------------------------------------------------------------
  def shake
    data = @action_data.dup
    $sv_camera.shake(data[1], data[2], data[3])
    @wait = data[3] if data[4]
  end
  #--------------------------------------------------------------------------
  # ● 画面色調変更
  #--------------------------------------------------------------------------
  def color_effect
    case @action_data[1]
    when 0,1,2,3,4,5
      targets = N03.get_targets(@action_data[1], @battler)
    when 6
      screen = true
    when 7
      targets = [@battler] + @target_battler
    when 8
      screen = true
      targets = $game_troop.members + $game_party.battle_members - [@battler]
    when 9
      screen = true
      targets = $game_troop.members + $game_party.battle_members - [@battler] - @target_battler
    when 10
      screen = true
      targets = $game_troop.members + $game_party.battle_members
    end
    return if screen == nil && targets == []
    for target in targets do target.sv.color_set = @action_data[2] end if targets
    @wait = @action_data[2][4] if @action_data[3]
    return if !screen
    $sv_camera.color_set[1] = @action_data[2]
    $sv_camera.color_set[2] = @action_data[2]
  end  
  #--------------------------------------------------------------------------
  # ● トランジション
  #--------------------------------------------------------------------------
  def transition
    $sv_camera.perform_transition(@action_data)
  end  
  #--------------------------------------------------------------------------
  # ● ふきだしアニメ表示
  #--------------------------------------------------------------------------
  def balloon_anime
    @balloon_data = @action_data.dup
  end  
  #--------------------------------------------------------------------------
  # ● ピクチャ表示
  #--------------------------------------------------------------------------
  def picture_set
    @picture = true
    set_effect_data
  end
  #--------------------------------------------------------------------------
  # ● ステート操作
  #--------------------------------------------------------------------------
  def state_set
    targets = N03.get_targets(@action_data[1], @battler)
    return if targets == []
    case @action_data[2]
    when 1 ; targets = [targets[rand(targets.size)]]
    when 2 ; targets -= @battler if targets.include?(@battler)
    end
    for target in targets
      for id in @action_data[4]
        target.add_state(id) if @action_data[3] == "+"
        target.remove_state(id) if @action_data[3] == "-"
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● FPS変更
  #--------------------------------------------------------------------------
  def fps
    Graphics.frame_rate = @action_data[1]
    start_action
  end
  #--------------------------------------------------------------------------
  # ● バトラー画像変更の場合
  #--------------------------------------------------------------------------
  def graphics_change
    @graphics_change = true
    return @battler.graphics_change(@action_data[3]) if [email protected]?
    @pre_change_data = [@battler.character_name, @battler.character_index, @battler.face_name, @battler.face_index] if @pre_change_data == nil && !@action_data[1]
    if @action_data[4] == []
      face_name = @battler.face_name
      face_index = @battler.face_index
    else
      face_name = @action_data[4][1]
      face_index = @action_data[4][0]
    end
    @battler.set_graphic(@action_data[3], @action_data[2], face_name, face_index)
  end
  #--------------------------------------------------------------------------
  # ● スキル派生
  #--------------------------------------------------------------------------
  def derivating_skill
    # 未修得スキルは派生不可なら
    return if !@action_data[1] && [email protected]_learn?($data_skills[@action_data[3]])
    # コスト不足は派生不可なら
    return if !@action_data[2] && [email protected]_cost_payable?($data_skills[@action_data[3]])
    # 派生
    @derivation_skill_id = @action_data[3]
    # 以降のアクションをキャンセル
    @full_action = []
  end
  #--------------------------------------------------------------------------
  # ● BGM/BGS/SE演奏
  #--------------------------------------------------------------------------
  def sound
    pitch = @action_data[2]
    vol   = @action_data[3]
    name  = @action_data[4]
    case @action_data[1]
    when "se"
      Audio.se_play("Audio/SE/" + name, vol, pitch)
    when "bgm"
      # 名前指定のない場合、現在のBGMを変えないように
      name = RPG::BGM.last.name if @action_data[4] == ""
      Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
    when "bgs"
      name = RPG::BGS.last.name if @action_data[4] == ""
      Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
    end
  end
  #--------------------------------------------------------------------------
  # ● ムービーの再生
  #--------------------------------------------------------------------------
  def movie
    Graphics.play_movie('Movies/' + @action_data[1])
  end
  #--------------------------------------------------------------------------
  # ● ゲームスイッチ操作
  #--------------------------------------------------------------------------
  def switches
    for id in @action_data[1]
      $game_switches[id] = true if id > 0
      $sv_camera.switches[id.abs] = true  if id < 0
    end
    for id in @action_data[2]
      $game_switches[id] = false if id > 0
      $sv_camera.switches[id.abs] = false  if id < 0
    end
    $sv_camera.program_check
  end
  #--------------------------------------------------------------------------
  # ● ゲーム変数操作
  #--------------------------------------------------------------------------
  def variable
    # オペランドチェック
    operand = @action_data[3]
    operand = $game_variables[@action_data[3].abs] if @action_data[3] < 0
    # 変数操作で分岐
    case @action_data[2]
    when 0 ; $game_variables[@action_data[1]] = operand  # 代入
    when 1 ; $game_variables[@action_data[1]] += operand # 加算
    when 2 ; $game_variables[@action_data[1]] -= operand # 減算
    when 3 ; $game_variables[@action_data[1]] *= operand # 乗算
    when 4 ; $game_variables[@action_data[1]] /= operand # 除算
    when 5 ; $game_variables[@action_data[1]] %= operand # 剰余
    end
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (ゲームスイッチ)
  #--------------------------------------------------------------------------
  def nece_1
    judgment = $game_switches[@action_data[1]] == @action_data[2] if @action_data[1] > 0
    judgment = $sv_camera.switches[@action_data[1].abs] == @action_data[2] if @action_data[1] < 0
    action_diverging(judgment, @action_data[3])
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (ゲーム変数)
  #--------------------------------------------------------------------------
  def nece_2
    variable = $game_variables[@action_data[1]]
    num = @action_data[2]
    num = $game_variables[@action_data[2].abs] if num < 0
    case @action_data[3]
    when 0 ; judgment = variable == num
    when 1 ; judgment = variable < num
    when 2 ; judgment = variable > num
    end  
    action_diverging(judgment, @action_data[4])
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (ステート)
  #--------------------------------------------------------------------------
  def nece_3
    targets = N03.get_targets(@action_data[1], @battler)
    return if targets == []
    member_num = @action_data[4]
    member_num = targets.size if @action_data[4] == 0 && targets.size > 1
    hit_count = 0
    miss_count = 0
    for target in targets
      hit_count += 1 if target.state?(@action_data[2])
      miss_count += 1 if !target.state?(@action_data[2])
    end
    case @action_data[3]
    when 0 ; judgment = hit_count >= member_num
    when 1 ; judgment = miss_count >= member_num
    end
    action_diverging(judgment, @action_data[5])
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (スキル)
  #--------------------------------------------------------------------------
  def nece_4
    targets = N03.get_targets(@action_data[1], @battler)
    return if targets == []
    member_num = @action_data[4]
    member_num = targets.size if @action_data[4] == 0 && targets.size > 1
    hit_count = 0
    miss_count = 0
    for target in targets
      hit_count += 1 if target.skill_learn?($data_skills[@action_data[2]]) && target.skill_conditions_met?($data_skills[@action_data[2]])
      miss_count += 1 if !target.skill_learn?($data_skills[@action_data[2]]) or !target.skill_conditions_met?($data_skills[@action_data[2]])
    end
    case @action_data[3]
    when 0 ; judgment = hit_count >= member_num
    when 1 ; judgment = miss_count >= member_num
    end
    action_diverging(judgment, @action_data[5])
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (パラメータ)
  #--------------------------------------------------------------------------
  def nece_5
    targets = N03.get_targets(@action_data[1], @battler)
    return if targets == []
    member_num = @action_data[5]
    member_num = targets.size if @action_data[5] == 0 && targets.size > 1
    hit_count = 0
    for target in targets
      hit_count += 1 if target.comparison_parameter([@action_data[2],@action_data[3],@action_data[4]])
    end
    judgment = hit_count >= member_num
    action_diverging(judgment, @action_data[6])
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (装備)
  #--------------------------------------------------------------------------
  def nece_6
    targets = N03.get_targets(@action_data[1], @battler)
    return if targets == []
    member_num = @action_data[5]
    member_num = targets.size if @action_data[5] == 0 && targets.size > 1
    hit_count = 0
    miss_count = 0
    for target in targets
      hit_count += 1 if target.comparison_equip([@action_data[2],@action_data[3]])
      miss_count += 1 if !target.comparison_equip([@action_data[2],@action_data[3]])
    end
    case @action_data[4]
    when 0 ; judgment = hit_count >= member_num
    when 1 ; judgment = miss_count >= member_num
    end
    action_diverging(judgment, @action_data[6])
  end  
  #--------------------------------------------------------------------------
  # ● 条件分岐 (スクリプト)
  #--------------------------------------------------------------------------
  def nece_7
    judgment = eval(@action_data[2])
    action_diverging(judgment, @action_data[1])
  end  
  #--------------------------------------------------------------------------
  # ● アクション分岐  
  #--------------------------------------------------------------------------
  def action_diverging(judgment, kind)
    result = 0
    if judgment
      result = 1 if kind == 1
      result = 2 if kind == 2
    else
      result = 1 if kind == 0
    end
    # フルアクション終了
    return @full_action = []  if result == 2
    # 次のアクションを除去
    @full_action.shift if result == 1
    set_action
    # 次のアクションを実行
    @action_data = N03::ACTION[@action]
    next_action
  end
  #--------------------------------------------------------------------------
  # ● セカンドターゲット操作
  #--------------------------------------------------------------------------
  def second_targets_set
    targets = N03.get_targets(@action_data[1], @battler)
    for target in targets
      targets.delete(target) if @action_data[2][1] == 1 && target.index != @action_data[2][0]
      targets.delete(target) if @action_data[2][1] == 2 && target.index == @action_data[2][0].abs
      targets.delete(target) if @action_data[3] > 0 && target.id != @action_data[3]
      targets.delete(target) if @action_data[3] < 0 && target.id == @action_data[3].abs
      targets.delete(target) if @action_data[4] > 0 && !target.state?(@action_data[4])
      targets.delete(target) if @action_data[4] < 0 && target.state?(@action_data[4].abs)
      targets.delete(target) if @action_data[5] > 0 && !target.skill_conditions_met?($data_skills[@action_data[5]])
      targets.delete(target) if @action_data[5] < 0 && target.skill_conditions_met?($data_skills[@action_data[5].abs])
      targets.delete(target) if !target.comparison_parameter(@action_data[6])
      targets.delete(target) if !@action_data[7][1].include?(0) && !target.comparison_equip(@action_data[7])
    end
    return @second_targets = [] if targets.size == 0
    case @action_data[8]
    when 1 ; targets = [targets[rand(targets.size)]]
    when 2 ; targets.delete(@battler)
    end
    return @second_targets = [] if targets.size == 0
    @second_targets = targets
    case @action_data[9]
    when 0 ; return
    when 1 ; set_play_data(["second_targets_set"])
    when 2 ; set_play_data(["targets_set"])
    end
    @wait += 1
  end
  #--------------------------------------------------------------------------
  # ● コモンイベント呼び出し
  #--------------------------------------------------------------------------
  def call_common_event
    $game_temp.reserve_common_event(@action_data[1])
    $sv_camera.event = true
    @event_fix = @action_data[2]
  end
  #--------------------------------------------------------------------------
  # ● ダメージアニメ
  #--------------------------------------------------------------------------
  def damage_anime(delay_time = 12)
    anime(N03.get_attack_anime_id(-3, @battler), wait = true)
    action_play
    @wait -= delay_time
    @full_action.unshift("eval('@damage_anime_data = []
    @set_damage = true')")
  end
  #--------------------------------------------------------------------------
  # ● 通常コラプス
  #--------------------------------------------------------------------------
  def normal_collapse
    @collapse = true
    return
  end
  #--------------------------------------------------------------------------
  # ● 初期位置変更
  #--------------------------------------------------------------------------
  def change_base_position
    @base_x = @x
    @base_y = @y
    @base_h = @h
  end  
  #--------------------------------------------------------------------------
  # ● 強制アクション実行
  #--------------------------------------------------------------------------
  def force_act
    target(@full_action.shift)
  end
  #--------------------------------------------------------------------------
  # ● 強制アクション実行 (セカンドターゲット)
  #--------------------------------------------------------------------------
  def force_act2
    target2(@full_action.shift)
  end
  #--------------------------------------------------------------------------
  # ● 個別処理開始
  #--------------------------------------------------------------------------
  def individual_start
    @individual_targets = @target_battler.dup
    @remain_targets = @target_battler.dup
    @target_battler = [@individual_targets[0]]
    # リピート部分のアクションを保持
    @individual_act = @full_action.dup
  end
  #--------------------------------------------------------------------------
  # ● 個別処理終了
  #--------------------------------------------------------------------------
  def individual_end
    @individual_targets.shift
    for target in @individual_targets
      @individual_targets.shift if target.dead?
    end
    # ターゲットが残っているなら行動リピート
    return @target_battler = @remain_targets if @individual_targets.size == 0
    @full_action = @individual_act.dup
    @target_battler = [@individual_targets[0]]
  end
  #--------------------------------------------------------------------------
  # ● ループ開始
  #--------------------------------------------------------------------------
  def loop_start
    # ループ部分のアクションを保持
    @loop_act = @full_action.dup
  end
  #--------------------------------------------------------------------------
  # ● ループ終了
  #--------------------------------------------------------------------------
  def loop_end
    # 行動リピート
    @full_action = @loop_act.dup if @loop_act != []
  end
  #--------------------------------------------------------------------------
  # ● 次の行動者へ移行
  #--------------------------------------------------------------------------
  def next_battler
    @action_end = true
    @active = false
  end
  #--------------------------------------------------------------------------
  # ● 画像変更フラグ
  #--------------------------------------------------------------------------
  def set_change
    @change_up = true
  end
  #--------------------------------------------------------------------------
  # ● 戦闘シーン通信
  #--------------------------------------------------------------------------
  def play_data
    data = @play_data
    @play_data = []
    return data
  end
  #--------------------------------------------------------------------------
  # ● ショートカットコマンド
  #--------------------------------------------------------------------------
  def anime(anime_id, wait = true)
    @action_data = ["anime",anime_id,1,false,wait,false,true,false]
  end
  def anime_me(anime_id, wait = true)
    @action_data = ["anime",anime_id,0,false,wait,false,true,false]
  end
  def se(file, pitch = 100)
    @action_data = ["sound",  "se", pitch, 100, file]
  end
  def target(act)
    for target in @target_battler do target.sv.force_action = act end
  end
  def target2(act)
    for target in @second_targets do target.sv.force_action = act end
  end
  def delay(time)
    @wait = @battler.index * time
  end
  #--------------------------------------------------------------------------
  # ● バトラーのIDを取得
  #--------------------------------------------------------------------------
  def id
    return @battler.id if @battler.actor?
    return [email protected]
  end
  #--------------------------------------------------------------------------
  # ● 被クリティカルフラグを取得
  #--------------------------------------------------------------------------
  def critical?
    return @battler.result.critical
  end
  #--------------------------------------------------------------------------
  # ● 被回復フラグを取得
  #--------------------------------------------------------------------------
  def recovery?
    recovery = false
    recovery = true if @battler.result.hp_damage < 0
    recovery = true if @battler.result.mp_damage < 0
    recovery = true if @battler.result.tp_damage < 0
    return recovery
  end
  #--------------------------------------------------------------------------
  # ● 被スキルIDを取得
  #--------------------------------------------------------------------------
  def damage_skill_id
    return @damage_skill_id
  end
  #--------------------------------------------------------------------------
  # ● 被アイテムIDを取得
  #--------------------------------------------------------------------------
  def damage_item_id
    return @damage_item_id
  end
  #--------------------------------------------------------------------------
  # ● 装備武器を取得
  #--------------------------------------------------------------------------
  def weapon_id
    return 0 if [email protected][0]
    return @battler.weapons[0].id
  end
  #--------------------------------------------------------------------------
  # ● 装備武器のタイプを取得
  #--------------------------------------------------------------------------
  def weapon_type
    return 0 if [email protected][0]
    return @battler.weapons[0].wtype_id
  end
  #--------------------------------------------------------------------------
  # ● 盾を装備しているか
  #--------------------------------------------------------------------------
  def shield?
    for armor in @battler.armors do return true if armor != nil && armor.etype_id == 1 end
    return false
  end
  #--------------------------------------------------------------------------
  # ● ダメージがあるか
  #--------------------------------------------------------------------------
  def damage_zero?
    return @battler.result.hp_damage == 0 && @battler.result.mp_damage == 0 && @battler.result.tp_damage == 0
  end
  #--------------------------------------------------------------------------
  # ● スキルIDを取得
  #--------------------------------------------------------------------------
  def skill_id
    return @counter_id if @counter_id != 0
    return 0 if @battler.current_action == nil or @battler.current_action.item == nil
    return 0 if @battler.current_action.item.is_a?(RPG::Item)
    return @battler.current_action.item.id
  end
  #--------------------------------------------------------------------------
  # ● スキルのタイプを取得
  #--------------------------------------------------------------------------
  def skill_type
    return 0 if skill_id == 0
    return $data_skills[skill_id].stype_id
  end
  #--------------------------------------------------------------------------
  # ● スキル名を取得
  #--------------------------------------------------------------------------
  def skill_name
    return "" if skill_id == 0
    return $data_skills[skill_id].name
  end
  #--------------------------------------------------------------------------
  # ● アイテムIDを取得
  #--------------------------------------------------------------------------
  def item_id
    return 0 if @battler.current_action == nil or @battler.current_action.item == nil
    return @battler.current_action.item.id
  end
  #--------------------------------------------------------------------------
  # ● 攻撃アクション
  #--------------------------------------------------------------------------
  def attack_action(item)
    return skill_action if item.is_a?(RPG::Skill)
    return item_action
  end
  #--------------------------------------------------------------------------
  # ● ダメージアクションベース
  #--------------------------------------------------------------------------
  def damage_action_base(item)
    @damage_skill_id = 0
    @damage_item_id = 0
    @damage_skill_id = item.id if item.is_a?(RPG::Skill)
    @damage_item_id = item.id if item.is_a?(RPG::Item)
  end  
  #--------------------------------------------------------------------------
  # ● ダメージアクション
  #--------------------------------------------------------------------------
  def damage_action(attacker, item)
    damage_action_base(item)
    act = damage(attacker)
    return if @active
    start_action(act) if act != nil
  end
  #--------------------------------------------------------------------------
  # ● 回避アクション
  #--------------------------------------------------------------------------
  def evasion_action(attacker, item)
    damage_action_base(item)
    act = evasion(attacker)
    return if @active
    start_action(act) if act != nil
  end
  #--------------------------------------------------------------------------
  # ● ミスアクション
  #--------------------------------------------------------------------------
  def miss_action(attacker, item)
    damage_action_base(item)
    act = miss(attacker)
    return if @active
    start_action(act) if act != nil
  end
  #--------------------------------------------------------------------------
  # ● 閃きスクリプト併用処理
  #--------------------------------------------------------------------------
  def flash_action
    return "閃き"
  end
  
end


#==============================================================================
# ■ module N03
#------------------------------------------------------------------------------
#  サイドビューバトルのモジュールです。
#==============================================================================
module N03
  #--------------------------------------------------------------------------
  # ● バトラーの敵グループを取得
  #--------------------------------------------------------------------------
  def self.get_enemy_unit(battler)
    return $game_troop if battler.actor?
    return $game_party
  end
  #--------------------------------------------------------------------------
  # ● バトラーの味方グループを取得
  #--------------------------------------------------------------------------
  def self.get_party_unit(battler)
    return $game_party if battler.actor?
    return $game_troop
  end
  #--------------------------------------------------------------------------
  # ● 戦闘アニメ時間の取得
  #--------------------------------------------------------------------------
  def self.get_anime_time(anime_id)
    return 0 if anime_id <= 0
    return $data_animations[anime_id].frame_max * 4
  end
  #--------------------------------------------------------------------------
  # ● 攻撃アニメの取得
  #--------------------------------------------------------------------------
  def self.get_attack_anime_id(kind, battler)
    return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0
    case kind
    when -1 ; anime_id = battler.atk_animation_id1
    when -2 ; anime_id = battler.atk_animation_id2
    when -3
      if battler.current_action != nil
        anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil
      end
    else    ; anime_id = kind
    end
    case anime_id
    when -1 ; anime_id = battler.atk_animation_id1
    when -2 ; anime_id = battler.atk_animation_id2
    end
    return anime_id if anime_id
    return 0
  end  
  #--------------------------------------------------------------------------
  # ● 戦闘アニメデータをセット
  #--------------------------------------------------------------------------
  def self.set_damage_anime_data(targets, target, data)
    return if !first_of_all_screen_anime(data[0], target, targets)
    target.animation_id         = data[0]
    target.animation_mirror     = data[1]
    target.sv.anime_no_mirror   = data[2]
    target.sv.anime_camera_zoom = data[3]
    target.sv.anime_plus_z      = data[4]
  end   
  #--------------------------------------------------------------------------
  # ● ターゲットの取得
  #--------------------------------------------------------------------------
  def self.get_targets(kind, battler)
    case kind.abs
    when 0 ; return [battler].dup
    when 1 ; return battler.sv.target_battler.dup
    when 2 ; return get_enemy_unit(battler).members.dup
    when 3 ; return get_party_unit(battler).members.dup
    when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup
    when 5 ; return battler.sv.second_targets.dup
    end
  end  
  #--------------------------------------------------------------------------
  # ● ターゲットの座標を取得
  #--------------------------------------------------------------------------
  def self.get_targets_position(targets, horming, m_a = nil)
    return [0,0,0] if targets == nil && !$sv_camera.mirror
    return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror
    x = y = h = 0
    for i in 0...targets.size
      x += targets.sv.base_x if !horming
      y += targets.sv.base_y if !horming
      h += targets.sv.base_h if !horming
      x += targets.sv.x if horming
      y += targets.sv.y if horming
      h += targets.sv.h if horming
      y -= targets.sv.ch * 100 if m_a == 0
      y -= targets.sv.ch * 50 if m_a == 1
    end
    return [x / targets.size, y / targets.size, h / targets.size]
  end
  #--------------------------------------------------------------------------
  # ● 速度を時間に変換
  #--------------------------------------------------------------------------
  def self.distanse_calculation(time, target_position, self_position, distanse_move)
    return time if !distanse_move
    distanse_x = self_position[0] - target_position[0]
    distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0]
    distanse_y = self_position[1] - target_position[1]
    distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1]
    if self_position[2] != nil && target_position[2] != nil
      distanse_h = self_position[2] - target_position[2]
      distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2]
    else
      distanse_h = 0
    end
    distanse = [distanse_x, distanse_y, distanse_h].max
    return distanse / (time * 100) + 1
  end
  #--------------------------------------------------------------------------
  # ● 放物線移動計算
  #--------------------------------------------------------------------------
  def self.parabola(data, time, size, type = 1)
    move_data = data
    move_data[0] *= size
    move_data[1] *= size
    move = []
    move_d = []
    for i in 0...time / 2
      move = move_data[0]
      move_d = move_data[1]
      move_data[0] = move_data[0] * type / (1 + type)
      move_data[1] = move_data[1] * type / (1 + type)
    end
    move = move + move_d.reverse!
    move.reverse!
    adjust = move.inject(0) {|result, item| result + item }
    move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0
    move.unshift(0) if time % 2 != 0
    return move
  end
  #--------------------------------------------------------------------------
  # ● 反転値
  #--------------------------------------------------------------------------
  def self.mirror_num(mirror)
    return 1 if !mirror
    return -1
  end  
  #--------------------------------------------------------------------------
  # ● カメラワーク
  #--------------------------------------------------------------------------
  def self.camera(battler, data)
    battler = $game_party.battle_members[0] if !battler
    cx = data[2][0] * 100
    cy = data[2][1] * 100
    return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6
    targets = self.get_targets(data[1], battler)
    return if targets == nil or targets == []
    position = self.get_targets_position(targets, true)
    $sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false)
  end
  #--------------------------------------------------------------------------
  # ● コラプス禁止
  #--------------------------------------------------------------------------
  def self.immortaling
    # 全員に不死身付与
    for member in $game_party.battle_members + $game_troop.members
      # イベント操作等で不死身設定になっていたら解除を無効にするフラグを立てる
      member.sv.immortal = true if member.state?(N03::IMMORTAL_ID)
      member.add_state(N03::IMMORTAL_ID)
    end
    return true
  end  
  #--------------------------------------------------------------------------
  # ● コラプス許可
  #--------------------------------------------------------------------------
  def self.unimmortaling
    # 全員の不死身化解除(イベント等で不死身設定がされていれば除く)
    for member in $game_party.battle_members + $game_troop.members
      next if member.dead?
      # 不死身ステートが行動中に解除されていた場合、解除無効を解除
      member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal
      next member.sv.immortal = false if member.sv.immortal
      member.remove_state(N03::IMMORTAL_ID)
      next if member.hp != 0
      member.add_state(1)
      member.perform_collapse_effect
      member.sv.action_terminate
    end
    return false
  end  
  #--------------------------------------------------------------------------
  # ● スキル派生
  #--------------------------------------------------------------------------
  def self.derived_skill(battler)
    battler.force_action(battler.sv.derivation_skill_id, -2)
    BattleManager.unshift_action_battlers(battler)
  end
  #--------------------------------------------------------------------------
  # ● ダメージの作成
  #--------------------------------------------------------------------------
  def self.set_damage(battler, hp_damage, mp_damage)
    battler.result.hp_damage = hp_damage
    battler.result.mp_damage = mp_damage
  end
  #--------------------------------------------------------------------------
  # ● ターゲット生死確認
  #--------------------------------------------------------------------------
  def self.targets_alive?(targets)
    return false if targets == []
    for target in targets do return true if !target.dead? end
    return false
  end
  #--------------------------------------------------------------------------
  # ● ターゲットをセカンドターゲットへ
  #--------------------------------------------------------------------------
  def self.s_targets(battler)
    battler.sv.target_battler = battler.sv.second_targets
    return battler.sv.second_targets
  end  
  #--------------------------------------------------------------------------
  # ● セカンドターゲットをターゲットへ
  #--------------------------------------------------------------------------
  def self.targets_set(battler)
    battler.sv.second_targets = battler.current_action.make_targets.compact
    battler.sv.target_battler = battler.sv.second_targets
  end  
  #--------------------------------------------------------------------------
  # ● 戦闘アニメ実行判定 (対象:画面時は最初のターゲットのみアニメ実行)
  #--------------------------------------------------------------------------
  def self.first_of_all_screen_anime(anime_id, target, targets)
    anime = $data_animations[anime_id]
    return false if !anime
    return true if anime.position != 3
    return false if anime.position == 3 && target != targets[0]
    targets.delete(target)
    target.sv.timing_targets = targets
    return true
  end
  #--------------------------------------------------------------------------
  # ● 戦闘不能付加攻撃か
  #--------------------------------------------------------------------------
  def self.dead_attack?(battler, item)
    for state in battler.atk_states
      return true if state == battler.death_state_id
    end
    for effect in item.effects
      return true if effect.code == 21 && effect.data_id == battler.death_state_id
    end
    return false
  end  
   
end

紅色的那行就是BUG所在
請問該如何修改?謝謝
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 20:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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