Skip to content

Commit

Permalink
ERT Request QOL (#4267)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request
Tells admins if a random ERT has already been sent in response to an ERT
request. Useful for latejoin staff who may be unaware, or missed the
initial one by happenstance.

Also refactors the ERT request into a proc to synchronise messages as it
was duplicated in four different places.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Some QOL to make it easier to tell the situation with ERTs is a good
thing.
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->


# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/41653574/713af5e8-c91d-4930-89e7-4831355b0e42)


</details>


# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
code: Moved the Request ERT message to a proc to reduce duplication.
admin: Added a detail in ERT request to indicate if a RANDOM ERT was
granted by staff already or not. This will not work for manual specific
chosen ERTs.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
  • Loading branch information
realforest2001 committed Aug 27, 2023
1 parent 186bfe4 commit 680b63c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
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

0 comments on commit 680b63c

Please sign in to comment.