mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
set_luminosity helper
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
Entered(AM)
|
||||
|
||||
//Lighting related
|
||||
luminosity = !(dynamic_lighting)
|
||||
set_luminosity(!(dynamic_lighting))
|
||||
|
||||
if(opacity)
|
||||
directional_opacity = ALL_CARDINALS
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
stack_trace("a lighting object was assigned to a turf that already had a lighting object!")
|
||||
|
||||
affected_turf.lighting_object = src
|
||||
affected_turf.luminosity = 0
|
||||
affected_turf.set_luminosity(0)
|
||||
|
||||
for(var/turf/space/space_tile in RANGE_TURFS(1, affected_turf))
|
||||
space_tile.update_starlight()
|
||||
@@ -40,7 +40,7 @@
|
||||
SSlighting.objects_queue -= src
|
||||
if (isturf(affected_turf))
|
||||
affected_turf.lighting_object = null
|
||||
affected_turf.luminosity = 1
|
||||
affected_turf.set_luminosity(1)
|
||||
affected_turf.underlays -= current_underlay
|
||||
affected_turf = null
|
||||
return ..()
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
affected_turf.underlays += current_underlay
|
||||
|
||||
affected_turf.luminosity = set_luminosity
|
||||
affected_turf.set_luminosity(set_luminosity)
|
||||
|
||||
/datum/lighting_object/proc/removefromturf()
|
||||
affected_turf.underlays -= current_underlay
|
||||
|
||||
@@ -93,6 +93,13 @@
|
||||
return
|
||||
recalculate_directional_opacity()
|
||||
|
||||
///Setter for the byond luminosity var
|
||||
/turf/proc/set_luminosity(new_luminosity, force)
|
||||
// SSplanets handles outdoor turfs
|
||||
if(outdoors && !force)
|
||||
return
|
||||
|
||||
luminosity = new_luminosity
|
||||
|
||||
///Calculate on which directions this turfs block view.
|
||||
/turf/proc/recalculate_directional_opacity()
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
return
|
||||
T.vis_contents += sun
|
||||
T.dynamic_lumcount += our_brightness
|
||||
T.set_luminosity(1, TRUE)
|
||||
|
||||
/datum/sun_holder/proc/remove_from_turf(turf/T)
|
||||
if(!(sun in T.vis_contents))
|
||||
@@ -46,6 +47,7 @@
|
||||
return
|
||||
T.vis_contents -= sun
|
||||
T.dynamic_lumcount -= our_brightness
|
||||
T.set_luminosity(!IS_DYNAMIC_LIGHTING(T), TRUE)
|
||||
|
||||
/datum/sun_holder/proc/rainbow()
|
||||
var/end = world.time + 30 SECONDS
|
||||
|
||||
Reference in New Issue
Block a user