Skip to content

Commit

Permalink
generic beacon
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 27, 2023
1 parent 36d6060 commit e717851
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions code/game/objects/items/handheld_distress_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,47 @@
recipient = "Anchorpoint Station"
ert_full_name = list("CMB - Patrol Team - Marshals in Distress (Friendly)", "CMB - Anchorpoint Station Colonial Marine QRF (Friendly)")
ert_short_name = list("SEND CMB", "SEND QRF")

/// Generic beacon for objectives
/obj/item/handheld_beacon
name = "handheld beacon"
desc = "A standard handheld beacon. Generally used by teams who may be out of regular communications range but must signal for various reasons. This one is branded with a Weyland Yutani symbol and sold en masse."
icon = 'icons/obj/items/handheld_distress_beacon.dmi'
icon_state = "beacon_inactive"
w_class = SIZE_SMALL

/// Whether the beacon is active or not
var/active = FALSE

/obj/item/handheld_beacon/get_examine_text(mob/user)
. = ..()

if(active)
. += "The beacon has been activated!"

/obj/item/handheld_beacon/update_icon()
. = ..()

if(active)
icon_state = "beacon_active"
return
icon_state = initial(icon_state)

/obj/item/handheld_beacon/attack_self(mob/user)
. = ..()

if(.)
return

active = !active
update_icon()

to_chat(user, SPAN_NOTICE("The beacon pings quietly and turns [active ? "on" : "off"]."))

if(!active)
return

for(var/client/admin_client in GLOB.admins)
if((R_ADMIN|R_MOD) & admin_client.admin_holder.rights)
playsound_client(admin_client,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(user)] has used [name]! [ADMIN_JMP_USER(user)]")

0 comments on commit e717851

Please sign in to comment.