[READY]Randomized Station Time + Night Shifts

This commit is contained in:
Jordan Brown
2018-02-21 13:01:33 -05:00
committed by CitadelStationBot
parent c1d66af3a1
commit bc2f2a9728
32 changed files with 241 additions and 42 deletions

View File

@@ -64,12 +64,14 @@
return FALSE
/datum/ntnet/proc/log_data_transfer(datum/netdata/data)
logs += "[worldtime2text()] - [data.generate_netlog()]"
logs += "[station_time_timestamp()] - [data.generate_netlog()]"
if(logs.len > setting_maxlogcount)
logs = logs.Copy(logs.len - setting_maxlogcount, 0)
return
// Simplified logging: Adds a log. log_string is mandatory parameter, source is optional.
/datum/ntnet/proc/add_log(log_string, obj/item/computer_hardware/network_card/source = null)
var/log_text = "[worldtime2text()] - "
var/log_text = "[station_time_timestamp()] - "
if(source)
log_text += "[source.get_network_tag()] - "
else

View File

@@ -1,3 +1,4 @@
<<<<<<< HEAD
/obj/effect/proc_holder/changeling/fakedeath
name = "Reviving Stasis"
desc = "We fall into a stasis, allowing us to regenerate and trick our enemies."
@@ -35,3 +36,42 @@
if("No")
return
return ..()
=======
/obj/effect/proc_holder/changeling/fakedeath
name = "Reviving Stasis"
desc = "We fall into a stasis, allowing us to regenerate and trick our enemies."
chemical_cost = 15
dna_cost = 0
req_dna = 1
req_stat = DEAD
//Fake our own death and fully heal. You will appear to be dead but regenerate fully after a short delay.
/obj/effect/proc_holder/changeling/fakedeath/sting_action(mob/living/user)
to_chat(user, "<span class='notice'>We begin our stasis, preparing energy to arise once more.</span>")
if(user.stat != DEAD)
user.emote("deathgasp")
user.tod = station_time_timestamp()
user.fakedeath("changeling") //play dead
user.update_stat()
user.update_canmove()
addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME, TIMER_UNIQUE)
return TRUE
/obj/effect/proc_holder/changeling/fakedeath/proc/ready_to_regenerate(mob/user)
if(user && user.mind)
var/datum/antagonist/changeling/C = user.mind.has_antag_datum(/datum/antagonist/changeling)
if(C && C.purchasedpowers)
to_chat(user, "<span class='notice'>We are ready to revive.</span>")
C.purchasedpowers += new /obj/effect/proc_holder/changeling/revive(null)
/obj/effect/proc_holder/changeling/fakedeath/can_sting(mob/living/user)
if(user.has_trait(TRAIT_FAKEDEATH, "changeling"))
to_chat(user, "<span class='warning'>We are already reviving.</span>")
return
if(!user.stat) //Confirmation for living changelings if they want to fake their death
switch(alert("Are we sure we wish to fake our own death?",,"Yes", "No"))
if("No")
return
return ..()
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift

View File

@@ -103,7 +103,7 @@
// We gathered everything. Create a fork and slowly display the results to the holder of the scanner.
var/found_something = 0
add_log("<B>[worldtime2text()][get_timestamp()] - [target_name]</B>", 0)
add_log("<B>[station_time_timestamp()][get_timestamp()] - [target_name]</B>", 0)
// Fingerprints
if(length(fingerprints))

View File

@@ -73,7 +73,7 @@
var/obj/item/clothing/suit/space/space_ninja/SN = wear_suit
if(statpanel("SpiderOS"))
stat("SpiderOS Status:","[SN.s_initialized ? "Initialized" : "Disabled"]")
stat("Current Time:", "[worldtime2text()]")
stat("Current Time:", "[station_time_timestamp()]")
if(SN.s_initialized)
//Suit gear
stat("Energy Charge:", "[round(SN.cell.charge/100)]%")
@@ -423,7 +423,7 @@
return
else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text())
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, station_time_timestamp())
GLOB.data_core.addMinorCrime(R.fields["id"], crime)
to_chat(usr, "<span class='notice'>Successfully added a minor crime.</span>")
return
@@ -438,7 +438,7 @@
return
else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text())
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, station_time_timestamp())
GLOB.data_core.addMajorCrime(R.fields["id"], crime)
to_chat(usr, "<span class='notice'>Successfully added a major crime.</span>")
return
@@ -470,7 +470,7 @@
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []<BR>[]", allowed_access, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []<BR>[]", allowed_access, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
to_chat(usr, "<span class='notice'>Successfully added comment.</span>")
return
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")

View File

@@ -47,7 +47,7 @@
stat = DEAD
unset_machine()
timeofdeath = world.time
tod = worldtime2text()
tod = station_time_timestamp()
var/turf/T = get_turf(src)
for(var/obj/item/I in contents)
I.on_mob_death(src, gibbed)

View File

@@ -228,5 +228,5 @@
if(stat == DEAD)
return
add_trait(TRAIT_FAKEDEATH, source)
tod = worldtime2text()
tod = station_time_timestamp()
update_stat()

View File

@@ -285,7 +285,7 @@
else
client.perspective = EYE_PERSPECTIVE
client.eye = loc
return 1
return 1
/mob/living/reset_perspective(atom/A)
if(..())
@@ -603,7 +603,8 @@
stat(null, "Next Map: [cached.map_name]")
stat(null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]")
stat(null, "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]")
stat(null, "Station Time: [worldtime2text()]")
stat(null, "Round Time: [worldtime2text()]")
stat(null, "Station Time: [station_time_timestamp()]")
stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
if(SSshuttle.emergency)
var/ETA = SSshuttle.emergency.getModeStr()

View File

@@ -19,12 +19,12 @@
return ..()
/datum/ntnet_conversation/proc/add_message(message, username)
message = "[worldtime2text()] [username]: [message]"
message = "[station_time_timestamp()] [username]: [message]"
messages.Add(message)
trim_message_list()
/datum/ntnet_conversation/proc/add_status_message(message)
messages.Add("[worldtime2text()] -!- [message]")
messages.Add("[station_time_timestamp()] -!- [message]")
trim_message_list()
/datum/ntnet_conversation/proc/trim_message_list()

View File

@@ -330,7 +330,7 @@
data["PC_programheaders"] = program_headers
data["PC_stationtime"] = worldtime2text()
data["PC_stationtime"] = station_time_timestamp()
data["PC_hasheader"] = 1
data["PC_showexitprogram"] = active_program ? 1 : 0 // Hides "Exit Program" button on mainscreen
return data

View File

@@ -159,7 +159,7 @@
<br>
[GLOB.data_core ? GLOB.data_core.get_manifest(0) : ""]
"}
if(!printer.print_text(contents,text("crew manifest ([])", worldtime2text())))
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
return
else

View File

@@ -145,7 +145,7 @@
t = replacetext(t, "\[/i\]", "</I>")
t = replacetext(t, "\[u\]", "<U>")
t = replacetext(t, "\[/u\]", "</U>")
t = replacetext(t, "\[time\]", "[worldtime2text()]")
t = replacetext(t, "\[time\]", "[station_time_timestamp()]")
t = replacetext(t, "\[date\]", "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]")
t = replacetext(t, "\[large\]", "<font size=\"4\">")
t = replacetext(t, "\[/large\]", "</font>")

View File

@@ -90,6 +90,8 @@
var/failure_timer = 0
var/force_update = 0
var/emergency_lights = FALSE
var/nightshift_lights = FALSE
var/last_nightshift_switch = 0
var/update_state = -1
var/update_overlay = -1
var/icon_update_needed = FALSE
@@ -755,6 +757,7 @@
"siliconUser" = user.has_unlimited_silicon_privilege || user.using_power_flow_console(),
"malfStatus" = get_malf_status(user),
"emergencyLights" = !emergency_lights,
"nightshiftLights" = nightshift_lights,
"powerChannels" = list(
list(
@@ -857,6 +860,13 @@
if("breaker")
toggle_breaker()
. = TRUE
if("toggle_nightshift")
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
set_nightshift(!nightshift_lights)
. = TRUE
if("charge")
chargemode = !chargemode
if(!chargemode)
@@ -1304,6 +1314,16 @@
failure_timer = max(failure_timer, round(duration))
/obj/machinery/power/apc/proc/set_nightshift(on)
set waitfor = FALSE
nightshift_lights = on
for(var/area/A in area.related)
for(var/obj/machinery/light/L in A)
if(L.nightshift_allowed)
L.nightshift_enabled = nightshift_lights
L.update(FALSE)
CHECK_TICK
#undef UPSTATE_CELL_IN
#undef UPSTATE_OPENED1
#undef UPSTATE_OPENED2

View File

@@ -210,6 +210,13 @@
var/obj/item/stock_parts/cell/cell
var/start_with_cell = TRUE // if true, this fixture generates a very weak cell at roundstart
var/nightshift_enabled = FALSE //Currently in night shift mode?
var/nightshift_allowed = TRUE //Set to FALSE to never let this light get switched to night mode.
var/nightshift_brightness = 8
var/nightshift_light_power = 0.45
var/nightshift_light_color = "#FFDDCC"
var/emergency_mode = FALSE // if true, the light is in emergency mode
var/no_emergency = FALSE // if true, this light cannot ever have an emergency mode
var/bulb_emergency_brightness_mul = 0.25 // multiplier for this light's base brightness in emergency power mode
@@ -301,24 +308,36 @@
return
// update the icon_state and luminosity of the light depending on its state
/obj/machinery/light/proc/update(trigger = 1)
/obj/machinery/light/proc/update(trigger = TRUE)
switch(status)
if(LIGHT_BROKEN,LIGHT_BURNED,LIGHT_EMPTY)
on = FALSE
emergency_mode = FALSE
if(on)
<<<<<<< HEAD
if(!light || light.light_range != brightness || SSnightshift.nightshift != nightshift) //Cit change - makes lights update when nightshift triggers
=======
var/BR = nightshift_enabled? nightshift_brightness : brightness
var/PO = nightshift_enabled? nightshift_light_power : bulb_power
var/CO = nightshift_enabled? nightshift_light_color : bulb_colour
var/matching = light && BR == light.light_range && PO == light.light_power && CO == light.light_color
if(!matching)
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift
switchcount++
nightshift = SSnightshift.nightshift // Cit change - makes lights update when nightshift triggers
if(rigged)
if(status == LIGHT_OK && trigger)
explode()
else if( prob( min(60, switchcount*switchcount*0.01) ) )
else if( prob( min(60, (switchcount^2)*0.01) ) )
if(trigger)
burn_out()
else
use_power = ACTIVE_POWER_USE
<<<<<<< HEAD
set_light(brightness, ((SSnightshift.nightshift && obeysnightshift) ? SSnightshift.nightshift_light_power : bulb_power), ((SSnightshift.nightshift && obeysnightshift) ? SSnightshift.nightshift_light_color : bulb_colour)) // Citadel change. Allows nightshift and admins to modify station light power and color
=======
set_light(BR, PO, CO)
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift
else if(has_emergency_power(LIGHT_EMERGENCY_POWER_USE) && !turned_off())
use_power = IDLE_POWER_USE
emergency_mode = TRUE

View File

@@ -1,8 +1,8 @@
GLOBAL_VAR_INIT(security_level, 0)
//0 = code green
//1 = code blue
//2 = code red
//3 = code delta
GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
//SEC_LEVEL_GREEN = code green
//SEC_LEVEL_BLUE = code blue
//SEC_LEVEL_RED = code red
//SEC_LEVEL_DELTA = code delta
//config.alert_desc_blue_downto
@@ -91,6 +91,7 @@ GLOBAL_VAR_INIT(security_level, 0)
SSnightshift.updatenightlights()
//End of citadel changes
SSblackbox.record_feedback("tally", "security_level_changes", 1, get_security_level())
SSnightshift.check_nightshift()
else
return