From 34e9142e6b08819639fea3eb2c4afb2093e87852 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Fri, 24 Feb 2017 16:22:14 +0100
Subject: [PATCH] Armour of Shadows give 20% evasion when on unlit tile

---
 game/modules/tome/class/interface/Combat.lua  | 10 +++++++---
 game/modules/tome/data/talents/uber/const.lua |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua
index 34d9f38407..188c2ddb16 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -347,10 +347,14 @@ end
 
 --- Try to totally evade an attack
 function _M:checkEvasion(target)
-	if not target:attr("evasion") or self == target then return end
-	if target:attr("no_evasion") then return end
-	
 	local evasion = target:attr("evasion")
+	if target:knowTalent(target.T_ARMOUR_OF_SHADOWS) and not game.level.map.lites(target.x, target.y) then
+		evasion = (evasion or 0) + 20
+	end
+
+	if not evasion or self == target then return end
+	if target:attr("no_evasion") then return end
+
 	print("checkEvasion", evasion, target.level, self.level)
 	print("=> evasion chance", evasion)
 	return rng.percent(evasion)
diff --git a/game/modules/tome/data/talents/uber/const.lua b/game/modules/tome/data/talents/uber/const.lua
index 09c0252f61..240afd0ff1 100644
--- a/game/modules/tome/data/talents/uber/const.lua
+++ b/game/modules/tome/data/talents/uber/const.lua
@@ -112,7 +112,7 @@ uberTalent{
 		self:attr("darkness_darkens", -1)
 	end,
 	info = function(self, t)
-		return ([[You know how to protect yourself with the deepest shadows. As long as you stand on an unlit tile you gain %d armour and 50%% armour hardiness.
+		return ([[You know how to protect yourself with the deepest shadows. As long as you stand on an unlit tile you gain %d armour, 50%% armour hardiness and 20%% evasion.
 		Any time you deal darkness damage, you will unlight both the target tile and yours.
 		The armor bonus scales with your Constitution.]])
 		:format(t.ArmourBonus(self,t))
-- 
GitLab