diff --git a/code/__DEFINES/time.dm b/code/__DEFINES/time.dm index 8bc4d039f6..27f6eae8b6 100644 --- a/code/__DEFINES/time.dm +++ b/code/__DEFINES/time.dm @@ -24,4 +24,4 @@ When using time2text(), please use "DDD" to find the weekday. Refrain from using #define DS2TICKS(DS) ((DS)/world.tick_lag) -#define TICKS2DS(T) ((T) TICKS) \ No newline at end of file +#define TICKS2DS(T) ((T) TICKS) diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 08734c3d88..47f9d26d21 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -9,7 +9,23 @@ /proc/gameTimestamp(format = "hh:mm:ss", wtime=null) if(!wtime) wtime = world.time - return time2text(wtime - GLOB.timezoneOffset + SSticker.gametime_offset - SSticker.round_start_time, format) + return time2text(wtime - GLOB.timezoneOffset, format) + +/proc/station_time() + return ((((world.time - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % 864000) - GLOB.timezoneOffset + +/proc/station_time_timestamp(format = "hh:mm:ss") + return time2text(station_time(), format) + +/proc/station_time_debug(force_set) + if(isnum(force_set)) + SSticker.gametime_offset = force_set + return + SSticker.gametime_offset = rand(0, 864000) //hours in day * minutes in hour * seconds in minute * deciseconds in second + if(prob(50)) + SSticker.gametime_offset = FLOOR(SSticker.gametime_offset, 3600) + else + SSticker.gametime_offset = CEILING(SSticker.gametime_offset, 3600) /* Returns 1 if it is the selected month and day */ /proc/isDay(month, day) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index c47c0699d2..714e9d114e 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -13,7 +13,7 @@ //#define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green #endif -//#define UNIT_TESTS //Enables unit tests via TEST_RUN_PARAMETER +//#define UNIT_TESTS //Enables unit tests via TEST_RUN_PARAMETER #ifndef PRELOAD_RSC //set to: #define PRELOAD_RSC 0 // 0 to allow using external resources or on-demand behaviour; diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index cc8f832229..b7edace2e6 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -275,3 +275,9 @@ integer = FALSE /datum/config_entry/flag/ic_printing + +/datum/config_entry/flag/enable_night_shifts + +/datum/config_entry/flag/randomize_shift_time + +/datum/config_entry/flag/shift_time_realtime diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm new file mode 100644 index 0000000000..93003c4634 --- /dev/null +++ b/code/controllers/subsystem/nightshift.dm @@ -0,0 +1,68 @@ +SUBSYSTEM_DEF(nightshift) + name = "Night Shift" + wait = 600 + flags = SS_NO_TICK_CHECK + + var/nightshift_active = FALSE + var/nightshift_start_time = 702000 //7:30 PM, station time + var/nightshift_end_time = 270000 //7:30 AM, station time + var/nightshift_first_check = 30 SECONDS + + var/obey_security_level = TRUE + var/high_security_mode = FALSE + +/datum/controller/subsystem/nightshift/Initialize() + if(!CONFIG_GET(flag/enable_night_shifts)) + can_fire = FALSE + return ..() + +/datum/controller/subsystem/nightshift/fire(resumed = FALSE) + if(world.time - SSticker.round_start_time < nightshift_first_check) + return + check_nightshift() + +/datum/controller/subsystem/nightshift/proc/check_nightshift(force_set = FALSE) + var/time = station_time() + var/nightshift = time < nightshift_end_time || time > nightshift_start_time + var/red_or_delta = GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA + var/announcing = TRUE + if(nightshift && red_or_delta) + nightshift = FALSE + if(high_security_mode && !red_or_delta) + high_security_mode = FALSE + priority_announce("Restoring night lighting configuration to normal operation.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement") + announcing = FALSE + else if(!high_security_mode && red_or_delta) + high_security_mode = TRUE + priority_announce("Night lighting disabled: Station is in a state of emergency.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement") + announcing = FALSE + + if((nightshift_active != nightshift) || force_set) + nightshift? activate_nightshift(announcing) : deactivate_nightshift(announcing) + +/datum/controller/subsystem/nightshift/proc/activate_nightshift(announce = TRUE) + if(!nightshift_active) + if(announce) + priority_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.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement") + nightshift_active = TRUE + var/list/area/affected = return_nightshift_area_types() + for(var/i in affected) + var/area/A = locate(i) in GLOB.sortedAreas + for(var/obj/machinery/power/apc/APC in A) + APC.set_nightshift(TRUE) + CHECK_TICK + +/datum/controller/subsystem/nightshift/proc/deactivate_nightshift(announce = TRUE) + if(nightshift_active) + if(announce) + priority_announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement") + nightshift_active = FALSE + var/list/area/affected = return_nightshift_area_types() + for(var/i in affected) + var/area/A = locate(i) in GLOB.sortedAreas + for(var/obj/machinery/power/apc/APC in A) + APC.set_nightshift(FALSE) + CHECK_TICK + +/datum/controller/subsystem/nightshift/proc/return_nightshift_area_types() + return GLOB.the_station_areas.Copy() diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 4ab8332303..f9826a4265 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -43,7 +43,8 @@ SUBSYSTEM_DEF(ticker) var/timeLeft //pregame timer var/start_at - var/gametime_offset = 432000 // equal to 12 hours, making gametime at roundstart 12:00:00 + var/gametime_offset = 432000 //Deciseconds to add to world.time for station time. + var/station_time_rate_multiplier = 24 //factor of station time progressal vs real time. var/totalPlayers = 0 //used for pregame stats on statpanel var/totalPlayersReady = 0 //used for pregame stats on statpanel @@ -144,6 +145,10 @@ SUBSYSTEM_DEF(ticker) ..() start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10) + if(CONFIG_GET(flag/randomize_shift_time)) + gametime_offset = rand(0, 23) HOURS + else if(CONFIG_GET(flag/shift_time_realtime)) + gametime_offset = world.timeofday /datum/controller/subsystem/ticker/fire() switch(current_state) diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index a5d7296ce6..d8ee305c91 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -187,7 +187,7 @@ interact(usr) //Refresh the UI after a filter changes /obj/machinery/computer/apc_control/emag_act(mob/user) - if(!authenticated) + if(!authenticated) to_chat(user, "You bypass [src]'s access requirements using your emag.") authenticated = TRUE log_activity("logged in") @@ -199,7 +199,7 @@ /obj/machinery/computer/apc_control/proc/log_activity(log_text) var/op_string = operator && !(obj_flags & EMAGGED) ? operator : "\[NULL OPERATOR\]" - LAZYADD(logs, "([worldtime2text()]) [op_string] [log_text]") + LAZYADD(logs, "([station_time_timestamp()]) [op_string] [log_text]") /mob/proc/using_power_flow_console() for(var/obj/machinery/computer/apc_control/A in range(1, src)) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index cba82f805f..f2a6353d8a 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -495,7 +495,7 @@ var/counter = 1 while(src.active2.fields[text("com_[]", counter)]) counter++ - src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) + src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) else if(href_list["del_c"]) if((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index c17c251487..8b08824c44 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -474,7 +474,7 @@ What a mess.*/ var/counter = 1 while(active2.fields[text("com_[]", counter)]) counter++ - active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) + active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) if("Delete Record (ALL)") if(active1) @@ -616,7 +616,7 @@ What a mess.*/ if(active1.fields["photo_front"]) if(istype(active1.fields["photo_front"], /obj/item/photo)) var/obj/item/photo/P = active1.fields["photo_front"] - print_photo(P.img, active1.fields["name"]) + print_photo(P.img, active1.fields["name"]) if("show_photo_side") if(active1.fields["photo_side"]) if(istype(active1.fields["photo_side"], /obj/item/photo)) @@ -631,14 +631,14 @@ What a mess.*/ if(active1.fields["photo_side"]) if(istype(active1.fields["photo_side"], /obj/item/photo)) var/obj/item/photo/P = active1.fields["photo_side"] - print_photo(P.img, active1.fields["name"]) + print_photo(P.img, active1.fields["name"]) if("mi_crim_add") if(istype(active1, /datum/data/record)) var/t1 = stripped_input(usr, "Please input minor crime names:", "Secure. records", "", null) var/t2 = stripped_input(usr, "Please input minor crime details:", "Secure. records", "", null) if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) return - var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text()) + var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, station_time_timestamp()) GLOB.data_core.addMinorCrime(active1.fields["id"], crime) if("mi_crim_delete") if(istype(active1, /datum/data/record)) @@ -652,7 +652,7 @@ What a mess.*/ var/t2 = stripped_input(usr, "Please input major crime details:", "Secure. records", "", null) if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) return - var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text()) + var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, station_time_timestamp()) GLOB.data_core.addMajorCrime(active1.fields["id"], crime) if("ma_crim_delete") if(istype(active1, /datum/data/record)) diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm index 283232f991..6d31a9dbcd 100644 --- a/code/game/machinery/computer/telecrystalconsoles.dm +++ b/code/game/machinery/computer/telecrystalconsoles.dm @@ -141,7 +141,7 @@ GLOBAL_LIST_INIT(possible_uplinker_IDs, list("Alfa","Bravo","Charlie","Delta","E var/list/transferlog = list() /obj/machinery/computer/telecrystals/boss/proc/logTransfer(logmessage) - transferlog += ("[worldtime2text()] [logmessage]") + transferlog += ("[station_time_timestamp()] [logmessage]") /obj/machinery/computer/telecrystals/boss/proc/scanUplinkers() for(var/obj/machinery/computer/telecrystals/uplinker/A in urange(scanrange, src.loc)) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index aa724c087f..d1a6eec3b0 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -122,7 +122,7 @@ GLOBAL_LIST_EMPTY(allCasters) var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message newMsg.author = author newMsg.body = msg - newMsg.time_stamp = "[worldtime2text()]" + newMsg.time_stamp = "[station_time_timestamp()]" newMsg.is_admin_message = adminMessage newMsg.locked = !allow_comments if(photo) @@ -701,7 +701,7 @@ GLOBAL_LIST_EMPTY(allCasters) var/datum/newscaster/feed_comment/FC = new/datum/newscaster/feed_comment FC.author = scanned_user FC.body = cominput - FC.time_stamp = worldtime2text() + FC.time_stamp = station_time_timestamp() FM.comments += FC log_talk(usr,"[key_name(usr)] as [scanned_user] commented on message [FM.returnBody(-1)] -- [FC.body]",LOGCOMMENT) updateUsrDialog() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 8bda5d5e78..3e29a6f07e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -996,7 +996,7 @@ /obj/mecha/proc/log_message(message as text,red=null) log.len++ - log[log.len] = list("time"="[worldtime2text()]","date","year"="[GLOB.year_integer+540]","message"="[red?"":null][message][red?"":null]") + log[log.len] = list("time"="[station_time_timestamp()]","date","year"="[GLOB.year_integer+540]","message"="[red?"":null][message][red?"":null]") return log.len /obj/mecha/proc/log_append_to_last(message as text,red=null) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index db7e2993ae..044336e65d 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -212,7 +212,7 @@ GLOBAL_LIST_EMPTY(PDAs) dat += text("ID: [id ? "[id.registered_name], [id.assignment]" : "----------"]") dat += text("
[id ? "Update PDA Info" : ""]

") - dat += "[worldtime2text()]
" //:[world.time / 100 % 6][world.time / 100 % 10]" + dat += "[station_time_timestamp()]
" //:[world.time / 100 % 6][world.time / 100 % 10]" dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]" dat += "

" diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 4bad63b5ee..cd632032ac 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1072,7 +1072,7 @@ /obj/item/toy/clockwork_watch/examine(mob/user) ..() - to_chat(user, "Station Time: [worldtime2text()]") + to_chat(user, "Station Time: [station_time_timestamp()]") /* * Toy Dagger diff --git a/code/modules/NTNet/network.dm b/code/modules/NTNet/network.dm index aacc1b08b5..aee0dc1a2d 100644 --- a/code/modules/NTNet/network.dm +++ b/code/modules/NTNet/network.dm @@ -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 diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index ff0658bc27..754c894278 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -1,37 +1,37 @@ -/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, "We begin our stasis, preparing energy to arise once more.") - if(user.stat != DEAD) - user.emote("deathgasp") - user.tod = worldtime2text() - 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, "We are ready to revive.") - 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, "We are already reviving.") - 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 ..() +/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, "We begin our stasis, preparing energy to arise once more.") + 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, "We are ready to revive.") + 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, "We are already reviving.") + 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 ..() diff --git a/code/modules/detectivework/scanner.dm b/code/modules/detectivework/scanner.dm index fa6c1f88cb..aa80178030 100644 --- a/code/modules/detectivework/scanner.dm +++ b/code/modules/detectivework/scanner.dm @@ -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("[worldtime2text()][get_timestamp()] - [target_name]", 0) + add_log("[station_time_timestamp()][get_timestamp()] - [target_name]", 0) // Fingerprints if(length(fingerprints)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7ff6c5a13f..64ffc91ae7 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -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, "Successfully added a minor crime.") 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, "Successfully added a major crime.") return @@ -470,7 +470,7 @@ var/counter = 1 while(R.fields[text("com_[]", counter)]) counter++ - R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []
[]", allowed_access, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) + R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []
[]", allowed_access, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) to_chat(usr, "Successfully added comment.") return to_chat(usr, "Unable to locate a data core entry for this person.") diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 36cf94df3b..bab93fa5f2 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -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) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 9c46c49ad9..50d86a2cf6 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -228,5 +228,5 @@ if(stat == DEAD) return add_trait(TRAIT_FAKEDEATH, source) - tod = worldtime2text() + tod = station_time_timestamp() update_stat() \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 07caeba711..26c6e88775 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -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() diff --git a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm index 3efa1d7963..20ad05b8e3 100644 --- a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm +++ b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm @@ -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() diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 2d50d4a186..ce8d8ce4b9 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -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 diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 88f322328f..def388c574 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -159,7 +159,7 @@
[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, "Hardware error: Printer was unable to print the file. It may be out of paper.") return else diff --git a/code/modules/modular_computers/file_system/programs/file_browser.dm b/code/modules/modular_computers/file_system/programs/file_browser.dm index 11a4b8e125..fb90ecbfad 100644 --- a/code/modules/modular_computers/file_system/programs/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/file_browser.dm @@ -145,7 +145,7 @@ t = replacetext(t, "\[/i\]", "") t = replacetext(t, "\[u\]", "") t = replacetext(t, "\[/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\]", "") t = replacetext(t, "\[/large\]", "") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index fcc0d3a7b3..7c94ed7392 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -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, "[src]'s night lighting circuit breaker is still cycling!") + 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 diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 719aa082ca..bf5ca084e9 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -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,27 @@ 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) - 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) 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 - 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) else if(has_emergency_power(LIGHT_EMERGENCY_POWER_USE) && !turned_off()) use_power = IDLE_POWER_USE emergency_mode = TRUE diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index d4e21edb32..61c3f8833f 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -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 @@ -84,13 +84,8 @@ GLOBAL_VAR_INIT(security_level, 0) if(D.red_alert_access) D.visible_message("[D] whirrs as it automatically lifts access requirements!") playsound(D, 'sound/machines/boltsup.ogg', 50, TRUE) - //Citadel change, makes red and delta alerts override nightshift lights - SSnightshift.nightshift_override = TRUE - if(SSnightshift.nightshift) - SSnightshift.nightshift = FALSE - SSnightshift.updatenightlights() - //End of citadel changes SSblackbox.record_feedback("tally", "security_level_changes", 1, get_security_level()) + SSnightshift.check_nightshift() else return diff --git a/config/game_options.txt b/config/game_options.txt index bd39305cf7..6cdc0990ad 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -511,10 +511,11 @@ ALLOW_MISCREANTS ## Determines if players are allowed to print integrated circuits, uncomment to allow. #IC_PRINTING -## NIGHT SHIFT ## -## Comment to disable nightshift -NIGHTSHIFT_ENABLED +## Enable night shifts ## +ENABLE_NIGHT_SHIFTS -## These values determine the start and end of night shift. By default, night shift starts at 8 PM, and ends at 6 AM. -NIGHTSHIFT_START 20 -NIGHTSHIFT_FINISH 6 +## Enable randomized shift start times## +RANDOMIZE_SHIFT_TIME + +## Sets shift time to server time at roundstart. Overridden by RANDOMIZE_SHIFT_TIME ## +#SHIFT_TIME_REALTIME diff --git a/modular_citadel/code/controllers/subsystem/cit_nightshift.dm b/modular_citadel/code/controllers/subsystem/cit_nightshift.dm deleted file mode 100644 index 5387b4bf01..0000000000 --- a/modular_citadel/code/controllers/subsystem/cit_nightshift.dm +++ /dev/null @@ -1,53 +0,0 @@ -/obj/machinery/light - var/obeysnightshift = FALSE - var/nightshift = FALSE - -/obj/machinery/light/Initialize() - . = ..() - var/area/a = get_area(src) - if(a.type in GLOB.the_station_areas) - obeysnightshift = TRUE - SSnightshift.nightlights += src - -/obj/machinery/light/Destroy() - if(obeysnightshift && src in SSnightshift.nightlights) - SSnightshift.nightlights -= src - . = ..() - -SUBSYSTEM_DEF(nightshift) - name = "Night shift" - wait = 3000 - flags = SS_BACKGROUND - - var/nightshift = FALSE - var/nightshift_light_power = 0.45 - var/nightshift_light_color = "#FFDDCC" - var/nightshift_override = FALSE - - var/list/nightlights = list() - -/datum/controller/subsystem/nightshift/Initialize() - if(CONFIG_GET(flag/nightshift_enabled) && !nightshift_override) - var/nighttime = text2num(time2text(world.timeofday,"hh")) - if(!nightshift && ((nighttime >= CONFIG_GET(number/nightshift_start)) || (nighttime <= CONFIG_GET(number/nightshift_finish)))) - nightshift = TRUE - updatenightlights() - . = ..() - -/datum/controller/subsystem/nightshift/fire(resumed = 0) - if(CONFIG_GET(flag/nightshift_enabled) && !nightshift_override) - var/nighttime = text2num(time2text(world.timeofday,"hh")) - if(GLOB.security_level < SEC_LEVEL_RED && ((nighttime >= CONFIG_GET(number/nightshift_start)) || (nighttime <= CONFIG_GET(number/nightshift_finish)))) - if(!nightshift) - nightshift = TRUE - updatenightlights() - priority_announce("Good afternoon, 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.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement") - else if(nightshift) - nightshift = FALSE - updatenightlights() - priority_announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement") - -/datum/controller/subsystem/nightshift/proc/updatenightlights() - for(var/obj/machinery/light/nightlight in nightlights) - if(nightlight) - nightlight.update(FALSE) diff --git a/tgstation.dme b/tgstation.dme index 47e4e3b2c4..a49437ef9d 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -257,6 +257,7 @@ #include "code\controllers\subsystem\medals.dm" #include "code\controllers\subsystem\minimap.dm" #include "code\controllers\subsystem\mobs.dm" +#include "code\controllers\subsystem\nightshift.dm" #include "code\controllers\subsystem\npcpool.dm" #include "code\controllers\subsystem\orbit.dm" #include "code\controllers\subsystem\overlays.dm" @@ -2535,7 +2536,6 @@ #include "modular_citadel\code\__HELPERS\mobs.dm" #include "modular_citadel\code\_globalvars\lists\mobs.dm" #include "modular_citadel\code\controllers\configuration\entries\general.dm" -#include "modular_citadel\code\controllers\subsystem\cit_nightshift.dm" #include "modular_citadel\code\controllers\subsystem\job.dm" #include "modular_citadel\code\controllers\subsystem\research.dm" #include "modular_citadel\code\controllers\subsystem\shuttle.dm" diff --git a/tgui/assets/tgui.js b/tgui/assets/tgui.js index 45259aec58..66b8a1b9de 100644 --- a/tgui/assets/tgui.js +++ b/tgui/assets/tgui.js @@ -1,18 +1,18 @@ -require=function t(e,n,a){function r(o,s){if(!n[o]){if(!e[o]){var p="function"==typeof require&&require;if(!s&&p)return p(o,!0);if(i)return i(o,!0);var u=Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return r(n?n:t)},c,c.exports,t,e,n,a)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?u[2]:void 0,l=Math.min((void 0===c?o:r(c,o))-p,o-s),d=1;for(s>p&&p+l>s&&(d=-1,p+=l-1,s+=l-1);l-- >0;)p in n?n[s]=n[p]:delete n[s],s+=d,p+=d;return n}},{76:76,79:79,80:80}],6:[function(t,e,n){"use strict";var a=t(80),r=t(76),i=t(79);e.exports=[].fill||function(t){for(var e=a(this),n=i(e.length),o=arguments,s=o.length,p=r(s>1?o[1]:void 0,n),u=s>2?o[2]:void 0,c=void 0===u?n:r(u,n);c>p;)e[p++]=t;return e}},{76:76,79:79,80:80}],7:[function(t,e,n){var a=t(78),r=t(79),i=t(76);e.exports=function(t){return function(e,n,o){var s,p=a(e),u=r(p.length),c=i(o,u);if(t&&n!=n){for(;u>c;)if(s=p[c++],s!=s)return!0}else for(;u>c;c++)if((t||c in p)&&p[c]===n)return t||c;return!t&&-1}}},{76:76,78:78,79:79}],8:[function(t,e,n){var a=t(17),r=t(34),i=t(80),o=t(79),s=t(9);e.exports=function(t){var e=1==t,n=2==t,p=3==t,u=4==t,c=6==t,l=5==t||c;return function(d,f,h){for(var m,g,v=i(d),b=r(v),y=a(f,h,3),x=o(b.length),_=0,w=e?s(d,x):n?s(d,0):void 0;x>_;_++)if((l||_ in b)&&(m=b[_],g=y(m,_,v),t))if(e)w[_]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return _;case 2:w.push(m)}else if(u)return!1;return c?-1:p||u?u:w}}},{17:17,34:34,79:79,80:80,9:9}],9:[function(t,e,n){var a=t(38),r=t(36),i=t(83)("species");e.exports=function(t,e){var n;return r(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!r(n.prototype)||(n=void 0),a(n)&&(n=n[i],null===n&&(n=void 0))),new(void 0===n?Array:n)(e)}},{36:36,38:38,83:83}],10:[function(t,e,n){var a=t(11),r=t(83)("toStringTag"),i="Arguments"==a(function(){return arguments}());e.exports=function(t){var e,n,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=(e=Object(t))[r])?n:i?a(e):"Object"==(o=a(e))&&"function"==typeof e.callee?"Arguments":o}},{11:11,83:83}],11:[function(t,e,n){var a={}.toString;e.exports=function(t){return a.call(t).slice(8,-1)}},{}],12:[function(t,e,n){"use strict";var a=t(46),r=t(31),i=t(60),o=t(17),s=t(69),p=t(18),u=t(27),c=t(42),l=t(44),d=t(82)("id"),f=t(30),h=t(38),m=t(65),g=t(19),v=Object.isExtensible||h,b=g?"_s":"size",y=0,x=function(t,e){if(!h(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!f(t,d)){if(!v(t))return"F";if(!e)return"E";r(t,d,++y)}return"O"+t[d]},_=function(t,e){var n,a=x(e);if("F"!==a)return t._i[a];for(n=t._f;n;n=n.n)if(n.k==e)return n};e.exports={getConstructor:function(t,e,n,r){var c=t(function(t,i){s(t,c,e),t._i=a.create(null),t._f=void 0,t._l=void 0,t[b]=0,void 0!=i&&u(i,n,t[r],t)});return i(c.prototype,{clear:function(){for(var t=this,e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[b]=0},"delete":function(t){var e=this,n=_(e,t);if(n){var a=n.n,r=n.p;delete e._i[n.i],n.r=!0,r&&(r.n=a),a&&(a.p=r),e._f==n&&(e._f=a),e._l==n&&(e._l=r),e[b]--}return!!n},forEach:function(t){for(var e,n=o(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(n(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!_(this,t)}}),g&&a.setDesc(c.prototype,"size",{get:function(){return p(this[b])}}),c},def:function(t,e,n){var a,r,i=_(t,e);return i?i.v=n:(t._l=i={i:r=x(e,!0),k:e,v:n,p:a=t._l,n:void 0,r:!1},t._f||(t._f=i),a&&(a.n=i),t[b]++,"F"!==r&&(t._i[r]=i)),t},getEntry:_,setStrong:function(t,e,n){c(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?l(0,n.k):"values"==e?l(0,n.v):l(0,[n.k,n.v]):(t._t=void 0,l(1))},n?"entries":"values",!n,!0),m(e)}}},{17:17,18:18,19:19,27:27,30:30,31:31,38:38,42:42,44:44,46:46,60:60,65:65,69:69,82:82}],13:[function(t,e,n){var a=t(27),r=t(10);e.exports=function(t){return function(){if(r(this)!=t)throw TypeError(t+"#toJSON isn't generic");var e=[];return a(this,!1,e.push,e),e}}},{10:10,27:27}],14:[function(t,e,n){"use strict";var a=t(31),r=t(60),i=t(4),o=t(38),s=t(69),p=t(27),u=t(8),c=t(30),l=t(82)("weak"),d=Object.isExtensible||o,f=u(5),h=u(6),m=0,g=function(t){return t._l||(t._l=new v)},v=function(){this.a=[]},b=function(t,e){return f(t.a,function(t){return t[0]===e})};v.prototype={get:function(t){var e=b(this,t);return e?e[1]:void 0},has:function(t){return!!b(this,t)},set:function(t,e){var n=b(this,t);n?n[1]=e:this.a.push([t,e])},"delete":function(t){var e=h(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},e.exports={getConstructor:function(t,e,n,a){var i=t(function(t,r){s(t,i,e),t._i=m++,t._l=void 0,void 0!=r&&p(r,n,t[a],t)});return r(i.prototype,{"delete":function(t){return o(t)?d(t)?c(t,l)&&c(t[l],this._i)&&delete t[l][this._i]:g(this)["delete"](t):!1},has:function(t){return o(t)?d(t)?c(t,l)&&c(t[l],this._i):g(this).has(t):!1}}),i},def:function(t,e,n){return d(i(e))?(c(e,l)||a(e,l,{}),e[l][t._i]=n):g(t).set(e,n),t},frozenStore:g,WEAK:l}},{27:27,30:30,31:31,38:38,4:4,60:60,69:69,8:8,82:82}],15:[function(t,e,n){"use strict";var a=t(29),r=t(22),i=t(61),o=t(60),s=t(27),p=t(69),u=t(38),c=t(24),l=t(43),d=t(66);e.exports=function(t,e,n,f,h,m){var g=a[t],v=g,b=h?"set":"add",y=v&&v.prototype,x={},_=function(t){var e=y[t];i(y,t,"delete"==t?function(t){return m&&!u(t)?!1:e.call(this,0===t?0:t)}:"has"==t?function(t){return m&&!u(t)?!1:e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!u(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof v&&(m||y.forEach&&!c(function(){(new v).entries().next()}))){var w,k=new v,E=k[b](m?{}:-0,1)!=k,S=c(function(){k.has(1)}),C=l(function(t){new v(t)});C||(v=e(function(e,n){p(e,v,t);var a=new g;return void 0!=n&&s(n,h,a[b],a),a}),v.prototype=y,y.constructor=v),m||k.forEach(function(t,e){w=1/e===-(1/0)}),(S||w)&&(_("delete"),_("has"),h&&_("get")),(w||E)&&_(b),m&&y.clear&&delete y.clear}else v=f.getConstructor(e,t,h,b),o(v.prototype,n);return d(v,t),x[t]=v,r(r.G+r.W+r.F*(v!=g),x),m||f.setStrong(v,t,h),v}},{22:22,24:24,27:27,29:29,38:38,43:43,60:60,61:61,66:66,69:69}],16:[function(t,e,n){var a=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=a)},{}],17:[function(t,e,n){var a=t(2);e.exports=function(t,e,n){if(a(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,a){return t.call(e,n,a)};case 3:return function(n,a,r){return t.call(e,n,a,r)}}return function(){return t.apply(e,arguments)}}},{2:2}],18:[function(t,e,n){e.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],19:[function(t,e,n){e.exports=!t(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{24:24}],20:[function(t,e,n){var a=t(38),r=t(29).document,i=a(r)&&a(r.createElement);e.exports=function(t){return i?r.createElement(t):{}}},{29:29,38:38}],21:[function(t,e,n){var a=t(46);e.exports=function(t){var e=a.getKeys(t),n=a.getSymbols;if(n)for(var r,i=n(t),o=a.isEnum,s=0;i.length>s;)o.call(t,r=i[s++])&&e.push(r);return e}},{46:46}],22:[function(t,e,n){var a=t(29),r=t(16),i=t(31),o=t(61),s=t(17),p="prototype",u=function(t,e,n){var c,l,d,f,h=t&u.F,m=t&u.G,g=t&u.S,v=t&u.P,b=t&u.B,y=m?a:g?a[e]||(a[e]={}):(a[e]||{})[p],x=m?r:r[e]||(r[e]={}),_=x[p]||(x[p]={});m&&(n=e);for(c in n)l=!h&&y&&c in y,d=(l?y:n)[c],f=b&&l?s(d,a):v&&"function"==typeof d?s(Function.call,d):d,y&&!l&&o(y,c,d),x[c]!=d&&i(x,c,f),v&&_[c]!=d&&(_[c]=d)};a.core=r,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,e.exports=u},{16:16,17:17,29:29,31:31,61:61}],23:[function(t,e,n){var a=t(83)("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[a]=!1,!"/./"[t](e)}catch(r){}}return!0}},{83:83}],24:[function(t,e,n){e.exports=function(t){try{return!!t()}catch(e){return!0}}},{}],25:[function(t,e,n){"use strict";var a=t(31),r=t(61),i=t(24),o=t(18),s=t(83);e.exports=function(t,e,n){var p=s(t),u=""[t];i(function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})&&(r(String.prototype,t,n(o,p,u)),a(RegExp.prototype,p,2==e?function(t,e){return u.call(t,this,e)}:function(t){return u.call(t,this)}))}},{18:18,24:24,31:31,61:61,83:83}],26:[function(t,e,n){"use strict";var a=t(4);e.exports=function(){var t=a(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},{4:4}],27:[function(t,e,n){var a=t(17),r=t(40),i=t(35),o=t(4),s=t(79),p=t(84);e.exports=function(t,e,n,u){var c,l,d,f=p(t),h=a(n,u,e?2:1),m=0;if("function"!=typeof f)throw TypeError(t+" is not iterable!");if(i(f))for(c=s(t.length);c>m;m++)e?h(o(l=t[m])[0],l[1]):h(t[m]);else for(d=f.call(t);!(l=d.next()).done;)r(d,h,l.value,e)}},{17:17,35:35,4:4,40:40,79:79,84:84}],28:[function(t,e,n){var a=t(78),r=t(46).getNames,i={}.toString,o="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return r(t)}catch(e){return o.slice()}};e.exports.get=function(t){return o&&"[object Window]"==i.call(t)?s(t):r(a(t))}},{46:46,78:78}],29:[function(t,e,n){var a=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=a)},{}],30:[function(t,e,n){var a={}.hasOwnProperty;e.exports=function(t,e){return a.call(t,e)}},{}],31:[function(t,e,n){var a=t(46),r=t(59);e.exports=t(19)?function(t,e,n){return a.setDesc(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},{19:19,46:46,59:59}],32:[function(t,e,n){e.exports=t(29).document&&document.documentElement},{29:29}],33:[function(t,e,n){e.exports=function(t,e,n){var a=void 0===n;switch(e.length){case 0:return a?t():t.call(n);case 1:return a?t(e[0]):t.call(n,e[0]);case 2:return a?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return a?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return a?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},{}],34:[function(t,e,n){var a=t(11);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==a(t)?t.split(""):Object(t)}},{11:11}],35:[function(t,e,n){var a=t(45),r=t(83)("iterator"),i=Array.prototype;e.exports=function(t){return void 0!==t&&(a.Array===t||i[r]===t)}},{45:45,83:83}],36:[function(t,e,n){var a=t(11);e.exports=Array.isArray||function(t){return"Array"==a(t)}},{11:11}],37:[function(t,e,n){var a=t(38),r=Math.floor;e.exports=function(t){return!a(t)&&isFinite(t)&&r(t)===t}},{38:38}],38:[function(t,e,n){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],39:[function(t,e,n){var a=t(38),r=t(11),i=t(83)("match");e.exports=function(t){var e;return a(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==r(t))}},{11:11,38:38,83:83}],40:[function(t,e,n){var a=t(4);e.exports=function(t,e,n,r){try{return r?e(a(n)[0],n[1]):e(n)}catch(i){var o=t["return"];throw void 0!==o&&a(o.call(t)),i}}},{4:4}],41:[function(t,e,n){"use strict";var a=t(46),r=t(59),i=t(66),o={};t(31)(o,t(83)("iterator"),function(){return this}),e.exports=function(t,e,n){t.prototype=a.create(o,{next:r(1,n)}),i(t,e+" Iterator")}},{31:31,46:46,59:59,66:66,83:83}],42:[function(t,e,n){"use strict";var a=t(48),r=t(22),i=t(61),o=t(31),s=t(30),p=t(45),u=t(41),c=t(66),l=t(46).getProto,d=t(83)("iterator"),f=!([].keys&&"next"in[].keys()),h="@@iterator",m="keys",g="values",v=function(){return this};e.exports=function(t,e,n,b,y,x,_){u(n,e,b);var w,k,E=function(t){if(!f&&t in A)return A[t];switch(t){case m:return function(){return new n(this,t)};case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",C=y==g,P=!1,A=t.prototype,O=A[d]||A[h]||y&&A[y],T=O||E(y);if(O){var R=l(T.call(new t));c(R,S,!0),!a&&s(A,h)&&o(R,d,v),C&&O.name!==g&&(P=!0,T=function(){return O.call(this)})}if(a&&!_||!f&&!P&&A[d]||o(A,d,T),p[e]=T,p[S]=v,y)if(w={values:C?T:E(g),keys:x?T:E(m),entries:C?E("entries"):T},_)for(k in w)k in A||i(A,k,w[k]);else r(r.P+r.F*(f||P),e,w);return w}},{22:22,30:30,31:31,41:41,45:45,46:46,48:48,61:61,66:66,83:83}],43:[function(t,e,n){var a=t(83)("iterator"),r=!1;try{var i=[7][a]();i["return"]=function(){r=!0},Array.from(i,function(){throw 2})}catch(o){}e.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var i=[7],o=i[a]();o.next=function(){return{done:n=!0}},i[a]=function(){return o},t(i)}catch(s){}return n}},{83:83}],44:[function(t,e,n){e.exports=function(t,e){return{value:e,done:!!t}}},{}],45:[function(t,e,n){e.exports={}},{}],46:[function(t,e,n){var a=Object;e.exports={create:a.create,getProto:a.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:a.getOwnPropertyDescriptor,setDesc:a.defineProperty,setDescs:a.defineProperties,getKeys:a.keys,getNames:a.getOwnPropertyNames,getSymbols:a.getOwnPropertySymbols,each:[].forEach}},{}],47:[function(t,e,n){var a=t(46),r=t(78);e.exports=function(t,e){for(var n,i=r(t),o=a.getKeys(i),s=o.length,p=0;s>p;)if(i[n=o[p++]]===e)return n}},{46:46,78:78}],48:[function(t,e,n){e.exports=!1},{}],49:[function(t,e,n){e.exports=Math.expm1||function(t){return 0==(t=+t)?t:t>-1e-6&&1e-6>t?t+t*t/2:Math.exp(t)-1}},{}],50:[function(t,e,n){e.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&1e-8>t?t-t*t/2:Math.log(1+t)}},{}],51:[function(t,e,n){e.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:0>t?-1:1}},{}],52:[function(t,e,n){var a,r,i,o=t(29),s=t(75).set,p=o.MutationObserver||o.WebKitMutationObserver,u=o.process,c=o.Promise,l="process"==t(11)(u),d=function(){var t,e,n;for(l&&(t=u.domain)&&(u.domain=null,t.exit());a;)e=a.domain,n=a.fn,e&&e.enter(),n(),e&&e.exit(),a=a.next;r=void 0,t&&t.enter()};if(l)i=function(){u.nextTick(d)};else if(p){var f=1,h=document.createTextNode("");new p(d).observe(h,{characterData:!0}),i=function(){h.data=f=-f}}else i=c&&c.resolve?function(){c.resolve().then(d)}:function(){s.call(o,d)};e.exports=function(t){var e={fn:t,next:void 0,domain:l&&u.domain};r&&(r.next=e),a||(a=e,i()),r=e}},{11:11,29:29,75:75}],53:[function(t,e,n){var a=t(46),r=t(80),i=t(34);e.exports=t(24)(function(){var t=Object.assign,e={},n={},a=Symbol(),r="abcdefghijklmnopqrst";return e[a]=7,r.split("").forEach(function(t){n[t]=t}),7!=t({},e)[a]||Object.keys(t({},n)).join("")!=r})?function(t,e){for(var n=r(t),o=arguments,s=o.length,p=1,u=a.getKeys,c=a.getSymbols,l=a.isEnum;s>p;)for(var d,f=i(o[p++]),h=c?u(f).concat(c(f)):u(f),m=h.length,g=0;m>g;)l.call(f,d=h[g++])&&(n[d]=f[d]);return n}:Object.assign},{24:24,34:34,46:46,80:80}],54:[function(t,e,n){var a=t(22),r=t(16),i=t(24);e.exports=function(t,e){var n=(r.Object||{})[t]||Object[t],o={};o[t]=e(n),a(a.S+a.F*i(function(){n(1)}),"Object",o)}},{16:16,22:22,24:24}],55:[function(t,e,n){var a=t(46),r=t(78),i=a.isEnum;e.exports=function(t){return function(e){for(var n,o=r(e),s=a.getKeys(o),p=s.length,u=0,c=[];p>u;)i.call(o,n=s[u++])&&c.push(t?[n,o[n]]:o[n]);return c}}},{46:46,78:78}],56:[function(t,e,n){var a=t(46),r=t(4),i=t(29).Reflect;e.exports=i&&i.ownKeys||function(t){var e=a.getNames(r(t)),n=a.getSymbols;return n?e.concat(n(t)):e}},{29:29,4:4,46:46}],57:[function(t,e,n){"use strict";var a=t(58),r=t(33),i=t(2);e.exports=function(){for(var t=i(this),e=arguments.length,n=Array(e),o=0,s=a._,p=!1;e>o;)(n[o]=arguments[o++])===s&&(p=!0);return function(){var a,i=this,o=arguments,u=o.length,c=0,l=0;if(!p&&!u)return r(t,n,i);if(a=n.slice(),p)for(;e>c;c++)a[c]===s&&(a[c]=o[l++]);for(;u>l;)a.push(o[l++]);return r(t,a,i)}}},{2:2,33:33,58:58}],58:[function(t,e,n){e.exports=t(29)},{29:29}],59:[function(t,e,n){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],60:[function(t,e,n){var a=t(61);e.exports=function(t,e){for(var n in e)a(t,n,e[n]);return t}},{61:61}],61:[function(t,e,n){var a=t(29),r=t(31),i=t(82)("src"),o="toString",s=Function[o],p=(""+s).split(o);t(16).inspectSource=function(t){return s.call(t)},(e.exports=function(t,e,n,o){"function"==typeof n&&(n.hasOwnProperty(i)||r(n,i,t[e]?""+t[e]:p.join(e+"")),n.hasOwnProperty("name")||r(n,"name",e)),t===a?t[e]=n:(o||delete t[e],r(t,e,n))})(Function.prototype,o,function(){return"function"==typeof this&&this[i]||s.call(this)})},{16:16,29:29,31:31,82:82}],62:[function(t,e,n){e.exports=function(t,e){var n=e===Object(e)?function(t){return e[t]}:e;return function(e){return(e+"").replace(t,n)}}},{}],63:[function(t,e,n){e.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},{}],64:[function(t,e,n){var a=t(46).getDesc,r=t(38),i=t(4),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,r){try{r=t(17)(Function.call,a(Object.prototype,"__proto__").set,2),r(e,[]),n=!(e instanceof Array)}catch(i){n=!0}return function(t,e){return o(t,e),n?t.__proto__=e:r(t,e),t}}({},!1):void 0),check:o}},{17:17,38:38,4:4,46:46}],65:[function(t,e,n){"use strict";var a=t(29),r=t(46),i=t(19),o=t(83)("species");e.exports=function(t){var e=a[t];i&&e&&!e[o]&&r.setDesc(e,o,{configurable:!0,get:function(){return this}})}},{19:19,29:29,46:46,83:83}],66:[function(t,e,n){var a=t(46).setDesc,r=t(30),i=t(83)("toStringTag");e.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,i)&&a(t,i,{configurable:!0,value:e})}},{30:30,46:46,83:83}],67:[function(t,e,n){var a=t(29),r="__core-js_shared__",i=a[r]||(a[r]={});e.exports=function(t){return i[t]||(i[t]={})}},{29:29}],68:[function(t,e,n){var a=t(4),r=t(2),i=t(83)("species");e.exports=function(t,e){var n,o=a(t).constructor;return void 0===o||void 0==(n=a(o)[i])?e:r(n)}},{2:2,4:4,83:83}],69:[function(t,e,n){e.exports=function(t,e,n){if(!(t instanceof e))throw TypeError(n+": use the 'new' operator!");return t}},{}],70:[function(t,e,n){var a=t(77),r=t(18);e.exports=function(t){return function(e,n){var i,o,s=r(e)+"",p=a(n),u=s.length;return 0>p||p>=u?t?"":void 0:(i=s.charCodeAt(p),55296>i||i>56319||p+1===u||(o=s.charCodeAt(p+1))<56320||o>57343?t?s.charAt(p):i:t?s.slice(p,p+2):(i-55296<<10)+(o-56320)+65536)}}},{18:18,77:77}],71:[function(t,e,n){var a=t(39),r=t(18);e.exports=function(t,e,n){if(a(e))throw TypeError("String#"+n+" doesn't accept regex!");return r(t)+""}},{18:18,39:39}],72:[function(t,e,n){var a=t(79),r=t(73),i=t(18);e.exports=function(t,e,n,o){var s=i(t)+"",p=s.length,u=void 0===n?" ":n+"",c=a(e);if(p>=c)return s;""==u&&(u=" ");var l=c-p,d=r.call(u,Math.ceil(l/u.length));return d.length>l&&(d=d.slice(0,l)),o?d+s:s+d}},{18:18,73:73,79:79}],73:[function(t,e,n){"use strict";var a=t(77),r=t(18);e.exports=function(t){var e=r(this)+"",n="",i=a(t);if(0>i||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},{18:18,77:77}],74:[function(t,e,n){var a=t(22),r=t(18),i=t(24),o=" \n\x0B\f\r   ᠎              \u2028\u2029\ufeff",s="["+o+"]",p="​…",u=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),l=function(t,e){var n={};n[t]=e(d),a(a.P+a.F*i(function(){return!!o[t]()||p[t]()!=p}),"String",n)},d=l.trim=function(t,e){return t=r(t)+"",1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};e.exports=l},{18:18,22:22,24:24}],75:[function(t,e,n){var a,r,i,o=t(17),s=t(33),p=t(32),u=t(20),c=t(29),l=c.process,d=c.setImmediate,f=c.clearImmediate,h=c.MessageChannel,m=0,g={},v="onreadystatechange",b=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},y=function(t){b.call(t.data)};d&&f||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++m]=function(){s("function"==typeof t?t:Function(t),e)},a(m),m},f=function(t){delete g[t]},"process"==t(11)(l)?a=function(t){l.nextTick(o(b,t,1))}:h?(r=new h,i=r.port2,r.port1.onmessage=y,a=o(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(a=function(t){c.postMessage(t+"","*")},c.addEventListener("message",y,!1)):a=v in u("script")?function(t){p.appendChild(u("script"))[v]=function(){p.removeChild(this),b.call(t)}}:function(t){setTimeout(o(b,t,1),0)}),e.exports={set:d,clear:f}},{11:11,17:17,20:20,29:29,32:32,33:33}],76:[function(t,e,n){var a=t(77),r=Math.max,i=Math.min;e.exports=function(t,e){return t=a(t),0>t?r(t+e,0):i(t,e)}},{77:77}],77:[function(t,e,n){var a=Math.ceil,r=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?r:a)(t)}},{}],78:[function(t,e,n){var a=t(34),r=t(18);e.exports=function(t){return a(r(t))}},{18:18,34:34}],79:[function(t,e,n){var a=t(77),r=Math.min;e.exports=function(t){return t>0?r(a(t),9007199254740991):0}},{77:77}],80:[function(t,e,n){var a=t(18);e.exports=function(t){return Object(a(t))}},{18:18}],81:[function(t,e,n){var a=t(38);e.exports=function(t,e){if(!a(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!a(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!a(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!a(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},{38:38}],82:[function(t,e,n){var a=0,r=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++a+r).toString(36))}},{}],83:[function(t,e,n){var a=t(67)("wks"),r=t(82),i=t(29).Symbol;e.exports=function(t){return a[t]||(a[t]=i&&i[t]||(i||r)("Symbol."+t))}},{29:29,67:67,82:82}],84:[function(t,e,n){var a=t(10),r=t(83)("iterator"),i=t(45);e.exports=t(16).getIteratorMethod=function(t){return void 0!=t?t[r]||t["@@iterator"]||i[a(t)]:void 0}},{10:10,16:16,45:45,83:83}],85:[function(t,e,n){"use strict";var a,r=t(46),i=t(22),o=t(19),s=t(59),p=t(32),u=t(20),c=t(30),l=t(11),d=t(33),f=t(24),h=t(4),m=t(2),g=t(38),v=t(80),b=t(78),y=t(77),x=t(76),_=t(79),w=t(34),k=t(82)("__proto__"),E=t(8),S=t(7)(!1),C=Object.prototype,P=Array.prototype,A=P.slice,O=P.join,T=r.setDesc,R=r.getDesc,j=r.setDescs,L={};o||(a=!f(function(){return 7!=T(u("div"),"a",{get:function(){return 7}}).a}),r.setDesc=function(t,e,n){if(a)try{return T(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(h(t)[e]=n.value),t},r.getDesc=function(t,e){if(a)try{return R(t,e)}catch(n){}return c(t,e)?s(!C.propertyIsEnumerable.call(t,e),t[e]):void 0},r.setDescs=j=function(t,e){h(t);for(var n,a=r.getKeys(e),i=a.length,o=0;i>o;)r.setDesc(t,n=a[o++],e[n]);return t}),i(i.S+i.F*!o,"Object",{getOwnPropertyDescriptor:r.getDesc,defineProperty:r.setDesc,defineProperties:j});var M="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),D=M.concat("length","prototype"),N=M.length,F=function(){var t,e=u("iframe"),n=N,a=">";for(e.style.display="none",p.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("