【低创】将抗性降到0以下的插件
抗性降到0以下,也就是越打血越多这种抖m行为不符合大众的价值观,于是就被禁止了
=begin
伤害吸收插件
by 炽天裁决
挨打回血,天子快乐插件
使用说明
在备注栏填入<dam_absorb: 属性:抗性数值(,+)>
例如<dam_absorb: 3:-0.5,1:0.2>
属性中 -1 代表普通攻击,0,代表无属性
填入低于 -1 的值可以适用于所有伤害
游戏中,持有此装备/状态/职业/角色ID的角色会用备注中的抗性结算(会覆盖掉原有的设定)
所有抗性会在全部抗性中取最优(这一点和预设是相反的,不然无法实现效果)
=end
class RPG::BaseItem
def dam_absorb
if @dam_absorb.nil?
@dam_absorb = []
if @note =~ /<dam_absorb:[ ](.*)>/i
for x in $1.split(",")
a = []
for y in x.split(":")
a +=
end
@dam_absorb +=
end
end
end
@dam_absorb
end
end
class Game_Battler
alias absorb_element_rate element_rate
def element_rate(i)
r = e_absorb_value(i)
er = absorb_element_rate(i)
if r != nil
er = r if r < er
end
return er
end
def item_element_rate(user, item)
r = nil
a = element_absorb
a.each{|x|
if x < -1
r = x if r == nil
r = x if x <= r
end
}
if item.damage.element_id < 0
if user.atk_elements.empty?
er = element_rate(-1)
else
er = elements_max_rate(user.atk_elements)
end
else
er = element_rate(item.damage.element_id)
end
if r != nil
er = r if r < er
end
return er
end
def elements_max_rate(elements)
r = elements.inject([]) {|r, i| r.push(element_rate(i)) }.min
r = 1.0 if r == nil
return r
end
def element_absorb
return []
end
def e_absorb_value(id)
r = nil
absorb = element_absorb
absorb.each{|i|
if i == id
r = i if r == nil
r = i if i < r
end
}
return r
end
end
class Game_Actor < Game_Battler
def element_absorb
absorb = self.class.dam_absorb + actor.dam_absorb
equips.each do |eq|
absorb += eq.dam_absorb unless eq.nil?
end
states.each do |st|
absorb += st.dam_absorb
end
absorb= absorb .uniq
return absorb
end
end
class Game_Enemy < Game_Battler
def element_absorb
absorb = enemy.dam_absorb
states.each do |st|
absorb += st.dam_absorb
end
absorb= absorb .uniq
return absorb
end
end
页:
[1]