From 3ad13cafe97c0fe6e206d8f7e392ee742463575c Mon Sep 17 00:00:00 2001 From: Merlin1230 <76177064+Merlin1230@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:52:11 +0000 Subject: [PATCH] [MIRROR] adds a GCS signal to the transmission beacon --- code/modules/overmap/ships/beacon.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/modules/overmap/ships/beacon.dm b/code/modules/overmap/ships/beacon.dm index c23d6b79580e9..40940f7635063 100644 --- a/code/modules/overmap/ships/beacon.dm +++ b/code/modules/overmap/ships/beacon.dm @@ -11,6 +11,7 @@ construct_state = /singleton/machine_construction/default/panel_closed var/obj/overmap/radio/signal var/obj/overmap/radio/distress/emergency_signal + var/obj/item/device/gps/gps /// Integer. The `world.time` value of the last distress broadcast. var/last_message_time = 0 /// Integer. The `world.time` of the last activation toggle. @@ -37,6 +38,10 @@ ) +/obj/machinery/radio_beacon/Initialize() + . = ..() + gps = new(src) + /obj/machinery/radio_beacon/interface_interact(mob/user, skip_time_check = FALSE) if (!CanInteract(user, DefaultTopicState())) return @@ -84,6 +89,12 @@ if(!message) return + var/gps_name = sanitize(input("What should its GCS signal be named?", "[gps.gps_tag] - GCS Tag", gps.gps_tag) as text|null) + if (gps_name && gps_name != gps.gps_tag) + gps.gps_tag = uppertext(copytext(gps_name, 1, 11)) + if (!gps.tracking) + gps.toggle_tracking(silent=TRUE) + visible_message(SPAN_NOTICE("\The [src] whirrs to life, starting its radio broadcast.")) playsound(src, 'sound/machines/sensors/newcontact.ogg', 50, 3, 3) @@ -113,6 +124,10 @@ emergency_signal.set_origin(O) + gps?.gps_tag = "SOS" + if (!gps?.tracking) + gps.toggle_tracking(silent=TRUE) + update_use_power(POWER_USE_ACTIVE) update_icon() @@ -127,6 +142,9 @@ last_activation_time = world.time + if (gps?.tracking) + gps.toggle_tracking(silent=TRUE) + update_use_power(POWER_USE_OFF) update_icon() @@ -154,6 +172,7 @@ /obj/machinery/radio_beacon/Destroy() QDEL_NULL(signal) QDEL_NULL(emergency_signal) + QDEL_NULL(gps) . = ..() /obj/overmap/radio