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

[MIRROR] adds a GCS signal to the transmission beacon #2931

Open
wants to merge 1 commit into
base: dev-sierra
Choose a base branch
from
Open
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
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