def apply_guard(damage)
if self.is_a?($game_actor) #判斷角色?
if self.armor3_id == 0 and guarding?
damage = 10
elsif self.armor3_id == 7...10 and guarding?
damage = 1
end
else damage = 100
end
return damage
end
當攻擊時不論是怪物或是角色這行 if self.is_a?($game_actor) 都會跳錯 作者: hsun770916 时间: 2011-12-24 01:56
感謝兩位的幫忙~
if self.is_a?(Game_Actor) # 角色
if guarding? # 判断是否防御中
if self.armor3_id == 7...10 #判斷裝備
damage /= 10 # 降低伤害
else
damage /= 2 # 降低伤害
end
end
else #敵人
if guarding? # 判断是否防御中
damage /= 2 # 降低伤害
end
end