# # 連続スキル攻撃(Ver2.00) #  (C)2005 TYPE74RX-T # # 必須スクリプト:アクターの複数回行動 #  (上記のスクリプトセクションのすぐ下にスクリプトを入れて下さい。) # # ★ 連続スキル可能なステートを設定しているステートID #  (数値はお好みにより変更して下さい。) RX_T_CSS_ID = 18 # ★ 連続スキル回数を設定(数値はお好みにより変更して下さい。) RX_T_CSS_FREQUENCY = 3 class Scene_Battle # ★ スキル選択フラグ @rx_t_skill_sel = false #-------------------------------------------------------------------------- # ★ アクターコマンドウィンドウをリメイク #-------------------------------------------------------------------------- def remake_command_window(renzoku) s2 = "" if @actor_command == true @actor_command_window.dispose @actor_command_window = nil end if renzoku == 1 s2 = "連続" + $data_system.words.skill else s2 = $data_system.words.skill end s1 = $data_system.words.attack s3 = $data_system.words.guard s4 = $data_system.words.item @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4]) @actor_command = true @actor_command_window.y = 160 @actor_command_window.back_opacity = 160 @actor_command_window.active = false @actor_command_window.visible = false end #-------------------------------------------------------------------------- # ★ 行動回数を初期化(連続スキル専用再定義) #-------------------------------------------------------------------------- def rx_t_initialise_actor_times @rx_t_actor_times = [] rx_t_cas_i = 0 @rx_t_skill_sel = false for actor in $game_party.actors rx_t_cas = 1 if actor.states.include?(RX_T_CAS_ID) rx_t_cas = $rx_t_cas[RX_T_CAS_ID].times elsif actor.states.include?(RX_T_CSS_ID) rx_t_cas = $rx_t_cas[RX_T_CSS_ID].times end @rx_t_actor_times[rx_t_cas_i] = rx_t_cas rx_t_cas_i += 1 end end #-------------------------------------------------------------------------- # ● アクターコマンドウィンドウのセットアップ #-------------------------------------------------------------------------- alias rx_t_rgssb2_phase3_setup_command_window phase3_setup_command_window def phase3_setup_command_window # ★ 連続スキルステートを持っていれば # スキルコマンド名の頭に「連続」を付加 if @active_battler.states.include?(RX_T_CSS_ID) remake_command_window(1) else # ★ 通常のスキルコマンド名に戻す remake_command_window(0) end rx_t_rgssb2_phase3_setup_command_window end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド) #-------------------------------------------------------------------------- alias rx_t_rgssb2_update_phase3_basic_command update_phase3_basic_command def update_phase3_basic_command # ★ コマンドを可視状態に。 @actor_command_window.rx_t_enable_item(0) @actor_command_window.rx_t_enable_item(2) @actor_command_window.rx_t_enable_item(3) if @active_battler.states.include?(RX_T_CSS_ID) rx_t_rgssb2_update_phase3_basic_command_2 return end @rx_t_skill_sel = false rx_t_rgssb2_update_phase3_basic_command end #-------------------------------------------------------------------------- # ★ フレーム更新 (アクターコマンドフェーズ : 連続スキル専用基本コマンド) #-------------------------------------------------------------------------- def rx_t_rgssb2_update_phase3_basic_command_2 # 連続スキル発動可能ならスキル以外のコマンドをdisableに。 if @rx_t_skill_sel @actor_command_window.disable_item(0) @actor_command_window.disable_item(2) @actor_command_window.disable_item(3) end # 記憶しておく行動データを初期化 $rx_t_ad[@actor_index][@rx_t_actor_times[@actor_index]].kind = 0 $rx_t_ad[@actor_index][@rx_t_actor_times[@actor_index]].basic = 0 $rx_t_ad[@actor_index][@rx_t_actor_times[@actor_index]].skill_id = 0 $rx_t_ad[@actor_index][@rx_t_actor_times[@actor_index]].item_id = 0 # B ボタンが押された場合 if Input.trigger?(Input::B) @rx_t_skill_sel = false # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # 前のアクターのコマンド入力へ phase3_prior_actor return end # C ボタンが押された場合 if Input.trigger?(Input::C) # アクターコマンドウィンドウのカーソル位置で分岐 case @actor_command_window.index when 0 # 攻撃 # 一度スキル攻撃を選択していたらコマンド実行不能に if @rx_t_skill_sel # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.skill_id = 0 @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 0 # エネミーの選択を開始 start_enemy_select when 1 # スキル # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.kind = 1 # スキルの選択を開始 start_skill_select when 2 # 防御 # 一度スキル攻撃を選択していたらコマンド実行不能に if @rx_t_skill_sel # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end @active_battler.current_action.skill_id = 0 @rx_t_skill_sel = false @active_battler.current_action.target_index = -1 @rx_t_actor_times[@actor_index] = 1 # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 1 # 次のアクターのコマンド入力へ phase3_next_actor when 3 # アイテム # 一度スキル攻撃を選択していたらコマンド実行不能に if @rx_t_skill_sel # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.kind = 2 # # アイテムの選択を開始 start_item_select end return end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : スキル選択) #-------------------------------------------------------------------------- alias rx_t_rgssb2_update_phase3_skill_select update_phase3_skill_select def update_phase3_skill_select if @active_battler.states.include?(RX_T_CSS_ID) update_phase3_skill_select_2 return end rx_t_rgssb2_update_phase3_skill_select end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : 連続スキル専用スキル選択) #-------------------------------------------------------------------------- def update_phase3_skill_select_2 # スキルウィンドウを可視状態にする @skill_window.visible = true # スキルウィンドウを更新 @skill_window.update # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # スキルの選択を終了 end_skill_select return end # C ボタンが押された場合 if Input.trigger?(Input::C) # スキルウィンドウで現在選択されているデータを取得 @skill = @skill_window.skill # 使用できない場合 if @skill == nil or not @active_battler.skill_can_use?(@skill.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.skill_id = @skill.id # スキルウィンドウを不可視状態にする @skill_window.visible = false # 効果範囲が敵単体の場合 if @skill.scope == 1 # エネミーの選択を開始 start_enemy_select # 効果範囲が味方単体の場合 elsif @skill.scope == 3 or @skill.scope == 5 # アクターの選択を開始 start_actor_select # 効果範囲が単体ではない場合 else @rx_t_skill_sel = true # スキルの選択を終了 end_skill_select # 次のアクターのコマンド入力へ phase3_next_actor end return end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択) #-------------------------------------------------------------------------- alias rx_t_rgssb2_update_phase3_enemy_select update_phase3_enemy_select def update_phase3_enemy_select if @active_battler.states.include?(RX_T_CSS_ID) rx_t_rgssb2_update_phase3_enemy_select_2 return end rx_t_rgssb2_update_phase3_enemy_select end #-------------------------------------------------------------------------- # ★ フレーム更新 (アクターコマンドフェーズ : 連続スキル専用エネミー選択) #-------------------------------------------------------------------------- def rx_t_rgssb2_update_phase3_enemy_select_2 # エネミーアローを更新 @enemy_arrow.update # B ボタンが押された場合 if Input.trigger?(Input::B) # スキル選択状況を初期化 @active_battler.current_action.skill_id = 0 if @enemy_arrow.index >= 0 @enemy_arrow.index = -1 end # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # エネミーの選択を終了 end_enemy_select return end # C ボタンが押された場合 if Input.trigger?(Input::C) # スキル行動を選択していなければ一回行動モードに。 # そうでなければスキル行動フラグを立てる if @active_battler.current_action.skill_id == 0 @rx_t_actor_times[@actor_index] = 1 @rx_t_skill_sel = false else @rx_t_skill_sel = true end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.target_index = @enemy_arrow.index # エネミーの選択を終了 end_enemy_select # スキルウィンドウ表示中の場合 if @skill_window != nil # スキルの選択を終了 end_skill_select end # アイテムウィンドウ表示中の場合 if @item_window != nil # アイテムの選択を終了 end_item_select end # 次のアクターのコマンド入力へ phase3_next_actor end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : アクター選択) #-------------------------------------------------------------------------- alias rx_t_rgssb2_update_phase3_actor_select update_phase3_actor_select def update_phase3_actor_select if @active_battler.states.include?(RX_T_CSS_ID) rx_t_rgssb2_update_phase3_actor_select_2 return end rx_t_rgssb2_update_phase3_actor_select end #-------------------------------------------------------------------------- # ★ フレーム更新 (アクターコマンドフェーズ : 連続スキル専用アクター選択) #-------------------------------------------------------------------------- def rx_t_rgssb2_update_phase3_actor_select_2 # アクターアローを更新 @actor_arrow.update # B ボタンが押された場合 if Input.trigger?(Input::B) # スキル選択状況を初期化 @active_battler.current_action.skill_id = 0 if @actor_arrow.index >= 0 @actor_arrow.index = -1 end # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # アクターの選択を終了 end_actor_select return end # C ボタンが押された場合 if Input.trigger?(Input::C) # スキル行動を選択していなければ一回行動モードに。 # そうでなければスキル行動フラグを立てる if @active_battler.current_action.skill_id == 0 @rx_t_actor_times[@actor_index] = 1 @rx_t_skill_sel = false else if @active_battler.current_action.item_id == 0 @rx_t_skill_sel = true else @rx_t_actor_times[@actor_index] = 1 @rx_t_skill_sel = false end end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 @active_battler.current_action.target_index = @actor_arrow.index # アクターの選択を終了 end_actor_select # スキルウィンドウ表示中の場合 if @skill_window != nil # スキルの選択を終了 end_skill_select end # アイテムウィンドウ表示中の場合 if @item_window != nil # アイテムの選択を終了 end_item_select end # 次のアクターのコマンド入力へ phase3_next_actor end end #-------------------------------------------------------------------------- # ● メインフェーズ開始(連続スキル専用再定義) #-------------------------------------------------------------------------- def start_phase4 # ★ 逃走フラグが立っていない時 #  (逃走による不具合を防ぐ) unless @rx_t_run_away rx_t_cnt_i = 0 for actor in $game_party.actors rx_t_cas = 1 # ★ 連続行動ステートがあるなら if actor.states.include?(RX_T_CAS_ID) # 連続行動 rx_t_cas = $rx_t_cas[RX_T_CAS_ID].times elsif actor.states.include?(RX_T_CSS_ID) # 連続行動 rx_t_cas = $rx_t_cas[RX_T_CSS_ID].times end # ★ 最初に取る行動を代入 rx_t_switch = false rx_t_switch2 = false rx_t_switch3 = false rx_t_switch4 = false if actor.states.include?(RX_T_CSS_ID) and actor.current_action.kind < 2 rx_t_switch = true end if actor.states.include?(RX_T_CSS_ID) and actor.current_action.basic <= 1 rx_t_switch2 = true end if actor.states.include?(RX_T_CSS_ID) and actor.current_action.item_id == 0 rx_t_switch3 = true end if actor.states.include?(RX_T_CAS_ID) or rx_t_switch rx_t_switch4 = true end #actor.name = $rx_t_ad[rx_t_cnt_i][rx_t_cas].name if rx_t_switch4 and not rx_t_switch2 and not rx_t_switch3 actor.current_action.kind = $rx_t_ad[rx_t_cnt_i][rx_t_cas].kind actor.current_action.basic = $rx_t_ad[rx_t_cnt_i][rx_t_cas].basic actor.current_action.skill_id = $rx_t_ad[rx_t_cnt_i][rx_t_cas].skill_id actor.current_action.item_id = $rx_t_ad[rx_t_cnt_i][rx_t_cas].item_id end if actor.current_action.item_id != 0 and actor.states.include?(RX_T_CSS_ID) elsif actor.states.include?(RX_T_CAS_ID) actor.current_action.target_index = $rx_t_ad[rx_t_cnt_i][rx_t_cas].target elsif actor.current_action.skill_id != 0 and actor.states.include?(RX_T_CSS_ID) actor.current_action.target_index = $rx_t_ad[rx_t_cnt_i][rx_t_cas].target end rx_t_cnt_i += 1 end end rx_t_cas_start_phase4 end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備) # (連続スキル専用再定義) #-------------------------------------------------------------------------- def update_phase4_step1 rx_t_cas_update_phase4_step1 # ★ 行動者がアクターの場合 if @active_battler.is_a?(Game_Actor) # ★ 行動数の設定 @rx_t_acts = 1 if @active_battler.states.include?(RX_T_CAS_ID) @rx_t_acts = $rx_t_cas[RX_T_CAS_ID].times elsif @active_battler.states.include?(RX_T_CSS_ID) # ★ 連続行動の最初の選択でスキルを使っていなければ行動は一度のみ if @active_battler.current_action.skill_id == 0 or @active_battler.current_action.item_id > 0 @rx_t_acts = 1 else @rx_t_acts = $rx_t_cas[RX_T_CSS_ID].times end end end end #-------------------------------------------------------------------------- # ★ フレーム更新 (メインフェーズ ステップ 7 : 連続行動可能時の行動設定) #-------------------------------------------------------------------------- def update_phase4_step7 if @rx_t_acts > 1 rx_t_i = 0 for actor in $game_party.actors if @active_battler.name == actor.name and actor.states.include?(RX_T_CAS_ID) break elsif @active_battler.name == actor.name and actor.states.include?(RX_T_CSS_ID) break end rx_t_i += 1 end # 次の行動を代入 @active_battler.current_action.kind = $rx_t_ad[rx_t_i][@rx_t_acts - 1].kind @active_battler.current_action.basic = $rx_t_ad[rx_t_i][@rx_t_acts - 1].basic @active_battler.current_action.skill_id = $rx_t_ad[rx_t_i][@rx_t_acts - 1].skill_id @active_battler.current_action.item_id = $rx_t_ad[rx_t_i][@rx_t_acts - 1].item_id @active_battler.current_action.target_index = $rx_t_ad[rx_t_i][@rx_t_acts - 1].target # ステップ 8 に移行 @phase4_step = 8 else # ステップ 1 に移行 @phase4_step = 1 end end end class Scene_Title #-------------------------------------------------------------------------- # ● メイン処理(連続スキル専用再定義) #-------------------------------------------------------------------------- def main # ★ アクターの行動データを初期化 rx_t_i = rx_t_j = 0 $rx_t_ad = nil $rx_t_ad = [[],[],[],[],[]] for rx_t_i in 0..3 for rx_t_j in 0..4 $rx_t_ad[rx_t_i][rx_t_j] = RX_T_ActorDoing.new end end $rx_t_cas = [] $rx_t_cas[RX_T_CAS_ID] = RX_T_Continuous_Action_State.new $rx_t_cas[RX_T_CAS_ID].times = RX_T_CAS_FREQUENCY $rx_t_cas[RX_T_CSS_ID] = RX_T_Continuous_Action_State.new $rx_t_cas[RX_T_CSS_ID].times = RX_T_CSS_FREQUENCY rx_t_cas_main end end