#============================================================================== # ■ 戦闘不能者自動復活 #------------------------------------------------------------------------------ # 戦闘不能になったアクター、またはエネミーを自動で復活させます # 設定の仕方は通常のステートの自動解除と同じく○ターン経過後○%で復活します。 # アクター又はエネミーだけ自動で復活するようにも設定できます # # *月の下の宿 # URL:http://gekkasou.shiteyattari.com/ #============================================================================== module An_DMM #アクターを自動復活させる DMM_Actors = true #アクターが自動復活するターン数 #nilに指定するとデータベースの設定に準じます DMMA_Turn = nil #アクターが復活する確立(%) #DMMA_Turnがnilならば自動でnilとして扱います DMMA_Percent = 100 #エネミーを自動復活させる DMM_Enemies = true #エネミーが自動復活するターン数 #nilに指定するとデータベースの設定に準じます DMME_Turn = 5 #エネミーが復活する確立(%) #DMME_Turnがnilならば自動でnilとして扱います DMME_Percent = 50 end #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler include An_DMM #-------------------------------------------------------------------------- # ● ステートの付加 #-------------------------------------------------------------------------- alias an_dedmanmoves_add_state add_state def add_state(state_id) an_dedmanmoves_add_state(state_id) if state_id == 1 && self == Game_Actor @state_turns[state_id] = DMMA_Turn.nil? ? state.hold_turn : DMMA_Turn elsif state_id == 1 && self == Game_Enemy @state_turns[state_id] = DMME_Turn.nil? ? state.hold_turn : DMME_Turn end end #-------------------------------------------------------------------------- # ● ステート自然解除 (ターンごとに呼び出し) #-------------------------------------------------------------------------- alias an_dedmanmoves_remove_states_auto remove_states_auto def remove_states_auto clear_action_results if !self.dead? an_dedmanmoves_remove_states_auto return end case self when Game_Actor return unless DMM_Actors prob = !DMMA_Turn.nil? ? DMMA_Percent : $data_states[1].auto_release_prob prob = $data_states[1].auto_release_prob if DMMA_Percent.nil? when Game_Enemy return unless DMM_Enemies prob = !DMME_Turn.nil? ? DMME_Percent : $data_states[1].auto_release_prob prob = $data_states[1].auto_release_prob if DMME_Percent.nil? end if @state_turns.keys.include?(1) if @state_turns[1] > 0 @state_turns[1] -= 1 elsif rand(100) < prob remove_state(1) @removed_states.push(1) end end end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● ターン終了 #-------------------------------------------------------------------------- alias an_dedmanmoves_turn_end turn_end def turn_end for i in $game_party.dead_members + $game_troop.dead_members @message_window.clear @active_battler = i remove_states_auto display_current_state @message_window.clear end an_dedmanmoves_turn_end end end #Ver1.00