#============================================================================== # [ZTBS] -Zenith Tactical Battle System- タクティカルバトルシステム #  〜+B10:ZTBS ActionEx併用化〜   by 水夜 #  ver0.90  Zenith Creation (http://zenith.ifdef.jp/) #------------------------------------------------------------------------------ # マップ上での戦略的なバトルを実現。 #  ※「特殊効果詰め合わせActionEx」・・・スクリプトシェルフ(桜雅在土氏) #                   http://scriptshelf.jpn.org/x/ #============================================================================== #============================================================================== # --- エフェクト表示中判定:予約時は false --- #============================================================================== class Spriteset_Map include XRXS_WAIT_COUNT_PLAN alias xrxs66_effect? effect? def effect? return false if @@wait_count_plan_enable return xrxs66_effect? end end #============================================================================== # ■ Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :active_battler # アクティブなバトラー #-------------------------------------------------------------------------- # ● いんくるーど #-------------------------------------------------------------------------- include(XRXS_WAIT_COUNT_PLAN) #-------------------------------------------------------------------------- # ● エフェクト表示中か #-------------------------------------------------------------------------- alias xrxs66_effect? effect? def effect? return false if @@wait_count_plan_enable return xrxs66_effect? end #-------------------------------------------------------------------------- # ● アクターフェーズ開始 #-------------------------------------------------------------------------- alias :xrxs37_start_phase1 :start_phase1 def start_phase1 # ターン開始時の処理 xrxs37_beginning_of_a_turn(true) # 初期化済みフラグをクリア @firstival_phase4_done = false # 呼び戻す xrxs37_start_phase1 end #-------------------------------------------------------------------------- # ● エネミーフェーズ開始 #-------------------------------------------------------------------------- alias :xrxs37_start_phase2 :start_phase2 def start_phase2 # ターン開始時の処理 xrxs37_beginning_of_a_turn(false) # 初期化済みフラグをクリア @firstival_phase4_done = false # 呼び戻す xrxs37_start_phase2 end #-------------------------------------------------------------------------- # ○ ターン開始時の処理 #-------------------------------------------------------------------------- def xrxs37_beginning_of_a_turn(is_actor) # 継続チェック if is_actor battlers = $game_system.tactics_actors.values else battlers = $game_system.tactics_enemies.values end for battler in battlers next if battler.current_action.cast_duration <= 0 # 条件ステートが解除された場合、ため/詠唱発動をキャンセルする if battler.current_action.condition_state_id > 0 and (not battler.state?(battler.current_action.condition_state_id)) battler.current_action.cast_duration = 0 end # スキルが使用不可能に変化した場合、ため/詠唱発動をキャンセルする if battler.current_action.kind == 1 and (!battler.skill_can_use?(battler.current_action.skill_id) or battler.restriction >= 2) battler.current_action.cast_duration = 0 battler.remove_state(battler.current_action.condition_state_id) end end end #-------------------------------------------------------------------------- # ○ 生存確認 #-------------------------------------------------------------------------- def target_battlers_still_arive? all_dead = true for i in @targets.keys all_dead &= @targets[i].dead? end return !all_dead end #-------------------------------------------------------------------------- # ● タクティクス終了処理 #-------------------------------------------------------------------------- alias :xrxs37_end_tactics :end_tactics def end_tactics # 溜めを解除 for actor in $game_system.tactics_actors.values + $game_system.tactics_dead_actors.values actor.current_action.cast_duration = 0 end # 呼び戻す xrxs37_end_tactics end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ) #-------------------------------------------------------------------------- def update_phase1 # ウィンドウ位置調整 move_window # 戦闘不能復活判定 battler_revival # 勝敗判定 if judge return end # エフェクト中の場合 if effect? return end # カーソル移動中の場合 if Spriteset_Map.method_defined?("cursor_sprite") and @spriteset.cursor_sprite.moving? return end # イベント実行中の場合 if $game_system.map_interpreter.running? return end # セレクト中の場合 if @select != nil and @select != 10 update_select return end # リザルトウィンドウ表示中の場合 if defined? result_window and result_window return end if Scene_Map.method_defined?("update_phase1_step10") # ステップに応じて更新 case $game_system.tactics_step when 0 update_phase1_step0 when 1 update_phase1_step1 when 2 update_phase1_step2 when 3 update_phase1_step3 when 4 update_phase1_step4 when 5 update_phase1_step5 when 6 update_phase1_step6 when 6.5 update_phase1_step6_another when 7 update_step7 when 8 update_step8 when 9 update_step9 when 10 update_phase1_step10 when 11 update_step10 when 12 update_phase1_step11 when 13 update_phase1_step12 when 14 update_phase1_step13 end else # ステップに応じて更新 case $game_system.tactics_step when 0 update_phase1_step0 when 1 update_phase1_step1 when 2 update_phase1_step2 when 3 update_phase1_step3 when 4 update_phase1_step4 when 5 update_phase1_step5 when 6 update_phase1_step6 when 6.5 update_phase1_step6_another when 7 update_step7 when 8 update_step8 when 9 update_step9 when 10 update_step10 when 11 update_phase1_step11 when 12 update_phase1_step12 when 13 update_phase1_step13 end end if $game_system.tactics_step != 1 return end # 全員行動済み判定 case all_acted? when 1 start_phase2 return when 2 # 未行動アクター処理 not_acted_actor_refresh return end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ セレクト) #-------------------------------------------------------------------------- def update_select # C ボタンが押された場合 if Input.trigger?(Input::C) # アクターウィンドウ if @select_window.is_a?(Window_TActors) # 現在選択されているアクターを取得 actor = $game_map.events[@select_window.actor] if $game_system.tactics_step == 0 if !$game_system.tactics_actors.keys.include?(@select_window.actor) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end else if $game_system.tactics_actors.keys.include?(@select_window.actor) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # セレクトウィンドウを解放 dispose_select_window # セレクト終了 @select = nil # カーソル固定を解除 $game_player.not_update = false if $game_system.tactics_step != 0 # 攻撃エリアをセット set_attack_area(0) # ステップ 6 へ移行 $game_system.tactics_step = 6 @targets = {} @targets[actor.id] = $game_system.tactics_dead_actors[actor.id] return end @battler = actor $game_player.moveto(@battler.x, @battler.y) # ヘルプウィンドウにアクターをセット set_battler_info # ステップ 1 へ移行 $game_system.tactics_step = 1 # スキルウィンドウ elsif @select_window.is_a?(Window_TSkill) # スキルウィンドウで現在選択されているデータを取得 @skill = @select_window.skill # 使用できない場合 if @skill == nil or not @attacker.skill_can_use?(@skill.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) @skill = nil return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @attacker.current_action.skill_id = @skill.id # セレクトウィンドウを解放 dispose_select_window # 対象が戦闘不能味方の場合 if @skill.scope == 5 or @skill.scope == 6 # セレクトウィンドウを作成 make_select_window(0,0) @revival = true return end # ヘルプウィンドウにアクターをセット set_battler_info # ステップ 6 へ移行 $game_system.tactics_step = 6 # セレクト終了 @select = 10 # 攻撃エリアをセット set_attack_area(0) # カーソル固定を解除 $game_player.not_update = false # アイテムウィンドウ elsif @select_window.is_a?(Window_TItem) # アイテムウィンドウで現在選択されているデータを取得 @item = @select_window.item # 使用できない場合 if @attacker.can_use?(2, @item.id) if @item == nil or not $game_party.item_can_use?(@item.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) @item = nil return end end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @attacker.current_action.item_id = @item.id # セレクトウィンドウを解放 dispose_select_window # 対象が戦闘不能味方の場合 if @item.scope == 5 or @item.scope == 6 # セレクトウィンドウを作成 make_select_window(0,0) @revival = true return end # ヘルプウィンドウにアクターをセット set_battler_info # ステップ 6 へ移行 $game_system.tactics_step = 6 # セレクト終了 @select = 10 # 攻撃エリアをセット set_attack_area(0) # カーソル固定を解除 $game_player.not_update = false end end # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # セレクトウィンドウを解放 dispose_select_window # 戦闘不能者選択中 if @revival != nil and $game_system.tactics_step != 0 # セレクトウィンドウを作成 case @attacker.current_action.kind when 1 make_select_window(1, @attacker, @skill) when 2 make_select_window(2, nil, @item) end @revival = nil return end # コマンドウィンドウを作成 make_command_window(@select) # ヘルプウィンドウにアクターをセット set_battler_info # セレクト終了 @select = nil # ステップ 2 帰還フラグ解除 @back_step2 = nil end end #-------------------------------------------------------------------------- # ○ 行動の初期化 #-------------------------------------------------------------------------- def xrxs37_clear_actions # エネミーのターン回数をリセット @firstival_phase4_done = false if @firstival_phase4_done.nil? unless @firstival_phase4_done for enemy in $game_troop.enemies enemy.current_action.turn_move_times = 0 end end @firstival_phase4_done = true # 初期化 @phase4_act_times = 0 @phase4_act_times_max = 1 @phase4_hit_times = 0 @phase4_hit_times_max = 1 @skill = nil @weapon_id = nil @total_target_battlers = [] end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ ステップ 2 : 移動前コマンド) #-------------------------------------------------------------------------- def update_phase1_step2 # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # コマンドウィンドウを解放 dispose_command_window # カーソル固定を解除 $game_player.not_update = false # ステップ 1 へ移行 $game_system.tactics_step = 1 end # C ボタンが押された場合 if Input.trigger?(Input::C) # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # コマンドによって分岐 case @command_window.index # 移動 when 0 # コマンドウィンドウ解放 dispose_command_window # 移動エリアをセット set_movable_area(0) # カーソル固定を解除 $game_player.not_update = false # ステップ 3 へ移行 $game_system.tactics_step = 3 # 行動バトラー設定 @active_battler = @battler # 防御 when 1 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # 防御状態に設定 @attacker.current_action.kind = 0 @attacker.current_action.basic = 1 # コマンドウィンドウ解放 dispose_command_window # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップ 10 へ移行 $game_system.tactics_step = 10 # 攻撃 when 2 # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@battler.id] if !Game_Battler.method_defined?("can_use?") or @attacker.can_use?(0) # コマンドウィンドウ解放 dispose_command_window # 行動バトラー設定 @active_battler = @battler # アクションを設定 @attacker.current_action.kind = 0 @attacker.current_action.basic = 0 # 攻撃エリアをセット set_attack_area(0) # カーソル固定を解除 $game_player.not_update = false # ステップ 6 へ移行 $game_system.tactics_step = 6 # ステップ 2 帰還フラグ @back_step2 = true end # スキル when 3 # コマンドウィンドウ解放 dispose_command_window # セレクト へ移行 @select = 2 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # セレクトウィンドウを作成 make_select_window(1, @attacker) # アクションを設定 @attacker.current_action.kind = 1 # ステップ 2 帰還フラグ @back_step2 = true # アイテム when 4 # コマンドウィンドウ解放 dispose_command_window # セレクト へ移行 @select = 3 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # セレクトウィンドウを作成 make_select_window(2, @attacker) # アクションを設定 @attacker.current_action.kind = 2 # ステップ 2 帰還フラグ @back_step2 = true # その他 else if defined?("talk_event") # 「待機」のための分岐 if defined?(XRXS_CP_SYSTEM) and @command_window.index == 5 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # コマンドウィンドウ解放 dispose_command_window # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップ 10 へ移行 $game_system.tactics_step = 10 else @commands = @command_window.commands @comindex = @command_window.index @comvalue = @commands[@comindex] # コマンドウィンドウ解放 dispose_command_window # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # アクションを設定 @attacker.current_action.kind = 0 @attacker.current_action.basic = @comindex # 攻撃エリアをセット set_attack_area(0) # カーソル固定を解除 $game_player.not_update = false # ステップ 6 へ移行 $game_system.tactics_step = 6 # ステップ 2 帰還フラグ @back_step2 = true end # 待機 else # コマンドウィンドウ解放 dispose_command_window # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップ 10 へ移行 $game_system.tactics_step = 10 end end end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ ステップ 5 : 移動後コマンド) #-------------------------------------------------------------------------- def update_phase1_step5 # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # コマンドウィンドウ解放 dispose_command_window # 元の位置に戻す @active_battler.moveto(@pre_x, @pre_y) # カーソル位置を戻す back_cursor # 移動エリアをセット set_movable_area(0) # カーソル固定を解除 $game_player.not_update = false # ステップ 3 へ移行 $game_system.tactics_step = 3 end # C ボタンが押された場合 if Input.trigger?(Input::C) # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # コマンドによって分岐 case @command_window.index # 攻撃 when 0 # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] if !defined?("can_use?") or @attacker.can_use?(0) # コマンドウィンドウ解放 dispose_command_window # 行動バトラー設定 @active_battler = @battler # アクションを設定 @attacker.current_action.kind = 0 @attacker.current_action.basic = 0 # 攻撃エリアをセット set_attack_area(0) # カーソル固定を解除 $game_player.not_update = false # ステップ 6 へ移行 $game_system.tactics_step = 6 end # 防御 when 1 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # 防御状態に設定 @attacker.current_action.kind = 0 @attacker.current_action.basic = 1 # コマンドウィンドウ解放 dispose_command_window # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップ 10 へ移行 $game_system.tactics_step = 10 # スキル when 2 # コマンドウィンドウ解放 dispose_command_window # セレクト へ移行 @select = 1 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # セレクトウィンドウを作成 make_select_window(1, @attacker) # アクションを設定 @attacker.current_action.kind = 1 # アイテム when 3 # コマンドウィンドウ解放 dispose_command_window # セレクト へ移行 @select = 2 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # セレクトウィンドウを作成 make_select_window(2, @attacker) # アクションを設定 @attacker.current_action.kind = 2 # 待機 when 4 # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # コマンドウィンドウ解放 dispose_command_window # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップ 10 へ移行 $game_system.tactics_step = 10 # その他 else @commands = @command_window.commands @comindex = @command_window.index @comvalue = @commands[@comindex] # コマンドウィンドウ解放 dispose_command_window # 行動バトラー設定 @active_battler = @battler # 攻撃バトラー取得 @attacker = $game_system.tactics_actors[@active_battler.id] # アクションを設定 @attacker.current_action.kind = 0 @attacker.current_action.basic = @comindex # 攻撃エリアをセット set_attack_area(0) # カーソル固定を解除 $game_player.not_update = false # ステップ 6 へ移行 $game_system.tactics_step = 6 end end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ ステップ 6 : 対象選択) #-------------------------------------------------------------------------- def update_phase1_step6 # カーソル位置のバトラー(イベント)取得 get_cursor_battler # ヘルプウィンドウにアクター or エネミーをセット set_battler_info # 座標から向きを変える sx = $game_player.x - @active_battler.x sy = $game_player.y - @active_battler.y # 横の距離のほうが長い場合 if sx.abs > sy.abs # 左右方向で指定イベントのいるほうを向く result = sx > 0 ? 6 : 4 # 縦の距離のほうが長い場合 elsif sx.abs < sy.abs # 上下方向で指定イベントのいるほうを向く result = sy > 0 ? 2 : 8 # 同じ場合 else # 右下 if sx > 0 and sy > 0 if @active_battler.direction == 4 or @active_battler.direction == 8 result = 6 else result = @active_battler.direction end # 右上 elsif sx > 0 if @active_battler.direction == 2 or @active_battler.direction == 4 result = 6 else result = @active_battler.direction end # 左下 elsif sy > 0 if @active_battler.direction == 6 or @active_battler.direction == 8 result = 4 else result = @active_battler.direction end # 左上 elsif sx < 0 and sy < 0 if @active_battler.direction == 2 or @active_battler.direction == 6 result = 4 else result = @active_battler.direction end # 中心 else result = @active_battler.direction end end if @active_battler.direction != result @active_battler.turn(result) @battler = @active_battler set_attack_area(0) end # C ボタンが押された場合 if Input.trigger?(Input::C) and !$game_player.moving? # 発動可能な場合 if possible_action? # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # 行動の初期化 xrxs37_clear_actions # エリアを透明化 invisible_area # 攻撃行動 update_phase1_step6_another else # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) end end # B ボタンが押された場合 if Input.trigger?(Input::B) and !$game_player.moving? @targets = nil @revival = nil # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # エリアを解放 dispose_area # カーソル位置を戻す back_cursor # カーソルを固定 $game_player.not_update = true if @back_step2 != nil and @back_step2 # ステップ 2 へ移行 $game_system.tactics_step = 2 if @select != nil case @attacker.current_action.kind when 1 # セレクトウィンドウを作成 make_select_window(1, @attacker, @skill) @select = 2 when 2 # セレクトウィンドウを作成 make_select_window(2, nil, @item) @select = 3 end else @back_step2 = nil # コマンドウィンドウを作成 make_command_window(1) end else # ステップ 5 へ移行 $game_system.tactics_step = 5 if @select != nil case @attacker.current_action.kind when 1 # セレクトウィンドウを作成 make_select_window(1, @attacker, @skill) @select = 1 when 2 # セレクトウィンドウを作成 make_select_window(2, nil, @item) @select = 2 end else # コマンドウィンドウを作成 make_command_window end end end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ ステップ 6.5 : 攻撃準備) #-------------------------------------------------------------------------- def update_phase1_step6_another # 発動可能な場合 if possible_action? @back_step2 = nil # カーソルを固定 $game_player.not_update = true # ステップ 7 へ移行 $game_system.tactics_step = 7 @select = nil if @revival == nil # ターゲットを取得 @targets = {} for i in @can_attack if $game_system.tactics_actors.keys.include?(i) @targets[i] = $game_system.tactics_actors[i] $game_map.events[i].turn_toward_event(@active_battler.id) unless defined?(ZTBSB18) end if $game_system.tactics_enemies.keys.include?(i) @targets[i] = $game_system.tactics_enemies[i] $game_map.events[i].turn_toward_event(@active_battler.id) unless defined?(ZTBSB18) end end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end @active_battler.turn_toward_position($game_player.x, $game_player.y) # 戦闘不能回復の場合 else $game_map.events[@targets.keys[0]].moveto($game_player.x, $game_player.y) @active_battler.turn_toward_position($game_player.x, $game_player.y) $game_map.events[@targets.keys[0]].turn_toward_event(@active_battler.id) unless defined?(ZTBSB18) end @revival = nil @can_attack = nil # アクション結果作成 case @attacker.current_action.kind when 0 if @attacker.current_action.basic < 4 make_basic_action_result else event_id = cando_id($game_player.x, $game_player.y) common_id = @talk_events[event_id][1] $game_system.map_interpreter.setup($data_common_events[common_id].list, 0) @talk_events.delete(event_id) # ステップ 10 へ移行 $game_system.tactics_step = 10 end when 1 make_skill_action_result when 2 make_item_action_result end else $game_system.tactics_step = 10 end # 普通の行動をする場合 if $game_system.tactics_step == 7 # 連続行動中は 対象アニメへ if @phase4_act_times >= 1 $game_system.tactics_step = 8 # 連続ヒット中 ダメージ表示へ elsif @phase4_hit_times >= 1 $game_system.tactics_step = 9 end end end #-------------------------------------------------------------------------- # ● 基本アクション 結果作成 #-------------------------------------------------------------------------- alias :xrxs37_make_basic_action_result :make_basic_action_result def make_basic_action_result # 攻撃の場合 if @attacker.current_action.basic == 0 # 武器IDの取得 @weapon_id = @attacker.is_a?(Game_Actor) ? @attacker.weapon_id : 0 # 消費 if@weapon_id > 0 @attacker.hp -= $data_weapons[@weapon_id].hp_cost(@attacker) @attacker.sp -= $data_weapons[@weapon_id].sp_cost(@attacker) end # 使用する武器の特殊効果の取得 if Game_Battler.method_defined?("multy_element_set") @attacker.current_action.set_xrxs37_special_effect(@attacker.multy_element_set) else @attacker.current_action.set_xrxs37_special_effect(@attacker.equip_element_set) end # 特殊効果:行動回数 @phase4_act_times_max = [@attacker.current_action.move_times, 1].max # 最低1回 # 特殊効果:ヒット回数 @phase4_hit_times_max = [@attacker.current_action.hit_times, 1].max # 最低1回 end # 呼び戻す xrxs37_make_basic_action_result end #-------------------------------------------------------------------------- # ● スキルアクション 結果作成 #-------------------------------------------------------------------------- alias xrxs37_make_skill_action_result make_skill_action_result def make_skill_action_result # スキルを取得 @skill = $data_skills[@attacker.current_action.skill_id] # キャスト中でない場合 if @attacker.current_action.cast_duration <= 0 # 特殊効果:詠唱発動 returnar = XRXS.element_check(@attacker.skill_element_set(@skill), XRXS37::CAST_CHANT) if returnar[0] @attacker.current_action.cast_duration = returnar[1] state_id = get_state_id_cast_chant @attacker.current_action.condition_state_id = state_id @attacker.add_state(state_id) if state_id > 0 # 実際にステート付加 end # 特殊効果:溜め発動 returnar = XRXS.element_check(@attacker.skill_element_set(@skill), XRXS37::CAST_DURATION) if returnar[0] @attacker.current_action.cast_duration = returnar[1] end end # キャスト中の場合 if @attacker.current_action.cast_duration >= 2 @animation1_id = @skill.animation1_id @animation2_id = 0 return end # [消費ステート]の判別 if @attacker.current_action.condition_state_id > 0 # 設定されている場合 if @attacker.state?(@attacker.current_action.condition_state_id) # 条件を満たした場合 ステートを解除する @attacker.remove_state(@attacker.current_action.condition_state_id) else # 条件を満たしていない場合 @animation1_id = 0 @animation2_id = 0 return end end # 既に一回以上行動している場合 if @phase4_act_times >= 1 or @phase4_hit_times >= 1 # # スキルの消費分を復旧させ、擬似的にHP/SPを減らさない ( HP消費に対応 ) # @attacker.cost_restore(@skill) else # 使用するスキルの特殊効果の取得 @attacker.current_action.set_xrxs37_special_effect(@attacker.skill_element_set(@skill)) # 特殊効果:行動回数 @phase4_act_times_max = [@attacker.current_action.move_times, 1].max # 特殊効果:ヒット回数 @phase4_hit_times_max = [@attacker.current_action.hit_times, 1].max end # 足りるかを判定 unless @attacker.skill_can_use?(@skill.id) # ステップ 1 に移行 @phase4_step = 1 return end # コモンイベント ID を設定 @common_event_id = @skill.common_event_id # # SPとHPを消費 # ( make_skill_action_result メソッドにステータスウィンドウの # リフレッシュがあるため、呼び戻すより前に SPとHP を消費させる。) # @attacker.hp -= @skill.hp_cost(@attacker) @attacker.sp -= @skill.sp_cost(@attacker) # 都合によりSPの回復 @attacker.sp += @skill.sp_cost # 呼び戻す xrxs37_make_skill_action_result # SPの制限の解除 @attacker.sp0_ban = false # 既に一回以上ヒット/行動している、またはため中の場合 if (@phase4_hit_times >= 1 or @phase4_act_times >= 1) or (@attacker.current_action.cast_duration >= 2) @help_window.visible = false end # ためスキル発動時はアニメ1を消す if @attacker.current_action.cast_duration == 1 @animation1_id = 0 end end #-------------------------------------------------------------------------- # ● アイテムアクション 結果作成 #-------------------------------------------------------------------------- alias :xrxs37_make_item_action_result :make_item_action_result def make_item_action_result @item = $data_items[@attacker.current_action.item_id] # 使用できない場合 unless defined?("can_use?") or not @attacker.can_use?(2, @item_window.item.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 消費 @attacker.hp -= @item.hp_cost(@attacker) @attacker.sp -= @item.sp_cost(@attacker) # アイテムを取得 @item = $data_items[@attacker.current_action.item_id] # アイテム切れなどで使用できなくなった場合 unless $game_party.item_can_use?(@item.id) # 呼び戻す xrxs37_make_item_action_result return end # 特殊効果の設定 @attacker.current_action.set_xrxs37_special_effect(@item.element_set) # 呼び戻す xrxs37_make_item_action_result # コモンイベント ID を設定 @common_event_id = @item.common_event_id # 既に一回以上ヒット/行動している場合 if @phase4_hit_times >= 1 or @phase4_act_times >= 1 # ヘルプウィンドウを隠す @help_window.visible = false end end #-------------------------------------------------------------------------- # ● フレーム更新 (ステップ 8 : 対象側アニメーション) #-------------------------------------------------------------------------- alias :xrxs66_update_step8 :update_step8 def update_step8 # 呼び戻す xrxs66_update_step8 # アニメーションの長さによって、待機フレーム数を設定 if @animation2_id > 0 and @@wait_count_plan.empty? previous_count = 0 for frame in XRXS_TIMINGS.get(@animation2_id) if defined?(XRXS66ZX) next_count = frame - previous_count else next_count = frame * 2 - previous_count end if next_count > 0 @@wait_count_plan.push(next_count) end previous_count = frame end @@wait_count_plan_enable = true end # ウェイトカウント予約をが空でないならシフト @wait_count = @@wait_count_plan.shift unless @@wait_count_plan.empty? end #-------------------------------------------------------------------------- # ● フレーム更新 (ステップ 9 : ダメージ表示) #-------------------------------------------------------------------------- def update_step9 @help_window.visible = false # ダメージ表示ラグ有りの場合 if ZTBS::DAMAGE_LAG if @targets.keys.size == 0 # 消去対象をチェック set_erase_battler # ステップ 10 に移行 $game_system.tactics_step = 10 elsif !@spriteset.effect? # ダメージ表示 i = @targets.keys[0] $game_map.events[i].damage = @targets[i].damage $game_map.events[i].critical = @targets[i].critical if $game_map.events[i].damage != nil hit = ($game_map.events[i].damage != "Miss") @spriteset.character_sprites[i].hit_change(@targets[i].index2, hit) $game_map.events[i].damage_pop = true end @targets.delete(i) end # ダメージ表示ラグ無しの場合 else # ダメージ表示 for i in @targets.keys $game_map.events[i].damage = @targets[i].damage $game_map.events[i].critical = @targets[i].critical if $game_map.events[i].damage != nil hit = ($game_map.events[i].damage != "Miss") @spriteset.character_sprites[i].hit_change(@targets[i].index2, hit) $game_map.events[i].damage_pop = true end end # 消去対象をチェック set_erase_battler # ステップ 10 に移行 $game_system.tactics_step = 10 end # まずは今回のターゲットを保存 @total_target_battlers += @targets.values # 連続行動を判定 xrxs37_continuous_action_check # ステップ 10 へ行く場合 if $game_system.tactics_step == 10 # 総ターゲットを復帰 @target_battlers = @total_target_battlers # 最低 10 フレーム待つ @wait_count = 10 end end #-------------------------------------------------------------------------- # ○ 連続行動を判定 (「ヒット回数」「行動回数」「派生」) #-------------------------------------------------------------------------- def xrxs37_continuous_action_check # ターゲットらの判定 target_still_left = false for i in @targets.keys # 戦闘不能による「ため」のキャンセル if @targets[i].dead? and @targets[i].current_action.cast_duration >= 0 @targets[i].current_action.cast_duration = 0 end # 生存判定 target_still_left |= !@targets[i].dead? end # # [ヒット回数] # @phase4_hit_times += 1 if target_still_left and @phase4_hit_times < @phase4_hit_times_max $game_system.tactics_step = 6.5 return end # 生存確認 (@target_battlersが変更) target_still_left |= target_battlers_still_arive? # # [行動回数] # @phase4_act_times += 1 if target_still_left and @phase4_act_times < @phase4_act_times_max # 指定行動回数に満たない場合は繰り返す為、ステップ 6.5 に移行 $game_system.tactics_step = 6.5 @wait_count = 0 @phase4_hit_times = 0 return else # ヘルプウィンドウを隠す @help_window.visible = false end # # 「派生」 # # 属性配列を取得 set = [] case @attacker.current_action.kind when 0 if @attacker.current_action.basic == 0 set = @attacker.equip_element_set end when 1 set = @skill.element_set end # ステート異常の場合は属性をクリア set.clear if @attacker.restriction >= 2 # 全員を一時的に不死身にして対処 for target in ($game_system.tactics_actors.values + $game_system.tactics_enemies.values) if target.t_immortal target.t_immortal = target.immortal end end end #-------------------------------------------------------------------------- # ● フレーム更新 (ステップ 10 共有 : 行動終了) #-------------------------------------------------------------------------- if Scene_Map.method_defined?("update_phase1_step10") alias ztbsb10_phase1_update_step10 update_phase1_step10 alias ztbsb10_phase2_update_step10 update_phase2_step10 def update_phase1_step10 # エリアを 解放 dispose_area # 固定ターゲットを解除 @fix_target = nil # ウェイト予約の終了 @@wait_count_plan_enable = false @@wait_count_plan.clear ztbsb10_phase1_update_step10 end def update_phase2_step10 # エリアを 解放 dispose_area # 固定ターゲットを解除 @fix_target = nil # ウェイト予約の終了 @@wait_count_plan_enable = false @@wait_count_plan.clear ztbsb10_phase2_update_step10 end else alias ztbsb10_update_step10 update_step10 def update_step10 # エリアを 解放 dispose_area # 固定ターゲットを解除 @fix_target = nil # ウェイト予約の終了 @@wait_count_plan_enable = false @@wait_count_plan.clear if @targets != nil for i in @targets.keys # エネミーが戦闘不能になった場合 if @targets[i].is_a?(Game_Enemy) and @targets[i].dead? # 経験値など獲得 get_exp_etc(@targets[i]) end end end # 呼び戻す ztbsb10_update_step10 end end #-------------------------------------------------------------------------- # ● フレーム更新 (エネミーフェーズ) #-------------------------------------------------------------------------- def update_phase2 # ウィンドウ位置調整 move_window # 戦闘不能復活判定 battler_revival # 勝敗判定 if judge return end # エフェクト中の場合 if effect? return end # カーソル移動中の場合 if Spriteset_Map.method_defined?("cursor_sprite") and @spriteset.cursor_sprite.moving? return end # イベント実行中の場合 if $game_system.map_interpreter.running? return end # リザルトウィンドウ表示中の場合 if defined? result_window and result_window return end if Scene_Map.method_defined?("update_phase2_step10") # ステップに応じて更新 case $game_system.tactics_step when 0 update_phase2_step0 when 1 update_phase2_step1 when 2 update_phase2_step2 when 3 update_phase2_step3 when 4 update_phase2_step4 when 5 update_phase2_step5 when 6 update_phase2_step6 when 6.5 update_phase2_step6_another when 7 update_step7 when 8 update_step8 when 9 update_step9 when 10 update_phase2_step10 when 11 update_step10 when 12 update_phase2_step11 when 13 update_phase2_step12 end else # ステップに応じて更新 case $game_system.tactics_step when 0 update_phase2_step0 when 1 update_phase2_step1 when 2 update_phase2_step2 when 3 update_phase2_step3 when 4 update_phase2_step4 when 5 update_phase2_step5 when 6 update_phase2_step6 when 6.5 update_phase2_step6_another when 7 update_step7 when 8 update_step8 when 9 update_step9 when 10 update_step10 when 11 update_phase2_step11 when 12 update_phase2_step12 end end if $game_system.tactics_step != 1 return end # 全員行動済み判定 case all_acted? when 1 start_phase1 return when 2 # 未行動エネミー処理 not_acted_enemy_refresh return end end #-------------------------------------------------------------------------- # ● フレーム更新 (エネミーフェーズ ステップ 2 : アクション判定) #-------------------------------------------------------------------------- def update_phase2_step2 @wait_count = ZTBS::ENEMY_THINKING # 行動できない場合 if @attacker.restriction == 4 # ステップを 10 に設定 $game_system.tactics_step = 10 return end # 防御 or 何もしない の場合 if @attacker.current_action.kind == 0 and (@attacker.current_action.basic == 1 or @attacker.current_action.basic == 3) # ステップを 10 に設定 $game_system.tactics_step = 10 return end # 攻撃エリア検索 position = search_attack_area # 攻撃 の場合 if @attacker.current_action.kind == 0 and @attacker.current_action.basic == 0 and @active_battler.move_frequency != 6 # 攻撃範囲が定義されている場合 if defined? ENEMY_RANGE # 攻撃ターゲット判定 targets = check_attack_target(position) @fix_targets = targets if [8, 11].include?(@now_scope) ts = targets[1].select{|i| $game_system.tactics_actors.keys.include?(i)} else ts = targets[1] end if ts.size > 0 @targets = {} @target_position = targets[0] for i in targets[1] if $game_system.tactics_actors.keys.include?(i) @targets[i] = $game_system.tactics_actors[i] else @targets[i] = $game_system.tactics_enemies[i] end end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end # 攻撃エリアをセット set_attack_area(1) # ステップを 6 に設定 $game_system.tactics_step = 6 return else # 最も近いバトラー取得 case @now_scope when 0, 1, 2, 5, 6, 9 id = nearest_battler($game_system.tactics_actors.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] when 3, 4, 7, 10 id = nearest_battler($game_system.tactics_enemies.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] when 8, 11 id = nearest_battler($game_system.tactics_actors.keys + $game_system.tactics_enemies.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] end end else @attacker.set_xrxs69_special_scope(@attacker.skill_element_set(skill)) case @attacker.current_action.scope_force when 12 if [1, 3, 5].include?(skill.scope) scope = skill.scope + 1 else scope = skill.scope end when 0 scope = skill.scope else scope = @attacker.current_action.scope_force end @now_scope = scope # 対象の種類取得 case scope when 1, 2, 9 type = 0 when 3, 4, 7, 10 type = 1 when 8, 11 type = 2 end targets = battlers_in_area(position, type) @fix_targets = targets if targets.size > 0 @targets = {} id = decide_target(targets) @target_position = [$game_map.events[id].x, $game_map.events[id].y] if $game_system.tactics_actors.keys.include?(id) @targets[i] = $game_system.tactics_actors[id] else @targets[i] = $game_system.tactics_enemies[id] end # 攻撃エリアをセット set_attack_area(1) # ステップを 6 に設定 $game_system.tactics_step = 6 return else # 最も近いバトラー取得 case @now_scope when 0, 1, 2, 5, 6, 9 id = nearest_battler($game_system.tactics_actors.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] when 3, 4, 7, 10 id = nearest_battler($game_system.tactics_enemies.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] when 8, 11 id = nearest_battler($game_system.tactics_actors.keys + $game_system.tactics_enemies.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] end end end # スキル の場合 elsif @attacker.current_action.kind == 1 and @active_battler.move_frequency != 6 # スキル取得 skill = $data_skills[@attacker.current_action.skill_id] # スキルターゲット判定 targets = check_skill_target(skill, position) @fix_targets = targets if [8, 11].include?(@now_scope) ts = targets[1].select{|i| $game_system.tactics_actors.keys.include?(i)} else ts = targets[1] end if ts.size > 0 @targets = {} @target_position = targets[0] for i in targets[1] if $game_system.tactics_actors.keys.include?(i) @targets[i] = $game_system.tactics_actors[i] else @targets[i] = $game_system.tactics_enemies[i] end end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end # 攻撃エリアをセット set_attack_area(1) # ステップを 6 に設定 $game_system.tactics_step = 6 return else # 最も近いバトラー取得 case @now_scope when 0, 1, 2, 5, 6, 9 id = nearest_battler($game_system.tactics_actors.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] when 3, 4, 7, 10 id = nearest_battler($game_system.tactics_enemies.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] when 8, 11 id = nearest_battler($game_system.tactics_actors.keys + $game_system.tactics_enemies.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] end end else # 最も近いアクター取得 id = nearest_battler($game_system.tactics_actors.keys) @target_position = [$game_map.events[id].x, $game_map.events[id].y] end # 移動開始距離よりも遠い場合 if defined?(ZTBS::MOVEABLE_SA) sa = (@active_battler.x - @target_position[0]).abs + (@active_battler.y - @target_position[1]).abs move = $game_system.tactics_enemies[@active_battler.id].movable if @active_battler.move_frequency != 6 if sa > (move * ZTBS::MOVEABLE_SA[@active_battler.move_frequency - 1]).ceil # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップを 10 に設定 $game_system.tactics_step = 10 return end end # 移動頻度が 1 の場合 elsif @active_battler.move_frequency == 1 # 再移動可能距離を0にする @attacker.more_step = 0 # ステップを 10 に設定 $game_system.tactics_step = 10 return end # 移動エリア検索 search_route # 動けない場合 if @position.size == 1 # 何気にその場でいる @target_position = @position[0] else # 逃げる の場合 if @attacker.current_action.kind == 0 and @attacker.current_action.basic == 2 # 移動先決定 @target_position = far_away_position(@target_position, @position) else # 移動先決定 @target_position = nearest_position(@target_position, @position) end end # 逃げる の場合 if @attacker.current_action.kind == 0 and @attacker.current_action.basic == 2 # 移動先決定 @target_position = far_away_position(@target_position, @position) else # 移動先決定 @target_position = nearest_position(@target_position, @position) end # 移動エリアをセット set_movable_area(1) # ステップを 3 に設定 $game_system.tactics_step = 3 end #-------------------------------------------------------------------------- # ● フレーム更新 (エネミーフェーズ ステップ 5 : アクション再判定) #-------------------------------------------------------------------------- def update_phase2_step5 @wait_count = ZTBS::ENEMY_THINKING # 防御 or 何もしない の場合 if @attacker.current_action.kind == 0 and (@attacker.current_action.basic == 1 or @attacker.current_action.basic == 3) # 再移動可能距離を0にする @attacker.more_step = 0 if Game_Battler.method_defined?("more_step") # ステップを 10 に設定 $game_system.tactics_step = 10 return end # 攻撃エリア検索 position = search_attack_area # 攻撃 の場合 if @attacker.current_action.kind == 0 and @attacker.current_action.basic == 0 # 攻撃範囲が定義されている場合 if defined? ENEMY_RANGE # 攻撃ターゲット判定 targets = check_attack_target(position) @fix_targets = targets if targets[1].size > 0 @targets = {} @target_position = targets[0] for i in targets[1] @targets[i] = $game_system.tactics_actors[i] end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end # 攻撃エリアをセット set_attack_area(1) # ステップを 6 に設定 $game_system.tactics_step = 6 return end else targets = battlers_in_area(position) @fix_targets = targets if targets.size > 0 @targets = {} id = decide_target(targets) @target_position = [$game_map.events[id].x, $game_map.events[id].y] if $game_system.tactics_actors.keys.include?(id) @targets[id] = $game_system.tactics_actors[id] else @targets[id] = $game_system.tactics_enemies[id] end # 攻撃エリアをセット set_attack_area(1) # ステップを 6 に設定 $game_system.tactics_step = 6 return end end # スキル の場合 elsif @attacker.current_action.kind == 1 # スキル取得 skill = $data_skills[@attacker.current_action.skill_id] # スキルターゲット判定 targets = check_skill_target(skill, position) @fix_targets = targets if targets[1].size > 0 @targets = {} @target_position = targets[0] for i in targets[1] if $game_system.tactics_actors.keys.include?(i) @targets[i] = $game_system.tactics_actors[i] else @targets[i] = $game_system.tactics_enemies[i] end end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end # 攻撃エリアをセット set_attack_area(1) # ステップを 6 に設定 $game_system.tactics_step = 6 return end end # ステップを 10 に設定 $game_system.tactics_step = 10 end #-------------------------------------------------------------------------- # ● フレーム更新 (エネミーフェーズ ステップ 6 : 対象選択) #-------------------------------------------------------------------------- def update_phase2_step6 # カーソル位置のバトラー(イベント)取得 get_cursor_battler # カーソル位置にバトラーがいる場合 if @battler != nil # ヘルプウィンドウにアクター or エネミーをセット set_battler_info # カーソル位置にバトラーがいない場合、ヘルプウィンドウを隠す else @help_window.visible = false end # 座標から向きを変える sx = $game_player.x - @active_battler.x sy = $game_player.y - @active_battler.y # 横の距離のほうが長い場合 if sx.abs > sy.abs # 左右方向で指定イベントのいるほうを向く result = sx > 0 ? 6 : 4 # 縦の距離のほうが長い場合 elsif sx.abs < sy.abs # 上下方向で指定イベントのいるほうを向く result = sy > 0 ? 2 : 8 # 同じ場合 else # 右下 if sx > 0 and sy > 0 if @active_battler.direction == 4 or @active_battler.direction == 8 result = 6 else result = @active_battler.direction end # 右上 elsif sx > 0 if @active_battler.direction == 2 or @active_battler.direction == 4 result = 6 else result = @active_battler.direction end # 左下 elsif sy > 0 if @active_battler.direction == 6 or @active_battler.direction == 8 result = 4 else result = @active_battler.direction end # 左上 elsif sx < 0 and sx < 0 if @active_battler.direction == 2 or @active_battler.direction == 6 result = 4 else result = @active_battler.direction end # 中心 else result = @active_battler.direction end end if @active_battler.direction != result @active_battler.turn(result) @battler = @active_battler set_attack_area(0) end # 現在カーソル位置記憶 @now_x = $game_player.x @now_y = $game_player.y # xrxs37_clear_actions # カーソル固定を解除 $game_player.not_update = false # 移動中の場合 if !move_cursor_auto(@target_position) return end # アクション結果作成 case @attacker.current_action.kind when 0 make_basic_action_result when 1 make_skill_action_result end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ハッシュの中身を1つにする key = @targets.keys[0] value = @targets[key] @targets.clear @targets[key] = value end # 互いに向き合う unless defined?(ZTBSB18) for i in @targets.keys $game_map.events[i].turn_toward_event(@active_battler.id) end end @active_battler.turn_toward_position($game_player.x, $game_player.y) # エリア透明化 invisible_area # ステップを 7 に設定 $game_system.tactics_step = 7 end #-------------------------------------------------------------------------- # ● フレーム更新 (エネミーフェーズ ステップ 6.5 : 攻撃準備) #-------------------------------------------------------------------------- def update_phase2_step6_another # 攻撃エリア検索 @battler = @active_battler position = [[$game_player.x, $game_player.y]] # 攻撃 の場合 if @attacker.current_action.kind == 0 and @attacker.current_action.basic == 0 # 攻撃範囲が定義されている場合 if defined? ENEMY_RANGE # ターゲットを復帰 targets = @fix_targets if targets[1].size > 0 @targets = {} @target_position = targets[0] for i in targets[1] @targets[i] = $game_system.tactics_actors[i] end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end # 攻撃エリアをセット set_attack_area(1) # ステップを 7 に設定 $game_system.tactics_step = 7 end else # ターゲットを復帰 targets = @fix_targets if targets.size > 0 @targets = {} id = decide_target(targets) @target_position = [$game_map.events[id].x, $game_map.events[id].y] if $game_system.tactics_actors.keys.include?(id) @targets[id] = $game_system.tactics_actors[id] else @targets[id] = $game_system.tactics_enemies[id] end # 攻撃エリアをセット set_attack_area(1) # ステップを 7 に設定 $game_system.tactics_step = 7 end end # スキル の場合 elsif @attacker.current_action.kind == 1 # スキル取得 skill = $data_skills[@attacker.current_action.skill_id] # ターゲットを復帰 targets = @fix_targets if targets[1].size > 0 @targets = {} @target_position = targets[0] for i in targets[1] if $game_system.tactics_actors.keys.include?(i) @targets[i] = $game_system.tactics_actors[i] else @targets[i] = $game_system.tactics_enemies[i] end end # 対象が全体でない場合 unless [2, 4, 6, 8].include?(@now_scope) # ターゲットが固定の場合、それを指定 if @fix_target == nil key = @targets.keys[rand(@targets.size)] else key = @fix_target end # ハッシュの中身を1つにする value = @targets[key] @targets.clear @targets[key] = value # 対象がランダムでない場合 if [1, 3, 5].include?(@now_scope) @fix_target = key else @fix_target = nil end end # 攻撃エリアをセット set_attack_area(1) # ステップを 7 に設定 $game_system.tactics_step = 7 end end # エリアを透明化 invisible_area # アクション結果作成 case @attacker.current_action.kind when 0 make_basic_action_result when 1 make_skill_action_result end # 普通の行動をする場合 if $game_system.tactics_step == 7 # 連続行動中は 対象アニメへ if @phase4_act_times >= 1 # 連続ヒット中 ダメージ表示へ $game_system.tactics_step = 8 elsif @phase4_hit_times >= 1 $game_system.tactics_step = 9 end end end #-------------------------------------------------------------------------- # ○ 戦闘不能を許可するか #-------------------------------------------------------------------------- def dead_ok? if @phase4_hit_times.is_a?(Numeric) if XRXS37::ALL_HIT if XRXS37::ALL_ACT or XRXS37::ALL_DERIVER return false if @phase4_hit_times < @phase4_hit_times_max else return (@phase4_hit_times < @phase4_hit_times_max) end end if XRXS37::ALL_ACT if XRXS37::ALL_DERIVER return false if @phase4_act_times < @phase4_act_times_max else return (@phase4_act_times < @phase4_act_times_max) end end if XRXS37::ALL_DERIVER and !$game_system.in_tactics return false if @derive_skill_id >= 0 end end return true end #-------------------------------------------------------------------------- # ● エリア透明化 #-------------------------------------------------------------------------- def invisible_area for sprite in @spriteset.area_sprites + @spriteset.range_sprites sprite.opacity = 0 end end end