Nightshifts & Randomized Station Time

This commit adds the Nightshift lighting mode from /tg/. From 19:00 to
07:00 in station time, the station will go into a reduced-lighting mode,
with dimmed lights across the station.

In conjunction with this, there is a new configuration option to start
the shift time at a random time other than 12:00, so that players are
more likely to experience a night shift (as opposed to having to have a
7 hour round).
This commit is contained in:
tigercat2000
2018-03-25 23:01:04 -07:00
parent 80cef82ebd
commit bc4fb3d79b
68 changed files with 264 additions and 121 deletions

View File

@@ -228,7 +228,7 @@
// Time
interpreter.SetProc("time", /proc/time)
interpreter.SetProc("timestamp", /proc/timestamp)
interpreter.SetProc("timestamp", /proc/gameTimestamp)
// Run the compiled code
interpreter.Run()

View File

@@ -155,10 +155,6 @@
//writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/time() called tick#: [world.time]")
return world.time + (12 HOURS)
/proc/timestamp(var/format = "hh:mm:ss") // Get the game time in text
//writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/timestamp() called tick#: [world.time]")
return time2text(world.time + (10 HOURS), format) // Yes, 10, not 12 hours, for some reason time2text() is being moronic (T-thanks BYOND), and it's adding 2 hours to this, I don't even know either.
proc/string_explode(var/string, var/separator = "")
//writepanic("[__FILE__].[__LINE__] \\/proc/string_explode() called tick#: [world.time]")
if(istext(string) && (istext(separator) || isnull(separator)))