Skip to content

Commit 36ca9ab

Browse files
authored
Fixes Most Screwdriver/Wrench/Wirecutter Special Tool Interactions (#37207)
* most cases * forgot user ref and more calls * fixes reversed arguments, standardize is_hot
1 parent 430687c commit 36ca9ab

File tree

34 files changed

+118
-115
lines changed

34 files changed

+118
-115
lines changed

code/datums/helper_datums/construction_datum.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
text = replacetext(text, "{es}", "es")
101101
text = replacetext(text, "{ies}", "ies")
102102
text = replacetext(text,"{USER}","[user]")
103-
text = replacetext(text,"{HOLDER}","[holder]")
103+
text = replacetext(text,"{HOLDER}","\the [holder.name]")
104104
return text
105105

106106
/datum/construction/proc/construct_message(step, mob/user, atom/movable/used_atom)

code/game/machinery/bots/mulebot.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ var/global/mulebot_count = 0
150150
if(user.drop_item(C, src))
151151
cell = C
152152
updateDialog()
153-
else if((istype(I,/obj/item/tool/wirecutters)||istype(I,/obj/item/device/multitool)) && user.a_intent != I_HURT)
153+
else if((I.is_wirecutter(user) || I.is_multitool(user)) && user.a_intent != I_HURT)
154154
attack_hand(user)
155155
else if(I.is_screwdriver(user) && user.a_intent != I_HURT)
156156
if(locked)

code/game/machinery/vending_packs.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
return
258258

259259
/obj/structure/stackopacks/attackby(obj/item/weapon/W as obj, mob/user as mob)
260-
if(istype(W,/obj/item/tool/wirecutters) || istype(W,/obj/item/weapon/shard) || istype(W,/obj/item/weapon/kitchen/utensil/knife/large) || istype(W,/obj/item/tool/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife))
260+
if(W.is_wirecutter(user) || istype(W,/obj/item/weapon/shard) || istype(W,/obj/item/weapon/kitchen/utensil/knife/large) || istype(W,/obj/item/tool/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife))
261261
var/turf/T = get_turf(src)
262262
for(var/obj/O in contents)
263263
O.forceMove(T)

code/game/objects/items/devices/deskbell.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@
269269
to_chat(user, "<span class='warning'>You must add wires first.</span>")
270270
return
271271
if(1)
272-
if(istype(W,/obj/item/tool/wirecutters))
272+
if(W.is_wirecutter(user))
273273
if(has_signaler)
274274
to_chat(user, "<span class='warning'>You must remove the signaler first.</span>")
275275
return

code/game/objects/items/devices/rigbuilding.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
to_chat(user, "You don't have enough cable to wire \the [src].")
5454
return
5555

56-
else if(istype(W, /obj/item/tool/wirecutters))
56+
else if(W.is_wirecutter(user))
5757
if(buildstate == RIG_WIRED)
5858
to_chat(user, "You secure the wiring in \the [src].")
5959
W.playtoolsound(src, 50)

code/game/objects/items/gum.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
/obj/item/gum/attackby(var/obj/item/W, var/mob/user)
114114
if(locked_to)
115115
var/datum/locking_category/category = locked_to.get_lock_cat_for(src)
116-
if(istype(category, /datum/locking_category/gum_stuck) && is_type_in_list(W, list(/obj/item/weapon/chisel, /obj/item/tool/screwdriver)))
116+
if(istype(category, /datum/locking_category/gum_stuck) && is_type_in_list(W, list(/obj/item/weapon/chisel, /obj/item/tool/screwdriver, /obj/item/tool/solder/screw)))
117117
playsound(src, "sound/items/screwdriver.ogg", 10, 1, -1)
118118
if(do_after(user, src, 5 SECONDS) && locked_to)
119119
to_chat(user, "You pry \the [src] loose from \the [locked_to].")

code/game/objects/items/stacks/sheets/light.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
max_amount = 60
1616

1717
/obj/item/stack/light_w/attackby(var/obj/item/O as obj, var/mob/user as mob)
18-
if(istype(O,/obj/item/tool/wirecutters))
18+
if(O.is_wirecutter(user))
1919
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
2020
CC.amount = 2
2121
amount--

code/game/objects/items/weapons/defib.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
to_chat(user, "<span class='notice'>You wrap the exposed wires around the cell.</span>")
268268
src.update_icon()
269269

270-
if (istype(I, /obj/item/tool/screwdriver))
270+
if (I.is_screwdriver(user))
271271
if (!power_supply)
272272
return
273273

code/game/objects/items/weapons/switchtool.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"/obj/item/weapon/chisel:chisel" = null,
3232
"/obj/item/device/multitool:multitool" = null)
3333
var/obj/item/deployed //what's currently in use
34-
var/removing_item = /obj/item/tool/screwdriver //the type of item that lets you take tools out
34+
var/can_remove_items = TRUE //if you can remove items with a screwdriver
3535

3636
/obj/item/weapon/switchtool/preattack(atom/target, mob/user, proximity_flag, click_parameters)
3737
if(istype(target, /obj/item/weapon/storage) && !istype(target, /obj/item/weapon/storage/pill_bottle)) //we place automatically, but want pill bottles to be meltable
@@ -91,7 +91,7 @@
9191
choose_deploy(user)
9292

9393
/obj/item/weapon/switchtool/attackby(var/obj/item/used_item, mob/user)
94-
if(istype(used_item, removing_item)) //if it's the thing that lets us remove tools and we have something to remove
94+
if(can_remove_items && used_item.is_screwdriver(user)) //if it's the thing that lets us remove tools and we have something to remove
9595
var/no_modules = TRUE
9696
for(var/module in stored_modules)
9797
if(stored_modules[module])
@@ -429,7 +429,7 @@
429429
undeploy_sound = "sound/weapons/switchsound.ogg"
430430
light_color = LIGHT_COLOR_CYAN
431431
mech_flags = MECH_SCAN_ILLEGAL
432-
removing_item = null
432+
can_remove_items = FALSE
433433
var/has_tech = 0
434434
var/hcolor = "CYAN"
435435
starting_materials = null

code/game/objects/items/weapons/tools.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
/obj/item/tool/weldingtool/attackby(obj/item/W as obj, mob/user as mob)
308308
if(user.is_in_modules(src))
309309
return
310-
if(istype(W,/obj/item/tool/screwdriver))
310+
if(W.is_screwdriver(user))
311311
if(welding)
312312
to_chat(user, "<span class='warning'>Stop welding first!</span>")
313313
return

0 commit comments

Comments
 (0)