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

Fixed valley of the moon quest

git-svn-id: http://svn.net-core.org/repos/t-engine4@6277 51575b47-30f0-44d4-a5cc-537603b46e54
parent dc09d2da
No related branches found
No related tags found
No related merge requests found
......@@ -185,9 +185,9 @@ function _M:seen_by(who)
end
if who.ai_state and who.ai_state.target_last_seen then
-- Don't believe allies if they saw the target far, far away
if core.fov.distance(self.x, self.y, who.ai_state.target_last_seen.x, who.ai_state.target_last_seen.y) > self.sight then return end
if who.ai_state.target_last_seen.x and who.ai_state.target_last_seen.y and core.fov.distance(self.x, self.y, who.ai_state.target_last_seen.x, who.ai_state.target_last_seen.y) > self.sight then return end
-- Don't believe allies if they saw the target over 10 turns ago
if (game.turn - who.ai_state.target_last_seen.turn) / (game.energy_to_act / game.energy_per_tick) > 10 then return end
if (game.turn - (who.ai_state.target_last_seen.turn or game.turn)) / (game.energy_to_act / game.energy_per_tick) > 10 then return end
end
-- And only trust the ally if they can actually see the target
if not who:canSee(who.ai_target.actor) then return end
......
......@@ -84,6 +84,10 @@ function _M:generateOne()
else
m:setTarget(game.player)
end
if not m.unique then
m.ai_state = m.ai_state or {}
m.ai_state.ai_move = "move_dmap"
end
self.zone:addEntity(self.level, m, "actor", x, y)
end
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