Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Handle infravision/heightened_senses which allow to see outside of lite radius but with LOS
- -- Note: Overseer of Nations bonus already factored into attributes
- if self:attr("infravision") or self:attr("heightened_senses") then
- local radius = math.max((self.heightened_senses or 0), (self.infravision or 0))
- radius = math.min(radius, self.sight)
- local rad2 = math.max(1, math.floor(radius / 4))
- 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)
- self:computeFOV(rad2, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y, fovdist[sqdist]) end, true, true, true)
- end
- -- Compute both the normal and the lite FOV, using cache
- -- Do it last so it overrides others
- self:computeFOV(self.sight or 10, "block_sight", function(x, y, dx, dy, sqdist)
- game.level.map:apply(x, y, fovdist[sqdist])
- end, true, false, true)
- local lradius = self.lite
- if self.radiance_aura and lradius < self.radiance_aura then lradius = self.radiance_aura end
- if self.lite <= 0 then
- game.level.map:applyLite(self.x, self.y)
- else
- --se
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement