From 3c5f848d5b4ed315b54cdca53890b86c3e56ec77 Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Mon, 16 Apr 2012 18:03:28 +0100 Subject: [PATCH] Forgot a file. --- code/game/machinery/Beacon.dm | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 code/game/machinery/Beacon.dm diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm new file mode 100644 index 00000000000..73adecbabdc --- /dev/null +++ b/code/game/machinery/Beacon.dm @@ -0,0 +1,55 @@ +/obj/machinery/bluespace_beacon + + icon = 'objects.dmi' + icon_state = "floor_beaconf" + name = "Bluespace Gigabeacon" + desc = "A device that draws power from bluespace and creates a permanent tracking beacon." + level = 1 // underfloor + layer = 2.5 + anchored = 1 + use_power = 1 + idle_power_usage = 0 + var/obj/item/device/radio/beacon/Beacon + + New() + ..() + var/turf/T = loc + Beacon = new /obj/item/device/radio/beacon + Beacon.invisibility = 100 + Beacon.loc = T + + hide(T.intact) + + Del() + if(Beacon) + del(Beacon) + ..() + + // update the invisibility and icon + hide(var/intact) + invisibility = intact ? 101 : 0 + updateicon() + + // update the icon_state + proc/updateicon() + var/state="floor_beacon" + + if(invisibility) + icon_state = "[state]f" + + else + icon_state = "[state]" + + process() + if(!Beacon) + var/turf/T = loc + Beacon = new /obj/item/device/radio/beacon + Beacon.invisibility = 100 + Beacon.loc = T + if(Beacon) + if(Beacon.loc != loc) + Beacon.loc = loc + + updateicon() + +