Skip to content
Snippets Groups Projects
Commit f106bc63 authored by dg's avatar dg
Browse files

restrict target passign a bit, still not good

git-svn-id: http://svn.net-core.org/repos/t-engine4@3697 51575b47-30f0-44d4-a5cc-537603b46e54
parent 013e1487
No related branches found
No related tags found
No related merge requests found
......@@ -818,6 +818,16 @@ function _M:tooltip(x, y, seen_by)
elseif factlevel > 0 then factcolor, factstate = "#LIGHT_GREEN#", "friendly"
end
-- Debug feature, mousing over with ctrl pressed will give detailed FOV info
if config.settings.cheat and core.key.modState("ctrl") then
print("============================================== SEEING from", self.name)
for i, a in ipairs(self.fov.actors_dist) do
local d = self.fov.actors[a]
print(("%3d : %-40s at %3dx%3d (see at %3dx%3d), diff %3dx%3d"):format(d.sqdist, a.name, a.x, a.y, d.x, d.y,d.dx,d.dy))
end
print("==============================================")
end
local pfactcolor, pfactstate, pfactlevel = "#ANTIQUE_WHITE#", "neutral", self:reactionToward(game.player)
if pfactlevel < 0 then pfactcolor, pfactstate = "#LIGHT_RED#", "hostile"
elseif pfactlevel > 0 then pfactcolor, pfactstate = "#LIGHT_GREEN#", "friendly"
......
......@@ -75,6 +75,7 @@ function _M:seen_by(who)
if not who.ai_target.actor then return end
if self:reactionToward(who) <= 0 then return end
if not who:canSee(who.ai_target.actor) then return end
if not who.x or not self:hasLOS(who.x, who.y) then return end
self:setTarget(who.ai_target.actor)
end
......
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