#============================================================================== # ○ステート解除タイミングステート Ver1.00 # for RGSS2 # 西瓜 / Space not far # http://muspell.raindrop.jp/ # 特定のステートが解除されるタイミングで別のステートを付加または # 解除するシステムです。 #============================================================================== # ■更新履歴 # Ver1.01 # ・解除タイミング解除ステートを設定していると自然治癒時にエラーが出るのを # やや強引に修正。 #============================================================================== # ステートのメモ欄に<解除タイミング付加:n> # または<解除タイミング解除:n>と書き込むことで # そのステートが解除される時にn番のステートを付加あるいは解除するようになります。 # ■仕様 # 解除タイミングに設定されたステートの付加/解除メッセージが # 表示されることはありません。 class Game_Battler SNF_RELEASE_INVEST = "解除タイミング付加" SNF_RELEASE_RELEASE = "解除タイミング解除" #-------------------------------------------------------------------------- # ● ステートの解除 # state_id : ステート ID #-------------------------------------------------------------------------- alias snf_change_remove_state remove_state def remove_state(state_id) return unless state?(state_id) # 解除タイミング付加 memo = $data_states[state_id].note.scan(/<#{SNF_RELEASE_INVEST}[::](\d+)>/) if memo != nil and not memo.empty? add_state(memo[0][0].to_i) @added_states.push(memo[0][0].to_i) end # 解除タイミング解除 memo = $data_states[state_id].note.scan(/<#{SNF_RELEASE_RELEASE}[::](\d+)>/) if memo != nil and not memo.empty? snf_change_remove_state(memo[0][0].to_i) @removed_states.push(memo[0][0].to_i) end snf_change_remove_state(state_id) end #-------------------------------------------------------------------------- # ● ステート自然解除 (ターンごとに呼び出し) #-------------------------------------------------------------------------- # 再定義 def remove_states_auto clear_action_results for i in @state_turns.keys.clone next if @state_turns[i] == nil if @state_turns[i] > 0 @state_turns[i] -= 1 elsif rand(100) < $data_states[i].auto_release_prob remove_state(i) @removed_states.push(i) end end end end