class Game_Battler #-------------------------------------------------------------------------- # ● [追加]护盾属性读取 #-------------------------------------------------------------------------- def barrier @barrier >= 0 ? @barrier : (@barrier = 0) end #-------------------------------------------------------------------------- # ● [别名修改]受到伤害时解除状态 #-------------------------------------------------------------------------- alias remove_states_by_damage_for_barrier remove_states_by_damage def remove_states_by_damage remove_states_by_damage_for_barrier # 原方法 barrier_states = states.select{|state| state.barrier_value(self) != 0} if !barrier_states.empty? total_barrier = barrier_states.map{|state|state.barrier_value(self)}.inject(:+) barrier_states.sort_by{|state|state.barrier_value(self)}.each do |state| if total_barrier - @barrier >= state.barrier_value(self) total_barrier -= @barrier remove_state(state.id) end end end end end
class Game_Battler
#--------------------------------------------------------------------------
# ● [追加]护盾属性读取
#--------------------------------------------------------------------------
def barrier
@barrier >= 0 ? @barrier : (@barrier = 0)
end
#--------------------------------------------------------------------------
# ● [别名修改]受到伤害时解除状态
#--------------------------------------------------------------------------
alias remove_states_by_damage_for_barrier remove_states_by_damage
def remove_states_by_damage
remove_states_by_damage_for_barrier # 原方法
barrier_states = states.select{|state| state.barrier_value(self) != 0}
if !barrier_states.empty?
total_barrier = barrier_states.map{|state|state.barrier_value(self)}.inject(:+)
barrier_states.sort_by{|state|state.barrier_value(self)}.each do |state|
if total_barrier - @barrier >= state.barrier_value(self)
total_barrier -= @barrier
remove_state(state.id)
end
end
end
end
end
找个空白的地方加入这个看看 |