QQ图片20161112181311.png (5.08 KB, 下载次数: 16)
#-------------------------------------------------------------------------- # ● 受到伤害时解除状态 #-------------------------------------------------------------------------- def remove_states_by_damage states.each do |state| if state.remove_by_damage && rand(100) < state.chance_by_damage remove_state(state.id) end end end
class Game_Battler < Game_BattlerBase alias :es_item_apply :item_apply def item_apply(user, item) @item = item es_item_apply(user,item) end #将[1,2,3,4]改成你要免除解除状态的属性ID组 #如果只有一个的话,[1] 这样就行了 alias :es_remove_states_by_damage :remove_states_by_damage def remove_states_by_damage if @item if [1,2,3,4].include?(@item.damage.element_id) return end end es_remove_states_by_damage end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |