mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
@@ -5,6 +5,9 @@
|
||||
icon_state = "fakesun"
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
var/atom/movable/sun_visuals/sun
|
||||
var/family = null //Allows multipe maps that are THEORETICALLY connected to use the same settings when not in a connected Z stack
|
||||
var/shared_settings //Automatically set if using the family var
|
||||
var/static/world_suns = list() //List of all the fake_suns in the world, used for checking for family members
|
||||
|
||||
var/list/possible_light_setups = list(
|
||||
list(
|
||||
@@ -78,13 +81,26 @@
|
||||
|
||||
)
|
||||
|
||||
/obj/effect/fake_sun/New(loc, ...)
|
||||
. = ..()
|
||||
world_suns += src
|
||||
|
||||
/obj/effect/fake_sun/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/effect/fake_sun/LateInitialize()
|
||||
. = ..()
|
||||
var/list/choice = pick(possible_light_setups)
|
||||
var/list/choice
|
||||
if(family) //Allows one to make multiple fake_suns to use the same settings
|
||||
for(var/obj/effect/fake_sun/l in world_suns) //check all the suns that exist
|
||||
if(l.family == family && l.shared_settings) //do you have settings we need?
|
||||
choice = l.shared_settings
|
||||
break
|
||||
if(!choice) //We didn't get anything from our family, let's pick something
|
||||
choice = pick(possible_light_setups)
|
||||
if(family) //Let's pass our settings on to our family
|
||||
shared_settings = choice
|
||||
if(choice["brightness"] <= LIGHTING_SOFT_THRESHOLD) // dark!
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user