diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm
index d66ebc100c..ea1189c1cb 100644
--- a/code/ATMOSPHERICS/atmospherics.dm
+++ b/code/ATMOSPHERICS/atmospherics.dm
@@ -160,8 +160,8 @@ Pipelines + Other Objects -> Pipe network
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
- return 0
- return 1
+ return FALSE
+ return TRUE
// Deconstruct into a pipe item.
/obj/machinery/atmospherics/proc/deconstruct()
@@ -228,3 +228,21 @@ Pipelines + Other Objects -> Pipe network
// pixel_x = PIPE_PIXEL_OFFSET_X(piping_layer)
// pixel_y = PIPE_PIXEL_OFFSET_Y(piping_layer)
// layer = initial(layer) + PIPE_LAYER_OFFSET(piping_layer)
+
+/obj/machinery/atmospherics/default_deconstruction_wrench(var/obj/item/weapon/W as obj, var/mob/user as mob)
+ if (!W.get_tool_quality(TOOL_WRENCH))
+ return FALSE
+
+ if(!can_unwrench())
+ to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.")
+ else
+ playsound(src, W.usesound, 50, 1, preference = /datum/client_preference/pickup_sounds)
+ to_chat(user, "You begin to unfasten \the [src]...")
+ if (do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
+ user.visible_message( \
+ "\The [user] unfastens \the [src].", \
+ "You have unfastened \the [src].", \
+ "You hear a ratchet.")
+ deconstruct()
+ add_fingerprint(user)
+ return TRUE
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index 071593f7d6..ae92466e88 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -91,7 +91,7 @@
return 1
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
index 46b82e3b6f..456bf6761f 100644
--- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
@@ -279,23 +279,12 @@
add_fingerprint(usr)
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
if (unlocked)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
#undef REGULATE_NONE
#undef REGULATE_INPUT
diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm
index c767679f3e..0da858d11a 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm
@@ -240,20 +240,9 @@ Thus, the two variables affect pump operation are set in New():
update_icon()
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench this [src], turn it off first.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench this [src], it too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
index bc772ba8c6..3a2bd1a5f1 100644
--- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
@@ -80,21 +80,9 @@
update_icon()
/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(!W.is_wrench())
+ if(!W.get_tool_quality(TOOL_WRENCH))
return ..()
-
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- to_chat(user, "You begin to unfasten \the [src]...")
- playsound(src, W.usesound, 50, 1)
- if(do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return default_deconstruction_wrench(user, W)
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
if(..())
diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm
index 5b489441db..37b3611bb7 100644
--- a/code/ATMOSPHERICS/components/portables_connector.dm
+++ b/code/ATMOSPHERICS/components/portables_connector.dm
@@ -147,22 +147,11 @@
/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if(!W.get_tool_quality(TOOL_WRENCH))
return ..()
- if (connected_device)
+ if(connected_device)
to_chat(user, "You cannot unwrench \the [src], dettach \the [connected_device] first.")
- return 1
- if (locate(/obj/machinery/portable_atmospherics, src.loc))
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ if(locate(/obj/machinery/portable_atmospherics, src.loc))
+ return TRUE
+ return default_deconstruction_wrench(user, W)
diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
index 4570b95dda..8279ed77c5 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
@@ -52,20 +52,9 @@
update_icon()
/obj/machinery/atmospherics/trinary/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return default_deconstruction_wrench(user, W)
// Housekeeping and pipe network stuff below
/obj/machinery/atmospherics/trinary/get_neighbor_nodes_for_init()
diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm
index 7deca38847..d8f657689c 100644
--- a/code/ATMOSPHERICS/components/tvalve.dm
+++ b/code/ATMOSPHERICS/components/tvalve.dm
@@ -327,23 +327,13 @@
go_to_side()
/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if(!W.get_tool_quality(TOOL_WRENCH))
return ..()
- if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
+ if(istype(src, /obj/machinery/atmospherics/tvalve/digital))
to_chat(user, "You cannot unwrench \the [src], it's too complicated.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
+
/obj/machinery/atmospherics/tvalve/mirrored
icon_state = "map_tvalvem0"
diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
index bba26185e7..ab800040ca 100644
--- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
@@ -67,21 +67,10 @@
return 1
/obj/machinery/atmospherics/unary/heat_exchanger/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
to_chat(user, "You must remove the plating first.")
- return 1
- if (!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm
index fa77c7b7ab..0ef41c04b5 100644
--- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm
+++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm
@@ -161,14 +161,7 @@
update_icon()
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
+ return default_deconstruction_wrench(user, W)
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 926521ad00..5a6081ef8e 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -381,7 +381,7 @@
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
to_chat(user, "Now welding the vent.")
- if(do_after(user, 20 * WT.toolspeed))
+ if(do_after(user, 20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
playsound(src, WT.usesound, 50, 1)
if(!welded)
@@ -416,27 +416,16 @@
update_icon()
/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
- return 1
+ return TRUE
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && !T.is_plating())
to_chat(user, "You must remove the plating first.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
#undef DEFAULT_PRESSURE_DELTA
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 495d7d0428..8cf56c98cf 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -264,27 +264,17 @@
update_icon()
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
- return 1
+ return TRUE
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && !T.is_plating())
to_chat(user, "You must remove the plating first.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
+
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
. = ..()
diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm
index c890938100..aa9fc24120 100644
--- a/code/ATMOSPHERICS/components/valve.dm
+++ b/code/ATMOSPHERICS/components/valve.dm
@@ -19,7 +19,7 @@
var/datum/pipe_network/network_node2
/obj/machinery/atmospherics/valve/open
- open = 1
+ open = TRUE
icon_state = "map_valve1"
/obj/machinery/atmospherics/valve/update_icon(animation)
@@ -61,7 +61,7 @@
network_node1 = new_network
if(new_network.normal_members.Find(src))
- return 0
+ return FALSE
new_network.normal_members += src
@@ -89,9 +89,10 @@
node2 = null
/obj/machinery/atmospherics/valve/proc/open()
- if(open) return 0
+ if(open)
+ return FALSE
- open = 1
+ open = TRUE
update_icon()
if(network_node1&&network_node2)
@@ -99,17 +100,17 @@
network_node2 = network_node1
if(network_node1)
- network_node1.update = 1
+ network_node1.update = TRUE
else if(network_node2)
- network_node2.update = 1
+ network_node2.update = TRUE
- return 1
+ return TRUE
/obj/machinery/atmospherics/valve/proc/close()
if(!open)
- return 0
+ return FALSE
- open = 0
+ open = FALSE
update_icon()
if(network_node1)
@@ -119,7 +120,7 @@
build_network()
- return 1
+ return TRUE
/obj/machinery/atmospherics/valve/proc/normalize_dir()
if(dir==3)
@@ -141,9 +142,7 @@
/obj/machinery/atmospherics/valve/process()
..()
- . = PROCESS_KILL
-
- return
+ return PROCESS_KILL
/obj/machinery/atmospherics/valve/atmos_init()
normalize_dir()
@@ -199,7 +198,7 @@
if(network_node2 == old_network)
network_node2 = new_network
- return 1
+ return TRUE
/obj/machinery/atmospherics/valve/return_network_air(datum/pipe_network/reference)
return null
@@ -229,7 +228,7 @@
/obj/machinery/atmospherics/valve/digital/Destroy()
unregister_radio(src, frequency)
- . = ..()
+ return ..()
/obj/machinery/atmospherics/valve/digital/attack_ai(mob/user as mob)
return src.attack_hand(user)
@@ -240,20 +239,20 @@
if(!src.allowed(user))
to_chat(user, "Access denied.")
return
- ..()
+ return ..()
/obj/machinery/atmospherics/valve/digital/open
- open = 1
+ open = TRUE
icon_state = "map_valve1"
/obj/machinery/atmospherics/valve/digital/power_change()
var/old_stat = stat
- ..()
+ . = ..()
if(old_stat != stat)
update_icon()
/obj/machinery/atmospherics/valve/digital/update_icon()
- ..()
+ . = ..()
if(!powered())
icon_state = "valve[open]nopower"
@@ -270,7 +269,7 @@
/obj/machinery/atmospherics/valve/digital/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id))
- return 0
+ return FALSE
switch(signal.data["command"])
if("valve_open")
@@ -286,25 +285,16 @@
close()
else
open()
+ return TRUE
/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user))
to_chat(user, "Access denied.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 40 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(user, W)
+
/obj/machinery/atmospherics/valve/examine(mob/user)
. = ..()
diff --git a/code/ATMOSPHERICS/pipes/pipe_base.dm b/code/ATMOSPHERICS/pipes/pipe_base.dm
index 22ceb272f6..9792b3396d 100644
--- a/code/ATMOSPHERICS/pipes/pipe_base.dm
+++ b/code/ATMOSPHERICS/pipes/pipe_base.dm
@@ -114,26 +114,17 @@
return ..()
if(istype(W,/obj/item/device/pipe_painter))
- return 0
+ return FALSE
- if (!W.is_wrench())
+ if (!W.get_tool_quality(TOOL_WRENCH))
return ..()
+
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
to_chat(user, "You must remove the plating first.")
- return 1
- if(!can_unwrench())
- to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
- add_fingerprint(user)
- return 1
- playsound(src, W.usesound, 50, 1)
- to_chat(user, "You begin to unfasten \the [src]...")
- if (do_after(user, 10 * W.toolspeed))
- user.visible_message( \
- "\The [user] unfastens \the [src].", \
- "You have unfastened \the [src].", \
- "You hear a ratchet.")
- deconstruct()
+ return TRUE
+ return default_deconstruction_wrench(W, user)
+
/obj/machinery/atmospherics/pipe/proc/change_color(var/new_color)
//only pass valid pipe colors please ~otherwise your pipe will turn invisible
diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm
index 0b955b6cfc..6eb5bf315e 100644
--- a/code/__defines/misc.dm
+++ b/code/__defines/misc.dm
@@ -256,12 +256,6 @@ var/global/list/##LIST_NAME = list();\
#define MATRIX_Vulp_Colorblind list(0.50, 0.40, 0.10, 0.50, 0.40, 0.10, 0, 0.20, 0.80)
#define MATRIX_Taj_Colorblind list(0.40, 0.20, 0.40, 0.40, 0.60, 0, 0.20, 0.20, 0.60)
-// Tool substitution defines
-#define IS_SCREWDRIVER "screwdriver"
-#define IS_CROWBAR "crowbar"
-#define IS_WIRECUTTER "wirecutter"
-#define IS_WRENCH "wrench"
-
// Diagonal movement
#define FIRST_DIAG_STEP 1
diff --git a/code/__defines/tools.dm b/code/__defines/tools.dm
index d7b5e1cdba..18feb9b9e5 100644
--- a/code/__defines/tools.dm
+++ b/code/__defines/tools.dm
@@ -12,10 +12,26 @@
#define TOOL_RETRACTOR "retractor"
#define TOOL_HEMOSTAT "hemostat"
#define TOOL_CAUTERY "cautery"
-#define TOOL_DRILL "drill"
+#define TOOL_SDRILL "surgical_drill"
#define TOOL_SCALPEL "scalpel"
-#define TOOL_SAW "saw"
+#define TOOL_CSAW "circ_saw"
#define TOOL_BONESET "bonesetter"
#define TOOL_KNIFE "knife"
#define TOOL_BLOODFILTER "bloodfilter"
-#define TOOL_ROLLINGPIN "rollingpin"
\ No newline at end of file
+#define TOOL_ROLLINGPIN "rollingpin"
+#define TOOL_BONEGEL "bonegel"
+#define TOOL_FIXVEIN "fixovein"
+#define TOOL_BONECLAMP "boneclamp"
+#define TOOL_NANOPASTE "nanopaste"
+#define TOOL_FISHING "fishing rod"
+#define TOOL_WOODCUT "axe"
+
+// Divisor for use time. Higher value = better
+#define TOOL_QUALITY_NONE 0
+#define TOOL_QUALITY_WORST 0.125
+#define TOOL_QUALITY_POOR 0.25
+#define TOOL_QUALITY_MEDIOCRE 0.5
+#define TOOL_QUALITY_STANDARD 1
+#define TOOL_QUALITY_DECENT 2
+#define TOOL_QUALITY_GOOD 4
+#define TOOL_QUALITY_BEST 8
\ No newline at end of file
diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm
index 2ba27dc1d0..957eae50c5 100644
--- a/code/_helpers/global_lists.dm
+++ b/code/_helpers/global_lists.dm
@@ -148,11 +148,11 @@ var/global/list/string_slot_flags = list(
var/datum/sprite_accessory/marking/M = new path()
body_marking_styles_list[M.name] = M
- //Surgery Steps - Initialize all /datum/surgery_step into a list
- paths = typesof(/datum/surgery_step)-/datum/surgery_step
+ //Surgery Steps - Initialize all /decl/surgery_step into a list
+ paths = subtypesof(/decl/surgery_step)
for(var/T in paths)
- var/datum/surgery_step/S = new T
- surgery_steps += S
+ var/decl/surgery_step/S = new T
+ surgery_steps += S // TODO: Actually treat this like a decl
sort_surgeries()
//List of job. I can't believe this was calculated multiple times per tick!
diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm
index 7860e93b00..0857dc73d4 100644
--- a/code/_helpers/mobs.dm
+++ b/code/_helpers/mobs.dm
@@ -142,19 +142,24 @@ Proc for attack log creation, because really why not
else
return pick("chest", "groin")
-/proc/do_mob(mob/user , mob/target, time = 30, target_zone = 0, uninterruptible = FALSE, progress = TRUE, ignore_movement = FALSE)
+/proc/do_mob(mob/user , mob/target, delay = 30, target_zone = 0, uninterruptible = FALSE, progress = TRUE, ignore_movement = FALSE)
+ if(delay < 0)
+ return FALSE
if(!user || !target)
- return 0
+ return FALSE
+ if(delay == 0)
+ return TRUE
+
var/user_loc = user.loc
var/target_loc = target.loc
var/holding = user.get_active_hand()
var/datum/progressbar/progbar
if (progress)
- progbar = new(user, time, target)
+ progbar = new(user, delay, target)
- var/endtime = world.time+time
var/starttime = world.time
+ var/endtime = starttime + delay
. = TRUE
while (world.time < endtime)
stoplag(1)
@@ -190,10 +195,12 @@ Proc for attack log creation, because really why not
qdel(progbar)
/proc/do_after(mob/user, delay, atom/target = null, needhand = TRUE, progress = TRUE, incapacitation_flags = INCAPACITATION_DEFAULT, ignore_movement = FALSE, max_distance = null)
+ if(delay < 0)
+ return FALSE
if(!user)
- return 0
+ return FALSE
if(!delay)
- return 1 //Okay. Done.
+ return TRUE //Okay. Done.
var/atom/target_loc = null
if(target)
target_loc = target.loc
@@ -212,9 +219,9 @@ Proc for attack log creation, because really why not
if (progress)
progbar = new(user, delay, target)
- var/endtime = world.time + delay
var/starttime = world.time
- . = 1
+ var/endtime = starttime + delay
+ . = TRUE
while (world.time < endtime)
stoplag(1)
if(progress)
diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm
index 52b3e7762b..48a4445e19 100644
--- a/code/_helpers/unsorted.dm
+++ b/code/_helpers/unsorted.dm
@@ -1069,32 +1069,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
loc = loc.loc
return null
-/proc/get_turf_or_move(turf/location)
- return get_turf(location)
-
-
-//Quick type checks for some tools
-var/global/list/common_tools = list(
-/obj/item/stack/cable_coil,
-/obj/item/weapon/tool/wrench,
-/obj/item/weapon/weldingtool,
-/obj/item/weapon/tool/screwdriver,
-/obj/item/weapon/tool/wirecutters,
-/obj/item/device/multitool,
-/obj/item/weapon/tool/crowbar)
-
-/proc/istool(O)
- if(O && is_type_in_list(O, common_tools))
- return 1
- return 0
-
-
/proc/is_wire_tool(obj/item/I)
- if(istype(I, /obj/item/device/multitool) || I.is_wirecutter())
- return TRUE
- if(istype(I, /obj/item/device/assembly/signaler))
- return TRUE
- return
+ return I.get_tool_quality(TOOL_MULTITOOL) || \
+ I.get_tool_quality(TOOL_WIRECUTTER) || \
+ istype(I, /obj/item/device/assembly/signaler)
/proc/is_hot(obj/item/W as obj)
switch(W.type)
@@ -1126,24 +1104,6 @@ var/global/list/common_tools = list(
else
return 0
-//Whether or not the given item counts as sharp in terms of dealing damage
-/proc/is_sharp(obj/O as obj)
- if(!O)
- return FALSE
- if(O.sharp)
- return TRUE
- if(O.edge)
- return TRUE
- return FALSE
-
-//Whether or not the given item counts as cutting with an edge in terms of removing limbs
-/proc/has_edge(obj/O as obj)
- if(!O)
- return FALSE
- if(O.edge)
- return TRUE
- return FALSE
-
//Returns 1 if the given item is capable of popping things like balloons, inflatable barriers, or cutting police tape.
/proc/can_puncture(obj/item/W as obj) // For the record, WHAT THE HELL IS THIS METHOD OF DOING IT?
if(!W)
@@ -1151,7 +1111,7 @@ var/global/list/common_tools = list(
if(W.sharp)
return TRUE
return ( \
- W.is_screwdriver() || \
+ W.get_tool_quality(TOOL_SCREWDRIVER) || \
istype(W, /obj/item/weapon/pen) || \
istype(W, /obj/item/weapon/weldingtool) || \
istype(W, /obj/item/weapon/flame/lighter/zippo) || \
@@ -1160,27 +1120,17 @@ var/global/list/common_tools = list(
istype(W, /obj/item/weapon/shovel) \
)
-/proc/is_surgery_tool(obj/item/W as obj)
- return ( \
- istype(W, /obj/item/weapon/surgical/scalpel) || \
- istype(W, /obj/item/weapon/surgical/hemostat) || \
- istype(W, /obj/item/weapon/surgical/retractor) || \
- istype(W, /obj/item/weapon/surgical/cautery) || \
- istype(W, /obj/item/weapon/surgical/bonegel) || \
- istype(W, /obj/item/weapon/surgical/bonesetter)
- )
-
// check if mob is lying down on something we can operate him on.
// The RNG with table/rollerbeds comes into play in do_surgery() so that fail_step() can be used instead.
/proc/can_operate(mob/living/carbon/M, mob/living/user)
- . = M.lying
-
- if(user && M == user && user.allow_self_surgery && user.a_intent == I_HELP) // You can, technically, always operate on yourself after standing still. Inadvised, but you can.
-
- if(!M.isSynthetic())
- . = TRUE
-
- return .
+ // You can, technically, always operate on yourself after standing still. Inadvised, but you can.
+ if(istype(user) && \
+ M == user && \
+ user.allow_self_surgery && \
+ user.a_intent == I_HELP && \
+ !M.isSynthetic())
+ return TRUE
+ return M.lying
// Returns an instance of a valid surgery surface.
/mob/living/proc/get_surgery_surface(mob/living/user)
diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm
index c6cf642f8a..9ed4ad3852 100644
--- a/code/datums/components/crafting/crafting.dm
+++ b/code/datums/components/crafting/crafting.dm
@@ -85,8 +85,10 @@
if(istype(item, /obj/item/stack))
var/obj/item/stack/stack = item
.["other"][item.type] += stack.amount
- else if(item.tool_qualities)
- .["tool_qualities"] |= item.tool_qualities
+ else if(LAZYLEN(item.tool_qualities))
+ for(var/tool_quality in item.tool_qualities)
+ if(.["tool_qualities"][tool_quality] < item.tool_qualities[tool_quality])
+ .["tool_qualities"][tool_quality] = item.tool_qualities[tool_quality]
.["other"][item.type] += 1
else
if(istype(item, /obj/item/weapon/reagent_containers))
@@ -161,10 +163,10 @@
present_qualities[behavior] = TRUE
available_tools[contained_item.type] = TRUE
for(var/behavior in contained_item.tool_qualities)
- present_qualities[behavior] = TRUE
+ present_qualities[behavior] = max(present_qualities[behavior], contained_item.tool_qualities[behavior])
for(var/quality in surroundings["tool_behaviour"])
- present_qualities[quality] = TRUE
+ present_qualities[quality] = max(present_qualities[quality], surroundings[quality])
for(var/path in surroundings["other"])
available_tools[path] = TRUE
diff --git a/code/datums/components/crafting/tool_quality.dm b/code/datums/components/crafting/tool_quality.dm
deleted file mode 100644
index 119469310a..0000000000
--- a/code/datums/components/crafting/tool_quality.dm
+++ /dev/null
@@ -1,29 +0,0 @@
-/obj/item
- var/list/tool_qualities
-
-/// Used to check for a specific tool quality on an item.
-/// Returns TRUE or FALSE depending on whether `tool_quality` is found.
-/obj/item/proc/has_tool_quality(tool_quality)
- return !!LAZYFIND(tool_qualities, tool_quality)
-
-/* Legacy Support */
-
-/// DEPRECATED PROC: DO NOT USE IN NEW CODE
-/obj/item/proc/is_screwdriver()
- return has_tool_quality(TOOL_SCREWDRIVER)
-
-/// DEPRECATED PROC: DO NOT USE IN NEW CODE
-/obj/item/proc/is_wrench()
- return has_tool_quality(TOOL_WRENCH)
-
-/// DEPRECATED PROC: DO NOT USE IN NEW CODE
-/obj/item/proc/is_crowbar()
- return has_tool_quality(TOOL_CROWBAR)
-
-/// DEPRECATED PROC: DO NOT USE IN NEW CODE
-/obj/item/proc/is_wirecutter()
- return has_tool_quality(TOOL_WIRECUTTER)
-
-/// DEPRECATED PROC: DO NOT USE IN NEW CODE
-/obj/item/proc/is_multitool()
- return has_tool_quality(TOOL_MULTITOOL)
diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm
index e2d3dbdfd4..a0162e8bea 100644
--- a/code/datums/helper_datums/construction_datum.dm
+++ b/code/datums/helper_datums/construction_datum.dm
@@ -34,31 +34,17 @@
if(valid_step)
if(custom_action(valid_step, I, user))
next_step()
- return 1
- return 0
+ return TRUE
+ return FALSE
/datum/construction/proc/is_right_key(var/obj/item/I) // returns current step num if I is of the right type.
var/list/L = steps[steps.len]
- switch(L["key"])
- if(IS_SCREWDRIVER)
- if(I.is_screwdriver())
- return steps.len
- if(IS_CROWBAR)
- if(I.is_crowbar())
- return steps.len
- if(IS_WIRECUTTER)
- if(I.is_wirecutter())
- return steps.len
- if(IS_WRENCH)
- if(I.is_wrench())
- return steps.len
-
- if(istype(I, L["key"]))
+ if(istype(I, L["key"]) || I.get_tool_quality(L["key"]))
return steps.len
return 0
/datum/construction/proc/custom_action(step, I, user)
- return 1
+ return TRUE
/datum/construction/proc/check_all_steps(var/obj/item/I,mob/user as mob) //check all steps, remove matching one.
for(var/i=1;i<=steps.len;i++)
@@ -69,8 +55,8 @@
listclearnulls(steps);
if(!steps.len)
spawn_result()
- return 1
- return 0
+ return TRUE
+ return FALSE
/datum/construction/proc/spawn_result()
@@ -105,34 +91,11 @@
/datum/construction/reversible/is_right_key(var/obj/item/I) // returns index step
var/list/L = steps[index]
+ if(I.get_tool_quality(L["key"]))
+ return FORWARD
- switch(L["key"])
- if(IS_SCREWDRIVER)
- if(I.is_screwdriver())
- return FORWARD
- if(IS_CROWBAR)
- if(I.is_crowbar())
- return FORWARD
- if(IS_WIRECUTTER)
- if(I.is_wirecutter())
- return FORWARD
- if(IS_WRENCH)
- if(I.is_wrench())
- return FORWARD
-
- switch(L["backkey"])
- if(IS_SCREWDRIVER)
- if(I.is_screwdriver())
- return BACKWARD
- if(IS_CROWBAR)
- if(I.is_crowbar())
- return BACKWARD
- if(IS_WIRECUTTER)
- if(I.is_wirecutter())
- return BACKWARD
- if(IS_WRENCH)
- if(I.is_wrench())
- return BACKWARD
+ if(I.get_tool_quality(L["backkey"]))
+ return BACKWARD
if(istype(I, L["key"]))
return FORWARD //to the first step -> forward
@@ -145,8 +108,8 @@
if(diff)
if(custom_action(index, diff, I, user))
update_index(diff)
- return 1
- return 0
+ return TRUE
+ return FALSE
/datum/construction/reversible/custom_action(index, diff, I, user)
- return 1
\ No newline at end of file
+ return TRUE
\ No newline at end of file
diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm
index 83ebb65fa8..01d368bc2e 100644
--- a/code/datums/wires/wires.dm
+++ b/code/datums/wires/wires.dm
@@ -167,8 +167,8 @@
switch(action)
// Toggles the cut/mend status.
if("cut")
- // if(!I.is_wirecutter() && !user.can_admin_interact())
- if(!istype(I) || !I.is_wirecutter())
+ // if(!I.get_tool_quality(TOOL_WIRECUTTER) && !user.can_admin_interact())
+ if(!istype(I) || !I.get_tool_quality(TOOL_WIRECUTTER))
to_chat(user, "You need wirecutters!")
return
@@ -178,8 +178,8 @@
// Pulse a wire.
if("pulse")
- // if(!I.is_multitool() && !user.can_admin_interact())
- if(!istype(I) || !I.is_multitool())
+ // if(!I.get_tool_quality(TOOL_MULTITOOL) && !user.can_admin_interact())
+ if(!istype(I) || !I.get_tool_quality(TOOL_MULTITOOL))
to_chat(user, "You need a multitool!")
return
diff --git a/code/game/gamemodes/changeling/powers/armblade.dm b/code/game/gamemodes/changeling/powers/armblade.dm
index 0652280ce7..98460d3c9e 100644
--- a/code/game/gamemodes/changeling/powers/armblade.dm
+++ b/code/game/gamemodes/changeling/powers/armblade.dm
@@ -135,7 +135,7 @@
armor_penetration = 15
sharp = 1
edge = 1
- pry = 1
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_STANDARD)
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
defend_chance = 60
projectile_parry_chance = 25
@@ -162,6 +162,6 @@
name = "hand greatclaw"
force = 20
armor_penetration = 20
- pry = 1
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_STANDARD)
defend_chance = 60
projectile_parry_chance = 25
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
index ed99b6e72c..699e847208 100644
--- a/code/game/machinery/CableLayer.dm
+++ b/code/game/machinery/CableLayer.dm
@@ -35,7 +35,7 @@
to_chat(user, "You load [result] lengths of cable into [src].")
return
- if(O.is_wirecutter())
+ if(O.get_tool_quality(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)
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 585a62a5fa..65db62df13 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -239,7 +239,7 @@ update_flag
..()
/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(!W.is_wrench() && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
+ if(!W.get_tool_quality(TOOL_WRENCH) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
visible_message("\The [user] hits \the [src] with \a [W]!")
src.health -= W.force
src.add_fingerprint(user)
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index 2e706defcf..cb8e2f4ef8 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -103,10 +103,10 @@
return ..()
/obj/machinery/meter/attackby(var/obj/item/W, var/mob/user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to unfasten \the [src]...")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index e334a3f3c2..1fab99d760 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -109,7 +109,7 @@
update_icon()
return
- else if (W.is_wrench())
+ else if (W.get_tool_quality(TOOL_WRENCH))
if(connected_port)
disconnect()
to_chat(user, "You disconnect \the [src] from the port.")
@@ -165,7 +165,7 @@
power_change()
return
- if(I.is_screwdriver() && removeable_cell)
+ if(I.get_tool_quality(TOOL_SCREWDRIVER) && removeable_cell)
if(!cell)
to_chat(user, "There is no power cell installed.")
return
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index f6cadfbff1..a7010ec3d9 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -216,7 +216,7 @@
update_connected_network()
/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
if(on)
to_chat(user, "Turn \the [src] off first!")
return
@@ -230,7 +230,7 @@
//doesn't use power cells
if(istype(I, /obj/item/weapon/cell))
return
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
return
//doesn't hold tanks
@@ -248,7 +248,7 @@
desc += "This one seems to be tightly secured with large bolts."
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
to_chat(user, "The bolts are too tight for you to unscrew!")
return
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index 90d5409143..3598c657e6 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -156,7 +156,7 @@
if(panel_open)
//Don't eat multitools or wirecutters used on an open lathe.
- if(O.is_multitool() || O.is_wirecutter())
+ if(O.get_tool_quality(TOOL_MULTITOOL) || O.get_tool_quality(TOOL_WIRECUTTER))
wires.Interact(user)
return
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 3230424b45..75632751db 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -154,7 +154,7 @@
/obj/machinery/camera/attackby(obj/item/W as obj, mob/living/user as mob)
update_coverage()
// DECONSTRUCTION
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
//to_chat(user, "You start to [panel_open ? "close" : "open"] the camera's panel.")
//if(toggle_panel(user)) // No delay because no one likes screwdrivers trying to be hip and have a duration cooldown
panel_open = !panel_open
@@ -162,7 +162,7 @@
"You screw the camera's panel [panel_open ? "open" : "closed"].")
playsound(src, W.usesound, 50, 1)
- else if((W.is_wirecutter() || istype(W, /obj/item/device/multitool)) && panel_open)
+ else if((W.get_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/multitool)) && panel_open)
interact(user)
else if(istype(W, /obj/item/weapon/weldingtool) && (wires.CanDeconstruct() || (stat & BROKEN)))
@@ -367,24 +367,20 @@
return null
/obj/machinery/camera/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user)
-
- if(busy)
- return 0
- if(!WT.isOn())
- return 0
+ if(busy || !WT.isOn())
+ return FALSE
// Do after stuff here
- to_chat(user, "You start to weld [src]..")
+ to_chat(user, "You start to weld [src]...")
playsound(src, WT.usesound, 50, 1)
WT.eyecheck(user)
- busy = 1
- if(do_after(user, 100 * WT.toolspeed))
- busy = 0
- if(!WT.isOn())
- return 0
- return 1
- busy = 0
- return 0
+ busy = TRUE
+ if(do_after(user, 100 * WT.get_tool_speed(TOOL_WELDER)))
+ busy = FALSE
+ if(WT.isOn())
+ return TRUE
+ busy = FALSE
+ return FALSE
/obj/machinery/camera/interact(mob/living/user as mob)
if(!panel_open || istype(user, /mob/living/silicon/ai))
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index b56fa786be..e3c4d92d9f 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -29,7 +29,7 @@
if(0)
// State 0
- if(W.is_wrench() && isturf(src.loc))
+ if(W.get_tool_quality(TOOL_WRENCH) && isturf(src.loc))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You wrench the assembly into place.")
anchored = 1
@@ -47,7 +47,7 @@
state = 2
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You unattach the assembly from its place.")
anchored = 0
@@ -77,7 +77,7 @@
if(3)
// State 3
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
@@ -115,7 +115,7 @@
break
return
- else if(W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_WIRECUTTER))
new/obj/item/stack/cable_coil(get_turf(src), 2)
playsound(src, W.usesound, 50, 1)
@@ -132,7 +132,7 @@
return
// Taking out upgrades
- else if(W.is_crowbar() && upgrades.len)
+ else if(W.get_tool_quality(TOOL_CROWBAR) && upgrades.len)
var/obj/U = locate(/obj) in upgrades
if(U)
to_chat(user, "You unattach an upgrade from the assembly.")
@@ -154,20 +154,17 @@
..()
/obj/item/weapon/camera_assembly/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user)
+ if(busy || !WT.isOn())
+ return FALSE
- if(busy)
- return 0
- if(!WT.isOn())
- return 0
-
- to_chat(user, "You start to weld the [src]..")
+ // Do after stuff here
+ to_chat(user, "You start to weld [src]...")
playsound(src, WT.usesound, 50, 1)
WT.eyecheck(user)
- busy = 1
- if(do_after(user, 20 * WT.toolspeed))
- busy = 0
- if(!WT.isOn())
- return 0
- return 1
- busy = 0
- return 0
+ busy = TRUE
+ if(do_after(user, 100 * WT.get_tool_speed(TOOL_WELDER)))
+ busy = FALSE
+ if(WT.isOn())
+ return TRUE
+ busy = FALSE
+ return FALSE
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 2b768fb3e6..557ee73b3f 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -66,7 +66,7 @@
user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].")
chargelevel = -1
update_icon()
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(charging)
to_chat(user, "Remove [charging] first!")
return
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index a41ccad3a0..025e55b3dd 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -250,7 +250,7 @@
user.drop_item()
W.forceMove(src)
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(locked && (anchored || occupant))
to_chat(user, "Can not do that while [src] is in use.")
else
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index dd94e6c8a9..9ca2d2236d 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -273,17 +273,17 @@
if(LAZYLEN(good_surgeries))
return good_surgeries
var/static/list/banned_surgery_steps = list(
- /datum/surgery_step,
- /datum/surgery_step/generic,
- /datum/surgery_step/open_encased,
- /datum/surgery_step/repairflesh,
- /datum/surgery_step/face,
- /datum/surgery_step/cavity,
- /datum/surgery_step/limb,
- /datum/surgery_step/brainstem,
+ /decl/surgery_step,
+ /decl/surgery_step/generic,
+ /decl/surgery_step/open_encased,
+ /decl/surgery_step/repairflesh,
+ /decl/surgery_step/face,
+ /decl/surgery_step/cavity,
+ /decl/surgery_step/limb,
+ /decl/surgery_step/brainstem,
)
good_surgeries = surgery_steps
- for(var/datum/surgery_step/S in good_surgeries)
+ for(var/decl/surgery_step/S in good_surgeries)
if(S.type in banned_surgery_steps)
good_surgeries -= S
if(!LAZYLEN(S.allowed_tools))
@@ -297,7 +297,7 @@
*/
/obj/machinery/computer/operating/proc/find_next_steps(mob/user, zone)
. = list()
- for(var/datum/surgery_step/S in get_surgery_steps_without_basetypes())
+ for(var/decl/surgery_step/S in get_surgery_steps_without_basetypes())
if(S.can_use(user, victim, zone, null) && S.is_valid_target(victim))
var/allowed_tools_by_name = list()
for(var/tool in S.allowed_tools)
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index 397366c6c2..ba6080de59 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -14,27 +14,27 @@
switch(state)
if(0)
- if(P.is_wrench())
+ if(P.get_tool_quality(TOOL_WRENCH))
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You wrench the frame into place.")
anchored = 1
state = 1
- if(istype(P, /obj/item/weapon/weldingtool))
+ if(P.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = P
if(!WT.isOn())
to_chat(user, "The welder must be on for this task.")
return
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 20 * WT.toolspeed))
+ if(do_after(user, 20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.remove_fuel(0, user)) return
to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/plasteel( loc, 4)
qdel(src)
if(1)
- if(P.is_wrench())
+ if(P.get_tool_quality(TOOL_WRENCH))
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You unfasten the frame.")
anchored = 0
state = 0
@@ -45,12 +45,12 @@
circuit = P
user.drop_item()
P.loc = src
- if(P.is_screwdriver() && circuit)
+ if(P.get_tool_quality(TOOL_SCREWDRIVER) && circuit)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You screw the circuit board into place.")
state = 2
icon_state = "2"
- if(P.is_crowbar() && circuit)
+ if(P.get_tool_quality(TOOL_CROWBAR) && circuit)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the circuit board.")
state = 1
@@ -58,7 +58,7 @@
circuit.loc = loc
circuit = null
if(2)
- if(P.is_screwdriver() && circuit)
+ if(P.get_tool_quality(TOOL_SCREWDRIVER) && circuit)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You unfasten the circuit board.")
state = 1
@@ -77,7 +77,7 @@
to_chat(user, "You add cables to the frame.")
return
if(3)
- if(P.is_wirecutter())
+ if(P.get_tool_quality(TOOL_WIRECUTTER))
if (brain)
to_chat(user, "Get that brain out of there first")
else
@@ -145,7 +145,7 @@
to_chat(usr, "Added [P].")
icon_state = "3b"
- if(P.is_crowbar() && brain)
+ if(P.get_tool_quality(TOOL_CROWBAR) && brain)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the brain.")
brain.loc = loc
@@ -153,7 +153,7 @@
icon_state = "3"
if(4)
- if(P.is_crowbar())
+ if(P.get_tool_quality(TOOL_CROWBAR))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the glass panel.")
state = 3
@@ -164,7 +164,7 @@
new /obj/item/stack/material/glass/reinforced( loc, 2 )
return
- if(P.is_screwdriver())
+ if(P.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You connect the monitor.")
if(!brain)
@@ -232,11 +232,11 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva
else
to_chat(user, "ERROR: Unable to locate artificial intelligence.")
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(anchored)
user.visible_message("\The [user] starts to unbolt \the [src] from the plating...")
playsound(src, W.usesound, 50, 1)
- if(!do_after(user,40 * W.toolspeed))
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message("\The [user] decides not to unbolt \the [src].")
return
user.visible_message("\The [user] finishes unfastening \the [src]!")
@@ -245,7 +245,7 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva
else
user.visible_message("\The [user] starts to bolt \the [src] to the plating...")
playsound(src, W.usesound, 50, 1)
- if(!do_after(user,40 * W.toolspeed))
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message("\The [user] decides not to bolt \the [src].")
return
user.visible_message("\The [user] finishes fastening down \the [src]!")
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 3ec9e2c841..935dac23be 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -15,7 +15,7 @@
var/restoring = FALSE
/obj/machinery/computer/aifixer/attackby(obj/item/I, mob/living/user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(occupier)
if(stat & (NOPOWER|BROKEN))
to_chat(user, "The screws on [name]'s screen won't budge.")
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 054c9c2cc3..ef0fb687bf 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -13,27 +13,27 @@
/obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob)
switch(state)
if(0)
- if(P.is_wrench())
+ if(P.get_tool_quality(TOOL_WRENCH))
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You wrench the frame into place.")
src.anchored = 1
src.state = 1
- if(istype(P, /obj/item/weapon/weldingtool))
+ if(get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = P
if(!WT.remove_fuel(0, user))
to_chat(user, "The welding tool must be on to complete this task.")
return
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 20 * WT.toolspeed))
+ if(do_after(user, 20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src)
if(1)
- if(P.is_wrench())
+ if(P.get_tool_quality(TOOL_WRENCH))
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You unfasten the frame.")
src.anchored = 0
src.state = 0
@@ -48,12 +48,12 @@
P.loc = src
else
to_chat(user, "This frame does not accept circuit boards of this type!")
- if(P.is_screwdriver() && circuit)
+ if(P.get_tool_quality(TOOL_SCREWDRIVER) && circuit)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You screw the circuit board into place.")
src.state = 2
src.icon_state = "2"
- if(P.is_crowbar()) && circuit)
+ if(P.get_tool_quality(TOOL_CROWBAR)) && circuit)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the circuit board.")
src.state = 1
@@ -61,7 +61,7 @@
circuit.loc = src.loc
src.circuit = null
if(2)
- if(P.is_screwdriver() && circuit)
+ if(P.get_tool_quality(TOOL_SCREWDRIVER) && circuit)
playsound(src, P.usesound, 50, 1)
to_chat(user, "You unfasten the circuit board.")
src.state = 1
@@ -79,7 +79,7 @@
state = 3
icon_state = "3"
if(3)
- if(P.is_wirecutter())
+ if(P.get_tool_quality(TOOL_WIRECUTTER))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the cables.")
src.state = 2
@@ -100,13 +100,13 @@
src.state = 4
src.icon_state = "4"
if(4)
- if(P.is_crowbar())
+ if(P.get_tool_quality(TOOL_CROWBAR))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the glass panel.")
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
- if(P.is_screwdriver())
+ if(P.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You connect the monitor.")
var/B = new src.circuit.build_path ( src.loc )
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index e5074c06f0..7db94fafcf 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -34,7 +34,7 @@
return
if(!istype(user))
return
- if(O.is_screwdriver() && emag)
+ if(O.get_tool_quality(TOOL_SCREWDRIVER) && emag)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
to_chat(user, "It is too hot to mess with!")
return
diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm
index 5eae5e82d0..670a55a9d1 100644
--- a/code/game/machinery/computer/pod.dm
+++ b/code/game/machinery/computer/pod.dm
@@ -50,7 +50,7 @@
/*
/obj/machinery/computer/pod/attackby(I as obj, user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
if(do_after(user, 20))
if(stat & BROKEN)
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 3717da58c5..11174a9652 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -41,7 +41,7 @@
state = 2
icon_state = "box_1"
else
- if(P.is_wrench())
+ if(P.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 75, 1)
to_chat(user, "You dismantle the frame")
new /obj/item/stack/material/steel(src.loc, 5)
@@ -71,7 +71,7 @@
else
to_chat(user, "This frame does not accept circuit boards of this type!")
else
- if(P.is_wirecutter())
+ if(P.get_tool_quality(TOOL_WIRECUTTER))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You remove the cables.")
state = 1
@@ -80,7 +80,7 @@
A.amount = 5
if(3)
- if(P.is_crowbar())
+ if(P.get_tool_quality(TOOL_CROWBAR))
playsound(src, P.usesound, 50, 1)
state = 2
circuit.loc = src.loc
@@ -96,7 +96,7 @@
components = null
icon_state = "box_1"
else
- if(P.is_screwdriver())
+ if(P.get_tool_quality(TOOL_SCREWDRIVER))
var/component_check = 1
for(var/R in req_components)
if(req_components[R] > 0)
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index a50da1d9b4..28e2fae729 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -47,7 +47,7 @@ Deployable items
visible_message("BZZzZZzZZzZT")
return
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(health < maxhealth)
health = maxhealth
emagged = 0
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 936da63af4..8bce7872f7 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1059,7 +1059,7 @@ About the new airlock wires panel:
return
else
return
- else if(C.is_screwdriver())
+ else if(C.get_tool_quality(TOOL_SCREWDRIVER))
if (src.p_open)
if (stat & BROKEN)
to_chat(usr, "The panel is broken and cannot be closed.")
@@ -1070,7 +1070,7 @@ About the new airlock wires panel:
src.p_open = 1
playsound(src, C.usesound, 50, 1)
src.update_icon()
- else if(C.is_wirecutter())
+ else if(C.get_tool_quality(TOOL_WIRECUTTER))
return src.attack_hand(user)
else if(istype(C, /obj/item/device/multitool))
return src.attack_hand(user)
@@ -1079,11 +1079,11 @@ About the new airlock wires panel:
else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
- else if(!repairing && C.is_crowbar())
+ else if(!repairing && C.get_tool_quality(TOOL_CROWBAR))
if(can_remove_electronics())
playsound(src, C.usesound, 75, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
- if(do_after(user,40 * C.toolspeed))
+ if(do_after(user,40 * C.get_tool_speed(TOOL_CROWBAR)))
to_chat(user, "You removed the airlock electronics!")
var/obj/structure/door_assembly/da = new assembly_type(src.loc)
@@ -1124,7 +1124,7 @@ About the new airlock wires panel:
// Check if we're using a crowbar or armblade, and if the airlock's unpowered for whatever reason (off, broken, etc).
else if(istype(C, /obj/item/weapon))
var/obj/item/weapon/W = C
- if((W.pry == 1) && !arePowerSystemsOn())
+ if(W.get_tool_quality(TOOL_CROWBAR) && !arePowerSystemsOn())
if(locked)
to_chat(user, "The airlock's bolts prevent it from being forced.")
else if( !welded && !operating )
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index 6bd7a82291..c549779478 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -154,7 +154,7 @@
/obj/machinery/door/blast/attackby(obj/item/weapon/C as obj, mob/user as mob)
src.add_fingerprint(user)
if(istype(C, /obj/item/weapon)) // For reasons unknown, sometimes C is actually not what it is advertised as, like a mob.
- if(C.pry == 1 && (user.a_intent != I_HURT || (stat & BROKEN))) // Can we pry it open with something, like a crowbar/fireaxe/lingblade?
+ if(C.get_tool_quality(TOOL_CROWBAR) && (user.a_intent != I_HURT || (stat & BROKEN))) // Can we pry it open with something, like a crowbar/fireaxe/lingblade?
if(istype(C,/obj/item/weapon/material/twohanded/fireaxe)) // Fireaxes need to be in both hands to pry.
var/obj/item/weapon/material/twohanded/fireaxe/F = C
if(!F.wielded)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 5eccfd11f1..36fff7aa30 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -246,7 +246,7 @@
return
- if(repairing && istype(I, /obj/item/weapon/weldingtool))
+ if(repairing && I.get_tool_quality(TOOL_WELDER))
if(!density)
to_chat(user, "\The [src] must be closed before you can repair it.")
return
@@ -255,14 +255,14 @@
if(welder.remove_fuel(0,user))
to_chat(user, "You start to fix dents and weld \the [get_material_name()] into place.")
playsound(src, welder.usesound, 50, 1)
- if(do_after(user, (5 * repairing) * welder.toolspeed) && welder && welder.isOn())
+ if(do_after(user, (5 * repairing) * welder.get_tool_speed(TOOL_WELDER)) && welder && welder.isOn())
to_chat(user, "You finish repairing the damage to \the [src].")
health = between(health, health + repairing*DOOR_REPAIR_AMOUNT, maxhealth)
update_icon()
repairing = 0
return
- if(repairing && I.is_crowbar())
+ if(repairing && I.get_tool_quality(TOOL_CROWBAR))
var/datum/material/mat = get_material()
var/obj/item/stack/material/repairing_sheet = mat.place_sheet(loc)
repairing_sheet.amount += repairing-1
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index c23e6f4ffa..854dfbc5b8 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -249,7 +249,7 @@
return //Don't open the door if we're putting tape on it to tell people 'don't open the door'.
if(operating)
return//Already doing something.
- if(istype(C, /obj/item/weapon/weldingtool) && !repairing)
+ if(!repairing && C.get_tool_quality(TOOL_WELDER))
if(prying)
to_chat(user, "Someone's busy prying that [density ? "open" : "closed"]!")
var/obj/item/weapon/weldingtool/W = C
@@ -262,7 +262,7 @@
update_icon()
return
- if(density && C.is_screwdriver())
+ if(density && C.get_tool_quality(TOOL_SCREWDRIVER))
hatch_open = !hatch_open
playsound(src, C.usesound, 50, 1)
user.visible_message("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance hatch.",
@@ -270,7 +270,7 @@
update_icon()
return
- if(blocked && C.is_crowbar() && !repairing)
+ if(blocked && C.get_tool_quality(TOOL_CROWBAR) && !repairing)
if(!hatch_open)
to_chat(user, "You must open the maintenance hatch first!")
else
@@ -300,21 +300,16 @@
to_chat(user, "\The [src] is welded shut!")
return
- if(C.pry == 1)
+ if(C.get_tool_quality(TOOL_CROWBAR))
if(operating)
return
- if(blocked && C.is_crowbar())
+ if(blocked)
user.visible_message("\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return
- if(istype(C,/obj/item/weapon/material/twohanded/fireaxe))
- var/obj/item/weapon/material/twohanded/fireaxe/F = C
- if(!F.wielded)
- return
-
if(prying)
to_chat(user, "Someone's already prying that [density ? "open" : "closed"].")
return
@@ -325,8 +320,8 @@
prying = 1
update_icon()
playsound(src, C.usesound, 100, 1)
- if(do_after(user,30 * C.toolspeed))
- if(C.is_crowbar())
+ if(do_after(user,30 * C.get_tool_speed(TOOL_CROWBAR)))
+ if(C.get_tool_quality(TOOL_CROWBAR))
if(stat & (BROKEN|NOPOWER) || !density)
user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [src] [density ? "open" : "closed"] with \the [C]!",\
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index ab1de73c60..9e04e4d2ca 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -31,7 +31,7 @@
wired = 1
to_chat(user, "You wire \the [src].")
- else if(C.is_wirecutter() && wired )
+ else if(C.get_tool_quality(TOOL_WIRECUTTER) && wired )
playsound(src, C.usesound, 100, 1)
user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].")
@@ -54,20 +54,20 @@
qdel(src)
else
to_chat(user, "You must secure \the [src] first!")
- else if(C.is_wrench())
+ else if(C.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, C.usesound, 50, 1)
user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!",
"You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon()
- else if((glass || !anchored) && istype(C, /obj/item/weapon/weldingtool))
+ else if((glass || !anchored) && C.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
playsound(src, WT.usesound, 50, 1)
if(glass)
user.visible_message("[user] welds the glass panel out of \the [src].",
"You start to weld the glass panel out of \the [src].")
- if(do_after(user, 40 * WT.toolspeed, src) && WT.isOn())
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER), src) && WT.isOn())
to_chat(user, "You welded the glass panel out!")
new /obj/item/stack/material/glass/reinforced(drop_location())
glass = FALSE
@@ -75,7 +75,7 @@
return
if(!anchored)
user.visible_message("[user] dissassembles \the [src].", "You start to dissassemble \the [src].")
- if(do_after(user, 40 * WT.toolspeed, src) && WT.isOn())
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER), src) && WT.isOn())
user.visible_message("[user] has dissassembled \the [src].",
"You have dissassembled \the [src].")
new /obj/item/stack/material/steel(drop_location(), 2)
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 11c29e9ad1..386fc977a8 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -190,13 +190,13 @@
if(istype(I))
// Fixing.
- if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP)
+ if(I.get_tool_quality(TOOL_WELDER) && user.a_intent == I_HELP)
var/obj/item/weapon/weldingtool/WT = I
if(health < maxhealth)
if(WT.remove_fuel(1 ,user))
to_chat(user, "You begin repairing [src]...")
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 40 * WT.toolspeed, target = src))
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER), target = src))
health = maxhealth
update_icon()
to_chat(user, "You repair [src].")
@@ -216,10 +216,10 @@
return 1
//If it's opened/emagged, crowbar can pry it out of its frame.
- if (!density && I.is_crowbar())
+ if (!density && I.get_tool_quality(TOOL_CROWBAR))
playsound(src, I.usesound, 50, 1)
user.visible_message("[user] begins prying the windoor out of the frame.", "You start to pry the windoor out of the frame.")
- if (do_after(user,40 * I.toolspeed))
+ if (do_after(user,40 * I.get_tool_speed(TOOL_CROWBAR)))
to_chat(user,"You pried the windoor out of the frame!")
var/obj/structure/windoor_assembly/wa = new/obj/structure/windoor_assembly(src.loc)
diff --git a/code/game/machinery/exonet_node.dm b/code/game/machinery/exonet_node.dm
index 3c8d458922..a9af4fe834 100644
--- a/code/game/machinery/exonet_node.dm
+++ b/code/game/machinery/exonet_node.dm
@@ -76,9 +76,9 @@
// Parameters: 2 (I - the item being whacked against the machine, user - the person doing the whacking)
// Description: Handles deconstruction.
/obj/machinery/exonet_node/attackby(obj/item/I, mob/user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
default_deconstruction_screwdriver(user, I)
- else if(I.is_crowbar())
+ else if(I.get_tool_quality(TOOL_CROWBAR))
default_deconstruction_crowbar(user, I)
else
..()
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 9576650dab..7a89310974 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -35,7 +35,7 @@
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
add_fingerprint(user)
disable = !disable
if(disable)
@@ -102,7 +102,7 @@
flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
add_fingerprint(user)
anchored = !anchored
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 10ad623bf9..9e9542097e 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -96,7 +96,7 @@
update_icon()
/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(!open)
if(unlocked)
unlocked = 0
@@ -105,7 +105,7 @@
unlocked = 1
to_chat(user, "You unscrew the battery panel.")
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if(unlocked)
if(open)
open = 0
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index 09296ac302..b64045e217 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -23,16 +23,16 @@ var/list/floor_light_cache = list()
anchored = 1
/obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
anchored = !anchored
visible_message("\The [user] has [anchored ? "attached" : "detached"] \the [src].")
- else if(istype(W, /obj/item/weapon/weldingtool) && (damaged || (stat & BROKEN)))
+ else if(W.get_tool_quality(TOOL_WELDER) && (damaged || (stat & BROKEN)))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
to_chat(user, "\The [src] must be on to complete this task.")
return
playsound(src, WT.usesound, 50, 1)
- if(!do_after(user, 20 * WT.toolspeed))
+ if(!do_after(user, 20 * WT.get_tool_speed(TOOL_WELDER)))
return
if(!src || !WT.isOn())
return
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index 5dcfe90d6e..9affbf24a5 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -34,7 +34,7 @@
return
/obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
var/m = input("Choose work mode", "Mode") as null|anything in mode
mode[m] = !mode[m]
var/O = mode[m]
@@ -47,7 +47,7 @@
TakeTile(T)
return
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if(!length(contents))
to_chat(user, "\The [src] is empty.")
else
@@ -58,7 +58,7 @@
T = null
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
T = input("Choose tile type.", "Tiles") as null|anything in contents
return
..()
diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm
index 867d9858c6..1a6d1e9bd8 100644
--- a/code/game/machinery/frame.dm
+++ b/code/game/machinery/frame.dm
@@ -132,6 +132,16 @@
frame_class = FRAME_CLASS_MACHINE
frame_size = 4
+/datum/frame/frame_types/teleporter_hub
+ name = "Teleporter Hub"
+ frame_class = FRAME_CLASS_MACHINE
+ frame_size = 4
+
+/datum/frame/frame_types/teleporter_station
+ name = "Teleporter Hub"
+ frame_class = FRAME_CLASS_MACHINE
+ frame_size = 4
+
/datum/frame/frame_types/display
name = "Display"
frame_class = FRAME_CLASS_DISPLAY
@@ -304,11 +314,11 @@
update_icon()
/obj/structure/frame/attackby(obj/item/P as obj, mob/user as mob)
- if(P.is_wrench())
+ if(P.get_tool_quality(TOOL_WRENCH))
if(state == FRAME_PLACED && !anchored)
to_chat(user, "You start to wrench the frame into place.")
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WRENCH)))
anchored = TRUE
if(!need_circuit && circuit)
state = FRAME_FASTENED
@@ -320,16 +330,16 @@
else if(state == FRAME_PLACED && anchored)
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You unfasten the frame.")
anchored = FALSE
- else if(istype(P, /obj/item/weapon/weldingtool))
+ else if(P.get_tool_quality(TOOL_WELDER))
if(state == FRAME_PLACED)
var/obj/item/weapon/weldingtool/WT = P
if(WT.remove_fuel(0, user))
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 20 * P.toolspeed))
+ if(do_after(user, 20 * P.get_tool_speed(TOOL_WELDER)))
if(src && WT.isOn())
to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/steel(src.loc, frame_type.frame_size)
@@ -357,7 +367,7 @@
to_chat(user, "This frame does not accept circuit boards of this type!")
return
- else if(P.is_screwdriver())
+ else if(P.get_tool_quality(TOOL_SCREWDRIVER))
if(state == FRAME_UNFASTENED)
if(need_circuit && circuit)
playsound(src, P.usesound, 50, 1)
@@ -452,7 +462,7 @@
qdel(src)
return
- else if(P.is_crowbar())
+ else if(P.get_tool_quality(TOOL_CROWBAR))
if(state == FRAME_UNFASTENED)
if(need_circuit && circuit)
playsound(src, P.usesound, 50, 1)
@@ -530,7 +540,7 @@
break
to_chat(user, desc)
- else if(P.is_wirecutter())
+ else if(P.get_tool_quality(TOOL_WIRECUTTER))
if(state == FRAME_WIRED)
if( \
frame_type.frame_class == FRAME_CLASS_COMPUTER || \
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index cfd1a3c935..429417e033 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -69,7 +69,7 @@
// sd_SetLuminosity(0)
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
add_fingerprint(user)
disable = !disable
playsound(src, W.usesound, 50, 1)
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 0f57b816d0..6a8136e1d7 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -66,7 +66,7 @@
update_icon()
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You start to dismantle the IV drip.")
if(do_after(user, 15))
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 99b69ccb63..506a73a4e4 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -78,11 +78,11 @@
return
if(default_deconstruction_crowbar(user, W))
return
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
return wires.Interact(user)
if(istype(W, /obj/item/device/multitool))
return wires.Interact(user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(playing)
StopPlaying()
user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].")
@@ -222,7 +222,7 @@
return
if(default_deconstruction_crowbar(user, W))
return
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(playing)
StopPlaying()
user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].")
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 903a27314b..38ecc6d581 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -166,7 +166,7 @@ Class Procs:
pulse2.icon = 'icons/effects/effects.dmi'
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
- pulse2.anchored = 1
+ pulse2.anchored = TRUE
pulse2.set_dir(pick(cardinal))
spawn(10)
@@ -177,16 +177,12 @@ Class Procs:
switch(severity)
if(1.0)
qdel(src)
- return
if(2.0)
if(prob(50))
qdel(src)
- return
if(3.0)
if(prob(25))
qdel(src)
- return
- else
return
/obj/machinery/vv_edit_var(var/var_name, var/new_value)
@@ -234,22 +230,21 @@ Class Procs:
return attack_hand(user)
/obj/machinery/attack_hand(mob/user as mob)
-
if(inoperable(MAINT))
- return 1
+ return TRUE
if(user.lying || user.stat)
- return 1
+ return TRUE
if(!(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon)))
to_chat(user, "You don't have the dexterity to do this!")
- return 1
+ return TRUE
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= 55)
visible_message("[H] stares cluelessly at [src].")
- return 1
+ return TRUE
else if(prob(H.getBrainLoss()))
to_chat(user, "You momentarily forget how to use [src].")
- return 1
+ return TRUE
if(clicksound && istype(user, /mob/living/carbon))
playsound(src, clicksound, clickvol)
@@ -278,9 +273,9 @@ Class Procs:
/obj/machinery/proc/shock(mob/user, prb)
if(inoperable())
- return 0
+ return FALSE
if(!prob(prb))
- return 0
+ return FALSE
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
s.start()
@@ -292,8 +287,8 @@ Class Procs:
if(temp_apc && temp_apc.terminal && temp_apc.terminal.powernet)
temp_apc.terminal.powernet.trigger_warning()
if(user.stunned)
- return 1
- return 0
+ return TRUE
+ return TRUE
/obj/machinery/proc/default_apply_parts()
var/obj/item/weapon/circuitboard/CB = circuit
@@ -313,9 +308,9 @@ Class Procs:
/obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/weapon/storage/part_replacer/R)
if(!istype(R))
- return 0
+ return FALSE
if(!component_parts)
- return 0
+ return FALSE
to_chat(user, "Following parts detected in [src]:")
for(var/obj/item/C in component_parts)
to_chat(user, " [C.name]")
@@ -339,20 +334,22 @@ Class Procs:
break
update_icon()
RefreshParts()
- return 1
+ return TRUE
// Default behavior for wrenching down machines. Supports both delay and instant modes.
/obj/machinery/proc/default_unfasten_wrench(var/mob/user, var/obj/item/W, var/time = 0)
- if(!W.is_wrench())
+ if(!W.get_tool_quality(TOOL_WRENCH))
return FALSE
if(panel_open)
return FALSE // Close panel first!
+
playsound(src, W.usesound, 50, 1)
- var/actual_time = W.toolspeed * time
+ var/actual_time = W.get_tool_speed(TOOL_WRENCH) * time
if(actual_time != 0)
user.visible_message( \
"\The [user] begins [anchored ? "un" : ""]securing \the [src].", \
"You start [anchored ? "un" : ""]securing \the [src].")
+
if(actual_time == 0 || do_after(user, actual_time, target = src))
user.visible_message( \
"\The [user] has [anchored ? "un" : ""]secured \the [src].", \
@@ -363,29 +360,33 @@ Class Procs:
return TRUE
/obj/machinery/proc/default_deconstruction_crowbar(var/mob/user, var/obj/item/C)
- if(!C.is_crowbar())
- return 0
+ if(!C.get_tool_quality(TOOL_CROWBAR))
+ return FALSE
if(!panel_open)
- return 0
+ return FALSE
. = dismantle()
/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
- if(!S.is_screwdriver())
- return 0
+ if(!S.get_tool_quality(TOOL_SCREWDRIVER))
+ return FALSE
playsound(src, S.usesound, 50, 1)
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance hatch of [src].")
update_icon()
- return 1
+ return TRUE
+
+// Unimplemented on base type, but other machinery types may yet have use
+/obj/machinery/proc/default_deconstruction_wrench(var/mob/user, var/obj/item/S)
+ return
/obj/machinery/proc/computer_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
- if(!S.is_screwdriver())
- return 0
+ if(!S.get_tool_quality(TOOL_SCREWDRIVER))
+ return FALSE
if(!circuit)
- return 0
+ return FALSE
to_chat(user, "You start disconnecting the monitor.")
playsound(src, S.usesound, 50, 1)
- if(do_after(user, 20 * S.toolspeed))
+ if(do_after(user, 20 * S.get_tool_speed(TOOL_SCREWDRIVER)))
if(stat & BROKEN)
to_chat(user, "The broken glass falls out.")
new /obj/item/weapon/material/shard(src.loc)
@@ -394,19 +395,19 @@ Class Procs:
. = dismantle()
/obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
- if(!S.is_screwdriver())
- return 0
+ if(!S.get_tool_quality(TOOL_SCREWDRIVER))
+ return FALSE
playsound(src, S.usesound, 50, 1)
panel_open = !panel_open
to_chat(user, "The wires have been [panel_open ? "exposed" : "unexposed"]")
update_icon()
- return 1
+ return FALSE
/obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/W)
- if(!W.is_wirecutter())
- return 0
+ if(!W.get_tool_quality(TOOL_WIRECUTTER))
+ return FALSE
if(!panel_open)
- return 0
+ return FALSE
user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].")
playsound(src, W.usesound, 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
@@ -418,19 +419,19 @@ Class Procs:
if(istype(I,/obj/item/weapon/card/id))
I.forceMove(src.loc)
if(!circuit)
- return 0
+ return FALSE
var/obj/structure/frame/A = new /obj/structure/frame(src.loc)
var/obj/item/weapon/circuitboard/M = circuit
A.circuit = M
- A.anchored = 1
+ A.anchored = TRUE
A.frame_type = M.board_type
if(A.frame_type.circuit)
- A.need_circuit = 0
+ A.need_circuit = FALSE
if(A.frame_type.frame_class == FRAME_CLASS_ALARM || A.frame_type.frame_class == FRAME_CLASS_DISPLAY)
- A.density = 0
+ A.density = FALSE
else
- A.density = 1
+ A.density = TRUE
if(A.frame_type.frame_class == FRAME_CLASS_MACHINE)
for(var/obj/D in component_parts)
@@ -460,11 +461,10 @@ Class Procs:
M.loc = null
M.deconstruct(src)
qdel(src)
- return 1
+ return TRUE
/datum/proc/apply_visual(mob/M)
- M.sight = 0 //Just reset their mesons and stuff so they can't use them, by default.
- return
+ M.sight = FALSE //Just reset their mesons and stuff so they can't use them, by default.
/datum/proc/remove_visual(mob/M)
return
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 6d08389065..18596ff535 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -72,7 +72,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w
if(!T.is_plating())
return // prevent intraction when T-scanner revealed
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
open = !open
playsound(src, I.usesound, 50, 1)
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index 414b153c2f..dfc161be02 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -55,7 +55,7 @@ var/bomb_set
return
/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob)
- if(O.is_screwdriver())
+ if(O.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, O.usesound, 50, 1)
add_fingerprint(user)
if(auth)
@@ -78,7 +78,7 @@ var/bomb_set
flick("nuclearbombc", src)
return
- if(O.is_wirecutter() || istype(O, /obj/item/device/multitool))
+ if(O.get_tool_quality(TOOL_WIRECUTTER) || istype(O, /obj/item/device/multitool))
if(opened == 1)
nukehack_win(user)
return
@@ -94,35 +94,38 @@ var/bomb_set
if(anchored)
switch(removal_stage)
if(0)
- if(istype(O,/obj/item/weapon/weldingtool))
+ if(O.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = O
- if(!WT.isOn()) return
+ if(!WT.isOn())
+ return
if(WT.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "You need more fuel to complete this task.")
return
user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...")
- if(do_after(user,40 * WT.toolspeed))
- if(!src || !user || !WT.remove_fuel(5, user)) return
+ if(do_after(user,40 * WT.get_tool_speed(TOOL_WELDER)))
+ if(!src || !user || !WT.remove_fuel(5, user))
+ return
user.visible_message("[user] cuts through the bolt covers on [src].", "You cut through the bolt cover.")
removal_stage = 1
return
if(1)
- if(O.is_crowbar())
+ if(O.get_tool_quality(TOOL_CROWBAR))
user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...")
playsound(src, O.usesound, 50, 1)
- if(do_after(user,15 * O.toolspeed))
- if(!src || !user) return
+ if(do_after(user,15 * O.get_tool_speed(TOOL_CROWBAR)))
+ if(!src || !user)
+ return
user.visible_message("[user] forces open the bolt covers on [src].", "You force open the bolt covers.")
removal_stage = 2
return
if(2)
- if(istype(O,/obj/item/weapon/weldingtool))
+ if(O.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn()) return
@@ -132,29 +135,30 @@ var/bomb_set
user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...")
playsound(src, WT.usesound, 50, 1)
- if(do_after(user,40 * WT.toolspeed))
- if(!src || !user || !WT.remove_fuel(5, user)) return
+ if(do_after(user,40 * WT.get_tool_speed(TOOL_WELDER)))
+ if(!src || !user || !WT.remove_fuel(5, user))
+ return
user.visible_message("[user] cuts apart the anchoring system sealant on [src].", "You cut apart the anchoring system's sealant.")
removal_stage = 3
return
if(3)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
playsound(src, O.usesound, 50, 1)
- if(do_after(user,50 * O.toolspeed))
+ if(do_after(user,50 * O.get_tool_speed(TOOL_WRENCH)))
if(!src || !user) return
user.visible_message("[user] unwrenches the anchoring bolts on [src].", "You unwrench the anchoring bolts.")
removal_stage = 4
return
if(4)
- if(O.is_crowbar())
+ if(O.get_tool_quality(TOOL_CROWBAR))
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
playsound(src, O.usesound, 50, 1)
- if(do_after(user,80 * O.toolspeed))
+ if(do_after(user,80 * O.get_tool_speed(TOOL_WRENCH)))
if(!src || !user) return
user.visible_message("[user] crowbars [src] off of the anchors. It can now be moved.", "You jam the crowbar under the nuclear device and lift it off its anchors. You can now move it!")
anchored = 0
@@ -262,7 +266,7 @@ var/bomb_set
visible_message("The [src] emits a quiet whirling noise!")
if(href_list["act"] == "wire")
var/obj/item/I = usr.get_active_hand()
- if(!I.is_wirecutter())
+ if(!I.get_tool_quality(TOOL_WIRECUTTER))
to_chat(usr, "You need wirecutters!")
else
wires[temp_wire] = !wires[temp_wire]
diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm
index 32a76c3fb8..4540af5af7 100644
--- a/code/game/machinery/oxygen_pump.dm
+++ b/code/game/machinery/oxygen_pump.dm
@@ -128,7 +128,7 @@
return 1
/obj/machinery/oxygen_pump/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
stat ^= MAINT
user.visible_message("\The [user] [(stat & MAINT) ? "opens" : "closes"] \the [src].", "You [(stat & MAINT) ? "open" : "close"] \the [src].")
icon_state = (stat & MAINT) ? icon_state_open : icon_state_closed
diff --git a/code/game/machinery/pda_multicaster.dm b/code/game/machinery/pda_multicaster.dm
index 8f9cfb0f4b..c546368ca5 100644
--- a/code/game/machinery/pda_multicaster.dm
+++ b/code/game/machinery/pda_multicaster.dm
@@ -38,9 +38,9 @@
icon_state = "[initial(icon_state)]_off"
/obj/machinery/pda_multicaster/attackby(obj/item/I, mob/user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
default_deconstruction_screwdriver(user, I)
- else if(I.is_crowbar())
+ else if(I.get_tool_quality(TOOL_CROWBAR))
default_deconstruction_crowbar(user, I)
else
..()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index f5f2532080..bd51ba6e7e 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -166,7 +166,7 @@ Buildable meters
return ..()
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
return wrench_act(user, W)
return ..()
@@ -255,7 +255,7 @@ Buildable meters
var/piping_layer = PIPING_LAYER_DEFAULT
/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
return wrench_act(user, W)
return ..()
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 0d5e42f771..8637779244 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -115,11 +115,11 @@
user.drop_item()
qdel(W)
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if (unwrenched==0)
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to unfasten \the [src] from the floor...")
- if (do_after(user, 40 * W.toolspeed))
+ if (do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message( \
"[user] unfastens \the [src].", \
"You have unfastened \the [src]. Now it can be pulled somewhere else.", \
@@ -132,7 +132,7 @@
else /*if (unwrenched==1)*/
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to fasten \the [src] to the floor...")
- if (do_after(user, 20 * W.toolspeed))
+ if (do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message( \
"[user] fastens \the [src].", \
"You have fastened \the [src]. Now it can dispense pipes.", \
diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm
index 41e31e4ec0..339462beb1 100644
--- a/code/game/machinery/pipe/pipelayer.dm
+++ b/code/game/machinery/pipe/pipelayer.dm
@@ -81,12 +81,12 @@
return
if(default_part_replacement(user, W))
return
- if (!panel_open && W.is_wrench())
+ if (!panel_open && W.get_tool_quality(TOOL_WRENCH))
P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes
P_type = Pipes[P_type_t]
user.visible_message("[user] has set \the [src] to manufacture [P_type_t].", "You set \the [src] to manufacture [P_type_t].")
return
- if(!panel_open && W.is_crowbar())
+ if(!panel_open && W.get_tool_quality(TOOL_CROWBAR))
a_dis = !a_dis
user.visible_message("[user] has [!a_dis?"de":""]activated auto-dismantling.", "You [!a_dis?"de":""]activate auto-dismantling.")
return
diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm
index 4efd32c273..cd7853eae6 100644
--- a/code/game/machinery/pointdefense.dm
+++ b/code/game/machinery/pointdefense.dm
@@ -101,7 +101,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense)
return data
/obj/machinery/pointdefense_control/attackby(var/obj/item/W, var/mob/user)
- if(W?.is_multitool())
+ if(W?.get_tool_quality(TOOL_MULTITOOL))
var/new_ident = input(user, "Enter a new ident tag.", "[src]", id_tag) as null|text
if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, physical_state))
// Check for duplicate controllers with this ID
@@ -180,7 +180,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense)
return PDC
/obj/machinery/pointdefense/attackby(var/obj/item/W, var/mob/user)
- if(W?.is_multitool())
+ if(W?.get_tool_quality(TOOL_MULTITOOL))
var/new_ident = input(user, "Enter a new ident tag.", "[src]", id_tag) as null|text
if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, physical_state))
to_chat(user, "You register [src] with the [new_ident] network.")
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 5268d6d1f6..59df34611b 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -510,7 +510,7 @@
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
if(stat & BROKEN)
- if(I.is_crowbar())
+ if(I.get_tool_quality(TOOL_CROWBAR))
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
to_chat(user, "You begin prying the metal coverings off.")
@@ -529,7 +529,7 @@
to_chat(user, "You remove the turret but did not manage to salvage anything.")
qdel(src) // qdel
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
if(enabled || raised)
to_chat(user, "You cannot unsecure an active turret!")
return
@@ -546,18 +546,12 @@
)
wrenching = TRUE
- if(do_after(user, 50 * I.toolspeed))
+ if(do_after(user, 50 * I.get_tool_speed(TOOL_WRENCH)))
//This code handles moving the turret around. After all, it's a portable turret!
- if(!anchored)
- playsound(src, I.usesound, 100, 1)
- anchored = TRUE
- update_icon()
- to_chat(user, "You secure the exterior bolts on the turret.")
- else if(anchored)
- playsound(src, I.usesound, 100, 1)
- anchored = FALSE
- to_chat(user, "You unsecure the exterior bolts on the turret.")
- update_icon()
+ playsound(src, I.usesound, 100, 1)
+ update_icon()
+ anchored = !anchored
+ to_chat(user, "You [anchored ? "" : "un"]secure the exterior bolts on the turret.")
wrenching = FALSE
else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
@@ -968,14 +962,14 @@
//this is a bit unwieldy but self-explanatory
switch(build_step)
if(0) //first step
- if(I.is_wrench() && !anchored)
+ if(I.get_tool_quality(TOOL_WRENCH) && !anchored)
playsound(src, I.usesound, 100, 1)
to_chat(user, "You secure the external bolts.")
anchored = TRUE
build_step = 1
return
- else if(I.is_crowbar() && !anchored)
+ else if(I.get_tool_quality(TOOL_CROWBAR) && !anchored)
playsound(src, I.usesound, 75, 1)
to_chat(user, "You dismantle the turret construction.")
new /obj/item/stack/material/steel(loc, 5)
@@ -993,7 +987,7 @@
to_chat(user, "You need two sheets of metal to continue construction.")
return
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
playsound(src, I.usesound, 75, 1)
to_chat(user, "You unfasten the external bolts.")
anchored = FALSE
@@ -1001,13 +995,13 @@
return
if(2)
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
playsound(src, I.usesound, 100, 1)
to_chat(user, "You bolt the metal armor into place.")
build_step = 3
return
- else if(istype(I, /obj/item/weapon/weldingtool))
+ else if(I.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = I
if(!WT.isOn())
return
@@ -1016,7 +1010,7 @@
return
playsound(src, I.usesound, 50, 1)
- if(do_after(user, 20 * I.toolspeed))
+ if(do_after(user, 20 * I.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.remove_fuel(5, user)) return
build_step = 1
to_chat(user, "You remove the turret's interior metal armor.")
@@ -1041,7 +1035,7 @@
qdel(I) //delete the gun :(
return
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
playsound(src, I.usesound, 100, 1)
to_chat(user, "You remove the turret's metal armor bolts.")
build_step = 2
@@ -1060,7 +1054,7 @@
//attack_hand() removes the gun
if(5)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, I.usesound, 100, 1)
build_step = 6
to_chat(user, "You close the internal access hatch.")
@@ -1078,21 +1072,21 @@
to_chat(user, "You need two sheets of metal to continue construction.")
return
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, I.usesound, 100, 1)
build_step = 5
to_chat(user, "You open the internal access hatch.")
return
if(7)
- if(istype(I, /obj/item/weapon/weldingtool))
+ if(I.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = I
if(!WT.isOn()) return
if(WT.get_fuel() < 5)
to_chat(user, "You need more fuel to complete this task.")
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 30 * WT.toolspeed))
+ if(do_after(user, 30 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.remove_fuel(5, user))
return
build_step = 8
@@ -1108,7 +1102,7 @@
qdel(src) // qdel
- else if(I.is_crowbar())
+ else if(I.get_tool_quality(TOOL_CROWBAR))
playsound(src, I.usesound, 75, 1)
to_chat(user, "You pry off the turret's exterior armor.")
new /obj/item/stack/material/steel(loc, 2)
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index 669d738c63..d4c4fcb749 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -78,7 +78,7 @@
update_icon()
user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].")
- else if(portable && G.is_wrench())
+ else if(portable && G.get_tool_quality(TOOL_WRENCH))
if(charging)
to_chat(user, "Remove [charging] first!")
return
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 8178c970c9..1b269cbca4 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -72,7 +72,7 @@
else
to_chat(user, "The hatch must be open to insert a power cell.")
return
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
playsound(src, I.usesound, 50, 1)
user.visible_message("[user] [panel_open ? "opens" : "closes"] the hatch on the [src].", "You [panel_open ? "open" : "close"] the hatch on the [src].")
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 6bad81a8da..f14d2bdc4f 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -1,5 +1,5 @@
//////////////////////////////////////
-// SUIT STORAGE UNIT /////////////////
+// suit STORAGE UNIT /////////////////
//////////////////////////////////////
/obj/machinery/suit_storage_unit
@@ -9,13 +9,13 @@
icon_state = "suitstorage000000100" //order is: [has helmet][has suit][has human][is open][is locked][is UV cycling][is powered][is dirty/broken] [is superUVcycling]
anchored = 1
density = 1
- var/mob/living/carbon/human/OCCUPANT = null
- var/obj/item/clothing/suit/space/SUIT = null
- var/SUIT_TYPE = null
- var/obj/item/clothing/head/helmet/space/HELMET = null
- var/HELMET_TYPE = null
- var/obj/item/clothing/mask/MASK = null //All the stuff that's gonna be stored insiiiiiiiiiiiiiiiiiiide, nyoro~n
- var/MASK_TYPE = null //Erro's idea on standarising SSUs whle keeping creation of other SSU types easy: Make a child SSU, name it something then set the TYPE vars to your desired suit output. New() should take it from there by itself.
+ var/mob/living/carbon/human/occupant = null
+ var/obj/item/clothing/suit/space/suit = null
+ var/suit_type = null
+ var/obj/item/clothing/head/helmet/space/helmet = null
+ var/helmet_type = null
+ var/obj/item/clothing/mask/mask = null //All the stuff that's gonna be stored insiiiiiiiiiiiiiiiiiiide, nyoro~n
+ var/mask_type = null //Erro's idea on standarising SSUs whle keeping creation of other SSU types easy: Make a child SSU, name it something then set the TYPE vars to your desired suit output. New() should take it from there by itself.
var/isopen = 0
var/islocked = 0
var/isUV = 0
@@ -29,29 +29,29 @@
//The units themselves/////////////////
/obj/machinery/suit_storage_unit/standard_unit
- SUIT_TYPE = /obj/item/clothing/suit/space
- HELMET_TYPE = /obj/item/clothing/head/helmet/space
- MASK_TYPE = /obj/item/clothing/mask/breath
+ suit_type = /obj/item/clothing/suit/space
+ helmet_type = /obj/item/clothing/head/helmet/space
+ mask_type = /obj/item/clothing/mask/breath
/obj/machinery/suit_storage_unit/Initialize()
. = ..()
update_icon()
- if(SUIT_TYPE)
- SUIT = new SUIT_TYPE(src)
- if(HELMET_TYPE)
- HELMET = new HELMET_TYPE(src)
- if(MASK_TYPE)
- MASK = new MASK_TYPE(src)
+ if(suit_type)
+ suit = new suit_type(src)
+ if(helmet_type)
+ helmet = new helmet_type(src)
+ if(mask_type)
+ mask = new mask_type(src)
/obj/machinery/suit_storage_unit/update_icon()
var/hashelmet = 0
var/hassuit = 0
var/hashuman = 0
- if(HELMET)
+ if(helmet)
hashelmet = 1
- if(SUIT)
+ if(suit)
hassuit = 1
- if(OCCUPANT)
+ if(occupant)
hashuman = 1
icon_state = text("suitstorage[][][][][][][][][]", hashelmet, hassuit, hashuman, isopen, islocked, isUV, ispowered, isbroken, issuperUV)
@@ -108,20 +108,20 @@
data["safeties"] = safetieson
data["uv_active"] = isUV
data["uv_super"] = issuperUV
- if(HELMET)
- data["helmet"] = HELMET.name
+ if(helmet)
+ data["helmet"] = helmet.name
else
data["helmet"] = null
- if(SUIT)
- data["suit"] = SUIT.name
+ if(suit)
+ data["suit"] = suit.name
else
data["suit"] = null
- if(MASK)
- data["mask"] = MASK.name
+ if(mask)
+ data["mask"] = mask.name
else
data["mask"] = null
data["storage"] = null
- if(OCCUPANT)
+ if(occupant)
data["occupied"] = TRUE
else
data["occupied"] = FALSE
@@ -169,92 +169,58 @@
/obj/machinery/suit_storage_unit/proc/toggleUV(mob/user as mob)
-// var/protected = 0
-// var/mob/living/carbon/human/H = user
- if(!panelopen)
- return
-
- /*if(istype(H)) //Let's check if the guy's wearing electrically insulated gloves
- if(H.gloves)
- var/obj/item/clothing/gloves/G = H.gloves
- if(istype(G,/obj/item/clothing/gloves/yellow))
- protected = 1
-
- if(!protected)
- playsound(src, "sparks", 75, 1, -1)
- to_chat(user, "You try to touch the controls but you get zapped. There must be a short circuit somewhere.")
- return*/
- else //welp, the guy is protected, we can continue
+ if(panelopen)
if(issuperUV)
to_chat(user, "You slide the dial back towards \"185nm\".")
issuperUV = 0
else
to_chat(user, "You crank the dial all the way up to \"15nm\".")
issuperUV = 1
- return
/obj/machinery/suit_storage_unit/proc/togglesafeties(mob/user as mob)
-// var/protected = 0
-// var/mob/living/carbon/human/H = user
- if(!panelopen) //Needed check due to bugs
- return
-
- /*if(istype(H)) //Let's check if the guy's wearing electrically insulated gloves
- if(H.gloves)
- var/obj/item/clothing/gloves/G = H.gloves
- if(istype(G,/obj/item/clothing/gloves/yellow))
- protected = 1
-
- if(!protected)
- playsound(src, "sparks", 75, 1, -1)
- to_chat(user, "You try to touch the controls but you get zapped. There must be a short circuit somewhere.")
- return*/
- else
+ if(panelopen)
to_chat(user, "You push the button. The coloured LED next to it changes.")
safetieson = !safetieson
/obj/machinery/suit_storage_unit/proc/dispense_helmet(mob/user as mob)
- if(!HELMET)
- return //Do I even need this sanity check? Nyoro~n
- else
- HELMET.loc = src.loc
- HELMET = null
- return
+ if(helmet)
+ helmet.loc = src.loc
+ helmet = null
/obj/machinery/suit_storage_unit/proc/dispense_suit(mob/user as mob)
- if(!SUIT)
+ if(!suit)
return
else
- SUIT.loc = src.loc
- SUIT = null
+ suit.loc = src.loc
+ suit = null
return
/obj/machinery/suit_storage_unit/proc/dispense_mask(mob/user as mob)
- if(!MASK)
+ if(!mask)
return
else
- MASK.loc = src.loc
- MASK = null
+ mask.loc = src.loc
+ mask = null
return
/obj/machinery/suit_storage_unit/proc/dump_everything()
islocked = 0 //locks go free
- if(SUIT)
- SUIT.loc = src.loc
- SUIT = null
- if(HELMET)
- HELMET.loc = src.loc
- HELMET = null
- if(MASK)
- MASK.loc = src.loc
- MASK = null
- if(OCCUPANT)
- eject_occupant(OCCUPANT)
+ if(suit)
+ suit.loc = src.loc
+ suit = null
+ if(helmet)
+ helmet.loc = src.loc
+ helmet = null
+ if(mask)
+ mask.loc = src.loc
+ mask = null
+ if(occupant)
+ eject_occupant(occupant)
return
@@ -262,7 +228,7 @@
if(islocked || isUV)
to_chat(user, "Unable to open unit.")
return
- if(OCCUPANT)
+ if(occupant)
eject_occupant(user)
return // eject_occupant opens the door, so we need to return
isopen = !isopen
@@ -270,7 +236,7 @@
/obj/machinery/suit_storage_unit/proc/toggle_lock(mob/user as mob)
- if(OCCUPANT && safetieson)
+ if(occupant && safetieson)
to_chat(user, "The Unit's safety protocols disallow locking when a biological form is detected inside its compartments.")
return
if(isopen)
@@ -282,16 +248,16 @@
/obj/machinery/suit_storage_unit/proc/start_UV(mob/user as mob)
if(isUV || isopen) //I'm bored of all these sanity checks
return
- if(OCCUPANT && safetieson)
+ if(occupant && safetieson)
to_chat(user, "WARNING: Biological entity detected in the confines of the Unit's storage. Cannot initiate cycle.")
return
- if(!HELMET && !MASK && !SUIT && !OCCUPANT) //shit's empty yo
+ if(!helmet && !mask && !suit && !occupant) //shit's empty yo
to_chat(user, "Unit storage bays empty. Nothing to disinfect -- Aborting.")
return
to_chat(user, "You start the Unit's cauterisation cycle.")
cycletime_left = 20
isUV = 1
- if(OCCUPANT && !islocked)
+ if(occupant && !islocked)
islocked = 1 //Let's lock it for good measure
update_icon()
updateUsrDialog()
@@ -299,50 +265,50 @@
var/i //our counter
for(i=0,i<4,i++)
sleep(50)
- if(OCCUPANT)
- OCCUPANT.apply_effect(50, IRRADIATE)
- var/obj/item/organ/internal/diona/nutrients/rad_organ = locate() in OCCUPANT.internal_organs
+ if(occupant)
+ occupant.apply_effect(50, IRRADIATE)
+ var/obj/item/organ/internal/diona/nutrients/rad_organ = locate() in occupant.internal_organs
if(!rad_organ)
- if(OCCUPANT.can_feel_pain())
- OCCUPANT.emote("scream")
+ if(occupant.can_feel_pain())
+ occupant.emote("scream")
if(issuperUV)
var/burndamage = rand(28,35)
- OCCUPANT.take_organ_damage(0,burndamage)
+ occupant.take_organ_damage(0,burndamage)
else
var/burndamage = rand(6,10)
- OCCUPANT.take_organ_damage(0,burndamage)
+ occupant.take_organ_damage(0,burndamage)
if(i==3) //End of the cycle
if(!issuperUV)
- if(HELMET)
- HELMET.clean_blood()
- if(SUIT)
- SUIT.clean_blood()
- if(MASK)
- MASK.clean_blood()
+ if(helmet)
+ helmet.clean_blood()
+ if(suit)
+ suit.clean_blood()
+ if(mask)
+ mask.clean_blood()
else //It was supercycling, destroy everything
- if(HELMET)
- HELMET = null
- if(SUIT)
- SUIT = null
- if(MASK)
- MASK = null
+ if(helmet)
+ helmet = null
+ if(suit)
+ suit = null
+ if(mask)
+ mask = null
visible_message("With a loud whining noise, the Suit Storage Unit's door grinds open. Puffs of ashen smoke come out of its chamber.", 3)
isbroken = 1
isopen = 1
islocked = 0
- eject_occupant(OCCUPANT) //Mixing up these two lines causes bug. DO NOT DO IT.
+ eject_occupant(occupant) //Mixing up these two lines causes bug. DO NOT DO IT.
isUV = 0 //Cycle ends
update_icon()
updateUsrDialog()
return
/* spawn(200) //Let's clean dat shit after 20 secs //Eh, this doesn't work
- if(HELMET)
- HELMET.clean_blood()
- if(SUIT)
- SUIT.clean_blood()
- if(MASK)
- MASK.clean_blood()
+ if(helmet)
+ helmet.clean_blood()
+ if(suit)
+ suit.clean_blood()
+ if(mask)
+ mask.clean_blood()
isUV = 0 //Cycle ends
update_icon()
updateUsrDialog()
@@ -350,12 +316,12 @@
var/i
for(i=0,i<4,i++) //Gradually give the guy inside some damaged based on the intensity
spawn(50)
- if(OCCUPANT)
+ if(occupant)
if(issuperUV)
- OCCUPANT.take_organ_damage(0,40)
+ occupant.take_organ_damage(0,40)
to_chat(user, "Test. You gave him 40 damage")
else
- OCCUPANT.take_organ_damage(0,8)
+ occupant.take_organ_damage(0,8)
to_chat(user, "Test. You gave him 8 damage")
return*/
@@ -370,21 +336,21 @@
if(islocked)
return
- if(!OCCUPANT)
+ if(!occupant)
return
// for(var/obj/O in src)
// O.loc = src.loc
- if(OCCUPANT.client)
- if(user != OCCUPANT)
- to_chat(OCCUPANT, "The machine kicks you out!")
+ if(occupant.client)
+ if(user != occupant)
+ to_chat(occupant, "The machine kicks you out!")
if(user.loc != src.loc)
- to_chat(OCCUPANT, "You leave the not-so-cozy confines of the SSU.")
+ to_chat(occupant, "You leave the not-so-cozy confines of the SSU.")
- OCCUPANT.client.eye = OCCUPANT.client.mob
- OCCUPANT.client.perspective = MOB_PERSPECTIVE
- OCCUPANT.loc = src.loc
- OCCUPANT = null
+ occupant.client.eye = occupant.client.mob
+ occupant.client.perspective = MOB_PERSPECTIVE
+ occupant.loc = src.loc
+ occupant = null
if(!isopen)
isopen = 1
update_icon()
@@ -418,7 +384,7 @@
if(!ispowered || isbroken)
to_chat(usr, "The unit is not operational.")
return
- if((OCCUPANT) || (HELMET) || (SUIT))
+ if((occupant) || (helmet) || (suit))
to_chat(usr, "It's too cluttered inside for you to fit in!")
return
visible_message("[usr] starts squeezing into the suit storage unit!", 3)
@@ -428,7 +394,7 @@
usr.client.eye = src
usr.loc = src
// usr.metabslow = 1
- OCCUPANT = usr
+ occupant = usr
isopen = 0 //Close the thing after the guy gets inside
update_icon()
@@ -439,14 +405,14 @@
updateUsrDialog()
return
else
- OCCUPANT = null //Testing this as a backup sanity test
+ occupant = null //Testing this as a backup sanity test
return
/obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob)
if(!ispowered)
return
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
panelopen = !panelopen
playsound(src, I.usesound, 100, 1)
to_chat(user, "You [panelopen ? "open up" : "close"] the unit's maintenance panel.")
@@ -462,7 +428,7 @@
if(!ispowered || isbroken)
to_chat(user, "The unit is not operational.")
return
- if((OCCUPANT) || (HELMET) || (SUIT)) //Unit needs to be absolutely empty
+ if((occupant) || (helmet) || (suit)) //Unit needs to be absolutely empty
to_chat(user, "The unit's storage area is too cluttered.")
return
visible_message("[user] starts putting [G.affecting.name] into the Suit Storage Unit.", 3)
@@ -473,7 +439,7 @@
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
- OCCUPANT = M
+ occupant = M
isopen = 0 //close ittt
//for(var/obj/O in src)
@@ -488,13 +454,13 @@
if(!isopen)
return
var/obj/item/clothing/suit/space/S = I
- if(SUIT)
+ if(suit)
to_chat(user, "The unit already contains a suit.")
return
to_chat(user, "You load the [S.name] into the storage compartment.")
user.drop_item()
S.loc = src
- SUIT = S
+ suit = S
update_icon()
updateUsrDialog()
return
@@ -502,13 +468,13 @@
if(!isopen)
return
var/obj/item/clothing/head/helmet/H = I
- if(HELMET)
+ if(helmet)
to_chat(user, "The unit already contains a helmet.")
return
to_chat(user, "You load the [H.name] into the storage compartment.")
user.drop_item()
H.loc = src
- HELMET = H
+ helmet = H
update_icon()
updateUsrDialog()
return
@@ -516,13 +482,13 @@
if(!isopen)
return
var/obj/item/clothing/mask/M = I
- if(MASK)
+ if(mask)
to_chat(user, "The unit already contains a mask.")
return
to_chat(user, "You load the [M.name] into the storage compartment.")
user.drop_item()
M.loc = src
- MASK = M
+ mask = M
update_icon()
updateUsrDialog()
return
@@ -675,7 +641,7 @@
return
//Hacking init.
- if(istype(I, /obj/item/device/multitool) || I.is_wirecutter())
+ if(I.get_tool_quality(TOOL_MULTITOOL) || I.get_tool_quality(TOOL_WIRECUTTER))
if(panel_open)
attack_hand(user)
return
@@ -711,7 +677,7 @@
updateUsrDialog()
return
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
playsound(src, I.usesound, 50, 1)
diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm
index 413f5a0af9..4a386129eb 100644
--- a/code/game/machinery/supplybeacon.dm
+++ b/code/game/machinery/supplybeacon.dm
@@ -45,7 +45,7 @@
drop_type = "supermatter"
/obj/machinery/power/supply_beacon/attackby(var/obj/item/weapon/W, var/mob/user)
- if(!use_power && W.is_wrench())
+ if(!use_power && W.get_tool_quality(TOOL_WRENCH))
if(!anchored && !connect_to_network())
to_chat(user, "This device must be placed over an exposed cable.")
return
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 2c59ec8b20..2581366a3e 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -119,7 +119,7 @@
return
/obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(active)
to_chat(user, "You need to deactivate the beacon first!")
return
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index aabb65769a..ab9b471b03 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -17,7 +17,7 @@
frame_types_wall = construction_frame_wall
/obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
new refund_type(get_turf(src.loc), refund_amt)
qdel(src)
return
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index ae2238145d..e966e80f18 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -96,35 +96,23 @@
icon_state = "wm_[state][panel_open]"
/obj/machinery/washing_machine/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(state == 2 && washing.len < 1)
- if(default_deconstruction_screwdriver(user, W))
- return
- if(default_deconstruction_crowbar(user, W))
- return
- if(default_unfasten_wrench(user, W, 40))
- return
- /*if(W.is_screwdriver())
- panel = !panel
- to_chat(user, "You [panel ? "open" : "close"] the [src]'s maintenance panel")*/
- if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp))
- if(state in list( 1, 3, 6))
- if(!crayon)
- user.drop_item()
- crayon = W
- crayon.loc = src
- else
- ..()
- else
- ..()
- else if(istype(W,/obj/item/weapon/grab))
- if((state == 1) && hacked)
- var/obj/item/weapon/grab/G = W
- if(ishuman(G.assailant) && iscorgi(G.affecting))
- G.affecting.loc = src
- qdel(G)
- state = 3
- else
- ..()
+ if(state == 2 && washing.len < 1 && ( \
+ default_deconstruction_screwdriver(user, W) || \
+ default_deconstruction_crowbar(user, W) || \
+ default_unfasten_wrench(user, W, 40) ) )
+ return
+
+ if(!crayon && (state in list(1, 3, 6)) && ( \
+ istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp) ) )
+ user.drop_from_inventory(W, src)
+ crayon = W
+
+ else if(istype(W,/obj/item/weapon/grab) && state == 1 && hacked)
+ var/obj/item/weapon/grab/G = W
+ if(ishuman(G.assailant) && iscorgi(G.affecting))
+ G.affecting.loc = src
+ qdel(G)
+ state = 3
else if(is_type_in_list(W, disallowed_types))
to_chat(user, "You can't fit \the [W] inside.")
diff --git a/code/game/mecha/equipment/tools/powertool.dm b/code/game/mecha/equipment/tools/powertool.dm
index 0adcb98929..9c4e40184e 100644
--- a/code/game/mecha/equipment/tools/powertool.dm
+++ b/code/game/mecha/equipment/tools/powertool.dm
@@ -11,7 +11,7 @@
required_type = list(/obj/mecha/working/ripley)
var/obj/item/my_tool = null
- var/tooltype = /obj/item/weapon/tool/wrench/power
+ var/tooltype = /obj/item/weapon/tool/powerdrill
/obj/item/mecha_parts/mecha_equipment/tool/powertool/Initialize()
my_tool = new tooltype(src)
@@ -37,19 +37,19 @@
name = "pneumatic prybar"
desc = "An exosuit-mounted pneumatic prybar."
icon_state = "mecha_crowbar"
- tooltype = /obj/item/weapon/tool/crowbar/power
+ tooltype = /obj/item/weapon/tool/hydraulic_cutter
ready_sound = 'sound/mecha/gasdisconnected.ogg'
/obj/item/mecha_parts/mecha_equipment/tool/powertool/cutter
name = "pneumatic cablecutter"
desc = "An exosuit-mounted pneumatic cablecutter."
icon_state = "mecha_cablecutter"
- tooltype = /obj/item/weapon/tool/wirecutters/power
+ tooltype = /obj/item/weapon/tool/hydraulic_cutter
ready_sound = 'sound/mecha/gasdisconnected.ogg'
/obj/item/mecha_parts/mecha_equipment/tool/powertool/screwdriver
name = "pneumatic screwdriver"
desc = "An exosuit-mounted pneumatic screwdriver."
icon_state = "mecha_screwdriver"
- tooltype = /obj/item/weapon/tool/screwdriver/power
+ tooltype = /obj/item/weapon/tool/powerdrill
ready_sound = 'sound/mecha/gasdisconnected.ogg'
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index cdad507d68..d578448d63 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -1468,7 +1468,7 @@
to_chat(user, "Invalid ID: Access denied.")
else
to_chat(user, "Maintenance protocols disabled by operator.")
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(state==MECHA_BOLTS_SECURED)
state = MECHA_PANEL_LOOSE
to_chat(user, "You undo the securing bolts.")
@@ -1476,7 +1476,7 @@
state = MECHA_BOLTS_SECURED
to_chat(user, "You tighten the securing bolts.")
return
- else if(W.is_crowbar())
+ else if(W.get_tool_quality(TOOL_CROWBAR))
if(state==MECHA_PANEL_LOOSE)
state = MECHA_CELL_OPEN
to_chat(user, "You open the hatch to the power unit")
@@ -1509,7 +1509,7 @@
else
to_chat(user, "There's not enough wire to finish the task.")
return
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(hasInternalDamage(MECHA_INT_TEMP_CONTROL))
clearInternalDamage(MECHA_INT_TEMP_CONTROL)
to_chat(user, "You repair the damaged temperature controller.")
diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index e345013e3d..d008d072bb 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -9,13 +9,13 @@
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
- else if(I.is_wirecutter())
+ else if(I.get_tool_quality(TOOL_WIRECUTTER))
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
else if(istype(I, /obj/item/stack/cable_coil))
@@ -41,13 +41,13 @@
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
- else if(I.is_wirecutter())
+ else if(I.get_tool_quality(TOOL_WIRECUTTER))
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
else if(istype(I, /obj/item/stack/cable_coil))
@@ -103,11 +103,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -115,46 +115,46 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//8
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//10
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//11
- list("key"=IS_WIRECUTTER,
- "backkey"=IS_SCREWDRIVER,
+ list("key"=TOOL_WIRECUTTER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//12
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//14
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -314,11 +314,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/mecha_parts/part/gygax_armour,
@@ -326,70 +326,70 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/targeting,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -598,11 +598,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -610,70 +610,70 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Medical module is secured"),
//11
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Medical module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/medical,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -884,15 +884,15 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
- "backkey"=IS_CROWBAR,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is being installed."),
//4
list("key"=/obj/item/stack/material/plasteel,
@@ -900,46 +900,46 @@
"desc"="Internal armor is welded."),
//5
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//6
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//7
list("key"=/obj/item/stack/material/plasteel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//8
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//9
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//10
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//11
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//12
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//13
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//14
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//15
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -1108,11 +1108,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/mecha_parts/part/durand_armour,
@@ -1120,70 +1120,70 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/durand/targeting,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/durand/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/durand/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -1392,11 +1392,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -1404,46 +1404,46 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//8
list("key"=/obj/item/weapon/circuitboard/mecha/odysseus/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//10
list("key"=/obj/item/weapon/circuitboard/mecha/odysseus/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//11
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//12
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//14
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -1604,11 +1604,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -1616,70 +1616,70 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_WRENCH,
+ "backkey"=TOOL_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Hand teleporter is secured"),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Hand teleporter is installed"),
//8
list("key"=/obj/item/weapon/hand_tele,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="SMES coil is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="SMES coil is installed"),
//10
list("key"=/obj/item/weapon/smes_coil/super_capacity,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/phazon/targeting,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/phazon/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/phazon/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -1886,11 +1886,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_CROWBAR,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//2
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="External armor is attached."),
//3
list("key"=/obj/item/stack/material/morphium,
@@ -1898,78 +1898,78 @@
"desc"="Internal armor is welded"),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=IS_CROWBAR,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is wrenched"),
//5
- list("key"=IS_WRENCH,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_WRENCH,
+ "backkey"=TOOL_CROWBAR,
"desc"="Internal armor is attached."),
//6
list("key"=/obj/item/stack/material/durasteel,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Durand auxiliary board is secured."),
//7
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Durand auxiliary board is installed"),
//8
list("key"=/obj/item/weapon/circuitboard/mecha/durand/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Phase coil is secured"),
//9
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Phase coil is installed"),
//10
list("key"=/obj/item/prop/alien/phasecoil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Gygax balance system secured"),
//11
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Gygax balance system installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Targeting module is secured"),
//13
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Targeting module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/imperion/targeting,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//15
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/imperion/peripherals,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is secured"),
//17
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_CROWBAR,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed"),
//18
list("key"=/obj/item/weapon/circuitboard/mecha/imperion/main,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//19
list("key"=/obj/item/weapon/tool/wirecutters,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added"),
//20
list("key"=/obj/item/stack/cable_coil,
- "backkey"=IS_SCREWDRIVER,
+ "backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//21
- list("key"=IS_SCREWDRIVER,
- "backkey"=IS_WRENCH,
+ list("key"=TOOL_SCREWDRIVER,
+ "backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//22
- list("key"=IS_WRENCH,
+ list("key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm
index c28a16c893..6241937577 100644
--- a/code/game/mecha/mecha_wreckage.dm
+++ b/code/game/mecha/mecha_wreckage.dm
@@ -49,7 +49,7 @@
else
to_chat(user, "You need more welding fuel to complete this task.")
return
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
if(salvage_num <= 0)
to_chat(user, "You don't see anything that can be cut with [W].")
return
@@ -61,7 +61,7 @@
salvage_num--
else
to_chat(user, "You failed to salvage anything valuable from [src].")
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if(!isemptylist(crowbar_salvage))
var/obj/S = pick(crowbar_salvage)
if(S)
diff --git a/code/game/objects/effects/decals/posters/posters.dm b/code/game/objects/effects/decals/posters/posters.dm
index 7c55453656..307a20de03 100644
--- a/code/game/objects/effects/decals/posters/posters.dm
+++ b/code/game/objects/effects/decals/posters/posters.dm
@@ -164,7 +164,7 @@
return ..()
/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
playsound(src, W.usesound, 100, 1)
if(ruined)
to_chat(user, "You remove the remnants of the poster.")
diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm
index fe6fbe4686..55a338b605 100644
--- a/code/game/objects/effects/mines.dm
+++ b/code/game/objects/effects/mines.dm
@@ -100,7 +100,7 @@
explode(M)
/obj/effect/mine/attackby(obj/item/W as obj, mob/living/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
user.visible_message("[user] very carefully screws the mine's panel [panel_open ? "open" : "closed"].",
"You very carefully screw the mine's panel [panel_open ? "open" : "closed"].")
@@ -109,16 +109,15 @@
// Panel open, stay uncloaked, or uncloak if already cloaked. If you don't cloak on place, ignore it and just be normal alpha.
alpha = camo_net ? (panel_open ? 255 : 50) : 255
- else if((W.is_wirecutter() || istype(W, /obj/item/device/multitool)) && panel_open)
+ else if(panel_open && (W.get_tool_quality(TOOL_WIRECUTTER) || W.get_tool_quality(TOOL_MULTITOOL)))
interact(user)
else
..()
/obj/effect/mine/interact(mob/living/user as mob)
- if(!panel_open || istype(user, /mob/living/silicon/ai))
- return
- user.set_machine(src)
- wires.Interact(user)
+ if(panel_open && !istype(user, /mob/living/silicon/ai))
+ user.set_machine(src)
+ wires.Interact(user)
/obj/effect/mine/camo
camo_net = TRUE
@@ -308,7 +307,7 @@
return
/obj/item/weapon/mine/attackby(obj/item/W as obj, mob/living/user as mob)
- if(W.is_screwdriver() && trap)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER) && trap)
to_chat(user, "You begin removing \the [trap].")
if(do_after(user, 10 SECONDS))
to_chat(user, "You finish disconnecting the mine's trigger.")
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 165d261080..ed770e631c 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -86,7 +86,6 @@
// Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called.
var/list/sprite_sheets_obj = list()
- var/toolspeed = 1 // This is a multipler on how 'fast' a tool works. e.g. setting this to 0.5 will make the tool work twice as fast.
var/attackspeed = DEFAULT_ATTACK_COOLDOWN // How long click delay will be when using this, in 1/10ths of a second. Checked in the user's get_attack_speed().
var/reach = 1 // Length of tiles it can reach, 1 is adjacent.
var/addblends // Icon overlay for ADD highlights when applicable.
diff --git a/code/game/objects/items/bells.dm b/code/game/objects/items/bells.dm
index e9219957e4..1af158be10 100644
--- a/code/game/objects/items/bells.dm
+++ b/code/game/objects/items/bells.dm
@@ -87,7 +87,7 @@
/obj/item/weapon/deskbell/attackby(obj/item/W, mob/user, params)
if(!istype(W))
return
- if(W.is_wrench() && isturf(loc))
+ if(W.get_tool_quality(TOOL_WRENCH) && isturf(loc))
if(do_after(5))
if(!src) return
to_chat(user, "You dissasemble the desk bell")
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 970613bc5b..3b41cb299f 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -48,7 +48,7 @@
src.name = "body bag"
//..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri
return
- else if(W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_WIRECUTTER))
to_chat(user, "You cut the tag off the bodybag")
src.name = "body bag"
src.overlays.Cut()
@@ -246,7 +246,7 @@
inject_occupant(H)
break
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(syringe)
if(used)
to_chat(user,"The injector cannot be removed now that the stasis bag has been used!")
diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm
index eeaf734566..f00271fee8 100644
--- a/code/game/objects/items/devices/defib.dm
+++ b/code/game/objects/items/devices/defib.dm
@@ -97,7 +97,7 @@
to_chat(user, "You install a cell in \the [src].")
update_icon()
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(bcell)
bcell.update_icon()
bcell.forceMove(get_turf(src.loc))
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 0801e0da5b..722076a0be 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -37,13 +37,13 @@
power_supply = new cell_type(src)
/obj/item/device/flash/attackby(var/obj/item/W, var/mob/user)
- if(W.is_screwdriver() && broken)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER) && broken)
if(repairing)
to_chat(user, "\The [src] is already being repaired!")
return
user.visible_message("\The [user] starts trying to repair \the [src]'s bulb.")
repairing = TRUE
- if(do_after(user, (40 SECONDS + rand(0, 20 SECONDS)) * W.toolspeed) && can_repair)
+ if(do_after(user, (40 SECONDS + rand(0, 20 SECONDS)) * W.get_tool_speed(TOOL_SCREWDRIVER)) && can_repair)
if(prob(30))
user.visible_message("\The [user] successfully repairs \the [src]!")
broken = FALSE
diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm
index a550d608e1..68ce0ed6a0 100644
--- a/code/game/objects/items/devices/hacktool.dm
+++ b/code/game/objects/items/devices/hacktool.dm
@@ -24,7 +24,7 @@
return ..()
/obj/item/device/multitool/hacktool/attackby(var/obj/item/W, var/mob/user)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
in_hack_mode = !in_hack_mode
playsound(src, W.usesound, 50, 1)
else
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 8b6d472c58..2facc57a3c 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -54,7 +54,7 @@
else
to_chat(user, "[src] already has a diode.")
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(diode)
to_chat(user, "You remove the [diode.name] from the [src].")
diode.loc = get_turf(src.loc)
diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm
index 72552b4de9..cf60227545 100644
--- a/code/game/objects/items/devices/multitool.dm
+++ b/code/game/objects/items/devices/multitool.dm
@@ -28,8 +28,7 @@
var/obj/machinery/clonepod/connecting //same for cryopod linkage
var/obj/machinery/connectable //Used to connect machinery.
var/weakref_wiring //Used to store weak references for integrated circuitry. This is now the Omnitool.
- toolspeed = 1
- tool_qualities = list(TOOL_MULTITOOL)
+ tool_qualities = list(TOOL_MULTITOOL = TOOL_QUALITY_STANDARD)
/obj/item/device/multitool/attack_self(mob/living/user)
var/choice = alert("What do you want to do with \the [src]?","Multitool Menu", "Switch Mode", "Clear Buffers", "Cancel")
@@ -63,16 +62,12 @@
to_chat(user,"\The [src] is now set to [toolmode].")
accepting_refs = (toolmode == MULTITOOL_MODE_INTCIRCUITS)
-
- return
-
-/obj/item/device/multitool/is_multitool()
- return TRUE
+n
/obj/item/device/multitool/cyborg
name = "multitool"
desc = "Optimised and stripped-down version of a regular multitool."
- toolspeed = 0.5
+ tool_qualities = list(TOOL_MULTITOOL = TOOL_QUALITY_DECENT)
@@ -94,5 +89,5 @@
catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_multitool)
icon = 'icons/obj/abductor.dmi'
icon_state = "multitool"
- toolspeed = 0.1
+ tool_qualities = list(TOOL_MULTITOOL = TOOL_QUALITY_BEST)
origin_tech = list(TECH_MAGNET = 5, TECH_ENGINEERING = 5)
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index 1fd6711092..c679177869 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -328,7 +328,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
current_emotion = emotion
/obj/item/device/paicard/proc/alertUpdate()
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("\The [src] flashes a message across its screen, \"Additional personalities available for download.\"", 3, "\The [src] bleeps electronically.", 2)
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index db601a2d93..36cb9776a6 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -29,7 +29,7 @@
..()
/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(mode == 0)
var/turf/T = loc
if(isturf(T) && !!T.is_plating())
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index 58e8100204..88075cf096 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -334,33 +334,20 @@
return ..(freq, level, 1)
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
-// ..()
user.set_machine(src)
- if(!(W.is_screwdriver() || istype(W, /obj/item/device/encryptionkey)))
- return
-
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(keyslot1 || keyslot2)
-
-
for(var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
secure_radio_connections[ch_name] = null
-
if(keyslot1)
- var/turf/T = get_turf(user)
- if(T)
- keyslot1.loc = T
- keyslot1 = null
-
-
+ keyslot1.forceMove(get_turf(user))
+ keyslot1 = null
if(keyslot2)
- var/turf/T = get_turf(user)
- if(T)
- keyslot2.loc = T
- keyslot2 = null
+ keyslot2.forceMove(get_turf(user))
+ keyslot2 = null
recalculateChannels()
to_chat(user, "You pop out the encryption keys in the headset!")
@@ -368,26 +355,25 @@
else
to_chat(user, "This headset doesn't have any encryption keys! How useless...")
+
+ return TRUE
- if(istype(W, /obj/item/device/encryptionkey/))
- if(keyslot1 && keyslot2)
- to_chat(user, "The headset can't hold another key!")
- return
-
+ else if(istype(W, /obj/item/device/encryptionkey/))
if(!keyslot1)
- user.drop_item()
- W.loc = src
+ user.drop_from_inventory(W, src)
keyslot1 = W
- else
- user.drop_item()
- W.loc = src
+ else if(!keyslot2)
+ user.drop_from_inventory(W, src)
keyslot2 = W
-
+
+ else
+ to_chat(user, "The headset can't hold another key!")
recalculateChannels()
-
- return
+ return TRUE
+
+ return ..()
/obj/item/device/radio/headset/recalculateChannels(var/setDescription = 0)
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index 97dd933e3a..dcb8086912 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -123,12 +123,12 @@
/obj/item/device/radio/intercom/attackby(obj/item/W as obj, mob/user as mob)
add_fingerprint(user)
- if(W.is_screwdriver()) // Opening the intercom up.
+ if(W.get_tool_quality(TOOL_SCREWDRIVER)) // Opening the intercom up.
wiresexposed = !wiresexposed
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
playsound(src, W.usesound, 50, 1)
update_icon()
- else if(wiresexposed && W.is_wirecutter())
+ else if(wiresexposed && W.get_tool_quality(TOOL_WIRECUTTER))
user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].")
playsound(src, W.usesound, 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 444c80c94a..aca1ba09d2 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -606,21 +606,18 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
. += "\The [src] can not be modified or attached!"
/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob)
- ..()
user.set_machine(src)
- if (!W.is_screwdriver())
- return
- b_stat = !( b_stat )
- if(!istype(src, /obj/item/device/radio/beacon))
- if (b_stat)
- user.show_message("\The [src] can now be attached and modified!")
- else
- user.show_message("\The [src] can no longer be modified or attached!")
- updateDialog()
- //Foreach goto(83)
- add_fingerprint(user)
- return
- else return
+ add_fingerprint(user)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
+ b_stat = !b_stat
+ if(!istype(src, /obj/item/device/radio/beacon))
+ updateDialog()
+ if(b_stat)
+ to_chat(user, SPAN_NOTICE("\The [src] can now be attached and modified!"))
+ else
+ to_chat(user, SPAN_NOTICE("\The [src] can no longer be modified or attached!"))
+ return TRUE
+ return ..()
/obj/item/device/radio/emp_act(severity)
broadcasting = 0
@@ -658,25 +655,16 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
R.cell_use_power(C.active_usage)
/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob)
-// ..()
user.set_machine(src)
- if (!(W.is_screwdriver() || istype(W, /obj/item/device/encryptionkey)))
- return
-
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(keyslot)
-
-
for(var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
secure_radio_connections[ch_name] = null
-
-
+
if(keyslot)
- var/turf/T = get_turf(user)
- if(T)
- keyslot.loc = T
- keyslot = null
+ keyslot.forceMove(get_turf(user))
+ keyslot = null
recalculateChannels()
to_chat(user, "You pop out the encryption key in the radio!")
@@ -685,19 +673,20 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
else
to_chat(user, "This radio doesn't have any encryption keys!")
- if(istype(W, /obj/item/device/encryptionkey/))
+ return TRUE
+
+ else if(istype(W, /obj/item/device/encryptionkey/))
if(keyslot)
to_chat(user, "The radio can't hold another key!")
- return
- if(!keyslot)
- user.drop_item()
- W.loc = src
+ else
+ user.drop_from_inventory(W, src)
keyslot = W
recalculateChannels()
+ return TRUE
- return
+ return ..()
/obj/item/device/radio/borg/recalculateChannels()
src.channels = list()
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index d28ebc71f4..1176de17eb 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -32,13 +32,12 @@ HALOGEN COUNTER - Radcount on mobs
. = ..()
/obj/item/device/healthanalyzer/do_surgery(mob/living/M, mob/living/user)
- if(user.a_intent != I_HELP) //in case it is ever used as a surgery tool
- return ..()
scan_mob(M, user) //default surgery behaviour is just to scan as usual
- return 1
+ return TRUE
/obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/user)
scan_mob(M, user)
+ return TRUE
/obj/item/device/healthanalyzer/proc/scan_mob(mob/living/M, mob/living/user)
var/dat = ""
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
index d3436ba4c5..ab51cdf2fc 100644
--- a/code/game/objects/items/devices/spy_bug.dm
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -110,7 +110,7 @@
else
to_chat(user, "Error: The device is linked to another monitor.")
- else if(W.is_wrench() && user.a_intent != I_HURT)
+ else if(W.get_tool_quality(TOOL_WRENCH) && user.a_intent != I_HURT)
if(isturf(loc))
anchored = !anchored
diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm
index e378a16a8a..6a2c7b4829 100644
--- a/code/game/objects/items/devices/suit_cooling.dm
+++ b/code/game/objects/items/devices/suit_cooling.dm
@@ -144,7 +144,7 @@
to_chat(user, "You switch \the [src] [on ? "on" : "off"].")
/obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (W.is_screwdriver())
+ if (W.get_tool_quality(TOOL_SCREWDRIVER))
if(cover_open)
cover_open = 0
to_chat(user, "You screw the panel into place.")
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index 011a3338d6..55bbb1b082 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -408,10 +408,10 @@
/obj/item/device/tape/attackby(obj/item/I, mob/user, params)
- if(ruined && I.is_screwdriver())
+ if(ruined && I.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You start winding the tape back in...")
playsound(src, I.usesound, 50, 1)
- if(do_after(user, 120 * I.toolspeed, target = src))
+ if(do_after(user, 120 * I.get_tool_speed(TOOL_SCREWDRIVER), target = src))
to_chat(user, "You wound the tape back in.")
fix()
return
diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm
index a336326845..c5dc090e1b 100644
--- a/code/game/objects/items/stacks/nanopaste.dm
+++ b/code/game/objects/items/stacks/nanopaste.dm
@@ -6,7 +6,7 @@
icon_state = "nanopaste"
origin_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3)
amount = 10
- toolspeed = 0.75 //Used in surgery, shouldn't be the same speed as a normal screwdriver on mechanical organ repair.
+ tool_qualities = list(TOOL_NANOPASTE = TOOL_QUALITY_STANDARD) //Used in surgery, shouldn't be the same speed as a normal screwdriver on mechanical organ repair.
w_class = ITEMSIZE_SMALL
no_variants = FALSE
@@ -16,7 +16,7 @@
if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
var/mob/living/silicon/robot/R = M
if (R.getBruteLoss() || R.getFireLoss())
- if(do_after(user,7 * toolspeed))
+ if(do_after(user,7 * get_tool_speed(TOOL_NANOPASTE)))
R.adjustBruteLoss(-15)
R.adjustFireLoss(-15)
R.updatehealth()
@@ -45,13 +45,13 @@
if (S && (S.robotic >= ORGAN_ROBOT))
if(!S.get_damage())
- user << "Nothing to fix here."
+ to_chat(user, "Nothing to fix here.")
else if(can_use(1))
user.setClickCooldown(user.get_attack_speed(src))
if(S.open >= 2)
- if(do_after(user,5 * toolspeed))
+ if(do_after(user,5 * get_tool_speed(TOOL_NANOPASTE)))
S.heal_damage(20, 20, robo_repair = 1)
- else if(do_after(user,5 * toolspeed))
+ else if(do_after(user,5 * get_tool_speed(TOOL_NANOPASTE)))
S.heal_damage(10,10, robo_repair =1)
H.updatehealth()
use(1)
diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm
index e29c80eaea..f6c4fc2c52 100644
--- a/code/game/objects/items/toys/toys.dm
+++ b/code/game/objects/items/toys/toys.dm
@@ -750,7 +750,7 @@
opened = FALSE
return
- if(is_sharp(I) && !opened)
+ if(I.sharp && !opened)
to_chat(user, "You open a small incision in [src]. You can place tiny items inside.")
opened = TRUE
return
@@ -871,7 +871,7 @@
opened = FALSE
return
- if(is_sharp(I) && !opened)
+ if(I.sharp && !opened)
to_chat(user, "You open a small incision in [src]. You can place tiny items inside.")
opened = TRUE
return
diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm
index 6b9cbdd4a3..12cfb2ec24 100644
--- a/code/game/objects/items/uav.dm
+++ b/code/game/objects/items/uav.dm
@@ -99,7 +99,7 @@
visible_message("[user] pairs [I] to [nickname]")
toggle_pairing()
- else if(I.is_screwdriver() && cell)
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER) && cell)
if(do_after(user, 3 SECONDS, src))
to_chat(user, "You remove [cell] into [nickname].")
playsound(src, I.usesound, 50, 1)
diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm
index c6e2cb4d41..1626827153 100644
--- a/code/game/objects/items/weapons/RCD.dm
+++ b/code/game/objects/items/weapons/RCD.dm
@@ -17,6 +17,7 @@
matter = list(MAT_STEEL = 50000)
preserve_item = TRUE // RCDs are pretty important.
var/datum/effect_system/spark_spread/spark_system
+ var/toolspeed = 1
var/stored_matter = 0
var/max_stored_matter = RCD_MAX_CAPACITY
var/ranged = FALSE
diff --git a/code/game/objects/items/weapons/augment_items.dm b/code/game/objects/items/weapons/augment_items.dm
index c0df9c9688..d40db30c70 100644
--- a/code/game/objects/items/weapons/augment_items.dm
+++ b/code/game/objects/items/weapons/augment_items.dm
@@ -32,6 +32,6 @@
force = 30
armor_penetration = 15
edge = 1
- pry = 1
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_STANDARD)
defend_chance = 40
projectile_parry_chance = 20
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm
index 791cd51cdc..58ff2a0b23 100644
--- a/code/game/objects/items/weapons/circuitboards/computer/research.dm
+++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm
@@ -7,7 +7,7 @@
build_path = /obj/machinery/computer/rdconsole/core
/obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, I.usesound, 50, 1)
user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.")
if(build_path == /obj/machinery/computer/rdconsole/core)
diff --git a/code/game/objects/items/weapons/circuitboards/frame.dm b/code/game/objects/items/weapons/circuitboards/frame.dm
index 612047cc7c..4968e0f830 100644
--- a/code/game/objects/items/weapons/circuitboards/frame.dm
+++ b/code/game/objects/items/weapons/circuitboards/frame.dm
@@ -167,6 +167,7 @@
/obj/item/weapon/reagent_containers/glass/beaker/large = 1)
/obj/item/weapon/circuitboard/distiller
+ name = T_BOARD("distillery")
build_path = /obj/machinery/portable_atmospherics/powered/reagent_distillery
board_type = new /datum/frame/frame_types/reagent_distillery
req_components = list(
@@ -178,7 +179,7 @@
/obj/item/weapon/circuitboard/teleporter_hub
name = T_BOARD("teleporter hub")
build_path = /obj/machinery/teleport/hub
- board_type = "teleporter_hub"
+ board_type = new /datum/frame/frame_types/teleporter_hub
// origin_tech = list(TECH_DATA = 2, TECH_BLUESPACE = 4)
req_components = list(
/obj/item/weapon/stock_parts/scanning_module = 4,
@@ -188,7 +189,7 @@
/obj/item/weapon/circuitboard/teleporter_station
name = T_BOARD("teleporter station")
build_path = /obj/machinery/teleport/station
- board_type = "teleporter_station"
+ board_type = new /datum/frame/frame_types/teleporter_hub
// origin_tech = list(TECH_DATA = 2, TECH_BLUESPACE = 3)
req_components = list(
/obj/item/weapon/stock_parts/console_screen = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm
index 02dfbd6354..017dea03d1 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm
@@ -12,7 +12,7 @@
/obj/item/weapon/stock_parts/scanning_module = 1)
/obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, I.usesound, 50, 1)
user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.")
if(build_path == /obj/machinery/r_n_d/server/core)
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index f1f6e85bb3..75411925a8 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -29,14 +29,15 @@
return ..()
/obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
open_panel = !open_panel
to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.")
playsound(src, I.usesound, 50, 1)
- else if(I.is_wirecutter() || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler ))
+ return TRUE
+ else if(I.get_tool_quality(TOOL_WIRECUTTER) || I.get_tool_quality(TOOL_MULTITOOL) || istype(I, /obj/item/device/assembly/signaler ))
wires.Interact(user)
- else
- ..()
+ return TRUE
+ return ..()
/obj/item/weapon/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 60098a4f3f..94d1a25ebc 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -69,7 +69,7 @@
/obj/item/weapon/flamethrower/attackby(obj/item/W as obj, mob/user as mob)
if(user.stat || user.restrained() || user.lying) return
- if(W.is_wrench() && !status)//Taking this apart
+ if(W.get_tool_quality(TOOL_WRENCH) && !status)//Taking this apart
var/turf/T = get_turf(src)
if(weldtool)
weldtool.loc = T
@@ -84,7 +84,7 @@
qdel(src)
return
- if(W.is_screwdriver() && igniter && !lit)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER) && igniter && !lit)
status = !status
to_chat(user, "[igniter] is now [status ? "secured" : "unsecured"]!")
update_icon()
diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm
index 862453693c..8d40f73536 100644
--- a/code/game/objects/items/weapons/gift_wrappaper.dm
+++ b/code/game/objects/items/weapons/gift_wrappaper.dm
@@ -49,7 +49,7 @@
/obj/effect/spresent/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
- if (!W.is_wirecutter())
+ if (!W.get_tool_quality(TOOL_WIRECUTTER))
to_chat(user, "I need wirecutters for that.")
return
@@ -135,7 +135,7 @@
to_chat(user, "You MUST put the paper on a table!")
if (W.w_class < ITEMSIZE_LARGE)
var/obj/item/I = user.get_inactive_hand()
- if(I.is_wirecutter())
+ if(I.get_tool_quality(TOOL_WIRECUTTER))
var/a_used = 2 ** (src.w_class - 1)
if (src.amount < a_used)
to_chat(user, "You need more paper!")
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index 4997e30723..6ddce6af21 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -76,7 +76,7 @@
icon_state = initial(icon_state) +"_ass"
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
stage = 1
- else if(W.is_screwdriver() && path != 2)
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && path != 2)
if(stage == 1)
path = 1
if(beakers.len)
diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm
index 209e47b253..159af97c80 100644
--- a/code/game/objects/items/weapons/grenades/grenade.dm
+++ b/code/game/objects/items/weapons/grenades/grenade.dm
@@ -90,7 +90,7 @@
/obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
switch(det_time)
if (1)
det_time = 10
diff --git a/code/game/objects/items/weapons/implants/implantcircuits.dm b/code/game/objects/items/weapons/implants/implantcircuits.dm
index 033ad2c4b1..58919ea3b1 100644
--- a/code/game/objects/items/weapons/implants/implantcircuits.dm
+++ b/code/game/objects/items/weapons/implants/implantcircuits.dm
@@ -39,7 +39,7 @@
return IC.examine(user)
/obj/item/weapon/implant/integrated_circuit/attackby(var/obj/item/O, var/mob/user)
- if(O.is_crowbar() || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.is_screwdriver() || istype(O, /obj/item/weapon/cell/device) )
+ if(O.get_tool_quality(TOOL_CROWBAR) || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.get_tool_quality(TOOL_SCREWDRIVER) || istype(O, /obj/item/weapon/cell/device) )
IC.attackby(O, user)
else
..()
diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm
index 928a7c1a5d..922908f443 100644
--- a/code/game/objects/items/weapons/improvised_components.dm
+++ b/code/game/objects/items/weapons/improvised_components.dm
@@ -7,7 +7,7 @@
thrown_force_divisor = 0.1
/obj/item/weapon/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You finish the concealed blade weapon.")
playsound(src, W.usesound, 50, 1)
new /obj/item/weapon/material/butterfly(user.loc, material.name)
diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm
index d3c615e8fd..77bfd6a6b4 100644
--- a/code/game/objects/items/weapons/material/gravemarker.dm
+++ b/code/game/objects/items/weapons/material/gravemarker.dm
@@ -12,24 +12,24 @@
var/epitaph = "" //A quick little blurb
/obj/item/weapon/material/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN)
if(carving_1)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
- if(do_after(user, material.hardness * W.toolspeed))
+ if(do_after(user, material.hardness * W.get_tool_speed(TOOL_SCREWDRIVER)))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
grave_name += carving_1
update_icon()
var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN)
if(carving_2)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
- if(do_after(user, material.hardness * W.toolspeed))
+ if(do_after(user, material.hardness * W.get_tool_speed(TOOL_SCREWDRIVER)))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
epitaph += carving_2
update_icon()
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
- if(do_after(user, material.hardness * W.toolspeed))
+ if(do_after(user, material.hardness * W.get_tool_speed(TOOL_WRENCH)))
material.place_dismantled_product(get_turf(src))
user.visible_message("[user] dismantles down \the [src.name].", "You dismantle \the [src.name].")
qdel(src)
diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm
index 08fbb4f348..69fceb008c 100644
--- a/code/game/objects/items/weapons/material/kitchen.dm
+++ b/code/game/objects/items/weapons/material/kitchen.dm
@@ -97,9 +97,11 @@
icon_state = "fork"
sharp = TRUE
edge = FALSE
+ tool_qualities = list(TOOL_SCREWDRIVER = TOOL_QUALITY_WORST) // Really bad, but in a pinch...
/obj/item/weapon/material/kitchen/utensil/fork/plastic
default_material = "plastic"
+ tool_qualities = list()
/obj/item/weapon/material/kitchen/utensil/foon
name = "foon"
diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm
index 17cf512927..957c3f3304 100644
--- a/code/game/objects/items/weapons/material/knives.dm
+++ b/code/game/objects/items/weapons/material/knives.dm
@@ -152,4 +152,4 @@
icon_state = "survivalknife"
item_state = "knife"
applies_material_colour = FALSE
- toolspeed = 2 // Use a real axe if you want to chop logs.
+ tool_qualities = list(TOOL_WOODCUT = TOOL_QUALITY_POOR) // Use a real axe if you want to chop logs.
diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm
index ab65a03c97..d6a57a1dea 100644
--- a/code/game/objects/items/weapons/material/material_weapons.dm
+++ b/code/game/objects/items/weapons/material/material_weapons.dm
@@ -119,9 +119,8 @@
T.visible_message("\The [src] goes dull!")
playsound(src, "shatter", 70, 1)
dulled = 1
- if(is_sharp() || has_edge())
- sharp = 0
- edge = 0
+ sharp = 0
+ edge = 0
/obj/item/weapon/material/proc/repair(var/repair_amount, var/repair_time, mob/living/user)
if(!fragile)
diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm
index 5ca8091ab6..1d7bf340bd 100644
--- a/code/game/objects/items/weapons/material/twohanded.dm
+++ b/code/game/objects/items/weapons/material/twohanded.dm
@@ -105,13 +105,13 @@
var/mob/living/M = loc
if(istype(M) && !issmall(M) && M.item_is_in_hands(src) && !M.hands_are_full())
wielded = 1
- pry = 1
+ tool_qualities[TOOL_CROWBAR] = TOOL_QUALITY_DECENT
force = force_wielded
name = "[base_name] (wielded)"
update_icon()
else
wielded = 0
- pry = 0
+ tool_qualities[TOOL_CROWBAR] = TOOL_QUALITY_NONE
force = force_unwielded
name = "[base_name]"
update_icon()
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index 8471d6b4e1..8634d5ac57 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -147,7 +147,7 @@
update_icon()
else
to_chat(user, "[src] already has a cell.")
- else if(W.is_screwdriver() && bcell)
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && bcell)
bcell.update_icon()
bcell.forceMove(get_turf(loc))
bcell = null
diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm
index 0032123655..66879552dc 100644
--- a/code/game/objects/items/weapons/policetape.dm
+++ b/code/game/objects/items/weapons/policetape.dm
@@ -5,8 +5,6 @@
icon_state = "tape"
w_class = ITEMSIZE_SMALL
- toolspeed = 3 //You can use it in surgery. It's stupid, but you can.
-
var/turf/start
var/turf/end
var/tape_type = /obj/item/tape
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index 6333b66126..3cbcb0f130 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -84,7 +84,7 @@
//to strong bullets and lasers. They still do fine to pistol rounds of all kinds, however.
if(istype(damage_source, /obj/item/projectile))
var/obj/item/projectile/P = damage_source
- if((is_sharp(P) && P.armor_penetration >= 10) || istype(P, /obj/item/projectile/beam))
+ if((P.sharp && P.armor_penetration >= 10) || istype(P, /obj/item/projectile/beam))
//If we're at this point, the bullet/beam is going to go through the shield, however it will hit for less damage.
//Bullets get slowed down, while beams are diffused as they hit the shield, so these shields are not /completely/
//useless. Extremely penetrating projectiles will go through the shield without less damage.
@@ -149,7 +149,7 @@
/obj/item/weapon/shield/energy/get_block_chance(mob/user, var/damage, atom/damage_source = null, mob/attacker = null)
if(istype(damage_source, /obj/item/projectile))
var/obj/item/projectile/P = damage_source
- if((is_sharp(P) && damage > 10) || istype(P, /obj/item/projectile/beam))
+ if((P.sharp && damage > 10) || istype(P, /obj/item/projectile/beam))
return (base_block_chance - round(damage / 3)) //block bullets and beams using the old block chance
return base_block_chance
diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm
index 10a7407f0b..582acb3527 100644
--- a/code/game/objects/items/weapons/storage/belt.dm
+++ b/code/game/objects/items/weapons/storage/belt.dm
@@ -110,8 +110,8 @@
/obj/item/weapon/storage/belt/utility/chief/full
starts_with = list(
- /obj/item/weapon/tool/screwdriver/power,
- /obj/item/weapon/tool/crowbar/power,
+ /obj/item/weapon/tool/powerdrill,
+ /obj/item/weapon/tool/hydraulic_cutter,
/obj/item/weapon/weldingtool/experimental,
/obj/item/device/multitool,
/obj/item/stack/cable_coil/random_belt,
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index afabc37df2..a9de35b444 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -43,8 +43,8 @@
playsound(src, "sparks", 50, 1)
return
- if (W.is_screwdriver())
- if (do_after(user, 20 * W.toolspeed))
+ if (W.get_tool_quality(TOOL_SCREWDRIVER))
+ if (do_after(user, 20 * W.get_tool_speed(TOOL_SCREWDRIVER)))
src.open =! src.open
playsound(src, W.usesound, 50, 1)
user.show_message(text("You [] the service panel.", (src.open ? "open" : "close")))
diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm
index e62ac35ea8..22580b9e3b 100644
--- a/code/game/objects/items/weapons/storage/toolbox.dm
+++ b/code/game/objects/items/weapons/storage/toolbox.dm
@@ -86,9 +86,9 @@
/obj/item/weapon/storage/toolbox/syndicate/powertools
starts_with = list(
/obj/item/clothing/gloves/yellow,
- /obj/item/weapon/tool/screwdriver/power,
+ /obj/item/weapon/tool/powerdrill,
/obj/item/weapon/weldingtool/experimental,
- /obj/item/weapon/tool/crowbar/power,
+ /obj/item/weapon/tool/hydraulic_cutter,
/obj/item/device/multitool,
/obj/item/stack/cable_coil/random_belt,
/obj/item/device/analyzer
diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm
index 324fb93dd8..261e222a34 100644
--- a/code/game/objects/items/weapons/storage/uplink_kits.dm
+++ b/code/game/objects/items/weapons/storage/uplink_kits.dm
@@ -328,7 +328,7 @@
description_antag = "This case will likely contain a charged fuel rod gun, and a few fuel rods to go with it. It can only hold the fuel rod gun, fuel rods, batteries, a screwdriver, and stock machine parts."
force = 12 //Anti-rad lined i.e. Lead, probably gonna hurt a bit if you get bashed with it.
can_hold = list(/obj/item/weapon/gun/magnetic/fuelrod, /obj/item/weapon/fuel_assembly, /obj/item/weapon/cell, /obj/item/weapon/stock_parts, /obj/item/weapon/tool/screwdriver)
- cant_hold = list(/obj/item/weapon/tool/screwdriver/power)
+ cant_hold = list(/obj/item/weapon/tool/powerdrill)
starts_with = list(
/obj/item/weapon/gun/magnetic/fuelrod,
/obj/item/weapon/fuel_assembly/deuterium,
diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm
index c92f122547..bc58288afc 100644
--- a/code/game/objects/items/weapons/storage/wallets.dm
+++ b/code/game/objects/items/weapons/storage/wallets.dm
@@ -38,7 +38,7 @@
/obj/item/clothing/accessory/badge,
/obj/item/weapon/makeover
)
- cant_hold = list(/obj/item/weapon/tool/screwdriver/power)
+ cant_hold = list(/obj/item/weapon/tool/powerdrill)
slot_flags = SLOT_ID
var/obj/item/weapon/card/id/front_id = null
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 31c260c730..4e540d29e3 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -33,6 +33,7 @@
matter = list(MAT_STEEL = 10000, "glass" = 5000)
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
drop_sound = 'sound/items/drop/scrap.ogg'
+ tool_qualities = list(TOOL_RETRACTOR = TOOL_QUALITY_STANDARD)
/*
* Hemostat
@@ -45,6 +46,7 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("attacked", "pinched")
drop_sound = 'sound/items/drop/scrap.ogg'
+ tool_qualities = list(TOOL_HEMOSTAT = TOOL_QUALITY_STANDARD)
/*
* Cautery
@@ -57,6 +59,7 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("burnt")
drop_sound = 'sound/items/drop/scrap.ogg'
+ tool_qualities = list(TOOL_CAUTERY = TOOL_QUALITY_STANDARD)
/*
* Surgical Drill
@@ -72,6 +75,7 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("drilled")
drop_sound = 'sound/items/drop/accessory.ogg'
+ tool_qualities = list(TOOL_SDRILL = TOOL_QUALITY_STANDARD)
/*
* Scalpel
@@ -92,6 +96,7 @@
matter = list(MAT_STEEL = 10000, "glass" = 5000)
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
drop_sound = 'sound/items/drop/knife.ogg'
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_STANDARD)
/*
* Researchable Scalpels
@@ -101,6 +106,7 @@
desc = "A scalpel augmented with a directed laser, for more precise cutting without blood entering the field. This one looks basic and could be improved."
icon_state = "scalpel_laser1_on"
damtype = "fire"
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/scalpel/laser2
name = "laser scalpel"
@@ -108,6 +114,7 @@
icon_state = "scalpel_laser2_on"
damtype = "fire"
force = 12.0
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_GOOD)
/obj/item/weapon/surgical/scalpel/laser3
name = "laser scalpel"
@@ -115,12 +122,9 @@
icon_state = "scalpel_laser3_on"
damtype = "fire"
force = 15.0
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_BEST)
+
-/obj/item/weapon/surgical/scalpel/manager
- name = "incision management system"
- desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision allowing for the immediate commencement of therapeutic steps."
- icon_state = "scalpel_manager_on"
- force = 7.5
/obj/item/weapon/surgical/scalpel/ripper
name = "organ pincers"
@@ -128,9 +132,25 @@
icon_state = "organ_ripper"
item_state = "bone_setter"
force = 15.0
- toolspeed = 0.75
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_DECENT)
origin_tech = list(TECH_MATERIAL = 5, TECH_BIO = 3, TECH_ILLEGAL = 2)
+/*
+ * Incision management:
+ * Circ saw, scalpel, retractor, and hemostat
+ */
+/obj/item/weapon/surgical/manager
+ name = "incision management system"
+ desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision allowing for the immediate commencement of therapeutic steps."
+ icon_state = "scalpel_manager_on"
+ force = 7.5
+ tool_qualities = list(
+ TOOL_SCALPEL = TOOL_QUALITY_GOOD,
+ TOOL_CSAW = TOOL_QUALITY_GOOD,
+ TOOL_RETRACTOR = TOOL_QUALITY_GOOD,
+ TOOL_HEMOSTAT = TOOL_QUALITY_GOOD
+ )
+
/*
* Circular Saw
*/
@@ -150,6 +170,7 @@
attack_verb = list("attacked", "slashed", "sawed", "cut")
sharp = 1
edge = 1
+ tool_qualities = list(TOOL_CSAW = TOOL_QUALITY_STANDARD)
/obj/item/weapon/surgical/circular_saw/manager
name = "energetic bone diverter"
@@ -162,7 +183,7 @@
origin_tech = list(TECH_BIO = 4, TECH_MATERIAL = 6, TECH_MAGNET = 6)
matter = list(MAT_STEEL = 12500)
attack_verb = list("attacked", "slashed", "seared", "cut")
- toolspeed = 0.75
+ tool_qualities = list(TOOL_CSAW = TOOL_QUALITY_GOOD)
//misc, formerly from code/defines/weapons.dm
/obj/item/weapon/surgical/bonegel
@@ -172,6 +193,7 @@
force = 0
throwforce = 1.0
drop_sound = 'sound/items/drop/bottle.ogg'
+ tool_qualities = list(TOOL_BONEGEL = TOOL_QUALITY_STANDARD)
/obj/item/weapon/surgical/FixOVein
name = "FixOVein"
@@ -182,6 +204,7 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 3)
var/usage_amount = 10
drop_sound = 'sound/items/drop/accessory.ogg'
+ tool_qualities = list(TOOL_FIXVEIN = TOOL_QUALITY_STANDARD)
/obj/item/weapon/surgical/bonesetter
name = "bone setter"
@@ -193,6 +216,7 @@
throw_range = 5
attack_verb = list("attacked", "hit", "bludgeoned")
drop_sound = 'sound/items/drop/scrap.ogg'
+ tool_qualities = list(TOOL_BONESET = TOOL_QUALITY_STANDARD)
/obj/item/weapon/surgical/bone_clamp
name = "bone clamp"
@@ -203,66 +227,68 @@
throw_speed = 3
throw_range = 5
attack_verb = list("attacked", "hit", "bludgeoned")
+ tool_qualities = list(TOOL_BONECLAMP = TOOL_QUALITY_STANDARD)
// Cyborg Tools
/obj/item/weapon/surgical/retractor/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_RETRACTOR = TOOL_QUALITY_DECENT)
+
/obj/item/weapon/surgical/hemostat/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_HEMOSTAT = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/cautery/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_CAUTERY = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/surgicaldrill/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_SDRILL = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/scalpel/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/circular_saw/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_CSAW = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/bonegel/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_BONEGEL = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/FixOVein/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_FIXVEIN = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/bonesetter/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_BONESET = TOOL_QUALITY_DECENT)
// Alien Tools
/obj/item/weapon/surgical/retractor/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_RETRACTOR = TOOL_QUALITY_GOOD)
/obj/item/weapon/surgical/hemostat/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_HEMOSTAT = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/cautery/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_CAUTERY = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/surgicaldrill/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_SDRILL = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/scalpel/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_SCALPEL = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/circular_saw/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_CSAW = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/FixOVein/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.25
+ tool_qualities = list(TOOL_FIXVEIN = TOOL_QUALITY_DECENT)
/obj/item/weapon/surgical/bone_clamp/alien
icon = 'icons/obj/abductor.dmi'
- toolspeed = 0.75
+ tool_qualities = list(TOOL_BONECLAMP = TOOL_QUALITY_DECENT)
diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm
index c88f2ada6a..6f8b0b8640 100644
--- a/code/game/objects/items/weapons/syndie.dm
+++ b/code/game/objects/items/weapons/syndie.dm
@@ -107,7 +107,7 @@
/obj/item/weapon/flame/lighter/zippo/c4detonator/attackby(obj/item/weapon/W, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
detonator_mode = !detonator_mode
playsound(src, W.usesound, 50, 1)
to_chat(user, "You unscrew the top panel of \the [src] revealing a button.")
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index d19539f29a..af2414da00 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -133,7 +133,7 @@ var/list/global/tank_gauge_cache = list()
to_chat(user, "You attach the wires to the tank.")
src.add_bomb_overlay()
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
if(wired && src.proxyassembly.assembly)
to_chat(user, "You carefully begin clipping the wires that attach to the tank.")
diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm
index b8a9c87416..a745905fe2 100644
--- a/code/game/objects/items/weapons/tape.dm
+++ b/code/game/objects/items/weapons/tape.dm
@@ -7,8 +7,6 @@
drop_sound = 'sound/items/drop/cardboardbox.ogg'
pickup_sound = 'sound/items/pickup/cardboardbox.ogg'
- toolspeed = 2 //It is now used in surgery as a not awful, but probably dangerous option, due to speed.
-
/obj/item/weapon/tape_roll/proc/can_place(var/mob/living/carbon/human/H, var/mob/user)
if(istype(user, /mob/living/silicon/robot) || user == H)
return TRUE
@@ -16,7 +14,6 @@
for (var/obj/item/weapon/grab/G in H.grabbed_by)
if (G.loc == user && G.state >= GRAB_AGGRESSIVE)
return TRUE
-
return FALSE
/obj/item/weapon/tape_roll/attack(var/mob/living/carbon/human/H, var/mob/user)
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index fa1da2b35d..f765eeef0f 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -244,7 +244,7 @@
var/inc_damage = W.force
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
if(!shock(user, 100, pick(BP_L_HAND, BP_R_HAND)))
playsound(src, W.usesound, 100, 1)
inc_damage *= 3
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 9442f762e5..fee3cf829b 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -10,7 +10,6 @@
var/catchable = 1 // can it be caught on throws/flying?
var/sharp = 0 // whether this object cuts
var/edge = 0 // whether this object is more likely to dismember
- var/pry = 0 //Used in attackby() to open doors
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
var/damtype = "brute"
var/armor_penetration = 0
diff --git a/code/game/objects/random/misc.dm b/code/game/objects/random/misc.dm
index b347dcd021..21179e8af6 100644
--- a/code/game/objects/random/misc.dm
+++ b/code/game/objects/random/misc.dm
@@ -25,8 +25,8 @@
/obj/random/tool/powermaint/item_to_spawn()
return pick(prob(320);/obj/random/tool,
- prob(1);/obj/item/weapon/tool/screwdriver/power,
- prob(1);/obj/item/weapon/tool/wirecutters/power,
+ prob(1);/obj/item/weapon/tool/powerdrill,
+ prob(1);/obj/item/weapon/tool/hydraulic_cutter,
prob(15);/obj/item/weapon/weldingtool/electric,
prob(5);/obj/item/weapon/weldingtool/experimental)
@@ -36,8 +36,8 @@
icon_state = "tool_2"
/obj/random/tool/power/item_to_spawn()
- return pick(/obj/item/weapon/tool/screwdriver/power,
- /obj/item/weapon/tool/wirecutters/power,
+ return pick(/obj/item/weapon/tool/powerdrill,
+ /obj/item/weapon/tool/hydraulic_cutter,
/obj/item/weapon/weldingtool/electric,
/obj/item/weapon/weldingtool/experimental)
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index 29498bb2df..bcfa245521 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -29,7 +29,7 @@ LINEN BINS
return
/obj/item/weapon/bedsheet/attackby(obj/item/I, mob/user)
- if(is_sharp(I))
+ if(I.sharp)
user.visible_message("\The [user] begins cutting up [src] with [I].", "You begin cutting up [src] with [I].")
if(do_after(user, 50))
to_chat(user, "You cut [src] into pieces!")
diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm
index 147a5dc38f..9ee69a6121 100644
--- a/code/game/objects/structures/catwalk.dm
+++ b/code/game/objects/structures/catwalk.dm
@@ -83,7 +83,7 @@
if(WT.isOn() && WT.remove_fuel(0, user))
deconstruct(user)
return
- if(C.is_crowbar() && plated_tile)
+ if(C.get_tool_quality(TOOL_CROWBAR) && plated_tile)
hatch_open = !hatch_open
if(hatch_open)
playsound(src, 'sound/items/Crowbar.ogg', 100, 2)
diff --git a/code/game/objects/structures/crates_lockers/__closets.dm b/code/game/objects/structures/crates_lockers/__closets.dm
index 96cd5bacf3..ff2a1a3f70 100644
--- a/code/game/objects/structures/crates_lockers/__closets.dm
+++ b/code/game/objects/structures/crates_lockers/__closets.dm
@@ -277,13 +277,13 @@
return
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(opened)
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
- if(do_after(user, 20 * W.toolspeed))
+ if(do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
if(!src) return
to_chat(user, "You [anchored? "un" : ""]secured \the [src]!")
anchored = !anchored
@@ -332,7 +332,7 @@
else if(seal_tool)
if(istype(W, seal_tool))
var/obj/item/weapon/S = W
- if(istype(S, /obj/item/weapon/weldingtool))
+ if(S.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = S
if(!WT.remove_fuel(0,user))
if(!WT.isOn())
@@ -340,7 +340,7 @@
else
to_chat(user, "You need more welding fuel to complete this task.")
return
- if(do_after(user, 20 * S.toolspeed))
+ if(do_after(user, 20 * S.get_tool_speed(TOOL_WELDER)))
playsound(src, S.usesound, 50)
sealed = !sealed
update_icon()
diff --git a/code/game/objects/structures/crates_lockers/closets/coffin.dm b/code/game/objects/structures/crates_lockers/closets/coffin.dm
index ce1e7cfe5e..add694a38d 100644
--- a/code/game/objects/structures/crates_lockers/closets/coffin.dm
+++ b/code/game/objects/structures/crates_lockers/closets/coffin.dm
@@ -68,11 +68,11 @@
/obj/structure/closet/grave/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(src.opened)
- if(istype(W, /obj/item/weapon/shovel))
+ if(W.get_tool_quality(TOOL_SHOVEL))
user.visible_message("[user] piles dirt into \the [src.name].", \
"You start to pile dirt into \the [src.name].", \
"You hear dirt being moved.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_SHOVEL)))
user.visible_message("[user] pats down the dirt on top of \the [src.name].", \
"You finish filling in \the [src.name].")
close()
@@ -104,12 +104,12 @@
if(W)
W.forceMove(src.loc)
else
- if(istype(W, /obj/item/weapon/shovel))
+ if(W.get_tool_quality(TOOL_SHOVEL))
if(user.a_intent == I_HURT) // Hurt intent means you're trying to kill someone, or just get rid of the grave
user.visible_message("[user] begins to smoothe out the dirt of \the [src.name].", \
"You start to smoothe out the dirt of \the [src.name].", \
"You hear dirt being moved.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_SHOVEL)))
user.visible_message("[user] finishes smoothing out \the [src.name].", \
"You finish smoothing out \the [src.name].")
if(LAZYLEN(contents))
@@ -125,7 +125,7 @@
user.visible_message("[user] begins to unearth \the [src.name].", \
"You start to unearth \the [src.name].", \
"You hear dirt being moved.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_SHOVEL)))
user.visible_message("[user] reaches the bottom of \the [src.name].", \
"You finish digging out \the [src.name].")
break_open()
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
index 2ef01e01a4..0e05e4ba0c 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
@@ -54,13 +54,13 @@
to_chat(user, "Access Denied")
/obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(opened)
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
- if(do_after(user, 20 * W.toolspeed))
+ if(do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
if(!src) return
to_chat(user, "You [anchored? "un" : ""]secured \the [src]!")
anchored = !anchored
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 539656d4c2..e28a57eda6 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -113,7 +113,7 @@
user.drop_item()
W.forceMove(src)
return
- else if(W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_WIRECUTTER))
if(rigged)
to_chat(user , "You cut away the wiring.")
playsound(src, W.usesound, 100, 1)
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index 3485b31505..e3846130df 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -25,7 +25,7 @@
var/turf/T = get_turf(src)
if(!T)
to_chat(user, "You can't open this here!")
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
new /obj/item/stack/material/wood(src)
for(var/atom/movable/AM in contents)
@@ -48,7 +48,7 @@
icon_state = "vehiclecrate"
/obj/structure/largecrate/hoverpod/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
var/obj/item/mecha_parts/mecha_equipment/ME
var/obj/mecha/working/hoverpod/H = new (loc)
diff --git a/code/game/objects/structures/crates_lockers/vehiclecage.dm b/code/game/objects/structures/crates_lockers/vehiclecage.dm
index b98636eb16..f12fe71b9f 100644
--- a/code/game/objects/structures/crates_lockers/vehiclecage.dm
+++ b/code/game/objects/structures/crates_lockers/vehiclecage.dm
@@ -31,11 +31,11 @@
var/turf/T = get_turf(src)
if(!T)
to_chat(user, "You can't open this here!")
- if(W.is_wrench() && do_after(user, 60 * W.toolspeed, src))
+ if(W.get_tool_quality(TOOL_WRENCH) && do_after(user, 60 * W.get_tool_speed(TOOL_WRENCH), src))
playsound(src, W.usesound, 50, 1)
disassemble(W, user)
user.visible_message("[user] begins loosening \the [src]'s bolts.")
- if(W.is_wirecutter() && do_after(user, 70 * W.toolspeed, src))
+ if(W.get_tool_quality(TOOL_WIRECUTTER) && do_after(user, 70 * W.get_tool_speed(TOOL_WIRECUTTER), src))
playsound(src, W.usesound, 50, 1)
disassemble(W, user)
user.visible_message("[user] begins cutting \the [src]'s bolts.")
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index 9de63fd3d0..20fa02e90d 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -38,7 +38,7 @@
layer = OBJ_LAYER
/obj/structure/curtain/attackby(obj/item/P, mob/user)
- if(P.is_wirecutter())
+ if(P.get_tool_quality(TOOL_WIRECUTTER))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You start to cut the shower curtains.")
if(do_after(user, 10))
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index f303878e02..888ed40b59 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -172,13 +172,13 @@
rename_door(user)
return
- if(istype(W, /obj/item/weapon/weldingtool) && ( (istext(glass)) || (glass == 1) || (!anchored) ))
+ if(W.get_tool_quality(TOOL_WELDER) && ( (istext(glass)) || (glass == 1) || (!anchored) ))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0, user))
playsound(src, WT.usesound, 50, 1)
if(istext(glass))
user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.")
- if(do_after(user, 40 * WT.toolspeed))
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
to_chat(user, "You welded the [glass] plating off!")
var/M = text2path("/obj/item/stack/material/[glass]")
@@ -186,14 +186,14 @@
glass = 0
else if(glass == 1)
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly.")
- if(do_after(user, 40 * WT.toolspeed))
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
to_chat(user, "You welded the glass panel out!")
new /obj/item/stack/material/glass/reinforced(src.loc)
glass = 0
else if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
- if(do_after(user, 40 * WT.toolspeed))
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
to_chat(user, "You dissasembled the airlock assembly!")
new /obj/item/stack/material/steel(src.loc, 4)
@@ -202,19 +202,19 @@
to_chat(user, "You need more welding fuel.")
return
- else if(W.is_wrench() && state == 0)
+ else if(W.get_tool_quality(TOOL_WRENCH) && state == 0)
playsound(src, W.usesound, 100, 1)
if(anchored)
user.visible_message("[user] begins unsecuring the airlock assembly from the floor.", "You starts unsecuring the airlock assembly from the floor.")
else
user.visible_message("[user] begins securing the airlock assembly to the floor.", "You starts securing the airlock assembly to the floor.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
if(!src) return
to_chat(user, "You [anchored? "un" : ""]secured the airlock assembly!")
anchored = !anchored
- else if(istype(W, /obj/item/stack/cable_coil) && state == 0 && anchored)
+ else if(W.get_tool_quality(TOOL_CABLE_COIL) && state == 0 && anchored)
var/obj/item/stack/cable_coil/C = W
if (C.get_amount() < 1)
to_chat(user, "You need one length of coil to wire the airlock assembly.")
@@ -225,11 +225,11 @@
src.state = 1
to_chat(user, "You wire the airlock.")
- else if(W.is_wirecutter() && state == 1 )
+ else if(W.get_tool_quality(TOOL_WIRECUTTER) && state == 1 )
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WIRECUTTER)))
if(!src) return
to_chat(user, "You cut the airlock wires.!")
new/obj/item/stack/cable_coil(src.loc, 1)
@@ -247,7 +247,7 @@
src.state = 2
src.electronics = W
- else if(W.is_crowbar() && state == 2 )
+ else if(W.get_tool_quality(TOOL_CROWBAR) && state == 2 )
//This should never happen, but just in case I guess
if (!electronics)
to_chat(user, "There was nothing to remove.")
@@ -257,7 +257,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("\The [user] starts removing the electronics from the airlock assembly.", "You start removing the electronics from the airlock assembly.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_CROWBAR)))
if(!src) return
to_chat(user, "You removed the airlock electronics!")
src.state = 1
@@ -289,11 +289,11 @@
to_chat(user, "You installed [material_display_name(material_name)] plating into the airlock assembly.")
glass = material_name
- else if(W.is_screwdriver() && state == 2 )
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && state == 2 )
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now finishing the airlock.")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_SCREWDRIVER)))
if(!src) return
to_chat(user, "You finish the airlock!")
var/path
diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm
index ae2f4e3dbc..98c2eaadbd 100644
--- a/code/game/objects/structures/electricchair.dm
+++ b/code/game/objects/structures/electricchair.dm
@@ -12,7 +12,7 @@
return
/obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
var/obj/structure/bed/chair/C = new /obj/structure/bed/chair(loc)
playsound(src, W.usesound, 50, 1)
C.set_dir(dir)
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index c13c471d15..fb0c0818c8 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -29,11 +29,11 @@
to_chat(user, "You place [O] in [src].")
else
opened = !opened
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
if(!has_extinguisher)
to_chat(user, "You start to unwrench the extinguisher cabinet.")
playsound(src, O.usesound, 50, 1)
- if(do_after(user, 15 * O.toolspeed))
+ if(do_after(user, 15 * O.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You unwrench the extinguisher cabinet.")
new /obj/item/frame/extinguisher_cabinet( src.loc )
qdel(src)
diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm
index bf04da9870..b958dbfab6 100644
--- a/code/game/objects/structures/fence.dm
+++ b/code/game/objects/structures/fence.dm
@@ -69,7 +69,7 @@
return ..()
/obj/structure/fence/attackby(obj/item/W, mob/user)
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
if(!cuttable)
to_chat(user, span("warning", "This section of the fence can't be cut."))
return
@@ -85,7 +85,7 @@
span("danger", "You start cutting through \the [src] with \the [W]."))
playsound(src, W.usesound, 50, 1)
- if(do_after(user, CUT_TIME * W.toolspeed, target = src))
+ if(do_after(user, CUT_TIME * W.get_tool_speed(TOOL_WIRECUTTER), target = src))
if(current_stage == hole_size)
switch(++hole_size)
if(MEDIUM_HOLE)
diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm
index f584fd8838..ae3133d278 100644
--- a/code/game/objects/structures/fireaxe.dm
+++ b/code/game/objects/structures/fireaxe.dm
@@ -30,10 +30,10 @@
// hasaxe = 1
if (isrobot(user) || locked)
- if(istype(O, /obj/item/device/multitool))
+ if(O.get_tool_quality(TOOL_MULTITOOL))
to_chat(user, "Resetting circuitry...")
playsound(src, 'sound/machines/lockreset.ogg', 50, 1)
- if(do_after(user, 20 * O.toolspeed))
+ if(do_after(user, 20 * O.get_tool_speed(TOOL_MULTITOOL)))
locked = 0
to_chat(user, " You disable the locking modules.")
update_icon()
@@ -75,7 +75,7 @@
else
if(smashed)
return
- if(istype(O, /obj/item/device/multitool))
+ if(O.get_tool_quality(TOOL_MULTITOOL))
if(open)
open = 0
update_icon()
@@ -84,7 +84,7 @@
else
to_chat(user, "Resetting circuitry...")
playsound(src, 'sound/machines/lockenable.ogg', 50, 1)
- if(do_after(user,20 * O.toolspeed))
+ if(do_after(user,20 * O.get_tool_speed(TOOL_MULTITOOL)))
locked = 1
to_chat(user, " You re-enable the locking modules.")
return
diff --git a/code/game/objects/structures/fitness.dm b/code/game/objects/structures/fitness.dm
index 729e578ba5..2f6dd1da35 100644
--- a/code/game/objects/structures/fitness.dm
+++ b/code/game/objects/structures/fitness.dm
@@ -33,7 +33,7 @@
var/list/qualifiers = list("with ease", "without any trouble", "with great effort")
/obj/structure/fitness/weightlifter/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, 'sound/items/Deconstruct.ogg', 75, 1)
weight = ((weight) % qualifiers.len) + 1
to_chat(user, "You set the machine's weight level to [weight].")
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index 79cbda65e4..090ce620a6 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -145,24 +145,24 @@
reinforce_girder()
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
- if(W.is_wrench() && state == 0)
+ if(W.get_tool_quality(TOOL_WRENCH) && state == 0)
if(anchored && !reinf_material)
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now disassembling the girder...")
- if(do_after(user,(35 + round(max_health/50)) * W.toolspeed))
+ if(do_after(user, (35 + round(max_health/50)) * W.get_tool_speed(TOOL_WRENCH)))
if(!src) return
to_chat(user, "You dissasembled the girder!")
dismantle()
else if(!anchored)
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now securing the girder...")
- if(do_after(user, 40 * W.toolspeed, src))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH), src))
to_chat(user, "You secured the girder!")
reset_girder()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
to_chat(user, "Now slicing apart the girder...")
- if(do_after(user,30 * W.toolspeed))
+ if(do_after(user, 30 * W.get_tool_speed(TOOL_WELDER))) // TODO: Welding tool usage checks
if(!src) return
to_chat(user, "You slice apart the girder!")
dismantle()
@@ -171,11 +171,11 @@
to_chat(user, "You drill through the girder!")
dismantle()
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(state == 2)
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now unsecuring support struts...")
- if(do_after(user,40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_SCREWDRIVER)))
if(!src) return
to_chat(user, "You unsecured the support struts!")
state = 1
@@ -184,20 +184,20 @@
reinforcing = !reinforcing
to_chat(user, "\The [src] can now be [reinforcing? "reinforced" : "constructed"]!")
- else if(W.is_wirecutter() && state == 1)
+ else if(W.get_tool_quality(TOOL_WIRECUTTER) && state == 1)
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now removing support struts...")
- if(do_after(user,40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WIRECUTTER)))
if(!src) return
to_chat(user, "You removed the support struts!")
reinf_material.place_dismantled_product(get_turf(src))
reinf_material = null
reset_girder()
- else if(W.is_crowbar() && state == 0 && anchored)
+ else if(W.get_tool_quality(TOOL_CROWBAR) && state == 0 && anchored)
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now dislodging the girder...")
- if(do_after(user, 40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_CROWBAR)))
if(!src) return
to_chat(user, "You dislodged the girder!")
displace()
@@ -240,7 +240,7 @@
to_chat(user, "You begin adding the plating...")
- if(!do_after(user,40) || !S.use(amount_to_use))
+ if(!do_after(user, 40) || !S.use(amount_to_use))
return 1 //once we've gotten this far don't call parent attackby()
if(anchored)
@@ -274,7 +274,7 @@
return 0
to_chat(user, "Now reinforcing...")
- if (!do_after(user,40) || !S.use(1))
+ if (!do_after(user, 40) || !S.use(1))
return 1 //don't call parent attackby() past this point
to_chat(user, "You added reinforcement!")
@@ -338,16 +338,16 @@
qdel(src)
/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 100, 1)
to_chat(user, "Now disassembling the girder...")
- if(do_after(user,40 * W.toolspeed))
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You dissasembled the girder!")
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
to_chat(user, "Now slicing apart the girder...")
- if(do_after(user,30 * W.toolspeed))
+ if(do_after(user, 30 * W.get_tool_speed(TOOL_WELDER))) // TODO: #8284 welding tool usage
to_chat(user, "You slice apart the girder!")
dismantle()
diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm
index f6d88eb310..96e86a44de 100644
--- a/code/game/objects/structures/gravemarker.dm
+++ b/code/game/objects/structures/gravemarker.dm
@@ -51,25 +51,25 @@
return 1
/obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN)
if(carving_1)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
- if(do_after(user, material.hardness * W.toolspeed))
+ if(do_after(user, material.hardness * W.get_tool_speed(TOOL_SCREWDRIVER)))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
grave_name += carving_1
update_icon()
var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN)
if(carving_2)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
- if(do_after(user, material.hardness * W.toolspeed))
+ if(do_after(user, material.hardness * W.get_tool_speed(TOOL_SCREWDRIVER)))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
epitaph += carving_2
update_icon()
return
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
user.visible_message("[user] starts taking down \the [src.name].", "You start taking down \the [src.name].")
- if(do_after(user, material.hardness * W.toolspeed))
+ if(do_after(user, material.hardness * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message("[user] takes down \the [src.name].", "You take down \the [src.name].")
dismantle()
..()
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 0c91bccfc6..0bb6c51825 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -94,12 +94,12 @@
return
if(istype(W, /obj/item/weapon/rcd)) // To stop us from hitting the grille when building windows, because grilles don't let parent handle it properly.
return FALSE
- else if(W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_WIRECUTTER))
if(!shock(user, 100))
playsound(src, W.usesound, 100, 1)
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
qdel(src)
- else if((W.is_screwdriver()) && (istype(loc, /turf/simulated) || anchored))
+ else if((W.get_tool_quality(TOOL_SCREWDRIVER)) && (istype(loc, /turf/simulated) || anchored))
if(!shock(user, 90))
playsound(src, W.usesound, 100, 1)
anchored = !anchored
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index 69347fb0aa..f964065bbd 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -50,7 +50,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/mop) || istype(I, /obj/item/weapon/reagent_containers/glass/rag) || istype(I, /obj/item/weapon/soap))
- if (mybucket)
+ if(mybucket)
if(I.reagents.total_volume < I.reagents.maximum_volume)
if(mybucket.reagents.total_volume < 1)
to_chat(user, "[mybucket] is empty!")
@@ -62,47 +62,47 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
to_chat(user, "[I] can't absorb anymore liquid!")
else
to_chat(user, "There is no bucket mounted here to dip [I] into!")
- return 1
+ return TRUE
else if (istype(I, /obj/item/weapon/reagent_containers/glass/bucket) && mybucket)
I.afterattack(mybucket, usr, 1)
update_icon()
- return 1
+ return TRUE
else if(istype(I, /obj/item/weapon/reagent_containers/spray) && !myspray)
- user.unEquip(I, 0, src)
+ user.drop_from_inventory(I, src)
myspray = I
update_icon()
updateUsrDialog()
to_chat(user, "You put [I] into [src].")
- return 1
+ return TRUE
else if(istype(I, /obj/item/device/lightreplacer) && !myreplacer)
- user.unEquip(I, 0, src)
+ user.drop_from_inventory(I, src)
myreplacer = I
update_icon()
updateUsrDialog()
to_chat(user, "You put [I] into [src].")
- return 1
+ return TRUE
else if(istype(I, /obj/item/weapon/storage/bag/trash) && !mybag)
- user.unEquip(I, 0, src)
+ user.drop_from_inventory(I, src)
mybag = I
update_icon()
updateUsrDialog()
to_chat(user, "You put [I] into [src].")
- return 1
+ return TRUE
else if(istype(I, /obj/item/clothing/suit/caution))
if(signs < 4)
- user.unEquip(I, 0, src)
+ user.drop_from_inventory(I, src)
signs++
update_icon()
updateUsrDialog()
to_chat(user, "You put [I] into [src].")
else
to_chat(user, "[src] can't hold any more signs.")
- return 1
+ return TRUE
else if(mybag)
return mybag.attackby(I, user)
@@ -110,12 +110,11 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
//This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash
else if (!has_items)
- if (I.is_wrench())
+ if (I.get_tool_quality(TOOL_WRENCH))
if (do_after(user, 5 SECONDS, src))
dismantle(user)
- return
- ..()
-
+ return TRUE
+ return ..()
//New Altclick functionality!
//Altclick the cart with a mop to stow the mop away
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index f6bdcca0b1..83439d7679 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -50,15 +50,15 @@
..()
/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
if(!glass)
playsound(src, I.usesound, 50, 1)
- if(do_after(user, 20 * I.toolspeed))
+ if(do_after(user, 20 * I.get_tool_speed(TOOL_WRENCH)))
to_chat(user, "You unfasten the frame.")
new /obj/item/frame/mirror( src.loc )
qdel(src)
return
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
if(shattered && glass)
to_chat(user, "The broken glass falls out.")
icon_state = "mirror_frame"
diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm
index e90f7392ee..0d929e3ee4 100644
--- a/code/game/objects/structures/musician.dm
+++ b/code/game/objects/structures/musician.dm
@@ -343,11 +343,11 @@
song.interact(user)
/obj/structure/device/piano/attackby(obj/item/O as obj, mob/user as mob)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
if(anchored)
playsound(src, O.usesound, 50, 1)
to_chat(user, "You begin to loosen \the [src]'s casters...")
- if (do_after(user, 40 * O.toolspeed))
+ if (do_after(user, 40 * O.get_tool_speed(TOOL_WRENCH)))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
"You have loosened \the [src]. Now it can be pulled somewhere else.", \
@@ -356,7 +356,7 @@
else
playsound(src, O.usesound, 50, 1)
to_chat(user, "You begin to tighten \the [src] to the floor...")
- if (do_after(user, 20 * O.toolspeed))
+ if (do_after(user, 20 * O.get_tool_speed(TOOL_WRENCH)))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
"You have tightened \the [src]'s casters. Now it can be played again.", \
diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm
index d655581c92..ae173178f0 100644
--- a/code/game/objects/structures/plasticflaps.dm
+++ b/code/game/objects/structures/plasticflaps.dm
@@ -17,10 +17,10 @@
)
/obj/structure/plasticflaps/attackby(obj/item/P, mob/user)
- if(P.is_wirecutter())
+ if(P.get_tool_quality(TOOL_WIRECUTTER))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You start to cut the plastic flaps.")
- if(do_after(user, 10 * P.toolspeed))
+ if(do_after(user, 10 * P.get_tool_speed(TOOL_WIRECUTTER)))
to_chat(user, "You cut the plastic flaps.")
var/obj/item/stack/material/plastic/A = new /obj/item/stack/material/plastic( src.loc )
A.amount = 4
diff --git a/code/game/objects/structures/props/puzzledoor.dm b/code/game/objects/structures/props/puzzledoor.dm
index f5ec2fe7cb..05af02e984 100644
--- a/code/game/objects/structures/props/puzzledoor.dm
+++ b/code/game/objects/structures/props/puzzledoor.dm
@@ -61,7 +61,7 @@
/obj/machinery/door/blast/puzzle/attackby(obj/item/weapon/C as obj, mob/user as mob)
if(istype(C, /obj/item/weapon))
- if(C.pry == 1 && (user.a_intent != I_HURT || (stat & BROKEN)))
+ if(C.get_tool_quality(TOOL_CROWBAR) && (user.a_intent != I_HURT || (stat & BROKEN)))
if(istype(C,/obj/item/weapon/material/twohanded/fireaxe))
var/obj/item/weapon/material/twohanded/fireaxe/F = C
if(!F.wielded)
diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm
index 93442b4d68..068f841a59 100644
--- a/code/game/objects/structures/railing.dm
+++ b/code/game/objects/structures/railing.dm
@@ -199,7 +199,7 @@
/obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob)
// Dismantle
- if(W.is_wrench() && !anchored)
+ if(W.get_tool_quality(TOOL_WRENCH) && !anchored)
playsound(src, W.usesound, 50, 1)
if(do_after(user, 20, src))
user.visible_message("\The [user] dismantles \the [src].", "You dismantle \the [src].")
@@ -218,7 +218,7 @@
return
// Install
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
user.visible_message(anchored ? "\The [user] begins unscrewing \the [src]." : "\The [user] begins fasten \the [src]." )
playsound(src, W.usesound, 75, 1)
if(do_after(user, 10, src))
diff --git a/code/game/objects/structures/salvageable.dm b/code/game/objects/structures/salvageable.dm
index 18fe7ad080..62d322729e 100644
--- a/code/game/objects/structures/salvageable.dm
+++ b/code/game/objects/structures/salvageable.dm
@@ -14,9 +14,9 @@
return
/obj/structure/salvageable/attackby(obj/item/I, mob/user)
- if(I.is_crowbar())
+ if(I.get_tool_quality(TOOL_CROWBAR))
playsound(src, I.usesound, 50, 1)
- var/actual_time = I.toolspeed * 170
+ var/actual_time = I.get_tool_speed(TOOL_CROWBAR) * 170
user.visible_message( \
"\The [user] begins salvaging from \the [src].", \
"You start salvaging from \the [src].")
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index 8abf0f3d18..878a40ecf0 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -21,7 +21,7 @@
return
/obj/structure/sign/attackby(obj/item/tool as obj, mob/user as mob) //deconstruction
- if(tool.is_screwdriver() && !istype(src, /obj/structure/sign/scenery) && !istype(src, /obj/structure/sign/double))
+ if(tool.get_tool_quality(TOOL_SCREWDRIVER) && !istype(src, /obj/structure/sign/scenery) && !istype(src, /obj/structure/sign/double))
playsound(src, tool.usesound, 50, 1)
to_chat(user, "You unfasten the sign with your [tool].")
var/obj/item/sign/S = new(src.loc)
@@ -42,7 +42,7 @@
var/sign_state = ""
/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction
- if(tool.is_screwdriver() && isturf(user.loc))
+ if(tool.get_tool_quality(TOOL_SCREWDRIVER) && isturf(user.loc))
var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
if(direction == "Cancel") return
var/obj/structure/sign/S = new(user.loc)
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 be833aec08..7c84f1d1a4 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -87,7 +87,7 @@
return
/obj/structure/bed/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 50, 1)
dismantle()
qdel(src)
@@ -118,7 +118,7 @@
add_padding(padding_type)
return
- else if(W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_WIRECUTTER))
if(!padding_material)
to_chat(user, "\The [src] has no padding to remove.")
return
@@ -218,7 +218,7 @@
return
/obj/structure/bed/roller/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench() || istype(W,/obj/item/stack) || W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WRENCH) || istype(W,/obj/item/stack) || W.get_tool_quality(TOOL_WIRECUTTER))
return
else if(istype(W,/obj/item/roller_holder))
if(has_buckled_mobs())
diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
index 5d1322c3c3..6c0b05b28f 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
@@ -140,7 +140,7 @@
return
/obj/structure/bed/chair/office/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W,/obj/item/stack) || W.is_wirecutter())
+ if(istype(W,/obj/item/stack) || W.get_tool_quality(TOOL_WIRECUTTER))
return
..()
@@ -240,7 +240,7 @@
color = WOOD_COLOR_CHOCOLATE
/obj/structure/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W,/obj/item/stack) || W.is_wirecutter())
+ if(istype(W,/obj/item/stack) || W.get_tool_quality(TOOL_WIRECUTTER))
return
..()
diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
index 640d84ea68..7f9f52eae0 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
@@ -110,7 +110,7 @@ var/global/list/stool_cache = list() //haha stool
qdel(src)
/obj/item/weapon/stool/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 50, 1)
dismantle()
qdel(src)
@@ -140,7 +140,7 @@ var/global/list/stool_cache = list() //haha stool
to_chat(user, "You add padding to \the [src].")
add_padding(padding_type)
return
- else if (W.is_wirecutter())
+ else if (W.get_tool_quality(TOOL_WIRECUTTER))
if(!padding_material)
to_chat(user, "\The [src] has no padding to remove.")
return
diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
index 3641d57fda..e8b7528931 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
@@ -56,9 +56,9 @@
L.set_dir(dir)
/obj/structure/bed/chair/wheelchair/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench() || W.is_wirecutter() || istype(W,/obj/item/stack))
- return
- ..()
+ if(W.get_tool_quality(TOOL_WRENCH) || W.get_tool_quality(TOOL_WIRECUTTER) || istype(W,/obj/item/stack))
+ return TRUE
+ return ..()
/obj/structure/bed/chair/wheelchair/relaymove(mob/user, direction)
// Redundant check?
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 15919a754a..d185c9ce94 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -73,7 +73,7 @@
phorontanks++
else
full = TRUE
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
if(anchored)
to_chat(user, "You lean down and unwrench [src].")
anchored = 0
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 42e90eda15..afd9c748fa 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -45,7 +45,7 @@
icon_state = "[initial(icon_state)][open][cistern]"
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
- if(I.is_crowbar())
+ if(I.get_tool_quality(TOOL_CROWBAR))
to_chat(user, "You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].")
playsound(src, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
if(do_after(user, 30))
@@ -204,11 +204,11 @@
/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob)
if(I.type == /obj/item/device/analyzer)
to_chat(user, "The water temperature seems to be [watertemp].")
- if(I.is_wrench())
+ if(I.get_tool_quality(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, "You begin to adjust the temperature valve with \the [I].")
playsound(src, I.usesound, 50, 1)
- if(do_after(user, 50 * I.toolspeed))
+ if(do_after(user, 50 * I.get_tool_speed(TOOL_WRENCH)))
watertemp = newtemp
user.visible_message("[user] adjusts the shower with \the [I].", "You adjust the shower with \the [I].")
add_fingerprint(user)
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 9934794a7c..a4f7221090 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -86,13 +86,13 @@
switch(state)
if("01")
- if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
+ if(W.get_tool_quality(TOOL_WELDER) && !anchored )
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly.")
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 40 * WT.toolspeed))
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
to_chat(user,"You disassembled the windoor assembly!")
if(secure)
@@ -104,30 +104,32 @@
to_chat(user,"You need more welding fuel to disassemble the windoor assembly.")
return
- //Wrenching an unsecure assembly anchors it in place. Step 4 complete
- if(W.is_wrench() && !anchored)
+
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 100, 1)
- user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
-
- if(do_after(user, 40 * W.toolspeed))
- if(!src) return
- to_chat(user,"You've secured the windoor assembly!")
- src.anchored = 1
- step = 0
-
- //Unwrenching an unsecure assembly un-anchors it. Step 4 undone
- else if(W.is_wrench() && anchored)
- playsound(src, W.usesound, 100, 1)
- user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
-
- if(do_after(user, 40 * W.toolspeed))
- if(!src) return
- to_chat(user,"You've unsecured the windoor assembly!")
- src.anchored = 0
- step = null
+
+ //Wrenching an unsecure assembly anchors it in place. Step 4 complete
+ if(!anchored)
+ user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
+ if(!src)
+ return
+ to_chat(user,"You've secured the windoor assembly!")
+ src.anchored = TRUE
+ step = 0
+
+ //Unwrenching an unsecure assembly un-anchors it. Step 4 undone
+ else
+ user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WRENCH)))
+ if(!src)
+ return
+ to_chat(user,"You've unsecured the windoor assembly!")
+ src.anchored = FALSE
+ step = null
//Adding cable to the assembly. Step 5 complete.
- else if(istype(W, /obj/item/stack/cable_coil) && anchored)
+ else if(W.get_tool_quality(TOOL_CABLE_COIL) && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
var/obj/item/stack/cable_coil/CC = W
@@ -142,12 +144,13 @@
if("02")
//Removing wire from the assembly. Step 5 undone.
- if(W.is_wirecutter() && !src.electronics)
+ if(W.get_tool_quality(TOOL_WIRECUTTER) && !src.electronics)
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
- if(do_after(user, 40 * W.toolspeed))
- if(!src) return
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_WIRECUTTER)))
+ if(!src)
+ return
to_chat(user,"You cut the windoor wires.!")
new/obj/item/stack/cable_coil(get_turf(user), 1)
@@ -171,12 +174,13 @@
W.loc = src.loc
//Screwdriver to remove airlock electronics. Step 6 undone.
- else if(W.is_screwdriver() && src.electronics)
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && src.electronics)
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
- if(do_after(user, 40 * W.toolspeed))
- if(!src || !src.electronics) return
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_SCREWDRIVER)))
+ if(!src || !src.electronics)
+ return
to_chat(user,"You've removed the airlock electronics!")
step = 1
var/obj/item/weapon/airlock_electronics/ae = electronics
@@ -184,7 +188,7 @@
ae.loc = src.loc
//Crowbar to complete the assembly, Step 7 complete.
- else if(W.is_crowbar())
+ else if(W.get_tool_quality(TOOL_CROWBAR))
if(!src.electronics)
to_chat(usr,"The assembly is missing electronics.")
return
@@ -195,9 +199,9 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
- if(do_after(user, 40 * W.toolspeed))
-
- if(!src) return
+ if(do_after(user, 40 * W.get_tool_speed(TOOL_CROWBAR)))
+ if(!src)
+ return
density = 1 //Shouldn't matter but just incase
to_chat(user,"You finish the windoor!")
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 54e1ee720b..a60384b77b 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -223,13 +223,13 @@
if(!istype(W)) return//I really wish I did not need this
// Fixing.
- if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP)
+ if(W.get_tool_quality(TOOL_WELDER) && user.a_intent == I_HELP)
var/obj/item/weapon/weldingtool/WT = W
if(health < maxhealth)
if(WT.remove_fuel(1 ,user))
to_chat(user, "You begin repairing [src]...")
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 40 * WT.toolspeed, target = src))
+ if(do_after(user, 40 * WT.get_tool_speed(TOOL_WELDER), target = src))
health = maxhealth
// playsound(src, 'sound/items/Welder.ogg', 50, 1)
update_icon()
@@ -265,7 +265,7 @@
if(W.flags & NOBLUDGEON) return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(reinf && state >= 1)
state = 3 - state
update_nearby_icons()
@@ -283,11 +283,11 @@
update_verbs()
playsound(src, W.usesound, 75, 1)
to_chat(user, "You have [anchored ? "" : "un"]fastened the window [anchored ? "to" : "from"] the floor.")
- else if(W.is_crowbar() && reinf && state <= 1)
+ else if(W.get_tool_quality(TOOL_CROWBAR) && reinf && state <= 1)
state = 1 - state
playsound(src, W.usesound, 75, 1)
to_chat(user, "You have pried the window [state ? "into" : "out of"] the frame.")
- else if(W.is_wrench() && !anchored && (!state || !reinf))
+ else if(W.get_tool_quality(TOOL_WRENCH) && !anchored && (!state || !reinf))
if(!glasstype)
to_chat(user, "You're not sure how to dismantle \the [src] properly.")
else
@@ -297,7 +297,7 @@
if(is_fulltile())
mats.amount = 4
qdel(src)
- else if(istype(W, /obj/item/stack/cable_coil) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized))
+ else if(W.get_tool_quality(TOOL_CABLE_COIL) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized))
var/obj/item/stack/cable_coil/C = W
if (C.use(1))
playsound(src, 'sound/effects/sparks1.ogg', 75, 1)
@@ -305,7 +305,7 @@
"\The [user] begins to wire \the [src] for electrochromic tinting.", \
"You begin to wire \the [src] for electrochromic tinting.", \
"You hear sparks.")
- if(do_after(user, 20 * C.toolspeed, src) && state == 0)
+ if(do_after(user, 20 * C.get_tool_speed(TOOL_CABLE_COIL), src) && state == 0)
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
var/obj/structure/window/reinforced/polarized/P = new(loc, dir)
if(is_fulltile())
diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm
index ae8664113a..962a3aa08b 100644
--- a/code/game/turfs/simulated/floor_attackby.dm
+++ b/code/game/turfs/simulated/floor_attackby.dm
@@ -9,7 +9,7 @@
attack_tile(C, L) // Be on help intent if you want to decon something.
return
- if(!(C.is_screwdriver() && flooring && (flooring.flags & TURF_REMOVE_SCREWDRIVER)) && try_graffiti(user, C))
+ if(!(C.get_tool_quality(TOOL_SCREWDRIVER) && flooring && (flooring.flags & TURF_REMOVE_SCREWDRIVER)) && try_graffiti(user, C))
return
if(istype(C, /obj/item/stack/tile/roofing))
@@ -117,7 +117,7 @@
to_chat(user, "You need more welding fuel to complete this task.")
/turf/simulated/floor/proc/try_deconstruct_tile(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if(broken || burnt)
to_chat(user, "You remove the broken [flooring.descriptor].")
make_plating()
@@ -131,14 +131,14 @@
return 0
playsound(src, W.usesound, 80, 1)
return 1
- else if(W.is_screwdriver() && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
if(broken || burnt)
return 0
to_chat(user, "You unscrew and remove the [flooring.descriptor].")
make_plating(1)
playsound(src, W.usesound, 80, 1)
return 1
- else if(W.is_wrench() && (flooring.flags & TURF_REMOVE_WRENCH))
+ else if(W.get_tool_quality(TOOL_WRENCH) && (flooring.flags & TURF_REMOVE_WRENCH))
to_chat(user, "You unwrench and remove the [flooring.descriptor].")
make_plating(1)
playsound(src, W.usesound, 80, 1)
diff --git a/code/game/turfs/simulated/outdoors/outdoors.dm b/code/game/turfs/simulated/outdoors/outdoors.dm
index 98b5168b15..40d4ee7852 100644
--- a/code/game/turfs/simulated/outdoors/outdoors.dm
+++ b/code/game/turfs/simulated/outdoors/outdoors.dm
@@ -41,9 +41,9 @@ var/list/turf_edge_cache = list()
/turf/simulated/floor/outdoors/attackby(obj/item/C, mob/user)
- if(can_dig && istype(C, /obj/item/weapon/shovel))
+ if(can_dig && C.get_tool_quality(TOOL_SHOVEL))
to_chat(user, SPAN_NOTICE("\The [user] begins digging into \the [src] with \the [C]."))
- var/delay = (3 SECONDS * C.toolspeed)
+ var/delay = (3 SECONDS * C.get_tool_quality(TOOL_SHOVEL))
user.setClickCooldown(delay)
if(do_after(user, delay, src))
if(!(locate(/obj/machinery/portable_atmospherics/hydroponics/soil) in contents))
diff --git a/code/game/turfs/simulated/outdoors/outdoors_attackby.dm b/code/game/turfs/simulated/outdoors/outdoors_attackby.dm
index 1a969fee98..097b33563b 100644
--- a/code/game/turfs/simulated/outdoors/outdoors_attackby.dm
+++ b/code/game/turfs/simulated/outdoors/outdoors_attackby.dm
@@ -1,7 +1,14 @@
// this code here enables people to dig up worms from certain tiles.
/turf/simulated/floor/outdoors/grass/attackby(obj/item/weapon/S as obj, mob/user as mob)
- if(istype(S, /obj/item/stack/tile/floor))
+ if(S.get_tool_quality(TOOL_SHOVEL))
+ to_chat(user, "You begin to dig in \the [src] with your [S].")
+ if(do_after(user, 4 SECONDS * S.get_tool_speed(TOOL_SHOVEL)))
+ to_chat(user, "\The [src] has been dug up, a worm pops from the ground.")
+ new /obj/item/weapon/reagent_containers/food/snacks/worm(src)
+ else
+ to_chat(user, "You decide to not finish digging in \the [src].")
+ else if(istype(S, /obj/item/stack/tile/floor))
ChangeTurf(/turf/simulated/floor, preserve_outdoors = TRUE)
return
. = ..()
\ No newline at end of file
diff --git a/code/game/turfs/simulated/outdoors/snow.dm b/code/game/turfs/simulated/outdoors/snow.dm
index 31fb6c5ac8..36e7f1a802 100644
--- a/code/game/turfs/simulated/outdoors/snow.dm
+++ b/code/game/turfs/simulated/outdoors/snow.dm
@@ -27,9 +27,9 @@
add_overlay(image(icon = 'icons/turf/outdoors.dmi', icon_state = "snow_footprints", dir = text2num(d)))
/turf/simulated/floor/outdoors/snow/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/weapon/shovel))
+ if(W.get_tool_quality(TOOL_SHOVEL))
to_chat(user, "You begin to remove \the [src] with your [W].")
- if(do_after(user, 4 SECONDS * W.toolspeed))
+ if(do_after(user, 4 SECONDS * W.get_tool_speed(TOOL_SHOVEL)))
to_chat(user, "\The [src] has been dug up, and now lies in a pile nearby.")
var/obj/item/stack/material/snow/S = new(src)
S.amount = 10
diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm
index 559bc62557..82cb1f0f8a 100644
--- a/code/game/turfs/simulated/wall_attacks.dm
+++ b/code/game/turfs/simulated/wall_attacks.dm
@@ -189,7 +189,7 @@
for(var/obj/effect/overlay/wallrot/WR in src)
qdel(WR)
return
- else if(!is_sharp(W) && W.force >= 10 || W.force >= 20)
+ else if(!W.sharp && W.force >= 10 || W.force >= 20)
to_chat(user, "\The [src] crumbles away under the force of your [W.name].")
src.dismantle_wall(1)
return
@@ -219,7 +219,7 @@
var/turf/T = user.loc //get user's location for delay checks
- if(damage && istype(W, /obj/item/weapon/weldingtool))
+ if(damage && W.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = W
@@ -229,7 +229,7 @@
if(WT.remove_fuel(0,user))
to_chat(user, "You start repairing the damage to [src].")
playsound(src, WT.usesound, 100, 1)
- if(do_after(user, max(5, damage / 5) * WT.toolspeed) && WT && WT.isOn())
+ if(do_after(user, max(5, damage / 5) * WT.get_tool_speed(TOOL_WELDER)) && WT && WT.isOn())
to_chat(user, "You finish repairing the damage to [src].")
take_damage(-damage)
else
@@ -239,13 +239,14 @@
return
// Basic dismantling.
+ var/dismantle_toolspeed = 1
if(isnull(construction_stage) || !reinf_material)
var/cut_delay = 60 - material.cut_delay
var/dismantle_verb
var/dismantle_sound
- if(istype(W,/obj/item/weapon/weldingtool))
+ if(W.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.isOn())
return
@@ -254,18 +255,20 @@
return
dismantle_verb = "cutting"
dismantle_sound = W.usesound
+ dismantle_toolspeed = W.get_tool_speed(TOOL_WELDER)
// cut_delay *= 0.7 // Tools themselves now can shorten the time it takes.
else if(istype(W,/obj/item/weapon/melee/energy/blade))
dismantle_sound = "sparks"
dismantle_verb = "slicing"
cut_delay *= 0.5
- else if(istype(W,/obj/item/weapon/pickaxe))
+ else if(W.get_tool_quality(TOOL_MINING))
var/obj/item/weapon/pickaxe/P = W
dismantle_verb = P.drill_verb
dismantle_sound = P.drill_sound
cut_delay -= P.digspeed
+ dismantle_toolspeed = W.get_tool_speed(TOOL_MINING)
- if(dismantle_verb)
+ if(dismantle_toolspeed)
to_chat(user, "You begin [dismantle_verb] through the outer plating.")
if(dismantle_sound)
@@ -274,7 +277,7 @@
if(cut_delay<0)
cut_delay = 0
- if(!do_after(user,cut_delay * W.toolspeed))
+ if(!do_after(user,cut_delay * dismantle_toolspeed))
return
to_chat(user, "You remove the outer plating.")
@@ -286,7 +289,7 @@
else
switch(construction_stage)
if(6)
- if (W.is_wirecutter())
+ if (W.get_tool_quality(TOOL_WIRECUTTER))
playsound(src, W.usesound, 100, 1)
construction_stage = 5
user.update_examine_panel(src)
@@ -294,17 +297,17 @@
update_icon()
return
if(5)
- if (W.is_screwdriver())
+ if (W.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You begin removing the support lines.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_SCREWDRIVER)) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
return
construction_stage = 4
user.update_examine_panel(src)
update_icon()
to_chat(user, "You unscrew the support lines.")
return
- else if (W.is_wirecutter())
+ else if (W.get_tool_quality(TOOL_WIRECUTTER))
construction_stage = 6
user.update_examine_panel(src)
to_chat(user, "You mend the outer grille.")
@@ -327,17 +330,17 @@
if(cut_cover)
to_chat(user, "You begin slicing through the metal cover.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user, 60 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
+ if(!do_after(user, 60 * W.get_tool_speed(TOOL_WELDER)) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
return
construction_stage = 3
user.update_examine_panel(src)
update_icon()
to_chat(user, "You press firmly on the cover, dislodging it.")
return
- else if (W.is_screwdriver())
+ else if (W.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You begin screwing down the support lines.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_SCREWDRIVER)) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
return
construction_stage = 5
user.update_examine_panel(src)
@@ -345,10 +348,10 @@
to_chat(user, "You screw down the support lines.")
return
if(3)
- if (W.is_crowbar())
+ if (W.get_tool_quality(TOOL_CROWBAR))
to_chat(user, "You struggle to pry off the cover.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
+ if(!do_after(user,100 * W.get_tool_speed(TOOL_CROWBAR)) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
return
construction_stage = 2
user.update_examine_panel(src)
@@ -356,10 +359,10 @@
to_chat(user, "You pry off the cover.")
return
if(2)
- if (W.is_wrench())
+ if (W.get_tool_quality(TOOL_WRENCH))
to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
return
construction_stage = 1
user.update_examine_panel(src)
@@ -380,7 +383,7 @@
if(cut_cover)
to_chat(user, "You begin slicing through the support rods.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user,70 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
+ if(!do_after(user,70 * W.get_tool_speed(TOOL_WELDER)) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
return
construction_stage = 0
user.update_examine_panel(src)
@@ -388,10 +391,10 @@
to_chat(user, "The slice through the support rods.")
return
if(0)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
to_chat(user, "You struggle to pry off the outer sheath.")
playsound(src, W.usesound, 100, 1)
- if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || !user || !W || !T )
+ if(!do_after(user,100 * W.get_tool_speed(TOOL_CROWBAR)) || !istype(src, /turf/simulated/wall) || !user || !W || !T )
return
if(user.loc == T && user.get_active_hand() == W )
to_chat(user, "You pry off the outer sheath.")
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index 1a0b58bdc9..cee578cdc9 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -70,7 +70,7 @@
if((!A.secured) && (!secured))
attach_assembly(A,user)
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(toggle_secure())
to_chat(user, "\The [src] is ready!")
else
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index b38d28938c..71c2eb3d64 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -103,7 +103,7 @@
..()
/obj/item/device/assembly_holder/attackby(var/obj/item/weapon/W, var/mob/user)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(!a_left || !a_right)
to_chat(user, " BUG:Assembly part missing, please report this!")
return
diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm
index d3f518bbc8..f591891c5f 100644
--- a/code/modules/assembly/shock_kit.dm
+++ b/code/modules/assembly/shock_kit.dm
@@ -14,7 +14,7 @@
return
/obj/item/assembly/shock_kit/attackby(var/obj/item/weapon/W, var/mob/user)
- if(W.is_wrench() && !status)
+ if(W.get_tool_quality(TOOL_WRENCH) && !status)
var/turf/T = loc
if(ismob(T))
T = T.loc
@@ -26,7 +26,7 @@
part2 = null
qdel(src)
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
status = !status
to_chat(user, "[src] is now [status ? "secured" : "unsecured"]!")
playsound(src, W.usesound, 50, 1)
diff --git a/code/modules/catalogue/cataloguer.dm b/code/modules/catalogue/cataloguer.dm
index 8f7f3152f3..3584d44e4f 100644
--- a/code/modules/catalogue/cataloguer.dm
+++ b/code/modules/catalogue/cataloguer.dm
@@ -34,6 +34,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers)
var/debug = FALSE // If true, can view all catalogue data defined, regardless of unlock status.
var/weakref/partial_scanned = null // Weakref of the thing that was last scanned if inturrupted. Used to allow for partial scans to be resumed.
var/partial_scan_time = 0 // How much to make the next scan shorter.
+ var/toolspeed = 1
/obj/item/device/cataloguer/advanced
name = "advanced cataloguer"
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index f53a217645..7df5025a42 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -72,7 +72,7 @@
if (!..())
return 0
- if(LAZYLEN(species_restricted) && istype(M,/mob/living/carbon/human))
+ if(LAZYLEN(species_restricted) && ishuman(M))
var/exclusive = null
var/wearable = null
var/mob/living/carbon/human/H = M
@@ -191,19 +191,15 @@
SPECIES_TESHARI = 'icons/mob/species/teshari/ears.dmi')
/obj/item/clothing/ears/attack_hand(mob/user as mob)
- if (!user) return
-
- if (src.loc != user || !istype(user,/mob/living/carbon/human))
- ..()
+ if (!user || !canremove)
return
+ if (src.loc != user || !ishuman(user))
+ return ..()
+
var/mob/living/carbon/human/H = user
if(H.l_ear != src && H.r_ear != src)
- ..()
- return
-
- if(!canremove)
- return
+ return ..()
var/obj/item/clothing/ears/O
if(slot_flags & SLOT_TWOEARS )
@@ -316,25 +312,6 @@
/obj/item/clothing/gloves/proc/Touch(var/atom/A, var/proximity)
return 0 // return 1 to cancel attack_hand()
-/*/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user)
- if(W.is_wirecutter() || istype(W, /obj/item/weapon/scalpel))
- if (clipped)
- to_chat(user, "The [src] have already been clipped!")
- update_icon()
- return
-
- playsound(src, W.usesound, 50, 1)
- user.visible_message("[user] cuts the fingertips off of the [src].","You cut the fingertips off of the [src].")
-
- clipped = 1
- name = "modified [name]"
- desc = "[desc]
They have had the fingertips cut off of them."
- if("exclude" in species_restricted)
- species_restricted -= SPECIES_UNATHI
- species_restricted -= SPECIES_TAJ
- return
-*/
-
/obj/item/clothing/gloves/clean_blood()
. = ..()
transfer_blood = 0
diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm
index 9316c8f64f..38e4eae6f4 100644
--- a/code/modules/clothing/gloves/boxing.dm
+++ b/code/modules/clothing/gloves/boxing.dm
@@ -4,14 +4,6 @@
icon_state = "boxing"
item_state_slots = list(slot_r_hand_str = "red", slot_l_hand_str = "red")
-/*
-/obj/item/clothing/gloves/boxing/attackby(obj/item/weapon/W, mob/user)
- if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel))
- to_chat(user, "That won't work.") //Nope
- return
- ..()
-*/
-
/obj/item/clothing/gloves/boxing/green
icon_state = "boxinggreen"
item_state_slots = list(slot_r_hand_str = "green", slot_l_hand_str = "green")
diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm
index 025080f8f2..5cdad2feac 100644
--- a/code/modules/clothing/masks/hailer.dm
+++ b/code/modules/clothing/masks/hailer.dm
@@ -103,7 +103,7 @@
return
/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/I, mob/user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
switch(aggressiveness)
if(1)
to_chat(user, "You set the aggressiveness restrictor to the second position.")
@@ -123,11 +123,11 @@
phrase = 1
if(5)
to_chat(user, "You adjust the restrictor but nothing happens, probably because its broken.")
- if(I.is_wirecutter())
+ if(I.get_tool_quality(TOOL_WIRECUTTER))
if(aggressiveness != 5)
to_chat(user, "You broke it!")
aggressiveness = 5
- if(I.is_crowbar())
+ if(I.get_tool_quality(TOOL_CROWBAR))
if(!hailer)
to_chat(user, "This mask has an integrated hailer, you can't remove it!")
else
diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm
index 395484d53a..222cd4a67c 100644
--- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm
@@ -7,7 +7,7 @@
return
// Pass repair items on to the chestpiece.
- if(chest && (istype(W,/obj/item/stack/material) || istype(W, /obj/item/weapon/weldingtool)))
+ if(chest && (istype(W,/obj/item/stack/material) || W.get_tool_quality(TOOL_WELDER)))
return chest.attackby(W,user)
// Lock or unlock the access panel.
@@ -30,7 +30,7 @@
to_chat(user, "You [locked ? "lock" : "unlock"] \the [src] access panel.")
return
- else if(W.is_crowbar())
+ else if(W.get_tool_quality(TOOL_CROWBAR))
if(!open && locked)
to_chat(user, "The access panel is locked shut.")
return
@@ -41,7 +41,7 @@
if(open)
// Hacking.
- if(W.is_wirecutter() || istype(W, /obj/item/device/multitool))
+ if(W.get_tool_quality(TOOL_WIRECUTTER) || W.get_tool_quality(TOOL_MULTITOOL))
if(open)
wires.Interact(user)
else
@@ -102,7 +102,7 @@
src.cell = W
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(!air_supply)
to_chat(user, "There is no tank to remove.")
@@ -116,7 +116,7 @@
air_supply = null
return
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
var/list/current_mounts = list()
if(cell) current_mounts += "cell"
diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm
index 3a92bd2be1..5bc40bd84e 100644
--- a/code/modules/clothing/spacesuits/void/void.dm
+++ b/code/modules/clothing/spacesuits/void/void.dm
@@ -226,7 +226,7 @@
to_chat(user, "You cannot modify \the [src] while it is being worn.")
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(helmet || boots || tank)
var/choice = input("What component would you like to remove?") as null|anything in list(helmet,boots,tank,cooler)
if(!choice) return
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
index 35ed151a45..7eeac2bc3e 100644
--- a/code/modules/clothing/under/accessories/accessory.dm
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -164,10 +164,8 @@
slot = ACCESSORY_SLOT_TIE
/obj/item/clothing/accessory/stethoscope/do_surgery(mob/living/carbon/human/M, mob/living/user)
- if(user.a_intent != I_HELP) //in case it is ever used as a surgery tool
- return ..()
- attack(M, user) //default surgery behaviour is just to scan as usual
- return 1
+ return attack(M, user) //default surgery behaviour is just to scan as usual
+
/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/living/user)
if(ishuman(M) && isliving(user))
diff --git a/code/modules/economy/cash_register.dm b/code/modules/economy/cash_register.dm
index cd8b77a219..e516d4f5dc 100644
--- a/code/modules/economy/cash_register.dm
+++ b/code/modules/economy/cash_register.dm
@@ -190,7 +190,7 @@
scan_cash(SC)
else if(istype(O, /obj/item/weapon/card/emag))
return ..()
- else if(O.is_wrench())
+ else if(O.get_tool_quality(TOOL_WRENCH))
var/obj/item/weapon/tool/wrench/W = O
toggle_anchors(W, user)
// Not paying: Look up price and add it to transaction_amount
@@ -481,8 +481,10 @@
to_chat(usr, "The cash box is locked.")
-/obj/machinery/cash_register/proc/toggle_anchors(obj/item/weapon/tool/wrench/W, mob/user)
- if(manipulating) return
+/obj/machinery/cash_register/proc/toggle_anchors(obj/item/weapon/W, mob/user)
+ if(manipulating || !W.get_tool_quality(TOOL_WRENCH))
+ return
+
manipulating = 1
if(!anchored)
user.visible_message("\The [user] begins securing \the [src] to the floor.",
@@ -491,7 +493,7 @@
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.",
"You begin unsecuring \the [src] from the floor.")
playsound(src, W.usesound, 50, 1)
- if(!do_after(user, 20 * W.toolspeed))
+ if(!do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
manipulating = 0
return
if(!anchored)
diff --git a/code/modules/economy/coins.dm b/code/modules/economy/coins.dm
index c5a5f622fc..da23adde51 100644
--- a/code/modules/economy/coins.dm
+++ b/code/modules/economy/coins.dm
@@ -82,7 +82,7 @@
else
to_chat(user, "This cable coil appears to be empty.")
return
- else if(W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_WIRECUTTER))
if(!string_attached)
..()
return
diff --git a/code/modules/economy/vending.dm b/code/modules/economy/vending.dm
index c19b877a04..1b658ad279 100644
--- a/code/modules/economy/vending.dm
+++ b/code/modules/economy/vending.dm
@@ -156,7 +156,7 @@ GLOBAL_LIST_EMPTY(vending_products)
if(I || istype(W, /obj/item/weapon/spacecash))
attack_hand(user)
return
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
playsound(src, W.usesound, 50, 1)
@@ -168,7 +168,7 @@ GLOBAL_LIST_EMPTY(vending_products)
SStgui.update_uis(src) // Speaker switch is on the main UI, not wires UI
return
- else if(istype(W, /obj/item/device/multitool) || W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_MULTITOOL) || W.get_tool_quality(TOOL_WIRECUTTER))
if(panel_open)
attack_hand(user)
return
@@ -180,14 +180,14 @@ GLOBAL_LIST_EMPTY(vending_products)
to_chat(user, "You insert \the [W] into \the [src].")
SStgui.update_uis(src)
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 100, 1)
if(anchored)
user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
- if(do_after(user, 20 * W.toolspeed))
+ if(do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
if(!src) return
to_chat(user, "You [anchored? "un" : ""]secured \the [src]!")
anchored = !anchored
diff --git a/code/modules/fishing/fishing.dm b/code/modules/fishing/fishing.dm
index 7e4a9d85bc..2e5fcbf7bd 100644
--- a/code/modules/fishing/fishing.dm
+++ b/code/modules/fishing/fishing.dm
@@ -132,7 +132,7 @@ GLOBAL_LIST_INIT(generic_fishing_chance_list, list(FISHING_RARE = 5, FISHING_UNC
to_chat(user,"You cast \the [P.name] into \the [src].")
being_fished = TRUE
R.cast = TRUE
- var/fishing_time = rand(min_fishing_time SECONDS,max_fishing_time SECONDS) * R.toolspeed
+ var/fishing_time = rand(min_fishing_time SECONDS,max_fishing_time SECONDS) * R.get_tool_speed(TOOL_FISHING)
if(do_after(user,fishing_time,user))
playsound(src, 'sound/effects/slosh.ogg', 5, 1, 5)
to_chat(user,"You feel a tug and begin pulling!")
diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm
index 44cde185ac..d3d6664dda 100644
--- a/code/modules/fishing/fishing_rod.dm
+++ b/code/modules/fishing/fishing_rod.dm
@@ -19,6 +19,7 @@
applies_material_colour = TRUE
default_material = "wood"
can_dull = FALSE
+ tool_qualities = list(TOOL_FISHING = TOOL_QUALITY_MEDIOCRE)
var/strung = TRUE
var/line_break = TRUE
@@ -51,7 +52,7 @@
update_icon()
/obj/item/weapon/material/fishing_rod/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_wirecutter() && strung)
+ if(I.get_tool_quality(TOOL_WIRECUTTER) && strung)
strung = FALSE
to_chat(user, "You cut \the [src]'s string!")
update_icon()
@@ -90,10 +91,10 @@
if(re.id == "nutriment" || re.id == "protein" || re.id == "glucose" || re.id == "fishbait")
foodvolume += re.volume
- toolspeed = initial(toolspeed) * min(0.75, (0.5 / max(0.5, (foodvolume / Bait.reagents.maximum_volume))))
+ set_tool_quality(TOOL_FISHING, initial(tool_qualities[TOOL_FISHING]) * 2 * max(0.75, (foodvolume / Bait.reagents.maximum_volume)))
else
- toolspeed = initial(toolspeed)
+ set_tool_quality(TOOL_FISHING, initial(tool_qualities[TOOL_FISHING]))
/obj/item/weapon/material/fishing_rod/proc/consume_bait()
if(Bait)
@@ -118,7 +119,7 @@
attackspeed = 2 SECONDS
default_material = "titanium"
- toolspeed = 0.75
+ tool_qualities = list(TOOL_FISHING = TOOL_QUALITY_DECENT)
/obj/item/weapon/material/fishing_rod/modern/built
strung = FALSE
@@ -128,4 +129,4 @@
desc = "Mass produced, but somewhat reliable."
default_material = "plastic"
- toolspeed = 0.9
\ No newline at end of file
+ tool_qualities = list(TOOL_FISHING = TOOL_QUALITY_STANDARD)
diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm
index c77683a8db..b7ce92d2c4 100644
--- a/code/modules/food/food/snacks.dm
+++ b/code/modules/food/food/snacks.dm
@@ -174,7 +174,7 @@
if (is_sliceable())
//these are used to allow hiding edge items in food that is not on a table/tray
var/can_slice_here = isturf(src.loc) && ((locate(/obj/structure/table) in src.loc) || (locate(/obj/machinery/optable) in src.loc) || (locate(/obj/item/weapon/tray) in src.loc))
- var/hide_item = !has_edge(W) || !can_slice_here
+ var/hide_item = !W.edge || !can_slice_here
if (hide_item)
if (W.w_class >= src.w_class || is_robot_module(W))
@@ -186,7 +186,7 @@
contents += W
return
- if (has_edge(W))
+ if (W.edge)
if (!can_slice_here)
to_chat(user, "You cannot slice \the [src] here! You need a table or at least a tray to do it.")
return
diff --git a/code/modules/food/kitchen/cooking_machines/_appliance.dm b/code/modules/food/kitchen/cooking_machines/_appliance.dm
index 0148b1be2c..19d03c1e67 100644
--- a/code/modules/food/kitchen/cooking_machines/_appliance.dm
+++ b/code/modules/food/kitchen/cooking_machines/_appliance.dm
@@ -221,7 +221,7 @@
else if(istype(check, /obj/item/weapon/disk/nuclear))
to_chat(user, "You can't cook that.")
return 0
- else if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/weapon/storage/part_replacer)) // You can't cook tools, dummy.
+ else if(I.get_tool_quality(TOOL_CROWBAR) || I.get_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/weapon/storage/part_replacer)) // You can't cook tools, dummy.
return 0
else if(!istype(check) && !istype(check, /obj/item/weapon/holder))
to_chat(user, "That's not edible.")
diff --git a/code/modules/food/kitchen/cooking_machines/oven.dm b/code/modules/food/kitchen/cooking_machines/oven.dm
index 013f7ad648..2897208414 100644
--- a/code/modules/food/kitchen/cooking_machines/oven.dm
+++ b/code/modules/food/kitchen/cooking_machines/oven.dm
@@ -110,7 +110,7 @@
/obj/machinery/appliance/cooker/oven/proc/manip(var/obj/item/I)
// check if someone's trying to manipulate the machine
- if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/weapon/storage/part_replacer))
+ if(I.get_tool_quality(TOOL_CROWBAR) || I.get_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/weapon/storage/part_replacer))
return TRUE
else
return FALSE
diff --git a/code/modules/food/kitchen/microwave.dm b/code/modules/food/kitchen/microwave.dm
index 33e0a02812..089ecee2aa 100644
--- a/code/modules/food/kitchen/microwave.dm
+++ b/code/modules/food/kitchen/microwave.dm
@@ -75,24 +75,24 @@
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(src.broken > 0)
- if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver
+ if(src.broken == 2 && O.get_tool_quality(TOOL_SCREWDRIVER)) // If it's broken and they're using a screwdriver
user.visible_message( \
"\The [user] starts to fix part of the microwave.", \
"You start to fix part of the microwave." \
)
playsound(src, O.usesound, 50, 1)
- if (do_after(user,20 * O.toolspeed))
+ if (do_after(user,20 * O.get_tool_speed(TOOL_SCREWDRIVER)))
user.visible_message( \
"\The [user] fixes part of the microwave.", \
"You have fixed part of the microwave." \
)
src.broken = 1 // Fix it a bit
- else if(src.broken == 1 && O.is_wrench()) // If it's broken and they're doing the wrench
+ else if(src.broken == 1 && O.get_tool_quality(TOOL_WRENCH)) // If it's broken and they're doing the wrench
user.visible_message( \
"\The [user] starts to fix part of the microwave.", \
"You start to fix part of the microwave." \
)
- if (do_after(user,20 * O.toolspeed))
+ if (do_after(user,20 * O.get_tool_speed(TOOL_WRENCH)))
user.visible_message( \
"\The [user] fixes the microwave.", \
"You have fixed the microwave." \
@@ -157,10 +157,10 @@
var/obj/item/weapon/grab/G = O
to_chat(user, "This is ridiculous. You can not fit \the [G.affecting] in this [src].")
return 1
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
default_deconstruction_screwdriver(user, O)
return
- else if(O.is_crowbar())
+ else if(O.get_tool_quality(TOOL_CROWBAR))
if(default_deconstruction_crowbar(user, O))
return
else
@@ -168,7 +168,7 @@
"\The [user] begins [src.anchored ? "unsecuring" : "securing"] the microwave.", \
"You attempt to [src.anchored ? "unsecure" : "secure"] the microwave."
)
- if (do_after(user,20/O.toolspeed))
+ if (do_after(user,20/O.get_tool_speed(TOOL_CROWBAR)))
user.visible_message( \
"\The [user] [src.anchored ? "unsecures" : "secures"] the microwave.", \
"You [src.anchored ? "unsecure" : "secure"] the microwave."
diff --git a/code/modules/food/kitchen/smartfridge/smartfridge.dm b/code/modules/food/kitchen/smartfridge/smartfridge.dm
index 4df4070cd6..7f7d32f74d 100644
--- a/code/modules/food/kitchen/smartfridge/smartfridge.dm
+++ b/code/modules/food/kitchen/smartfridge/smartfridge.dm
@@ -109,7 +109,7 @@
********************/
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(O.is_screwdriver())
+ if(O.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].")
playsound(src, O.usesound, 50, 1)
@@ -119,7 +119,7 @@
if(wrenchable && default_unfasten_wrench(user, O, 20))
return
- if(istype(O, /obj/item/device/multitool) || O.is_wirecutter())
+ if(O.get_tool_quality(TOOL_MULTITOOL) || O.get_tool_quality(TOOL_WIRECUTTER))
if(panel_open)
attack_hand(user)
return
diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm
index 3704d74d1a..18d81fc855 100644
--- a/code/modules/holodeck/HolodeckObjects.dm
+++ b/code/modules/holodeck/HolodeckObjects.dm
@@ -202,11 +202,11 @@
if(W.flags & NOBLUDGEON) return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "It's a holowindow, you can't unfasten it!")
- else if(W.is_crowbar() && reinf && state <= 1)
+ else if(W.get_tool_quality(TOOL_CROWBAR) && reinf && state <= 1)
to_chat(user, "It's a holowindow, you can't pry it!")
- else if(W.is_wrench() && !anchored && (!state || !reinf))
+ else if(W.get_tool_quality(TOOL_WRENCH) && !anchored && (!state || !reinf))
to_chat(user, "It's a holowindow, you can't dismantle it!")
else
if(W.damtype == BRUTE || W.damtype == BURN)
@@ -263,7 +263,7 @@
qdel(src)
/obj/structure/bed/chair/holochair/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
to_chat(user, "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 6accec414d..b2c92deda9 100644
--- a/code/modules/hydroponics/beekeeping/beehive.dm
+++ b/code/modules/hydroponics/beekeeping/beehive.dm
@@ -36,12 +36,12 @@
. += "The lid is open."
/obj/machinery/beehive/attackby(var/obj/item/I, var/mob/user)
- if(I.is_crowbar())
+ if(I.get_tool_quality(TOOL_CROWBAR))
closed = !closed
user.visible_message("[user] [closed ? "closes" : "opens"] \the [src].", "You [closed ? "close" : "open"] \the [src].")
update_icon()
return
- else if(I.is_wrench())
+ else if(I.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, I.usesound, 50, 1)
user.visible_message("[user] [anchored ? "wrenches" : "unwrenches"] \the [src].", "You [anchored ? "wrench" : "unwrench"] \the [src].")
@@ -107,7 +107,7 @@
if(smoked)
to_chat(user, "The hive is smoked.")
return 1
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(bee_count)
to_chat(user, "You can't dismantle \the [src] with these bees inside.")
return
diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm
index 194064e1b0..d143092018 100644
--- a/code/modules/hydroponics/seed_machines.dm
+++ b/code/modules/hydroponics/seed_machines.dm
@@ -96,7 +96,7 @@
if(default_deconstruction_screwdriver(user, W))
return
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 100, 1)
to_chat(user, "You [anchored ? "un" : ""]secure \the [src].")
anchored = !anchored
diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm
index e312d709ca..74b0f6c558 100644
--- a/code/modules/hydroponics/seed_storage.dm
+++ b/code/modules/hydroponics/seed_storage.dm
@@ -508,18 +508,18 @@
else
to_chat(user, "There are no seeds in \the [O.name].")
return
- else if(O.is_wrench())
+ else if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 50, 1)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
playsound(src, O.usesound, 50, 1)
overlays.Cut()
if(panel_open)
overlays += image(icon, "[initial(icon_state)]-panel")
- else if((O.is_wirecutter() || istype(O, /obj/item/device/multitool)) && panel_open)
+ else if((O.get_tool_quality(TOOL_WIRECUTTER) || O.get_tool_quality(TOOL_MULTITOOL)) && panel_open)
wires.Interact(user)
/obj/machinery/seed_storage/emag_act(var/remaining_charges, var/mob/user)
diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm
index c554b3a439..d7bf72138f 100644
--- a/code/modules/hydroponics/spreading/spreading.dm
+++ b/code/modules/hydroponics/spreading/spreading.dm
@@ -239,7 +239,7 @@
user.setClickCooldown(user.get_attack_speed(W))
plant_controller.add_plant(src)
- if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel))
+ if(W.get_tool_quality(TOOL_WIRECUTTER) || W.get_tool_quality(TOOL_SCALPEL))
if(sampled)
to_chat(user, "\The [src] has already been sampled recently.")
return
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index e24e30e281..2575ef8350 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -469,7 +469,7 @@
if(O.is_open_container())
return 0
- if(O.is_wirecutter() || istype(O, /obj/item/weapon/surgical/scalpel))
+ if(O.get_tool_quality(TOOL_WIRECUTTER) || O.get_tool_quality(TOOL_SCALPEL))
if(!seed)
to_chat(user, "There is nothing to take a sample from in \the [src].")
@@ -564,7 +564,7 @@
qdel(O)
check_health()
- else if(mechanical && O.is_wrench())
+ else if(mechanical && O.get_tool_quality(TOOL_WRENCH))
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index aea7ffc4ea..13f7bd76ce 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -233,7 +233,7 @@
visible_message("\The [user] waves \the [src] around [target].")
/obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user)
- if(can_anchor && I.is_wrench())
+ if(can_anchor && I.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
to_chat(user, span("notice", "You've [anchored ? "" : "un"]secured \the [src] to \the [get_turf(src)]."))
if(anchored)
@@ -252,14 +252,14 @@
interact(user)
return TRUE
- else if(I.is_crowbar())
+ else if(I.get_tool_quality(TOOL_CROWBAR))
playsound(src, 'sound/items/Crowbar.ogg', 50, 1)
opened = !opened
to_chat(user, "You [opened ? "opened" : "closed"] \the [src].")
update_icon()
return TRUE
- else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.is_screwdriver())
+ else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.get_tool_quality(TOOL_SCREWDRIVER))
if(opened)
interact(user)
return TRUE
@@ -359,4 +359,4 @@
// Returns TRUE if I is something that could/should have a valid interaction. Used to tell circuitclothes to hit the circuit with something instead of the clothes
/obj/item/device/electronic_assembly/proc/is_valid_tool(var/obj/item/I)
- return I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics)
\ No newline at end of file
+ return I.get_tool_quality(TOOL_CROWBAR) || I.get_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics)
\ No newline at end of file
diff --git a/code/modules/integrated_electronics/core/assemblies/device.dm b/code/modules/integrated_electronics/core/assemblies/device.dm
index e1180914da..31ab76b24f 100644
--- a/code/modules/integrated_electronics/core/assemblies/device.dm
+++ b/code/modules/integrated_electronics/core/assemblies/device.dm
@@ -12,7 +12,7 @@
. = ..()
/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob)
- if (I.is_crowbar())
+ if (I.get_tool_quality(TOOL_CROWBAR))
toggle_open(user)
else if (opened)
EA.attackby(I, user)
diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm
index 0a66c29127..4eec6c9ab3 100644
--- a/code/modules/integrated_electronics/core/tools.dm
+++ b/code/modules/integrated_electronics/core/tools.dm
@@ -274,7 +274,7 @@
/obj/item/weapon/tool/screwdriver,
/obj/item/device/multitool
)
- cant_hold = list(/obj/item/weapon/tool/screwdriver/power)
+ cant_hold = list(/obj/item/weapon/tool/powerdrill)
/obj/item/weapon/storage/bag/circuits/basic/Initialize()
. = ..()
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index dbd6eade31..00dd3bdf90 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -38,14 +38,14 @@
return
else
name = ("bookcase ([newname])")
- else if(O.is_wrench())
+ else if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 100, 1)
to_chat(user, (anchored ? "You unfasten \the [src] from the floor." : "You secure \the [src] to the floor."))
anchored = !anchored
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, O.usesound, 75, 1)
to_chat(user, "You begin dismantling \the [src].")
- if(do_after(user,25 * O.toolspeed))
+ if(do_after(user,25 * O.get_tool_speed(TOOL_SCREWDRIVER)))
to_chat(user, "You dismantle \the [src].")
new /obj/item/stack/material/wood(get_turf(src), 3)
for(var/obj/item/weapon/book/b in contents)
@@ -281,7 +281,7 @@ Book Cart End
return
scanner.computer.inventory.Add(src)
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
- else if(istype(W, /obj/item/weapon/material/knife) || W.is_wirecutter())
+ else if(istype(W, /obj/item/weapon/material/knife) || W.get_tool_quality(TOOL_WIRECUTTER))
if(carved) return
to_chat(user, "You begin to carve out [title].")
if(do_after(user, 30))
diff --git a/code/modules/materials/sheets/organic/tanning/hide.dm b/code/modules/materials/sheets/organic/tanning/hide.dm
index e59d1e2d82..84483917d7 100644
--- a/code/modules/materials/sheets/organic/tanning/hide.dm
+++ b/code/modules/materials/sheets/organic/tanning/hide.dm
@@ -16,7 +16,7 @@
//Step one - dehairing.
/obj/item/stack/animalhide/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(has_edge(W) || is_sharp(W))
+ if(W.edge || W.sharp)
//visible message on mobs is defined as visible_message(var/message, var/self_message, var/blind_message)
user.visible_message("\The [user] starts cutting hair off \the [src]", "You start cutting the hair off \the [src]", "You hear the sound of a knife rubbing against flesh")
var/scraped = 0
diff --git a/code/modules/materials/sheets/organic/wood.dm b/code/modules/materials/sheets/organic/wood.dm
index eb95131425..ee558e0412 100644
--- a/code/modules/materials/sheets/organic/wood.dm
+++ b/code/modules/materials/sheets/organic/wood.dm
@@ -35,8 +35,8 @@
/obj/item/stack/material/log/attackby(var/obj/item/W, var/mob/user)
if(!istype(W) || W.force <= 0)
return ..()
- if(W.sharp && W.edge)
- var/time = (3 SECONDS / max(W.force / 10, 1)) * W.toolspeed
+ if(W.get_tool_quality(TOOL_WOODCUT)) // Not all that is sharp should chop wood
+ var/time = (3 SECONDS / max(W.force / 10, 1)) * W.get_tool_speed(TOOL_WOODCUT)
user.setClickCooldown(time)
if(do_after(user, time, src) && use(1))
to_chat(user, "You cut up a log into planks.")
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index 06dc694313..c8f5cb062c 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -343,7 +343,7 @@
if(default_deconstruction_crowbar(user, W))
return
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(istype(get_turf(src), /turf/space))
to_chat(user, "You can't anchor something to empty space. Idiot.")
diff --git a/code/modules/mob/living/bot/SLed209bot.dm b/code/modules/mob/living/bot/SLed209bot.dm
index c4fd4b2767..8354cf68d2 100644
--- a/code/modules/mob/living/bot/SLed209bot.dm
+++ b/code/modules/mob/living/bot/SLed209bot.dm
@@ -150,7 +150,7 @@
qdel(W)
if(8)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 100, 1)
var/turf/T = get_turf(user)
to_chat(user, "Now attaching the gun to the frame...")
diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm
index bfe6d54b0a..283b57fd27 100644
--- a/code/modules/mob/living/bot/bot.dm
+++ b/code/modules/mob/living/bot/bot.dm
@@ -101,7 +101,7 @@
else
to_chat(user, "Access denied.")
return
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
if(!locked)
open = !open
to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].")
diff --git a/code/modules/mob/living/bot/ed209bot.dm b/code/modules/mob/living/bot/ed209bot.dm
index adb0ea7885..730c19da50 100644
--- a/code/modules/mob/living/bot/ed209bot.dm
+++ b/code/modules/mob/living/bot/ed209bot.dm
@@ -188,7 +188,7 @@
qdel(W)
if(8)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 100, 1)
var/turf/T = get_turf(user)
to_chat(user, "Now attaching the gun to the frame...")
diff --git a/code/modules/mob/living/bot/edCLNbot.dm b/code/modules/mob/living/bot/edCLNbot.dm
index 2730ab1b9b..1fae7f8c48 100644
--- a/code/modules/mob/living/bot/edCLNbot.dm
+++ b/code/modules/mob/living/bot/edCLNbot.dm
@@ -193,7 +193,7 @@
qdel(W)
if(7)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 100, 1)
var/turf/T = get_turf(user)
to_chat(user, "Attatching the mop to the frame...")
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm
index 4f37526a27..f524a1a69f 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/carbon/brain/MMI.dm
@@ -260,7 +260,7 @@
src.searching = 0
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("\The [src] buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
@@ -278,7 +278,7 @@
// to_chat(src.brainmob, "Use say #b to speak to other artificial intelligences.")
src.brainmob.mind.assigned_role = "Synthetic Brain"
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("\The [src] chimes quietly.")
diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm
index 488eda6e5c..c69440c879 100644
--- a/code/modules/mob/living/carbon/brain/posibrain.dm
+++ b/code/modules/mob/living/carbon/brain/posibrain.dm
@@ -66,7 +66,7 @@
to_chat(src.brainmob, "Use say #b to speak to other artificial intelligences.")
src.brainmob.mind.assigned_role = "Positronic Brain"
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("The positronic brain beeps as it loads a personality.")
playsound(src, 'sound/misc/boobeebeep.ogg', 50, 1)
@@ -80,7 +80,7 @@
src.searching = 0
icon_state = "posibrain"
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("The positronic brain buzzes and beeps, and the golden lights fade away. Perhaps you could try again?")
playsound(src, 'sound/misc/buzzbeep.ogg', 50, 1)
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index df195a495e..3d8dad93eb 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -13,8 +13,8 @@
return 0
//Apply weapon damage
- var/weapon_sharp = is_sharp(I)
- var/weapon_edge = has_edge(I)
+ var/weapon_sharp = I.sharp
+ var/weapon_edge = I.edge
var/hit_embed_chance = I.embed_chance
if(prob(getarmor(hit_zone, "melee"))) //melee armour provides a chance to turn sharp/edge weapon attacks into blunt ones
weapon_sharp = 0
diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm
index 013c033482..c80e9a739a 100644
--- a/code/modules/mob/living/carbon/human/human_damage.dm
+++ b/code/modules/mob/living/carbon/human/human_damage.dm
@@ -154,7 +154,7 @@
amount *= M.incoming_damage_percent
if(!isnull(M.incoming_brute_damage_percent))
amount *= M.incoming_brute_damage_percent
- O.take_damage(amount, 0, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
+ O.take_damage(amount, 0, damage_source.sharp, damage_source.edge, damage_source)
else
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_healing_percent))
@@ -175,7 +175,7 @@
amount *= M.incoming_damage_percent
if(!isnull(M.incoming_fire_damage_percent))
amount *= M.incoming_fire_damage_percent
- O.take_damage(0, amount, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
+ O.take_damage(0, amount, damage_source.sharp, damage_source.edge, damage_source)
else
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_healing_percent))
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index cdfef35b59..b356944655 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -441,14 +441,13 @@ emp_act
var/armor = run_armor_check(affecting, "melee", O.armor_penetration, "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
if(armor < 100)
- apply_damage(throw_damage, dtype, zone, armor, soaked, is_sharp(O), has_edge(O), O)
+ apply_damage(throw_damage, dtype, zone, armor, soaked, O.sharp, O.edge, O)
//thrown weapon embedded object code.
if(dtype == BRUTE && istype(O,/obj/item))
var/obj/item/I = O
if (!is_robot_module(I))
- var/sharp = is_sharp(I)
var/damage = throw_damage
if (soaked)
damage -= soaked
@@ -456,12 +455,11 @@ emp_act
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
- var/embed_chance = sharp? damage/I.w_class : damage/(I.w_class*3)
- var/embed_threshold = sharp? 5*I.w_class : 15*I.w_class
-
+ var/embed_chance = I.sharp ? damage/I.w_class : damage/(I.w_class*3)
+ var/embed_threshold = I.sharp ? 5*I.w_class : 15*I.w_class
//Sharp objects will always embed if they do enough damage.
//Thrown sharp objects have some momentum already and have a small chance to embed even if the damage is below the threshold
- if((sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))
+ if((I.sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))
affecting.embed(I)
// Begin BS12 momentum-transfer code.
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index b6e6ffc03f..81238fff6b 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -115,8 +115,8 @@
//Armor
var/soaked = get_armor_soak(def_zone, P.check_armour, P.armor_penetration)
var/absorb = run_armor_check(def_zone, P.check_armour, P.armor_penetration)
- var/proj_sharp = is_sharp(P)
- var/proj_edge = has_edge(P)
+ var/proj_sharp = P.sharp
+ var/proj_edge = P.edge
if ((proj_sharp || proj_edge) && (soaked >= round(P.damage*0.8)))
proj_sharp = 0
@@ -246,8 +246,8 @@
if(!effective_force || blocked >= 100)
return 0
//Apply weapon damage
- var/weapon_sharp = is_sharp(I)
- var/weapon_edge = has_edge(I)
+ var/weapon_sharp = I.sharp
+ var/weapon_edge = I.edge
if(getsoak(hit_zone, "melee",) - (I.armor_penetration/5) > round(effective_force*0.8)) //soaking a hit turns sharp attacks into blunt ones
weapon_sharp = 0
@@ -282,7 +282,7 @@
var/soaked = get_armor_soak(null, "melee")
- apply_damage(throw_damage, dtype, null, armor, soaked, is_sharp(O), has_edge(O), O)
+ apply_damage(throw_damage, dtype, null, armor, soaked, O.sharp, O.edge, O)
O.throwing = 0 //it hit, so stop moving
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 5006c24c8a..ebcd89f9d1 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -760,14 +760,14 @@ var/list/ai_verbs_default = list(
var/obj/item/device/aicard/card = W
card.grab_ai(src, user)
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(user == deployed_shell)
to_chat(user, "The shell's subsystems resist your efforts to tamper with your bolts.")
return
if(anchored)
playsound(src, W.usesound, 50, 1)
user.visible_message("\The [user] starts to unbolt \the [src] from the plating...")
- if(!do_after(user,40 * W.toolspeed))
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message("\The [user] decides not to unbolt \the [src].")
return
user.visible_message("\The [user] finishes unfastening \the [src]!")
@@ -776,7 +776,7 @@ var/list/ai_verbs_default = list(
else
playsound(src, W.usesound, 50, 1)
user.visible_message("\The [user] starts to bolt \the [src] to the plating...")
- if(!do_after(user,40 * W.toolspeed))
+ if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message("\The [user] decides not to bolt \the [src].")
return
user.visible_message("\The [user] finishes fastening down \the [src]!")
diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm
index e4f461179d..755010d1bc 100644
--- a/code/modules/mob/living/silicon/pai/life.dm
+++ b/code/modules/mob/living/silicon/pai/life.dm
@@ -5,7 +5,7 @@
if(src.cable)
if(get_dist(src, src.cable) > 1)
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("The data cable rapidly retracts back into its spool.", 3, "You hear a click and the sound of wire spooling rapidly.", 2)
playsound(src, 'sound/machines/click.ogg', 50, 1)
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index fcc1fd62df..06fe2447ee 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -162,7 +162,7 @@
src.silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
to_chat(src, "Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete.")
if(prob(20))
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("A shower of sparks spray from [src]'s inner workings.", 3, "You hear and smell the ozone hiss of electrical sparks being expelled violently.", 2)
return src.death(0)
diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm
index a2a0e3e411..ef0589cca0 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone.dm
@@ -178,7 +178,7 @@ var/list/mob_hat_cache = list()
to_chat(user, "\The [src] is not compatible with \the [W].")
return
- else if (W.is_crowbar())
+ else if (W.get_tool_quality(TOOL_CROWBAR))
to_chat(user, "\The [src] is hermetically sealed. You can't open the case.")
return
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 30d3cfaca5..c86976e01b 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -540,7 +540,7 @@
for(var/mob/O in viewers(user, null))
O.show_message(text("[user] has fixed some of the burnt wires on [src]!"), 1)
- else if (W.is_crowbar() && user.a_intent != I_HURT) // crowbar means open or close the cover
+ else if (W.get_tool_quality(TOOL_CROWBAR) && user.a_intent != I_HURT) // crowbar means open or close the cover
if(opened)
if(cell)
to_chat(user, "You close the cover.")
@@ -617,26 +617,26 @@
C.brute_damage = 0
C.electronics_damage = 0
- else if (W.is_wirecutter() || istype(W, /obj/item/device/multitool))
+ else if (W.get_tool_quality(TOOL_WIRECUTTER) || W.get_tool_quality(TOOL_MULTITOOL))
if (wiresexposed)
wires.Interact(user)
else
to_chat(user, "You can't reach the wiring.")
- else if(W.is_screwdriver() && opened && !cell) // haxing
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && opened && !cell) // haxing
wiresexposed = !wiresexposed
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
playsound(src, W.usesound, 50, 1)
updateicon()
- else if(W.is_screwdriver() && opened && cell) // radio
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER) && opened && cell) // radio
if(radio)
radio.attackby(W,user)//Push it to the radio to let it handle everything
else
to_chat(user, "Unable to locate a radio.")
updateicon()
- else if(W.is_wrench() && opened && !cell)
+ else if(W.get_tool_quality(TOOL_WRENCH) && opened && !cell)
if(bolt)
to_chat(user,"You begin removing \the [bolt].")
diff --git a/code/modules/mob/living/simple_mob/butchering.dm b/code/modules/mob/living/simple_mob/butchering.dm
index c03c6b8015..a1df4087de 100644
--- a/code/modules/mob/living/simple_mob/butchering.dm
+++ b/code/modules/mob/living/simple_mob/butchering.dm
@@ -2,7 +2,4 @@
gib_on_butchery = TRUE
/mob/living/simple_mob/can_butcher(var/mob/user, var/obj/item/I) // Override for special butchering checks.
- . = ..()
-
- if(. && (!is_sharp(I) || !has_edge(I)))
- return FALSE
+ return ..() && I.sharp && I.edge
\ No newline at end of file
diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm
index 94737e4b67..35dd3c6411 100644
--- a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm
@@ -64,7 +64,7 @@
if(!(P.damage_type == BRUTE || P.damage_type == BURN))
projectile_dam_type = BRUTE
incoming_damage = round(incoming_damage / 4) //Damage from strange sources is converted to brute for physical projectiles, though severely decreased.
- apply_damage(incoming_damage, projectile_dam_type, null, armorcheck, soakedcheck, is_sharp(P), has_edge(P), P)
+ apply_damage(incoming_damage, projectile_dam_type, null, armorcheck, soakedcheck, P.sharp, P.edge, P)
return -1 //Doesn't reflect non-beams or non-energy projectiles. They just smack and drop with little to no effect.
else
visible_message("The [P.name] gets reflected by [src]'s shell!", \
@@ -74,7 +74,7 @@
if(!(P.damage_type == BRUTE || P.damage_type == BURN))
projectile_dam_type = BURN
incoming_damage = round(incoming_damage / 4) //Damage from strange sources is converted to burn for energy-type projectiles, though severely decreased.
- apply_damage(incoming_damage, P.damage_type, null, armorcheck, soakedcheck, is_sharp(P), has_edge(P), P)
+ apply_damage(incoming_damage, P.damage_type, null, armorcheck, soakedcheck, P.sharp, P.edge, P)
// Find a turf near or on the original location to bounce to
if(P.starting)
diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm
index 24c02c1add..3defb5b740 100644
--- a/code/modules/modular_computers/computers/modular_computer/interaction.dm
+++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm
@@ -146,7 +146,7 @@
try_install_component(user, C)
else
to_chat(user, "This component is too large for \the [src].")
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
var/list/components = get_all_components()
if(components.len)
to_chat(user, "Remove all components from \the [src] before disassembling it.")
@@ -171,7 +171,7 @@
to_chat(user, "You repair \the [src].")
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
var/list/all_components = get_all_components()
if(!all_components.len)
to_chat(user, "This device doesn't have any components installed.")
diff --git a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
index 9ba516a02c..52005fd6b9 100644
--- a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
+++ b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
@@ -25,7 +25,7 @@
name = "telescreen"
/obj/item/modular_computer/telescreen/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if(anchored)
shutdown_computer()
anchored = FALSE
diff --git a/code/modules/organs/internal/augment/armmounted.dm b/code/modules/organs/internal/augment/armmounted.dm
index c22988de83..27e7a4334a 100644
--- a/code/modules/organs/internal/augment/armmounted.dm
+++ b/code/modules/organs/internal/augment/armmounted.dm
@@ -21,7 +21,7 @@
integrated_object_type = /obj/item/weapon/gun/energy/laser/mounted/augment
/obj/item/organ/internal/augment/armmounted/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
switch(organ_tag)
if(O_AUG_L_FOREARM)
organ_tag = O_AUG_R_FOREARM
@@ -66,7 +66,7 @@
integrated_object_type = /obj/item/weapon/portable_scanner
/obj/item/organ/internal/augment/armmounted/hand/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
switch(organ_tag)
if(O_AUG_L_HAND)
organ_tag = O_AUG_R_HAND
@@ -110,7 +110,7 @@
integrated_object_type = null
/obj/item/organ/internal/augment/armmounted/shoulder/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
switch(organ_tag)
if(O_AUG_L_UPPERARM)
organ_tag = O_AUG_R_UPPERARM
@@ -166,8 +166,6 @@
integrated_object_type = null
- toolspeed = 0.8
-
var/list/integrated_tools = list(
/obj/item/weapon/tool/screwdriver = null,
/obj/item/weapon/tool/wrench = null,
@@ -211,7 +209,8 @@
integrated_tools[path] = new path(src)
var/obj/item/I = integrated_tools[path]
I.canremove = FALSE
- I.toolspeed = toolspeed
+ for(var/quality in I.tool_qualities)
+ I.set_tool_quality(quality, TOOL_QUALITY_MEDIOCRE)
I.my_augment = src
I.name = "integrated [I.name]"
diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm
index 103c64a925..cc9baf8314 100644
--- a/code/modules/organs/organ.dm
+++ b/code/modules/organs/organ.dm
@@ -458,20 +458,11 @@ var/list/organ_cache = list()
return ..()
/obj/item/organ/proc/can_butcher(var/obj/item/O, var/mob/living/user)
- if(butcherable && meat_type)
-
- if(istype(O, /obj/machinery/gibber)) // The great equalizer.
- return TRUE
-
- if(robotic >= ORGAN_ROBOT)
- if(O.is_screwdriver())
- return TRUE
-
- else
- if(is_sharp(O) && has_edge(O))
- return TRUE
-
- return FALSE
+ return (butcherable && meat_type) && ( \
+ istype(O, /obj/machinery/gibber) || \
+ (robotic >= ORGAN_ROBOT && O.get_tool_quality(TOOL_SCREWDRIVER)) || \
+ (O.sharp && O.edge)
+ )
/obj/item/organ/proc/butcher(var/obj/item/O, var/mob/living/user, var/atom/newtarget)
if(robotic >= ORGAN_ROBOT)
diff --git a/code/modules/overmap/overmap_shuttle.dm b/code/modules/overmap/overmap_shuttle.dm
index ad07f274bc..4268a4e529 100644
--- a/code/modules/overmap/overmap_shuttle.dm
+++ b/code/modules/overmap/overmap_shuttle.dm
@@ -167,7 +167,7 @@
..()
/obj/structure/fuel_port/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if(opened)
to_chat(user, "You tightly shut \the [src] door.")
playsound(src, 'sound/effects/locker_close.ogg', 25, 0, -3)
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index 5c2031df83..50bf0830d3 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -120,7 +120,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
SSnanoui.update_uis(src)
/obj/machinery/photocopier/faxmachine/attackby(obj/item/O as obj, mob/user as mob)
- if(O.is_multitool() && panel_open)
+ if(O.get_tool_quality(TOOL_MULTITOOL) && panel_open)
var/input = sanitize(input(usr, "What Department ID would you like to give this fax machine?", "Multitool-Fax Machine Interface", department))
if(!input)
to_chat(usr, "No input found. Please hang up and try your call again.")
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index c4fa72a9b5..4939645484 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -38,14 +38,14 @@
P.loc = src
open_animation()
SStgui.update_uis(src)
- else if(P.is_wrench())
+ else if(P.get_tool_quality(TOOL_WRENCH))
playsound(src, P.usesound, 50, 1)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
- else if(P.is_screwdriver())
+ else if(P.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You begin taking the [name] apart.")
playsound(src, P.usesound, 50, 1)
- if(do_after(user, 10 * P.toolspeed))
+ if(do_after(user, 10 * P.get_tool_speed(TOOL_SCREWDRIVER)))
playsound(src, P.usesound, 50, 1)
to_chat(user, "You take the [name] apart.")
new /obj/item/stack/material/steel( src.loc, 4 )
diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm
index 0a10eabc23..77b7b08e6d 100644
--- a/code/modules/paperwork/papershredder.dm
+++ b/code/modules/paperwork/papershredder.dm
@@ -35,7 +35,7 @@
if(istype(W, /obj/item/weapon/storage))
empty_bin(user, W)
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 50, 1)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 5d554b05d3..a47507392c 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -156,7 +156,7 @@
qdel(O)
else
to_chat(user, "This cartridge is not yet ready for replacement! Use up the rest of the toner.")
- else if(O.is_wrench())
+ else if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 50, 1)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
diff --git a/code/modules/pda/core_apps.dm b/code/modules/pda/core_apps.dm
index 4b561c9844..a442c048d6 100644
--- a/code/modules/pda/core_apps.dm
+++ b/code/modules/pda/core_apps.dm
@@ -35,7 +35,7 @@
if(1) // Configure pAI device
pda.pai.attack_self(usr)
if(2) // Eject pAI device
- var/turf/T = get_turf_or_move(pda.loc)
+ var/turf/T = get_turf(pda.loc)
if(T)
pda.pai.loc = T
pda.pai = null
diff --git a/code/modules/persistence/noticeboard.dm b/code/modules/persistence/noticeboard.dm
index edccbc4c67..06c6b3da9e 100644
--- a/code/modules/persistence/noticeboard.dm
+++ b/code/modules/persistence/noticeboard.dm
@@ -85,7 +85,7 @@
icon_state = "[base_icon_state][LAZYLEN(notices)]"
/obj/structure/noticeboard/attackby(var/obj/item/weapon/thing, var/mob/user)
- if(thing.is_screwdriver())
+ if(thing.get_tool_quality(TOOL_SCREWDRIVER))
var/choice = input("Which direction do you wish to place the noticeboard?", "Noticeboard Offset") as null|anything in list("North", "South", "East", "West")
if(choice && Adjacent(user) && thing.loc == user && !user.incapacitated())
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
@@ -103,7 +103,7 @@
pixel_x = -32
pixel_y = 0
return
- else if(thing.is_wrench())
+ else if(thing.get_tool_quality(TOOL_WRENCH))
visible_message(SPAN_WARNING("\The [user] begins dismantling \the [src]."))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 50, src))
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index c5a0e152c0..bb28b70ba4 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -140,7 +140,7 @@
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user)
if(!istype(W) || !user) return
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(!anchored)
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 002427435e..901447c1cc 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -480,14 +480,14 @@ GLOBAL_LIST_EMPTY(apcs)
if(issilicon(user) && get_dist(src,user) > 1)
return attack_hand(user)
add_fingerprint(user)
- if(W.is_crowbar() && opened)
+ if(W.get_tool_quality(TOOL_CROWBAR) && opened)
if(has_electronics == APC_HAS_ELECTRONICS_WIRED)
if(terminal)
to_chat(user, "Disconnect the wires first.")
return
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to remove the power control board...") //lpeters - fixed grammar issues //Ner - grrrrrr
- if(do_after(user, 50 * W.toolspeed))
+ if(do_after(user, 50 * W.get_tool_speed(TOOL_CROWBAR)))
if(has_electronics == APC_HAS_ELECTRONICS_WIRED)
has_electronics = APC_HAS_ELECTRONICS_NONE
if((stat & BROKEN))
@@ -504,7 +504,7 @@ GLOBAL_LIST_EMPTY(apcs)
else if(opened != 2) //cover isn't removed
opened = 0
update_icon()
- else if(W.is_crowbar() && !(stat & BROKEN) )
+ else if(W.get_tool_quality(TOOL_CROWBAR) && !(stat & BROKEN) )
if(coverlocked && !(stat & MAINT))
to_chat(user, "The cover is locked and cannot be opened.")
return
@@ -530,7 +530,7 @@ GLOBAL_LIST_EMPTY(apcs)
"You insert the power cell.")
chargecount = 0
update_icon()
- else if (W.is_screwdriver()) // haxing
+ else if (W.get_tool_quality(TOOL_SCREWDRIVER)) // haxing
if(opened)
if(cell)
to_chat(user, "Remove the power cell first.")
@@ -586,7 +586,7 @@ GLOBAL_LIST_EMPTY(apcs)
"You add cables to the APC frame.")
make_terminal()
terminal.connect_to_network()
- else if(W.is_wirecutter() && terminal && opened && has_electronics != APC_HAS_ELECTRONICS_SECURED)
+ else if(W.get_tool_quality(TOOL_WIRECUTTER) && terminal && opened && has_electronics != APC_HAS_ELECTRONICS_SECURED)
var/turf/T = loc
if(istype(T) && !T.is_plating())
to_chat(user, "You must remove the floor plating in front of the APC first.")
@@ -594,7 +594,7 @@ GLOBAL_LIST_EMPTY(apcs)
user.visible_message("[user.name] starts dismantling the [src]'s power terminal.", \
"You begin to cut the cables...")
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
- if(do_after(user, 50 * W.toolspeed))
+ if(do_after(user, 50 * W.get_tool_speed(TOOL_WIRECUTTER)))
if(terminal && opened && has_electronics != APC_HAS_ELECTRONICS_SECURED)
if(prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
@@ -618,7 +618,7 @@ GLOBAL_LIST_EMPTY(apcs)
else if(istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics == APC_HAS_ELECTRONICS_NONE && ((stat & BROKEN)))
to_chat(user, "The [src] is too broken for that. Repair it first.")
return
- else if(istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics == APC_HAS_ELECTRONICS_NONE && !terminal)
+ else if(W.get_tool_quality(TOOL_WELDER) && opened && has_electronics == APC_HAS_ELECTRONICS_NONE && !terminal)
var/obj/item/weapon/weldingtool/WT = W
if(WT.get_fuel() < 3)
to_chat(user, "You need more welding fuel to complete this task.")
@@ -627,7 +627,7 @@ GLOBAL_LIST_EMPTY(apcs)
"You start welding the APC frame...", \
"You hear welding.")
playsound(src, WT.usesound, 25, 1)
- if(do_after(user, 50 * WT.toolspeed))
+ if(do_after(user, 50 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.remove_fuel(3, user)) return
if(emagged || (stat & BROKEN) || opened==2)
new /obj/item/stack/material/steel(loc)
@@ -685,9 +685,10 @@ GLOBAL_LIST_EMPTY(apcs)
"You hear a bang!")
update_icon()
else
- if(istype(user, /mob/living/silicon))
- return attack_hand(user)
- if(!opened && wiresexposed && (istype(W, /obj/item/device/multitool) || W.is_wirecutter() || istype(W, /obj/item/device/assembly/signaler)))
+ if(istype(user, /mob/living/silicon) || ( \
+ !opened && wiresexposed && ( \
+ W.get_tool_quality(TOOL_MULTITOOL) || W.get_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/device/assembly/signaler)
+ ) ) )
return attack_hand(user)
//Placeholder until someone can do take_damage() for APCs or something.
to_chat(user, "The [name] looks too sturdy to bash open with \the [W.name].")
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 68aaf533d1..032eda7a6c 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -176,7 +176,7 @@ var/list/possible_cable_coil_colours = list(
if(!T.is_plating())
return
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
var/obj/item/stack/cable_coil/CC
if(d1 == UP || d2 == UP)
to_chat(user, "You must cut this cable from above.")
@@ -510,7 +510,7 @@ var/list/possible_cable_coil_colours = list(
stacktype = /obj/item/stack/cable_coil
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
- tool_qualities = list(TOOL_CABLE_COIL)
+ tool_qualities = list(TOOL_CABLE_COIL = TOOL_QUALITY_STANDARD)
/obj/item/stack/cable_coil/cyborg
name = "cable coil synthesizer"
@@ -947,7 +947,7 @@ var/list/possible_cable_coil_colours = list(
slot_flags = SLOT_BELT
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
stacktype = null
- toolspeed = 0.25
+ tool_qualities = list(TOOL_CABLE_COIL = TOOL_QUALITY_GOOD)
/obj/item/stack/cable_coil/alien/Initialize(var/ml, length = MAXCOIL, var/param_color = null) //There has to be a better way to do this.
. = ..()
diff --git a/code/modules/power/cable_ender.dm b/code/modules/power/cable_ender.dm
index 20ca1fdd05..bda5115053 100644
--- a/code/modules/power/cable_ender.dm
+++ b/code/modules/power/cable_ender.dm
@@ -24,7 +24,7 @@
/obj/structure/cable/ender/attackby(obj/item/W, mob/user)
src.add_fingerprint(user)
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
to_chat(user, " These cables are too tough to be cut with those [W.name].")
return
else if(istype(W, /obj/item/stack/cable_coil))
diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm
index 692dcd73d9..76122c53b6 100644
--- a/code/modules/power/cable_heavyduty.dm
+++ b/code/modules/power/cable_heavyduty.dm
@@ -17,7 +17,7 @@
if(!T.is_plating())
return
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
to_chat(usr, "These cables are too tough to be cut with those [W.name].")
return
else if(istype(W, /obj/item/stack/cable_coil))
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
index adb661c25b..b70a28120c 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
@@ -68,7 +68,7 @@ GLOBAL_LIST_EMPTY(fuel_injectors)
cur_assembly = W
return
- if(W.is_wrench() || W.is_screwdriver() || W.is_crowbar() || istype(W, /obj/item/weapon/storage/part_replacer))
+ if(W.get_tool_quality(TOOL_WRENCH) || W.get_tool_quality(TOOL_SCREWDRIVER) || W.get_tool_quality(TOOL_CROWBAR) || istype(W, /obj/item/weapon/storage/part_replacer))
if(injecting)
to_chat(user, "Shut \the [src] off first!")
return
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index a9159f7f1c..2e2062b565 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -169,7 +169,7 @@ GLOBAL_LIST_EMPTY(all_turbines)
attack_hand(user)
/obj/machinery/power/generator/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/modules/power/grid_checker.dm b/code/modules/power/grid_checker.dm
index 224eade429..124359bc88 100644
--- a/code/modules/power/grid_checker.dm
+++ b/code/modules/power/grid_checker.dm
@@ -38,12 +38,12 @@
/obj/machinery/power/grid_checker/attackby(obj/item/W, mob/user)
if(!user)
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
default_deconstruction_screwdriver(user, W)
opened = !opened
- else if(W.is_crowbar())
+ else if(W.get_tool_quality(TOOL_CROWBAR))
default_deconstruction_crowbar(user, W)
- else if(istype(W, /obj/item/device/multitool) || W.is_wirecutter())
+ else if(W.get_tool_quality(TOOL_MULTITOOL) || W.get_tool_quality(TOOL_WIRECUTTER))
attack_hand(user)
/obj/machinery/power/grid_checker/attack_hand(mob/user)
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 77faa08465..99b09893b5 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -103,11 +103,11 @@ var/global/list/light_type_cache = list()
add_fingerprint(user)
return
- if (W.is_wrench())
+ if (W.get_tool_quality(TOOL_WRENCH))
if (src.stage == 1)
playsound(src, W.usesound, 75, 1)
to_chat(usr, "You begin deconstructing [src].")
- if (!do_after(usr, 30 * W.toolspeed))
+ if (!do_after(usr, 30 * W.get_tool_speed(TOOL_WRENCH)))
return
new /obj/item/stack/material/steel( get_turf(src.loc), sheets_refunded )
user.visible_message("[user.name] deconstructs [src].", \
@@ -122,7 +122,7 @@ var/global/list/light_type_cache = list()
to_chat(usr, "You have to unscrew the case first.")
return
- if(W.is_wirecutter())
+ if(W.get_tool_quality(TOOL_WIRECUTTER))
if (src.stage != 2) return
src.stage = 1
src.update_icon()
@@ -142,7 +142,7 @@ var/global/list/light_type_cache = list()
"You add wires to [src].")
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if (src.stage == 2)
src.stage = 3
src.update_icon()
@@ -558,7 +558,7 @@ var/global/list/light_type_cache = list()
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
- if(W.is_screwdriver()) //If it's a screwdriver open it.
+ if(W.get_tool_quality(TOOL_SCREWDRIVER)) //If it's a screwdriver open it.
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] opens [src]'s casing.", \
"You open [src]'s casing.", "You hear a noise.")
@@ -576,7 +576,7 @@ var/global/list/light_type_cache = list()
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
/obj/machinery/light/flamp/attackby(obj/item/W, mob/user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, W.usesound, 50, 1)
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
@@ -589,7 +589,7 @@ var/global/list/light_type_cache = list()
return
else
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] removes [src]'s lamp shade.", \
"You remove [src]'s lamp shade.", "You hear a noise.")
diff --git a/code/modules/power/pacman2.dm b/code/modules/power/pacman2.dm
index dffcce3da7..4090349889 100644
--- a/code/modules/power/pacman2.dm
+++ b/code/modules/power/pacman2.dm
@@ -71,7 +71,7 @@
O.loc = src
to_chat(user, "You add the phoron tank to the generator.")
else if(!active)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
if(anchored)
@@ -79,14 +79,14 @@
else
to_chat(user, "You unsecure the generator from the floor.")
SSmachines.makepowernets()
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
open = !open
playsound(src, O.usesound, 50, 1)
if(open)
to_chat(user, "You open the access panel.")
else
to_chat(user, "You close the access panel.")
- else if(O.is_crowbar() && !open)
+ else if(O.get_tool_quality(TOOL_CROWBAR) && !open)
playsound(src, O.usesound, 50, 1)
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
for(var/obj/item/I in component_parts)
diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm
index f5c3d81676..f75c966a14 100644
--- a/code/modules/power/port_gen.dm
+++ b/code/modules/power/port_gen.dm
@@ -275,7 +275,7 @@
updateUsrDialog()
return
else if(!active)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
if(!anchored)
connect_to_network()
to_chat(user, "You secure the generator to the floor.")
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index c3b79601e7..1cb8857ec5 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -71,11 +71,11 @@ var/global/list/rad_collectors = list()
W.loc = src
update_icons()
return 1
- else if(W.is_crowbar())
+ else if(W.get_tool_quality(TOOL_CROWBAR))
if(P && !src.locked)
eject()
return 1
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(P)
to_chat(user, "Remove the phoron tank first.")
return 1
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index c10f283735..2cc8bcbff0 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -147,7 +147,7 @@
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(active)
to_chat(user, "Turn off [src] first.")
return
@@ -171,7 +171,7 @@
to_chat(user, "\The [src] needs to be unwelded from the floor.")
return
- if(istype(W, /obj/item/weapon/weldingtool))
+ if(W.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = W
if(active)
to_chat(user, "Turn off [src] first.")
@@ -185,7 +185,7 @@
user.visible_message("[user.name] starts to weld [src] to the floor.", \
"You start to weld [src] to the floor.", \
"You hear welding")
- if (do_after(user,20 * WT.toolspeed))
+ if (do_after(user,20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
state = 2
to_chat(user, "You weld [src] to the floor.")
@@ -198,7 +198,7 @@
user.visible_message("[user.name] starts to cut [src] free from the floor.", \
"You start to cut [src] free from the floor.", \
"You hear welding")
- if (do_after(user,20 * WT.toolspeed))
+ if (do_after(user,20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
state = 1
to_chat(user, "You cut [src] free from the floor.")
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index ef3258d8c1..a8ef213e60 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -103,7 +103,7 @@ field_generator power level display
if(active)
to_chat(user, "The [src] needs to be off.")
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
switch(state)
if(0)
state = 1
@@ -122,7 +122,7 @@ field_generator power level display
if(2)
to_chat(user, "The [src.name] needs to be unwelded from the floor.")
return
- else if(istype(W, /obj/item/weapon/weldingtool))
+ else if(W.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = W
switch(state)
if(0)
@@ -134,7 +134,7 @@ field_generator power level display
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
"You start to weld the [src] to the floor.", \
"You hear welding")
- if (do_after(user,20 * WT.toolspeed))
+ if (do_after(user,20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
state = 2
to_chat(user, "You weld the field generator to the floor.")
@@ -146,7 +146,7 @@ field_generator power level display
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
"You start to cut the [src] free from the floor.", \
"You hear welding")
- if (do_after(user,20 * WT.toolspeed))
+ if (do_after(user,20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
state = 1
to_chat(user, "You cut the [src] free from the floor.")
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index 213b37d01a..9bf4e48c03 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -17,7 +17,7 @@
if(src) qdel(src)
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, W.usesound, 75, 1)
if(anchored)
@@ -29,13 +29,13 @@
"You unsecure the [src.name] from the floor.", \
"You hear a ratchet.")
return
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
playsound(src, W.usesound, 50, 1)
visible_message("\The [user] adjusts \the [src]'s mechanisms.")
if(panel_open && do_after(user, 30))
to_chat(user, "\The [src] looks like it could be modified.")
- if(panel_open && do_after(user, 80 * W.toolspeed)) // We don't have skills, so a delayed hint for engineers will have to do for now. (Panel open check for sanity)
+ if(panel_open && do_after(user, 80 * W.get_tool_speed(TOOL_SCREWDRIVER))) // We don't have skills, so a delayed hint for engineers will have to do for now. (Panel open check for sanity)
playsound(src, W.usesound, 50, 1)
to_chat(user, "\The [src] looks like it could be adapted to forge advanced materials via particle acceleration, somehow..")
else
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index 6d7108fbd6..bba1137ed8 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -125,13 +125,8 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
. += "It is assembled."
/obj/structure/particle_accelerator/attackby(obj/item/W, mob/user)
- if(istool(W))
- if(src.process_tool_hit(W,user))
- return
- ..()
- return
-
-
+ return src.process_tool_hit(W,user) || ..()
+
/obj/structure/particle_accelerator/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
if(master?.active)
@@ -197,21 +192,21 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
/obj/structure/particle_accelerator/proc/process_tool_hit(var/obj/item/O, var/mob/user)
if(!(O) || !(user))
- return 0
+ return FALSE
if(!ismob(user) || !isobj(O))
- return 0
+ return FALSE
var/temp_state = src.construction_state
switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 75, 1)
src.anchored = 1
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"You secure the external bolts.")
temp_state++
if(1)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 75, 1)
src.anchored = 0
user.visible_message("[user.name] detaches the [src.name] from the floor.", \
@@ -223,27 +218,27 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
"You add some wires.")
temp_state++
if(2)
- if(O.is_wirecutter())//TODO:Shock user if its on?
+ if(O.get_tool_quality(TOOL_WIRECUTTER))//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [src.name].", \
"You remove some wires.")
temp_state--
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
user.visible_message("[user.name] closes the [src.name]'s access panel.", \
"You close the access panel.")
temp_state++
if(3)
- if(O.is_screwdriver())
+ if(O.get_tool_quality(TOOL_SCREWDRIVER))
user.visible_message("[user.name] opens the [src.name]'s access panel.", \
"You open the access panel.")
temp_state--
if(temp_state == src.construction_state)//Nothing changed
- return 0
- else
- src.construction_state = temp_state
- if(src.construction_state < 3)//Was taken apart, update state
- update_state()
- update_icon()
- return 1
+ return FALSE
+
+ src.construction_state = temp_state
+ if(src.construction_state < 3)//Was taken apart, update state
+ update_state()
+ update_icon()
+ return TRUE
@@ -305,11 +300,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
/obj/machinery/particle_accelerator/attackby(obj/item/W, mob/user)
- if(istool(W))
- if(src.process_tool_hit(W,user))
- return
- ..()
- return
+ return src.process_tool_hit(W,user) || ..()
/obj/machinery/particle_accelerator/ex_act(severity)
switch(severity)
@@ -332,20 +323,20 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
/obj/machinery/particle_accelerator/proc/process_tool_hit(var/obj/item/O, var/mob/user)
if(!(O) || !(user))
- return 0
+ return FALSE
if(!ismob(user) || !isobj(O))
- return 0
+ return FALSE
var/temp_state = src.construction_state
switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 75, 1)
src.anchored = 1
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"You secure the external bolts.")
temp_state++
if(1)
- if(O.is_wrench())
+ if(O.get_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 75, 1)
src.anchored = 0
user.visible_message("[user.name] detaches the [src.name] from the floor.", \
@@ -357,29 +348,29 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
"You add some wires.")
temp_state++
if(2)
- if(O.is_wirecutter())//TODO:Shock user if its on?
+ if(O.get_tool_quality(TOOL_WIRECUTTER))//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [src.name].", \
"You remove some wires.")
temp_state--
- else if(O.is_screwdriver())
+ else if(O.get_tool_quality(TOOL_SCREWDRIVER))
user.visible_message("[user.name] closes the [src.name]'s access panel.", \
"You close the access panel.")
temp_state++
if(3)
- if(O.is_screwdriver())
+ if(O.get_tool_quality(TOOL_SCREWDRIVER))
user.visible_message("[user.name] opens the [src.name]'s access panel.", \
"You open the access panel.")
temp_state--
active = 0
if(temp_state == src.construction_state)//Nothing changed
- return 0
- else
- if(src.construction_state < 3)//Was taken apart, update state
- update_state()
- if(use_power)
- update_use_power(USE_POWER_OFF)
- src.construction_state = temp_state
- if(src.construction_state >= 3)
- update_use_power(USE_POWER_IDLE)
- update_icon()
- return 1
+ return FALSE
+
+ if(src.construction_state < 3)//Was taken apart, update state
+ update_state()
+ if(use_power)
+ update_use_power(USE_POWER_OFF)
+ src.construction_state = temp_state
+ if(src.construction_state >= 3)
+ update_use_power(USE_POWER_IDLE)
+ update_icon()
+ return TRUE
diff --git a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm
index adff836cee..208a9099b0 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm
@@ -71,7 +71,7 @@
to_chat(user, "You add \the [reagent_container] to \the [src].")
update_icon()
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, W.usesound, 75, 1)
if(anchored)
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 0ea630d7bd..6580f7e77e 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -308,7 +308,7 @@ GLOBAL_LIST_EMPTY(smeses)
stat = 0
return FALSE
- else if(W.is_wirecutter() && !building_terminal)
+ else if(W.get_tool_quality(TOOL_WIRECUTTER) && !building_terminal)
building_terminal = TRUE
var/obj/machinery/power/terminal/term
for(var/obj/machinery/power/terminal/T in get_turf(user))
@@ -326,7 +326,7 @@ GLOBAL_LIST_EMPTY(smeses)
else
to_chat(user, "You begin to cut the cables...")
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
- if(do_after(user, 50 * W.toolspeed))
+ if(do_after(user, 50 * W.get_tool_speed(TOOL_WIRECUTTER)))
if (prob(50) && electrocute_mob(usr, term.powernet, term))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm
index 1f5391ab50..015eb98fa8 100644
--- a/code/modules/power/smes_construction.dm
+++ b/code/modules/power/smes_construction.dm
@@ -328,14 +328,14 @@
failure_probability = 0
// Crowbar - Disassemble the SMES.
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
if (terminals.len)
to_chat(user, "You have to disassemble the terminal first!")
return
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to disassemble the [src]!")
- if (do_after(usr, (100 * cur_coils) * W.toolspeed)) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s with a normal crowbar
+ if (do_after(usr, (100 * cur_coils) * W.get_tool_speed(TOOL_CROWBAR))) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s with a normal crowbar
if (failure_probability && prob(failure_probability))
total_system_failure(failure_probability, user)
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 086b887931..b3f50e69d4 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -55,7 +55,7 @@ GLOBAL_LIST_EMPTY(solars_list)
/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
playsound(src, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar panel.")
if(do_after(user, 50))
@@ -212,13 +212,13 @@ GLOBAL_LIST_EMPTY(solars_list)
if (!isturf(loc))
return 0
if(!anchored)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
anchored = 1
user.visible_message("[user] wrenches the solar assembly into place.")
playsound(src, W.usesound, 75, 1)
return 1
else
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
anchored = 0
user.visible_message("[user] unwrenches the solar assembly from it's place.")
playsound(src, W.usesound, 75, 1)
@@ -247,7 +247,7 @@ GLOBAL_LIST_EMPTY(solars_list)
user.visible_message("[user] inserts the electronics into the solar assembly.")
return 1
else
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
new /obj/item/weapon/tracker_electronics(src.loc)
tracker = 0
user.visible_message("[user] takes out the electronics from the solar assembly.")
@@ -407,7 +407,7 @@ GLOBAL_LIST_EMPTY(solars_list)
return data
/obj/machinery/power/solar_control/attackby(obj/item/I, user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, I.usesound, 50, 1)
if(do_after(user, 20))
if (src.stat & BROKEN)
diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm
index 5c262b5983..268435530d 100644
--- a/code/modules/power/tesla/coil.dm
+++ b/code/modules/power/tesla/coil.dm
@@ -50,13 +50,13 @@
//if(default_deconstruction_screwdriver(user, "coil_open[anchored]", "coil[anchored]", W))
if(default_deconstruction_screwdriver(user, W))
- return
+ return FALSE
if(default_part_replacement(user, W))
- return
+ return FALSE
if(default_unfasten_wrench(user, W))
- return
+ return FALSE
if(default_deconstruction_crowbar(user, W))
- return
+ return FALSE
if(is_wire_tool(W))
return wires.Interact(user)
return ..()
diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm
index c03d7db3b6..13cf964462 100644
--- a/code/modules/power/tracker.dm
+++ b/code/modules/power/tracker.dm
@@ -51,7 +51,7 @@
/obj/machinery/power/tracker/attackby(var/obj/item/weapon/W, var/mob/user)
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
playsound(src, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar tracker.")
if(do_after(user, 50))
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index 42b875deba..f17ec28758 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -31,7 +31,7 @@
update_icon()
/obj/item/ammo_casing/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(!BB)
to_chat(user, "There is no bullet in the casing to inscribe anything into.")
return
diff --git a/code/modules/projectiles/ammunition/smartmag.dm b/code/modules/projectiles/ammunition/smartmag.dm
index 3cc4add9cb..cf301c487a 100644
--- a/code/modules/projectiles/ammunition/smartmag.dm
+++ b/code/modules/projectiles/ammunition/smartmag.dm
@@ -87,7 +87,7 @@
update_icon()
return
- else if(I.is_screwdriver())
+ else if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(attached_cell)
to_chat(user, "You begin removing \the [attached_cell] from \the [src].")
if(do_after(user, 10)) // Faster than doing it by hand
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 2f470b0f0e..89130c3ff9 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -250,11 +250,11 @@
verbs += /obj/item/weapon/gun/verb/allow_dna
return
- if(A.is_screwdriver())
+ if(A.get_tool_quality(TOOL_SCREWDRIVER))
if(dna_lock && attached_lock && !attached_lock.controller_lock)
to_chat(user, "You begin removing \the [attached_lock] from \the [src].")
playsound(src, A.usesound, 50, 1)
- if(do_after(user, 25 * A.toolspeed))
+ if(do_after(user, 25 * A.get_tool_speed(TOOL_SCREWDRIVER)))
to_chat(user, "You remove \the [attached_lock] from \the [src].")
user.put_in_hands(attached_lock)
dna_lock = 0
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index 9de4027392..cf82927a8f 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -166,7 +166,7 @@
else
to_chat(user, "[src] already has a cell installed.")
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(cell)
var/obj/item/C = cell
C.loc = get_turf(user)
@@ -274,7 +274,7 @@
else
to_chat(user, "You need at least three plastic sheets to complete this task.")
return
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(buildstate == 5)
to_chat(user, "You secure the crossbow's various parts.")
playsound(src, W.usesound, 50, 1)
diff --git a/code/modules/projectiles/guns/magnetic/bore.dm b/code/modules/projectiles/guns/magnetic/bore.dm
index eea444fbf6..185f868f2b 100644
--- a/code/modules/projectiles/guns/magnetic/bore.dm
+++ b/code/modules/projectiles/guns/magnetic/bore.dm
@@ -86,7 +86,7 @@
/obj/item/weapon/gun/magnetic/matfed/attackby(var/obj/item/thing, var/mob/user)
if(removable_components)
- if(thing.is_crowbar())
+ if(thing.get_tool_quality(TOOL_CROWBAR))
if(!manipulator)
to_chat(user, "\The [src] has no manipulator installed.")
return
diff --git a/code/modules/projectiles/guns/magnetic/magnetic.dm b/code/modules/projectiles/guns/magnetic/magnetic.dm
index 68178d4bdb..51af9029de 100644
--- a/code/modules/projectiles/guns/magnetic/magnetic.dm
+++ b/code/modules/projectiles/guns/magnetic/magnetic.dm
@@ -155,7 +155,7 @@
update_icon()
return
- if(thing.is_screwdriver())
+ if(thing.get_tool_quality(TOOL_SCREWDRIVER))
if(!capacitor)
to_chat(user, "\The [src] has no capacitor installed.")
return
diff --git a/code/modules/projectiles/guns/magnetic/magnetic_construction.dm b/code/modules/projectiles/guns/magnetic/magnetic_construction.dm
index 003d6c956c..e2e27703bf 100644
--- a/code/modules/projectiles/guns/magnetic/magnetic_construction.dm
+++ b/code/modules/projectiles/guns/magnetic/magnetic_construction.dm
@@ -66,7 +66,7 @@
increment_construction_stage()
return
- if(thing.is_screwdriver() && construction_stage >= 9)
+ if(thing.get_tool_quality(TOOL_SCREWDRIVER) && construction_stage >= 9)
user.visible_message("\The [user] secures \the [src] and finishes it off.")
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/item/weapon/gun/magnetic/coilgun = new(loc)
diff --git a/code/modules/projectiles/guns/modular_guns.dm b/code/modules/projectiles/guns/modular_guns.dm
index 61e5039874..45bb68a48f 100644
--- a/code/modules/projectiles/guns/modular_guns.dm
+++ b/code/modules/projectiles/guns/modular_guns.dm
@@ -51,12 +51,12 @@
FireModeModify()
/obj/item/weapon/gun/energy/modular/attackby(obj/item/O, mob/user)
- if(O.is_screwdriver())
+ if(O.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You [assembled ? "disassemble" : "assemble"] the gun.")
assembled = !assembled
playsound(src, O.usesound, 50, 1)
return
- if(O.is_crowbar())
+ if(O.get_tool_quality(TOOL_CROWBAR))
if(assembled == 1)
to_chat(user, "Disassemble the [src] first!")
return
diff --git a/code/modules/reagents/hoses/connector.dm b/code/modules/reagents/hoses/connector.dm
index e165877041..9742a66f28 100644
--- a/code/modules/reagents/hoses/connector.dm
+++ b/code/modules/reagents/hoses/connector.dm
@@ -3,7 +3,7 @@
. = ..()
if(locate(/obj/item/hose_connector) in src)
- if(O.is_wirecutter())
+ if(O.get_tool_quality(TOOL_WIRECUTTER))
var/list/available_sockets = list()
for(var/obj/item/hose_connector/HC in src)
diff --git a/code/modules/reagents/machinery/dispenser/dispenser2.dm b/code/modules/reagents/machinery/dispenser/dispenser2.dm
index d53dac4ba5..53deea0445 100644
--- a/code/modules/reagents/machinery/dispenser/dispenser2.dm
+++ b/code/modules/reagents/machinery/dispenser/dispenser2.dm
@@ -76,10 +76,10 @@
SStgui.update_uis(src)
/obj/machinery/chemical_dispenser/attackby(obj/item/weapon/W, mob/user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to [anchored ? "un" : ""]fasten \the [src].")
- if (do_after(user, 20 * W.toolspeed))
+ if (do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
user.visible_message(
"\The [user] [anchored ? "un" : ""]fastens \the [src].",
"You have [anchored ? "un" : ""]fastened \the [src].",
@@ -91,7 +91,7 @@
else if(istype(W, /obj/item/weapon/reagent_containers/chem_disp_cartridge))
add_cartridge(W, user)
- else if(W.is_screwdriver())
+ else if(W.get_tool_quality(TOOL_SCREWDRIVER))
var/label = input(user, "Which cartridge would you like to remove?", "Chemical Dispenser") as null|anything in cartridges
if(!label) return
var/obj/item/weapon/reagent_containers/chem_disp_cartridge/C = remove_cartridge(label)
diff --git a/code/modules/reagents/machinery/dispenser/reagent_tank.dm b/code/modules/reagents/machinery/dispenser/reagent_tank.dm
index 197e203f83..bdae0485f1 100644
--- a/code/modules/reagents/machinery/dispenser/reagent_tank.dm
+++ b/code/modules/reagents/machinery/dispenser/reagent_tank.dm
@@ -133,7 +133,7 @@
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.add_fingerprint(user)
- if (W.is_wrench())
+ if (W.get_tool_quality(TOOL_WRENCH))
user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \
"You wrench [src]'s faucet [modded ? "closed" : "open"]")
modded = modded ? 0 : 1
@@ -265,7 +265,7 @@
return 1
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
src.add_fingerprint(user)
if(bottle)
playsound(src, I.usesound, 50, 1)
@@ -283,14 +283,14 @@
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
- if(do_after(user, 20 * I.toolspeed, src))
+ if(do_after(user, 20 * I.get_tool_speed(TOOL_WRENCH), src))
if(!src) return
to_chat(user, "You [anchored? "un" : ""]secured \the [src]!")
anchored = !anchored
playsound(src, I.usesound, 50, 1)
return
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(cupholder)
playsound(src, I.usesound, 50, 1)
to_chat(user, "You take the cup dispenser off.")
@@ -305,7 +305,7 @@
if(!bottle && !cupholder)
playsound(src, I.usesound, 50, 1)
to_chat(user, "You start taking the water-cooler apart.")
- if(do_after(user, 20 * I.toolspeed) && !bottle && !cupholder)
+ if(do_after(user, 20 * I.get_tool_speed(TOOL_SCREWDRIVER)) && !bottle && !cupholder)
to_chat(user, "You take the water-cooler apart.")
new /obj/item/stack/material/plastic( src.loc, 4 )
qdel(src)
diff --git a/code/modules/reagents/machinery/pump.dm b/code/modules/reagents/machinery/pump.dm
index 6c9302d61e..a8767f9fdf 100644
--- a/code/modules/reagents/machinery/pump.dm
+++ b/code/modules/reagents/machinery/pump.dm
@@ -141,18 +141,18 @@
/obj/machinery/pump/attackby(obj/item/weapon/W, mob/user)
. = TRUE
- if(W.is_screwdriver() && !open)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER) && !open)
to_chat(user, SPAN_NOTICE("You [unlocked ? "screw" : "unscrew"] the battery panel."))
unlocked = !unlocked
- else if(W.is_crowbar() && unlocked)
+ else if(W.get_tool_quality(TOOL_CROWBAR) && unlocked)
to_chat(user, open ? \
"You crowbar the battery panel in place." : \
"You remove the battery panel." \
)
open = !open
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(on)
to_chat(user, "\The [src] is active. Turn it off before trying to move it!")
return FALSE
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index 71785807ec..6dc5c366af 100644
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -277,7 +277,7 @@
user.drop_from_inventory(src)
qdel(src)
return
- else if(D.is_wirecutter())
+ else if(D.get_tool_quality(TOOL_WIRECUTTER))
to_chat(user, "You cut a big hole in \the [src] with \the [D]. It's kinda useless as a bucket now.")
user.put_in_hands(new /obj/item/clothing/head/helmet/bucket)
user.drop_from_inventory(src)
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index 37dd909a74..573d336280 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -275,14 +275,14 @@
if(default_deconstruction_screwdriver(user, I))
return
- if(istype(I, /obj/item/weapon/weldingtool))
+ if(I.get_tool_quality(TOOL_WELDER))
if(panel_open)
var/obj/item/weapon/weldingtool/WT = I
if(!WT.remove_fuel(0, user))
to_chat(user, "The welding tool must be on to complete this task.")
return
playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 20 * WT.toolspeed))
+ if(do_after(user, 20 * WT.get_tool_speed(TOOL_WELDER)))
if(!src || !WT.isOn()) return
to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/steel( src.loc, 2 )
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index 1182e61596..c27eded961 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -246,7 +246,7 @@
var/obj/structure/disposalpipe/CP = locate() in T
// wrench: (un)anchor
- if(I.is_wrench())
+ if(I.get_tool_quality(TOOL_WRENCH))
if(anchored)
anchored = 0
if(ispipe)
@@ -285,13 +285,13 @@
update()
// weldingtool: convert to real pipe
- else if(istype(I, /obj/item/weapon/weldingtool))
+ else if(I.get_tool_quality(TOOL_WELDER))
if(anchored)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
to_chat(user, "Welding the [nicetype] in place.")
- if(do_after(user, 20 * W.toolspeed))
+ if(do_after(user, 20 * W.get_tool_speed(TOOL_WELDER)))
if(!src || !W.isOn()) return
to_chat(user, "The [nicetype] has been welded in place!")
update() // TODO: Make this neat
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 73308fe7f1..340a230e34 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -56,7 +56,7 @@
src.add_fingerprint(user)
if(mode<=0) // It's off
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(contents.len > 0)
to_chat(user, "Eject the items first!")
return
@@ -70,7 +70,7 @@
playsound(src, I.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
- else if(istype(I, /obj/item/weapon/weldingtool) && mode==-1)
+ else if(I.get_tool_quality(TOOL_WELDER) && mode==-1)
if(contents.len > 0)
to_chat(user, "Eject the items first!")
return
@@ -79,7 +79,7 @@
playsound(src, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the disposal unit.")
- if(do_after(user,20 * W.toolspeed))
+ if(do_after(user,20 * W.get_tool_speed(TOOL_WELDER)))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the disposal unit.")
var/obj/structure/disposalconstruct/C = new (src.loc)
@@ -1554,7 +1554,7 @@
if(!I || !user)
return
src.add_fingerprint(user)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
if(mode==0)
mode=1
to_chat(user, "You remove the screws around the power connection.")
@@ -1565,12 +1565,12 @@
to_chat(user, "You attach the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
- else if(istype(I, /obj/item/weapon/weldingtool) && mode==1)
+ else if(I.get_tool_quality(TOOL_WELDER) && mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
- if(do_after(user,20 * W.toolspeed))
+ if(do_after(user,20 * W.get_tool_speed(TOOL_WELDER)))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the disposal outlet.")
var/obj/structure/disposalconstruct/C = new (src.loc)
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 969526be79..6a4baa6b22 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -430,19 +430,19 @@
if(!I || !user)
return
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
c_mode = !c_mode
playsound(src, I.usesound, 50, 1)
to_chat(user, "You [c_mode ? "remove" : "attach"] the screws around the power connection.")
return
- if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1)
+ if(I.get_tool_quality(TOOL_WELDER) && c_mode==1)
var/obj/item/weapon/weldingtool/W = I
if(!W.remove_fuel(0,user))
to_chat(user, "You need more welding fuel to complete this task.")
return
playsound(src, W.usesound, 50, 1)
to_chat(user, "You start slicing the floorweld off the delivery chute.")
- if(do_after(user,20 * W.toolspeed))
+ if(do_after(user,20 * W.get_tool_speed(TOOL_WELDER)))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the delivery chute.")
var/obj/structure/disposalconstruct/C = new (src.loc)
diff --git a/code/modules/research/designs/engineering.dm b/code/modules/research/designs/engineering.dm
index 9fa557426c..efaa33c8a1 100644
--- a/code/modules/research/designs/engineering.dm
+++ b/code/modules/research/designs/engineering.dm
@@ -19,7 +19,7 @@
id = "handdrill"
req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 2)
materials = list(MAT_STEEL = 300, "silver" = 100)
- build_path = /obj/item/weapon/tool/screwdriver/power
+ build_path = /obj/item/weapon/tool/powerdrill
sort_string = "NAAAB"
/datum/design/item/tool/jaws_life
@@ -28,7 +28,7 @@
id = "jawslife"
req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 2)
materials = list(MAT_STEEL = 300, "silver" = 100)
- build_path = /obj/item/weapon/tool/crowbar/power
+ build_path = /obj/item/weapon/tool/hydraulic_cutter
sort_string = "NAAAC"
// Other devices
diff --git a/code/modules/research/designs/medical.dm b/code/modules/research/designs/medical.dm
index bd095ae430..4db3c0c75a 100644
--- a/code/modules/research/designs/medical.dm
+++ b/code/modules/research/designs/medical.dm
@@ -40,7 +40,7 @@
id = "scalpel_manager"
req_tech = list(TECH_BIO = 4, TECH_MATERIAL = 7, TECH_MAGNET = 5, TECH_DATA = 4)
materials = list (MAT_STEEL = 12500, "glass" = 7500, "silver" = 1500, "gold" = 1500, "diamond" = 750)
- build_path = /obj/item/weapon/surgical/scalpel/manager
+ build_path = /obj/item/weapon/surgical/manager
sort_string = "KAAAD"
/datum/design/item/medical/saw_manager
diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm
index 8956e9e3c8..9c9b011de2 100644
--- a/code/modules/security levels/keycard authentication.dm
+++ b/code/modules/security levels/keycard authentication.dm
@@ -42,10 +42,10 @@
event_triggered_by = usr
broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "You begin removing the faceplate from the [src]")
playsound(src, W.usesound, 50, 1)
- if(do_after(user, 10 * W.toolspeed))
+ if(do_after(user, 10 * W.get_tool_speed(TOOL_SCREWDRIVER)))
to_chat(user, "You remove the faceplate from the [src]")
var/obj/structure/frame/A = new /obj/structure/frame(loc)
var/obj/item/weapon/circuitboard/M = new circuit(A)
diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm
index f02f03bbec..5d451cbefd 100644
--- a/code/modules/shieldgen/emergency_shield.dm
+++ b/code/modules/shieldgen/emergency_shield.dm
@@ -280,7 +280,7 @@
return 1
/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 100, 1)
if(is_open)
to_chat(user, "You close the panel.")
@@ -300,7 +300,7 @@
to_chat(user, "You repair the [src]!")
update_icon()
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(locked)
to_chat(user, "The bolts are covered, unlocking this would retract the covers.")
return
diff --git a/code/modules/shieldgen/sheldwallgen.dm b/code/modules/shieldgen/sheldwallgen.dm
index 4d31397ec1..9f57d65adf 100644
--- a/code/modules/shieldgen/sheldwallgen.dm
+++ b/code/modules/shieldgen/sheldwallgen.dm
@@ -157,7 +157,7 @@
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user)
- if(W.is_wrench())
+ if(W.get_tool_quality(TOOL_WRENCH))
if(active)
to_chat(user, "Turn off the field generator first.")
return
diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm
index 991c73f789..ab04717d10 100644
--- a/code/modules/shieldgen/shield_capacitor.dm
+++ b/code/modules/shieldgen/shield_capacitor.dm
@@ -46,7 +46,7 @@
updateDialog()
else
to_chat(user, "Access denied.")
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
src.anchored = !src.anchored
playsound(src, W.usesound, 75, 1)
src.visible_message("[bicon(src)] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm
index 129f77d443..cc2ca7211e 100644
--- a/code/modules/shieldgen/shield_gen.dm
+++ b/code/modules/shieldgen/shield_gen.dm
@@ -66,7 +66,7 @@
updateDialog()
else
to_chat(user, "Access denied.")
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
src.anchored = !src.anchored
playsound(src, W.usesound, 75, 1)
src.visible_message("[bicon(src)] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].")
diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm
index 6a48eb198d..743322742c 100644
--- a/code/modules/surgery/bones.dm
+++ b/code/modules/surgery/bones.dm
@@ -7,12 +7,12 @@
// Bone Glue Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/glue_bone
+/decl/surgery_step/glue_bone
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100
)
- allowed_procs = list(IS_SCREWDRIVER = 75)
+ allowed_procs = list(TOOL_SCREWDRIVER = 75)
can_infect = 1
blood_level = 1
@@ -20,7 +20,7 @@
min_duration = 50
max_duration = 60
-/datum/surgery_step/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -28,7 +28,7 @@
return 0
return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 0
-/datum/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected.stage == 0)
user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.name] with \the [tool]." , \
@@ -36,13 +36,13 @@
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 50)
..()
-/datum/surgery_step/glue_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/glue_bone/end_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)
user.visible_message("[user] applies some [tool] to [target]'s bone in [affected.name]", \
"You apply some [tool] to [target]'s bone in [affected.name] with \the [tool].")
affected.stage = 1
-/datum/surgery_step/glue_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/glue_bone/fail_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)
user.visible_message("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
@@ -51,17 +51,17 @@
// Bone Setting Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/set_bone
+/decl/surgery_step/set_bone
allowed_tools = list(
/obj/item/weapon/surgical/bonesetter = 100
)
- allowed_procs = list(IS_WRENCH = 75)
+ allowed_procs = list(TOOL_WRENCH = 75)
min_duration = 60
max_duration = 70
-/datum/surgery_step/set_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/set_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -69,14 +69,14 @@
return 0
return affected && affected.organ_tag != BP_HEAD && !(affected.robotic >= ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
-/datum/surgery_step/set_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/set_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to set the bone in [target]'s [affected.name] in place with \the [tool]." , \
"You are beginning to set the bone in [target]'s [affected.name] in place with \the [tool].")
target.custom_pain("The pain in your [affected.name] is going to make you pass out!", 50)
..()
-/datum/surgery_step/set_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/set_bone/end_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 (affected.status & ORGAN_BROKEN)
user.visible_message("[user] sets the bone in [target]'s [affected.name] in place with \the [tool].", \
@@ -87,7 +87,7 @@
"You set the bone in [target]'s [affected.name] in the WRONG place with \the [tool].")
affected.fracture()
-/datum/surgery_step/set_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/set_bone/fail_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)
user.visible_message("[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!" , \
"Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!")
@@ -97,17 +97,17 @@
// Skull Mending Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/mend_skull
+/decl/surgery_step/mend_skull
allowed_tools = list(
/obj/item/weapon/surgical/bonesetter = 100
)
- allowed_procs = list(IS_WRENCH = 75)
+ allowed_procs = list(TOOL_WRENCH = 75)
min_duration = 60
max_duration = 70
-/datum/surgery_step/mend_skull/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/mend_skull/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -115,18 +115,18 @@
return 0
return affected && affected.organ_tag == BP_HEAD && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
-/datum/surgery_step/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] is beginning to piece together [target]'s skull with \the [tool]." , \
"You are beginning to piece together [target]'s skull with \the [tool].")
..()
-/datum/surgery_step/mend_skull/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/mend_skull/end_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)
user.visible_message("[user] sets [target]'s skull with \the [tool]." , \
"You set [target]'s skull with \the [tool].")
affected.stage = 2
-/datum/surgery_step/mend_skull/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/mend_skull/fail_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)
user.visible_message("[user]'s hand slips, damaging [target]'s face with \the [tool]!" , \
"Your hand slips, damaging [target]'s face with \the [tool]!")
@@ -138,12 +138,12 @@
// Bone Fixing Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/finish_bone
+/decl/surgery_step/finish_bone
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100
)
- allowed_procs = list(IS_SCREWDRIVER = 75)
+ allowed_procs = list(TOOL_SCREWDRIVER = 75)
can_infect = 1
blood_level = 1
@@ -151,7 +151,7 @@
min_duration = 50
max_duration = 60
-/datum/surgery_step/finish_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/finish_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -159,20 +159,20 @@
return 0
return affected && affected.open >= 2 && !(affected.robotic >= ORGAN_ROBOT) && affected.stage == 2
-/datum/surgery_step/finish_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/finish_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].", \
"You start to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].")
..()
-/datum/surgery_step/finish_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/finish_bone/end_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)
user.visible_message("[user] has mended the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"You have mended the damaged bones in [target]'s [affected.name] with \the [tool]." )
affected.status &= ~ORGAN_BROKEN
affected.stage = 0
-/datum/surgery_step/finish_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/finish_bone/fail_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)
user.visible_message("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
@@ -181,7 +181,7 @@
// Bone Clamp Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/clamp_bone
+/decl/surgery_step/clamp_bone
allowed_tools = list(
/obj/item/weapon/surgical/bone_clamp = 100
)
@@ -192,7 +192,7 @@
min_duration = 70
max_duration = 90
-/datum/surgery_step/clamp_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/clamp_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -200,7 +200,7 @@
return 0
return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 0
-/datum/surgery_step/clamp_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/clamp_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected.stage == 0)
user.visible_message("[user] starts repairing the damaged bones in [target]'s [affected.name] with \the [tool]." , \
@@ -208,13 +208,13 @@
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 50)
..()
-/datum/surgery_step/clamp_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/clamp_bone/end_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)
user.visible_message("[user] sets the bone in [target]'s [affected.name] with \the [tool].", \
"You sets [target]'s bone in [affected.name] with \the [tool].")
affected.status &= ~ORGAN_BROKEN
-/datum/surgery_step/clamp_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/clamp_bone/fail_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)
user.visible_message("[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!" , \
"Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!")
diff --git a/code/modules/surgery/encased.dm b/code/modules/surgery/encased.dm
index d69c456f7c..4145fb1da6 100644
--- a/code/modules/surgery/encased.dm
+++ b/code/modules/surgery/encased.dm
@@ -2,12 +2,12 @@
//////////////////////////////////////////////////////////////////
// GENERIC RIBCAGE SURGERY //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/open_encased
+/decl/surgery_step/open_encased
priority = 2
can_infect = 1
blood_level = 1
-/datum/surgery_step/open_encased/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
@@ -20,7 +20,7 @@
// Rib Sawing Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/open_encased/saw
+/decl/surgery_step/open_encased/saw
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
@@ -29,13 +29,13 @@
min_duration = 50
max_duration = 70
-/datum/surgery_step/open_encased/saw/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/saw/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2
-/datum/surgery_step/open_encased/saw/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/saw/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -45,7 +45,7 @@
target.custom_pain("Something hurts horribly in your [affected.name]!", 60)
..()
-/datum/surgery_step/open_encased/saw/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/saw/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -54,7 +54,7 @@
"You have cut [target]'s [affected.encased] open with \the [tool].")
affected.open = 2.5
-/datum/surgery_step/open_encased/saw/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/saw/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -69,23 +69,23 @@
// Rib Opening Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/open_encased/retract
+/decl/surgery_step/open_encased/retract
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100
)
- allowed_procs = list(IS_CROWBAR = 75)
+ allowed_procs = list(TOOL_CROWBAR = 75)
min_duration = 30
max_duration = 40
-/datum/surgery_step/open_encased/retract/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/retract/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
-/datum/surgery_step/open_encased/retract/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/retract/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -96,7 +96,7 @@
target.custom_pain("Something hurts horribly in your [affected.name]!", 40)
..()
-/datum/surgery_step/open_encased/retract/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/retract/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -106,7 +106,7 @@
affected.open = 3
-/datum/surgery_step/open_encased/retract/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/retract/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -122,23 +122,23 @@
// Rib Closing Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/open_encased/close
+/decl/surgery_step/open_encased/close
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
)
- allowed_procs = list(IS_CROWBAR = 75)
+ allowed_procs = list(TOOL_CROWBAR = 75)
min_duration = 20
max_duration = 40
-/datum/surgery_step/open_encased/close/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/close/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return (..() && affected && affected.open == 3)
-/datum/surgery_step/open_encased/close/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/close/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -149,7 +149,7 @@
target.custom_pain("Something hurts horribly in your [affected.name]!", 100)
..()
-/datum/surgery_step/open_encased/close/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/close/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -160,7 +160,7 @@
affected.open = 2.5
-/datum/surgery_step/open_encased/close/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/close/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -180,23 +180,23 @@
// Rib Mending Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/open_encased/mend
+/decl/surgery_step/open_encased/mend
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100
)
- allowed_procs = list(IS_SCREWDRIVER = 75)
+ allowed_procs = list(TOOL_SCREWDRIVER = 75)
min_duration = 20
max_duration = 40
-/datum/surgery_step/open_encased/mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
-/datum/surgery_step/open_encased/mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -207,7 +207,7 @@
target.custom_pain("Something hurts horribly in your [affected.name]!", 100)
..()
-/datum/surgery_step/open_encased/mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -221,7 +221,7 @@
///////////////////////////////////////////////////////////////
// Saw/Retractor/Gel Combi-open and close.
///////////////////////////////////////////////////////////////
-/datum/surgery_step/open_encased/advancedsaw_open
+/decl/surgery_step/open_encased/advancedsaw_open
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw/manager = 100
)
@@ -231,13 +231,13 @@
min_duration = 60
max_duration = 90
-/datum/surgery_step/open_encased/advancedsaw_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open >= 2 && affected.open < 3
-/datum/surgery_step/open_encased/advancedsaw_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -247,7 +247,7 @@
target.custom_pain("Something hurts horribly in your [affected.name]!", 60)
..()
-/datum/surgery_step/open_encased/advancedsaw_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -256,7 +256,7 @@
"You have cut [target]'s [affected.encased] wide open with \the [tool].")
affected.open = 3
-/datum/surgery_step/open_encased/advancedsaw_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -270,7 +270,7 @@
affected.fracture()
-/datum/surgery_step/open_encased/advancedsaw_mend
+/decl/surgery_step/open_encased/advancedsaw_mend
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw/manager = 100
)
@@ -280,13 +280,13 @@
min_duration = 30
max_duration = 60
-/datum/surgery_step/open_encased/advancedsaw_mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return (..() && affected && affected.open == 3)
-/datum/surgery_step/open_encased/advancedsaw_mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -297,7 +297,7 @@
target.custom_pain("Something hurts horribly in your [affected.name]!", 100)
..()
-/datum/surgery_step/open_encased/advancedsaw_mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/open_encased/advancedsaw_mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
diff --git a/code/modules/surgery/external_repair.dm b/code/modules/surgery/external_repair.dm
index 93c04175d2..4dbac80d08 100644
--- a/code/modules/surgery/external_repair.dm
+++ b/code/modules/surgery/external_repair.dm
@@ -2,13 +2,13 @@
//////////////////////////////////////////////////////////////////
// LIMB REPAIR SURGERY //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/repairflesh/
+/decl/surgery_step/repairflesh/
priority = 1
can_infect = 1
blood_level = 1
req_open = 1
-/datum/surgery_step/repairflesh/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target.stat == DEAD) // Sorry defibs, your subjects need to have pumping fluids for these to work.
return 0
if (isslime(target))
@@ -33,7 +33,7 @@
// SCAN STEP //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/repairflesh/scan_injury
+/decl/surgery_step/repairflesh/scan_injury
allowed_tools = list(
/obj/item/weapon/autopsy_scanner = 100,
/obj/item/device/analyzer = 10
@@ -46,7 +46,7 @@
min_duration = 20
max_duration = 40
-/datum/surgery_step/repairflesh/scan_injury/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/scan_injury/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(affected.burn_stage || affected.brute_stage)
@@ -54,13 +54,13 @@
return 1
return 0
-/datum/surgery_step/repairflesh/scan_injury/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/scan_injury/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)
user.visible_message("[user] begins scanning [target]'s [affected] with \the [tool].", \
"You begin scanning [target]'s [affected] with \the [tool].")
..()
-/datum/surgery_step/repairflesh/scan_injury/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/scan_injury/end_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)
user.visible_message("[user] finishes scanning [target]'s [affected].", \
"You finish scanning [target]'s [affected].")
@@ -73,7 +73,7 @@
to_chat(user, "\The muscle in [target]'s [affected] is notably charred.")
affected.burn_stage = max(1, affected.burn_stage)
-/datum/surgery_step/repairflesh/scan_injury/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/scan_injury/fail_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)
user.visible_message("[user]'s hand slips, dropping \the [tool] onto [target]'s [affected]!" , \
"Your hand slips, dropping \the [tool] onto [target]'s [affected]!" )
@@ -83,7 +83,7 @@
// BURN STEP //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/repairflesh/repair_burns
+/decl/surgery_step/repairflesh/repair_burns
allowed_tools = list(
/obj/item/stack/medical/advanced/ointment = 100,
/obj/item/stack/medical/ointment = 50,
@@ -96,7 +96,7 @@
min_duration = 90
max_duration = 120
-/datum/surgery_step/repairflesh/repair_burns/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_burns/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(affected.burn_stage < 1 || !(affected.burn_dam))
@@ -106,7 +106,7 @@
return 1
return 0
-/datum/surgery_step/repairflesh/repair_burns/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_burns/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(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll))
user.visible_message("[user] begins taping up [target]'s [affected] with \the [tool].", \
@@ -120,7 +120,7 @@
"You begin coating the charred tissue in [target]'s [affected] with \the [tool].")
..()
-/datum/surgery_step/repairflesh/repair_burns/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_burns/end_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(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll))
user.visible_message("[user] finishes taping up [target]'s [affected] with \the [tool].", \
@@ -134,7 +134,7 @@
T.use(1)
..()
-/datum/surgery_step/repairflesh/repair_burns/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_burns/fail_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)
user.visible_message("[user]'s hand slips, tearing up [target]'s [affected] with \the [tool].", \
"Your hand slips, tearing up [target]'s [affected] with \the [tool].")
@@ -149,7 +149,7 @@
// BRUTE STEP //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/repairflesh/repair_brute
+/decl/surgery_step/repairflesh/repair_brute
allowed_tools = list(
/obj/item/stack/medical/advanced/bruise_pack = 100,
/obj/item/stack/medical/bruise_pack = 50,
@@ -162,7 +162,7 @@
min_duration = 90
max_duration = 120
-/datum/surgery_step/repairflesh/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(affected.brute_stage < 1 || !(affected.brute_dam))
@@ -172,7 +172,7 @@
return 1
return 0
-/datum/surgery_step/repairflesh/repair_brute/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_brute/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(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll))
user.visible_message("[user] begins taping up [target]'s [affected] with \the [tool].", \
@@ -186,7 +186,7 @@
"You begin coating the tissue in [target]'s [affected] with \the [tool].")
..()
-/datum/surgery_step/repairflesh/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_brute/end_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(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll))
user.visible_message("[user] finishes taping up [target]'s [affected] with \the [tool].", \
@@ -200,7 +200,7 @@
T.use(1)
..()
-/datum/surgery_step/repairflesh/repair_brute/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/repairflesh/repair_brute/fail_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)
user.visible_message("[user]'s hand slips, tearing up [target]'s [affected] with \the [tool].", \
"Your hand slips, tearing up [target]'s [affected] with \the [tool].")
diff --git a/code/modules/surgery/face.dm b/code/modules/surgery/face.dm
index b670497fc9..c160c6eefb 100644
--- a/code/modules/surgery/face.dm
+++ b/code/modules/surgery/face.dm
@@ -3,12 +3,12 @@
// FACE SURGERY //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/face
+/decl/surgery_step/face
priority = 2
req_open = 0
can_infect = 0
-/datum/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -22,7 +22,7 @@
// Face Opening Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/cut_face
+/decl/surgery_step/generic/cut_face
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -32,20 +32,20 @@
min_duration = 90
max_duration = 110
-/datum/surgery_step/generic/cut_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == O_MOUTH && target.op_stage.face == 0
-/datum/surgery_step/generic/cut_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to cut open [target]'s face and neck with \the [tool].", \
"You start to cut open [target]'s face and neck with \the [tool].")
..()
-/datum/surgery_step/generic/cut_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has cut open [target]'s face and neck with \the [tool]." , \
" You have cut open[target]'s face and neck with \the [tool].",)
target.op_stage.face = 1
-/datum/surgery_step/generic/cut_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_face/fail_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)
user.visible_message("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!" , \
"Your hand slips, slicing [target]'s throat wth \the [tool]!" )
@@ -56,7 +56,7 @@
// Vocal Cord/Face Repair Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/face/mend_vocal
+/decl/surgery_step/face/mend_vocal
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -66,20 +66,20 @@
min_duration = 70
max_duration = 90
-/datum/surgery_step/face/mend_vocal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/mend_vocal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face == 1
-/datum/surgery_step/face/mend_vocal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/mend_vocal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts mending [target]'s vocal cords with \the [tool].", \
"You start mending [target]'s vocal cords with \the [tool].")
..()
-/datum/surgery_step/face/mend_vocal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/mend_vocal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] mends [target]'s vocal cords with \the [tool].", \
"You mend [target]'s vocal cords with \the [tool].")
target.op_stage.face = 2
-/datum/surgery_step/face/mend_vocal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/mend_vocal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips, clamping [target]'s trachea shut for a moment with \the [tool]!", \
"Your hand slips, clamping [user]'s trachea shut for a moment with \the [tool]!")
target.AdjustLosebreath(10)
@@ -88,31 +88,31 @@
// Face Fixing Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/face/fix_face
+/decl/surgery_step/face/fix_face
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 75
)
- allowed_procs = list(IS_CROWBAR = 55)
+ allowed_procs = list(TOOL_CROWBAR = 55)
min_duration = 80
max_duration = 100
-/datum/surgery_step/face/fix_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/fix_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face == 2
-/datum/surgery_step/face/fix_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/fix_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts pulling the skin on [target]'s face back in place with \the [tool].", \
"You start pulling the skin on [target]'s face back in place with \the [tool].")
..()
-/datum/surgery_step/face/fix_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/fix_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] pulls the skin on [target]'s face back in place with \the [tool].", \
"You pull the skin on [target]'s face back in place with \the [tool].")
target.op_stage.face = 3
-/datum/surgery_step/face/fix_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/fix_face/fail_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)
user.visible_message("[user]'s hand slips, tearing skin on [target]'s face with \the [tool]!", \
"Your hand slips, tearing skin on [target]'s face with \the [tool]!")
@@ -122,7 +122,7 @@
// Face Cauterizing Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/face/cauterize
+/decl/surgery_step/face/cauterize
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
@@ -133,15 +133,15 @@
min_duration = 70
max_duration = 100
-/datum/surgery_step/face/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face > 0
-/datum/surgery_step/face/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] is beginning to cauterize the incision on [target]'s face and neck with \the [tool]." , \
"You are beginning to cauterize the incision on [target]'s face and neck with \the [tool].")
..()
-/datum/surgery_step/face/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/cauterize/end_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)
user.visible_message("[user] cauterizes the incision on [target]'s face and neck with \the [tool].", \
"You cauterize the incision on [target]'s face and neck with \the [tool].")
@@ -152,7 +152,7 @@
h.disfigured = 0
target.op_stage.face = 0
-/datum/surgery_step/face/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/face/cauterize/fail_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)
user.visible_message("[user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!", \
"Your hand slips, leaving a small burn on [target]'s face with \the [tool]!")
diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm
index a5ccd15050..6c73036a1a 100644
--- a/code/modules/surgery/generic.dm
+++ b/code/modules/surgery/generic.dm
@@ -3,10 +3,10 @@
// COMMON STEPS //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/
+/decl/surgery_step/generic/
can_infect = 1
-/datum/surgery_step/generic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (isslime(target))
return 0
if (target_zone == O_EYES) //there are specific steps for eye surgery
@@ -28,7 +28,7 @@
// Scalpel Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/cut_open
+/decl/surgery_step/generic/cut_open
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -39,19 +39,19 @@
min_duration = 90
max_duration = 110
-/datum/surgery_step/generic/cut_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != O_MOUTH
-/datum/surgery_step/generic/cut_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts the incision on [target]'s [affected.name] with \the [tool].", \
"You start the incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.name]!", 40)
..()
-/datum/surgery_step/generic/cut_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_open/end_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)
user.visible_message("[user] has made an incision on [target]'s [affected.name] with \the [tool].", \
"You have made an incision on [target]'s [affected.name] with \the [tool].",)
@@ -62,7 +62,7 @@
affected.createwound(CUT, 1)
-/datum/surgery_step/generic/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_open/fail_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)
user.visible_message("[user]'s hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!", \
"Your hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!")
@@ -72,7 +72,7 @@
// Laser Scalpel Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/cut_with_laser
+/decl/surgery_step/generic/cut_with_laser
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/laser3 = 95, \
/obj/item/weapon/surgical/scalpel/laser2 = 85, \
@@ -84,19 +84,19 @@
min_duration = 90
max_duration = 110
-/datum/surgery_step/generic/cut_with_laser/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_with_laser/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != O_MOUTH
-/datum/surgery_step/generic/cut_with_laser/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_with_laser/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts the bloodless incision on [target]'s [affected.name] with \the [tool].", \
"You start the bloodless incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("You feel a horrible, searing pain in your [affected.name]!", 50)
..()
-/datum/surgery_step/generic/cut_with_laser/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_with_laser/end_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)
user.visible_message("[user] has made a bloodless incision on [target]'s [affected.name] with \the [tool].", \
"You have made a bloodless incision on [target]'s [affected.name] with \the [tool].",)
@@ -107,7 +107,7 @@
affected.organ_clamp()
spread_germs_to_organ(affected, user)
-/datum/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cut_with_laser/fail_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)
user.visible_message("[user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!", \
"Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!")
@@ -118,9 +118,9 @@
// Incision Management Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/incision_manager
+/decl/surgery_step/generic/incision_manager
allowed_tools = list(
- /obj/item/weapon/surgical/scalpel/manager = 100
+ /obj/item/weapon/surgical/manager = 100
)
priority = 2
@@ -128,19 +128,19 @@
min_duration = 80
max_duration = 120
-/datum/surgery_step/generic/incision_manager/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/incision_manager/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != O_MOUTH
-/datum/surgery_step/generic/incision_manager/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/incision_manager/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to construct a prepared incision on and within [target]'s [affected.name] with \the [tool].", \
"You start to construct a prepared incision on and within [target]'s [affected.name] with \the [tool].")
target.custom_pain("You feel a horrible, searing pain in your [affected.name] as it is pushed apart!", 50)
..()
-/datum/surgery_step/generic/incision_manager/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/incision_manager/end_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)
user.visible_message("[user] has constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].", \
"You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].",)
@@ -153,7 +153,7 @@
affected.organ_clamp()
affected.open = 2
-/datum/surgery_step/generic/incision_manager/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/incision_manager/fail_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)
user.visible_message("[user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!", \
"Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!")
@@ -164,7 +164,7 @@
// Hemostat Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/clamp_bleeders
+/decl/surgery_step/generic/clamp_bleeders
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -174,26 +174,26 @@
min_duration = 40
max_duration = 60
-/datum/surgery_step/generic/clamp_bleeders/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/clamp_bleeders/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open && (affected.status & ORGAN_BLEEDING)
-/datum/surgery_step/generic/clamp_bleeders/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/clamp_bleeders/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts clamping bleeders in [target]'s [affected.name] with \the [tool].", \
"You start clamping bleeders in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in your [affected.name] is maddening!", 40)
..()
-/datum/surgery_step/generic/clamp_bleeders/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/clamp_bleeders/end_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)
user.visible_message("[user] clamps bleeders in [target]'s [affected.name] with \the [tool].", \
"You clamp bleeders in [target]'s [affected.name] with \the [tool].")
affected.organ_clamp()
spread_germs_to_organ(affected, user)
-/datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/clamp_bleeders/fail_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)
user.visible_message("[user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!",)
@@ -203,23 +203,23 @@
// Retractor Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/retract_skin
+/decl/surgery_step/generic/retract_skin
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 50
)
- allowed_procs = list(IS_CROWBAR = 75)
+ allowed_procs = list(TOOL_CROWBAR = 75)
min_duration = 30
max_duration = 40
-/datum/surgery_step/generic/retract_skin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/retract_skin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 1 //&& !(affected.status & ORGAN_BLEEDING)
-/datum/surgery_step/generic/retract_skin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/retract_skin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to pry open the incision on [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to pry open the incision on [target]'s [affected.name] with \the [tool]."
@@ -233,7 +233,7 @@
target.custom_pain("It feels like the skin on your [affected.name] is on fire!", 40)
..()
-/datum/surgery_step/generic/retract_skin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/retract_skin/end_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)
var/msg = "[user] keeps the incision open on [target]'s [affected.name] with \the [tool]."
var/self_msg = "You keep the incision open on [target]'s [affected.name] with \the [tool]."
@@ -246,7 +246,7 @@
user.visible_message(msg, self_msg)
affected.open = 2
-/datum/surgery_step/generic/retract_skin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/retract_skin/fail_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)
var/msg = "[user]'s hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!"
var/self_msg = "Your hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!"
@@ -263,7 +263,7 @@
// Cauterize Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/cauterize
+/decl/surgery_step/generic/cauterize
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
@@ -274,19 +274,19 @@
min_duration = 70
max_duration = 100
-/datum/surgery_step/generic/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open && target_zone != O_MOUTH
-/datum/surgery_step/generic/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("Your [affected.name] is being burned!", 40)
..()
-/datum/surgery_step/generic/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cauterize/end_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)
user.visible_message("[user] cauterizes the incision on [target]'s [affected.name] with \the [tool].", \
"You cauterize the incision on [target]'s [affected.name] with \the [tool].")
@@ -294,7 +294,7 @@
affected.germ_level = 0
affected.status &= ~ORGAN_BLEEDING
-/datum/surgery_step/generic/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/cauterize/fail_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)
user.visible_message("[user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!")
@@ -304,7 +304,7 @@
// Amputation Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/generic/amputate
+/decl/surgery_step/generic/amputate
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
@@ -314,7 +314,7 @@
min_duration = 110
max_duration = 160
-/datum/surgery_step/generic/amputate/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/amputate/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target_zone == O_EYES) //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
@@ -324,20 +324,20 @@
return 0
return !affected.cannot_amputate
-/datum/surgery_step/generic/amputate/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/amputate/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to amputate [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].")
target.custom_pain("Your [affected.amputation_point] is being ripped apart!", 100)
..()
-/datum/surgery_step/generic/amputate/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/amputate/end_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)
user.visible_message("[user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].", \
"You amputate [target]'s [affected.name] with \the [tool].")
affected.droplimb(1,DROPLIMB_EDGE)
-/datum/surgery_step/generic/amputate/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/generic/amputate/fail_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)
user.visible_message("[user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, sawwing through the bone in [target]'s [affected.name] with \the [tool]!")
diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm
index 87817c6e27..98f6ca8e00 100644
--- a/code/modules/surgery/implant.dm
+++ b/code/modules/surgery/implant.dm
@@ -4,10 +4,10 @@
// ITEM PLACEMENT SURGERY //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/cavity
+/decl/surgery_step/cavity
priority = 1
-/datum/surgery_step/cavity/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -15,7 +15,7 @@
return 0
return affected && affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING)
-/datum/surgery_step/cavity/proc/get_max_wclass(var/obj/item/organ/external/affected)
+/decl/surgery_step/cavity/proc/get_max_wclass(var/obj/item/organ/external/affected)
switch (affected.organ_tag)
if (BP_HEAD)
return ITEMSIZE_TINY
@@ -25,7 +25,7 @@
return ITEMSIZE_SMALL
return 0
-/datum/surgery_step/cavity/proc/get_cavity(var/obj/item/organ/external/affected)
+/decl/surgery_step/cavity/proc/get_cavity(var/obj/item/organ/external/affected)
switch (affected.organ_tag)
if (BP_HEAD)
return "cranial"
@@ -35,7 +35,7 @@
return "abdominal"
return ""
-/datum/surgery_step/cavity/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("[user]'s hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!")
@@ -45,7 +45,7 @@
// Space Making Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/cavity/make_space
+/decl/surgery_step/cavity/make_space
allowed_tools = list(
/obj/item/weapon/surgical/surgicaldrill = 100, \
/obj/item/weapon/pen = 75, \
@@ -55,12 +55,12 @@
min_duration = 60
max_duration = 80
-/datum/surgery_step/cavity/make_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/make_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && !affected.cavity
-/datum/surgery_step/cavity/make_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/make_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
"You start making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
@@ -68,7 +68,7 @@
affected.cavity = 1
..()
-/datum/surgery_step/cavity/make_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/make_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("[user] makes some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
"You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
@@ -77,7 +77,7 @@
// Cavity Closing Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/cavity/close_space
+/decl/surgery_step/cavity/close_space
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
@@ -89,12 +89,12 @@
min_duration = 60
max_duration = 80
-/datum/surgery_step/cavity/close_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/close_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.cavity
-/datum/surgery_step/cavity/close_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/close_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts mending [target]'s [get_cavity(affected)] cavity wall with \the [tool].", \
"You start mending [target]'s [get_cavity(affected)] cavity wall with \the [tool]." )
@@ -102,7 +102,7 @@
affected.cavity = 0
..()
-/datum/surgery_step/cavity/close_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/close_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("[user] mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].", \
" You mend[target]'s [get_cavity(affected)] cavity walls with \the [tool]." )
@@ -111,14 +111,14 @@
// Item Implantation Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/cavity/place_item
+/decl/surgery_step/cavity/place_item
priority = 0
allowed_tools = list(/obj/item = 100)
min_duration = 80
max_duration = 100
-/datum/surgery_step/cavity/place_item/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/place_item/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!istype(tool))
return FALSE
if(..())
@@ -133,14 +133,14 @@
total_volume += I.w_class
return total_volume <= get_max_wclass(affected)
-/datum/surgery_step/cavity/place_item/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/place_item/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts putting \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
"You start putting \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) //Nobody will probably ever see this, but I made these two blue. ~CK
target.custom_pain("The pain in your chest is living hell!",1)
..()
-/datum/surgery_step/cavity/place_item/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/place_item/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("[user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
@@ -159,18 +159,18 @@
// IMPLANT/ITEM REMOVAL SURGERY
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/cavity/implant_removal
+/decl/surgery_step/cavity/implant_removal
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
- allowed_procs = list(IS_WIRECUTTER = 75)
+ allowed_procs = list(TOOL_WIRECUTTER = 75)
min_duration = 80
max_duration = 100
-/datum/surgery_step/cavity/implant_removal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/implant_removal/can_use(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(affected.organ_tag == BP_HEAD)
var/obj/item/organ/internal/brain/sponge = target.internal_organs_by_name["brain"]
@@ -178,14 +178,14 @@
else
return ..()
-/datum/surgery_step/cavity/implant_removal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/implant_removal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts poking around inside [target]'s [affected.name] with \the [tool].", \
"You start poking around inside [target]'s [affected.name] with \the [tool]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
-/datum/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
var/find_prob = 0
@@ -234,7 +234,7 @@
user.visible_message("[user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \
"You could not find anything inside [target]'s [affected.name]." )
-/datum/surgery_step/cavity/implant_removal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/cavity/implant_removal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
..()
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
if (affected.implants.len)
diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm
index 0219149996..9ebefd807f 100644
--- a/code/modules/surgery/limb_reattach.dm
+++ b/code/modules/surgery/limb_reattach.dm
@@ -3,12 +3,12 @@
// LIMB SURGERY //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/limb/
- priority = 3 // Must be higher than /datum/surgery_step/internal
+/decl/surgery_step/limb/
+ priority = 3 // Must be higher than /decl/surgery_step/internal
req_open = 0
can_infect = 0
-/datum/surgery_step/limb/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -21,13 +21,13 @@
// Limb Attachment Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/limb/attach
+/decl/surgery_step/limb/attach
allowed_tools = list(/obj/item/organ/external = 100)
min_duration = 50
max_duration = 70
-/datum/surgery_step/limb/attach/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/attach/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!istype(tool))
return FALSE
var/obj/item/organ/external/E = tool
@@ -48,12 +48,12 @@
else
return 1
-/datum/surgery_step/limb/attach/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/attach/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("[user] starts attaching [E.name] to [target]'s [E.amputation_point].", \
"You start attaching [E.name] to [target]'s [E.amputation_point].")
-/datum/surgery_step/limb/attach/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/attach/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("[user] has attached [target]'s [E.name] to the [E.amputation_point].", \
"You have attached [target]'s [E.name] to the [E.amputation_point].")
@@ -70,7 +70,7 @@
target.updatehealth()
target.UpdateDamageIcon()
-/datum/surgery_step/limb/attach/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/attach/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message(" [user]'s hand slips, damaging [target]'s [E.amputation_point]!", \
" Your hand slips, damaging [target]'s [E.amputation_point]!")
@@ -80,7 +80,7 @@
// Limb Connection Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/limb/connect
+/decl/surgery_step/limb/connect
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -91,16 +91,16 @@
min_duration = 100
max_duration = 120
-/datum/surgery_step/limb/connect/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/connect/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
return E && !E.is_stump() && (E.status & ORGAN_CUT_AWAY)
-/datum/surgery_step/limb/connect/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/connect/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
user.visible_message("[user] starts connecting tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
"You start connecting tendons and muscle in [target]'s [E.amputation_point].")
-/datum/surgery_step/limb/connect/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/connect/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
user.visible_message("[user] has connected tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
"You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool].")
@@ -109,7 +109,7 @@
target.updatehealth()
target.UpdateDamageIcon()
-/datum/surgery_step/limb/connect/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/connect/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message(" [user]'s hand slips, damaging [target]'s [E.amputation_point]!", \
" Your hand slips, damaging [target]'s [E.amputation_point]!")
@@ -119,13 +119,13 @@
// Robolimb Attachment Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/limb/mechanize
+/decl/surgery_step/limb/mechanize
allowed_tools = list(/obj/item/robot_parts = 100)
min_duration = 80
max_duration = 100
-/datum/surgery_step/limb/mechanize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/mechanize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..() && istype(tool))
var/obj/item/robot_parts/p = tool
if (p.part)
@@ -133,11 +133,11 @@
return 0
return isnull(target.get_organ(target_zone))
-/datum/surgery_step/limb/mechanize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/mechanize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts attaching \the [tool] to [target].", \
"You start attaching \the [tool] to [target].")
-/datum/surgery_step/limb/mechanize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/mechanize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/robot_parts/L = tool
user.visible_message("[user] has attached \the [tool] to [target].", \
"You have attached \the [tool] to [target].")
@@ -161,7 +161,7 @@
qdel(tool)
-/datum/surgery_step/limb/mechanize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/limb/mechanize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message(" [user]'s hand slips, damaging [target]'s flesh!", \
" Your hand slips, damaging [target]'s flesh!")
target.apply_damage(10, BRUTE, null, sharp=1)
diff --git a/code/modules/surgery/neck.dm b/code/modules/surgery/neck.dm
index 6b970ad4c2..37e372aeb1 100644
--- a/code/modules/surgery/neck.dm
+++ b/code/modules/surgery/neck.dm
@@ -3,12 +3,12 @@
// BRAINSTEM SURGERY //
//////////////////////////////////////////////////////////////////////
-/datum/surgery_step/brainstem
+/decl/surgery_step/brainstem
priority = 2
req_open = 1
can_infect = 1
-/datum/surgery_step/brainstem/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -22,7 +22,7 @@
// Blood Vessel Mending
/////////////////////////////
-/datum/surgery_step/brainstem/mend_vessels
+/decl/surgery_step/brainstem/mend_vessels
priority = 1
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100,
@@ -32,20 +32,20 @@
min_duration = 80
max_duration = 100
-/datum/surgery_step/brainstem/mend_vessels/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vessels/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 0
-/datum/surgery_step/brainstem/mend_vessels/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vessels/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to mend the blood vessels on [target]'s brainstem with \the [tool].", \
"You start to mend the blood vessels on [target]'s brainstem with \the [tool].")
..()
-/datum/surgery_step/brainstem/mend_vessels/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vessels/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has mended the blood vessels on [target]'s brainstem with \the [tool]." , \
" You have mended the blood vessels on [target]'s brainstem with \the [tool].",)
target.op_stage.brainstem = 1
-/datum/surgery_step/brainstem/mend_vessels/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vessels/fail_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)
user.visible_message("[user]'s hand slips, tearing at [target]'s brainstem with \the [tool]!" , \
"Your hand slips, tearing at [target]'s brainstem with \the [tool]!" )
@@ -56,7 +56,7 @@
// Bone Drilling
/////////////////////////////
-/datum/surgery_step/brainstem/drill_vertebrae
+/decl/surgery_step/brainstem/drill_vertebrae
priority = 3 //Do this instead of expanding the skull cavity
allowed_tools = list(
/obj/item/weapon/surgical/surgicaldrill = 100,
@@ -64,20 +64,20 @@
/obj/item/weapon/pickaxe = 5
)
- allowed_procs = list(IS_SCREWDRIVER = 75)
+ allowed_procs = list(TOOL_SCREWDRIVER = 75)
min_duration = 200 //Very. Very. Carefully.
max_duration = 300
-/datum/surgery_step/brainstem/drill_vertebrae/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/drill_vertebrae/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 1
-/datum/surgery_step/brainstem/drill_vertebrae/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/drill_vertebrae/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to drill around [target]'s brainstem with \the [tool].", \
"You start to drill around [target]'s brainstem with \the [tool].")
..()
-/datum/surgery_step/brainstem/drill_vertebrae/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/drill_vertebrae/end_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)
user.visible_message("[user] has drilled around [target]'s brainstem with \the [tool]." , \
" You have drilled around [target]'s brainstem with \the [tool].",)
@@ -85,7 +85,7 @@
target.op_stage.brainstem = 2
affected.fracture() //Does not apply damage, simply breaks it if it wasn't already. Doesn't stop a defib on its own.
-/datum/surgery_step/brainstem/drill_vertebrae/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/drill_vertebrae/fail_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)
user.visible_message("[user]'s hand slips, shredding [target]'s brainstem with \the [tool]!" , \
"Your hand slips, shredding [target]'s brainstem with \the [tool]!" )
@@ -99,32 +99,32 @@
// Bone Cleaning
/////////////////////////////
-/datum/surgery_step/brainstem/clean_chips
+/decl/surgery_step/brainstem/clean_chips
priority = 3 //Do this instead of picking around for implants.
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100,
/obj/item/weapon/melee/changeling/claw = 40) //Surprisingly, claws are kind of okay at picking things out.
- allowed_procs = list(IS_WIRECUTTER = 60)
+ allowed_procs = list(TOOL_WIRECUTTER = 60)
min_duration = 90
max_duration = 120
-/datum/surgery_step/brainstem/clean_chips/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/clean_chips/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 2
-/datum/surgery_step/brainstem/clean_chips/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/clean_chips/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to pick around [target]'s brainstem for bone chips with \the [tool].", \
"You start to pick around [target]'s brainstem for bone chips with \the [tool].")
..()
-/datum/surgery_step/brainstem/clean_chips/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/clean_chips/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has cleaned around [target]'s brainstem with \the [tool]." , \
" You have cleaned around [target]'s brainstem with \the [tool].",)
target.AdjustParalysis(10) //Still invasive.
target.op_stage.brainstem = 3
-/datum/surgery_step/brainstem/clean_chips/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/clean_chips/fail_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)
user.visible_message("[user]'s hand slips, gouging [target]'s brainstem with \the [tool]!" , \
"Your hand slips, gouging [target]'s brainstem with \the [tool]!" )
@@ -138,7 +138,7 @@
// Spinal Cord Repair
/////////////////////////////
-/datum/surgery_step/brainstem/mend_cord
+/decl/surgery_step/brainstem/mend_cord
priority = 1 //Do this after IB.
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100,
@@ -149,22 +149,22 @@
min_duration = 100
max_duration = 200
-/datum/surgery_step/brainstem/mend_cord/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_cord/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 3
-/datum/surgery_step/brainstem/mend_cord/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_cord/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to fuse [target]'s spinal cord with \the [tool].", \
"You start to fuse [target]'s spinal cord with \the [tool].")
..()
-/datum/surgery_step/brainstem/mend_cord/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_cord/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has fused [target]'s spinal cord with \the [tool]." , \
" You have fused [target]'s spinal cord with \the [tool].",)
target.op_stage.brainstem = 4
target.AdjustParalysis(5)
target.add_modifier(/datum/modifier/franken_sickness, 20 MINUTES)
-/datum/surgery_step/brainstem/mend_cord/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_cord/fail_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)
user.visible_message("[user]'s hand slips, tearing at [target]'s spinal cord with \the [tool]!" , \
"Your hand slips, tearing at [target]'s spinal cord with \the [tool]!" )
@@ -178,7 +178,7 @@
// Vertebrae repair
/////////////////////////////
-/datum/surgery_step/brainstem/mend_vertebrae
+/decl/surgery_step/brainstem/mend_vertebrae
priority = 3 //Do this instead of fixing bones.
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100,
@@ -188,21 +188,21 @@
min_duration = 100
max_duration = 160
-/datum/surgery_step/brainstem/mend_vertebrae/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vertebrae/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 4
-/datum/surgery_step/brainstem/mend_vertebrae/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vertebrae/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to mend [target]'s opened vertebrae with \the [tool].", \
"You start to mend [target]'s opened vertebrae with \the [tool].")
..()
-/datum/surgery_step/brainstem/mend_vertebrae/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vertebrae/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has mended [target]'s vertebrae with \the [tool]." , \
" You have mended [target]'s vertebrae with \the [tool].",)
target.can_defib = 1
target.op_stage.brainstem = 5
-/datum/surgery_step/brainstem/mend_vertebrae/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/mend_vertebrae/fail_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)
user.visible_message("[user]'s hand slips, tearing at [target]'s spinal cord with \the [tool]!" , \
"Your hand slips, tearing at [target]'s spinal cord with \the [tool]!" )
@@ -216,32 +216,32 @@
// Realign tissues
/////////////////////////////
-/datum/surgery_step/brainstem/realign_tissue
+/decl/surgery_step/brainstem/realign_tissue
priority = 3 //Do this instead of searching for objects in the skull.
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100,
/obj/item/weapon/melee/changeling/claw = 20) //Claws. Good for digging, not so much for moving.
- allowed_procs = list(IS_WIRECUTTER = 60)
+ allowed_procs = list(TOOL_WIRECUTTER = 60)
min_duration = 90
max_duration = 120
-/datum/surgery_step/brainstem/realign_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/realign_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 5
-/datum/surgery_step/brainstem/realign_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/realign_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to realign the tissues in [target]'s skull with \the [tool].", \
"You start to realign the tissues in [target]'s skull with \the [tool].")
..()
-/datum/surgery_step/brainstem/realign_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/realign_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has realigned the tissues in [target]'s skull back into place with \the [tool]." , \
" You have realigned the tissues in [target]'s skull back into place with \the [tool].",)
target.AdjustParalysis(5) //I n v a s i v e
target.op_stage.brainstem = 0 //The cycle begins anew.
-/datum/surgery_step/brainstem/realign_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/brainstem/realign_tissue/fail_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)
user.visible_message("[user]'s hand slips, gouging [target]'s brainstem with \the [tool]!" , \
"Your hand slips, gouging [target]'s brainstem with \the [tool]!" )
diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm
index 499706006f..22b1e2042b 100644
--- a/code/modules/surgery/organs_internal.dm
+++ b/code/modules/surgery/organs_internal.dm
@@ -1,10 +1,10 @@
// Internal surgeries.
-/datum/surgery_step/internal
+/decl/surgery_step/internal
priority = 2
can_infect = 1
blood_level = 1
-/datum/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
@@ -19,13 +19,13 @@
// ALIEN EMBRYO SURGERY //
////////////////////////////////////////////////////////////////// // Here for future reference incase it's needed. See: Alien_embryo.dm and Alien_facehugger.dm
/*
-/datum/surgery_step/internal/remove_embryo
+/decl/surgery_step/internal/remove_embryo
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
- allowed_procs = list(IS_WIRECUTTER = 75)
+ allowed_procs = list(TOOL_WIRECUTTER = 75)
blood_level = 2
min_duration = 80
@@ -59,7 +59,7 @@
//////////////////////////////////////////////////////////////////
// CHEST INTERNAL ORGAN SURGERY //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/internal/fix_organ
+/decl/surgery_step/internal/fix_organ
allowed_tools = list(
/obj/item/stack/medical/advanced/bruise_pack= 100, \
/obj/item/stack/medical/bruise_pack = 20
@@ -68,7 +68,7 @@
min_duration = 70
max_duration = 90
-/datum/surgery_step/internal/fix_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/fix_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -81,7 +81,7 @@
break
return ..() && is_organ_damaged
-/datum/surgery_step/internal/fix_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/fix_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/tool_name = "\the [tool]"
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
tool_name = "regenerative membrane"
@@ -102,7 +102,7 @@
target.custom_pain("The pain in your [affected.name] is living hell!", 100)
..()
-/datum/surgery_step/internal/fix_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/fix_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/tool_name = "\the [tool]"
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
tool_name = "regenerative membrane"
@@ -125,7 +125,7 @@
if(I.organ_tag == O_LUNGS)
target.SetLosebreath(0)
-/datum/surgery_step/internal/fix_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/fix_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -149,7 +149,7 @@
// Organ Detaching Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/internal/detatch_organ/
+/decl/surgery_step/internal/detatch_organ/
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
@@ -160,7 +160,7 @@
min_duration = 90
max_duration = 110
-/datum/surgery_step/internal/detatch_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/detatch_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
@@ -188,7 +188,7 @@
return ..() && organ_to_remove
-/datum/surgery_step/internal/detatch_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/detatch_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to separate [target]'s [target.op_stage.current_organ] with \the [tool].", \
@@ -196,7 +196,7 @@
target.custom_pain("The pain in your [affected.name] is living hell!", 100)
..()
-/datum/surgery_step/internal/detatch_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/detatch_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"You have separated [target]'s [target.op_stage.current_organ] with \the [tool].")
@@ -204,7 +204,7 @@
if(I && istype(I))
I.status |= ORGAN_CUT_AWAY
-/datum/surgery_step/internal/detatch_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/detatch_organ/fail_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)
user.visible_message("[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
@@ -214,19 +214,19 @@
// Organ Removal Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/internal/remove_organ
+/decl/surgery_step/internal/remove_organ
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
- allowed_procs = list(IS_WIRECUTTER = 75)
+ allowed_procs = list(TOOL_WIRECUTTER = 75)
min_duration = 60
max_duration = 80
-/datum/surgery_step/internal/remove_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/remove_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
@@ -248,13 +248,13 @@
target.op_stage.current_organ = organ_to_remove
return ..()
-/datum/surgery_step/internal/remove_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/remove_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts removing [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start removing [target]'s [target.op_stage.current_organ] with \the [tool].")
target.custom_pain("Someone's ripping out your [target.op_stage.current_organ]!", 100)
..()
-/datum/surgery_step/internal/remove_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/remove_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has removed [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You have removed [target]'s [target.op_stage.current_organ] with \the [tool].")
@@ -265,7 +265,7 @@
O.removed(user)
target.op_stage.current_organ = null
-/datum/surgery_step/internal/remove_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/remove_organ/fail_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)
user.visible_message("[user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, damaging [target]'s [affected.name] with \the [tool]!")
@@ -275,7 +275,7 @@
// Organ Replacement Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/internal/replace_organ
+/decl/surgery_step/internal/replace_organ
allowed_tools = list(
/obj/item/organ = 100
)
@@ -283,7 +283,7 @@
min_duration = 60
max_duration = 80
-/datum/surgery_step/internal/replace_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/replace_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/internal/O = tool
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -327,14 +327,14 @@
return ..() && organ_missing && organ_compatible
-/datum/surgery_step/internal/replace_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/replace_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.name].", \
"You start transplanting \the [tool] into [target]'s [affected.name].")
target.custom_pain("Someone's rooting around in your [affected.name]!", 100)
..()
-/datum/surgery_step/internal/replace_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/replace_organ/end_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)
user.visible_message("[user] has transplanted \the [tool] into [target]'s [affected.name].", \
"You have transplanted \the [tool] into [target]'s [affected.name].")
@@ -343,7 +343,7 @@
user.remove_from_mob(O)
O.replaced(target,affected)
-/datum/surgery_step/internal/replace_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/replace_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips, damaging \the [tool]!", \
"Your hand slips, damaging \the [tool]!")
var/obj/item/organ/I = tool
@@ -354,7 +354,7 @@
// Organ Attaching Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/internal/attach_organ
+/decl/surgery_step/internal/attach_organ
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100, \
/obj/item/stack/cable_coil = 75
@@ -363,7 +363,7 @@
min_duration = 100
max_duration = 120
-/datum/surgery_step/internal/attach_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/attach_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
@@ -385,13 +385,13 @@
target.op_stage.current_organ = organ_to_replace
return ..()
-/datum/surgery_step/internal/attach_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/attach_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] begins reattaching [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start reattaching [target]'s [target.op_stage.current_organ] with \the [tool].")
target.custom_pain("Someone's digging needles into your [target.op_stage.current_organ]!", 100)
..()
-/datum/surgery_step/internal/attach_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/attach_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
@@ -399,7 +399,7 @@
if(I && istype(I))
I.status &= ~ORGAN_CUT_AWAY
-/datum/surgery_step/internal/attach_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/attach_organ/fail_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)
user.visible_message("[user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!")
@@ -409,7 +409,7 @@
// Organ Ripping Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/internal/rip_organ
+/decl/surgery_step/internal/rip_organ
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/ripper = 100
@@ -422,7 +422,7 @@
min_duration = 60
max_duration = 80
-/datum/surgery_step/internal/rip_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/rip_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
@@ -444,13 +444,13 @@
target.op_stage.current_organ = organ_to_remove
return ..()
-/datum/surgery_step/internal/rip_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/rip_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts ripping [target]'s [target.op_stage.current_organ] out with \the [tool].", \
"You start ripping [target]'s [target.op_stage.current_organ] out with \the [tool].")
target.custom_pain("Someone's ripping out your [target.op_stage.current_organ]!", 100)
..()
-/datum/surgery_step/internal/rip_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/rip_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has ripped [target]'s [target.op_stage.current_organ] out with \the [tool].", \
"You have ripped [target]'s [target.op_stage.current_organ] out with \the [tool].")
@@ -461,7 +461,7 @@
O.removed(user)
target.op_stage.current_organ = null
-/datum/surgery_step/internal/rip_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/internal/rip_organ/fail_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)
user.visible_message("[user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, damaging [target]'s [affected.name] with \the [tool]!")
diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm
index fe7d004dc4..e10ba2444f 100644
--- a/code/modules/surgery/other.dm
+++ b/code/modules/surgery/other.dm
@@ -7,7 +7,7 @@
// Internal Bleeding Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/fix_vein
+/decl/surgery_step/fix_vein
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100, \
@@ -19,7 +19,7 @@
min_duration = 70
max_duration = 90
-/datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
@@ -34,14 +34,14 @@
return affected.open == (affected.encased ? 3 : 2) && internal_bleeding
-/datum/surgery_step/fix_vein/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_vein/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.name] with \the [tool]." , \
"You start patching the damaged vein in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!", 100)
..()
-/datum/surgery_step/fix_vein/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_vein/end_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)
user.visible_message("[user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].", \
"You have patched the damaged vein in [target]'s [affected.name] with \the [tool].")
@@ -51,7 +51,7 @@
affected.update_damages()
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
-/datum/surgery_step/fix_vein/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_vein/fail_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)
user.visible_message("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
@@ -60,7 +60,7 @@
///////////////////////////////////////////////////////////////
// Necrosis Surgery Step 1
///////////////////////////////////////////////////////////////
-/datum/surgery_step/fix_dead_tissue //Debridement
+/decl/surgery_step/fix_dead_tissue //Debridement
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
@@ -74,7 +74,7 @@
min_duration = 110
max_duration = 160
-/datum/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
@@ -87,20 +87,20 @@
return affected && affected.open >= 2 && (affected.status & ORGAN_DEAD)
-/datum/surgery_step/fix_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.name] with \the [tool]." , \
"You start cutting away necrotic tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!", 100)
..()
-/datum/surgery_step/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_dead_tissue/end_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)
user.visible_message("[user] has cut away necrotic tissue in [target]'s [affected.name] with \the [tool].", \
"You have cut away necrotic tissue in [target]'s [affected.name] with \the [tool].")
affected.open = 3
-/datum/surgery_step/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/fix_dead_tissue/fail_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)
user.visible_message("[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
"Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
@@ -109,7 +109,7 @@
///////////////////////////////////////////////////////////////
// Necrosis Surgery Step 2
///////////////////////////////////////////////////////////////
-/datum/surgery_step/treat_necrosis
+/decl/surgery_step/treat_necrosis
priority = 2
allowed_tools = list(
/obj/item/weapon/reagent_containers/dropper = 100,
@@ -125,7 +125,7 @@
min_duration = 50
max_duration = 60
-/datum/surgery_step/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return 0
@@ -144,14 +144,14 @@
return 0
return affected && affected.open == 3 && (affected.status & ORGAN_DEAD)
-/datum/surgery_step/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.name] with \the [tool]." , \
"You start applying medication to the affected tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 50)
..()
-/datum/surgery_step/treat_necrosis/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/treat_necrosis/end_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 (!istype(tool, /obj/item/weapon/reagent_containers))
@@ -167,7 +167,7 @@
user.visible_message("[user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name].", \
"You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].")
-/datum/surgery_step/treat_necrosis/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/treat_necrosis/fail_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 (!istype(tool, /obj/item/weapon/reagent_containers))
@@ -186,7 +186,7 @@
// Hardsuit Removal Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/hardsuit
+/decl/surgery_step/hardsuit
allowed_tools = list(
/obj/item/weapon/weldingtool = 80,
/obj/item/weapon/surgical/circular_saw = 60,
@@ -200,7 +200,7 @@
min_duration = 120
max_duration = 180
-/datum/surgery_step/hardsuit/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/hardsuit/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!istype(target))
return 0
if(istype(tool,/obj/item/weapon/weldingtool))
@@ -209,7 +209,7 @@
return 0
return (target_zone == BP_TORSO) && ((istype(target.back, /obj/item/weapon/rig) && !(target.back.canremove)) || (istype(target.belt, /obj/item/weapon/rig) && !(target.belt.canremove)))
-/datum/surgery_step/hardsuit/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/hardsuit/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/weapon/rig/rig = target.back
if(!istype(rig))
rig = target.belt
@@ -219,7 +219,7 @@
"You start cutting through the support systems of \the [rig] on [target] with \the [tool].")
..()
-/datum/surgery_step/hardsuit/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/hardsuit/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/weapon/rig/rig = target.back
if(!istype(rig))
rig = target.belt
@@ -229,6 +229,6 @@
user.visible_message("[user] has cut through the support systems of \the [rig] on [target] with \the [tool].", \
"You have cut through the support systems of \the [rig] on [target] with \the [tool].")
-/datum/surgery_step/hardsuit/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/hardsuit/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s [tool] can't quite seem to get through the metal...", \
"\The [tool] can't quite seem to get through the metal. It's weakening, though - try again.")
diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm
index 964e2a87f1..bc28847768 100644
--- a/code/modules/surgery/robotics.dm
+++ b/code/modules/surgery/robotics.dm
@@ -3,10 +3,10 @@
// COMMON STEPS //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/
+/decl/surgery_step/robotics/
can_infect = 0
-/datum/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (isslime(target))
return 0
if (target_zone == O_EYES) //there are specific steps for eye surgery
@@ -28,7 +28,7 @@
// Unscrew Hatch Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/unscrew_hatch
+/decl/surgery_step/robotics/unscrew_hatch
allowed_tools = list(
/obj/item/weapon/coin = 50,
/obj/item/weapon/material/knife = 50
@@ -41,24 +41,24 @@
min_duration = 90
max_duration = 110
-/datum/surgery_step/robotics/unscrew_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/unscrew_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != O_MOUTH
-/datum/surgery_step/robotics/unscrew_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/unscrew_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"You start to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].")
..()
-/datum/surgery_step/robotics/unscrew_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/unscrew_hatch/end_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)
user.visible_message("[user] has opened the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool].",)
affected.open = 1
-/datum/surgery_step/robotics/unscrew_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/unscrew_hatch/fail_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)
user.visible_message("[user]'s [tool.name] slips, failing to unscrew [target]'s [affected.name].", \
"Your [tool] slips, failing to unscrew [target]'s [affected.name].")
@@ -67,7 +67,7 @@
// Open Hatch Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/open_hatch
+/decl/surgery_step/robotics/open_hatch
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
/obj/item/weapon/material/kitchen/utensil = 50
@@ -78,24 +78,24 @@
min_duration = 30
max_duration = 40
-/datum/surgery_step/robotics/open_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/open_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 1
-/datum/surgery_step/robotics/open_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/open_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].",
"You start to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].")
..()
-/datum/surgery_step/robotics/open_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/open_hatch/end_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)
user.visible_message("[user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"You open the maintenance hatch on [target]'s [affected.name] with \the [tool].")
affected.open = 3
-/datum/surgery_step/robotics/open_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/open_hatch/fail_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)
user.visible_message("[user]'s [tool.name] slips, failing to open the hatch on [target]'s [affected.name].",
"Your [tool] slips, failing to open the hatch on [target]'s [affected.name].")
@@ -104,7 +104,7 @@
// Close Hatch Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/close_hatch
+/decl/surgery_step/robotics/close_hatch
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
/obj/item/weapon/material/kitchen/utensil = 50
@@ -115,25 +115,25 @@
min_duration = 70
max_duration = 100
-/datum/surgery_step/robotics/close_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/close_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open && target_zone != O_MOUTH
-/datum/surgery_step/robotics/close_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/close_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to close and secure the hatch on [target]'s [affected.name] with \the [tool]." , \
"You begin to close and secure the hatch on [target]'s [affected.name] with \the [tool].")
..()
-/datum/surgery_step/robotics/close_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/close_hatch/end_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)
user.visible_message("[user] closes and secures the hatch on [target]'s [affected.name] with \the [tool].", \
"You close and secure the hatch on [target]'s [affected.name] with \the [tool].")
affected.open = 0
affected.germ_level = 0
-/datum/surgery_step/robotics/close_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/close_hatch/fail_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)
user.visible_message("[user]'s [tool.name] slips, failing to close the hatch on [target]'s [affected.name].",
"Your [tool.name] slips, failing to close the hatch on [target]'s [affected.name].")
@@ -142,7 +142,7 @@
// Brute Repair Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/repair_brute
+/decl/surgery_step/robotics/repair_brute
allowed_tools = list(
/obj/item/weapon/weldingtool = 100,
/obj/item/weapon/pickaxe/plasmacutter = 50
@@ -151,7 +151,7 @@
min_duration = 50
max_duration = 60
-/datum/surgery_step/robotics/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(istype(tool, /obj/item/weapon/weldingtool))
@@ -160,20 +160,20 @@
return 0
return affected && affected.open == 3 && (affected.disfigured || affected.brute_dam > 0) && target_zone != O_MOUTH
-/datum/surgery_step/robotics/repair_brute/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_brute/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to patch damage to [target]'s [affected.name]'s support structure with \the [tool]." , \
"You begin to patch damage to [target]'s [affected.name]'s support structure with \the [tool].")
..()
-/datum/surgery_step/robotics/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_brute/end_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)
user.visible_message("[user] finishes patching damage to [target]'s [affected.name] with \the [tool].", \
"You finish patching damage to [target]'s [affected.name] with \the [tool].")
affected.heal_damage(rand(30,50),0,1,1)
affected.disfigured = 0
-/datum/surgery_step/robotics/repair_brute/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_brute/fail_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)
user.visible_message("[user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name].",
"Your [tool.name] slips, damaging the internal structure of [target]'s [affected.name].")
@@ -183,7 +183,7 @@
// Burn Repair Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/repair_burn
+/decl/surgery_step/robotics/repair_burn
allowed_tools = list(
/obj/item/stack/cable_coil = 100
)
@@ -191,7 +191,7 @@
min_duration = 50
max_duration = 60
-/datum/surgery_step/robotics/repair_burn/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_burn/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(istype(tool, /obj/item/stack/cable_coil))
@@ -208,20 +208,20 @@
return affected && affected.open == 3 && (affected.disfigured || affected.burn_dam > 0) && target_zone != O_MOUTH
-/datum/surgery_step/robotics/repair_burn/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_burn/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to splice new cabling into [target]'s [affected.name]." , \
"You begin to splice new cabling into [target]'s [affected.name].")
..()
-/datum/surgery_step/robotics/repair_burn/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_burn/end_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)
user.visible_message("[user] finishes splicing cable into [target]'s [affected.name].", \
"You finishes splicing new cable into [target]'s [affected.name].")
affected.heal_damage(0,rand(30,50),1,1)
affected.disfigured = 0
-/datum/surgery_step/robotics/repair_burn/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/repair_burn/fail_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)
user.visible_message("[user] causes a short circuit in [target]'s [affected.name]!",
"You cause a short circuit in [target]'s [affected.name]!")
@@ -231,7 +231,7 @@
// Robot Organ Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/fix_organ_robotic //For artificial organs
+/decl/surgery_step/robotics/fix_organ_robotic //For artificial organs
allowed_tools = list(
/obj/item/stack/nanopaste = 100, \
/obj/item/weapon/surgical/bonegel = 30, \
@@ -242,7 +242,7 @@
min_duration = 70
max_duration = 90
-/datum/surgery_step/robotics/fix_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/fix_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -254,7 +254,7 @@
break
return affected.open == 3 && is_organ_damaged
-/datum/surgery_step/robotics/fix_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/fix_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -268,7 +268,7 @@
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
-/datum/surgery_step/robotics/fix_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/fix_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -282,7 +282,7 @@
if(I.organ_tag == O_EYES)
target.sdisabilities &= ~BLIND
-/datum/surgery_step/robotics/fix_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/fix_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -301,7 +301,7 @@
// Robot Organ Detaching Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/detatch_organ_robotic
+/decl/surgery_step/robotics/detatch_organ_robotic
allowed_tools = list(
/obj/item/device/multitool = 100
@@ -310,7 +310,7 @@
min_duration = 90
max_duration = 110
-/datum/surgery_step/robotics/detatch_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/detatch_organ_robotic/can_use(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(!(affected && (affected.robotic >= ORGAN_ROBOT)))
return 0
@@ -333,12 +333,12 @@
return ..() && organ_to_remove
-/datum/surgery_step/robotics/detatch_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/detatch_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to decouple [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start to decouple [target]'s [target.op_stage.current_organ] with \the [tool]." )
..()
-/datum/surgery_step/robotics/detatch_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/detatch_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has decoupled [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool].")
@@ -346,7 +346,7 @@
if(I && istype(I))
I.status |= ORGAN_CUT_AWAY
-/datum/surgery_step/robotics/detatch_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/detatch_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips, disconnecting \the [tool].", \
"Your hand slips, disconnecting \the [tool].")
@@ -354,13 +354,13 @@
// Robot Organ Attaching Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/attach_organ_robotic
+/decl/surgery_step/robotics/attach_organ_robotic
allowed_procs = list(IS_SCREWDRIVER = 100)
min_duration = 100
max_duration = 120
-/datum/surgery_step/robotics/attach_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/attach_organ_robotic/can_use(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(!(affected && (affected.robotic >= ORGAN_ROBOT)))
return 0
@@ -382,12 +382,12 @@
target.op_stage.current_organ = organ_to_replace
return ..()
-/datum/surgery_step/robotics/attach_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/attach_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] begins reattaching [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start reattaching [target]'s [target.op_stage.current_organ] with \the [tool].")
..()
-/datum/surgery_step/robotics/attach_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/attach_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
@@ -395,7 +395,7 @@
if(I && istype(I))
I.status &= ~ORGAN_CUT_AWAY
-/datum/surgery_step/robotics/attach_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/attach_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips, disconnecting \the [tool].", \
"Your hand slips, disconnecting \the [tool].")
@@ -403,7 +403,7 @@
// MMI Insertion Surgery
///////////////////////////////////////////////////////////////
-/datum/surgery_step/robotics/install_mmi
+/decl/surgery_step/robotics/install_mmi
allowed_tools = list(
/obj/item/device/mmi = 100
)
@@ -411,7 +411,7 @@
min_duration = 60
max_duration = 80
-/datum/surgery_step/robotics/install_mmi/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_mmi/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(target_zone != BP_HEAD)
return
@@ -441,13 +441,13 @@
return 1
-/datum/surgery_step/robotics/install_mmi/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_mmi/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts installing \the [tool] into [target]'s [affected.name].", \
"You start installing \the [tool] into [target]'s [affected.name].")
..()
-/datum/surgery_step/robotics/install_mmi/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_mmi/end_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)
user.visible_message("[user] has installed \the [tool] into [target]'s [affected.name].", \
"You have installed \the [tool] into [target]'s [affected.name].")
@@ -477,7 +477,7 @@
target.real_name = target.name
return
-/datum/surgery_step/robotics/install_mmi/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_mmi/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips.", \
"Your hand slips.")
@@ -485,7 +485,7 @@
* Install a Diona Nymph into a Nymph Mech
*/
-/datum/surgery_step/robotics/install_nymph
+/decl/surgery_step/robotics/install_nymph
allowed_tools = list(
/obj/item/weapon/holder/diona = 100
)
@@ -493,7 +493,7 @@
min_duration = 60
max_duration = 80
-/datum/surgery_step/robotics/install_nymph/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_nymph/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(target_zone != BP_TORSO)
return
@@ -528,13 +528,13 @@
return 1
-/datum/surgery_step/robotics/install_nymph/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_nymph/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts setting \the [tool] into [target]'s [affected.name].", \
"You start setting \the [tool] into [target]'s [affected.name].")
..()
-/datum/surgery_step/robotics/install_nymph/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_nymph/end_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)
user.visible_message("[user] has installed \the [tool] into [target]'s [affected.name].", \
"You have installed \the [tool] into [target]'s [affected.name].")
@@ -570,6 +570,6 @@
target.name = new_name
target.real_name = target.name
-/datum/surgery_step/robotics/install_nymph/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/robotics/install_nymph/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips.", \
"Your hand slips.")
diff --git a/code/modules/surgery/slimes.dm b/code/modules/surgery/slimes.dm
index 1c2a748c38..3fab099152 100644
--- a/code/modules/surgery/slimes.dm
+++ b/code/modules/surgery/slimes.dm
@@ -2,16 +2,16 @@
// SLIME CORE EXTRACTION //
//////////////////////////////////////////////////////////////////
-/datum/surgery_step/slime
+/decl/surgery_step/slime
is_valid_target(mob/living/simple_animal/slime/target)
return istype(target, /mob/living/simple_animal/slime/)
-/datum/surgery_step/slime/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
return target.stat == 2
-/datum/surgery_step/slime/cut_flesh
+/decl/surgery_step/slime/cut_flesh
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -21,25 +21,25 @@
min_duration = 30
max_duration = 50
-/datum/surgery_step/slime/cut_flesh/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_flesh/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
return ..() && istype(target) && target.core_removal_stage == 0
-/datum/surgery_step/slime/cut_flesh/begin_step(mob/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_flesh/begin_step(mob/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting through [target]'s flesh with \the [tool].", \
"You start cutting through [target]'s flesh with \the [tool].")
-/datum/surgery_step/slime/cut_flesh/end_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_flesh/end_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] cuts through [target]'s flesh with \the [tool].", \
"You cut through [target]'s flesh with \the [tool], revealing its silky innards.")
target.core_removal_stage = 1
-/datum/surgery_step/slime/cut_flesh/fail_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_flesh/fail_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips, tearing [target]'s flesh with \the [tool]!", \
"Your hand slips, tearing [target]'s flesh with \the [tool]!")
-/datum/surgery_step/slime/cut_innards
+/decl/surgery_step/slime/cut_innards
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -49,25 +49,25 @@
min_duration = 30
max_duration = 50
-/datum/surgery_step/slime/cut_innards/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_innards/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
return ..() && istype(target) && target.core_removal_stage == 1
-/datum/surgery_step/slime/cut_innards/begin_step(mob/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_innards/begin_step(mob/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting [target]'s silky innards apart with \the [tool].", \
"You start cutting [target]'s silky innards apart with \the [tool].")
-/datum/surgery_step/slime/cut_innards/end_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_innards/end_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] cuts [target]'s innards apart with \the [tool], exposing the cores.", \
"You cut [target]'s innards apart with \the [tool], exposing the cores.")
target.core_removal_stage = 2
-/datum/surgery_step/slime/cut_innards/fail_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/cut_innards/fail_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
user.visible_message("[user]'s hand slips, tearing [target]'s innards with \the [tool]!", \
"Your hand slips, tearing [target]'s innards with \the [tool]!")
-/datum/surgery_step/slime/saw_core
+/decl/surgery_step/slime/saw_core
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
@@ -76,14 +76,14 @@
min_duration = 50
max_duration = 70
-/datum/surgery_step/slime/saw_core/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/saw_core/can_use(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
return ..() && (istype(target) && target.core_removal_stage == 2 && target.cores > 0) //This is being passed a human as target, unsure why.
-/datum/surgery_step/slime/saw_core/begin_step(mob/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/saw_core/begin_step(mob/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting out one of [target]'s cores with \the [tool].", \
"You start cutting out one of [target]'s cores with \the [tool].")
-/datum/surgery_step/slime/saw_core/end_step(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/saw_core/end_step(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
target.cores--
user.visible_message("[user] cuts out one of [target]'s cores with \the [tool].",, \
"You cut out one of [target]'s cores with \the [tool]. [target.cores] cores left.")
@@ -94,7 +94,7 @@
target.icon_state = "slime extracted"
-/datum/surgery_step/slime/saw_core/fail_step(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
+/decl/surgery_step/slime/saw_core/fail_step(mob/living/user, mob/living/simple_animal/slime/target, target_zone, obj/item/tool)
var/datum/gender/T = gender_datums[user.get_visible_gender()]
user.visible_message("[user]'s hand slips, causing [T.him] to miss the core!", \
"Your hand slips, causing you to miss the core!")
\ No newline at end of file
diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm
index dcbfcd9736..f331439ae2 100644
--- a/code/modules/surgery/surgery.dm
+++ b/code/modules/surgery/surgery.dm
@@ -3,7 +3,7 @@
/obj/
var/surgery_odds = 0 // Used for tables/etc which can have surgery done of them.
-/datum/surgery_step
+/decl/surgery_step
var/priority = 0 //steps with higher priority would be attempted first
var/req_open = 1 //1 means the part must be cut open, 0 means it doesn't
@@ -28,30 +28,20 @@
var/blood_level = 0
//returns how well tool is suited for this step
-/datum/surgery_step/proc/tool_quality(obj/item/tool)
- for (var/T in allowed_tools)
- if (istype(tool,T))
- return allowed_tools[T]
+/decl/surgery_step/proc/tool_quality(obj/item/tool)
+ if(!tool)
+ return 0
+ if(tool.type in allowed_tools)
+ return allowed_tools[tool.type]
for(var/P in allowed_procs)
- switch(P)
- if(IS_SCREWDRIVER)
- if(tool.is_screwdriver())
- return allowed_procs[P]
- if(IS_CROWBAR)
- if(tool.is_crowbar())
- return allowed_procs[P]
- if(IS_WIRECUTTER)
- if(tool.is_wirecutter())
- return allowed_procs[P]
- if(IS_WRENCH)
- if(tool.is_wrench())
- return allowed_procs[P]
+ if(tool.get_tool_quality(P))
+ return allowed_procs[P]
return 0
// Checks if this step applies to the user mob at all
-/datum/surgery_step/proc/is_valid_target(mob/living/carbon/human/target)
+/decl/surgery_step/proc/is_valid_target(mob/living/carbon/human/target)
if(!hasorgans(target))
return 0
@@ -70,7 +60,7 @@
// Let's check if stuff blocks us from doing surgery on them
// TODO: make it based on area coverage rather than just forbid spacesuits?
// Returns true if target organ is covered
-/datum/surgery_step/proc/coverage_check(mob/living/user, mob/living/carbon/human/target, obj/item/organ/external/affected, obj/item/tool)
+/decl/surgery_step/proc/coverage_check(mob/living/user, mob/living/carbon/human/target, obj/item/organ/external/affected, obj/item/tool)
if(!affected)
return FALSE
@@ -84,11 +74,11 @@
return FALSE
// checks whether this step can be applied with the given user and target
-/datum/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 0
// does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
-/datum/surgery_step/proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/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)
spread_germs_to_organ(affected, user)
@@ -101,15 +91,13 @@
return
// does stuff to end the step, which is normally print a message + do whatever this step changes
-/datum/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return
// stuff that happens when the step fails
-/datum/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+/decl/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return null
-
-
/proc/spread_germs_to_organ(var/obj/item/organ/external/E, var/mob/living/carbon/human/user)
if(!istype(user) || !istype(E)) return
@@ -119,30 +107,20 @@
E.germ_level = max(germ_level,E.germ_level) //as funny as scrubbing microbes out with clean gloves is - no.
-
-/obj/item/proc/can_do_surgery(mob/living/carbon/M, mob/living/user)
-// if(M == user)
-// return 0
- if(!ishuman(M))
- return 1
-
- return 1
-
/obj/item/proc/do_surgery(mob/living/carbon/M, mob/living/user)
- if(!can_do_surgery(M, user))
- return 0
if(!istype(M))
- return 0
+ return FALSE
if (user.a_intent == I_HURT) //check for Hippocratic Oath
- return 0
+ return FALSE
var/zone = user.zone_sel.selecting
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
to_chat(user, "You can't operate on this area while surgery is already in progress.")
- return 1
+ return TRUE
- for(var/datum/surgery_step/S in surgery_steps)
+ for(var/decl/surgery_step/S in surgery_steps)
//check if tool is right or close enough and if this step is possible
- if(S.tool_quality(src))
+ var/qual = S.tool_quality(src)
+ if(qual)
var/step_is_valid = S.can_use(user, M, zone, src)
if(step_is_valid && S.is_valid_target(M))
@@ -150,16 +128,18 @@
to_chat(user, "You focus on attempting to perform surgery upon yourself.")
if(!do_after(user, 3 SECONDS, M))
- return 0
+ return FALSE
if(step_is_valid == SURGERY_FAILURE) // This is a failure that already has a message for failing.
- return 1
+ return TRUE
M.op_stage.in_progress += zone
S.begin_step(user, M, zone, src) //start on it
var/success = TRUE
// Bad tools make it less likely to succeed.
- if(!prob(S.tool_quality(src)))
+ //if(!prob(S.tool_chance(src)))
+ if((ispath(qual) && !prob(S.allowed_tools[qual])) || \
+ (istext(qual) && !prob(S.allowed_procs[qual])))
success = FALSE
// Bad or no surface may mean failure as well.
@@ -170,7 +150,12 @@
// Not staying still fails you too.
if(success)
var/calc_duration = rand(S.min_duration, S.max_duration)
- if(!do_mob(user, M, calc_duration * toolspeed, zone))
+ if(istext(qual))
+ calc_duration *= src.get_tool_speed(qual)
+ else if(ispath(qual))
+ calc_duration *= src.tool_qualities[1] // Hack to get around still matching on types
+
+ if(!do_mob(user, M, calc_duration, zone))
success = FALSE
to_chat(user, "You must remain close to and keep focused on your patient to conduct surgery.")
@@ -183,8 +168,8 @@
if (ishuman(M))
var/mob/living/carbon/human/H = M
H.update_surgery()
- return 1 //don't want to do weapony things after surgery
- return 0
+ return TRUE //don't want to do weapony things after surgery
+ return FALSE
/proc/sort_surgeries()
var/gap = surgery_steps.len
@@ -196,8 +181,8 @@
if(gap < 1)
gap = 1
for(var/i = 1; gap + i <= surgery_steps.len; i++)
- var/datum/surgery_step/l = surgery_steps[i] //Fucking hate
- var/datum/surgery_step/r = surgery_steps[gap+i] //how lists work here
+ var/decl/surgery_step/l = surgery_steps[i] //Fucking hate
+ var/decl/surgery_step/r = surgery_steps[gap+i] //how lists work here
if(l.priority < r.priority)
surgery_steps.Swap(i, gap + i)
swapped = 1
diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm
index 2a6829b87c..67a9afabb4 100644
--- a/code/modules/tables/tables.dm
+++ b/code/modules/tables/tables.dm
@@ -99,7 +99,7 @@
/obj/structure/table/attackby(obj/item/weapon/W, mob/user)
- if(reinforced && W.is_screwdriver())
+ if(reinforced && W.get_tool_quality(TOOL_SCREWDRIVER))
remove_reinforced(W, user)
if(!reinforced)
update_desc()
@@ -107,7 +107,7 @@
update_material()
return 1
- if(carpeted && W.is_crowbar())
+ if(carpeted && W.get_tool_quality(TOOL_CROWBAR))
user.visible_message("\The [user] removes the carpet from \the [src].",
"You remove the carpet from \the [src].")
new carpeted_type(loc)
@@ -127,7 +127,7 @@
else
to_chat(user, "You don't have enough carpet!")
- if(!reinforced && !carpeted && material && W.is_wrench())
+ if(!reinforced && !carpeted && material && W.get_tool_quality(TOOL_WRENCH))
remove_material(W, user)
if(!material)
update_connections(1)
@@ -138,16 +138,16 @@
update_material()
return 1
- if(!carpeted && !reinforced && !material && W.is_wrench())
- dismantle(W, user)
- return 1
+ if(!carpeted && !reinforced && !material && W.get_tool_quality(TOOL_WRENCH))
+ return dismantle(W, user)
+
- if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
+ if(health < maxhealth && W.get_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/F = W
if(F.welding)
to_chat(user, "You begin reparing damage to \the [src].")
playsound(src, F.usesound, 50, 1)
- if(!do_after(user, 20 * F.toolspeed) || !F.remove_fuel(1, user))
+ if(!do_after(user, 20 * F.get_tool_speed(TOOL_WELDER)) || !F.remove_fuel(1, user))
return
user.visible_message("\The [user] repairs some damage to \the [src].",
"You repair some damage to \the [src].")
@@ -272,25 +272,28 @@
return null
/obj/structure/table/proc/remove_reinforced(obj/item/weapon/S, mob/user)
- reinforced = common_material_remove(user, reinforced, 40 * S.toolspeed, "reinforcements", "screws", S.usesound)
+ reinforced = common_material_remove(user, reinforced, 40 * S.get_tool_speed(TOOL_SCREWDRIVER), "reinforcements", "screws", S.usesound)
/obj/structure/table/proc/remove_material(obj/item/weapon/W, mob/user)
- material = common_material_remove(user, material, 20 * W.toolspeed, "plating", "bolts", W.usesound)
+ material = common_material_remove(user, material, 20 * W.get_tool_speed(TOOL_WRENCH), "plating", "bolts", W.usesound)
/obj/structure/table/proc/dismantle(obj/item/W, mob/user)
- if(manipulating) return
- manipulating = 1
+ if(manipulating)
+ return FALSE
+ if(!W.get_tool_quality(TOOL_WRENCH))
+ return FALSE
+ manipulating = TRUE
user.visible_message("\The [user] begins dismantling \the [src].",
"You begin dismantling \the [src].")
playsound(src, W.usesound, 50, 1)
- if(!do_after(user, 20 * W.toolspeed))
- manipulating = 0
- return
+ if(!do_after(user, 20 * W.get_tool_speed(TOOL_WRENCH)))
+ manipulating = FALSE
+ return FALSE
user.visible_message("\The [user] dismantles \the [src].",
"You dismantle \the [src].")
new /obj/item/stack/material/steel(src.loc)
qdel(src)
- return
+ return TRUE
// Returns a list of /obj/item/weapon/material/shard objects that were created as a result of this table's breakage.
// Used for !fun! things such as embedding shards in the faces of tableslammed people.
diff --git a/code/modules/tools/tool_quality.dm b/code/modules/tools/tool_quality.dm
new file mode 100644
index 0000000000..dbfb2a1379
--- /dev/null
+++ b/code/modules/tools/tool_quality.dm
@@ -0,0 +1,40 @@
+/obj/item
+ var/list/tool_qualities = list()
+
+/obj/item/examine(mob/user)
+ . = ..()
+ for(var/qual in tool_qualities)
+ var/msg
+ switch(tool_qualities[qual])
+ if(TOOL_QUALITY_WORST)
+ msg += "very poor "
+ if(TOOL_QUALITY_POOR)
+ msg += "poor "
+ if(TOOL_QUALITY_MEDIOCRE)
+ msg += "mediocre "
+ if(TOOL_QUALITY_STANDARD)
+ msg += ""
+ if(TOOL_QUALITY_DECENT)
+ msg += "decent "
+ if(TOOL_QUALITY_GOOD)
+ msg += "pretty good "
+ if(TOOL_QUALITY_BEST)
+ msg += "very good "
+ . += "It looks like it can be used as a [msg][qual]."
+
+/atom/proc/get_tool_quality(tool_quality)
+ return TOOL_QUALITY_NONE
+
+/// Used to check for a specific tool quality on an item.
+/// Returns the value of `tool_quality` if it is found, else 0.
+/obj/item/get_tool_quality(quality)
+ return LAZYFIND(tool_qualities, quality)
+
+/obj/item/proc/set_tool_quality(tool, quality)
+ tool_qualities[tool] = quality
+
+/obj/item/proc/get_tool_speed(quality)
+ return LAZYFIND(tool_qualities, quality)
+
+/obj/item/proc/get_use_time(quality, base_time)
+ return LAZYFIND(tool_qualities, quality) ? base_time / tool_qualities[quality] : -1
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tools/combitool.dm b/code/modules/tools/tools/combitool.dm
similarity index 99%
rename from code/game/objects/items/weapons/tools/combitool.dm
rename to code/modules/tools/tools/combitool.dm
index cd507a5644..ca2be54a94 100644
--- a/code/game/objects/items/weapons/tools/combitool.dm
+++ b/code/modules/tools/tools/combitool.dm
@@ -29,7 +29,7 @@
if(loc == user && tools.len)
. += "It has the following fittings:"
for(var/obj/item/tool in tools)
- . += "[bicon(tool)] - [tool.name][tools[current_tool]==tool?" (selected)":""]")
+ . += "[bicon(tool)] - [tool.name][tools[current_tool]==tool?" (selected)":""]"
/obj/item/weapon/combitool/Initialize()
. = ..()
diff --git a/code/game/objects/items/weapons/tools/crowbar.dm b/code/modules/tools/tools/crowbar.dm
similarity index 77%
rename from code/game/objects/items/weapons/tools/crowbar.dm
rename to code/modules/tools/tools/crowbar.dm
index 2fccff9aae..20e897685a 100644
--- a/code/game/objects/items/weapons/tools/crowbar.dm
+++ b/code/modules/tools/tools/crowbar.dm
@@ -10,7 +10,6 @@
slot_flags = SLOT_BELT
force = 6
throwforce = 7
- pry = 1
item_state = "crowbar"
w_class = ITEMSIZE_SMALL
origin_tech = list(TECH_ENGINEERING = 1)
@@ -19,8 +18,7 @@
usesound = 'sound/items/crowbar.ogg'
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
- toolspeed = 1
- tool_qualities = list(TOOL_CROWBAR)
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_STANDARD)
/obj/item/weapon/tool/crowbar/red
icon = 'icons/obj/tools.dmi'
@@ -48,7 +46,7 @@
icon = 'icons/obj/abductor.dmi'
usesound = 'sound/weapons/sonic_jackhammer.ogg'
icon_state = "crowbar"
- toolspeed = 0.1
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_BEST)
origin_tech = list(TECH_COMBAT = 4, TECH_ENGINEERING = 4)
/obj/item/weapon/tool/crowbar/hybrid
@@ -57,7 +55,7 @@
catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_crowbar)
icon_state = "hybcrowbar"
usesound = 'sound/weapons/sonic_jackhammer.ogg'
- toolspeed = 0.4
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_DECENT)
origin_tech = list(TECH_COMBAT = 4, TECH_ENGINEERING = 3)
reach = 2
@@ -66,36 +64,23 @@
desc = "A hydraulic prying tool, compact but powerful. Designed to replace crowbars in industrial synthetics."
usesound = 'sound/items/jaws_pry.ogg'
force = 10
- toolspeed = 0.5
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_DECENT)
-/obj/item/weapon/tool/crowbar/power
+/obj/item/weapon/tool/hydraulic_cutter
name = "jaws of life"
- desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a prying head."
+ desc = "A set of jaws of life, compressed through the magic of science."
icon_state = "jaws_pry"
item_state = "jawsoflife"
matter = list(MAT_METAL=150, MAT_SILVER=50)
origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
usesound = 'sound/items/jaws_pry.ogg'
force = 15
- toolspeed = 0.25
- var/obj/item/weapon/tool/wirecutters/power/counterpart = null
+ var/state = 0 // Technically boolean, but really a state machine
+ tool_qualities = list(TOOL_CROWBAR = TOOL_QUALITY_GOOD)
-/obj/item/weapon/tool/crowbar/power/Initialize(var/ml, no_counterpart = TRUE)
- . = ..()
- if(!counterpart && no_counterpart)
- counterpart = new(src, FALSE)
- counterpart.counterpart = src
-
-/obj/item/weapon/tool/crowbar/power/Destroy()
- if(counterpart)
- counterpart.counterpart = null // So it can qdel cleanly.
- QDEL_NULL(counterpart)
- return ..()
-
-/obj/item/weapon/tool/crowbar/power/attack_self(mob/user)
+/obj/item/weapon/tool/hydraulic_cutter/attack_self(mob/user)
playsound(src, 'sound/items/change_jaws.ogg', 50, 1)
- user.drop_item(src)
- counterpart.forceMove(get_turf(src))
- src.forceMove(counterpart)
- user.put_in_active_hand(counterpart)
+ set_tool_quality(TOOL_CROWBAR, state ? TOOL_QUALITY_GOOD : TOOL_QUALITY_NONE)
+ set_tool_quality(TOOL_WIRECUTTER, state ? TOOL_QUALITY_NONE : TOOL_QUALITY_GOOD)
+ state = !state
to_chat(user, "You attach the cutting jaws to [src].")
diff --git a/code/game/objects/items/weapons/tools/screwdriver.dm b/code/modules/tools/tools/screwdriver.dm
similarity index 81%
rename from code/game/objects/items/weapons/tools/screwdriver.dm
rename to code/modules/tools/tools/screwdriver.dm
index e8a578dc7d..43c8cebb13 100644
--- a/code/game/objects/items/weapons/tools/screwdriver.dm
+++ b/code/modules/tools/tools/screwdriver.dm
@@ -20,8 +20,7 @@
matter = list(MAT_STEEL = 75)
attack_verb = list("stabbed")
sharp = 1
- toolspeed = 1
- tool_qualities = list(TOOL_SCREWDRIVER)
+ tool_qualities = list(TOOL_SCREWDRIVER = TOOL_QUALITY_STANDARD)
var/random_color = TRUE
/obj/item/weapon/tool/screwdriver/Initialize()
@@ -83,7 +82,7 @@
icon_state = "screwdriver_a"
item_state = "screwdriver_black"
usesound = 'sound/items/pshoom.ogg'
- toolspeed = 0.1
+ tool_qualities = list(TOOL_SCREWDRIVER = TOOL_QUALITY_BEST)
random_color = FALSE
/obj/item/weapon/tool/screwdriver/hybrid
@@ -94,7 +93,7 @@
origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3)
w_class = ITEMSIZE_NORMAL
usesound = 'sound/effects/uncloak.ogg'
- toolspeed = 0.4
+ tool_qualities = list(TOOL_SCREWDRIVER = TOOL_QUALITY_DECENT)
random_color = FALSE
reach = 2
@@ -102,11 +101,11 @@
name = "powered screwdriver"
desc = "An electrical screwdriver, designed to be both precise and quick."
usesound = 'sound/items/drill_use.ogg'
- toolspeed = 0.5
+ tool_qualities = list(TOOL_SCREWDRIVER = TOOL_QUALITY_DECENT)
-/obj/item/weapon/tool/screwdriver/power
+/obj/item/weapon/tool/powerdrill
name = "hand drill"
- desc = "A simple powered hand drill. It's fitted with a screw bit."
+ desc = "A simple powered hand drill."
icon_state = "drill_screw"
item_state = "drill"
matter = list(MAT_STEEL = 150, MAT_SILVER = 50)
@@ -120,26 +119,12 @@
attack_verb = list("drilled", "screwed", "jabbed", "whacked")
hitsound = 'sound/items/drill_hit.ogg'
usesound = 'sound/items/drill_use.ogg'
- toolspeed = 0.25
- random_color = FALSE
- var/obj/item/weapon/tool/wrench/power/counterpart = null
+ var/state = 0 // Technically boolean, but really a state machine
+ tool_qualities = list(TOOL_SCREWDRIVER = TOOL_QUALITY_GOOD)
-/obj/item/weapon/tool/screwdriver/power/Initialize(var/ml, no_counterpart = TRUE)
- . = ..()
- if(!counterpart && no_counterpart)
- counterpart = new(src, FALSE)
- counterpart.counterpart = src
-
-/obj/item/weapon/tool/screwdriver/power/Destroy()
- if(counterpart)
- counterpart.counterpart = null // So it can qdel cleanly.
- QDEL_NULL(counterpart)
- return ..()
-
-/obj/item/weapon/tool/screwdriver/power/attack_self(mob/user)
+/obj/item/weapon/tool/powerdrill/attack_self(mob/user)
playsound(src,'sound/items/change_drill.ogg',50,1)
- user.drop_item(src)
- counterpart.forceMove(get_turf(src))
- src.forceMove(counterpart)
- user.put_in_active_hand(counterpart)
- to_chat(user, "You attach the bolt driver bit to [src].")
+ set_tool_quality(TOOL_SCREWDRIVER, state ? TOOL_QUALITY_GOOD : TOOL_QUALITY_NONE)
+ set_tool_quality(TOOL_WRENCH, state ? TOOL_QUALITY_NONE : TOOL_QUALITY_GOOD)
+ state = !state
+ to_chat(user, "You attach the bolt driver bit to [src].")
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/modules/tools/tools/weldingtool.dm
similarity index 97%
rename from code/game/objects/items/weapons/tools/weldingtool.dm
rename to code/modules/tools/tools/weldingtool.dm
index 3f45de2bdf..efa123fc8d 100644
--- a/code/game/objects/items/weapons/tools/weldingtool.dm
+++ b/code/modules/tools/tools/weldingtool.dm
@@ -22,7 +22,7 @@
//R&D tech level
origin_tech = list(TECH_ENGINEERING = 1)
- tool_qualities = list(TOOL_WELDER)
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_STANDARD)
//Welding tool specific stuff
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
@@ -38,7 +38,6 @@
var/eye_safety_modifier = 0 // Increasing this will make less eye protection needed to stop eye damage. IE at 1, sunglasses will fully protect.
var/burned_fuel_for = 0 // Keeps track of how long the welder's been on, used to gradually empty the welder if left one, without RNG.
var/always_process = FALSE // If true, keeps the welder on the process list even if it's off. Used for when it needs to regenerate fuel.
- toolspeed = 1
drop_sound = 'sound/items/drop/weldingtool.ogg'
pickup_sound = 'sound/items/pickup/weldingtool.ogg'
@@ -277,6 +276,7 @@
else if(T)
T.visible_message("\The [src] turns on.")
playsound(src, acti_sound, 50, 1)
+ set_tool_quality(TOOL_WELDER, initial(tool_qualities[TOOL_WELDER]))
src.force = 15
src.damtype = "fire"
src.w_class = ITEMSIZE_LARGE
@@ -299,6 +299,7 @@
else if(T)
T.visible_message("\The [src] turns off.")
playsound(src, deac_sound, 50, 1)
+ set_tool_quality(TOOL_WELDER, TOOL_QUALITY_NONE)
src.force = 3
src.damtype = "brute"
src.w_class = initial(src.w_class)
@@ -366,7 +367,7 @@
/obj/item/weapon/weldingtool/largetank/cyborg
name = "integrated welding tool"
desc = "An advanced welder designed to be used in robotic systems."
- toolspeed = 0.5
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_DECENT)
/obj/item/weapon/weldingtool/hugetank
name = "upgraded welding tool"
@@ -385,7 +386,7 @@
w_class = ITEMSIZE_SMALL
matter = list(MAT_METAL = 30, MAT_GLASS = 10)
change_icons = 0
- toolspeed = 2
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_MEDIOCRE)
eye_safety_modifier = 1 // Safer on eyes.
/datum/category_item/catalogue/anomalous/precursor_a/alien_welder
@@ -418,7 +419,7 @@
catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_welder)
icon = 'icons/obj/abductor.dmi'
icon_state = "welder"
- toolspeed = 0.1
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_BEST)
flame_color = "#6699FF" // Light bluish.
eye_safety_modifier = 2
change_icons = 0
@@ -438,7 +439,7 @@
w_class = ITEMSIZE_NORMAL
origin_tech = list(TECH_ENGINEERING = 4, TECH_PHORON = 3)
matter = list(MAT_STEEL = 70, "glass" = 120)
- toolspeed = 0.5
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_DECENT)
change_icons = 0
flame_intensity = 3
always_process = TRUE
@@ -456,7 +457,7 @@
icon_state = "hybwelder"
max_fuel = 80 //more max fuel is better! Even if it doesn't actually use fuel.
eye_safety_modifier = -2 // Brighter than the sun. Literally, you can look at the sun with a welding mask of proper grade, this will burn through that.
- toolspeed = 0.25
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_GOOD)
w_class = ITEMSIZE_NORMAL
flame_intensity = 5
origin_tech = list(TECH_ENGINEERING = 5, TECH_PHORON = 4, TECH_PRECURSOR = 1)
@@ -473,7 +474,7 @@
max_fuel = 10
w_class = ITEMSIZE_NO_CONTAINER
matter = null
- toolspeed = 1.25
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_MEDIOCRE)
change_icons = 0
flame_intensity = 1
eye_safety_modifier = 1
@@ -521,7 +522,7 @@
desc = "A bulky, cooler-burning welding tool that draws from a worn welding tank."
icon_state = "tubewelder"
max_fuel = 5
- toolspeed = 1.75
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_POOR)
eye_safety_modifier = 2
/*
@@ -656,7 +657,7 @@
use_external_power = 1
/obj/item/weapon/weldingtool/electric/mounted/cyborg
- toolspeed = 0.5
+ tool_qualities = list(TOOL_WELDER = TOOL_QUALITY_DECENT)
/obj/item/weapon/weldingtool/electric/mounted/exosuit
var/obj/item/mecha_parts/mecha_equipment/equip_mount = null
diff --git a/code/game/objects/items/weapons/tools/wirecutters.dm b/code/modules/tools/tools/wirecutters.dm
similarity index 69%
rename from code/game/objects/items/weapons/tools/wirecutters.dm
rename to code/modules/tools/tools/wirecutters.dm
index 4f50e0d491..43bf276861 100644
--- a/code/game/objects/items/weapons/tools/wirecutters.dm
+++ b/code/modules/tools/tools/wirecutters.dm
@@ -21,8 +21,7 @@
pickup_sound = 'sound/items/pickup/wirecutter.ogg'
sharp = 1
edge = 1
- toolspeed = 1
- tool_qualities = list(TOOL_WIRECUTTER)
+ tool_qualities = list(TOOL_WIRECUTTER = TOOL_QUALITY_STANDARD)
var/random_color = TRUE
/obj/item/weapon/tool/wirecutters/Initialize()
@@ -63,7 +62,7 @@
catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_wirecutters)
icon = 'icons/obj/abductor.dmi'
icon_state = "cutters"
- toolspeed = 0.1
+ tool_qualities = list(TOOL_WIRECUTTER = TOOL_QUALITY_BEST)
origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 4)
random_color = FALSE
@@ -71,7 +70,7 @@
name = "wirecutters"
desc = "This cuts wires. With science."
usesound = 'sound/items/jaws_cut.ogg'
- toolspeed = 0.5
+ tool_qualities = list(TOOL_WIRECUTTER = TOOL_QUALITY_GOOD)
/obj/item/weapon/tool/wirecutters/hybrid
name = "strange wirecutters"
@@ -81,38 +80,6 @@
origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_PHORON = 2)
attack_verb = list("pinched", "nipped", "warped", "blasted")
usesound = 'sound/effects/stealthoff.ogg'
- toolspeed = 0.4
+ tool_qualities = list(TOOL_WIRECUTTER = TOOL_QUALITY_GOOD)
reach = 2
-
-/obj/item/weapon/tool/wirecutters/power
- name = "jaws of life"
- desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a cutting head."
- icon_state = "jaws_cutter"
- item_state = "jawsoflife"
- origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
- matter = list(MAT_METAL=150, MAT_SILVER=50)
- usesound = 'sound/items/jaws_cut.ogg'
- force = 15
- toolspeed = 0.25
- random_color = FALSE
- var/obj/item/weapon/tool/crowbar/power/counterpart = null
-
-/obj/item/weapon/tool/wirecutters/power/Initialize(var/ml, no_counterpart = TRUE)
- . = ..(ml)
- if(!counterpart && no_counterpart)
- counterpart = new(src, FALSE)
- counterpart.counterpart = src
-
-/obj/item/weapon/tool/wirecutters/power/Destroy()
- if(counterpart)
- counterpart.counterpart = null // So it can qdel cleanly.
- QDEL_NULL(counterpart)
- return ..()
-
-/obj/item/weapon/tool/wirecutters/power/attack_self(mob/user)
- playsound(src, 'sound/items/change_jaws.ogg', 50, 1)
- user.drop_item(src)
- counterpart.forceMove(get_turf(src))
- src.forceMove(counterpart)
- user.put_in_active_hand(counterpart)
- to_chat(user, "You attach the pry jaws to [src].")
+
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tools/wrench.dm b/code/modules/tools/tools/wrench.dm
similarity index 67%
rename from code/game/objects/items/weapons/tools/wrench.dm
rename to code/modules/tools/tools/wrench.dm
index acab3459b8..a2fb549499 100644
--- a/code/game/objects/items/weapons/tools/wrench.dm
+++ b/code/modules/tools/tools/wrench.dm
@@ -14,16 +14,15 @@
matter = list(MAT_STEEL = 150)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
usesound = 'sound/items/ratchet.ogg'
- toolspeed = 1
drop_sound = 'sound/items/drop/wrench.ogg'
pickup_sound = 'sound/items/pickup/wrench.ogg'
- tool_qualities = list(TOOL_WRENCH)
+ tool_qualities = list(TOOL_WRENCH = TOOL_QUALITY_STANDARD)
/obj/item/weapon/tool/wrench/cyborg
name = "automatic wrench"
desc = "An advanced robotic wrench. Can be found in industrial synthetic shells."
usesound = 'sound/items/drill_use.ogg'
- toolspeed = 0.5
+ tool_qualities = list(TOOL_WRENCH = TOOL_QUALITY_DECENT)
/obj/item/weapon/tool/wrench/hybrid // Slower and bulkier than normal power tools, but it has the power of reach. If reach even worked half the time.
name = "strange wrench"
@@ -37,7 +36,7 @@
origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_PHORON = 2)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked", "warped", "blasted")
usesound = 'sound/effects/stealthoff.ogg'
- toolspeed = 0.5
+ tool_qualities = list(TOOL_WRENCH = TOOL_QUALITY_DECENT)
reach = 2
@@ -63,40 +62,6 @@
icon = 'icons/obj/abductor.dmi'
icon_state = "wrench"
usesound = 'sound/effects/empulse.ogg'
- toolspeed = 0.1
+ tool_qualities = list(TOOL_WRENCH = TOOL_QUALITY_BEST)
origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 5)
-
-/obj/item/weapon/tool/wrench/power
- name = "hand drill"
- desc = "A simple powered hand drill. It's fitted with a bolt bit."
- icon_state = "drill_bolt"
- item_state = "drill"
- usesound = 'sound/items/drill_use.ogg'
- matter = list(MAT_STEEL = 150, MAT_SILVER = 50)
- origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
- force = 8
- w_class = ITEMSIZE_SMALL
- throwforce = 8
- attack_verb = list("drilled", "screwed", "jabbed")
- toolspeed = 0.25
- var/obj/item/weapon/tool/screwdriver/power/counterpart = null
-
-/obj/item/weapon/tool/wrench/power/Initialize(var/ml, no_counterpart = TRUE)
- . = ..()
- if(!counterpart && no_counterpart)
- counterpart = new(src, FALSE)
- counterpart.counterpart = src
-
-/obj/item/weapon/tool/wrench/power/Destroy()
- if(counterpart)
- counterpart.counterpart = null // So it can qdel cleanly.
- QDEL_NULL(counterpart)
- return ..()
-
-/obj/item/weapon/tool/wrench/power/attack_self(mob/user)
- playsound(src,'sound/items/change_drill.ogg',50,1)
- user.drop_item(src)
- counterpart.forceMove(get_turf(src))
- src.forceMove(counterpart)
- user.put_in_active_hand(counterpart)
- to_chat(user, "You attach the screw driver bit to [src].")
+
diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm
index c1ee89d700..a69c418159 100644
--- a/code/modules/vehicles/cargo_train.dm
+++ b/code/modules/vehicles/cargo_train.dm
@@ -67,7 +67,7 @@
return ..()
/obj/vehicle/train/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(open && W.is_wirecutter())
+ if(open && W.get_tool_quality(TOOL_WIRECUTTER))
passenger_allowed = !passenger_allowed
user.visible_message("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src].","You [passenger_allowed ? "cut" : "mend"] the load limiter cable.")
else
diff --git a/code/modules/vehicles/construction.dm b/code/modules/vehicles/construction.dm
index 1b3320b339..d2e31a7ef5 100644
--- a/code/modules/vehicles/construction.dm
+++ b/code/modules/vehicles/construction.dm
@@ -129,7 +129,7 @@
return
if(7)
- if(W.is_wrench() || W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_WRENCH) || W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin your finishing touches on \the [src].")
if(do_after(user, 20) && build_stage == 7)
@@ -177,7 +177,7 @@
return
if(2)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You close up \the [src].")
var/obj/vehicle/train/trolley/trailer/product = new(src)
@@ -258,7 +258,7 @@
return
if(6)
- if(W.is_wrench() || W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_WRENCH) || W.get_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin your finishing touches on \the [src].")
if(do_after(user, 20) && build_stage == 6)
diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm
index 56c4d7878a..1a540394a6 100644
--- a/code/modules/vehicles/vehicle.dm
+++ b/code/modules/vehicles/vehicle.dm
@@ -92,13 +92,13 @@
if(istype(W, /obj/item/weapon/hand_labeler))
return
if(mechanical)
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
if(!locked)
open = !open
update_icon()
to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].")
playsound(src, W.usesound, 50, 1)
- else if(W.is_crowbar() && cell && open)
+ else if(W.get_tool_quality(TOOL_CROWBAR) && cell && open)
remove_cell(user)
else if(istype(W, /obj/item/weapon/cell) && !cell && open)
diff --git a/code/modules/virus2/centrifuge.dm b/code/modules/virus2/centrifuge.dm
index aaa65ce9e7..75f98e4f9a 100644
--- a/code/modules/virus2/centrifuge.dm
+++ b/code/modules/virus2/centrifuge.dm
@@ -10,7 +10,7 @@
var/datum/disease2/disease/virus2 = null
/obj/machinery/computer/centrifuge/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(O.is_screwdriver())
+ if(O.get_tool_quality(TOOL_SCREWDRIVER))
return ..(O,user)
if(default_unfasten_wrench(user, O, 20))
diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm
index fb682f51d1..4976a0a3e3 100644
--- a/code/modules/virus2/diseasesplicer.dm
+++ b/code/modules/virus2/diseasesplicer.dm
@@ -12,7 +12,7 @@
var/scanning = 0
/obj/machinery/computer/diseasesplicer/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(I.is_screwdriver())
+ if(I.get_tool_quality(TOOL_SCREWDRIVER))
return ..(I,user)
if(default_unfasten_wrench(user, I, 20))
diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm
index 3db06689d7..4def7b4495 100644
--- a/code/modules/xenoarcheaology/tools/suspension_generator.dm
+++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm
@@ -127,7 +127,7 @@
/obj/machinery/suspension_gen/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(!locked && !suspension_field && default_deconstruction_screwdriver(user, W))
return
- else if(W.is_wrench())
+ else if(W.get_tool_quality(TOOL_WRENCH))
if(!suspension_field)
if(anchored)
anchored = 0
diff --git a/code/modules/xenobio/items/slime_objects.dm b/code/modules/xenobio/items/slime_objects.dm
index 5e48a99767..b8382314de 100644
--- a/code/modules/xenobio/items/slime_objects.dm
+++ b/code/modules/xenobio/items/slime_objects.dm
@@ -43,7 +43,7 @@
icon_state = "slime cube"
if(searching == 1)
searching = 0
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for (var/mob/M in viewers(T))
M.show_message("The activity in the cube dies down. Maybe it will spark another time.")
diff --git a/code/modules/xenobio2/machinery/core_extractor.dm b/code/modules/xenobio2/machinery/core_extractor.dm
index 5b38a939da..3d1b334e4f 100644
--- a/code/modules/xenobio2/machinery/core_extractor.dm
+++ b/code/modules/xenobio2/machinery/core_extractor.dm
@@ -26,11 +26,11 @@
/obj/machinery/slime/extractor/attackby(var/obj/item/W, var/mob/user)
//Let's try to deconstruct first.
- if(W.is_screwdriver() && !inuse)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER) && !inuse)
default_deconstruction_screwdriver(user, W)
return
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
default_deconstruction_crowbar(user, W)
return
diff --git a/code/modules/xenobio2/machinery/injector.dm b/code/modules/xenobio2/machinery/injector.dm
index 250e4cbc73..fb345f4ff2 100644
--- a/code/modules/xenobio2/machinery/injector.dm
+++ b/code/modules/xenobio2/machinery/injector.dm
@@ -88,11 +88,11 @@
/obj/machinery/xenobio2/manualinjector/attackby(var/obj/item/W, var/mob/user)
//Let's try to deconstruct first.
- if(W.is_screwdriver())
+ if(W.get_tool_quality(TOOL_SCREWDRIVER))
default_deconstruction_screwdriver(user, W)
return
- if(W.is_crowbar() && !occupant)
+ if(W.get_tool_quality(TOOL_CROWBAR) && !occupant)
default_deconstruction_crowbar(user, W)
return
diff --git a/code/modules/xenobio2/machinery/slime_replicator.dm b/code/modules/xenobio2/machinery/slime_replicator.dm
index 9e4969d635..ce6b899b4f 100644
--- a/code/modules/xenobio2/machinery/slime_replicator.dm
+++ b/code/modules/xenobio2/machinery/slime_replicator.dm
@@ -24,11 +24,11 @@
/obj/machinery/slime/replicator/attackby(var/obj/item/W, var/mob/user)
//Let's try to deconstruct first.
- if(W.is_screwdriver() && !inuse)
+ if(W.get_tool_quality(TOOL_SCREWDRIVER) && !inuse)
default_deconstruction_screwdriver(user, W)
return
- if(W.is_crowbar())
+ if(W.get_tool_quality(TOOL_CROWBAR))
default_deconstruction_crowbar(user, W)
return
diff --git a/code/modules/xenobio2/mob/slime/slime_monkey.dm b/code/modules/xenobio2/mob/slime/slime_monkey.dm
index 39660b1728..bb384e719c 100644
--- a/code/modules/xenobio2/mob/slime/slime_monkey.dm
+++ b/code/modules/xenobio2/mob/slime/slime_monkey.dm
@@ -29,7 +29,7 @@ Slime cube lives here.
icon_state = "slime cube"
if(searching == 1)
searching = 0
- var/turf/T = get_turf_or_move(src.loc)
+ var/turf/T = get_turf(src.loc)
for(var/mob/M in viewers(T))
M.show_message("The activity in the cube dies down. Maybe it will spark another time.")
@@ -42,7 +42,7 @@ Slime cube lives here.
S.mind.assigned_role = "Promethean"
S.set_species("Promethean")
S.shapeshifter_set_colour("#05FF9B")
- for(var/mob/M in viewers(get_turf_or_move(loc)))
+ for(var/mob/M in viewers(get_turf(loc)))
M.show_message("The monkey cube suddenly takes the shape of a humanoid!")
var/newname = sanitize(input(S, "You are a Promethean. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
if(newname)
diff --git a/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm b/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm
index 2c0b30631e..e3ce0de5cc 100644
--- a/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm
+++ b/maps/submaps/surface_submaps/mountains/quarantineshuttle.dmm
@@ -112,11 +112,11 @@
"ch" = (/obj/structure/table/steel,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
"ci" = (/obj/structure/table/steel,/obj/item/weapon/reagent_containers/syringe/antiviral,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
"cj" = (/obj/structure/table/steel,/obj/item/weapon/reagent_containers/spray/cleaner{desc = "Someone has crossed out the 'Space' from Space Cleaner and written in Chemistry. Scrawled on the back is, 'Okay, whoever filled this with polytrinic acid, it was only funny the first time. It was hard enough replacing the CMO's first cat!'"; name = "Chemistry Cleaner"},/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
-"ck" = (/obj/structure/table/steel,/obj/item/weapon/tool/crowbar/power,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
+"ck" = (/obj/structure/table/steel,/obj/item/weapon/tool/hydraulic_cutter,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
"cl" = (/obj/structure/table/rack,/obj/item/clothing/head/bio_hood,/obj/item/clothing/suit/bio_suit,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
"cm" = (/obj/item/weapon/weldingtool/largetank,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
"cn" = (/obj/structure/closet/crate/medical,/turf/simulated/mineral/floor/ignore_mapgen,/area/submap/cave/qShuttle)
-
+
(1,1,1) = {"
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/polaris.dme b/polaris.dme
index e1b65d71f1..d5f8b65796 100644
--- a/polaris.dme
+++ b/polaris.dme
@@ -295,7 +295,6 @@
#include "code\datums\components\crafting\crafting.dm"
#include "code\datums\components\crafting\crafting_external.dm"
#include "code\datums\components\crafting\recipes.dm"
-#include "code\datums\components\crafting\tool_quality.dm"
#include "code\datums\elements\_element.dm"
#include "code\datums\game_masters\_common.dm"
#include "code\datums\game_masters\default.dm"
@@ -1186,11 +1185,6 @@
#include "code\game\objects\items\weapons\tanks\jetpack.dm"
#include "code\game\objects\items\weapons\tanks\tank_types.dm"
#include "code\game\objects\items\weapons\tanks\tanks.dm"
-#include "code\game\objects\items\weapons\tools\crowbar.dm"
-#include "code\game\objects\items\weapons\tools\screwdriver.dm"
-#include "code\game\objects\items\weapons\tools\weldingtool.dm"
-#include "code\game\objects\items\weapons\tools\wirecutters.dm"
-#include "code\game\objects\items\weapons\tools\wrench.dm"
#include "code\game\objects\random\_random.dm"
#include "code\game\objects\random\guns_and_ammo.dm"
#include "code\game\objects\random\maintenance.dm"
@@ -3125,6 +3119,13 @@
#include "code\modules\tgui\states\physical.dm"
#include "code\modules\tgui\states\self.dm"
#include "code\modules\tgui\states\zlevel.dm"
+#include "code\modules\tools\tool_quality.dm"
+#include "code\modules\tools\tools\combitool.dm"
+#include "code\modules\tools\tools\crowbar.dm"
+#include "code\modules\tools\tools\screwdriver.dm"
+#include "code\modules\tools\tools\weldingtool.dm"
+#include "code\modules\tools\tools\wirecutters.dm"
+#include "code\modules\tools\tools\wrench.dm"
#include "code\modules\tooltip\tooltip.dm"
#include "code\modules\turbolift\_turbolift.dm"
#include "code\modules\turbolift\turbolift.dm"