Project1
标题:
关于护盾跟施法者属性挂钩的脚本改造
[打印本页]
作者:
zx903193387
时间:
2016-10-4 16:01
标题:
关于护盾跟施法者属性挂钩的脚本改造
寻找到一个护盾技能,但是好像只能施加固定数值的护盾,求问如何将护盾值改造成跟施法者属性挂钩
module RPG
class UsableItem
def jiadunvalue
note.split(/[\r\n]+/).each { |line|
case line
when /<加盾:(\d+)>/i
return $1.to_i
end
}
return 0
end
end
end
class Game_Battler
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
@dun = 0 if @dun.nil?
if item.damage.to_hp?
a = [value,@dun].min
value -= a
@dun -= a
end
@result.make_damage(value.to_i, item)
end
alias item_apply_dunval_zabing item_apply
def item_apply(user, item)
item_apply_dunval_zabing(user, item)
@dun += item.jiadunvalue
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1