Module necro.game.vision.Vision

Functions

addLightSource (position, light) Adds a light source to the level with the specified parameters.
clearLightSources ()
getEffectiveBrightness (x, y) Returns the brightness of the tile at the specified position
getLightLevel (x, y) Returns the light level (affected by all nearby light sources, but not visibility or revelation) of the tile at the specified position
isIlluminated (x, y) Returns true if the tile at the specified position is forced to full brightness by perspective
isLit (x, y)
isOpaque (x, y) Returns true if the tile at the specified position is opaque
isPerspectiveShadowed (x, y) Returns true if the tile at the specified position is forced to minimum brightness by perspective
isRevealed (x, y, mask) Returns true if the tile at the specified position has been visible and sufficiently lit up in a certain FoV group
isShadowed (x, y) Returns true if the tile at the specified position is in a nightmare's shadow
isVisible (x, y, mask) Returns true if the tile at the specified position is currently within any player's field of view
isVisibleAndLit (x, y, mask) Returns true if the tile at the specified position is sufficiently visible and lit up for enemies on it to aggro
isVisuallyLit (x, y) Deprecated
isVisuallyRevealed (x, y) Returns true if the tile at the specified position has been visible and sufficiently lit up from the focused player's perspective.
queueFieldOfViewUpdate ()
rebuildShadowMap ()
removeLightSource (position, light) Removes a light source from the level with the specified parameters.
reveal (x, y, mask) Reveal the tile at the specified position
setEffectiveBrightness (x, y, brightness) Modifies the brightness of the tile at the specified position
unreveal (x, y, mask) Unreveal the tile at the specified position
updateInstantly ()


Functions

addLightSource (position, light)
Adds a light source to the level with the specified parameters. As light sources created using this function are not tracked, care must be taken to match the exact parameters when removing or moving the light source, as otherwise, residual spots of light will remain in the level.

Parameters:

  • position
  • light
clearLightSources ()
getEffectiveBrightness (x, y)
Returns the brightness of the tile at the specified position

Parameters:

  • x
  • y
getLightLevel (x, y)
Returns the light level (affected by all nearby light sources, but not visibility or revelation) of the tile at the specified position

Parameters:

  • x
  • y
isIlluminated (x, y)
Returns true if the tile at the specified position is forced to full brightness by perspective

Parameters:

  • x
  • y
isLit (x, y)

Parameters:

  • x
  • y
isOpaque (x, y)
Returns true if the tile at the specified position is opaque

Parameters:

  • x
  • y
isPerspectiveShadowed (x, y)
Returns true if the tile at the specified position is forced to minimum brightness by perspective

Parameters:

  • x
  • y
isRevealed (x, y, mask)
Returns true if the tile at the specified position has been visible and sufficiently lit up in a certain FoV group

Parameters:

  • x
  • y
  • mask
isShadowed (x, y)
Returns true if the tile at the specified position is in a nightmare's shadow

Parameters:

  • x
  • y
isVisible (x, y, mask)
Returns true if the tile at the specified position is currently within any player's field of view

Parameters:

  • x
  • y
  • mask
isVisibleAndLit (x, y, mask)
Returns true if the tile at the specified position is sufficiently visible and lit up for enemies on it to aggro

Parameters:

  • x
  • y
  • mask
isVisuallyLit (x, y)
Deprecated

Parameters:

  • x
  • y
isVisuallyRevealed (x, y)
Returns true if the tile at the specified position has been visible and sufficiently lit up from the focused player's perspective.

Parameters:

  • x
  • y
queueFieldOfViewUpdate ()
rebuildShadowMap ()
removeLightSource (position, light)
Removes a light source from the level with the specified parameters. As light sources removed using this function are not tracked, care must be taken to match the exact parameters specified when the light source was created, as otherwise, residual spots of light will remain in the level.

Parameters:

  • position
  • light
reveal (x, y, mask)
Reveal the tile at the specified position

Parameters:

  • x
  • y
  • mask
setEffectiveBrightness (x, y, brightness)
Modifies the brightness of the tile at the specified position

Parameters:

  • x
  • y
  • brightness
unreveal (x, y, mask)
Unreveal the tile at the specified position

Parameters:

  • x
  • y
  • mask
updateInstantly ()
generated by LDoc 1.4.6