[MIRROR] Interview System / Soft Panic Bunker (#1458)

* Interview System / Soft Panic Bunker

* a

Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
SkyratBot
2020-10-26 08:32:37 +01:00
committed by GitHub
co-authored by Bobbahbrown Azarak
parent 6c58c5bad7
commit 91773c46da
30 changed files with 810 additions and 39 deletions
+2
View File
@@ -128,6 +128,7 @@ GLOBAL_PROTECT(admin_verbs_server)
/client/proc/forcerandomrotate,
/client/proc/adminchangemap,
/client/proc/panicbunker,
/client/proc/toggle_interviews,
/client/proc/toggle_hub,
/client/proc/toggle_cdn
)
@@ -251,6 +252,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
/proc/release,
/client/proc/reload_admins,
/client/proc/panicbunker,
/client/proc/toggle_interviews,
/client/proc/admin_change_sec_level,
/client/proc/toggle_nuke,
/client/proc/cmd_display_del_log,
+12
View File
@@ -2308,6 +2308,18 @@
var/obj/item/nuclear_challenge/button = locate(href_list["force_war"])
button.force_war()
else if (href_list["interview"])
if(!check_rights(R_ADMIN))
return
var/datum/interview/I = locate(href_list["interview"])
if (I)
I.ui_interact(usr)
else if (href_list["interview_man"])
if(!check_rights(R_ADMIN))
return
GLOB.interviews.ui_interact(usr)
/datum/admins/proc/HandleCMode()
if(!check_rights(R_ADMIN))
return
-1
View File
@@ -286,7 +286,6 @@
if(!already_logged) //Reply to an existing ticket
SSblackbox.LogAhelp(recipient.current_ticket.id, "Reply", msg, recipient.ckey, src.ckey)
//always play non-admin recipients the adminhelp sound
SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))
+17 -3
View File
@@ -6,6 +6,7 @@
return
var/new_pb = !CONFIG_GET(flag/panic_bunker)
var/interview = CONFIG_GET(flag/panic_bunker_interview)
var/time_rec = 0
var/message = ""
if(new_pb)
@@ -14,10 +15,23 @@
message = replacetext(message, "%minutes%", time_rec)
CONFIG_SET(number/panic_bunker_living, time_rec)
CONFIG_SET(string/panic_bunker_message, message)
var/interview_sys = alert(src, "Should the interview system be enabled? (Allows players to connect under the hour limit and force them to be manually approved to play)", "Enable interviews?", "Enable", "Disable")
interview = interview_sys == "Enable"
CONFIG_SET(flag/panic_bunker_interview, interview)
CONFIG_SET(flag/panic_bunker, new_pb)
log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [new_pb ? "on and set to [time_rec] with a message of [message]" : "off"]")
message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [new_pb ? "enabled with a living minutes requirement of [time_rec]" : "disabled"].")
log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [new_pb ? "on and set to [time_rec] with a message of [message]. The interview system is [interview ? "enabled" : "disabled"]" : "off"].")
message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [new_pb ? "enabled with a living minutes requirement of [time_rec]. The interview system is [interview ? "enabled" : "disabled"]" : "disabled"].")
if (new_pb && !SSdbcore.Connect())
message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Panic Bunker", "[new_pb ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_interviews()
set category = "Server"
set name = "Toggle PB Interviews"
if (!CONFIG_GET(flag/panic_bunker))
to_chat(usr, "<span class='adminnotice'>NOTE: The panic bunker is not enabled, so this change will not effect anything until it is enabled.</span>", confidential = TRUE)
var/new_interview = !CONFIG_GET(flag/panic_bunker_interview)
CONFIG_SET(flag/panic_bunker_interview, new_interview)
log_admin("[key_name(usr)] has toggled the Panic Bunker's interview system, it is now [new_interview ? "enabled" : "disabled"].")
message_admins("[key_name(usr)] has toggled the Panic Bunker's interview system, it is now [new_interview ? "enabled" : "disabled"].")