diff --git a/aurorastation.dme b/aurorastation.dme
index 40c501046fb..125c465d37a 100644
--- a/aurorastation.dme
+++ b/aurorastation.dme
@@ -155,6 +155,7 @@
#include "code\__DEFINES\tgui.dm"
#include "code\__DEFINES\time.dm"
#include "code\__DEFINES\tips.dm"
+#include "code\__DEFINES\tools.dm"
#include "code\__DEFINES\traits.dm"
#include "code\__DEFINES\turfs.dm"
#include "code\__DEFINES\typeids.dm"
@@ -179,6 +180,7 @@
#include "code\__DEFINES\dcs\signals\signals_record.dm"
#include "code\__DEFINES\dcs\signals\signals_spatial_grid.dm"
#include "code\__DEFINES\dcs\signals\signals_subsystem.dm"
+#include "code\__DEFINES\dcs\signals\signals_tools.dm"
#include "code\__DEFINES\dcs\signals\signals_turf.dm"
#include "code\__DEFINES\dcs\signals\signals_weather.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm"
@@ -710,6 +712,7 @@
#include "code\game\atom\atom_defense.dm"
#include "code\game\atom\atom_examine.dm"
#include "code\game\atom\atom_orbit.dm"
+#include "code\game\atom\atom_tool_acts.dm"
#include "code\game\atom\atoms_initializing_EXPENSIVE.dm"
#include "code\game\dna\dna2.dm"
#include "code\game\dna\dna2_domutcheck.dm"
@@ -1267,6 +1270,9 @@
#include "code\game\objects\items\stacks\sheets\leather.dm"
#include "code\game\objects\items\stacks\tiles\light.dm"
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
+#include "code\game\objects\items\tools\crowbar.dm"
+#include "code\game\objects\items\tools\mop.dm"
+#include "code\game\objects\items\tools\tools.dm"
#include "code\game\objects\items\weapons\AI_modules.dm"
#include "code\game\objects\items\weapons\autopsy.dm"
#include "code\game\objects\items\weapons\candle.dm"
@@ -1289,7 +1295,6 @@
#include "code\game\objects\items\weapons\ipc_scanner.dm"
#include "code\game\objects\items\weapons\landmines.dm"
#include "code\game\objects\items\weapons\manuals.dm"
-#include "code\game\objects\items\weapons\mop.dm"
#include "code\game\objects\items\weapons\neutralizer.dm"
#include "code\game\objects\items\weapons\paint.dm"
#include "code\game\objects\items\weapons\paiwire.dm"
@@ -1307,7 +1312,6 @@
#include "code\game\objects\items\weapons\teleportation.dm"
#include "code\game\objects\items\weapons\tether.dm"
#include "code\game\objects\items\weapons\thermal_drill.dm"
-#include "code\game\objects\items\weapons\tools.dm"
#include "code\game\objects\items\weapons\towel.dm"
#include "code\game\objects\items\weapons\traps.dm"
#include "code\game\objects\items\weapons\vaurca_items.dm"
diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm
index 0a44eae825c..f91d1be1004 100644
--- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm
+++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm
@@ -18,3 +18,45 @@
#define COMPONENT_BULLET_PIERCED (1<<2)
///from base of atom/bullet_act(): (/obj/projectile, def_zone)
#define COMSIG_ATOM_BULLET_ACT "atom_bullet_act"
+
+/// Sent from [atom/proc/item_interaction], when this atom is left-clicked on by a mob with an item
+/// Sent from the very beginning of the click chain, intended for generic atom-item interactions
+/// Args: (mob/living/user, obj/item/tool, list/modifiers)
+/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
+#define COMSIG_ATOM_ITEM_INTERACTION "atom_item_interaction"
+/// Sent from [atom/proc/item_interaction], when this atom is alt-left-clicked on by a mob with an item
+/// Sent from the very beginning of the click chain, intended for generic atom-item interactions
+/// Args: (mob/living/user, obj/item/tool, list/modifiers)
+/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
+#define COMSIG_ATOM_ITEM_INTERACTION_ALT "atom_item_interaction_alt"
+/// Sent from [atom/proc/item_interaction], to a mob clicking on an atom with an item
+#define COMSIG_USER_ITEM_INTERACTION "user_item_interaction"
+/// Sent from [atom/proc/item_interaction], to an item clicking on an atom
+/// Args: (mob/living/user, atom/interacting_with, list/modifiers)
+/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
+#define COMSIG_ITEM_INTERACTING_WITH_ATOM "item_interacting_with_atom"
+/// Sent from [atom/proc/item_interaction], to an item alt-left-clicking on an atom
+/// Args: (mob/living/user, atom/interacting_with, list/modifiers)
+/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
+#define COMSIG_ITEM_INTERACTING_WITH_ATOM_ALT "item_interacting_with_atom_alt"
+/// Sent from [atom/proc/item_interaction], when this atom is alt-left-clicked on by a mob with a tool
+#define COMSIG_USER_ITEM_INTERACTION_ALT "user_item_interaction_alt"
+/// Sent from [atom/proc/item_interaction], when this atom is left-clicked on by a mob with a tool of a specific tool type
+/// Args: (mob/living/user, obj/item/tool, list/recipes)
+/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
+#define COMSIG_ATOM_TOOL_ACT(tooltype) "tool_act_[tooltype]"
+/// Sent from [atom/proc/item_interaction], when this atom is alt-left-clicked on by a mob with a tool of a specific tool type
+/// Args: (mob/living/user, obj/item/tool)
+/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
+#define COMSIG_ATOM_ALT_TOOL_ACT(tooltype) "tool_alt_act_[tooltype]"
+/// Sent from [atom/proc/ranged_item_interaction], when this atom is left-clicked on by a mob with an item while not adjacent
+#define COMSIG_ATOM_RANGED_ITEM_INTERACTION "atom_ranged_item_interaction"
+/// Sent from [atom/proc/ranged_item_interaction], when this atom is alt-left-clicked on by a mob with an item while not adjacent
+#define COMSIG_ATOM_RANGED_ITEM_INTERACTION_ALT "atom_ranged_item_interaction_alt"
+/// Sent from [atom/proc/ranged_item_interaction], when a mob is using this item while left-clicking on by an atom while not adjacent
+#define COMSIG_RANGED_ITEM_INTERACTING_WITH_ATOM "ranged_item_interacting_with_atom"
+/// Sent from [atom/proc/ranged_item_interaction], when a mob is using this item while alt-left-clicking on by an atom while not adjacent
+#define COMSIG_RANGED_ITEM_INTERACTING_WITH_ATOM_ALT "ranged_item_interacting_with_atom_alt"
+
+/// Sent from [atom/proc/item_interaction], when this atom is used as a tool and an event occurs
+#define COMSIG_ITEM_TOOL_ACTED "tool_item_acted"
diff --git a/code/__DEFINES/dcs/signals/signals_tools.dm b/code/__DEFINES/dcs/signals/signals_tools.dm
new file mode 100644
index 00000000000..db3960bc013
--- /dev/null
+++ b/code/__DEFINES/dcs/signals/signals_tools.dm
@@ -0,0 +1,14 @@
+// Notifies tools that something is happening.
+
+// Successful actions against an atom.
+///Called from /atom/proc/tool_act (atom)
+#define COMSIG_TOOL_ATOM_ACTED_PRIMARY(tooltype) "tool_atom_acted_[tooltype]"
+///Called from /atom/proc/tool_act (atom)
+#define COMSIG_TOOL_ATOM_ACTED_ALT(tooltype) "tool_atom_acted_[tooltype]"
+
+//Called when a tool attempts to pry open an airlock. Called from /obj/machinery/door/airlock/try_to_crowbar
+#define COMSIG_TOOL_FORCE_OPEN_AIRLOCK "tool_force_open_airlock"
+ //If this value is returned, prevents the airlock from being forced open.
+ #define COMPONENT_TOOL_DO_NOT_ALLOW_FORCE_OPEN (1<<0)
+ //If this value is returned, it means the tool successfully opened the airlock without interruption
+ #define COMPONENT_TOOL_ALLOW_FORCE_OPEN (1<<1)
diff --git a/code/__DEFINES/obj.dm b/code/__DEFINES/obj.dm
index 15be321838c..a5a6db48b5a 100644
--- a/code/__DEFINES/obj.dm
+++ b/code/__DEFINES/obj.dm
@@ -1,42 +1,3 @@
-/obj/proc/issurgerycompatible() // set to false for things that are too unwieldy for surgery
- return TRUE
-
-/obj/proc/iswrench()
- return FALSE
-
-/obj/proc/isscrewdriver()
- return FALSE
-
-/obj/proc/iswirecutter()
- return FALSE
-
-/obj/proc/ismultitool()
- return FALSE
-
-/obj/proc/iscrowbar()
- return FALSE
-
-/obj/proc/iswelder()
- return FALSE
-
-/obj/proc/iscoil()
- return FALSE
-
-/obj/proc/ishammer()
- return FALSE
-
-/obj/proc/ispen()
- return FALSE
-
-// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
-// tool sound is only played when op is started. If not, it's played twice.
-#define MIN_TOOL_SOUND_DELAY 20
-
-#define SCREWDRIVER "screwdriver"
-#define WRENCH "wrench"
-#define CROWBAR "crowbar"
-#define WIRECUTTER "wirecutter"
-
// Defines for barricade states
#define BARRICADE_DMG_NONE 0
#define BARRICADE_DMG_SLIGHT 1
@@ -62,20 +23,4 @@
#define BARRICADE_LIQUIDBAG_4 4
#define BARRICADE_LIQUIDBAG_5 5
-/proc/check_tool_quality(var/obj/tool, var/quality, var/return_value, var/requires_surgery_compatibility = FALSE)
- switch(quality)
- if(SCREWDRIVER)
- if(tool.isscrewdriver() && (!requires_surgery_compatibility || tool.issurgerycompatible()))
- return return_value
- if(WRENCH)
- if(tool.iswrench() && (!requires_surgery_compatibility || tool.issurgerycompatible()))
- return return_value
- if(CROWBAR)
- if(tool.iscrowbar() && (!requires_surgery_compatibility || tool.issurgerycompatible()))
- return return_value
- if(WIRECUTTER)
- if(tool.iswirecutter() && (!requires_surgery_compatibility || tool.issurgerycompatible()))
- return return_value
- return null
-
#define HELMET_GARB_PASS_ICON "pass_icon"
diff --git a/code/__DEFINES/tools.dm b/code/__DEFINES/tools.dm
new file mode 100644
index 00000000000..c682eb1f0f2
--- /dev/null
+++ b/code/__DEFINES/tools.dm
@@ -0,0 +1,77 @@
+// Tool types, as used by the obj/item variable 'tool_behaviour'. These are strings and not bitfields, because even
+// though some objects logically could function as multiple tools simultaneously, the 'tool_behaviour' variable describes
+// current intention, not functionality. For an item that can function as multiple tools, it must have a mechanism to switch
+// between intended tool types.
+#define TOOL_CROWBAR "crowbar"
+#define TOOL_MULTITOOL "multitool"
+#define TOOL_SCREWDRIVER "screwdriver"
+#define TOOL_WIRECUTTER "cutters"
+#define TOOL_WRENCH "wrench"
+#define TOOL_PIPEWRENCH "pipe wrench"
+#define TOOL_WELDER "welder"
+#define TOOL_ANALYZER "analyzer"
+#define TOOL_MINING "mining"
+#define TOOL_SHOVEL "shovel"
+#define TOOL_RETRACTOR "retractor"
+#define TOOL_HEMOSTAT "hemostat"
+#define TOOL_CAUTERY "cautery"
+#define TOOL_DRILL "drill"
+#define TOOL_SCALPEL "scalpel"
+#define TOOL_SAW "saw"
+#define TOOL_BONESET "bonesetter"
+#define TOOL_KNIFE "knife"
+#define TOOL_BLOODFILTER "bloodfilter"
+#define TOOL_ROLLINGPIN "rolling pin"
+#define TOOL_CABLECOIL "cable coil"
+#define TOOL_HAMMER "hammer"
+#define TOOL_PEN "pen"
+
+// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
+// tool sound is only played when op is started. If not, it's played twice.
+#define MIN_TOOL_SOUND_DELAY 20
+#define MIN_TOOL_OPERATING_DELAY 40 //minimum delay for operating sound. Prevent overlaps and overhand sound.
+/// Return when an item interaction is successful.
+/// This cancels the rest of the chain entirely and indicates success.
+#define ITEM_INTERACT_SUCCESS (1<<0) // Same as TRUE, as most tool (legacy) tool acts return TRUE on success
+/// Return to prevent the rest of the attack chain from being executed / preventing the item user from thwacking the target.
+/// Similar to [ITEM_INTERACT_SUCCESS], but does not necessarily indicate success.
+#define ITEM_INTERACT_BLOCKING (1<<1)
+ /// Only for people who get confused by the naming scheme
+ #define ITEM_INTERACT_FAILURE ITEM_INTERACT_BLOCKING
+/// Return to skip the rest of the interaction chain, going straight to attack.
+#define ITEM_INTERACT_SKIP_TO_ATTACK (1<<2)
+
+/// Combination flag for any item interaction that blocks the rest of the attack chain
+#define ITEM_INTERACT_ANY_BLOCKER (ITEM_INTERACT_SUCCESS | ITEM_INTERACT_BLOCKING)
+
+/// How many seconds between each fuel depletion tick ("use" proc)
+#define TOOL_FUEL_BURN_INTERVAL 5
+
+///This is a number I got by quickly searching up the temperature to melt iron/glass, though not really realistic.
+///This is used for places where lighters should not be hot enough to be used as a welding tool on.
+#define HIGH_TEMPERATURE_REQUIRED 1500
+
+/**
+ * A helper for checking if an item interaction should be skipped.
+ * This is only used explicitly because some interactions may not want to ever be skipped.
+ */
+#define SHOULD_SKIP_INTERACTION(target, item, user) (HAS_TRAIT(target, TRAIT_COMBAT_MODE_SKIP_INTERACTION) && user.combat_mode)
+
+// Used by the decal painter to get information about the decal being painted
+/// Icon state to paint
+#define DECAL_INFO_ICON_STATE "icon_state"
+/// Color to paint the decal with
+#define DECAL_INFO_COLOR "color"
+/// Dir of the decal sprite
+#define DECAL_INFO_DIR "dir"
+/// Alpha of the decal
+#define DECAL_INFO_ALPHA "alpha"
+
+/obj/proc/issurgerycompatible() // set to false for things that are too unwieldy for surgery
+ return TRUE
+
+/proc/check_tool_quality(var/obj/item/tool, var/quality, var/return_value, var/requires_surgery_compatibility = FALSE)
+ if(quality == tool.tool_behaviour && (!requires_surgery_compatibility || tool.issurgerycompatible()))
+ return return_value
+
+ return null
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 07237ef084f..c4c06a0f3bc 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -11,6 +11,10 @@ mob/attacked_with_item() should then do mob-type specific stuff (like determinin
Item Hit Effects:
item/apply_hit_effect() can be overriden to do whatever you want. However "standard" physical damage based weapons should make use of the target mob's hit_with_weapon() proc to
avoid code duplication. This includes items that may sometimes act as a standard weapon in addition to having other effects (e.g. stunbatons on harm intent).
+
+[obj/item/proc/base_item_interaction] handles all non-combat interactions of an item with an atom.
+This calls [atom/proc/tool_act], among others.
+
*/
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
@@ -58,6 +62,12 @@ avoid code duplication. This includes items that may sometimes act as a standard
if((user?.a_intent == I_HURT) && !(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON))
visible_message(SPAN_DANGER("[src] has been hit by [user] with [attacking_item]."))
+ var/item_interact_result = src.base_item_interaction(user, src, modifiers)
+ if(item_interact_result & ITEM_INTERACT_SUCCESS)
+ return TRUE
+ if(item_interact_result & ITEM_INTERACT_BLOCKING)
+ return FALSE
+
/mob/living/attackby(obj/item/attacking_item, mob/user, params)
if(..())
return TRUE
diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm
index 25204fad7de..77807135499 100644
--- a/code/datums/helper_datums/construction_datum.dm
+++ b/code/datums/helper_datums/construction_datum.dm
@@ -38,11 +38,11 @@
/datum/construction/proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
var/list/L = steps[steps.len]
- if(isobj(used_atom))
- var/return_value = check_tool_quality(used_atom, L["key"], steps.len)
- if(return_value)
- return return_value
- if(istype(used_atom, L["key"]))
+ var/obj/item/used_item = used_atom
+ var/return_value = check_tool_quality(used_item, L["key"], steps.len)
+ if(return_value)
+ return return_value
+ if(istype(used_item, L["key"]) || used_item.tool_behaviour == L["key"])
return steps.len
return FALSE
@@ -50,10 +50,11 @@
return TRUE
/datum/construction/proc/check_all_steps(atom/used_atom, mob/user) //check all steps, remove matching one.
+ var/obj/item/used_item = used_atom
for(var/i=1;i<=steps.len;i++)
var/list/L = steps[i];
- if(istype(used_atom, L["key"]))
- if(custom_action(i, used_atom, user))
+ if(istype(used_item, L["key"]) || used_item.tool_behaviour == L["key"])
+ if(custom_action(i, used_item, user))
steps[i]=null;//stupid byond list from list removal...
listclearnulls(steps);
if(!steps.len)
@@ -90,20 +91,14 @@
/datum/construction/reversible/is_right_key(atom/used_atom) // returns index step
var/list/L = steps[index]
- var/is_obj = FALSE
- if(isobj(used_atom))
- var/return_value = check_tool_quality(used_atom, L["key"], FORWARD)
- if(return_value)
- return return_value
- is_obj = TRUE
- if(istype(used_atom, L["key"]))
+ var/obj/item/used_item = used_atom
+ if(istype(used_item, L["key"]) || used_item.tool_behaviour == L["key"])
return FORWARD //to the first step -> forward
else if(L["backkey"])
- if(is_obj)
- var/return_value = check_tool_quality(used_atom, L["backkey"], BACKWARD)
- if(return_value)
- return return_value
- if(istype(used_atom, L["backkey"]))
+ var/return_value = check_tool_quality(used_item, L["backkey"], BACKWARD)
+ if(return_value)
+ return return_value
+ if(istype(used_item, L["backkey"]) || used_item.tool_behaviour == L["backkey"])
return BACKWARD //to the last step -> backwards
return FALSE
diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm
index 44c8c12cda6..0333c0c8f7d 100644
--- a/code/datums/wires/wires.dm
+++ b/code/datums/wires/wires.dm
@@ -335,13 +335,13 @@ GLOBAL_LIST_INIT(wire_name_directory, list())
if("cut") // Toggles the cut/mend status
var/obj/item/I = L.get_active_hand()
- if(!I || !I.iswirecutter())
+ if(!I || !I.tool_behaviour == TOOL_WIRECUTTER)
if(isrobot(L))
var/mob/living/silicon/robot/R = L
I = R.return_wirecutter()
else
I = L.get_inactive_hand()
- if(I?.iswirecutter())
+ if(I?.tool_behaviour == TOOL_WIRECUTTER)
cut_color(target_wire, source = L)
holder.add_hiddenprint(L)
I.play_tool_sound(holder, 50)
@@ -351,13 +351,13 @@ GLOBAL_LIST_INIT(wire_name_directory, list())
if("pulse")
var/obj/item/I = L.get_active_hand()
- if(!I || !I.ismultitool())
+ if(!I || !I.tool_behaviour == TOOL_MULTITOOL)
if(isrobot(L))
var/mob/living/silicon/robot/R = L
I = R.return_multitool()
else
I = L.get_inactive_hand()
- if(I?.ismultitool())
+ if(I?.tool_behaviour == TOOL_MULTITOOL)
pulse_color(target_wire, L)
holder.add_hiddenprint(L)
. = TRUE
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index ee8f13ca737..6fdcc6e5f2b 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -450,7 +450,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
/obj/item/module/power_control/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/circuitboard/ghettosmes/new_circuit = new /obj/item/circuitboard/ghettosmes(get_turf(src))
to_chat(user, SPAN_NOTICE("You modify \the [src] into a makeshift PSU circuitboard."))
qdel(src)
@@ -521,7 +521,7 @@
icon_state = "neuralbroke"
/obj/item/neuralbroke/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
new /obj/item/device/encryptionkey/hivenet(user.loc)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You bypass the fried security chip and extract the encryption key.")
diff --git a/code/game/atom/atom_act.dm b/code/game/atom/atom_act.dm
index 95ab64b9249..59c165966eb 100644
--- a/code/game/atom/atom_act.dm
+++ b/code/game/atom/atom_act.dm
@@ -74,14 +74,17 @@
if(harmed_atom && isturf(harmed_atom.loc))
step(harmed_atom, REVERSE_DIR(harmed_atom.dir))
-
-/*
- THESE ARE LEGACY ONES, NOT UPDATED YET
-*/
-
-/atom/proc/ex_act()
+/**
+ * Respond to an explosion affecting our atom. Generally gets overwritten.
+ * This is a legacy proc, to be updated.
+ */
+/atom/proc/ex_act(severity, target)
set waitfor = FALSE
return
+/**
+ * Respond to an emag being used on our atom. Generally gets overwritten.
+ * This is a legacy proc, to be updated.
+ */
/atom/proc/emag_act(var/remaining_charges, var/mob/user, var/emag_source)
return NO_EMAG_ACT
diff --git a/code/game/atom/atom_tool_acts.dm b/code/game/atom/atom_tool_acts.dm
new file mode 100644
index 00000000000..112956f8c26
--- /dev/null
+++ b/code/game/atom/atom_tool_acts.dm
@@ -0,0 +1,328 @@
+/**
+ * ## Item interaction
+ *
+ * Handles non-combat interactions of a tool on this atom,
+ * such as using a tool on a wall to deconstruct it,
+ * or scanning someone with a health analyzer
+ */
+/atom/proc/base_item_interaction(mob/living/user, obj/item/tool, list/modifiers)
+ SHOULD_CALL_PARENT(TRUE)
+ PROTECTED_PROC(TRUE)
+
+ if(!user.a_intent == I_HURT)
+ var/tool_return = tool_act(user, tool, modifiers)
+ if(tool_return)
+ return tool_return
+
+ var/is_alt_clicking = text2num(LAZYACCESS(modifiers, ALT_CLICK))
+ var/is_left_clicking = !is_alt_clicking
+ var/early_sig_return = NONE
+ if(is_left_clicking)
+ /*
+ * This is intentionally using `||` instead of `|` to short-circuit the signal calls
+ * This is because we want to return early if ANY of these signals return a value
+ *
+ * This puts priority on the atom's signals, then the tool's signals, then the user's signals,
+ * so we can avoid doing two interactions at once
+ */
+ early_sig_return = SEND_SIGNAL(src, COMSIG_ATOM_ITEM_INTERACTION, user, tool, modifiers) \
+ || SEND_SIGNAL(tool, COMSIG_ITEM_INTERACTING_WITH_ATOM, user, src, modifiers) \
+ || SEND_SIGNAL(user, COMSIG_USER_ITEM_INTERACTION, src, tool, modifiers)
+ else
+ // See above
+ early_sig_return = SEND_SIGNAL(src, COMSIG_ATOM_ITEM_INTERACTION_ALT, user, tool, modifiers) \
+ || SEND_SIGNAL(tool, COMSIG_ITEM_INTERACTING_WITH_ATOM_ALT, user, src, modifiers) \
+ || SEND_SIGNAL(user, COMSIG_USER_ITEM_INTERACTION_ALT, src, tool, modifiers)
+ if(early_sig_return)
+ return early_sig_return
+
+ var/self_interaction = is_left_clicking \
+ ? item_interaction(user, tool, modifiers) \
+ : item_interaction_alt(user, tool, modifiers)
+ if(self_interaction)
+ return self_interaction
+
+ var/interact_return = is_left_clicking \
+ ? tool.interact_with_atom(src, user, modifiers) \
+ : tool.interact_with_atom_alt(src, user, modifiers)
+ if(interact_return)
+ return interact_return
+
+ // We have to manually handle storage in item_interaction because storage is blocking in 99% of interactions, which stifles a lot
+ // Yeah it sucks not being able to signalize this, but the other option is to have a second signal here just for storage which is also not great
+ /*
+ if(atom_storage)
+ if(is_left_clicking)
+ if(atom_storage.insert_on_attack)
+ return atom_storage.item_interact_insert(user, tool)
+ else
+ if(atom_storage.open_storage(user) && atom_storage.display_contents)
+ return ITEM_INTERACT_SUCCESS
+ */
+ return NONE
+
+/**
+ *
+ * ## Tool Act
+ *
+ * Handles using specific tools on this atom directly.
+ * Only called when in Help intent.
+ *
+ * Handles the tool_acts in particular, such as wrenches and screwdrivers.
+ *
+ * This can be overridden to handle unique "tool interactions"
+ * IE using an item like a tool (when it's not actually one)
+ * This is particularly useful for things that shouldn't be inserted into storage
+ * (because tool acting runs before storage checks)
+ * but otherwise does nothing that [item_interaction] doesn't already do.
+ *
+ * In other words, use sparingly. It's harder to use (correctly) than [item_interaction].
+ */
+/atom/proc/tool_act(mob/living/user, obj/item/tool, list/modifiers)
+ SHOULD_CALL_PARENT(TRUE)
+ PROTECTED_PROC(TRUE)
+
+ var/tool_type = tool.tool_behaviour
+ if(!tool_type)
+ return NONE
+
+ var/is_alt_clicking = text2num(LAZYACCESS(modifiers, ALT_CLICK))
+ var/is_left_clicking = !is_alt_clicking
+
+ var/list/processing_recipes = list()
+ var/signal_result = is_left_clicking \
+ ? SEND_SIGNAL(src, COMSIG_ATOM_TOOL_ACT(tool_type), user, tool, processing_recipes) \
+ : SEND_SIGNAL(src, COMSIG_ATOM_ALT_TOOL_ACT(tool_type), user, tool)
+ if(signal_result)
+ return signal_result
+ /*
+ if(length(processing_recipes))
+ process_recipes(user, tool, processing_recipes)
+ return ITEM_INTERACT_SUCCESS
+ */
+ if(QDELETED(tool))
+ return ITEM_INTERACT_SUCCESS // Safe-ish to assume that if we deleted our item something succeeded
+
+ var/act_result = NONE // or FALSE, or null, as some things may return
+
+ switch(tool_type)
+ if(TOOL_CROWBAR)
+ act_result = is_left_clicking ? crowbar_act(user, tool) : crowbar_act_alt(user, tool)
+ if(TOOL_MULTITOOL)
+ act_result = is_left_clicking ? multitool_act(user, tool) : multitool_act_alt(user, tool)
+ if(TOOL_SCREWDRIVER)
+ act_result = is_left_clicking ? screwdriver_act(user, tool) : screwdriver_act_alt(user, tool)
+ if(TOOL_WRENCH)
+ act_result = is_left_clicking ? wrench_act(user, tool) : wrench_act_alt(user, tool)
+ if(TOOL_WIRECUTTER)
+ act_result = is_left_clicking ? wirecutter_act(user, tool) : wirecutter_act_alt(user, tool)
+ if(TOOL_WELDER)
+ act_result = is_left_clicking ? welder_act(user, tool) : welder_act_alt(user, tool)
+ if(TOOL_ANALYZER)
+ act_result = is_left_clicking ? analyzer_act(user, tool) : analyzer_act_alt(user, tool)
+
+ if(!act_result)
+ return NONE
+
+ // A tooltype_act has completed successfully
+ if(is_left_clicking)
+ // log_tool("[key_name(user)] used [tool] on [src] at [AREACOORD(src)]")
+ SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_PRIMARY(tool_type), src)
+ else
+ // log_tool("[key_name(user)] used [tool] on [src] (alt-left click) at [AREACOORD(src)]")
+ SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_ALT(tool_type), src)
+ SEND_SIGNAL(tool, COMSIG_ITEM_TOOL_ACTED, src, user, tool_type, act_result)
+ return act_result
+
+/**
+ * Called when this atom has an item used on it.
+ * IE, a mob is clicking on this atom with an item.
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ * Return NONE to allow default interaction / tool handling.
+ */
+/atom/proc/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
+ return NONE
+
+/**
+ * Called when this atom has an item used on it WITH ALT LEFT CLICK,
+ * IE, a mob is alt-left clicking on this atom with an item.
+ * Default behavior has it run the same code as left click.
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ * Return NONE to allow default interaction / tool handling.
+ */
+/atom/proc/item_interaction_alt(mob/living/user, obj/item/tool, list/modifiers)
+ return item_interaction(user, tool, modifiers)
+
+/**
+ * Called when this item is being used to interact with an atom,
+ * IE, a mob is clicking on an atom with this item.
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ * Return NONE to allow default interaction / tool handling.
+ */
+/obj/item/proc/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
+ return NONE
+
+/**
+ * Called when this item is being used to interact with an atom WITH ALT LEFT CLICK,
+ * IE, a mob is alt-left clicking on an atom with this item.
+ *
+ * Default behavior has it run the same code as left click.
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ * Return NONE to allow default interaction / tool handling.
+ */
+/obj/item/proc/interact_with_atom_alt(atom/interacting_with, mob/living/user, list/modifiers)
+ return interact_with_atom(interacting_with, user, modifiers)
+
+/**
+ * ## Ranged item interaction
+ *
+ * Handles non-combat ranged interactions of a tool on this atom,
+ * such as shooting a gun in the direction of someone*,
+ * having a scanner you can point at someone to scan them at any distance,
+ * or pointing a laser pointer at something.
+ *
+ * *While this intuitively sounds combat related, it is not,
+ * because a "combat use" of a gun is gun-butting.
+ */
+/atom/proc/base_ranged_item_interaction(mob/living/user, obj/item/tool, list/modifiers)
+ SHOULD_CALL_PARENT(TRUE)
+ PROTECTED_PROC(TRUE)
+
+ var/is_alt_clicking = LAZYACCESS(modifiers, ALT_CLICK)
+ var/is_left_clicking = !is_alt_clicking
+ var/early_sig_return = NONE
+ if(is_left_clicking)
+ // See [base_item_interaction] for defails on why this is using `||` (TL;DR it's short circuiting)
+ early_sig_return = SEND_SIGNAL(src, COMSIG_ATOM_RANGED_ITEM_INTERACTION, user, tool, modifiers) \
+ || SEND_SIGNAL(tool, COMSIG_RANGED_ITEM_INTERACTING_WITH_ATOM, user, src, modifiers)
+ else
+ // See above
+ early_sig_return = SEND_SIGNAL(src, COMSIG_ATOM_RANGED_ITEM_INTERACTION_ALT, user, tool, modifiers) \
+ || SEND_SIGNAL(tool, COMSIG_RANGED_ITEM_INTERACTING_WITH_ATOM_ALT, user, src, modifiers)
+ if(early_sig_return)
+ return early_sig_return
+
+ var/self_interaction = is_left_clicking \
+ ? ranged_item_interaction(user, tool, modifiers) \
+ : ranged_item_interaction_alt(user, tool, modifiers)
+ if(self_interaction)
+ return self_interaction
+
+ var/interact_return = is_left_clicking \
+ ? tool.ranged_interact_with_atom(src, user, modifiers) \
+ : tool.ranged_interact_with_atom_alt(src, user, modifiers)
+ if(interact_return)
+ return interact_return
+
+ return NONE
+
+/**
+ * Called when this atom has an item used on it from a distance.
+ * IE, a mob is clicking on this atom with an item and is not adjacent.
+ *
+ * Does NOT include Telekinesis users, they are considered adjacent generally.
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ */
+/atom/proc/ranged_item_interaction(mob/living/user, obj/item/tool, list/modifiers)
+ return NONE
+
+/**
+ * Called when this atom has an item used on it from a distance WITH ALT LEFT CLICK,
+ * IE, a mob is alt-left clicking on this atom with an item and is not adjacent.
+ *
+ * Default behavior has it run the same code as left click.
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ */
+/atom/proc/ranged_item_interaction_alt(mob/living/user, obj/item/tool, list/modifiers)
+ return ranged_item_interaction(user, tool, modifiers)
+
+/**
+ * Called when this item is being used to interact with an atom from a distance,
+ * IE, a mob is clicking on an atom with this item and is not adjacent.
+ *
+ * Does NOT include Telekinesis users, they are considered adjacent generally
+ * (so long as this item is adjacent to the atom).
+ *
+ * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.
+ */
+/obj/item/proc/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
+ return NONE
+
+/**
+ * Called when this item is being used to interact with an atom from a distance WITH ALT LEFT CLICK,
+ * IE, a mob is alt-left clicking on an atom with this item and is not adjacent.
+ *
+ * Default behavior has it run the same code as left click.
+ */
+/obj/item/proc/ranged_interact_with_atom_alt(atom/interacting_with, mob/living/user, list/modifiers)
+ return ranged_interact_with_atom(interacting_with, user, modifiers)
+
+/*
+ * Tool-specific behavior procs.
+ *
+ * Return an ITEM_INTERACT_ flag to handle the event, or NONE to allow the mob to attack the atom.
+ * Returning TRUE will also cancel attacks. It is equivalent to an ITEM_INTERACT_ flag. (This is legacy behavior, and is not to be relied on)
+ * Returning FALSE or null will also allow the mob to attack the atom. (This is also legacy behavior)
+ */
+
+/// Called on an object when a tool with crowbar capabilities is used to left click an object
+/atom/proc/crowbar_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with crowbar capabilities is used to alt-left click an object
+/atom/proc/crowbar_act_alt(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with multitool capabilities is used to left click an object
+/atom/proc/multitool_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with multitool capabilities is used to alt-left click an object
+/atom/proc/multitool_act_alt(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with screwdriver capabilities is used to left click an object
+/atom/proc/screwdriver_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with screwdriver capabilities is used to alt-left click an object
+/atom/proc/screwdriver_act_alt(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with wrench capabilities is used to left click an object
+/atom/proc/wrench_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with wrench capabilities is used to alt-left click an object
+/atom/proc/wrench_act_alt(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with wirecutter capabilities is used to left click an object
+/atom/proc/wirecutter_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with wirecutter capabilities is used to alt-left click an object
+/atom/proc/wirecutter_act_alt(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with welder capabilities is used to left click an object
+/atom/proc/welder_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with welder capabilities is used to alt-left click an object
+/atom/proc/welder_act_alt(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with analyzer capabilities is used to left click an object
+/atom/proc/analyzer_act(mob/living/user, obj/item/tool)
+ return
+
+/// Called on an object when a tool with analyzer capabilities is used to alt-left click an object
+/atom/proc/analyzer_act_alt(mob/living/user, obj/item/tool)
+ return
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 7cec690ca78..d20dfd30617 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -77,8 +77,8 @@
/obj/machinery/dna_scannernew/proc/eject_occupant()
src.go_out()
- for(var/obj/O in src)
- if((!istype(O,/obj/item/reagent_containers)) && (!istype(O,/obj/item/circuitboard/clonescanner)) && (!istype(O,/obj/item/stock_parts)) && (!O.iscoil()))
+ for(var/obj/item/O in src)
+ if((!istype(O,/obj/item/reagent_containers)) && (!istype(O,/obj/item/circuitboard/clonescanner)) && (!istype(O,/obj/item/stock_parts)) && (!O.tool_behaviour == TOOL_CABLECOIL))
O.forceMove(get_turf(src))//Ejects items that manage to get in there (exluding the components)
if(!occupant)
for(var/mob/M in src)//Failsafe so you can get mobs out
diff --git a/code/game/gamemodes/changeling/implements/items.dm b/code/game/gamemodes/changeling/implements/items.dm
index b50f3c8c359..999f44c8bc7 100644
--- a/code/game/gamemodes/changeling/implements/items.dm
+++ b/code/game/gamemodes/changeling/implements/items.dm
@@ -19,6 +19,7 @@
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
canremove = FALSE
var/mob/living/creator
+ tool_behaviour = TOOL_CROWBAR
/obj/item/melee/arm_blade/New()
..()
@@ -50,11 +51,6 @@
host.drop_from_inventory(src)
QDEL_IN(src, 1)
-/obj/item/melee/arm_blade/iscrowbar()
- if(creator.a_intent == I_HELP)
- return TRUE
- return FALSE
-
/obj/item/melee/arm_blade/resolve_attackby(atom/A, mob/living/user, var/click_parameters)
if(istype(A,/turf/simulated/floor) && user.a_intent != I_HELP)
return
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
index edf2a55fca7..e225fdb56a4 100644
--- a/code/game/machinery/CableLayer.dm
+++ b/code/game/machinery/CableLayer.dm
@@ -31,7 +31,7 @@
return
/obj/machinery/cablelayer/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/result = load_cable(attacking_item)
if(!result)
to_chat(user, SPAN_WARNING("\The [src]'s cable reel is full."))
@@ -39,7 +39,7 @@
to_chat(user, SPAN_NOTICE("You load [result] lengths of cable into \the [src]."))
return TRUE
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(cable && cable.amount)
var/m = round(input(usr,"Please specify the length of cable to cut.", "Cut Cable",min(cable.amount,30)) as num, 1)
m = min(m, cable.amount)
@@ -53,7 +53,7 @@
to_chat(user, SPAN_WARNING("There's no more cable on the reel."))
return TRUE
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
if(!cable)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any cable loaded!"))
return TRUE
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 9a9836f18b2..02b3dd5391e 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -283,7 +283,7 @@
update_icon()
qdel(G)
return TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
src.panel_open = !src.panel_open
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
ClearOverlays()
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index d117cd436d7..3a893751cba 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -1017,13 +1017,13 @@ pixel_x = 10;
switch(buildstage)
if(2)
- if(attacking_item.isscrewdriver()) // Opening that Air Alarm up.
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) // Opening that Air Alarm up.
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "open" : "close"] the maintenance panel."))
update_icon()
return TRUE
- if (panel_open && attacking_item.iswirecutter())
+ if (panel_open && attacking_item.tool_behaviour == TOOL_WIRECUTTER)
user.visible_message(SPAN_WARNING("[user] has cut the wires inside \the [src]!"), "You cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
@@ -1032,7 +1032,7 @@ pixel_x = 10;
return TRUE
if(1)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if (C.use(5))
to_chat(user, SPAN_NOTICE("You wire \the [src]."))
@@ -1044,7 +1044,7 @@ pixel_x = 10;
to_chat(user, SPAN_WARNING("You need 5 pieces of cable to do wire \the [src]."))
return TRUE
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, "You start prying out the circuit.")
if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, "You pry out the circuit!")
@@ -1062,7 +1062,7 @@ pixel_x = 10;
update_icon()
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You remove the air alarm assembly from the wall!")
new /obj/item/frame/air_alarm(get_turf(user))
attacking_item.play_tool_sound(src.loc, 50)
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 302f4817b49..cfbb90cce4e 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -456,7 +456,7 @@ update_flag
/obj/machinery/portable_atmospherics/canister/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/mecha_equipment/clamp))
return
- if(!attacking_item.iswrench() && !is_type_in_list(attacking_item, list(/obj/item/tank, /obj/item/device/analyzer, /obj/item/modular_computer)) && !issignaler(attacking_item) && !(attacking_item.iswirecutter() && signaler))
+ if(attacking_item.tool_behaviour != TOOL_WRENCH && !is_type_in_list(attacking_item, list(/obj/item/tank, /obj/item/device/analyzer, /obj/item/modular_computer)) && !issignaler(attacking_item) && (attacking_item.tool_behaviour != TOOL_WIRECUTTER && signaler))
if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)
return TRUE
visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [attacking_item]!"), SPAN_NOTICE("You hit \the [src] with \the [attacking_item]."))
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index cbfc2c77d6d..36ffb1000fe 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -142,7 +142,7 @@
return ..()
/obj/machinery/meter/attackby(obj/item/attacking_item, mob/user)
- if (!attacking_item.iswrench())
+ if(attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src]..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index aead7185779..3737b1c5c48 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -116,7 +116,7 @@
SStgui.update_uis(src)
return TRUE
- else if (attacking_item.iswrench())
+ else if (attacking_item.tool_behaviour == TOOL_WRENCH)
if(connected_port)
disconnect()
to_chat(user, SPAN_NOTICE("You disconnect \the [src] from the port."))
@@ -179,7 +179,7 @@
SStgui.update_uis(src)
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!cell)
to_chat(user, SPAN_WARNING("There is no power cell installed."))
return TRUE
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 692b1080330..9689d078f62 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -217,7 +217,7 @@
update_connected_network()
/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(on)
to_chat(user, SPAN_WARNING("Turn \the [src] off first!"))
return TRUE
@@ -231,7 +231,7 @@
//doesn't use power cells
if(istype(attacking_item, /obj/item/cell))
return TRUE
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
return TRUE
//doesn't hold tanks
@@ -244,7 +244,7 @@
name = "Stationary Air Scrubber"
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_WARNING("The bolts are too tight for you to unscrew!"))
return TRUE
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index c1537172578..8636220cccb 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -64,12 +64,12 @@
return 1
/obj/machinery/bot/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!locked)
open = !open
to_chat(user, SPAN_NOTICE("Maintenance panel is now [src.open ? "opened" : "closed"]."))
return TRUE
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(health < maxhealth)
if(open)
health = min(maxhealth, health+10)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index a16d1e20265..0e1477799fa 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -184,7 +184,7 @@
/obj/machinery/camera/attackby(obj/item/attacking_item, mob/user)
update_coverage()
// DECONSTRUCTION
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
//to_chat(user, SPAN_NOTICE("You start to [panel_open ? "close" : "open"] the camera's panel."))
//if(toggle_panel(user)) // No delay because no one likes screwdrivers trying to be hip and have a duration cooldown
panel_open = !panel_open
@@ -193,11 +193,11 @@
attacking_item.play_tool_sound(get_turf(src), 50)
return TRUE
- else if((attacking_item.iswirecutter() || attacking_item.ismultitool()) && panel_open)
+ else if((attacking_item.tool_behaviour == TOOL_WIRECUTTER || attacking_item.tool_behaviour == TOOL_MULTITOOL) && panel_open)
interact(user)
return TRUE
- else if(attacking_item.iswelder() && (wires.CanDeconstruct() || (stat & BROKEN)))
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && (wires.CanDeconstruct() || (stat & BROKEN)))
if(weld(attacking_item, user))
if(assembly)
assembly.forceMove(src.loc)
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index 6349a31de17..4b9aeb905e1 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -29,7 +29,7 @@
if(0)
// State 0
- if(attacking_item.iswrench() && isturf(src.loc))
+ if(attacking_item.tool_behaviour == TOOL_WRENCH && isturf(src.loc))
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You wrench the assembly into place.")
anchored = 1
@@ -40,14 +40,14 @@
if(1)
// State 1
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
if(weld(attacking_item, user))
to_chat(user, "You weld the assembly securely into place.")
anchored = 1
state = 2
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unattach the assembly from its place.")
anchored = 0
@@ -57,7 +57,7 @@
if(2)
// State 2
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(2))
to_chat(user, SPAN_NOTICE("You add wires to the assembly."))
@@ -66,7 +66,7 @@
to_chat(user, SPAN_WARNING("You need 2 coils of wire to wire the assembly."))
return TRUE
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(weld(attacking_item, user))
to_chat(user, "You unweld the assembly from its place.")
@@ -77,7 +77,7 @@
if(3)
// State 3
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
var/input = sanitize( tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Station,Security,Secret",
@@ -118,7 +118,7 @@
break
return TRUE
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
new/obj/item/stack/cable_coil(get_turf(src), 2)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
@@ -140,7 +140,7 @@
return
// Taking out upgrades
- else if(attacking_item.iscrowbar() && upgrades.len)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && upgrades.len)
var/obj/U = locate(/obj) in upgrades
if(U)
to_chat(user, "You unattach an upgrade from the assembly.")
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index d3e3e210b22..0113237d436 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -56,7 +56,7 @@
if(stat & BROKEN)
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(charging)
to_chat(user, SPAN_WARNING("Remove the cell first!"))
return TRUE
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index d1dbee70427..fe269c0ee37 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -238,7 +238,7 @@
user.drop_from_inventory(attacking_item, src)
qdel(attacking_item)
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(locked && (anchored || occupant))
to_chat(user, SPAN_WARNING("Can not do that while [src] is in use."))
else
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index 0fb7cafbc42..60a3ddf3f3c 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -16,13 +16,13 @@
switch(state)
if(0)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, SPAN_NOTICE("You wrench the frame into place."))
anchored = 1
state = 1
return TRUE
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, "The welder must be on for this task.")
@@ -34,7 +34,7 @@
qdel(src)
return TRUE
if(1)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, SPAN_NOTICE("You unfasten the frame."))
anchored = 0
@@ -47,13 +47,13 @@
circuit = attacking_item
user.drop_from_inventory(attacking_item,src)
return TRUE
- if(attacking_item.isscrewdriver() && circuit)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && circuit)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You screw the circuit board into place."))
state = 2
icon_state = "2"
return TRUE
- if(attacking_item.iscrowbar() && circuit)
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR && circuit)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the circuit board."))
state = 1
@@ -62,13 +62,13 @@
circuit = null
return TRUE
if(2)
- if(attacking_item.isscrewdriver() && circuit)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && circuit)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You unfasten the circuit board."))
state = 1
icon_state = "1"
return TRUE
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if (C.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need five coils of wire to add them to the frame."))
@@ -82,7 +82,7 @@
to_chat(user, SPAN_NOTICE("You add cables to the frame."))
return TRUE
if(3)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if (brain)
to_chat(user, "Get that brain out of there first")
else
@@ -151,7 +151,7 @@
icon_state = "3b"
return TRUE
- if(attacking_item.iscrowbar() && brain)
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR && brain)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the brain."))
brain.forceMove(loc)
@@ -160,7 +160,7 @@
return TRUE
if(4)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the glass panel."))
state = 3
@@ -171,7 +171,7 @@
new /obj/item/stack/material/glass/reinforced( loc, 2 )
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You connect the monitor."))
if(!brain)
@@ -235,7 +235,7 @@
else
to_chat(user, "ERROR: Unable to locate artificial intelligence.")
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] starts to unbolt \the [src] from the plating..."))
if(!attacking_item.use_tool(src, user, 40, volume = 50))
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 253526e9703..9225d538ecb 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -13,13 +13,13 @@
/obj/structure/computerframe/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(0)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, SPAN_NOTICE("You wrench the frame into place."))
src.anchored = 1
src.state = 1
return TRUE
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(0, user))
to_chat(user, "The welding tool must be on to complete this task.")
@@ -31,7 +31,7 @@
qdel(src)
return TRUE
if(1)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, SPAN_NOTICE("You unfasten the frame."))
src.anchored = 0
@@ -48,13 +48,13 @@
else
to_chat(user, SPAN_WARNING("This frame does not accept circuit boards of this type!"))
return TRUE
- if(attacking_item.isscrewdriver() && circuit)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && circuit)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You screw the circuit board into place and screw the drawer shut."))
src.state = 2
src.icon_state = "2"
return TRUE
- if(attacking_item.iscrowbar() && circuit)
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR && circuit)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the circuit board."))
src.state = 1
@@ -63,13 +63,13 @@
src.circuit = null
return TRUE
if(2)
- if(attacking_item.isscrewdriver() && circuit)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && circuit)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You unfasten the circuit board."))
src.state = 1
src.icon_state = "1"
return TRUE
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if (C.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need five coils of wire to add them to the frame."))
@@ -83,7 +83,7 @@
icon_state = "3"
return TRUE
if(3)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("You remove the cables."))
src.state = 2
@@ -106,14 +106,14 @@
src.icon_state = "4"
return TRUE
if(4)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the glass keyboard."))
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You connect the glass keyboard."))
var/B = new src.circuit.build_path ( src.loc )
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 751420ec77d..9269adfb313 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -174,7 +174,7 @@
return text
/obj/machinery/computer/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(circuit)
if(attacking_item.use_tool(src, user, 20, volume = 50))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
diff --git a/code/game/machinery/computer/slotmachine.dm b/code/game/machinery/computer/slotmachine.dm
index 83d79bc54a9..f7b8851e1e2 100644
--- a/code/game/machinery/computer/slotmachine.dm
+++ b/code/game/machinery/computer/slotmachine.dm
@@ -107,7 +107,7 @@
else
to_chat(user, SPAN_WARNING("This machine is only accepting coins!"))
return TRUE
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
if(balance > 0)
visible_message("[src] says, 'ERROR! Please empty the machine balance before altering paymode'") //Prevents converting coins into credits and vice versa
else
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 31293ab1ddf..75a8be83b85 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -83,14 +83,14 @@
/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(BLUEPRINT_STATE)
- if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/gun/energy/plasmacutter))
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/gun/energy/plasmacutter))
playsound(get_turf(src), 'sound/items/poster_ripped.ogg', 75, TRUE)
to_chat(user, SPAN_NOTICE("You decide to scrap the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
return TRUE
if(WIRING_STATE)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(C.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need five lengths of cable to add them to the blueprint."))
@@ -104,7 +104,7 @@
icon_state = "blueprint_1"
return TRUE
else
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You dismantle the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
@@ -150,7 +150,7 @@
to_chat(user, SPAN_WARNING("This blueprint does not accept circuit boards of this type!"))
return TRUE
else
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
playsound(get_turf(src), attacking_item.usesound, 50, TRUE, pitch_toggle)
to_chat(user, SPAN_NOTICE("You remove the cables."))
state = WIRING_STATE
@@ -161,7 +161,7 @@
return TRUE
if(COMPONENT_STATE)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
attacking_item.play_tool_sound(get_turf(src), 50)
state = CIRCUITBOARD_STATE
circuit.forceMove(get_turf(src))
@@ -180,7 +180,7 @@
icon_state = "blueprint_2"
return TRUE
else
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
var/component_check = TRUE
for(var/R in req_components)
if(req_components[R] > 0)
@@ -266,7 +266,7 @@
density = TRUE
/obj/machinery/constructable_frame/temp_deco/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
new /obj/item/stack/material/steel(get_turf(src), 5)
diff --git a/code/game/machinery/crusher_piston.dm b/code/game/machinery/crusher_piston.dm
index 64d6a60fa25..fef3a76b48b 100644
--- a/code/game/machinery/crusher_piston.dm
+++ b/code/game/machinery/crusher_piston.dm
@@ -104,7 +104,7 @@
//Stuff you can do if the maint hatch is open
if(panel_open)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You start [valve_open ? "closing" : "opening"] the pressure relief valve of [src]."))
if(attacking_item.use_tool(src, user, 50, volume = 50))
valve_open = !valve_open
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 0419fe5ec7d..b192ac6ff1a 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -57,7 +57,7 @@ Deployable Kits
visible_message(SPAN_WARNING("\The [src] is hit by \the [hitting_projectile]!"))
/obj/structure/blocker/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ishammer() && user.a_intent != I_HURT)
+ if(attacking_item.tool_behaviour == TOOL_HAMMER && user.a_intent != I_HURT)
var/obj/item/I = usr.get_inactive_hand()
if(I && istype(I, /obj/item/stack))
var/obj/item/stack/D = I
@@ -174,7 +174,7 @@ Deployable Kits
visible_message(SPAN_WARNING("BZZzZZzZZzZT"))
return
return
- else if (attacking_item.iswrench())
+ else if (attacking_item.tool_behaviour == TOOL_WRENCH)
if (src.health < src.maxhealth)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
src.health = src.maxhealth
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index dc87ec98d82..fa42a20d0be 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1493,7 +1493,7 @@ About the new airlock wires panel:
var/cut_sound
var/cutting = FALSE
- if(tool.iswelder())
+ if(tool.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = tool
if(!WT.isOn())
return
@@ -1760,7 +1760,7 @@ About the new airlock wires panel:
var/obj/item/device/magnetic_lock/newbracer = attacking_item
newbracer.attachto(src, user)
return TRUE
- if(!repairing && (attacking_item.iswelder() && !( src.operating > 0 ) && src.density))
+ if(!repairing && (attacking_item.tool_behaviour == TOOL_WELDER && !( src.operating > 0 ) && src.density))
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
@@ -1778,7 +1778,7 @@ About the new airlock wires panel:
welded = !welded
update_icon()
return TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if (src.p_open)
if (stat & BROKEN)
to_chat(user, SPAN_WARNING("The panel is broken and cannot be closed."))
@@ -1790,9 +1790,9 @@ About the new airlock wires panel:
to_chat(user, SPAN_NOTICE("You carefully unscrew the panel on \the [src]"))
src.update_icon()
return TRUE
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
return src.attack_hand(user)
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
return src.attack_hand(user)
else if(istype(attacking_item, /obj/item/device/assembly/signaler))
return src.attack_hand(user)
@@ -1802,7 +1802,7 @@ About the new airlock wires panel:
var/obj/item/pai_cable/cable = attacking_item
cable.plugin(src, user)
return TRUE
- else if(!repairing && attacking_item.iscrowbar())
+ else if(!repairing && attacking_item.tool_behaviour == TOOL_CROWBAR)
if(istype(attacking_item, /obj/item/melee/arm_blade))
if(arePowerSystemsOn() &&!(stat & BROKEN))
..()
@@ -1860,7 +1860,7 @@ About the new airlock wires panel:
else
to_chat(user, SPAN_WARNING("You need to be wielding \the [attacking_item] to do that."))
return TRUE
- else if(attacking_item.ishammer() && !arePowerSystemsOn())
+ else if(attacking_item.tool_behaviour == TOOL_HAMMER && !arePowerSystemsOn())
if(locked && user.a_intent != I_HURT)
to_chat(user, SPAN_NOTICE("The airlock's bolts prevent it from being forced."))
else if(locked && user.a_intent == I_HURT)
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index d99e5d2cbd8..82c27cb5bd1 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -139,7 +139,7 @@
return TRUE
- if(attacking_item.ishammer() || istype(attacking_item, /obj/item/crowbar/hydraulic_rescue_tool))
+ if(attacking_item.tool_behaviour == TOOL_HAMMER || istype(attacking_item, /obj/item/crowbar/hydraulic_rescue_tool))
if(((stat & NOPOWER) || (stat & BROKEN)) && !src.operating)
force_toggle()
else
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 7eaa51ab246..d59d6d28bc9 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -321,7 +321,7 @@
if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
- if(attacking_item.ishammer() && user.a_intent != I_HURT)
+ if(attacking_item.tool_behaviour == TOOL_HAMMER && user.a_intent != I_HURT)
var/obj/item/stack/stack = usr.get_inactive_hand()
if(istype(stack) && stack.get_material_name() == get_material_name())
if(stat & BROKEN)
@@ -354,7 +354,7 @@
return TRUE
- if(repairing && attacking_item.iswelder())
+ if(repairing && attacking_item.tool_behaviour == TOOL_WELDER)
if(!density)
to_chat(user, SPAN_WARNING("\The [src] must be closed before you can repair it."))
return TRUE
@@ -370,7 +370,7 @@
repairing = null
return TRUE
- if(repairing && attacking_item.iscrowbar())
+ if(repairing && attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("You remove \the [repairing]."))
attacking_item.play_tool_sound(get_turf(src), 50)
repairing.forceMove(user.loc)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 8a2c19fbe2d..190e6179b05 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -287,7 +287,7 @@
// Already doing something.
if(operating)
return TRUE
- if(attacking_item.iswelder() && !repairing)
+ if(attacking_item.tool_behaviour == TOOL_WELDER && !repairing)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
@@ -305,14 +305,14 @@
blocked = !blocked
update_icon()
return TRUE
- if(density && attacking_item.isscrewdriver())
+ if(density && attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
hatch_open = !hatch_open
user.visible_message(SPAN_DANGER("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance panel."),
"You have [hatch_open ? "opened" : "closed"] the [src] maintenance panel.")
update_icon()
return TRUE
- if(blocked && attacking_item.iscrowbar() && !repairing)
+ if(blocked && attacking_item.tool_behaviour == TOOL_CROWBAR && !repairing)
if(!hatch_open)
to_chat(user, SPAN_DANGER("You must open the maintenance panel first!"))
else
@@ -340,11 +340,11 @@
to_chat(user, SPAN_DANGER("\The [src] is welded shut!"))
return TRUE
- if(attacking_item.iscrowbar() || istype(attacking_item, /obj/item/material/twohanded/fireaxe) || attacking_item.ishammer())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR || istype(attacking_item, /obj/item/material/twohanded/fireaxe) || attacking_item.tool_behaviour == TOOL_HAMMER)
if(operating)
return TRUE
- if(blocked && attacking_item.iscrowbar())
+ if(blocked && attacking_item.tool_behaviour == TOOL_CROWBAR)
user.visible_message(SPAN_DANGER("\The [user] pries at \the [src] with \a [attacking_item], but \the [src] is welded in place!"),\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
@@ -359,7 +359,7 @@
"You start forcing \the [src] [density ? "open" : "closed"] with \the [attacking_item]!",\
"You hear metal strain.")
if(attacking_item.use_tool(src, user, 30, volume = 50))
- if(attacking_item.iscrowbar() || attacking_item.ishammer())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR || attacking_item.tool_behaviour == TOOL_HAMMER)
if(stat & (BROKEN|NOPOWER) || !density)
user.visible_message(SPAN_DANGER("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [attacking_item]!"),\
"You force \the [src] [density ? "open" : "closed"] with \the [attacking_item]!",\
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index 563979d3421..389b4c827df 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -16,7 +16,7 @@
icon_state = "door_construction"
/obj/structure/firedoor_assembly/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscoil() && !wired && anchored)
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL && !wired && anchored)
var/obj/item/stack/cable_coil/cable = attacking_item
if (cable.get_amount() < 1)
to_chat(user, SPAN_WARNING("You need one length of coil to wire \the [src]."))
@@ -27,7 +27,7 @@
wired = 1
to_chat(user, SPAN_NOTICE("You wire \the [src]."))
return TRUE
- else if(attacking_item.iswirecutter() && wired )
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER && wired )
user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].")
if(attacking_item.use_tool(src, user, 40, volume = 50))
@@ -47,14 +47,14 @@
else
to_chat(user, SPAN_WARNING("You must secure \the [src] first!"))
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
attacking_item.play_tool_sound(get_turf(src), 50)
user.visible_message(SPAN_WARNING("[user] has [anchored ? "" : "un" ]secured \the [src]!"),
"You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon()
return TRUE
- else if(!anchored && attacking_item.iswelder())
+ else if(!anchored && attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
user.visible_message(SPAN_WARNING("[user] dissassembles \the [src]."),
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index d396896dc09..6a0c4ea0ea2 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -182,7 +182,7 @@
return TRUE
//If it's emagged, crowbar can pry electronics out.
- if (emagged == 1 && attacking_item.iscrowbar())
+ if (emagged == 1 && attacking_item.tool_behaviour == TOOL_CROWBAR)
user.visible_message("[user] dismantles the windoor.", "You start to dismantle the windoor.")
if(attacking_item.use_tool(src, user, 60, volume = 50))
to_chat(user, SPAN_NOTICE("You dismantled the windoor!"))
@@ -194,7 +194,7 @@
qdel(src)
return TRUE
- if(isobj(attacking_item) && attacking_item.iscrowbar() && user.a_intent == I_HELP)
+ if(isobj(attacking_item) && attacking_item.tool_behaviour == TOOL_CROWBAR && user.a_intent == I_HELP)
if(!operable())
visible_message("\The [user] forces \the [src] [density ? "open" : "closed"].")
if(density)
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index a49f183b863..a86a6f76950 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -110,7 +110,7 @@
else
return TRUE
- if (attacking_item.isscrewdriver() && buildstage == 2)
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER && buildstage == 2)
if(!panel_open)
set_light(0)
panel_open = !panel_open
@@ -121,7 +121,7 @@
set_light(0)
switch(buildstage)
if(2)
- if (attacking_item.ismultitool())
+ if (attacking_item.tool_behaviour == TOOL_MULTITOOL)
src.detecting = !( src.detecting )
if (src.detecting)
user.visible_message(SPAN_NOTICE("\The [user] has reconnected [src]'s detecting unit!"),
@@ -132,7 +132,7 @@
SPAN_NOTICE("You have disconnected [src]'s detecting unit."))
return TRUE
- else if (attacking_item.iswirecutter())
+ else if (attacking_item.tool_behaviour == TOOL_WIRECUTTER)
user.visible_message(SPAN_NOTICE("\The [user] has cut the wires inside \the [src]!"),
SPAN_NOTICE("You have cut the wires inside \the [src]."))
@@ -142,7 +142,7 @@
update_icon()
return TRUE
if(1)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if (C.use(5))
to_chat(user, SPAN_NOTICE("You wire \the [src]."))
@@ -150,7 +150,7 @@
else
to_chat(user, SPAN_WARNING("You need 5 pieces of cable to wire \the [src]."))
return TRUE
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, "You pry out the circuit!")
attacking_item.play_tool_sound(get_turf(src), 50)
var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics()
@@ -165,7 +165,7 @@
buildstage = 1
update_icon()
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/frame/fire_alarm(get_turf(user))
attacking_item.play_tool_sound(get_turf(src), 50)
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 74e0ad04513..809cef371f7 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/attacking_item, mob/user)
- if (attacking_item.iswirecutter())
+ if (attacking_item.tool_behaviour == TOOL_WIRECUTTER)
add_fingerprint(user)
src.disable = !src.disable
if (src.disable)
@@ -110,7 +110,7 @@
src.flash()
/obj/machinery/flasher/portable/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
add_fingerprint(user)
src.anchored = !src.anchored
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 59f9384a61c..9bc90e40e1c 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -105,7 +105,7 @@
update_icon()
/obj/machinery/floodlight/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!open)
unlocked = !unlocked
var/msg = unlocked ? "You unscrew the battery panel." : "You screw the battery panel into place."
@@ -113,7 +113,7 @@
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is open and cannot be screwed down!"))
return TRUE
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(unlocked)
open = !open
var/msg = open ? "You remove the battery panel." : "You crowbar the battery panel into place."
diff --git a/code/game/machinery/floor_frames.dm b/code/game/machinery/floor_frames.dm
index 32d39cdfb92..303cfd77544 100644
--- a/code/game/machinery/floor_frames.dm
+++ b/code/game/machinery/floor_frames.dm
@@ -15,7 +15,7 @@
. += "It could be installed by using it on an adjacent floor."
/obj/item/floor_frame/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
new refund_type(get_turf(src.loc), refund_amt)
qdel(src)
return TRUE
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index 3f1f73e17a7..3bf59fb5e30 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -23,12 +23,12 @@
anchored = 1
/obj/machinery/floor_light/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
anchored = !anchored
visible_message(SPAN_NOTICE("\The [user] has [anchored ? "attached" : "detached"] \the [src]."))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
return TRUE
- else if(attacking_item.iswelder() && (damaged || (stat & BROKEN)))
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && (damaged || (stat & BROKEN)))
var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(0, user))
to_chat(user, SPAN_WARNING("\The [src] must be on to complete this task."))
@@ -45,7 +45,7 @@
return TRUE
else if(attacking_item.force && user.a_intent == "hurt")
return attack_hand(user)
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(anchored)
to_chat(user, SPAN_WARNING("\The [src] must be unfastened from the [loc] first!"))
return TRUE
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index 41d7b9a7109..a0f46e64039 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -48,7 +48,7 @@
user.visible_message("[user] has [!on ? "de" : ""]activated \the [src].", SPAN_NOTICE("You [!on ? "de" : ""]activate \the [src]."))
/obj/machinery/floorlayer/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
var/m = tgui_input_list(user, "Choose work mode", "Mode", mode)
mode[m] = !mode[m]
var/O = mode[m]
@@ -61,7 +61,7 @@
take_tile(attacking_item)
return TRUE
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!length(contents))
to_chat(user, SPAN_NOTICE("\The [src] is empty."))
else
@@ -72,7 +72,7 @@
T = null
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
T = tgui_input_list(user, "Choose which set of tiles you want \the [src] to lay.", "Tiles", contents)
return TRUE
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index a0911618a48..4eb7b03d290 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -102,7 +102,7 @@
update_icon()
/obj/machinery/sparker/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
add_fingerprint(user)
disable = !disable
if(disable)
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 9f85f46503d..290094a690a 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -485,7 +485,7 @@
user.visible_message(SPAN_NOTICE("[user] places \the [attacking_item] in \the [src]."), SPAN_NOTICE("You place \the [attacking_item] in \the [src]."))
update_icon()
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!tank)
to_chat(user, "There isn't a tank installed for you to secure!")
return TRUE
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index e9701cc66bc..32df2077c22 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -123,7 +123,7 @@
if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(music_player?.playing)
StopPlaying()
user.visible_message(SPAN_WARNING("[user] has [anchored ? "un" : ""]secured \the [src]."), "You [anchored ? "un" : ""]secure \the [src].")
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 24062854376..4142a860a4b 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -362,7 +362,7 @@ Class Procs:
user.visible_message("[user] attaches \the [S] to \the [src].", SPAN_NOTICE("You attach \the [S] to \the [src]."), range = 3)
log_and_message_admins("has attached a signaler to \the [src].", user, get_turf(src))
return TRUE
- else if(attacking_item.iswirecutter() && signaler)
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER && signaler)
user.visible_message("[user] removes \the [signaler] from \the [src].", SPAN_NOTICE("You remove \the [signaler] from \the [src]."), range = 3)
user.put_in_hands(detach_signaler())
return TRUE
@@ -454,14 +454,14 @@ Class Procs:
return 0
/obj/machinery/proc/default_deconstruction_crowbar(var/mob/user, var/obj/item/C)
- if(!istype(C) || !C.iscrowbar())
+ if(!istype(C) || C.tool_behaviour != TOOL_CROWBAR)
return 0
if(!panel_open)
return 0
. = dismantle()
/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
- if(!istype(S) || !S.isscrewdriver())
+ if(!istype(S) || S.tool_behaviour != TOOL_SCREWDRIVER)
return FALSE
S.play_tool_sound(get_turf(src), 50)
panel_open = !panel_open
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 6f7fd148077..0bea75b922b 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -55,7 +55,7 @@
/obj/machinery/mass_driver/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!anchored)
attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] secures [src] to the floor.", \
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index b42818962dc..1eba164b4ce 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -134,7 +134,7 @@
if(!T.is_plating())
return // prevent intraction when T-scanner revealed
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
open = !open
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
@@ -142,7 +142,7 @@
update_icon()
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!open || locked)
to_chat(user, SPAN_NOTICE("You need to have the maintenance panel open and the controls unlocked to remove the bolts."))
return
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index 6e5a22ad475..6c40f26d745 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -1093,7 +1093,7 @@ GLOBAL_LIST_INIT_TYPED(allCasters, /obj/machinery/newscaster, list())
/obj/item/newspaper/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
if(rolled)
user.visible_message(SPAN_NOTICE("\The [user] unrolls \the [src] to write on it."),\
SPAN_NOTICE("You unroll \the [src] to write on it."))
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index 7d7e136275d..ecf933ddae3 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -46,7 +46,7 @@ GLOBAL_VAR(bomb_set)
return
/obj/machinery/nuclearbomb/attackby(obj/item/attacking_item, mob/user, params)
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
src.add_fingerprint(user)
if (src.auth)
if (panel_open == 0)
@@ -70,7 +70,7 @@ GLOBAL_VAR(bomb_set)
flick("lock", src)
return TRUE
- if (panel_open && (attacking_item.ismultitool() || attacking_item.iswirecutter()))
+ if (panel_open && (attacking_item.tool_behaviour == TOOL_MULTITOOL || attacking_item.tool_behaviour == TOOL_WIRECUTTER))
return attack_hand(user)
if (src.extended)
@@ -83,7 +83,7 @@ GLOBAL_VAR(bomb_set)
if (src.anchored)
switch(removal_stage)
if(0)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn()) return TRUE
if (WT.get_fuel() < 5) // uses up 5 fuel.
@@ -99,7 +99,7 @@ GLOBAL_VAR(bomb_set)
return TRUE
if(1)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [attacking_item]...")
if(attacking_item.use_tool(src, user, 15, volume = 50))
@@ -109,7 +109,7 @@ GLOBAL_VAR(bomb_set)
return TRUE
if(2)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn()) return TRUE
if (WT.get_fuel() < 5) // uses up 5 fuel.
@@ -124,7 +124,7 @@ GLOBAL_VAR(bomb_set)
return TRUE
if(3)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
if(attacking_item.use_tool(src, user, 50, volume = 50))
@@ -134,7 +134,7 @@ GLOBAL_VAR(bomb_set)
return TRUE
if(4)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
if(attacking_item.use_tool(src, user, 80, volume = 50))
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index ce426d10b38..5da8708081a 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -507,7 +507,7 @@
/obj/item/pipe/attackby(obj/item/attacking_item, mob/user)
..()
//*
- if (!attacking_item.iswrench() && !istype(attacking_item, /obj/item/pipewrench))
+ if (attacking_item.tool_behaviour != TOOL_WRENCH && !istype(attacking_item, /obj/item/pipewrench))
return ..()
if(istype(attacking_item, /obj/item/pipewrench))
var/action = tgui_input_list(user, "Change pipe?", "Change pipe", list("Yes", "No"), "No")
@@ -1543,7 +1543,7 @@
w_class = WEIGHT_CLASS_BULKY
/obj/item/pipe_meter/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
to_chat(user, SPAN_WARNING("You need to fasten it to a pipe"))
return 1
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index efad3d289cd..fcbae191325 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -127,7 +127,7 @@
user.remove_from_mob(attacking_item) //Catches robot gripper duplication
qdel(attacking_item)
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(anchored)
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src] from the floor..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 642e9b18411..5a356a181c6 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -358,7 +358,7 @@
/obj/machinery/porta_turret/attackby(obj/item/attacking_item, mob/user)
if(stat & BROKEN)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
to_chat(user, SPAN_NOTICE("You begin prying the metal coverings off."))
@@ -377,7 +377,7 @@
qdel(src) // qdel
return TRUE
- else if((attacking_item.iswrench()))
+ else if((attacking_item.tool_behaviour == TOOL_WRENCH))
if (immobile)
to_chat(user, SPAN_NOTICE("[src] is firmly attached to the ground with some form of epoxy."))
return TRUE
@@ -413,7 +413,7 @@
wrenching = 0
return TRUE
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if (!WT.welding)
to_chat(user, SPAN_DANGER("\The [WT] must be turned on!"))
@@ -891,7 +891,7 @@
//this is a bit unwieldy but self-explanatory
switch(build_step)
if(0) //first step
- if(attacking_item.iswrench() && !anchored)
+ if(attacking_item.tool_behaviour == TOOL_WRENCH && !anchored)
attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, SPAN_NOTICE("You secure the external bolts."))
anchored = 1
@@ -899,7 +899,7 @@
icon_state = "turret_frame_1_[case_sprite_set]"
return TRUE
- else if(attacking_item.iscrowbar() && !anchored)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && !anchored)
attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You dismantle the turret construction."))
new /obj/item/stack/material/steel( loc, 5)
@@ -917,7 +917,7 @@
to_chat(user, SPAN_WARNING("You need two sheets of metal to continue construction."))
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You unfasten the external bolts."))
anchored = 0
@@ -927,14 +927,14 @@
if(2)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, SPAN_NOTICE("You bolt the metal armor into place."))
build_step = 3
icon_state = "turret_frame_3_[case_sprite_set]"
return TRUE
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return TRUE
@@ -970,7 +970,7 @@
AddOverlays("turret_[E.turret_sprite_set]_off")
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, SPAN_NOTICE("You remove the turret's metal armor bolts."))
build_step = 2
@@ -990,7 +990,7 @@
//attack_hand() removes the gun
if(5)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 100)
build_step = 6
to_chat(user, SPAN_NOTICE("You close the access hatch."))
@@ -1015,7 +1015,7 @@
to_chat(user, SPAN_WARNING("You need two sheets of metal to continue construction."))
return TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 100)
build_step = 5
to_chat(user, SPAN_NOTICE("You open the access hatch."))
@@ -1025,7 +1025,7 @@
return TRUE
if(7)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn()) return
if(WT.get_fuel() < 5)
@@ -1072,7 +1072,7 @@
qdel(src) // qdel
return TRUE
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You pry off the turret's exterior armor."))
new /obj/item/stack/material/steel(loc, 2)
@@ -1083,7 +1083,7 @@
AddOverlays("turret_frame_5c_[case_sprite_set]")
return TRUE
- if(attacking_item.ispen()) //you can rename turrets like bots!
+ if(attacking_item.tool_behaviour == TOOL_PEN) //you can rename turrets like bots!
var/t = sanitizeSafe(input(user, "Enter new turret name", name, finish_name) as text, MAX_NAME_LEN)
if(t && in_range(src, usr) && loc != usr)
finish_name = t
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index 42aae1adc69..5066894e4a3 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -59,7 +59,7 @@
qdel(bar)
/obj/machinery/recharger/attackby(obj/item/attacking_item, mob/user)
- if(portable && attacking_item.iswrench())
+ if(portable && attacking_item.tool_behaviour == TOOL_WRENCH)
if(charging)
to_chat(user, SPAN_WARNING("You can't modify \the [src] while it has something charging inside."))
return TRUE
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 268a850cb81..ecc1064beea 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -82,7 +82,7 @@
else
to_chat(user, SPAN_NOTICE("The hatch must be open to insert a power cell."))
return TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
user.visible_message(SPAN_NOTICE("[user] [panel_open ? "opens" : "closes"] the hatch on the [src]."),
SPAN_NOTICE("You [panel_open ? "open" : "close"] the hatch on the [src]."))
diff --git a/code/game/machinery/stasis_cage.dm b/code/game/machinery/stasis_cage.dm
index 03be25b4396..cb5753ce371 100644
--- a/code/game/machinery/stasis_cage.dm
+++ b/code/game/machinery/stasis_cage.dm
@@ -140,7 +140,7 @@
/obj/machinery/stasis_cage/attackby(obj/item/attacking_item, mob/user)
. = ..()
// Crowbar - Pry thing out of cage
- if (attacking_item.iscrowbar())
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR)
if (panel_open)
to_chat(user, SPAN_NOTICE("\The [src]'s panel is open!"))
return TRUE
@@ -163,7 +163,7 @@
return TRUE
// Wrench - Repair lid
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
if (broken)
user.visible_message(SPAN_NOTICE("\The [user] begins to clamp \the [src]'s lid back into position."), SPAN_NOTICE("You begin to clamp \the [src]'s lid back into position."))
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
@@ -175,7 +175,7 @@
return TRUE
// Screwdriver - Open panel
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "unscrew" : "screw shut"] the maintainance panel of \the [src]"))
diff --git a/code/game/machinery/suit_cycler.dm b/code/game/machinery/suit_cycler.dm
index 06bdbe49bbc..4c8863d20a3 100644
--- a/code/game/machinery/suit_cycler.dm
+++ b/code/game/machinery/suit_cycler.dm
@@ -244,7 +244,7 @@
update_icon()
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "open" : "close"] the maintenance panel."))
updateUsrDialog()
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 94147965514..76352467853 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -471,7 +471,7 @@
/obj/machinery/suit_storage_unit/attackby(obj/item/attacking_item, mob/user)
if(!src.ispowered)
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
src.panelopen = !src.panelopen
attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, SPAN_NOTICE("You [src.panelopen ? "open up" : "close"] the unit's maintenance panel."))
diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm
index 0d5d9d80192..ade899eb797 100644
--- a/code/game/machinery/supplybeacon.dm
+++ b/code/game/machinery/supplybeacon.dm
@@ -44,7 +44,7 @@
drop_type = "supermatter"
/obj/machinery/power/supply_beacon/attackby(obj/item/attacking_item, mob/user)
- if(!use_power && attacking_item.iswrench())
+ if(!use_power && attacking_item.tool_behaviour == TOOL_WRENCH)
if(!anchored && !connect_to_network())
to_chat(user, SPAN_WARNING("This device must be placed over an exposed cable."))
return TRUE
diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm
index a22f7229b5a..94be759c67f 100644
--- a/code/game/machinery/telecomms/computers/logbrowser.dm
+++ b/code/game/machinery/telecomms/computers/logbrowser.dm
@@ -148,7 +148,7 @@
return
/obj/machinery/computer/telecomms/server/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(attacking_item.use_tool(src, user, 20, volume = 50))
if (src.stat & BROKEN)
to_chat(user, SPAN_NOTICE("The broken glass falls out."))
diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm
index c65a2f54c6c..e2e9ff57d49 100644
--- a/code/game/machinery/telecomms/computers/message.dm
+++ b/code/game/machinery/telecomms/computers/message.dm
@@ -58,7 +58,7 @@
return ..()
if(!istype(user))
return TRUE
- if(attacking_item.isscrewdriver() && emag)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && emag)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
to_chat(user, SPAN_WARNING("It is too hot to mess with!"))
return TRUE
diff --git a/code/game/machinery/telecomms/computers/telemonitor.dm b/code/game/machinery/telecomms/computers/telemonitor.dm
index 2e0e10629a3..cebc0c1f9dd 100644
--- a/code/game/machinery/telecomms/computers/telemonitor.dm
+++ b/code/game/machinery/telecomms/computers/telemonitor.dm
@@ -125,7 +125,7 @@
return
/obj/machinery/computer/telecomms/monitor/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(attacking_item.use_tool(src, user, 20, volume = 50))
if (src.stat & BROKEN)
to_chat(user, SPAN_NOTICE("The broken glass falls out."))
diff --git a/code/game/machinery/telecomms/computers/traffic_control.dm b/code/game/machinery/telecomms/computers/traffic_control.dm
index 0cf7350deb2..f392eb3a4f0 100644
--- a/code/game/machinery/telecomms/computers/traffic_control.dm
+++ b/code/game/machinery/telecomms/computers/traffic_control.dm
@@ -202,7 +202,7 @@
return
/obj/machinery/computer/telecomms/traffic/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(attacking_item.use_tool(src, user, 20, volume = 50))
if (src.stat & BROKEN)
to_chat(user, SPAN_NOTICE("The broken glass falls out."))
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 9420f1051e0..59c71321bcc 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -7,7 +7,7 @@
/obj/machinery/telecomms/attackby(obj/item/attacking_item, mob/user)
// Using a multitool lets you access the receiver's interface
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
user.set_machine(src)
interact(user, attacking_item)
return TRUE
@@ -37,29 +37,29 @@
switch(construct_op)
if(0)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You unfasten the bolts."))
attacking_item.play_tool_sound(get_turf(src), 50)
construct_op ++
. = TRUE
if(1)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You fasten the bolts."))
attacking_item.play_tool_sound(get_turf(src), 50)
construct_op --
. = TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You dislodge the external plating."))
attacking_item.play_tool_sound(get_turf(src), 75)
construct_op ++
. = TRUE
if(2)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You secure the external plating."))
attacking_item.play_tool_sound(get_turf(src), 75)
construct_op --
. = TRUE
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the cables."))
construct_op ++
@@ -68,7 +68,7 @@
stat |= BROKEN // the machine's been borked!
. = TRUE
if(3)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/A = attacking_item
if (A.use(5))
to_chat(user, SPAN_NOTICE("You insert the cables."))
@@ -77,7 +77,7 @@
else
to_chat(user, SPAN_WARNING("You need five coils of wire for this."))
. = TRUE
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("You begin prying out the circuit board's components..."))
if(attacking_item.use_tool(src, user, 60, volume = 50))
to_chat(user, SPAN_NOTICE("You finish prying out the components."))
@@ -97,7 +97,7 @@
newpath = text2path(component)
var/obj/item/s = new newpath
s.forceMove(user.loc)
- if(s.iscoil())
+ if(s.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/A = s
A.amount = 1
diff --git a/code/game/machinery/tesla_beacon.dm b/code/game/machinery/tesla_beacon.dm
index 62657d7adc8..a9b41ff6009 100644
--- a/code/game/machinery/tesla_beacon.dm
+++ b/code/game/machinery/tesla_beacon.dm
@@ -52,7 +52,7 @@
return
/obj/machinery/power/tesla_beacon/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(active)
to_chat(user, SPAN_WARNING("You need to deactivate \the [src] first!"))
return TRUE
diff --git a/code/game/machinery/vending/_vending.dm b/code/game/machinery/vending/_vending.dm
index 275e32d690d..ac27f1f9c51 100644
--- a/code/game/machinery/vending/_vending.dm
+++ b/code/game/machinery/vending/_vending.dm
@@ -418,14 +418,14 @@
if (I || istype(attacking_item, /obj/item/spacecash))
return attack_hand(user)
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
src.panel_open = !src.panel_open
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
ClearOverlays()
if(src.panel_open)
AddOverlays("[initial(icon_state)]-panel")
return TRUE
- else if(attacking_item.ismultitool()||attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL||attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(src.panel_open)
return attack_hand(user)
return TRUE
@@ -439,7 +439,7 @@
to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
SStgui.update_uis(src)
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!can_move)
return TRUE
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index 74d0a4c41cd..85f031665f7 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -14,7 +14,7 @@
. += "It could be installed by using it on an adjacent wall."
/obj/item/frame/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
new refund_type( get_turf(src.loc), refund_amt)
qdel(src)
return TRUE
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 60b3a032be4..4e4a31c18e5 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -113,7 +113,7 @@
state = 3
else
return ..()
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(anchored)
to_chat(user, SPAN_NOTICE("You lean down and unwrench \the [src]."))
anchored = FALSE
diff --git a/code/game/objects/effects/burnt_wall.dm b/code/game/objects/effects/burnt_wall.dm
index 0225ece8842..f54afe35233 100644
--- a/code/game/objects/effects/burnt_wall.dm
+++ b/code/game/objects/effects/burnt_wall.dm
@@ -17,7 +17,7 @@
alpha = 125
/obj/effect/overlay/burnt_wall/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return TRUE
diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm
index d9f2bd8ab2e..41c80fa3d48 100644
--- a/code/game/objects/effects/decals/contraband.dm
+++ b/code/game/objects/effects/decals/contraband.dm
@@ -127,7 +127,7 @@
icon_state = design.icon_state
/obj/structure/sign/poster/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
if(ruined)
to_chat(user, SPAN_NOTICE("You remove the remnants of the poster."))
diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm
index fbcf8d4e8df..384f0507e1c 100644
--- a/code/game/objects/effects/spiders.dm
+++ b/code/game/objects/effects/spiders.dm
@@ -24,7 +24,7 @@
/obj/effect/spider/attackby(obj/item/attacking_item, mob/user)
visible_message(SPAN_WARNING("\The [src] has been [LAZYPICK(attacking_item.attack_verb, "attacked")] with [attacking_item][(user ? " by [user]." : ".")]"))
var/damage = attacking_item.force / 4.0
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
damage = 15
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index f6a5c58f4d9..778d0c99a92 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -235,11 +235,14 @@
/// Holder var for the item outline filter, null when no outline filter on the item.
var/outline_filter
- // Persistency
- // Set this to true if you want the item to become persistent trash
- // Requires the usual implementation requirements for new persistent types but provides a single implementation for trash logic
+ /// Persistency
+ /// Set this to true if you want the item to become persistent trash
+ /// Requires the usual implementation requirements for new persistent types but provides a single implementation for trash logic
var/persistency_considered_trash = FALSE
+ /// How a tool acts when you use it on something, such as wirecutters cutting wires while multitools measure power
+ var/tool_behaviour = null
+
/obj/item/Initialize(mapload, ...)
. = ..()
if(islist(armor))
@@ -732,7 +735,7 @@ GLOBAL_LIST_INIT(slot_flags_enumeration, list(
if(!disable_warning)
to_chat(usr, SPAN_WARNING("You somehow have a suit with no defined allowed items for suit storage, stop that."))
return 0
- if(!istype(src, /obj/item/modular_computer) && !ispen() && !is_type_in_list(src, H.wear_suit.allowed))
+ if(!istype(src, /obj/item/modular_computer) && tool_behaviour == TOOL_PEN && !is_type_in_list(src, H.wear_suit.allowed))
return 0
if(slot_handcuffed)
if(!istype(src, /obj/item/handcuffs))
diff --git a/code/game/objects/items/airbubble.dm b/code/game/objects/items/airbubble.dm
index 30faaabf0b3..47ff02b8a80 100644
--- a/code/game/objects/items/airbubble.dm
+++ b/code/game/objects/items/airbubble.dm
@@ -446,7 +446,7 @@
qdel(attacking_item)
update_icon()
return TRUE
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(!zipped)
to_chat(user, SPAN_WARNING("[src] has no cables to cut."))
attack_hand(user)
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index 37ec6d94256..740b4de346b 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -8,7 +8,7 @@
obj_flags = OBJ_FLAG_CONDUCTABLE
/obj/item/frame/apc/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
new /obj/item/stack/material/steel( get_turf(src.loc), 2 )
qdel(src)
return TRUE
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 953ea2b864b..66f5db7ad4e 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -77,7 +77,7 @@
can_be_buckled = TRUE
/obj/structure/closet/body_bag/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.ispen())
+ if (attacking_item.tool_behaviour == TOOL_PEN)
var/t = tgui_input_text(user, "What would you like the label to be?", name)
if (user.get_active_hand() != attacking_item)
return TRUE
@@ -92,7 +92,7 @@
else
src.name = "body bag"
return TRUE
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "You cut the tag off the bodybag.")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
src.name = "body bag"
diff --git a/code/game/objects/items/canvas.dm b/code/game/objects/items/canvas.dm
index 5deeaa47715..6f7dd7e0950 100644
--- a/code/game/objects/items/canvas.dm
+++ b/code/game/objects/items/canvas.dm
@@ -50,7 +50,7 @@
* One pixel increments.
*/
/obj/item/canvas/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You begin to [anchored ? "loosen" : "tighten"] \the [src]..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("[user] [anchored ? "loosens" : "tightens"] \the [src].", SPAN_NOTICE("You [anchored ? "loosen" : "tighten"] \the [src]."), SPAN_NOTICE("You hear a ratchet."))
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index 6c41ae9f35d..50a9ffa59a0 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -129,7 +129,7 @@
to_chat(user, SPAN_NOTICE("You install a cell in \the [src]."))
update_icon()
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(bcell)
bcell.update_icon()
bcell.dropInto(loc)
diff --git a/code/game/objects/items/devices/auto_cpr.dm b/code/game/objects/items/devices/auto_cpr.dm
index c3d85f8fe1e..87b87d4e319 100644
--- a/code/game/objects/items/devices/auto_cpr.dm
+++ b/code/game/objects/items/devices/auto_cpr.dm
@@ -199,7 +199,7 @@
return ..()
/obj/item/auto_cpr/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.get_inventory_slot(src) == slot_wear_suit)
@@ -211,7 +211,7 @@
return TRUE
if(panel_open)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!tank)
to_chat(user, "There isn't a tank to remove!")
return TRUE
@@ -221,7 +221,7 @@
tank = null
update_icon()
return TRUE
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!battery)
to_chat(user, "There isn't a battery to remove!")
return TRUE
diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm
index ae5b65b8511..56fa133ed6e 100644
--- a/code/game/objects/items/devices/hacktool.dm
+++ b/code/game/objects/items/devices/hacktool.dm
@@ -30,7 +30,7 @@
return ..()
/obj/item/device/multitool/hacktool/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
in_hack_mode = !in_hack_mode
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, TRUE)
return TRUE
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index ed1a047249a..211ef54f721 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -50,7 +50,7 @@
to_chat(user, SPAN_NOTICE("[src] already has a laser diode."))
return TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(diode)
to_chat(user, SPAN_NOTICE("You remove the [diode.name] from the [src]."))
diode.forceMove(get_turf(user))
diff --git a/code/game/objects/items/devices/magnetic_lock.dm b/code/game/objects/items/devices/magnetic_lock.dm
index ca0df878625..dfedceabdda 100644
--- a/code/game/objects/items/devices/magnetic_lock.dm
+++ b/code/game/objects/items/devices/magnetic_lock.dm
@@ -174,7 +174,7 @@
update_icon()
return TRUE
- if (attacking_item.iswelder())
+ if (attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if (WT.use(2, user))
user.visible_message(SPAN_NOTICE("[user] starts welding the metal shell of [src]."), SPAN_NOTICE("You start [hacked ? "repairing" : "welding open"] the metal covering of [src]."))
@@ -191,7 +191,7 @@
update_icon()
return TRUE
- if (attacking_item.iscrowbar())
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR)
if (!locked)
to_chat(user, SPAN_NOTICE("You pry the cover off [src]."))
setconstructionstate(1)
@@ -205,19 +205,19 @@
to_chat(user, SPAN_NOTICE("There's already a powercell in \the [src]."))
return TRUE
- if (attacking_item.iscrowbar())
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("You wedge the cover back in place."))
setconstructionstate(0)
return TRUE
if (2)
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You unscrew and remove the wiring cover from \the [src]."))
attacking_item.play_tool_sound(get_turf(src), 50)
setconstructionstate(3)
return TRUE
- if (attacking_item.iscrowbar())
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("You wedge the cover back in place."))
setconstructionstate(0)
return TRUE
@@ -231,20 +231,20 @@
return TRUE
if (3)
- if (attacking_item.iswirecutter())
+ if (attacking_item.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, SPAN_NOTICE("You cut the wires connecting the [src]'s magnets to their internal powersupply, [target ? "making the device fall off [target] and rendering it unusable." : "rendering the device unusable."]"))
playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1)
setconstructionstate(4)
return TRUE
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You replace and screw tight the wiring cover from \the [src]."))
attacking_item.play_tool_sound(get_turf(src), 50)
setconstructionstate(2)
return TRUE
if (4)
- if (attacking_item.iswirecutter())
+ if (attacking_item.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, SPAN_NOTICE("You repair the wires connecting the [src]'s magnets to their internal powersupply"))
setconstructionstate(3)
return TRUE
diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm
index 1376c956b7c..62ad61e4a1c 100644
--- a/code/game/objects/items/devices/multitool.dm
+++ b/code/game/objects/items/devices/multitool.dm
@@ -34,6 +34,8 @@
var/datum/integrated_io/selected_io = null
var/mode = 0
+ tool_behaviour = TOOL_MULTITOOL
+
/obj/item/device/multitool/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "You can use this on a variety of objects (including APCs, airlocks and more) to try to hack them without cutting wires."
@@ -47,9 +49,6 @@
QDEL_NULL(apc_indicator)
return ..()
-/obj/item/device/multitool/ismultitool()
- return TRUE
-
/obj/item/device/multitool/proc/get_buffer(var/typepath)
// Only allow clearing the buffer name when someone fetches the buffer.
// Means you cannot be sure the source hasn't been destroyed until the very moment it's needed.
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index 56cab775a16..00fba934939 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -71,7 +71,7 @@
else
to_chat(user, SPAN_WARNING("\The [src] would not gain any new channels from \the [EK]."))
return TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!length(installed_encryptionkeys))
to_chat(user, SPAN_WARNING("There are no installed encryption keys to remove!"))
return
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index e8545dac9f8..0fc172c18e5 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -48,7 +48,7 @@
return ..()
/obj/item/device/powersink/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(mode == 0)
var/turf/T = loc
if(isturf(T) && !!T.is_plating())
diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm
index 8d815679736..5c95b7bd12c 100644
--- a/code/game/objects/items/devices/radio/beacon.dm
+++ b/code/game/objects/items/devices/radio/beacon.dm
@@ -34,7 +34,7 @@ GLOBAL_LIST_EMPTY(teleportbeacons)
return null
/obj/item/device/radio/beacon/attackby(obj/item/attacking_item, mob/user)
- if(isturf(loc) && attacking_item.isscrewdriver())
+ if(isturf(loc) && attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
anchored = !anchored
user.visible_message("[user] [anchored ? "" : "un"]fastens \the [src] [anchored ? "to" : "from"] the floor.", "You [anchored ? "" : "un"]fasten \the [src] [anchored ? "to" : "from"] the floor.")
return
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index a9e0415cce4..21dfbb9e4af 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -108,7 +108,7 @@
..()
/obj/item/device/radio/headset/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(keyslot1 || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, radiochannels[ch_name])
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 289d5b2c9de..c6ffdd6cc41 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -547,7 +547,7 @@ var/global/list/default_interrogation_channels = list(
/obj/item/device/radio/attackby(obj/item/attacking_item, mob/user)
..()
user.set_machine(src)
- if (!( attacking_item.isscrewdriver() ))
+ if (!( attacking_item.tool_behaviour == TOOL_SCREWDRIVER ))
return
b_stat = !( b_stat )
if(!istype(src, /obj/item/device/radio/beacon))
@@ -602,10 +602,10 @@ var/global/list/default_interrogation_channels = list(
/obj/item/device/radio/borg/attackby(obj/item/attacking_item, mob/user)
// ..()
user.set_machine(src)
- if (!( attacking_item.isscrewdriver() || (istype(attacking_item, /obj/item/device/encryptionkey/ ))))
+ if (!( attacking_item.tool_behaviour == TOOL_SCREWDRIVER || (istype(attacking_item, /obj/item/device/encryptionkey/ ))))
return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(keyslot)
diff --git a/code/game/objects/items/devices/radio_jammer.dm b/code/game/objects/items/devices/radio_jammer.dm
index 72fceba8a78..e96be1831ff 100644
--- a/code/game/objects/items/devices/radio_jammer.dm
+++ b/code/game/objects/items/devices/radio_jammer.dm
@@ -140,7 +140,7 @@ GLOBAL_LIST_INIT_TYPED(active_radio_jammers, /obj/item/device/radiojammer, list(
/obj/item/device/radiojammer/improvised/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You disassemble the improvised signal jammer."))
user.put_in_hands(assembly_holder)
assembly_holder.detached()
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
index ec353217649..bf78d345011 100644
--- a/code/game/objects/items/devices/spy_bug.dm
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -49,7 +49,7 @@
var/obj/item/device/spy_monitor/SM = attacking_item
SM.pair(src, user)
return TRUE
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
var/n_tag = sanitizeSafe( tgui_input_text(user, "What would you like to label the camera?", "Bug Labelling", default = camera.c_tag, max_length = MAX_NAME_LEN), MAX_NAME_LEN )
if(Adjacent(user) && user.stat == CONSCIOUS && n_tag)
camera.c_tag = n_tag
diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm
index 3e59deae339..1979c800bbf 100644
--- a/code/game/objects/items/devices/suit_cooling.dm
+++ b/code/game/objects/items/devices/suit_cooling.dm
@@ -179,7 +179,7 @@
to_chat(user, SPAN_NOTICE("You switch on \the [src]."))
/obj/item/device/suit_cooling_unit/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(cover_open)
cover_open = FALSE
to_chat(user, SPAN_NOTICE("You screw the panel into place."))
diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm
index 86f04ac3365..ea8d7947e9c 100644
--- a/code/game/objects/items/devices/tvcamera.dm
+++ b/code/game/objects/items/devices/tvcamera.dm
@@ -116,7 +116,7 @@ Using robohead because of restricting to roboticist */
desc = "This TV camera assembly has a camera and audio module."
return
if(2)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(!C.use(3))
to_chat(user, SPAN_NOTICE("You need three cable coils to wire the devices."))
@@ -127,7 +127,7 @@ Using robohead because of restricting to roboticist */
desc = "This TV camera assembly has wires sticking out."
return
if(3)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, SPAN_NOTICE("You trim the wires."))
buildstep++
desc = "This TV camera assembly needs casing."
diff --git a/code/game/objects/items/easel.dm b/code/game/objects/items/easel.dm
index 3962b8f6626..0292fbf86af 100644
--- a/code/game/objects/items/easel.dm
+++ b/code/game/objects/items/easel.dm
@@ -32,7 +32,7 @@
C.pixel_z = 0
user.visible_message("[user] puts \the [C] on \the [src].", SPAN_NOTICE("You place \the [C] on \the [src]."))
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
dismantle()
return TRUE
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index d8fdc5b45c4..cf51504d481 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -18,7 +18,7 @@
return ..()
/obj/item/target/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
if(hp == initial(hp))
to_chat(user, SPAN_NOTICE("\The [src] is fully repaired."))
return TRUE
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 91888abf864..05bda089c0b 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -72,7 +72,7 @@ GLOBAL_LIST_INIT_TYPED(rod_recipes, /datum/stack_recipe, list(
/obj/item/stack/rods/attackby(obj/item/attacking_item, mob/user)
..()
- if (attacking_item.iswelder())
+ if (attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(get_amount() < 2)
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 563d215c1b4..a3d83b286ab 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -142,7 +142,7 @@
else
to_chat(user, SPAN_WARNING("You need one metal sheet to finish the light tile!"))
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
user.drop_from_inventory(attacking_item, get_turf(src))
to_chat(user, SPAN_NOTICE("You detach the wire from the [name]."))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm
index e8d172b43b1..fbcc7b6f7b5 100644
--- a/code/game/objects/items/stacks/sheets/leather.dm
+++ b/code/game/objects/items/stacks/sheets/leather.dm
@@ -90,7 +90,7 @@
//Animal Hide to leather steps
//Step one - dehairing.
/obj/item/stack/material/animalhide/attackby(obj/item/attacking_item, mob/user)
- if(is_sharp(attacking_item) && !attacking_item.noslice && !attacking_item.iswirecutter()) //Can we cut and slice with the item? And does the hide still have something to remove? Say no to wirecutters since it's more about bladed items.
+ if(is_sharp(attacking_item) && !attacking_item.noslice && attacking_item.tool_behaviour != TOOL_WIRECUTTER) //Can we cut and slice with the item? And does the hide still have something to remove? Say no to wirecutters since it's more about bladed items.
if(bare)
to_chat(user, SPAN_WARNING("There's nothing left to remove from \the [src]!"))
return
@@ -131,7 +131,7 @@
make_leather()
/obj/item/stack/material/animalhide/wetleather/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
if(being_dried)
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index de24659d780..ccf7b97f0ac 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -32,7 +32,7 @@
/obj/item/stack/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
if(is_adjacent)
- if(!iscoil())
+ if(tool_behaviour != TOOL_CABLECOIL)
if(!uses_charge)
. += "There [src.amount == 1 ? "is" : "are"] [src.amount] [src.singular_name]\s in the stack."
else
diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm
index dfa3f3c7728..39c8e2ece20 100644
--- a/code/game/objects/items/stacks/tiles/light.dm
+++ b/code/game/objects/items/stacks/tiles/light.dm
@@ -18,7 +18,7 @@
state = 0 //fine
/obj/item/stack/tile/light/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
amount--
to_chat(user, SPAN_NOTICE("You pry off the steel sheet from the [name]."))
attacking_item.play_tool_sound(get_turf(src), 100)
diff --git a/code/game/objects/items/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm
new file mode 100644
index 00000000000..2555b28cbae
--- /dev/null
+++ b/code/game/objects/items/tools/crowbar.dm
@@ -0,0 +1,79 @@
+/obj/item/crowbar
+ name = "pocket crowbar"
+ desc = "A small crowbar. This handy tool is useful for lots of things, such as prying floor tiles or opening unpowered doors."
+ icon = 'icons/obj/tools.dmi'
+ item_icons = list(
+ slot_l_hand_str = 'icons/mob/items/lefthand_tools.dmi',
+ slot_r_hand_str = 'icons/mob/items/righthand_tools.dmi',
+ )
+ icon_state = "crowbar"
+ item_state = "crowbar"
+ obj_flags = OBJ_FLAG_CONDUCTABLE
+ slot_flags = SLOT_BELT
+ force = 18
+ throwforce = 7
+ w_class = WEIGHT_CLASS_NORMAL
+ drop_sound = 'sound/items/drop/crowbar.ogg'
+ pickup_sound = 'sound/items/pickup/crowbar.ogg'
+ usesound = SFX_CROWBAR
+ surgerysound = 'sound/items/surgery/retractor.ogg'
+ origin_tech = list(TECH_ENGINEERING = 1)
+ matter = list(DEFAULT_WALL_MATERIAL = 50)
+ attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
+ tool_behaviour = TOOL_CROWBAR
+ toolspeed = 1
+ var/force_opens = FALSE
+
+/obj/item/crowbar/red
+ icon = 'icons/obj/tools.dmi'
+ icon_state = "crowbar_red"
+ item_state = "crowbar_red"
+
+/// Imagine something like a crash axe found on airplanes or forcing tools used by emergency services. This is a tool first and foremost.
+/obj/item/crowbar/rescue_axe
+ name = "rescue axe"
+ desc = "A short lightweight emergency tool meant to chop, pry and pierce. Most of the handle is insulated excepting the wedge at the very bottom. The axe head atop the tool has a short pick opposite of the blade."
+ icon_state = "rescue_axe"
+ item_state = "rescue_axe"
+ w_class = WEIGHT_CLASS_NORMAL
+ force = 18
+ throwforce = 12
+ obj_flags = null // Handle is insulated, so this means it won't conduct electricity and hurt you.
+ sharp = TRUE
+ edge = TRUE
+ origin_tech = list(TECH_ENGINEERING = 2)
+
+/// In practice this means it just does full damage to reinforced windows, which halve the force of attacks done against it already. That's just fine.
+/obj/item/crowbar/rescue_axe/resolve_attackby(atom/A)
+ if(istype(A, /obj/structure/window))
+ force = initial(force) * 2
+ else
+ force = initial(force)
+ . = ..()
+
+/obj/item/crowbar/rescue_axe/can_woodcut()
+ return TRUE
+
+/obj/item/crowbar/rescue_axe/red
+ icon_state = "rescue_axe_red"
+ item_state = "rescue_axe_red"
+
+/obj/item/crowbar/hydraulic_rescue_tool
+ name = "hydraulic rescue tool"
+ desc = "A hydraulic rescue tool that functions like a crowbar by applying strong amounts of hydraulic pressure to force open different things. Also known as jaws of life."
+ icon = 'icons/obj/item/hydraulic_rescue_tool.dmi'
+ icon_state = "jawspry"
+ force = 15
+ throwforce = 1
+ w_class = WEIGHT_CLASS_NORMAL
+ drop_sound = 'sound/items/drop/crowbar.ogg'
+ pickup_sound = 'sound/items/pickup/crowbar.ogg'
+ origin_tech = list(TECH_ENGINEERING = 1)
+ matter = list(DEFAULT_WALL_MATERIAL = 50)
+ attack_verb = list("attacked", "rammed", "battered", "bludgeoned")
+ toolspeed = 0.7
+ force_opens = TRUE
+
+/obj/item/crowbar/robotic
+ icon = 'icons/obj/robot_items.dmi'
+ toolspeed = 0.5
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/tools/mop.dm
similarity index 100%
rename from code/game/objects/items/weapons/mop.dm
rename to code/game/objects/items/tools/mop.dm
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/tools/tools.dm
similarity index 87%
rename from code/game/objects/items/weapons/tools.dm
rename to code/game/objects/items/tools/tools.dm
index 4706a1e81b1..7f91d033ba8 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/tools/tools.dm
@@ -37,9 +37,7 @@
surgerysound = 'sound/items/surgery/bonesetter.ogg'
drop_sound = 'sound/items/drop/wrench.ogg'
pickup_sound = 'sound/items/pickup/wrench.ogg'
-
-/obj/item/wrench/iswrench()
- return TRUE
+ tool_behaviour = TOOL_WRENCH
/*
* Screwdriver
@@ -70,6 +68,7 @@
lock_picking_level = 5
build_from_parts = TRUE
worn_overlay = "head"
+ tool_behaviour = TOOL_SCREWDRIVER
/obj/item/screwdriver/Initialize()
. = ..()
@@ -115,9 +114,6 @@
M = user
return eyestab(M,user)
-/obj/item/screwdriver/isscrewdriver()
- return TRUE
-
/*
* Wirecutters
*/
@@ -153,6 +149,8 @@
var/list/color_options = list(COLOR_BLUE, COLOR_RED, COLOR_PURPLE, COLOR_BROWN, COLOR_GREEN, COLOR_CYAN, COLOR_YELLOW)
+ tool_behaviour = TOOL_WIRECUTTER
+
/obj/item/wirecutters/Initialize()
. = ..()
if(build_from_parts)
@@ -204,9 +202,6 @@
else
..()
-/obj/item/wirecutters/iswirecutter()
- return TRUE
-
/obj/item/wirecutters/toolbelt
color_options = list(COLOR_TOOLS)
@@ -248,27 +243,29 @@
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
- //Cost to make in the autolathe
+ /// Cost to make in the autolathe
matter = list(DEFAULT_WALL_MATERIAL = 70, MATERIAL_GLASS = 30)
- //R&D tech level
+ /// R&D tech level
origin_tech = list(TECH_ENGINEERING = 1)
//Welding tool specific stuff
- var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
- var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
- var/max_fuel = 20 //The max amount of fuel the welder can hold
+ /// Whether or not the welding tool is off(0), on(1) or currently welding(2)
+ var/welding = 0
+ /// Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
+ var/status = TRUE
+ /// The max amount of fuel the welder can hold
+ var/max_fuel = 20
var/change_icons = TRUE
var/produces_flash = TRUE
+ tool_behaviour = TOOL_WELDER
+
/obj/item/weldingtool/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
if(distance <= 0)
. += "It contains [get_fuel()]/[max_fuel] units of fuel."
-/obj/item/weldingtool/iswelder()
- return TRUE
-
/obj/item/weldingtool/largetank
name = "industrial welding tool"
desc = "A welding tool with an extended-capacity built-in fuel tank, standard issue for engineers."
@@ -364,7 +361,7 @@
return ..()
/obj/item/weldingtool/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(isrobot(loc))
to_chat(user, SPAN_ALERT("You cannot modify your own welder!"))
return TRUE
@@ -398,8 +395,7 @@
if(get_fuel() < 1)
setWelding(0)
- //I'm not sure what this does. I assume it has to do with starting fires...
- //...but it doesnt check to see if the welder is on or not.
+ // If we're running process(), we're currently running. Hotspot on the current tile.
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/M = location
@@ -612,7 +608,7 @@
AddOverlays("overcap_attached", ATOM_ICON_CACHE_PROTECTED)
toolspeed *= 2
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!eyeshield && !overcap)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any accessories to remove!"))
return TRUE
@@ -694,91 +690,6 @@
. += ..()
. += "This can be attached to an experimental welder to double the speed it works at, at the cost of tripling the fuel cost of using it."
-/*
- * Crowbar
- */
-
-/obj/item/crowbar
- name = "crowbar"
- desc = "An iron bar with a flattened end, used as a lever to remove floors and pry open doors."
- icon = 'icons/obj/tools.dmi'
- item_icons = list(
- slot_l_hand_str = 'icons/mob/items/lefthand_tools.dmi',
- slot_r_hand_str = 'icons/mob/items/righthand_tools.dmi',
- )
- icon_state = "crowbar"
- item_state = "crowbar"
- obj_flags = OBJ_FLAG_CONDUCTABLE
- slot_flags = SLOT_BELT
- force = 18
- throwforce = 7
- w_class = WEIGHT_CLASS_NORMAL
- drop_sound = 'sound/items/drop/crowbar.ogg'
- pickup_sound = 'sound/items/pickup/crowbar.ogg'
- usesound = SFX_CROWBAR
- surgerysound = 'sound/items/surgery/retractor.ogg'
- origin_tech = list(TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 50)
- attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
-
-/obj/item/crowbar/iscrowbar()
- return TRUE
-
-/obj/item/crowbar/red
- icon = 'icons/obj/tools.dmi'
- icon_state = "crowbar_red"
- item_state = "crowbar_red"
-
-/obj/item/crowbar/rescue_axe // Imagine something like a crash axe found on airplanes or forcing tools used by emergency services. This is a tool first and foremost.
- name = "rescue axe"
- desc = "A short lightweight emergency tool meant to chop, pry and pierce. Most of the handle is insulated excepting the wedge at the very bottom. The axe head atop the tool has a short pick opposite of the blade."
- icon_state = "rescue_axe"
- item_state = "rescue_axe"
- w_class = WEIGHT_CLASS_NORMAL
- force = 18
- throwforce = 12
- obj_flags = null // Handle is insulated, so this means it won't conduct electricity and hurt you.
- sharp = TRUE
- edge = TRUE
- origin_tech = list(TECH_ENGINEERING = 2)
-
-/obj/item/crowbar/rescue_axe/resolve_attackby(atom/A) // In practice this means it just does full damage to reinforced windows, which halve the force of attacks done against it already. That's just fine.
- if(istype(A, /obj/structure/window))
- force = initial(force) * 2
- else
- force = initial(force)
- . = ..()
-
-/obj/item/crowbar/rescue_axe/iscrowbar()
- if(ismob(loc))
- var/mob/M = loc
- if(M.a_intent && M.a_intent == I_HURT)
- return FALSE
-
- return TRUE
-
-/obj/item/crowbar/rescue_axe/can_woodcut()
- return TRUE
-
-/obj/item/crowbar/rescue_axe/red
- icon_state = "rescue_axe_red"
- item_state = "rescue_axe_red"
-
-/obj/item/crowbar/hydraulic_rescue_tool
- name = "hydraulic rescue tool"
- desc = "A hydraulic rescue tool that functions like a crowbar by applying strong amounts of hydraulic pressure to force open different things. Also known as jaws of life."
- icon = 'icons/obj/item/hydraulic_rescue_tool.dmi'
- icon_state = "jawspry"
- force = 15
- throwforce = 1
- w_class = WEIGHT_CLASS_NORMAL
- drop_sound = 'sound/items/drop/crowbar.ogg'
- pickup_sound = 'sound/items/pickup/crowbar.ogg'
- usesound = SFX_CROWBAR
- origin_tech = list(TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 50)
- attack_verb = list("attacked", "rammed", "battered", "bludgeoned")
-
// Pipe wrench
/obj/item/pipewrench
name = "pipe wrench"
@@ -798,6 +709,7 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 2)
matter = list(DEFAULT_WALL_MATERIAL = 150)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
+ tool_behaviour = TOOL_PIPEWRENCH
/obj/item/pipewrench/Initialize()
. = ..()
@@ -839,21 +751,6 @@
tools[tool] = image('icons/obj/tools.dmi', icon_state = "[icon_state]-[tool]")
. = ..()
-/obj/item/combitool/iswrench()
- return current_tool == "wrench"
-
-/obj/item/combitool/isscrewdriver()
- return current_tool == "screwdriver"
-
-/obj/item/combitool/iswirecutter()
- return current_tool == "wirecutters"
-
-/obj/item/combitool/iscrowbar()
- return current_tool == "crowbar"
-
-/obj/item/combitool/ismultitool()
- return current_tool == "multitool"
-
/obj/item/combitool/proc/update_tool()
icon_state = "[initial(icon_state)]-[current_tool]"
@@ -868,18 +765,23 @@
if("wrench")
usesound = 'sound/items/wrench.ogg'
surgerysound = 'sound/items/surgery/bonesetter.ogg'
+ tool_behaviour = TOOL_WRENCH
if("screwdriver")
usesound = 'sound/items/screwdriver.ogg'
surgerysound = 'sound/items/screwdriver.ogg'
+ tool_behaviour = TOOL_SCREWDRIVER
if("wirecutters")
usesound = 'sound/items/wirecutter.ogg'
surgerysound = 'sound/items/surgery/hemostat.ogg'
+ tool_behaviour = TOOL_WIRECUTTER
if("crowbar")
usesound = SFX_CROWBAR
surgerysound = 'sound/items/surgery/retractor.ogg'
+ tool_behaviour = TOOL_CROWBAR
if("multitool")
usesound = null
surgerysound = null
+ tool_behaviour = TOOL_MULTITOOL
update_tool()
return 1
@@ -898,8 +800,8 @@
usesound = 'sound/items/drill_use.ogg'
var/current_tool = 1
var/list/tools = list(
- "screwdriver bit",
- "wrench bit"
+ "screwdriver",
+ "wrench"
)
/obj/item/powerdrill/mechanics_hints(mob/user, distance, is_adjacent)
@@ -908,6 +810,8 @@
/obj/item/powerdrill/Initialize()
. = ..()
+ // When spawned, it has the screwdriver bit enabled. Reflect that.
+ tool_behaviour = TOOL_SCREWDRIVER
update_tool()
/obj/item/powerdrill/set_initial_maptext()
@@ -924,21 +828,17 @@
. = ..()
closeToolTip(usr)
-/obj/item/powerdrill/iswrench()
- return tools[current_tool] == "wrench bit"
-
-/obj/item/powerdrill/isscrewdriver()
- return tools[current_tool] == "screwdriver bit"
-
-/obj/item/powerdrill/proc/update_tool()
- if(isscrewdriver())
+/obj/item/powerdrill/proc/update_tool(var/tool)
+ if(tool == TOOL_SCREWDRIVER)
usesound = 'sound/items/drill_use.ogg'
icon_state = "impact_wrench-screw"
check_maptext(SMALL_FONTS(7, "S"))
- else if(iswrench())
+ tool_behaviour = TOOL_SCREWDRIVER
+ else if(tool == TOOL_WRENCH)
usesound = 'sound/items/air_wrench.ogg'
icon_state = "impact_wrench-wrench"
check_maptext(SMALL_FONTS(7, "W"))
+ tool_behaviour = TOOL_WRENCH
/obj/item/powerdrill/attack_self(var/mob/user)
if(++current_tool > tools.len)
@@ -949,7 +849,7 @@
else
to_chat(user, "You switch \the [src] to the [tool] fitting.")
playsound(loc, 'sound/items/change_drill.ogg', 50, 1)
- update_tool()
+ update_tool(tool)
return TRUE
/obj/item/powerdrill/issurgerycompatible()
@@ -1037,6 +937,7 @@
attack_verb = list("smashed", "hammered")
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
+ tool_behaviour = TOOL_HAMMER
usesound = SFX_HAMMER
/obj/item/hammer/Initialize()
@@ -1045,5 +946,3 @@
handle.color = pick(COLOR_BLUE, COLOR_RED, COLOR_PURPLE, COLOR_BROWN, COLOR_GREEN, COLOR_CYAN, COLOR_YELLOW)
AddOverlays(handle)
-/obj/item/hammer/ishammer()
- return TRUE
diff --git a/code/game/objects/items/weapons/RFD.dm b/code/game/objects/items/weapons/RFD.dm
index 4a3907436af..a7657dfaba8 100644
--- a/code/game/objects/items/weapons/RFD.dm
+++ b/code/game/objects/items/weapons/RFD.dm
@@ -105,7 +105,7 @@ ABSTRACT_TYPE(/obj/item/rfd)
return TRUE
// Turning it into a crossbow, as you do.
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
crafting = !crafting
if(!crafting)
to_chat(user, SPAN_NOTICE("You reassemble the RFD."))
diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm
index ba444b968e4..3b6b1adc910 100644
--- a/code/game/objects/items/weapons/candle.dm
+++ b/code/game/objects/items/weapons/candle.dm
@@ -31,7 +31,7 @@
/obj/item/flame/candle/attackby(obj/item/attacking_item, mob/user)
..()
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light()
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index 7dc64eb5eef..0ff7b09f239 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -284,7 +284,7 @@ ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
text = zippomes
else if(istype(attacking_item, /obj/item/flame/lighter))
text = lightermes
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
text = weldermes
else if(istype(attacking_item, /obj/item/device/assembly/igniter))
text = ignitermes
@@ -1081,9 +1081,9 @@ ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
can_fold = FALSE
/obj/item/paper/cig/attackby(obj/item/attacking_item, mob/user)
- if(istype(attacking_item, /obj/item/flame) || attacking_item.iswelder())
+ if(istype(attacking_item, /obj/item/flame) || attacking_item.tool_behaviour == TOOL_WELDER)
..()
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
..()
else
return
diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
index e5093829d8f..df1884984de 100644
--- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
+++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
@@ -52,7 +52,7 @@
to_chat(user, SPAN_NOTICE("You [locked ? "" : "un"]lock the circuit controls."))
else
to_chat(user, SPAN_WARNING("Access denied."))
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
if(locked)
to_chat(user, SPAN_WARNING("Circuit controls are locked."))
return
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/power.dm b/code/game/objects/items/weapons/circuitboards/machinery/power.dm
index 2221b0b6993..2f3e206858f 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/power.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/power.dm
@@ -20,7 +20,7 @@
req_components = list("/obj/item/cell" = 3)
/obj/item/circuitboard/ghettosmes/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/module/power_control/new_circuit = new /obj/item/module/power_control(get_turf(src))
to_chat(user, SPAN_NOTICE("You modify \the [src] into an APC power control module."))
qdel(src)
diff --git a/code/game/objects/items/weapons/cloaking_device.dm b/code/game/objects/items/weapons/cloaking_device.dm
index 301cb67309a..b8c7445b2ad 100644
--- a/code/game/objects/items/weapons/cloaking_device.dm
+++ b/code/game/objects/items/weapons/cloaking_device.dm
@@ -144,7 +144,7 @@
else
to_chat(user, SPAN_NOTICE("[src] already has a cell."))
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(cell)
cell.update_icon()
cell.forceMove(get_turf(src.loc))
diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm
index bd5b6dd0394..110b7a79bc3 100644
--- a/code/game/objects/items/weapons/ecigs.dm
+++ b/code/game/objects/items/weapons/ecigs.dm
@@ -130,7 +130,7 @@
update_icon()
to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(cig_cell) //if contains powercell
cig_cell.update_icon()
user.put_in_hands(cig_cell)
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 93980d5e3ec..35937ca05a5 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -43,7 +43,7 @@
return ..()
/obj/item/plastique/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
open_panel = !open_panel
to_chat(user, SPAN_NOTICE("You [open_panel ? "open" : "close"] the wire panel."))
return TRUE
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 538f5227f0c..ba293d44031 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -37,7 +37,7 @@
. += SPAN_NOTICE("The cartridge seems spent.")
/obj/item/reagent_containers/extinguisher_refill/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(is_open_container())
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
else
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index f8240b7ab86..ade97cfe6d6 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -106,7 +106,7 @@
if(use_check_and_message(user))
return TRUE
- if(attacking_item.iswrench() && !secured)//Taking this apart
+ if(attacking_item.tool_behaviour == TOOL_WRENCH && !secured)//Taking this apart
var/turf/T = get_turf(src)
if(welding_tool)
welding_tool.forceMove(T)
@@ -121,7 +121,7 @@
qdel(src)
return TRUE
- else if(attacking_item.isscrewdriver() && igniter && !lit)
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && igniter && !lit)
secured = !secured
to_chat(user, SPAN_NOTICE("[igniter] is now [secured ? "secured" : "unsecured"]!"))
update_icon()
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index b9549e1d023..91ac2eede11 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -84,7 +84,7 @@
icon_state = initial(icon_state) +"_ass"
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
stage = 1
- else if(attacking_item.isscrewdriver() && path != 2)
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && path != 2)
if(stage == 1)
path = 1
if(beakers.len)
diff --git a/code/game/objects/items/weapons/grenades/dynamite.dm b/code/game/objects/items/weapons/grenades/dynamite.dm
index 31ade0ff11d..4050bf01287 100644
--- a/code/game/objects/items/weapons/grenades/dynamite.dm
+++ b/code/game/objects/items/weapons/grenades/dynamite.dm
@@ -13,7 +13,7 @@
if(active)
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
activate(user)
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index dbfe8f30329..02dc6f421e0 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -220,7 +220,7 @@
to_chat(user, SPAN_NOTICE("You wrap \the [src] around the top of the rod."))
qdel(src)
update_icon(user)
- else if(can_be_cut && attacking_item.iswirecutter())
+ else if(can_be_cut && attacking_item.tool_behaviour == TOOL_WIRECUTTER)
user.visible_message("[user] cuts the [src].", SPAN_NOTICE("You cut the [src]."))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 15, color)
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index 9e2b26e91ef..237c001c730 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -37,7 +37,7 @@
AddOverlays(overlay_implant_icon)
/obj/item/implantcase/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.ispen())
+ if (attacking_item.tool_behaviour == TOOL_PEN)
var/t = tgui_input_text(user, "What would you like the label to be?", name, name, MAX_NAME_LEN)
if (user.get_active_hand() != attacking_item)
return
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index 4163168b22d..995437c007d 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -111,7 +111,7 @@
update_icon()
/obj/item/implanter/ipc_tag/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!ipc_tag)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an IPC tag loaded."))
return
diff --git a/code/game/objects/items/weapons/implants/implants/circuit.dm b/code/game/objects/items/weapons/implants/implants/circuit.dm
index 2df87d953fc..d9eae5bbf6b 100644
--- a/code/game/objects/items/weapons/implants/implants/circuit.dm
+++ b/code/game/objects/items/weapons/implants/implants/circuit.dm
@@ -44,7 +44,7 @@
return IC.examine(user, distance, is_adjacent, infix, suffix, show_extended)
/obj/item/implant/integrated_circuit/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar() || istype(attacking_item, /obj/item/device/integrated_electronics) || istype(attacking_item, /obj/item/integrated_circuit) || attacking_item.isscrewdriver() || istype(attacking_item, /obj/item/cell/device) )
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR || istype(attacking_item, /obj/item/device/integrated_electronics) || istype(attacking_item, /obj/item/integrated_circuit) || attacking_item.tool_behaviour == TOOL_SCREWDRIVER || istype(attacking_item, /obj/item/cell/device) )
IC.attackby(attacking_item, user)
else
..()
diff --git a/code/game/objects/items/weapons/implants/implants/compressed_matter.dm b/code/game/objects/items/weapons/implants/implants/compressed_matter.dm
index bf37fe4d84d..78c5b4c1df4 100644
--- a/code/game/objects/items/weapons/implants/implants/compressed_matter.dm
+++ b/code/game/objects/items/weapons/implants/implants/compressed_matter.dm
@@ -11,7 +11,7 @@
var/obj/item/scanned = null
/obj/item/implant/compressed/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!scanned)
to_chat(user, SPAN_NOTICE("There is nothing to remove from the implant."))
else
diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm
index 5da731b242c..039e9b12e19 100644
--- a/code/game/objects/items/weapons/improvised_components.dm
+++ b/code/game/objects/items/weapons/improvised_components.dm
@@ -7,7 +7,7 @@
thrown_force_divisor = 0.1
/obj/item/material/butterflyconstruction/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "You finish the concealed blade weapon.")
new /obj/item/material/knife/butterfly(user.loc, material.name)
qdel(src)
@@ -71,7 +71,7 @@
var/obj/item/material/tmp_shard = attacking_item
finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.name)
to_chat(user, SPAN_NOTICE("You fasten \the [attacking_item] to the top of the rod with the cable."))
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
finished = new /obj/item/melee/baton/cattleprod(get_turf(user), forward_cable_color)
to_chat(user, SPAN_NOTICE("You fasten the wirecutters to the top of the rod with the cable, prongs outward."))
else if(istype(attacking_item, /obj/item/material/wirerod))
diff --git a/code/game/objects/items/weapons/ipc_scanner.dm b/code/game/objects/items/weapons/ipc_scanner.dm
index 1beb54727ad..272a3377830 100644
--- a/code/game/objects/items/weapons/ipc_scanner.dm
+++ b/code/game/objects/items/weapons/ipc_scanner.dm
@@ -50,7 +50,7 @@
to_chat(user, SPAN_NOTICE("Citizenship Info: [tag.citizenship_info]"))
/obj/item/ipc_tag_scanner/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
wires_exposed = !wires_exposed
user.visible_message(SPAN_WARNING("\The [user] [wires_exposed ? "exposes the wiring" : "closes the panel"] on \the [src]."), SPAN_WARNING("You [wires_exposed ? "expose the wiring" : "close the panel"] on \the [src]."), 3)
else if(wires_exposed)
diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm
index 5dece859748..af0da44df47 100644
--- a/code/game/objects/items/weapons/material/shards.dm
+++ b/code/game/objects/items/weapons/material/shards.dm
@@ -64,7 +64,7 @@
alpha = 255
/obj/item/material/shard/attackby(obj/item/attacking_item, mob/user as mob)
- if(attacking_item.iswelder() && material.shard_can_repair)
+ if(attacking_item.tool_behaviour == TOOL_WELDER && material.shard_can_repair)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
material.place_sheet(user.loc)
diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm
index 9fe7d6bbe34..36b4294bddc 100644
--- a/code/game/objects/items/weapons/melee/misc.dm
+++ b/code/game/objects/items/weapons/melee/misc.dm
@@ -79,16 +79,7 @@
attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked")
w_class = WEIGHT_CLASS_NORMAL
origin_tech = list(TECH_MATERIAL = 3, TECH_ILLEGAL = 2)
-
-/obj/item/melee/hammer/iscrowbar()
- if(ismob(loc))
- var/mob/M = loc
- if(M.a_intent && M.a_intent == I_HURT)
- return FALSE
- return TRUE
-
-/obj/item/melee/hammer/ishammer()
- return TRUE
+ tool_behaviour = TOOL_HAMMER
/obj/item/melee/hammer/powered
name = "powered hammer"
diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm
index 0f6a0b51570..a05ce566de1 100644
--- a/code/game/objects/items/weapons/policetape.dm
+++ b/code/game/objects/items/weapons/policetape.dm
@@ -106,7 +106,7 @@ GLOBAL_LIST_INIT(tape_roll_applications, list())
. += "This strip of tape has been modified to serve as a marker for emergency shield generators to lock onto."
/obj/item/tape/engineering/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
shield_marker = !shield_marker
to_chat(user, SPAN_NOTICE("You [shield_marker ? "" : "un"]designate \the [src] as a target for an emergency shield generator."))
if(shield_marker)
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 63dd39c5579..3d89cd1b805 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -1428,7 +1428,7 @@
icon_state = "paperbag_[choice]-food"
/obj/item/storage/box/unique/papersack/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
if(!papersack_designs)
papersack_designs = sortList(list(
"None" = image(icon = src.icon, icon_state = "paperbag_None"),
@@ -1459,7 +1459,7 @@
update_icon()
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(length(contents) == 0)
to_chat(user, SPAN_NOTICE("You begin poking holes in \the [src]."))
if(attacking_item.use_tool(src, user, 30))
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index c46919790ef..1ac9b1cff72 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -713,7 +713,7 @@
to_chat(user, SPAN_WARNING("You try to push \the [attacking_item] through the lid but it doesn't work!"))
return
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
if(src.open)
return
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index d0bde95f159..db1df92e051 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -42,12 +42,12 @@ ABSTRACT_TYPE(/obj/item/storage/secure)
playsound(src.loc, SFX_SPARKS, 50, 1)
return
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(attacking_item.use_tool(src, user, 20, volume = 50))
src.open =! src.open
to_chat(user, SPAN_NOTICE("You [src.open ? "open" : "close"] the service panel."))
return
- if ((attacking_item.ismultitool()) && (src.open == 1)&& (!src.l_hacking))
+ if ((attacking_item.tool_behaviour == TOOL_MULTITOOL) && (src.open == 1)&& (!src.l_hacking))
to_chat(user, SPAN_NOTICE("Now attempting to reset internal memory, please hold."))
src.l_hacking = 1
if (do_after(usr, 100))
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index e18f71af45a..bc2f55d8cf0 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -89,7 +89,7 @@
else
to_chat(user, SPAN_NOTICE("[src] already has a cell."))
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(bcell)
bcell.update_icon()
bcell.forceMove(get_turf(src))
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 977cc8748f5..f351b93bb30 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -34,6 +34,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 5000)
obj_flags = OBJ_FLAG_CONDUCTABLE
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
+ tool_behaviour = TOOL_RETRACTOR
/*
* Hemostat
@@ -48,6 +49,7 @@
obj_flags = OBJ_FLAG_CONDUCTABLE
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("attacked", "pinched")
+ tool_behaviour = TOOL_HEMOSTAT
/*
* Cautery
@@ -62,6 +64,7 @@
obj_flags = OBJ_FLAG_CONDUCTABLE
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("burnt")
+ tool_behaviour = TOOL_CAUTERY
/*
* Surgical Drill
@@ -81,6 +84,7 @@
attack_verb = list("drilled")
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
+ tool_behaviour = TOOL_DRILL
/*
* Scalpel
@@ -105,6 +109,7 @@
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
drop_sound = 'sound/items/drop/knife.ogg'
pickup_sound = 'sound/items/pickup/knife.ogg'
+ tool_behaviour = TOOL_SCALPEL
/*
* Researchable Scalpels
@@ -150,6 +155,7 @@
edge = TRUE
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
+ tool_behaviour = TOOL_SAW
// Miscellanous
/obj/item/surgery/bone_gel
@@ -187,6 +193,7 @@
throw_speed = 3
throw_range = 5
attack_verb = list("attacked", "hit", "bludgeoned")
+ tool_behaviour = TOOL_BONESET
/obj/item/storage/box/fancy/tray
name = "surgery tray"
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index d3b8d89abd1..491a25407d5 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -700,7 +700,7 @@
return
capture(capturing_mob)
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [WT] is off!"))
@@ -716,7 +716,7 @@
release(user)
qdel(src)
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
var/turf/T = get_turf(src)
if(!T)
to_chat(user, SPAN_WARNING("There is nothing to secure \the [src] to!"))
@@ -869,7 +869,7 @@
..()
/obj/item/trap/animal/large/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
var/turf/T = get_turf(src)
if(!T)
to_chat(user, SPAN_WARNING("There is nothing to secure \the [src] to!"))
@@ -887,7 +887,7 @@
user.visible_message(SPAN_NOTICE("[user] [anchored ? "" : "un" ]secures \the [src]!"),
SPAN_NOTICE("You [anchored ? "" : "un" ]secure \the [src]!"))
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
// Unlike smaller traps, screwdriver shouldn't work on this.
return
else
diff --git a/code/game/objects/structures/ECD.dm b/code/game/objects/structures/ECD.dm
index 1f2368b4926..a32f230bb29 100644
--- a/code/game/objects/structures/ECD.dm
+++ b/code/game/objects/structures/ECD.dm
@@ -29,7 +29,7 @@
to_chat(living_user, SPAN_NOTICE("\The [src] does not seem to be doing anything, but you can feel it. A signal, beyond anything you can consciously understand, weaving and scratching a shield around the back of your mind."))
/obj/structure/ecd/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
switch(state)
if(ECD_LOOSE)
state = ECD_BOLTED
@@ -49,7 +49,7 @@
to_chat(user, SPAN_WARNING("\The [src] needs to be unwelded from the floor."))
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
switch(state)
if(ECD_LOOSE)
diff --git a/code/game/objects/structures/barricades/_barricade.dm b/code/game/objects/structures/barricades/_barricade.dm
index 381272cc63e..35f230f6fff 100644
--- a/code/game/objects/structures/barricades/_barricade.dm
+++ b/code/game/objects/structures/barricades/_barricade.dm
@@ -189,7 +189,7 @@
update_icon()
return
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(is_wired)
user.visible_message(SPAN_NOTICE("[user] begin removing the barbed wire on [src]."),
SPAN_NOTICE("You begin removing the barbed wire on [src]."))
diff --git a/code/game/objects/structures/barricades/metal.dm b/code/game/objects/structures/barricades/metal.dm
index ae6b1f0fcda..b5b226a8bd1 100644
--- a/code/game/objects/structures/barricades/metal.dm
+++ b/code/game/objects/structures/barricades/metal.dm
@@ -37,7 +37,7 @@
. += "The protection panel has been removed and the anchor bolts loosened. It's ready to be pried apart."
/obj/structure/barricade/metal/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(damage_state == BARRICADE_DMG_HEAVY)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
@@ -52,7 +52,7 @@
switch(build_state)
if(BARRICADE_BSTATE_SECURED) //Fully constructed step. Use screwdriver to remove the protection panels to reveal the bolts
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!attacking_item.use_tool(src, user, 1 SECOND, volume = 40))
return
user.visible_message(SPAN_NOTICE("[user] removes [src]'s protection panel."),
@@ -61,14 +61,14 @@
return
if(BARRICADE_BSTATE_UNSECURED) //Protection panel removed step. Screwdriver to put the panel back, wrench to unsecure the anchor bolts
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!attacking_item.use_tool(src, user, 2 SECONDS, volume = 40))
return
user.visible_message(SPAN_NOTICE("[user] screws \the [src]'s protection panel back."),
SPAN_NOTICE("You screw \the [src]'s protection panel back."))
build_state = BARRICADE_BSTATE_SECURED
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!attacking_item.use_tool(src, user, 1 SECOND, volume = 40))
return
user.visible_message(SPAN_NOTICE("[user] loosens [src]'s anchor bolts."),
@@ -78,7 +78,7 @@
update_icon() //unanchored changes layer
return
if(BARRICADE_BSTATE_MOVABLE) //Anchor bolts loosened step. Apply crowbar to unseat the panel and take apart the whole thing. Apply wrench to resecure anchor bolts
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
for(var/obj/structure/barricade/B in loc)
if(B != src && B.dir == dir)
to_chat(user, SPAN_WARNING("There's already a barricade here."))
@@ -95,7 +95,7 @@
anchored = TRUE
update_icon() //unanchored changes layer
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
user.visible_message(SPAN_NOTICE("[user] starts unseating [src]'s panels."),
SPAN_NOTICE("You start unseating [src]'s panels."))
if(attacking_item.use_tool(src, user, 3 SECONDS, volume = 40))
diff --git a/code/game/objects/structures/barricades/plasteel.dm b/code/game/objects/structures/barricades/plasteel.dm
index 42b045da01f..556bd5b2b28 100644
--- a/code/game/objects/structures/barricades/plasteel.dm
+++ b/code/game/objects/structures/barricades/plasteel.dm
@@ -76,7 +76,7 @@
busy = FALSE
/obj/structure/barricade/plasteel/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -94,7 +94,7 @@
switch(build_state)
if(2) //Fully constructed step. Use screwdriver to remove the protection panels to reveal the bolts
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -108,7 +108,7 @@
SPAN_NOTICE("You remove [src]'s protection panels, exposing the anchor bolts."))
build_state = BARRICADE_BSTATE_UNSECURED
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
playsound(src.loc, 'sound/items/crowbar_pry.ogg', 25, 1)
if(linked)
user.visible_message(SPAN_NOTICE("[user] removes the linking on [src]."),
@@ -125,7 +125,7 @@
cade.update_icon()
update_icon()
if(1) //Protection panel removed step. Screwdriver to put the panel back, wrench to unsecure the anchor bolts
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -135,7 +135,7 @@
SPAN_NOTICE("You set [src]'s protection panel back."))
build_state = BARRICADE_BSTATE_SECURED
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(busy || tool_cooldown > world.time)
return
if(!attacking_item.use_tool(src, user, 10, volume = 50))
@@ -148,7 +148,7 @@
return
if(0) //Anchor bolts loosened step. Apply crowbar to unseat the panel and take apart the whole thing. Apply wrench to rescure anchor bolts
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -164,7 +164,7 @@
build_state = BARRICADE_BSTATE_UNSECURED
update_icon() //unanchored changes layer
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index 7b5f5f53cac..5b05fd68f2e 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -196,7 +196,7 @@ LINEN BINS
return FALSE
/obj/item/bedsheet/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(SPAN_NOTICE("\The [user] begins poking eyeholes in \the [src] with \the [attacking_item]."),
SPAN_NOTICE("You begin poking eyeholes in \the [src] with \the [attacking_item]."))
if(attacking_item.use_tool(src, user, 50, volume = 50))
diff --git a/code/game/objects/structures/carts/carts.dm b/code/game/objects/structures/carts/carts.dm
index a9cbe85962b..478f1c7580a 100644
--- a/code/game/objects/structures/carts/carts.dm
+++ b/code/game/objects/structures/carts/carts.dm
@@ -21,15 +21,13 @@ ABSTRACT_TYPE(/obj/structure/cart)
/obj/structure/cart/disassembly_hints(mob/user, distance, is_adjacent)
. += ..()
. += "An empty cart can be taken apart with a wrench or a welder. Or a plasma cutter, if you're that hardcore. If it contains anything when disassembled, these contents will spill onto the floor."
-
-/obj/structure/cart/proc/take_apart(var/mob/user = null, var/obj/object)
+/obj/structure/cart/proc/take_apart(var/mob/user = null, var/obj/item/object)
if(user)
- if(iswelder(object))
+ if(object.tool_behaviour == TOOL_WELDER)
var/obj/item/welder = object
welder.play_tool_sound(get_turf(src), 50)
-
user.visible_message("[user] starts taking apart the [src]...", SPAN_NOTICE("You start disassembling the [src]..."))
- if (!do_after(user, 30, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
+ if(!do_after(user, 30, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
return
dismantle()
diff --git a/code/game/objects/structures/carts/engicart.dm b/code/game/objects/structures/carts/engicart.dm
index 4e716060bb2..5be7fe21e38 100644
--- a/code/game/objects/structures/carts/engicart.dm
+++ b/code/game/objects/structures/carts/engicart.dm
@@ -144,7 +144,7 @@
handle_storing(attacking_item, user, should_store, storage_is_full)
return TRUE
- else if(!has_items && (attacking_item.iswrench() || attacking_item.iswelder() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ else if (!has_items && (attacking_item.tool_behaviour == TOOL_WRENCH || attacking_item.tool_behaviour == TOOL_WELDER || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
take_apart(user, attacking_item)
return
..()
diff --git a/code/game/objects/structures/carts/janicart.dm b/code/game/objects/structures/carts/janicart.dm
index 1c94ebe3b76..9794e0b4097 100644
--- a/code/game/objects/structures/carts/janicart.dm
+++ b/code/game/objects/structures/carts/janicart.dm
@@ -198,7 +198,6 @@
signs++
else
storage_is_full = TRUE
-
handle_storing(attacking_item, user, should_store, storage_is_full)
return
@@ -207,7 +206,7 @@
// This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash.
return my_bag.attackby(attacking_item, user)
- else if(!has_items && (attacking_item.iswrench() || attacking_item.iswelder() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ else if (!has_items && (attacking_item.tool_behaviour == TOOL_WRENCH || attacking_item.tool_behaviour == TOOL_WELDER || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
take_apart(user, attacking_item)
return
diff --git a/code/game/objects/structures/carts/parcelcart.dm b/code/game/objects/structures/carts/parcelcart.dm
index cdcd5d7e3d4..d379950735d 100644
--- a/code/game/objects/structures/carts/parcelcart.dm
+++ b/code/game/objects/structures/carts/parcelcart.dm
@@ -52,7 +52,7 @@
handle_storing(attacking_item, user, should_store, storage_is_full)
return TRUE
- else if(!has_items && (attacking_item.iswrench() || attacking_item.iswelder() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ else if (!has_items && (attacking_item.tool_behaviour == TOOL_WRENCH || attacking_item.tool_behaviour == TOOL_WELDER || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
take_apart(user, attacking_item)
return
..()
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index be5679d237d..411ca11e8d7 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -364,7 +364,7 @@
var/obj/item/grab/G = attacking_item
mouse_drop_receive(G.affecting, user) //act like they were dragged onto the closet
return 0
- if(attacking_item.isscrewdriver()) // Moved here so you can only detach linked teleporters when the door is open. So you can like unscrew and bolt the locker normally in most circumstances.
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) // Moved here so you can only detach linked teleporters when the door is open. So you can like unscrew and bolt the locker normally in most circumstances.
if(linked_teleporter)
user.visible_message(SPAN_NOTICE("\The [user] starts detaching \the [linked_teleporter] from \the [src]..."), SPAN_NOTICE("You begin detaching \the [linked_teleporter] from \the [src]..."), range = 3)
if(do_after(user, 30, src, DO_REPAIR_CONSTRUCT))
@@ -373,7 +373,7 @@
user.put_in_hands(linked_teleporter)
linked_teleporter = null
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
@@ -430,7 +430,7 @@
return
else if(istype(attacking_item, /obj/item/ducttape))
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
@@ -452,7 +452,7 @@
)
else
attack_hand(user)
- else if(attacking_item.isscrewdriver() && canbemoved)
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && canbemoved)
if(screwed)
to_chat(user, SPAN_NOTICE("You start to unscrew \the [src] from the floor..."))
attacking_item.play_tool_sound(get_turf(src), 50)
@@ -467,7 +467,7 @@
to_chat(user, SPAN_NOTICE("You screw \the [src]!"))
attacking_item.play_tool_sound(get_turf(src), 50)
screwed = TRUE
- else if(attacking_item.iswrench() && canbemoved)
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && canbemoved)
if(wrenched && !screwed)
to_chat(user, SPAN_NOTICE("You start to unfasten the bolts holding \the [src] in place..."))
attacking_item.play_tool_sound(get_turf(src), 50)
diff --git a/code/game/objects/structures/crates_lockers/crateshelf.dm b/code/game/objects/structures/crates_lockers/crateshelf.dm
index 66161acf51b..cae1290ca9f 100644
--- a/code/game/objects/structures/crates_lockers/crateshelf.dm
+++ b/code/game/objects/structures/crates_lockers/crateshelf.dm
@@ -62,7 +62,7 @@
/obj/structure/crate_shelf/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
dismantle(attacking_item, user)
/obj/structure/crate_shelf/dismantle(obj/item/W, mob/user)
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index d2fde5041bc..ab372828c15 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -9,7 +9,7 @@
return
/obj/structure/largecrate/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
new /obj/item/stack/material/wood(src)
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index 70084f04b32..da8479faf2b 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -40,7 +40,7 @@
/obj/structure/curtain/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswirecutter() || attacking_item.sharp && !attacking_item.noslice)
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || attacking_item.sharp && !attacking_item.noslice)
if(manipulating) return
manipulating = TRUE
visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."),
@@ -52,7 +52,7 @@
SPAN_NOTICE("You cut down \the [src]."))
dismantle()
- if(attacking_item.isscrewdriver()) //You can anchor/unanchor curtains
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) //You can anchor/unanchor curtains
anchored = !anchored
var/obj/structure/curtain/C
for(C in src.loc)
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index a55641a02f2..079f64246eb 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -118,7 +118,7 @@
bound_height = width * world.icon_size
/obj/structure/door_assembly/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
var/door_name = sanitizeSafe(input(user, "Enter the name for the door.", src.name, src.created_name), MAX_NAME_LEN)
if(!door_name)
return
@@ -126,7 +126,7 @@
return
created_name = door_name
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(!glass && anchored)
to_chat(user, SPAN_WARNING("\The [src] isn't ready to be welded yet. It doesn't have any installed glass to remove, and it has to be unsecured to deconstruct it."))
return
@@ -152,7 +152,7 @@
to_chat(user, SPAN_WARNING("You need more welding fuel."))
return
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(state != STATE_UNWIRED)
to_chat(user, SPAN_WARNING("You have to remove the wiring before you can use the wrench on \the [src]."))
return
@@ -170,7 +170,7 @@
to_chat(user, SPAN_NOTICE("You [anchored? "un" : ""]secure \the [src]."))
anchored = !anchored
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
if(state > STATE_UNWIRED)
to_chat(user, SPAN_WARNING("\The [src] has already been wired."))
return
@@ -187,7 +187,7 @@
state = STATE_WIRED
to_chat(user, SPAN_NOTICE("You wire the airlock."))
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(state == STATE_UNWIRED)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any wires to remove."))
return
@@ -228,7 +228,7 @@
else
EL.is_installed = FALSE
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(state != STATE_ELECTRONICS_INSTALLED)
to_chat(user, SPAN_WARNING("\The [src] has no electronics to remove."))
return
@@ -267,7 +267,7 @@
to_chat(user, SPAN_NOTICE("You install reinforced glass windows into the airlock assembly."))
glass = TRUE
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(state != STATE_ELECTRONICS_INSTALLED)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any electronics installed."))
return
diff --git a/code/game/objects/structures/fireaxe_cabinet.dm b/code/game/objects/structures/fireaxe_cabinet.dm
index 259e5267c31..65abc182ea5 100644
--- a/code/game/objects/structures/fireaxe_cabinet.dm
+++ b/code/game/objects/structures/fireaxe_cabinet.dm
@@ -115,7 +115,7 @@
return ..()
/obj/structure/fireaxecabinet/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
toggle_lock(user)
return
diff --git a/code/game/objects/structures/fluff/engineering/maintenance.dm b/code/game/objects/structures/fluff/engineering/maintenance.dm
index 2babe872638..28f68a96444 100644
--- a/code/game/objects/structures/fluff/engineering/maintenance.dm
+++ b/code/game/objects/structures/fluff/engineering/maintenance.dm
@@ -73,8 +73,8 @@ ABSTRACT_TYPE(/obj/structure/engineer_maintenance)
icon_state = "[panel_location]_[panel_type]_[icon_number]"
/obj/structure/engineer_maintenance/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iswrench()) // Any wrench is good, but we explicltly include the impact drill to send a helpful msg if they just have the screwdriver bit attached.
- if(!attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH) // Any wrench is good, but we explicitly include the impact drill to send a helpful msg if they just have the screwdriver bit attached.
+ if(attacking_item.tool_behaviour != TOOL_WRENCH)
to_chat(user, SPAN_WARNING("\The [attacking_item] must have its wrenchbit inserted to remove \the [src]'s bolts!"))
return
if (istype(attacking_item, /obj/item/powerdrill))
diff --git a/code/game/objects/structures/full_window_frame.dm b/code/game/objects/structures/full_window_frame.dm
index 21193017351..353f805b2d9 100644
--- a/code/game/objects/structures/full_window_frame.dm
+++ b/code/game/objects/structures/full_window_frame.dm
@@ -59,7 +59,7 @@
return FALSE
/obj/structure/window_frame/attackby(obj/item/attacking_item, mob/user)
- if((attacking_item.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
+ if((attacking_item.tool_behaviour == TOOL_SCREWDRIVER) && (istype(loc, /turf/simulated) || anchored))
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("You can't unfasten \the [src] if it has glass installed."))
return
@@ -79,7 +79,7 @@
update_nearby_icons()
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("You can't disassemble \the [src] if it has glass installed."))
return
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index e54849a465c..100866b7f1c 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -104,7 +104,7 @@
reinforce_girder()
/obj/structure/girder/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench() && state == 0)
+ if(attacking_item.tool_behaviour == TOOL_WRENCH && state == 0)
if(anchored && !reinf_material)
to_chat(user, SPAN_NOTICE("Now disassembling the girder..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
@@ -171,7 +171,7 @@
to_chat(user, SPAN_NOTICE("You slice apart the girder!"))
dismantle()
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(state == 2)
to_chat(user, SPAN_NOTICE("Now unsecuring support struts..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
@@ -185,7 +185,7 @@
to_chat(user, SPAN_NOTICE("\The [src] can now be [reinforcing? "reinforced" : "constructed"]!"))
return
- else if(attacking_item.iswirecutter() && state == 1)
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER && state == 1)
to_chat(user, SPAN_NOTICE("Now removing support struts..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
@@ -193,7 +193,7 @@
reinf_material = null
reset_girder()
- else if(attacking_item.iscrowbar() && state == 0 && anchored)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && state == 0 && anchored)
to_chat(user, SPAN_NOTICE("Now dislodging the girder..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
@@ -357,7 +357,7 @@
qdel(src)
/obj/structure/girder/cult/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("Now disassembling the girder..."))
if(attacking_item.use_tool(src, user, 40, volume = 50))
to_chat(user, SPAN_NOTICE("You dissasembled the girder!"))
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 59deebe5336..75e1318c48c 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -183,7 +183,7 @@
spawn(0) healthcheck() //spawn to make sure we return properly if the grille is deleted
/obj/structure/grille/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(!shock(user, 100))
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
@@ -196,7 +196,7 @@
playsound(loc, PC.fire_sound, 100, TRUE)
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
qdel(src)
- else if((attacking_item.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
+ else if((attacking_item.tool_behaviour == TOOL_SCREWDRIVER) && (istype(loc, /turf/simulated) || anchored))
if(!shock(user, 90))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
anchored = !anchored
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index a10f12f0978..8df53a47927 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -69,7 +69,7 @@
var/turf/T = get_turf(src)
T.attackby(attacking_item, user) //BubbleWrap - hand this off to the underlying turf instead
return
- if (attacking_item.iswelder())
+ if (attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(1, user))
to_chat(user, SPAN_NOTICE("Slicing lattice joints ..."))
@@ -118,7 +118,7 @@
layer = CATWALK_LAYER
/obj/structure/lattice/catwalk/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(1, user))
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
@@ -131,7 +131,7 @@
qdel(src)
/obj/structure/lattice/catwalk/indoor/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(attacking_item.use_tool(src, user, 5, volume = 50))
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "" : "un"]anchor [src]."))
@@ -158,7 +158,7 @@
var/damaged = FALSE
/obj/structure/lattice/catwalk/indoor/grate/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder() && damaged)
+ if(attacking_item.tool_behaviour == TOOL_WELDER && damaged)
var/obj/item/weldingtool/WT = attacking_item
if(attacking_item.use_tool(src, user, 5, volume = 50) && WT.use(1, user))
user.visible_message(
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 7afa8d556c3..6ab7b5be792 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -93,7 +93,7 @@
else return ..()
/obj/structure/morgue/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
var/t = tgui_input_text(user, "What would you like the label to be?", "Morgue", "", MAX_NAME_LEN)
if(user.get_active_hand() != attacking_item)
return
diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm
index 275691e9275..7388ee1eb2a 100644
--- a/code/game/objects/structures/noticeboard.dm
+++ b/code/game/objects/structures/noticeboard.dm
@@ -78,9 +78,9 @@
if((P && P.loc == src)) //ifthe paper's on the board
var/obj/item/R = usr.r_hand
var/obj/item/L = usr.l_hand
- if(R.ispen())
+ if(R.tool_behaviour == TOOL_PEN)
P.attackby(R, usr)
- else if(L.ispen())
+ else if(L.tool_behaviour == TOOL_PEN)
P.attackby(L, usr)
else
to_chat(usr, SPAN_NOTICE("You'll need something to write with!"))
diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm
index 7fff6db9a8f..30ed9983ea3 100644
--- a/code/game/objects/structures/plasticflaps.dm
+++ b/code/game/objects/structures/plasticflaps.dm
@@ -99,7 +99,7 @@
/obj/structure/plasticflaps/attackby(obj/item/attacking_item, mob/user)
if(manipulating) return
- if(attacking_item.iswirecutter() || attacking_item.sharp && !attacking_item.noslice)
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || attacking_item.sharp && !attacking_item.noslice)
manipulating = TRUE
visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."),
SPAN_NOTICE("You begin cutting down \the [src]."))
diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm
index 928d626e975..42e76802f5d 100644
--- a/code/game/objects/structures/railing.dm
+++ b/code/game/objects/structures/railing.dm
@@ -262,7 +262,7 @@
return
// Dismantle
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!can_wrench)
to_chat(user, SPAN_WARNING("This [src] cannot be adjusted."))
return
@@ -287,7 +287,7 @@
update_icon()
return
// Repair
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/F = attacking_item
if(F.isOn())
if(health >= maxhealth)
@@ -302,7 +302,7 @@
return
// Install
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!can_screwdriver)
to_chat(user, SPAN_WARNING("This [src] cannot be adjusted."))
return
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index e2dc20c6e55..48d68658062 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -23,7 +23,7 @@
qdel(src)
/obj/structure/sign/attackby(obj/item/attacking_item, mob/user) // Deconstruction.
- if(attacking_item.isscrewdriver() && !istype(src, /obj/structure/sign/double))
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && !istype(src, /obj/structure/sign/double))
user.visible_message(SPAN_NOTICE("\The [user] starts to unfasten \the [src]."), SPAN_NOTICE("You start to unfasten \the [src]."))
if(attacking_item.use_tool(src, user, 0, volume = 50))
unfasten(user)
@@ -54,7 +54,7 @@
pickup_sound = 'sound/items/pickup/axe.ogg'
/obj/item/sign/attackby(obj/item/attacking_item, mob/user) // Construction.
- if(attacking_item.isscrewdriver() && isturf(user.loc))
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && isturf(user.loc))
var/direction = tgui_input_list(user, "In which direction?", "Select Direction", list("North", "East", "South", "West", "Cancel"))
if(direction == "Cancel") return
if(QDELETED(src)) //Prevents spawning multiple new signs with queued dialogues
diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
index 0d8a96d7f3e..73897da5d22 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -159,7 +159,7 @@
return
/obj/structure/bed/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(can_dismantle)
dismantle(attacking_item, user)
else if(istype(attacking_item,/obj/item/stack))
@@ -191,7 +191,7 @@
add_padding(padding_type)
return
- else if (attacking_item.iswirecutter())
+ else if (attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(!can_pad)
return
if(!padding_material)
@@ -202,7 +202,7 @@
painted_colour = null
remove_padding()
- else if (attacking_item.isscrewdriver())
+ else if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(anchored)
anchored = FALSE
to_chat(user, "You unfasten \the [src] from floor.")
@@ -450,7 +450,7 @@
.=..()
/obj/structure/bed/roller/attackby(obj/item/attacking_item, mob/user)
- if(iswrench(attacking_item) || istype(attacking_item, /obj/item/stack) || iswirecutter(attacking_item))
+ if(attacking_item.tool_behaviour == TOOL_WRENCH || istype(attacking_item, /obj/item/stack) || attacking_item.tool_behaviour == TOOL_WIRECUTTER)
return 1
if(istype(attacking_item, /obj/item/vitals_monitor))
if(vitals)
@@ -798,7 +798,7 @@
update_icon()
/obj/structure/roller_rack/attackby(obj/item/attacking_item, mob/user)
- if(iswrench(attacking_item))
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "bolt" : "unbolt"] \the [src] [anchored ? "to" : "from"] the ground."))
diff --git a/code/game/objects/structures/survey_probe.dm b/code/game/objects/structures/survey_probe.dm
index 953e3c5308b..0a52fc57347 100644
--- a/code/game/objects/structures/survey_probe.dm
+++ b/code/game/objects/structures/survey_probe.dm
@@ -48,7 +48,7 @@
deploy()
/obj/structure/survey_probe/attackby(obj/item/attacking_item, mob/user, params)
- if(!timer_id && attacking_item.iswrench())
+ if(!timer_id && attacking_item.tool_behaviour == TOOL_WRENCH)
if(!anchored)
user.visible_message(
SPAN_NOTICE("\The [user] unfastens the locking bolts on \the [src], deploying it."),
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 38ecfda0437..813cdc4ca7d 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -122,7 +122,7 @@
to_chat(user, SPAN_WARNING("\The [src] is full."))
updateUsrDialog()
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(anchored)
to_chat(user, SPAN_NOTICE("You lean down and unwrench \the [src]."))
anchored = FALSE
diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm
index 569fa63de0c..b636261e24c 100644
--- a/code/game/objects/structures/target_stake.dm
+++ b/code/game/objects/structures/target_stake.dm
@@ -22,7 +22,7 @@
to_chat(user, SPAN_NOTICE("You slide \the [attacking_item] into the stake."))
set_target(attacking_item)
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(pinned_target)
to_chat(user, SPAN_WARNING("You cannot dismantle \the [src] while it has a target attached."))
return
diff --git a/code/game/objects/structures/therapy.dm b/code/game/objects/structures/therapy.dm
index 24a6358b0fa..fbb6d240c84 100644
--- a/code/game/objects/structures/therapy.dm
+++ b/code/game/objects/structures/therapy.dm
@@ -139,7 +139,7 @@
START_PROCESSING(SSfast_process, src)
/obj/structure/metronome/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
if(anchored)
to_chat(user, SPAN_NOTICE("You unanchor \the [src] and it destabilizes."))
diff --git a/code/game/objects/structures/urban.dm b/code/game/objects/structures/urban.dm
index b97ea7f6a7f..b80d6c73adc 100644
--- a/code/game/objects/structures/urban.dm
+++ b/code/game/objects/structures/urban.dm
@@ -332,7 +332,7 @@ ABSTRACT_TYPE(/obj/structure/stairs/urban/road_ramp)
var/open = 0
/obj/structure/manhole/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
playsound(src.loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
to_chat(user, "You forcibly relocate the manhole, hopefully in the right way.")
if(!open)
diff --git a/code/game/objects/structures/vr/_remote_chair.dm b/code/game/objects/structures/vr/_remote_chair.dm
index 9351c4c6dd0..568d5461343 100644
--- a/code/game/objects/structures/vr/_remote_chair.dm
+++ b/code/game/objects/structures/vr/_remote_chair.dm
@@ -26,7 +26,7 @@
return
/obj/structure/bed/stool/chair/remote/attackby(obj/item/attacking_item, mob/user)
- if(portable_type && attacking_item.iswrench())
+ if(portable_type && attacking_item.tool_behaviour == TOOL_WRENCH)
user.visible_message(SPAN_NOTICE("\The [user] starts dismantling \the [src]..."), SPAN_NOTICE("You start dismantling \the [src]..."))
if(do_after(user, 20 SECONDS, src, DO_REPAIR_CONSTRUCT))
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 4769cd5da38..2ee483ca918 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -45,7 +45,7 @@
icon_state = "toilet[open][cistern]"
/obj/structure/toilet/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("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(attacking_item.use_tool(src, user, 30, volume = 0))
@@ -188,7 +188,7 @@
/obj/machinery/shower/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.type == /obj/item/device/analyzer)
to_chat(user, SPAN_NOTICE("The water temperature seems to be [watertemp]."))
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
to_chat(user, SPAN_NOTICE("You begin to adjust the temperature valve with \the [attacking_item]."))
if(attacking_item.use_tool(src, user, 50, volume = 50))
diff --git a/code/game/objects/structures/weapons_rack.dm b/code/game/objects/structures/weapons_rack.dm
index 2eaed49d684..68290d96424 100644
--- a/code/game/objects/structures/weapons_rack.dm
+++ b/code/game/objects/structures/weapons_rack.dm
@@ -96,7 +96,7 @@
balloon_alert(user, "it won't budge!")
to_chat(user, SPAN_WARNING("You lack the required access to operate this rack's lock, or the lock mechanism is broken."))
- else if(locked && attacking_item.iswelder())
+ else if(locked && attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
balloon_alert_to_viewers("cutting through the lock...")
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 35e36c70a94..80bd891a2e6 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -72,7 +72,7 @@
//I really should have spread this out across more states but thin little windoors are hard to sprite.
switch(state)
if("01")
- if(attacking_item.iswelder() && !anchored)
+ if(attacking_item.tool_behaviour == TOOL_WELDER && !anchored)
var/obj/item/weldingtool/WT = attacking_item
if (WT.use(0,user))
user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.")
@@ -90,7 +90,7 @@
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
- if(attacking_item.iswrench() && !anchored)
+ if(attacking_item.tool_behaviour == TOOL_WRENCH && !anchored)
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
if(attacking_item.use_tool(src, user, 40, volume = 50))
@@ -103,7 +103,7 @@
src.name = "Anchored Windoor Assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
- else if(attacking_item.iswrench() && anchored)
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && anchored)
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
if(attacking_item.use_tool(src, user, 40, volume = 50))
@@ -133,7 +133,7 @@
src.name = "Secure Windoor Assembly"
//Adding cable to the assembly. Step 5 complete.
- else if(attacking_item.iscoil() && anchored)
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
var/obj/item/stack/cable_coil/CC = attacking_item
@@ -151,7 +151,7 @@
if("02")
//Removing wire from the assembly. Step 5 undone.
- if(attacking_item.iswirecutter() && !src.electronics)
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER && !src.electronics)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
@@ -184,7 +184,7 @@
EL.is_installed = 0
//Screwdriver to remove airlock electronics. Step 6 undone.
- else if(attacking_item.isscrewdriver() && src.electronics)
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && src.electronics)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
if(attacking_item.use_tool(src, user, 40, volume = 50))
@@ -199,7 +199,7 @@
ae.forceMove(src.loc)
//Crowbar to complete the assembly, Step 7 complete.
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!src.electronics)
to_chat(usr, SPAN_WARNING("The assembly is missing electronics."))
return
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 4ab406e4e11..78a1e15e233 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -267,7 +267,7 @@
if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)
return
- if(attacking_item.isscrewdriver() && user.a_intent != I_HURT)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && user.a_intent != I_HURT)
if(reinf && state >= 1)
state = 3 - state
update_nearby_icons()
@@ -286,11 +286,11 @@
to_chat(user, (anchored ? SPAN_NOTICE("You have fastened the window to the floor.") : SPAN_NOTICE("You have unfastened the window.")))
update_icon()
update_nearby_icons()
- else if(attacking_item.iscrowbar() && reinf && state <= 1 && user.a_intent != I_HURT)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && reinf && state <= 1 && user.a_intent != I_HURT)
state = 1 - state
attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, (state ? SPAN_NOTICE("You have pried the window into the frame.") : SPAN_NOTICE("You have pried the window out of the frame.")))
- else if(attacking_item.iswrench() && !anchored && (!state || !reinf) && user.a_intent != I_HURT)
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && !anchored && (!state || !reinf) && user.a_intent != I_HURT)
if(!glasstype)
to_chat(user, SPAN_NOTICE("You're not sure how to dismantle \the [src] properly."))
else
@@ -698,7 +698,7 @@
if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)
return
- if(attacking_item.isscrewdriver() && user.a_intent != I_HURT)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && user.a_intent != I_HURT)
if(state == 2)
if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You have unfastened the glass from the window frame."))
@@ -709,7 +709,7 @@
to_chat(user, SPAN_NOTICE("You have fastened the glass to the window frame."))
state++
update_nearby_icons()
- else if(attacking_item.iscrowbar() && user.a_intent != I_HURT)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && user.a_intent != I_HURT)
if(state == 1)
if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You pry the glass out of the window frame."))
@@ -720,7 +720,7 @@
to_chat(user, SPAN_NOTICE("You pry the glass into the window frame."))
state++
update_nearby_icons()
- else if(attacking_item.iswrench() && user.a_intent != I_HURT)
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && user.a_intent != I_HURT)
if(state == 0)
user.visible_message(SPAN_DANGER("\The [user] is dismantling \the [src]!"))
if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm
index 45b5f9fb6ea..21e15b21fc0 100644
--- a/code/game/turfs/simulated/floor_attackby.dm
+++ b/code/game/turfs/simulated/floor_attackby.dm
@@ -4,7 +4,7 @@
return 0
if(flooring && (!ismob(user) || user.a_intent != I_HURT))
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(broken || burnt)
to_chat(user, SPAN_NOTICE("You remove the broken [flooring.descriptor]."))
make_plating()
@@ -18,14 +18,14 @@
return
playsound(src, 'sound/items/crowbar_tile.ogg', 80, 1)
return
- else if(attacking_item.isscrewdriver() && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
if(broken || burnt)
return
to_chat(user, SPAN_NOTICE("You unscrew and remove the [flooring.descriptor]."))
make_plating(1)
attacking_item.play_tool_sound(get_turf(src), 80)
return
- else if(attacking_item.iswrench() && (flooring.flags & TURF_REMOVE_WRENCH))
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && (flooring.flags & TURF_REMOVE_WRENCH))
to_chat(user, SPAN_NOTICE("You unwrench and remove the [flooring.descriptor]."))
make_plating(1)
attacking_item.play_tool_sound(get_turf(src), 80)
@@ -35,7 +35,7 @@
make_plating(1)
attacking_item.play_tool_sound(get_turf(src), 80)
return
- else if(attacking_item.iswelder() && (flooring.flags & TURF_REMOVE_WELDER))
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && (flooring.flags & TURF_REMOVE_WELDER))
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [WT] isn't turned on."))
@@ -45,12 +45,12 @@
make_plating(1)
attacking_item.play_tool_sound(get_turf(src), 80)
return
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
to_chat(user, SPAN_WARNING("You must remove the [flooring.descriptor] first."))
return
else
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
if(broken || burnt)
to_chat(user, SPAN_WARNING("This section is too damaged to support anything. Use a welder to fix the damage."))
return
@@ -88,7 +88,7 @@
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
return
// Repairs and deconstruction
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
var/area/A = get_area(src)
if(A && (A.area_flags & AREA_FLAG_INDESTRUCTIBLE_TURFS))
return
@@ -111,7 +111,7 @@
T.visible_message(SPAN_DANGER("The ceiling above has been pried off!"))
return
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = attacking_item
if(welder.isOn() && (is_plating()))
if(broken || burnt)
diff --git a/code/game/turfs/simulated/floor_static.dm b/code/game/turfs/simulated/floor_static.dm
index de428f949c7..dced35a076f 100644
--- a/code/game/turfs/simulated/floor_static.dm
+++ b/code/game/turfs/simulated/floor_static.dm
@@ -8,7 +8,7 @@
initial_flooring = null
/turf/simulated/floor/fixed/attackby(obj/item/attacking_item, mob/user)
- if(istype(attacking_item, /obj/item/stack) && !attacking_item.iscoil())
+ if(istype(attacking_item, /obj/item/stack) && attacking_item.tool_behaviour != TOOL_CABLECOIL)
return
return ..()
diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm
index 5561a1f268b..7c1e82abc94 100644
--- a/code/game/turfs/simulated/wall_attacks.dm
+++ b/code/game/turfs/simulated/wall_attacks.dm
@@ -122,7 +122,7 @@
burn(is_hot(attacking_item))
if(locate(/obj/effect/overlay/wallrot) in src)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0,user))
to_chat(user, SPAN_NOTICE("You burn away the fungi with \the [WT]."))
@@ -167,7 +167,7 @@
var/turf/T = user.loc //get user's location for delay checks
- if(damage && attacking_item.iswelder())
+ if(damage && attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
@@ -193,7 +193,7 @@
var/dismantle_verb
var/dismantle_sound
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return
@@ -266,14 +266,14 @@
else
switch(construction_stage)
if(6)
- if (attacking_item.iswirecutter())
+ if (attacking_item.tool_behaviour == TOOL_WIRECUTTER)
playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
construction_stage = 5
to_chat(user, SPAN_NOTICE("You cut the outer grille."))
update_icon()
return
if(5)
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You begin removing the support lines."))
attacking_item.play_tool_sound(get_turf(src), 100)
if(!attacking_item.use_tool(src, user, 60, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
@@ -292,7 +292,7 @@
return
if(4)
var/cut_cover
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return
@@ -312,7 +312,7 @@
to_chat(user, SPAN_NOTICE("You press firmly on the cover, dislodging it."))
return
if(3)
- if (attacking_item.iscrowbar())
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("You struggle to pry off the cover."))
if(!attacking_item.use_tool(src, user , 100, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
return
@@ -321,7 +321,7 @@
to_chat(user, SPAN_NOTICE("You pry off the cover."))
return
if(2)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You start loosening the anchoring bolts which secure the support rods to their frame."))
if(!attacking_item.use_tool(src, user , 40, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
return
@@ -331,7 +331,7 @@
return
if(1)
var/cut_cover
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if( WT.use(0,user) )
cut_cover=1
@@ -350,7 +350,7 @@
to_chat(user, SPAN_NOTICE("The support rods drop out as you cut them loose from the frame."))
return
if(0)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_NOTICE("You struggle to pry off the outer sheath."))
if(!attacking_item.use_tool(src, user , 100, volume = 50)) return
if(!istype(src, /turf/simulated/wall) || !user || !attacking_item || !T ) return
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 42fb7f3d3c6..72953f7bb1a 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -524,7 +524,7 @@
if(istype(attacking_item, /obj/item/grab))
var/obj/item/grab/grab = attacking_item
step(grab.affecting, get_dir(grab.affecting, src))
- if (can_lay_cable() && attacking_item.iscoil())
+ if (can_lay_cable() && attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/coil = attacking_item
coil.turf_place(src, user)
else
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index f23ac2b6993..759e61a0b19 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -95,7 +95,7 @@
if(!A.secured && !secured)
attach_assembly(A, user)
return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(toggle_secure())
to_chat(user, SPAN_NOTICE("\The [src] is ready!"))
else
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index b4785ed0f5c..f702df3e072 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -27,7 +27,7 @@
if(istype(attacking_item, /obj/item/device/analyzer))
bombtank.attackby(attacking_item, user)
return
- if(!status && (attacking_item.iswrench() || istype(attacking_item, /obj/item/wirecutters/bomb))) //This is basically bomb assembly code inverted. apparently it works.
+ if(!status && (attacking_item.tool_behaviour == TOOL_WRENCH || istype(attacking_item, /obj/item/wirecutters/bomb))) //This is basically bomb assembly code inverted. apparently it works.
to_chat(user, SPAN_NOTICE("You disassemble \the [src]."))
bombassembly.forceMove(get_turf(user))
@@ -41,7 +41,7 @@
qdel(src)
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.welding)
return
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index 9fdc3e58ff9..313d2f9d7fa 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -130,7 +130,7 @@
return ..()
/obj/item/device/assembly_holder/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!a_left || !a_right)
to_chat(user, SPAN_DANGER("BUG: Assembly part missing, please report this!"))
return
diff --git a/code/modules/atmospherics/components/binary_devices/circulator.dm b/code/modules/atmospherics/components/binary_devices/circulator.dm
index 29d07488918..c510ad6cc79 100644
--- a/code/modules/atmospherics/components/binary_devices/circulator.dm
+++ b/code/modules/atmospherics/components/binary_devices/circulator.dm
@@ -97,7 +97,7 @@
return TRUE
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
index b55aa1acede..4daeeb04140 100644
--- a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
+++ b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
@@ -58,7 +58,7 @@
. += "Its outlet port is to the [dir2text(dir)]."
/obj/machinery/atmospherics/binary/oxyregenerator/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/modules/atmospherics/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/components/binary_devices/passive_gate.dm
index fbde575f30c..c73c85a1720 100644
--- a/code/modules/atmospherics/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/components/binary_devices/passive_gate.dm
@@ -327,7 +327,7 @@
return
/obj/machinery/atmospherics/binary/passive_gate/attackby(obj/item/attacking_item, mob/user)
- if (!attacking_item.iswrench())
+ if (attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
if (unlocked)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
diff --git a/code/modules/atmospherics/components/binary_devices/pump.dm b/code/modules/atmospherics/components/binary_devices/pump.dm
index 57dbd63c4a5..26a5e9856d4 100644
--- a/code/modules/atmospherics/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/components/binary_devices/pump.dm
@@ -274,7 +274,7 @@ Thus, the two variables affect pump operation are set in New():
update_icon()
/obj/machinery/atmospherics/binary/pump/attackby(obj/item/attacking_item, mob/user)
- if (!attacking_item.iswrench() && !istype(attacking_item, /obj/item/pipewrench))
+ if (attacking_item.tool_behaviour != TOOL_WRENCH && !istype(attacking_item, /obj/item/pipewrench))
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench this [src], turn it off first."))
diff --git a/code/modules/atmospherics/components/omni_devices/omni_base.dm b/code/modules/atmospherics/components/omni_devices/omni_base.dm
index 16ef189223a..043a241e100 100644
--- a/code/modules/atmospherics/components/omni_devices/omni_base.dm
+++ b/code/modules/atmospherics/components/omni_devices/omni_base.dm
@@ -83,7 +83,7 @@
update_icon()
/obj/machinery/atmospherics/omni/attackby(obj/item/attacking_item, mob/user)
- if(!attacking_item.iswrench())
+ if(attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
var/int_pressure = 0
diff --git a/code/modules/atmospherics/components/portables_connector.dm b/code/modules/atmospherics/components/portables_connector.dm
index 88533010c92..9411793a592 100644
--- a/code/modules/atmospherics/components/portables_connector.dm
+++ b/code/modules/atmospherics/components/portables_connector.dm
@@ -154,7 +154,7 @@
/obj/machinery/atmospherics/portables_connector/attackby(obj/item/attacking_item, mob/user)
- if (!attacking_item.iswrench())
+ if (attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
if (connected_device)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], dettach \the [connected_device] first."))
diff --git a/code/modules/atmospherics/components/tvalve.dm b/code/modules/atmospherics/components/tvalve.dm
index fa770df2f37..42a8db1e453 100644
--- a/code/modules/atmospherics/components/tvalve.dm
+++ b/code/modules/atmospherics/components/tvalve.dm
@@ -347,7 +347,7 @@
go_to_side()
/obj/machinery/atmospherics/tvalve/attackby(obj/item/attacking_item, mob/user)
- if (!attacking_item.iswrench())
+ if (attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], it's too complicated."))
diff --git a/code/modules/atmospherics/components/unary/heat_exchanger.dm b/code/modules/atmospherics/components/unary/heat_exchanger.dm
index 09b6f4a1caf..4766c1d3c6c 100644
--- a/code/modules/atmospherics/components/unary/heat_exchanger.dm
+++ b/code/modules/atmospherics/components/unary/heat_exchanger.dm
@@ -64,7 +64,7 @@
return TRUE
/obj/machinery/atmospherics/unary/heat_exchanger/attackby(obj/item/attacking_item, mob/user)
- if(!attacking_item.iswrench())
+ if(attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
var/turf/T = src.loc
if(level == 1 && isturf(T) && !T.is_plating())
diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm
index 2ba5fb08fc8..100826a9b1d 100644
--- a/code/modules/atmospherics/components/unary/vent_pump.dm
+++ b/code/modules/atmospherics/components/unary/vent_pump.dm
@@ -394,7 +394,7 @@
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if (!WT.welding)
to_chat(user, SPAN_DANGER("\The [WT] must be turned on!"))
@@ -436,7 +436,7 @@
playsound(loc, 'sound/items/welder_pry.ogg', 50, TRUE)
update_icon()
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm
index f8f766a1469..d8a1a0bf6a5 100644
--- a/code/modules/atmospherics/components/unary/vent_scrubber.dm
+++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm
@@ -358,7 +358,7 @@
update_icon()
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
if (!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
return TRUE
@@ -383,7 +383,7 @@
qdel(src)
return TRUE
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
diff --git a/code/modules/atmospherics/components/valve.dm b/code/modules/atmospherics/components/valve.dm
index a0fac9cfeef..5a79e98a523 100644
--- a/code/modules/atmospherics/components/valve.dm
+++ b/code/modules/atmospherics/components/valve.dm
@@ -319,7 +319,7 @@
open()
/obj/machinery/atmospherics/valve/attackby(obj/item/attacking_item, mob/user)
- if (!attacking_item.iswrench())
+ if (attacking_item.tool_behaviour != TOOL_WRENCH)
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital))
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], it's too complicated."))
diff --git a/code/modules/atmospherics/pipes.dm b/code/modules/atmospherics/pipes.dm
index d8c98bd0ecc..d2e01d27908 100644
--- a/code/modules/atmospherics/pipes.dm
+++ b/code/modules/atmospherics/pipes.dm
@@ -103,7 +103,7 @@
A.analyze_gases(src, user)
return FALSE
- if (!attacking_item.iswrench() && !istype(attacking_item, /obj/item/pipewrench))
+ if (attacking_item.tool_behaviour != TOOL_WRENCH && !istype(attacking_item, /obj/item/pipewrench))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 034b4f7a0f9..31d744f205a 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -140,7 +140,7 @@
/obj/machinery/gateway/centerstation/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, "\black The gate is already calibrated, there is no work for you to do here.")
return
@@ -243,7 +243,7 @@
/obj/machinery/gateway/centeraway/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == 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/blob/blob.dm b/code/modules/blob/blob.dm
index b103d05dbf6..46d7e19b541 100644
--- a/code/modules/blob/blob.dm
+++ b/code/modules/blob/blob.dm
@@ -215,7 +215,7 @@
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
playsound(get_turf(src), 'sound/effects/attackblob.ogg', 50, TRUE)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(!pruned)
to_chat(user, SPAN_NOTICE("You collect a sample from \the [src]."))
var/obj/P = new product(get_turf(user))
@@ -230,7 +230,7 @@
switch(attacking_item.damtype)
if(DAMAGE_BURN)
damage = (attacking_item.force / fire_resist)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
playsound(get_turf(src), 'sound/items/Welder.ogg', 100, TRUE)
if(DAMAGE_BRUTE)
damage = (attacking_item.force / brute_resist)
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index 86730a558ad..db15757d7e5 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -9,9 +9,9 @@
return 0
/obj/item/clothing/attackby(obj/item/attacking_item, mob/user)
- if(IC && (istype(attacking_item, /obj/item/integrated_circuit) || attacking_item.iswrench() || attacking_item.iscrowbar() || \
+ if(IC && (istype(attacking_item, /obj/item/integrated_circuit) || attacking_item.tool_behaviour == TOOL_WRENCH || attacking_item.tool_behaviour == TOOL_CROWBAR || \
istype(attacking_item, /obj/item/device/integrated_electronics/wirer) || istype(attacking_item, /obj/item/device/integrated_electronics/debugger) || \
- attacking_item.ismultitool() || attacking_item.isscrewdriver() || istype(attacking_item, /obj/item/cell/device)))
+ attacking_item.tool_behaviour == TOOL_MULTITOOL || attacking_item.tool_behaviour == TOOL_SCREWDRIVER || istype(attacking_item, /obj/item/cell/device)))
IC.attackby(attacking_item, user)
diff --git a/code/modules/clothing/gloves/attackby.dm b/code/modules/clothing/gloves/attackby.dm
index ad22ec8315a..2e5be29ca23 100644
--- a/code/modules/clothing/gloves/attackby.dm
+++ b/code/modules/clothing/gloves/attackby.dm
@@ -1,5 +1,5 @@
/obj/item/clothing/gloves/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/siemens_percentage = 100 * siemens_coefficient
to_chat(user, SPAN_NOTICE("You probe \the [src] with \the [attacking_item]. The gloves will let [siemens_percentage]% of an electric shock through."))
return
@@ -33,7 +33,7 @@
return
//add wires
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if (clipped)
to_chat(user, SPAN_NOTICE("The [src] are too badly mangled for wiring."))
@@ -66,7 +66,7 @@
update_icon()
return
- else if((cell || wired) && (attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel)))
+ else if((cell || wired) && (attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/surgery/scalpel)))
//stunglove stuff
if(cell)
diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm
index 9843c4395d7..bf59a8d3e3a 100644
--- a/code/modules/clothing/gloves/boxing.dm
+++ b/code/modules/clothing/gloves/boxing.dm
@@ -6,7 +6,7 @@
species_restricted = list("exclude",BODYTYPE_VAURCA_BREEDER,BODYTYPE_VAURCA_WARFORM,BODYTYPE_VAURCA_BULWARK)
/obj/item/clothing/gloves/boxing/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel))
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/surgery/scalpel))
to_chat(user, SPAN_NOTICE("That won't work.")) //Nope)
return
..()
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index c8fedef8bfc..5d1cca4d435 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -167,7 +167,7 @@
/obj/item/clothing/head/pumpkin/lantern/attackby(obj/item/attacking_item, mob/user)
..()
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light()
diff --git a/code/modules/clothing/sets/laser_tag.dm b/code/modules/clothing/sets/laser_tag.dm
index 97511bcb9e1..94ef1ea77bd 100644
--- a/code/modules/clothing/sets/laser_tag.dm
+++ b/code/modules/clothing/sets/laser_tag.dm
@@ -49,7 +49,7 @@
return ..()
/obj/item/clothing/suit/armor/riot/laser_tag/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/chosen_color = tgui_input_list(user, "Which color do you wish your vest to be?", "Color Selection", list("blue", "red"))
if(!chosen_color)
return
@@ -89,7 +89,7 @@
get_tag_color(laser_tag_color)
/obj/item/clothing/head/helmet/riot/laser_tag/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/chosen_color = tgui_input_list(user, "Which color do you wish your helmet to be?", "Color Selection", list("blue", "red"))
if(!chosen_color)
return
diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm
index e5d76c5b005..097cf3cf777 100644
--- a/code/modules/clothing/spacesuits/breaches.dm
+++ b/code/modules/clothing/spacesuits/breaches.dm
@@ -199,7 +199,7 @@ GLOBAL_LIST_INIT(breach_burn_descriptors, list(
repair_breaches(DAMAGE_BURN, use_amt * repair_power, user)
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(istype(src.loc,/mob/living))
to_chat(user, SPAN_WARNING("How do you intend to patch a voidsuit while someone is wearing it?"))
diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm
index df01181f28a..25b197df7a9 100644
--- a/code/modules/clothing/spacesuits/rig/modules/modules.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm
@@ -87,7 +87,7 @@
paste.use(1)
return
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
switch(damage)
if(0)
to_chat(user, SPAN_WARNING("There is no damage to mend."))
diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm
index 51f0945b435..f22c997ff3c 100644
--- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm
@@ -8,7 +8,7 @@
return
// Pass repair items on to the chestpiece.
- if(chest && (istype(attacking_item, /obj/item/stack/material) || attacking_item.iswelder()))
+ if(chest && (istype(attacking_item, /obj/item/stack/material) || attacking_item.tool_behaviour == TOOL_WELDER))
return chest.attackby(attacking_item, user)
// Lock or unlock the access panel.
@@ -31,7 +31,7 @@
to_chat(user, SPAN_NOTICE("You [locked ? "lock" : "unlock"] \the [src] access panel."))
return
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!open && locked)
//Ask to confirm the attempt, otherwise leave
@@ -123,7 +123,7 @@
src.cell = attacking_item
return
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!air_supply)
to_chat(user, SPAN_WARNING("There is no tank to remove."))
@@ -137,7 +137,7 @@
air_supply = null
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
var/list/current_mounts = list()
if(cell) current_mounts += "cell"
diff --git a/code/modules/clothing/spacesuits/rig/rig_construction.dm b/code/modules/clothing/spacesuits/rig/rig_construction.dm
index 0329ef3d937..6f20ea71256 100644
--- a/code/modules/clothing/spacesuits/rig/rig_construction.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_construction.dm
@@ -204,22 +204,22 @@
/datum/construction/reversible/rig_assembly/custom_action(index as num, diff as num, atom/used_atom, mob/user as mob)
var/obj/item/I = used_atom
- if(I.iswelder())
+ if(I.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/W = I
if (W.use(0, user))
playsound(holder, 'sound/items/welder_pry.ogg', 50, 1)
else
return 0
- else if(I.iswrench())
+ else if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(get_turf(I), 50)
- else if(I.isscrewdriver())
+ else if(I.tool_behaviour == TOOL_SCREWDRIVER)
I.play_tool_sound(get_turf(I), 50)
- else if(I.iswirecutter())
+ else if(I.tool_behaviour == TOOL_WIRECUTTER)
I.play_tool_sound(get_turf(I), 50)
- else if(I.iscoil())
+ else if(I.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = used_atom
if(C.use(4))
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)
@@ -238,31 +238,31 @@
/datum/construction/reversible/rig_assembly/civilian
steps = list(
//1
- list("key"=/obj/item/weldingtool,
- "backkey"=WRENCH,
+ list("key"=TOOL_WELDER,
+ "backkey"=TOOL_WRENCH,
"desc"="The external armor has been wrenched down, use a welding tool to finish it off, or use a wrench to unsecure the external armor."),
//2
- list("key"=WRENCH,
- "backkey"=/obj/item/crowbar,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="The external armor has been installed, use a wrench to secure it, or use a crowbar to pry it out of place."),
//3
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/screwdriver,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The central control module has been secured, add some steel to install external armor, or use a screwdriver to unsecure the control module."),
//4
- list("key"=SCREWDRIVER,
- "backkey"=/obj/item/crowbar,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="The central control module has been installed, use a screwdriver to secure it, or use a crowbar to pry it out."),
//5
list("key"=null,
- "backkey"=/obj/item/wirecutters,
+ "backkey"=TOOL_WIRECUTTER,
"desc"="The wiring has been adjusted, install the central control module to continue, or use a wirecutter to unset the wires."),
//6
- list("key"=WIRECUTTER,
- "backkey"=/obj/item/screwdriver,
+ list("key"=TOOL_WIRECUTTER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring has been added, use a wirecutter to properly adjust them, or use a screwdriver to remove them."),
//7
- list("key"=/obj/item/stack/cable_coil,
+ list("key"=TOOL_CABLECOIL,
"desc"="The assembly lacks wiring, add some to begin."),
)
@@ -331,59 +331,59 @@
/datum/construction/reversible/rig_assembly/combat
steps = list(
//1
- list("key"=/obj/item/weldingtool,
- "backkey"=WRENCH,
+ list("key"=TOOL_WELDER,
+ "backkey"=TOOL_WRENCH,
"desc"="The external armor has been wrenched down, use a welding tool to finish it off, or use a wrench to unsecure the external armor."),
//2
- list("key"=WRENCH,
- "backkey"=CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="The external armor has been installed, use a wrench to secure it, or use a crowbar to pry it out of place."),
//3
list("key"=/obj/item/stack/material/plasteel,
- "backkey"=/obj/item/weldingtool,
+ "backkey"=TOOL_WELDER,
"desc"="The internal armor has been welded into place, add some plasteel to install external armor, or use a welding tool to unweld the internal armor.."),
//4
- list("key"=/obj/item/weldingtool,
- "backkey"=WRENCH,
+ list("key"=TOOL_WELDER,
+ "backkey"=TOOL_WRENCH,
"desc"="The internal armor has been wrenched down, use a welding tool to weld it into place, or use a wrench to unsecure the internal armor."),
//5
- list("key"=WRENCH,
- "backkey"=CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="The internal armor has been installed, use a wrench to secure it, or use a crowbar to pry it out of place."),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The advanced scanner module has been secured, add some steel to install internal armor, or use a screwdriver to unsecure it."),
//7
- list("key"=SCREWDRIVER,
- "backkey"=CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="The advanced scanner module has been installed, use a screwdriver to secure it, or use a crowbar to pry it out."),
//8
list("key"=/obj/item/stock_parts/scanning_module/adv,
- "backkey"=SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The targeting module has been secured, add an advanced scanning module to continue, or use a screwdriver to unsecure it."),
//9
- list("key"=SCREWDRIVER,
- "backkey"=CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="The targeting module has been installed, use a screwdriver to secure it, or use a crowbar to pry it out."),
//10
list("key"=null,
- "backkey"=SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The central control module has been secured, add a targeting module to continue, or use a screwdriver to unsecure it."),
//11
- list("key"=SCREWDRIVER,
- "backkey"=CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="The central control module has been installed, use a screwdriver to secure it, or use a crowbar to pry it out."),
//12
list("key"=null,
- "backkey"=WIRECUTTER,
+ "backkey"=TOOL_WIRECUTTER,
"desc"="The wiring has been adjusted, install the central control module to continue, or use a wirecutter to unset the wires."),
//13
- list("key"=WIRECUTTER,
- "backkey"=SCREWDRIVER,
+ list("key"=TOOL_WIRECUTTER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring has been added, use a wirecutter to properly adjust them, or use a screwdriver to remove them."),
//14
- list("key"=/obj/item/stack/cable_coil,
+ list("key"=TOOL_CABLECOIL,
"desc"="The assembly lacks wiring, add some to begin."),
)
diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm
index 2c81d7891ac..9ef1930b205 100644
--- a/code/modules/clothing/spacesuits/void/void.dm
+++ b/code/modules/clothing/spacesuits/void/void.dm
@@ -268,7 +268,7 @@
to_chat(user, SPAN_WARNING("You cannot modify \the [src] while it is being worn."))
return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(helmet || boots || tank || cooler)
var/choice = tgui_input_list(usr, "What component would you like to remove?", "Component Removal", list(helmet,boots,tank,cooler))
if(!choice) return
diff --git a/code/modules/clothing/wrists/watches.dm b/code/modules/clothing/wrists/watches.dm
index 052b891f3c5..f24c905871b 100644
--- a/code/modules/clothing/wrists/watches.dm
+++ b/code/modules/clothing/wrists/watches.dm
@@ -116,7 +116,7 @@
usr.visible_message (SPAN_NOTICE("[usr] taps their foot on the floor, arrogantly pointing at the [src] on their wrist with a look of derision in their eyes, not noticing it's broken."), SPAN_NOTICE("You point down at the [src] with an arrogant look about your eyes."))
/obj/item/clothing/wrists/watch/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(SPAN_NOTICE("[user] [screwed ? "unscrews" : "screws"] the cover of the [src] [screwed ? "open" : "closed"]."),
SPAN_NOTICE("You [screwed ? "unscrews" : "screws"] the cover of the [src] [screwed ? "open" : "closed"]."))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
@@ -124,7 +124,7 @@
return
if(wired)
return
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(screwed)
to_chat(user, SPAN_NOTICE("The [src] is not open."))
diff --git a/code/modules/cooking/machinery/cooking_machines/_appliance.dm b/code/modules/cooking/machinery/cooking_machines/_appliance.dm
index 891c679b65b..a5fd9ca5063 100644
--- a/code/modules/cooking/machinery/cooking_machines/_appliance.dm
+++ b/code/modules/cooking/machinery/cooking_machines/_appliance.dm
@@ -194,7 +194,7 @@
else if(istype(I, /obj/item/reagent_containers/glass))
to_chat(user, SPAN_WARNING("That would probably break [I]."))
return CANNOT_INSERT
- else if(I.iscrowbar() || I.isscrewdriver() || istype(I, /obj/item/storage/part_replacer))
+ else if(I.tool_behaviour == TOOL_CROWBAR || I.tool_behaviour == TOOL_SCREWDRIVER || istype(I, /obj/item/storage/part_replacer))
return CANNOT_INSERT
else if(!istype(check) && !istype(I, /obj/item/holder))
to_chat(user, SPAN_WARNING("That's not edible."))
diff --git a/code/modules/cooking/machinery/cooking_machines/microwave.dm b/code/modules/cooking/machinery/cooking_machines/microwave.dm
index a5e01f091ff..95c9a69997d 100644
--- a/code/modules/cooking/machinery/cooking_machines/microwave.dm
+++ b/code/modules/cooking/machinery/cooking_machines/microwave.dm
@@ -66,7 +66,7 @@
/obj/machinery/appliance/cooker/microwave/attackby(obj/item/O, mob/living/user, list/click_params)
if (broken)
// Start repairs by using a screwdriver
- if(broken == SCREWDRIVER_BROKEN && O.isscrewdriver())
+ if(broken == SCREWDRIVER_BROKEN && O.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message( \
SPAN_NOTICE("\The [user] starts to fix part of \the [src]."), \
SPAN_NOTICE("You start to fix part of \the [src].") \
@@ -80,7 +80,7 @@
return TRUE
// Finish repairs using a wrench
- if (broken == WRENCH_BROKEN && O.iswrench())
+ if (broken == WRENCH_BROKEN && O.tool_behaviour == TOOL_WRENCH)
user.visible_message( \
SPAN_NOTICE("\The [user] starts to fix part of \the [src]."), \
SPAN_NOTICE("You start to fix part of \the [src].") \
diff --git a/code/modules/cooking/machinery/cooking_machines/oven.dm b/code/modules/cooking/machinery/cooking_machines/oven.dm
index 997b1702b2e..17d45553eaa 100644
--- a/code/modules/cooking/machinery/cooking_machines/oven.dm
+++ b/code/modules/cooking/machinery/cooking_machines/oven.dm
@@ -111,7 +111,7 @@
/obj/machinery/appliance/cooker/oven/proc/manip(var/obj/item/I)
// check if someone's trying to manipulate the machine
- return I.iscrowbar() || I.isscrewdriver() || istype(I, /obj/item/storage/part_replacer) || istype(I, /obj/item/stock_parts)
+ return I.tool_behaviour == TOOL_CROWBAR || I.tool_behaviour == TOOL_SCREWDRIVER || istype(I, /obj/item/storage/part_replacer) || istype(I, /obj/item/stock_parts)
/obj/machinery/appliance/cooker/oven/can_insert(var/obj/item/I, var/mob/user)
if (!open && !manip(I, user))
diff --git a/code/modules/cooking/machinery/smartfridge.dm b/code/modules/cooking/machinery/smartfridge.dm
index 96bdd572e22..19bb8bdd9f9 100644
--- a/code/modules/cooking/machinery/smartfridge.dm
+++ b/code/modules/cooking/machinery/smartfridge.dm
@@ -299,14 +299,14 @@
********************/
/obj/machinery/smartfridge/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
user.visible_message("\The [user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].",
"You [panel_open ? "open" : "close"] the maintenance panel of \the [src].")
update_icon()
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] the bolts holding \the [src] to the floor.",
"You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.")
@@ -314,7 +314,7 @@
power_change()
return
- if(attacking_item.ismultitool() || attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL || attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(panel_open)
switch(input(user, "What would you like to select?", "Machine Debug Software") as null|anything in list("SmartHeater", "MegaSeed Storage", "Slime Extract Storage", "Refrigerated Chemical Storage", "Refrigerated Virus Storage", "Drink Showcase", "Drying Rack"))
if("SmartHeater")
diff --git a/code/modules/custom_ka/core.dm b/code/modules/custom_ka/core.dm
index fceafc04817..519f28ef620 100644
--- a/code/modules/custom_ka/core.dm
+++ b/code/modules/custom_ka/core.dm
@@ -408,7 +408,7 @@
to_chat(user,"You label \the [name] as \"[custom_name]\"")
update_icon()
return TRUE
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(installed_upgrade_chip)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user,"You remove \the [installed_upgrade_chip].")
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index 677f9192ff1..e494847f37f 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -1558,7 +1558,7 @@ All custom items with worn sprites must follow the contained sprite system: http
text = zippomsg
else if(istype(attacking_item, /obj/item/flame/lighter))
text = lightermsg
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
text = weldermsg
else if(istype(attacking_item, /obj/item/device/assembly/igniter))
text = ignitermsg
diff --git a/code/modules/detectivework/tools/evidencebag.dm b/code/modules/detectivework/tools/evidencebag.dm
index 67c9e7242e7..aadbcc66cb2 100644
--- a/code/modules/detectivework/tools/evidencebag.dm
+++ b/code/modules/detectivework/tools/evidencebag.dm
@@ -105,7 +105,7 @@
examinate(user, stored_item, show_extended)
/obj/item/evidencebag/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen() || istype(attacking_item, /obj/item/device/flashlight/pen))
+ if(attacking_item.tool_behaviour == TOOL_PEN || istype(attacking_item, /obj/item/device/flashlight/pen))
var/tmp_label = sanitizeSafe( tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(tmp_label) > MAX_NAME_LEN)
to_chat(user, SPAN_NOTICE("The label can be at most [MAX_NAME_LEN] characters long."))
diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm
index 801ae236a7e..1ada6c2e60e 100644
--- a/code/modules/detectivework/tools/sample_kits.dm
+++ b/code/modules/detectivework/tools/sample_kits.dm
@@ -51,7 +51,7 @@
if(merge_evidence(attacking_item, user))
qdel(attacking_item)
return TRUE
- else if (attacking_item.ispen())
+ else if (attacking_item.tool_behaviour == TOOL_PEN)
var/tmp_label = sanitizeSafe( tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(tmp_label) > MAX_NAME_LEN)
to_chat(user, SPAN_WARNING("The label can be at most [MAX_NAME_LEN] characters long."))
diff --git a/code/modules/fabrication/_fabricator.dm b/code/modules/fabrication/_fabricator.dm
index 3da4d5da912..48cfec94d8c 100644
--- a/code/modules/fabrication/_fabricator.dm
+++ b/code/modules/fabrication/_fabricator.dm
@@ -182,7 +182,7 @@ ABSTRACT_TYPE(/obj/machinery/fabricator)
if(panel_open)
//Don't eat multitools or wirecutters used on an open lathe.
- if(attacking_item.ismultitool() || attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL || attacking_item.tool_behaviour == TOOL_WIRECUTTER )
if(panel_open)
wires.interact(user)
else
diff --git a/code/modules/heavy_vehicle/components/_components.dm b/code/modules/heavy_vehicle/components/_components.dm
index e01b92de2e6..6e5d716b27d 100644
--- a/code/modules/heavy_vehicle/components/_components.dm
+++ b/code/modules/heavy_vehicle/components/_components.dm
@@ -109,7 +109,7 @@
update_components()
/obj/item/mech_component/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(contents.len)
var/obj/item/removed = pick(contents)
user.visible_message(SPAN_NOTICE("\The [user] removes \the [removed] from \the [src]."))
@@ -119,10 +119,10 @@
else
to_chat(user, SPAN_WARNING("There is nothing to remove."))
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
repair_brute_generic(attacking_item, user)
return
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
repair_burn_generic(attacking_item, user)
return
return ..()
diff --git a/code/modules/heavy_vehicle/components/frame.dm b/code/modules/heavy_vehicle/components/frame.dm
index c5eee644fa8..5a82a773e8b 100644
--- a/code/modules/heavy_vehicle/components/frame.dm
+++ b/code/modules/heavy_vehicle/components/frame.dm
@@ -111,7 +111,7 @@
/obj/structure/heavy_vehicle_frame/attackby(obj/item/attacking_item, mob/user)
// Removing components.
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(is_reinforced == FRAME_REINFORCED)
user.visible_message(SPAN_NOTICE("\The [user] crowbars the reinforcement off \the [src]."))
new /obj/item/stack/material/steel(loc, 15)
@@ -138,7 +138,7 @@
return
// Final construction step.
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
// Check for basic components.
if(!(arms && legs && head && body))
@@ -180,7 +180,7 @@
return
// Installing wiring.
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
if(is_wired)
to_chat(user, SPAN_WARNING("\The [src] has already been wired."))
@@ -204,7 +204,7 @@
playsound(user.loc, 'sound/items/Deconstruct.ogg', 50, 1)
is_wired = FRAME_WIRED
// Securing wiring.
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(!is_wired)
to_chat(user, "There is no wiring in \the [src] to neaten.")
return
@@ -229,7 +229,7 @@
else
return ..()
// Securing metal.
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!is_reinforced)
to_chat(user, SPAN_WARNING("There is no metal to secure inside \the [src]."))
return
@@ -240,7 +240,7 @@
attacking_item.play_tool_sound(get_turf(src), 100)
is_reinforced = (is_reinforced == FRAME_REINFORCED_SECURE) ? FRAME_REINFORCED : FRAME_REINFORCED_SECURE
// Welding metal.
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!is_reinforced)
to_chat(user, SPAN_WARNING("There is no metal to secure inside \the [src]."))
diff --git a/code/modules/heavy_vehicle/components/head.dm b/code/modules/heavy_vehicle/components/head.dm
index fc79738e2dc..90035b1a433 100644
--- a/code/modules/heavy_vehicle/components/head.dm
+++ b/code/modules/heavy_vehicle/components/head.dm
@@ -133,7 +133,7 @@
if(istype(attacking_item, /obj/item/circuitboard/exosystem))
install_software(attacking_item, user)
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
var/result = ..()
update_software()
return result
diff --git a/code/modules/heavy_vehicle/equipment/utility.dm b/code/modules/heavy_vehicle/equipment/utility.dm
index c5ce057229f..68e07b7d296 100644
--- a/code/modules/heavy_vehicle/equipment/utility.dm
+++ b/code/modules/heavy_vehicle/equipment/utility.dm
@@ -689,7 +689,7 @@
lathe.attackby(target, owner)
/obj/item/mecha_equipment/autolathe/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver() || attacking_item.ismultitool() || attacking_item.iswirecutter() || istype(attacking_item, /obj/item/storage/part_replacer))
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER || attacking_item.tool_behaviour == TOOL_MULTITOOL || attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/storage/part_replacer))
lathe.attackby(attacking_item, user)
update_icon()
return TRUE
@@ -736,6 +736,7 @@
if(!selected_tool)
return
mounted_tool.current_tool = 1
+ tool_behaviour = mounted_tool.current_tool
for(var/tool in mounted_tool.tools)
if(mounted_tool.tools[mounted_tool.current_tool] == selected_tool)
break
@@ -752,21 +753,12 @@
var/tool_name = capitalize(replacetext(mounted_tool.tools[mounted_tool.current_tool], "bit", ""))
return "Tool: [tool_name]"
-/obj/item/mecha_equipment/toolset/isscrewdriver()
- return mounted_tool.tools[mounted_tool.current_tool] == "screwdriverbit"
-
-/obj/item/mecha_equipment/toolset/iswrench()
- return mounted_tool.tools[mounted_tool.current_tool] == "wrenchbit"
-
-/obj/item/mecha_equipment/toolset/iscrowbar()
- return mounted_tool.tools[mounted_tool.current_tool] == "crowbarbit"
-
/obj/item/powerdrill/mech
name = "mounted toolset"
tools = list(
- "screwdriverbit",
- "wrenchbit",
- "crowbarbit"
+ "screwdriver",
+ "wrench",
+ "crowbar"
)
/obj/item/mecha_equipment/quick_enter
@@ -834,7 +826,7 @@
anomaly_overlay.pixel_y = 3
AddOverlays(anomaly_overlay)
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!AC)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an anomaly core installed!"))
return TRUE
diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm
index 6abf4cee523..be9a4955593 100644
--- a/code/modules/heavy_vehicle/mech_interaction.dm
+++ b/code/modules/heavy_vehicle/mech_interaction.dm
@@ -369,7 +369,7 @@
become_remote()
qdel(attacking_item)
return
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
if(hardpoints_locked)
to_chat(user, SPAN_WARNING("Hardpoint system access is disabled."))
return
@@ -386,7 +386,7 @@
to_chat(user, SPAN_WARNING("\The [src] has no hardpoint systems to remove."))
return
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!remote && length(pilots))
to_chat(user, SPAN_WARNING("You can't disassemble \the [src] while it has a pilot!"))
return
@@ -412,7 +412,7 @@
new remote_type(get_turf(src))
dismantle()
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(!getBruteLoss())
return
var/list/damaged_parts = list()
@@ -423,7 +423,7 @@
if(CanInteract(user, GLOB.physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.brute_damage)
to_fix.repair_brute_generic(attacking_item, user)
return
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
if(!getFireLoss())
return
var/list/damaged_parts = list()
@@ -434,7 +434,7 @@
if(CanInteract(user, GLOB.physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.burn_damage)
to_fix.repair_burn_generic(attacking_item, user)
return
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("The cell compartment remains locked while maintenance protocols are disabled."))
return
diff --git a/code/modules/heavy_vehicle/mech_wreckage.dm b/code/modules/heavy_vehicle/mech_wreckage.dm
index 84031390b41..a4e07b6c4c8 100644
--- a/code/modules/heavy_vehicle/mech_wreckage.dm
+++ b/code/modules/heavy_vehicle/mech_wreckage.dm
@@ -44,7 +44,7 @@
/obj/structure/mech_wreckage/attackby(obj/item/attacking_item, mob/user)
var/cutting
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
cutting = TRUE
@@ -62,7 +62,7 @@
to_chat(user, SPAN_WARNING("\The [src] has already been weakened."))
return 1
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(prepared)
to_chat(user, SPAN_NOTICE("You finish dismantling \the [src]."))
new /obj/item/stack/material/steel(get_turf(src),rand(5,10))
diff --git a/code/modules/holidays/christmas/props.dm b/code/modules/holidays/christmas/props.dm
index 6787d6d8e35..f0f9f7bfe37 100644
--- a/code/modules/holidays/christmas/props.dm
+++ b/code/modules/holidays/christmas/props.dm
@@ -86,7 +86,7 @@
/obj/effect/spresent/attackby(obj/item/attacking_item, mob/user)
..()
- if (!attacking_item.iswirecutter())
+ if (attacking_item.tool_behaviour != TOOL_WIRECUTTER)
to_chat(user, SPAN_WARNING("I need wirecutters for that."))
return
diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm
index eb414eef215..b5dc3123bda 100644
--- a/code/modules/holodeck/HolodeckObjects.dm
+++ b/code/modules/holodeck/HolodeckObjects.dm
@@ -172,11 +172,11 @@
if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON) return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, (SPAN_NOTICE("It's a holowindow, you can't unfasten it!")))
- else if(attacking_item.iscrowbar() && reinf && state <= 1)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && reinf && state <= 1)
to_chat(user, (SPAN_NOTICE("It's a holowindow, you can't pry it!")))
- else if(attacking_item.iswrench() && !anchored && (!state || !reinf))
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && !anchored && (!state || !reinf))
to_chat(user, (SPAN_NOTICE("It's a holowindow, you can't dismantle it!")))
else
if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
@@ -245,7 +245,7 @@
return ..()
/obj/structure/bed/stool/chair/holochair/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, (SPAN_NOTICE("It's a holochair, you can't dismantle it!")))
return
diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm
index 7fb29663c39..443d7a0b85e 100644
--- a/code/modules/hydroponics/beekeeping/beehive.dm
+++ b/code/modules/hydroponics/beekeeping/beehive.dm
@@ -81,12 +81,12 @@
AddOverlays("bees3")
/obj/machinery/beehive/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
closed = !closed
user.visible_message(SPAN_NOTICE("\The [user] [closed ? "closes" : "opens"] \the [src]."), SPAN_NOTICE("You [closed ? "close" : "open"] \the [src]."))
update_icon()
return
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "wrenches" : "unwrenches"] \the [src]."), SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
if(!smoked && !anchored && (bee_count > 10))
@@ -145,7 +145,7 @@
if(smoked)
to_chat(user, SPAN_NOTICE("The hive is smoked."))
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You start dismantling \the [src]. This will take a while..."))
if(attacking_item.use_tool(src, user, 150, volume = 50))
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index 08b170a0a5e..b3287272f4e 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -200,7 +200,7 @@
return
if(seed)
- if(GET_SEED_TRAIT(seed, TRAIT_PRODUCES_POWER) && attacking_item.iscoil())
+ if(GET_SEED_TRAIT(seed, TRAIT_PRODUCES_POWER) && attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(5))
//TODO: generalize this.
diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm
index a4888531514..cb48dede9ef 100644
--- a/code/modules/hydroponics/seed_machines.dm
+++ b/code/modules/hydroponics/seed_machines.dm
@@ -94,13 +94,13 @@
to_chat(user, "You load [attacking_item] into [src].")
return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
open = !open
to_chat(user, SPAN_NOTICE("You [open ? "open" : "close"] the maintenance panel."))
return
if(open)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
dismantle()
return
diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm
index 28908866fe0..e070ab02e20 100644
--- a/code/modules/hydroponics/seed_storage.dm
+++ b/code/modules/hydroponics/seed_storage.dm
@@ -226,7 +226,7 @@
else
to_chat(user, SPAN_WARNING("There are no seeds in \the [attacking_item.name]."))
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm
index 7b3c7da15df..2808bb90b61 100644
--- a/code/modules/hydroponics/spreading/spreading.dm
+++ b/code/modules/hydroponics/spreading/spreading.dm
@@ -261,7 +261,7 @@
user.do_attack_animation(src)
SSplants.add_plant(src)
- if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel))
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/surgery/scalpel))
if(sampled)
to_chat(user, SPAN_WARNING("\The [src] has already been sampled recently."))
return
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index d4dc549af57..dddd0210365 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -542,7 +542,7 @@
if (attacking_item.is_open_container())
return FALSE
- if((attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel)) && !closed_system)
+ if((attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/surgery/scalpel)) && !closed_system)
if(!seed)
to_chat(user, "There is nothing to take a sample from in \the [src].")
return
@@ -668,7 +668,7 @@
qdel(attacking_item)
check_health()
- else if(mechanical && attacking_item.iswrench())
+ else if(mechanical && attacking_item.tool_behaviour == TOOL_WRENCH)
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
return ..()
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index 74bb3f85275..592e93df3a1 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -249,7 +249,7 @@
interact(user)
return TRUE
- else if(attacking_item.iswrench() && can_anchor)
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH && can_anchor)
attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
if(anchored)
@@ -259,14 +259,14 @@
user.visible_message("[user] has wrenched [src]'s anchoring bolts [anchored ? "into" : "out of"] place.", "You wrench [src]'s anchoring bolts [anchored ? "into" : "out of"] place.", "You hear the sound of a ratcheting wrench turning.")
return TRUE
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
attacking_item.play_tool_sound(get_turf(src), 50)
opened = !opened
to_chat(user, SPAN_NOTICE("You [opened ? "open" : "close"] \the [src]."))
update_icon()
return TRUE
- else if(istype(attacking_item, /obj/item/device/integrated_electronics/wirer) || istype(attacking_item, /obj/item/device/integrated_electronics/debugger) || attacking_item.ismultitool() || attacking_item.isscrewdriver())
+ else if(istype(attacking_item, /obj/item/device/integrated_electronics/wirer) || istype(attacking_item, /obj/item/device/integrated_electronics/debugger) || attacking_item.tool_behaviour == TOOL_MULTITOOL || attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(opened)
interact(user)
else
diff --git a/code/modules/integrated_electronics/core/device.dm b/code/modules/integrated_electronics/core/device.dm
index c697737c9a7..b6ee1edb33e 100644
--- a/code/modules/integrated_electronics/core/device.dm
+++ b/code/modules/integrated_electronics/core/device.dm
@@ -18,7 +18,7 @@
. = ..()
/obj/item/device/assembly/electronic_assembly/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.iscrowbar())
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR)
toggle_open(user)
else if (opened)
EA.attackby(attacking_item, user)
diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm
index dcc5c98c4ab..5432e0993e3 100644
--- a/code/modules/integrated_electronics/core/integrated_circuit.dm
+++ b/code/modules/integrated_electronics/core/integrated_circuit.dm
@@ -198,12 +198,12 @@ 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
- var/obj/held_item = usr.get_active_hand()
- var/obj/off_hand = usr.get_inactive_hand()
+ var/obj/item/held_item = usr.get_active_hand()
+ var/obj/item/off_hand = usr.get_inactive_hand()
var/obj/item/device/multitool/M
- if(held_item?.ismultitool())
+ if(held_item?.tool_behaviour == TOOL_MULTITOOL)
M = held_item
- if(!M && off_hand?.ismultitool())
+ if(!M && off_hand?.tool_behaviour == TOOL_MULTITOOL)
M = off_hand
if(M?.tracking_apc)
to_chat(usr, SPAN_WARNING("\The [M]'s smart tracking is enabled! Disable it to regain I/O functionality."))
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index d78fbca485c..8d71b3380ca 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -30,17 +30,17 @@
if(istype(attacking_item, /obj/item/book))
user.drop_from_inventory(attacking_item,src)
update_icon()
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_NAME_LEN)
if(!newname)
return
else
name = ("bookcase ([newname])")
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, (anchored ? SPAN_NOTICE("You unfasten \the [src] from the floor.") : SPAN_NOTICE("You secure \the [src] to the floor.")))
anchored = !anchored
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You begin dismantling \the [src]."))
if(attacking_item.use_tool(src, user, 25, volume = 50))
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
@@ -241,7 +241,7 @@
else
to_chat(user, SPAN_NOTICE("There's already something in [title]!"))
return
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
if(unique)
to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.")
return
@@ -300,7 +300,7 @@
return
scanner.computer.inventory.Add(src)
to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
- else if(istype(attacking_item, /obj/item/material/knife) || attacking_item.iswirecutter())
+ else if(istype(attacking_item, /obj/item/material/knife) || attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(carved) return
to_chat(user, SPAN_NOTICE("You begin to carve out [title]."))
if(attacking_item.use_tool(src, user, 30, volume = 50))
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index e788674a7fd..e0571a03e98 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -413,7 +413,7 @@
to_chat(user, SPAN_WARNING("\The [src] must be secured to the floor first!"))
return
user.drop_from_inventory(attacking_item,src)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."),
@@ -503,7 +503,7 @@
qdel(paper)
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."), \
diff --git a/code/modules/makeshift/makeshift_reagents.dm b/code/modules/makeshift/makeshift_reagents.dm
index 2b3a456badd..97a60f7241f 100644
--- a/code/modules/makeshift/makeshift_reagents.dm
+++ b/code/modules/makeshift/makeshift_reagents.dm
@@ -64,7 +64,7 @@
var/joules = 0
if(istype(W, /obj/item/flame))
joules = 1000 // 1 kJ per match, and we're assuming lighters give as much per use
- else if(W.iswelder())
+ else if(W.tool_behaviour == TOOL_WELDER)
joules = 10000 // we'll just have it be ten times stronger
else if(istype(W, /obj/item/device/assembly/igniter))
joules = 5000 // half as strong as a welder; this thing has to set off bombs and such
@@ -131,7 +131,7 @@
qdel(src)
/obj/structure/chemkit/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
dismantle()
return
if(!istype(attacking_item, /obj/item/reagent_containers/food/snacks) && attacking_item.is_open_container())
@@ -229,7 +229,7 @@
icon_state = "distillery-off"
/obj/structure/distillery/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
dismantle()
return
if(!welder && istype(attacking_item, /obj/item/weldingtool))
@@ -241,7 +241,7 @@
if(!istype(attacking_item, /obj/item/reagent_containers/food/snacks) && attacking_item.is_open_container())
trans_item(attacking_item, user)
return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
transfer_out = !transfer_out
to_chat(user, SPAN_NOTICE("You [transfer_out ? "open" : "close"] the spigot on the keg, ready to [transfer_out ? "remove" : "add"] reagents."))
return
diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm
index 801dca6a16a..f30672082e1 100644
--- a/code/modules/materials/material_sheets.dm
+++ b/code/modules/materials/material_sheets.dm
@@ -95,7 +95,7 @@
..()
/obj/item/stack/material/attackby(obj/item/attacking_item, mob/user)
- if(iscoil(attacking_item))
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
material.build_wired_product(user, attacking_item, src)
return
else if(istype(attacking_item, /obj/item/stack/rods))
diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm
index 6b111f5883f..bc186259032 100644
--- a/code/modules/mining/abandonedcrates.dm
+++ b/code/modules/mining/abandonedcrates.dm
@@ -176,7 +176,7 @@
/obj/structure/closet/crate/secure/loot/attackby(obj/item/attacking_item, mob/user)
if(locked)
- if(attacking_item.ismultitool()) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
to_chat(user, SPAN_NOTICE("DECA-CODE LOCK ANALYSIS:"))
if(attempts == 1)
to_chat(user, SPAN_WARNING("* Anti-Tamper system will activate on the next failed access attempt."))
diff --git a/code/modules/mining/coins.dm b/code/modules/mining/coins.dm
index c01645950db..f9294047018 100644
--- a/code/modules/mining/coins.dm
+++ b/code/modules/mining/coins.dm
@@ -74,7 +74,7 @@
cmineral = "mining"
/obj/item/coin/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/CC = attacking_item
if(string_attached)
to_chat(user, SPAN_NOTICE("There already is a string attached to this coin."))
@@ -86,7 +86,7 @@
else
to_chat(user, SPAN_NOTICE("This cable coil appears to be empty."))
return
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(!string_attached)
..()
return
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index faabed0e40e..fda7d17b0b5 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -314,7 +314,7 @@
attached_satchel.insert_into_storage(ore)
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!attached_satchel)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a satchel attached to it!"))
return
@@ -328,7 +328,7 @@
attached_satchel = null
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(panel_open)
if(cell)
to_chat(user, SPAN_NOTICE("You shimmy out \the [cell]."))
@@ -572,7 +572,7 @@
if(default_deconstruction_crowbar(user, attacking_item))
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(istype(get_turf(src), /turf/space))
to_chat(user, SPAN_NOTICE("You send \the [src] careening into space. Idiot."))
var/inertia = rand(10, 30)
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index f5a0c53fa1a..35c3ac90721 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -365,9 +365,7 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1, TECH_COMBAT = 2)
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked", "slashed", "cut")
sharp = TRUE
-
-/obj/item/shovel/gadpathur/iscrowbar()
- return TRUE
+ tool_behaviour = TOOL_CROWBAR
// Flags.
@@ -513,7 +511,7 @@
var/turf/T = get_turf(src)
T.attackby(attacking_item, user)
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You slice apart the track."))
@@ -1189,7 +1187,7 @@ GLOBAL_LIST_INIT_TYPED(total_extraction_beacons, /obj/structure/extraction_point
var/busy_sculpting = FALSE
/obj/structure/sculpting_block/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
visible_message("[user] starts to [anchored ? "un" : ""]anchor \the [src].", SPAN_NOTICE("You start to [anchored ? "un" : ""]anchor \the [src]."))
if(attacking_item.use_tool(src, user, 50, volume = 50))
anchored = !anchored
diff --git a/code/modules/mining/ore_satchel.dm b/code/modules/mining/ore_satchel.dm
index 7253e74dfb7..1f5157a2498 100644
--- a/code/modules/mining/ore_satchel.dm
+++ b/code/modules/mining/ore_satchel.dm
@@ -74,7 +74,7 @@
linked_beacon_uses = E.uses_left
to_chat(user, SPAN_NOTICE("You attach \the [E] to \the [src]."))
qdel(E)
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!linked_beacon)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a linked extraction pack!"))
return
diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm
index bd1f7a92b87..19a50db64ac 100644
--- a/code/modules/mob/living/bot/bot.dm
+++ b/code/modules/mob/living/bot/bot.dm
@@ -109,14 +109,14 @@
else
to_chat(user, SPAN_WARNING("As you swipe your ID, it reads: \"Access denied.\""))
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!locked)
open = !open
to_chat(user, SPAN_NOTICE("You [open ? "open" : "close"] the maintenance panel."))
else
to_chat(user, SPAN_WARNING("You need to unlock the controls first."))
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(health < maxHealth)
if(open)
health = min(maxHealth, health + 10)
@@ -126,7 +126,7 @@
else
to_chat(user, SPAN_WARNING("[src] does not need a repair."))
return
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!pAI)
to_chat(user, SPAN_WARNING("\The [src] does not have a pAI installed!"))
return
diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm
index 4dbeefcfd00..5bbf8b0a054 100644
--- a/code/modules/mob/living/bot/cleanbot.dm
+++ b/code/modules/mob/living/bot/cleanbot.dm
@@ -506,7 +506,7 @@ GLOBAL_LIST_INIT_TYPED(cleanbot_types, /obj/effect/decal/cleanable, typesof(/obj
A.name = created_name
to_chat(user, SPAN_NOTICE("You add the robot arm to the bucket and sensor assembly. Beep boop!"))
qdel(src)
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
var/t = sanitizeSafe( tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN )
if(!t)
return
diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm
index b3cfc70f2fe..41e62dae3a2 100644
--- a/code/modules/mob/living/bot/farmbot.dm
+++ b/code/modules/mob/living/bot/farmbot.dm
@@ -416,7 +416,7 @@
qdel(attacking_item)
qdel(src)
return TRUE
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
var/t = tgui_input_text(user, "Enter new robot name", name, created_name)
t = sanitize(t, MAX_NAME_LEN)
if(!t)
diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm
index 4be7e0735ec..c1d187b74e3 100644
--- a/code/modules/mob/living/bot/medbot.dm
+++ b/code/modules/mob/living/bot/medbot.dm
@@ -359,7 +359,7 @@
/obj/item/firstaid_arm_assembly/attackby(obj/item/attacking_item, mob/user)
..()
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
var/t = sanitizeSafe( tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN )
if(!t)
return
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm
index a25ec7f462d..28188373b31 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/carbon/brain/MMI.dm
@@ -111,17 +111,17 @@
set_cradle_state(STATE_BRAIN)
update_name()
if(STATE_NODIODES)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message("[user] tightens the screws on \the [src] with \the [attacking_item], [brainobj.prepared ? "the diodes silently sinking into the pre-made holes" : "the diodes plunging into the brain with a wet squelch"].",
SPAN_NOTICE("You tighten the screws on \the [src] with \the [attacking_item], [brainobj.prepared ? "the diodes silently sinking into the pre-made holes" : "the diodes plunging into the brain with a wet squelch"]."))
brainobj.prepared = TRUE
set_cradle_state(STATE_DIODES)
if(STATE_DIODES)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message("[user] undoes the screws on \the [src] with \the [attacking_item], the diodes silently rising out of the brain within.",
SPAN_NOTICE("You undo the screws on \the [src] with \the [attacking_item], the diodes silently rising out of the brain within."))
set_cradle_state(STATE_NODIODES)
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
user.visible_message("[user] welds the two parts of the braincase together, permanently sealing \the [brainobj] inside.",
@@ -130,7 +130,7 @@
set_cradle_state(STATE_SEALED)
feedback_inc("cyborg_mmis_filled", 1)
if(STATE_SEALED)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
to_chat(user, SPAN_WARNING("\The [src] is sealed tight, no welding will be able to undo it."))
return
else if(istype(attacking_item, /obj/item/surgery/circular_saw))
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 54bd4ee170e..0e48c43fada 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -786,7 +786,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
var/obj/item/aicard/card = attacking_item
card.grab_ai(src, user)
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] starts to unbolt \the [src] from the plating..."))
if(!attacking_item.use_tool(src, user, 40, volume = 50))
diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm
index 6c33f6d66c7..e77e082e5f7 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone.dm
@@ -348,7 +348,7 @@
else if(istype(attacking_item, /obj/item/borg/upgrade/))
to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [attacking_item]."))
return
- else if(attacking_item.iscrowbar())
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR)
to_chat(user, SPAN_WARNING("\The [src] is hermetically sealed. You can't open the case."))
return
else if(attacking_item.GetID() || istype(attacking_item, /obj/item/card/robot))
diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
index 3c3d4623c5a..c09e3f8cb25 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
@@ -203,7 +203,7 @@
module_string += "[O]: Activate
"
var/obj/item/I = O
- if((istype(I, /obj/item) || istype(I, /obj/item/device)) && !(I.iscoil()))
+ if((istype(I, /obj/item) || istype(I, /obj/item/device)) && !(I.tool_behaviour == TOOL_CABLECOIL))
tools += module_string
else
resources += module_string
diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm
index ab7ed382030..4fb39a25963 100644
--- a/code/modules/mob/living/silicon/robot/inventory.dm
+++ b/code/modules/mob/living/silicon/robot/inventory.dm
@@ -6,14 +6,14 @@
return module_active
/mob/living/silicon/robot/proc/return_wirecutter()
- for(var/obj/I in list(module_state_1, module_state_2, module_state_3))
- if(I.iswirecutter())
+ for(var/obj/item/I in list(module_state_1, module_state_2, module_state_3))
+ if(I.tool_behaviour == TOOL_WIRECUTTER)
return I
return
/mob/living/silicon/robot/proc/return_multitool()
- for(var/obj/I in list(module_state_1, module_state_2, module_state_3))
- if(I.ismultitool())
+ for(var/obj/item/I in list(module_state_1, module_state_2, module_state_3))
+ if(I.tool_behaviour == TOOL_MULTITOOL)
return I
return
diff --git a/code/modules/mob/living/silicon/robot/items/inductive_charger.dm b/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
index 36bae237dd2..fded2ed5513 100644
--- a/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
+++ b/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
@@ -125,7 +125,7 @@
to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [src]."))
cell = attacking_item
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!cell)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a cell inserted."))
return TRUE
diff --git a/code/modules/mob/living/silicon/robot/items/robot_parts.dm b/code/modules/mob/living/silicon/robot/items/robot_parts.dm
index b20a07af590..50cddeb9a27 100644
--- a/code/modules/mob/living/silicon/robot/items/robot_parts.dm
+++ b/code/modules/mob/living/silicon/robot/items/robot_parts.dm
@@ -315,7 +315,7 @@
to_chat(user, SPAN_WARNING("\The [attacking_item] can only be inserted after everything else is installed."))
return
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
var/t = sanitizeSafe( tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN )
if(!t)
return
@@ -343,7 +343,7 @@
cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert \the [src]."))
return
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
if(wires)
to_chat(user, SPAN_WARNING("\The [src] is already wired up correctly."))
return
@@ -375,7 +375,7 @@
to_chat(user, SPAN_NOTICE("You add the infrared sensor to the robot head."))
qdel(src)
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
if(law_manager)
to_chat(user, SPAN_NOTICE("You disable the lawing circuits on \the [src]."))
law_manager = FALSE
diff --git a/code/modules/mob/living/silicon/robot/items/robot_tools.dm b/code/modules/mob/living/silicon/robot/items/robot_tools.dm
index ccdbbfcbb1e..debe24c2cf5 100644
--- a/code/modules/mob/living/silicon/robot/items/robot_tools.dm
+++ b/code/modules/mob/living/silicon/robot/items/robot_tools.dm
@@ -1,6 +1,3 @@
-/obj/item/crowbar/robotic
- icon = 'icons/obj/robot_items.dmi'
-
/obj/item/wrench/robotic
icon = 'icons/obj/robot_items.dmi'
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 4d0b9bb0bfc..40599faf757 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -623,7 +623,7 @@
if(user.a_intent == I_HELP)
if(wires_exposed)
wires.interact(user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
if(src == user)
to_chat(user, SPAN_WARNING("You lack the reach to be able to repair yourself."))
return
@@ -641,7 +641,7 @@
add_fingerprint(user)
visible_message(SPAN_WARNING("\The [user] has fixed some of the dents on \the [src]!"))
return
- else if(attacking_item.iscoil() && (wires_exposed || istype(src,/mob/living/silicon/robot/drone)))
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL && (wires_exposed || istype(src,/mob/living/silicon/robot/drone)))
if(!getFireLoss())
to_chat(user, SPAN_WARNING("There is nothing to fix here!"))
return
@@ -652,7 +652,7 @@
updatehealth()
visible_message(SPAN_WARNING("\The [user] has fixed some of the burnt wires on \the [src]!"))
return
- else if(attacking_item.iscrowbar()) // crowbar means open or close the cover
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR) // crowbar means open or close the cover
if(opened)
if(cell)
user.visible_message(SPAN_NOTICE("\The [user] begins clasping shut \the [src]'s maintenance hatch."), SPAN_NOTICE("You begin closing up \the [src]'s maintenance hatch."))
@@ -744,11 +744,11 @@
C.brute_damage = 0
C.electronics_damage = 0
handle_panel_overlay()
- else if(attacking_item.isscrewdriver() && opened && !cell) // haxing
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && opened && !cell) // haxing
wires_exposed = !wires_exposed
user.visible_message(SPAN_NOTICE("\The [user] [wires_exposed ? "exposes" : "covers"] \the [src]'s wires."), SPAN_NOTICE("You [wires_exposed ? "expose" : "cover"] \the [src]'s wires."))
handle_panel_overlay()
- else if(attacking_item.isscrewdriver() && opened && cell) // radio
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && opened && cell) // radio
if(radio)
radio.attackby(attacking_item, user) //Push it to the radio to let it handle everything
else
diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
index 5044d5f88fe..e7cf099923d 100644
--- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
+++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
@@ -119,7 +119,7 @@
src.update_icon()
return 1
- if (attacking_item.iswelder())
+ if (attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if (WT.use(0))
if(health < maxHealth)
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index c03b0629dfe..b75fda8d510 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -1116,8 +1116,8 @@ GLOBAL_LIST_INIT(organ_rel_size, list(
#undef SAFE_PERP
-/mob/proc/get_multitool(var/obj/P)
- if(P?.ismultitool())
+/mob/proc/get_multitool(var/obj/item/P)
+ if(P?.tool_behaviour == TOOL_MULTITOOL)
return P
/mob/abstract/ghost/observer/get_multitool()
diff --git a/code/modules/modular_computers/NTNet/NTNet_relay.dm b/code/modules/modular_computers/NTNet/NTNet_relay.dm
index 598e2f1f689..5adadc1bbaa 100644
--- a/code/modules/modular_computers/NTNet/NTNet_relay.dm
+++ b/code/modules/modular_computers/NTNet/NTNet_relay.dm
@@ -122,12 +122,12 @@
return ..()
/obj/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "open" : "close"] the maintenance hatch."))
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!panel_open)
to_chat(user, SPAN_WARNING("Open the maintenance panel first."))
return
diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm
index 4c7ad315084..2192376fd04 100644
--- a/code/modules/modular_computers/computers/modular_computer/interaction.dm
+++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm
@@ -283,7 +283,7 @@
if(istype(attacking_item, /obj/item/device/paicard))
try_install_component(user, attacking_item)
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
var/list/components = get_all_components()
if(components.len)
to_chat(user, SPAN_WARNING("You have to remove all the components from \the [src] before disassembling it."))
@@ -294,7 +294,7 @@
user.visible_message(SPAN_NOTICE("\The [user] disassembles \the [src]."), SPAN_NOTICE("You disassemble \the [src]."), SPAN_NOTICE("You hear a ratcheting noise."))
qdel(src)
return TRUE
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [attacking_item] is off."))
@@ -312,7 +312,7 @@
update_icon()
return TRUE
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
var/list/all_components = get_all_components()
if(!all_components.len)
to_chat(user, SPAN_WARNING("This device doesn't have any components installed."))
diff --git a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
index 831629de718..21e74cdd4d7 100644
--- a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
+++ b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
@@ -19,7 +19,7 @@
is_holographic = TRUE
/obj/item/modular_computer/telescreen/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(anchored)
shutdown_computer()
anchored = FALSE
diff --git a/code/modules/modular_computers/hardware/ai_slot.dm b/code/modules/modular_computers/hardware/ai_slot.dm
index d287fe345d8..c605c7670ba 100644
--- a/code/modules/modular_computers/hardware/ai_slot.dm
+++ b/code/modules/modular_computers/hardware/ai_slot.dm
@@ -27,7 +27,7 @@
user.drop_from_inventory(attacking_item, src)
stored_card = attacking_item
update_power_usage()
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You manually remove \the [stored_card] from \the [src]."))
stored_card.forceMove(get_turf(src))
stored_card = null
diff --git a/code/modules/modular_computers/hardware/hardware.dm b/code/modules/modular_computers/hardware/hardware.dm
index 4ff5ea6e794..2c2dbb4cc8a 100644
--- a/code/modules/modular_computers/hardware/hardware.dm
+++ b/code/modules/modular_computers/hardware/hardware.dm
@@ -44,7 +44,7 @@
/obj/item/computer_hardware/attackby(obj/item/attacking_item, mob/user)
/// Multitool. Runs diagnostics
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, SPAN_NOTICE("***** DIAGNOSTICS REPORT *****"))
diagnostics(user)
to_chat(user, SPAN_NOTICE("******************************"))
@@ -60,7 +60,7 @@
damage = 0
return TRUE
/// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
- if(S.iscoil())
+ if(S.tool_behaviour == TOOL_CABLECOIL)
if(!damage)
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
return TRUE
diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm
index fff62888641..41a95e299f3 100644
--- a/code/modules/modular_computers/laptop_vendor.dm
+++ b/code/modules/modular_computers/laptop_vendor.dm
@@ -335,7 +335,7 @@
ui.set_auto_update(1)
/obj/machinery/lapvend/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(anchored)
user.visible_message("[user] begins unsecuring \the [src] from the floor.", \
diff --git a/code/modules/multiz/turfs/open_space.dm b/code/modules/multiz/turfs/open_space.dm
index 8e7a4443e06..77e75242fd2 100644
--- a/code/modules/multiz/turfs/open_space.dm
+++ b/code/modules/multiz/turfs/open_space.dm
@@ -260,7 +260,7 @@
to_chat(user, SPAN_WARNING("The plating is going to need some support."))
//To lay cable.
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/coil = attacking_item
coil.turf_place(src, user)
return
diff --git a/code/modules/organs/internal/species/machine/power_core.dm b/code/modules/organs/internal/species/machine/power_core.dm
index ce6918fe9f8..2857f3570ee 100644
--- a/code/modules/organs/internal/species/machine/power_core.dm
+++ b/code/modules/organs/internal/species/machine/power_core.dm
@@ -89,7 +89,7 @@
to_chat(owner, SPAN_MACHINE_WARNING("Power core electronics damaged. Caution. Caution."))
/obj/item/organ/internal/machine/power_core/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(open)
open = FALSE
to_chat(user, SPAN_NOTICE("You screw the battery panel in place."))
@@ -97,7 +97,7 @@
open = TRUE
to_chat(user, SPAN_NOTICE("You unscrew the battery panel."))
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(open)
if(cell)
user.put_in_hands(cell)
diff --git a/code/modules/overmap/overmap_shuttle.dm b/code/modules/overmap/overmap_shuttle.dm
index 2028244af95..7e29072f7fc 100644
--- a/code/modules/overmap/overmap_shuttle.dm
+++ b/code/modules/overmap/overmap_shuttle.dm
@@ -191,7 +191,7 @@
icon_state = icon_closed
/obj/structure/fuel_port/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(state != FUEL_PORT_WELDED)
to_chat(user, SPAN_WARNING("\The [src] must be bolted and welded in place before it can be opened!"))
return
@@ -212,7 +212,7 @@
return
if(contents.len == 0)
user.unEquip(attacking_item, TRUE, src)
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
switch(state)
if(FUEL_PORT_WELDED)
to_chat(user, SPAN_WARNING("\The [src] is welded in place!"))
@@ -229,7 +229,7 @@
SPAN_NOTICE("You secure \the [src]'s external reinforcing bolts."), \
SPAN_WARNING("You hear a ratcheting noise."))
state = FUEL_PORT_BOLTED
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
switch(state)
if(FUEL_PORT_UNSECURED)
diff --git a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
index 7a3a3e35675..ebfa987049a 100644
--- a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
+++ b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
@@ -69,7 +69,7 @@
log_and_message_admins("[user] has caused the cookoff of [src] by attacking it with [attacking_item]!", user)
cookoff(FALSE)
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
var/obj/item/pen/P = attacking_item
if(!use_check_and_message(user))
var/friendly_message = sanitizeSafe( tgui_input_text(user, "What do you want to write on \the [src]?", "Personal Message", "", 32), 32 )
diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm
index 9eb49351109..306dc0dd73c 100644
--- a/code/modules/overmap/ships/computers/sensors.dm
+++ b/code/modules/overmap/ships/computers/sensors.dm
@@ -439,7 +439,7 @@
if(default_part_replacement(user, attacking_item))
return TRUE
var/damage = max_health - health
- if(damage && attacking_item.iswelder())
+ if(damage && attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm
index 83d86fba0eb..7dd904f37d7 100644
--- a/code/modules/overmap/ships/computers/ship.dm
+++ b/code/modules/overmap/ships/computers/ship.dm
@@ -28,7 +28,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
popup.open()
/obj/machinery/computer/ship/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscoil()) // Repair from hotwire
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL) // Repair from hotwire
var/obj/item/stack/cable_coil/C = attacking_item
if(hotwire_progress >= initial(hotwire_progress))
to_chat(usr, SPAN_BOLD("\The [src] does not require repairs."))
@@ -46,7 +46,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
playsound(src.loc, 'sound/items/Deconstruct.ogg', 30, TRUE)
return
- if(attacking_item.iswirecutter()) // Hotwiring
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER) // Hotwiring
if(!req_access && !req_one_access && !emagged) // Already hacked/no need to hack
to_chat(user, SPAN_BOLD("[src] is not access-locked."))
return
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index 1c5d19dd589..830511c201a 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -62,10 +62,10 @@
r_contents = reverselist(contents)
to_chat(user, SPAN_NOTICE("You clip the [attacking_item] onto \the [src]."))
- else if(istype(toppaper) && attacking_item.ispen())
+ else if(istype(toppaper) && attacking_item.tool_behaviour == TOOL_PEN)
toppaper.attackby(attacking_item, user)
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
add_pen(user)
if(ui_open)
@@ -106,7 +106,7 @@
/obj/item/clipboard/proc/add_pen(mob/user)
if(!haspen)
var/obj/item/pen/W = user.get_active_hand()
- if(W.ispen())
+ if(W.tool_behaviour == TOOL_PEN)
user.drop_from_inventory(W,src)
haspen = W
to_chat(user, SPAN_NOTICE("You slot the pen into \the [src]."))
@@ -136,7 +136,7 @@
var/obj/item/I = usr.get_active_hand()
- if(I.ispen())
+ if(I.tool_behaviour == TOOL_PEN)
P.attackby(I, usr)
else if (haspen)
P.attackby(haspen, usr)
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 2c3efa7bf60..4c9abcc0f36 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -63,7 +63,7 @@
sleep(40)
icon_state = initial(icon_state)
updateUsrDialog()
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 54dd9472a6a..a4f4f1d5614 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -44,7 +44,7 @@
user.drop_from_inventory(attacking_item, src)
to_chat(user, SPAN_NOTICE("You put the [attacking_item] into \the [src]."))
update_icon()
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
var/n_name = sanitizeSafe( tgui_input_text(user, "What would you like to label the folder?", "Folder Labelling", max_length = MAX_NAME_LEN), MAX_NAME_LEN )
if(Adjacent(user) && user.stat == 0)
name = "folder[(n_name ? "- '[n_name]'" : null)]"
@@ -84,9 +84,9 @@
if(!istype(paper) || paper.loc != src)
return
var/obj/item/pen = usr.get_inactive_hand()
- if(!pen || !pen.ispen())
+ if(!pen || !pen.tool_behaviour == TOOL_PEN)
pen = usr.get_active_hand()
- if(pen?.ispen())
+ if(pen?.tool_behaviour == TOOL_PEN)
paper.attackby(pen, usr)
else if(href_list["read"])
var/obj/item/paper/P = locate(href_list["read"])
diff --git a/code/modules/paperwork/journal.dm b/code/modules/paperwork/journal.dm
index ba5540c1d83..8e8f7d4600a 100644
--- a/code/modules/paperwork/journal.dm
+++ b/code/modules/paperwork/journal.dm
@@ -76,7 +76,7 @@
return
insert_item(attacking_item, user)
return
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
if(!open)
to_chat(user, SPAN_NOTICE("You open \the [src] with \the [attacking_item]."))
open = !open
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index f1062c9240f..51906ee2026 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -313,7 +313,7 @@
update_icon()
/obj/item/paper/proc/get_signature(var/obj/item/pen/P, mob/user as mob)
- if(P && P.ispen())
+ if(P && P.tool_behaviour == TOOL_PEN)
return P.get_signature(user)
if (user)
@@ -514,13 +514,13 @@
if(T.pen)
i = T.pen
- if(!i || !i.ispen())
+ if(!i || !i.tool_behaviour == TOOL_PEN)
i = usr.get_inactive_hand()
var/obj/item/clipboard/c
var/iscrayon = FALSE
var/isfountain = FALSE
var/istypewriter = FALSE
- if(!i.ispen())
+ if(!i.tool_behaviour == TOOL_PEN)
if(usr.back && istype(usr.back,/obj/item/rig))
var/obj/item/rig/r = usr.back
var/obj/item/rig_module/device/pen/m = locate(/obj/item/rig_module/device/pen) in r.installed_modules
@@ -657,7 +657,7 @@
B.amount = 2
B.update_icon()
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
if(icon_state == "scrap")
to_chat(user, SPAN_WARNING("The [src] is too crumpled to write on."))
return
diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm
index a0ffda53b31..ea0c37d1fd6 100644
--- a/code/modules/paperwork/papershredder.dm
+++ b/code/modules/paperwork/papershredder.dm
@@ -21,7 +21,7 @@
empty_bin(user, attacking_item)
return
- else if (attacking_item.iswrench())
+ else if (attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
user.visible_message(
@@ -143,7 +143,7 @@
var/obj/item/flame/F = P
if (!F.lit)
return
- else if (P.iswelder())
+ else if (P.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/F = P // NOW THAT'S WHAT I CALL RECYCLING - wezzy
if (!F.welding)
return
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 482e6434978..7a06e4ef945 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -57,14 +57,12 @@
var/colour = "black"
/// Done here so other pen variants can access the cursive variable.
var/cursive = FALSE
+ tool_behaviour = TOOL_PEN
/obj/item/pen/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "Pens can be used on paper to write, or on a wide variety of objects, machinery, etc. to label or rename them."
-/obj/item/pen/ispen()
- return TRUE
-
/*
* PDA Pens
*/
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index a5bcab5560f..8758e076fc4 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -128,7 +128,7 @@
to_chat(user, SPAN_NOTICE("This cartridge is not yet ready for replacement! Use up the rest of the toner."))
flick("photocopier_notoner", src)
playsound(loc, 'sound/machines/buzz-two.ogg', 75, 1)
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 796a539b8d8..bdc25d3093a 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -61,7 +61,7 @@ GLOBAL_VAR_INIT(photo_count, 0)
examinate(user, src)
/obj/item/photo/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen())
+ if(attacking_item.tool_behaviour == TOOL_PEN)
var/txt = sanitize( tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", max_length = 128), 128 )
if(loc == user && user.stat == 0)
scribble = txt
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index 21f337858c6..d3dca02cf2e 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -143,7 +143,7 @@
icon_state = "control"
/obj/machinery/power/am_control_unit/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!anchored)
attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] secures \the [src] to the floor.", \
diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm
index ada68278fcf..a41b3e2f782 100644
--- a/code/modules/power/antimatter/shielding.dm
+++ b/code/modules/power/antimatter/shielding.dm
@@ -234,7 +234,7 @@
. += "To deploy, drop near an antimatter control unit or an existing deployed section and use your multitool on it."
/obj/item/device/am_shielding_container/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool() && isturf(loc))
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL && isturf(loc))
if(locate(/obj/machinery/am_shielding) in loc)
to_chat(user, SPAN_WARNING("There is already an antimatter reactor section there."))
return
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 1ef6f4d0204..0c4bf1f1596 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -491,7 +491,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
return
// CROWBAR: Try to remove circuit board OR open unlocked cover.
- if (attacking_item.iscrowbar() && opened)
+ if (attacking_item.tool_behaviour == TOOL_CROWBAR && opened)
if (has_electronics == HAS_ELECTRONICS_CONNECT)
if (terminal)
to_chat(user, SPAN_WARNING("Disconnect wires first."))
@@ -515,7 +515,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
panel_open = FALSE
opened = COVER_CLOSED
update_icon()
- else if (attacking_item.iscrowbar() && !((stat & BROKEN) || hacker) )
+ else if (attacking_item.tool_behaviour == TOOL_CROWBAR && !((stat & BROKEN) || hacker) )
if(coverlocked && !(stat & MAINT))
to_chat(user, SPAN_WARNING("The cover is locked and cannot be opened."))
return
@@ -560,7 +560,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
update_icon()
// SCREWDRIVER: Expose wiring panel.
- else if (attacking_item.isscrewdriver())
+ else if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(opened != COVER_CLOSED)
if (cell)
to_chat(user, SPAN_WARNING("Close the APC first.")) //Less hints more mystery!
@@ -586,7 +586,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
update_icon()
// CABLE COIL: Install the power terminal (wire stuff on the floor in front of the APC).
- else if (attacking_item.iscoil() && !terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
+ else if (attacking_item.tool_behaviour == TOOL_CABLECOIL && !terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
var/turf/T = loc
if(istype(T) && !T.is_plating())
to_chat(user, SPAN_WARNING("You must remove the floor plating in front of the APC first."))
@@ -612,7 +612,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
terminal.connect_to_network()
// WIRECUTTER: Dismantle the power terminal (wire stuff on the floor in front of APC).
- else if (attacking_item.iswirecutter() && terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
+ else if (attacking_item.tool_behaviour == TOOL_WIRECUTTER && terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
var/turf/T = loc
if(istype(T) && !T.is_plating())
to_chat(user, SPAN_WARNING("You must remove the floor plating in front of the APC first."))
@@ -647,7 +647,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
// WELDER: If the APC is broken, remove the cover.
// If the cover is open and APC has been stripped down, dismantle it back into steel.
- else if (attacking_item.iswelder())
+ else if (attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if (opened != COVER_REMOVED && (stat & BROKEN))
if (!WT.isOn()) return
@@ -771,8 +771,8 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
if (issilicon(user))
return attack_hand(user)
if (opened == COVER_CLOSED && panel_open && \
- attacking_item.ismultitool() || \
- attacking_item.iswirecutter() || istype(attacking_item, /obj/item/device/assembly/signaler))
+ attacking_item.tool_behaviour == TOOL_MULTITOOL || \
+ attacking_item.tool_behaviour == TOOL_WIRECUTTER || istype(attacking_item, /obj/item/device/assembly/signaler))
return attack_hand(user)
user.visible_message(SPAN_DANGER("The [name] has been hit with the [attacking_item.name] by [user.name]!"), \
SPAN_DANGER("You hit the [name] with your [attacking_item.name]!"), \
diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm
index b0473aa95d0..d6358619926 100644
--- a/code/modules/power/batteryrack.dm
+++ b/code/modules/power/batteryrack.dm
@@ -44,7 +44,7 @@
/obj/machinery/power/smes/batteryrack/attackby(obj/item/attacking_item, mob/user) //these can only be moved by being reconstructed, solves having to remake the powernet.
..() //SMES attackby for now handles screwdriver, cable coils and wirecutters, no need to repeat that here
if(open_hatch)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
attacking_item.play_tool_sound(get_turf(src), 50)
diff --git a/code/modules/power/breaker_box.dm b/code/modules/power/breaker_box.dm
index 763d2099e9c..e87c2a81c63 100644
--- a/code/modules/power/breaker_box.dm
+++ b/code/modules/power/breaker_box.dm
@@ -100,7 +100,7 @@
busy = 0
/obj/machinery/power/breakerbox/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/newtag = input(user, "Enter new RCON tag. Use \"NO_TAG\" to disable RCON or leave empty to cancel.", "SMES RCON system") as text
if(newtag)
RCon_tag = newtag
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index d74743b7188..4fec198b13a 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -150,9 +150,9 @@ By design, d1 is the smallest direction and d2 is the highest
if(!T.can_have_cabling())
return
- if(attacking_item.iswirecutter() || (attacking_item.sharp || attacking_item.edge))
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || (attacking_item.sharp || attacking_item.edge))
- if(!attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour != TOOL_WIRECUTTER)
if(user.a_intent != I_HELP)
return
@@ -192,14 +192,14 @@ By design, d1 is the smallest direction and d2 is the highest
return
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/coil = attacking_item
if (coil.get_amount() < 1)
to_chat(user, "You don't have enough cable.")
return
coil.cable_join(src, user)
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
if(powernet && (powernet.avail > 0)) // is it powered?
to_chat(user, SPAN_WARNING("[powernet.avail]W in power network."))
@@ -516,9 +516,7 @@ By design, d1 is the smallest direction and d2 is the highest
contained_sprite = TRUE
build_from_parts = TRUE
worn_overlay = "end"
-
-/obj/item/stack/cable_coil/iscoil()
- return TRUE
+ tool_behaviour = TOOL_CABLECOIL
/obj/item/stack/cable_coil/Initialize(mapload, amt, param_color = null)
. = ..(mapload, amt)
@@ -659,7 +657,7 @@ By design, d1 is the smallest direction and d2 is the highest
check_maptext(SMALL_FONTS(7, get_amount()))
/obj/item/stack/cable_coil/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
choose_cable_color(user)
return ..()
@@ -1065,7 +1063,7 @@ By design, d1 is the smallest direction and d2 is the highest
return ..()
/obj/structure/noose/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
user.visible_message("[user] cuts \the [src].", SPAN_NOTICE("You cut \the [src]."))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
if(istype(buckled, /mob/living))
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 582199f1d8e..36172682755 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -143,7 +143,7 @@
else
to_chat(user, SPAN_NOTICE("You'd need both devices to be signallers for this to work."))
return
- else if(attacking_item.ismultitool() && ishuman(user) && user.get_inactive_hand() == src)
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL && ishuman(user) && user.get_inactive_hand() == src)
if(charge < 10)
to_chat(user, SPAN_WARNING("\The [src] doesn't have enough charge to produce sufficient current!"))
return
diff --git a/code/modules/power/collector.dm b/code/modules/power/collector.dm
index 4b4891adacd..88f4d4680f6 100644
--- a/code/modules/power/collector.dm
+++ b/code/modules/power/collector.dm
@@ -128,13 +128,13 @@ GLOBAL_LIST_INIT_TYPED(rad_collectors, /obj/machinery/power/rad_collector, list(
update_icon()
return TRUE
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(loaded_tank && !locked)
to_chat(user, SPAN_NOTICE("You detach and remove \the [loaded_tank.name]."))
eject(user)
return TRUE
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(loaded_tank)
USE_FEEDBACK_FAILURE("Remove the phoron tank first.")
return TRUE
diff --git a/code/modules/power/fusion/consoles/_consoles.dm b/code/modules/power/fusion/consoles/_consoles.dm
index 1685b903e21..6119a80b2d2 100644
--- a/code/modules/power/fusion/consoles/_consoles.dm
+++ b/code/modules/power/fusion/consoles/_consoles.dm
@@ -18,7 +18,7 @@
return fusion.get_local_network()
/obj/machinery/computer/fusion/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
diff --git a/code/modules/power/fusion/core/_core.dm b/code/modules/power/fusion/core/_core.dm
index dcca80f2633..353a461bcfc 100644
--- a/code/modules/power/fusion/core/_core.dm
+++ b/code/modules/power/fusion/core/_core.dm
@@ -108,12 +108,12 @@
to_chat(user,SPAN_WARNING("Shut \the [src] off first!"))
return
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
if(anchored)
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
index da8af55b45e..7fc4b4b85a9 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
@@ -36,7 +36,7 @@
/obj/machinery/fusion_fuel_injector/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
@@ -57,7 +57,7 @@
cur_assembly = attacking_item
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
if(injecting)
to_chat(user, SPAN_WARNING("Shut \the [src] off first!"))
return
diff --git a/code/modules/power/fusion/gyrotron/gyrotron.dm b/code/modules/power/fusion/gyrotron/gyrotron.dm
index da744ae6ca1..a2db1fb1cdd 100644
--- a/code/modules/power/fusion/gyrotron/gyrotron.dm
+++ b/code/modules/power/fusion/gyrotron/gyrotron.dm
@@ -40,7 +40,7 @@
icon_state = "emitter-off"
/obj/machinery/power/emitter/gyrotron/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
diff --git a/code/modules/power/fusion/kinetic_harvester.dm b/code/modules/power/fusion/kinetic_harvester.dm
index 28a0bf8bafb..f9eb3c632f6 100644
--- a/code/modules/power/fusion/kinetic_harvester.dm
+++ b/code/modules/power/fusion/kinetic_harvester.dm
@@ -27,7 +27,7 @@
return TRUE
/obj/machinery/kinetic_harvester/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/datum/component/local_network_member/lanm = GetComponent(/datum/component/local_network_member)
if(lanm.get_new_tag(user))
find_core()
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index d338f0a8d60..198085538a2 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -171,7 +171,7 @@
attack_hand(user)
/obj/machinery/power/generator/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 75)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 939d8dece39..138889e9e2a 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -203,12 +203,12 @@
var/old_broken_state = broken_state
switch(broken_state)
if(GRAV_NEEDS_SCREWDRIVER)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You secure the screws of the framework."))
attacking_item.play_tool_sound(get_turf(src), 50)
broken_state++
if(GRAV_NEEDS_WELDING)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.use(1, user))
to_chat(user, SPAN_NOTICE("You mend the damaged framework."))
@@ -225,13 +225,13 @@
else
to_chat(user, SPAN_NOTICE("You need 10 sheets of plasteel."))
if(GRAV_NEEDS_WRENCH)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You secure the plating to the framework."))
attacking_item.play_tool_sound(get_turf(src), 75)
set_fix()
else
..()
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(backpanelopen)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You replace the back panel."))
diff --git a/code/modules/power/lights/construction.dm b/code/modules/power/lights/construction.dm
index 32eadc0526f..c355656763b 100644
--- a/code/modules/power/lights/construction.dm
+++ b/code/modules/power/lights/construction.dm
@@ -49,7 +49,7 @@
/obj/machinery/light_construct/attackby(obj/item/attacking_item, mob/user)
add_fingerprint(user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
switch(stage)
if(1)
to_chat(user, SPAN_NOTICE("You begin taking \the [src] apart..."))
@@ -69,7 +69,7 @@
to_chat(user, SPAN_WARNING("You have to unscrew the case first."))
return
- if(attacking_item.iswirecutter())
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
if(stage != 2)
return
stage = 1
@@ -91,7 +91,7 @@
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 100, TRUE)
return
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
if(stage != 1)
return
var/obj/item/stack/cable_coil/coil = attacking_item
@@ -112,7 +112,7 @@
SPAN_NOTICE("You add wires to \the [src]."))
return
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(stage == 2)
switch(fixture_type)
if("tube")
@@ -173,7 +173,7 @@
playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE)
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!cell_connectors)
to_chat(user, SPAN_WARNING("\The [src] does not have a power cell connector."))
return
diff --git a/code/modules/power/lights/fixtures.dm b/code/modules/power/lights/fixtures.dm
index bb4ac4614a8..69f816a0442 100644
--- a/code/modules/power/lights/fixtures.dm
+++ b/code/modules/power/lights/fixtures.dm
@@ -379,7 +379,7 @@
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
- if(attacking_item.isscrewdriver()) //If it's a screwdriver open it.
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) //If it's a screwdriver open it.
attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] opens \the [src]'s casing."), SPAN_NOTICE("You open \the [src]'s casing."), SPAN_NOTICE("You hear a noise."))
var/obj/machinery/light_construct/newlight = null
diff --git a/code/modules/power/portgen.dm b/code/modules/power/portgen.dm
index 710478f7968..1409b0c10d7 100644
--- a/code/modules/power/portgen.dm
+++ b/code/modules/power/portgen.dm
@@ -284,7 +284,7 @@
addstack.use(amount)
return
else if(!active)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!anchored)
connect_to_network()
@@ -296,14 +296,14 @@
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
anchored = !anchored
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
open = !open
attacking_item.play_tool_sound(get_turf(src), 50)
if(open)
to_chat(user, SPAN_NOTICE("You open the access panel."))
else
to_chat(user, SPAN_NOTICE("You close the access panel."))
- else if(open && attacking_item.iscrowbar())
+ else if(open && attacking_item.tool_behaviour == TOOL_CROWBAR)
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(loc)
for(var/obj/item/I in component_parts)
I.forceMove(loc)
diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm
index 1c5e7fc19ae..e9fe6081723 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -105,7 +105,7 @@
//almost never called, overwritten by all power machines but terminal and generator
/obj/machinery/power/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/coil = attacking_item
diff --git a/code/modules/power/radial_floodlight.dm b/code/modules/power/radial_floodlight.dm
index 5f67d02f621..2f833807614 100644
--- a/code/modules/power/radial_floodlight.dm
+++ b/code/modules/power/radial_floodlight.dm
@@ -36,7 +36,7 @@
return
/obj/machinery/power/radial_floodlight/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "" : "un"]secures \the [src] [anchored ? "to" : "from"] the floor."),
SPAN_NOTICE("You [anchored ? "" : "un"]secure \the [src] [anchored ? "to" : "from"] the floor."),
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index b2dfaa7c918..327ad355910 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -189,7 +189,7 @@
shot_counter++
/obj/machinery/power/emitter/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(active)
to_chat(user, SPAN_WARNING("You cannot unbolt \the [src] while it's active."))
return
@@ -212,7 +212,7 @@
to_chat(user, SPAN_WARNING("\The [src] needs to be unwelded from the floor."))
return
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(active)
to_chat(user, SPAN_NOTICE("You cannot unweld \the [src] while it's active."))
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index 5fdd847c9f2..889faf7a666 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -97,7 +97,7 @@ field_generator power level display
if(active)
to_chat(user, "The [src] needs to be off.")
return
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
switch(state)
if(0)
state = 1
@@ -118,7 +118,7 @@ field_generator power level display
if(2)
to_chat(user, SPAN_WARNING("The [src.name] needs to be unwelded from the floor."))
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
switch(state)
if(0)
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index 3f9db36c98c..163d56cdf04 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -25,7 +25,7 @@
if(src) qdel(src)
/obj/machinery/the_singularitygen/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index c07fed34815..8aec22db3fd 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -174,36 +174,36 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
switch(construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
- if(O.iswrench())
+ if(O.tool_behaviour == TOOL_WRENCH)
O.play_tool_sound(get_turf(src), 75)
anchored = TRUE
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure the external bolts."))
temp_state++
if(1)
- if(O.iswrench())
+ if(O.tool_behaviour == TOOL_WRENCH)
O.play_tool_sound(get_turf(src), 75)
anchored = FALSE
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [src] from the floor."), \
SPAN_NOTICE("You remove the external bolts."))
temp_state--
- else if(O.iscoil())
+ else if(O.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = O
if(C.use(1))
user.visible_message(SPAN_NOTICE("\The [user] adds wires to \the [src]."), \
SPAN_NOTICE("You add some wires."))
temp_state++
if(2)
- if(O.iswirecutter())//TODO:Shock user if its on?
+ if(O.tool_behaviour == TOOL_WIRECUTTER)//TODO:Shock user if its on?
user.visible_message(SPAN_NOTICE("\The [user] removes some wires from \the [src]."), \
SPAN_NOTICE("You remove some wires."))
temp_state--
- else if(O.isscrewdriver())
+ else if(O.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(SPAN_NOTICE("\The [user] closes \the [src]'s access panel."), \
SPAN_NOTICE("You close the access panel."))
temp_state++
if(3)
- if(O.isscrewdriver())
+ if(O.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(SPAN_NOTICE("\The [user] opens \the [src]'s access panel."), \
SPAN_NOTICE("You open the access panel."))
temp_state--
@@ -280,36 +280,36 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
var/temp_state = construction_state
switch(construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
- if(O.iswrench())
+ if(O.tool_behaviour == TOOL_WRENCH)
O.play_tool_sound(get_turf(src), 75)
anchored = TRUE
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure the external bolts."))
temp_state++
if(1)
- if(O.iswrench())
+ if(O.tool_behaviour == TOOL_WRENCH)
O.play_tool_sound(get_turf(src), 75)
anchored = FALSE
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [src] from the floor."), \
SPAN_NOTICE("You remove the external bolts."))
temp_state--
- else if(O.iscoil())
+ else if(O.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = O
if(C.use(1))
user.visible_message(SPAN_NOTICE("\The [user] removes some wires from \the [src]."), \
SPAN_NOTICE("You remove some wires."))
temp_state++
if(2)
- if(O.iswirecutter())//TODO:Shock user if its on?
+ if(O.tool_behaviour == TOOL_WIRECUTTER)//TODO:Shock user if its on?
user.visible_message(SPAN_NOTICE("\The [user] removes some wires from \the [src]."), \
SPAN_NOTICE("You remove some wires."))
temp_state--
- else if(O.isscrewdriver())
+ else if(O.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(SPAN_NOTICE("\The [user] closes \the [src]'s access panel."), \
SPAN_NOTICE("You close the access panel."))
temp_state++
if(3)
- if(O.isscrewdriver())
+ if(O.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(SPAN_NOTICE("\The [user] opens \the [src]'s access panel."), \
SPAN_NOTICE("You open the access panel."))
temp_state--
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index d92f2165456..1f66c696353 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -375,7 +375,7 @@
ui_interact(user)
/obj/machinery/power/smes/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!open_hatch)
if(is_badly_damaged())
to_chat(user, SPAN_WARNING("\The [src]'s maintenance panel is broken open!"))
@@ -398,7 +398,7 @@
to_chat(user, SPAN_WARNING("You need to open access hatch on [src] first!"))
return 0
- if(attacking_item.iscoil() && !terminal && !building_terminal)
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL && !terminal && !building_terminal)
building_terminal = 1
var/obj/item/stack/cable_coil/CC = attacking_item
if (CC.get_amount() <= 10)
@@ -417,7 +417,7 @@
stat = 0
return 0
- else if(attacking_item.iswirecutter() && terminal && !building_terminal)
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER && terminal && !building_terminal)
building_terminal = 1
var/turf/tempTDir = terminal.loc
if (istype(tempTDir))
diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm
index 050e79cf504..7a2d1df489b 100644
--- a/code/modules/power/smes_construction.dm
+++ b/code/modules/power/smes_construction.dm
@@ -417,7 +417,7 @@
// - Hatch is open, so we can modify the SMES
// - No action was taken in parent function (terminal de/construction atm).
if (..())
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
if(health == initial(health))
to_chat(user, SPAN_WARNING("\The [src] is already repaired."))
return
@@ -435,7 +435,7 @@
busted = FALSE
return
// Multitool - change RCON tag
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/newtag = input(user, "Enter new RCON tag. Use \"NO_TAG\" to disable RCON or leave empty to cancel.", "SMES RCON system") as text
if(newtag)
RCon_tag = newtag
@@ -460,7 +460,7 @@
failure_probability = 0
// Crowbar - Disassemble the SMES.
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if (terminal)
to_chat(user, SPAN_WARNING("You have to disassemble the terminal first!"))
return
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index af345588108..a363338655e 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -58,7 +58,7 @@
/obj/machinery/power/solar/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message(SPAN_NOTICE("[user] begins to take the glass off the solar panel."))
if(attacking_item.use_tool(src, user, 50, volume = 50))
@@ -220,13 +220,13 @@
/obj/item/solar_assembly/attackby(obj/item/attacking_item, mob/user)
if(!anchored && isturf(loc))
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = 1
user.visible_message(SPAN_NOTICE("[user] wrenches the solar assembly into place."))
attacking_item.play_tool_sound(get_turf(src), 75)
return 1
else
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = 0
user.visible_message(SPAN_NOTICE("[user] unwrenches the solar assembly from it's place."))
attacking_item.play_tool_sound(get_turf(src), 75)
@@ -255,7 +255,7 @@
user.visible_message(SPAN_NOTICE("[user] inserts the electronics into the solar assembly."))
return 1
else
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
new /obj/item/tracker_electronics(src.loc)
tracker = 0
user.visible_message(SPAN_NOTICE("[user] takes out the electronics from the solar assembly."))
@@ -380,7 +380,7 @@
return
/obj/machinery/power/solar_control/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT))
if (src.stat & BROKEN)
diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm
index 106b4e2046b..3435101be1e 100644
--- a/code/modules/power/tesla/coil.dm
+++ b/code/modules/power/tesla/coil.dm
@@ -36,7 +36,7 @@
if(default_part_replacement(user, attacking_item))
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You [anchored ? "unfasten" : "fasten"] [src] to the flooring."))
anchored = !anchored
@@ -90,7 +90,7 @@
if(default_part_replacement(user, attacking_item))
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You [anchored ? "unfasten" : "fasten"] [src] to the flooring."))
anchored = !anchored
diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm
index 91d875c3cca..75f70027e6c 100644
--- a/code/modules/power/tracker.dm
+++ b/code/modules/power/tracker.dm
@@ -59,7 +59,7 @@
/obj/machinery/power/tracker/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message(SPAN_NOTICE("[user] begins to take the glass off the solar tracker."))
if(attacking_item.use_tool(src, user, 50, volume = 50))
diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm
index 80958fb7510..ad124642407 100644
--- a/code/modules/power/turbine.dm
+++ b/code/modules/power/turbine.dm
@@ -145,7 +145,7 @@
efficiency = E / 6
/obj/machinery/power/compressor/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
turbine = null
inturf = get_step(src, dir)
locate_machinery()
@@ -296,7 +296,7 @@
if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
compressor = null
outturf = get_step(src, dir)
locate_machinery()
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index 20b407c5682..b4e717700f6 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -47,7 +47,7 @@
update_icon()
/obj/item/ammo_casing/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!BB)
to_chat(user, SPAN_NOTICE("There is no bullet in the casing to inscribe anything into."))
return
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index fc6a7576822..f4e0adc06e6 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -1055,7 +1055,7 @@
w_class += attacking_item.w_class
return TRUE
- if(attacking_item.iscrowbar() && bayonet)
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR && bayonet)
to_chat(user, SPAN_NOTICE("You detach \the [bayonet] from \the [src]."))
bayonet.forceMove(get_turf(src))
user.put_in_hands(bayonet)
@@ -1064,7 +1064,7 @@
update_icon()
return TRUE
- if(attacking_item.iswrench() && ammo_display)
+ if(attacking_item.tool_behaviour == TOOL_WRENCH && ammo_display)
to_chat(user, SPAN_NOTICE("You wrench the ammo display loose from \the [src]."))
ammo_display.forceMove(get_turf(src))
user.put_in_hands(ammo_display)
@@ -1074,7 +1074,7 @@
maptext = ""
return TRUE
- if(pin && attacking_item.isscrewdriver())
+ if(pin && attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
visible_message(SPAN_WARNING("\The [user] begins to try and pry out \the [src]'s firing pin!"))
if(attacking_item.use_tool(src, user, 45, volume = 50))
if(pin.durable || prob(50))
diff --git a/code/modules/projectiles/guns/energy/blaster.dm b/code/modules/projectiles/guns/energy/blaster.dm
index 6b29bea0eb5..b9c721e09b0 100644
--- a/code/modules/projectiles/guns/energy/blaster.dm
+++ b/code/modules/projectiles/guns/energy/blaster.dm
@@ -182,7 +182,7 @@
. += SPAN_WARNING("It has no cell installed.")
/obj/item/gun/energy/blaster/himeo/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(power_supply)
playsound(user, 'sound/machines/compbeep1.ogg', 40, FALSE)
to_chat(user, SPAN_NOTICE("You uninstall \the [power_supply]."))
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index fb0acd5e605..86616e083aa 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -232,7 +232,7 @@
turret_sprite_set = "red"
/obj/item/gun/energy/lasertag/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/chosen_color = tgui_input_list(user, "Which color do you wish your gun to be?", "Color Selection", list("blue", "red"))
if(!chosen_color)
return
diff --git a/code/modules/projectiles/guns/energy/mining.dm b/code/modules/projectiles/guns/energy/mining.dm
index 804469472a0..97271caf98b 100644
--- a/code/modules/projectiles/guns/energy/mining.dm
+++ b/code/modules/projectiles/guns/energy/mining.dm
@@ -30,7 +30,7 @@
. += FONT_SMALL(SPAN_WARNING("It has no power supply installed."))
/obj/item/gun/energy/plasmacutter/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(power_supply)
to_chat(user, SPAN_NOTICE("You uninstall \the [power_supply]."))
power_supply.forceMove(get_turf(src))
diff --git a/code/modules/projectiles/guns/energy/modular.dm b/code/modules/projectiles/guns/energy/modular.dm
index 5c6238f8c85..432158b91fd 100644
--- a/code/modules/projectiles/guns/energy/modular.dm
+++ b/code/modules/projectiles/guns/energy/modular.dm
@@ -45,7 +45,7 @@
. += "You can see \a [modulator] attached."
/obj/item/gun/energy/laser/prototype/attackby(obj/item/attacking_item, mob/user)
- if(!attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour != TOOL_SCREWDRIVER)
return ..()
to_chat(user, "You disassemble \the [src].")
disassemble(user)
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index 35efab42818..528930a4604 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -169,7 +169,7 @@
else
to_chat(user, SPAN_NOTICE("\The [src] already has a cell installed."))
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(cell)
var/obj/item/C = cell
C.forceMove(get_turf(user))
@@ -244,7 +244,7 @@
else
to_chat(user, SPAN_NOTICE("You need at least three rods to complete this task."))
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(buildstate == 1)
var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
@@ -254,7 +254,7 @@
buildstate++
update_icon()
return
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(buildstate == 2)
if(C.use(5))
@@ -282,7 +282,7 @@
else
to_chat(user, SPAN_NOTICE("You need at least three plastic sheets to complete this task."))
return
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(buildstate == 5)
to_chat(user, SPAN_NOTICE("You secure the crossbow's various parts."))
new /obj/item/gun/launcher/crossbow(get_turf(src))
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index fb873479ac2..af986c15d82 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -195,7 +195,7 @@
buildstate++
update_icon()
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(buildstate == 1)
var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
diff --git a/code/modules/projectiles/guns/projectile/improvised.dm b/code/modules/projectiles/guns/projectile/improvised.dm
index 7889ae59f68..8f591bf36b1 100644
--- a/code/modules/projectiles/guns/projectile/improvised.dm
+++ b/code/modules/projectiles/guns/projectile/improvised.dm
@@ -141,7 +141,7 @@
buildstate++
update_icon()
return
- else if(attacking_item.iscoil())
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(buildstate == 3)
if(C.use(10))
@@ -216,7 +216,7 @@
buildstate++
update_icon()
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(buildstate == 3)
var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index e69540d851d..4d23742b93d 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -157,7 +157,7 @@
needspin = FALSE
/obj/item/gun/projectile/revolver/capgun/attackby(obj/item/attacking_item, mob/user)
- if(!attacking_item.iswirecutter() || icon_state == "revolver")
+ if(attacking_item.tool_behaviour != TOOL_WIRECUTTER || icon_state == "revolver")
return ..()
to_chat(user, SPAN_NOTICE("You snip off the toy markings off the [src]."))
icon = 'icons/obj/guns/revolver.dmi'
diff --git a/code/modules/psionics/equipment/psipower_tinker.dm b/code/modules/psionics/equipment/psipower_tinker.dm
index d76fd21a848..4be16e71e91 100644
--- a/code/modules/psionics/equipment/psipower_tinker.dm
+++ b/code/modules/psionics/equipment/psipower_tinker.dm
@@ -2,7 +2,7 @@
name = "psychokinetic crowbar"
icon_state = "crowbar"
force = 11
- var/emulating = "crowbar"
+ tool_behaviour = TOOL_CROWBAR
var/list/tools = list("crowbar", "wrench", "screwdriver", "cutters")
/obj/item/psychic_power/tinker/Initialize(mapload, ...)
@@ -13,18 +13,6 @@
new_tools[capitalize_first_letters(tool_name)] = radial_image
tools = new_tools
-/obj/item/psychic_power/tinker/iscrowbar()
- return emulating == "crowbar"
-
-/obj/item/psychic_power/tinker/iswrench()
- return emulating == "wrench"
-
-/obj/item/psychic_power/tinker/isscrewdriver()
- return emulating == "screwdriver"
-
-/obj/item/psychic_power/tinker/iswirecutter()
- return emulating == "cutters"
-
/obj/item/psychic_power/tinker/attack_self(mob/user)
if(!owner || loc != owner)
return
@@ -38,8 +26,8 @@
if(!owner || loc != owner)
return
- emulating = lowertext(choice)
- name = "psychokinetic [emulating]"
- icon_state = emulating
- to_chat(owner, SPAN_NOTICE("You begin emulating \a [emulating]."))
+ tool_behaviour = lowertext(choice)
+ name = "psychokinetic [tool_behaviour]"
+ icon_state = tool_behaviour
+ to_chat(owner, SPAN_NOTICE("You begin emulating \a [tool_behaviour]."))
playsound(get_turf(src), 'sound/effects/psi/power_fabrication.ogg', 40, TRUE)
diff --git a/code/modules/random_map/automata/diona.dm b/code/modules/random_map/automata/diona.dm
index 5608dd40d71..bcd7f8fdbec 100644
--- a/code/modules/random_map/automata/diona.dm
+++ b/code/modules/random_map/automata/diona.dm
@@ -23,7 +23,7 @@
/obj/structure/diona/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if (!WT.welding)
to_chat(user, SPAN_WARNING("\The [WT] must be turned on!"))
diff --git a/code/modules/random_map/drop/droppod_doors.dm b/code/modules/random_map/drop/droppod_doors.dm
index 524bc94f57b..267a7f02106 100644
--- a/code/modules/random_map/drop/droppod_doors.dm
+++ b/code/modules/random_map/drop/droppod_doors.dm
@@ -31,7 +31,7 @@
/obj/structure/droppod_door/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index d909a13941d..7a9fcd6b0f3 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -92,7 +92,7 @@
user.drop_from_inventory(attacking_item, src)
to_chat(user, "You add the pill bottle into the dispenser slot!")
src.updateUsrDialog()
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
to_chat(user, "You [anchored ? "attach" : "detach"] the [src] [anchored ? "to" : "from"] the ground")
attacking_item.play_tool_sound(get_turf(src), 75)
diff --git a/code/modules/reagents/dispenser/dispenser2.dm b/code/modules/reagents/dispenser/dispenser2.dm
index 5371e4b8911..9aa6951cbb8 100644
--- a/code/modules/reagents/dispenser/dispenser2.dm
+++ b/code/modules/reagents/dispenser/dispenser2.dm
@@ -94,7 +94,7 @@
eject()
/obj/machinery/chemical_dispenser/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You begin to [anchored ? "un" : ""]fasten [src]."))
if(attacking_item.use_tool(src, user, 20, volume = 50))
user.visible_message(
@@ -108,7 +108,7 @@
else if(istype(attacking_item, /obj/item/reagent_containers/chem_disp_cartridge))
add_cartridge(attacking_item, user)
- else if(attacking_item.isscrewdriver())
+ else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
var/label = tgui_input_list(user, "Which cartridge would you like to remove?", "Chemical Dispenser", cartridges)
if(!label)
return
diff --git a/code/modules/reagents/dispenser/dispenser_presets.dm b/code/modules/reagents/dispenser/dispenser_presets.dm
index 5e567b830db..5eed5e9cab4 100644
--- a/code/modules/reagents/dispenser/dispenser_presets.dm
+++ b/code/modules/reagents/dispenser/dispenser_presets.dm
@@ -58,7 +58,7 @@
)
/obj/machinery/chemical_dispenser/ert/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("This dispenser is riveted to the floor and cannot be unanchored."))
return
else
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index c01e2576c17..77056b0d9f3 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -162,7 +162,7 @@
/obj/item/reagent_containers/blood/attackby(obj/item/attacking_item, mob/user)
..()
- if (attacking_item.ispen())
+ if (attacking_item.tool_behaviour == TOOL_PEN)
if (REAGENT_VOLUME(reagents, /singleton/reagent/blood) && name != "empty IV bag") //Stops people mucking with bloodpacks that are filled
to_chat(user, SPAN_NOTICE("You can't relabel [name] until it is empty!"))
return
@@ -173,7 +173,7 @@
return
var/obj/item/i = user.get_active_hand()
- if(!i.ispen() || !in_range(user, src)) //Checks to see if pen is still held or bloodpack is in range
+ if(!i.tool_behaviour == TOOL_PEN || !in_range(user, src)) //Checks to see if pen is still held or bloodpack is in range
return
if(blood_name == "Clear")
diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/reagents/reagent_containers/food/cans.dm
index 6d7b16369ac..d100b29a55f 100644
--- a/code/modules/reagents/reagent_containers/food/cans.dm
+++ b/code/modules/reagents/reagent_containers/food/cans.dm
@@ -72,7 +72,7 @@
qdel(grenade_casing)
update_icon()
- if(attacking_item.isscrewdriver() && bombcasing > BOMBCASING_EMPTY)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && bombcasing > BOMBCASING_EMPTY)
if(bombcasing == BOMBCASING_LOOSE)
bombcasing = BOMBCASING_SECURE
shrapnelcount = 14
@@ -107,7 +107,7 @@
else
to_chat(user, SPAN_WARNING("There is no opening on \the [name] for the steel wool!"))
- else if(attacking_item.iswirecutter() && fuselength)
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER && fuselength)
switch(fuselength)
if(1 to FUSELENGTH_MIN) // you can't increase the fuse with wirecutters and you can't trim it down below 3, so just remove it outright.
user.visible_message("[user] removes the steel wool from \the [name].",
diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm
index 5aed876cf70..2504f2c9a5a 100644
--- a/code/modules/reagents/reagent_containers/food/drinks.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks.dm
@@ -336,7 +336,7 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
. += "For: [details["Customer"]]"
/obj/item/reagent_containers/food/drinks/takeaway_cup_idris/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ispen() && !use_check_and_message(user))
+ if(attacking_item.tool_behaviour == TOOL_PEN && !use_check_and_message(user))
var/choice = tgui_input_list(user, "Which detail do you want to edit?", "Detail Editor", list("Customer", "Order"))
switch(choice)
if("Customer")
diff --git a/code/modules/reagents/reagent_containers/food/snacks/confections.dm b/code/modules/reagents/reagent_containers/food/snacks/confections.dm
index fb2db526f96..3516ac1ce5a 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/confections.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/confections.dm
@@ -216,7 +216,7 @@
//Custard + blowtorch = creme brulee
/obj/item/reagent_containers/food/snacks/custard/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = attacking_item
if(welder.isOn())
new /obj/item/reagent_containers/food/snacks/creme_brulee(src)
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index bdfed6a89da..61564e4b43d 100644
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -77,7 +77,7 @@
if(istype(attacking_item,/obj/item/storage/part_replacer))
if(!reagents || !reagents.total_volume)
return ..()
- if(attacking_item.ispen() || istype(attacking_item, /obj/item/device/flashlight/pen))
+ if(attacking_item.tool_behaviour == TOOL_PEN || istype(attacking_item, /obj/item/device/flashlight/pen))
var/tmp_label = sanitizeSafe( tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(tmp_label) > 15)
to_chat(user, SPAN_NOTICE("The label can be at most 15 characters long."))
@@ -282,7 +282,7 @@
user.put_in_hands(new /obj/item/bucket_sensor)
qdel(src)
return
- else if(attacking_item.iswirecutter())
+ else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, SPAN_NOTICE("You cut a big hole in \the [src] with \the [attacking_item]."))
user.put_in_hands(new helmet_type)
qdel(src)
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index f859100638f..ba3bd7521f2 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -181,7 +181,7 @@
return ..()
/obj/item/reagent_containers/hypospray/autoinjector/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver() && !is_open_container())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && !is_open_container())
to_chat(user, SPAN_NOTICE("Using \the [attacking_item], you unsecure the autoinjector's lid.")) // it locks shut after being secured
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
update_icon()
diff --git a/code/modules/reagents/reagent_containers/inhaler.dm b/code/modules/reagents/reagent_containers/inhaler.dm
index 16423a253a8..2fc15cac9ab 100644
--- a/code/modules/reagents/reagent_containers/inhaler.dm
+++ b/code/modules/reagents/reagent_containers/inhaler.dm
@@ -139,7 +139,7 @@
return
/obj/item/reagent_containers/inhaler/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver() && !is_open_container())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && !is_open_container())
to_chat(user,SPAN_NOTICE("Using \the [attacking_item], you unsecure the inhaler's lid.")) // it locks shut after being secured
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
update_icon()
diff --git a/code/modules/reagents/reagent_containers/inhaler_advanced.dm b/code/modules/reagents/reagent_containers/inhaler_advanced.dm
index c25a25bd4cc..9e09c61bad9 100644
--- a/code/modules/reagents/reagent_containers/inhaler_advanced.dm
+++ b/code/modules/reagents/reagent_containers/inhaler_advanced.dm
@@ -62,7 +62,7 @@
return
/obj/item/reagent_containers/personal_inhaler_cartridge/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver() && !is_open_container())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && !is_open_container())
to_chat(user,SPAN_NOTICE("Using \the [attacking_item], you unsecure the inhaler cartridge's lid.")) // it locks shut after being secured
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
return
diff --git a/code/modules/reagents/reagent_containers/welding_backpack.dm b/code/modules/reagents/reagent_containers/welding_backpack.dm
index adcdcaebd85..d5395a81518 100644
--- a/code/modules/reagents/reagent_containers/welding_backpack.dm
+++ b/code/modules/reagents/reagent_containers/welding_backpack.dm
@@ -28,7 +28,7 @@
. += SPAN_WARNING("\The [src] is empty!")
/obj/item/reagent_containers/weldpack/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(atom_flags & ATOM_FLAG_OPEN_CONTAINER)
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
else
@@ -36,7 +36,7 @@
attacking_item.play_tool_sound(get_turf(src), 70)
to_chat(user, SPAN_NOTICE("You wrench \the [src]'s fuel cap [(atom_flags & ATOM_FLAG_OPEN_CONTAINER) ? "open" : "closed"]."))
return
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/T = attacking_item
var/fuel_volume = REAGENT_VOLUME(reagents, /singleton/reagent/fuel)
if(!fuel_volume)
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 6bafc505d4b..776c7a37d46 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -65,7 +65,7 @@
else
to_chat(user,SPAN_NOTICE("The inlet cap on \the [src] is wrenched on tight!"))
- if (attacking_item.iswrench())
+ if (attacking_item.tool_behaviour == TOOL_WRENCH)
if(use_check(user, USE_DISALLOW_SPECIALS))
to_chat(user, SPAN_WARNING("A strange force prevents you from doing this.")) //there is no way to justify this icly
return
@@ -323,7 +323,7 @@
return "[src]'s cup dispenser is empty."
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/attacking_item, mob/user)
- if (attacking_item.isscrewdriver())
+ if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
src.add_fingerprint(user)
attacking_item.play_tool_sound(get_turf(src), 100)
if(do_after(user, 20))
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index 9263c348b58..c59d8e06da0 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -123,7 +123,7 @@
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!(stat & BROKEN))
var/obj/item/conveyor_construct/C = new/obj/item/conveyor_construct(src.loc)
C.id = id
@@ -262,7 +262,7 @@
S.update()
/obj/machinery/conveyor_switch/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == 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/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index 6e5ec152e0a..c11bb9a4a22 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -220,7 +220,7 @@
var/obj/structure/disposalpipe/CP = locate() in T
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(anchored)
anchored = 0
if(ispipe)
@@ -258,7 +258,7 @@
attacking_item.play_tool_sound(get_turf(src), 100)
update()
- else if(attacking_item.iswelder())
+ else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(anchored)
var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 1dd55a69846..32ee62d3289 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -153,14 +153,14 @@
src.add_fingerprint(user)
if(!is_on)
has_contents = contents_count()
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(has_contents)
to_chat(user, SPAN_WARNING("Eject the items first!"))
return TRUE
else if(default_deconstruction_screwdriver(user, attacking_item))
update()
return TRUE
- else if(attacking_item.iswelder() && panel_open)
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && panel_open)
if(has_contents)
to_chat(user, SPAN_WARNING("Eject the items first!"))
return TRUE
@@ -1067,7 +1067,7 @@
if(!T.is_plating())
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
@@ -1526,7 +1526,7 @@
if(!T.is_plating())
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
- if(attacking_item.iswelder())
+ if(attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
@@ -1684,7 +1684,7 @@
if(!attacking_item || !user)
return
src.add_fingerprint(user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(mode==0)
mode=1
attacking_item.play_tool_sound(get_turf(src), 50)
@@ -1695,7 +1695,7 @@
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You attach the screws around the power connection.")
return
- else if(attacking_item.iswelder() && mode==1)
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && mode==1)
var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 331335435c6..4f82a93b93e 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -54,7 +54,7 @@
else
to_chat(user, SPAN_WARNING("You need to set a destination first!"))
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
@@ -169,7 +169,7 @@
else
to_chat(user, SPAN_WARNING("You need to set a destination first!"))
- else if(attacking_item.ispen())
+ else if(attacking_item.tool_behaviour == TOOL_PEN)
switch(tgui_input_list(user, "What would you like to alter?", null, list("Title", "Description"), "Cancel"))
if("Title")
var/str = sanitizeSafe( tgui_input_text(usr, "Label text?", "Set label", "", MAX_NAME_LEN), MAX_NAME_LEN )
@@ -367,7 +367,7 @@
user.drop_item(attacking_item)
CollidedWith(attacking_item)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(c_mode==0)
c_mode=1
attacking_item.play_tool_sound(get_turf(src), 50)
@@ -378,7 +378,7 @@
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You attach the screws around the power connection.")
return
- else if(attacking_item.iswelder() && c_mode==1)
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && c_mode==1)
var/obj/item/weldingtool/W = attacking_item
if(W.use(1,user))
to_chat(user, "You start slicing the floorweld off the delivery chute.")
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index cb67d6810b2..8a2ada0319a 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -142,7 +142,7 @@
env.merge(removed)
/obj/machinery/r_n_d/server/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/device/multitool/MT = attacking_item
var/obj/machinery/r_n_d/tech_processor/TP = MT.get_buffer(/obj/machinery/r_n_d/tech_processor)
if(TP)
diff --git a/code/modules/research/tech_processor.dm b/code/modules/research/tech_processor.dm
index ef1b15f2171..e25e1e5e79e 100644
--- a/code/modules/research/tech_processor.dm
+++ b/code/modules/research/tech_processor.dm
@@ -43,7 +43,7 @@
heat_delay = initial(heat_delay)
/obj/machinery/r_n_d/tech_processor/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/device/multitool/MT = attacking_item
MT.set_buffer(src)
to_chat(user, SPAN_NOTICE("You attach \the [src]'s linking node to \the [MT]'s machinery buffer."))
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
index fd38e523686..5a2e7368f9c 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
@@ -227,14 +227,14 @@
istype(attacking_item,/obj/item/melee/energy) ||\
istype(attacking_item,/obj/item/melee/cultblade) ||\
istype(attacking_item,/obj/item/card/emag) ||\
- attacking_item.ismultitool())
+ attacking_item.tool_behaviour == TOOL_MULTITOOL)
if (my_effect.trigger == TRIGGER_ENERGY)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_ENERGY)
secondary_effect.ToggleActivate()
else if (istype(attacking_item,/obj/item/flame) && attacking_item:lit ||\
- attacking_item.iswelder() && attacking_item:welding)
+ attacking_item.tool_behaviour == TOOL_WELDER && attacking_item:welding)
if(my_effect.trigger == TRIGGER_HEAT)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_HEAT)
diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
index 142c0351650..7f39e0797de 100644
--- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
+++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
@@ -51,7 +51,7 @@
return TRUE
/obj/machinery/suspension_gen/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(!open)
screwed = !screwed
to_chat(user, SPAN_NOTICE("You [screwed ? "screw" : "unscrew"] the battery panel."))
@@ -59,7 +59,7 @@
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is open!"))
return
- else if (attacking_item.iscrowbar())
+ else if (attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!screwed)
if(!suspension_field)
open = !open
@@ -69,7 +69,7 @@
to_chat(user, SPAN_WARNING("[src]'s safety locks are engaged, shut it down first."))
else
to_chat(user, SPAN_WARNING("Unscrew [src]'s battery panel first."))
- else if (attacking_item.iswrench())
+ else if (attacking_item.tool_behaviour == TOOL_WRENCH)
if(!suspension_field)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You wrench the stabilising bolts [anchored ? "into place" : "loose"]."))
diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm
index 9d1162ae620..9c2aa63c376 100644
--- a/code/modules/shieldgen/emergency_shield.dm
+++ b/code/modules/shieldgen/emergency_shield.dm
@@ -320,7 +320,7 @@
return 1
/obj/machinery/shieldgen/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
if(panel_open)
to_chat(user, SPAN_NOTICE("You close the panel."))
@@ -329,7 +329,7 @@
to_chat(user, SPAN_NOTICE("You open the panel and expose the wiring."))
panel_open = TRUE
- else if(attacking_item.iscoil() && malfunction && panel_open)
+ else if(attacking_item.tool_behaviour == TOOL_CABLECOIL && malfunction && panel_open)
var/obj/item/stack/cable_coil/coil = attacking_item
to_chat(user, SPAN_NOTICE("You begin to replace the wires."))
//if(do_after(user, min(60, round( ((maxhealth/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage
@@ -340,7 +340,7 @@
to_chat(user, SPAN_NOTICE("You repair the [src]!"))
update_icon()
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(locked)
to_chat(user, "The bolts are covered, unlocking this would retract the covers.")
return
diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm
index cfba64f8f38..29292452a1f 100644
--- a/code/modules/shieldgen/shield_capacitor.dm
+++ b/code/modules/shieldgen/shield_capacitor.dm
@@ -49,7 +49,7 @@
updateDialog()
else
to_chat(user, SPAN_ALERT("Access denied."))
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by \the [user]."))
diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm
index ea91cca1c2f..e349cda4bad 100644
--- a/code/modules/shieldgen/shield_gen.dm
+++ b/code/modules/shieldgen/shield_gen.dm
@@ -59,7 +59,7 @@
updateDialog()
else
to_chat(user, SPAN_ALERT("Access denied."))
- else if(attacking_item.iswrench())
+ else if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = !anchored
visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "bolted to the floor":"unbolted from the floor"] by \the [user]."))
diff --git a/code/modules/shieldgen/shieldwallgen.dm b/code/modules/shieldgen/shieldwallgen.dm
index 1dd37451118..4525642e128 100644
--- a/code/modules/shieldgen/shieldwallgen.dm
+++ b/code/modules/shieldgen/shieldwallgen.dm
@@ -157,7 +157,7 @@
CF.set_dir(field_dir)
/obj/machinery/shieldwallgen/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(power_state)
to_chat(user, SPAN_WARNING("You cannot unsecure \the [src] while it's active."))
return
diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm
index 002a7e10926..2966904f98f 100644
--- a/code/modules/shuttles/shuttle_console.dm
+++ b/code/modules/shuttles/shuttle_console.dm
@@ -52,7 +52,7 @@
PH.set_console(src)
PH.set_hud_maptext("Shuttle Status: [get_shuttle_status(SSshuttle.shuttles[shuttle_tag])]")
return
- if(attacking_item.iscoil()) // Repair from hotwire
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL) // Repair from hotwire
var/obj/item/stack/cable_coil/C = attacking_item
if(hotwire_progress >= initial(hotwire_progress))
to_chat(usr, SPAN_BOLD("\The [src] does not require repairs."))
@@ -70,7 +70,7 @@
playsound(src.loc, 'sound/items/Deconstruct.ogg', 30, TRUE)
return
- if(attacking_item.iswirecutter()) // Hotwiring
+ if(attacking_item.tool_behaviour == TOOL_WIRECUTTER) // Hotwiring
if(!req_access && !req_one_access && !emagged) // Already hacked/no need to hack
to_chat(user, SPAN_BOLD("[src] is not access-locked."))
return
diff --git a/code/modules/spell_system/artifacts/items/poppet.dm b/code/modules/spell_system/artifacts/items/poppet.dm
index c26d0a41dc6..8318c6406cd 100644
--- a/code/modules/spell_system/artifacts/items/poppet.dm
+++ b/code/modules/spell_system/artifacts/items/poppet.dm
@@ -94,7 +94,7 @@
H.flash_act()
return TRUE
- if(attacking_item.iscoil())
+ if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
to_chat(H, SPAN_WARNING("You strangle \the [src] with \the [attacking_item]!"))
H.silent += 10
playsound(get_turf(H), 'sound/effects/noosed.ogg', 50, 1, -1)
diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm
index 8e3c636f07b..8596f20ea93 100644
--- a/code/modules/surgery/bones.dm
+++ b/code/modules/surgery/bones.dm
@@ -44,8 +44,8 @@
/singleton/surgery_step/set_bone
name = "Set Broken Bone"
allowed_tools = list(
- /obj/item/surgery/bonesetter = 100, \
- WRENCH = 75 \
+ TOOL_BONESET = 100, \
+ TOOL_WRENCH = 75 \
)
min_duration = 30
@@ -84,8 +84,8 @@
/singleton/surgery_step/mend_skull
name = "Repair Broken Skull"
allowed_tools = list(
- /obj/item/surgery/bonesetter = 100, \
- WRENCH = 75 \
+ TOOL_BONESET = 100, \
+ TOOL_WRENCH = 75 \
)
min_duration = 40
diff --git a/code/modules/surgery/encased.dm b/code/modules/surgery/encased.dm
index 7c5821b0abc..a0f872e099b 100644
--- a/code/modules/surgery/encased.dm
+++ b/code/modules/surgery/encased.dm
@@ -18,7 +18,7 @@
/singleton/surgery_step/open_encased/saw
allowed_tools = list(
- /obj/item/surgery/circular_saw = 100,
+ TOOL_SAW = 100,
/obj/item/melee/energy = 100,
/obj/item/melee/chainsword = 70,
/obj/item/material/hatchet = 75
@@ -67,8 +67,8 @@
/singleton/surgery_step/open_encased/retract
name = "Retract Sawed Bone"
allowed_tools = list(
- /obj/item/surgery/retractor = 100, \
- /obj/item/crowbar = 75
+ TOOL_RETRACTOR = 100, \
+ TOOL_CROWBAR = 75
)
min_duration = 20
@@ -121,8 +121,8 @@
/singleton/surgery_step/open_encased/close
name = "Bend Sawed Bone Closed"
allowed_tools = list(
- /obj/item/surgery/retractor = 100, \
- /obj/item/crowbar = 75
+ TOOL_RETRACTOR = 100, \
+ TOOL_CROWBAR = 75
)
min_duration = 20
diff --git a/code/modules/surgery/face.dm b/code/modules/surgery/face.dm
index 7cf8ee9659e..ad7815de60b 100644
--- a/code/modules/surgery/face.dm
+++ b/code/modules/surgery/face.dm
@@ -5,7 +5,7 @@
/singleton/surgery_step/generic/cut_face
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -35,7 +35,7 @@
/singleton/surgery_step/robotics/face/synthskin
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
diff --git a/code/modules/surgery/facial_surgery.dm b/code/modules/surgery/facial_surgery.dm
index 280c73af4c3..647e27a7163 100644
--- a/code/modules/surgery/facial_surgery.dm
+++ b/code/modules/surgery/facial_surgery.dm
@@ -19,7 +19,7 @@
/singleton/surgery_step/generic/prepare_face
allowed_tools = list(
- /obj/item/surgery/retractor = 100,
+ TOOL_RETRACTOR = 100,
/obj/item/material/knife/tacknife = 75
)
@@ -50,8 +50,8 @@
/singleton/surgery_step/generic/alter_face
name = "Alter Face"
allowed_tools = list(
- /obj/item/surgery/hemostat = 100, \
- /obj/item/stack/cable_coil = 75, \
+ TOOL_HEMOSTAT = 100, \
+ TOOL_CABLECOIL = 75, \
/obj/item/device/assembly/mousetrap = 10 //I don't know. Don't ask me. But I'm leaving it because hilarity.
)
@@ -96,7 +96,7 @@
/singleton/surgery_step/face/cauterize
name = "Cauterize Face"
allowed_tools = list(
- /obj/item/surgery/cautery = 100, \
+ TOOL_CAUTERY = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/flame/lighter = 50, \
/obj/item/weldingtool = 25
@@ -140,7 +140,7 @@
/singleton/surgery_step/robotics/face/synthskinopen
name = "Retract facial incisions"
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -169,7 +169,7 @@
/singleton/surgery_step/robotics/face/prepare_face
name = "Prepare Face"
allowed_tools = list(
- /obj/item/surgery/retractor = 100,
+ TOOL_RETRACTOR = 100,
/obj/item/material/knife/tacknife = 75
)
@@ -197,8 +197,8 @@
/singleton/surgery_step/robotics/face/alter_synthface
name = "Alter Face"
allowed_tools = list(
- /obj/item/device/multitool = 100, \
- /obj/item/stack/cable_coil = 75, \
+ TOOL_MULTITOOL = 100, \
+ TOOL_CABLECOIL = 75, \
/obj/item/device/assembly/mousetrap = 10 //I don't know. Don't ask me. But I'm leaving it because hilarity.
)
@@ -241,7 +241,7 @@
/singleton/surgery_step/robotics/face/seal_face
name = "Seal face"
allowed_tools = list(
- /obj/item/surgery/cautery = 100, \
+ TOOL_CAUTERY = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/flame/lighter = 50, \
/obj/item/weldingtool = 25
diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm
index 391135b8c0a..35da56b46c6 100644
--- a/code/modules/surgery/generic.dm
+++ b/code/modules/surgery/generic.dm
@@ -110,7 +110,7 @@
/singleton/surgery_step/generic/cut_open
name = "Make Incision"
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -155,7 +155,7 @@
/singleton/surgery_step/generic/cut_open_vaurca
name = "Cut Open Vaurca"
allowed_tools = list(
- /obj/item/surgery/surgicaldrill = 100,
+ TOOL_DRILL = 100,
/obj/item/pickaxe/ = 15
)
@@ -198,8 +198,8 @@
/singleton/surgery_step/generic/clamp_bleeders
name = "Clamp Bleeders"
allowed_tools = list(
- /obj/item/surgery/hemostat = 100, \
- /obj/item/stack/cable_coil = 75, \
+ TOOL_HEMOSTAT = 100, \
+ TOOL_CABLECOIL = 75, \
/obj/item/device/assembly/mousetrap = 20
)
@@ -237,8 +237,8 @@
/singleton/surgery_step/generic/retract_skin
name = "Widen Incision"
allowed_tools = list(
- /obj/item/surgery/retractor = 100, \
- /obj/item/crowbar = 75, \
+ TOOL_RETRACTOR = 100, \
+ TOOL_CROWBAR = 75, \
/obj/item/material/kitchen/utensil/fork = 50
)
@@ -299,7 +299,7 @@
/singleton/surgery_step/generic/cauterize
name = "Cauterize Incision"
allowed_tools = list(
- /obj/item/surgery/cautery = 100,
+ TOOL_CAUTERY = 100,
/obj/item/clothing/mask/smokable/cigarette = 25,
/obj/item/flame/lighter = 50,
/obj/item/weldingtool = 75
diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm
index fcdc0b24b38..b39aea2bf51 100644
--- a/code/modules/surgery/implant.dm
+++ b/code/modules/surgery/implant.dm
@@ -42,7 +42,7 @@
/singleton/surgery_step/cavity/make_space
name = "Hollow Out Cavity"
allowed_tools = list(
- /obj/item/surgery/surgicaldrill = 100, \
+ TOOL_DRILL = 100, \
/obj/item/pen = 75, \
/obj/item/stack/rods = 50
)
@@ -73,7 +73,7 @@
name = "Close Cavity"
priority = 2
allowed_tools = list(
- /obj/item/surgery/cautery = 100, \
+ TOOL_CAUTERY = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/flame/lighter = 50, \
/obj/item/weldingtool = 25
@@ -152,8 +152,8 @@
/singleton/surgery_step/cavity/implant_removal
name = "Remove Foreign Body"
allowed_tools = list(
- /obj/item/surgery/hemostat = 100, \
- WIRECUTTER = 75, \
+ TOOL_HEMOSTAT = 100, \
+ TOOL_WIRECUTTER = 75, \
/obj/item/material/kitchen/utensil/fork = 20
)
diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm
index d0f913ade77..e2b40c71e02 100644
--- a/code/modules/surgery/limb_reattach.dm
+++ b/code/modules/surgery/limb_reattach.dm
@@ -52,8 +52,8 @@
/singleton/surgery_step/limb/connect
name = "Connect Limb"
allowed_tools = list(
- /obj/item/surgery/hemostat = 100, \
- /obj/item/stack/cable_coil = 75, \
+ TOOL_HEMOSTAT = 100, \
+ TOOL_CABLECOIL = 75, \
/obj/item/device/assembly/mousetrap = 20
)
can_infect = TRUE
diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm
index a7fb2760b43..5ba79b6ad78 100644
--- a/code/modules/surgery/organs_internal.dm
+++ b/code/modules/surgery/organs_internal.dm
@@ -111,7 +111,7 @@
allowed_tools = list(
/obj/item/stack/nanopaste = 100,
/obj/item/surgery/bone_gel = 30,
- SCREWDRIVER = 70
+ TOOL_SCREWDRIVER = 70
)
min_duration = 50
@@ -180,7 +180,7 @@
name = "Separate Organ"
priority = 1
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -246,8 +246,8 @@
/singleton/surgery_step/internal/remove_organ
name = "Remove Organ"
allowed_tools = list(
- /obj/item/surgery/hemostat = 100, \
- WIRECUTTER = 75, \
+ TOOL_HEMOSTAT = 100, \
+ TOOL_WIRECUTTER = 75, \
/obj/item/material/kitchen/utensil/fork = 20
)
@@ -412,7 +412,7 @@
name = "Attach Organ"
allowed_tools = list(
/obj/item/surgery/fix_o_vein = 100, \
- /obj/item/stack/cable_coil = 75
+ TOOL_CABLECOIL = 75
)
min_duration = 80
@@ -465,7 +465,7 @@
name = "Prepare Brain"
allowed_tools = list(
/obj/item/surgery/scalpel/manager = 95,
- /obj/item/surgery/surgicaldrill = 75,
+ TOOL_DRILL = 75,
/obj/item/pickaxe/ = 5
)
diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm
index 5506b6b91b8..15e3cb29eb8 100644
--- a/code/modules/surgery/other.dm
+++ b/code/modules/surgery/other.dm
@@ -9,7 +9,7 @@
priority = 3
allowed_tools = list(
/obj/item/surgery/fix_o_vein = 100, \
- /obj/item/stack/cable_coil = 75
+ TOOL_CABLECOIL = 75
)
can_infect = TRUE
blood_level = 1
@@ -55,7 +55,7 @@
name = "Debride Damaged Tissue"
priority = 4
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -189,7 +189,7 @@
priority = 2
allowed_tools = list(
/obj/item/surgery/fix_o_vein = 100, \
- /obj/item/stack/cable_coil = 75
+ TOOL_CABLECOIL = 75
)
can_infect = TRUE
blood_level = 1
@@ -227,8 +227,8 @@
/singleton/surgery_step/hardsuit
name = "Remove Hardsuit"
allowed_tools = list(
- /obj/item/weldingtool = 80,
- /obj/item/surgery/circular_saw = 60,
+ TOOL_WELDER = 80,
+ TOOL_SAW = 60,
/obj/item/gun/energy/plasmacutter = 100
)
@@ -244,7 +244,7 @@
if(!istype(target))
return FALSE
- if(tool.iswelder())
+ if(tool.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = tool
if(!welder.isOn() || !welder.use(1,user))
return FALSE
@@ -266,7 +266,7 @@
/singleton/surgery_step/amputate
name = "Amputate Limb"
allowed_tools = list(
- /obj/item/surgery/circular_saw = 100,
+ TOOL_SAW = 100,
/obj/item/melee/energy = 100,
/obj/item/melee/chainsword = 100,
/obj/item/material/hatchet = 55
diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm
index 0f166ccbbdd..e165161d329 100644
--- a/code/modules/surgery/robotics.dm
+++ b/code/modules/surgery/robotics.dm
@@ -25,7 +25,7 @@
/singleton/surgery_step/robotics/unscrew_hatch
name = "Unscrew Hatch"
allowed_tools = list(
- SCREWDRIVER = 100,
+ TOOL_SCREWDRIVER = 100,
/obj/item/coin = 50,
/obj/item/material/kitchen/utensil/knife = 50
)
@@ -67,7 +67,7 @@
/singleton/surgery_step/robotics/screw_hatch
name = "Screw Hatch"
allowed_tools = list(
- SCREWDRIVER = 100,
+ TOOL_SCREWDRIVER = 100,
/obj/item/coin = 50,
/obj/item/material/kitchen/utensil/knife = 50
)
@@ -109,8 +109,8 @@
/singleton/surgery_step/robotics/open_hatch
name = "Open Hatch"
allowed_tools = list(
- /obj/item/surgery/retractor = 100,
- CROWBAR = 100,
+ TOOL_RETRACTOR = 100,
+ TOOL_CROWBAR = 100,
/obj/item/material/kitchen/utensil = 50
)
@@ -146,8 +146,8 @@
/singleton/surgery_step/robotics/close_hatch
name = "Close Hatch"
allowed_tools = list(
- /obj/item/surgery/retractor = 100,
- CROWBAR = 100,
+ TOOL_RETRACTOR = 100,
+ TOOL_CROWBAR = 100,
/obj/item/material/kitchen/utensil = 50
)
@@ -187,7 +187,7 @@
/singleton/surgery_step/robotics/repair_brute
name = "Repair Damage"
allowed_tools = list(
- /obj/item/weldingtool = 100,
+ TOOL_WELDER = 100,
/obj/item/gun/energy/plasmacutter = 50
)
@@ -199,7 +199,7 @@
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
- if(tool.iswelder())
+ if(tool.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = tool
if(!welder.isOn() || welder.get_fuel() < 2)
return FALSE
@@ -212,7 +212,7 @@
..()
/singleton/surgery_step/robotics/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
- if(tool.iswelder())
+ if(tool.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = tool
if(!welder.isOn() && !welder.use(2, user))
user.visible_message(SPAN_WARNING("[user]'s [tool] shut off before the procedure was finished."), \
@@ -232,8 +232,7 @@
/singleton/surgery_step/robotics/repair_burn
name = "Repair Burns"
allowed_tools = list(
- /obj/item/stack/cable_coil = 100,
- /obj/item/stack/cable_coil/cyborg = 100
+ TOOL_CABLECOIL = 100
)
min_duration = 30
@@ -276,7 +275,7 @@
/singleton/surgery_step/robotics/detach_organ_robotic
name = "Detach Robotic Organ"
allowed_tools = list(
- /obj/item/device/multitool = 100
+ TOOL_MULTITOOL = 100
)
min_duration = 70
@@ -326,7 +325,7 @@
/singleton/surgery_step/robotics/attach_organ_robotic
name = "Attach Robotic Organ"
allowed_tools = list(
- SCREWDRIVER = 100
+ TOOL_SCREWDRIVER = 100
)
min_duration = 80
@@ -452,8 +451,7 @@
/singleton/surgery_step/internal/fix_internal_wiring
name = "Repair Internal Wiring"
allowed_tools = list(
- /obj/item/stack/cable_coil = 100,
- /obj/item/stack/cable_coil/cyborg = 100
+ TOOL_CABLECOIL = 100
)
min_duration = 50
@@ -502,7 +500,7 @@
/singleton/surgery_step/internal/fix_internal_electronics
name = "Repair Internal Electronics"
allowed_tools = list(
- /obj/item/device/multitool = 100,
+ TOOL_MULTITOOL = 100,
)
min_duration = 100
@@ -727,7 +725,7 @@
/singleton/surgery_step/robotics/repair_endoskeleton
name = "Repair Endoskeleton"
allowed_tools = list(
- /obj/item/weldingtool = 100,
+ TOOL_WELDER = 100,
/obj/item/gun/energy/plasmacutter = 50
)
@@ -739,7 +737,7 @@
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
- if(tool.iswelder())
+ if(tool.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = tool
if(!welder.isOn() || welder.get_fuel() < 5)
return FALSE
@@ -755,7 +753,7 @@
..()
/singleton/surgery_step/robotics/repair_endoskeleton/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
- if(tool.iswelder())
+ if(tool.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/welder = tool
if(!welder.isOn() && !welder.use(5, user))
user.visible_message(SPAN_WARNING("[user]'s [tool] shut off before the procedure was finished."), \
diff --git a/code/modules/surgery/slimes.dm b/code/modules/surgery/slimes.dm
index 5d214c4d7a0..3f448b9d81b 100644
--- a/code/modules/surgery/slimes.dm
+++ b/code/modules/surgery/slimes.dm
@@ -12,7 +12,7 @@
/singleton/surgery_step/slime/cut_flesh
name = "Open Slime"
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -40,7 +40,7 @@
/singleton/surgery_step/slime/cut_innards
name = "Cut Innards"
allowed_tools = list(
- /obj/item/surgery/scalpel = 100,
+ TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
@@ -68,7 +68,7 @@
/singleton/surgery_step/slime/saw_core
name = "Detach Core"
allowed_tools = list(
- /obj/item/surgery/circular_saw = 100, \
+ TOOL_SAW = 100, \
/obj/item/material/hatchet = 75
)
diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm
index b952555ed32..715e2196301 100644
--- a/code/modules/surgery/surgery.dm
+++ b/code/modules/surgery/surgery.dm
@@ -4,24 +4,24 @@
var/name
var/priority = 0 //steps with higher priority would be attempted first
- // type path referencing tools that can be used for this step, and how well are they suited for it
+ /// type path referencing tools that can be used for this step, and how well are they suited for it
var/list/allowed_tools = null
- // type paths referencing races that this step applies to.
+ /// type paths referencing races that this step applies to.
var/list/allowed_species = null
var/list/disallowed_species = list("Nymph")
- // duration of the step
+ /// duration of the step
var/min_duration = 0
var/max_duration = 0
- // evil infection stuff that will make everyone hate me
+ /// evil infection stuff that will make everyone hate me
var/can_infect = FALSE
- //How much blood this step can get on surgeon. 1 - hands, 2 - full body.
+ /// How much blood this step can get on surgeon. 1 - hands, 2 - full body.
var/blood_level = 0
var/requires_surgery_compatibility = TRUE
- //returns how well tool is suited for this step
+/// Returns how well tool is suited for this step.
/singleton/surgery_step/proc/tool_quality(obj/item/tool)
for(var/T in allowed_tools)
var/return_value = check_tool_quality(tool, T, allowed_tools[T], requires_surgery_compatibility)
@@ -31,7 +31,7 @@
return allowed_tools[T]
return FALSE
- // Checks if this step applies to the user mob at all
+/// Checks if this step applies to the user mob at all
/singleton/surgery_step/proc/is_valid_target(mob/living/carbon/human/target)
if(!ishuman(target))
return FALSE
@@ -49,13 +49,13 @@
return TRUE
-// checks whether this step can be applied with the given user and target
+/// Checks whether this step can be applied with the given user and target
/singleton/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return FALSE
return TRUE
-// does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
+/// Does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
/singleton/surgery_step/proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(can_infect && affected)
@@ -69,11 +69,11 @@
playsound(target.loc, tool.surgerysound, 50, TRUE)
return TRUE
-// does stuff to end the step, which is normally print a message + do whatever this step changes
+/// Does stuff to end the step, which is normally print a message + do whatever this step changes
/singleton/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return FALSE
-// stuff that happens when the step fails
+/// Stuff that happens when the step fails
/singleton/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return null
diff --git a/code/modules/tables/interactions.dm b/code/modules/tables/interactions.dm
index 2929171c1b1..228b3d88d9b 100644
--- a/code/modules/tables/interactions.dm
+++ b/code/modules/tables/interactions.dm
@@ -239,7 +239,7 @@
to_chat(user, SPAN_WARNING("You need a better grip to do that!"))
return
- if(reinforced && attacking_item.isscrewdriver())
+ if(reinforced && attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
remove_reinforced(attacking_item, user)
if(!reinforced)
update_desc()
@@ -247,7 +247,7 @@
update_material()
return 1
- if(carpeted && attacking_item.iscrowbar())
+ if(carpeted && attacking_item.tool_behaviour == TOOL_CROWBAR)
user.visible_message(SPAN_NOTICE("\The [user] removes the carpet from \the [src]."),
SPAN_NOTICE("You remove the carpet from \the [src]."))
new /obj/item/stack/tile/carpet(loc)
@@ -266,7 +266,7 @@
else
to_chat(user, SPAN_WARNING("You don't have enough carpet!"))
- if(!reinforced && !carpeted && material && (attacking_item.iswrench() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ if(!reinforced && !carpeted && material && (attacking_item.tool_behaviour == TOOL_WRENCH || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
remove_material(attacking_item, user)
if(!material)
update_connections(1)
@@ -277,11 +277,11 @@
update_material()
return 1
- if(!carpeted && !reinforced && !material && (attacking_item.iswrench() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ if(!carpeted && !reinforced && !material && (attacking_item.tool_behaviour == TOOL_WRENCH || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
dismantle(attacking_item, user)
return 1
- if(health < maxhealth && attacking_item.iswelder())
+ if(health < maxhealth && attacking_item.tool_behaviour == TOOL_WELDER)
var/obj/item/weldingtool/F = attacking_item
if(F.welding)
to_chat(user, SPAN_NOTICE("You begin reparing damage to \the [src]."))
@@ -321,7 +321,7 @@
return
- if(attacking_item.ishammer() && user.a_intent != I_HURT)
+ if(attacking_item.tool_behaviour == TOOL_HAMMER && user.a_intent != I_HURT)
var/obj/item/I = usr.get_inactive_hand()
if(I && istype(I, /obj/item/stack))
var/obj/item/stack/D = I
diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm
index c43f893cc7f..8ec4f4c21f2 100644
--- a/code/modules/telesci/telepad.dm
+++ b/code/modules/telesci/telepad.dm
@@ -36,12 +36,12 @@
return
if(panel_open)
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/device/multitool/M = attacking_item
M.buffer = src
to_chat(user, "You save the data in the [attacking_item.name]'s buffer.")
else
- if(attacking_item.ismultitool())
+ if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, "You should open [src]'s maintenance panel first.")
default_deconstruction_crowbar(user, attacking_item)
@@ -66,7 +66,7 @@
var/stage = 0
/obj/machinery/telepad_cargo/attackby(obj/item/attacking_item, mob/user, params)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
anchored = 0
attacking_item.play_tool_sound(get_turf(src), 50)
if(anchored)
@@ -75,7 +75,7 @@
else if(!anchored)
anchored = 1
to_chat(user, "\The [src] is now secured.")
- if(attacking_item.isscrewdriver())
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(stage == 0)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unscrew the telepad's tracking beacon.")
@@ -84,7 +84,7 @@
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You screw in the telepad's tracking beacon.")
stage = 0
- if(attacking_item.iswelder() && stage == 1)
+ if(attacking_item.tool_behaviour == TOOL_WELDER && stage == 1)
playsound(src, 'sound/items/Welder.ogg', 50, 1)
to_chat(user, "You disassemble the telepad.")
new /obj/item/stack/material/steel(get_turf(src))
diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm
index 0caf8293d42..389cb33add1 100644
--- a/code/modules/telesci/telesci_computer.dm
+++ b/code/modules/telesci/telesci_computer.dm
@@ -170,7 +170,7 @@
user.visible_message("[user] inserts [attacking_item] into \the [src]'s GPS device slot.",
SPAN_NOTICE("You insert [attacking_item] into \the [src]'s GPS device slot."))
- else if(attacking_item.ismultitool())
+ else if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/device/multitool/M = attacking_item
if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm
index 3793719f9b6..2e81b76f52f 100644
--- a/code/modules/vehicles/cargo_train.dm
+++ b/code/modules/vehicles/cargo_train.dm
@@ -148,7 +148,7 @@
return ..()
/obj/vehicle/train/cargo/trolley/attackby(obj/item/attacking_item, mob/user)
- if(open && attacking_item.iswirecutter())
+ if(open && attacking_item.tool_behaviour == TOOL_WIRECUTTER)
passenger_allowed = !passenger_allowed
user.visible_message(SPAN_NOTICE("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src]."),
SPAN_NOTICE("You [passenger_allowed ? "cut" : "mend"] the load limiter cable."))
diff --git a/code/modules/vehicles/droppod.dm b/code/modules/vehicles/droppod.dm
index d3588c86815..2639395af94 100644
--- a/code/modules/vehicles/droppod.dm
+++ b/code/modules/vehicles/droppod.dm
@@ -45,7 +45,7 @@
return
/obj/vehicle/droppod/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswelder() && status == USED && !humanload && !passenger)
+ if(attacking_item.tool_behaviour == TOOL_WELDER && status == USED && !humanload && !passenger)
var/obj/item/weldingtool/W = attacking_item
if(W.welding)
src.visible_message(SPAN_NOTICE("[user] starts cutting \the [src] apart."))
diff --git a/code/modules/vehicles/pussywagon.dm b/code/modules/vehicles/pussywagon.dm
index 3abcefde7bd..212ccd6f165 100644
--- a/code/modules/vehicles/pussywagon.dm
+++ b/code/modules/vehicles/pussywagon.dm
@@ -174,7 +174,7 @@
to_chat(user, SPAN_NOTICE("You replace \the [src]'s reagent reservoir."))
return
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!open)
to_chat(user, SPAN_WARNING("\The [src]'s maintenance panel isn't open."))
return
@@ -187,7 +187,7 @@
to_chat(user, SPAN_WARNING("\The [src] doesn't have a reagent reservoir installed."))
return
- if(attacking_item.iscrowbar())
+ if(attacking_item.tool_behaviour == TOOL_CROWBAR)
if(!open)
to_chat(user, SPAN_WARNING("\The [src]'s panel isn't open."))
return
diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm
index e99a3de1ab0..de83edb8413 100644
--- a/code/modules/vehicles/train.dm
+++ b/code/modules/vehicles/train.dm
@@ -107,7 +107,7 @@
unload(user) //unload if loaded
/obj/vehicle/train/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 70)
unattach(user)
return
diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm
index 90d702a0071..76029e25233 100644
--- a/code/modules/vehicles/vehicle.dm
+++ b/code/modules/vehicles/vehicle.dm
@@ -91,17 +91,17 @@
/obj/vehicle/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/device/hand_labeler))
return
- if(attacking_item.isscrewdriver() && !organic)
+ if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER && !organic)
if(!locked)
open = !open
update_icon()
to_chat(user, SPAN_NOTICE("Maintenance panel is now [open ? "opened" : "closed"]."))
- else if(attacking_item.iscrowbar() && cell && open && !organic)
+ else if(attacking_item.tool_behaviour == TOOL_CROWBAR && cell && open && !organic)
remove_cell(user)
else if(istype(attacking_item, /obj/item/cell) && !cell && open && !organic)
insert_cell(attacking_item, user)
- else if(attacking_item.iswelder() && !organic)
+ else if(attacking_item.tool_behaviour == TOOL_WELDER && !organic)
var/obj/item/weldingtool/T = attacking_item
if(T.welding)
if(health < maxhealth)
diff --git a/html/changelogs/Bat-Tools.yml b/html/changelogs/Bat-Tools.yml
new file mode 100644
index 00000000000..039dd8e7a68
--- /dev/null
+++ b/html/changelogs/Bat-Tools.yml
@@ -0,0 +1,14 @@
+# Your name.
+author: Batrachophrenoboocosmomachia
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
+# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - refactor: "Adds tool_behaviour variable to /obj/item which defines the object's functionality, removing the need for iscrowbar(), iswrench() etc. procs."
+ - rscadd: "Adds multiple tool-related signals."
diff --git a/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm b/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm
index 7b059c3d7e2..88fd612935b 100644
--- a/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm
+++ b/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm
@@ -629,7 +629,7 @@ GLOBAL_LIST_EMPTY(trackables_pool)
return ..()
/obj/structure/quarantined_outpost/fluff_canister/attackby(obj/item/attacking_item, mob/user)
- if(attacking_item.iswrench())
+ if(attacking_item.tool_behaviour == TOOL_WRENCH)
if(!locate(/obj/structure/quarantined_outpost/fluff_connector) in get_turf(src))
to_chat(user, SPAN_WARNING("There is no suitable port to secure \the [src]."))
return TRUE