mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Ports /tg/'s starlight luminance.
Because configuration is initialized before the map we also don't have the same runtimes issues corrected by https://github.com/tgstation/-tg-station/pull/7806.
This commit is contained in:
@@ -182,6 +182,8 @@
|
||||
var/dooc_allowed = 1
|
||||
var/dsay_allowed = 1
|
||||
|
||||
var/starlight = 0 // Whether space turfs have ambient light or not
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
|
||||
for (var/T in L)
|
||||
@@ -603,6 +605,9 @@
|
||||
config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
|
||||
config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
|
||||
|
||||
if("starlight")
|
||||
config.starlight = 1
|
||||
|
||||
else
|
||||
log_misc("Unknown setting in configuration: '[name]'")
|
||||
|
||||
|
||||
@@ -14,6 +14,15 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
|
||||
/turf/space/New()
|
||||
if(!istype(src, /turf/space/transit))
|
||||
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
|
||||
update_starlight()
|
||||
|
||||
/turf/space/proc/update_starlight()
|
||||
if(!config.starlight)
|
||||
return
|
||||
if(locate(/turf/simulated) in orange(src,1))
|
||||
SetLuminosity(3)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
/turf/space/attackby(obj/item/C as obj, mob/user as mob)
|
||||
|
||||
|
||||
@@ -251,6 +251,9 @@
|
||||
if(air_master)
|
||||
air_master.mark_for_update(src)
|
||||
|
||||
for(var/turf/space/S in range(W,1))
|
||||
S.update_starlight()
|
||||
|
||||
W.levelupdate()
|
||||
return W
|
||||
|
||||
@@ -272,6 +275,9 @@
|
||||
if(air_master)
|
||||
air_master.mark_for_update(src)
|
||||
|
||||
for(var/turf/space/S in range(W,1))
|
||||
S.update_starlight()
|
||||
|
||||
W.levelupdate()
|
||||
return W
|
||||
|
||||
|
||||
@@ -321,3 +321,6 @@ EVENT_CUSTOM_START_MAJOR 80;100
|
||||
|
||||
## Uncomment to disable respawning by default.
|
||||
#DISABLE_RESPAWN
|
||||
|
||||
## Uncomment to make space turfs have a short-range ambient light.
|
||||
# STARLIGHT
|
||||
|
||||
Reference in New Issue
Block a user