module BattleManager class << self def revive_input_set(actor) @revive_input = true $game_party.members.each_with_index do |v,i| if v.id == actor.id @revive_actor_index = i break end end end def revive_input @revive_input end def revive_input_start @revive_input_start end def setup_revive_input @revive_input_start = true @actor_index = @revive_actor_index actor.make_actions @revive_input = false end def inject_revive_actor @action_battlers.insert(0,actor) end alias :rev_next_command :next_command def next_command if @revive_input_start inject_revive_actor @revive_input_start = false return false end rev_next_command end alias :rev_prior_command :prior_command def prior_command return false if @revive_input_start rev_prior_command end def in_turn? return false if @revive_input_start @phase == :turn end end end class Scene_Battle < Scene_Base def process_action return if scene_changing? if !@subject || !@subject.current_action if BattleManager.revive_input BattleManager.setup_revive_input start_actor_command_selection return end @subject = BattleManager.next_subject end return turn_end unless @subject if @subject.current_action @subject.current_action.prepare if @subject.current_action.valid? @status_window.open execute_action end @subject.remove_current_action end process_action_end unless @subject.current_action end def prior_command if BattleManager.prior_command start_actor_command_selection elsif BattleManager.revive_input_start @actor_command_window.activate else start_party_command_selection end end end class Game_Actor def revive @hp = 1 if @hp == 0 return if !$game_party.in_battle BattleManager.revive_input_set(self) end end
RaidenInfinity 发表于 2017-1-24 13:27
根据提供的范例大致弄出了效果:
6111.jpg (26.6 KB, 下载次数: 29)
module BattleManager class << self alias :rev_init_members :init_members def init_members @revive_input = [] @revive_input_start = [] @revive_actor_index = [] end def revive_input_set(actor) @revive_input.push(true) $game_party.members.each_with_index do |v,i| if v.id == actor.id @revive_actor_index.push(i) break end end end def revive_input @revive_input[0] end def revive_input_start @revive_input_start[0] end def setup_revive_input @revive_input.shift @actor_index = @revive_actor_index.shift actor.make_actions if actor.auto_battle? actor.make_auto_battle_actions inject_revive_actor else @revive_input_start.push(true) SceneManager.scene.start_actor_command_selection end end def inject_revive_actor actor.make_speed @action_battlers.push(actor) @action_battlers.sort! {|a,b| b.speed - a.speed } end alias :rev_next_command :next_command def next_command if revive_input_start inject_revive_actor @revive_input_start.shift return false end rev_next_command end alias :rev_prior_command :prior_command def prior_command return false if revive_input_start rev_prior_command end def in_turn? return false if revive_input_start @phase == :turn end end end class Scene_Battle < Scene_Base def process_action return if scene_changing? if !@subject || !@subject.current_action if BattleManager.revive_input BattleManager.setup_revive_input return end @subject = BattleManager.next_subject end return turn_end unless @subject if @subject.current_action @subject.current_action.prepare if @subject.current_action.valid? @status_window.open execute_action end @subject.remove_current_action end process_action_end unless @subject.current_action end def prior_command if BattleManager.prior_command start_actor_command_selection elsif BattleManager.revive_input_start @actor_command_window.activate else start_party_command_selection end end end class Game_Actor def revive @hp = 1 if @hp == 0 return if !$game_party.in_battle BattleManager.revive_input_set(self) end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |