diff --git a/code/modules/power/breaker_box.dm b/code/modules/power/breaker_box.dm
index e47d6f17f3..29a420d118 100644
--- a/code/modules/power/breaker_box.dm
+++ b/code/modules/power/breaker_box.dm
@@ -4,9 +4,8 @@
// Humans need 30 seconds (AI is faster when it comes to complex electronics)
// Used for advanced grid control (read: Substations)
-/obj/structure/breakerbox
+/obj/machinery/power/breakerbox
name = "Breaker Box"
- desc = "Large panel with breakers used to control connected power circuits."
icon = 'icons/obj/power.dmi'
icon_state = "bbox_off"
var/icon_state_on = "bbox_on"
@@ -16,16 +15,16 @@
anchored = 1
var/on = 0
var/busy = 0
+ var/directions = list(1,2,4,8,5,6,9,10)
-/obj/structure/breakerbox/examine()
- ..()
+/obj/machinery/power/breakerbox/examine()
usr << "Large machine with heavy duty switching circuits used for advanced grid control"
if(on)
usr << "\green It seems to be online."
else
usr << "\red It seems to be offline"
-/obj/structure/breakerbox/attack_ai(mob/user)
+/obj/machinery/power/breakerbox/attack_ai(mob/user)
if(busy)
user << "\red System is busy. Please wait until current operation is finished before changing power settings."
return
@@ -40,7 +39,7 @@
busy = 0
-/obj/structure/breakerbox/attack_hand(mob/user)
+/obj/machinery/power/breakerbox/attack_hand(mob/user)
if(busy)
user << "\red System is busy. Please wait until current operation is finished before changing power settings."
@@ -54,16 +53,17 @@
if(do_after(user, 300)) // 30s for non-AIs as humans have to manually reprogram it and rapid switching may cause some lag / powernet updates flood. If AIs spam it they can be easily traced.
set_state(!on)
- for(var/mob/O in viewers(user))
- O.show_message(text("\red [user] finished reprogramming the [src]!"), 1)
+ user.visible_message(\
+ "[user.name] [on ? "enabled" : "disabled"] the breaker box!",\
+ "You [on ? "enabled" : "disabled"] the breaker box!")
busy = 0
-/obj/structure/breakerbox/proc/set_state(var/state)
+/obj/machinery/power/breakerbox/proc/set_state(var/state)
on = state
if(on)
icon_state = icon_state_on
var/list/connection_dirs = list()
- for(var/direction in list(1,2,4,8,5,6,9,10))
+ for(var/direction in directions)
for(var/obj/structure/cable/C in get_step(src,direction))
if(C.d1 == turn(direction, 180) || C.d2 == turn(direction, 180))
connection_dirs += direction
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 34698cb735..73a3eca3c4 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -36,7 +36,7 @@
var/d2 = 1
layer = 2.44 //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4
color = COLOR_RED
- var/obj/structure/breakerbox/breaker_box
+ var/obj/machinery/power/breakerbox/breaker_box
/obj/structure/cable/yellow
color = COLOR_YELLOW