Starlight

This commit ports baystation12's implementation of starlight, modified to
rely on the master-controller due to differences between us, -tg-, and
bay12. Starlight allows space tiles to give off light, the amount of light
can be configured in config.txt.
This commit is contained in:
Tigercat2000
2015-05-10 18:31:21 -07:00
parent c2038640f7
commit fd799d6844
5 changed files with 30 additions and 2 deletions
+6
View File
@@ -152,6 +152,8 @@
// 15, 45, 70 minutes respectively
var/list/event_delay_upper = list(EVENT_LEVEL_MUNDANE = 9000, EVENT_LEVEL_MODERATE = 27000, EVENT_LEVEL_MAJOR = 42000)
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)
@@ -501,6 +503,10 @@
config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
if("starlight")
var/vvalue = text2num(value)
config.starlight = vvalue >= 0 ? vvalue : 0
else
diary << "Unknown setting in configuration: '[name]'"
+6 -1
View File
@@ -74,6 +74,7 @@ datum/controller/game_controller/proc/setup()
color_windows_init()
setup_objects()
setup_starlight()
setupgenetics()
setupfactions()
setup_economy()
@@ -83,7 +84,6 @@ datum/controller/game_controller/proc/setup()
make_mining_asteroid_secret()
populate_spawn_points()
/* MOVED TO SCHEDULER
spawn(0)
@@ -125,6 +125,11 @@ datum/controller/game_controller/proc/setup_objects()
world << "\red \b Initializations complete."
sleep(-1)
datum/controller/game_controller/proc/setup_starlight()
world << "\red \b Initializing Starlight"
for(var/turf/space/S in world)
S.update_starlight()
world << "\red \b Starlight Initilization Complete"
datum/controller/game_controller/proc/process()
processing = 1
+11
View File
@@ -11,6 +11,17 @@
/turf/space/New()
if(!istype(src, /turf/space/transit))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
if(config)
update_starlight() //MC will initialize all the space turfs that get created before config
/turf/space/proc/update_starlight()
if(!config) return
if(!config.starlight)
return
if(locate(/turf/simulated) in orange(src,1))
set_light(config.starlight)
else
set_light(0)
/turf/space/attack_paw(mob/user as mob)
return src.attack_hand(user)
+3
View File
@@ -240,6 +240,9 @@
W:Assimilate_Air()
W.RemoveLattice()
for(var/turf/space/S in range(W,1))
S.update_starlight()
W.levelupdate()
W.CalculateAdjacentTurfs()
. = W