Skip to content

Commit

Permalink
[MIRROR] adds a GCS signal to the transmission beacon (#2931)
Browse files Browse the repository at this point in the history
Co-authored-by: Merlin1230 <[email protected]>
Co-authored-by: Lexanx <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2024
1 parent 64d5a74 commit f677254
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions code/modules/overmap/ships/beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand All @@ -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()

Expand Down Expand Up @@ -154,6 +172,7 @@
/obj/machinery/radio_beacon/Destroy()
QDEL_NULL(signal)
QDEL_NULL(emergency_signal)
QDEL_NULL(gps)
. = ..()

/obj/overmap/radio
Expand Down

0 comments on commit f677254

Please sign in to comment.