diff --git a/GainStation13/code/machinery/adipoelectric_generator.dm b/GainStation13/code/machinery/adipoelectric_generator.dm
index f220b82f..d3a58b98 100644
--- a/GainStation13/code/machinery/adipoelectric_generator.dm
+++ b/GainStation13/code/machinery/adipoelectric_generator.dm
@@ -72,7 +72,7 @@
if(default_deconstruction_crowbar(P))
return
- if(istype(P, /obj/item/wrench) && !active)
+ if(P.tool_behavior == TOOL_WRENCH && !active)
if(!anchored && !isinspace())
connect_to_network()
to_chat(user, "You secure the generator to the floor.")
diff --git a/GainStation13/code/mechanics/den abductors/console.dm b/GainStation13/code/mechanics/den abductors/console.dm
index 14d5c94e..a69fde1b 100644
--- a/GainStation13/code/mechanics/den abductors/console.dm
+++ b/GainStation13/code/mechanics/den abductors/console.dm
@@ -168,7 +168,7 @@
return INITIALIZE_HINT_LATELOAD
/obj/structure/scale/credits/attackby(obj/item/used_tool, mob/user, params)
- if(!istype(used_tool, /obj/item/wrench))
+ if(!used_tool.tool_behavior == TOOL_WRENCH)
return ..()
anchored = !anchored
diff --git a/GainStation13/code/modules/gym/gym.dm b/GainStation13/code/modules/gym/gym.dm
index 79d1f0d1..b254d017 100644
--- a/GainStation13/code/modules/gym/gym.dm
+++ b/GainStation13/code/modules/gym/gym.dm
@@ -48,7 +48,7 @@
C.adjust_fatness(-10, FATTENING_TYPE_WEIGHT_LOSS)
/obj/machinery/conveyor/treadmill/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
user.visible_message("[user] struggles to pry up \the [src] with \the [I].", \
"You struggle to pry up \the [src] with \the [I].")
if(I.use_tool(src, user, 40, volume=40))
@@ -59,14 +59,14 @@
to_chat(user, "You remove the conveyor belt.")
qdel(src)
- else if(istype(I, /obj/item/wrench))
+ else if(I.tool_behaviour == TOOL_WRENCH)
if(!(stat & BROKEN))
I.play_tool_sound(src)
setDir(turn(dir,-45))
update_move_direction()
to_chat(user, "You rotate [src].")
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
if(!(stat & BROKEN))
verted = verted * -1
update_move_direction()
diff --git a/GainStation13/code/obj/structure/scale.dm b/GainStation13/code/obj/structure/scale.dm
index 488d9eda..cba5719e 100644
--- a/GainStation13/code/obj/structure/scale.dm
+++ b/GainStation13/code/obj/structure/scale.dm
@@ -22,7 +22,7 @@
..()
/obj/structure/scale/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
+ if(W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))
diff --git a/code/datums/components/remote_materials.dm b/code/datums/components/remote_materials.dm
index 1377c270..03110aca 100644
--- a/code/datums/components/remote_materials.dm
+++ b/code/datums/components/remote_materials.dm
@@ -74,7 +74,7 @@ handles linking back and forth.
_MakeLocal()
/datum/component/remote_materials/proc/OnAttackBy(datum/source, obj/item/I, mob/user)
- if (istype(I, /obj/item/multitool))
+ if (I.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if (!QDELETED(M.buffer) && istype(M.buffer, /obj/machinery/ore_silo))
if (silo == M.buffer)
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 9bf90b0b..74bb83e4 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -901,10 +901,6 @@
. = chosen_langtype
/* End language procs */
-/atom/movable/proc/ConveyorMove(movedir)
- set waitfor = FALSE
- if(!anchored && has_gravity())
- step(src, movedir)
//Returns an atom's power cell, if it has one. Overload for individual items.
/atom/movable/proc/get_cell()
diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm
index 20efee94..0852db7f 100644
--- a/code/game/machinery/PDApainter.dm
+++ b/code/game/machinery/PDApainter.dm
@@ -77,7 +77,7 @@
O.add_fingerprint(user)
update_icon()
- else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ else if(O.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(stat & BROKEN)
if(!O.tool_start_check(user, amount=0))
return
diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm
index dda33e87..469723e5 100644
--- a/code/game/machinery/announcement_system.dm
+++ b/code/game/machinery/announcement_system.dm
@@ -60,14 +60,14 @@ GLOBAL_LIST_EMPTY(announcement_systems)
update_icon()
/obj/machinery/announcement_system/attackby(obj/item/P, mob/user, params)
- if(istype(P, /obj/item/screwdriver))
+ if(P.tool_behavior == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance hatch of [src].")
update_icon()
else if(default_deconstruction_crowbar(P))
return
- else if(istype(P, /obj/item/multitool) && panel_open && (stat & BROKEN))
+ else if(P.tool_behavior == TOOL_MULTITOOL && panel_open && (stat & BROKEN))
to_chat(user, "You reset [src]'s firmware.")
stat &= ~BROKEN
update_icon()
diff --git a/code/game/machinery/aug_manipulator.dm b/code/game/machinery/aug_manipulator.dm
index 17dad525..a6a55791 100644
--- a/code/game/machinery/aug_manipulator.dm
+++ b/code/game/machinery/aug_manipulator.dm
@@ -73,7 +73,7 @@
O.add_fingerprint(user)
update_icon()
- else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ else if(O.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(obj_integrity < max_integrity)
if(!O.tool_start_check(user, amount=0))
return
diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm
index 7d05c961..bd2a6174 100644
--- a/code/game/machinery/buttons.dm
+++ b/code/game/machinery/buttons.dm
@@ -56,7 +56,7 @@
. += "button-board"
/obj/machinery/button/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(panel_open || allowed(user))
default_deconstruction_screwdriver(user, "button-open", "[skin]",W)
update_icon()
@@ -84,7 +84,7 @@
req_access = board.accesses
to_chat(user, "You add [W] to the button.")
- if(!device && !board && istype(W, /obj/item/wrench))
+ if(!device && !board && W.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start unsecuring the button frame...")
W.play_tool_sound(src)
if(W.use_tool(src, user, 40))
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index 3c060608..c6acec52 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -39,7 +39,7 @@
switch(state)
if(1)
// State 1
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "You weld the assembly securely into place.")
setAnchored(TRUE)
@@ -57,7 +57,7 @@
return
return
- else if(istype(W, /obj/item/weldingtool))
+ else if(W.tool_behavior == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "You unweld the assembly from its place.")
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 61a27c10..79de3c17 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -310,7 +310,9 @@
if(default_deconstruction_crowbar(W))
return
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
+ if(!multitool_check_buffer(user, W))
+ return
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/computer/cloning))
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 8bb0894c..f45c406f 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -10,7 +10,7 @@
light_color = LIGHT_COLOR_PINK
/obj/machinery/computer/aifixer/attackby(obj/I, mob/user, params)
- if(occupier && istype(I, /obj/item/screwdriver))
+ if(occupier && I.tool_behavior == TOOL_SCREWDRIVER)
if(stat & (NOPOWER|BROKEN))
to_chat(user, "The screws on [name]'s screen won't budge.")
else
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 46aec8c1..12ae9f1b 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -7,14 +7,14 @@
add_fingerprint(user)
switch(state)
if(0)
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start wrenching the frame into place...")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "You wrench the frame into place.")
setAnchored(TRUE)
state = 1
return
- if(istype(P, /obj/item/weldingtool))
+ if(P.tool_behavior == TOOL_WELDER)
if(!P.tool_start_check(user, amount=0))
return
@@ -26,7 +26,7 @@
qdel(src)
return
if(1)
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start to unfasten the frame...")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "You unfasten the frame.")
@@ -46,13 +46,13 @@
else if(istype(P, /obj/item/circuitboard) && !circuit)
to_chat(user, "This frame does not accept circuit boards of this type!")
return
- if(istype(P, /obj/item/screwdriver) && circuit)
+ if(P.tool_behavior == TOOL_SCREWDRIVER && circuit)
P.play_tool_sound(src)
to_chat(user, "You screw [circuit] into place.")
state = 2
icon_state = "2"
return
- if(istype(P, /obj/item/crowbar) && circuit)
+ if(P.tool_behavior == TOOL_CROWBAR && circuit)
P.play_tool_sound(src)
to_chat(user, "You remove [circuit].")
state = 1
@@ -62,7 +62,7 @@
circuit = null
return
if(2)
- if(istype(P, /obj/item/screwdriver) && circuit)
+ if(P.tool_behavior == TOOL_SCREWDRIVER && circuit)
P.play_tool_sound(src)
to_chat(user, "You unfasten the circuit board.")
state = 1
@@ -80,7 +80,7 @@
icon_state = "3"
return
if(3)
- if(istype(P, /obj/item/wirecutters))
+ if(P.tool_behavior == TOOL_WIRECUTTER)
P.play_tool_sound(src)
to_chat(user, "You remove the cables.")
state = 2
@@ -102,7 +102,7 @@
src.icon_state = "4"
return
if(4)
- if(istype(P, /obj/item/crowbar))
+ if(P.tool_behavior == TOOL_CROWBAR)
P.play_tool_sound(src)
to_chat(user, "You remove the glass panel.")
state = 3
@@ -110,7 +110,7 @@
var/obj/item/stack/sheet/glass/G = new(drop_location(), 2)
G.add_fingerprint(user)
return
- if(istype(P, /obj/item/screwdriver))
+ if(P.tool_behavior == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
to_chat(user, "You connect the monitor.")
var/obj/B = new circuit.build_path (loc, circuit)
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index 35e71ace..4208248d 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -132,7 +132,7 @@
to_chat(user, "You insert [W].")
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
src.updateUsrDialog()
- else if(istype(W, /obj/item/multitool))
+ else if(W.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/clonepod))
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index d99e5bb7..0e81e359 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -91,7 +91,7 @@
icon_state = "box_1"
return
- if(istype(P, /obj/item/screwdriver) && !anchored)
+ if(P.tool_behavior == TOOL_SCREWDRIVER && !anchored)
user.visible_message("[user] disassembles the frame.", \
"You start to disassemble the frame...", "You hear banging and clanking.")
if(P.use_tool(src, user, 40, volume=50))
@@ -101,7 +101,7 @@
M.add_fingerprint(user)
qdel(src)
return
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start [anchored ? "un" : ""]securing [name]...")
if(P.use_tool(src, user, 40, volume=75))
if(state == 1)
@@ -110,7 +110,7 @@
return
if(2)
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start [anchored ? "un" : ""]securing [name]...")
if(P.use_tool(src, user, 40, volume=75))
to_chat(user, "You [anchored ? "un" : ""]secure [name].")
@@ -138,7 +138,7 @@
to_chat(user, "This frame does not accept circuit boards of this type!")
return
- if(istype(P, /obj/item/wirecutters))
+ if(P.tool_behavior == TOOL_WIRECUTTER)
P.play_tool_sound(src)
to_chat(user, "You remove the cables.")
state = 1
@@ -147,7 +147,7 @@
return
if(3)
- if(istype(P, /obj/item/crowbar))
+ if(P.tool_behavior == TOOL_CROWBAR)
P.play_tool_sound(src)
state = 2
circuit.forceMove(drop_location())
@@ -165,14 +165,14 @@
icon_state = "box_1"
return
- if(istype(P, /obj/item/wrench) && !circuit.needs_anchored)
+ if(P.tool_behavior == TOOL_WRENCH && !circuit.needs_anchored)
to_chat(user, "You start [anchored ? "un" : ""]securing [name]...")
if(P.use_tool(src, user, 40, volume=75))
to_chat(user, "You [anchored ? "un" : ""]secure [name].")
setAnchored(!anchored)
return
- if(istype(P, /obj/item/screwdriver))
+ if(P.tool_behavior == TOOL_SCREWDRIVER)
var/component_check = 1
for(var/R in req_components)
if(req_components[R] > 0)
diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm
index 9dceaba7..c2491897 100644
--- a/code/game/machinery/dance_machine.dm
+++ b/code/game/machinery/dance_machine.dm
@@ -34,7 +34,7 @@
/obj/machinery/jukebox/attackby(obj/item/O, mob/user, params)
if(!active && !(flags_1 & NODECONSTRUCT_1))
- if(istype(O, /obj/item/wrench))
+ if(O.tool_behavior == TOOL_WRENCH)
if(!anchored && !isinspace())
to_chat(user,"You secure [src] to the floor.")
setAnchored(TRUE)
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index a5e90759..8ff7bcf9 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -26,7 +26,7 @@
return
/obj/structure/barricade/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM && material == METAL)
+ if(I.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM && material == METAL)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 3dc99b47..0ff13fb8 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -908,7 +908,7 @@
update_icon()
return
if(AIRLOCK_SECURITY_METAL)
- if(istype(C, /obj/item/weldingtool))
+ if(C.tool_behavior == TOOL_WELDER)
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "You begin cutting the panel's shielding...")
@@ -923,7 +923,7 @@
update_icon()
return
if(AIRLOCK_SECURITY_PLASTEEL_I_S)
- if(istype(C, /obj/item/crowbar))
+ if(C.tool_behavior == TOOL_CROWBAR)
var/obj/item/crowbar/W = C
to_chat(user, "You start removing the inner layer of shielding...")
if(W.use_tool(src, user, 40, volume=100))
@@ -940,7 +940,7 @@
update_icon()
return
if(AIRLOCK_SECURITY_PLASTEEL_I)
- if(istype(C, /obj/item/weldingtool))
+ if(C.tool_behavior == TOOL_WELDER)
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "You begin cutting the inner layer of shielding...")
@@ -953,7 +953,7 @@
security_level = AIRLOCK_SECURITY_PLASTEEL_I_S
return
if(AIRLOCK_SECURITY_PLASTEEL_O_S)
- if(istype(C, /obj/item/crowbar))
+ if(C.tool_behavior == TOOL_CROWBAR)
to_chat(user, "You start removing outer layer of shielding...")
if(C.use_tool(src, user, 40, volume=100))
if(!panel_open)
@@ -966,7 +966,7 @@
spawn_atom_to_turf(/obj/item/stack/sheet/plasteel, user.loc, 1)
return
if(AIRLOCK_SECURITY_PLASTEEL_O)
- if(istype(C, /obj/item/weldingtool))
+ if(C.tool_behavior == TOOL_WELDER)
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "You begin cutting the outer layer of shielding...")
@@ -979,7 +979,7 @@
security_level = AIRLOCK_SECURITY_PLASTEEL_O_S
return
if(AIRLOCK_SECURITY_PLASTEEL)
- if(istype(C, /obj/item/wirecutters))
+ if(C.tool_behavior == TOOL_WIRECUTTER)
if(src.hasPower() && src.shock(user, 60)) // Protective grille of wiring is electrified
return
to_chat(user, "You start cutting through the outer grille.")
@@ -990,7 +990,7 @@
"You cut through \the [src]'s outer grille.")
security_level = AIRLOCK_SECURITY_PLASTEEL_O
return
- if(istype(C, /obj/item/screwdriver))
+ if(C.tool_behavior == TOOL_SCREWDRIVER)
if(panel_open && detonated)
to_chat(user, "[src] has no maintenance panel!")
return
@@ -998,7 +998,7 @@
to_chat(user, "You [panel_open ? "open":"close"] the maintenance panel of the airlock.")
C.play_tool_sound(src)
src.update_icon()
- else if(istype(C, /obj/item/wirecutters) && note)
+ else if(C.tool_behavior == TOOL_WIRECUTTER && note)
user.visible_message("[user] cuts down [note] from [src].", "You remove [note] from [src].")
C.play_tool_sound(src)
note.forceMove(get_turf(user))
@@ -1077,7 +1077,7 @@
/obj/machinery/door/airlock/try_to_crowbar(obj/item/I, mob/living/user)
var/beingcrowbarred = null
- if(istype(I, /obj/item/crowbar) )
+ if(I.tool_behavior == TOOL_CROWBAR )
beingcrowbarred = 1
else
beingcrowbarred = 0
diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm
index ec99a9e0..e69a7bb3 100644
--- a/code/game/machinery/doors/airlock_types.dm
+++ b/code/game/machinery/doors/airlock_types.dm
@@ -696,7 +696,7 @@
/obj/machinery/door/airlock/clockwork/proc/attempt_construction(obj/item/I, mob/living/user)
if(!I || !user || !user.canUseTopic(src))
return 0
- else if(istype(I, /obj/item/wrench))
+ else if(I.tool_behaviour == TOOL_WRENCH)
if(construction_state == GEAR_SECURE)
user.visible_message("[user] begins loosening [src]'s cogwheel...", "You begin loosening [src]'s cogwheel...")
if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_SECURE)
@@ -712,7 +712,7 @@
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
construction_state = GEAR_SECURE
return 1
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
if(construction_state == GEAR_SECURE)
to_chat(user, "[src]'s cogwheel is too tightly secured! Your [I.name] can't reach under it!")
return 1
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 08e8d0aa..2ddaea9a 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -195,10 +195,10 @@
return
/obj/machinery/door/attackby(obj/item/I, mob/user, params)
- if(user.a_intent != INTENT_HARM && (istype(I, /obj/item/crowbar) || istype(I, /obj/item/twohanded/fireaxe)))
+ if(user.a_intent != INTENT_HARM && (I.tool_behavior == TOOL_CROWBAR || istype(I, /obj/item/twohanded/fireaxe)))
try_to_crowbar(I, user)
return 1
- else if(istype(I, /obj/item/weldingtool))
+ else if(I.tool_behavior == TOOL_WELDER)
try_to_weld(I, user)
return 1
else if(!(I.item_flags & NOBLUDGEON) && user.a_intent != INTENT_HARM)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index f5bf8c8a..3aeec4d2 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -100,7 +100,7 @@
return
if(welded)
- if(istype(C, /obj/item/wrench))
+ if(C.tool_behavior == TOOL_WRENCH)
if(boltslocked)
to_chat(user, "There are screws locking the bolts in place!")
return
@@ -114,7 +114,7 @@
"You undo [src]'s floor bolts.")
deconstruct(TRUE)
return
- if(istype(C, /obj/item/screwdriver))
+ if(C.tool_behavior == TOOL_SCREWDRIVER)
user.visible_message("[user] [boltslocked ? "unlocks" : "locks"] [src]'s bolts.", \
"You [boltslocked ? "unlock" : "lock"] [src]'s floor bolts.")
C.play_tool_sound(src)
@@ -290,7 +290,7 @@
/obj/structure/firelock_frame/attackby(obj/item/C, mob/user)
switch(constructionStep)
if(CONSTRUCTION_PANEL_OPEN)
- if(istype(C, /obj/item/crowbar))
+ if(C.tool_behavior == TOOL_CROWBAR)
C.play_tool_sound(src)
user.visible_message("[user] starts prying something out from [src]...", \
"You begin prying out the wire cover...")
@@ -304,7 +304,7 @@
constructionStep = CONSTRUCTION_WIRES_EXPOSED
update_icon()
return
- if(istype(C, /obj/item/wrench))
+ if(C.tool_behavior == TOOL_WRENCH)
if(locate(/obj/machinery/door/firedoor) in get_turf(src))
to_chat(user, "There's already a firelock there.")
return
@@ -346,7 +346,7 @@
return
if(CONSTRUCTION_WIRES_EXPOSED)
- if(istype(C, /obj/item/wirecutters))
+ if(C.tool_behavior == TOOL_WIRECUTTER)
C.play_tool_sound(src)
user.visible_message("[user] starts cutting the wires from [src]...", \
"You begin removing [src]'s wires...")
@@ -360,7 +360,7 @@
constructionStep = CONSTRUCTION_GUTTED
update_icon()
return
- if(istype(C, /obj/item/crowbar))
+ if(C.tool_behavior == TOOL_CROWBAR)
C.play_tool_sound(src)
user.visible_message("[user] starts prying a metal plate into [src]...", \
"You begin prying the cover plate back onto [src]...")
@@ -375,7 +375,7 @@
update_icon()
return
if(CONSTRUCTION_GUTTED)
- if(istype(C, /obj/item/crowbar))
+ if(C.tool_behavior == TOOL_CROWBAR)
user.visible_message("[user] begins removing the circuit board from [src]...", \
"You begin prying out the circuit board from [src]...")
if(!C.use_tool(src, user, 50, volume=50))
@@ -407,7 +407,7 @@
update_icon()
return
if(CONSTRUCTION_NOCIRCUIT)
- if(istype(C, /obj/item/weldingtool))
+ if(C.tool_behavior == TOOL_WELDER)
if(!C.tool_start_check(user, amount=1))
return
user.visible_message("[user] begins cutting apart [src]'s frame...", \
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index cf0fabe2..5679615d 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -223,7 +223,7 @@
add_fingerprint(user)
if(!(flags_1&NODECONSTRUCT_1))
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(density || operating)
to_chat(user, "You need to open the door to access the maintenance panel!")
return
@@ -232,7 +232,7 @@
to_chat(user, "You [panel_open ? "open":"close"] the maintenance panel of the [src.name].")
return
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
if(panel_open && !density && !operating)
user.visible_message("[user] removes the electronics from the [src.name].", \
"You start to remove electronics from the [src.name]...")
diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm
index 9cb45a03..cdd04853 100644
--- a/code/game/machinery/doppler_array.dm
+++ b/code/game/machinery/doppler_array.dm
@@ -29,7 +29,7 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
return PROCESS_KILL
/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
if(!anchored && !isinspace())
anchored = TRUE
power_change()
diff --git a/code/game/machinery/droneDispenser.dm b/code/game/machinery/droneDispenser.dm
index 96ac8981..4e4c0f87 100644
--- a/code/game/machinery/droneDispenser.dm
+++ b/code/game/machinery/droneDispenser.dm
@@ -210,13 +210,13 @@
icon_state = icon_on
/obj/machinery/droneDispenser/attackby(obj/item/I, mob/living/user)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
I.play_tool_sound(src)
to_chat(user, "You retrieve the materials from [src].")
- else if(istype(I, /obj/item/weldingtool))
+ else if(I.tool_behavior == TOOL_WELDER)
if(!(stat & BROKEN))
to_chat(user, "[src] doesn't need repairs.")
return
diff --git a/code/game/machinery/exp_cloner.dm b/code/game/machinery/exp_cloner.dm
index c5b40a46..0a30929b 100644
--- a/code/game/machinery/exp_cloner.dm
+++ b/code/game/machinery/exp_cloner.dm
@@ -143,7 +143,9 @@
LAZYREMOVE(pods, pod)
/obj/machinery/computer/prototype_cloning/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
+ if(!multitool_check_buffer(user, W))
+ return
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/clonepod/experimental))
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 1ef3fc0a..0ff38f6b 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -157,7 +157,7 @@
/obj/machinery/firealarm/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
- if(istype(W, /obj/item/screwdriver) && buildstage == 2)
+ if(W.tool_behavior == TOOL_SCREWDRIVER && buildstage == 2)
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "The wires have been [panel_open ? "exposed" : "unexposed"].")
@@ -166,7 +166,7 @@
if(panel_open)
- if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP)
+ if(W.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=0))
return
@@ -181,7 +181,7 @@
switch(buildstage)
if(2)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
detecting = !detecting
if (src.detecting)
user.visible_message("[user] has reconnected [src]'s detecting unit!", "You reconnect [src]'s detecting unit.")
@@ -189,7 +189,7 @@
user.visible_message("[user] has disconnected [src]'s detecting unit!", "You disconnect [src]'s detecting unit.")
return
- else if (istype(W, /obj/item/wirecutters))
+ else if (W.tool_behavior == TOOL_WIRECUTTER)
buildstage = 1
W.play_tool_sound(src)
new /obj/item/stack/cable_coil(user.loc, 5)
@@ -214,7 +214,7 @@
update_icon()
return
- else if(istype(W, /obj/item/crowbar))
+ else if(W.tool_behavior == TOOL_CROWBAR)
user.visible_message("[user.name] removes the electronics from [src.name].", \
"You start prying out the circuit...")
if(W.use_tool(src, user, 20, volume=50))
@@ -246,7 +246,7 @@
update_icon()
return
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
user.visible_message("[user] removes the fire alarm assembly from the wall.", \
"You remove the fire alarm assembly from the wall.")
var/obj/item/wallframe/firealarm/frame = new /obj/item/wallframe/firealarm()
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 6f89ce0d..dc022ce0 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -52,7 +52,7 @@
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
- if (istype(W, /obj/item/wirecutters))
+ if (W.tool_behavior == TOOL_WIRECUTTER)
if (bulb)
user.visible_message("[user] begins to disconnect [src]'s flashbulb.", "You begin to disconnect [src]'s flashbulb...")
if(W.use_tool(src, user, 30, volume=50) && bulb)
@@ -71,7 +71,7 @@
else
to_chat(user, "A flashbulb is already installed in [src]!")
- else if (istype(W, /obj/item/wrench))
+ else if (W.tool_behavior == TOOL_WRENCH)
if(!bulb)
to_chat(user, "You start unsecuring the flasher frame...")
if(W.use_tool(src, user, 40, volume=50))
@@ -168,7 +168,7 @@
flash()
/obj/machinery/flasher/portable/attackby(obj/item/W, mob/user, params)
- if (istype(W, /obj/item/wrench))
+ if (W.tool_behavior == TOOL_WRENCH)
W.play_tool_sound(src, 100)
if (!anchored && !isinspace())
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index 099b51db..f95c7a88 100644
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -91,7 +91,7 @@
// src.sd_SetLuminosity(0)
/obj/machinery/sparker/attackby(obj/item/W, mob/user, params)
- if (istype(W, /obj/item/screwdriver))
+ if (W.tool_behavior == TOOL_SCREWDRIVER)
add_fingerprint(user)
src.disable = !src.disable
if (src.disable)
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 7dc651e3..97bc5caa 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -89,7 +89,7 @@
if(T.intact)
return // prevent intraction when T-scanner revealed
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
open = !open
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/newscaster.dm b/code/game/machinery/newscaster.dm
index b7f63ba0..8a5040da 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -716,7 +716,7 @@ GLOBAL_LIST_EMPTY(allCasters)
updateUsrDialog()
/obj/machinery/newscaster/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You start [anchored ? "un" : ""]securing [name]...")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
@@ -730,7 +730,7 @@ GLOBAL_LIST_EMPTY(allCasters)
to_chat(user, "You [anchored ? "un" : ""]secure [name].")
new /obj/item/wallframe/newscaster(loc)
qdel(src)
- else if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ else if(I.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(stat & BROKEN)
if(!I.tool_start_check(user, amount=0))
return
diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm
index 3c9f8be8..51c6646a 100644
--- a/code/game/machinery/porta_turret/portable_turret.dm
+++ b/code/game/machinery/porta_turret/portable_turret.dm
@@ -240,7 +240,7 @@
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user, params)
if(stat & BROKEN)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == 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...")
@@ -257,7 +257,7 @@
to_chat(user, "You remove the turret but did not manage to salvage anything.")
qdel(src)
- else if((istype(I, /obj/item/wrench)) && (!on))
+ else if((I.tool_behaviour == TOOL_WRENCH) && (!on))
if(raised)
return
@@ -284,7 +284,7 @@
to_chat(user, "Controls are now [locked ? "locked" : "unlocked"].")
else
to_chat(user, "Access denied.")
- else if(istype(I, /obj/item/multitool) && !locked)
+ else if(I.tool_behavior == TOOL_MULTITOOL && !locked)
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "You add [src] to multitool buffer.")
@@ -843,7 +843,7 @@
if(stat & BROKEN)
return
- if (istype(I, /obj/item/multitool))
+ if (I.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if(M.buffer && istype(M.buffer, /obj/machinery/porta_turret))
turrets |= M.buffer
diff --git a/code/game/machinery/porta_turret/portable_turret_construct.dm b/code/game/machinery/porta_turret/portable_turret_construct.dm
index 9d86e379..23c9c625 100644
--- a/code/game/machinery/porta_turret/portable_turret_construct.dm
+++ b/code/game/machinery/porta_turret/portable_turret_construct.dm
@@ -23,14 +23,14 @@
//this is a bit unwieldy but self-explanatory
switch(build_step)
if(PTURRET_UNSECURED) //first step
- if(istype(I, /obj/item/wrench) && !anchored)
+ if(I.tool_behaviour == TOOL_WRENCH && !anchored)
I.play_tool_sound(src, 100)
to_chat(user, "You secure the external bolts.")
setAnchored(TRUE)
build_step = PTURRET_BOLTED
return
- else if(istype(I, /obj/item/crowbar) && !anchored)
+ else if(I.tool_behavior == TOOL_CROWBAR && !anchored)
I.play_tool_sound(src, 75)
to_chat(user, "You dismantle the turret construction.")
new /obj/item/stack/sheet/metal( loc, 5)
@@ -48,7 +48,7 @@
to_chat(user, "You need two sheets of metal to continue construction!")
return
- else if(istype(I, /obj/item/wrench))
+ else if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 75)
to_chat(user, "You unfasten the external bolts.")
setAnchored(FALSE)
@@ -57,13 +57,13 @@
if(PTURRET_START_INTERNAL_ARMOUR)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 100)
to_chat(user, "You bolt the metal armor into place.")
build_step = PTURRET_INTERNAL_ARMOUR_ON
return
- else if(istype(I, /obj/item/weldingtool))
+ else if(I.tool_behavior == TOOL_WELDER)
if(!I.tool_start_check(user, amount=5)) //uses up 5 fuel
return
@@ -86,7 +86,7 @@
build_step = PTURRET_GUN_EQUIPPED
return
- else if(istype(I, /obj/item/wrench))
+ else if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 100)
to_chat(user, "You remove the turret's metal armor bolts.")
build_step = PTURRET_START_INTERNAL_ARMOUR
@@ -103,7 +103,7 @@
if(PTURRET_SENSORS_ON)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 100)
build_step = PTURRET_CLOSED
to_chat(user, "You close the internal access hatch.")
@@ -120,14 +120,14 @@
to_chat(user, "You need two sheets of metal to continue construction!")
return
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 100)
build_step = PTURRET_SENSORS_ON
to_chat(user, "You open the internal access hatch.")
return
if(PTURRET_START_EXTERNAL_ARMOUR)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
if(!I.tool_start_check(user, amount=5))
return
@@ -149,7 +149,7 @@
turret.setup(installed_gun)
qdel(src)
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
I.play_tool_sound(src, 75)
to_chat(user, "You pry off the turret's exterior armor.")
new /obj/item/stack/sheet/metal(loc, 2)
diff --git a/code/game/machinery/porta_turret/portable_turret_cover.dm b/code/game/machinery/porta_turret/portable_turret_cover.dm
index 6ff795c1..e31bbc4f 100644
--- a/code/game/machinery/porta_turret/portable_turret_cover.dm
+++ b/code/game/machinery/porta_turret/portable_turret_cover.dm
@@ -40,7 +40,7 @@
/obj/machinery/porta_turret_cover/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench) && !parent_turret.on)
+ if(I.tool_behaviour == TOOL_WRENCH && !parent_turret.on)
if(parent_turret.raised)
return
@@ -63,7 +63,7 @@
updateUsrDialog()
else
to_chat(user, "Access denied.")
- else if(istype(I, /obj/item/multitool) && !parent_turret.locked)
+ else if(I.tool_behavior == TOOL_MULTITOOL && !parent_turret.locked)
var/obj/item/multitool/M = I
M.buffer = parent_turret
to_chat(user, "You add [parent_turret] to multitool buffer.")
diff --git a/code/game/machinery/poweredfans/fan_assembly.dm b/code/game/machinery/poweredfans/fan_assembly.dm
index 9a11bf35..1c01f891 100644
--- a/code/game/machinery/poweredfans/fan_assembly.dm
+++ b/code/game/machinery/poweredfans/fan_assembly.dm
@@ -25,7 +25,7 @@
switch(stat)
if(1)
// Stat 1
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "You weld the fan assembly securely into place.")
setAnchored(TRUE)
@@ -46,7 +46,7 @@
forceMove(F)
F.setDir(src.dir)
return
- else if(istype(W, /obj/item/weldingtool))
+ else if(W.tool_behavior == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "You unweld the fan assembly from its place.")
stat = 1
diff --git a/code/game/machinery/quantum_pad.dm b/code/game/machinery/quantum_pad.dm
index 7f411819..a4a67c4e 100644
--- a/code/game/machinery/quantum_pad.dm
+++ b/code/game/machinery/quantum_pad.dm
@@ -55,12 +55,12 @@
return
if(panel_open)
- if(istype(I, /obj/item/multitool))
+ if(I.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "You save the data in [I]'s buffer. It can now be saved to pads with closed panels.")
return TRUE
- else if(istype(I, /obj/item/multitool))
+ else if(I.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if(istype(M.buffer, /obj/machinery/quantumpad))
if(M.buffer == src)
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index c18411ef..e24b4bd9 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -36,7 +36,7 @@
update_icon()
/obj/machinery/recharger/attackby(obj/item/G, mob/user, params)
- if(istype(G, /obj/item/wrench))
+ if(G.tool_behavior == TOOL_WRENCH)
if(charging)
to_chat(user, "Remove the charging item first!")
return
@@ -77,7 +77,7 @@
if(default_deconstruction_screwdriver(user, "rechargeropen", "recharger0", G))
return
- if(panel_open && istype(G, /obj/item/crowbar))
+ if(panel_open && G.tool_behavior == TOOL_CROWBAR)
default_deconstruction_crowbar(G)
return
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index a7a0f507..ea6ccdf3 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -502,7 +502,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
messages += "From: [linkedsender]
[message]"
/obj/machinery/requests_console/attackby(obj/item/O, mob/user, params)
- if(istype(O, /obj/item/crowbar))
+ if(O.tool_behavior == TOOL_CROWBAR)
if(open)
to_chat(user, "You close the maintenance panel.")
open = FALSE
@@ -511,7 +511,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
open = TRUE
update_icon()
return
- if(istype(O, /obj/item/screwdriver))
+ if(O.tool_behavior == TOOL_SCREWDRIVER)
if(open)
hackState = !hackState
if(hackState)
diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm
index 6f6497a9..73c1288c 100644
--- a/code/game/machinery/shieldgen.dm
+++ b/code/game/machinery/shieldgen.dm
@@ -147,7 +147,7 @@
return
/obj/machinery/shieldgen/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
W.play_tool_sound(src, 100)
panel_open = !panel_open
if(panel_open)
@@ -169,7 +169,7 @@
to_chat(user, "You repair \the [src].")
update_icon()
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
if(locked)
to_chat(user, "The bolts are covered! Unlocking this would retract the covers.")
return
@@ -345,7 +345,7 @@
return ..()
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
default_unfasten_wrench(user, W, 0)
else if(W.GetID())
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 984a911d..df7f3fda 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -152,7 +152,7 @@
else
to_chat(user, "The hatch must be open to insert a power cell!")
return
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
panel_open = !panel_open
user.visible_message("\The [user] [panel_open ? "opens" : "closes"] the hatch on \the [src].", "You [panel_open ? "open" : "close"] the hatch on \the [src].")
update_icon()
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 1da89fb3..7eb81d94 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -80,7 +80,7 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
to_chat(user, "You need to screw the beacon to the floor first!")
/obj/machinery/power/singularity_beacon/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(active)
to_chat(user, "You need to deactivate the beacon first!")
return
@@ -164,4 +164,4 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
desc = "A label on it reads: Warning: Activating this device will send a silly explosive to your location."
droptype = /obj/machinery/syndicatebomb/badmin/clown
-#undef METEOR_DISASTER_MODIFIER
\ No newline at end of file
+#undef METEOR_DISASTER_MODIFIER
diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm
index f10a2874..e149de6d 100644
--- a/code/game/machinery/syndicatebomb.dm
+++ b/code/game/machinery/syndicatebomb.dm
@@ -112,7 +112,7 @@
. = timer_set
/obj/machinery/syndicatebomb/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench) && can_unanchor)
+ if(I.tool_behaviour == TOOL_WRENCH && can_unanchor)
if(!anchored)
if(!isturf(loc) || isspaceturf(loc))
to_chat(user, "The bomb must be placed on solid ground to attach it.")
@@ -130,7 +130,7 @@
else
to_chat(user, "The bolts are locked down!")
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
open_panel = !open_panel
update_icon()
to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.")
@@ -138,7 +138,7 @@
else if(is_wire_tool(I) && open_panel)
wires.interact(user)
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
if(open_panel && wires.is_all_cut())
if(payload)
to_chat(user, "You carefully pry out [payload].")
@@ -158,7 +158,7 @@
to_chat(user, "You place [payload] into [src].")
else
to_chat(user, "[payload] is already loaded into [src]! You'll have to remove it first.")
- else if(istype(I, /obj/item/weldingtool))
+ else if(I.tool_behavior == TOOL_WELDER)
if(payload || !wires.is_all_cut() || !open_panel)
return
@@ -436,7 +436,7 @@
qdel(src)
/obj/item/bombcore/chemical/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/crowbar) && beakers.len > 0)
+ if(I.tool_behavior == TOOL_CROWBAR && beakers.len > 0)
I.play_tool_sound(src)
for (var/obj/item/B in beakers)
B.forceMove(drop_location())
diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm
index d93422d4..6e94bd02 100644
--- a/code/game/machinery/telecomms/computers/message.dm
+++ b/code/game/machinery/telecomms/computers/message.dm
@@ -325,7 +325,7 @@
update_static_data(usr)
/obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/living/user, params)
- if(istype(O, /obj/item/screwdriver) && CHECK_BITFIELD(obj_flags, EMAGGED))
+ if(O.tool_behavior == TOOL_SCREWDRIVER && CHECK_BITFIELD(obj_flags, EMAGGED))
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
//Why this though, you should make it emag to a board level. (i wont do it)
to_chat(user, "It is too hot to mess with!")
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 78ecb5a5..3c054953 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -19,7 +19,7 @@
if(default_deconstruction_screwdriver(user, icon_open, icon_closed, P))
return
// Using a multitool lets you access the receiver's interface
- else if(istype(P, /obj/item/multitool))
+ else if(P.tool_behavior == TOOL_MULTITOOL)
attack_hand(user)
else if(default_deconstruction_crowbar(P))
@@ -244,7 +244,7 @@
// Check if the user can use it.
/obj/machinery/telecomms/proc/canInteract(mob/user)
- if(issilicon(user) || istype(user.get_active_held_item(), /obj/item/multitool))
+ if(issilicon(user) || user.get_active_held_item().tool_behavior == TOOL_MULTITOOL)
return TRUE
return FALSE
// Check if the user is nearby and has a multitool.
@@ -265,6 +265,6 @@
var/mob/living/silicon/ai/U = user
P = U.aiMulti
else if(iscyborg(user) && in_range(user, src))
- if(istype(user.get_active_held_item(), /obj/item/multitool))
+ if(user.get_active_held_item().tool_behavior == TOOL_MULTITOOL)
P = user.get_active_held_item()
return P
diff --git a/code/game/machinery/telecomms/machines/allinone.dm b/code/game/machinery/telecomms/machines/allinone.dm
index fbb55055..a8e61908 100644
--- a/code/game/machinery/telecomms/machines/allinone.dm
+++ b/code/game/machinery/telecomms/machines/allinone.dm
@@ -38,5 +38,5 @@
signal.broadcast()
/obj/machinery/telecomms/allinone/attackby(obj/item/P, mob/user, params)
- if(istype(P, /obj/item/multitool))
+ if(P.tool_behavior == TOOL_MULTITOOL)
return attack_hand(user)
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 9d3c5b74..d4cf08b2 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -156,7 +156,7 @@
return ..()
/obj/machinery/teleport/station/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/M = W
if(panel_open)
M.buffer = src
@@ -177,7 +177,7 @@
else if(default_deconstruction_crowbar(W))
return
- else if(istype(W, /obj/item/wirecutters))
+ else if(W.tool_behavior == TOOL_WIRECUTTER)
if(panel_open)
link_console_and_hub()
to_chat(user, "You reconnect the station to nearby machinery.")
diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm
index a5ed0df2..b304050b 100644
--- a/code/game/mecha/mecha_defense.dm
+++ b/code/game/mecha/mecha_defense.dm
@@ -201,7 +201,7 @@
to_chat(user, "Invalid ID: Access denied.")
else
to_chat(user, "Maintenance protocols disabled by operator.")
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
if(construction_state==1)
construction_state = 2
to_chat(user, "You undo the securing bolts.")
@@ -209,7 +209,7 @@
construction_state = 1
to_chat(user, "You tighten the securing bolts.")
return
- else if(istype(W, /obj/item/crowbar))
+ else if(W.tool_behavior == TOOL_CROWBAR)
if(construction_state==2)
construction_state = 3
to_chat(user, "You open the hatch to the power unit.")
@@ -226,7 +226,7 @@
else
to_chat(user, "You need two lengths of cable to fix this mech!")
return
- else if(istype(W, /obj/item/screwdriver) && user.a_intent != INTENT_HARM)
+ else if(W.tool_behavior == TOOL_SCREWDRIVER && user.a_intent != INTENT_HARM)
if(internal_damage & MECHA_INT_TEMP_CONTROL)
clearInternalDamage(MECHA_INT_TEMP_CONTROL)
to_chat(user, "You repair the damaged temperature controller.")
@@ -254,7 +254,7 @@
to_chat(user, "There's already a powercell installed.")
return
- else if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ else if(W.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM)
user.changeNext_move(CLICK_CD_MELEE)
if(obj_integrity < max_integrity)
if(W.use_tool(src, user, 0, volume=50, amount=1))
diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm
index af03e9ca..d3f6f5d7 100644
--- a/code/game/mecha/mecha_wreckage.dm
+++ b/code/game/mecha/mecha_wreckage.dm
@@ -35,7 +35,7 @@
. += "The AI recovery beacon is active."
/obj/structure/mecha_wreckage/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
if(salvage_num <= 0 || !length(welder_salvage))
to_chat(user, "You don't see anything that can be cut with [I]!")
return
@@ -54,7 +54,7 @@
to_chat(user, "You fail to salvage anything valuable from [src]!")
return
- else if(istype(I, /obj/item/wirecutters))
+ else if(I.tool_behavior == TOOL_WIRECUTTER)
if(salvage_num <= 0)
to_chat(user, "You don't see anything that can be cut with [I]!")
return
@@ -67,7 +67,7 @@
else
to_chat(user, "You fail to salvage anything valuable from [src]!")
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
if(crowbar_salvage && crowbar_salvage.len)
var/obj/S = pick(crowbar_salvage)
if(S)
diff --git a/code/game/objects/effects/contraband.dm b/code/game/objects/effects/contraband.dm
index 18f51d2d..4f5b0d39 100644
--- a/code/game/objects/effects/contraband.dm
+++ b/code/game/objects/effects/contraband.dm
@@ -87,7 +87,7 @@
/obj/structure/sign/poster/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters))
+ if(I.tool_behavior == TOOL_WIRECUTTER)
I.play_tool_sound(src, 100)
if(ruined)
to_chat(user, "You remove the remnants of the poster.")
diff --git a/code/game/objects/effects/effects.dm b/code/game/objects/effects/effects.dm
index dd0bc8ab..12673c12 100644
--- a/code/game/objects/effects/effects.dm
+++ b/code/game/objects/effects/effects.dm
@@ -47,9 +47,6 @@
qdel(src)
return 0
-/obj/effect/ConveyorMove()
- return
-
/obj/effect/abstract/ex_act(severity, target)
return
diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm
index 479cc3b2..e71e2b1a 100644
--- a/code/game/objects/items/RCL.dm
+++ b/code/game/objects/items/RCL.dm
@@ -44,7 +44,7 @@
return
update_icon()
to_chat(user, "You add the cables to [src]. It now contains [loaded.amount].")
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(!loaded)
return
if(ghetto && prob(10)) //Is it a ghetto RCL? If so, give it a 10% chance to fall apart
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index c725148d..6dd5422a 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -60,7 +60,7 @@
/obj/item/wallframe/attackby(obj/item/W, mob/user, params)
..()
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
// For camera-building borgs
var/turf/T = get_step(get_turf(user), user.dir)
if(iswallturf(T))
@@ -69,7 +69,7 @@
var/metal_amt = round(materials[MAT_METAL]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(materials[MAT_GLASS]/MINERAL_MATERIAL_AMOUNT)
- if(istype(W, /obj/item/wrench) && (metal_amt || glass_amt))
+ if(W.tool_behavior == TOOL_WRENCH && (metal_amt || glass_amt))
to_chat(user, "You dismantle [src].")
if(metal_amt)
new /obj/item/stack/sheet/metal(get_turf(src), metal_amt)
diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm
index 68ada3f5..928c8a1c 100644
--- a/code/game/objects/items/circuitboards/computer_circuitboards.dm
+++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm
@@ -66,7 +66,7 @@
var/list/dept_list = list("Civilian","Security","Medical","Science","Engineering","Cargo")
/obj/item/circuitboard/computer/card/minor/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
target_dept = (target_dept == dept_list.len) ? 1 : (target_dept + 1)
to_chat(user, "You set the board to \"[dept_list[target_dept]]\".")
else
@@ -181,7 +181,7 @@
build_path = /obj/machinery/computer/rdconsole/core
/obj/item/circuitboard/computer/rdconsole/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/computer/rdconsole/core)
name = "R&D Console - Robotics (Computer Board)"
build_path = /obj/machinery/computer/rdconsole/robotics
@@ -323,7 +323,7 @@
build_path = /obj/machinery/computer/libraryconsole
/obj/item/circuitboard/computer/libraryconsole/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/computer/libraryconsole/bookmanagement)
name = "Library Visitor Console (Computer Board)"
build_path = /obj/machinery/computer/libraryconsole
diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm
index 8ccc62ae..6f952826 100644
--- a/code/game/objects/items/circuitboards/machine_circuitboards.dm
+++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm
@@ -279,7 +279,7 @@
/obj/machinery/vending/gato = "GATO Vending Machine")
/obj/item/circuitboard/machine/vendor/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
var/choice = show_radial_menu(user, src, GLOB.vending_m_choices, radius = 46, require_near = TRUE, tooltips = TRUE)
if(!choice)
return
@@ -353,7 +353,7 @@
build_path = PATH_HEATER
/obj/item/circuitboard/machine/thermomachine/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
var/obj/item/circuitboard/new_type
var/new_setting
switch(build_path)
@@ -422,7 +422,7 @@
needs_anchored = FALSE
/obj/item/circuitboard/machine/processor/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/processor)
name = "Slime Processor (Machine Board)"
build_path = /obj/machinery/processor/slime
@@ -458,7 +458,7 @@
return ..()
/obj/item/circuitboard/machine/smartfridge/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
var/position = fridges_name_paths.Find(build_path, fridges_name_paths)
position = (position == fridges_name_paths.len) ? 1 : (position + 1)
build_path = fridges_name_paths[position]
@@ -635,7 +635,7 @@
build_path = PATH_POWERCOIL
/obj/item/circuitboard/machine/tesla_coil/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
var/obj/item/circuitboard/new_type
var/new_setting
switch(build_path)
@@ -732,7 +732,7 @@
needs_anchored = FALSE
/obj/item/circuitboard/machine/chem_master/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
var/new_name = "ChemMaster"
var/new_path = /obj/machinery/chem_master
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index c06031ce..a494444f 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -124,7 +124,7 @@
to_chat(user, "You install a cell in [src].")
update_icon()
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(cell)
cell.update_icon()
cell.forceMove(get_turf(src))
diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm
index 3cded97e..ed396652 100644
--- a/code/game/objects/items/devices/geiger_counter.dm
+++ b/code/game/objects/items/devices/geiger_counter.dm
@@ -168,7 +168,7 @@
to_chat(user, "[icon2html(src, user)] Target is free of radioactive contamination.")
/obj/item/geiger_counter/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver) && (obj_flags & EMAGGED))
+ if(I.tool_behavior == TOOL_SCREWDRIVER && (obj_flags & EMAGGED))
if(scanning)
to_chat(user, "Turn off [src] before you perform this action!")
return 0
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 062c9e65..c1693597 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -48,7 +48,7 @@
else
to_chat(user, "[src] already has a diode installed.")
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(diode)
to_chat(user, "You remove the [diode.name] from \the [src].")
diode.forceMove(drop_location())
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index 58fc77e7..1cbc2792 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -57,7 +57,7 @@
set_light(0)
/obj/item/powersink/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !T.intact)
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index d9b46303..85611d90 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -266,7 +266,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index efdf0557..bb38bc46 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -22,7 +22,7 @@
freerange = TRUE
/obj/item/radio/intercom/ratvar/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "[src] is fastened to the wall with [is_servant_of_ratvar(user) ? "replicant alloy" : "some material you've never seen"], and can't be removed.")
return //no unfastening!
. = ..()
@@ -56,7 +56,7 @@
. += "It's unscrewed from the wall, and can be detached."
/obj/item/radio/intercom/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(unfastened)
user.visible_message("[user] starts tightening [src]'s screws...", "You start screwing in [src]...")
if(I.use_tool(src, user, 30, volume=50))
@@ -68,7 +68,7 @@
user.visible_message("[user] loosens [src]'s screws!", "You unscrew [src], loosening it from the wall.")
unfastened = TRUE
return
- else if(istype(I, /obj/item/wrench))
+ else if(I.tool_behaviour == TOOL_WRENCH)
if(!unfastened)
to_chat(user, "You need to unscrew [src] from the wall first!")
return
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 55366608..f5b9863a 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -335,7 +335,7 @@
/obj/item/radio/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
unscrewed = !unscrewed
if(unscrewed)
to_chat(user, "The radio can now be attached and modified!")
@@ -386,7 +386,7 @@
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index dd086e70..20c954f1 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -271,7 +271,7 @@
/obj/item/tape/attackby(obj/item/I, mob/user, params)
- if(ruined && istype(I, /obj/item/screwdriver) || istype(I, /obj/item/pen))
+ if(ruined && I.tool_behavior == TOOL_SCREWDRIVER || istype(I, /obj/item/pen))
to_chat(user, "You start winding the tape back in...")
if(I.use_tool(src, user, 120))
to_chat(user, "You wound the tape back in.")
diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm
index 906572d0..ffdc9cd7 100644
--- a/code/game/objects/items/flamethrower.dm
+++ b/code/game/objects/items/flamethrower.dm
@@ -80,7 +80,7 @@
flame_turf(turflist)
/obj/item/flamethrower/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && !status)//Taking this apart
+ if(W.tool_behavior == TOOL_WRENCH && !status)//Taking this apart
var/turf/T = get_turf(src)
if(weldtool)
weldtool.forceMove(T)
@@ -95,7 +95,7 @@
qdel(src)
return
- else if(istype(W, /obj/item/screwdriver) && igniter && !lit)
+ else if(W.tool_behavior == TOOL_SCREWDRIVER && igniter && !lit)
status = !status
to_chat(user, "[igniter] is now [status ? "secured" : "unsecured"]!")
update_icon()
diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm
index 3b6ffc83..3d670fec 100644
--- a/code/game/objects/items/grenades/chem_grenade.dm
+++ b/code/game/objects/items/grenades/chem_grenade.dm
@@ -51,7 +51,7 @@
/obj/item/grenade/chem_grenade/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(stage == WIRED)
if(beakers.len)
stage_change(READY)
@@ -106,11 +106,11 @@
to_chat(user, "You need one length of coil to wire the assembly!")
return
- else if(stage == READY && istype(I, /obj/item/wirecutters) && !active)
+ else if(stage == READY && I.tool_behavior == TOOL_WIRECUTTER && !active)
stage_change(WIRED)
to_chat(user, "You unlock the [initial(name)] assembly.")
- else if(stage == WIRED && istype(I, /obj/item/wrench))
+ else if(stage == WIRED && I.tool_behaviour == TOOL_WRENCH)
if(beakers.len)
for(var/obj/O in beakers)
O.forceMove(drop_location())
@@ -274,7 +274,7 @@
var/unit_spread = 10 // Amount of units per repeat. Can be altered with a multitool.
/obj/item/grenade/chem_grenade/adv_release/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/multitool))
+ if(I.tool_behavior == TOOL_MULTITOOL)
switch(unit_spread)
if(0 to 24)
unit_spread += 5
diff --git a/code/game/objects/items/grenades/grenade.dm b/code/game/objects/items/grenades/grenade.dm
index 0c83ddbb..e65978fb 100644
--- a/code/game/objects/items/grenades/grenade.dm
+++ b/code/game/objects/items/grenades/grenade.dm
@@ -95,7 +95,7 @@
/obj/item/grenade/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
switch(det_time)
if ("1")
det_time = 10
diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm
index 1c213b20..da84ba87 100644
--- a/code/game/objects/items/grenades/plastic.dm
+++ b/code/game/objects/items/grenades/plastic.dm
@@ -46,7 +46,7 @@
playsound(src, 'sound/weapons/tap.ogg', 20, 1)
update_icon()
return
- if(nadeassembly && istype(I, /obj/item/wirecutters))
+ if(nadeassembly && I.tool_behavior == TOOL_WIRECUTTER)
I.play_tool_sound(src, 20)
nadeassembly.forceMove(get_turf(src))
nadeassembly.master = null
@@ -196,7 +196,7 @@
user.gib(1, 1)
/obj/item/grenade/plastic/c4/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
open_panel = !open_panel
to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.")
else if(is_wire_tool(I))
diff --git a/code/game/objects/items/inducer.dm b/code/game/objects/items/inducer.dm
index 079e0d79..cde48c62 100644
--- a/code/game/objects/items/inducer.dm
+++ b/code/game/objects/items/inducer.dm
@@ -62,7 +62,7 @@
/obj/item/inducer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
W.play_tool_sound(src)
if(!opened)
to_chat(user, "You unscrew the battery compartment.")
diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm
index 57b9973a..81401909 100644
--- a/code/game/objects/items/melee/energy.dm
+++ b/code/game/objects/items/melee/energy.dm
@@ -179,7 +179,7 @@
possible_colors = list("purple" = LIGHT_COLOR_LAVENDER)
/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
item_color = "rainbow"
diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm
index e63b4d7a..5ddf205e 100644
--- a/code/game/objects/items/pneumaticCannon.dm
+++ b/code/game/objects/items/pneumaticCannon.dm
@@ -77,7 +77,7 @@
updateTank(W, 0, user)
else if(W.type == type)
to_chat(user, "You're fairly certain that putting a pneumatic cannon inside another pneumatic cannon would cause a spacetime disruption.")
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
switch(pressureSetting)
if(1)
pressureSetting = 2
@@ -86,7 +86,7 @@
if(3)
pressureSetting = 1
to_chat(user, "You tweak \the [src]'s pressure output to [pressureSetting].")
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(tank)
updateTank(tank, 1, user)
else if(loadedWeightClass >= maxWeightClass)
diff --git a/code/game/objects/items/powerfist.dm b/code/game/objects/items/powerfist.dm
index 27ed0f82..48ad379c 100644
--- a/code/game/objects/items/powerfist.dm
+++ b/code/game/objects/items/powerfist.dm
@@ -36,7 +36,7 @@
to_chat(user, "\The [IT] is too small for \the [src].")
return
updateTank(W, 0, user)
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
switch(fisto_setting)
if(1)
fisto_setting = 2
@@ -46,7 +46,7 @@
fisto_setting = 1
W.play_tool_sound(src)
to_chat(user, "You tweak \the [src]'s piston valve to [fisto_setting].")
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(tank)
updateTank(tank, 1, user)
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 91b8021d..6f479fc7 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -226,7 +226,7 @@
else
to_chat(user, "You need to attach a flash to it first!")
- else if (istype(W, /obj/item/multitool))
+ else if (W.tool_behavior == TOOL_MULTITOOL)
if(check_completion())
Interact(user)
else
@@ -382,7 +382,7 @@
var/mob/living/living_user = usr
var/obj/item/item_in_hand = living_user.get_active_held_item()
- if(!istype(item_in_hand, /obj/item/multitool))
+ if(!item_in_hand.tool_behavior == TOOL_MULTITOOL)
to_chat(living_user, "You need a multitool!")
return
diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm
index c1db69f7..2e9ba6d8 100644
--- a/code/game/objects/items/stacks/medical.dm
+++ b/code/game/objects/items/stacks/medical.dm
@@ -146,7 +146,7 @@
/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters) || I.is_sharp())
+ if(I.tool_behavior == TOOL_WIRECUTTER || I.is_sharp())
if(get_amount() < 2)
to_chat(user, "You need at least two gauzes to do this!")
return
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 53787362..e46292fa 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -40,7 +40,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(get_amount() < 2)
to_chat(user, "You need at least two rods to do this!")
return
diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm
index 85e08aa4..974210a0 100644
--- a/code/game/objects/items/stacks/tiles/light.dm
+++ b/code/game/objects/items/stacks/tiles/light.dm
@@ -20,7 +20,7 @@
state = 0 //fine
/obj/item/stack/tile/light/attackby(obj/item/O, mob/user, params)
- if(istype(O, /obj/item/crowbar))
+ if(O.tool_behavior == TOOL_CROWBAR)
new/obj/item/stack/sheet/metal(user.loc)
amount--
new/obj/item/stack/light_w(user.loc)
diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm
index 9178adfe..a0d9edc1 100644
--- a/code/game/objects/items/stacks/tiles/tile_types.dm
+++ b/code/game/objects/items/stacks/tiles/tile_types.dm
@@ -20,7 +20,7 @@
/obj/item/stack/tile/attackby(obj/item/W, mob/user, params)
- if (istype(W, /obj/item/weldingtool))
+ if (W.tool_behavior == TOOL_WELDER)
if(get_amount() < 4)
to_chat(user, "You need at least four tiles to do this!")
return
diff --git a/code/game/objects/items/storage/secure.dm b/code/game/objects/items/storage/secure.dm
index 8bb37fd6..c261befe 100644
--- a/code/game/objects/items/storage/secure.dm
+++ b/code/game/objects/items/storage/secure.dm
@@ -36,14 +36,14 @@
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
if(SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
- if (istype(W, /obj/item/screwdriver))
+ if (W.tool_behavior == TOOL_SCREWDRIVER)
if (W.use_tool(src, user, 20))
open =! open
to_chat(user, "You [open ? "open" : "close"] the service panel.")
return
- if (istype(W, /obj/item/wirecutters))
+ if (W.tool_behavior == TOOL_WIRECUTTER)
to_chat(user, "[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be pulsed.")
- if ((istype(W, /obj/item/multitool)) && (!l_hacking))
+ if ((W.tool_behavior == TOOL_MULTITOOL) && (!l_hacking))
if(open == 1)
to_chat(user, "Now attempting to reset internal memory, please hold.")
l_hacking = 1
diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm
index 508dbbfd..eeeab474 100644
--- a/code/game/objects/items/stunbaton.dm
+++ b/code/game/objects/items/stunbaton.dm
@@ -109,7 +109,7 @@
to_chat(user, "You install a cell in [src].")
update_icon()
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(cell)
cell.update_icon()
cell.forceMove(get_turf(src))
diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm
index 5f9066de..17198297 100644
--- a/code/game/objects/items/tools/weldingtool.dm
+++ b/code/game/objects/items/tools/weldingtool.dm
@@ -90,7 +90,7 @@
/obj/item/weldingtool/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
flamethrower_screwdriver(I, user)
else if(istype(I, /obj/item/stack/rods))
flamethrower_rods(I, user)
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index bc50d055..5e7baedc 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -259,7 +259,7 @@
newSaber.item_color = "rainbow"
qdel(W)
qdel(src)
- else if(istype(W, /obj/item/multitool))
+ else if(W.tool_behavior == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
item_color = "rainbow"
diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm
index f4cdd6fa..bbae8d00 100644
--- a/code/game/objects/items/twohanded.dm
+++ b/code/game/objects/items/twohanded.dm
@@ -452,7 +452,7 @@
possible_colors = list("purple")
/obj/item/twohanded/dualsaber/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
to_chat(user, "2XRNBW_ENGAGE")
@@ -896,4 +896,4 @@
var/client/C = user.client
C.change_view(CONFIG_GET(string/default_view))
user.client.pixel_x = 0
- user.client.pixel_y = 0
\ No newline at end of file
+ user.client.pixel_y = 0
diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm
index 5b9a7649..443b494d 100644
--- a/code/game/objects/structures/ai_core.dm
+++ b/code/game/objects/structures/ai_core.dm
@@ -61,7 +61,7 @@
return TRUE
/obj/structure/AIcore/latejoin_inactive/attackby(obj/item/P, mob/user, params)
- if(istype(P, /obj/item/multitool))
+ if(P.tool_behavior == TOOL_MULTITOOL)
active = !active
to_chat(user, "You [active? "activate" : "deactivate"] [src]'s transmitters.")
return
@@ -76,10 +76,10 @@
return ..()
/obj/structure/AIcore/attackby(obj/item/P, mob/user, params)
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
return default_unfasten_wrench(user, P, 20)
if(!anchored)
- if(istype(P, /obj/item/weldingtool) && can_deconstruct)
+ if(P.tool_behavior == TOOL_WELDER && can_deconstruct)
if(state != EMPTY_CORE)
to_chat(user, "The core must be empty to deconstruct it!")
return
@@ -105,13 +105,13 @@
circuit = P
return
if(CIRCUIT_CORE)
- if(istype(P, /obj/item/screwdriver))
+ if(P.tool_behavior == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
to_chat(user, "You screw the circuit board into place.")
state = SCREWED_CORE
update_icon()
return
- if(istype(P, /obj/item/crowbar))
+ if(P.tool_behavior == TOOL_CROWBAR)
P.play_tool_sound(src)
to_chat(user, "You remove the circuit board.")
state = EMPTY_CORE
@@ -120,7 +120,7 @@
circuit = null
return
if(SCREWED_CORE)
- if(istype(P, /obj/item/screwdriver) && circuit)
+ if(P.tool_behavior == TOOL_SCREWDRIVER && circuit)
P.play_tool_sound(src)
to_chat(user, "You unfasten the circuit board.")
state = CIRCUIT_CORE
@@ -139,7 +139,7 @@
to_chat(user, "You need five lengths of cable to wire the AI core!")
return
if(CABLED_CORE)
- if(istype(P, /obj/item/wirecutters))
+ if(P.tool_behavior == TOOL_WIRECUTTER)
if(brain)
to_chat(user, "Get that [brain.name] out of there first!")
else
@@ -201,7 +201,7 @@
update_icon()
return
- if(istype(P, /obj/item/crowbar) && brain)
+ if(P.tool_behavior == TOOL_CROWBAR && brain)
P.play_tool_sound(src)
to_chat(user, "You remove the brain.")
brain.forceMove(loc)
@@ -210,7 +210,7 @@
return
if(GLASS_CORE)
- if(istype(P, /obj/item/crowbar))
+ if(P.tool_behavior == TOOL_CROWBAR)
P.play_tool_sound(src)
to_chat(user, "You remove the glass panel.")
state = CABLED_CORE
@@ -218,7 +218,7 @@
new /obj/item/stack/sheet/rglass(loc, 2)
return
- if(istype(P, /obj/item/screwdriver))
+ if(P.tool_behavior == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
to_chat(user, "You connect the monitor.")
if(brain)
@@ -247,7 +247,7 @@
P.transfer_ai("INACTIVE", "AICARD", src, user)
return
- if(istype(P, /obj/item/screwdriver))
+ if(P.tool_behavior == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
to_chat(user, "You disconnect the monitor.")
state = GLASS_CORE
diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm
index 772929f6..dac8103f 100644
--- a/code/game/objects/structures/barsigns.dm
+++ b/code/game/objects/structures/barsigns.dm
@@ -65,7 +65,7 @@
pick_sign(user)
/obj/structure/sign/barsign/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(!allowed(user))
to_chat(user, "Access denied.")
return
diff --git a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm
index 4c4c53de..cd8f95e3 100644
--- a/code/game/objects/structures/beds_chairs/bed.dm
+++ b/code/game/objects/structures/beds_chairs/bed.dm
@@ -52,7 +52,7 @@
return attack_hand(user)
/obj/structure/bed/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
+ if(W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
deconstruct(TRUE)
else if(istype(W, /obj/item/bedsheet))
diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm
index 3c9dea06..67f40490 100644
--- a/code/game/objects/structures/beds_chairs/chair.dm
+++ b/code/game/objects/structures/beds_chairs/chair.dm
@@ -138,7 +138,7 @@
qdel(src)
/obj/structure/chair/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
+ if(W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index 36b46aeb..db822212 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -45,7 +45,7 @@ LINEN BINS
return
/obj/item/bedsheet/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters) || I.is_sharp())
+ if(I.tool_behavior == TOOL_WIRECUTTER || I.is_sharp())
var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3)
transfer_fingerprints_to(C)
C.add_fingerprint(user)
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 1d960b21..79707f6a 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -343,7 +343,7 @@
. = TRUE
if(opened)
if(istype(W, cutting_tool))
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
@@ -368,9 +368,9 @@
return TRUE
else if(istype(W, /obj/item/electronics/airlock))
handle_lock_addition(user, W)
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
handle_lock_removal(user, W)
- else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
+ else if(W.tool_behavior == TOOL_WELDER && can_weld_shut)
if(!W.tool_start_check(user, amount=0))
return
@@ -387,7 +387,7 @@
"You [welded ? "weld" : "unwelded"] \the [src] with \the [W].",
"You hear welding.")
update_icon()
- else if(istype(W, /obj/item/wrench) && anchorable)
+ else if(W.tool_behavior == TOOL_WRENCH && anchorable)
if(isinspace() && !anchored)
return
setAnchored(!anchored)
diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm
index 1c348502..7aa0ac54 100644
--- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm
+++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm
@@ -32,7 +32,7 @@
else
name = "body bag"
return
- else if(istype(I, /obj/item/wirecutters))
+ else if(I.tool_behavior == TOOL_WIRECUTTER)
to_chat(user, "You cut the tag off [src].")
name = "body bag"
tagged = 0
diff --git a/code/game/objects/structures/crates_lockers/crates/large.dm b/code/game/objects/structures/crates_lockers/crates/large.dm
index 880460a2..f63d5f01 100644
--- a/code/game/objects/structures/crates_lockers/crates/large.dm
+++ b/code/game/objects/structures/crates_lockers/crates/large.dm
@@ -16,7 +16,7 @@
to_chat(user, "You need a crowbar to pry this open!")
/obj/structure/closet/crate/large/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
if(manifest)
tear_manifest(user)
@@ -40,4 +40,4 @@
else
to_chat(user, "You need a crowbar to pry this open!")
return FALSE //Just stop. Do nothing. Don't turn into an invisible sprite. Don't open like a locker.
- //The large crate has no non-attack interactions other than the crowbar, anyway.
\ No newline at end of file
+ //The large crate has no non-attack interactions other than the crowbar, anyway.
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 9493efa1..4f3e1137 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -106,7 +106,7 @@
toggle_lock(user)
else
to_chat(user, "Access denied.")
- else if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
+ else if(W.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=5))
return
@@ -119,7 +119,7 @@
else
to_chat(user, "[src] is already in good condition!")
return
- else if(!alert && istype(W, /obj/item/crowbar) && openable) //Only applies to the lab cage and player made display cases
+ else if(!alert && W.tool_behavior == TOOL_CROWBAR && openable) //Only applies to the lab cage and player made display cases
if(broken)
if(showpiece)
to_chat(user, "Remove the displayed object first.")
@@ -189,7 +189,7 @@
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench)) //The player can only deconstruct the wooden frame
+ if(I.tool_behaviour == TOOL_WRENCH) //The player can only deconstruct the wooden frame
to_chat(user, "You start disassembling [src]...")
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 0f7a4432..42f27ed9 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -58,7 +58,7 @@
return
created_name = t
- else if(istype(W, /obj/item/weldingtool) && (mineral || glass || !anchored ))
+ else if(W.tool_behavior == TOOL_WELDER && (mineral || glass || !anchored ))
if(!W.tool_start_check(user, amount=0))
return
@@ -88,7 +88,7 @@
to_chat(user, "You disassemble the airlock assembly.")
deconstruct(TRUE)
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
if(!anchored )
var/door_check = 1
for(var/obj/machinery/door/D in loc)
@@ -134,7 +134,7 @@
to_chat(user, "You wire the airlock assembly.")
name = "wired airlock assembly"
- else if(istype(W, /obj/item/wirecutters) && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
+ else if(W.tool_behavior == TOOL_WIRECUTTER && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
user.visible_message("[user] cuts the wires from the airlock assembly.", \
"You start to cut the wires from the airlock assembly...")
@@ -162,7 +162,7 @@
electronics = W
- else if(istype(W, /obj/item/crowbar) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
+ else if(W.tool_behavior == TOOL_CROWBAR && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
user.visible_message("[user] removes the electronics from the airlock assembly.", \
"You start to remove electronics from the airlock assembly...")
@@ -226,7 +226,7 @@
else
to_chat(user, "You cannot add [G] to [src]!")
- else if(istype(W, /obj/item/screwdriver) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
+ else if(W.tool_behavior == TOOL_SCREWDRIVER && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
user.visible_message("[user] finishes the airlock.", \
"You start finishing the airlock...")
diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm
index 0065a1e4..30f4536d 100644
--- a/code/game/objects/structures/dresser.dm
+++ b/code/game/objects/structures/dresser.dm
@@ -7,7 +7,7 @@
anchored = TRUE
/obj/structure/dresser/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You begin to [anchored ? "unwrench" : "wrench"] [src].")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "You successfully [anchored ? "unwrench" : "wrench"] [src].")
@@ -90,7 +90,7 @@
anchored = TRUE
/obj/structure/gmushroomdresser/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You begin to [anchored ? "unwrench" : "wrench"] [src].")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "You successfully [anchored ? "unwrench" : "wrench"] [src].")
@@ -173,7 +173,7 @@
anchored = TRUE
/obj/structure/plaswooddresser/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You begin to [anchored ? "unwrench" : "wrench"] [src].")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "You successfully [anchored ? "unwrench" : "wrench"] [src].")
@@ -256,7 +256,7 @@
anchored = TRUE
/obj/structure/shadowwdresser/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You begin to [anchored ? "unwrench" : "wrench"] [src].")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "You successfully [anchored ? "unwrench" : "wrench"] [src].")
@@ -328,4 +328,4 @@
var/n_color = input(H, "Choose your [garment_type]'\s color.", "Character Preference", default_color) as color|null
if(!n_color || !H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return default_color
- return sanitize_hexcolor(n_color)
\ No newline at end of file
+ return sanitize_hexcolor(n_color)
diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm
index 4c66ba5d..07e5fd3a 100644
--- a/code/game/objects/structures/electricchair.dm
+++ b/code/game/objects/structures/electricchair.dm
@@ -11,7 +11,7 @@
add_overlay(mutable_appearance('icons/obj/chairs.dmi', "echair_over", MOB_LAYER + 1))
/obj/structure/chair/e_chair/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
var/obj/structure/chair/C = new /obj/structure/chair(loc)
W.play_tool_sound(src)
C.setDir(dir)
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index d6beaa26..00e69d5c 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -41,7 +41,7 @@
update_icon()
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench) && !stored_extinguisher)
+ if(I.tool_behaviour == TOOL_WRENCH && !stored_extinguisher)
to_chat(user, "You start unsecuring [name]...")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index 10fe32b2..db25db28 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -92,7 +92,7 @@
to_chat(user, "You must wait until the door has stopped moving!")
return
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(density)
var/turf/T = get_turf(src)
if(T.density)
@@ -106,7 +106,7 @@
else
to_chat(user, "You can't reach, close it first!")
- else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
+ else if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
if(W.use_tool(src, user, 0, volume=50))
dismantle(user, TRUE)
else if(istype(W, /obj/item/pickaxe/drill/jackhammer))
@@ -157,7 +157,7 @@
/obj/structure/falsewall/reinforced/attackby(obj/item/tool, mob/user)
..()
- if(istype(tool, /obj/item/wirecutters))
+ if(tool.tool_behavior == TOOL_WIRECUTTER)
dismantle(user, TRUE, tool)
/*
diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm
index 35891fa6..83fb91c7 100644
--- a/code/game/objects/structures/fence.dm
+++ b/code/game/objects/structures/fence.dm
@@ -57,7 +57,7 @@
hole_size = LARGE_HOLE
/obj/structure/fence/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/wirecutters))
+ if(W.tool_behavior == TOOL_WIRECUTTER)
if(!cuttable)
to_chat(user, "This section of the fence can't be cut.")
return
@@ -156,4 +156,4 @@
#undef NO_HOLE
#undef MEDIUM_HOLE
#undef LARGE_HOLE
-#undef MAX_HOLE_SIZE
\ No newline at end of file
+#undef MAX_HOLE_SIZE
diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm
index 448734d9..eb5ebfa0 100644
--- a/code/game/objects/structures/fireaxe.dm
+++ b/code/game/objects/structures/fireaxe.dm
@@ -23,9 +23,9 @@
return ..()
/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/user, params)
- if(iscyborg(user) || istype(I, /obj/item/multitool))
+ if(iscyborg(user) || I.tool_behavior == TOOL_MULTITOOL)
toggle_lock(user)
- else if(istype(I, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
+ else if(I.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=2))
return
diff --git a/code/game/objects/structures/fluff.dm b/code/game/objects/structures/fluff.dm
index d8cd2f31..aeb07c7e 100644
--- a/code/game/objects/structures/fluff.dm
+++ b/code/game/objects/structures/fluff.dm
@@ -11,7 +11,7 @@
var/deconstructible = TRUE
/obj/structure/fluff/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/wrench) && deconstructible)
+ if(I.tool_behaviour == TOOL_WRENCH && deconstructible)
user.visible_message("[user] starts disassembling [src]...", "You start disassembling [src]...")
I.play_tool_sound(src)
if(I.use_tool(src, user, 50))
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index ce36d334..e8b8e594 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -349,7 +349,7 @@
new /obj/item/stack/sheet/runed_metal(drop_location(), 1)
qdel(src)
- else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
+ else if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount=0))
return
@@ -424,7 +424,7 @@
/obj/structure/girder/bronze/attackby(obj/item/W, mob/living/user, params)
add_fingerprint(user)
- if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
+ if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount = 0))
return
to_chat(user, "You start slicing apart [src]...")
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 0d444430..b0ed88d1 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -136,11 +136,11 @@
/obj/structure/grille/attackby(obj/item/W, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
add_fingerprint(user)
- if(istype(W, /obj/item/wirecutters))
+ if(W.tool_behavior == TOOL_WIRECUTTER)
if(!shock(user, 100))
W.play_tool_sound(src, 100)
deconstruct()
- else if((istype(W, /obj/item/screwdriver)) && (isturf(loc) || anchored))
+ else if((W.tool_behavior == TOOL_SCREWDRIVER) && (isturf(loc) || anchored))
if(!shock(user, 90))
W.play_tool_sound(src, 100)
setAnchored(!anchored)
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index a5ea0e35..9971c57d 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -75,7 +75,7 @@
to_chat(user, "[src] can't hold any more signs!")
else if(mybag)
mybag.attackby(I, user)
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
user.visible_message("[user] begins to empty the contents of [src].", "You begin to empty the contents of [src]...")
if(I.use_tool(src, user, 30))
to_chat(usr, "You empty the contents of [src]'s bucket onto the floor.")
diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm
index a717f7f1..68c84ab1 100644
--- a/code/game/objects/structures/kitchen_spike.dm
+++ b/code/game/objects/structures/kitchen_spike.dm
@@ -22,7 +22,7 @@
var/obj/F = new /obj/structure/kitchenspike(src.loc)
transfer_fingerprints_to(F)
qdel(src)
- else if(istype(I, /obj/item/weldingtool))
+ else if(I.tool_behavior == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "You begin cutting \the [src] apart...")
@@ -240,4 +240,4 @@
untie_mob(L)
return ..()
-#undef VIABLE_MOB_CHECK
\ No newline at end of file
+#undef VIABLE_MOB_CHECK
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index 2f9e646d..7b9af994 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -41,7 +41,7 @@
/obj/structure/lattice/attackby(obj/item/C, mob/user, params)
if(resistance_flags & INDESTRUCTIBLE)
return
- if(istype(C, /obj/item/wirecutters))
+ if(C.tool_behavior == TOOL_WIRECUTTER)
to_chat(user, "Slicing [name] joints ...")
deconstruct()
else
diff --git a/code/game/objects/structures/medkit.dm b/code/game/objects/structures/medkit.dm
index 16137cf2..4f841636 100644
--- a/code/game/objects/structures/medkit.dm
+++ b/code/game/objects/structures/medkit.dm
@@ -47,7 +47,7 @@ obj/structure/medkit_cabinet/contents_explosion(severity, target)
//disassembly code
/obj/structure/medkit_cabinet/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench) && !stored_medkit)
+ if(I.tool_behaviour == TOOL_WRENCH && !stored_medkit)
to_chat(user, "You start unsecuring [name]...")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
diff --git a/code/game/objects/structures/micro_bricks.dm b/code/game/objects/structures/micro_bricks.dm
index c214f84c..3020199a 100644
--- a/code/game/objects/structures/micro_bricks.dm
+++ b/code/game/objects/structures/micro_bricks.dm
@@ -21,7 +21,7 @@
anchored = TRUE
return TRUE
- if(istype(item, /obj/item/crowbar))
+ if(item.tool_behavior == TOOL_CROWBAR)
to_chat(user,"You pry the bricks from the floor.")
anchored = FALSE
return TRUE
diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm
index 515938fb..b67b7c29 100644
--- a/code/game/objects/structures/reflector.dm
+++ b/code/game/objects/structures/reflector.dm
@@ -79,13 +79,13 @@
if(admin)
return
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
can_rotate = !can_rotate
to_chat(user, "You [can_rotate ? "unlock" : "lock"] [src]'s rotation.")
W.play_tool_sound(src)
return
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
if(anchored)
to_chat(user, "Unweld [src] from the floor first!")
return
@@ -96,7 +96,7 @@
if(buildstackamount)
new buildstacktype(drop_location(), buildstackamount)
qdel(src)
- else if(istype(W, /obj/item/weldingtool))
+ else if(W.tool_behavior == TOOL_WELDER)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=0))
return
diff --git a/code/game/objects/structures/showcase.dm b/code/game/objects/structures/showcase.dm
index 823cd104..5da63c17 100644
--- a/code/game/objects/structures/showcase.dm
+++ b/code/game/objects/structures/showcase.dm
@@ -109,7 +109,7 @@
//However if a player wants to move an existing showcase or remove one, this is for that.
/obj/structure/showcase/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/screwdriver) && !anchored)
+ if(W.tool_behavior == TOOL_SCREWDRIVER && !anchored)
if(deconstruction_state == SHOWCASE_SCREWDRIVERED)
to_chat(user, "You screw the screws back into the showcase.")
W.play_tool_sound(src, 100)
@@ -119,7 +119,7 @@
W.play_tool_sound(src, 100)
deconstruction_state = SHOWCASE_SCREWDRIVERED
- if(istype(W, /obj/item/crowbar) && deconstruction_state == SHOWCASE_SCREWDRIVERED)
+ if(W.tool_behavior == TOOL_CROWBAR && deconstruction_state == SHOWCASE_SCREWDRIVERED)
if(W.use_tool(src, user, 20, volume=100))
to_chat(user, "You start to crowbar the showcase apart...")
new /obj/item/stack/sheet/metal(drop_location(), 4)
diff --git a/code/game/objects/structures/signs/_signs.dm b/code/game/objects/structures/signs/_signs.dm
index e519192a..0e0fd4d8 100644
--- a/code/game/objects/structures/signs/_signs.dm
+++ b/code/game/objects/structures/signs/_signs.dm
@@ -25,7 +25,7 @@
playsound(loc, 'sound/items/welder.ogg', 80, 1)
/obj/structure/sign/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench) && buildable_sign)
+ if(I.tool_behaviour == TOOL_WRENCH && buildable_sign)
user.visible_message("[user] starts removing [src]...", \
"You start unfastening [src].")
I.play_tool_sound(src)
@@ -165,4 +165,4 @@
/obj/structure/sign/carts
name = "CARTS"
desc = "You are entering a motorized cart area."
- icon_state = "carts"
\ No newline at end of file
+ icon_state = "carts"
diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm
index 1077e285..a4f1bfdf 100644
--- a/code/game/objects/structures/statues.dm
+++ b/code/game/objects/structures/statues.dm
@@ -16,7 +16,7 @@
if(!(flags_1 & NODECONSTRUCT_1))
if(default_unfasten_wrench(user, W))
return
- if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
+ if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount=0))
return FALSE
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 79444367..cc162ad0 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -148,13 +148,13 @@
/obj/structure/table/attackby(obj/item/I, mob/user, params)
if(!(flags_1 & NODECONSTRUCT_1))
- if(istype(I, /obj/item/screwdriver) && deconstruction_ready)
+ if(I.tool_behavior == TOOL_SCREWDRIVER && deconstruction_ready)
to_chat(user, "You start disassembling [src]...")
if(I.use_tool(src, user, 20, volume=50))
deconstruct(TRUE)
return
- if(istype(I, /obj/item/wrench) && deconstruction_ready)
+ if(I.tool_behaviour == TOOL_WRENCH && deconstruction_ready)
to_chat(user, "You start deconstructing [src]...")
if(I.use_tool(src, user, 40, volume=50))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
@@ -495,7 +495,7 @@
to_chat(user, "The top cover is firmly welded on.")
/obj/structure/table/reinforced/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
@@ -647,7 +647,7 @@
step(O, get_dir(O, src))
/obj/structure/rack/attackby(obj/item/W, mob/user, params)
- if (istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
+ if (W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
deconstruct(TRUE)
return
@@ -706,7 +706,7 @@
var/building = FALSE
/obj/item/rack_parts/attackby(obj/item/W, mob/user, params)
- if (istype(W, /obj/item/wrench))
+ if (W.tool_behavior == TOOL_WRENCH)
new /obj/item/stack/sheet/metal(user.loc)
qdel(src)
else
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 5789c5ab..aef9cbdf 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -50,7 +50,7 @@
oxygentanks++
else
full = TRUE
- else if(istype(I, /obj/item/wrench))
+ else if(I.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, I, time = 20)
return
else if(user.a_intent != INTENT_HARM)
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index 75113338..e185280a 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -97,7 +97,7 @@
/obj/structure/transit_tube/station/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
for(var/obj/structure/transit_tube_pod/P in loc)
P.deconstruct(FALSE, user)
else
diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm
index bd6f9d3a..7eec2f27 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube.dm
@@ -37,7 +37,7 @@
deconstruct(FALSE)
/obj/structure/transit_tube/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
if(tube_construction)
for(var/obj/structure/transit_tube_pod/pod in src.loc)
to_chat(user, "Remove the pod first!")
@@ -50,7 +50,7 @@
transfer_fingerprints_to(R)
R.add_fingerprint(user)
qdel(src)
- else if(istype(W, /obj/item/crowbar))
+ else if(W.tool_behavior == TOOL_CROWBAR)
for(var/obj/structure/transit_tube_pod/pod in src.loc)
pod.attackby(W, user)
else
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index fd292060..286bd5d7 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -27,7 +27,7 @@
icon_state = "pod"
/obj/structure/transit_tube_pod/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
if(!moving)
I.play_tool_sound(src)
if(contents.len)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 76ab1a7e..f0205b25 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -75,7 +75,7 @@
/obj/structure/toilet/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
to_chat(user, "You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]...")
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
if(I.use_tool(src, user, 30))
@@ -596,7 +596,7 @@
to_chat(user, "Someone's already washing here.")
return
- if (istype(O, /obj/item/wrench) && user.a_intent == INTENT_HELP)
+ if (O.tool_behavior == TOOL_WRENCH && user.a_intent == INTENT_HELP)
to_chat(user, "You start deconstructing [src]...")
O.play_tool_sound(src)
@@ -774,4 +774,4 @@
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
- playsound(loc, 'sound/items/welder.ogg', 80, 1)
\ No newline at end of file
+ playsound(loc, 'sound/items/welder.ogg', 80, 1)
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 53459340..a1f58e2a 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -87,7 +87,7 @@
add_fingerprint(user)
switch(state)
if("01")
- if(istype(W, /obj/item/weldingtool) && !anchored)
+ if(W.tool_behavior == TOOL_WELDER && !anchored)
if(!W.tool_start_check(user, amount=0))
return
@@ -105,7 +105,7 @@
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
- if(istype(W, /obj/item/wrench) && !anchored)
+ if(W.tool_behavior == TOOL_WRENCH && !anchored)
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "There is already a windoor in that location!")
@@ -128,7 +128,7 @@
name = "anchored windoor assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
- else if(istype(W, /obj/item/wrench) && anchored)
+ else if(W.tool_behavior == TOOL_WRENCH && anchored)
user.visible_message("[user] unsecures the windoor assembly to the floor.",
"You start to unsecure the windoor assembly to the floor...")
@@ -185,7 +185,7 @@
if("02")
//Removing wire from the assembly. Step 5 undone.
- if(istype(W, /obj/item/wirecutters))
+ if(W.tool_behavior == TOOL_WIRECUTTER)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly...")
if(W.use_tool(src, user, 40, volume=100))
@@ -219,7 +219,7 @@
W.forceMove(drop_location())
//Screwdriver to remove airlock electronics. Step 6 undone.
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
if(!electronics)
return
@@ -246,7 +246,7 @@
//Crowbar to complete the assembly, Step 7 complete.
- else if(istype(W, /obj/item/crowbar))
+ else if(W.tool_behavior == TOOL_CROWBAR)
if(!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 3fcfd996..4836a5bf 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -166,7 +166,7 @@
add_fingerprint(user)
- if(istype(I, /obj/item/weldingtool) && user.a_intent == INTENT_HELP)
+ if(I.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return
@@ -181,7 +181,7 @@
return
if(!(flags_1&NODECONSTRUCT_1))
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 75)
if(reinf)
if(state == WINDOW_SCREWED_TO_FRAME || state == WINDOW_IN_FRAME)
@@ -202,7 +202,7 @@
return
- else if (istype(I, /obj/item/crowbar) && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME))
+ else if (I.tool_behavior == TOOL_CROWBAR && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME))
to_chat(user, "You begin to lever the window [state == WINDOW_OUT_OF_FRAME ? "into":"out of"] the frame...")
I.play_tool_sound(src, 75)
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src,PROC_REF(check_state_and_anchored), state, anchored)))
@@ -210,7 +210,7 @@
to_chat(user, "You pry the window [state == WINDOW_IN_FRAME ? "into":"out of"] the frame.")
return
- else if(istype(I, /obj/item/wrench) && !anchored)
+ else if(I.tool_behaviour == TOOL_WRENCH && !anchored)
I.play_tool_sound(src, 75)
to_chat(user, " You begin to disassemble [src]...")
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src,PROC_REF(check_state_and_anchored), state, anchored)))
diff --git a/code/game/turfs/simulated/wall/reinf_walls.dm b/code/game/turfs/simulated/wall/reinf_walls.dm
index f4f86e79..1e9a1970 100644
--- a/code/game/turfs/simulated/wall/reinf_walls.dm
+++ b/code/game/turfs/simulated/wall/reinf_walls.dm
@@ -63,7 +63,7 @@
//DECONSTRUCTION
switch(d_state)
if(INTACT)
- if(istype(W, /obj/item/wirecutters))
+ if(W.tool_behavior == TOOL_WIRECUTTER)
W.play_tool_sound(src, 100)
d_state = SUPPORT_LINES
update_icon()
@@ -71,7 +71,7 @@
return 1
if(SUPPORT_LINES)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You begin unsecuring the support lines...")
if(W.use_tool(src, user, 40, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_LINES)
@@ -81,7 +81,7 @@
to_chat(user, "You unsecure the support lines.")
return 1
- else if(istype(W, /obj/item/wirecutters))
+ else if(W.tool_behavior == TOOL_WIRECUTTER)
W.play_tool_sound(src, 100)
d_state = INTACT
update_icon()
@@ -89,7 +89,7 @@
return 1
if(COVER)
- if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
+ if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "You begin slicing through the metal cover...")
@@ -101,7 +101,7 @@
to_chat(user, "You press firmly on the cover, dislodging it.")
return 1
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You begin securing the support lines...")
if(W.use_tool(src, user, 40, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER)
@@ -112,7 +112,7 @@
return 1
if(CUT_COVER)
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
to_chat(user, "You struggle to pry off the cover...")
if(W.use_tool(src, user, 100, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != CUT_COVER)
@@ -122,7 +122,7 @@
to_chat(user, "You pry off the cover.")
return 1
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "You begin welding the metal cover back to the frame...")
@@ -135,7 +135,7 @@
return 1
if(ANCHOR_BOLTS)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame...")
if(W.use_tool(src, user, 40, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS)
@@ -145,7 +145,7 @@
to_chat(user, "You remove the bolts anchoring the support rods.")
return 1
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
to_chat(user, "You start to pry the cover back into place...")
if(W.use_tool(src, user, 20, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS)
@@ -156,7 +156,7 @@
return 1
if(SUPPORT_RODS)
- if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
+ if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "You begin slicing through the support rods...")
@@ -168,7 +168,7 @@
to_chat(user, "You slice through the support rods.")
return 1
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start tightening the bolts which secure the support rods to their frame...")
W.play_tool_sound(src, 100)
if(W.use_tool(src, user, 40))
@@ -180,7 +180,7 @@
return 1
if(SHEATH)
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
to_chat(user, "You struggle to pry off the outer sheath...")
if(W.use_tool(src, user, 100, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SHEATH)
@@ -189,7 +189,7 @@
dismantle_wall()
return 1
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "You begin welding the support rods back together...")
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 53830fc2..80aa06c8 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -221,7 +221,7 @@
if((user.a_intent != INTENT_HELP) || !LAZYLEN(dent_decals))
return FALSE
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return FALSE
@@ -255,7 +255,7 @@
return FALSE
/turf/closed/wall/proc/try_decon(obj/item/I, mob/user, turf/T)
- if(istype(I, /obj/item/weldingtool) || istype(I, /obj/item/gun/energy/plasmacutter))
+ if(I.tool_behavior == TOOL_WELDER || istype(I, /obj/item/gun/energy/plasmacutter))
if(!I.tool_start_check(user, amount=0))
return FALSE
diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
index ca336db4..7d7d6031 100644
--- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm
+++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
@@ -636,7 +636,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/abductor/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
return // Stops humans from disassembling abductor headsets.
return ..()
@@ -703,7 +703,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
framestackamount = 1
/obj/structure/table_frame/abductor/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You start disassembling [src]...")
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
diff --git a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm
index e5007fbf..9e8de1fe 100644
--- a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm
+++ b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm
@@ -49,7 +49,7 @@
// This exists so Hardened/Silver Stake can't have a welding torch used on them.
/obj/item/stake/basic/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
//if (amWelded)
// to_chat(user, "This stake has already been treated with fire.")
// return
@@ -146,7 +146,7 @@
// Convert back to Silver
/obj/item/stake/hardened/silver/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
var/obj/item/weldingtool/WT = I
if(WT.use(0))//remove_fuel(0, user))
var/obj/item/stack/sheet/mineral/silver/newsheet = new (user.loc)
diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm
index 1170f705..dfd34739 100644
--- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm
+++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm
@@ -169,11 +169,11 @@
if(istype(W, cutting_tool))
to_chat(user, "This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src].")
return
- else if(anchored && istype(W, /obj/item/wrench)) // Can't unanchor unless owner.
+ else if(anchored && W.tool_behavior == TOOL_WRENCH) // Can't unanchor unless owner.
to_chat(user, "The coffin won't come unanchored from the floor.")
return
- if(locked && istype(W, /obj/item/crowbar))
+ if(locked && W.tool_behavior == TOOL_CROWBAR)
var/pry_time = pryLidTimer * W.toolspeed // Pry speed must be affected by the speed of the tool.
user.visible_message("[user] tries to pry the lid off of [src] with [W].", \
"You begin prying the lid off of [src] with [W]. This should take about [DisplayTimeText(pry_time)].")
diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm
index f9db3660..10063673 100644
--- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm
+++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm
@@ -353,7 +353,7 @@
torture_time -= 1
else if(I.sharpness == IS_SHARP_ACCURATE)
torture_time -= 2
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
var/obj/item/weldingtool/welder = I
welder.welding = TRUE
torture_time -= 5
diff --git a/code/modules/antagonists/clockcult/clock_structure.dm b/code/modules/antagonists/clockcult/clock_structure.dm
index 13da9c5a..a9bd9cf7 100644
--- a/code/modules/antagonists/clockcult/clock_structure.dm
+++ b/code/modules/antagonists/clockcult/clock_structure.dm
@@ -95,7 +95,7 @@
return ..()
/obj/structure/destructible/clockwork/attackby(obj/item/I, mob/user, params)
- if(is_servant_of_ratvar(user) && istype(I, /obj/item/wrench) && unanchored_icon)
+ if(is_servant_of_ratvar(user) && I.tool_behaviour == TOOL_WRENCH && unanchored_icon)
if(default_unfasten_wrench(user, I, 50) == SUCCESSFUL_UNFASTEN)
update_anchored(user)
return 1
diff --git a/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm b/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm
index fb8397ee..3f08b910 100644
--- a/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm
+++ b/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm
@@ -24,10 +24,10 @@
return
/obj/structure/destructible/clockwork/wall_gear/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, I, 10)
return 1
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
if(anchored)
to_chat(user, "[src] needs to be unsecured to disassemble it!")
else
diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
index 63a78269..fa963c78 100644
--- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
+++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
@@ -114,7 +114,7 @@
return
if(NUKESTATE_PANEL_REMOVED)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
if(!I.tool_start_check(user, amount=1))
return
to_chat(user, "You start cutting [src]'s inner plate...")
diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm
index 8ca6d16e..91920ea4 100644
--- a/code/modules/antagonists/swarmer/swarmer.dm
+++ b/code/modules/antagonists/swarmer/swarmer.dm
@@ -43,7 +43,7 @@
to_chat(user, "Picking up the swarmer may cause it to activate. You should be careful about this.")
/obj/effect/mob_spawn/swarmer/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver) && user.a_intent != INTENT_HARM)
+ if(W.tool_behavior == TOOL_SCREWDRIVER && user.a_intent != INTENT_HARM)
user.visible_message("[usr.name] deactivates [src].",
"After some fiddling, you find a way to disable [src]'s power source.",
"You hear clicking.")
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index 253530bd..c7a9548f 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -744,14 +744,14 @@
/obj/machinery/airalarm/attackby(obj/item/W, mob/user, params)
switch(buildstage)
if(2)
- if(istype(W, /obj/item/wirecutters) && panel_open && wires.is_all_cut())
+ if(W.tool_behavior == TOOL_WIRECUTTER && panel_open && wires.is_all_cut())
W.play_tool_sound(src)
to_chat(user, "You cut the final wires.")
new /obj/item/stack/cable_coil(loc, 5)
buildstage = 1
update_icon()
return
- else if(istype(W, /obj/item/screwdriver)) // Opening that Air Alarm up.
+ else if(W.tool_behavior == TOOL_SCREWDRIVER) // Opening that Air Alarm up.
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "The wires have been [panel_open ? "exposed" : "unexposed"].")
@@ -763,7 +763,7 @@
wires.interact(user)
return
if(1)
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
user.visible_message("[user.name] removes the electronics from [src.name].",\
"You start prying out the circuit...")
W.play_tool_sound(src)
@@ -815,7 +815,7 @@
update_icon()
return
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
to_chat(user, "You detach \the [src] from the wall.")
W.play_tool_sound(src)
new /obj/item/wallframe/airalarm( user.loc )
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index b26774e2..04998b58 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -301,7 +301,7 @@
|| default_deconstruction_crowbar(I))
update_icon()
return
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You can't access the maintenance panel while the pod is " \
+ (on ? "active" : (occupant ? "full" : "open")) + ".")
return
diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
index b47b6b42..a1fa443c 100644
--- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
+++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
@@ -116,7 +116,7 @@
to_chat(user, "[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].")
replace_tank(user, FALSE, T)
update_icon()
- else if(istype(W, /obj/item/wrench))
+ else if(W.tool_behavior == TOOL_WRENCH)
if(!(stat & BROKEN))
if(connected_port)
disconnect()
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index e693abc8..24a644ff 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -159,7 +159,7 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
return
/obj/machinery/gateway/centeraway/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
if(calibrated)
to_chat(user, "\black The gate is already calibrated, there is no work for you to do here.")
return
diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm
index 653a72ac..2244a004 100644
--- a/code/modules/clothing/gloves/color.dm
+++ b/code/modules/clothing/gloves/color.dm
@@ -63,7 +63,7 @@
name = "fingerless insulated gloves"
/obj/item/clothing/gloves/color/yellow/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters))
+ if(I.tool_behavior == TOOL_WIRECUTTER)
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
to_chat(user, "You snip the fingertips off of [src].")
I.play_tool_sound(src)
@@ -72,7 +72,7 @@
..()
/obj/item/clothing/gloves/color/fyellow/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters))
+ if(I.tool_behavior == TOOL_WIRECUTTER)
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
to_chat(user, "You snip the fingertips off of [src].")
I.play_tool_sound(src)
@@ -100,7 +100,7 @@
item_color = "chief" //Exists for washing machines. Is not different from black gloves in any way.
/obj/item/clothing/gloves/color/black/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters))
+ if(I.tool_behavior == TOOL_WIRECUTTER)
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
to_chat(user, "You snip the fingertips off of [src].")
I.play_tool_sound(src)
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index e7958d39..007bb7a6 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -288,7 +288,7 @@
A.Grant(user)
return
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(F)
for(var/obj/item/flashlight/seclite/S in src)
to_chat(user, "You unscrew the seclite from [src].")
diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm
index 3e5d3b01..5c9de282 100644
--- a/code/modules/clothing/spacesuits/flightsuit.dm
+++ b/code/modules/clothing/spacesuits/flightsuit.dm
@@ -1006,7 +1006,7 @@
else if(locked)
usermessage("You can not perform any service while the suit is locked!", "boldwarning")
return FALSE
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
if(!maint_panel)
maint_panel = TRUE
else
@@ -1016,7 +1016,7 @@
else if(!maint_panel)
usermessage("The maintenance panel is closed!", "boldwarning")
return FALSE
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
var/list/inputlist = list()
if(pack)
inputlist += "Pack"
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index a7e4e61c..5c4dadff 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -126,7 +126,7 @@
jetpack = I
to_chat(user, "You successfully install the jetpack into [src].")
return
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
if(!jetpack)
to_chat(user, "[src] has no jetpack installed.")
return
diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm
index 52cb8dad..77c009ac 100644
--- a/code/modules/hydroponics/beekeeping/beebox.dm
+++ b/code/modules/hydroponics/beekeeping/beebox.dm
@@ -157,7 +157,7 @@
to_chat(user, "There's no room for any more frames in the apiary!")
return
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
if(default_unfasten_wrench(user, I, time = 20))
return
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index 0370a94b..eed0b539 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -615,7 +615,7 @@
else if(default_unfasten_wrench(user, O))
return
- else if(istype(O, /obj/item/wirecutters) && unwrenchable)
+ else if(O.tool_behavior == TOOL_WIRECUTTER && unwrenchable)
if (!anchored)
to_chat(user, "Anchor the tray first!")
return
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index 6946e2a9..6ee13dba 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -452,7 +452,7 @@
for(var/obj/item/integrated_circuit/input/S in assembly_components)
S.attackby_react(I,user,user.a_intent)
return ..()
- else if(istype(I, /obj/item/multitool) || istype(I, /obj/item/integrated_electronics/wirer) || istype(I, /obj/item/integrated_electronics/debugger))
+ else if(I.tool_behavior == TOOL_MULTITOOL || istype(I, /obj/item/integrated_electronics/wirer) || istype(I, /obj/item/integrated_electronics/debugger))
if(opened)
interact(user)
return TRUE
diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm
index cec3e234..ac40a6b8 100644
--- a/code/modules/integrated_electronics/core/integrated_circuit.dm
+++ b/code/modules/integrated_electronics/core/integrated_circuit.dm
@@ -265,7 +265,7 @@ a creative player the means to solve many problems. Circuits are held inside an
if(href_list["link"])
linked = locate(href_list["link"]) in pin.linked
- if(istype(held_item, /obj/item/integrated_electronics) || istype(held_item, /obj/item/multitool))
+ if(held_item, /obj/item/integrated_electronics) || istype(held_item.tool_behavior == TOOL_MULTITOOL)
pin.handle_wire(linked, held_item, href_list["act"], usr)
else
to_chat(usr, "You can't do a whole lot without the proper tools.")
diff --git a/code/modules/integrated_electronics/core/pins.dm b/code/modules/integrated_electronics/core/pins.dm
index c1bbb900..0301b0ff 100644
--- a/code/modules/integrated_electronics/core/pins.dm
+++ b/code/modules/integrated_electronics/core/pins.dm
@@ -105,7 +105,7 @@ D [1]/ ||
push_data()
/datum/integrated_io/proc/handle_wire(datum/integrated_io/linked_pin, obj/item/tool, action, mob/living/user)
- if(istype(tool, /obj/item/multitool))
+ if(tool.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/multitool = tool
switch(action)
if("wire")
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 69787ee0..3f096868 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -53,12 +53,12 @@
/obj/structure/bookcase/attackby(obj/item/I, mob/user, params)
switch(state)
if(0)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "You wrench the frame into place.")
anchored = TRUE
state = 1
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "You pry the frame apart.")
deconstruct(TRUE)
@@ -71,7 +71,7 @@
to_chat(user, "You add a shelf.")
state = 2
icon_state = "book-0"
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 100)
to_chat(user, "You unwrench the frame.")
anchored = FALSE
@@ -100,7 +100,7 @@
return
else
name = "bookcase ([sanitize(newname)])"
- else if(istype(I, /obj/item/crowbar))
+ else if(I.tool_behavior == TOOL_CROWBAR)
if(contents.len)
to_chat(user, "You need to remove the books first!")
else
@@ -292,7 +292,7 @@
scanner.computer.inventory.Add(src)
to_chat(user, "[I]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
- else if(istype(I, /obj/item/multitool))
+ else if(I.tool_behavior == TOOL_MULTITOOL)
to_chat(user, "You begin to erase the data from [title] with your PDA!...")
if(do_after(user, 30, target = src))
to_chat(user, "You erase all the page data from [title] with your PDA! You didn't want to read it anyway.")
diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm
index c89c547e..60c1b475 100644
--- a/code/modules/mining/abandoned_crates.dm
+++ b/code/modules/mining/abandoned_crates.dm
@@ -191,7 +191,7 @@
/obj/structure/closet/crate/secure/loot/attackby(obj/item/W, mob/user)
if(locked)
- if(istype(W, /obj/item/multitool))
+ if(W.tool_behavior == TOOL_MULTITOOL)
to_chat(user, "DECA-CODE LOCK REPORT:")
if(attempts == 1)
to_chat(user, "* Anti-Tamper Bomb will activate on next failed access attempt.")
diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm
index 78693a8c..aabfeabc 100644
--- a/code/modules/mining/equipment/kinetic_crusher.dm
+++ b/code/modules/mining/equipment/kinetic_crusher.dm
@@ -48,7 +48,7 @@
. += "It has \a [T] attached, which causes [T.effect_desc()]."
/obj/item/twohanded/kinetic_crusher/attackby(obj/item/I, mob/living/user)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
if(LAZYLEN(trophies))
to_chat(user, "You remove [src]'s trophies.")
I.play_tool_sound(src)
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 31e977c6..7861c01d 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -38,7 +38,7 @@
user << browse(dat, "window=console_stacking_machine")
/obj/machinery/mineral/stacking_unit_console/multitool_act(mob/living/user, obj/item/I)
- if(istype(I, /obj/item/multitool))
+ if(I.tool_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "You store linkage information in [I]'s buffer.")
diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm
index 660e5ec2..18817456 100644
--- a/code/modules/mining/minebot.dm
+++ b/code/modules/mining/minebot.dm
@@ -105,7 +105,7 @@
to_chat(user, "You instruct [src] to drop any collected ore.")
DropOre()
return
- if(istype(I, /obj/item/crowbar) || istype(I, /obj/item/borg/upgrade/modkit))
+ if(I.tool_behavior == TOOL_CROWBAR || istype(I, /obj/item/borg/upgrade/modkit))
I.melee_attack_chain(user, stored_gun, params)
return
..()
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index a9379768..4a5b9f46 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -241,7 +241,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
GibtoniteReaction(user)
return
if(primed)
- if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || istype(I, /obj/item/multitool))
+ if(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || istype(I.tool_behavior == TOOL_MULTITOOL)
primed = FALSE
if(det_timer)
deltimer(det_timer)
diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm
index ccf9011a..f0ae2957 100644
--- a/code/modules/mob/dead/dead.dm
+++ b/code/modules/mob/dead/dead.dm
@@ -30,9 +30,6 @@ INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead/gib() //ghosts can't be gibbed.
return
-/mob/dead/ConveyorMove() //lol
- return
-
/mob/dead/forceMove(atom/destination)
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(destination)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 517ffb0a..ddb5d69d 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -1053,11 +1053,6 @@
"[C] leaps out of [src]'s way!")]")
C.Knockdown(40)
-/mob/living/ConveyorMove()
- if((movement_type & FLYING) && !stat)
- return
- ..()
-
/mob/living/can_be_pulled()
return ..() && !(buckled && buckled.buckle_prevents_pull)
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 2d63b03d..ddd01204 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -390,7 +390,7 @@
return ISINRANGE(T1.x, T0.x - interaction_range, T0.x + interaction_range) && ISINRANGE(T1.y, T0.y - interaction_range, T0.y + interaction_range)
/mob/living/silicon/robot/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/weldingtool) && (user.a_intent != INTENT_HARM || user == src))
+ if(W.tool_behavior == TOOL_WELDER && (user.a_intent != INTENT_HARM || user == src))
user.changeNext_move(CLICK_CD_MELEE)
if (!getBruteLoss())
to_chat(user, "[src] is already in good condition!")
@@ -435,7 +435,7 @@
else
to_chat(user, "The wires seem fine, there's no need to fix them.")
- else if(istype(W, /obj/item/crowbar)) // crowbar means open or close the cover
+ else if(W.tool_behavior == TOOL_CROWBAR) // crowbar means open or close the cover
if(opened)
to_chat(user, "You close the cover.")
opened = 0
@@ -467,12 +467,12 @@
else
to_chat(user, "You can't reach the wiring!")
- else if(istype(W, /obj/item/screwdriver) && opened && !cell) // haxing
+ else if(W.tool_behavior == TOOL_SCREWDRIVER && opened && !cell) // haxing
wiresexposed = !wiresexposed
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
update_icons()
- else if(istype(W, /obj/item/screwdriver) && opened && cell) // radio
+ else if(W.tool_behavior == TOOL_SCREWDRIVER && opened && cell) // radio
if(shell)
to_chat(user, "You cannot seem to open the radio compartment") //Prevent AI radio key theft
else if(radio)
@@ -481,7 +481,7 @@
to_chat(user, "Unable to locate a radio!")
update_icons()
- else if(istype(W, /obj/item/wrench) && opened && !cell) //Deconstruction. The flashes break from the fall, to prevent this from being a ghetto reset module.
+ else if(W.tool_behavior == TOOL_WRENCH && opened && !cell) //Deconstruction. The flashes break from the fall, to prevent this from being a ghetto reset module.
if(!lockcharge)
to_chat(user, "[src]'s bolts spark! Maybe you should lock them down first!")
spark_system.start()
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index edcce7d6..eaa599b9 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -284,7 +284,7 @@
show_controls(user)
/mob/living/simple_animal/bot/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(!locked)
open = !open
to_chat(user, "The maintenance panel is now [open ? "opened" : "closed"].")
@@ -314,7 +314,7 @@
ejectpai(user)
else
user.changeNext_move(CLICK_CD_MELEE)
- if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ if(W.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(health >= maxHealth)
to_chat(user, "[src] does not need a repair!")
return
diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm
index 6a1cea8e..0104e6d3 100644
--- a/code/modules/mob/living/simple_animal/bot/construction.dm
+++ b/code/modules/mob/living/simple_animal/bot/construction.dm
@@ -100,7 +100,7 @@
build_step++
if(ASSEMBLY_FOURTH_STEP)
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(W.use_tool(src, user, 0, volume=40))
name = "shielded frame assembly"
to_chat(user, "You weld the vest to [src].")
@@ -181,7 +181,7 @@
build_step++
if(8)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You start attaching the gun to the frame...")
if(W.use_tool(src, user, 40, volume=100))
name = "armed [name]"
@@ -408,13 +408,13 @@
var/atom/Tsec = drop_location()
switch(build_step)
if(ASSEMBLY_FIRST_STEP)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
if(I.use_tool(src, user, 0, volume=40))
add_overlay("hs_hole")
to_chat(user, "You weld a hole in [src]!")
build_step++
- else if(istype(I, /obj/item/screwdriver)) //deconstruct
+ else if(I.tool_behavior == TOOL_SCREWDRIVER) //deconstruct
new /obj/item/assembly/signaler(Tsec)
new /obj/item/clothing/head/helmet/sec(Tsec)
to_chat(user, "You disconnect the signaler from the helmet.")
@@ -430,7 +430,7 @@
qdel(I)
build_step++
- else if(istype(I, /obj/item/weldingtool)) //deconstruct
+ else if(I.tool_behavior == TOOL_WELDER) //deconstruct
if(I.use_tool(src, user, 0, volume=40))
cut_overlay("hs_hole")
to_chat(user, "You weld the hole in [src] shut!")
@@ -447,7 +447,7 @@
qdel(I)
build_step++
- else if(istype(I, /obj/item/screwdriver)) //deconstruct
+ else if(I.tool_behavior == TOOL_SCREWDRIVER) //deconstruct
cut_overlay("hs_eye")
new /obj/item/assembly/prox_sensor(Tsec)
to_chat(user, "You detach the proximity sensor from [src].")
@@ -464,7 +464,7 @@
S.robot_arm = robot_arm
qdel(I)
qdel(src)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You adjust [src]'s arm slots to mount extra weapons")
build_step ++
return
@@ -488,7 +488,7 @@
qdel(I)
qdel(src)
- else if(istype(I, /obj/item/screwdriver)) //deconstruct
+ else if(I.tool_behavior == TOOL_SCREWDRIVER) //deconstruct
cut_overlay("hs_arm")
var/obj/item/bodypart/dropped_arm = new robot_arm(Tsec)
robot_arm = null
@@ -520,7 +520,7 @@
S.robot_arm = robot_arm
qdel(I)
qdel(src)
- else if(istype(I, /obj/item/screwdriver)) //deconstruct
+ else if(I.tool_behavior == TOOL_SCREWDRIVER) //deconstruct
build_step--
icon_state = initial(icon_state)
to_chat(user, "You unbolt [src]'s energy swords")
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index 50475f7e..a311e9ca 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -186,9 +186,9 @@ Auto Patrol[]"},
/mob/living/simple_animal/bot/ed209/attackby(obj/item/W, mob/user, params)
..()
- if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
+ if(W.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
- if(!istype(W, /obj/item/screwdriver) && (!target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
+ if(!W.tool_behavior == TOOL_SCREWDRIVER && (!target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
if(W.force && W.damtype != STAMINA)//If force is non-zero and damage type isn't stamina.
retaliate(user)
if(lasercolor)//To make up for the fact that lasertag bots don't hunt
diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm
index b6ef13d5..0b5ee24d 100644
--- a/code/modules/mob/living/simple_animal/bot/honkbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm
@@ -119,9 +119,9 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
/mob/living/simple_animal/bot/honkbot/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ if(W.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM)
return
- if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Check for welding tool to fix #2432.
+ if(!W.tool_behavior == TOOL_SCREWDRIVER && (W.force) && (!target) && (W.damtype != STAMINA) ) // Check for welding tool to fix #2432.
retaliate(user)
addtimer(CALLBACK(src,PROC_REF(react_buzz)), 5)
..()
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index ac73065c..0a28af14 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -185,9 +185,9 @@ Auto Patrol: []"},
/mob/living/simple_animal/bot/secbot/attackby(obj/item/W, mob/user, params)
..()
- if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
+ if(W.tool_behavior == TOOL_WELDER && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
- if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
+ if(!W.tool_behavior == TOOL_SCREWDRIVER && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
retaliate(user)
if(special_retaliate_after_attack(user))
return
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
index c108e727..725a2c7b 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
@@ -168,7 +168,7 @@
..()
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/screwdriver) && stat == DEAD)
+ if(I.tool_behavior == TOOL_SCREWDRIVER && stat == DEAD)
try_reactivate(user)
else
..()
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm
index 0f97a4c4..e1bbd77c 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm
@@ -55,7 +55,7 @@
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/screwdriver) && stat != DEAD)
+ if(I.tool_behavior == TOOL_SCREWDRIVER && stat != DEAD)
if(health < maxHealth)
to_chat(user, "You start to tighten loose screws on [src]...")
if(I.use_tool(src, user, 80))
@@ -66,7 +66,7 @@
else
to_chat(user, "[src]'s screws can't get any tighter!")
return //This used to not exist and drones who repaired themselves also stabbed the shit out of themselves.
- else if(istype(I, /obj/item/wrench) && user != src) //They aren't required to be hacked, because laws can change in other ways (i.e. admins)
+ else if(I.tool_behaviour == TOOL_WRENCH && user != src) //They aren't required to be hacked, because laws can change in other ways (i.e. admins)
user.visible_message("[user] starts resetting [src]...", \
"You press down on [src]'s factory reset control...")
if(I.use_tool(src, user, 50, volume=50))
diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm
index cdb299b2..72223229 100644
--- a/code/modules/mob/living/simple_animal/friendly/mouse.dm
+++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm
@@ -199,7 +199,7 @@
/mob/living/simple_animal/mouse/boommouse/attackby(obj/item/I, mob/living/user, params)
var/turf/T = get_turf(src)
message_admins("[ADMIN_LOOKUPFLW(user)] is attacking a boommouse at [ADMIN_VERBOSEJMP(T)].")
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
var/obj/item/weldingtool/W = I
if(W.welding)
user.visible_message("[user] burns the boommouse with [user.p_their()] [W.name]!", "That was stupid of you.")
diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm
index 466290a5..8ff259c7 100644
--- a/code/modules/modular_computers/computers/item/computer.dm
+++ b/code/modules/modular_computers/computers/item/computer.dm
@@ -400,7 +400,7 @@
if(install_component(W, user))
return
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
if(all_components.len)
to_chat(user, "Remove all components from \the [src] before disassembling it.")
return
@@ -410,7 +410,7 @@
qdel(src)
return
- if(istype(W, /obj/item/weldingtool))
+ if(W.tool_behavior == TOOL_WELDER)
if(obj_integrity == max_integrity)
to_chat(user, "\The [src] does not require repairs.")
return
@@ -424,7 +424,7 @@
to_chat(user, "You repair \the [src].")
return
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
if(!all_components.len)
to_chat(user, "This device doesn't have any components installed.")
return
diff --git a/code/modules/modular_computers/hardware/_hardware.dm b/code/modules/modular_computers/hardware/_hardware.dm
index 744db157..9dde3d46 100644
--- a/code/modules/modular_computers/hardware/_hardware.dm
+++ b/code/modules/modular_computers/hardware/_hardware.dm
@@ -33,7 +33,7 @@
/obj/item/computer_hardware/attackby(obj/item/I, mob/living/user)
// Multitool. Runs diagnostics
- if(istype(I, /obj/item/multitool))
+ if(I.tool_behavior == TOOL_MULTITOOL)
to_chat(user, "***** DIAGNOSTICS REPORT *****")
diagnostics(user)
to_chat(user, "******************************")
diff --git a/code/modules/modular_computers/hardware/ai_slot.dm b/code/modules/modular_computers/hardware/ai_slot.dm
index 47cbbff4..a580f445 100644
--- a/code/modules/modular_computers/hardware/ai_slot.dm
+++ b/code/modules/modular_computers/hardware/ai_slot.dm
@@ -62,7 +62,7 @@
/obj/item/computer_hardware/ai_slot/attackby(obj/item/I, mob/living/user)
if(..())
return
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You press down on the manual eject button with \the [I].")
try_eject(,user,1)
- return
\ No newline at end of file
+ return
diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm
index c68e1ad1..6d4f30ce 100644
--- a/code/modules/modular_computers/hardware/card_slot.dm
+++ b/code/modules/modular_computers/hardware/card_slot.dm
@@ -111,7 +111,7 @@
/obj/item/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user)
if(..())
return
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You press down on the manual eject button with \the [I].")
try_eject(0,user)
return
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index aa1fd7db..b7e551a5 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -54,7 +54,7 @@
sleep(5)
icon_state = initial(icon_state)
updateUsrDialog()
- else if(istype(P, /obj/item/wrench))
+ else if(P.tool_behavior == TOOL_WRENCH)
to_chat(user, "You begin to [anchored ? "unwrench" : "wrench"] [src].")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "You successfully [anchored ? "unwrench" : "wrench"] [src].")
diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm
index ccc94273..80de7b2c 100644
--- a/code/modules/paperwork/paper_cutter.dm
+++ b/code/modules/paperwork/paper_cutter.dm
@@ -59,7 +59,7 @@
storedcutter = P
update_icon()
return
- if(istype(P, /obj/item/screwdriver) && storedcutter)
+ if(P.tool_behavior == TOOL_SCREWDRIVER && storedcutter)
P.play_tool_sound(src)
to_chat(user, "[storedcutter] has been [cuttersecured ? "unsecured" : "secured"].")
cuttersecured = !cuttersecured
diff --git a/code/modules/photography/photos/frame.dm b/code/modules/photography/photos/frame.dm
index 95bf96f9..68cff140 100644
--- a/code/modules/photography/photos/frame.dm
+++ b/code/modules/photography/photos/frame.dm
@@ -115,14 +115,14 @@
return ..()
/obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user, params)
- if(can_decon && (istype(I, /obj/item/screwdriver) || istype(I, /obj/item/wrench)))
+ if(can_decon && (I.tool_behavior == TOOL_SCREWDRIVER || I.tool_behaviour == TOOL_WRENCH))
to_chat(user, "You start unsecuring [name]...")
if(I.use_tool(src, user, 30, volume=50))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "You unsecure [name].")
deconstruct()
- else if(istype(I, /obj/item/wirecutters) && framed)
+ else if(I.tool_behavior == TOOL_WIRECUTTER && framed)
framed.forceMove(drop_location())
framed = null
user.visible_message("[user] cuts away [framed] from [src]!")
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index 752cbea2..8f676677 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -159,7 +159,7 @@
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
if(!anchored)
W.play_tool_sound(src, 75)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm
index 7ec3cc19..ff467ff8 100644
--- a/code/modules/power/antimatter/shielding.dm
+++ b/code/modules/power/antimatter/shielding.dm
@@ -246,7 +246,7 @@
materials = list(MAT_METAL=100)
/obj/item/am_shielding_container/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/multitool) && istype(src.loc, /turf))
+ if(I.tool_behavior == TOOL_MULTITOOL && istype(src.loc, /turf))
new/obj/machinery/am_shielding(src.loc)
qdel(src)
else
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index ff693e1d..d870ec91 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -139,7 +139,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/turf/T = get_turf(src)
if(T.intact)
return
- if(istype(W, /obj/item/wirecutters))
+ if(W.tool_behavior == TOOL_WIRECUTTER)
if (shock(user, 50))
return
user.visible_message("[user] cuts the cable.", "You cut the cable.")
@@ -161,7 +161,7 @@ By design, d1 is the smallest direction and d2 is the highest
R.loaded.cable_join(src, user)
R.is_empty(user)
- else if(istype(W, /obj/item/multitool))
+ else if(W.tool_behavior == TOOL_MULTITOOL)
if(powernet && (powernet.avail > 0)) // is it powered?
to_chat(user, "[DisplayPower(powernet.avail)] in power network.")
else
@@ -852,4 +852,4 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
/obj/item/stack/cable_coil/cut/random
item_color = null
- color = "#ffffff"
\ No newline at end of file
+ color = "#ffffff"
diff --git a/code/modules/power/floodlight.dm b/code/modules/power/floodlight.dm
index 8da3594d..460804e9 100644
--- a/code/modules/power/floodlight.dm
+++ b/code/modules/power/floodlight.dm
@@ -9,7 +9,7 @@
var/state = FLOODLIGHT_NEEDS_WRENCHING
/obj/structure/floodlight_frame/attackby(obj/item/O, mob/user, params)
- if(istype(O, /obj/item/wrench) && (state == FLOODLIGHT_NEEDS_WRENCHING))
+ if(O.tool_behavior == TOOL_WRENCH && (state == FLOODLIGHT_NEEDS_WRENCHING))
to_chat(user, "You secure [src].")
anchored = TRUE
state = FLOODLIGHT_NEEDS_WIRES
@@ -27,7 +27,7 @@
to_chat(user, "You put lights in [src].")
new /obj/machinery/power/floodlight(src.loc)
qdel(src)
- else if(istype(O, /obj/item/screwdriver) && (state == FLOODLIGHT_NEEDS_SECURING))
+ else if(O.tool_behavior == TOOL_SCREWDRIVER && (state == FLOODLIGHT_NEEDS_SECURING))
to_chat(user, "You fasten the wiring and electronics in [src].")
name = "secured [name]"
desc = "A bare metal frame that looks like a floodlight. Requires light tubes."
@@ -83,7 +83,7 @@
to_chat(user, "You set [src] to [setting_text].")
/obj/machinery/power/floodlight/attackby(obj/item/O, mob/user, params)
- if(istype(O, /obj/item/wrench))
+ if(O.tool_behavior == TOOL_WRENCH)
default_unfasten_wrench(user, O, time = 20)
change_setting(1)
if(anchored)
@@ -114,4 +114,4 @@
qdel(src)
/obj/machinery/power/floodlight/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
- playsound(src, 'sound/effects/glasshit.ogg', 75, 1)
\ No newline at end of file
+ playsound(src, 'sound/effects/glasshit.ogg', 75, 1)
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index d0d1e2b4..4207de41 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -187,14 +187,14 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
/obj/machinery/gravity_generator/main/attackby(obj/item/I, mob/user, params)
switch(broken_state)
if(GRAV_NEEDS_SCREWDRIVER)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
to_chat(user, "You secure the screws of the framework.")
I.play_tool_sound(src)
broken_state++
update_icon()
return
if(GRAV_NEEDS_WELDING)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
if(I.use_tool(src, user, 0, volume=50, amount=1))
to_chat(user, "You mend the damaged framework.")
broken_state++
@@ -213,7 +213,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
to_chat(user, "You need 10 sheets of plasteel!")
return
if(GRAV_NEEDS_WRENCH)
- if(istype(I, /obj/item/wrench))
+ if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You secure the plating to the framework.")
I.play_tool_sound(src)
set_fix()
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index a8fa8a14..bb60aa02 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -107,7 +107,7 @@
return
switch(stage)
if(1)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
to_chat(usr, "You begin deconstructing [src]...")
if (W.use_tool(src, user, 30, volume=50))
new /obj/item/stack/sheet/metal(drop_location(), sheets_refunded)
@@ -128,11 +128,11 @@
to_chat(user, "You need one length of cable to wire [src]!")
return
if(2)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
to_chat(usr, "You have to remove the wires first!")
return
- if(istype(W, /obj/item/wirecutters))
+ if(W.tool_behavior == TOOL_WIRECUTTER)
stage = 1
icon_state = "[fixture_type]-construct-stage1"
new /obj/item/stack/cable_coil(drop_location(), 1, "red")
@@ -141,7 +141,7 @@
W.play_tool_sound(src, 100)
return
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
user.visible_message("[user.name] closes [src]'s casing.", \
"You close [src]'s casing.", "You hear screwing.")
W.play_tool_sound(src, 75)
@@ -450,7 +450,7 @@
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
- if(istype(W, /obj/item/screwdriver)) //If it's a screwdriver open it.
+ if(W.tool_behavior == TOOL_SCREWDRIVER) //If it's a screwdriver open it.
W.play_tool_sound(src, 75)
user.visible_message("[user.name] opens [src]'s casing.", \
"You open [src]'s casing.", "You hear a noise.")
diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm
index d11acd02..2e97edea 100644
--- a/code/modules/power/port_gen.dm
+++ b/code/modules/power/port_gen.dm
@@ -168,7 +168,7 @@
return
else if(!active)
- if(istype(O, /obj/item/wrench))
+ if(O.tool_behavior == TOOL_WRENCH)
if(!anchored && !isinspace())
connect_to_network()
@@ -181,7 +181,7 @@
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
return
- else if(istype(O, /obj/item/screwdriver))
+ else if(O.tool_behavior == TOOL_SCREWDRIVER)
panel_open = !panel_open
O.play_tool_sound(src)
if(panel_open)
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index 98729de3..62be7624 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -18,7 +18,7 @@
var/creation_type = /obj/singularity
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
default_unfasten_wrench(user, W, 0)
else
return ..()
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index 09fb3ad4..0db59bc1 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -63,7 +63,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
- if(istype(W, /obj/item/wrench) && !isinspace())
+ if(W.tool_behavior == TOOL_WRENCH && !isinspace())
W.play_tool_sound(src, 75)
anchored = TRUE
user.visible_message("[user.name] secures the [name] to the floor.", \
@@ -71,7 +71,7 @@
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
W.play_tool_sound(src, 75)
anchored = FALSE
user.visible_message("[user.name] detaches the [name] from the floor.", \
@@ -86,18 +86,18 @@
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(PA_CONSTRUCTION_PANEL_OPEN)
- if(istype(W, /obj/item/wirecutters))//TODO:Shock user if its on?
+ if(W.tool_behavior == TOOL_WIRECUTTER)//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [name].", \
"You remove some wires.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
user.visible_message("[user.name] closes the [name]'s access panel.", \
"You close the access panel.")
construction_state = PA_CONSTRUCTION_COMPLETE
did_something = TRUE
if(PA_CONSTRUCTION_COMPLETE)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
user.visible_message("[user.name] opens the [name]'s access panel.", \
"You open the access panel.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm
index 73e09050..8898b47f 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -271,7 +271,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
- if(istype(W, /obj/item/wrench) && !isinspace())
+ if(W.tool_behavior == TOOL_WRENCH && !isinspace())
W.play_tool_sound(src, 75)
anchored = TRUE
user.visible_message("[user.name] secures the [name] to the floor.", \
@@ -279,7 +279,7 @@
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
- if(istype(W, /obj/item/wrench))
+ if(W.tool_behavior == TOOL_WRENCH)
W.play_tool_sound(src, 75)
anchored = FALSE
user.visible_message("[user.name] detaches the [name] from the floor.", \
@@ -294,18 +294,18 @@
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(PA_CONSTRUCTION_PANEL_OPEN)
- if(istype(W, /obj/item/wirecutters))//TODO:Shock user if its on?
+ if(W.tool_behavior == TOOL_WIRECUTTER)//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [name].", \
"You remove some wires.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
- else if(istype(W, /obj/item/screwdriver))
+ else if(W.tool_behavior == TOOL_SCREWDRIVER)
user.visible_message("[user.name] closes the [name]'s access panel.", \
"You close the access panel.")
construction_state = PA_CONSTRUCTION_COMPLETE
did_something = TRUE
if(PA_CONSTRUCTION_COMPLETE)
- if(istype(W, /obj/item/screwdriver))
+ if(W.tool_behavior == TOOL_SCREWDRIVER)
user.visible_message("[user.name] opens the [name]'s access panel.", \
"You open the access panel.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 774f7ba1..a359cf98 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -151,7 +151,7 @@
log_game("[src] has been deconstructed by [key_name(user)] at [AREACOORD(src)]")
investigate_log("SMES deconstructed by [key_name(user)] at [AREACOORD(src)]", INVESTIGATE_SINGULO)
return
- else if(panel_open && istype(I, /obj/item/crowbar))
+ else if(panel_open && I.tool_behavior == TOOL_CROWBAR)
return
return ..()
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 01c90069..a5ba41f0 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -203,7 +203,7 @@
glass_type = null
/obj/item/solar_assembly/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && isturf(loc))
+ if(W.tool_behavior == TOOL_WRENCH && isturf(loc))
if(isinspace())
to_chat(user, "You can't secure [src] here.")
return
@@ -245,7 +245,7 @@
user.visible_message("[user] inserts the electronics into the solar assembly.", "You insert the electronics into the solar assembly.")
return 1
else
- if(istype(W, /obj/item/crowbar))
+ if(W.tool_behavior == TOOL_CROWBAR)
new /obj/item/electronics/tracker(src.loc)
tracker = 0
user.visible_message("[user] takes out the electronics from the solar assembly.", "You take out the electronics from the solar assembly.")
@@ -411,7 +411,7 @@
return FALSE
/obj/machinery/power/solar_control/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behavior == TOOL_SCREWDRIVER)
if(I.use_tool(src, user, 20, volume=50))
if (src.stat & BROKEN)
to_chat(user, "The broken glass falls out.")
diff --git a/code/modules/projectiles/ammunition/caseless/foam.dm b/code/modules/projectiles/ammunition/caseless/foam.dm
index 1040c08d..cce7c06e 100644
--- a/code/modules/projectiles/ammunition/caseless/foam.dm
+++ b/code/modules/projectiles/ammunition/caseless/foam.dm
@@ -25,7 +25,7 @@
/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params)
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
- if (istype(A, /obj/item/screwdriver) && !modified)
+ if (A.tool_behavior == TOOL_SCREWDRIVER && !modified)
modified = TRUE
FD.modified = TRUE
FD.damage_type = BRUTE
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index c61f8ada..b7e2ea97 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -360,7 +360,7 @@
knife_overlay.pixel_x = knife_x_offset
knife_overlay.pixel_y = knife_y_offset
add_overlay(knife_overlay, TRUE)
- else if(istype(I, /obj/item/screwdriver))
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
if(gun_light)
var/obj/item/flashlight/seclite/S = gun_light
to_chat(user, "You unscrew the seclite from \the [src].")
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 4103efaa..cb531ab7 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -135,7 +135,7 @@
boom()
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/weldingtool))
+ if(I.tool_behavior == TOOL_WELDER)
if(!reagents.has_reagent(/datum/reagent/fuel))
to_chat(user, "[src] is out of fuel!")
return
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index 4bf250c9..242c1356 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
user.visible_message("[user] struggles to pry up \the [src] with \the [I].", \
"You struggle to pry up \the [src] with \the [I].")
if(I.use_tool(src, user, 40, volume=40))
@@ -155,18 +155,18 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
to_chat(user, "You remove the conveyor belt.")
qdel(src)
- else if(istype(I, /obj/item/wrench))
if(!(stat & BROKEN))
I.play_tool_sound(src)
setDir(turn(dir,-45))
update_move_direction()
to_chat(user, "You rotate [src].")
+ else if(I.tool_behavior == TOOL_WRENCH)
- else if(istype(I, /obj/item/screwdriver))
if(!(stat & BROKEN))
verted = verted * -1
update_move_direction()
to_chat(user, "You reverse [src]'s direction.")
+ else if(I.tool_behavior == TOOL_SCREWDRIVER)
else if(user.a_intent != INTENT_HARM)
user.transferItemToLoc(I, drop_location())
@@ -309,7 +309,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
CHECK_TICK
/obj/machinery/conveyor_switch/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/crowbar))
+ if(I.tool_behavior == TOOL_CROWBAR)
var/obj/item/conveyor_switch_construct/C = new/obj/item/conveyor_switch_construct(src.loc)
C.id = id
transfer_fingerprints_to(C)
diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm
index 28817750..cbe3f7ea 100644
--- a/code/modules/research/xenobiology/xenobio_camera.dm
+++ b/code/modules/research/xenobiology/xenobio_camera.dm
@@ -138,7 +138,9 @@
current_potion = O
to_chat(user, "You load [O] in the console's potion slot[replaced ? ", replacing the one that was there before" : ""].")
return
- else if(istype(O, /obj/item/multitool))
+ else if(O.tool_behavior == TOOL_MULTITOOL)
+ if(!multitool_check_buffer(user, W))
+ return
var/obj/item/multitool/M = O
if(istype(M.buffer))
to_chat(user, "You link [src] with [M.buffer] in [M] buffer.")
diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm
index 4600a1a0..0d752f25 100644
--- a/code/modules/station_goals/bsa.dm
+++ b/code/modules/station_goals/bsa.dm
@@ -40,7 +40,9 @@
icon_state = "power_box"
/obj/machinery/bsa/back/multitool_act(mob/living/user, obj/item/I)
- if(istype(I, /obj/item/multitool)) // Only this multitool type has a data buffer.
+ if(I.tool_behavior == TOOL_MULTITOOL) // Only this multitool type has a data buffer.
+ if(!multitool_check_buffer(user, W))
+ return
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "You store linkage information in [I]'s buffer.")
@@ -54,7 +56,7 @@
icon_state = "emitter_center"
/obj/machinery/bsa/front/multitool_act(mob/living/user, obj/item/I)
- if(istype(I, /obj/item/multitool)) // Only this multitool type has a data buffer.
+ if(I.tool_behavior == TOOL_MULTITOOL) // Only this multitool type has a data buffer.
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "You store linkage information in [I]'s buffer.")
@@ -70,7 +72,7 @@
var/obj/machinery/bsa/front/front
/obj/machinery/bsa/middle/multitool_act(mob/living/user, obj/item/I)
- if(istype(I, /obj/item/multitool)) // Only this multitool type has a data buffer.
+ if(I.tool_behavior == TOOL_MULTITOOL) // Only this multitool type has a data buffer.
var/obj/item/multitool/M = I
if(M.buffer)
if(istype(M.buffer, /obj/machinery/bsa/back))
diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm
index be88d0ec..2435451a 100644
--- a/code/modules/station_goals/shield.dm
+++ b/code/modules/station_goals/shield.dm
@@ -122,7 +122,7 @@
icon_state = active ? "sat_active" : "sat_inactive"
/obj/machinery/satellite/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/multitool))
+ if(I.tool_behavior == TOOL_MULTITOOL)
to_chat(user, "// NTSAT-[id] // Mode : [active ? "PRIMARY" : "STANDBY"] //[(obj_flags & EMAGGED) ? "DEBUG_MODE //" : ""]")
else
return ..()
diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm
index a3f8b883..78544e6d 100644
--- a/code/modules/surgery/bodyparts/robot_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm
@@ -198,7 +198,7 @@
else
src.flash1 = F
to_chat(user, "You insert the flash into the eye socket.")
- else if(istype(W, /obj/item/crowbar))
+ else if(W.tool_behavior == TOOL_CROWBAR)
if(flash1 || flash2)
W.play_tool_sound(src)
to_chat(user, "You remove the flash from [src].")
diff --git a/hyperstation/code/modules/cargo/sweatshop/sweatshop.dm b/hyperstation/code/modules/cargo/sweatshop/sweatshop.dm
index c347a961..ae35e341 100644
--- a/hyperstation/code/modules/cargo/sweatshop/sweatshop.dm
+++ b/hyperstation/code/modules/cargo/sweatshop/sweatshop.dm
@@ -126,7 +126,7 @@
..()
//cut heated metal into nails
/obj/item/processed/metal/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wirecutters))
+ if(I.tool_behavior == TOOL_WIRECUTTER)
to_chat(user," You tediously begin to cut [src] into several nails...")
if(do_after(user, 80) && isturf(loc))
new /obj/item/nails(loc)
diff --git a/hyperstation/code/obj/pole.dm b/hyperstation/code/obj/pole.dm
index 4455a882..ba4b233b 100644
--- a/hyperstation/code/obj/pole.dm
+++ b/hyperstation/code/obj/pole.dm
@@ -71,7 +71,7 @@
/obj/item/polepack/attackby(obj/item/P, mob/user, params) //erecting a pole here.
add_fingerprint(user)
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
if (!(item_flags & IN_INVENTORY))
to_chat(user, "You start to fasten the frame to the floor and celing...")
if(P.use_tool(src, user, 8 SECONDS, volume=50))
@@ -83,11 +83,11 @@
/obj/structure/pole/attackby(obj/item/P, mob/user, params) //un-erecting a pole. :(
add_fingerprint(user)
- if(istype(P, /obj/item/wrench))
+ if(P.tool_behavior == TOOL_WRENCH)
to_chat(user, "You start to unfastening the frame...")
if(P.use_tool(src, user, 8 SECONDS, volume=50))
to_chat(user, "You take down the stripper pole!")
var/obj/item/polepack/C = new
C.loc = loc
del(src)
- return
\ No newline at end of file
+ return