学黑暗圣剑,定义了一个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
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