#============================================================================== # ■ダメージ解除確率無視 for RGSS3 Ver1.03-β # □作成者 kure #============================================================================== #============================================================================== # ●■ RPG::UsableItem(追加定義集積) #============================================================================== class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # ● 指定IDに対する解除無視確率 #-------------------------------------------------------------------------- def ignore_remove_rate(id) @note.match(/<ダメージ解除無視\s?#{id}\s?,\s?(\d+)%\s?>/) return $1.to_i == id ? $2.to_i : 0 end end #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler < Game_BattlerBase attr_accessor :last_item_effect # 最終適用オブジェクト #-------------------------------------------------------------------------- # ● スキル/アイテムの効果適用(エイリアス) #-------------------------------------------------------------------------- alias k_before_state_dam_item_apply item_apply def item_apply(user, item) @last_item_effect = item k_before_state_dam_item_apply(user, item) end #-------------------------------------------------------------------------- # ● ダメージによるステート解除(再定義) #-------------------------------------------------------------------------- def remove_states_by_damage states.each {|state| next unless state.remove_by_damage next unless state.chance_by_damage > rand(100) next if @last_item_effect && @last_item_effect.ignore_remove_rate(state.id) > rand(100) remove_state(state.id) } end end