From 89297332f7a8b24ba2e27b4e05050e7e4e8fec82 Mon Sep 17 00:00:00 2001 From: tralezab <40974010+tralezab@users.noreply.github.com> Date: Fri, 25 Dec 2020 13:14:35 -0800 Subject: [PATCH] tgui: Secrets Panel (#55698) Tgui-izes the secrets panel Removes one terrible shuttle button, but just know all of them are pretty shit There can only be one (40 second delay) was condensed into an option for there can only be one Before it was a blank HTML document. It has some kind of useful stuff, and also some shitpost-y stuff. Using some tab system really helps you pick out where the logging/issue fixing buttons are and where the silly garbage --- code/modules/admin/admin_verbs.dm | 7 - code/modules/admin/topic.dm | 3 - code/modules/admin/verbs/onlyone.dm | 3 +- code/modules/admin/{ => verbs}/secrets.dm | 962 ++++++++++------------ tgstation.dme | 2 +- tgui/packages/tgui/interfaces/Secrets.js | 678 +++++++++++++++ tgui/public/tgui-common.chunk.js | 2 +- tgui/public/tgui-panel.bundle.js | 2 +- tgui/public/tgui.bundle.js | 2 +- 9 files changed, 1098 insertions(+), 563 deletions(-) rename code/modules/admin/{ => verbs}/secrets.dm (56%) create mode 100644 tgui/packages/tgui/interfaces/Secrets.js diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index d5349bf05fd..ef8bd903c37 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -415,13 +415,6 @@ GLOBAL_PROTECT(admin_verbs_hideable) holder.Game() SSblackbox.record_feedback("tally", "admin_verb", 1, "Game Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/secrets() - set name = "Secrets" - set category = "Admin.Game" - if (holder) - holder.Secrets() - SSblackbox.record_feedback("tally", "admin_verb", 1, "Secrets Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - /client/proc/poll_panel() set name = "Server Poll Management" set category = "Admin" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index bb548e460d5..9dc2f959163 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1691,9 +1691,6 @@ break return - else if(href_list["secrets"]) - Secrets_topic(href_list["secrets"],href_list) - else if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index 40d2fb9f14d..cbee1b49dbd 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -5,6 +5,7 @@ GLOBAL_VAR_INIT(highlander, FALSE) return GLOB.highlander = TRUE + sound_to_playing_players('sound/misc/highlander.ogg') send_to_playing_players("THERE CAN BE ONLY ONE") for(var/obj/item/disk/nuclear/N in GLOB.poi_list) @@ -41,7 +42,7 @@ GLOBAL_VAR_INIT(highlander, FALSE) send_to_playing_players("Bagpipes begin to blare. You feel Scottish pride coming over you.") message_admins("[key_name_admin(usr)] used (delayed) THERE CAN BE ONLY ONE!") log_admin("[key_name(usr)] used delayed THERE CAN BE ONLY ONE.") - addtimer(CALLBACK(src, .proc/only_one), 420) + addtimer(CALLBACK(src, .proc/only_one), 42 SECONDS) /mob/living/carbon/human/proc/make_scottish() mind.add_antag_datum(/datum/antagonist/highlander) diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/verbs/secrets.dm similarity index 56% rename from code/modules/admin/secrets.dm rename to code/modules/admin/verbs/secrets.dm index 1dbab89d88e..8c319f145b3 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -1,127 +1,165 @@ -/datum/admins/proc/Secrets() - if(!check_rights(0)) + + +/client/proc/secrets() //Creates a verb for admins to open up the ui + set name = "Secrets" + set desc = "Abuse harder than you ever have before with this handy dandy semi-misc stuff menu" + set category = "Admin.Game" + SSblackbox.record_feedback("tally", "admin_verb", 1, "Secrets Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + var/datum/secrets_menu/tgui = new(usr)//create the datum + tgui.ui_interact(usr)//datum has a tgui component, here we open the window + +/datum/secrets_menu + var/client/holder //client of whoever is using this datum + var/is_debugger = FALSE + var/is_funmin = FALSE + +/datum/secrets_menu/New(user)//user can either be a client or a mob due to byondcode(tm) + if (istype(user, /client)) + var/client/user_client = user + holder = user_client //if its a client, assign it to holder + else + var/mob/user_mob = user + holder = user_mob.client //if its a mob, assign the mob's client to holder + + is_debugger = check_rights(R_DEBUG) + is_funmin = check_rights(R_FUN) + +/datum/secrets_menu/ui_state(mob/user) + return GLOB.admin_state + +/datum/secrets_menu/ui_close() + qdel(src) + +/datum/secrets_menu/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "Secrets") + ui.open() + +/datum/secrets_menu/ui_data(mob/user) + var/list/data = list() + data["is_debugger"] = is_debugger + data["is_funmin"] = is_funmin + return data + +/datum/secrets_menu/ui_act(action, params) + . = ..() + if(.) + return + if((action != "admin_log" || action != "show_admins") && !check_rights(R_ADMIN)) return - - var/list/dat = list("The first rule of adminbuse is: you don't talk about the adminbuse.
") - - dat +={" - General Secrets
-
- Admin Log
- Show Admin List
-
- "} - - if(check_rights(R_ADMIN,0)) - dat += {" - Admin Secrets
-
- Cure all diseases currently in existence
- Bombing List
- Show last [length(GLOB.lastsignalers)] signalers
- Show last [length(GLOB.lawchanges)] law changes
- Show AI Laws
- Show Game Mode
- Show Crew Manifest
- List DNA (Blood)
- List Fingerprints
- Enable/Disable CTF

- Reset Thunderdome to default state
- Rename Station Name
- Reset Station Name
- Set Night Shift Mode
-
- Shuttles
-
- Move Ferry
- Toggle Arrivals Ferry
- Move Mining Shuttle
- Move Labor Shuttle
-
- "} - - if(check_rights(R_FUN,0)) - dat += {" - Fun Secrets
-
- Trigger a Virus Outbreak
- Turn all humans into monkeys
- Chinese Cartoons
- Change the species of all humans
- Make all areas powered
- Make all areas unpowered
- Power all SMES
- Anonymous Names (needs to be used in the lobby)
- Triple AI mode (needs to be used in the lobby)
- Everyone is the traitor
- Summon Guns
- Summon Magic
- Summon Events (Toggle)
- There can only be one!
- There can only be one! (40-second delay)
- Make all players brain damaged
- Egalitarian Station Mode
- Anarcho-Capitalist Station Mode
- Break all lights
- Fix all lights
- The floor is lava! (DANGEROUS: extremely lame)
- Spawn a custom portal storm
-
- Change bomb cap
- Mass Purrbation
- Mass Remove Purrbation
- Fully Immerse Everyone
- Un-Fully Immerse Everyone
- "} - - dat += "
" - - if(check_rights(R_DEBUG,0)) - dat += {" - Security Level Elevated
-
- Change all maintenance doors to engie/brig access only
- Change all maintenance doors to brig access only
- Remove cap on security officers
-
- "} - - usr << browse(dat.Join(), "window=secrets") - return - - - - - -/datum/admins/proc/Secrets_topic(item,href_list) var/datum/round_event/E var/ok = FALSE - switch(item) + switch(action) + //Generic Buttons anyone can use. if("admin_log") var/dat = "Admin Log
" for(var/l in GLOB.admin_log) dat += "
  • [l]
  • " if(!GLOB.admin_log.len) dat += "No-one has done anything this round!" - usr << browse(dat, "window=admin_log") - + holder << browse(dat, "window=admin_log") if("show_admins") var/dat = "Current admins:
    " if(GLOB.admin_datums) for(var/ckey in GLOB.admin_datums) var/datum/admins/D = GLOB.admin_datums[ckey] dat += "[ckey] - [D.rank.name]
    " - usr << browse(dat, "window=showadmins;size=600x500") - - if("tdomereset") - if(!check_rights(R_ADMIN)) + holder << browse(dat, "window=showadmins;size=600x500") + //Buttons for debug. + if("maint_access_engiebrig") + if(!is_debugger) return + for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) + M.check_access() + if (ACCESS_MAINT_TUNNELS in M.req_access) + M.req_access = list() + M.req_one_access = list(ACCESS_BRIG,ACCESS_ENGINE) + message_admins("[key_name_admin(holder)] made all maint doors engineering and brig access-only.") + if("maint_access_brig") + if(!is_debugger) + return + for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) + M.check_access() + if (ACCESS_MAINT_TUNNELS in M.req_access) + M.req_access = list(ACCESS_BRIG) + message_admins("[key_name_admin(holder)] made all maint doors brig access-only.") + if("infinite_sec") + if(!is_debugger) + return + var/datum/job/J = SSjob.GetJob("Security Officer") + if(!J) + return + J.total_positions = -1 + J.spawn_positions = -1 + message_admins("[key_name_admin(holder)] has removed the cap on security officers.") + //Buttons for helpful stuff. This is where people land in the tgui + if("clear_virus") + var/choice = input("Are you sure you want to cure all disease?") in list("Yes", "Cancel") + if(choice == "Yes") + message_admins("[key_name_admin(holder)] has cured all diseases.") + for(var/thing in SSdisease.active_diseases) + var/datum/disease/D = thing + D.cure(0) + if("list_bombers") + var/dat = "Bombing List
    " + for(var/l in GLOB.bombers) + dat += text("[l]
    ") + holder << browse(dat, "window=bombers") + + if("list_signalers") + var/dat = "Showing last [length(GLOB.lastsignalers)] signalers.
    " + for(var/sig in GLOB.lastsignalers) + dat += "[sig]
    " + holder << browse(dat, "window=lastsignalers;size=800x500") + if("list_lawchanges") + var/dat = "Showing last [length(GLOB.lawchanges)] law changes.
    " + for(var/sig in GLOB.lawchanges) + dat += "[sig]
    " + holder << browse(dat, "window=lawchanges;size=800x500") + if("showailaws") + holder.holder.output_ai_laws()//huh, inconvenient var naming, huh? + if("showgm") + if(!SSticker.HasRoundStarted()) + alert("The game hasn't started yet!") + else if (SSticker.mode) + alert("The game mode is [SSticker.mode.name]") + else + alert("For some reason there's a SSticker, but not a game mode") + if("manifest") + var/dat = "Showing Crew Manifest.
    " + dat += "" + for(var/datum/data/record/t in GLOB.data_core.general) + dat += "" + dat += "
    NamePosition
    [t.fields["name"]][t.fields["rank"]]
    " + holder << browse(dat, "window=manifest;size=440x410") + if("dna") + var/dat = "Showing DNA from blood.
    " + dat += "" + for(var/i in GLOB.human_list) + var/mob/living/carbon/human/H = i + if(H.ckey) + dat += "" + dat += "
    NameDNABlood Type
    [H][H.dna.unique_enzymes][H.dna.blood_type]
    " + holder << browse(dat, "window=DNA;size=440x410") + if("fingerprints") + var/dat = "Showing Fingerprints.
    " + dat += "" + for(var/i in GLOB.human_list) + var/mob/living/carbon/human/H = i + if(H.ckey) + dat += "" + dat += "
    NameFingerprints
    [H][md5(H.dna.uni_identity)]
    " + holder << browse(dat, "window=fingerprints;size=440x410") + if("ctfbutton") + toggle_all_ctf(holder) + if("tdomereset") var/delete_mobs = alert("Clear all mobs?","Confirm","Yes","No","Cancel") if(delete_mobs == "Cancel") return - log_admin("[key_name(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].", 1) - message_admins("[key_name_admin(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].") + log_admin("[key_name(holder)] reset the thunderdome to default with delete_mobs==[delete_mobs].", 1) + message_admins("[key_name_admin(holder)] reset the thunderdome to default with delete_mobs==[delete_mobs].") var/area/thunderdome = GLOB.areas_by_type[/area/tdome/arena] if(delete_mobs == "Yes") @@ -133,29 +171,22 @@ var/area/template = GLOB.areas_by_type[/area/tdome/arena_source] template.copy_contents_to(thunderdome) - - if("clear_virus") - - var/choice = input("Are you sure you want to cure all disease?") in list("Yes", "Cancel") - if(choice == "Yes") - message_admins("[key_name_admin(usr)] has cured all diseases.") - for(var/thing in SSdisease.active_diseases) - var/datum/disease/D = thing - D.cure(0) if("set_name") - if(!check_rights(R_ADMIN)) - return - var/new_name = input(usr, "Please input a new name for the station.", "What?", "") as text|null + var/new_name = input(holder, "Please input a new name for the station.", "What?", "") as text|null if(!new_name) return set_station_name(new_name) - log_admin("[key_name(usr)] renamed the station to \"[new_name]\".") - message_admins("[key_name_admin(usr)] renamed the station to: [new_name].") + log_admin("[key_name(holder)] renamed the station to \"[new_name]\".") + message_admins("[key_name_admin(holder)] renamed the station to: [new_name].") + priority_announce("[command_name()] has renamed the station to \"[new_name]\".") + if("reset_name") + var/new_name = new_station_name() + set_station_name(new_name) + log_admin("[key_name(holder)] reset the station name.") + message_admins("[key_name_admin(holder)] reset the station name.") priority_announce("[command_name()] has renamed the station to \"[new_name]\".") if("night_shift_set") - if(!check_rights(R_ADMIN)) - return - 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") + var/val = alert(holder, "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_GET(flag/enable_night_shifts)) @@ -169,185 +200,266 @@ if("Off") SSnightshift.can_fire = FALSE SSnightshift.update_nightshift(FALSE, TRUE) - - if("reset_name") - if(!check_rights(R_ADMIN)) - return - var/new_name = new_station_name() - set_station_name(new_name) - log_admin("[key_name(usr)] reset the station name.") - message_admins("[key_name_admin(usr)] reset the station name.") - priority_announce("[command_name()] has renamed the station to \"[new_name]\".") - - if("list_bombers") - if(!check_rights(R_ADMIN)) - return - var/dat = "Bombing List
    " - for(var/l in GLOB.bombers) - dat += text("[l]
    ") - usr << browse(dat, "window=bombers") - - if("list_signalers") - if(!check_rights(R_ADMIN)) - return - var/dat = "Showing last [length(GLOB.lastsignalers)] signalers.
    " - for(var/sig in GLOB.lastsignalers) - dat += "[sig]
    " - usr << browse(dat, "window=lastsignalers;size=800x500") - - if("list_lawchanges") - if(!check_rights(R_ADMIN)) - return - var/dat = "Showing last [length(GLOB.lawchanges)] law changes.
    " - for(var/sig in GLOB.lawchanges) - dat += "[sig]
    " - usr << browse(dat, "window=lawchanges;size=800x500") - - if("moveminingshuttle") - if(!check_rights(R_ADMIN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Send Mining Shuttle")) - if(!SSshuttle.toggleShuttle("mining","mining_home","mining_away")) - message_admins("[key_name_admin(usr)] moved mining shuttle") - log_admin("[key_name(usr)] moved the mining shuttle") - - if("movelaborshuttle") - if(!check_rights(R_ADMIN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Send Labor Shuttle")) - if(!SSshuttle.toggleShuttle("laborcamp","laborcamp_home","laborcamp_away")) - message_admins("[key_name_admin(usr)] moved labor shuttle") - log_admin("[key_name(usr)] moved the labor shuttle") - if("moveferry") - if(!check_rights(R_ADMIN)) - return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Send CentCom Ferry")) if(!SSshuttle.toggleShuttle("ferry","ferry_home","ferry_away")) - message_admins("[key_name_admin(usr)] moved the CentCom ferry") - log_admin("[key_name(usr)] moved the CentCom ferry") - + message_admins("[key_name_admin(holder)] moved the CentCom ferry") + log_admin("[key_name(holder)] moved the CentCom ferry") if("togglearrivals") - if(!check_rights(R_ADMIN)) - return var/obj/docking_port/mobile/arrivals/A = SSshuttle.arrivals if(A) var/new_perma = !A.perma_docked A.perma_docked = new_perma SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Permadock Arrivals Shuttle", "[new_perma ? "Enabled" : "Disabled"]")) - message_admins("[key_name_admin(usr)] [new_perma ? "stopped" : "started"] the arrivals shuttle") - log_admin("[key_name(usr)] [new_perma ? "stopped" : "started"] the arrivals shuttle") + message_admins("[key_name_admin(holder)] [new_perma ? "stopped" : "started"] the arrivals shuttle") + log_admin("[key_name(holder)] [new_perma ? "stopped" : "started"] the arrivals shuttle") else - to_chat(usr, "There is no arrivals shuttle.", confidential = TRUE) - if("showailaws") - if(!check_rights(R_ADMIN)) + to_chat(holder, "There is no arrivals shuttle.", confidential = TRUE) + if("movelaborshuttle") + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Send Labor Shuttle")) + if(!SSshuttle.toggleShuttle("laborcamp","laborcamp_home","laborcamp_away")) + message_admins("[key_name_admin(holder)] moved labor shuttle") + log_admin("[key_name(holder)] moved the labor shuttle") + //!fun! buttons. + if("virus") + if(!is_funmin) return - output_ai_laws() - if("showgm") - if(!check_rights(R_ADMIN)) + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Virus Outbreak")) + switch(alert("Do you want this to be a random disease or do you have something in mind?",,"Make Your Own","Random","Choose")) + if("Make Your Own") + AdminCreateVirus(holder) + if("Random") + var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control + E = DC.runEvent() + if("Choose") + var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sortList(typesof(/datum/disease), /proc/cmp_typepaths_asc) + var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control + var/datum/round_event/disease_outbreak/DO = DC.runEvent() + DO.virus_type = virus + E = DO + if("allspecies") + if(!is_funmin) return - if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") - else if (SSticker.mode) - alert("The game mode is [SSticker.mode.name]") - else alert("For some reason there's a SSticker, but not a game mode") - if("manifest") - if(!check_rights(R_ADMIN)) + var/result = input(holder, "Please choose a new species","Species") as null|anything in GLOB.species_list + if(result) + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Mass Species Change", "[result]")) + log_admin("[key_name(holder)] turned all humans into [result]", 1) + message_admins("\blue [key_name_admin(holder)] turned all humans into [result]") + var/newtype = GLOB.species_list[result] + for(var/i in GLOB.human_list) + var/mob/living/carbon/human/H = i + H.set_species(newtype) + if("power") + if(!is_funmin) return - var/dat = "Showing Crew Manifest.
    " - dat += "" - for(var/datum/data/record/t in GLOB.data_core.general) - dat += "" - dat += "
    NamePosition
    [t.fields["name"]][t.fields["rank"]]
    " - usr << browse(dat, "window=manifest;size=440x410") - if("DNA") - if(!check_rights(R_ADMIN)) + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Power All APCs")) + log_admin("[key_name(holder)] made all areas powered", 1) + message_admins("[key_name_admin(holder)] made all areas powered") + power_restore() + if("unpower") + if(!is_funmin) return - var/dat = "Showing DNA from blood.
    " - dat += "" - for(var/i in GLOB.human_list) - var/mob/living/carbon/human/H = i - if(H.ckey) - dat += "" - dat += "
    NameDNABlood Type
    [H][H.dna.unique_enzymes][H.dna.blood_type]
    " - usr << browse(dat, "window=DNA;size=440x410") - if("fingerprints") - if(!check_rights(R_ADMIN)) + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Depower All APCs")) + log_admin("[key_name(holder)] made all areas unpowered", 1) + message_admins("[key_name_admin(holder)] made all areas unpowered") + power_failure() + if("quickpower") + if(!is_funmin) return - var/dat = "Showing Fingerprints.
    " - dat += "" - for(var/i in GLOB.human_list) - var/mob/living/carbon/human/H = i - if(H.ckey) - dat += "" - dat += "
    NameFingerprints
    [H][md5(H.dna.uni_identity)]
    " - usr << browse(dat, "window=fingerprints;size=440x410") + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Power All SMESs")) + log_admin("[key_name(holder)] made all SMESs powered", 1) + message_admins("[key_name_admin(holder)] made all SMESs powered") + power_restore_quick() + if("anon_name") + if(!is_funmin) + return + holder.anon_names() + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Anonymous Names")) + if("tripleAI") + if(!is_funmin) + return + holder.triple_ai() + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Triple AI")) + if("onlyone") + if(!is_funmin) + return + var/response = alert("Delay by 40 seconds?", "There can, in fact, only be one", "Instant!", "40 seconds (crush the hope of a normal shift)") + if(response == "Instant!") + holder.only_one() + else + holder.only_one_delayed() + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("There Can Be Only One")) + if("guns") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Guns")) + var/survivor_probability = 0 + switch(alert("Do you want this to create survivors antagonists?",,"No Antags","Some Antags","All Antags!")) + if("Some Antags") + survivor_probability = 25 + if("All Antags!") + survivor_probability = 100 + rightandwrong(SUMMON_GUNS, holder, survivor_probability) + if("magic") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Magic")) + var/survivor_probability = 0 + switch(alert("Do you want this to create magician antagonists?",,"No Antags","Some Antags","All Antags!")) + if("Some Antags") + survivor_probability = 25 + if("All Antags!") + survivor_probability = 100 + + rightandwrong(SUMMON_MAGIC, holder, survivor_probability) + if("events") + if(!is_funmin) + return + if(!SSevents.wizardmode) + if(alert("Do you want to toggle summon events on?",,"Yes","No") == "Yes") + summonevents() + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Activate")) + + else + switch(alert("What would you like to do?",,"Intensify Summon Events","Turn Off Summon Events","Nothing")) + if("Intensify Summon Events") + summonevents() + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Intensify")) + if("Turn Off Summon Events") + SSevents.toggleWizardmode() + SSevents.resetFrequency() + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Disable")) + if("eagles") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Egalitarian Station")) + for(var/obj/machinery/door/airlock/W in GLOB.machines) + if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) + W.req_access = list() + message_admins("[key_name_admin(holder)] activated Egalitarian Station mode") + priority_announce("CentCom airlock control override activated. Please take this time to get acquainted with your coworkers.", null, 'sound/ai/commandreport.ogg') + if("ancap") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Anarcho-capitalist Station")) + SSeconomy.full_ancap = !SSeconomy.full_ancap + message_admins("[key_name_admin(holder)] toggled Anarcho-capitalist mode") + if(SSeconomy.full_ancap) + priority_announce("The NAP is now in full effect.", null, 'sound/ai/commandreport.ogg') + else + priority_announce("The NAP has been revoked.", null, 'sound/ai/commandreport.ogg') + if("blackout") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Break All Lights")) + message_admins("[key_name_admin(holder)] broke all lights") + for(var/obj/machinery/light/L in GLOB.machines) + L.break_light_tube() + if("whiteout") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Fix All Lights")) + message_admins("[key_name_admin(holder)] fixed all lights") + for(var/obj/machinery/light/L in GLOB.machines) + L.fix() + if("customportal") + if(!is_funmin) + return + + var/list/settings = list( + "mainsettings" = list( + "typepath" = list("desc" = "Path to spawn", "type" = "datum", "path" = "/mob/living", "subtypesonly" = TRUE, "value" = /mob/living/simple_animal/hostile/poison/bees), + "humanoutfit" = list("desc" = "Outfit if human", "type" = "datum", "path" = "/datum/outfit", "subtypesonly" = TRUE, "value" = /datum/outfit), + "amount" = list("desc" = "Number per portal", "type" = "number", "value" = 1), + "portalnum" = list("desc" = "Number of total portals", "type" = "number", "value" = 10), + "offerghosts" = list("desc" = "Get ghosts to play mobs", "type" = "boolean", "value" = "No"), + "minplayers" = list("desc" = "Minimum number of ghosts", "type" = "number", "value" = 1), + "playersonly" = list("desc" = "Only spawn ghost-controlled mobs", "type" = "boolean", "value" = "No"), + "ghostpoll" = list("desc" = "Ghost poll question", "type" = "string", "value" = "Do you want to play as %TYPE% portal invader?"), + "delay" = list("desc" = "Time between portals, in deciseconds", "type" = "number", "value" = 50), + "color" = list("desc" = "Portal color", "type" = "color", "value" = "#00FF00"), + "playlightning" = list("desc" = "Play lightning sounds on announcement", "type" = "boolean", "value" = "Yes"), + "announce_players" = list("desc" = "Make an announcement", "type" = "boolean", "value" = "Yes"), + "announcement" = list("desc" = "Announcement", "type" = "string", "value" = "Massive bluespace anomaly detected en route to %STATION%. Brace for impact."), + ) + ) + + message_admins("[key_name(holder)] is creating a custom portal storm...") + var/list/prefreturn = presentpreflikepicker(holder,"Customize Portal Storm", "Customize Portal Storm", Button1="Ok", width = 600, StealFocus = 1,Timeout = 0, settings=settings) + + if (prefreturn["button"] == 1) + var/list/prefs = settings["mainsettings"] + + if (prefs["amount"]["value"] < 1 || prefs["portalnum"]["value"] < 1) + to_chat(holder, "Number of portals and mobs to spawn must be at least 1.", confidential = TRUE) + return + + var/mob/pathToSpawn = prefs["typepath"]["value"] + if (!ispath(pathToSpawn)) + pathToSpawn = text2path(pathToSpawn) + + if (!ispath(pathToSpawn)) + to_chat(holder, "Invalid path [pathToSpawn].", confidential = TRUE) + return + + var/list/candidates = list() + + if (prefs["offerghosts"]["value"] == "Yes") + candidates = pollGhostCandidates(replacetext(prefs["ghostpoll"]["value"], "%TYPE%", initial(pathToSpawn.name)), ROLE_TRAITOR) + + if (prefs["playersonly"]["value"] == "Yes" && length(candidates) < prefs["minplayers"]["value"]) + message_admins("Not enough players signed up to create a portal storm, the minimum was [prefs["minplayers"]["value"]] and the number of signups [length(candidates)]") + return + + if (prefs["announce_players"]["value"] == "Yes") + portalAnnounce(prefs["announcement"]["value"], (prefs["playlightning"]["value"] == "Yes" ? TRUE : FALSE)) + + var/mutable_appearance/storm = mutable_appearance('icons/obj/tesla_engine/energy_ball.dmi', "energy_ball_fast", FLY_LAYER) + storm.color = prefs["color"]["value"] + + message_admins("[key_name_admin(holder)] has created a customized portal storm that will spawn [prefs["portalnum"]["value"]] portals, each of them spawning [prefs["amount"]["value"]] of [pathToSpawn]") + log_admin("[key_name(holder)] has created a customized portal storm that will spawn [prefs["portalnum"]["value"]] portals, each of them spawning [prefs["amount"]["value"]] of [pathToSpawn]") + + var/outfit = prefs["humanoutfit"]["value"] + if (!ispath(outfit)) + outfit = text2path(outfit) + + for (var/i in 1 to prefs["portalnum"]["value"]) + if (length(candidates)) // if we're spawning players, gotta be a little tricky and also not spawn players on top of NPCs + var/ghostcandidates = list() + for (var/j in 1 to min(prefs["amount"]["value"], length(candidates))) + ghostcandidates += pick_n_take(candidates) + addtimer(CALLBACK(GLOBAL_PROC, .proc/doPortalSpawn, get_random_station_turf(), pathToSpawn, length(ghostcandidates), storm, ghostcandidates, outfit), i*prefs["delay"]["value"]) + else if (prefs["playersonly"]["value"] != "Yes") + addtimer(CALLBACK(GLOBAL_PROC, .proc/doPortalSpawn, get_random_station_turf(), pathToSpawn, prefs["amount"]["value"], storm, null, outfit), i*prefs["delay"]["value"]) + if("changebombcap") + if(!is_funmin) + return + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Bomb Cap")) + + var/newBombCap = input(holder,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) as num|null + if (!CONFIG_SET(number/bombcap, newBombCap)) + return + + message_admins("[key_name_admin(holder)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]") + log_admin("[key_name(holder)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]") + //buttons that are fun for exactly you and nobody else. if("monkey") - if(!check_rights(R_FUN)) + if(!is_funmin) return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Monkeyize All Humans")) for(var/i in GLOB.human_list) var/mob/living/carbon/human/H = i INVOKE_ASYNC(H, /mob/living/carbon.proc/monkeyize) ok = TRUE - - if("allspecies") - if(!check_rights(R_FUN)) - return - var/result = input(usr, "Please choose a new species","Species") as null|anything in GLOB.species_list - if(result) - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Mass Species Change", "[result]")) - log_admin("[key_name(usr)] turned all humans into [result]", 1) - message_admins("\blue [key_name_admin(usr)] turned all humans into [result]") - var/newtype = GLOB.species_list[result] - for(var/i in GLOB.human_list) - var/mob/living/carbon/human/H = i - H.set_species(newtype) - - if("anon_name") - if(!check_rights(R_FUN)) - return - usr.client.anon_names() - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Anonymous Names")) - - if("tripleAI") - if(!check_rights(R_FUN)) - return - usr.client.triple_ai() - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Triple AI")) - - if("power") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Power All APCs")) - log_admin("[key_name(usr)] made all areas powered", 1) - message_admins("[key_name_admin(usr)] made all areas powered") - power_restore() - - if("unpower") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Depower All APCs")) - log_admin("[key_name(usr)] made all areas unpowered", 1) - message_admins("[key_name_admin(usr)] made all areas unpowered") - power_failure() - - if("quickpower") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Power All SMESs")) - log_admin("[key_name(usr)] made all SMESs powered", 1) - message_admins("[key_name_admin(usr)] made all SMESs powered") - power_restore_quick() - if("traitor_all") - if(!check_rights(R_FUN)) + if(!is_funmin) return if(!SSticker.HasRoundStarted()) alert("The game hasn't started yet!") return - var/objective = stripped_input(usr, "Enter an objective") + var/objective = stripped_input(holder, "Enter an objective") if(!objective) return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Traitor All", "[objective]")) @@ -365,31 +477,20 @@ new_objective.explanation_text = objective T.add_objective(new_objective) H.mind.add_antag_datum(T) - message_admins("[key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]") - log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]") - - if("changebombcap") - if(!check_rights(R_FUN)) + message_admins("[key_name_admin(holder)] used everyone is a traitor secret. Objective is [objective]") + log_admin("[key_name(holder)] used everyone is a traitor secret. Objective is [objective]") + if("massbraindamage") + if(!is_funmin) return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Bomb Cap")) - - var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) as num|null - if (!CONFIG_SET(number/bombcap, newBombCap)) - return - - message_admins("[key_name_admin(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]") - log_admin("[key_name(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]") - - if("blackout") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Break All Lights")) - message_admins("[key_name_admin(usr)] broke all lights") - for(var/obj/machinery/light/L in GLOB.machines) - L.break_light_tube() - + SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Mass Braindamage")) + for(var/mob/living/carbon/human/H in GLOB.player_list) + to_chat(H, "You suddenly feel stupid.", confidential = TRUE) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60, 80) + message_admins("[key_name_admin(holder)] made everybody brain damaged") + if("floorlava") + SSweather.run_weather(/datum/weather/floor_is_lava) if("anime") - if(!check_rights(R_FUN)) + if(!is_funmin) return var/animetype = alert("Would you like to have the clothes be changed?",,"Yes","No","Cancel") @@ -400,7 +501,7 @@ if(animetype == "Cancel" || droptype == "Cancel") return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Chinese Cartoons")) - message_admins("[key_name_admin(usr)] made everything kawaii.") + message_admins("[key_name_admin(holder)] made everything kawaii.") for(var/i in GLOB.human_list) var/mob/living/carbon/human/H = i SEND_SOUND(H, sound('sound/ai/animes.ogg')) @@ -428,273 +529,38 @@ ADD_TRAIT(I, TRAIT_NODROP, ADMIN_TRAIT) else to_chat(H, "You're not kawaii enough for this!", confidential = TRUE) - - if("whiteout") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Fix All Lights")) - message_admins("[key_name_admin(usr)] fixed all lights") - for(var/obj/machinery/light/L in GLOB.machines) - L.fix() - - if("floorlava") - SSweather.run_weather(/datum/weather/floor_is_lava) - - if("virus") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Virus Outbreak")) - switch(alert("Do you want this to be a random disease or do you have something in mind?",,"Make Your Own","Random","Choose")) - if("Make Your Own") - AdminCreateVirus(usr.client) - if("Random") - var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control - E = DC.runEvent() - if("Choose") - var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sortList(typesof(/datum/disease), /proc/cmp_typepaths_asc) - var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control - var/datum/round_event/disease_outbreak/DO = DC.runEvent() - DO.virus_type = virus - E = DO - - if("massbraindamage") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Mass Braindamage")) - for(var/mob/living/carbon/human/H in GLOB.player_list) - to_chat(H, "You suddenly feel stupid.", confidential = TRUE) - H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60, 80) - message_admins("[key_name_admin(usr)] made everybody brain damaged") - - if("eagles")//SCRAW - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Egalitarian Station")) - for(var/obj/machinery/door/airlock/W in GLOB.machines) - if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) - W.req_access = list() - message_admins("[key_name_admin(usr)] activated Egalitarian Station mode") - priority_announce("CentCom airlock control override activated. Please take this time to get acquainted with your coworkers.", null, 'sound/ai/commandreport.ogg') - - if("ancap") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Anarcho-capitalist Station")) - SSeconomy.full_ancap = !SSeconomy.full_ancap - message_admins("[key_name_admin(usr)] toggled Anarcho-capitalist mode") - if(SSeconomy.full_ancap) - priority_announce("The NAP is now in full effect.", null, 'sound/ai/commandreport.ogg') - else - priority_announce("The NAP has been revoked.", null, 'sound/ai/commandreport.ogg') - - - - - if("guns") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Guns")) - var/survivor_probability = 0 - switch(alert("Do you want this to create survivors antagonists?",,"No Antags","Some Antags","All Antags!")) - if("Some Antags") - survivor_probability = 25 - if("All Antags!") - survivor_probability = 100 - - rightandwrong(SUMMON_GUNS, usr, survivor_probability) - - if("magic") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Magic")) - var/survivor_probability = 0 - switch(alert("Do you want this to create survivors antagonists?",,"No Antags","Some Antags","All Antags!")) - if("Some Antags") - survivor_probability = 25 - if("All Antags!") - survivor_probability = 100 - - rightandwrong(SUMMON_MAGIC, usr, survivor_probability) - - if("events") - if(!check_rights(R_FUN)) - return - if(!SSevents.wizardmode) - if(alert("Do you want to toggle summon events on?",,"Yes","No") == "Yes") - summonevents() - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Activate")) - - else - switch(alert("What would you like to do?",,"Intensify Summon Events","Turn Off Summon Events","Nothing")) - if("Intensify Summon Events") - summonevents() - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Intensify")) - if("Turn Off Summon Events") - SSevents.toggleWizardmode() - SSevents.resetFrequency() - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Disable")) - - if("dorf") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Dwarf Beards")) - for(var/i in GLOB.human_list) - var/mob/living/carbon/human/B = i - B.facial_hairstyle = "Dward Beard" - B.update_hair() - message_admins("[key_name_admin(usr)] activated dorf mode") - - if("onlyone") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("There Can Be Only One")) - usr.client.only_one() - sound_to_playing_players('sound/misc/highlander.ogg') - - if("delayed_onlyone") - if(!check_rights(R_FUN)) - return - SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("There Can Be Only One")) - usr.client.only_one_delayed() - sound_to_playing_players('sound/misc/highlander_delayed.ogg') - - if("maint_access_brig") - if(!check_rights(R_DEBUG)) - return - for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) - M.check_access() - if (ACCESS_MAINT_TUNNELS in M.req_access) - M.req_access = list(ACCESS_BRIG) - message_admins("[key_name_admin(usr)] made all maint doors brig access-only.") - if("maint_access_engiebrig") - if(!check_rights(R_DEBUG)) - return - for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) - M.check_access() - if (ACCESS_MAINT_TUNNELS in M.req_access) - M.req_access = list() - M.req_one_access = list(ACCESS_BRIG,ACCESS_ENGINE) - message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.") - if("infinite_sec") - if(!check_rights(R_DEBUG)) - return - var/datum/job/J = SSjob.GetJob("Security Officer") - if(!J) - return - J.total_positions = -1 - J.spawn_positions = -1 - message_admins("[key_name_admin(usr)] has removed the cap on security officers.") - - if("ctfbutton") - if(!check_rights(R_ADMIN)) - return - toggle_all_ctf(usr) if("masspurrbation") - if(!check_rights(R_FUN)) + if(!is_funmin) return mass_purrbation() - message_admins("[key_name_admin(usr)] has put everyone on \ + message_admins("[key_name_admin(holder)] has put everyone on \ purrbation!") - log_admin("[key_name(usr)] has put everyone on purrbation.") + log_admin("[key_name(holder)] has put everyone on purrbation.") if("massremovepurrbation") - if(!check_rights(R_FUN)) + if(!is_funmin) return mass_remove_purrbation() - message_admins("[key_name_admin(usr)] has removed everyone from \ + message_admins("[key_name_admin(holder)] has removed everyone from \ purrbation.") - log_admin("[key_name(usr)] has removed everyone from purrbation.") - + log_admin("[key_name(holder)] has removed everyone from purrbation.") if("massimmerse") - if(!check_rights(R_FUN)) + if(!is_funmin) return mass_immerse() - message_admins("[key_name_admin(usr)] has Fully Immersed \ + message_admins("[key_name_admin(holder)] has Fully Immersed \ everyone!") - log_admin("[key_name(usr)] has Fully Immersed everyone.") - + log_admin("[key_name(holder)] has Fully Immersed everyone.") if("unmassimmerse") - if(!check_rights(R_FUN)) + if(!is_funmin) return mass_immerse(remove=TRUE) - message_admins("[key_name_admin(usr)] has Un-Fully Immersed \ + message_admins("[key_name_admin(holder)] has Un-Fully Immersed \ everyone!") - log_admin("[key_name(usr)] has Un-Fully Immersed everyone.") - - if("customportal") - if(!check_rights(R_FUN)) - return - - var/list/settings = list( - "mainsettings" = list( - "typepath" = list("desc" = "Path to spawn", "type" = "datum", "path" = "/mob/living", "subtypesonly" = TRUE, "value" = /mob/living/simple_animal/hostile/poison/bees), - "humanoutfit" = list("desc" = "Outfit if human", "type" = "datum", "path" = "/datum/outfit", "subtypesonly" = TRUE, "value" = /datum/outfit), - "amount" = list("desc" = "Number per portal", "type" = "number", "value" = 1), - "portalnum" = list("desc" = "Number of total portals", "type" = "number", "value" = 10), - "offerghosts" = list("desc" = "Get ghosts to play mobs", "type" = "boolean", "value" = "No"), - "minplayers" = list("desc" = "Minimum number of ghosts", "type" = "number", "value" = 1), - "playersonly" = list("desc" = "Only spawn ghost-controlled mobs", "type" = "boolean", "value" = "No"), - "ghostpoll" = list("desc" = "Ghost poll question", "type" = "string", "value" = "Do you want to play as %TYPE% portal invader?"), - "delay" = list("desc" = "Time between portals, in deciseconds", "type" = "number", "value" = 50), - "color" = list("desc" = "Portal color", "type" = "color", "value" = "#00FF00"), - "playlightning" = list("desc" = "Play lightning sounds on announcement", "type" = "boolean", "value" = "Yes"), - "announce_players" = list("desc" = "Make an announcement", "type" = "boolean", "value" = "Yes"), - "announcement" = list("desc" = "Announcement", "type" = "string", "value" = "Massive bluespace anomaly detected en route to %STATION%. Brace for impact."), - ) - ) - - message_admins("[key_name(usr)] is creating a custom portal storm...") - var/list/prefreturn = presentpreflikepicker(usr,"Customize Portal Storm", "Customize Portal Storm", Button1="Ok", width = 600, StealFocus = 1,Timeout = 0, settings=settings) - - if (prefreturn["button"] == 1) - var/list/prefs = settings["mainsettings"] - - if (prefs["amount"]["value"] < 1 || prefs["portalnum"]["value"] < 1) - to_chat(usr, "Number of portals and mobs to spawn must be at least 1.", confidential = TRUE) - return - - var/mob/pathToSpawn = prefs["typepath"]["value"] - if (!ispath(pathToSpawn)) - pathToSpawn = text2path(pathToSpawn) - - if (!ispath(pathToSpawn)) - to_chat(usr, "Invalid path [pathToSpawn].", confidential = TRUE) - return - - var/list/candidates = list() - - if (prefs["offerghosts"]["value"] == "Yes") - candidates = pollGhostCandidates(replacetext(prefs["ghostpoll"]["value"], "%TYPE%", initial(pathToSpawn.name)), ROLE_TRAITOR) - - if (prefs["playersonly"]["value"] == "Yes" && length(candidates) < prefs["minplayers"]["value"]) - message_admins("Not enough players signed up to create a portal storm, the minimum was [prefs["minplayers"]["value"]] and the number of signups [length(candidates)]") - return - - if (prefs["announce_players"]["value"] == "Yes") - portalAnnounce(prefs["announcement"]["value"], (prefs["playlightning"]["value"] == "Yes" ? TRUE : FALSE)) - - var/mutable_appearance/storm = mutable_appearance('icons/obj/tesla_engine/energy_ball.dmi', "energy_ball_fast", FLY_LAYER) - storm.color = prefs["color"]["value"] - - message_admins("[key_name_admin(usr)] has created a customized portal storm that will spawn [prefs["portalnum"]["value"]] portals, each of them spawning [prefs["amount"]["value"]] of [pathToSpawn]") - log_admin("[key_name(usr)] has created a customized portal storm that will spawn [prefs["portalnum"]["value"]] portals, each of them spawning [prefs["amount"]["value"]] of [pathToSpawn]") - - var/outfit = prefs["humanoutfit"]["value"] - if (!ispath(outfit)) - outfit = text2path(outfit) - - for (var/i in 1 to prefs["portalnum"]["value"]) - if (length(candidates)) // if we're spawning players, gotta be a little tricky and also not spawn players on top of NPCs - var/ghostcandidates = list() - for (var/j in 1 to min(prefs["amount"]["value"], length(candidates))) - ghostcandidates += pick_n_take(candidates) - addtimer(CALLBACK(GLOBAL_PROC, .proc/doPortalSpawn, get_random_station_turf(), pathToSpawn, length(ghostcandidates), storm, ghostcandidates, outfit), i*prefs["delay"]["value"]) - else if (prefs["playersonly"]["value"] != "Yes") - addtimer(CALLBACK(GLOBAL_PROC, .proc/doPortalSpawn, get_random_station_turf(), pathToSpawn, prefs["amount"]["value"], storm, null, outfit), i*prefs["delay"]["value"]) - + log_admin("[key_name(holder)] has Un-Fully Immersed everyone.") if(E) E.processing = FALSE if(E.announceWhen>0) - switch(alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No", "Cancel")) + switch(alert(holder, "Would you like to alert the crew?", "Alert", "Yes", "No", "Cancel")) if("Yes") E.announceChance = 100 if("Cancel") @@ -703,10 +569,10 @@ if("No") E.announceChance = 0 E.processing = TRUE - if (usr) - log_admin("[key_name(usr)] used secret [item]") - if (ok) - to_chat(world, text("A secret has been activated by []!", usr.key), confidential = TRUE) + if(holder) + log_admin("[key_name(holder)] used secret [action]") + if(ok) + to_chat(world, text("A secret has been activated by []!", holder.key), confidential = TRUE) /proc/portalAnnounce(announcement, playlightning) set waitfor = FALSE diff --git a/tgstation.dme b/tgstation.dme index 3c95de7929c..460e6830719 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1388,7 +1388,6 @@ #include "code\modules\admin\permissionedit.dm" #include "code\modules\admin\player_panel.dm" #include "code\modules\admin\poll_management.dm" -#include "code\modules\admin\secrets.dm" #include "code\modules\admin\skill_panel.dm" #include "code\modules\admin\sound_emitter.dm" #include "code\modules\admin\sql_ban_system.dm" @@ -1452,6 +1451,7 @@ #include "code\modules\admin\verbs\randomverbs.dm" #include "code\modules\admin\verbs\reestablish_db_connection.dm" #include "code\modules\admin\verbs\shuttlepanel.dm" +#include "code\modules\admin\verbs\secrets.dm" #include "code\modules\admin\verbs\spawnobjasmob.dm" #include "code\modules\admin\verbs\tripAI.dm" #include "code\modules\admin\verbs\SDQL2\SDQL_2.dm" diff --git a/tgui/packages/tgui/interfaces/Secrets.js b/tgui/packages/tgui/interfaces/Secrets.js new file mode 100644 index 00000000000..9f9b8a5e8a8 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Secrets.js @@ -0,0 +1,678 @@ +import { toFixed } from 'common/math'; +import { Fragment } from 'inferno'; +import { useBackend, useLocalState } from '../backend'; +import { Button, Flex, LabeledControls, NoticeBox, RoundGauge, Section } from '../components'; +import { FlexItem } from '../components/Flex'; +import { Window } from '../layouts'; + +const TAB2NAME = [ + { + title: 'Debugging', + blurb: 'Where useless shit goes to die', + gauge: 5, + component: () => DebuggingTab, + }, + { + title: 'Helpful', + blurb: 'Where fuckwits put logging', + gauge: 25, + component: () => HelpfulTab, + }, + { + title: 'Fun', + blurb: 'How I ran an """event"""', + gauge: 75, + component: () => FunTab, + }, + { + title: 'Only Fun For You', + blurb: 'How I spent my last day adminning', + gauge: 95, + component: () => FunForYouTab, + }, +]; + +const lineHeightNormal = 2.79; +const lineHeightDebug = 6; + +const DebuggingTab = (props, context) => { + const { act } = useBackend(context); + return ( + + +