# 毎フレーズSPを回復する # ターンごとではなく、1ユニット行動する事に回復するのが特徴 # 回復量は21行目で変更。デフォルトは最大SPの1%。 # #============================================================================== # ■ Scene_SLG(パーティコマンドフェーズ) #------------------------------------------------------------------------------ #  SLG戦闘の処理を行うクラスです。 # パーティコマンドフェーズ(phase2)について定義しています。 #============================================================================== class Scene_SLG #-------------------------------------------------------------------------- # ● 次のユニットの行動へ移る(名称はphase3_nextだがphase4でも使う) #-------------------------------------------------------------------------- def sp_recover unless @active_battler.dead? or @active_battler.hidden for actor in $game_party.actors unless actor.dead? or actor.hidden # 回復する割合を設定 actor.sp += actor.maxsp / 100 end end end end #-------------------------------------------------------------------------- # ● 次のユニットの行動へ移る(名称はphase3_nextだがphase4でも使う) #-------------------------------------------------------------------------- def phase3_next # スリップダメージ if @active_battler.hp > 0 and @active_battler.slip_damage? and @active_battler.charge_time == 0 @active_battler.slip_damage_effect @active_battler.damage_pop = true end # リジェネレーション # 既存のステートのループ for state_id in @active_battler.states # 存在しない時は無視 unless $data_states[state_id] == nil effect = @active_battler.states_new_effect(state_id) regene = effect[5] break if regene == true end end if @active_battler.hp > 0 and regene == true and @active_battler.charge_time == 0 @active_battler.regeneration_effect @active_battler.damage_pop = true end # スリップダメージとリジェネレーションの数値をまとめてHPから減算 @active_battler.hp -= @active_battler.damage if @active_battler.damage_pop # 行動順序配列の基準となる素早さ基準点を更新 battle_agi_pos if $game_temp.forcing_battler != nil # @add_waitを加算してすぐに行動のキャラだけ更新 update_phase3_forcing_unit_actionnumber else # @add_waitを加算して行動順序配列を更新 update_phase3_unit_actionnumber end # 行動順序ウィンドウをリフレッシュ @turn_window.refresh # 勝敗判定 unless $game_system.battle_interpreter.running? if judge # 勝利または敗北の場合 : メソッド終了 return end end # アクターコマンドウィンドウを無効化 @actor_command_window.active = false @actor_command_window.visible = false # 移動範囲を解放 $game_map.moverec_x.clear $game_map.moverec_y.clear $game_map.update @spriteset.update # 詠唱中の強制行動なら、強制行動の解除を行わない。 unless @charging_forcing # 強制行動フラグを解除 @active_battler.current_action.forcing = false # アクション強制対象のバトラーをクリア $game_temp.forcing_battler = nil else @charging_forcing = false @active_battler.current_action.save_set(@ca_save) end # SPを回復 sp_recover # ニューターンウィンドウを不可視化 @newturn_window.set_visible(false) # ステータスウィンドウをリフレッシュ @status_window.refresh $game_map.unit_status = 0 $game_map.unit_check = 0 # ターンカウント・カウント済みフラグを解除 @turn_count_flag = false # 蘇生魔法・アイテムを初期化 @hp0_actor_target = nil # ユニット行動フェーズ開始 start_phase3 return end #-------------------------------------------------------------------------- # ● 次のユニットの行動へ移る(逃走に失敗した時の処理) #-------------------------------------------------------------------------- def escape_phase3_next # パーティコマンドウィンドウを無効化 @party_command_window.active = false @party_command_window.visible = false # ヘルプウィンドウに文字を表示 @help_window.set_text("逃げ切れなかった!", 1) @wait_count = 40 # 主人公全員をすぐに行動・待機扱い for i in 1 .. $game_party.actors.size # イベントIDを代入 @unit_date_id = i # イベントIDからユニットデータに変換する $game_temp.active_unit = $game_map.unit_data[@unit_date_id] # XP本来のスクリプトとすり合わせる @active_battler = $game_map.unit_data[@unit_date_id] # 行動順序ウィンドウを更新 update_phase3_forcing_unit_actionnumber end # 行動順序ウィンドウをリフレッシュ @turn_window.refresh # 勝敗判定 unless $game_system.battle_interpreter.running? if judge # 勝利または敗北の場合 : メソッド終了 return end end # ターン数カウント if @turn_count >= $game_map.unit_array.size $game_temp.battle_turn += 1 @turn_count = 0 # バトルイベントの全ページを検索 for index in 0...$data_troops[@troop_id].pages.size # イベントページを取得 page = $data_troops[@troop_id].pages[index] # このページのスパンが [ターン] の場合 if page.span == 1 # 実行済みフラグをクリア $game_temp.battle_event_flags[index] = false end end end @turn_count += $game_party.actors.size - 1 # アクターコマンドウィンドウを無効化 @actor_command_window.active = false @actor_command_window.visible = false # 移動範囲を解放 $game_map.moverec_x.clear $game_map.moverec_y.clear $game_map.update @spriteset.update # SPを回復 sp_recover # ニューターンウィンドウを不可視化 @newturn_window.set_visible(false) # ステータスウィンドウをリフレッシュ @status_window.refresh $game_map.unit_status = 0 $game_map.unit_check = 0 # ターンカウント・カウント済みフラグを解除 @turn_count_flag = false # アクション強制対象のバトラーをクリア $game_temp.forcing_battler = nil # 蘇生魔法・アイテムを初期化 @hp0_actor_target = nil # ユニット行動フェーズ開始 start_phase3 return end end