diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index c5fe955523..04856958cc 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -92,7 +92,7 @@ return 1 /obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 75, 1) anchored = !anchored user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \ diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 686efa6508..364e7eda9f 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -279,7 +279,7 @@ add_fingerprint(usr) /obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if (unlocked) to_chat(user, "You cannot unwrench \the [src], turn it off first.") diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm index da5f37ff0c..6b0f40b8b4 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm @@ -82,7 +82,7 @@ add_overlay(image('icons/obj/pipeturbine.dmi', "hi-turb")) /obj/machinery/atmospherics/pipeturbine/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, W.usesound, 50, 1) to_chat(user, "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.") @@ -256,7 +256,7 @@ add_avail(power_generated) /obj/machinery/power/turbinemotor/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, W.usesound, 50, 1) turbine = null diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 514216e7fa..d979f9decf 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -239,7 +239,7 @@ Thus, the two variables affect pump operation are set in New(): update_icon() /obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if (!(stat & NOPOWER) && use_power) to_chat(user, "You cannot unwrench this [src], turn it off first.") diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index f0c5498fb3..77a35c8eae 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -80,7 +80,7 @@ update_icon() /obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if(!W.is_wrench()) + if(!W.has_tool_quality(TOOL_WRENCH)) return ..() if(!can_unwrench()) diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index 31f61ae55b..84b39b95c3 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -147,7 +147,7 @@ /obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if (connected_device) to_chat(user, "You cannot unwrench \the [src], dettach \the [connected_device] first.") diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index eaae718b2e..c548e956cc 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -52,7 +52,7 @@ update_icon() /obj/machinery/atmospherics/trinary/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if(!can_unwrench()) to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.") diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index acbf9f6ba2..5edf696696 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -327,7 +327,7 @@ go_to_side() /obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if(!can_unwrench()) to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.") diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index 91616f8d8f..ee759c897c 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -67,7 +67,7 @@ return 1 /obj/machinery/atmospherics/unary/heat_exchanger/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() var/turf/T = src.loc if (level==1 && isturf(T) && !T.is_plating()) diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm index b4991c0e5d..fa3c9073d8 100644 --- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm @@ -164,7 +164,7 @@ update_icon() /obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() playsound(src, W.usesound, 50, 1) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 4b8970fd94..31f1e33fc9 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -390,8 +390,8 @@ return /obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user) - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if (WT.remove_fuel(0,user)) to_chat(user, "Now welding the vent.") if(do_after(user, 20 * WT.toolspeed)) @@ -429,7 +429,7 @@ update_icon() /obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if (!(stat & NOPOWER) && use_power) to_chat(user, "You cannot unwrench \the [src], turn it off first.") diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index fe3e68130f..477ae9c552 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -270,7 +270,7 @@ update_icon() /obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if (!(stat & NOPOWER) && use_power) to_chat(user, "You cannot unwrench \the [src], turn it off first.") diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 9273b3b8d5..303e84b78c 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -288,7 +288,7 @@ open() /obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user)) to_chat(user, "Access denied.") diff --git a/code/ATMOSPHERICS/pipes/pipe_base.dm b/code/ATMOSPHERICS/pipes/pipe_base.dm index 0d687b8db0..d06b192a1a 100644 --- a/code/ATMOSPHERICS/pipes/pipe_base.dm +++ b/code/ATMOSPHERICS/pipes/pipe_base.dm @@ -116,7 +116,7 @@ if(istype(W,/obj/item/device/pipe_painter)) return 0 - if (!W.is_wrench()) + if (!W.has_tool_quality(TOOL_WRENCH)) return ..() var/turf/T = src.loc if (level==1 && isturf(T) && !T.is_plating()) diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index d68fd484bf..22c43fa574 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -278,6 +278,7 @@ var/global/list/##LIST_NAME = list();\ #define IS_CROWBAR "crowbar" #define IS_WIRECUTTER "wirecutter" #define IS_WRENCH "wrench" +#define IS_WELDER "welder" // Diagonal movement diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 6f06e3ca7d..4d1b90aada 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1044,7 +1044,7 @@ var/global/list/common_tools = list( /proc/is_wire_tool(obj/item/I) - if(istype(I, /obj/item/device/multitool) || I.is_wirecutter()) + if(istype(I, /obj/item/device/multitool) || I.has_tool_quality(TOOL_WIRECUTTER)) return TRUE if(istype(I, /obj/item/device/assembly/signaler)) return TRUE @@ -1058,6 +1058,12 @@ var/global/list/common_tools = list( return 3800 else return 0 + if(/obj/item/weapon/tool/transforming) + var/obj/item/weapon/tool/transforming/TT = W + if(TT.possible_tooltypes[TT.current_tooltype] == TOOL_WELDER) + return 3800 + else + return 0 if(/obj/item/weapon/flame/lighter) if(W:lit) return 1500 @@ -1105,7 +1111,7 @@ var/global/list/common_tools = list( if(W.sharp) return TRUE return ( \ - W.is_screwdriver() || \ + W.has_tool_quality(TOOL_SCREWDRIVER) || \ istype(W, /obj/item/weapon/pen) || \ istype(W, /obj/item/weapon/weldingtool) || \ istype(W, /obj/item/weapon/flame/lighter/zippo) || \ diff --git a/code/datums/components/crafting/tool_quality.dm b/code/datums/components/crafting/tool_quality.dm index 119469310a..5950cf72f4 100644 --- a/code/datums/components/crafting/tool_quality.dm +++ b/code/datums/components/crafting/tool_quality.dm @@ -27,3 +27,7 @@ /// DEPRECATED PROC: DO NOT USE IN NEW CODE /obj/item/proc/is_multitool() return has_tool_quality(TOOL_MULTITOOL) + +/// DEPRECATED PROC: DO NOT USE IN NEW CODE +/obj/item/proc/is_welder() + return has_tool_quality(TOOL_WELDER) diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm index e2d3dbdfd4..d60db6e25c 100644 --- a/code/datums/helper_datums/construction_datum.dm +++ b/code/datums/helper_datums/construction_datum.dm @@ -41,16 +41,19 @@ var/list/L = steps[steps.len] switch(L["key"]) if(IS_SCREWDRIVER) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) return steps.len if(IS_CROWBAR) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) return steps.len if(IS_WIRECUTTER) - if(I.is_wirecutter()) + if(I.has_tool_quality(TOOL_WIRECUTTER)) return steps.len if(IS_WRENCH) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) + return steps.len + if(IS_WELDER) + if(I.has_tool_quality(IS_WELDER)) return steps.len if(istype(I, L["key"])) @@ -108,30 +111,36 @@ switch(L["key"]) if(IS_SCREWDRIVER) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) return FORWARD if(IS_CROWBAR) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) return FORWARD if(IS_WIRECUTTER) - if(I.is_wirecutter()) + if(I.has_tool_quality(TOOL_WIRECUTTER)) return FORWARD if(IS_WRENCH) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) + return FORWARD + if(IS_WELDER) + if(I.has_tool_quality(IS_WELDER)) return FORWARD switch(L["backkey"]) if(IS_SCREWDRIVER) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) return BACKWARD if(IS_CROWBAR) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) return BACKWARD if(IS_WIRECUTTER) - if(I.is_wirecutter()) + if(I.has_tool_quality(TOOL_WIRECUTTER)) return BACKWARD if(IS_WRENCH) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) + return BACKWARD + if(IS_WELDER) + if(I.has_tool_quality(IS_WELDER)) return BACKWARD if(istype(I, L["key"])) diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 9a411c60ee..b366ac43a9 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -168,8 +168,8 @@ switch(action) // Toggles the cut/mend status. if("cut") - // if(!I.is_wirecutter() && !user.can_admin_interact()) - if(!istype(I) || !I.is_wirecutter()) + // if(!I.has_tool_quality(TOOL_WIRECUTTER) && !user.can_admin_interact()) + if(!istype(I) || !I.has_tool_quality(TOOL_WIRECUTTER)) to_chat(user, "You need wirecutters!") return @@ -179,8 +179,8 @@ // Pulse a wire. if("pulse") - // if(!I.is_multitool() && !user.can_admin_interact()) - if(!istype(I) || !I.is_multitool()) + // if(!I.has_tool_quality(TOOL_MULTITOOL) && !user.can_admin_interact()) + if(!istype(I) || !I.has_tool_quality(TOOL_MULTITOOL)) to_chat(user, "You need a multitool!") return diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index 20677bb0ff..b64f04d16f 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -34,7 +34,7 @@ to_chat(user, "You load [result] lengths of cable into [src].") return - if(O.is_wirecutter()) + if(O.has_tool_quality(TOOL_WIRECUTTER)) if(cable && cable.get_amount()) var/m = round(input(usr, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) as num, 1) m = min(m, cable.get_amount()) diff --git a/code/game/machinery/airconditioner_vr.dm b/code/game/machinery/airconditioner_vr.dm index 364d4bf377..60104c83c8 100644 --- a/code/game/machinery/airconditioner_vr.dm +++ b/code/game/machinery/airconditioner_vr.dm @@ -30,13 +30,13 @@ . += "There is a small display that reads \"[convert_k2c(target_temp)]C\"." /obj/machinery/power/thermoregulator/attackby(obj/item/I, mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(default_deconstruction_screwdriver(user,I)) return - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) if(default_deconstruction_crowbar(user,I)) return - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) anchored = !anchored visible_message("\The [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].") playsound(src, I.usesound, 75, 1) diff --git a/code/game/machinery/atm_ret_field.dm b/code/game/machinery/atm_ret_field.dm index 603e6615be..853550b9d4 100644 --- a/code/game/machinery/atm_ret_field.dm +++ b/code/game/machinery/atm_ret_field.dm @@ -41,11 +41,11 @@ field_type = /obj/structure/atmospheric_retention_field/impassable /obj/machinery/atmospheric_field_generator/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_crowbar() && isactive) + if(W.has_tool_quality(TOOL_CROWBAR) && isactive) if(!src) return to_chat(user, "You can't open the ARF-G whilst it's running!") return - if(W.is_crowbar() && !isactive) + if(W.has_tool_quality(TOOL_CROWBAR) && !isactive) if(!src) return to_chat(user, "You [hatch_open? "close" : "open"] \the [src]'s access hatch.") hatch_open = !hatch_open @@ -53,21 +53,21 @@ if(alwaysactive && wires_intact) generate_field() return - if(hatch_open && W.is_multitool()) + if(hatch_open && W.has_tool_quality(TOOL_MULTITOOL)) if(!src) return to_chat(user, "You toggle \the [src]'s activation behavior to [alwaysactive? "emergency" : "always-on"].") alwaysactive = !alwaysactive update_icon() return - if(hatch_open && W.is_wirecutter()) + if(hatch_open && W.has_tool_quality(TOOL_WIRECUTTER)) if(!src) return to_chat(user, "You [wires_intact? "cut" : "mend"] \the [src]'s wires!") wires_intact = !wires_intact update_icon() return - if(hatch_open && istype(W,/obj/item/weapon/weldingtool)) + if(hatch_open && W.has_tool_quality(TOOL_WELDER)) if(!src) return - var/obj/item/weapon/weldingtool/WT = W + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) return if(WT.get_fuel() < 5) // uses up 5 fuel. to_chat(user, "You need more fuel to complete this task.") diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index bb0858a79e..a7f8a40eeb 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -239,8 +239,8 @@ update_flag ..() /obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if(istype(W, /obj/item/weapon/weldingtool)) //Vorestart: Deconstructable Canisters - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) //Vorestart: Deconstructable Canisters + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.remove_fuel(0, user)) to_chat(user, "The welding tool must be on to complete this task.") return @@ -255,7 +255,7 @@ update_flag qdel(src) return //Voreend - if(!W.is_wrench() && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda)) + if(!W.has_tool_quality(TOOL_WRENCH) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda)) visible_message("\The [user] hits \the [src] with \a [W]!") src.health -= W.force src.add_fingerprint(user) diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 25f5e12567..c8b36e6138 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -105,7 +105,7 @@ return ..() /obj/machinery/meter/attackby(var/obj/item/W, var/mob/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") if(do_after(user, 40 * W.toolspeed)) diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index 6bdf71c525..a07d0054c3 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -117,7 +117,7 @@ update_icon() return - else if (W.is_wrench()) + else if (W.has_tool_quality(TOOL_WRENCH)) if(connected_port) disconnect() to_chat(user, "You disconnect \the [src] from the port.") @@ -173,7 +173,7 @@ power_change() return - if(I.is_screwdriver() && removeable_cell) + if(I.has_tool_quality(TOOL_SCREWDRIVER) && removeable_cell) if(!cell) to_chat(user, "There is no power cell installed.") return diff --git a/code/game/machinery/atmoalter/pump_vr.dm b/code/game/machinery/atmoalter/pump_vr.dm index 2c3b5c14d9..fb4acbe9f6 100644 --- a/code/game/machinery/atmoalter/pump_vr.dm +++ b/code/game/machinery/atmoalter/pump_vr.dm @@ -83,7 +83,7 @@ update_connected_network() /obj/machinery/portable_atmospherics/powered/pump/huge/attackby(var/obj/item/I, var/mob/user) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) if(on) to_chat(user, "Turn \the [src] off first!") return @@ -97,7 +97,7 @@ //doesn't use power cells if(istype(I, /obj/item/weapon/cell)) return - if (I.is_screwdriver()) + if (I.has_tool_quality(TOOL_SCREWDRIVER)) return //doesn't hold tanks @@ -111,7 +111,7 @@ name = "Stationary Air Pump" /obj/machinery/portable_atmospherics/powered/pump/huge/stationary/attackby(var/obj/item/I, var/mob/user) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) to_chat(user, "The bolts are too tight for you to unscrew!") return diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 7ab58e2c88..f27b8983e3 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -109,7 +109,7 @@ data["on"] = on ? 1 : 0 data["connected"] = connected_port ? 1 : 0 data["pressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) - + data["rate"] = round(volume_rate) data["minrate"] = round(minrate) data["maxrate"] = round(maxrate) @@ -201,7 +201,7 @@ update_use_power(new_use_power) if(!on) return - + var/power_draw = -1 var/datum/gas_mixture/environment = loc.return_air() @@ -218,7 +218,7 @@ update_connected_network() /obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I as obj, var/mob/user as mob) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) if(on) to_chat(user, "Turn \the [src] off first!") return @@ -232,7 +232,7 @@ //doesn't use power cells if(istype(I, /obj/item/weapon/cell)) return - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) return //doesn't hold tanks @@ -250,7 +250,7 @@ desc += "This one seems to be tightly secured with large bolts." /obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) to_chat(user, "The bolts are too tight for you to unscrew!") return diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 236f6d6837..e14d919569 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -125,7 +125,7 @@ if(panel_open) //Don't eat multitools or wirecutters used on an open lathe. - if(O.is_multitool() || O.is_wirecutter()) + if(O.has_tool_quality(TOOL_MULTITOOL) || O.has_tool_quality(TOOL_WIRECUTTER)) wires.Interact(user) return diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 85f23cb1db..796415d0f3 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -159,7 +159,7 @@ /obj/machinery/camera/attackby(obj/item/W as obj, mob/living/user as mob) update_coverage() // DECONSTRUCTION - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) //to_chat(user, "You start to [panel_open ? "close" : "open"] the camera's panel.") //if(toggle_panel(user)) // No delay because no one likes screwdrivers trying to be hip and have a duration cooldown panel_open = !panel_open @@ -167,10 +167,10 @@ "You screw the camera's panel [panel_open ? "open" : "closed"].") playsound(src, W.usesound, 50, 1) - else if((W.is_wirecutter() || istype(W, /obj/item/device/multitool)) && panel_open) + else if((W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/multitool)) && panel_open) interact(user) - else if(istype(W, /obj/item/weapon/weldingtool) && (wires.CanDeconstruct() || (stat & BROKEN))) + else if(W.has_tool_quality(TOOL_WELDER) && (wires.CanDeconstruct() || (stat & BROKEN))) if(weld(W, user)) if(assembly) assembly.loc = src.loc @@ -372,6 +372,7 @@ return null /obj/machinery/camera/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user) + WT = WT.get_welder() if(busy) return 0 diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index a73eb6fe91..6db595dad4 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -29,7 +29,7 @@ if(0) // State 0 - if(W.is_wrench() && isturf(src.loc)) + if(W.has_tool_quality(TOOL_WRENCH) && isturf(src.loc)) playsound(src, W.usesound, 50, 1) to_chat(user, "You wrench the assembly into place.") anchored = TRUE @@ -40,14 +40,14 @@ if(1) // State 1 - if(istype(W, /obj/item/weapon/weldingtool)) + if(W.has_tool_quality(TOOL_WELDER)) if(weld(W, user)) to_chat(user, "You weld the assembly securely into place.") anchored = TRUE state = 2 return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 50, 1) to_chat(user, "You unattach the assembly from its place.") anchored = FALSE @@ -66,7 +66,7 @@ to_chat(user, "You need 2 coils of wire to wire the assembly.") return - else if(istype(W, /obj/item/weapon/weldingtool)) + else if(W.has_tool_quality(TOOL_WELDER)) if(weld(W, user)) to_chat(user, "You unweld the assembly from its place.") @@ -77,7 +77,7 @@ if(3) // State 3 - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) var/input = sanitize(tgui_input_text(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT)) @@ -115,7 +115,7 @@ break return - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) new/obj/item/stack/cable_coil(get_turf(src), 2) playsound(src, W.usesound, 50, 1) @@ -132,7 +132,7 @@ return // Taking out upgrades - else if(W.is_crowbar() && upgrades.len) + else if(W.has_tool_quality(TOOL_CROWBAR) && upgrades.len) var/obj/U = locate(/obj) in upgrades if(U) to_chat(user, "You unattach an upgrade from the assembly.") @@ -154,6 +154,7 @@ ..() /obj/item/weapon/camera_assembly/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user) + WT = WT.get_welder() if(busy) return 0 diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 8439c9ff15..38ceea9f4b 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -74,7 +74,7 @@ user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].") chargelevel = -1 update_icon() - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(charging) to_chat(user, "Remove [charging] first!") return diff --git a/code/game/machinery/clawmachine.dm b/code/game/machinery/clawmachine.dm index 1896d37b97..08af125e20 100644 --- a/code/game/machinery/clawmachine.dm +++ b/code/game/machinery/clawmachine.dm @@ -100,7 +100,7 @@ if(busy) to_chat(user,"The claw machine is currently running. ") return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 49c917f312..4f5a37f68d 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -250,7 +250,7 @@ user.drop_item() W.forceMove(src) return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(locked && (anchored || occupant)) to_chat(user, "Can not do that while [src] is in use.") else diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index a399fc7ef6..15b04580f8 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -15,14 +15,14 @@ switch(state) if(0) - if(P.is_wrench()) + if(P.has_tool_quality(TOOL_WRENCH)) playsound(src, P.usesound, 50, 1) if(do_after(user, 20 * P.toolspeed)) to_chat(user, "You wrench the frame into place.") anchored = TRUE state = 1 - if(istype(P, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = P + if(P.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = P.get_welder() if(!WT.isOn()) to_chat(user, "The welder must be on for this task.") return @@ -33,7 +33,7 @@ new /obj/item/stack/material/plasteel( loc, 4) qdel(src) if(1) - if(P.is_wrench()) + if(P.has_tool_quality(TOOL_WRENCH)) playsound(src, P.usesound, 50, 1) if(do_after(user, 20 * P.toolspeed)) to_chat(user, "You unfasten the frame.") @@ -46,12 +46,12 @@ circuit = P user.drop_item() P.loc = src - if(P.is_screwdriver() && circuit) + if(P.has_tool_quality(TOOL_SCREWDRIVER) && circuit) playsound(src, P.usesound, 50, 1) to_chat(user, "You screw the circuit board into place.") state = 2 icon_state = "2" - if(P.is_crowbar() && circuit) + if(P.has_tool_quality(TOOL_CROWBAR) && circuit) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the circuit board.") state = 1 @@ -59,7 +59,7 @@ circuit.loc = loc circuit = null if(2) - if(P.is_screwdriver() && circuit) + if(P.has_tool_quality(TOOL_SCREWDRIVER) && circuit) playsound(src, P.usesound, 50, 1) to_chat(user, "You unfasten the circuit board.") state = 1 @@ -78,7 +78,7 @@ to_chat(user, "You add cables to the frame.") return if(3) - if(P.is_wirecutter()) + if(P.has_tool_quality(TOOL_WIRECUTTER)) if (brain) to_chat(user, "Get that brain out of there first") else @@ -145,7 +145,7 @@ to_chat(usr, "Added [P].") icon_state = "3b" - if(P.is_crowbar() && brain) + if(P.has_tool_quality(TOOL_CROWBAR) && brain) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the brain.") brain.loc = loc @@ -153,7 +153,7 @@ icon_state = "3" if(4) - if(P.is_crowbar()) + if(P.has_tool_quality(TOOL_CROWBAR)) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the glass panel.") state = 3 @@ -164,7 +164,7 @@ new /obj/item/stack/material/glass/reinforced( loc, 2 ) return - if(P.is_screwdriver()) + if(P.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, P.usesound, 50, 1) to_chat(user, "You connect the monitor.") if(!brain) @@ -232,7 +232,7 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva else to_chat(user, "ERROR: Unable to locate artificial intelligence.") return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(anchored) user.visible_message("\The [user] starts to unbolt \the [src] from the plating...") playsound(src, W.usesound, 50, 1) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 3ec9e2c841..923dd620a2 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -6,7 +6,7 @@ icon_keyboard = "tech_key" icon_screen = "ai-fixer" light_color = LIGHT_COLOR_PINK - + active_power_usage = 1000 /// Variable containing transferred AI @@ -15,7 +15,7 @@ var/restoring = FALSE /obj/machinery/computer/aifixer/attackby(obj/item/I, mob/living/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(occupier) if(stat & (NOPOWER|BROKEN)) to_chat(user, "The screws on [name]'s screen won't budge.") @@ -85,10 +85,10 @@ return TRUE if(!occupier) restoring = FALSE - + if(action) playsound(src, "terminal_type", 50, 1) - + switch(action) if("PRG_beginReconstruction") if(occupier?.health < 100) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 5f4ff28e05..33d8ae2e86 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -13,14 +13,14 @@ /obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob) switch(state) if(0) - if(P.is_wrench()) + if(P.has_tool_quality(TOOL_WRENCH)) playsound(src, P.usesound, 50, 1) if(do_after(user, 20 * P.toolspeed)) to_chat(user, "You wrench the frame into place.") src.anchored = TRUE src.state = 1 - if(istype(P, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = P + if(P.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = P.get_welder() if(!WT.remove_fuel(0, user)) to_chat(user, "The welding tool must be on to complete this task.") return @@ -31,7 +31,7 @@ new /obj/item/stack/material/steel( src.loc, 5 ) qdel(src) if(1) - if(P.is_wrench()) + if(P.has_tool_quality(TOOL_WRENCH)) playsound(src, P.usesound, 50, 1) if(do_after(user, 20 * P.toolspeed)) to_chat(user, "You unfasten the frame.") @@ -48,12 +48,12 @@ P.loc = src else to_chat(user, "This frame does not accept circuit boards of this type!") - if(P.is_screwdriver() && circuit) + if(P.has_tool_quality(TOOL_SCREWDRIVER) && circuit) playsound(src, P.usesound, 50, 1) to_chat(user, "You screw the circuit board into place.") src.state = 2 src.icon_state = "2" - if(P.is_crowbar()) && circuit) + if(P.has_tool_quality(TOOL_CROWBAR)) && circuit) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the circuit board.") src.state = 1 @@ -61,7 +61,7 @@ circuit.loc = src.loc src.circuit = null if(2) - if(P.is_screwdriver() && circuit) + if(P.has_tool_quality(TOOL_SCREWDRIVER) && circuit) playsound(src, P.usesound, 50, 1) to_chat(user, "You unfasten the circuit board.") src.state = 1 @@ -79,7 +79,7 @@ state = 3 icon_state = "3" if(3) - if(P.is_wirecutter()) + if(P.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the cables.") src.state = 2 @@ -100,13 +100,13 @@ src.state = 4 src.icon_state = "4" if(4) - if(P.is_crowbar()) + if(P.has_tool_quality(TOOL_CROWBAR)) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the glass panel.") src.state = 3 src.icon_state = "3" new /obj/item/stack/material/glass( src.loc, 2 ) - if(P.is_screwdriver()) + if(P.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, P.usesound, 50, 1) to_chat(user, "You connect the monitor.") var/B = new src.circuit.build_path ( src.loc ) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 27009d097b..a5dad720ec 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -34,7 +34,7 @@ return if(!istype(user)) return - if(O.is_screwdriver() && emag) + if(O.has_tool_quality(TOOL_SCREWDRIVER) && emag) //Stops people from just unscrewing the monitor and putting it back to get the console working again. to_chat(user, "It is too hot to mess with!") return @@ -101,7 +101,7 @@ if(linkedServer && auth) data["linkedServer"]["active"] = linkedServer.active data["linkedServer"]["broke"] = linkedServer.stat & (NOPOWER|BROKEN) - + var/list/pda_msgs = list() for(var/datum/data_pda_msg/pda in linkedServer.pda_msgs) pda_msgs.Add(list(list( @@ -111,7 +111,7 @@ "message" = pda.message, ))) data["linkedServer"]["pda_msgs"] = pda_msgs - + var/list/rc_msgs = list() for(var/datum/data_rc_msg/rc in linkedServer.rc_msgs) rc_msgs.Add(list(list( @@ -182,7 +182,7 @@ /obj/machinery/computer/message_monitor/tgui_act(action, params) if(..()) return TRUE - + switch(action) if("cleartemp") temp = null @@ -218,14 +218,14 @@ spawn(100*length(linkedServer.decryptkey)) if(src && linkedServer && usr) BruteForce(usr) - + if(!auth) return - + if(!linkedServer || linkedServer.stat & (NOPOWER|BROKEN)) temp = noserver return TRUE - + switch(action) //Turn the server on/off. if("active") @@ -277,7 +277,7 @@ var/obj/item/device/pda/P = locate(ref) if(!istype(P) || !P.owner || P.hidden) return FALSE - + var/datum/data/pda/app/messenger/M = P.find_program(/datum/data/pda/app/messenger) if(!M || M.toff) return FALSE @@ -316,7 +316,7 @@ //Sender is faking as someone who exists else linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]") - + var/datum/data/pda/app/messenger/M = customrecepient.find_program(/datum/data/pda/app/messenger) if(M) M.receive_message(list("sent" = 0, "owner" = "[PDARec.owner]", "job" = "[customjob]", "message" = "[custommessage]", "target" = "\ref[PDARec]"), "\ref[PDARec]") diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index f37f0f6c97..c074256475 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -50,7 +50,7 @@ /* /obj/machinery/computer/pod/attackby(I as obj, user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) if(do_after(user, 20)) if(stat & BROKEN) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 6a61f01502..bf6d5080d7 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -41,7 +41,7 @@ state = 2 icon_state = "box_1" else - if(P.is_wrench()) + if(P.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 75, 1) to_chat(user, "You dismantle the frame") new /obj/item/stack/material/steel(src.loc, 5) @@ -76,7 +76,7 @@ else to_chat(user, "This frame does not accept circuit boards of this type!") else - if(P.is_wirecutter()) + if(P.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, P.usesound, 50, 1) to_chat(user, "You remove the cables.") state = 1 @@ -85,7 +85,7 @@ A.amount = 5 if(3) - if(P.is_crowbar()) + if(P.has_tool_quality(TOOL_CROWBAR)) playsound(src, P.usesound, 50, 1) state = 2 circuit.loc = src.loc @@ -101,7 +101,7 @@ components = null icon_state = "box_1" else - if(P.is_screwdriver()) + if(P.has_tool_quality(TOOL_SCREWDRIVER)) var/component_check = 1 for(var/R in req_components) if(req_components[R] > 0) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index a72d814c79..63beb67797 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -47,7 +47,7 @@ Deployable items visible_message("BZZzZZzZZzZT") return return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(health < maxhealth) health = maxhealth emagged = 0 diff --git a/code/game/machinery/doorbell_vr.dm b/code/game/machinery/doorbell_vr.dm index 906c41ea6d..fbcc58b79e 100644 --- a/code/game/machinery/doorbell_vr.dm +++ b/code/game/machinery/doorbell_vr.dm @@ -136,7 +136,7 @@ var/obj/item/device/multitool/M = W M.connectable = src to_chat(user, "You save the data in \the [M]'s buffer.") - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) to_chat(user, "You start to unwrench \the [src].") playsound(src, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 15) && !QDELETED(src)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index b155462d70..a177ad3a89 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1141,8 +1141,8 @@ About the new airlock wires panel: if(istype(C, /mob/living)) ..() return - if(!repairing && istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density) - var/obj/item/weapon/weldingtool/W = C + if(!repairing && C.has_tool_quality(TOOL_WELDER) && !( src.operating > 0 ) && src.density) + var/obj/item/weapon/weldingtool/W = C.get_welder() if(W.remove_fuel(0,user)) if(!src.welded) src.welded = 1 @@ -1153,7 +1153,7 @@ About the new airlock wires panel: return else return - else if(C.is_screwdriver()) + else if(C.has_tool_quality(TOOL_SCREWDRIVER)) if (src.p_open) if (stat & BROKEN) to_chat(usr, "The panel is broken and cannot be closed.") @@ -1167,7 +1167,7 @@ About the new airlock wires panel: playsound(src, C.usesound, 50, 1) src.update_icon() return src.attack_hand(user) - else if(C.is_wirecutter()) + else if(C.has_tool_quality(TOOL_WIRECUTTER)) return src.attack_hand(user) else if(istype(C, /obj/item/device/multitool)) return src.attack_hand(user) @@ -1176,7 +1176,7 @@ About the new airlock wires panel: else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE var/obj/item/weapon/pai_cable/cable = C cable.plugin(src, user) - else if(!repairing && C.is_crowbar()) + else if(!repairing && C.has_tool_quality(TOOL_CROWBAR)) if(can_remove_electronics()) playsound(src, C.usesound, 75, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index fa31ef365f..2e31ea43f6 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -259,12 +259,12 @@ return - if(repairing && istype(I, /obj/item/weapon/weldingtool)) + if(repairing && I.has_tool_quality(TOOL_WELDER)) if(!density) to_chat(user, "\The [src] must be closed before you can repair it.") return - var/obj/item/weapon/weldingtool/welder = I + var/obj/item/weapon/weldingtool/welder = I.get_welder() if(welder.remove_fuel(0,user)) to_chat(user, "You start to fix dents and weld \the [get_material_name()] into place.") playsound(src, welder.usesound, 50, 1) @@ -275,7 +275,7 @@ repairing = 0 return - if(repairing && I.is_crowbar()) + if(repairing && I.has_tool_quality(TOOL_CROWBAR)) var/datum/material/mat = get_material() var/obj/item/stack/material/repairing_sheet = mat.place_sheet(loc, repairing) repairing = 0 diff --git a/code/game/machinery/doors/door_vr.dm b/code/game/machinery/doors/door_vr.dm index 1a504065cc..7a2ba190cd 100644 --- a/code/game/machinery/doors/door_vr.dm +++ b/code/game/machinery/doors/door_vr.dm @@ -69,7 +69,7 @@ return TRUE - if(reinforcing && istype(I, /obj/item/weapon/weldingtool)) + if(reinforcing && I.has_tool_quality(TOOL_WELDER)) if(!density) to_chat(user, "\The [src] must be closed before you can reinforce it.") return TRUE @@ -78,7 +78,7 @@ to_chat(user, "You will need more plasteel to reinforce \the [src].") return TRUE - var/obj/item/weapon/weldingtool/welder = I + var/obj/item/weapon/weldingtool/welder = I.get_welder() if(welder.remove_fuel(0,user)) to_chat(user, "You start weld \the plasteel into place.") playsound(src, welder.usesound, 50, 1) @@ -89,7 +89,7 @@ reinforcing = 0 return TRUE - if(reinforcing && I.is_crowbar()) + if(reinforcing && I.has_tool_quality(TOOL_CROWBAR)) var/obj/item/stack/material/plasteel/reinforcing_sheet = new /obj/item/stack/material/plasteel(src.loc, reinforcing) reinforcing = 0 to_chat(user, "You remove \the [reinforcing_sheet].") diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 96609e02a5..b8780d1e5e 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -57,7 +57,7 @@ if(F != src) log_debug("Duplicate firedoors at [x],[y],[z]") return INITIALIZE_HINT_QDEL - + var/area/A = get_area(src) ASSERT(istype(A)) @@ -80,7 +80,7 @@ /obj/machinery/door/firedoor/examine(mob/user) . = ..() - + if(!Adjacent(user)) return . @@ -249,10 +249,10 @@ return //Don't open the door if we're putting tape on it to tell people 'don't open the door'. if(operating) return//Already doing something. - if(istype(C, /obj/item/weapon/weldingtool) && !repairing) + if(C.has_tool_quality(TOOL_WELDER) && !repairing) if(prying) to_chat(user, "Someone's busy prying that [density ? "open" : "closed"]!") - var/obj/item/weapon/weldingtool/W = C + var/obj/item/weapon/weldingtool/W = C.get_welder() if(W.remove_fuel(0, user)) blocked = !blocked user.visible_message("\The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [W].",\ @@ -262,7 +262,7 @@ update_icon() return - if(density && C.is_screwdriver()) + if(density && C.has_tool_quality(TOOL_SCREWDRIVER)) hatch_open = !hatch_open playsound(src, C.usesound, 50, 1) user.visible_message("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance hatch.", @@ -270,7 +270,7 @@ update_icon() return - if(blocked && C.is_crowbar() && !repairing) + if(blocked && C.has_tool_quality(TOOL_CROWBAR) && !repairing) if(!hatch_open) to_chat(user, "You must open the maintenance hatch first!") else @@ -304,7 +304,7 @@ if(operating) return - if(blocked && C.is_crowbar()) + if(blocked && C.has_tool_quality(TOOL_CROWBAR)) user.visible_message("\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\ "You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\ "You hear someone struggle and metal straining.") @@ -326,7 +326,7 @@ update_icon() playsound(src, C.usesound, 100, 1) if(do_after(user,30 * C.toolspeed)) - if(C.is_crowbar()) + if(C.has_tool_quality(TOOL_CROWBAR)) if(stat & (BROKEN|NOPOWER) || !density) user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\ "You force \the [src] [density ? "open" : "closed"] with \the [C]!",\ diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm index 829cce4e7c..e6c37c7e51 100644 --- a/code/game/machinery/doors/firedoor_assembly.dm +++ b/code/game/machinery/doors/firedoor_assembly.dm @@ -31,7 +31,7 @@ wired = 1 to_chat(user, "You wire \the [src].") - else if(C.is_wirecutter() && wired ) + else if(C.has_tool_quality(TOOL_WIRECUTTER) && wired ) playsound(src, C.usesound, 100, 1) user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].") @@ -54,14 +54,14 @@ qdel(src) else to_chat(user, "You must secure \the [src] first!") - else if(C.is_wrench()) + else if(C.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, C.usesound, 50, 1) user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!", "You have [anchored ? "" : "un" ]secured \the [src]!") update_icon() - else if((glass || !anchored) && istype(C, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = C + else if((glass || !anchored) && C.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = C.get_welder() if(WT.remove_fuel(0, user)) playsound(src, WT.usesound, 50, 1) if(glass) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 822e950d63..8175800373 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -189,8 +189,8 @@ if(istype(I)) // Fixing. - if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP) - var/obj/item/weapon/weldingtool/WT = I + if(I.has_tool_quality(TOOL_WELDER) && user.a_intent == I_HELP) + var/obj/item/weapon/weldingtool/WT = I.get_welder() if(health < maxhealth) if(WT.remove_fuel(1 ,user)) to_chat(user, "You begin repairing [src]...") @@ -215,7 +215,7 @@ return 1 //If it's opened/emagged, crowbar can pry it out of its frame. - if (!density && I.is_crowbar()) + if (!density && I.has_tool_quality(TOOL_CROWBAR)) playsound(src, I.usesound, 50, 1) user.visible_message("[user] begins prying the windoor out of the frame.", "You start to pry the windoor out of the frame.") if (do_after(user,40 * I.toolspeed)) diff --git a/code/game/machinery/exonet_node.dm b/code/game/machinery/exonet_node.dm index 1eda308142..a3eb739983 100644 --- a/code/game/machinery/exonet_node.dm +++ b/code/game/machinery/exonet_node.dm @@ -78,9 +78,9 @@ // Parameters: 2 (I - the item being whacked against the machine, user - the person doing the whacking) // Description: Handles deconstruction. /obj/machinery/exonet_node/attackby(obj/item/I, mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) default_deconstruction_screwdriver(user, I) - else if(I.is_crowbar()) + else if(I.has_tool_quality(TOOL_CROWBAR)) default_deconstruction_crowbar(user, I) else ..() diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 848108285b..6668d1cf39 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -35,7 +35,7 @@ //Don't want to render prison breaks impossible /obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) add_fingerprint(user) disable = !disable if(disable) @@ -107,7 +107,7 @@ flash() /obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) add_fingerprint(user) anchored = !anchored @@ -115,7 +115,7 @@ user.show_message(text("[src] can now be moved.")) cut_overlays() unsense_proximity(callback = /atom/proc/HasProximity) - + else if(anchored) user.show_message(text("[src] is now secured.")) add_overlay("[base_state]-s") diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index a5cc7d6750..3c4b3a7a13 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -102,7 +102,7 @@ update_icon() /obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(!open) if(unlocked) unlocked = 0 @@ -111,7 +111,7 @@ unlocked = 1 to_chat(user, "You unscrew the battery panel.") - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if(unlocked) if(open) open = 0 diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index a870245be9..1722510df0 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -23,11 +23,11 @@ var/list/floor_light_cache = list() anchored = TRUE /obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) anchored = !anchored visible_message("\The [user] has [anchored ? "attached" : "detached"] \the [src].") - else if(istype(W, /obj/item/weapon/weldingtool) && (damaged || (stat & BROKEN))) - var/obj/item/weapon/weldingtool/WT = W + else if(W.has_tool_quality(TOOL_WELDER) && (damaged || (stat & BROKEN))) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.remove_fuel(0, user)) to_chat(user, "\The [src] must be on to complete this task.") return diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index dfbf3c38df..38da6b057f 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -34,7 +34,7 @@ return /obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) var/m = tgui_input_list(usr, "Choose work mode", "Mode", mode) mode[m] = !mode[m] var/O = mode[m] @@ -47,7 +47,7 @@ TakeTile(T) return - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if(!length(contents)) to_chat(user, "\The [src] is empty.") else @@ -58,7 +58,7 @@ T = null return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) T = tgui_input_list(usr, "Choose tile type.", "Tiles", contents) return ..() diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index 43fd737eaf..3b6caffcf9 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -300,7 +300,7 @@ update_icon() /obj/structure/frame/attackby(obj/item/P as obj, mob/user as mob) - if(P.is_wrench()) + if(P.has_tool_quality(TOOL_WRENCH)) if(state == FRAME_PLACED && !anchored) to_chat(user, "You start to wrench the frame into place.") playsound(src, P.usesound, 50, 1) @@ -320,9 +320,9 @@ to_chat(user, "You unfasten the frame.") anchored = FALSE - else if(istype(P, /obj/item/weapon/weldingtool)) + else if(P.has_tool_quality(TOOL_WELDER)) if(state == FRAME_PLACED) - var/obj/item/weapon/weldingtool/WT = P + var/obj/item/weapon/weldingtool/WT = P.get_welder() if(WT.remove_fuel(0, user)) playsound(src, P.usesound, 50, 1) if(do_after(user, 20 * P.toolspeed)) @@ -353,7 +353,7 @@ to_chat(user, "This frame does not accept circuit boards of this type!") return - else if(P.is_screwdriver()) + else if(P.has_tool_quality(TOOL_SCREWDRIVER)) if(state == FRAME_UNFASTENED) if(need_circuit && circuit) playsound(src, P.usesound, 50, 1) @@ -448,7 +448,7 @@ qdel(src) return - else if(P.is_crowbar()) + else if(P.has_tool_quality(TOOL_CROWBAR)) if(state == FRAME_UNFASTENED) if(need_circuit && circuit) playsound(src, P.usesound, 50, 1) @@ -525,7 +525,7 @@ break to_chat(user, desc) - else if(P.is_wirecutter()) + else if(P.has_tool_quality(TOOL_WIRECUTTER)) if(state == FRAME_WIRED) if( \ frame_type.frame_class == FRAME_CLASS_COMPUTER || \ diff --git a/code/game/machinery/holoposter.dm b/code/game/machinery/holoposter.dm index a5174380d2..9b32fbb371 100644 --- a/code/game/machinery/holoposter.dm +++ b/code/game/machinery/holoposter.dm @@ -83,7 +83,7 @@ GLOBAL_LIST_EMPTY(holoposters) src.add_fingerprint(user) if(stat & (NOPOWER)) return - if (W.is_multitool()) + if (W.has_tool_quality(TOOL_MULTITOOL)) playsound(src, 'sound/items/penclick.ogg', 60, 1) icon_state = tgui_input_list(usr, "Available Posters", "Holographic Poster", postertypes + "random") if(!Adjacent(user)) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 060bd029fc..52b313497a 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -72,7 +72,7 @@ // sd_SetLuminosity(0) /obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) add_fingerprint(user) disable = !disable playsound(src, W.usesound, 50, 1) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index f3149dc78a..51a1f3fb98 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -66,7 +66,7 @@ update_icon() return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) to_chat(user, "You start to dismantle the IV drip.") if(do_after(user, 15)) diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index 0e184683ec..52bbb8c634 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -108,11 +108,11 @@ return if(default_deconstruction_crowbar(user, W)) return - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) return wires.Interact(user) if(istype(W, /obj/item/device/multitool)) return wires.Interact(user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(playing) StopPlaying() user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].") @@ -270,7 +270,7 @@ return if(default_deconstruction_crowbar(user, W)) return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(playing) StopPlaying() user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].") diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 6ceab53895..00010da9cc 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -365,7 +365,7 @@ Class Procs: // Default behavior for wrenching down machines. Supports both delay and instant modes. /obj/machinery/proc/default_unfasten_wrench(var/mob/user, var/obj/item/W, var/time = 0) - if(!W.is_wrench()) + if(!W.has_tool_quality(TOOL_WRENCH)) return FALSE if(panel_open) return FALSE // Close panel first! @@ -385,14 +385,14 @@ Class Procs: return TRUE /obj/machinery/proc/default_deconstruction_crowbar(var/mob/user, var/obj/item/C) - if(!C.is_crowbar()) + if(!C.has_tool_quality(TOOL_CROWBAR)) return 0 if(!panel_open) return 0 . = dismantle() /obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/S) - if(!S.is_screwdriver()) + if(!S.has_tool_quality(TOOL_SCREWDRIVER)) return 0 playsound(src, S.usesound, 50, 1) panel_open = !panel_open @@ -401,7 +401,7 @@ Class Procs: return 1 /obj/machinery/proc/computer_deconstruction_screwdriver(var/mob/user, var/obj/item/S) - if(!S.is_screwdriver()) + if(!S.has_tool_quality(TOOL_SCREWDRIVER)) return 0 if(!circuit) return 0 @@ -416,7 +416,7 @@ Class Procs: . = dismantle() /obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/S) - if(!S.is_screwdriver()) + if(!S.has_tool_quality(TOOL_SCREWDRIVER)) return 0 playsound(src, S.usesound, 50, 1) panel_open = !panel_open @@ -425,7 +425,7 @@ Class Procs: return 1 /obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/W) - if(!W.is_wirecutter()) + if(!W.has_tool_quality(TOOL_WIRECUTTER)) return 0 if(!panel_open) return 0 diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index b0a1588b4d..79c8cdf738 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -72,7 +72,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w if(!T.is_plating()) return // prevent intraction when T-scanner revealed - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) open = !open playsound(src, I.usesound, 50, 1) user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index b9646235c0..1784635d59 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -55,7 +55,7 @@ var/bomb_set return /obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, O.usesound, 50, 1) add_fingerprint(user) if(auth) @@ -78,7 +78,7 @@ var/bomb_set flick("nuclearbombc", src) return - if(O.is_wirecutter() || istype(O, /obj/item/device/multitool)) + if(O.has_tool_quality(TOOL_WIRECUTTER) || istype(O, /obj/item/device/multitool)) if(opened == 1) nukehack_win(user) return @@ -94,9 +94,9 @@ var/bomb_set if(anchored) switch(removal_stage) if(0) - if(istype(O,/obj/item/weapon/weldingtool)) + if(O.has_tool_quality(TOOL_WELDER)) - var/obj/item/weapon/weldingtool/WT = O + var/obj/item/weapon/weldingtool/WT = O.get_welder() if(!WT.isOn()) return if(WT.get_fuel() < 5) // uses up 5 fuel. to_chat(user, "You need more fuel to complete this task.") @@ -111,7 +111,7 @@ var/bomb_set return if(1) - if(O.is_crowbar()) + if(O.has_tool_quality(TOOL_CROWBAR)) user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...") playsound(src, O.usesound, 50, 1) @@ -122,9 +122,9 @@ var/bomb_set return if(2) - if(istype(O,/obj/item/weapon/weldingtool)) + if(O.has_tool_quality(TOOL_WELDER)) - var/obj/item/weapon/weldingtool/WT = O + var/obj/item/weapon/weldingtool/WT = O.get_welder() if(!WT.isOn()) return if(WT.get_fuel() < 5) // uses up 5 fuel. to_chat(user, "You need more fuel to complete this task.") @@ -139,7 +139,7 @@ var/bomb_set return if(3) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...") playsound(src, O.usesound, 50, 1) @@ -150,7 +150,7 @@ var/bomb_set return if(4) - if(O.is_crowbar()) + if(O.has_tool_quality(TOOL_CROWBAR)) user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...") playsound(src, O.usesound, 50, 1) @@ -262,7 +262,7 @@ var/bomb_set visible_message("The [src] emits a quiet whirling noise!") if(href_list["act"] == "wire") var/obj/item/I = usr.get_active_hand() - if(!I.is_wirecutter()) + if(!I.has_tool_quality(TOOL_WIRECUTTER)) to_chat(usr, "You need wirecutters!") else wires[temp_wire] = !wires[temp_wire] diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm index 3673462534..f2dc3923ae 100644 --- a/code/game/machinery/oxygen_pump.dm +++ b/code/game/machinery/oxygen_pump.dm @@ -128,7 +128,7 @@ return 1 /obj/machinery/oxygen_pump/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) stat ^= MAINT user.visible_message("\The [user] [(stat & MAINT) ? "opens" : "closes"] \the [src].", "You [(stat & MAINT) ? "open" : "close"] \the [src].") icon_state = (stat & MAINT) ? icon_state_open : icon_state_closed diff --git a/code/game/machinery/pda_multicaster.dm b/code/game/machinery/pda_multicaster.dm index ef7612bf87..d8a75ebedc 100644 --- a/code/game/machinery/pda_multicaster.dm +++ b/code/game/machinery/pda_multicaster.dm @@ -39,9 +39,9 @@ icon_state = "[initial(icon_state)]_off" /obj/machinery/pda_multicaster/attackby(obj/item/I, mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) default_deconstruction_screwdriver(user, I) - else if(I.is_crowbar()) + else if(I.has_tool_quality(TOOL_CROWBAR)) default_deconstruction_crowbar(user, I) else ..() diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index f5f2532080..b86ed67519 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -166,7 +166,7 @@ Buildable meters return ..() /obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) return wrench_act(user, W) return ..() @@ -255,7 +255,7 @@ Buildable meters var/piping_layer = PIPING_LAYER_DEFAULT /obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) return wrench_act(user, W) return ..() diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index 8827dc8782..e9cb400746 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -78,11 +78,11 @@ if("p_layer") p_layer = text2num(params["p_layer"]) if("dispense_pipe") - if(!wait) + if(!wait) var/datum/pipe_recipe/recipe = locate(params["ref"]) if(!istype(recipe)) return - + var/target_dir = NORTH if(params["bent"]) target_dir = NORTHEAST @@ -116,7 +116,7 @@ user.drop_item() qdel(W) return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if (unwrenched==0) playsound(src, W.usesound, 50, 1) to_chat(user, "You begin to unfasten \the [src] from the floor...") diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm index bcc1f770a3..7a4951f065 100644 --- a/code/game/machinery/pipe/pipelayer.dm +++ b/code/game/machinery/pipe/pipelayer.dm @@ -81,12 +81,12 @@ return if(default_part_replacement(user, W)) return - if (!panel_open && W.is_wrench()) + if (!panel_open && W.has_tool_quality(TOOL_WRENCH)) P_type_t = tgui_input_list(usr, "Choose pipe type", "Pipe type", Pipes) P_type = Pipes[P_type_t] user.visible_message("[user] has set \the [src] to manufacture [P_type_t].", "You set \the [src] to manufacture [P_type_t].") return - if(!panel_open && W.is_crowbar()) + if(!panel_open && W.has_tool_quality(TOOL_CROWBAR)) a_dis = !a_dis user.visible_message("[user] has [!a_dis?"de":""]activated auto-dismantling.", "You [!a_dis?"de":""]activate auto-dismantling.") return diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm index d61e0dbe72..2a0a284c36 100644 --- a/code/game/machinery/pointdefense.dm +++ b/code/game/machinery/pointdefense.dm @@ -93,7 +93,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/power/pointdefense) return data /obj/machinery/pointdefense_control/attackby(var/obj/item/W, var/mob/user) - if(W?.is_multitool()) + if(W?.has_tool_quality(TOOL_MULTITOOL)) var/new_ident = tgui_input_text(user, "Enter a new ident tag.", "[src]", id_tag, MAX_NAME_LEN) new_ident = sanitize(new_ident,MAX_NAME_LEN) if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, GLOB.tgui_physical_state)) @@ -211,7 +211,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/power/pointdefense) return PDC /obj/machinery/power/pointdefense/attackby(var/obj/item/W, var/mob/user) - if(W?.is_multitool()) + if(W?.has_tool_quality(TOOL_MULTITOOL)) var/new_ident = tgui_input_text(user, "Enter a new ident tag.", "[src]", id_tag, MAX_NAME_LEN) new_ident = sanitize(new_ident,MAX_NAME_LEN) if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, GLOB.tgui_physical_state)) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 58c5b054ed..eccf4df786 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -487,7 +487,7 @@ /obj/machinery/porta_turret/attackby(obj/item/I, mob/user) if(stat & BROKEN) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) //If the turret is destroyed, you can remove it with a crowbar to //try and salvage its components to_chat(user, "You begin prying the metal coverings off.") @@ -506,7 +506,7 @@ to_chat(user, "You remove the turret but did not manage to salvage anything.") qdel(src) // qdel - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) if(enabled || raised) to_chat(user, "You cannot unsecure an active turret!") return @@ -948,14 +948,14 @@ //this is a bit unwieldy but self-explanatory switch(build_step) if(0) //first step - if(I.is_wrench() && !anchored) + if(I.has_tool_quality(TOOL_WRENCH) && !anchored) playsound(src, I.usesound, 100, 1) to_chat(user, "You secure the external bolts.") anchored = TRUE build_step = 1 return - else if(I.is_crowbar() && !anchored) + else if(I.has_tool_quality(TOOL_CROWBAR) && !anchored) playsound(src, I.usesound, 75, 1) to_chat(user, "You dismantle the turret construction.") new /obj/item/stack/material/steel(loc, 5) @@ -973,7 +973,7 @@ to_chat(user, "You need two sheets of metal to continue construction.") return - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) playsound(src, I.usesound, 75, 1) to_chat(user, "You unfasten the external bolts.") anchored = FALSE @@ -981,14 +981,14 @@ return if(2) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) playsound(src, I.usesound, 100, 1) to_chat(user, "You bolt the metal armor into place.") build_step = 3 return - else if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = I + else if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = I.get_welder() if(!WT.isOn()) return if(WT.get_fuel() < 5) //uses up 5 fuel. @@ -1021,7 +1021,7 @@ qdel(I) //delete the gun :( return - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) playsound(src, I.usesound, 100, 1) to_chat(user, "You remove the turret's metal armor bolts.") build_step = 2 @@ -1040,7 +1040,7 @@ //attack_hand() removes the gun if(5) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, I.usesound, 100, 1) build_step = 6 to_chat(user, "You close the internal access hatch.") @@ -1058,15 +1058,15 @@ to_chat(user, "You need two sheets of metal to continue construction.") return - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, I.usesound, 100, 1) build_step = 5 to_chat(user, "You open the internal access hatch.") return if(7) - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = I + if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = I.get_welder() if(!WT.isOn()) return if(WT.get_fuel() < 5) to_chat(user, "You need more fuel to complete this task.") @@ -1088,7 +1088,7 @@ qdel(src) // qdel - else if(I.is_crowbar()) + else if(I.has_tool_quality(TOOL_CROWBAR)) playsound(src, I.usesound, 75, 1) to_chat(user, "You pry off the turret's exterior armor.") new /obj/item/stack/material/steel(loc, 2) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index db94f63adb..cd23dad276 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -91,7 +91,7 @@ update_icon() user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].") - else if(portable && G.is_wrench()) + else if(portable && G.has_tool_quality(TOOL_WRENCH)) if(charging) to_chat(user, "Remove [charging] first!") return diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index ac0615635a..f5505ba9da 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -10,12 +10,12 @@ icon_state = "sheater0" name = "space heater" desc = "Made by Space Amish using traditional space techniques, this heater is guaranteed not to set the station on fire." - + light_system = MOVABLE_LIGHT light_range = 3 light_power = 1 light_on = FALSE - + var/obj/item/weapon/cell/cell var/cell_type = /obj/item/weapon/cell/high var/state = 0 @@ -90,7 +90,7 @@ else to_chat(user, "The hatch must be open to insert a power cell.") return - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open playsound(src, I.usesound, 50, 1) user.visible_message("[user] [panel_open ? "opens" : "closes"] the hatch on the [src].", "You [panel_open ? "open" : "close"] the hatch on the [src].") diff --git a/code/game/machinery/suit_storage/suit_cycler.dm b/code/game/machinery/suit_storage/suit_cycler.dm index 56a081737f..cdd6b45dc2 100644 --- a/code/game/machinery/suit_storage/suit_cycler.dm +++ b/code/game/machinery/suit_storage/suit_cycler.dm @@ -141,7 +141,7 @@ GLOBAL_LIST_EMPTY(suit_cycler_typecache) return //Hacking init. - if(istype(I, /obj/item/device/multitool) || I.is_wirecutter()) + if(istype(I, /obj/item/device/multitool) || I.has_tool_quality(TOOL_WIRECUTTER)) if(panel_open) attack_hand(user) return @@ -177,7 +177,7 @@ GLOBAL_LIST_EMPTY(suit_cycler_typecache) updateUsrDialog() return - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open playsound(src, I.usesound, 50, 1) diff --git a/code/game/machinery/suit_storage/suit_storage.dm b/code/game/machinery/suit_storage/suit_storage.dm index 334f5227d8..3134eee487 100644 --- a/code/game/machinery/suit_storage/suit_storage.dm +++ b/code/game/machinery/suit_storage/suit_storage.dm @@ -385,7 +385,7 @@ /obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob) if(!ispowered) return - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) panelopen = !panelopen playsound(src, I.usesound, 100, 1) to_chat(user, "You [panelopen ? "open up" : "close"] the unit's maintenance panel.") diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm index 377a02aa74..f3d4bb574f 100644 --- a/code/game/machinery/supplybeacon.dm +++ b/code/game/machinery/supplybeacon.dm @@ -45,7 +45,7 @@ drop_type = "supermatter" /obj/machinery/power/supply_beacon/attackby(var/obj/item/weapon/W, var/mob/user) - if(!use_power && W.is_wrench()) + if(!use_power && W.has_tool_quality(TOOL_WRENCH)) if(!anchored && !connect_to_network()) to_chat(user, "This device must be placed over an exposed cable.") return diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index bf1cd59024..0021e2bf2e 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -121,7 +121,7 @@ return /obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(active) to_chat(user, "You need to deactivate the beacon first!") return diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm index be00cab96a..696b46af78 100644 --- a/code/game/machinery/wall_frames.dm +++ b/code/game/machinery/wall_frames.dm @@ -18,7 +18,7 @@ frame_types_wall = construction_frame_wall /obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) new refund_type(get_turf(src.loc), refund_amt) qdel(src) return diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 77c3187458..e3c6a90976 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -106,7 +106,7 @@ return if(default_unfasten_wrench(user, W, 40)) return - /*if(W.is_screwdriver()) + /*if(W.has_tool_quality(TOOL_SCREWDRIVER)) panel = !panel to_chat(user, "You [panel ? "open" : "close"] the [src]'s maintenance panel")*/ if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp)) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 595e44a2cd..effab680ea 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1446,7 +1446,7 @@ to_chat(user, "Invalid ID: Access denied.") else to_chat(user, "Maintenance protocols disabled by operator.") - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(state==MECHA_BOLTS_SECURED) state = MECHA_PANEL_LOOSE to_chat(user, "You undo the securing bolts.") @@ -1454,7 +1454,7 @@ state = MECHA_BOLTS_SECURED to_chat(user, "You tighten the securing bolts.") return - else if(W.is_crowbar()) + else if(W.has_tool_quality(TOOL_CROWBAR)) if(state==MECHA_PANEL_LOOSE) state = MECHA_CELL_OPEN to_chat(user, "You open the hatch to the power unit") @@ -1487,7 +1487,7 @@ else to_chat(user, "There's not enough wire to finish the task.") return - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(hasInternalDamage(MECHA_INT_TEMP_CONTROL)) clearInternalDamage(MECHA_INT_TEMP_CONTROL) to_chat(user, "You repair the damaged temperature controller.") @@ -1526,8 +1526,8 @@ to_chat(user, "There's already a powercell installed.") return - else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != I_HURT) - var/obj/item/weapon/weldingtool/WT = W + else if(W.has_tool_quality(TOOL_WELDER) && user.a_intent != I_HURT) + var/obj/item/weapon/weldingtool/WT = W.get_welder() var/obj/item/mecha_parts/component/hull/HC = internal_components[MECH_HULL] var/obj/item/mecha_parts/component/armor/AC = internal_components[MECH_ARMOR] if (WT.remove_fuel(0,user)) diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index 27974a588d..f5ea5d0cbf 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -3,19 +3,19 @@ //////////////////////////////// /datum/construction/mecha/custom_action(step, obj/item/I, mob/user) - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/W = I - if (W.remove_fuel(0, user)) + if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/W = I.get_welder() + if(W.remove_fuel(0, user)) playsound(holder, 'sound/items/Welder2.ogg', 50, 1) else return 0 - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) playsound(holder, 'sound/items/Ratchet.ogg', 50, 1) - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1) - else if(I.is_wirecutter()) + else if(I.has_tool_quality(TOOL_WIRECUTTER)) playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1) else if(istype(I, /obj/item/stack/cable_coil)) @@ -35,19 +35,19 @@ return 1 /datum/construction/reversible/mecha/custom_action(index as num, diff as num, obj/item/I, mob/user as mob) - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/W = I - if (W.remove_fuel(0, user)) + if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/W = I.get_welder() + if(W.remove_fuel(0, user)) playsound(holder, 'sound/items/Welder2.ogg', 50, 1) else return 0 - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) playsound(holder, 'sound/items/Ratchet.ogg', 50, 1) - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1) - else if(I.is_wirecutter()) + else if(I.has_tool_quality(TOOL_WIRECUTTER)) playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1) else if(istype(I, /obj/item/stack/cable_coil)) @@ -102,7 +102,7 @@ result = "/obj/mecha/working/ripley" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -111,10 +111,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -310,7 +310,7 @@ result = "/obj/mecha/combat/gygax" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -319,10 +319,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/mecha_parts/part/gygax_armour, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -592,7 +592,7 @@ result = "/obj/mecha/combat/gygax/serenity" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -601,10 +601,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -875,7 +875,7 @@ result = "/obj/mecha/working/ripley/firefighter" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -888,10 +888,10 @@ "desc"="External armor is being installed."), //4 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //5 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //6 @@ -1095,7 +1095,7 @@ result = "/obj/mecha/combat/durand" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -1104,10 +1104,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/mecha_parts/part/durand_armour, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -1377,7 +1377,7 @@ result = "/obj/mecha/medical/odysseus" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -1386,10 +1386,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -1586,7 +1586,7 @@ result = "/obj/mecha/combat/phazon" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -1595,10 +1595,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -1865,7 +1865,7 @@ result = "/obj/mecha/combat/phazon/janus" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_CROWBAR, "desc"="External armor is installed."), //2 @@ -1874,10 +1874,10 @@ "desc"="External armor is attached."), //3 list("key"=/obj/item/stack/material/morphium, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded"), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_CROWBAR, "desc"="Internal armor is wrenched"), //5 diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm index 5dbee5556b..01b5987112 100644 --- a/code/game/mecha/mecha_wreckage.dm +++ b/code/game/mecha/mecha_wreckage.dm @@ -31,8 +31,8 @@ /obj/effect/decal/mecha_wreckage/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(salvage_num <= 0) to_chat(user, "You don't see anything that can be cut with [W].") return @@ -49,7 +49,7 @@ else to_chat(user, "You need more welding fuel to complete this task.") return - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) if(salvage_num <= 0) to_chat(user, "You don't see anything that can be cut with [W].") return @@ -61,7 +61,7 @@ salvage_num-- else to_chat(user, "You failed to salvage anything valuable from [src].") - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if(!isemptylist(crowbar_salvage)) var/obj/S = pick(crowbar_salvage) if(S) diff --git a/code/game/mecha/micro/mecha_construction_paths_vr.dm b/code/game/mecha/micro/mecha_construction_paths_vr.dm index 4117e2ca65..85ac01325b 100644 --- a/code/game/mecha/micro/mecha_construction_paths_vr.dm +++ b/code/game/mecha/micro/mecha_construction_paths_vr.dm @@ -33,7 +33,7 @@ result = "/obj/mecha/micro/sec/polecat" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -42,10 +42,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/mecha_parts/micro/part/polecat_armour, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -312,7 +312,7 @@ result = "/obj/mecha/micro/utility/gopher" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -321,10 +321,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 @@ -518,7 +518,7 @@ result = "/obj/mecha/micro/sec/weasel" steps = list( //1 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="External armor is wrenched."), //2 @@ -527,10 +527,10 @@ "desc"="External armor is installed."), //3 list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, + "backkey"=IS_WELDER, "desc"="Internal armor is welded."), //4 - list("key"=/obj/item/weapon/weldingtool, + list("key"=IS_WELDER, "backkey"=IS_WRENCH, "desc"="Internal armor is wrenched"), //5 diff --git a/code/game/objects/effects/alien/aliens.dm b/code/game/objects/effects/alien/aliens.dm index 84b415506d..b7a40d4819 100644 --- a/code/game/objects/effects/alien/aliens.dm +++ b/code/game/objects/effects/alien/aliens.dm @@ -192,8 +192,8 @@ var/damage = W.force / 4.0 - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) damage = 15 diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm index 2915213d8a..0b298f2224 100644 --- a/code/game/objects/effects/decals/contraband.dm +++ b/code/game/objects/effects/decals/contraband.dm @@ -180,7 +180,7 @@ poster_set = TRUE /obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, W.usesound, 100, 1) if(ruined) to_chat(user, "You remove the remnants of the poster.") diff --git a/code/game/objects/effects/decals/posters/posters.dm b/code/game/objects/effects/decals/posters/posters.dm index 1a9710a566..74624bcb0d 100644 --- a/code/game/objects/effects/decals/posters/posters.dm +++ b/code/game/objects/effects/decals/posters/posters.dm @@ -165,7 +165,7 @@ flick("poster_being_set", src) /obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, W.usesound, 100, 1) if(ruined) to_chat(user, "You remove the remnants of the poster.") diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 93a2ec408c..b464530da7 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -101,7 +101,7 @@ explode(M) /obj/effect/mine/attackby(obj/item/W as obj, mob/living/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open user.visible_message("[user] very carefully screws the mine's panel [panel_open ? "open" : "closed"].", "You very carefully screw the mine's panel [panel_open ? "open" : "closed"].") @@ -110,7 +110,7 @@ // Panel open, stay uncloaked, or uncloak if already cloaked. If you don't cloak on place, ignore it and just be normal alpha. alpha = camo_net ? (panel_open ? 255 : 50) : 255 - else if((W.is_wirecutter() || istype(W, /obj/item/device/multitool)) && panel_open) + else if((W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/multitool)) && panel_open) interact(user) else ..() @@ -309,7 +309,7 @@ return /obj/item/weapon/mine/attackby(obj/item/W as obj, mob/living/user as mob) - if(W.is_screwdriver() && trap) + if(W.has_tool_quality(TOOL_SCREWDRIVER) && trap) to_chat(user, "You begin removing \the [trap].") if(do_after(user, 10 SECONDS)) to_chat(user, "You finish disconnecting the mine's trigger.") diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index c92bacbb79..74ef44f5b1 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -30,8 +30,8 @@ var/damage = W.force / 4.0 - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) damage = 15 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index fa4dc54452..5c0e31a4c6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1018,3 +1018,6 @@ Note: This proc can be overwritten to allow for different types of auto-alignmen /obj/item/proc/on_holder_escape(var/obj/item/weapon/holder/H) return + +/obj/item/proc/get_welder() + return \ No newline at end of file diff --git a/code/game/objects/items/bells.dm b/code/game/objects/items/bells.dm index e9219957e4..0dce9e0223 100644 --- a/code/game/objects/items/bells.dm +++ b/code/game/objects/items/bells.dm @@ -87,7 +87,7 @@ /obj/item/weapon/deskbell/attackby(obj/item/W, mob/user, params) if(!istype(W)) return - if(W.is_wrench() && isturf(loc)) + if(W.has_tool_quality(TOOL_WRENCH) && isturf(loc)) if(do_after(5)) if(!src) return to_chat(user, "You dissasemble the desk bell") diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 94a24c9ee8..85833ec0a1 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -47,7 +47,7 @@ src.name = "body bag" //..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri return - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) to_chat(user, "You cut the tag off the bodybag") src.name = "body bag" cut_overlays() @@ -244,7 +244,7 @@ inject_occupant(H) break - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(syringe) if(used) to_chat(user,"The injector cannot be removed now that the stasis bag has been used!") diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index b7d6d5278c..7e993ce8ee 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -96,7 +96,7 @@ to_chat(user, "You install a cell in \the [src].") update_icon() - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(bcell) bcell.update_icon() bcell.forceMove(get_turf(src.loc)) diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 0b987e04c7..4e692b3347 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -37,7 +37,7 @@ power_supply = new cell_type(src) /obj/item/device/flash/attackby(var/obj/item/W, var/mob/user) - if(W.is_screwdriver() && broken) + if(W.has_tool_quality(TOOL_SCREWDRIVER) && broken) if(repairing) to_chat(user, "\The [src] is already being repaired!") return diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm index a374f19d8d..223ac5a1c4 100644 --- a/code/game/objects/items/devices/hacktool.dm +++ b/code/game/objects/items/devices/hacktool.dm @@ -9,7 +9,7 @@ var/list/known_targets var/list/supported_types var/datum/tgui_state/default/must_hack/hack_state - + /obj/item/device/multitool/hacktool/override hackspeed = 0.75 max_level = 5 @@ -31,7 +31,7 @@ return ..() /obj/item/device/multitool/hacktool/attackby(var/obj/item/W, var/mob/user) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) in_hack_mode = !in_hack_mode playsound(src, W.usesound, 50, 1) else @@ -78,7 +78,7 @@ if(D.security_level > max_level) to_chat(user, "\icon[src][bicon(src)] Target's electronic security is too complex.") return 0 - + var/found = known_targets.Find(D) if(found) known_targets.Swap(1, found) // Move the last hacked item first diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 784fb4ced3..0112b25dd3 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -54,7 +54,7 @@ else to_chat(user, "[src] already has a diode.") - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(diode) to_chat(user, "You remove the [diode.name] from the [src].") diode.loc = get_turf(src.loc) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 6fe9aea398..4a249cae00 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -66,9 +66,6 @@ return -/obj/item/device/multitool/is_multitool() - return TRUE - /obj/item/device/multitool/cyborg name = "multitool" desc = "Optimised and stripped-down version of a regular multitool." diff --git a/code/game/objects/items/devices/personal_shield_generator_vr.dm b/code/game/objects/items/devices/personal_shield_generator_vr.dm index 6d105b7b54..dbae24eabf 100644 --- a/code/game/objects/items/devices/personal_shield_generator_vr.dm +++ b/code/game/objects/items/devices/personal_shield_generator_vr.dm @@ -179,7 +179,7 @@ to_chat(user, "You install a cell in \the [src].") update_icon() - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(bcell) if(istype(bcell, /obj/item/weapon/cell/device/shield_generator)) //No stealing self charging batteries! var/choice = tgui_alert(user, "A popup appears on the device 'REMOVING THE INTERNAL CELL WILL DESTROY THE BATTERY. DO YOU WISH TO CONTINUE?'...Well, do you?", "Selection List", list("Cancel", "Remove")) diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 339b57f055..9ed57621d2 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -30,7 +30,7 @@ ..() /obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(mode == 0) var/turf/T = loc if(isturf(T) && !!T.is_plating()) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 5c46bbf3d8..9628a1a190 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -336,10 +336,10 @@ /obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob) // ..() user.set_machine(src) - if(!(W.is_screwdriver() || istype(W, /obj/item/device/encryptionkey))) + if(!(W.has_tool_quality(TOOL_SCREWDRIVER) || istype(W, /obj/item/device/encryptionkey))) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(keyslot1 || keyslot2) diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index cf3781f31b..e6fc45e2e4 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -131,12 +131,12 @@ /obj/item/device/radio/intercom/attackby(obj/item/W as obj, mob/user as mob) add_fingerprint(user) - if(W.is_screwdriver()) // Opening the intercom up. + if(W.has_tool_quality(TOOL_SCREWDRIVER)) // Opening the intercom up. wiresexposed = !wiresexposed to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]") playsound(src, W.usesound, 50, 1) update_icon() - else if(wiresexposed && W.is_wirecutter()) + else if(wiresexposed && W.has_tool_quality(TOOL_WIRECUTTER)) user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") playsound(src, W.usesound, 50, 1) new/obj/item/stack/cable_coil(get_turf(src), 5) @@ -173,7 +173,7 @@ /obj/item/device/radio/intercom/update_icon() var/area/A = get_area(src) on = A?.powered(EQUIP) - + cut_overlays() if(!on) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 63f5929307..99a9dddfc3 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -614,7 +614,7 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer) /obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() user.set_machine(src) - if (!W.is_screwdriver()) + if (!W.has_tool_quality(TOOL_SCREWDRIVER)) return b_stat = !( b_stat ) if(!istype(src, /obj/item/device/radio/beacon)) @@ -666,10 +666,10 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer) /obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob) // ..() user.set_machine(src) - if (!(W.is_screwdriver() || istype(W, /obj/item/device/encryptionkey))) + if (!(W.has_tool_quality(TOOL_SCREWDRIVER) || istype(W, /obj/item/device/encryptionkey))) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(keyslot) diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm index a92bf815b8..5f6eed3327 100644 --- a/code/game/objects/items/devices/spy_bug.dm +++ b/code/game/objects/items/devices/spy_bug.dm @@ -110,7 +110,7 @@ else to_chat(user, "Error: The device is linked to another monitor.") - else if(W.is_wrench() && user.a_intent != I_HURT) + else if(W.has_tool_quality(TOOL_WRENCH) && user.a_intent != I_HURT) if(isturf(loc)) anchored = !anchored diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index dda476191b..1d073ab3fe 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -146,7 +146,7 @@ to_chat(user, "You switch \the [src] [on ? "on" : "off"].") /obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (W.is_screwdriver()) + if (W.has_tool_quality(TOOL_SCREWDRIVER)) if(cover_open) cover_open = 0 to_chat(user, "You screw the panel into place.") @@ -237,7 +237,7 @@ return cell /obj/item/device/suit_cooling_unit/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (W.is_screwdriver()) + if (W.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "This cooler's cell is permanently installed!") return diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 0ae3fd17b9..131aba4993 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -409,7 +409,7 @@ /obj/item/device/tape/attackby(obj/item/I, mob/user, params) - if(ruined && I.is_screwdriver()) + if(ruined && I.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You start winding the tape back in...") playsound(src, I.usesound, 50, 1) if(do_after(user, 120 * I.toolspeed, target = src)) diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index bf132c7cf9..12423a91f3 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -33,8 +33,8 @@ /obj/item/target/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if (W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) cut_overlays() to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.") diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 6f97f72e3d..f27bb02560 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -41,8 +41,8 @@ stacktype = material.stack_type /obj/item/stack/tile/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if (W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(can_weld == FALSE) to_chat("You can't reform these into their original components.") diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index 2dc4cad3ee..20bb85d69b 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -118,7 +118,7 @@ visible_message("[user] pairs [I] to [nickname]") toggle_pairing() - else if(I.is_screwdriver() && cell) + else if(I.has_tool_quality(TOOL_SCREWDRIVER) && cell) if(do_after(user, 3 SECONDS, src)) to_chat(user, "You remove [cell] into [nickname].") playsound(src, I.usesound, 50, 1) diff --git a/code/game/objects/items/weapons/RMS_vr.dm b/code/game/objects/items/weapons/RMS_vr.dm index 69c5f61e64..b57cf9d539 100644 --- a/code/game/objects/items/weapons/RMS_vr.dm +++ b/code/game/objects/items/weapons/RMS_vr.dm @@ -248,7 +248,7 @@ return 1 /obj/item/weapon/rms/attackby(obj/item/W, mob/user) - if(W.is_multitool()) + if(W.has_tool_quality(TOOL_MULTITOOL)) overcharge = !overcharge if(overcharge) to_chat(user, "The Rapid Material Synthesizer quietly whirrs...") diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm index 7663dfd7ff..8fc58d8664 100644 --- a/code/game/objects/items/weapons/candle.dm +++ b/code/game/objects/items/weapons/candle.dm @@ -26,8 +26,8 @@ /obj/item/weapon/flame/candle/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool light("\The [user] casually lights the [src] with [W].") else if(istype(W, /obj/item/weapon/flame/lighter)) diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm index 8de61a2b91..43ea3d3cd6 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/research.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm @@ -7,7 +7,7 @@ build_path = /obj/machinery/computer/rdconsole/core /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, I.usesound, 50, 1) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") if(build_path == /obj/machinery/computer/rdconsole/core) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm index 4305ecf180..380de53fd2 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm @@ -12,7 +12,7 @@ /obj/item/weapon/stock_parts/scanning_module = 1) /obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, I.usesound, 50, 1) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") if(build_path == /obj/machinery/r_n_d/server/core) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 0e9250611e..494984b170 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -29,11 +29,11 @@ return ..() /obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) open_panel = !open_panel to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.") playsound(src, I.usesound, 50, 1) - else if(I.is_wirecutter() || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler )) + else if(I.has_tool_quality(TOOL_WIRECUTTER) || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler )) wires.Interact(user) else ..() diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index b20a44650e..287a174fbf 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -69,7 +69,7 @@ /obj/item/weapon/flamethrower/attackby(obj/item/W as obj, mob/user as mob) if(user.stat || user.restrained() || user.lying) return - if(W.is_wrench() && !status)//Taking this apart + if(W.has_tool_quality(TOOL_WRENCH) && !status)//Taking this apart var/turf/T = get_turf(src) if(weldtool) weldtool.loc = T @@ -84,7 +84,7 @@ qdel(src) return - if(W.is_screwdriver() && igniter && !lit) + if(W.has_tool_quality(TOOL_SCREWDRIVER) && igniter && !lit) status = !status to_chat(user, "[igniter] is now [status ? "secured" : "unsecured"]!") update_icon() diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index c30b47a7f4..6e4379367f 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -49,7 +49,7 @@ /obj/effect/spresent/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() - if (!W.is_wirecutter()) + if (!W.has_tool_quality(TOOL_WIRECUTTER)) to_chat(user, "I need wirecutters for that.") return @@ -132,7 +132,7 @@ to_chat(user, "You MUST put the paper on a table!") if (W.w_class < ITEMSIZE_LARGE) var/obj/item/I = user.get_inactive_hand() - if(I.is_wirecutter()) + if(I.has_tool_quality(TOOL_WIRECUTTER)) var/a_used = 2 ** (src.w_class - 1) if (src.amount < a_used) to_chat(user, "You need more paper!") diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 1a19b98910..c0c08d94fc 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -78,7 +78,7 @@ icon_state = initial(icon_state) +"_ass" name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]" stage = 1 - else if(W.is_screwdriver() && path != 2) + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && path != 2) if(stage == 1) path = 1 if(beakers.len) diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 9bdf650c64..38565fea0d 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -92,7 +92,7 @@ /obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) switch(det_time) if (1) det_time = 10 diff --git a/code/game/objects/items/weapons/implants/implantcircuits.dm b/code/game/objects/items/weapons/implants/implantcircuits.dm index ffe6547fcb..9dcc4853a0 100644 --- a/code/game/objects/items/weapons/implants/implantcircuits.dm +++ b/code/game/objects/items/weapons/implants/implantcircuits.dm @@ -39,7 +39,7 @@ return IC.examine(user) /obj/item/weapon/implant/integrated_circuit/attackby(var/obj/item/O, var/mob/user) - if(O.is_crowbar() || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.is_screwdriver() || istype(O, /obj/item/weapon/cell/device) ) + if(O.has_tool_quality(TOOL_CROWBAR) || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.has_tool_quality(TOOL_SCREWDRIVER) || istype(O, /obj/item/weapon/cell/device) ) IC.attackby(O, user) else ..() diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm index 928a7c1a5d..c4272a5e10 100644 --- a/code/game/objects/items/weapons/improvised_components.dm +++ b/code/game/objects/items/weapons/improvised_components.dm @@ -7,7 +7,7 @@ thrown_force_divisor = 0.1 /obj/item/weapon/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You finish the concealed blade weapon.") playsound(src, W.usesound, 50, 1) new /obj/item/weapon/material/butterfly(user.loc, material.name) diff --git a/code/game/objects/items/weapons/inducer_vr.dm b/code/game/objects/items/weapons/inducer_vr.dm index 0c39599071..b0519abce8 100644 --- a/code/game/objects/items/weapons/inducer_vr.dm +++ b/code/game/objects/items/weapons/inducer_vr.dm @@ -77,7 +77,7 @@ /obj/item/weapon/inducer/attackby(obj/item/W, mob/user) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) if(!opened) to_chat(user, "You open the battery compartment.") diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm index 83d65a6c3b..0505e6a8e6 100644 --- a/code/game/objects/items/weapons/material/gravemarker.dm +++ b/code/game/objects/items/weapons/material/gravemarker.dm @@ -12,7 +12,7 @@ var/epitaph = "" //A quick little blurb /obj/item/weapon/material/gravemarker/attackby(obj/item/weapon/W, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN) if(carving_1) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") @@ -27,7 +27,7 @@ user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") epitaph += carving_2 update_icon() - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") if(do_after(user, material.hardness * W.toolspeed)) material.place_dismantled_product(get_turf(src)) diff --git a/code/game/objects/items/weapons/material/material_armor.dm b/code/game/objects/items/weapons/material/material_armor.dm index 7fb5efad6e..7f16d57a1c 100644 --- a/code/game/objects/items/weapons/material/material_armor.dm +++ b/code/game/objects/items/weapons/material/material_armor.dm @@ -290,7 +290,7 @@ Protectiveness | Armor % unbreakable = FALSE name = "plate insert" desc = "used to craft armor plates for a plate carrier. Trim with a welder for light armor or add a second for heavy armor" - + /obj/item/weapon/material/armor_plating/attackby(var/obj/O, mob/user) if(istype(O, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/S = O @@ -323,12 +323,12 @@ Protectiveness | Armor % ..() //Make plating inserts for modular armour. -/obj/item/weapon/material/armor_plating/insert/attackby(var/obj/O, mob/user) +/obj/item/weapon/material/armor_plating/insert/attackby(var/obj/item/O, mob/user) . = ..() - if(istype(O, /obj/item/weapon/weldingtool)) - var /obj/item/weapon/weldingtool/S = O + if(O.has_tool_quality(TOOL_WELDER)) + var /obj/item/weapon/weldingtool/S = O.get_welder() if(S.remove_fuel(0,user)) if(!src || !S.isOn()) return to_chat(user, "You trim down the edges to size.") diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 59cc5f3edd..dbae1eead7 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -47,8 +47,8 @@ alpha = 255 /obj/item/weapon/material/shard/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/weldingtool) && material.shard_can_repair) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER) && material.shard_can_repair) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) material.place_sheet(loc) qdel(src) diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 92234d4da0..7eaf6a8174 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -145,7 +145,7 @@ update_icon() else to_chat(user, "[src] already has a cell.") - else if(W.is_screwdriver() && bcell) + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && bcell) bcell.update_icon() bcell.forceMove(get_turf(loc)) bcell = null diff --git a/code/game/objects/items/weapons/melee/misc_vr.dm b/code/game/objects/items/weapons/melee/misc_vr.dm index d06c4b82bf..b14a36e1f4 100644 --- a/code/game/objects/items/weapons/melee/misc_vr.dm +++ b/code/game/objects/items/weapons/melee/misc_vr.dm @@ -13,22 +13,4 @@ sharp = TRUE edge = FALSE attack_verb = list("stabbed", "lunged at", "dextrously struck", "sliced", "lacerated", "impaled", "diced", "charioted") - hitsound = 'sound/weapons/bladeslice.ogg' - -/obj/item/weapon/melee/altevian_wrench - name = "Hull Systems Multi-Wrench" - desc = "A wrench designed with a method to help secure and access bolts, hatches, and airlocks on altevian designed vessels. This operates as nothing more than a massive wrench when used for other purposes." - icon = 'icons/obj/weapons_vr.dmi' - icon_state = "altevian-wrench" - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_melee_vr.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_melee_vr.dmi', - ) - slot_flags = SLOT_BACK - force = 25 - throwforce = 15 - w_class = ITEMSIZE_HUGE - sharp = FALSE - edge = FALSE - attack_verb = list("whacked", "slammed", "bashed", "wrenched", "fixed", "bolted", "clonked", "bonked") - hitsound = 'sound/weapons/smash.ogg' \ No newline at end of file + hitsound = 'sound/weapons/bladeslice.ogg' \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index df9886cbb6..760ea116dd 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -153,8 +153,8 @@ /obj/item/weapon/storage/belt/utility/chief/full starts_with = list( - /obj/item/weapon/tool/screwdriver/power, - /obj/item/weapon/tool/crowbar/power, + /obj/item/weapon/tool/transforming/powerdrill, + /obj/item/weapon/tool/transforming/jawsoflife, /obj/item/weapon/weldingtool/experimental, /obj/item/device/multitool, /obj/item/stack/cable_coil/random_belt, diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index 2fa1e33c03..ce0e105f01 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -43,7 +43,7 @@ playsound(src, "sparks", 50, 1) return - if (W.is_screwdriver()) + if (W.has_tool_quality(TOOL_SCREWDRIVER)) if (do_after(user, 20 * W.toolspeed)) src.open =! src.open playsound(src, W.usesound, 50, 1) diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm index 9c6795aa12..fdd28c1a0e 100644 --- a/code/game/objects/items/weapons/storage/toolbox.dm +++ b/code/game/objects/items/weapons/storage/toolbox.dm @@ -97,9 +97,9 @@ /obj/item/weapon/storage/toolbox/syndicate/powertools starts_with = list( /obj/item/clothing/gloves/yellow, - /obj/item/weapon/tool/screwdriver/power, + /obj/item/weapon/tool/transforming/powerdrill, /obj/item/weapon/weldingtool/experimental, - /obj/item/weapon/tool/crowbar/power, + /obj/item/weapon/tool/transforming/jawsoflife, /obj/item/device/multitool, /obj/item/stack/cable_coil/random_belt, /obj/item/device/analyzer diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm index 198eeda966..fc0bd1856d 100644 --- a/code/game/objects/items/weapons/storage/uplink_kits.dm +++ b/code/game/objects/items/weapons/storage/uplink_kits.dm @@ -328,7 +328,6 @@ description_antag = "This case will likely contain a charged fuel rod gun, and a few fuel rods to go with it. It can only hold the fuel rod gun, fuel rods, batteries, a screwdriver, and stock machine parts." force = 12 //Anti-rad lined i.e. Lead, probably gonna hurt a bit if you get bashed with it. can_hold = list(/obj/item/weapon/gun/magnetic/fuelrod, /obj/item/weapon/fuel_assembly, /obj/item/weapon/cell, /obj/item/weapon/stock_parts, /obj/item/weapon/tool/screwdriver) - cant_hold = list(/obj/item/weapon/tool/screwdriver/power) starts_with = list( /obj/item/weapon/gun/magnetic/fuelrod, /obj/item/weapon/fuel_assembly/deuterium, diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm index bf6e0700c0..f2ea7da8a2 100644 --- a/code/game/objects/items/weapons/storage/wallets.dm +++ b/code/game/objects/items/weapons/storage/wallets.dm @@ -39,7 +39,6 @@ /obj/item/weapon/makeover, /obj/item/pizzavoucher //VOREStation edit ) - cant_hold = list(/obj/item/weapon/tool/screwdriver/power) slot_flags = SLOT_ID var/obj/item/weapon/card/id/front_id = null diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm index 0f70a805dd..5e519f8f4f 100644 --- a/code/game/objects/items/weapons/syndie.dm +++ b/code/game/objects/items/weapons/syndie.dm @@ -106,7 +106,7 @@ /obj/item/weapon/flame/lighter/zippo/c4detonator/attackby(obj/item/weapon/W, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) detonator_mode = !detonator_mode playsound(src, W.usesound, 50, 1) to_chat(user, "You unscrew the top panel of \the [src] revealing a button.") diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 7fbc4ff547..26ca107281 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -130,7 +130,7 @@ var/list/global/tank_gauge_cache = list() to_chat(user, "You attach the wires to the tank.") src.add_bomb_overlay() - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) if(wired && src.proxyassembly.assembly) to_chat(user, "You carefully begin clipping the wires that attach to the tank.") @@ -185,7 +185,7 @@ var/list/global/tank_gauge_cache = list() to_chat(user, "You need to wire the device up first.") - if(istype(W, /obj/item/weapon/weldingtool/)) + if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(1,user)) if(!valve_welded) diff --git a/code/game/objects/items/weapons/tools/crowbar.dm b/code/game/objects/items/weapons/tools/crowbar.dm index 06c1e53e07..8d7c1add85 100644 --- a/code/game/objects/items/weapons/tools/crowbar.dm +++ b/code/game/objects/items/weapons/tools/crowbar.dm @@ -72,34 +72,40 @@ toolspeed = 0.5 /obj/item/weapon/tool/crowbar/power - name = "jaws of life" - desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a prying head." - icon_state = "jaws_pry" - item_state = "jawsoflife" - matter = list(MAT_METAL=150, MAT_SILVER=50) - origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) + name = "power pryer" + desc = "You shouldn't see this." usesound = 'sound/items/jaws_pry.ogg' force = 15 toolspeed = 0.25 - var/obj/item/weapon/tool/wirecutters/power/counterpart = null -/obj/item/weapon/tool/crowbar/power/New(newloc, no_counterpart = TRUE) - ..(newloc) - if(!counterpart && no_counterpart) - counterpart = new(src, FALSE) - counterpart.counterpart = src +/* + * Prybar + */ -/obj/item/weapon/tool/crowbar/power/Destroy() - if(counterpart) - counterpart.counterpart = null // So it can qdel cleanly. - QDEL_NULL(counterpart) - return ..() +/obj/item/weapon/tool/prybar + name = "pry bar" + desc = "A steel bar with a wedge, designed specifically for opening unpowered doors in an emergency. It comes in a variety of configurations - collect them all!" + icon = 'icons/obj/tools_vr.dmi' + icon_state = "prybar" + item_state = "crowbar" + slot_flags = SLOT_BELT + force = 4 + throwforce = 5 + pry = 1 + w_class = ITEMSIZE_SMALL + origin_tech = list(TECH_ENGINEERING = 1) + matter = list(MAT_STEEL = 30) + attack_verb = list("whapped", "smacked", "swatted", "thwacked", "hit") + usesound = 'sound/items/crowbar.ogg' + toolspeed = 1 + var/random_color = TRUE -/obj/item/weapon/tool/crowbar/power/attack_self(mob/user) - playsound(src, 'sound/items/change_jaws.ogg', 50, 1) - user.drop_item(src) - counterpart.forceMove(get_turf(src)) - counterpart.persist_storable = persist_storable - src.forceMove(counterpart) - user.put_in_active_hand(counterpart) - to_chat(user, "You attach the cutting jaws to [src].") +/obj/item/weapon/tool/prybar/red + icon_state = "prybar_red" + item_state = "crowbar_red" + random_color = FALSE + +/obj/item/weapon/tool/prybar/New() + if(random_color) + icon_state = "prybar[pick("","_green","_aubergine","_blue")]" + . = ..() \ No newline at end of file diff --git a/code/game/objects/items/weapons/tools/crowbar_vr.dm b/code/game/objects/items/weapons/tools/crowbar_vr.dm deleted file mode 100644 index b846a0e294..0000000000 --- a/code/game/objects/items/weapons/tools/crowbar_vr.dm +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Prybar - */ - -/obj/item/weapon/tool/prybar - name = "pry bar" - desc = "A steel bar with a wedge, designed specifically for opening unpowered doors in an emergency. It comes in a variety of configurations - collect them all!" - icon = 'icons/obj/tools_vr.dmi' - icon_state = "prybar" - item_state = "crowbar" - slot_flags = SLOT_BELT - force = 4 - throwforce = 5 - pry = 1 - w_class = ITEMSIZE_SMALL - origin_tech = list(TECH_ENGINEERING = 1) - matter = list(MAT_STEEL = 30) - attack_verb = list("whapped", "smacked", "swatted", "thwacked", "hit") - usesound = 'sound/items/crowbar.ogg' - toolspeed = 1 - var/random_color = TRUE - -/obj/item/weapon/tool/prybar/red - icon_state = "prybar_red" - item_state = "crowbar_red" - random_color = FALSE - -/obj/item/weapon/tool/prybar/New() - if(random_color) - icon_state = "prybar[pick("","_green","_aubergine","_blue")]" - . = ..() diff --git a/code/game/objects/items/weapons/tools/screwdriver.dm b/code/game/objects/items/weapons/tools/screwdriver.dm index 4598b69803..55e78d71de 100644 --- a/code/game/objects/items/weapons/tools/screwdriver.dm +++ b/code/game/objects/items/weapons/tools/screwdriver.dm @@ -106,42 +106,10 @@ toolspeed = 0.5 /obj/item/weapon/tool/screwdriver/power - name = "hand drill" - desc = "A simple powered hand drill. It's fitted with a screw bit." - icon_state = "drill_screw" - item_state = "drill" - matter = list(MAT_STEEL = 150, MAT_SILVER = 50) - origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) - slot_flags = SLOT_BELT + name = "power screwdriver" + desc = "You shouldn't see this." force = 8 - w_class = ITEMSIZE_SMALL - throwforce = 8 - throw_speed = 2 - throw_range = 3//it's heavier than a screw driver/wrench, so it does more damage, but can't be thrown as far attack_verb = list("drilled", "screwed", "jabbed", "whacked") hitsound = 'sound/items/drill_hit.ogg' usesound = 'sound/items/drill_use.ogg' - toolspeed = 0.25 - random_color = FALSE - var/obj/item/weapon/tool/wrench/power/counterpart = null - -/obj/item/weapon/tool/screwdriver/power/New(newloc, no_counterpart = TRUE) - ..(newloc) - if(!counterpart && no_counterpart) - counterpart = new(src, FALSE) - counterpart.counterpart = src - -/obj/item/weapon/tool/screwdriver/power/Destroy() - if(counterpart) - counterpart.counterpart = null // So it can qdel cleanly. - QDEL_NULL(counterpart) - return ..() - -/obj/item/weapon/tool/screwdriver/power/attack_self(mob/user) - playsound(src,'sound/items/change_drill.ogg',50,1) - user.drop_item(src) - counterpart.forceMove(get_turf(src)) - counterpart.persist_storable = persist_storable - src.forceMove(counterpart) - user.put_in_active_hand(counterpart) - to_chat(user, "You attach the bolt driver bit to [src].") + toolspeed = 0.25 \ No newline at end of file diff --git a/code/game/objects/items/weapons/tools/transforming.dm b/code/game/objects/items/weapons/tools/transforming.dm new file mode 100644 index 0000000000..0cd4c2c42c --- /dev/null +++ b/code/game/objects/items/weapons/tools/transforming.dm @@ -0,0 +1,182 @@ +/obj/item/weapon/tool/transforming + name = "transforming tool" + desc = "You should never see this..." + var/list/possible_tooltypes = list() + var/current_tooltype = 1 + var/obj/item/weapon/weldingtool/welder + var/weldertype = /obj/item/weapon/weldingtool/dummy + +/obj/item/weapon/tool/transforming/New(newloc, no_counterpart = TRUE) + ..(newloc) + if(TOOL_WELDER in possible_tooltypes) + welder = new weldertype(src) + on_tool_switch() + +/obj/item/weapon/tool/transforming/Destroy() + if(welder) + QDEL_NULL(welder) + ..() + +/obj/item/weapon/tool/transforming/get_welder() + return welder + +/obj/item/weapon/tool/transforming/attack_self(mob/user) + if(!possible_tooltypes.len || possible_tooltypes.len < 2) + return + if(current_tooltype == possible_tooltypes.len) + current_tooltype = 1 + else + current_tooltype++ + + on_tool_switch(user) + +/obj/item/weapon/tool/transforming/proc/on_tool_switch(var/mob/user) + return + +/obj/item/weapon/tool/transforming/jawsoflife + name = "jaws of life" + desc = "A set of jaws of life, compressed through the magic of science." + icon = 'icons/obj/tools.dmi' + icon_state = "jaws_pry" + item_state = "jawsoflife" + origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) + matter = list(MAT_METAL=150, MAT_SILVER=50) + usesound = 'sound/items/jaws_pry.ogg' + force = 15 + toolspeed = 0.25 + sharp = TRUE + edge = TRUE + attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked", "pinched", "nipped") + possible_tooltypes = list(TOOL_CROWBAR,TOOL_WIRECUTTER) + +/obj/item/weapon/tool/transforming/jawsoflife/on_tool_switch(var/mob/user) + switch(possible_tooltypes[current_tooltype]) + if(TOOL_CROWBAR) + desc = initial(desc) + " It's fitted with a prying head." + icon_state = "jaws_pry" + usesound = 'sound/items/jaws_pry.ogg' + tool_qualities = list(TOOL_CROWBAR) + if(user) + playsound(src, 'sound/items/change_jaws.ogg', 50, 1) + to_chat(user, "You attach the pry jaws to [src].") + if(TOOL_WIRECUTTER) + desc = initial(desc) + " It's fitted with a cutting head." + icon_state = "jaws_cutter" + usesound = 'sound/items/jaws_cut.ogg' + tool_qualities = list(TOOL_WIRECUTTER) + if(user) + playsound(src, 'sound/items/change_jaws.ogg', 50, 1) + to_chat(user, "You attach the cutting jaws to [src].") + +/obj/item/weapon/tool/transforming/powerdrill + name = "hand drill" + desc = "A simple powered hand drill." + icon = 'icons/obj/tools.dmi' + icon_state = "drill_bolt" + item_state = "drill" + origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) + matter = list(MAT_STEEL = 150, MAT_SILVER = 50) + hitsound = 'sound/items/drill_hit.ogg' + usesound = 'sound/items/drill_use.ogg' + force = 8 + throwforce = 8 + toolspeed = 0.25 + sharp = FALSE + edge = FALSE + attack_verb = list("drilled", "screwed", "jabbed", "whacked") + possible_tooltypes = list(TOOL_WRENCH,TOOL_SCREWDRIVER) + +/obj/item/weapon/tool/transforming/powerdrill/on_tool_switch(var/mob/user) + switch(possible_tooltypes[current_tooltype]) + if(TOOL_WRENCH) + desc = initial(desc) + " It's fitted with a bolt driver." + icon_state = "drill_bolt" + sharp = FALSE + tool_qualities = list(TOOL_WRENCH) + if(user) + playsound(src,'sound/items/change_drill.ogg',50,1) + to_chat(user, "You attach the bolt driver to [src].") + if(TOOL_SCREWDRIVER) + desc = initial(desc) + " It's fitted with a screw driver." + icon_state = "drill_screw" + sharp = TRUE + tool_qualities = list(TOOL_SCREWDRIVER) + if(user) + playsound(src,'sound/items/change_drill.ogg',50,1) + to_chat(user, "You attach the screw driver to [src].") + +/obj/item/weapon/tool/transforming/altevian + name = "Hull Systems Omni-Tool" + desc = "A big and bulky tool, used by altevians for exterior operations. Can take shape of any regular tool, scaled up to a comically large size." + icon = 'icons/obj/weapons_vr.dmi' + icon_state = "altevian-wrench" + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_melee_vr.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_melee_vr.dmi', + ) + slot_flags = SLOT_BACK + w_class = ITEMSIZE_HUGE + force = 25 + throwforce = 15 + toolspeed = 0.25 + sharp = FALSE + edge = FALSE + attack_verb = list("whacked", "slammed", "bashed", "wrenched", "fixed", "bolted", "clonked", "bonked") + hitsound = 'sound/weapons/smash.ogg' + possible_tooltypes = list(TOOL_WRENCH,TOOL_CROWBAR,TOOL_WIRECUTTER,TOOL_SCREWDRIVER,TOOL_MULTITOOL,TOOL_WELDER) + weldertype = /obj/item/weapon/weldingtool/dummy/altevian + +/obj/item/weapon/tool/transforming/altevian/on_tool_switch(var/mob/user) + switch(possible_tooltypes[current_tooltype]) + if(TOOL_WRENCH) + desc = initial(desc) + " It's currently in bolting mode." + icon_state = "altevian-wrench" + usesound = 'sound/items/ratchet.ogg' + tool_qualities = list(TOOL_WRENCH) + if(user) + playsound(src,'sound/items/ratchet.ogg',50,1) + to_chat(user, "You reconfigure [src] into bolting mode.") + if(TOOL_CROWBAR) + desc = initial(desc) + " It's currently in prying mode." + icon_state = "altevian-crowbar" + usesound = 'sound/items/crowbar.ogg' + tool_qualities = list(TOOL_CROWBAR) + if(user) + playsound(src,'sound/items/ratchet.ogg',50,1) + to_chat(user, "You reconfigure [src] into prying mode.") + if(TOOL_WIRECUTTER) + desc = initial(desc) + " It's currently in cutting mode." + icon_state = "altevian-wirecutter" + usesound = 'sound/items/wirecutter.ogg' + tool_qualities = list(TOOL_WIRECUTTER) + if(user) + playsound(src,'sound/items/ratchet.ogg',50,1) + to_chat(user, "You reconfigure [src] into cutting mode.") + if(TOOL_SCREWDRIVER) + desc = initial(desc) + " It's currently in screwing mode." + icon_state = "altevian-screwdriver" + usesound = 'sound/items/screwdriver.ogg' + tool_qualities = list(TOOL_SCREWDRIVER) + if(user) + playsound(src,'sound/items/ratchet.ogg',50,1) + to_chat(user, "You reconfigure [src] into screwing mode.") + if(TOOL_MULTITOOL) + desc = initial(desc) + " It's currently in pulsing mode." + icon_state = "altevian-pulser" + usesound = 'sound/items/screwdriver.ogg' + tool_qualities = list(TOOL_MULTITOOL) + if(user) + playsound(src,'sound/items/ratchet.ogg',50,1) + to_chat(user, "You reconfigure [src] into pulsing mode.") + if(TOOL_WELDER) + desc = initial(desc) + " It's currently in welding mode." + icon_state = "altevian-welder-on" + welder.usesound = 'sound/items/Welder2.ogg' + usesound = 'sound/items/Welder2.ogg' + tool_qualities = list(TOOL_WELDER) + if(user) + playsound(src,'sound/items/ratchet.ogg',50,1) + to_chat(user, "You reconfigure [src] into welding mode.") + +/obj/item/weapon/weldingtool/dummy/altevian + toolspeed = 0.25 \ No newline at end of file diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index 8fbd4fe4d4..133570a61d 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -41,6 +41,7 @@ toolspeed = 1 drop_sound = 'sound/items/drop/weldingtool.ogg' pickup_sound = 'sound/items/pickup/weldingtool.ogg' + tool_qualities = list(TOOL_WELDER) /obj/item/weapon/weldingtool/Initialize() . = ..() @@ -58,6 +59,9 @@ STOP_PROCESSING(SSobj, src) return ..() +/obj/item/weapon/weldingtool/get_welder() + return src + /obj/item/weapon/weldingtool/examine(mob/user) . = ..() if(max_fuel && loc == user) @@ -690,4 +694,22 @@ else setWelding(FALSE, M.occupant) + +/obj/item/weapon/weldingtool/dummy + name = "dummy welding tool" + desc = "you shouldn't be reading this. Tell a dev!" + welding = TRUE + +/obj/item/weapon/weldingtool/dummy/process() + return + +/obj/item/weapon/weldingtool/dummy/get_fuel() + return get_max_fuel() + +/obj/item/weapon/weldingtool/dummy/remove_fuel(var/amount = 1, var/mob/M = null) + return TRUE + +/obj/item/weapon/weldingtool/dummy/isOn() + return TRUE + #undef WELDER_FUEL_BURN_INTERVAL diff --git a/code/game/objects/items/weapons/tools/wirecutters.dm b/code/game/objects/items/weapons/tools/wirecutters.dm index 2c43b963e1..8b71f8af84 100644 --- a/code/game/objects/items/weapons/tools/wirecutters.dm +++ b/code/game/objects/items/weapons/tools/wirecutters.dm @@ -98,35 +98,8 @@ reach = 2 /obj/item/weapon/tool/wirecutters/power - name = "jaws of life" - desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a cutting head." - icon_state = "jaws_cutter" - item_state = "jawsoflife" - origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) - matter = list(MAT_METAL=150, MAT_SILVER=50) + name = "power cutters" + desc = "You shouldn't see this." usesound = 'sound/items/jaws_cut.ogg' force = 15 - toolspeed = 0.25 - random_color = FALSE - var/obj/item/weapon/tool/crowbar/power/counterpart = null - -/obj/item/weapon/tool/wirecutters/power/New(newloc, no_counterpart = TRUE) - ..(newloc) - if(!counterpart && no_counterpart) - counterpart = new(src, FALSE) - counterpart.counterpart = src - -/obj/item/weapon/tool/wirecutters/power/Destroy() - if(counterpart) - counterpart.counterpart = null // So it can qdel cleanly. - QDEL_NULL(counterpart) - return ..() - -/obj/item/weapon/tool/wirecutters/power/attack_self(mob/user) - playsound(src, 'sound/items/change_jaws.ogg', 50, 1) - user.drop_item(src) - counterpart.forceMove(get_turf(src)) - counterpart.persist_storable = persist_storable - src.forceMove(counterpart) - user.put_in_active_hand(counterpart) - to_chat(user, "You attach the pry jaws to [src].") + toolspeed = 0.25 \ No newline at end of file diff --git a/code/game/objects/items/weapons/tools/wrench.dm b/code/game/objects/items/weapons/tools/wrench.dm index 8745e65a1c..2b1a3e30a8 100644 --- a/code/game/objects/items/weapons/tools/wrench.dm +++ b/code/game/objects/items/weapons/tools/wrench.dm @@ -74,37 +74,10 @@ origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 5) /obj/item/weapon/tool/wrench/power - name = "hand drill" - desc = "A simple powered hand drill. It's fitted with a bolt bit." - icon_state = "drill_bolt" - item_state = "drill" + name = "power wrench" + desc = "You shouldn't see this." usesound = 'sound/items/drill_use.ogg' - matter = list(MAT_STEEL = 150, MAT_SILVER = 50) - origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) force = 8 - w_class = ITEMSIZE_SMALL throwforce = 8 attack_verb = list("drilled", "screwed", "jabbed") toolspeed = 0.25 - var/obj/item/weapon/tool/screwdriver/power/counterpart = null - -/obj/item/weapon/tool/wrench/power/New(newloc, no_counterpart = TRUE) - ..(newloc) - if(!counterpart && no_counterpart) - counterpart = new(src, FALSE) - counterpart.counterpart = src - -/obj/item/weapon/tool/wrench/power/Destroy() - if(counterpart) - counterpart.counterpart = null // So it can qdel cleanly. - QDEL_NULL(counterpart) - return ..() - -/obj/item/weapon/tool/wrench/power/attack_self(mob/user) - playsound(src,'sound/items/change_drill.ogg',50,1) - user.drop_item(src) - counterpart.forceMove(get_turf(src)) - counterpart.persist_storable = persist_storable - src.forceMove(counterpart) - user.put_in_active_hand(counterpart) - to_chat(user, "You attach the screw driver bit to [src].") diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm index c183bc5c76..7bc406166c 100644 --- a/code/game/objects/items/weapons/traps.dm +++ b/code/game/objects/items/weapons/traps.dm @@ -244,7 +244,7 @@ var/inc_damage = W.force - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) if(!shock(user, 100, pick(BP_L_HAND, BP_R_HAND))) playsound(src, W.usesound, 100, 1) inc_damage *= 3 diff --git a/code/game/objects/random/misc.dm b/code/game/objects/random/misc.dm index 23aa3ee0f1..3f0f80593c 100644 --- a/code/game/objects/random/misc.dm +++ b/code/game/objects/random/misc.dm @@ -25,8 +25,8 @@ /obj/random/tool/powermaint/item_to_spawn() return pick(prob(320);/obj/random/tool, - prob(1);/obj/item/weapon/tool/screwdriver/power, - prob(1);/obj/item/weapon/tool/wirecutters/power, + prob(1);/obj/item/weapon/tool/transforming/powerdrill, + prob(1);/obj/item/weapon/tool/transforming/jawsoflife, prob(15);/obj/item/weapon/weldingtool/electric, prob(5);/obj/item/weapon/weldingtool/experimental) @@ -36,8 +36,8 @@ icon_state = "tool_2" /obj/random/tool/power/item_to_spawn() - return pick(/obj/item/weapon/tool/screwdriver/power, - /obj/item/weapon/tool/wirecutters/power, + return pick(/obj/item/weapon/tool/transforming/powerdrill, + /obj/item/weapon/tool/transforming/jawsoflife, /obj/item/weapon/weldingtool/electric, /obj/item/weapon/weldingtool/experimental) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index ea9cf8eb06..072bd9cddb 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -394,7 +394,7 @@ frame_canvas(user, I) else if(current_canvas && current_canvas.painting_name == initial(current_canvas.painting_name) && istype(I,/obj/item/weapon/pen)) try_rename(user) - else if(current_canvas && I.is_wirecutter()) + else if(current_canvas && I.has_tool_quality(TOOL_WIRECUTTER)) unframe_canvas(user) else return ..() diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm index ae5dc0c666..ffed750917 100644 --- a/code/game/objects/structures/catwalk.dm +++ b/code/game/objects/structures/catwalk.dm @@ -87,12 +87,12 @@ qdel(src) /obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob) - if(istype(C, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = C + if(C.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = C.get_welder() if(WT.isOn() && WT.remove_fuel(0, user)) deconstruct(user) return - if(C.is_crowbar() && plated_tile) + if(C.has_tool_quality(TOOL_CROWBAR) && plated_tile) hatch_open = !hatch_open if(hatch_open) playsound(src, 'sound/items/Crowbar.ogg', 100, 2) diff --git a/code/game/objects/structures/crates_lockers/__closets.dm b/code/game/objects/structures/crates_lockers/__closets.dm index 05661ccedb..f56c0269a4 100644 --- a/code/game/objects/structures/crates_lockers/__closets.dm +++ b/code/game/objects/structures/crates_lockers/__closets.dm @@ -271,7 +271,7 @@ return /obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(opened) if(anchored) user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") @@ -291,8 +291,8 @@ return 0 if(istype(W,/obj/item/tk_grab)) return 0 - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.remove_fuel(0,user)) if(!WT.isOn()) return @@ -326,8 +326,8 @@ else if(seal_tool) if(istype(W, seal_tool)) var/obj/item/weapon/S = W - if(istype(S, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = S + if(S.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = S.get_welder() if(!WT.remove_fuel(0,user)) if(!WT.isOn()) return diff --git a/code/game/objects/structures/crates_lockers/closets/egg_vr.dm b/code/game/objects/structures/crates_lockers/closets/egg_vr.dm index 19d3f8b452..eb69ff63b5 100644 --- a/code/game/objects/structures/crates_lockers/closets/egg_vr.dm +++ b/code/game/objects/structures/crates_lockers/closets/egg_vr.dm @@ -24,7 +24,7 @@ icon_state = icon_closed /obj/structure/closet/secure_closet/egg/attackby(obj/item/weapon/W, mob/user as mob) //This also prevents crew from welding the eggs and making them unable to be opened. - if(istype(W, /obj/item/weapon/weldingtool)) + if(W.has_tool_quality(TOOL_WELDER)) src.dump_contents() qdel(src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 85b9367b7d..3f7f75bfc2 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -54,7 +54,7 @@ to_chat(user, "Access Denied") /obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(opened) if(anchored) user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") @@ -90,7 +90,7 @@ spark_system.start() playsound(src, 'sound/weapons/blade1.ogg', 50, 1) playsound(src, "sparks", 50, 1) - else if(istype(W,/obj/item/weapon/packageWrap) || istype(W,/obj/item/weapon/weldingtool)) + else if(istype(W,/obj/item/weapon/packageWrap) || W.has_tool_quality(TOOL_WELDER)) return ..(W,user) else togglelock(user) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 7dfaf18187..601d0e5d36 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -90,7 +90,7 @@ src.set_dir(turn(src.dir, 90)) /obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench() && istype(src,/obj/structure/closet/crate/bin)) + if(W.has_tool_quality(TOOL_WRENCH) && istype(src,/obj/structure/closet/crate/bin)) return ..() else if(opened) if(isrobot(user)) @@ -117,7 +117,7 @@ user.drop_item() W.forceMove(src) return - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) if(rigged) to_chat(user , "You cut away the wiring.") playsound(src, W.usesound, 100, 1) diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm index 6b338895e3..fdb658daac 100644 --- a/code/game/objects/structures/crates_lockers/largecrate.dm +++ b/code/game/objects/structures/crates_lockers/largecrate.dm @@ -25,7 +25,7 @@ var/turf/T = get_turf(src) if(!T) to_chat(user, "You can't open this here!") - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) new /obj/item/stack/material/wood(src) for(var/atom/movable/AM in contents) @@ -55,7 +55,7 @@ icon_state = "vehiclecrate" /obj/structure/largecrate/hoverpod/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) var/obj/item/mecha_parts/mecha_equipment/ME var/obj/mecha/working/hoverpod/H = new (loc) diff --git a/code/game/objects/structures/crates_lockers/largecrate_vr.dm b/code/game/objects/structures/crates_lockers/largecrate_vr.dm index 85737c2481..7b9f9c0a4a 100644 --- a/code/game/objects/structures/crates_lockers/largecrate_vr.dm +++ b/code/game/objects/structures/crates_lockers/largecrate_vr.dm @@ -3,7 +3,7 @@ desc = "You hear chirping and cawing inside the crate. It sounds like there are a lot of birds in there..." /obj/structure/largecrate/birds/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) new /obj/item/stack/material/wood(src) new /mob/living/simple_mob/animal/passive/bird(src) new /mob/living/simple_mob/animal/passive/bird/parrot/kea(src) diff --git a/code/game/objects/structures/crates_lockers/vehiclecage.dm b/code/game/objects/structures/crates_lockers/vehiclecage.dm index c3a04e9267..944da792f8 100644 --- a/code/game/objects/structures/crates_lockers/vehiclecage.dm +++ b/code/game/objects/structures/crates_lockers/vehiclecage.dm @@ -31,11 +31,11 @@ var/turf/T = get_turf(src) if(!T) to_chat(user, "You can't open this here!") - if(W.is_wrench() && do_after(user, 60 * W.toolspeed, src)) + if(W.has_tool_quality(TOOL_WRENCH) && do_after(user, 60 * W.toolspeed, src)) playsound(src, W.usesound, 50, 1) disassemble(W, user) user.visible_message("[user] begins loosening \the [src]'s bolts.") - if(W.is_wirecutter() && do_after(user, 70 * W.toolspeed, src)) + if(W.has_tool_quality(TOOL_WIRECUTTER) && do_after(user, 70 * W.toolspeed, src)) playsound(src, W.usesound, 50, 1) disassemble(W, user) user.visible_message("[user] begins cutting \the [src]'s bolts.") diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm index f40a827806..714eb9eb53 100644 --- a/code/game/objects/structures/curtains.dm +++ b/code/game/objects/structures/curtains.dm @@ -38,7 +38,7 @@ layer = OBJ_LAYER /obj/structure/curtain/attackby(obj/item/P, mob/user) - if(P.is_wirecutter()) + if(P.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, P.usesound, 50, 1) to_chat(user, "You start to cut the shower curtains.") if(do_after(user, 10)) diff --git a/code/game/objects/structures/dancepole_vr.dm b/code/game/objects/structures/dancepole_vr.dm index 90270b88ce..c44ff91fb9 100644 --- a/code/game/objects/structures/dancepole_vr.dm +++ b/code/game/objects/structures/dancepole_vr.dm @@ -20,14 +20,14 @@ layer = BELOW_MOB_LAYER /obj/structure/dancepole/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) anchored = !anchored playsound(src, O.usesound, 50, 1) if(anchored) to_chat(user, "You secure \the [src].") else to_chat(user, "You unsecure \the [src].") - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 50, 1) to_chat(user, "Now disassembling \the [src]...") if(do_after(user, 30 * O.toolspeed)) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index a484aa3efe..6ca92a3b37 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -170,8 +170,8 @@ rename_door(user) return - if(istype(W, /obj/item/weapon/weldingtool) && ( (istext(glass)) || (glass == 1) || (!anchored) )) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER) && ( (istext(glass)) || (glass == 1) || (!anchored) )) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if (WT.remove_fuel(0, user)) playsound(src, WT.usesound, 50, 1) if(istext(glass)) @@ -200,7 +200,7 @@ to_chat(user, "You need more welding fuel.") return - else if(W.is_wrench() && state == 0) + else if(W.has_tool_quality(TOOL_WRENCH) && state == 0) playsound(src, W.usesound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring the airlock assembly from the floor.", "You starts unsecuring the airlock assembly from the floor.") @@ -223,7 +223,7 @@ src.state = 1 to_chat(user, "You wire the airlock.") - else if(W.is_wirecutter() && state == 1 ) + else if(W.has_tool_quality(TOOL_WIRECUTTER) && state == 1 ) playsound(src, W.usesound, 100, 1) user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.") @@ -245,7 +245,7 @@ src.state = 2 src.electronics = W - else if(W.is_crowbar() && state == 2 ) + else if(W.has_tool_quality(TOOL_CROWBAR) && state == 2 ) //This should never happen, but just in case I guess if (!electronics) to_chat(user, "There was nothing to remove.") @@ -287,7 +287,7 @@ to_chat(user, "You installed [material_display_name(material_name)] plating into the airlock assembly.") glass = material_name - else if(W.is_screwdriver() && state == 2 ) + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && state == 2 ) playsound(src, W.usesound, 100, 1) to_chat(user, "Now finishing the airlock.") diff --git a/code/game/objects/structures/droppod.dm b/code/game/objects/structures/droppod.dm index 730fba388b..d794a8829d 100644 --- a/code/game/objects/structures/droppod.dm +++ b/code/game/objects/structures/droppod.dm @@ -31,15 +31,15 @@ if(!T) warning("Drop pod wasn't spawned on a turf") return - + moveToNullspace() icon_state = "[initial(icon_state)]_falling" - + // Show warning on 3x3 area centred on our drop spot var/list/turfs_nearby = block(get_step(T, SOUTHWEST), get_step(T, NORTHEAST)) for(var/turf/TN in turfs_nearby) new /obj/effect/temporary_effect/shuttle_landing(TN) - + // Wait a minute sleep(4 SECONDS) @@ -58,7 +58,7 @@ T.hotspot_expose(900) sleep(1 SECOND) filters = null - + // CRONCH playsound(src, 'sound/effects/meteorimpact.ogg', 50, 1) if(!polite) @@ -69,7 +69,7 @@ else for(var/turf/simulated/floor/F in view(1, T)) F.burn_tile(900) - + for(var/obj/O in T) if(O == src) continue @@ -80,7 +80,7 @@ // Landed! Simmer plane = initial(plane) icon_state = "[initial(icon_state)]" - + if(auto_open) sleep(2 SECONDS) open_pod() @@ -109,7 +109,7 @@ user.visible_message("[user] opens \the [src]!","You open \the [src]!") /obj/structure/drop_pod/attackby(obj/item/O, mob/user) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) if(finished) to_chat(user, "You start breaking down \the [src].") if(do_after(user, 10 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE)) diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index cccde21044..ff37f1b40b 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -12,7 +12,7 @@ return /obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) var/obj/structure/bed/chair/C = new /obj/structure/bed/chair(loc) playsound(src, W.usesound, 50, 1) C.set_dir(dir) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index a0c01e52cd..8318392b49 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -31,7 +31,7 @@ to_chat(user, "You place [O] in [src].") else opened = !opened - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) if(!has_extinguisher) to_chat(user, "You start to unwrench the extinguisher cabinet.") playsound(src, O.usesound, 50, 1) diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm index a3133b264a..1bb1b4e71e 100644 --- a/code/game/objects/structures/fence.dm +++ b/code/game/objects/structures/fence.dm @@ -69,7 +69,7 @@ return ..() /obj/structure/fence/attackby(obj/item/W, mob/user) - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) if(!cuttable) to_chat(user, span("warning", "This section of the fence can't be cut.")) return diff --git a/code/game/objects/structures/fitness.dm b/code/game/objects/structures/fitness.dm index f84c9508e7..eb2f1e37bc 100644 --- a/code/game/objects/structures/fitness.dm +++ b/code/game/objects/structures/fitness.dm @@ -34,7 +34,7 @@ var/list/qualifiers = list("with ease", "without any trouble", "with great effort") /obj/structure/fitness/weightlifter/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, 'sound/items/Deconstruct.ogg', 75, 1) weight = ((weight) % qualifiers.len) + 1 to_chat(user, "You set the machine's weight level to [weight].") diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 8e8568953b..6642d9f99f 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -146,7 +146,7 @@ reinforce_girder() /obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob) - if(W.is_wrench() && state == 0) + if(W.has_tool_quality(TOOL_WRENCH) && state == 0) if(anchored && !reinf_material) playsound(src, W.usesound, 100, 1) to_chat(user, "Now disassembling the girder...") @@ -172,7 +172,7 @@ to_chat(user, "You drill through the girder!") dismantle() - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(state == 2) playsound(src, W.usesound, 100, 1) to_chat(user, "Now unsecuring support struts...") @@ -185,7 +185,7 @@ reinforcing = !reinforcing to_chat(user, "\The [src] can now be [reinforcing? "reinforced" : "constructed"]!") - else if(W.is_wirecutter() && state == 1) + else if(W.has_tool_quality(TOOL_WIRECUTTER) && state == 1) playsound(src, W.usesound, 100, 1) to_chat(user, "Now removing support struts...") if(do_after(user,40 * W.toolspeed)) @@ -195,7 +195,7 @@ reinf_material = null reset_girder() - else if(W.is_crowbar() && state == 0 && anchored) + else if(W.has_tool_quality(TOOL_CROWBAR) && state == 0 && anchored) playsound(src, W.usesound, 100, 1) to_chat(user, "Now dislodging the girder...") if(do_after(user, 40 * W.toolspeed)) @@ -339,7 +339,7 @@ qdel(src) /obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) to_chat(user, "Now disassembling the girder...") if(do_after(user,40 * W.toolspeed)) @@ -419,4 +419,3 @@ /obj/structure/girder/eris wall_type = /turf/simulated/wall/eris - \ No newline at end of file diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm index 381401b352..a93c57144a 100644 --- a/code/game/objects/structures/gravemarker.dm +++ b/code/game/objects/structures/gravemarker.dm @@ -51,7 +51,7 @@ return TRUE /obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN) if(carving_1) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") @@ -67,7 +67,7 @@ epitaph += carving_2 update_icon() return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) user.visible_message("[user] starts taking down \the [src.name].", "You start taking down \the [src.name].") if(do_after(user, material.hardness * W.toolspeed)) user.visible_message("[user] takes down \the [src.name].", "You take down \the [src.name].") diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index ea1a9346c1..13b5412e56 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -94,12 +94,12 @@ return if(istype(W, /obj/item/weapon/rcd)) // To stop us from hitting the grille when building windows, because grilles don't let parent handle it properly. return FALSE - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) if(!shock(user, 100)) playsound(src, W.usesound, 100, 1) new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2) qdel(src) - else if((W.is_screwdriver()) && (istype(loc, /turf/simulated) || anchored)) + else if((W.has_tool_quality(TOOL_SCREWDRIVER)) && (istype(loc, /turf/simulated) || anchored)) if(!shock(user, 90)) playsound(src, W.usesound, 100, 1) anchored = !anchored diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 43aeed44c1..20b496291e 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -176,7 +176,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart) //This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash else if (!has_items) - if (I.is_wrench()) + if (I.has_tool_quality(TOOL_WRENCH)) if (do_after(user, 5 SECONDS, src)) dismantle(user) return diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index d5fcf7e8d1..6107f25f6c 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -55,19 +55,19 @@ /obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob) - if (istype(C, /obj/item/stack/tile/floor)) + if(istype(C, /obj/item/stack/tile/floor)) var/turf/T = get_turf(src) T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead return - if (istype(C, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = C + if(C.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = C.get_welder() if(WT.welding == 1) if(WT.remove_fuel(0, user)) to_chat(user, "Slicing lattice joints ...") new /obj/item/stack/rods(src.loc) qdel(src) return - if (istype(C, /obj/item/stack/rods)) + if(istype(C, /obj/item/stack/rods)) var/obj/item/stack/rods/R = C if(R.get_amount() < 2) to_chat(user, "You need at least two rods to form a catwalk here.") diff --git a/code/game/objects/structures/low_wall.dm b/code/game/objects/structures/low_wall.dm index 08b43c2c97..8d0d035b96 100644 --- a/code/game/objects/structures/low_wall.dm +++ b/code/game/objects/structures/low_wall.dm @@ -86,7 +86,7 @@ return // Dismantling the half wall - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) for(var/obj/structure/S in loc) if(istype(S, /obj/structure/window)) to_chat(user, "There is still a window on the low wall!") diff --git a/code/game/objects/structures/medical_stand_vr.dm b/code/game/objects/structures/medical_stand_vr.dm index e2eca967ff..63b6f365f5 100644 --- a/code/game/objects/structures/medical_stand_vr.dm +++ b/code/game/objects/structures/medical_stand_vr.dm @@ -295,7 +295,7 @@ to_chat(user, "Close the valve first.") return if (tank) - if(!W.is_wrench()) + if(!W.has_tool_quality(TOOL_WRENCH)) return if (!is_loosen) is_loosen = TRUE diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 8cb6749823..8aff413305 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -50,7 +50,7 @@ ..() /obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) if(!glass) playsound(src, I.usesound, 50, 1) if(do_after(user, 20 * I.toolspeed)) @@ -58,7 +58,7 @@ new /obj/item/frame/mirror( src.loc ) qdel(src) return - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) if(shattered && glass) to_chat(user, "The broken glass falls out.") icon_state = "mirror_frame" diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index bd7e7836f6..ae26157f39 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -17,7 +17,7 @@ ) /obj/structure/plasticflaps/attackby(obj/item/P, mob/user) - if(P.is_wirecutter()) + if(P.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, P.usesound, 50, 1) to_chat(user, "You start to cut the plastic flaps.") if(do_after(user, 10 * P.toolspeed)) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index 3efd7091b0..3b357d9fd5 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -202,7 +202,7 @@ /obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob) // Dismantle - if(W.is_wrench() && !anchored) + if(W.has_tool_quality(TOOL_WRENCH) && !anchored) playsound(src, W.usesound, 50, 1) if(do_after(user, 20, src)) user.visible_message("\The [user] dismantles \the [src].", "You dismantle \the [src].") @@ -211,8 +211,8 @@ return // Repair - if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/F = W + if(health < maxhealth && W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/F = W.get_welder() if(F.welding) playsound(src, F.usesound, 50, 1) if(do_after(user, 20, src)) @@ -221,7 +221,7 @@ return // Install - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) user.visible_message(anchored ? "\The [user] begins unscrewing \the [src]." : "\The [user] begins fasten \the [src]." ) playsound(src, W.usesound, 75, 1) if(do_after(user, 10, src)) diff --git a/code/game/objects/structures/salvageable.dm b/code/game/objects/structures/salvageable.dm index 8408b3cddd..4999456a5e 100644 --- a/code/game/objects/structures/salvageable.dm +++ b/code/game/objects/structures/salvageable.dm @@ -14,7 +14,7 @@ return /obj/structure/salvageable/attackby(obj/item/I, mob/user) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) playsound(src, I.usesound, 50, 1) var/actual_time = I.toolspeed * 170 user.visible_message( \ diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index f61cf27bd3..b4d5469fcc 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -11,7 +11,7 @@ qdel(src) /obj/structure/sign/attackby(obj/item/tool, mob/user) //deconstruction - if(tool.is_screwdriver() && !istype(src, /obj/structure/sign/scenery) && !istype(src, /obj/structure/sign/double)) + if(tool.has_tool_quality(TOOL_SCREWDRIVER) && !istype(src, /obj/structure/sign/scenery) && !istype(src, /obj/structure/sign/double)) playsound(src, tool.usesound, 50, 1) unfasten(user) else ..() @@ -36,7 +36,7 @@ var/original_type /obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction - if(tool.is_screwdriver() && isturf(user.loc)) + if(tool.has_tool_quality(TOOL_SCREWDRIVER) && isturf(user.loc)) var/direction = tgui_input_list(usr, "In which direction?", "Select direction.", list("North", "East", "South", "West", "Cancel")) if(direction == "Cancel") return var/target_type = original_type || /obj/structure/sign diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm index f032855e3a..6a45bd731c 100644 --- a/code/game/objects/structures/simple_doors.dm +++ b/code/game/objects/structures/simple_doors.dm @@ -181,8 +181,8 @@ else playsound(src, 'sound/weapons/smash.ogg', 50, 1) CheckHardness() - else if(istype(W,/obj/item/weapon/weldingtool) && breakable) - var/obj/item/weapon/weldingtool/WT = W + else if(W.has_tool_quality(TOOL_WELDER) && breakable) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(material.ignition_point && WT.remove_fuel(0, user)) TemperatureAct(150) else diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 6a35ac7c36..7a55f5db5b 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -88,7 +88,7 @@ return /obj/structure/bed/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 50, 1) dismantle() qdel(src) @@ -119,7 +119,7 @@ add_padding(padding_type) return - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) if(!padding_material) to_chat(user, "\The [src] has no padding to remove.") return @@ -219,7 +219,7 @@ return /obj/structure/bed/roller/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench() || istype(W,/obj/item/stack) || W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WRENCH) || istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER)) return else if(istype(W,/obj/item/roller_holder)) if(has_buckled_mobs()) @@ -369,7 +369,7 @@ buckle_lying = 1 /obj/structure/dirtybed/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 08b059888a..903346fe95 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -207,7 +207,7 @@ return /obj/structure/bed/chair/office/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/stack) || W.is_wirecutter()) + if(istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER)) return ..() @@ -273,7 +273,7 @@ return /obj/structure/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/stack) || W.is_wirecutter()) + if(istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER)) return ..() diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index 8c61d2ca34..c22e3d5f1f 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -110,7 +110,7 @@ var/global/list/stool_cache = list() //haha stool qdel(src) /obj/item/weapon/stool/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 50, 1) dismantle() qdel(src) @@ -140,7 +140,7 @@ var/global/list/stool_cache = list() //haha stool to_chat(user, "You add padding to \the [src].") add_padding(padding_type) return - else if (W.is_wirecutter()) + else if (W.has_tool_quality(TOOL_WIRECUTTER)) if(!padding_material) to_chat(user, "\The [src] has no padding to remove.") return diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 142cd8928e..3214128eec 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -55,7 +55,7 @@ L.set_dir(dir) /obj/structure/bed/chair/wheelchair/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench() || W.is_wirecutter() || istype(W,/obj/item/stack)) + if(W.has_tool_quality(TOOL_WRENCH) || W.has_tool_quality(TOOL_WIRECUTTER) || istype(W,/obj/item/stack)) return ..() diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 1af54a1b4e..fcbfe98230 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -73,7 +73,7 @@ phorontanks++ else full = TRUE - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) if(anchored) to_chat(user, "You lean down and unwrench [src].") anchored = FALSE diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 693c8aa866..8f5444aa21 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -44,7 +44,7 @@ icon_state = "[initial(icon_state)][open][cistern]" /obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) to_chat(user, "You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].") playsound(src, 'sound/effects/stonedoor_openclose.ogg', 50, 1) if(do_after(user, 30)) @@ -200,7 +200,7 @@ /obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob) if(I.type == /obj/item/device/analyzer) to_chat(user, "The water temperature seems to be [watertemp].") - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) var/newtemp = tgui_input_list(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve", temperature_settings) to_chat(user, "You begin to adjust the temperature valve with \the [I].") playsound(src, I.usesound, 50, 1) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 855e7fac11..44bb6e45a7 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -87,8 +87,8 @@ switch(state) if("01") - if(istype(W, /obj/item/weapon/weldingtool) && !anchored ) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER) && !anchored) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if (WT.remove_fuel(0,user)) user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly.") playsound(src, WT.usesound, 50, 1) @@ -106,7 +106,7 @@ return //Wrenching an unsecure assembly anchors it in place. Step 4 complete - if(W.is_wrench() && !anchored) + if(W.has_tool_quality(TOOL_WRENCH) && !anchored) playsound(src, W.usesound, 100, 1) user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.") @@ -117,7 +117,7 @@ step = 0 //Unwrenching an unsecure assembly un-anchors it. Step 4 undone - else if(W.is_wrench() && anchored) + else if(W.has_tool_quality(TOOL_WRENCH) && anchored) playsound(src, W.usesound, 100, 1) user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.") @@ -143,7 +143,7 @@ if("02") //Removing wire from the assembly. Step 5 undone. - if(W.is_wirecutter() && !src.electronics) + if(W.has_tool_quality(TOOL_WIRECUTTER) && !src.electronics) playsound(src, W.usesound, 100, 1) user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.") @@ -172,7 +172,7 @@ W.loc = src.loc //Screwdriver to remove airlock electronics. Step 6 undone. - else if(W.is_screwdriver() && src.electronics) + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && src.electronics) playsound(src, W.usesound, 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.") @@ -185,7 +185,7 @@ ae.loc = src.loc //Crowbar to complete the assembly, Step 7 complete. - else if(W.is_crowbar()) + else if(W.has_tool_quality(TOOL_CROWBAR)) if(!src.electronics) to_chat(usr,"The assembly is missing electronics.") return diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 35e7a339af..e6ec740aa0 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -223,8 +223,8 @@ if(!istype(W)) return//I really wish I did not need this // Fixing. - if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER) && user.a_intent == I_HELP) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(health < maxhealth) if(WT.remove_fuel(1 ,user)) to_chat(user, "You begin repairing [src]...") @@ -265,7 +265,7 @@ if(W.flags & NOBLUDGEON) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(reinf && state >= 1) state = 3 - state update_nearby_icons() @@ -285,11 +285,11 @@ update_verbs() playsound(src, W.usesound, 75, 1) to_chat(user, "You have [anchored ? "" : "un"]fastened the window [anchored ? "to" : "from"] the floor.") - else if(W.is_crowbar() && reinf && state <= 1) + else if(W.has_tool_quality(TOOL_CROWBAR) && reinf && state <= 1) state = 1 - state playsound(src, W.usesound, 75, 1) to_chat(user, "You have pried the window [state ? "into" : "out of"] the frame.") - else if(W.is_wrench() && !anchored && (!state || !reinf)) + else if(W.has_tool_quality(TOOL_WRENCH) && !anchored && (!state || !reinf)) if(!glasstype) to_chat(user, "You're not sure how to dismantle \the [src] properly.") else diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 2b6f5422b4..49bd6bc208 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -129,8 +129,8 @@ playsound(src, 'sound/items/Deconstruct.ogg', 80, 1) return // Plating repairs and removal - else if(istype(C, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/welder = C + else if(C.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/welder = C.get_welder() if(welder.isOn()) // Needs repairs if(broken || burnt) @@ -160,7 +160,7 @@ do_remove_plating(C, user, base_type) /turf/simulated/floor/proc/try_deconstruct_tile(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if(broken || burnt) to_chat(user, "You remove the broken [flooring.descriptor].") make_plating() @@ -174,14 +174,14 @@ return 0 playsound(src, W.usesound, 80, 1) return 1 - else if(W.is_screwdriver() && (flooring.flags & TURF_REMOVE_SCREWDRIVER)) + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && (flooring.flags & TURF_REMOVE_SCREWDRIVER)) if(broken || burnt) return 0 to_chat(user, "You unscrew and remove the [flooring.descriptor].") make_plating(1) playsound(src, W.usesound, 80, 1) return 1 - else if(W.is_wrench() && (flooring.flags & TURF_REMOVE_WRENCH)) + else if(W.has_tool_quality(TOOL_WRENCH) && (flooring.flags & TURF_REMOVE_WRENCH)) to_chat(user, "You unwrench and remove the [flooring.descriptor].") make_plating(1) playsound(src, W.usesound, 80, 1) @@ -215,8 +215,8 @@ return TRUE /turf/simulated/floor/proc/do_remove_plating(obj/item/weapon/W, mob/user, base_type) - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.remove_fuel(5,user)) to_chat(user, "You don't have enough fuel in [WT] finish cutting through [src].") return diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 8c6eb32ae3..e6a810e9a6 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -132,7 +132,7 @@ user.setClickCooldown(user.get_attack_speed(W)) /* -//As with the floors, only this time it works AND tries pushing the wall after it's done. +//As with the floors, only this time it works AND tries pushing the wall after it's done. if(!construction_stage && user.a_intent == I_HELP) if(try_graffiti(user,W)) return @@ -185,8 +185,8 @@ if(locate(/obj/effect/overlay/wallrot) in src) - if(istype(W, /obj/item/weapon/weldingtool) ) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if( WT.remove_fuel(0,user) ) to_chat(user, "You burn away the fungi with \the [WT].") playsound(src, WT.usesound, 10, 1) @@ -200,8 +200,8 @@ //THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects if(thermite) - if( istype(W, /obj/item/weapon/weldingtool) ) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if( WT.remove_fuel(0,user) ) thermitemelt(user) return @@ -223,9 +223,9 @@ var/turf/T = user.loc //get user's location for delay checks - if(damage && istype(W, /obj/item/weapon/weldingtool)) + if(damage && W.has_tool_quality(TOOL_WELDER)) - var/obj/item/weapon/weldingtool/WT = W + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) return @@ -250,8 +250,8 @@ var/dismantle_verb var/dismantle_sound - if(istype(W,/obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) return if(!WT.remove_fuel(0,user)) @@ -292,7 +292,7 @@ else switch(construction_stage) if(6) - if (W.is_wirecutter()) + if (W.has_tool_quality(TOOL_WIRECUTTER)) playsound(src, W.usesound, 100, 1) construction_stage = 5 user.update_examine_panel(src) @@ -300,7 +300,7 @@ update_icon() return if(5) - if (W.is_screwdriver()) + if (W.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You begin removing the support lines.") playsound(src, W.usesound, 100, 1) if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 5) @@ -310,7 +310,7 @@ update_icon() to_chat(user, "You unscrew the support lines.") return - else if (W.is_wirecutter()) + else if (W.has_tool_quality(TOOL_WIRECUTTER)) construction_stage = 6 user.update_examine_panel(src) to_chat(user, "You mend the outer grille.") @@ -319,8 +319,8 @@ return if(4) var/cut_cover - if(istype(W,/obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) return if(WT.remove_fuel(0,user)) @@ -340,7 +340,7 @@ update_icon() to_chat(user, "You press firmly on the cover, dislodging it.") return - else if (W.is_screwdriver()) + else if (W.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You begin screwing down the support lines.") playsound(src, W.usesound, 100, 1) if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) @@ -351,7 +351,7 @@ to_chat(user, "You screw down the support lines.") return if(3) - if (W.is_crowbar()) + if (W.has_tool_quality(TOOL_CROWBAR)) to_chat(user, "You struggle to pry off the cover.") playsound(src, W.usesound, 100, 1) if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 3) @@ -362,7 +362,7 @@ to_chat(user, "You pry off the cover.") return if(2) - if (W.is_wrench()) + if (W.has_tool_quality(TOOL_WRENCH)) to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame.") playsound(src, W.usesound, 100, 1) if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 2) @@ -374,8 +374,8 @@ return if(1) var/cut_cover - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if( WT.remove_fuel(0,user) ) cut_cover=1 else @@ -394,7 +394,7 @@ to_chat(user, "You slice through the support rods.") return if(0) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) to_chat(user, "You struggle to pry off the outer sheath.") playsound(src, W.usesound, 100, 1) if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || !user || !W || !T ) diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 1a0b58bdc9..5ad969bda0 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -70,7 +70,7 @@ if((!A.secured) && (!secured)) attach_assembly(A,user) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(toggle_secure()) to_chat(user, "\The [src] is ready!") else diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index f4d544f040..52ab8e67cb 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -103,7 +103,7 @@ ..() /obj/item/device/assembly_holder/attackby(var/obj/item/weapon/W, var/mob/user) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(!a_left || !a_right) to_chat(user, " BUG:Assembly part missing, please report this!") return diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index d3f518bbc8..8dab46f163 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -14,7 +14,7 @@ return /obj/item/assembly/shock_kit/attackby(var/obj/item/weapon/W, var/mob/user) - if(W.is_wrench() && !status) + if(W.has_tool_quality(TOOL_WRENCH) && !status) var/turf/T = loc if(ismob(T)) T = T.loc @@ -26,7 +26,7 @@ part2 = null qdel(src) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) status = !status to_chat(user, "[src] is now [status ? "secured" : "unsecured"]!") playsound(src, W.usesound, 50, 1) diff --git a/code/modules/casino/slots.dm b/code/modules/casino/slots.dm index 40c7e5af61..654d872b0e 100644 --- a/code/modules/casino/slots.dm +++ b/code/modules/casino/slots.dm @@ -61,7 +61,7 @@ if(busy) to_chat(user,"The slot machine is currently running. ") return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") @@ -291,7 +291,7 @@ if(busy) to_chat(user,"The slot machine is currently running. ") return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 749ebe9b1a..e11e2647b9 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -342,7 +342,7 @@ return 0 // return 1 to cancel attack_hand() /*/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user) - if(W.is_wirecutter() || istype(W, /obj/item/weapon/scalpel)) + if(W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/weapon/scalpel)) if (clipped) to_chat(user, "The [src] have already been clipped!") update_icon() diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm index 9316c8f64f..3ed26e4126 100644 --- a/code/modules/clothing/gloves/boxing.dm +++ b/code/modules/clothing/gloves/boxing.dm @@ -6,7 +6,7 @@ /* /obj/item/clothing/gloves/boxing/attackby(obj/item/weapon/W, mob/user) - if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel)) + if(W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/weapon/surgical/scalpel)) to_chat(user, "That won't work.") //Nope return ..() diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm index a3a37772b3..4b12f8382e 100644 --- a/code/modules/clothing/masks/hailer.dm +++ b/code/modules/clothing/masks/hailer.dm @@ -102,7 +102,7 @@ return /obj/item/clothing/mask/gas/sechailer/attackby(obj/item/I, mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) switch(aggressiveness) if(1) to_chat(user, "You set the aggressiveness restrictor to the second position.") @@ -122,11 +122,11 @@ phrase = 1 if(5) to_chat(user, "You adjust the restrictor but nothing happens, probably because its broken.") - if(I.is_wirecutter()) + if(I.has_tool_quality(TOOL_WIRECUTTER)) if(aggressiveness != 5) to_chat(user, "You broke it!") aggressiveness = 5 - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) if(!hailer) to_chat(user, "This mask has an integrated hailer, you can't remove it!") else diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 6f23f2b57f..c12caa2e02 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -203,7 +203,7 @@ var/global/list/breach_burn_descriptors = list( repair_breaches(BURN, use_amt * repair_power, user) return - else if(istype(W, /obj/item/weapon/weldingtool)) + else if(W.has_tool_quality(TOOL_WELDER)) if(istype(src.loc,/mob/living)) to_chat(user, "How do you intend to patch a hardsuit while someone is wearing it?") @@ -213,7 +213,7 @@ var/global/list/breach_burn_descriptors = list( to_chat(user, "There is no structural damage on \the [src] to repair.") return - var/obj/item/weapon/weldingtool/WT = W + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.remove_fuel(5)) to_chat(user, "You need more welding fuel to repair this suit.") return diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm index 9ce406fccf..e6c48734df 100644 --- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm +++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm @@ -7,7 +7,7 @@ return // Pass repair items on to the chestpiece. - if(chest && (istype(W,/obj/item/stack/material) || istype(W, /obj/item/weapon/weldingtool))) + if(chest && (istype(W,/obj/item/stack/material) || W.has_tool_quality(TOOL_WELDER))) return chest.attackby(W,user) // Lock or unlock the access panel. @@ -30,7 +30,7 @@ to_chat(user, "You [locked ? "lock" : "unlock"] \the [src] access panel.") return - else if(W.is_crowbar()) + else if(W.has_tool_quality(TOOL_CROWBAR)) if(!open && locked) to_chat(user, "The access panel is locked shut.") return @@ -41,7 +41,7 @@ if(open) // Hacking. - if(W.is_wirecutter() || istype(W, /obj/item/device/multitool)) + if(W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/multitool)) if(open) wires.Interact(user) else @@ -102,7 +102,7 @@ src.cell = W return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(!air_supply) to_chat(user, "There is no tank to remove.") @@ -116,7 +116,7 @@ air_supply = null return - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) var/list/current_mounts = list() if(cell) current_mounts += "cell" diff --git a/code/modules/clothing/spacesuits/void/ert_vr.dm b/code/modules/clothing/spacesuits/void/ert_vr.dm index 7f253ddfe8..8b147a4dc3 100644 --- a/code/modules/clothing/spacesuits/void/ert_vr.dm +++ b/code/modules/clothing/spacesuits/void/ert_vr.dm @@ -77,7 +77,7 @@ to_chat(user, "You cannot modify \the [src] while it is being worn.") return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(boots || tank || cooler) var/choice = tgui_input_list(usr, "What component would you like to remove?", "Remove Component", list(boots,tank,cooler)) if(!choice) return diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 57a713962c..7d421348cc 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -241,7 +241,7 @@ to_chat(user, "You cannot modify \the [src] while it is being worn.") return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(helmet || boots || tank) var/choice = tgui_input_list(usr, "What component would you like to remove?", "Remove Component", list(helmet,boots,tank,cooler)) if(!choice) return diff --git a/code/modules/clothing/spacesuits/void/void_vr.dm b/code/modules/clothing/spacesuits/void/void_vr.dm index 2b9fc754a3..9222a4ca9c 100644 --- a/code/modules/clothing/spacesuits/void/void_vr.dm +++ b/code/modules/clothing/spacesuits/void/void_vr.dm @@ -10,7 +10,7 @@ /obj/item/clothing/suit/space/void species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) - + /obj/item/clothing/head/helmet/space/void/heck name = "\improper H.E.C.K. helmet" desc = "Hostile Environiment Cross-Kinetic Helmet: A helmet designed to withstand the wide variety of hazards from \[REDACTED\]. It wasn't enough for its last owner." @@ -114,7 +114,7 @@ to_chat(user, "You cannot modify \the [src] while it is being worn.") return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(boots || tank || cooler) var/choice = tgui_input_list(usr, "What component would you like to remove?", "Remove Component", list(boots,tank,cooler)) if(!choice) return @@ -151,4 +151,3 @@ default_worn_icon = 'icons/inventory/head/mob_vr.dmi' sprite_sheets = ALL_VR_SPRITE_SHEETS_HEAD_MOB sprite_sheets_obj = null - \ No newline at end of file diff --git a/code/modules/economy/cash_register.dm b/code/modules/economy/cash_register.dm index ae649a8f4d..8c799597ea 100644 --- a/code/modules/economy/cash_register.dm +++ b/code/modules/economy/cash_register.dm @@ -190,7 +190,7 @@ scan_cash(SC) else if(istype(O, /obj/item/weapon/card/emag)) return ..() - else if(O.is_wrench()) + else if(O.has_tool_quality(TOOL_WRENCH)) var/obj/item/weapon/tool/wrench/W = O toggle_anchors(W, user) // Not paying: Look up price and add it to transaction_amount diff --git a/code/modules/economy/coins.dm b/code/modules/economy/coins.dm index 51438cc101..87056deecd 100644 --- a/code/modules/economy/coins.dm +++ b/code/modules/economy/coins.dm @@ -81,7 +81,7 @@ else to_chat(user, "This cable coil appears to be empty.") return - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) if(!string_attached) ..() return diff --git a/code/modules/economy/vending.dm b/code/modules/economy/vending.dm index e17d5c951f..be0303a41f 100644 --- a/code/modules/economy/vending.dm +++ b/code/modules/economy/vending.dm @@ -216,7 +216,7 @@ GLOBAL_LIST_EMPTY(vending_products) else to_chat(user, "You cannot refill [src] with [RC].") return - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") playsound(src, W.usesound, 50, 1) @@ -228,7 +228,7 @@ GLOBAL_LIST_EMPTY(vending_products) SStgui.update_uis(src) // Speaker switch is on the main UI, not wires UI return - else if(istype(W, /obj/item/device/multitool) || W.is_wirecutter()) + else if(istype(W, /obj/item/device/multitool) || W.has_tool_quality(TOOL_WIRECUTTER)) if(panel_open) attack_hand(user) return @@ -240,7 +240,7 @@ GLOBAL_LIST_EMPTY(vending_products) to_chat(user, "You insert \the [W] into \the [src].") SStgui.update_uis(src) return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index 8f5bffa804..b29eb65bc1 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -51,7 +51,7 @@ update_icon() /obj/item/weapon/material/fishing_rod/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_wirecutter() && strung) + if(I.has_tool_quality(TOOL_WIRECUTTER) && strung) strung = FALSE to_chat(user, "You cut \the [src]'s string!") update_icon() diff --git a/code/modules/food/kitchen/cooking_machines/_appliance.dm b/code/modules/food/kitchen/cooking_machines/_appliance.dm index 7f71133f3a..07d812f8b5 100644 --- a/code/modules/food/kitchen/cooking_machines/_appliance.dm +++ b/code/modules/food/kitchen/cooking_machines/_appliance.dm @@ -242,7 +242,7 @@ else if(istype(check, /obj/item/weapon/disk/nuclear)) to_chat(user, "You can't cook that.") return 0 - else if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/weapon/storage/part_replacer)) // You can't cook tools, dummy. + else if(I.has_tool_quality(TOOL_CROWBAR) || I.has_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/weapon/storage/part_replacer)) // You can't cook tools, dummy. return 0 else if(!istype(check) && !istype(check, /obj/item/weapon/holder)) to_chat(user, "That's not edible.") @@ -606,7 +606,7 @@ /obj/machinery/appliance/attack_hand(var/mob/user) if(..()) return - + if(cooking_objs.len) removal_menu(user) diff --git a/code/modules/food/kitchen/cooking_machines/oven.dm b/code/modules/food/kitchen/cooking_machines/oven.dm index bcebc851a0..e16b7a2ce0 100644 --- a/code/modules/food/kitchen/cooking_machines/oven.dm +++ b/code/modules/food/kitchen/cooking_machines/oven.dm @@ -110,7 +110,7 @@ /obj/machinery/appliance/cooker/oven/proc/manip(var/obj/item/I) // check if someone's trying to manipulate the machine - if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/weapon/storage/part_replacer)) + if(I.has_tool_quality(TOOL_CROWBAR) || I.has_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/weapon/storage/part_replacer)) return TRUE else return FALSE diff --git a/code/modules/food/kitchen/microwave.dm b/code/modules/food/kitchen/microwave.dm index cfc6ee5d5d..4ee7ad9de0 100644 --- a/code/modules/food/kitchen/microwave.dm +++ b/code/modules/food/kitchen/microwave.dm @@ -77,7 +77,7 @@ /obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob) if(src.broken > 0) - if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver + if(src.broken == 2 && O.has_tool_quality(TOOL_SCREWDRIVER)) // If it's broken and they're using a screwdriver user.visible_message( \ "\The [user] starts to fix part of the microwave.", \ "You start to fix part of the microwave." \ @@ -89,7 +89,7 @@ "You have fixed part of the microwave." \ ) src.broken = 1 // Fix it a bit - else if(src.broken == 1 && O.is_wrench()) // If it's broken and they're doing the wrench + else if(src.broken == 1 && O.has_tool_quality(TOOL_WRENCH)) // If it's broken and they're doing the wrench user.visible_message( \ "\The [user] starts to fix part of the microwave.", \ "You start to fix part of the microwave." \ @@ -190,10 +190,10 @@ var/obj/item/weapon/grab/G = O to_chat(user, "This is ridiculous. You can not fit \the [G.affecting] in this [src].") return 1 - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) default_deconstruction_screwdriver(user, O) return - else if(O.is_crowbar()) + else if(O.has_tool_quality(TOOL_CROWBAR)) if(default_deconstruction_crowbar(user, O)) return else diff --git a/code/modules/food/kitchen/smartfridge/smartfridge.dm b/code/modules/food/kitchen/smartfridge/smartfridge.dm index 1a10b3c219..90f0cff8ad 100644 --- a/code/modules/food/kitchen/smartfridge/smartfridge.dm +++ b/code/modules/food/kitchen/smartfridge/smartfridge.dm @@ -96,7 +96,7 @@ add_overlay("[icon_base]-[icon_contents]3") /obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].") playsound(src, O.usesound, 50, 1) @@ -106,7 +106,7 @@ if(wrenchable && default_unfasten_wrench(user, O, 20)) return - if(istype(O, /obj/item/device/multitool) || O.is_wirecutter()) + if(istype(O, /obj/item/device/multitool) || O.has_tool_quality(TOOL_WIRECUTTER)) if(panel_open) attack_hand(user) return diff --git a/code/modules/games/dice.dm b/code/modules/games/dice.dm index b91fb73d1e..2d2b2dbaf9 100644 --- a/code/modules/games/dice.dm +++ b/code/modules/games/dice.dm @@ -16,7 +16,7 @@ /obj/item/weapon/dice/attackby(obj/item/weapon/W, mob/user) ..() - if(istype(W, /obj/item/weapon/weldingtool) || istype(W, /obj/item/weapon/flame/lighter)) + if(W.has_tool_quality(TOOL_WELDER) || istype(W, /obj/item/weapon/flame/lighter)) if(cheater) to_chat(user, "Wait, this [name] is already weighted!") else if(tamper_proof) diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index cf2a19f46a..5ae93bfd9c 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -206,11 +206,11 @@ if(W.flags & NOBLUDGEON) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "It's a holowindow, you can't unfasten it!") - else if(W.is_crowbar() && reinf && state <= 1) + else if(W.has_tool_quality(TOOL_CROWBAR) && reinf && state <= 1) to_chat(user, "It's a holowindow, you can't pry it!") - else if(W.is_wrench() && !anchored && (!state || !reinf)) + else if(W.has_tool_quality(TOOL_WRENCH) && !anchored && (!state || !reinf)) to_chat(user, "It's a holowindow, you can't dismantle it!") else if(W.damtype == BRUTE || W.damtype == BURN) @@ -267,12 +267,12 @@ qdel(src) /obj/structure/bed/chair/holochair/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) to_chat(user, "It's a holochair, you can't dismantle it!") return //VOREStation Add /obj/structure/bed/holobed/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) to_chat(user, "It's a holochair, you can't dismantle it!") return //VOREStation Add End diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index 20d544f701..126232754b 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -36,12 +36,12 @@ . += "The lid is open." /obj/machinery/beehive/attackby(var/obj/item/I, var/mob/user) - if(I.is_crowbar()) + if(I.has_tool_quality(TOOL_CROWBAR)) closed = !closed user.visible_message(SPAN_NOTICE("[user] [closed ? "closes" : "opens"] \the [src]."), SPAN_NOTICE("You [closed ? "close" : "open"] \the [src].")) update_icon() return - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, I.usesound, 50, 1) user.visible_message(SPAN_NOTICE("[user] [anchored ? "wrenches" : "unwrenches"] \the [src]."), SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src].")) @@ -107,7 +107,7 @@ if(smoked) to_chat(user, "The hive is smoked.") return 1 - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(bee_count) to_chat(user, SPAN_NOTICE("You can't dismantle \the [src] with these bees inside.")) return diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 8919b4ede5..128c1dc745 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -96,7 +96,7 @@ if(default_deconstruction_screwdriver(user, W)) return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) to_chat(user, "You [anchored ? "un" : ""]secure \the [src].") anchored = !anchored diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm index 749f6e4920..0ad03d2826 100644 --- a/code/modules/hydroponics/seed_storage.dm +++ b/code/modules/hydroponics/seed_storage.dm @@ -245,7 +245,7 @@ /obj/machinery/seed_storage/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) var/list/data = ..() - + if(smart) scanner = list("stats", "produce", "soil", "temperature", "light", "pressure") else @@ -402,18 +402,18 @@ else to_chat(user, "There are no seeds in \the [O.name].") return - else if(O.is_wrench()) + else if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") playsound(src, O.usesound, 50, 1) cut_overlays() if(panel_open) add_overlay("[initial(icon_state)]-panel") - else if((O.is_wirecutter() || istype(O, /obj/item/device/multitool)) && panel_open) + else if((O.has_tool_quality(TOOL_WIRECUTTER) || istype(O, /obj/item/device/multitool)) && panel_open) wires.Interact(user) /obj/machinery/seed_storage/emag_act(var/remaining_charges, var/mob/user) diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index a92de0ba98..224c7ee0c7 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -245,7 +245,7 @@ user.setClickCooldown(user.get_attack_speed(W)) SSplants.add_plant(src) - if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel)) + if(W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/weapon/surgical/scalpel)) if(sampled) to_chat(user, "\The [src] has already been sampled recently.") return diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 090e78803b..8a0a4c2c04 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -489,7 +489,7 @@ if(O.is_open_container()) return 0 - if(O.is_wirecutter() || istype(O, /obj/item/weapon/surgical/scalpel)) + if(O.has_tool_quality(TOOL_WIRECUTTER) || istype(O, /obj/item/weapon/surgical/scalpel)) if(!seed) to_chat(user, "There is nothing to take a sample from in \the [src].") @@ -584,7 +584,7 @@ qdel(O) check_health() - else if(mechanical && O.is_wrench()) + else if(mechanical && O.has_tool_quality(TOOL_WRENCH)) //If there's a connector here, the portable_atmospherics setup can handle it. if(locate(/obj/machinery/atmospherics/portables_connector/) in loc) diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 20802b90cc..8262768d3a 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -271,7 +271,7 @@ visible_message("\The [user] waves \the [src] around [target].") /obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user) - if(can_anchor && I.is_wrench()) + if(can_anchor && I.has_tool_quality(TOOL_WRENCH)) anchored = !anchored to_chat(user, span("notice", "You've [anchored ? "" : "un"]secured \the [src] to \the [get_turf(src)].")) if(anchored) @@ -290,14 +290,14 @@ tgui_interact(user) return TRUE - else if(I.is_crowbar()) + else if(I.has_tool_quality(TOOL_CROWBAR)) playsound(src, 'sound/items/Crowbar.ogg', 50, 1) opened = !opened to_chat(user, "You [opened ? "opened" : "closed"] \the [src].") update_icon() return TRUE - else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.is_screwdriver()) + else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.has_tool_quality(TOOL_SCREWDRIVER)) if(opened) tgui_interact(user) return TRUE @@ -397,4 +397,4 @@ // Returns TRUE if I is something that could/should have a valid interaction. Used to tell circuitclothes to hit the circuit with something instead of the clothes /obj/item/device/electronic_assembly/proc/is_valid_tool(var/obj/item/I) - return I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics) + return I.has_tool_quality(TOOL_CROWBAR) || I.has_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics) diff --git a/code/modules/integrated_electronics/core/assemblies/device.dm b/code/modules/integrated_electronics/core/assemblies/device.dm index 8500f4dafc..d23446dceb 100644 --- a/code/modules/integrated_electronics/core/assemblies/device.dm +++ b/code/modules/integrated_electronics/core/assemblies/device.dm @@ -12,7 +12,7 @@ ..() /obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob) - if (I.is_crowbar()) + if (I.has_tool_quality(TOOL_CROWBAR)) toggle_open(user) else if (opened) EA.attackby(I, user) diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm index f5b850ef5e..75b6e85fb4 100644 --- a/code/modules/integrated_electronics/core/tools.dm +++ b/code/modules/integrated_electronics/core/tools.dm @@ -274,7 +274,6 @@ /obj/item/weapon/tool/screwdriver, /obj/item/device/multitool ) - cant_hold = list(/obj/item/weapon/tool/screwdriver/power) /obj/item/weapon/storage/bag/circuits/basic/Initialize() . = ..() diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index a4ebf411da..0b11c0ef15 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -38,11 +38,11 @@ return else name = ("bookcase ([newname])") - else if(O.is_wrench()) + else if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 100, 1) to_chat(user, (anchored ? "You unfasten \the [src] from the floor." : "You secure \the [src] to the floor.")) anchored = !anchored - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, O.usesound, 75, 1) to_chat(user, "You begin dismantling \the [src].") if(do_after(user,25 * O.toolspeed)) @@ -281,7 +281,7 @@ Book Cart End return scanner.computer.inventory.Add(src) to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'") - else if(istype(W, /obj/item/weapon/material/knife) || W.is_wirecutter()) + else if(istype(W, /obj/item/weapon/material/knife) || W.has_tool_quality(TOOL_WIRECUTTER)) if(carved) return to_chat(user, "You begin to carve out [title].") if(do_after(user, 30)) diff --git a/code/modules/materials/sheets/metals/rods.dm b/code/modules/materials/sheets/metals/rods.dm index 9ebd0fd92f..dbb30c19d9 100644 --- a/code/modules/materials/sheets/metals/rods.dm +++ b/code/modules/materials/sheets/metals/rods.dm @@ -43,8 +43,8 @@ var/global/list/datum/stack_recipe/rods_recipes = list( \ new/datum/stack_recipe("catwalk", /obj/structure/catwalk, 2, time = 80, one_per_turf = 1, on_floor = 1)) /obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(get_amount() < 2) to_chat(user, "You need at least two rods to do this.") diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index e12b667047..b413ac8ee5 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -445,7 +445,7 @@ if(default_part_replacement(user,W)) return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(istype(get_turf(src), /turf/space)) to_chat(user, "You can't anchor something to empty space. Idiot.") diff --git a/code/modules/mining/shelter_atoms_vr.dm b/code/modules/mining/shelter_atoms_vr.dm index 6c209191e1..2f4ad9e46f 100644 --- a/code/modules/mining/shelter_atoms_vr.dm +++ b/code/modules/mining/shelter_atoms_vr.dm @@ -234,7 +234,7 @@ GLOBAL_LIST_EMPTY(unique_deployable) pixel_y = -32 /obj/item/device/gps/computer/attackby(obj/item/I, mob/living/user) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) user.visible_message("[user] disassembles [src].", "You start to disassemble [src]...", "You hear clanking and banging noises.") if(do_after(user,4 SECONDS,src)) @@ -300,7 +300,7 @@ GLOBAL_LIST_EMPTY(unique_deployable) qdel(src) /obj/structure/fans/attackby(obj/item/I, mob/living/user) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) user.visible_message("[user] disassembles [src].", "You start to disassemble [src]...", "You hear clanking and banging noises.") if(do_after(user,4 SECONDS,src)) diff --git a/code/modules/mob/living/bot/SLed209bot.dm b/code/modules/mob/living/bot/SLed209bot.dm index f016bc55f2..a32a88973e 100644 --- a/code/modules/mob/living/bot/SLed209bot.dm +++ b/code/modules/mob/living/bot/SLed209bot.dm @@ -99,8 +99,8 @@ icon_state = "ed209_shell" if(3) - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) build_step++ name = "shielded frame assembly" @@ -150,7 +150,7 @@ qdel(W) if(8) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 100, 1) var/turf/T = get_turf(user) to_chat(user, "Now attaching the gun to the frame...") diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 9e4eb0c2a5..e9ab9b665c 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -121,7 +121,7 @@ else to_chat(user, "Access denied.") return - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) if(!locked) open = !open to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].") @@ -129,7 +129,7 @@ else to_chat(user, "You need to unlock the controls first.") return - else if(istype(O, /obj/item/weapon/weldingtool)) + else if(O.has_tool_quality(TOOL_WELDER)) if(health < getMaxHealth()) if(open) if(getBruteLoss() < 10) @@ -161,7 +161,7 @@ to_chat(user, span_notice("You slot the card into \the [initial(src.name)].")) else to_chat(user, span_notice("You must open the panel first!")) - else if(O.is_crowbar()) + else if(O.has_tool_quality(TOOL_CROWBAR)) if(open && paicard) to_chat(user, span_notice("You are attempting to remove the pAI..")) if(do_after(user,10 * O.toolspeed)) diff --git a/code/modules/mob/living/bot/ed209bot.dm b/code/modules/mob/living/bot/ed209bot.dm index f699191a66..bca6624512 100644 --- a/code/modules/mob/living/bot/ed209bot.dm +++ b/code/modules/mob/living/bot/ed209bot.dm @@ -119,8 +119,8 @@ icon_state = "ed209_shell" if(3) - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) build_step++ name = "shielded frame assembly" @@ -188,7 +188,7 @@ qdel(W) if(8) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 100, 1) var/turf/T = get_turf(user) to_chat(user, "Now attaching the gun to the frame...") diff --git a/code/modules/mob/living/bot/edCLNbot.dm b/code/modules/mob/living/bot/edCLNbot.dm index ffdcdb1f44..3a8265f352 100644 --- a/code/modules/mob/living/bot/edCLNbot.dm +++ b/code/modules/mob/living/bot/edCLNbot.dm @@ -153,8 +153,8 @@ icon_state = "edCLN_bucket" if(3) - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) build_step++ name = "bucketed frame assembly" @@ -194,7 +194,7 @@ qdel(W) if(7) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 100, 1) var/turf/T = get_turf(user) to_chat(user, "Attatching the mop to the frame...") diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index a9854f0148..a0f485df78 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -436,8 +436,8 @@ /obj/item/weapon/secbot_assembly/attackby(var/obj/item/W, var/mob/user) ..() - if(istype(W, /obj/item/weapon/weldingtool) && !build_step) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER) && !build_step) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.remove_fuel(0, user)) build_step = 1 add_overlay("hs_hole") diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm index fef1206c66..c9978eb507 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm @@ -74,7 +74,7 @@ return /obj/structure/bed/double/weaversilk_nest/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench() || istype(W,/obj/item/stack) || W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WRENCH) || istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER)) return ..() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index ee77cbfe00..ea9cdc3579 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -763,7 +763,7 @@ var/list/ai_verbs_default = list( var/obj/item/device/aicard/card = W card.grab_ai(src, user) - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(user == deployed_shell) to_chat(user, "The shell's subsystems resist your efforts to tamper with your bolts.") return diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 7cfa78b731..fadd1fbf13 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -231,7 +231,7 @@ var/list/mob_hat_cache = list() to_chat(user, "\The [src] is not compatible with \the [W].") return - else if (W.is_crowbar()) + else if (W.has_tool_quality(TOOL_CROWBAR)) to_chat(user, "\The [src] is hermetically sealed. You can't open the case.") return diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index ffd727ecb7..8df2be1e13 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -546,16 +546,16 @@ M.install(src, user) return - if (istype(W, /obj/item/weapon/weldingtool) && user.a_intent != I_HURT) - if (src == user) + if(W.has_tool_quality(TOOL_WELDER) && user.a_intent != I_HURT) + if(src == user) to_chat(user, "You lack the reach to be able to repair yourself.") return - if (!getBruteLoss()) + if(!getBruteLoss()) to_chat(user, "Nothing to fix here!") return - var/obj/item/weapon/weldingtool/WT = W - if (WT.remove_fuel(0)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() + if(WT.remove_fuel(0)) user.setClickCooldown(user.get_attack_speed(WT)) adjustBruteLoss(-30) updatehealth() @@ -567,7 +567,7 @@ return else if(istype(W, /obj/item/stack/cable_coil) && (wiresexposed || istype(src,/mob/living/silicon/robot/drone))) - if (!getFireLoss()) + if(!getFireLoss()) to_chat(user, "Nothing to fix here!") return var/obj/item/stack/cable_coil/coil = W @@ -578,7 +578,7 @@ for(var/mob/O in viewers(user, null)) O.show_message("[user] has fixed some of the burnt wires on [src]!", 1) - else if (W.is_crowbar() && user.a_intent != I_HURT) // crowbar means open or close the cover + else if(W.has_tool_quality(TOOL_CROWBAR) && user.a_intent != I_HURT) // crowbar means open or close the cover if(opened) if(cell) to_chat(user, "You close the cover.") @@ -655,26 +655,26 @@ C.brute_damage = 0 C.electronics_damage = 0 - else if (W.is_wirecutter() || istype(W, /obj/item/device/multitool)) + else if (W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/multitool)) if (wiresexposed) wires.Interact(user) else to_chat(user, "You can't reach the wiring.") - else if(W.is_screwdriver() && opened && !cell) // haxing + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && opened && !cell) // haxing wiresexposed = !wiresexposed to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]") playsound(src, W.usesound, 50, 1) update_icon() - else if(W.is_screwdriver() && opened && cell) // radio + else if(W.has_tool_quality(TOOL_SCREWDRIVER) && opened && cell) // radio if(radio) radio.attackby(W,user)//Push it to the radio to let it handle everything else to_chat(user, "Unable to locate a radio.") update_icon() - else if(W.is_wrench() && opened && !cell) + else if(W.has_tool_quality(TOOL_WRENCH) && opened && !cell) if(bolt) to_chat(user,"You begin removing \the [bolt].") diff --git a/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs_altevian.dm b/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs_altevian.dm index b623e850b3..114be552cd 100644 --- a/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs_altevian.dm +++ b/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs_altevian.dm @@ -62,7 +62,7 @@ attacktext = list("whacked", "slammed", "bashed", "clonked", "bonked") attack_sound = 'sound/weapons/smash.ogg' - loot_list = list(/obj/item/weapon/melee/altevian_wrench = 100) + loot_list = list(/obj/item/weapon/tool/transforming/altevian = 100) /mob/living/simple_mob/humanoid/merc/altevian/ranged desc = "Altevian Naval Salvage Guard, adorned in the top of the line Heartbreaker suit. Armed with a small energy gun." diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 4cc9c8ba89..539e051689 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -146,7 +146,7 @@ try_install_component(user, C) else to_chat(user, "This component is too large for \the [src].") - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) var/list/components = get_all_components() if(components.len) to_chat(user, "Remove all components from \the [src] before disassembling it.") @@ -155,8 +155,8 @@ src.visible_message("\The [src] has been disassembled by [user].") qdel(src) return - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) to_chat(user, "\The [W] is off.") return @@ -171,7 +171,7 @@ to_chat(user, "You repair \the [src].") return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) var/list/all_components = get_all_components() if(!all_components.len) to_chat(user, "This device doesn't have any components installed.") diff --git a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm index f1ae59c80c..5d701ef5f0 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm @@ -25,7 +25,7 @@ name = "telescreen" /obj/item/modular_computer/telescreen/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if(anchored) shutdown_computer() anchored = FALSE diff --git a/code/modules/multiz/ladder_assembly_vr.dm b/code/modules/multiz/ladder_assembly_vr.dm index b6e5bddf7e..377a956227 100644 --- a/code/modules/multiz/ladder_assembly_vr.dm +++ b/code/modules/multiz/ladder_assembly_vr.dm @@ -24,7 +24,7 @@ else if(istype(get_area(src), /area/shuttle)) to_chat(user, "\The [src] cannot be constructed on a shuttle.") return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) switch(state) if(CONSTRUCTION_UNANCHORED) state = CONSTRUCTION_WRENCHED @@ -44,8 +44,8 @@ to_chat(user, "\The [src] needs to be unwelded.") return - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() switch(state) if(CONSTRUCTION_UNANCHORED) to_chat(user, "The refinforcing bolts need to be secured.") diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index d8f7aeebac..5461bfaa74 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -220,7 +220,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable //Attackby proc, for maintenance /obj/item/device/nif/attackby(obj/item/weapon/W, mob/user as mob) - if(open == 0 && W.is_screwdriver()) + if(open == 0 && W.has_tool_quality(TOOL_SCREWDRIVER)) if(do_after(user, 4 SECONDS, src) && open == 0) user.visible_message("[user] unscrews and pries open \the [src].","You unscrew and pry open \the [src].") playsound(src, 'sound/items/Screwdriver.ogg', 50, 1) @@ -246,7 +246,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable user.visible_message("[user] resets several circuits in \the [src].","You find and repair any faulty circuits in \the [src].") open = 3 update_icon() - else if(open == 3 && W.is_screwdriver()) + else if(open == 3 && W.has_tool_quality(TOOL_SCREWDRIVER)) if(do_after(user, 3 SECONDS, src) && open == 3) user.visible_message("[user] closes up \the [src].","You re-seal \the [src] for use once more.") playsound(src, 'sound/items/Screwdriver.ogg', 50, 1) diff --git a/code/modules/organs/internal/augment/armmounted.dm b/code/modules/organs/internal/augment/armmounted.dm index 932f4cf646..85b9f4aa5a 100644 --- a/code/modules/organs/internal/augment/armmounted.dm +++ b/code/modules/organs/internal/augment/armmounted.dm @@ -21,7 +21,7 @@ integrated_object_type = /obj/item/weapon/gun/energy/laser/mounted/augment /obj/item/organ/internal/augment/armmounted/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) switch(organ_tag) if(O_AUG_L_FOREARM) organ_tag = O_AUG_R_FOREARM @@ -66,7 +66,7 @@ integrated_object_type = /obj/item/weapon/portable_scanner /obj/item/organ/internal/augment/armmounted/hand/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) switch(organ_tag) if(O_AUG_L_HAND) organ_tag = O_AUG_R_HAND @@ -110,7 +110,7 @@ integrated_object_type = null /obj/item/organ/internal/augment/armmounted/shoulder/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) switch(organ_tag) if(O_AUG_L_UPPERARM) organ_tag = O_AUG_R_UPPERARM diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index bd77804b09..ec117338fa 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -485,7 +485,7 @@ var/list/organ_cache = list() return TRUE if(robotic >= ORGAN_ROBOT) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) return TRUE else diff --git a/code/modules/overmap/disperser/disperser.dm b/code/modules/overmap/disperser/disperser.dm index c7a5efd130..005ee3719e 100644 --- a/code/modules/overmap/disperser/disperser.dm +++ b/code/modules/overmap/disperser/disperser.dm @@ -22,7 +22,7 @@ to_chat(user, "The maintenance panel is open.") /obj/machinery/disperser/attackby(obj/item/I, mob/user) - if(I && I.is_wrench()) + if(I && I.has_tool_quality(TOOL_WRENCH)) if(panel_open) user.visible_message("\The [user] rotates \the [src] with \the [I].", "You rotate \the [src] with \the [I].") diff --git a/code/modules/overmap/overmap_shuttle.dm b/code/modules/overmap/overmap_shuttle.dm index d1bc6793bb..33af0f60f2 100644 --- a/code/modules/overmap/overmap_shuttle.dm +++ b/code/modules/overmap/overmap_shuttle.dm @@ -78,7 +78,7 @@ var/list/waypoints = S.get_waypoints(name) for(var/obj/effect/shuttle_landmark/LZ in waypoints) if(LZ.is_valid(src)) - res["[waypoints[LZ]] - [LZ.name]"] = LZ + res["[waypoints[LZ]] - [LZ.name]"] = LZ return res /datum/shuttle/autodock/overmap/get_location_name() @@ -167,7 +167,7 @@ ..() /obj/structure/fuel_port/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if(opened) to_chat(user, "You tightly shut \the [src] door.") playsound(src, 'sound/effects/locker_close.ogg', 25, 0, -3) diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index 21cd9654ee..18c0e36196 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -145,9 +145,9 @@ /obj/machinery/shipsensors/attackby(obj/item/weapon/W, mob/user) var/damage = max_health - health - if(damage && istype(W, /obj/item/weapon/weldingtool)) + if(damage && W.has_tool_quality(TOOL_WELDER)) - var/obj/item/weapon/weldingtool/WT = W + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) return diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 5f4ceef722..26e2a45de3 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -244,7 +244,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins user.drop_from_inventory(O) O.forceMove(src) scan = O - else if(O.is_multitool() && panel_open) + else if(O.has_tool_quality(TOOL_MULTITOOL) && panel_open) var/input = sanitize(tgui_input_text(usr, "What Department ID would you like to give this fax machine?", "Multitool-Fax Machine Interface", department)) if(!input) to_chat(usr, "No input found. Please hang up and try your call again.") diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 396390a650..e4f262b2ae 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -38,11 +38,11 @@ P.loc = src open_animation() SStgui.update_uis(src) - else if(P.is_wrench()) + else if(P.has_tool_quality(TOOL_WRENCH)) playsound(src, P.usesound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") - else if(P.is_screwdriver()) + else if(P.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You begin taking the [name] apart.") playsound(src, P.usesound, 50, 1) if(do_after(user, 10 * P.toolspeed)) diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 19a0994699..4360344029 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -35,7 +35,7 @@ if(istype(W, /obj/item/weapon/storage)) empty_bin(user, W) return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index ae9bb2f509..5ce9eacd99 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -166,7 +166,7 @@ to_chat(user, "This cartridge is not yet ready for replacement! Use up the rest of the toner.") flick("photocopier_notoner", src) playsound(loc, 'sound/machines/buzz-two.ogg', 75, 1) - else if(O.is_wrench()) + else if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") diff --git a/code/modules/persistence/graffiti.dm b/code/modules/persistence/graffiti.dm index e9a031bc8e..feb561f482 100644 --- a/code/modules/persistence/graffiti.dm +++ b/code/modules/persistence/graffiti.dm @@ -43,8 +43,8 @@ . += "\n It reads \"[message]\"." /obj/effect/decal/writing/attackby(var/obj/item/thing, var/mob/user) - if(istype(thing, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/welder = thing + if(thing.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/welder = thing.get_welder() if(welder.isOn() && welder.remove_fuel(0,user) && do_after(user, 5, src) && !QDELETED(src)) playsound(src.loc, welder.usesound, 50, 1) user.visible_message("\The [user] clears away some graffiti.") diff --git a/code/modules/persistence/noticeboard.dm b/code/modules/persistence/noticeboard.dm index c187225fa1..54f07d2a58 100644 --- a/code/modules/persistence/noticeboard.dm +++ b/code/modules/persistence/noticeboard.dm @@ -55,7 +55,7 @@ icon_state = "[base_icon_state][LAZYLEN(notices)]" /obj/structure/noticeboard/attackby(obj/item/I, mob/user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) var/choice = tgui_input_list(usr, "Which direction do you wish to place the noticeboard?", "Noticeboard Offset", list("North", "South", "East", "West", "No Offset")) if(choice && Adjacent(user) && I.loc == user && !user.incapacitated()) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) @@ -75,7 +75,7 @@ if("No Offset") return return - else if(I.is_wrench()) + else if(I.has_tool_quality(TOOL_WRENCH)) visible_message("[user] begins dismantling [src].") playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 50, src)) @@ -114,8 +114,8 @@ /obj/structure/noticeboard/tgui_data(mob/user) var/list/data = ..() - - + + var/list/tgui_notices = list() for(var/obj/item/I in src.notices) tgui_notices.Add(list(list( diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 8f3c3db009..189f029501 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -140,7 +140,7 @@ /obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user) if(!istype(W) || !user) return - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(!anchored) playsound(src, W.usesound, 75, 1) user.visible_message("[user.name] secures the [src.name] to the floor.", \ diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 8c0d3e9020..2245f7aca7 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -467,7 +467,7 @@ GLOBAL_LIST_EMPTY(apcs) if(issilicon(user) && get_dist(src,user) > 1) return attack_hand(user) add_fingerprint(user) - if(W.is_crowbar() && opened) + if(W.has_tool_quality(TOOL_CROWBAR) && opened) if(has_electronics == APC_HAS_ELECTRONICS_WIRED) if(terminal) to_chat(user, "Disconnect the wires first.") @@ -491,7 +491,7 @@ GLOBAL_LIST_EMPTY(apcs) else if(opened != 2) //cover isn't removed opened = 0 update_icon() - else if(W.is_crowbar() && !(stat & BROKEN) ) + else if(W.has_tool_quality(TOOL_CROWBAR) && !(stat & BROKEN) ) if(coverlocked && !(stat & MAINT)) to_chat(user, "The cover is locked and cannot be opened.") return @@ -517,7 +517,7 @@ GLOBAL_LIST_EMPTY(apcs) "You insert the power cell.") chargecount = 0 update_icon() - else if (W.is_screwdriver()) // haxing + else if (W.has_tool_quality(TOOL_SCREWDRIVER)) // haxing if(opened) if(cell) to_chat(user, "Remove the power cell first.") @@ -573,7 +573,7 @@ GLOBAL_LIST_EMPTY(apcs) "You add cables to the APC frame.") make_terminal() terminal.connect_to_network() - else if(W.is_wirecutter() && terminal && opened && has_electronics != APC_HAS_ELECTRONICS_SECURED) + else if(W.has_tool_quality(TOOL_WIRECUTTER) && terminal && opened && has_electronics != APC_HAS_ELECTRONICS_SECURED) var/turf/T = loc if(istype(T) && !T.is_plating()) to_chat(user, "You must remove the floor plating in front of the APC first.") @@ -605,8 +605,8 @@ GLOBAL_LIST_EMPTY(apcs) else if(istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics == APC_HAS_ELECTRONICS_NONE && ((stat & BROKEN))) to_chat(user, "The [src] is too broken for that. Repair it first.") return - else if(istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics == APC_HAS_ELECTRONICS_NONE && !terminal) - var/obj/item/weapon/weldingtool/WT = W + else if(W.has_tool_quality(TOOL_WELDER) && opened && has_electronics == APC_HAS_ELECTRONICS_NONE && !terminal) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(WT.get_fuel() < 3) to_chat(user, "You need more welding fuel to complete this task.") return @@ -674,7 +674,7 @@ GLOBAL_LIST_EMPTY(apcs) else if(istype(user, /mob/living/silicon)) return attack_hand(user) - if(!opened && wiresexposed && (istype(W, /obj/item/device/multitool) || W.is_wirecutter() || istype(W, /obj/item/device/assembly/signaler))) + if(!opened && wiresexposed && (istype(W, /obj/item/device/multitool) || W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/assembly/signaler))) return attack_hand(user) //Placeholder until someone can do take_damage() for APCs or something. to_chat(user, "The [name] looks too sturdy to bash open with \the [W.name].") diff --git a/code/modules/power/batteryrack_vr.dm b/code/modules/power/batteryrack_vr.dm index 8cc2b2c636..f6c4f3d36a 100644 --- a/code/modules/power/batteryrack_vr.dm +++ b/code/modules/power/batteryrack_vr.dm @@ -11,7 +11,7 @@ insert_cell(newcell) /obj/item/weapon/module/power_control/attackby(var/obj/item/I, var/mob/user) - if(I.is_multitool()) + if(I.has_tool_quality(TOOL_MULTITOOL)) to_chat(user, SPAN_NOTICE("You begin tweaking the power control circuits to support a power cell rack.")) if(do_after(user, 50 * I.toolspeed)) var/obj/item/newcircuit = new/obj/item/weapon/circuitboard/batteryrack(get_turf(user)) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index de42f2ba06..0b06dfbf31 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -177,7 +177,7 @@ var/list/possible_cable_coil_colours = list( if(!T.is_plating()) return - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) var/obj/item/stack/cable_coil/CC if(d1 == UP || d2 == UP) to_chat(user, "You must cut this cable from above.") diff --git a/code/modules/power/cable_ender.dm b/code/modules/power/cable_ender.dm index 5a581e37be..ba6359be63 100644 --- a/code/modules/power/cable_ender.dm +++ b/code/modules/power/cable_ender.dm @@ -24,7 +24,7 @@ /obj/structure/cable/ender/attackby(obj/item/W, mob/user) src.add_fingerprint(user) - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) to_chat(user, " These cables are too tough to be cut with those [W.name].") return else if(istype(W, /obj/item/stack/cable_coil)) diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm index 692dcd73d9..e37a8755d6 100644 --- a/code/modules/power/cable_heavyduty.dm +++ b/code/modules/power/cable_heavyduty.dm @@ -17,7 +17,7 @@ if(!T.is_plating()) return - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) to_chat(usr, "These cables are too tough to be cut with those [W.name].") return else if(istype(W, /obj/item/stack/cable_coil)) diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm index 08c413cd02..764d26c873 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm @@ -69,7 +69,7 @@ GLOBAL_LIST_EMPTY(fuel_injectors) cur_assembly = W return - if(W.is_wrench() || W.is_screwdriver() || W.is_crowbar() || istype(W, /obj/item/weapon/storage/part_replacer)) + if(W.has_tool_quality(TOOL_WRENCH) || W.has_tool_quality(TOOL_SCREWDRIVER) || W.has_tool_quality(TOOL_CROWBAR) || istype(W, /obj/item/weapon/storage/part_replacer)) if(injecting) to_chat(user, "Shut \the [src] off first!") return diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 20241cdc2c..30bb2c8df3 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -170,7 +170,7 @@ GLOBAL_LIST_EMPTY(all_turbines) attack_hand(user) /obj/machinery/power/generator/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 75, 1) anchored = !anchored user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \ diff --git a/code/modules/power/gravitygenerator_vr.dm b/code/modules/power/gravitygenerator_vr.dm index 8b4b1ccb96..40d0fc93ef 100644 --- a/code/modules/power/gravitygenerator_vr.dm +++ b/code/modules/power/gravitygenerator_vr.dm @@ -96,7 +96,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) /obj/machinery/gravity_generator/main/station/Initialize() . = ..() setup_parts() - middle.add_overlay("activated") + middle.add_overlay("activated") // // Generator an admin can spawn @@ -204,7 +204,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) /obj/machinery/gravity_generator/main/attackby(obj/item/I, mob/user, params) switch(broken_state) if(GRAV_NEEDS_SCREWDRIVER) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You secure the screws of the framework.") playsound(src, I.usesound, 75, 1) broken_state++ @@ -212,7 +212,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) return if(GRAV_NEEDS_WELDING) if(I.has_tool_quality(TOOL_WELDER)) - var/obj/item/weapon/weldingtool/W = I + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.remove_fuel(0,user)) to_chat(user, "You mend the damaged framework.") broken_state++ @@ -231,7 +231,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) to_chat(user, "You need 10 sheets of plasteel!") return if(GRAV_NEEDS_WRENCH) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) to_chat(user, "You secure the plating to the framework.") playsound(src, I.usesound, 75, 1) set_fix() @@ -408,7 +408,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) /obj/machinery/gravity_generator/main/proc/update_list() levels.Cut() var/my_z = get_z(src) - + //Actually doing it special this time instead of letting using_map decide if(using_map.use_overmap) var/obj/effect/overmap/visitable/S = get_overmap_sector(my_z) @@ -418,7 +418,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) levels = GetConnectedZlevels(my_z) else levels = GetConnectedZlevels(my_z) - + for(var/z in levels) if(!GLOB.gravity_generators["[z]"]) GLOB.gravity_generators["[z]"] = list() diff --git a/code/modules/power/grid_checker.dm b/code/modules/power/grid_checker.dm index 1409be9fef..60a268ca03 100644 --- a/code/modules/power/grid_checker.dm +++ b/code/modules/power/grid_checker.dm @@ -38,12 +38,12 @@ /obj/machinery/power/grid_checker/attackby(obj/item/W, mob/user) if(!user) return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) default_deconstruction_screwdriver(user, W) opened = !opened - else if(W.is_crowbar()) + else if(W.has_tool_quality(TOOL_CROWBAR)) default_deconstruction_crowbar(user, W) - else if(istype(W, /obj/item/device/multitool) || W.is_wirecutter()) + else if(istype(W, /obj/item/device/multitool) || W.has_tool_quality(TOOL_WIRECUTTER)) attack_hand(user) /obj/machinery/power/grid_checker/attack_hand(mob/user) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 806666abe8..454e491f70 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -103,7 +103,7 @@ var/global/list/light_type_cache = list() add_fingerprint(user) return - if (W.is_wrench()) + if (W.has_tool_quality(TOOL_WRENCH)) if (src.stage == 1) playsound(src, W.usesound, 75, 1) to_chat(usr, "You begin deconstructing [src].") @@ -122,7 +122,7 @@ var/global/list/light_type_cache = list() to_chat(usr, "You have to unscrew the case first.") return - if(W.is_wirecutter()) + if(W.has_tool_quality(TOOL_WIRECUTTER)) if (src.stage != 2) return src.stage = 1 src.update_icon() @@ -142,7 +142,7 @@ var/global/list/light_type_cache = list() "You add wires to [src].") return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if (src.stage == 2) src.stage = 3 src.update_icon() @@ -647,7 +647,7 @@ var/global/list/light_type_cache = list() // attempt to stick weapon into light socket else if(status == LIGHT_EMPTY) - if(W.is_screwdriver()) //If it's a screwdriver open it. + if(W.has_tool_quality(TOOL_SCREWDRIVER)) //If it's a screwdriver open it. playsound(src, W.usesound, 75, 1) user.visible_message("[user.name] opens [src]'s casing.", \ "You open [src]'s casing.", "You hear a noise.") @@ -665,7 +665,7 @@ var/global/list/light_type_cache = list() electrocute_mob(user, get_area(src), src, rand(0.7,1.0)) /obj/machinery/light/flamp/attackby(obj/item/W, mob/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, W.usesound, 50, 1) to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") @@ -678,7 +678,7 @@ var/global/list/light_type_cache = list() return else - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 75, 1) user.visible_message("[user.name] removes [src]'s lamp shade.", \ "You remove [src]'s lamp shade.", "You hear a noise.") diff --git a/code/modules/power/lightswitch_vr.dm b/code/modules/power/lightswitch_vr.dm index d5fe4cd6ab..e3776ede28 100644 --- a/code/modules/power/lightswitch_vr.dm +++ b/code/modules/power/lightswitch_vr.dm @@ -83,9 +83,9 @@ /obj/structure/construction/attackby(obj/item/weapon/W as obj, mob/user as mob) add_fingerprint(user) - if(istype(W, /obj/item/weapon/weldingtool)) + if(W.has_tool_quality(TOOL_WELDER)) if(stage == FRAME_UNFASTENED) - var/obj/item/weapon/weldingtool/WT = W + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.remove_fuel(0, user)) to_chat(user, "\The [src] must be on to complete this task.") return @@ -106,7 +106,7 @@ to_chat(user, "You have to remove the wires first.") return - else if(W.is_wirecutter()) + else if(W.has_tool_quality(TOOL_WIRECUTTER)) if (stage == FRAME_WIRED) stage = FRAME_FASTENED user.update_examine_panel(src) @@ -129,7 +129,7 @@ update_icon() return - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if (stage == FRAME_UNFASTENED) stage = FRAME_FASTENED user.update_examine_panel(src) diff --git a/code/modules/power/pacman2.dm b/code/modules/power/pacman2.dm index 81f73be63d..27f86867ed 100644 --- a/code/modules/power/pacman2.dm +++ b/code/modules/power/pacman2.dm @@ -70,7 +70,7 @@ O.loc = src to_chat(user, "You add the phoron tank to the generator.") else if(!active) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) if(anchored) @@ -78,14 +78,14 @@ else to_chat(user, "You unsecure the generator from the floor.") SSmachines.makepowernets() - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) open = !open playsound(src, O.usesound, 50, 1) if(open) to_chat(user, "You open the access panel.") else to_chat(user, "You close the access panel.") - else if(O.is_crowbar() && !open) + else if(O.has_tool_quality(TOOL_CROWBAR) && !open) playsound(src, O.usesound, 50, 1) var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc) for(var/obj/item/I in component_parts) diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index a9f0cd0e28..9160636125 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -279,7 +279,7 @@ updateUsrDialog() return else if(!active) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) if(!anchored) connect_to_network() to_chat(user, "You secure the generator to the floor.") diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 86a4d00edb..59abb2cca7 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -71,11 +71,11 @@ var/global/list/rad_collectors = list() W.loc = src update_icons() return 1 - else if(W.is_crowbar()) + else if(W.has_tool_quality(TOOL_CROWBAR)) if(P && !src.locked) eject() return 1 - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(P) to_chat(user, "Remove the phoron tank first.") return 1 diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index f578e42a9d..6c191479b8 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -158,7 +158,7 @@ /obj/machinery/power/emitter/attackby(obj/item/W, mob/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(active) to_chat(user, "Turn off [src] first.") return @@ -183,8 +183,8 @@ update_icon() // VOREStation Add return - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(active) to_chat(user, "Turn off [src] first.") return diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 758523b487..17c4d770e4 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -116,7 +116,7 @@ field_generator power level display if(active) to_chat(user, "The [src] needs to be off.") return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) switch(state) if(0) state = 1 @@ -135,8 +135,8 @@ field_generator power level display if(2) to_chat(user, "The [src.name] needs to be unwelded from the floor.") return - else if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + else if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() switch(state) if(0) to_chat(user, "The [src.name] needs to be wrenched to the floor.") diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm index 6e3a6d224d..ff2486d893 100644 --- a/code/modules/power/singularity/generator.dm +++ b/code/modules/power/singularity/generator.dm @@ -24,7 +24,7 @@ if(src) qdel(src) /obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, W.usesound, 75, 1) if(anchored) @@ -36,7 +36,7 @@ "You unsecure the [src.name] from the floor.", \ "You hear a ratchet.") return - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) panel_open = !panel_open playsound(src, W.usesound, 50, 1) visible_message("\The [user] adjusts \the [src]'s mechanisms.") diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index bf005048ca..4ef082b0ae 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -113,7 +113,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/structure/particle_accelerator/examine(mob/user) . = ..() - + switch(construction_state) if(0) . += "Looks like it's not attached to the flooring." @@ -204,14 +204,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps if(0) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 75, 1) src.anchored = TRUE user.visible_message("[user.name] secures the [src.name] to the floor.", \ "You secure the external bolts.") temp_state++ if(1) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 75, 1) src.anchored = FALSE user.visible_message("[user.name] detaches the [src.name] from the floor.", \ @@ -223,16 +223,16 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin "You add some wires.") temp_state++ if(2) - if(O.is_wirecutter())//TODO:Shock user if its on? + if(O.has_tool_quality(TOOL_WIRECUTTER))//TODO:Shock user if its on? user.visible_message("[user.name] removes some wires from the [src.name].", \ "You remove some wires.") temp_state-- - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) user.visible_message("[user.name] closes the [src.name]'s access panel.", \ "You close the access panel.") temp_state++ if(3) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) user.visible_message("[user.name] opens the [src.name]'s access panel.", \ "You open the access panel.") temp_state-- @@ -292,7 +292,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/machinery/particle_accelerator/examine(mob/user) . = ..() - + switch(construction_state) if(0) . += "Looks like it's not attached to the flooring." @@ -338,14 +338,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin var/temp_state = src.construction_state switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps if(0) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 75, 1) src.anchored = TRUE user.visible_message("[user.name] secures the [src.name] to the floor.", \ "You secure the external bolts.") temp_state++ if(1) - if(O.is_wrench()) + if(O.has_tool_quality(TOOL_WRENCH)) playsound(src, O.usesound, 75, 1) src.anchored = FALSE user.visible_message("[user.name] detaches the [src.name] from the floor.", \ @@ -357,16 +357,16 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin "You add some wires.") temp_state++ if(2) - if(O.is_wirecutter())//TODO:Shock user if its on? + if(O.has_tool_quality(TOOL_WIRECUTTER))//TODO:Shock user if its on? user.visible_message("[user.name] removes some wires from the [src.name].", \ "You remove some wires.") temp_state-- - else if(O.is_screwdriver()) + else if(O.has_tool_quality(TOOL_SCREWDRIVER)) user.visible_message("[user.name] closes the [src.name]'s access panel.", \ "You close the access panel.") temp_state++ if(3) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) user.visible_message("[user.name] opens the [src.name]'s access panel.", \ "You open the access panel.") temp_state-- diff --git a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm index 77c0858606..af901342d5 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm @@ -74,7 +74,7 @@ to_chat(user, "You add \the [reagent_container] to \the [src].") update_icon() return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) anchored = !anchored playsound(src, W.usesound, 75, 1) if(anchored) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 416734eae9..7e933ee14d 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -287,8 +287,8 @@ GLOBAL_LIST_EMPTY(smeses) to_chat(user, "You need to open access hatch on [src] first!") return FALSE - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W + if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/WT = W.get_welder() if(!WT.isOn()) to_chat(user, "Turn on \the [WT] first!") return FALSE @@ -319,7 +319,7 @@ GLOBAL_LIST_EMPTY(smeses) connect_to_network() return FALSE - else if(W.is_wirecutter() && !building_terminal) + else if(W.has_tool_quality(TOOL_WIRECUTTER) && !building_terminal) building_terminal = TRUE var/obj/machinery/power/terminal/term for(var/obj/machinery/power/terminal/T in get_turf(user)) diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index 44d3a748b5..47bd37f008 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -335,7 +335,7 @@ failure_probability = 0 // Crowbar - Disassemble the SMES. - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) if (terminals.len) to_chat(user, "You have to disassemble the terminal first!") return diff --git a/code/modules/power/smes_vr.dm b/code/modules/power/smes_vr.dm index fe46cae7f0..2612fab73b 100644 --- a/code/modules/power/smes_vr.dm +++ b/code/modules/power/smes_vr.dm @@ -6,7 +6,7 @@ var/overlay_icon = 'icons/obj/power_vr.dmi' /obj/machinery/power/smes/buildable/hybrid/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if(W.is_screwdriver() || W.is_wirecutter()) + if(W.has_tool_quality(TOOL_SCREWDRIVER) || W.has_tool_quality(TOOL_WIRECUTTER)) to_chat(user,"\The [src] full of weird alien technology that's best not messed with.") return 0 diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index f0c010c0f2..97d9ff488b 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -58,7 +58,7 @@ GLOBAL_LIST_EMPTY(solars_list) /obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) playsound(src, 'sound/machines/click.ogg', 50, 1) user.visible_message("[user] begins to take the glass off the solar panel.") if(do_after(user, 50)) @@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(solars_list) return 0 //if there's no SSsun.sun or the panel is not linked to a solar control computer, no need to proceed if(!powernet || powernet != control.powernet) return 0 // We aren't connected to the controller - if(obscured) + if(obscured) return 0 //get no light from the SSsun.sun, so don't generate power return GLOB.solar_gen_rate * sunfrac @@ -207,13 +207,13 @@ GLOBAL_LIST_EMPTY(solars_list) if (!isturf(loc)) return 0 if(!anchored) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) anchored = TRUE user.visible_message("[user] wrenches the solar assembly into place.") playsound(src, W.usesound, 75, 1) return 1 else - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) anchored = FALSE user.visible_message("[user] unwrenches the solar assembly from it's place.") playsound(src, W.usesound, 75, 1) @@ -242,7 +242,7 @@ GLOBAL_LIST_EMPTY(solars_list) user.visible_message("[user] inserts the electronics into the solar assembly.") return 1 else - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) new /obj/item/weapon/tracker_electronics(src.loc) tracker = 0 user.visible_message("[user] takes out the electronics from the solar assembly.") @@ -412,7 +412,7 @@ GLOBAL_LIST_EMPTY(solars_list) return data /obj/machinery/power/solar_control/attackby(obj/item/I, user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, I.usesound, 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) diff --git a/code/modules/power/tesla/telsa_construction.dm b/code/modules/power/tesla/telsa_construction.dm index 23507f8e3c..34fe83ec89 100644 --- a/code/modules/power/tesla/telsa_construction.dm +++ b/code/modules/power/tesla/telsa_construction.dm @@ -34,7 +34,7 @@ // SPECIAL BOARDS BELOW /obj/item/weapon/circuitboard/tesla_coil/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_multitool()) + if(I.has_tool_quality(TOOL_MULTITOOL)) var/result = tgui_input_list(user, "What do you want to reconfigure the board to?", "Multitool-Circuitboard interface", list("Standard", "Relay", "Prism", "Amplifier", "Recaster", "Collector")) switch(result) if("Standard") diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm index 0a301cba82..efd68308fb 100644 --- a/code/modules/power/tracker.dm +++ b/code/modules/power/tracker.dm @@ -53,7 +53,7 @@ /obj/machinery/power/tracker/attackby(var/obj/item/weapon/W, var/mob/user) - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) playsound(src, 'sound/machines/click.ogg', 50, 1) user.visible_message("[user] begins to take the glass off the solar tracker.") if(do_after(user, 50)) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 5fa957d0a1..a09e7cfb61 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -31,7 +31,7 @@ update_icon() /obj/item/ammo_casing/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(!BB) to_chat(user, "There is no bullet in the casing to inscribe anything into.") return diff --git a/code/modules/projectiles/ammunition/smartmag.dm b/code/modules/projectiles/ammunition/smartmag.dm index c1a5fbbcd8..e72e78fb36 100644 --- a/code/modules/projectiles/ammunition/smartmag.dm +++ b/code/modules/projectiles/ammunition/smartmag.dm @@ -87,7 +87,7 @@ update_icon() return - else if(I.is_screwdriver()) + else if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(attached_cell) to_chat(user, "You begin removing \the [attached_cell] from \the [src].") if(do_after(user, 10)) // Faster than doing it by hand diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 25e9e9c9bf..5e095bfc7f 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -282,7 +282,7 @@ verbs += /obj/item/weapon/gun/verb/allow_dna return - if(A.is_screwdriver()) + if(A.has_tool_quality(TOOL_SCREWDRIVER)) if(dna_lock && attached_lock && !attached_lock.controller_lock) to_chat(user, "You begin removing \the [attached_lock] from \the [src].") playsound(src, A.usesound, 50, 1) diff --git a/code/modules/projectiles/guns/energy/bsharpoon_vr.dm b/code/modules/projectiles/guns/energy/bsharpoon_vr.dm index 5874f65640..e1c5711d27 100644 --- a/code/modules/projectiles/guns/energy/bsharpoon_vr.dm +++ b/code/modules/projectiles/guns/energy/bsharpoon_vr.dm @@ -42,7 +42,7 @@ if(!istype(user)) return - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(!scanmod) to_chat(user, "There's no scanner module installed!") return diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index f236ed2984..1f278139d1 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -76,7 +76,7 @@ else to_chat(user, "[src] already has a laser.") - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(emitter) to_chat(user, "You remove the [emitter.name] from the [src].") emitter.loc = get_turf(src.loc) diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm index 74b3a5eb4c..aba55b268d 100644 --- a/code/modules/projectiles/guns/launcher/crossbow.dm +++ b/code/modules/projectiles/guns/launcher/crossbow.dm @@ -166,7 +166,7 @@ else to_chat(user, "[src] already has a cell installed.") - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(cell) var/obj/item/C = cell C.loc = get_turf(user) @@ -236,9 +236,9 @@ else to_chat(user, "You need at least three rods to complete this task.") return - else if(istype(W, /obj/item/weapon/weldingtool)) + else if(W.has_tool_quality(TOOL_WELDER)) if(buildstate == 1) - var/obj/item/weapon/weldingtool/T = W + var/obj/item/weapon/weldingtool/T = W.get_welder() if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return playsound(src, W.usesound, 50, 1) @@ -274,7 +274,7 @@ else to_chat(user, "You need at least three plastic sheets to complete this task.") return - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(buildstate == 5) to_chat(user, "You secure the crossbow's various parts.") playsound(src, W.usesound, 50, 1) diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm index 8372eb77b4..1e75a9b1d2 100644 --- a/code/modules/projectiles/guns/launcher/pneumatic.dm +++ b/code/modules/projectiles/guns/launcher/pneumatic.dm @@ -190,9 +190,9 @@ buildstate++ update_icon() return - else if(istype(W,/obj/item/weapon/weldingtool)) + else if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/T = W.get_welder() if(buildstate == 1) - var/obj/item/weapon/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return playsound(src, W.usesound, 100, 1) @@ -200,7 +200,6 @@ buildstate++ update_icon() if(buildstate == 3) - var/obj/item/weapon/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return playsound(src, W.usesound, 100, 1) @@ -208,7 +207,6 @@ buildstate++ update_icon() if(buildstate == 5) - var/obj/item/weapon/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return playsound(src, W.usesound, 100, 1) diff --git a/code/modules/projectiles/guns/magnetic/bore.dm b/code/modules/projectiles/guns/magnetic/bore.dm index 66e89cb9eb..21077bb05a 100644 --- a/code/modules/projectiles/guns/magnetic/bore.dm +++ b/code/modules/projectiles/guns/magnetic/bore.dm @@ -88,7 +88,7 @@ . = ..() update_rating_mod() if(removable_components) - if(thing.is_crowbar()) + if(thing.has_tool_quality(TOOL_CROWBAR)) if(!manipulator) to_chat(user, "\The [src] has no manipulator installed.") return diff --git a/code/modules/projectiles/guns/magnetic/magnetic.dm b/code/modules/projectiles/guns/magnetic/magnetic.dm index f4933efbf3..20aef6e980 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic.dm @@ -155,7 +155,7 @@ update_icon() return - if(thing.is_screwdriver()) + if(thing.has_tool_quality(TOOL_SCREWDRIVER)) if(!capacitor) to_chat(user, "\The [src] has no capacitor installed.") return diff --git a/code/modules/projectiles/guns/magnetic/magnetic_construction.dm b/code/modules/projectiles/guns/magnetic/magnetic_construction.dm index 9f81dbe4dc..da0212b520 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic_construction.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic_construction.dm @@ -33,8 +33,8 @@ increment_construction_stage() return - if(istype(thing, /obj/item/weapon/weldingtool) && construction_stage == 4) - var/obj/item/weapon/weldingtool/welder = thing + if(thing.has_tool_quality(TOOL_WELDER) && construction_stage == 4) + var/obj/item/weapon/weldingtool/welder = thing.get_welder() if(!welder.isOn()) to_chat(user, "Turn it on first!") @@ -66,7 +66,7 @@ increment_construction_stage() return - if(thing.is_screwdriver() && construction_stage >= 9) + if(thing.has_tool_quality(TOOL_SCREWDRIVER) && construction_stage >= 9) user.visible_message("\The [user] secures \the [src] and finishes it off.") playsound(src, 'sound/items/Screwdriver.ogg', 50, 1) var/obj/item/weapon/gun/magnetic/coilgun = new(loc) diff --git a/code/modules/projectiles/guns/modular_guns.dm b/code/modules/projectiles/guns/modular_guns.dm index f384c7975d..148b60245f 100644 --- a/code/modules/projectiles/guns/modular_guns.dm +++ b/code/modules/projectiles/guns/modular_guns.dm @@ -51,12 +51,12 @@ FireModeModify() /obj/item/weapon/gun/energy/modular/attackby(obj/item/O, mob/user) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You [assembled ? "disassemble" : "assemble"] the gun.") assembled = !assembled playsound(src, O.usesound, 50, 1) return - if(O.is_crowbar()) + if(O.has_tool_quality(TOOL_CROWBAR)) if(assembled == 1) to_chat(user, "Disassemble the [src] first!") return diff --git a/code/modules/reagents/hoses/connector.dm b/code/modules/reagents/hoses/connector.dm index abf55d4fab..a11834e3cb 100644 --- a/code/modules/reagents/hoses/connector.dm +++ b/code/modules/reagents/hoses/connector.dm @@ -3,7 +3,7 @@ . = ..() if(locate(/obj/item/hose_connector) in src) - if(O.is_wirecutter()) + if(O.has_tool_quality(TOOL_WIRECUTTER)) var/list/available_sockets = list() for(var/obj/item/hose_connector/HC in src) diff --git a/code/modules/reagents/machinery/dispenser/dispenser2.dm b/code/modules/reagents/machinery/dispenser/dispenser2.dm index 2d229f73aa..bd9c85b24c 100644 --- a/code/modules/reagents/machinery/dispenser/dispenser2.dm +++ b/code/modules/reagents/machinery/dispenser/dispenser2.dm @@ -77,7 +77,7 @@ SStgui.update_uis(src) /obj/machinery/chemical_dispenser/attackby(obj/item/weapon/W, mob/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 50, 1) to_chat(user, "You begin to [anchored ? "un" : ""]fasten \the [src].") if (do_after(user, 20 * W.toolspeed)) @@ -92,7 +92,7 @@ else if(istype(W, /obj/item/weapon/reagent_containers/chem_disp_cartridge)) add_cartridge(W, user) - else if(W.is_screwdriver()) + else if(W.has_tool_quality(TOOL_SCREWDRIVER)) var/label = tgui_input_list(user, "Which cartridge would you like to remove?", "Chemical Dispenser", cartridges) if(!label) return var/obj/item/weapon/reagent_containers/chem_disp_cartridge/C = remove_cartridge(label) @@ -134,7 +134,7 @@ data["amount"] = amount data["isBeakerLoaded"] = container ? 1 : 0 data["glass"] = accept_drinking - + var/beakerContents[0] if(container && container.reagents && container.reagents.reagent_list.len) for(var/datum/reagent/R in container.reagents.reagent_list) diff --git a/code/modules/reagents/machinery/dispenser/reagent_tank.dm b/code/modules/reagents/machinery/dispenser/reagent_tank.dm index c089c4c604..6c4d71181c 100644 --- a/code/modules/reagents/machinery/dispenser/reagent_tank.dm +++ b/code/modules/reagents/machinery/dispenser/reagent_tank.dm @@ -178,7 +178,7 @@ modded = FALSE /obj/structure/reagent_dispensers/fueltank/barrel/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (W.is_wrench()) //can't wrench it shut, it's always open + if (W.has_tool_quality(TOOL_WRENCH)) //can't wrench it shut, it's always open return return ..() //VOREStation Add End @@ -202,7 +202,7 @@ /obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W as obj, mob/user as mob) src.add_fingerprint(user) - if (W.is_wrench()) + if (W.has_tool_quality(TOOL_WRENCH)) user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \ "You wrench [src]'s faucet [modded ? "closed" : "open"]") modded = modded ? 0 : 1 @@ -360,7 +360,7 @@ return 1 /obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob) - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) src.add_fingerprint(user) if(bottle) playsound(src, I.usesound, 50, 1) @@ -385,7 +385,7 @@ playsound(src, I.usesound, 50, 1) return - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(cupholder) playsound(src, I.usesound, 50, 1) to_chat(user, "You take the cup dispenser off.") diff --git a/code/modules/reagents/machinery/pump.dm b/code/modules/reagents/machinery/pump.dm index 6c9302d61e..0330547df2 100644 --- a/code/modules/reagents/machinery/pump.dm +++ b/code/modules/reagents/machinery/pump.dm @@ -57,7 +57,7 @@ src.reagents.trans_to_holder(R, src.reagents.total_volume) qdel(src.reagents) src.reagents = R - + /obj/machinery/pump/update_icon() ..() cut_overlays() @@ -81,7 +81,7 @@ /obj/machinery/pump/process() if(!on) return - + if(!anchored || !(cell?.use(active_power_usage))) set_state(FALSE) return @@ -141,18 +141,18 @@ /obj/machinery/pump/attackby(obj/item/weapon/W, mob/user) . = TRUE - if(W.is_screwdriver() && !open) + if(W.has_tool_quality(TOOL_SCREWDRIVER) && !open) to_chat(user, SPAN_NOTICE("You [unlocked ? "screw" : "unscrew"] the battery panel.")) unlocked = !unlocked - else if(W.is_crowbar() && unlocked) + else if(W.has_tool_quality(TOOL_CROWBAR) && unlocked) to_chat(user, open ? \ "You crowbar the battery panel in place." : \ "You remove the battery panel." \ ) open = !open - - else if(W.is_wrench()) + + else if(W.has_tool_quality(TOOL_WRENCH)) if(on) to_chat(user, "\The [src] is active. Turn it off before trying to move it!") return FALSE diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 064b110c82..ef71cc5987 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -296,7 +296,7 @@ user.drop_from_inventory(src) qdel(src) return - else if(D.is_wirecutter()) + else if(D.has_tool_quality(TOOL_WIRECUTTER)) to_chat(user, "You cut a big hole in \the [src] with \the [D]. It's kinda useless as a bucket now.") user.put_in_hands(new /obj/item/clothing/head/helmet/bucket) user.drop_from_inventory(src) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 76ff255292..68e17ab1cf 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -289,9 +289,9 @@ if(default_deconstruction_screwdriver(user, I)) return - if(istype(I, /obj/item/weapon/weldingtool)) + if(I.has_tool_quality(TOOL_WELDER)) if(panel_open) - var/obj/item/weapon/weldingtool/WT = I + var/obj/item/weapon/weldingtool/WT = I.get_welder() if(!WT.remove_fuel(0, user)) to_chat(user, "The welding tool must be on to complete this task.") return diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 551a251a50..f3ff511d4d 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -246,7 +246,7 @@ var/obj/structure/disposalpipe/CP = locate() in T // wrench: (un)anchor - if(I.is_wrench()) + if(I.has_tool_quality(TOOL_WRENCH)) if(anchored) anchored = FALSE if(ispipe) @@ -285,9 +285,9 @@ update() // weldingtool: convert to real pipe - else if(istype(I, /obj/item/weapon/weldingtool)) + else if(I.has_tool_quality(TOOL_WELDER)) if(anchored) - var/obj/item/weapon/weldingtool/W = I + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.remove_fuel(0,user)) playsound(src, W.usesound, 100, 1) to_chat(user, "Welding the [nicetype] in place.") diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index d900a3fc0a..a9a317b45d 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -56,7 +56,7 @@ src.add_fingerprint(user) if(mode<=0) // It's off - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(contents.len > 0) to_chat(user, "Eject the items first!") return @@ -70,11 +70,11 @@ playsound(src, I.usesound, 50, 1) to_chat(user, "You attach the screws around the power connection.") return - else if(istype(I, /obj/item/weapon/weldingtool) && mode==-1) + else if(I.has_tool_quality(TOOL_WELDER) && mode==-1) if(contents.len > 0) to_chat(user, "Eject the items first!") return - var/obj/item/weapon/weldingtool/W = I + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.remove_fuel(0,user)) playsound(src, W.usesound, 100, 1) to_chat(user, "You start slicing the floorweld off the disposal unit.") @@ -980,8 +980,8 @@ if(!T.is_plating()) return // prevent interaction with T-scanner revealed pipes src.add_fingerprint(user) - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/W = I + if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.remove_fuel(0,user)) playsound(src, W.usesound, 50, 1) @@ -1455,8 +1455,8 @@ if(!T.is_plating()) return // prevent interaction with T-scanner revealed pipes src.add_fingerprint(user) - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/W = I + if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.remove_fuel(0,user)) playsound(src, W.usesound, 100, 1) @@ -1576,7 +1576,7 @@ if(!I || !user) return src.add_fingerprint(user) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) if(mode==0) mode=1 to_chat(user, "You remove the screws around the power connection.") @@ -1587,8 +1587,8 @@ to_chat(user, "You attach the screws around the power connection.") playsound(src, I.usesound, 50, 1) return - else if(istype(I, /obj/item/weapon/weldingtool) && mode==1) - var/obj/item/weapon/weldingtool/W = I + else if(I.has_tool_quality(TOOL_WELDER) && mode==1) + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.remove_fuel(0,user)) playsound(src, W.usesound, 100, 1) to_chat(user, "You start slicing the floorweld off the disposal outlet.") diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 8fe9646ac9..caa4df13bc 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -437,13 +437,13 @@ if(!I || !user) return - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) c_mode = !c_mode playsound(src, I.usesound, 50, 1) to_chat(user, "You [c_mode ? "remove" : "attach"] the screws around the power connection.") return - if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1) - var/obj/item/weapon/weldingtool/W = I + if(I.has_tool_quality(TOOL_WELDER) && c_mode==1) + var/obj/item/weapon/weldingtool/W = I.get_welder() if(!W.remove_fuel(0,user)) to_chat(user, "You need more welding fuel to complete this task.") return diff --git a/code/modules/research/designs/engineering.dm b/code/modules/research/designs/engineering.dm index bf55cdd788..aed5d0e95f 100644 --- a/code/modules/research/designs/engineering.dm +++ b/code/modules/research/designs/engineering.dm @@ -19,7 +19,7 @@ id = "handdrill" req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 2) materials = list(MAT_STEEL = 300, MAT_SILVER = 100) - build_path = /obj/item/weapon/tool/screwdriver/power + build_path = /obj/item/weapon/tool/transforming/powerdrill sort_string = "NAAAB" /datum/design/item/tool/jaws_life @@ -28,7 +28,7 @@ id = "jawslife" req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 2) materials = list(MAT_STEEL = 300, MAT_SILVER = 100) - build_path = /obj/item/weapon/tool/crowbar/power + build_path = /obj/item/weapon/tool/transforming/jawsoflife sort_string = "NAAAC" /datum/design/item/tool/rpd diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index daeae94946..effc14b222 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -42,7 +42,7 @@ event_triggered_by = usr broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) to_chat(user, "You begin removing the faceplate from the [src]") playsound(src, W.usesound, 50, 1) if(do_after(user, 10 * W.toolspeed)) diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index d7d244bac4..a3908a6a55 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -280,7 +280,7 @@ return 1 /obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 100, 1) if(is_open) to_chat(user, "You close the panel.") @@ -300,7 +300,7 @@ to_chat(user, "You repair the [src]!") update_icon() - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(locked) to_chat(user, "The bolts are covered, unlocking this would retract the covers.") return diff --git a/code/modules/shieldgen/sheldwallgen.dm b/code/modules/shieldgen/sheldwallgen.dm index d03cd22c45..3f4b7c2922 100644 --- a/code/modules/shieldgen/sheldwallgen.dm +++ b/code/modules/shieldgen/sheldwallgen.dm @@ -157,7 +157,7 @@ /obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) if(active) to_chat(user, "Turn off the field generator first.") return diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm index 2bd6818d25..c32998a0a2 100644 --- a/code/modules/shieldgen/shield_capacitor.dm +++ b/code/modules/shieldgen/shield_capacitor.dm @@ -46,7 +46,7 @@ updateDialog() else to_chat(user, "Access denied.") - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) src.anchored = !src.anchored playsound(src, W.usesound, 75, 1) src.visible_message("\icon[src][bicon(src)] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].") diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm index 2617d6c28f..3763f324d7 100644 --- a/code/modules/shieldgen/shield_gen.dm +++ b/code/modules/shieldgen/shield_gen.dm @@ -66,7 +66,7 @@ updateDialog() else to_chat(user, "Access denied.") - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) src.anchored = !src.anchored playsound(src, W.usesound, 75, 1) src.visible_message("\icon[src][bicon(src)] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].") diff --git a/code/modules/shieldgen/shield_generator.dm b/code/modules/shieldgen/shield_generator.dm index 2158a53d02..3f0f23ed37 100644 --- a/code/modules/shieldgen/shield_generator.dm +++ b/code/modules/shieldgen/shield_generator.dm @@ -357,12 +357,12 @@ overloaded = 0 /obj/machinery/power/shield_generator/attackby(obj/item/O as obj, mob/user as mob) - if(panel_open && (O?.is_multitool() || O?.is_wirecutter())) + if(panel_open && (O?.has_tool_quality(TOOL_MULTITOOL) || O?.has_tool_quality(TOOL_WIRECUTTER))) wires.Interact(user) return TRUE if(default_deconstruction_screwdriver(user, O)) return - if(O?.is_crowbar() || O?.is_wrench() || istype(O, /obj/item/weapon/storage/part_replacer)) + if(O?.has_tool_quality(TOOL_CROWBAR) || O?.has_tool_quality(TOOL_WRENCH) || istype(O, /obj/item/weapon/storage/part_replacer)) if(offline_for) to_chat(user, "Wait until \the [src] cools down from emergency shutdown first!") return diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index ee3e3e1963..0bf247f50b 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -41,16 +41,16 @@ for(var/P in allowed_procs) switch(P) if(IS_SCREWDRIVER) - if(tool.is_screwdriver()) + if(tool.has_tool_quality(TOOL_SCREWDRIVER)) return allowed_procs[P] if(IS_CROWBAR) - if(tool.is_crowbar()) + if(tool.has_tool_quality(TOOL_CROWBAR)) return allowed_procs[P] if(IS_WIRECUTTER) - if(tool.is_wirecutter()) + if(tool.has_tool_quality(TOOL_WIRECUTTER)) return allowed_procs[P] if(IS_WRENCH) - if(tool.is_wrench()) + if(tool.has_tool_quality(TOOL_WRENCH)) return allowed_procs[P] return 0 diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 62d089c037..698feefe2f 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -99,7 +99,7 @@ var/list/table_icon_cache = list() /obj/structure/table/attackby(obj/item/weapon/W, mob/user) - if(reinforced && W.is_screwdriver()) + if(reinforced && W.has_tool_quality(TOOL_SCREWDRIVER)) remove_reinforced(W, user) if(!reinforced) update_desc() @@ -107,7 +107,7 @@ var/list/table_icon_cache = list() update_material() return 1 - if(carpeted && W.is_crowbar()) + if(carpeted && W.has_tool_quality(TOOL_CROWBAR)) user.visible_message("\The [user] removes the carpet from \the [src].", "You remove the carpet from \the [src].") new carpeted_type(loc) @@ -127,7 +127,7 @@ var/list/table_icon_cache = list() else to_chat(user, "You don't have enough carpet!") - if(!reinforced && !carpeted && material && W.is_wrench()) + if(!reinforced && !carpeted && material && W.has_tool_quality(TOOL_WRENCH)) remove_material(W, user) if(!material) update_connections(1) @@ -138,12 +138,12 @@ var/list/table_icon_cache = list() update_material() return 1 - if(!carpeted && !reinforced && !material && W.is_wrench()) + if(!carpeted && !reinforced && !material && W.has_tool_quality(TOOL_WRENCH)) dismantle(W, user) return 1 - if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/F = W + if(health < maxhealth && W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/F = W.get_welder() if(F.welding) to_chat(user, "You begin reparing damage to \the [src].") playsound(src, F.usesound, 50, 1) diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm index b9a3bb20a3..30adcf1f73 100644 --- a/code/modules/vehicles/cargo_train.dm +++ b/code/modules/vehicles/cargo_train.dm @@ -68,7 +68,7 @@ return ..() /obj/vehicle/train/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(open && W.is_wirecutter()) + if(open && W.has_tool_quality(TOOL_WIRECUTTER)) passenger_allowed = !passenger_allowed user.visible_message("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src].","You [passenger_allowed ? "cut" : "mend"] the load limiter cable.") else diff --git a/code/modules/vehicles/construction.dm b/code/modules/vehicles/construction.dm index 20adccd5f0..3c81ccc6ae 100644 --- a/code/modules/vehicles/construction.dm +++ b/code/modules/vehicles/construction.dm @@ -129,7 +129,7 @@ return if(7) - if(W.is_wrench() || W.is_screwdriver()) + if(W.has_tool_quality(TOOL_WRENCH) || W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) to_chat(user, "You begin your finishing touches on \the [src].") if(do_after(user, 20) && build_stage == 7) @@ -179,7 +179,7 @@ return if(2) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) to_chat(user, "You close up \the [src].") var/obj/vehicle/train/trolley/trailer/product = new(src) @@ -260,7 +260,7 @@ return if(6) - if(W.is_wrench() || W.is_screwdriver()) + if(W.has_tool_quality(TOOL_WRENCH) || W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) to_chat(user, "You begin your finishing touches on \the [src].") if(do_after(user, 20) && build_stage == 6) @@ -360,7 +360,7 @@ return if(7) - if(W.is_wrench() || W.is_screwdriver()) + if(W.has_tool_quality(TOOL_WRENCH) || W.has_tool_quality(TOOL_SCREWDRIVER)) playsound(src, W.usesound, 50, 1) to_chat(user, "You begin your finishing touches on \the [src].") if(do_after(user, 20) && build_stage == 7) diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 24bd0447b4..d515199e6d 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -92,19 +92,19 @@ if(istype(W, /obj/item/weapon/hand_labeler)) return if(mechanical) - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) if(!locked) open = !open update_icon() to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].") playsound(src, W.usesound, 50, 1) - else if(W.is_crowbar() && cell && open) + else if(W.has_tool_quality(TOOL_CROWBAR) && cell && open) remove_cell(user) else if(istype(W, /obj/item/weapon/cell) && !cell && open) insert_cell(W, user) - else if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/T = W + else if(W.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/T = W.get_welder() if(T.welding) if(health < maxhealth) if(open) diff --git a/code/modules/virus2/centrifuge.dm b/code/modules/virus2/centrifuge.dm index ee2385d90d..4cfb570a8d 100644 --- a/code/modules/virus2/centrifuge.dm +++ b/code/modules/virus2/centrifuge.dm @@ -10,7 +10,7 @@ var/datum/disease2/disease/virus2 = null /obj/machinery/computer/centrifuge/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(O.is_screwdriver()) + if(O.has_tool_quality(TOOL_SCREWDRIVER)) return ..(O,user) if(default_unfasten_wrench(user, O, 20)) diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm index fb682f51d1..263404ea1f 100644 --- a/code/modules/virus2/diseasesplicer.dm +++ b/code/modules/virus2/diseasesplicer.dm @@ -12,7 +12,7 @@ var/scanning = 0 /obj/machinery/computer/diseasesplicer/attackby(var/obj/item/I as obj, var/mob/user as mob) - if(I.is_screwdriver()) + if(I.has_tool_quality(TOOL_SCREWDRIVER)) return ..(I,user) if(default_unfasten_wrench(user, I, 20)) diff --git a/code/modules/vore/weight/fitness_machines_vr.dm b/code/modules/vore/weight/fitness_machines_vr.dm index ca6267ba49..2f09e9a36f 100644 --- a/code/modules/vore/weight/fitness_machines_vr.dm +++ b/code/modules/vore/weight/fitness_machines_vr.dm @@ -55,7 +55,7 @@ "A honk emits from the punching bag as you hit it") /obj/machinery/fitness/heavy/attackby(obj/item/W, mob/living/user) - if(W.is_wrench()) + if(W.has_tool_quality(TOOL_WRENCH)) add_fingerprint(user) user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].") anchored = !anchored diff --git a/code/modules/xenoarcheaology/finds/finds.dm b/code/modules/xenoarcheaology/finds/finds.dm index aa620393dd..de7b6382b0 100644 --- a/code/modules/xenoarcheaology/finds/finds.dm +++ b/code/modules/xenoarcheaology/finds/finds.dm @@ -41,8 +41,8 @@ qdel(src) return - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/W = I + if(I.has_tool_quality(TOOL_WELDER)) + var/obj/item/weapon/weldingtool/W = I.get_welder() if(W.isOn()) if(W.get_fuel() >= 2) var/obj/item/inside = locate() in src diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index bb7d714aa0..4449d85db5 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -91,7 +91,7 @@ /obj/machinery/suspension_gen/attackby(obj/item/W as obj, mob/user as mob) if(!locked && !suspension_field && default_deconstruction_screwdriver(user, W)) return - else if(W.is_wrench()) + else if(W.has_tool_quality(TOOL_WRENCH)) if(!suspension_field) if(anchored) anchored = 0 diff --git a/code/modules/xenobio2/machinery/core_extractor.dm b/code/modules/xenobio2/machinery/core_extractor.dm index e2882001e1..8f55143be2 100644 --- a/code/modules/xenobio2/machinery/core_extractor.dm +++ b/code/modules/xenobio2/machinery/core_extractor.dm @@ -26,11 +26,11 @@ /obj/machinery/slime/extractor/attackby(var/obj/item/W, var/mob/user) //Let's try to deconstruct first. - if(W.is_screwdriver() && !inuse) + if(W.has_tool_quality(TOOL_SCREWDRIVER) && !inuse) default_deconstruction_screwdriver(user, W) return - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) default_deconstruction_crowbar(user, W) return diff --git a/code/modules/xenobio2/machinery/injector.dm b/code/modules/xenobio2/machinery/injector.dm index 3e31b54cd8..6b18e89073 100644 --- a/code/modules/xenobio2/machinery/injector.dm +++ b/code/modules/xenobio2/machinery/injector.dm @@ -88,11 +88,11 @@ /obj/machinery/xenobio2/manualinjector/attackby(var/obj/item/W, var/mob/user) //Let's try to deconstruct first. - if(W.is_screwdriver()) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) default_deconstruction_screwdriver(user, W) return - if(W.is_crowbar() && !occupant) + if(W.has_tool_quality(TOOL_CROWBAR) && !occupant) default_deconstruction_crowbar(user, W) return diff --git a/code/modules/xenobio2/machinery/slime_replicator.dm b/code/modules/xenobio2/machinery/slime_replicator.dm index 30c3e372a5..c7b7b3c567 100644 --- a/code/modules/xenobio2/machinery/slime_replicator.dm +++ b/code/modules/xenobio2/machinery/slime_replicator.dm @@ -24,11 +24,11 @@ /obj/machinery/slime/replicator/attackby(var/obj/item/W, var/mob/user) //Let's try to deconstruct first. - if(W.is_screwdriver() && !inuse) + if(W.has_tool_quality(TOOL_SCREWDRIVER) && !inuse) default_deconstruction_screwdriver(user, W) return - if(W.is_crowbar()) + if(W.has_tool_quality(TOOL_CROWBAR)) default_deconstruction_crowbar(user, W) return diff --git a/icons/inventory/back/mob.dmi b/icons/inventory/back/mob.dmi index ce764ee6c5..f9c36d0277 100644 Binary files a/icons/inventory/back/mob.dmi and b/icons/inventory/back/mob.dmi differ diff --git a/icons/mob/items/lefthand_melee_vr.dmi b/icons/mob/items/lefthand_melee_vr.dmi index 2cc11d8ed8..7d54473391 100644 Binary files a/icons/mob/items/lefthand_melee_vr.dmi and b/icons/mob/items/lefthand_melee_vr.dmi differ diff --git a/icons/mob/items/righthand_melee_vr.dmi b/icons/mob/items/righthand_melee_vr.dmi index 29134f5dcb..12afb64f34 100644 Binary files a/icons/mob/items/righthand_melee_vr.dmi and b/icons/mob/items/righthand_melee_vr.dmi differ diff --git a/icons/obj/weapons_vr.dmi b/icons/obj/weapons_vr.dmi index 591c65ab09..968c6e8ef2 100644 Binary files a/icons/obj/weapons_vr.dmi and b/icons/obj/weapons_vr.dmi differ diff --git a/maps/expedition_vr/alienship/alienship.dmm b/maps/expedition_vr/alienship/alienship.dmm index 18737671f6..bbe4d4fd3b 100644 --- a/maps/expedition_vr/alienship/alienship.dmm +++ b/maps/expedition_vr/alienship/alienship.dmm @@ -179,7 +179,7 @@ /area/tether_away/alienship) "aK" = ( /obj/structure/closet/crate, -/obj/item/weapon/tool/crowbar/power, +/obj/item/weapon/tool/transforming/jawsoflife, /obj/item/weapon/tool/wrench, /turf/simulated/shuttle/floor/alien, /area/tether_away/alienship) @@ -196,7 +196,7 @@ "aM" = ( /obj/structure/closet/crate, /obj/item/weapon/tool/crowbar/red, -/obj/item/weapon/tool/screwdriver/power, +/obj/item/weapon/tool/transforming/powerdrill, /obj/item/weapon/tool/wirecutters, /turf/simulated/shuttle/floor/alien, /area/tether_away/alienship) diff --git a/maps/expedition_vr/beach/submaps/quarantineshuttle.dmm b/maps/expedition_vr/beach/submaps/quarantineshuttle.dmm index beeb7784ff..efb45b4947 100644 --- a/maps/expedition_vr/beach/submaps/quarantineshuttle.dmm +++ b/maps/expedition_vr/beach/submaps/quarantineshuttle.dmm @@ -823,7 +823,7 @@ /area/submap/cave/qShuttle) "ck" = ( /obj/structure/table/steel, -/obj/item/weapon/tool/crowbar/power, +/obj/item/weapon/tool/transforming/jawsoflife, /turf/simulated/mineral/floor/ignore_mapgen/cave, /area/submap/cave/qShuttle) "cl" = ( diff --git a/maps/submaps/pois_vr/debris_field/ship_sup_exploded.dmm b/maps/submaps/pois_vr/debris_field/ship_sup_exploded.dmm index 09ce52b84c..cb31de1baa 100644 --- a/maps/submaps/pois_vr/debris_field/ship_sup_exploded.dmm +++ b/maps/submaps/pois_vr/debris_field/ship_sup_exploded.dmm @@ -42,10 +42,10 @@ /area/submap/debrisfield/misc_debris) "ak" = ( /obj/structure/closet/crate/secure/engineering, -/obj/item/weapon/tool/screwdriver/power, -/obj/item/weapon/tool/crowbar/power, -/obj/item/weapon/tool/screwdriver/power, -/obj/item/weapon/tool/crowbar/power, +/obj/item/weapon/tool/transforming/powerdrill, +/obj/item/weapon/tool/transforming/jawsoflife, +/obj/item/weapon/tool/transforming/powerdrill, +/obj/item/weapon/tool/transforming/jawsoflife, /obj/effect/decal/cleanable/dirt, /turf/simulated/shuttle/plating/airless, /area/submap/debrisfield/misc_debris) diff --git a/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm b/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm index 5e8cc12496..79bc245a1d 100644 --- a/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm +++ b/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm @@ -823,7 +823,7 @@ /area/submap/cave/qShuttle) "ck" = ( /obj/structure/table/steel, -/obj/item/weapon/tool/crowbar/power, +/obj/item/weapon/tool/transforming/jawsoflife, /turf/simulated/mineral/floor/ignore_mapgen, /area/submap/cave/qShuttle) "cl" = ( diff --git a/vorestation.dme b/vorestation.dme index a516911e66..13753afbe8 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1458,8 +1458,8 @@ #include "code\game\objects\items\weapons\tanks\tanks.dm" #include "code\game\objects\items\weapons\tools\brass.dm" #include "code\game\objects\items\weapons\tools\crowbar.dm" -#include "code\game\objects\items\weapons\tools\crowbar_vr.dm" #include "code\game\objects\items\weapons\tools\screwdriver.dm" +#include "code\game\objects\items\weapons\tools\transforming.dm" #include "code\game\objects\items\weapons\tools\weldingtool.dm" #include "code\game\objects\items\weapons\tools\wirecutters.dm" #include "code\game\objects\items\weapons\tools\wrench.dm"