Skip to content

Commit

Permalink
deploy beacon lights and custom name support
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Nov 7, 2023
1 parent ca7a671 commit 9efcf33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
13 changes: 12 additions & 1 deletion code/game/objects/items/beacons/deployable_beacons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@
playsound(deploying_turf, 'sound/mecha/mechmove01.ogg', 30, 1)

var/obj/structure/deployable_beacon/deployed_beacon = new beacon_type(get_turf(src), user)
transfer_label_component(deployed_beacon)

var/datum/component/label/src_label_component = GetComponent(/datum/component/label)
var/label_text
if(src_label_component)
label_text = src_label_component.label_name
src_label_component.remove_label()

deployed_beacon.name = name
deployed_beacon.desc = desc

if(label_text)
deployed_beacon.AddComponent(/datum/component/label, label_text)

qdel(src)

Expand Down
15 changes: 14 additions & 1 deletion code/game/objects/structures/beacons/deployable_beacons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

visible_message(SPAN_NOTICE("[src] beeps quietly as it begins broadcasting preprogrammed signals."))

set_light(2, 1, beacon_light_color)

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)
Expand All @@ -39,7 +41,18 @@
visible_message(SPAN_NOTICE("[src] gives a drone as it powers down and collapses into itself for easier carrying."))

var/obj/item/deployable_beacon/undeployed_beacon = new beacon_type()
transfer_label_component(undeployed_beacon)

var/datum/component/label/src_label_component = GetComponent(/datum/component/label)
var/label_text
if(src_label_component)
label_text = src_label_component.label_name
src_label_component.remove_label()

undeployed_beacon.name = name
undeployed_beacon.desc = desc

if(label_text)
undeployed_beacon.AddComponent(/datum/component/label, label_text)

user.put_in_hands(undeployed_beacon)

Expand Down

0 comments on commit 9efcf33

Please sign in to comment.