diff --git a/code/game/machinery/_machines_base/machine_construction/frame.dm b/code/game/machinery/_machines_base/machine_construction/frame.dm index 437e7321c17ef..268b709d7194e 100644 --- a/code/game/machinery/_machines_base/machine_construction/frame.dm +++ b/code/game/machinery/_machines_base/machine_construction/frame.dm @@ -20,12 +20,11 @@ machine.anchored = TRUE if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(!WT.remove_fuel(0, user)) - to_chat(user, "The welding tool must be on to complete this task.") + if(!WT.can_use(3, user)) 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.isOn()) + if (!WT.remove_fuel(3, user)) return TRUE TRANSFER_STATE(/singleton/machine_construction/default/deconstructed) to_chat(user, SPAN_NOTICE("You deconstruct \the [machine].")) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index acb9b55bfcda4..a46fe46af7907 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -384,11 +384,11 @@ if(busy) return 0 - if(WT.remove_fuel(0, user)) + if(WT.can_use(1, user)) 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.isOn()) + 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 diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 2cd6b20c48fac..6134ca6841ce2 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -157,11 +157,11 @@ if(busy) return 0 - if(WT.remove_fuel(0, user)) + if(WT.can_use(1, user)) 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.isOn()) + 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 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 41b84a0ce57ee..1c37c8043cbe8 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -890,7 +890,7 @@ About the new airlock wires panel: if(isWelder(item)) var/obj/item/weldingtool/WT = item - if(!WT.remove_fuel(0,user)) + if(!WT.remove_fuel(3,user)) return 0 cut_verb = "cutting" cut_sound = 'sound/items/Welder.ogg' @@ -995,14 +995,13 @@ About the new airlock wires panel: if (!repairing && isWelder(C) && operating != DOOR_OPERATING_YES && density) var/obj/item/weldingtool/W = C - if(!W.remove_fuel(0,user)) - to_chat(user, SPAN_NOTICE("Your [W.name] doesn't have enough fuel.")) + if(!W.can_use(1, user)) return playsound(src, 'sound/items/Welder.ogg', 50, 1) user.visible_message(SPAN_WARNING("\The [user] begins welding \the [src] [welded ? "open" : "closed"]!"), SPAN_NOTICE("You begin welding \the [src] [welded ? "open" : "closed"].")) if(do_after(user, (rand(3,5)) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (density && operating != DOOR_OPERATING_YES && !repairing) + if (density && operating != DOOR_OPERATING_YES && !repairing && W.remove_fuel(1, user)) playsound(src, 'sound/items/Welder2.ogg', 50, 1) welded = !welded update_icon() diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm index db76fc1784afb..4eca72c9674f7 100644 --- a/code/game/machinery/doors/braces.dm +++ b/code/game/machinery/doors/braces.dm @@ -114,13 +114,13 @@ to_chat(user, SPAN_NOTICE("\The [src] does not require repairs.")) return TRUE var/obj/item/weldingtool/welder = item - if (welder.remove_fuel(1, user)) + if (welder.can_use(1, user)) 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)) + 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].") diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 65ccd01bb031b..4c4edbbb9df2d 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -236,10 +236,10 @@ return var/obj/item/weldingtool/welder = I - if(welder.remove_fuel(0,user)) + 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 && welder.isOn()) + if(do_after(user, (0.5 * repairing.amount) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.remove_fuel(2, user)) if (!repairing) return //the materials in the door have been removed before welding was finished. diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index d89a8e1b00d1a..e98d366df7e4c 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -199,7 +199,7 @@ if(isWelder(C) && !repairing) var/obj/item/weldingtool/W = C - if(W.remove_fuel(0, user)) + if(W.can_use(2, user)) 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]"]."), @@ -207,7 +207,7 @@ ) playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) if(do_after(user, (C.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!W.isOn()) + if(!W.remove_fuel(2, user)) return blocked = !blocked user.visible_message( diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 81939b750a7c6..5b29b7e5de572 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -44,13 +44,12 @@ var/global/list/floor_light_cache = list() visible_message(SPAN_NOTICE("\The [user] has [anchored ? "attached" : "detached"] \the [src].")) else if(isWelder(W) && (damaged || MACHINE_IS_BROKEN(src))) var/obj/item/weldingtool/WT = W - if(!WT.remove_fuel(0, user)) - to_chat(user, SPAN_WARNING("\The [src] must be on to complete this task.")) + if(!WT.can_use(1, user)) return playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) return - if(!src || !WT.isOn()) + if(!src || !WT.remove_fuel(1, user)) return visible_message(SPAN_NOTICE("\The [user] has repaired \the [src].")) set_broken(FALSE) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index e9bd6fe803a5f..65fa0effe1c54 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -86,13 +86,10 @@ var/global/bomb_set if(0) if(isWelder(O)) var/obj/item/weldingtool/WT = O - if(!WT.isOn()) return - if(WT.get_fuel() < 5) // uses up 5 fuel. - to_chat(user, SPAN_WARNING("You need more fuel to complete this task.")) + if(!WT.can_use(5, user)) return user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...") - if(do_after(user, (O.toolspeed * 4) SECONDS, src, DO_REPAIR_CONSTRUCT)) if(!src || !user || !WT.remove_fuel(5, user)) return user.visible_message("\The [user] cuts through the bolt covers on \the [src].", "You cut through the bolt cover.") @@ -112,13 +109,10 @@ var/global/bomb_set if(2) if(isWelder(O)) var/obj/item/weldingtool/WT = O - if(!WT.isOn()) return - if (WT.get_fuel() < 5) // uses up 5 fuel. - to_chat(user, SPAN_WARNING("You need more fuel to complete this task.")) + if(!WT.can_use(5, user)) return user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...") - if(do_after(user, (O.toolspeed * 4) SECONDS, src, DO_REPAIR_CONSTRUCT)) if(!src || !user || !WT.remove_fuel(5, user)) return user.visible_message("\The [user] cuts apart the anchoring system sealant on \the [src].", "You cut apart the anchoring system's sealant.") diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 38913dddf6f80..0b0aa3e78a897 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -692,10 +692,7 @@ var/global/list/turret_icons else if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(!WT.isOn()) - return - if(WT.get_fuel() < 5) //uses up 5 fuel. - to_chat(user, SPAN_NOTICE("You need more fuel to complete this task.")) + if(!WT.can_use(5, user)) return playsound(loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1) @@ -771,9 +768,8 @@ var/global/list/turret_icons if(7) if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(!WT.isOn()) return - if(WT.get_fuel() < 5) - to_chat(user, SPAN_NOTICE("You need more fuel to complete this task.")) + if(!WT.can_use(5, user)) + return playsound(loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1) if(do_after(user, (I.toolspeed * 3) SECONDS, src, DO_REPAIR_CONSTRUCT)) diff --git a/code/game/machinery/self_destruct.dm b/code/game/machinery/self_destruct.dm index 60136b6642775..0fcf2be6ae833 100644 --- a/code/game/machinery/self_destruct.dm +++ b/code/game/machinery/self_destruct.dm @@ -11,15 +11,15 @@ /obj/machinery/self_destruct/attackby(obj/item/W as obj, mob/user as mob) if(isWelder(W)) - if(damaged) - user.visible_message("[user] begins to repair [src].", "You begin repairing [src].") - if(do_after(usr, (W.toolspeed * 10) SECONDS, src, DO_REPAIR_CONSTRUCT)) - var/obj/item/weldingtool/w - if(w.burn_fuel(10)) - damaged = 0 - user.visible_message("[user] repairs [src].", "You repair [src].") - else - to_chat(user, SPAN_WARNING("There is not enough fuel to repair [src].")) + var/obj/item/weldingtool/WT = W + if(damaged && WT.can_use(5, user)) + user.visible_message( + SPAN_NOTICE("\The [user] begins to repair \the [src]."), + SPAN_NOTICE("You begin repairing [src].") + ) + if(do_after(usr, (W.toolspeed * 10) SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(10, user)) + damaged = 0 + user.visible_message("[user] repairs [src].", "You repair [src].") return if(istype(W, /obj/item/nuclear_cylinder)) if(damaged) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 7a8114c87a6bf..1349ceb1c8569 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -53,7 +53,7 @@ to_chat(user, SPAN_WARNING("You need at least two rods to do this.")) return TRUE - if(WT.remove_fuel(0,user)) + 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( diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 212b4503fac56..27cab3fbd64b3 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -50,7 +50,7 @@ /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(0, user)) + if(WT.remove_fuel(1, user)) material.place_sheet(get_turf(src)) qdel(src) return diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index bd42ba7540254..6c46316a95145 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -210,11 +210,11 @@ 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.remove_fuel(1,user)) + 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)) + 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) diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index 34d9ab419c2d2..2b16d0da8b6d7 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -134,7 +134,6 @@ return if(welding) - remove_fuel(1) var/turf/location = get_turf(user) if(isliving(O)) var/mob/living/L = O @@ -292,12 +291,11 @@ to_chat(user, SPAN_WARNING("\The [M]'s [S.name] is hard and brittle - \the [src] cannot repair it.")) return TRUE - if (!welding) - to_chat(user, SPAN_WARNING("You'll need to turn [src] on to patch the damage on [M]'s [S.name]!")) + if (!can_use(2, user, "to patch the damage on [M]'s [S.name]")) return TRUE if (S.robo_repair(15, DAMAGE_BRUTE, "some dents", src, user)) - remove_fuel(1, user) + remove_fuel(2, user) return TRUE else return FALSE diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 858237cefbb95..67d64603e8a71 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -160,9 +160,9 @@ return else if(isWelder(C)) var/obj/item/weldingtool/welder = C - if(welder.isOn() && (is_plating())) + if(welder.can_use(2, user) && (is_plating())) if(broken || burnt) - if(welder.remove_fuel(0, user)) + if(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" @@ -170,7 +170,7 @@ broken = null return else - if(welder.remove_fuel(0, user)) + if(welder.remove_fuel(2, user)) playsound(src, 'sound/items/Welder.ogg', 80, 1) visible_message(SPAN_NOTICE("[user] has started melting the plating's reinforcements!")) if(do_after(user, (C.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.isOn() && welder_melt()) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 863a33dd3d93c..0ab3e4789babb 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -178,7 +178,7 @@ if(locate(/obj/overlay/wallrot) in src) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if( WT.remove_fuel(0,user) ) + if( WT.remove_fuel(1,user) ) to_chat(user, SPAN_NOTICE("You burn away the fungi with \the [WT].")) playsound(src, 'sound/items/Welder.ogg', 10, 1) for(var/obj/overlay/wallrot/WR in src) @@ -193,7 +193,7 @@ if(thermite) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if( WT.remove_fuel(0,user) ) + if( WT.remove_fuel(1,user) ) thermitemelt(user) return @@ -219,10 +219,10 @@ var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(0,user)) + if(WT.can_use(2, 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, damage / 5), src, DO_REPAIR_CONSTRUCT) && WT && WT.isOn()) + if(do_after(user, max(5, damage / 5), src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(2, user)) to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) restore_health(damage) return @@ -237,7 +237,7 @@ if(istype(W,/obj/item/weldingtool)) var/obj/item/weldingtool/WT = W - if(!WT.remove_fuel(0,user)) + if(!WT.remove_fuel(1,user)) return dismantle_verb = "cutting" dismantle_sound = 'sound/items/Welder.ogg' @@ -322,7 +322,7 @@ var/strict_timer_flags = FALSE if(istype(W,/obj/item/weldingtool)) var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(0,user)) + if(WT.remove_fuel(1,user)) cut_cover=1 else return @@ -367,7 +367,7 @@ var/strict_timer_flags = FALSE if(istype(W, /obj/item/weldingtool)) var/obj/item/weldingtool/WT = W - if( WT.remove_fuel(0,user) ) + if(WT.remove_fuel(1,user)) cut_cover=1 else return diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index 90076c60affb3..c48f155e7150e 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -271,7 +271,7 @@ to_chat(user, SPAN_NOTICE("The welding tool needs to be on to start this task.")) return 1 - if(!WT.remove_fuel(0,user)) + if(!WT.can_use(1,user)) to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task.")) return 1 @@ -285,8 +285,7 @@ if(!src) return 1 - if(!WT.isOn()) - to_chat(user, SPAN_NOTICE("The welding tool needs to be on to finish this task.")) + if(!WT.remove_fuel(1, user)) return 1 welded = !welded diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index 00f128dbcc8de..796e6ee58457a 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -212,7 +212,7 @@ to_chat(user, SPAN_NOTICE("The welding tool needs to be on to start this task.")) return 1 - if(!WT.remove_fuel(0,user)) + if(!WT.can_use(1,user)) to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task.")) return 1 @@ -226,8 +226,7 @@ if(!src) return 1 - if(!WT.isOn()) - to_chat(user, SPAN_NOTICE("The welding tool needs to be on to finish this task.")) + if(!WT.remove_fuel(1, user)) return 1 welded = !welded diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index b6696cbf47155..9650607935e5a 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -224,7 +224,6 @@ var/obj/item/weldingtool/WT = W if(!WT.remove_fuel(5)) - to_chat(user, SPAN_WARNING("You need more welding fuel to repair this suit.")) return repair_breaches(DAMAGE_BRUTE, 3, user) diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index cc616e57dde05..f1d96d7ddd9d0 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -166,8 +166,7 @@ if(reinf_material && reinf_material.stack_type && isWelder(W)) var/obj/item/weldingtool/WT = W - if(WT.isOn() && WT.get_fuel() > 2 && use(2)) - WT.remove_fuel(2, user) + if(WT.remove_fuel(2, user) && use(2)) 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 81d4760ad1657..46e21a94e2602 100644 --- a/code/modules/mechs/components/_components.dm +++ b/code/modules/mechs/components/_components.dm @@ -138,13 +138,13 @@ if(!WT.isOn()) to_chat(user, SPAN_WARNING("Turn \the [WT] on, first.")) return - if(WT.remove_fuel((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) + 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) + 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) diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 6bd11a30c0c70..7df9d83a8c7a3 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -167,8 +167,8 @@ return if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.isOn()) - to_chat(user, "\The [W] is off.") + var/damage = get_damage_value() + if(!WT.can_use(round(damage/75), user)) return if(!get_damage_value()) @@ -176,8 +176,7 @@ return to_chat(user, "You begin repairing damage to \the [src]...") - var/damage = get_damage_value() - if(WT.remove_fuel(round(damage / 75)) && do_after(user, damage / 10, src, DO_REPAIR_CONSTRUCT)) + if(do_after(user, damage / 10, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(round(damage / 75))) revive_health() to_chat(user, "You repair \the [src].") return diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index 3d2368cf2249e..d916587c4ff5a 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -278,15 +278,11 @@ if (!damage) to_chat(user, SPAN_WARNING("\The [src] doesn't need any repairs.")) return TRUE - if (!WT.isOn()) - to_chat(user, SPAN_WARNING("\The [W] needs to be turned on first.")) - return TRUE - if (!WT.remove_fuel(0,user)) - to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task.")) + if (!WT.can_use(3,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?.isOn()) + if (do_after(user, max(5, damage / 5), src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(3, user)) to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) revive_health() return TRUE diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 3e9d5f799aca5..bd528c02e2d60 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -551,8 +551,7 @@ to_chat(user, SPAN_WARNING("The wire connection is in the way.")) return TRUE var/obj/item/weldingtool/WT = W - if (WT.get_fuel() < 3) - to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task.")) + if (WT.can_use(3, user)) return user.visible_message(SPAN_WARNING("\The [user] begins to weld \the [src]."), \ "You start welding the APC frame...", \ diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index b8e795f427a2c..ee574f3feedb3 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -224,7 +224,7 @@ if (EMITTER_LOOSE) to_chat(user, SPAN_WARNING("\The [src] needs to be wrenched to the floor.")) if (EMITTER_WRENCHED) - if (WT.remove_fuel(0, user)) + if (WT.can_use(1, user)) playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) user.visible_message( SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), @@ -232,7 +232,7 @@ SPAN_ITALIC("You hear welding.") ) if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (!WT.isOn()) + if (!WT.remove_fuel(1, user)) return state = EMITTER_WELDED playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) @@ -242,10 +242,8 @@ SPAN_ITALIC("You hear welding.") ) connect_to_network() - else - to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task.")) if (EMITTER_WELDED) - if (WT.remove_fuel(0, user)) + if (WT.can_use(1, user)) playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) user.visible_message( SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), @@ -253,7 +251,7 @@ SPAN_ITALIC("You hear welding.") ) if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (!WT.isOn()) + if (!WT.remove_fuel(1, user)) return state = EMITTER_WRENCHED playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) @@ -263,8 +261,6 @@ SPAN_ITALIC("You hear welding.") ) disconnect_from_network() - else - to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task.")) return 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 d1bb6585f8dfd..239807e6e510d 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -129,25 +129,25 @@ field_generator power level display to_chat(user, SPAN_WARNING("The [src.name] needs to be wrenched to the floor.")) return if(1) - if (WT.remove_fuel(0,user)) + 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.isOn()) return + if(!src || !WT.remove_fuel(1, user)) return state = 2 to_chat(user, "You weld the field generator to the floor.") else return if(2) - if (WT.remove_fuel(0,user)) + 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.isOn()) return + if(!src || !WT.remove_fuel(1, user)) return state = 1 to_chat(user, "You cut the [src] free from the floor.") else diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 9b075a2b0d99a..5a6612a11e76a 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -251,13 +251,12 @@ if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.isOn()) - to_chat(user, "Turn on \the [WT] first!") + if(!WT.can_use(5, user)) return TRUE if(!damage) to_chat(user, "\The [src] is already fully repaired.") return TRUE - if(WT.remove_fuel(0,user) && do_after(user, damage, src, DO_REPAIR_CONSTRUCT)) + if(do_after(user, damage, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(5 ,user)) to_chat(user, "You repair all structural damage to \the [src]") damage = 0 return TRUE diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 1ac6c6e767e6c..84e43a0058289 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -85,12 +85,12 @@ GLOBAL_LIST_EMPTY(diversion_junctions) to_chat(user, "Eject the items first!") return var/obj/item/weldingtool/W = I - if(W.remove_fuel(0,user)) + 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.isOn()) return + 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) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index a10c9d9fdb549..58bbf0057f266 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -506,11 +506,11 @@ return else if(isWelder(I) && c_mode==1) var/obj/item/weldingtool/W = I - if(W.remove_fuel(1,user)) + 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.isOn()) return + 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() diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 5ade8f013455c..6580ddc3a9f51 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.isOn() || !welder.remove_fuel(1,user)) + if(!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 8675be7bcc0e6..672c4427717ea 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.isOn() || !welder.remove_fuel(1,user)) + if(!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/xenoarcheaology/finds/finds.dm b/code/modules/xenoarcheaology/finds/finds.dm index 6bbbf3a6a8e56..cf3a3616e3be9 100644 --- a/code/modules/xenoarcheaology/finds/finds.dm +++ b/code/modules/xenoarcheaology/finds/finds.dm @@ -41,19 +41,18 @@ if(isWelder(I)) var/obj/item/weldingtool/W = I - if(W.isOn()) - if(W.get_fuel() >= 2) - 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) + 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("A few sparks fly off \the [src], but nothing else happens.")) - W.remove_fuel(1) + visible_message(SPAN_INFO("\The [src] burns away into nothing.")) + qdel(src) + W.remove_fuel(2, user) + 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 else if(istype(I, /obj/item/device/core_sampler))