Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERT Request QOL #4267

Merged
merged 2 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
/datum/game_mode
var/list/datum/emergency_call/all_calls = list() //initialized at round start and stores the datums.
var/datum/emergency_call/picked_calls[] = list() //Which distress calls are currently active
var/ert_dispatched = FALSE

/datum/game_mode/proc/ares_online()
var/name = "ARES Online"
var/input = "ARES. Online. Good morning, marines."
shipwide_ai_announcement(input, name, 'sound/AI/ares_online.ogg')

/datum/game_mode/proc/request_ert(user, ares = FALSE)
if(!user)
return FALSE
message_admins("[key_name(user)] has requested a Distress Beacon! [ares ? SPAN_ORANGE("(via ARES)") : ""] ([SSticker.mode.ert_dispatched ? SPAN_RED("A random ERT was dispatched previously.") : SPAN_GREEN("No previous random ERT dispatched.")]) [CC_MARK(user)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress=\ref[user]'>SEND</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];ccdeny=\ref[user]'>DENY</A>) [ADMIN_JMP_USER(user)] [CC_REPLY(user)]")
return TRUE

//The distress call parent. Cannot be called itself due to "name" being a filtered target.
/datum/emergency_call
var/name = "name"
Expand Down Expand Up @@ -106,6 +113,7 @@
give_action(M, /datum/action/join_ert, src)

/datum/game_mode/proc/activate_distress()
ert_dispatched = TRUE
var/datum/emergency_call/random_call = get_random_call()
if(!istype(random_call, /datum/emergency_call)) //Something went horribly wrong
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
for(var/client/admin in GLOB.admins)
if((R_ADMIN|R_MOD) & admin.admin_holder.rights)
playsound_client(admin,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(usr)] has requested a Distress Beacon (via ARES)! [CC_MARK(usr)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress=\ref[usr]'>SEND</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];ccdeny=\ref[usr]'>DENY</A>) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]")
SSticker.mode.request_ert(usr, TRUE)
to_chat(usr, SPAN_NOTICE("A distress beacon request has been sent to USCM High Command."))
COOLDOWN_START(src, ares_distress_cooldown, COOLDOWN_COMM_REQUEST)
return TRUE
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/computer/almayer_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
/// requesting a distress beacon
COOLDOWN_DECLARE(cooldown_request)
/// requesting evac
COOLDOWN_DECLARE(cooldown_destruct)
COOLDOWN_DECLARE(cooldown_destruct)
/// messaging HC (admins)
COOLDOWN_DECLARE(cooldown_central)
/// making a ship announcement
COOLDOWN_DECLARE(cooldown_message)
COOLDOWN_DECLARE(cooldown_message)

var/list/messagetitle = list()
var/list/messagetext = list()
Expand Down Expand Up @@ -230,7 +230,7 @@
for(var/client/admin_client as anything in GLOB.admins)
if((R_ADMIN|R_MOD) & admin_client.admin_holder.rights)
admin_client << 'sound/effects/sos-morse-code.ogg'
message_admins("[key_name(usr)] has requested a Distress Beacon! [CC_MARK(usr)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress=\ref[usr]'>SEND</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];ccdeny=\ref[usr]'>DENY</A>) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]")
SSticker.mode.request_ert(usr)
to_chat(usr, SPAN_NOTICE("A distress beacon request has been sent to USCM Central Command."))

COOLDOWN_START(src, cooldown_request, COOLDOWN_COMM_REQUEST)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
for(var/client/C in GLOB.admins)
if((R_ADMIN|R_MOD) & C.admin_holder.rights)
C << 'sound/effects/sos-morse-code.ogg'
message_admins("[key_name(usr)] has requested a Distress Beacon! [CC_MARK(usr)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress=\ref[usr]'>SEND</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];ccdeny=\ref[usr]'>DENY</A>) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]")
SSticker.mode.request_ert(usr)
to_chat(usr, SPAN_NOTICE("A distress beacon request has been sent to USCM Central Command."))

cooldown_request = world.time
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/cictablet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
for(var/client/C in GLOB.admins)
if((R_ADMIN|R_MOD) & C.admin_holder.rights)
playsound_client(C,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(usr)] has requested a Distress Beacon! [CC_MARK(usr)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress=\ref[usr]'>SEND</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];ccdeny=\ref[usr]'>DENY</A>) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]")
SSticker.mode.request_ert(usr)
to_chat(usr, SPAN_NOTICE("A distress beacon request has been sent to USCM Central Command."))
COOLDOWN_START(src, distress_cooldown, COOLDOWN_COMM_REQUEST)
return TRUE
Expand Down