mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Being outdoors doesn't mean you can be dark forever (#6852)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
var/static/list/fake_sunlight_zs = list()
|
||||||
|
|
||||||
/obj/effect/fake_sun
|
/obj/effect/fake_sun
|
||||||
name = "fake sun"
|
name = "fake sun"
|
||||||
desc = "Deletes itself, but first updates all the lighting on outdoor turfs."
|
desc = "Deletes itself, but first updates all the lighting on outdoor turfs."
|
||||||
@@ -140,6 +142,7 @@
|
|||||||
sun.set_alpha(round(CLAMP01(choice["brightness"])*255,1))
|
sun.set_alpha(round(CLAMP01(choice["brightness"])*255,1))
|
||||||
|
|
||||||
if(do_sun)
|
if(do_sun)
|
||||||
|
fake_sunlight_zs |= z
|
||||||
for(var/turf/T as anything in turfs_to_use)
|
for(var/turf/T as anything in turfs_to_use)
|
||||||
sun.apply_to_turf(T)
|
sun.apply_to_turf(T)
|
||||||
|
|
||||||
|
|||||||
@@ -96,12 +96,18 @@
|
|||||||
|
|
||||||
///Setter for the byond luminosity var
|
///Setter for the byond luminosity var
|
||||||
/turf/proc/set_luminosity(new_luminosity, force)
|
/turf/proc/set_luminosity(new_luminosity, force)
|
||||||
// SSplanets handles outdoor turfs
|
|
||||||
if((is_outdoors() && !force) || outdoors_adjacent)
|
if((is_outdoors() && !force) || outdoors_adjacent)
|
||||||
return
|
if(check_for_sun()) //If another system handles our lighting, don't interfere
|
||||||
|
return
|
||||||
|
|
||||||
luminosity = new_luminosity
|
luminosity = new_luminosity
|
||||||
|
|
||||||
|
///Checks planets and fake_suns to see if our turf should be handled by either
|
||||||
|
/turf/proc/check_for_sun()
|
||||||
|
if((z in SSplanets.z_to_planet) || (z in fake_sunlight_zs))
|
||||||
|
return TRUE
|
||||||
|
return FALSE
|
||||||
|
|
||||||
///Calculate on which directions this turfs block view.
|
///Calculate on which directions this turfs block view.
|
||||||
/turf/proc/recalculate_directional_opacity()
|
/turf/proc/recalculate_directional_opacity()
|
||||||
. = directional_opacity
|
. = directional_opacity
|
||||||
|
|||||||
Reference in New Issue
Block a user