diff --git a/code/game/machinery/_machines_base/machine_construction/frame.dm b/code/game/machinery/_machines_base/machine_construction/frame.dm index 268b709d7194e..f5253eae7faff 100644 --- a/code/game/machinery/_machines_base/machine_construction/frame.dm +++ b/code/game/machinery/_machines_base/machine_construction/frame.dm @@ -20,11 +20,11 @@ machine.anchored = TRUE if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(!WT.can_use(3, user)) + if(!WT.can_use(3, user) && (istype(I, /obj/item/weldingtool))) return TRUE playsound(machine.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, (I.toolspeed * 2) SECONDS, machine, DO_REPAIR_CONSTRUCT)) - if (!WT.remove_fuel(3, user)) + if (!WT.remove_fuel(3, user) && (istype(I, /obj/item/weldingtool))) return TRUE TRANSFER_STATE(/singleton/machine_construction/default/deconstructed) to_chat(user, SPAN_NOTICE("You deconstruct \the [machine].")) diff --git a/code/game/machinery/barrier.dm b/code/game/machinery/barrier.dm index 9b3d83f9ec8c6..9f65060440143 100644 --- a/code/game/machinery/barrier.dm +++ b/code/game/machinery/barrier.dm @@ -43,7 +43,7 @@ return TRUE if (isWelder(I)) var/obj/item/weldingtool/W = I - if (!W.can_use(1, user)) + if (!W.can_use(1, user) && (istype(I, /obj/item/weldingtool))) return TRUE if (!emagged) to_chat(user, SPAN_WARNING("\The [src]'s locking clamps are not damaged.")) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 21a422ecadfb4..eabbb391d649c 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -378,19 +378,19 @@ return null -/obj/machinery/camera/proc/weld(obj/item/weldingtool/WT, mob/user) +/obj/machinery/camera/proc/weld(obj/item/I, mob/user) if(busy) return 0 - - if(WT.can_use(1, user)) - to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + var/obj/item/weldingtool/WT = I + if(!WT.can_use(1, user) && (istype(I, /obj/item/weldingtool))) return TRUE + to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + busy = 1 + if(do_after(user, 10 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 1 - if(do_after(user, 10 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 0 - return 1 + busy = 0 + return 1 busy = 0 return 0 diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 6134ca6841ce2..861adeacba38a 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -152,19 +152,20 @@ if(!anchored) ..() -/obj/item/camera_assembly/proc/weld(obj/item/weldingtool/WT, mob/user) +/obj/item/camera_assembly/proc/weld(obj/item/I, mob/user) if(busy) return 0 - if(WT.can_use(1, user)) - to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + var/obj/item/weldingtool/WT = I + if(!WT.can_use(1, user) && (istype(I, /obj/item/weldingtool))) return TRUE + to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + busy = 1 + if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 1 - if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 0 - return 1 + busy = 0 + return 1 busy = 0 return 0 diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index aba3ba37b95f8..a46b3ccc627bf 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -356,7 +356,7 @@ var/global/list/empty_playable_ai_cores = list() USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored from the floor before you can dismantle it with \the [tool].") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to deconstruct \the [src]")) + if (!welder.can_use(1, user, "to deconstruct \the [src]") && (istype(tool, /obj/item/weldingtool))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] starst dismantling \the [src] with \a [tool]."), @@ -365,7 +365,7 @@ var/global/list/empty_playable_ai_cores = list() playsound(src, 'sound/items/Welder.ogg', 50, TRUE) if (!user.do_skilled(SKILL_CONSTRUCTION, 2 SECONDS, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool)) return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE new /obj/item/stack/material/plasteel(loc, 4) user.visible_message( diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index ecb6656f2f4f1..a9efedf06095f 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -905,7 +905,7 @@ About the new airlock wires panel: if(isWelder(item)) var/obj/item/weldingtool/WT = item - if(!WT.remove_fuel(3,user)) + if(!WT.remove_fuel(3,user) && (istype(item, /obj/item/weldingtool))) return 0 cut_verb = "cutting" cut_sound = 'sound/items/Welder.ogg' @@ -1024,7 +1024,7 @@ About the new airlock wires panel: if (!repairing && isWelder(C) && operating != DOOR_OPERATING_YES && density) var/obj/item/weldingtool/W = C - if(!W.can_use(1, user)) + if(!W.can_use(1, user) && (istype(C, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, 1) user.visible_message(SPAN_WARNING("\The [user] begins welding \the [src] [welded ? "open" : "closed"]!"), diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm index 4eca72c9674f7..9433c44f3f4e5 100644 --- a/code/game/machinery/doors/braces.dm +++ b/code/game/machinery/doors/braces.dm @@ -114,19 +114,18 @@ to_chat(user, SPAN_NOTICE("\The [src] does not require repairs.")) return TRUE var/obj/item/weldingtool/welder = item - if (welder.can_use(1, user)) - playsound(src, 'sound/items/Welder.ogg', 100, 1) + if (!welder.can_use(1, user) && (istype(item, /obj/item/weldingtool))) return TRUE + playsound(src, 'sound/items/Welder.ogg', 100, 1) + user.visible_message( + SPAN_ITALIC("\The [user] begins repairing damage on \a [src]."), + SPAN_ITALIC("You begin repairing damage on the [src].") + ) + if (do_after(user, (item.toolspeed * 3) SECONDS, airlock, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && welder.remove_fuel(1, user)) user.visible_message( - SPAN_ITALIC("\The [user] begins repairing damage on \a [src]."), - SPAN_ITALIC("You begin repairing damage on the [src].") + SPAN_ITALIC("\The [user] repairs damage on \a [src]."), + SPAN_ITALIC("You repair damage on the [src].") ) - if (do_after(user, (item.toolspeed * 3) SECONDS, airlock, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && welder.remove_fuel(1, user)) - user.visible_message( - SPAN_ITALIC("\The [user] repairs damage on \a [src]."), - SPAN_ITALIC("You repair damage on the [src].") - ) - restore_health(rand(75, 150)) - return TRUE + restore_health(rand(75, 150)) return ..() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 91d421afdb131..1d3763acf7580 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -227,18 +227,18 @@ return TRUE var/obj/item/weldingtool/welder = I - if(welder.can_use(2, user)) - to_chat(user, SPAN_NOTICE("You start to fix dents and weld \the [repairing] into place.")) - playsound(src, 'sound/items/Welder.ogg', 100, 1) - if(do_after(user, (0.5 * repairing.amount) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.remove_fuel(2, user)) - if (!repairing) - return TRUE//the materials in the door have been removed before welding was finished. - - to_chat(user, SPAN_NOTICE("You finish repairing the damage to \the [src].")) - restore_health(repairing.amount * DOOR_REPAIR_AMOUNT) - update_icon() - qdel(repairing) - repairing = null + if(!welder.can_use(2, user) && (istype(I, /obj/item/weldingtool))) return TRUE + to_chat(user, SPAN_NOTICE("You start to fix dents and weld \the [repairing] into place.")) + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, (0.5 * repairing.amount) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.remove_fuel(2, user)) + if (!repairing) + return TRUE//the materials in the door have been removed before welding was finished. + + to_chat(user, SPAN_NOTICE("You finish repairing the damage to \the [src].")) + restore_health(repairing.amount * DOOR_REPAIR_AMOUNT) + update_icon() + qdel(repairing) + repairing = null return TRUE if(repairing && isCrowbar(I)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index eab86cc2e7329..4f5cc9327aa17 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -200,25 +200,24 @@ if(isWelder(C) && !repairing) var/obj/item/weldingtool/W = C - if(W.can_use(2, user)) + if(!W.can_use(2, user) && (istype(C, /obj/item/weldingtool))) return TRUE + user.visible_message( + SPAN_WARNING("\The [user] starts [!blocked ? "welding \the [src] shut" : "cutting open \the [src]"]."), + SPAN_DANGER("You start [!blocked ? "welding \the [src] closed" : "cutting open \the [src]"]."), + SPAN_ITALIC("You hear welding.") + ) + playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + if(do_after(user, (C.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!W.remove_fuel(2, user)) + return TRUE + blocked = !blocked user.visible_message( - SPAN_WARNING("\The [user] starts [!blocked ? "welding \the [src] shut" : "cutting open \the [src]"]."), - SPAN_DANGER("You start [!blocked ? "welding \the [src] closed" : "cutting open \the [src]"]."), + SPAN_DANGER("\The [user] [blocked ? "welds \the [src] shut" : "cuts open \the [src]"]."), + SPAN_DANGER("You [blocked ? "weld shut" : "undo the welds on"] \the [src]."), SPAN_ITALIC("You hear welding.") ) - playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) - if(do_after(user, (C.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!W.remove_fuel(2, user)) - return TRUE - blocked = !blocked - user.visible_message( - SPAN_DANGER("\The [user] [blocked ? "welds \the [src] shut" : "cuts open \the [src]"]."), - SPAN_DANGER("You [blocked ? "weld shut" : "undo the welds on"] \the [src]."), - SPAN_ITALIC("You hear welding.") - ) - playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) - update_icon() - return TRUE + playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) + update_icon() if(density && isScrewdriver(C)) hatch_open = !hatch_open diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm index a0d4dfab35289..1adabcc376f6d 100644 --- a/code/game/machinery/doors/firedoor_assembly.dm +++ b/code/game/machinery/doors/firedoor_assembly.dm @@ -72,7 +72,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored before you can dismantle it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to dismantle \the [src].")) + if (!welder.can_use(1, user, "to dismantle \the [src].") && (istype(tool, /obj/item/weldingtool))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] starts dismantling \the [src] with \a [tool]."), diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 56a94de5874d2..58a1687cbb1c5 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -48,7 +48,7 @@ var/global/list/floor_light_cache = list() if (isWelder(W) && (health_damaged() || MACHINE_IS_BROKEN(src))) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1, user)) + if(!WT.can_use(1, user) && (istype(W, /obj/item/weldingtool))) return TRUE playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index ff89950593470..782dab26d6526 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -84,7 +84,7 @@ var/global/bomb_set if(0) if(isWelder(O)) var/obj/item/weldingtool/WT = O - if(!WT.can_use(5, user)) + if(!WT.can_use(5, user) && (istype(O, /obj/item/weldingtool))) return TRUE user.visible_message( @@ -93,7 +93,7 @@ var/global/bomb_set ) if(do_after(user, (O.toolspeed * 4) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !user || !WT.remove_fuel(5, user)) return TRUE + if(!src || !user || (!WT.remove_fuel(5, user) && (istype(O, /obj/item/weldingtool)))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] cuts through the bolt covers on \the [src]."), SPAN_NOTICE("You cut through the bolt covers on \the [src].") @@ -120,7 +120,7 @@ var/global/bomb_set if(2) if(isWelder(O)) var/obj/item/weldingtool/WT = O - if(!WT.can_use(5, user)) + if(!WT.can_use(5, user) && (istype(O, /obj/item/weldingtool))) return TRUE user.visible_message( @@ -129,7 +129,7 @@ var/global/bomb_set ) if(do_after(user, (O.toolspeed * 4) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !user || !WT.remove_fuel(5, user)) return TRUE + if(!src || !user || (!WT.remove_fuel(5, user) && (istype(O, /obj/item/weldingtool)))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] cuts apart the anchoring system sealant on \the [src]."), SPAN_NOTICE("You cut apart the anchoring system's sealant.") diff --git a/code/game/machinery/self_destruct.dm b/code/game/machinery/self_destruct.dm index cccbcb79a7499..07ffdebee2f15 100644 --- a/code/game/machinery/self_destruct.dm +++ b/code/game/machinery/self_destruct.dm @@ -12,7 +12,7 @@ /obj/machinery/self_destruct/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(damaged && WT.can_use(5, user)) + if(damaged && (WT.can_use(5, user) && (istype(W, /obj/item/weldingtool)) )) user.visible_message( SPAN_NOTICE("\The [user] begins to repair \the [src]."), SPAN_NOTICE("You begin repairing [src].") diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 1349ceb1c8569..65727d3296ddd 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -53,20 +53,20 @@ to_chat(user, SPAN_WARNING("You need at least two rods to do this.")) return TRUE - if(WT.remove_fuel(1,user)) - var/obj/item/stack/material/new_item = material.place_sheet(usr.loc) - new_item.add_to_stacks(usr) - user.visible_message( - SPAN_NOTICE("\The [user] welds \the [src] into \a [material.sheet_singular_name]."), - SPAN_NOTICE("You weld \the [src] into \a [material.sheet_singular_name].") - ) - var/obj/item/stack/material/rods/R = src - src = null - var/replace = (user.get_inactive_hand()==R) - R.use(2) - if (!R && replace) - user.put_in_hands(new_item) - return TRUE + if(!WT.remove_fuel(1,user) && (istype(W, /obj/item/weldingtool))) return TRUE + var/obj/item/stack/material/new_item = material.place_sheet(usr.loc) + new_item.add_to_stacks(usr) + user.visible_message( + SPAN_NOTICE("\The [user] welds \the [src] into \a [material.sheet_singular_name]."), + SPAN_NOTICE("You weld \the [src] into \a [material.sheet_singular_name].") + ) + var/obj/item/stack/material/rods/R = src + src = null + var/replace = (user.get_inactive_hand()==R) + R.use(2) + if (!R && replace) + user.put_in_hands(new_item) + return TRUE return ..() diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 27cab3fbd64b3..e63419043bc1b 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -50,10 +50,10 @@ /obj/item/material/shard/attackby(obj/item/W as obj, mob/user as mob) if(isWelder(W) && material.shard_can_repair) var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(1, user)) - material.place_sheet(get_turf(src)) - qdel(src) - return + if(!WT.remove_fuel(1, user) && (istype(W, /obj/item/weldingtool))) return + material.place_sheet(get_turf(src)) + qdel(src) + return return ..() /obj/item/material/shard/Crossed(AM as mob|obj) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 6c46316a95145..191f5f4bc58a9 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -210,24 +210,25 @@ var/global/list/tank_gauge_cache = list() if (GET_FLAGS(tank_flags, TANK_FLAG_FORCED)) to_chat(user, SPAN_WARNING("\The [src]'s emergency relief valve must be closed before you can weld it shut!")) return - if(WT.can_use(1,user)) - add_fingerprint(user) - if(!GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) - to_chat(user, SPAN_NOTICE("You begin welding the \the [src] emergency pressure relief valve.")) - if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE) && WT.remove_fuel(1, user)) - to_chat(user, "[SPAN_NOTICE("You carefully weld \the [src] emergency pressure relief valve shut.")][SPAN_WARNING(" \The [src] may now rupture under pressure!")]") - SET_FLAGS(tank_flags, TANK_FLAG_WELDED) - CLEAR_FLAGS(tank_flags, TANK_FLAG_LEAKING) - else - GLOB.bombers += "[key_name(user)] attempted to weld a [src]. [air_contents.temperature-T0C]" - log_and_message_admins("attempted to weld a [src]. [air_contents.temperature-T0C]", user) - if(WT.welding) - to_chat(user, SPAN_DANGER("You accidentally rake \the [W] across \the [src]!")) - maxintegrity -= rand(2,6) - integrity = min(integrity,maxintegrity) - air_contents.add_thermal_energy(rand(2000,50000)) + if(!WT.can_use(1,user) && (istype(W, /obj/item/weldingtool))) return + add_fingerprint(user) + if(!GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) + to_chat(user, SPAN_NOTICE("You begin welding the \the [src] emergency pressure relief valve.")) + if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE)) + if(!WT.remove_fuel(1, user) && istype(W, /obj/item/weldingtool)) return + to_chat(user, "[SPAN_NOTICE("You carefully weld \the [src] emergency pressure relief valve shut.")][SPAN_WARNING(" \The [src] may now rupture under pressure!")]") + SET_FLAGS(tank_flags, TANK_FLAG_WELDED) + CLEAR_FLAGS(tank_flags, TANK_FLAG_LEAKING) else - to_chat(user, SPAN_NOTICE("The emergency pressure relief valve has already been welded.")) + GLOB.bombers += "[key_name(user)] attempted to weld a [src]. [air_contents.temperature-T0C]" + log_and_message_admins("attempted to weld a [src]. [air_contents.temperature-T0C]", user) + if(!WT.welding && (istype(W, /obj/item/weldingtool))) return + to_chat(user, SPAN_DANGER("You accidentally rake \the [W] across \the [src]!")) + maxintegrity -= rand(2,6) + integrity = min(integrity,maxintegrity) + air_contents.add_thermal_energy(rand(2000,50000)) + else + to_chat(user, SPAN_NOTICE("The emergency pressure relief valve has already been welded.")) /obj/item/tank/attack_self(mob/user as mob) add_fingerprint(user) diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm index 9b8aee7d392f9..dc3d84431ef37 100644 --- a/code/game/objects/structures/catwalk.dm +++ b/code/game/objects/structures/catwalk.dm @@ -100,7 +100,7 @@ // Welding Tool - Deconstruct if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE deconstruct(user) return TRUE diff --git a/code/game/objects/structures/crates_lockers/closets/__closet.dm b/code/game/objects/structures/crates_lockers/closets/__closet.dm index c89398ebfe9ec..88c2473662003 100644 --- a/code/game/objects/structures/crates_lockers/closets/__closet.dm +++ b/code/game/objects/structures/crates_lockers/closets/__closet.dm @@ -309,7 +309,7 @@ // Welding weapon - Dismantle closet if (isWelder(weapon)) var/obj/item/weldingtool/welder = weapon - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && istype(weapon, /obj/item/weldingtool)) return TRUE slice_into_parts(weapon, user) return TRUE @@ -344,7 +344,7 @@ if (!HAS_FLAGS(setup, CLOSET_CAN_BE_WELDED)) USE_FEEDBACK_FAILURE("\The [src] can't be welded shut.") return TRUE - if (!welder.can_use(1, user)) + if (!welder.can_use(1, user) && istype(tool, /obj/item/weldingtool)) return TRUE welded = !welded update_icon() diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 421c4481e3adb..6d899e7062c43 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -332,7 +332,7 @@ if (glass) var/glass_noun = istext(glass) ? "[glass] plating" : "glass panel" var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to remove \the [src]'s [glass_noun].")) + if (!welder.can_use(1, user, "to remove \the [src]'s [glass_noun].") && (istype(tool, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -344,7 +344,7 @@ if (!glass) USE_FEEDBACK_FAILURE("\The [src]'s state has changed.") return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE var/obj/item/stack/material/stack if (istext(glass)) @@ -366,7 +366,7 @@ USE_FEEDBACK_FAILURE("\The [src] must be unanchored before you can dismantle it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to dismantle \the [src].")) + if (!welder.can_use(1, user, "to dismantle \the [src].") && (istype(tool, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -378,7 +378,7 @@ if (anchored) USE_FEEDBACK_FAILURE("\The [src] must be unanchored before you can dismantle it.") return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE var/obj/item/stack/material/steel/stack = new(loc, 4) transfer_fingerprints_to(stack) diff --git a/code/game/objects/structures/drain.dm b/code/game/objects/structures/drain.dm index a994317b3c6ea..029e0fbc0c4e5 100644 --- a/code/game/objects/structures/drain.dm +++ b/code/game/objects/structures/drain.dm @@ -16,7 +16,7 @@ // Welding Tool - Weld the drain closed if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE welded = !welded user.visible_message( diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index a0a5a11c780de..ca134d1826924 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -81,7 +81,7 @@ // Welder - Deconstruct if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE deconstruct(user) return TRUE diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 2a8a24ebd0432..57fce7810af99 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -254,7 +254,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored before you can dismantle it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to dismantle \the [src].")) + if (!welder.can_use(1, user, "to dismantle \the [src].") && (istype(tool, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -269,7 +269,7 @@ if (anchored) USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored before you can dismantle it.") return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE var/obj/item/stack/material/glass/reinforced/glass = new(loc, 5) transfer_fingerprints_to(glass) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 34e48decd8bb3..c4adbd3468302 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -441,7 +441,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs some [get_material_display_name()] applied before you can weld it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE restore_health(repair_pending) repair_pending = 0 diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 385ed1245d277..5452f8fa9dd9c 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -165,23 +165,24 @@ else if(isWelder(C)) var/obj/item/weldingtool/welder = C - if(welder.can_use(2, user) && (is_plating())) - if(broken || burnt) - welder.remove_fuel(2, user) - to_chat(user, SPAN_NOTICE("You fix some dents on the broken plating.")) - playsound(src, 'sound/items/Welder.ogg', 80, 1) - icon_state = "plating" - burnt = null - broken = null - return TRUE - else - welder.remove_fuel(2, user) + if((!welder.can_use(2, user) && istype(C, /obj/item/weldingtool)) && (is_plating())) return + if(broken || burnt) + welder.remove_fuel(2, user) + to_chat(user, SPAN_NOTICE("You fix some dents on the broken plating.")) + playsound(src, 'sound/items/Welder.ogg', 80, 1) + icon_state = "plating" + burnt = null + broken = null + return TRUE + else + welder.remove_fuel(2, user) + playsound(src, 'sound/items/Welder.ogg', 80, 1) + visible_message(SPAN_NOTICE("\The [user] has started melting the plating's reinforcements!")) + if(do_after(user, (C.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(welder.isOn() && welder_melt() && istype(C, /obj/item/weldingtool)) return + visible_message(SPAN_WARNING("\The [user] has melted the plating's reinforcements! It should be possible to pry it off.")) playsound(src, 'sound/items/Welder.ogg', 80, 1) - visible_message(SPAN_NOTICE("\The [user] has started melting the plating's reinforcements!")) - if(do_after(user, (C.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.isOn() && welder_melt()) - visible_message(SPAN_WARNING("\The [user] has melted the plating's reinforcements! It should be possible to pry it off.")) - playsound(src, 'sound/items/Welder.ogg', 80, 1) - return TRUE + return TRUE else if(istype(C, /obj/item/gun/energy/plasmacutter) && (is_plating()) && !broken && !burnt) var/obj/item/gun/energy/plasmacutter/cutter = C diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index c42e94e3f2001..fc62e0e27a4cc 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -153,7 +153,7 @@ if(locate(/obj/overlay/wallrot) in src) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1, user)) + if(!WT.can_use(1, user) && istype(W, /obj/item/weldingtool)) return TRUE WT.remove_fuel(1,user) @@ -172,7 +172,7 @@ if(thermite) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1, user)) + if(!WT.can_use(1, user) && istype(W, /obj/item/weldingtool)) return TRUE WT.remove_fuel(1, user) thermitemelt(user) diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index ebab8d4ca57f3..5a0aa58580abc 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -306,7 +306,7 @@ if (isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1,user)) + if(!WT.can_use(1,user) && istype(W, /obj/item/weldingtool)) return TRUE to_chat(user, SPAN_NOTICE("Now welding \the [src].")) @@ -315,7 +315,7 @@ if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) return TRUE - if(!src || !WT.remove_fuel(1, user)) + if(!src || (!WT.remove_fuel(1, user) && istype(W, /obj/item/weldingtool))) return TRUE welded = !welded diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index b551fe791ea4b..979507880fcc5 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -208,7 +208,7 @@ var/obj/item/weldingtool/WT = W - if(!WT.can_use(1,user)) + if(!WT.can_use(1,user) && istype(W, /obj/item/weldingtool)) return TRUE to_chat(user, SPAN_NOTICE("Now welding \the [src].")) @@ -217,7 +217,7 @@ if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) return TRUE - if(!src || !WT.remove_fuel(1, user)) + if(!src || (!WT.remove_fuel(1, user) && istype(W, /obj/item/weldingtool))) return TRUE welded = !welded diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 9650607935e5a..db53f691c20e4 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -223,7 +223,7 @@ return var/obj/item/weldingtool/WT = W - if(!WT.remove_fuel(5)) + if(!WT.remove_fuel(5) && istype(W, /obj/item/weldingtool)) return repair_breaches(DAMAGE_BRUTE, 3, user) diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index f1d96d7ddd9d0..e7baeea70bf33 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -166,7 +166,8 @@ if(reinf_material && reinf_material.stack_type && isWelder(W)) var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(2, user) && use(2)) + if(use(2)) + if(istype(W, /obj/item/weldingtool) && !WT.remove_fuel(2, user)) return to_chat(user,SPAN_NOTICE("You recover some [reinf_material.use_name] from \the [src].")) reinf_material.place_sheet(get_turf(user), 1) return TRUE diff --git a/code/modules/mechs/components/_components.dm b/code/modules/mechs/components/_components.dm index 46e21a94e2602..c99b054c564b8 100644 --- a/code/modules/mechs/components/_components.dm +++ b/code/modules/mechs/components/_components.dm @@ -129,25 +129,26 @@ /obj/item/mech_component/proc/update_components() return -/obj/item/mech_component/proc/repair_brute_generic(obj/item/weldingtool/WT, mob/user) - if(!istype(WT)) +/obj/item/mech_component/proc/repair_brute_generic(obj/item/W, mob/user) + var/obj/item/weldingtool/WT = W + if(!IsWelder(W)) return if(!brute_damage) to_chat(user, SPAN_NOTICE("You inspect \the [src] but find nothing to weld.")) return - if(!WT.isOn()) + if(istype(W, /obj/item/weldingtool) && !WT.isOn()) to_chat(user, SPAN_WARNING("Turn \the [WT] on, first.")) return - if(WT.can_use((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) - user.visible_message( - SPAN_NOTICE("\The [user] begins welding the damage on \the [src]..."), - SPAN_NOTICE("You begin welding the damage on \the [src]...") - ) - var/repair_value = 10 * max(user.get_skill_value(SKILL_CONSTRUCTION), user.get_skill_value(SKILL_DEVICES)) - if(user.do_skilled(1 SECOND, SKILL_DEVICES , src, 0.6) && brute_damage && WT.remove_fuel((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) - repair_brute_damage(repair_value) - to_chat(user, SPAN_NOTICE("You mend the damage to \the [src].")) - playsound(user.loc, 'sound/items/Welder.ogg', 25, 1) + if(istype(W, /obj/item/weldingtool) && !WT.can_use((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) return + user.visible_message( + SPAN_NOTICE("\The [user] begins welding the damage on \the [src]..."), + SPAN_NOTICE("You begin welding the damage on \the [src]...") + ) + var/repair_value = 10 * max(user.get_skill_value(SKILL_CONSTRUCTION), user.get_skill_value(SKILL_DEVICES)) + if(user.do_skilled(1 SECOND, SKILL_DEVICES , src, 0.6) && brute_damage && WT.remove_fuel((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) + repair_brute_damage(repair_value) + to_chat(user, SPAN_NOTICE("You mend the damage to \the [src].")) + playsound(user.loc, 'sound/items/Welder.ogg', 25, 1) /obj/item/mech_component/proc/repair_burn_generic(obj/item/stack/cable_coil/CC, mob/user) if(!istype(CC)) diff --git a/code/modules/mechs/components/frame.dm b/code/modules/mechs/components/frame.dm index 1c760653d82cf..cc2147a620bc0 100644 --- a/code/modules/mechs/components/frame.dm +++ b/code/modules/mechs/components/frame.dm @@ -250,7 +250,7 @@ USE_FEEDBACK_FAILURE("\The [src]'s reinforcements need to be secured before you can weld them.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to weld \the [src]'s internal reinforcements")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to weld \the [src]'s internal reinforcements")) return TRUE var/current_state = is_reinforced playsound(src, 'sound/items/Welder.ogg', 50, TRUE) @@ -270,7 +270,7 @@ if (current_state != is_reinforced) USE_FEEDBACK_FAILURE("\The [src]'s state has changed.") return TRUE - if (!welder.remove_fuel(1, user)) + if (istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1, user)) return TRUE is_reinforced = is_reinforced == FRAME_REINFORCED_WELDED ? FRAME_REINFORCED_SECURE : FRAME_REINFORCED_WELDED update_icon() diff --git a/code/modules/mechs/mech_wreckage.dm b/code/modules/mechs/mech_wreckage.dm index 650d9f64e34b8..beebac88492cf 100644 --- a/code/modules/mechs/mech_wreckage.dm +++ b/code/modules/mechs/mech_wreckage.dm @@ -60,7 +60,7 @@ return TRUE if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1, user)) return TRUE else if (istype(tool, /obj/item/gun/energy/plasmacutter)) var/obj/item/gun/energy/plasmacutter/plasmacutter = tool diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index e5cd3e03dfce4..f0ee618365c47 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -132,7 +132,7 @@ USE_FEEDBACK_FAILURE("\The [src]'s access panel must be open to repair it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(5, user, "to repair \the [src].")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(5, user, "to repair \the [src].")) return TRUE welder.remove_fuel(5, user) health = min(maxHealth, health + 10) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index b416caf8282ba..65fa8a0560a26 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -797,7 +797,7 @@ USE_FEEDBACK_FAILURE("\The [src] has no physical damage to repair.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to repair \the [src]'s physical damage.")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to repair \the [src]'s physical damage.")) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 3002f4171e5a6..b3878acf7a71a 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -169,7 +169,7 @@ if(isWelder(W)) var/obj/item/weldingtool/WT = W var/damage = get_damage_value() - if(!WT.can_use(round(damage/75), user)) + if(istype(W, /obj/item/weldingtool) && !WT.can_use(round(damage/75), user)) return if(!get_damage_value()) diff --git a/code/modules/overmap/contacts/contact_sensors.dm b/code/modules/overmap/contacts/contact_sensors.dm index c9019eb19433c..34cee51939136 100644 --- a/code/modules/overmap/contacts/contact_sensors.dm +++ b/code/modules/overmap/contacts/contact_sensors.dm @@ -216,11 +216,12 @@ if (!damage) to_chat(user, SPAN_WARNING("\The [src] doesn't need any repairs.")) return TRUE - if (!WT.can_use(1, user)) + if (istype(tool, /obj/item/weldingtool) && !WT.can_use(1, user)) return TRUE to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) playsound(src, 'sound/items/Welder.ogg', 100, 1) - if (do_after(user, max(5, damage / 5), src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) + if (do_after(user, max(5, damage / 5), src, DO_REPAIR_CONSTRUCT)) + if(istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) return to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) revive_health() return TRUE diff --git a/code/modules/persistence/graffiti.dm b/code/modules/persistence/graffiti.dm index 7c247b4a21432..b0de9186903b5 100644 --- a/code/modules/persistence/graffiti.dm +++ b/code/modules/persistence/graffiti.dm @@ -49,7 +49,7 @@ // Welding Torch - Remove decal if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to remove \the [src].")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to remove \the [src].")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6f6c6952c3647..97a961a32ceff 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -555,14 +555,14 @@ to_chat(user, SPAN_WARNING("The wire connection is in the way.")) return TRUE var/obj/item/weldingtool/WT = W - if (!WT.can_use(3, user)) + if (istype(W, /obj/item/weldingtool) && !WT.can_use(3, user)) return TRUE user.visible_message(SPAN_WARNING("\The [user] begins to weld \the [src]."), \ "You start welding the APC frame...", \ "You hear welding.") playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, (W.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT) && opened && has_electronics == 0 && !terminal()) - if(!WT.remove_fuel(3, user)) + if(istype(W, /obj/item/weldingtool) && !WT.remove_fuel(3, user)) return TRUE if (emagged || MACHINE_IS_BROKEN(src) || opened==2) new /obj/item/stack/material/steel(loc) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 283348f893548..d7f727f3e33f5 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -213,43 +213,45 @@ if (EMITTER_LOOSE) to_chat(user, SPAN_WARNING("\The [src] needs to be wrenched to the floor.")) if (EMITTER_WRENCHED) - if (WT.can_use(1, user)) - playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1, user)) + return TRUE + playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + user.visible_message( + SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), + SPAN_NOTICE("You start to weld \the [src] to the floor."), + SPAN_ITALIC("You hear welding.") + ) + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) + return TRUE + state = EMITTER_WELDED + playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( - SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), - SPAN_NOTICE("You start to weld \the [src] to the floor."), + SPAN_NOTICE("\The [user] welds \the [src] to the floor."), + SPAN_NOTICE("You weld the base of \the [src] to the floor, securing it in place."), SPAN_ITALIC("You hear welding.") ) - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (!WT.remove_fuel(1, user)) - return TRUE - state = EMITTER_WELDED - playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) - user.visible_message( - SPAN_NOTICE("\The [user] welds \the [src] to the floor."), - SPAN_NOTICE("You weld the base of \the [src] to the floor, securing it in place."), - SPAN_ITALIC("You hear welding.") - ) - connect_to_network() + connect_to_network() if (EMITTER_WELDED) - if (WT.can_use(1, user)) - playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1, user)) + return TRUE + playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + user.visible_message( + SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), + SPAN_NOTICE("You start to cut \the [src] free from the floor."), + SPAN_ITALIC("You hear welding.") + ) + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) + return TRUE + state = EMITTER_WRENCHED + playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( - SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), - SPAN_NOTICE("You start to cut \the [src] free from the floor."), + SPAN_NOTICE("\The [user] cuts \the [src] free from the floor."), + SPAN_NOTICE("You cut \the [src] free from the floor."), SPAN_ITALIC("You hear welding.") ) - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (!WT.remove_fuel(1, user)) - return TRUE - state = EMITTER_WRENCHED - playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) - user.visible_message( - SPAN_NOTICE("\The [user] cuts \the [src] free from the floor."), - SPAN_NOTICE("You cut \the [src] free from the floor."), - SPAN_ITALIC("You hear welding.") - ) - disconnect_from_network() + disconnect_from_network() return TRUE if (istype(W, /obj/item/card/id) || istype(W, /obj/item/modular_computer)) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 41d7c5223a950..2a63598f55d08 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -124,26 +124,28 @@ field_generator power level display to_chat(user, SPAN_WARNING("The [src.name] needs to be wrenched to the floor.")) return TRUE if(1) - if (WT.can_use(1,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) - user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ - "You start to weld the [src] to the floor.", \ - "You hear welding") - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !WT.remove_fuel(1, user)) return TRUE - state = 2 - to_chat(user, "You weld the field generator to the floor.") + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1,user)) + return TRUE + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ + "You start to weld the [src] to the floor.", \ + "You hear welding") + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!src || (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user))) return TRUE + state = 2 + to_chat(user, "You weld the field generator to the floor.") return TRUE if(2) - if (WT.can_use(1,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) - user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ - "You start to cut the [src] free from the floor.", \ - "You hear welding") - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !WT.remove_fuel(1, user)) return TRUE - state = 1 - to_chat(user, "You cut the [src] free from the floor.") + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1,user)) + return TRUE + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ + "You start to cut the [src] free from the floor.", \ + "You hear welding") + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!src || (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user))) return TRUE + state = 1 + to_chat(user, "You cut the [src] free from the floor.") return TRUE return ..() diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index a29b73f876c9b..c901e70bb8392 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -251,7 +251,7 @@ if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(5, user)) + if(istype(W, /obj/item/weldingtool) && !WT.can_use(5, user)) return TRUE if(!damage) to_chat(user, "\The [src] is already fully repaired.") diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 39ad646424aa1..b19a35495b34d 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -163,7 +163,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs to be anchored to the floor before you can weld it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to weld \the [src] down.")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to weld \the [src] down.")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index fd7ce6915d233..7ced320219f89 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -106,17 +106,18 @@ GLOBAL_LIST_EMPTY(diversion_junctions) to_chat(user, "Eject the items first!") return TRUE var/obj/item/weldingtool/W = I - if(W.can_use(1,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - to_chat(user, "You start slicing the floorweld off the disposal unit.") - - if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !W.remove_fuel(1, user)) return - to_chat(user, "You sliced the floorweld off the disposal unit.") - var/obj/structure/disposalconstruct/machine/C = new (loc, src) - src.transfer_fingerprints_to(C) - C.update() - qdel(src) + if(istype(I, /obj/item/weldingtool) && !W.can_use(1,user)) + return + playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) + to_chat(user, "You start slicing the floorweld off the disposal unit.") + + if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!src || (istype(I, /obj/item/weldingtool) && !W.remove_fuel(1, user))) return + to_chat(user, "You sliced the floorweld off the disposal unit.") + var/obj/structure/disposalconstruct/machine/C = new (loc, src) + src.transfer_fingerprints_to(C) + C.update() + qdel(src) return TRUE else to_chat(user, "You need more welding fuel to complete this task.") @@ -653,7 +654,7 @@ GLOBAL_LIST_EMPTY(diversion_junctions) USE_FEEDBACK_FAILURE("\The [src]'s power connection needs to be disconnected before you can remove \the [src] from the floor.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to slice \the [src]'s floorweld.")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to slice \the [src]'s floorweld.")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -661,7 +662,9 @@ GLOBAL_LIST_EMPTY(diversion_junctions) SPAN_NOTICE("You start slicing \the [src]'s floorweld with \the [tool]."), SPAN_ITALIC("You hear the sound of welding.") ) - if (!user.do_skilled((tool.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool) || !welder.remove_fuel(1, user)) + if (!user.do_skilled((tool.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool)) + return TRUE + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/recycling/disposalpipe.dm b/code/modules/recycling/disposalpipe.dm index 1b507a75b7846..a527963298720 100644 --- a/code/modules/recycling/disposalpipe.dm +++ b/code/modules/recycling/disposalpipe.dm @@ -228,14 +228,16 @@ // Welding Tool - Cut pipe if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to slice \the [src].")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to slice \the [src].")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( SPAN_NOTICE("\The [user] starts slicing \the [src] with \a [tool]."), SPAN_NOTICE("You start slicing \the [src] with \the [tool].") ) - if (!user.do_skilled((tool.toolspeed * 3) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool) || !welder.remove_fuel(1, user)) + if (!user.do_skilled((tool.toolspeed * 3) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool)) + return TRUE + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return TRUE welded() user.visible_message( diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index eb286cf4c8571..fc9173ae5c75e 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -606,20 +606,18 @@ return TRUE if (isWelder(I) && c_mode==1) var/obj/item/weldingtool/W = I - if(W.can_use(1,user)) - to_chat(user, "You start slicing the floorweld off the delivery chute.") - if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - if(!src || !W.remove_fuel(1, user)) return - to_chat(user, "You sliced the floorweld off the delivery chute.") - var/obj/structure/disposalconstruct/C = new (loc, src) - C.update() - qdel(src) - return TRUE - else + if(istype(W, /obj/item/weldingtool) && !W.can_use(1,user)) to_chat(user, "You need more welding fuel to complete this task.") return TRUE - + to_chat(user, "You start slicing the floorweld off the delivery chute.") + if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) + if(!src || !W.remove_fuel(1, user)) return + to_chat(user, "You sliced the floorweld off the delivery chute.") + var/obj/structure/disposalconstruct/C = new (loc, src) + C.update() + qdel(src) + return TRUE return ..() /obj/machinery/disposal/deliveryChute/Destroy() diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 6580ddc3a9f51..afc2d6e985f85 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -122,7 +122,7 @@ return FALSE if(isWelder(tool)) var/obj/item/weldingtool/welder = tool - if(!welder.remove_fuel(1,user)) + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return FALSE return (target_zone == BP_CHEST) && istype(target.back, /obj/item/rig) && !(target.back.canremove) diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index cb420de843231..5e08e82f55e62 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -215,7 +215,7 @@ return FALSE if(isWelder(tool)) var/obj/item/weldingtool/welder = tool - if(!welder.remove_fuel(1,user)) + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return FALSE if(istype(tool, /obj/item/gun/energy/plasmacutter)) var/obj/item/gun/energy/plasmacutter/cutter = tool diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 872d71bf06306..3695f649cde5f 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -154,14 +154,14 @@ USE_FEEDBACK_FAILURE("\The [src] isn't damaged.") return TRUE var/obj/item/weldingtool/welder = weapon - if (!welder.can_use(1, user, "to repair \the [src]")) + if (istype(weapon, /obj/item/weldingtool) && !welder.can_use(1, user, "to repair \the [src]")) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, TRUE) user.visible_message( SPAN_NOTICE("\The [user] starts repairing \the [src] with \a [weapon]."), SPAN_NOTICE("You start repairing \the [src] with \the [weapon].") ) - if (!user.do_skilled((weapon.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, weapon) || !welder.remove_fuel(1)) + if (!user.do_skilled((weapon.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, weapon) || (istype(weapon, /obj/item/weldingtool) && !welder.remove_fuel(1))) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, TRUE) restore_health(get_max_health() / 5) // 20% repair per application diff --git a/code/modules/xenoarcheaology/finds/finds.dm b/code/modules/xenoarcheaology/finds/finds.dm index cf3a3616e3be9..2089ea3424f4a 100644 --- a/code/modules/xenoarcheaology/finds/finds.dm +++ b/code/modules/xenoarcheaology/finds/finds.dm @@ -41,19 +41,20 @@ if(isWelder(I)) var/obj/item/weldingtool/W = I - if(W.can_use(2, user)) - var/obj/item/inside = locate() in src - if(inside) - inside.dropInto(loc) - visible_message(SPAN_INFO("\The [src] burns away revealing \the [inside].")) - else - visible_message(SPAN_INFO("\The [src] burns away into nothing.")) - qdel(src) - W.remove_fuel(2, user) + if(istype(I, /obj/item/weldingtool) && !W.can_use(2, user)) + return else if (W.can_use(1, user, silent = TRUE)) visible_message(SPAN_INFO("A few sparks fly off \the [src], but nothing else happens.")) W.remove_fuel(1) return + var/obj/item/inside = locate() in src + if(inside) + inside.dropInto(loc) + visible_message(SPAN_INFO("\The [src] burns away revealing \the [inside].")) + else + visible_message(SPAN_INFO("\The [src] burns away into nothing.")) + qdel(src) + W.remove_fuel(2, user) else if(istype(I, /obj/item/device/core_sampler)) var/obj/item/device/core_sampler/S = I diff --git a/maps/sierra/structures/other.dm b/maps/sierra/structures/other.dm index d78c4e9f0f0df..e085e8dcd98dd 100644 --- a/maps/sierra/structures/other.dm +++ b/maps/sierra/structures/other.dm @@ -25,16 +25,16 @@ /obj/item/target/use_tool(obj/item/tool, mob/living/user, list/click_params) if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (welder.remove_fuel(0, user)) - ClearOverlays() - bulletholes.Cut() - hp = initial(hp) - user.visible_message( - SPAN_NOTICE("[user] slices off uneven chunks of aluminium and scorch marks from [src]."), - SPAN_NOTICE("You slice off uneven chunks of aluminium and scorch marks from [src]."), - SPAN_NOTICE("You hear welding."), - ) - return TRUE + if (istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(0, user)) + return TRUE + ClearOverlays() + bulletholes.Cut() + hp = initial(hp) + user.visible_message( + SPAN_NOTICE("[user] slices off uneven chunks of aluminium and scorch marks from [src]."), + SPAN_NOTICE("You slice off uneven chunks of aluminium and scorch marks from [src]."), + SPAN_NOTICE("You hear welding."), + ) return ..() /obj/item/target/syndicate diff --git a/mods/_fd/hestia_missiles/code/missile.dm b/mods/_fd/hestia_missiles/code/missile.dm index 0c6c49360b581..eea72136e67d1 100644 --- a/mods/_fd/hestia_missiles/code/missile.dm +++ b/mods/_fd/hestia_missiles/code/missile.dm @@ -198,9 +198,10 @@ if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 20 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(istype(I, /obj/item/weldingtool) && !WT.remove_fuel(0, user)) + return + damage = 20 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) if(damage <= 2) return diff --git a/mods/_fd/hestia_missiles/code/missile_old.dm b/mods/_fd/hestia_missiles/code/missile_old.dm index e14adb3b6b08d..40cea76c353c3 100644 --- a/mods/_fd/hestia_missiles/code/missile_old.dm +++ b/mods/_fd/hestia_missiles/code/missile_old.dm @@ -67,9 +67,10 @@ if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 20 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(istype(I, /obj/item/weldingtool) && !WT.remove_fuel(0, user)) + return + damage = 20 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) if(damage <= 2) return diff --git a/mods/_fd/hestia_missiles/code/presets/breacher.dm b/mods/_fd/hestia_missiles/code/presets/breacher.dm index 7ec7f6c6f65d2..89b7cfa3252d4 100644 --- a/mods/_fd/hestia_missiles/code/presets/breacher.dm +++ b/mods/_fd/hestia_missiles/code/presets/breacher.dm @@ -85,9 +85,10 @@ if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 20 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(istype(I, /obj/item/weldingtool) && !WT.remove_fuel(0, user)) + return + damage = 20 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) if(damage <= 2) return diff --git a/mods/atmos_ret_field/code/atmospheric_retention_field.dm b/mods/atmos_ret_field/code/atmospheric_retention_field.dm index 8229214286399..bcd6c2c78516b 100644 --- a/mods/atmos_ret_field/code/atmospheric_retention_field.dm +++ b/mods/atmos_ret_field/code/atmospheric_retention_field.dm @@ -88,7 +88,7 @@ if(hatch_open && (isWelder(tool))) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(5, user)) + if (istype(tool, /obj/item/weldingtool) && !!welder.remove_fuel(5, user)) to_chat(user, SPAN_WARNING("You need more fuel to complete this task.")) return TRUE // uses up 5 fuel. @@ -96,7 +96,7 @@ playsound(loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1) if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !user || !welder.remove_fuel(5, user)) + if(!src || !user || (istype(I, /obj/item/weldingtool) && !welder.remove_fuel(5, user))) return TRUE to_chat(user, SPAN_NOTICE("You fully disassemble \the [src]. There were no salvageable parts.")) diff --git a/mods/machinery/code/gravity_generator/base.dm b/mods/machinery/code/gravity_generator/base.dm index 6c2b012d64d8e..42182b7d0f79d 100644 --- a/mods/machinery/code/gravity_generator/base.dm +++ b/mods/machinery/code/gravity_generator/base.dm @@ -208,7 +208,7 @@ playsound(loc, 'sound/items/Welder2.ogg', 50, 1) var/obj/item/weldingtool/WT = tool - if(!do_after(user, 15 SECONDS, middle) || !user.use_sanity_check(src, tool) || !WT.remove_fuel(1, user) || broken_state != GRAV_NEEDS_WELDING) + if(!do_after(user, 15 SECONDS, middle) || !user.use_sanity_check(src, tool) || (istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) || broken_state != GRAV_NEEDS_WELDING) return TRUE health += 250 diff --git a/packs/infinity/items/projectile/guns/energy/laser_handmade.dm b/packs/infinity/items/projectile/guns/energy/laser_handmade.dm index b6ccf0b8d5448..756308e3f27c5 100644 --- a/packs/infinity/items/projectile/guns/energy/laser_handmade.dm +++ b/packs/infinity/items/projectile/guns/energy/laser_handmade.dm @@ -186,8 +186,8 @@ if(13) if(isWelder(tool)) var/obj/item/weldingtool/T = tool - if(T.remove_fuel(0,user)) - if(!src || !T.isOn()) return TRUE + if(istype(tool, /obj/item/weldingtool) && !T.remove_fuel(0,user)) + if(!src || (istype(tool, /obj/item/weldingtool) && !T.isOn())) return TRUE playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) to_chat(user, SPAN_NOTICE("You weld the cables into places.")) buildstate++ diff --git a/packs/infinity/structures/barrier.dm b/packs/infinity/structures/barrier.dm index ee3f51f755029..3d1dda4bfe9a5 100644 --- a/packs/infinity/structures/barrier.dm +++ b/packs/infinity/structures/barrier.dm @@ -110,18 +110,19 @@ if(health == maxhealth) to_chat(user, SPAN_NOTICE("\The [src] is fully repaired.")) return TRUE - if(!WT.isOn()) + if(istype(tool, /obj/item/weldingtool) && !WT.isOn()) to_chat(user, SPAN_NOTICE("[tool] should be turned on firstly.")) return TRUE - if(WT.remove_fuel(0,user)) - visible_message(SPAN_WARNING("[user] is repairing \the [src]...")) - playsound(src, 'sound/items/Welder.ogg', 100, 1) - if(do_after(user, max(5, health / 5), src) && WT?.isOn()) - to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) - playsound(src, 'sound/items/Welder2.ogg', 100, 1) - health = maxhealth - else + if(istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(0,user)) to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task.")) + return TRUE + visible_message(SPAN_WARNING("[user] is repairing \the [src]...")) + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, max(5, health / 5), src) && WT?.isOn()) + to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) + playsound(src, 'sound/items/Welder2.ogg', 100, 1) + health = maxhealth + update_icon() return TRUE @@ -261,18 +262,17 @@ /obj/item/barrier/use_tool(obj/item/tool, mob/user, list/click_params) if(health != 200 && isWelder(tool)) var/obj/item/weldingtool/WT = tool - if(!WT.isOn()) + if(istype(tool, /obj/item/weldingtool) && !WT.isOn()) to_chat(user, SPAN_NOTICE("The [tool] should be turned on firstly.")) return TRUE - if(WT.remove_fuel(0,user)) - to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) - playsound(src, 'sound/items/Welder.ogg', 100, 1) - if(do_after(user, max(5, health / 5), src) && WT?.isOn()) - to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) - playsound(src, 'sound/items/Welder2.ogg', 100, 1) - health = 200 - return TRUE - else + if(istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(0,user)) to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task.")) return TRUE + to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, max(5, health / 5), src) && WT?.isOn()) + to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) + playsound(src, 'sound/items/Welder2.ogg', 100, 1) + health = 200 + return TRUE return ..()