Fix time shit & Add secrets verb

This commit is contained in:
tigercat2000
2018-03-26 20:16:22 -07:00
parent bc4fb3d79b
commit affc986684
8 changed files with 28 additions and 9 deletions
+4 -4
View File
@@ -33,17 +33,17 @@
/proc/gameTimestamp(format = "hh:mm:ss", wtime=null)
if(!wtime)
wtime = world.time
return time2text(wtime - timezoneOffset, format)
return time2text(wtime - GLOB.timezoneOffset, format)
/* This is used for displaying the "station time" equivelent of a world.time value
Calling it with no args will give you the current time, but you can specify a world.time-based value as an argument
- You can use this, for example, to do "This will expire at [station_time_at(world.time + 500)]" to display a "station time" expiration date
which is much more useful for a player)*/
/proc/station_time(time=world.time)
return ((((time - round_start_time)) + GLOB.gametime_offset) % 864000) - timezoneOffset
/proc/station_time(time=world.time, display_only=FALSE)
return ((((time - round_start_time)) + GLOB.gametime_offset) % 864000) - (display_only ? GLOB.timezoneOffset : 0)
/proc/station_time_timestamp(format = "hh:mm:ss", time=world.time)
return time2text(station_time(time), format)
return time2text(station_time(time, TRUE), format)
/* Returns 1 if it is the selected month and day */
proc/isDay(var/month, var/day)
+1 -1
View File
@@ -74,7 +74,7 @@ var/score_dmgestkey = null
var/TAB = "    "
var/timezoneOffset = 0 // The difference betwen midnight (of the host computer) and 0 world.ticks.
GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks.
// For FTP requests. (i.e. downloading runtime logs.)
// However it'd be ok to use for accessing attack logs and such too, which are even laggier.
+1 -1
View File
@@ -48,7 +48,7 @@ SUBSYSTEM_DEF(nightshift)
/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE)
nightshift_active = active
if(announce)
if (active)
if(active)
announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.")
else
announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.")
+1
View File
@@ -23,6 +23,7 @@
<A href='?src=[UID()];secretsadmin=showgm'>Show Game Mode</A>&nbsp;&nbsp;
<A href='?src=[UID()];secretsadmin=manifest'>Show Crew Manifest</A><br>
<A href='?src=[UID()];secretsadmin=check_antagonist'>Show current traitors and objectives</A><BR>
<a href='?src=[UID()];secretsadmin=night_shift_set'>Set Night Shift Mode</a><br>
<B>Bombs</b><br>
<A href='?src=[UID()];secretsadmin=list_bombers'>Bombing List</A>&nbsp;&nbsp;
<A href='?src=[UID()];secretsadmin=clear_bombs'>Remove all bombs currently in existence</A>
+18
View File
@@ -3023,6 +3023,24 @@
dat += "<tr><td>[H]</td><td>H.dna = null</td></tr>"
dat += "</table>"
usr << browse(dat, "window=fingerprints;size=440x410")
if("night_shift_set")
var/val = alert(usr, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", "On", "Off", "Automatic")
switch(val)
if("Automatic")
if(config.enable_night_shifts)
SSnightshift.can_fire = TRUE
SSnightshift.fire()
else
SSnightshift.update_nightshift(FALSE, TRUE)
to_chat(usr, "<span class='notice'>Night shift set to automatic.</span>")
if("On")
SSnightshift.can_fire = FALSE
SSnightshift.update_nightshift(TRUE, FALSE)
to_chat(usr, "<span class='notice'>Night shift forced on.</span>")
if("Off")
SSnightshift.can_fire = FALSE
SSnightshift.update_nightshift(FALSE, FALSE)
to_chat(usr, "<span class='notice'>Night shift forced off.</span>")
else
if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsadmin"]]")
+1 -1
View File
@@ -913,7 +913,7 @@
if(!is_authenticated(usr))
return
if(last_nightshift_switch < world.time + 100) // don't spam...
if(last_nightshift_switch > world.time + 100) // don't spam...
to_chat(usr, "<span class='warning'>[src]'s night lighting circuit breaker is still cycling!</span>")
return
last_nightshift_switch = world.time
+1 -1
View File
@@ -142,7 +142,7 @@
var/static_power_used = 0
var/brightness_range = 8 // luminosity when on, also used in power calculation
var/brightness_power = 1
var/brightness_color = null
var/brightness_color = "#FFFFFF"
var/status = LIGHT_OK // LIGHT_OK, _EMPTY, _BURNED or _BROKEN
var/flickering = 0
var/light_type = /obj/item/weapon/light/tube // the type of light item
+1 -1
View File
@@ -32,7 +32,7 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
// dumb and hardcoded but I don't care~
config.server_name += " #[(world.port % 1000) / 100]"
timezoneOffset = text2num(time2text(0,"hh")) * 36000
GLOB.timezoneOffset = text2num(time2text(0, "hh")) * 36000
callHook("startup")