The problem seems to be that EFF_FORESIGHT is checked in Actor.onTakeHit(), so it does not actually avoid the hit, it only negates all damage.
techniques/2hweapon 229-234
Code: Select all
local speed, hit = self:attackTargetWith(target, weapon.combat, nil, self:combatTalentWeaponDamage(t, 1, 1.5))
-- Try to stun !
if hit then
if target:checkHit(self:combatAttackStr(weapon.combat), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_STUNNED, 2 + self:getTalentLevel(t), {})
Code: Select all
if self:hasEffect(self.EFF_FORESIGHT) and value >= (self.max_life / 10) then
self:removeEffect(self.EFF_FORESIGHT)
game.logSeen(self, "%s avoids the attack.", self.name:capitalize())
value = 0
end
Combat 202-211
Code: Select all
--- Try to totally evade an attack
function _M:checkEvasion(target)
if not target:attr("evasion") then return end
local evasion = target:attr("evasion")
print("checkEvasion", evasion, target.level, self.level)
evasion = evasion * (target.level / self.level)
print("=> evasion chance", evasion)
return rng.percent(evasion)
end