diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 0ccfdb5bda0..292e3eacbe0 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -105,9 +105,10 @@
-#define SCREWED 32
-
-/obj/machinery/singularity_beacon //not the best place for it but it's a hack job anyway -- Urist
+////////////////////////////////////////
+//Singularity beacon
+////////////////////////////////////////
+/obj/machinery/power/singularity_beacon
name = "ominous beacon"
desc = "This looks suspicious..."
icon = 'icons/obj/singularity.dmi'
@@ -115,108 +116,86 @@
anchored = 0
density = 1
- layer = MOB_LAYER - 0.1 //so people can't hide it and it's REALLY OBVIOUS
+ layer = MOB_LAYER - 0.2 //so people can't hide it and it's REALLY OBVIOUS
stat = 0
- var/active = 0 //It doesn't use up power, so use_power wouldn't really suit it
+ var/active = 0
var/icontype = "beacon"
- var/obj/structure/cable/attached = null
- proc/Activate(mob/user = null)
- if(!checkWirePower())
- if(user) user << "\blue The connected wire doesn't have enough current."
- return
- for(var/obj/singularity/singulo in world)
- if(singulo.z == z)
- singulo.target = src
- icon_state = "[icontype]1"
- active = 1
- if(user) user << "\blue You activate the beacon."
+/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
+ if(surplus() < 1500)
+ if(user) user << "The connected wire doesn't have enough current."
+ return
+ for(var/obj/singularity/singulo in world)
+ if(singulo.z == z)
+ singulo.target = src
+ icon_state = "[icontype]1"
+ active = 1
+ machines |= src
+ if(user)
+ user << "You activate the beacon."
- proc/Deactivate(mob/user = null)
- for(var/obj/singularity/singulo in world)
- if(singulo.target == src)
- singulo.target = null
- icon_state = "[icontype]0"
- active = 0
- if(user) user << "\blue You deactivate the beacon."
+/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
+ for(var/obj/singularity/singulo in world)
+ if(singulo.target == src)
+ singulo.target = null
+ icon_state = "[icontype]0"
+ active = 0
+ if(user)
+ user << "You deactivate the beacon."
- attack_ai(mob/user as mob)
+/obj/machinery/power/singularity_beacon/attack_ai(mob/user as mob)
+ return
+
+
+/obj/machinery/power/singularity_beacon/attack_hand(var/mob/user as mob)
+ if(anchored)
+ return active ? Deactivate(user) : Activate(user)
+ else
+ user << "You need to screw the beacon to the floor first!"
return
- attack_hand(var/mob/user as mob)
- if(stat & SCREWED)
- return active ? Deactivate(user) : Activate(user)
- else
- user << "\red You need to screw the beacon to the floor first!"
+/obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
+ if(istype(W,/obj/item/weapon/screwdriver))
+ if(active)
+ user << "You need to deactivate the beacon first!"
return
-
- attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if(istype(W,/obj/item/weapon/screwdriver))
- if(active)
- user << "\red You need to deactivate the beacon first!"
- return
-
- if(stat & SCREWED)
- stat &= ~SCREWED
- anchored = 0
- user << "\blue You unscrew the beacon from the floor."
- attached = null
- return
- else
- var/turf/T = loc
- if(isturf(T) && !T.intact)
- attached = locate() in T
- if(!attached)
- user << "This device must be placed over an exposed cable."
- return
- stat |= SCREWED
- anchored = 1
- user << "\blue You screw the beacon to the floor and attach the cable."
- return
- ..()
- return
-
-
- Destroy()
- if(active) Deactivate()
- ..()
-
- /*
- * Added for a simple way to check power. Verifies that the beacon
- * is connected to a wire, the wire is part of a powernet (that part's
- * sort of redundant, since all wires either join or create one when placed)
- * and that the powernet has at least 1500 power units available for use.
- * Doesn't use them, though, just makes sure they're there.
- * - QualityVan, Aug 11 2012
- */
- proc/checkWirePower()
- if(!attached)
- return 0
- var/datum/powernet/PN = attached.get_powernet()
- if(!PN)
- return 0
- if(PN.avail < 1500)
- return 0
- return 1
-
- process()
- if(!active)
+ if(anchored)
+ anchored = 0
+ user << "You unscrew the beacon from the floor."
+ disconnect_from_network()
return
else
- if(!checkWirePower())
- Deactivate()
- return
+ if(!connect_to_network())
+ user << "This device must be placed over an exposed cable."
+ return
+ anchored = 1
+ user << "You screw the beacon to the floor and attach the cable."
+ return
+ ..()
+ return
-/obj/machinery/singularity_beacon/syndicate
+/obj/machinery/power/singularity_beacon/Destroy()
+ if(active)
+ Deactivate()
+ ..()
+
+//stealth direct power usage
+/obj/machinery/power/singularity_beacon/process()
+ if(!active)
+ return PROCESS_KILL
+ else
+ if(surplus() > 1500)
+ add_load(1500)
+ else
+ Deactivate()
+
+/obj/machinery/power/singularity_beacon/syndicate
icontype = "beaconsynd"
- icon_state = "beaconsynd0"
-
-#undef SCREWED
-
+ icon_state = "beaconsynd0"
\ No newline at end of file
diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm
index 628a6ee8bba..146be0a57ed 100644
--- a/code/game/objects/items/devices/radio/beacon.dm
+++ b/code/game/objects/items/devices/radio/beacon.dm
@@ -13,7 +13,7 @@
emagged = 1
syndicate = 1
user << "\blue The This beacon now only be locked on to by emagged teleporters!"
-
+
/obj/item/device/radio/beacon/hear_talk()
return
@@ -52,7 +52,7 @@
/obj/item/device/radio/beacon/syndicate/attack_self(mob/user as mob)
if(user)
user << "\blue Locked In"
- new /obj/machinery/singularity_beacon/syndicate( user.loc )
+ new /obj/machinery/power/singularity_beacon/syndicate( user.loc )
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
del(src)
return
diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm
index 8d4cdbfc45c..f543b353781 100644
--- a/code/modules/power/singularity/singularity.dm
+++ b/code/modules/power/singularity/singularity.dm
@@ -33,7 +33,7 @@
src.energy = starting_energy
..()
processing_objects.Add(src)
- for(var/obj/machinery/singularity_beacon/singubeacon in world)
+ for(var/obj/machinery/power/singularity_beacon/singubeacon in world)
if(singubeacon.active)
target = singubeacon
break