#============================================================================== # ■ RGSS3 消去無効ステート Ver1.02 by 星潟 #------------------------------------------------------------------------------ # 全回復、戦闘不能、逃走(敵)の際に消去されないステートを作成します。 #============================================================================== # ステートのメモ欄に記述。 #============================================================================== # <全回復時残留> # # このステートは全回復(イベントコマンド「全回復」)を使用しても解除されない。 #------------------------------------------------------------------------------ # <戦闘不能時残留> # # このステートは戦闘不能時に解除されない。 #------------------------------------------------------------------------------ # <逃走時残留> # # このステートは逃走時に解除されない。 #============================================================================== module UnclearableState #ステートのメモ欄に記入する為の設定用ワードを指定。 Words = ["全回復時残留","戦闘不能時残留","逃走時残留"] end class Game_BattlerBase #-------------------------------------------------------------------------- # ステート情報をクリア #-------------------------------------------------------------------------- alias clear_states_unclearable clear_states def clear_states if @unclearable_flag @states ||= [] s1 = @states.clone s2 = @state_turns.clone s3 = @state_steps.clone end clear_states_unclearable return unless @unclearable_flag s1.each {|s| next unless s && $data_states[s].unclearable_type[@unclearable_flag] @states.push(s) @state_turns[s] = s2[s] @state_steps[s] = s3[s]} end #-------------------------------------------------------------------------- # 全回復 #-------------------------------------------------------------------------- alias recover_all_unclearable_state recover_all def recover_all @unclearable_flag = 0 recover_all_unclearable_state @unclearable_flag = nil end end class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # 戦闘不能になる #-------------------------------------------------------------------------- alias die_unclearable_state die def die @unclearable_flag = 1 die_unclearable_state @unclearable_flag = nil end #-------------------------------------------------------------------------- # 逃げる #-------------------------------------------------------------------------- alias escape_unclearable_state escape def escape @unclearable_flag = 2 escape_unclearable_state @unclearable_flag = nil end end class RPG::State < RPG::BaseItem #-------------------------------------------------------------------------- # 消去無効判定 #-------------------------------------------------------------------------- def unclearable_type @unclearable_type ||= create_unclearable_type end #-------------------------------------------------------------------------- # 消去無効判定作成 #-------------------------------------------------------------------------- def create_unclearable_type UnclearableState::Words.inject([]) {|r,t| r.push(note.include?(t))} end end