skill_effect 中加
if user.powerstock > 0 then
.........
定义你自己的公式
然后你所说的物理 OR 魔法 特技
module RPG
class Skill
def name
name = @name.split(/@/)[0]
return name != nil ? name : ''
end
def panduan
add_name = @name.split(/@/)[1]
return add_name != nil ? add_name : ""
end
end
end
我的实现步骤:
1.畜力一定是个状态
2.在普通攻击时,如果攻击者是是畜力状态,着伤害*2 同时移除攻击者的畜力状态
if attacker.states.include?(42)#如果攻击者为畜力状态
a = 2
self.damage = self.damage * a
attacker.remove_state(42)
end
3.如果是特技攻击,如果攻击者是畜力状态,而使用的技能为特技攻击,则伤害*2 同时移除攻击者的畜力状态。
if attacker.states.include?(42) and skill.atk_f > 0#如果攻击者为畜力状态
a = 2
self.damage = self.damage * a
attacker.remove_state(42)
end