mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +00:00
* APC balloon alerts (#67755) Changes the to_chat messages from building/repairing/deconstruction/etherealing APCs to balloon alerts. I tried to standardize the multiple names that some items get into one, example: control board or electronics into just board. Renamed other things just to be cleaner on what tools to use, example: power terminal was change to cable terminal. And added ! at the end of all error messages so it is easier to know that your attempt failed. * APC balloon alerts Co-authored-by: GuillaumePrata <55374212+GuillaumePrata@users.noreply.github.com>
72 lines
1.9 KiB
Plaintext
72 lines
1.9 KiB
Plaintext
// the underfloor wiring terminal for the APC
|
|
// autogenerated when an APC is placed
|
|
// all conduit connects go to this object instead of the APC
|
|
// using this solves the problem of having the APC in a wall yet also inside an area
|
|
|
|
/obj/machinery/power/terminal
|
|
name = "terminal"
|
|
icon_state = "term"
|
|
desc = "It's an underfloor wiring terminal for power equipment."
|
|
layer = WIRE_TERMINAL_LAYER //a bit above wires
|
|
var/obj/machinery/power/master = null
|
|
|
|
|
|
/obj/machinery/power/terminal/Initialize(mapload)
|
|
. = ..()
|
|
|
|
AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE, use_alpha = TRUE)
|
|
|
|
/obj/machinery/power/terminal/Destroy()
|
|
if(master)
|
|
master.disconnect_terminal()
|
|
master = null
|
|
return ..()
|
|
|
|
/obj/machinery/power/terminal/should_have_node()
|
|
return TRUE
|
|
|
|
/obj/machinery/power/proc/can_terminal_dismantle()
|
|
. = FALSE
|
|
|
|
/obj/machinery/power/apc/can_terminal_dismantle()
|
|
. = FALSE
|
|
if(opened)
|
|
. = TRUE
|
|
|
|
/obj/machinery/power/smes/can_terminal_dismantle()
|
|
. = FALSE
|
|
if(panel_open)
|
|
. = TRUE
|
|
|
|
|
|
/obj/machinery/power/terminal/proc/dismantle(mob/living/user, obj/item/I)
|
|
if(isturf(loc))
|
|
var/turf/T = loc
|
|
if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE)
|
|
balloon_alert(user, "must expose the cable terminal!")
|
|
return
|
|
|
|
if(master && !master.can_terminal_dismantle())
|
|
return
|
|
|
|
user.visible_message(span_notice("[user.name] dismantles the cable terminal from [master]."))
|
|
balloon_alert(user, "cutting the cables...")
|
|
|
|
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
|
if(I.use_tool(src, user, 50))
|
|
if(master && !master.can_terminal_dismantle())
|
|
return
|
|
|
|
if(prob(50) && electrocute_mob(user, powernet, src, 1, TRUE))
|
|
do_sparks(5, TRUE, master)
|
|
return
|
|
|
|
new /obj/item/stack/cable_coil(drop_location(), 10)
|
|
balloon_alert(user, "cable terminal dismantled")
|
|
qdel(src)
|
|
|
|
/obj/machinery/power/terminal/wirecutter_act(mob/living/user, obj/item/I)
|
|
..()
|
|
dismantle(user, I)
|
|
return TRUE
|