From 28391ffe761be2a9463b546bf225b4d30b1de082 Mon Sep 17 00:00:00 2001 From: Will <7099514+Willburd@users.noreply.github.com> Date: Sat, 22 Mar 2025 06:44:29 -0400 Subject: [PATCH] Various Fixes For Heavy Cables (#17398) * heavy cable fix * span fix * span part 2 --- code/modules/power/cable.dm | 6 ++++- code/modules/power/cable_heavyduty.dm | 38 ++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index fd90c688951..2e2ff8378eb 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -700,7 +700,11 @@ var/list/possible_cable_coil_colours = list( if(!istype(F)) return - var/obj/structure/cable/C = new(F) + var/obj/structure/cable/C + if(istype(src,/obj/item/stack/cable_coil/heavyduty)) // this is the only cable that does this, not worth an override + C = new /obj/structure/cable/heavyduty(F) + else + C = new /obj/structure/cable(F) C.cableColor(color) C.d1 = d1 C.d2 = d2 diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm index 8d635003156..06d09eb5268 100644 --- a/code/modules/power/cable_heavyduty.dm +++ b/code/modules/power/cable_heavyduty.dm @@ -10,6 +10,7 @@ plane = PLATING_PLANE layer = PIPES_LAYER - 0.05 //Just below pipes color = null + var/static/allow_cutting = TRUE // Allows heavy cables to be cut by welder, up to server preference or admin vv during round. Changing it on one changes them all! /obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user) @@ -18,13 +19,44 @@ return if(W.has_tool_quality(TOOL_WIRECUTTER)) - to_chat(user, span_blue("These cables are too tough to be cut with those [W.name].")) + to_chat(user, span_notice("These cables are too tough to be cut with those [W.name].")) return - else if(istype(W, /obj/item/stack/cable_coil)) - to_chat(user, span_blue("You will need heavier cables to connect to these.")) + else if(W.has_tool_quality(TOOL_WELDER)) + if(!allow_cutting) + to_chat(user, span_warning("Something in these cables make them too strong to cut!")) + return + + var/obj/item/weldingtool/WT = W.get_welder() + if(!WT.remove_fuel(2, user)) // Takes lots of fuel and time... + to_chat(user, span_infoplain("The welding tool must be on to complete this task.")) + return + + playsound(src, WT.usesound, 50, 1) + if(do_after(user, 250 * WT.toolspeed)) // Meant to be an obnoxiously long time due to these being intended as "mapper placed indestructable cables". However explosions can already break them if they turf change. + var/obj/item/stack/cable_coil/heavyduty/CC + if(src.d1) // 0-X cables are 1 unit, X-X cables are 2 units long + CC = new/obj/item/stack/cable_coil/heavyduty(T, 2, color) + else + CC = new/obj/item/stack/cable_coil/heavyduty(T, 1, color) + + src.add_fingerprint(user) + src.transfer_fingerprints_to(CC) + for(var/mob/O in viewers(src, null)) + O.show_message(span_warning("[user] cuts the cable."), 1) + + qdel(src) + return + else if(istype(W, /obj/item/stack/cable_coil) && !istype(W, /obj/item/stack/cable_coil/heavyduty)) + to_chat(user, span_notice("You will need heavier cables to connect to these.")) return else ..() +/obj/item/stack/cable_coil/heavyduty/turf_place(turf/simulated/F, mob/user) + if(istype(F, /turf/simulated/open)) + to_chat(user, span_infoplain("\The [src] isn't flexible enough to do this!")) + return + . = ..() + /obj/structure/cable/heavyduty/cableColor(var/colorC) return