From 2ad89210f73e2461710f1fb2060c5e04c1603f59 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Wed, 12 Dec 2012 22:11:20 +0000
Subject: [PATCH] Smoke Bomb affects a radius at higher levels Foes affected by
 smoke bomb do not prevent stealthing (event at close range) Hide In Plain
 Sight chance is now checked once instead of once per foes

git-svn-id: http://svn.net-core.org/repos/t-engine4@6060 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../tome/data/talents/cunning/stealth.lua     | 21 ++++++++++++-------
 .../tome/data/talents/cunning/traps.lua       |  8 ++++---
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/game/modules/tome/data/talents/cunning/stealth.lua b/game/modules/tome/data/talents/cunning/stealth.lua
index b7395a5692..7f9b958262 100644
--- a/game/modules/tome/data/talents/cunning/stealth.lua
+++ b/game/modules/tome/data/talents/cunning/stealth.lua
@@ -39,14 +39,19 @@ newTalent{
 
 		-- Check nearby actors
 		if not self.x or not self.y or not game.level then return end
-		local grids = core.fov.circle_grids(self.x, self.y, t.getRadius(self, t), true)
-		for x, yy in pairs(grids) do for y in pairs(yy) do
-			local actor = game.level.map(x, y, game.level.map.ACTOR)
-			if actor and actor ~= self and actor:reactionToward(self) < 0 and not rng.percent(self.hide_chance or 0) then
-				if not silent then game.logPlayer(self, "You cannot Stealth with nearby foes watching!") end
-				return nil
-			end
-		end end
+
+		if not rng.percent(self.hide_chance or 0) then
+			local grids = core.fov.circle_grids(self.x, self.y, t.getRadius(self, t), true)
+			for x, yy in pairs(grids) do for y in pairs(yy) do
+				local actor = game.level.map(x, y, game.level.map.ACTOR)
+				if actor and actor ~= self and actor:reactionToward(self) < 0 then
+					if not actor:hasEffect(actor.EFF_DIM_VISION) then
+						if not silent then game.logPlayer(self, "You cannot Stealth with nearby foes watching!") end
+						return nil
+					end
+				end
+			end end
+		end
 		return true
 	end,
 	activate = function(self, t)
diff --git a/game/modules/tome/data/talents/cunning/traps.lua b/game/modules/tome/data/talents/cunning/traps.lua
index e109cb6397..b88c686174 100644
--- a/game/modules/tome/data/talents/cunning/traps.lua
+++ b/game/modules/tome/data/talents/cunning/traps.lua
@@ -159,9 +159,10 @@ newTalent{
 	proj_speed = 10,
 	requires_target = true,
 	range = 10,
+	radius = function(self, t) return math.floor(0.5 * self:getTalentLevel(t)) end,
 	tactical = { DISABLE = { blind = 2 } },
 	action = function(self, t)
-		local tg = {type="bolt", range=self:getTalentRange(t), talent=t}
+		local tg = {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), talent=t}
 		local x, y = self:getTarget(tg)
 		if not x or not y then return nil end
 		self:projectile(tg, x, y, DamageType.STICKY_SMOKE, math.ceil(self:getTalentLevel(t) * 1.2), {type="slime"})
@@ -169,9 +170,10 @@ newTalent{
 		return true
 	end,
 	info = function(self, t)
-		return ([[Throws a vial of sticky smoke that explodes on your foe, reducing its vision range by %d for 5 turns.
+		return ([[Throws a vial of sticky smoke that explodes in radius %d on your foe, reducing its vision range by %d for 5 turns.
+		Creatures affected by smoke bomb can never prevent you from stealthing even if they are close to you.
 		This can be used while stealthed.]]):
-		format(math.ceil(self:getTalentLevel(t) * 1.2))
+		format(self:getTalentRadius(t), math.ceil(self:getTalentLevel(t) * 1.2))
 	end,
 }
 
-- 
GitLab