From 5a109a245806580ec6fbcbca755011a912713dd5 Mon Sep 17 00:00:00 2001
From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Date: Tue, 16 Jul 2024 03:54:26 -0500
Subject: [PATCH] distress signal admin button (#3186)
## About The Pull Request
A simple button that creates a announcement on whatever ship your
hovering over!
![image](https://github.com/shiptest-ss13/Shiptest/assets/86381784/a38409fb-9530-47ba-9c77-cb28e8e75645)
![image](https://github.com/shiptest-ss13/Shiptest/assets/86381784/6230d9da-246c-41ee-8e08-7453a275c400)
![image](https://github.com/shiptest-ss13/Shiptest/assets/86381784/4317a4a6-0a6b-4550-89df-47a7248d31ca)
## Why It's Good For The Game
Should save admins a lot of time
## Changelog
:cl:
add: New admin button to launch a distress announcement quicker.
/:cl:
---
code/__HELPERS/priority_announce.dm | 8 +++++++-
code/modules/admin/admin_verbs.dm | 2 ++
code/modules/admin/verbs/randomverbs.dm | 15 +++++++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/code/__HELPERS/priority_announce.dm b/code/__HELPERS/priority_announce.dm
index 65ea832c0e0b8..fb02a93e144d8 100644
--- a/code/__HELPERS/priority_announce.dm
+++ b/code/__HELPERS/priority_announce.dm
@@ -1,4 +1,4 @@
-/proc/priority_announce(text, title = "", sound = 'sound/ai/attention.ogg', type, sender_override, auth_id, zlevel) //WS Edit - Make cap's announcement use logged-in name
+/proc/priority_announce(text, title = "", sound = 'sound/ai/attention.ogg', type, sender_override, auth_id, zlevel)
if(!text)
return
@@ -73,3 +73,9 @@
to_chat(M, "[title]
[message]
[from ? "-[from.name] ([from.job])" : null]")
if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
SEND_SOUND(M, S)
+
+/proc/create_distress_beacon(datum/overmap/ship/ship)
+ if(!ship)
+ return
+ var/text = "A distress beacon has been launched by [ship.name], at local sector co-ordinates [ship.x || ship.docked_to.x]/[ship.y || ship.docked_to.y]. No further information available."
+ priority_announce(text, null, 'sound/effects/alert.ogg', sender_override = "Outpost Distress Beacon System", zlevel = 0)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 9c4f15b9d4605..42193738319e4 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -103,6 +103,7 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/cmd_admin_gib_self,
/client/proc/cmd_change_command_name,
/client/proc/cmd_admin_create_centcom_report,
+ /client/proc/cmd_admin_distress_signal,
/client/proc/drop_bomb,
/client/proc/set_dynex_scale,
/client/proc/drop_dynex_bomb,
@@ -254,6 +255,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
/client/proc/cinematic,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_create_centcom_report,
+ /client/proc/cmd_admin_distress_signal,
/client/proc/cmd_change_command_name,
/client/proc/object_say,
/client/proc/toggle_random_events,
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index f189fdf6106d3..853d33e1b61b8 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -360,6 +360,21 @@
message_admins("[key_name_admin(src)] has changed Central Command's name to [input]")
log_admin("[key_name(src)] has changed the Central Command name to: [input]")
+/client/proc/cmd_admin_distress_signal()
+ set category = "Event"
+ set name = "Create Distress Signal"
+
+ var/datum/overmap/ship/ship = SSshuttle.get_ship(usr)
+ if(!ship)
+ return
+ var/confirm = alert(src, "Do you want to create a distress signal for [ship.name]", "Distress Signal", "Yes", "Cancel")
+
+ switch(confirm)
+ if("Yes")
+ create_distress_beacon(ship)
+ if("Cancel")
+ return
+
/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in world)
set category = "Debug"
set name = "Delete"