Page 1 of 1

[b28] Foresight does not protect from effects

Posted: Mon Jul 11, 2011 7:45 pm
by jotwebe
Intuitively, if my temporal warden avoids an attack with the foresight talent, it should also protect from additional effects that come with the attack, like stun from stunning blow, or freeze from freeze. At least with stunning blow however, I just got stunned by a Minotaur while avoiding the damage.

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), {})

Actor 1085-1089 (onTakeHit function)

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
The evasion talent (from cunning/survival) actually works correctly, here's the part in Combat.lua where it is checked for. So I'd suggest doing something similar for foresight, only that instead of checking a chance, EFF_FORESIGHT would get removed...

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

Re: [b28] Foresight does not protect from effects

Posted: Thu Sep 08, 2011 12:25 am
by edge2054
I just found this post and wanted to comment.

Foresight works like boneshield, this really isn't a bug (maybe the talent description could be clearer).

The reason I wrote it like that is so it would avoid damage from any source. You're right that evasion turns one attack into a miss but it does nothing against spell effects. So turning Foresight into a 100% evasion against a single (non-spell only) attack doesn't sound like the answer either.

Anyway, I'll give it some thought. I think Foresight could be better but neither your suggestion or the current implementation is optimal.

Re: [b28] Foresight does not protect from effects

Posted: Thu Sep 08, 2011 10:28 pm
by Aquillion
Hmm. Why not just check in both places?

Granted, this still won't protect you from the side-effects of spells... hmm.