Merge pull request #8211 from PsiOmegaDelta/Starlight

Ports /tg/'s starlight luminance.
This commit is contained in:
Zuhayr
2015-02-24 02:19:50 +10:30
4 changed files with 24 additions and 1 deletions

View File

@@ -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]'")

View File

@@ -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)

View File

@@ -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