Skip to content
Snippets Groups Projects
Commit 80feedf9 authored by DarkGod's avatar DarkGod
Browse files

moved stealth preventing NPC target passing to a property, so that other talents could use it

parent 0daaf625
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -249,7 +249,7 @@ function _M:seen_by(who)
if not who.x or not self:hasLOS(who.x, who.y) then return end
-- Check if it's actually a being of cold machinery and not of blood and flesh
if not who.aiSeeTargetPos then return end
if self.ai_target.actor and not who_target:isTalentActive(who_target.T_STEALTH) then
if self.ai_target.actor and not who_target:attr("stealthed_prevents_targetting") then
-- Pass last seen coordinates
if self.ai_target.actor == who_target then
-- Adding some type-safety checks, but this isn't fixing the source of the errors
......
......@@ -90,6 +90,7 @@ newTalent{
stealth = self:addTemporaryValue("stealth", t.getStealthPower(self, t)),
lite = self:addTemporaryValue("lite", -1000),
infra = self:addTemporaryValue("infravision", 3), -- Losing wall visibility is already annoying, may as well let stealth have a vision advantage
stealthed_prevents_targetting = self:addTemporaryValue("stealthed_prevents_targetting", 1),
}
self:resetCanSeeCacheOf()
if self.updateMainShader then self:updateMainShader() end
......@@ -99,6 +100,7 @@ newTalent{
self:removeTemporaryValue("stealth", p.stealth)
self:removeTemporaryValue("infravision", p.infra)
self:removeTemporaryValue("lite", p.lite)
self:removeTemporaryValue("stealthed_prevents_targetting", p.stealthed_prevents_targetting)
if self:knowTalent(self.T_TERRORIZE) then
local t = self:getTalentFromId(self.T_TERRORIZE)
t.terrorize(self,t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment