学黑暗圣剑,定义了一个name_plus,就是数据库里面特技名字后面带的数值,然后在Game_Battler3里面的HP算法里面写了这一段: if name_plus != 0
if self.damage>=0
self.damage = [name_plus,self.damage].min
else
self.damage = [name_plus,self.damage].max
end
end作者: Wind2010 时间: 2011-11-6 10:55
p一下name_plus?作者: kvex1 时间: 2011-11-6 12:04
Wind2010 发表于 2011-11-6 10:55
p一下name_plus?
module RPG
class Skill
def name
name = @name.split(/,/)[0]
return name !=nil ? name : ""
end
def name_plus
name_plus = @name.split(/,/)[1]
return name_plus != nil ? name_plus.to_i : 0
end
end
end