Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1.         -- Handle infravision/heightened_senses which allow to see outside of lite radius but with LOS
  2.         -- Note: Overseer of Nations bonus already factored into attributes
  3.         if self:attr("infravision") or self:attr("heightened_senses") then
  4.             local radius = math.max((self.heightened_senses or 0), (self.infravision or 0))
  5.             radius = math.min(radius, self.sight)
  6.             local rad2 = math.max(1, math.floor(radius / 4))
  7.             self:computeFOV(radius, "block_sight", function(x, y, dx, dy, sqdist) if game.level.map(x, y, game.level.map.ACTOR) then game.level.map.seens(x, y, fovdist[sqdist]) end end, true, true, true)
  8.             self:computeFOV(rad2, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y, fovdist[sqdist]) end, true, true, true)
  9.         end
  10.  
  11.         -- Compute both the normal and the lite FOV, using cache
  12.         -- Do it last so it overrides others
  13.         self:computeFOV(self.sight or 10, "block_sight", function(x, y, dx, dy, sqdist)
  14.             game.level.map:apply(x, y, fovdist[sqdist])
  15.         end, true, false, true)
  16.         local lradius = self.lite
  17.         if self.radiance_aura and lradius < self.radiance_aura then lradius = self.radiance_aura end
  18.         if self.lite <= 0 then
  19.             game.level.map:applyLite(self.x, self.y)
  20.         else
  21.             --se
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement