Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ■ BattleManager
- #------------------------------------------------------------------------------
- # 戦闘の進行を管理するモジュールです。
- #=============================================================================
- module BattleManager
- #--------------------------------------------------------------------------
- # ● インスタンスの複製
- #--------------------------------------------------------------------------
- instance_eval {alias ums_specific_event_battle_battle_start
- battle_start}
- instance_eval {alias ums_specific_event_battle_make_escape_ratio
- make_escape_ratio}
- #--------------------------------------------------------------------------
- # ● 戦闘開始
- #--------------------------------------------------------------------------
- def self.battle_start
- if @event_proc
- if $game_system.force_surprise_event
- @surprise = 100
- $game_system.force_surprise_event = false
- elsif $game_system.force_preemptive_event
- @preemptive = 100
- $game_system.force_preemptive_event = false
- elsif $game_system.same_on_encounter
- on_encounter
- $game_system.same_on_encounter = false
- end
- end
- ums_specific_event_battle_battle_start
- end
- #--------------------------------------------------------------------------
- # ● 逃走成功率の作成
- #--------------------------------------------------------------------------
- def self.make_escape_ratio
- if $game_system.force_escape_event
- $game_system.force_escape_event = false
- @escape_ratio = 100
- return
- end
- ums_specific_event_battle_make_escape_ratio
- end
- end
- #==============================================================================
- # ■ Game_System
- #------------------------------------------------------------------------------
- # システム周りのデータを扱うクラスです。セーブやメニューの禁止状態などを保存
- # します。このクラスのインスタンスは $game_system で参照されます。
- #==============================================================================
- class Game_System
- alias ums_specific_event_battle_initialize initialize
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :force_preemptive_event
- attr_accessor :force_surprise_event
- attr_accessor :same_on_encounter
- attr_accessor :force_escape_event
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- ums_specific_event_battle_initialize
- @force_preemptive_event = false
- @force_surprise_event = false
- @same_on_encounter = false
- @force_escape_event = false
- end
- end
- #==============================================================================
- # ■ Game_Interpreter
- #------------------------------------------------------------------------------
- # イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
- # Game_Troop クラス、Game_Event クラスの内部で使用されます。
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # ● 次のイベント戦を必ず先制攻撃にする
- #--------------------------------------------------------------------------
- def next_preemptive(value = true)
- $game_system.force_preemptive_event = value
- end
- #--------------------------------------------------------------------------
- # ● 次のイベント戦を必ず不意打ちにする
- #--------------------------------------------------------------------------
- def next_surprise(value = true)
- $game_system.force_surprise_event = value
- end
- #--------------------------------------------------------------------------
- # ● 次のイベント戦にて、先制攻撃か不意打ちを“起こり得る”ようにする
- #--------------------------------------------------------------------------
- def next_same_on_encount(value = true)
- $game_system.same_on_encounter = value
- end
- #--------------------------------------------------------------------------
- # ● 次のイベント戦を必ず逃走成功にする
- #--------------------------------------------------------------------------
- def next_surely_escape(value = true)
- $game_system.force_escape_event = value
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment