#============================================================================== # ■ Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :position_events # 待機イベントのハッシュ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- unless defined?(ZTBS::ZTBSB16_DEFINED) alias ztbsb16_initialize initialize def initialize @position_events = position_event ztbsb16_initialize end end #-------------------------------------------------------------------------- # ● カスタマイズ #-------------------------------------------------------------------------- def position_event case $game_map.map_id #============================================================================== # ↓↓設定箇所は説明の下にあります↓↓ #============================================================================== #------------------------------------------------------------------------------ # when タクティカルマップID # return {[X座標条件, Y座標条件, アクターID(無くてもOK)] => コモンイベントID} #------------------------------------------------------------------------------ # # ※指定した範囲内に入ると、イベントが発生します。 # IDに"actor"を入れるとアクターの誰かが、 # "enemy"を入れるとエネミーの誰かが入ると発生します。 # #============================================================================== # ここより下が設定箇所です #============================================================================== when 21 return {["7-14", nil, 1] => 53} #============================================================================== # ここより上で設定してください #============================================================================== else return {} end end #-------------------------------------------------------------------------- # ● フレーム更新 (ステップ 10 共有 : 行動終了) #-------------------------------------------------------------------------- def update_step10 # スリップダメージ if @attacker.hp > 0 and @attacker.slip_damage? @attacker.slip_damage_effect @active_battler.damage = @attacker.damage @active_battler.damage_pop = true end # ステート自然解除 @attacker.remove_states_auto # エネミーが戦闘不能になった場合 if @attacker.is_a?(Game_Enemy) and @attacker.dead? # 経験値など獲得 get_exp_etc(@attacker) end # 消去対象をチェック set_erase_battler # カーソル位置を戻す back_cursor refresh_battler_info # エネミーフェーズの場合、ステップ 0 へ if $game_system.tactics_phase == 2 @wait_count = ZTBS::ENEMY_THINKING if @attacker.dead? @enemy_index -= 1 end # 待機時イベントの判定 for position in @position_events if position[0][0].nil? x_if = [0, 999] elsif position[0][0] =~ /(\d*)-(\d*)/ x_if = [($1 == "" ? 0 : $1.to_i), ($2 == "" ? 999 : $2.to_i)] end if position[0][1].nil? y_if = [0, 999] elsif position[0][1] =~ /(\d*)-(\d*)/ y_if = [($1 == "" ? 0 : $1.to_i), ($2 == "" ? 999 : $2.to_i)] end if @active_battler.x.between?(x_if[0], x_if[1]) and @active_battler.y.between?(y_if[0], y_if[1]) and position[0][2] == "enemy" common_id = position[1] $game_system.map_interpreter.setup($data_common_events[common_id].list, 0) @position_events.delete(position) end end # 行動者を解放 @active_battler.acted = true @active_battler = nil @attacker = nil # ステップ 0 に移行 $game_system.tactics_step = 0 if @targets != nil @targets.clear end return end # カーソル固定を解除 $game_player.not_update = false # 待機時イベントの判定 for position in @position_events if position[0][0].nil? x_if = [0, 999] elsif position[0][0] =~ /(\d*)-(\d*)/ x_if = [($1 == "" ? 0 : $1.to_i), ($2 == "" ? 999 : $2.to_i)] end if position[0][1].nil? y_if = [0, 999] elsif position[0][1] =~ /(\d*)-(\d*)/ y_if = [($1 == "" ? 0 : $1.to_i), ($2 == "" ? 999 : $2.to_i)] end if @active_battler.x.between?(x_if[0], x_if[1]) and @active_battler.y.between?(y_if[0], y_if[1]) and (position[0][2] == @attacker.id or position[0][2] == "actor") common_id = position[1] $game_system.map_interpreter.setup($data_common_events[common_id].list, 0) @position_events.delete(position) end end # 行動者を解放 @active_battler.acted = true @active_battler = nil @attacker = nil # ステップ 1 に移行 $game_system.tactics_step = 1 # 対象を解放 if @targets != nil @targets.clear end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターフェーズ ステップ 13 : 待機コマンド) #-------------------------------------------------------------------------- if self.class.method_defined?("update_phase1_step13") def update_phase1_step13 # 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 # ステップ 11 へ移行 $game_system.tactics_step = 11 end # C ボタンが押された場合 if Input.trigger?(Input::C) # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # コマンドウィンドウ解放 dispose_command_window # カーソル固定を解除 $game_player.not_update = false # 待機時イベントの判定 for position in @position_events if position[0][0].nil? x_if = [0, 999] elsif position[0][0] =~ /(\d*)-(\d*)/ x_if = [($1 == "" ? 0 : $1.to_i), ($2 == "" ? 999 : $2.to_i)] end if position[0][1].nil? y_if = [0, 999] elsif position[0][1] =~ /(\d*)-(\d*)/ y_if = [($1 == "" ? 0 : $1.to_i), ($2 == "" ? 999 : $2.to_i)] end if @active_battler.x.between?(x_if[0], x_if[1]) and @active_battler.y.between?(y_if[0], y_if[1]) and (position[0].size == 2 or position[0][2] == @attacker.id) common_id = position[1] $game_system.map_interpreter.setup($data_common_events[common_id].list, 0) @position_events.delete(position) end end # 行動者を解放 @active_battler.acted = true @active_battler = nil @attacker = nil # ステップ 1 へ移行 $game_system.tactics_step = 1 end end end end #============================================================================== # ■ ZTBS #============================================================================== module ZTBS ZTBSB16_DEFINED = true end