From 8418997ed8d5183db374619a47bc4acd03574ac1 Mon Sep 17 00:00:00 2001
From: Contrabang <91113370+Contrabang@users.noreply.github.com>
Date: Thu, 6 Oct 2022 04:30:33 -0400
Subject: [PATCH] Moves most screwdriver checks to screwdriver_act (#19024)
* screwdriver_act my beloved
* convert to returns instead of . / lewcc review
* it will be done
* i'm a little bit stupid, but now time to test
* sometimes I get excited and press the commit
* The great test has been completed
* oh wow oh wow, lewc review
* found one last one
* Steel review
* Lewc review
* quick sirryan review
* removes stupid comments (old coders I blame)
* sirryan review two
* whoops...
* hal review
* the fix to the fix to the fix
* Revert "the fix to the fix to the fix"
FUCK I pushed to the wrong branch
This reverts commit a96fe98781b889c53796abf1fc0c30f0a6ea906c.
---
code/game/machinery/constructable_frame.dm | 46 ++++----
code/game/machinery/floodlight.dm | 22 ++--
code/game/machinery/mass_driver.dm | 23 ++--
code/game/machinery/navbeacon.dm | 13 +--
code/game/machinery/portable_turret.dm | 30 +++--
code/game/machinery/washing_machine.dm | 3 -
code/game/objects/items/devices/flash.dm | 18 +--
.../objects/items/devices/laserpointer.dm | 16 +--
code/game/objects/items/weapons/defib.dm | 19 ++--
.../items/weapons/grenades/bananade.dm | 50 +++++----
.../items/weapons/grenades/chem_grenade.dm | 72 ++++++------
.../objects/items/weapons/grenades/grenade.dm | 34 +++---
code/game/objects/items/weapons/legcuffs.dm | 27 +++--
.../objects/items/weapons/pneumaticCannon.dm | 9 +-
.../objects/items/weapons/storage/secure.dm | 12 +-
code/game/objects/structures/barsign.dm | 33 +++---
code/game/objects/structures/false_walls.dm | 33 +++---
code/game/objects/structures/signs.dm | 54 ++++-----
code/modules/arcade/prize_counter.dm | 16 ++-
code/modules/assembly/shock_kit.dm | 10 +-
.../components/unary_devices/vent_pump.dm | 25 ++---
code/modules/clothing/glasses/glasses.dm | 22 ++--
code/modules/clothing/masks/gasmask.dm | 48 ++++----
code/modules/crafting/guncrafting.dm | 15 ++-
.../kitchen_machinery/kitchen_machine.dm | 18 ++-
.../mob/living/simple_animal/bot/bot.dm | 21 ++--
.../living/simple_animal/bot/construction.dm | 104 ++++++++++--------
.../mob/living/simple_animal/bot/ed209bot.dm | 2 +-
.../mob/living/simple_animal/bot/honkbot.dm | 2 +-
.../mob/living/simple_animal/bot/mulebot.dm | 14 ++-
.../mob/living/simple_animal/bot/secbot.dm | 2 +-
code/modules/paperwork/frames.dm | 82 +++++++-------
code/modules/power/lighting.dm | 17 +--
code/modules/power/port_gen.dm | 19 ++--
code/modules/projectiles/ammunition.dm | 45 ++++----
.../projectiles/ammunition/ammo_casings.dm | 20 ++--
.../reagents/chemistry/machinery/pandemic.dm | 10 +-
code/modules/recycling/disposal.dm | 26 ++---
code/modules/research/server.dm | 8 +-
39 files changed, 572 insertions(+), 468 deletions(-)
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index de32a055d8e..abdf84ab843 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -144,27 +144,6 @@
icon_state = "box_1"
return
- if(istype(P, /obj/item/screwdriver))
- var/component_check = 1
- for(var/R in req_components)
- if(req_components[R] > 0)
- component_check = 0
- break
- if(component_check)
- playsound(src.loc, P.usesound, 50, 1)
- var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
- new_machine.on_construction()
- for(var/obj/O in new_machine.component_parts)
- qdel(O)
- new_machine.component_parts = list()
- for(var/obj/O in src)
- O.loc = null
- new_machine.component_parts += O
- circuit.loc = null
- new_machine.RefreshParts()
- qdel(src)
- return
-
if(istype(P, /obj/item/storage/part_replacer) && P.contents.len && get_req_components_amt())
var/obj/item/storage/part_replacer/replacer = P
var/list/added_components = list()
@@ -220,6 +199,31 @@
if(user.a_intent == INTENT_HARM)
return ..()
+/obj/machinery/constructable_frame/machine_frame/screwdriver_act(mob/living/user, obj/item/I)
+ if(state != 3)
+ return
+
+ var/component_check = 1
+ for(var/R in req_components)
+ if(req_components[R] > 0)
+ component_check = 0
+ break
+ if(!component_check)
+ return TRUE
+ I.play_tool_sound(src)
+ var/obj/machinery/new_machine = new circuit.build_path(loc)
+ new_machine.on_construction()
+ for(var/obj/O in new_machine.component_parts)
+ qdel(O)
+ new_machine.component_parts = list()
+ for(var/obj/O in src)
+ O.loc = null
+ new_machine.component_parts += O
+ circuit.loc = null
+ new_machine.RefreshParts()
+ qdel(src)
+ return TRUE
+
//Machine Frame Circuit Boards
/*Common Parts: Parts List: Ignitor, Timer, Infra-red laser, Infra-red sensor, t_scanner, Capacitor, Valve, sensor unit,
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 4ed612a9cf2..635608a0fe9 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -109,16 +109,6 @@
anchored = FALSE
update_icon(UPDATE_ICON_STATE)
return
- if(istype(W, /obj/item/screwdriver))
- if(!open)
- if(unlocked)
- unlocked = FALSE
- to_chat(user, "You screw the battery panel in place.")
- else
- unlocked = TRUE
- to_chat(user, "You unscrew the battery panel.")
- update_icon(UPDATE_ICON_STATE)
- return
if(istype(W, /obj/item/crowbar))
if(unlocked)
if(open)
@@ -143,6 +133,18 @@
return
return ..()
+/obj/machinery/floodlight/screwdriver_act(mob/living/user, obj/item/I)
+ if(open)
+ return
+
+ if(unlocked)
+ to_chat(user, "You screw the battery panel in place.")
+ else
+ to_chat(user, "You unscrew the battery panel.")
+ unlocked = !unlocked
+ update_icon(UPDATE_ICON_STATE)
+ return TRUE
+
/obj/machinery/floodlight/extinguish_light()
on = FALSE
set_light(0)
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 7bed5836150..d07974434c9 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -21,7 +21,7 @@
return
var/obj/machinery/mass_driver_frame/F = new (get_turf(src))
- F.dir = src.dir
+ F.dir = dir
F.anchored = TRUE
F.build = 4
F.update_icon()
@@ -150,20 +150,21 @@
new /obj/item/stack/rods(loc,2)
build--
return TRUE
-
- if(istype(W, /obj/item/screwdriver))
- to_chat(user, "You finalize the Mass Driver...")
- playsound(get_turf(src), W.usesound, 50, 1)
- var/obj/machinery/mass_driver/M = new(get_turf(src))
- M.dir = src.dir
- qdel(src)
- return TRUE
-
return FALSE
-
return ..()
+/obj/machinery/mass_driver_frame/screwdriver_act(mob/living/user, obj/item/I)
+ if(build != 4)
+ return
+
+ to_chat(user, "You finalize the Mass Driver.")
+ I.play_tool_sound(src)
+ var/obj/machinery/mass_driver/M = new(get_turf(src))
+ M.dir = dir
+ qdel(src)
+ return TRUE
+
/obj/machinery/mass_driver_frame/welder_act(mob/user, obj/item/I)
if(build != 0 && build != 1 && build != 2)
return
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 4ddb356d2fc..49a316e0e2a 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -87,13 +87,6 @@
if(T.intact)
return // prevent intraction when T-scanner revealed
- if(istype(I, /obj/item/screwdriver))
- open = !open
-
- user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
-
- update_icon(UPDATE_ICON_STATE)
-
else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
if(open)
if(allowed(user))
@@ -107,6 +100,12 @@
else
return ..()
+/obj/machinery/navbeacon/screwdriver_act(mob/living/user, obj/item/I)
+ open = !open
+ user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
+ update_icon(UPDATE_ICON_STATE)
+ return TRUE
+
/obj/machinery/navbeacon/attack_ai(mob/user)
interact(user, 1)
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index ab4c5362ba2..5424aaa49cc 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -900,12 +900,8 @@ GLOBAL_LIST_EMPTY(turret_icons)
//attack_hand() removes the gun
if(5)
- if(istype(I, /obj/item/screwdriver))
- playsound(loc, I.usesound, 100, 1)
- build_step = 6
- to_chat(user, "You close the internal access hatch.")
- return
-
+ return
+ //screwdriver_act() handles screwing the panel closed
//attack_hand() removes the prox sensor
if(6)
@@ -918,12 +914,8 @@ GLOBAL_LIST_EMPTY(turret_icons)
to_chat(user, "You need two sheets of metal to continue construction.")
return
- else if(istype(I, /obj/item/screwdriver))
- playsound(loc, I.usesound, 100, 1)
- build_step = 5
- to_chat(user, "You open the internal access hatch.")
- return
- else if(istype(I, /obj/item/crowbar))
+ if(7)
+ if(istype(I, /obj/item/crowbar))
playsound(loc, I.usesound, 75, 1)
to_chat(user, "You pry off the turret's exterior armor.")
new /obj/item/stack/sheet/metal(loc, 2)
@@ -942,6 +934,20 @@ GLOBAL_LIST_EMPTY(turret_icons)
return
..()
+/obj/machinery/porta_turret_construct/screwdriver_act(mob/living/user, obj/item/I)
+ if(build_step != 6 && build_step != 5)
+ return
+
+ if(build_step == 5)
+ build_step = 6
+ to_chat(user, "You close the internal access hatch.")
+ else
+ build_step = 5
+ to_chat(user, "You open the internal access hatch.")
+
+ I.play_tool_sound(src)
+ return TRUE
+
/obj/machinery/porta_turret_construct/welder_act(mob/user, obj/item/I)
. = TRUE
if(build_step == 2)
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 4ed63a63d1d..c968a6d36a7 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -204,9 +204,6 @@
icon_state = "wm_[state][panel]"
/obj/machinery/washing_machine/attackby(obj/item/W as obj, mob/user as mob, params)
- /*if(istype(W,/obj/item/screwdriver))
- panel = !panel
- to_chat(user, "you [panel ? "open" : "close"] the [src]'s maintenance panel")*/
if(default_unfasten_wrench(user, W))
power_change()
return
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 099966c5fec..3212bffad1c 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -33,13 +33,6 @@
/obj/item/flash/attackby(obj/item/I, mob/user, params)
if(can_overcharge)
- if(istype(I, /obj/item/screwdriver))
- if(battery_panel)
- to_chat(user, "You close the battery compartment on [src].")
- battery_panel = FALSE
- else
- to_chat(user, "You open the battery compartment on [src].")
- battery_panel = TRUE
if(battery_panel && !overcharged)
if(istype(I, /obj/item/stock_parts/cell))
to_chat(user, "You jam [I] into the battery compartment on [src].")
@@ -47,6 +40,17 @@
overcharged = TRUE
add_overlay("overcharge")
+/obj/item/flash/screwdriver_act(mob/living/user, obj/item/I)
+ if(!can_overcharge)
+ return
+
+ if(battery_panel)
+ to_chat(user, "You close the battery compartment on [src].")
+ else
+ to_chat(user, "You open the battery compartment on [src].")
+ battery_panel = !battery_panel
+ return TRUE
+
/obj/item/flash/random/New()
..()
if(prob(25))
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 4a418506111..43aba3f2835 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -56,14 +56,14 @@
else
to_chat(user, "[src] already has a cell.")
- else if(istype(W, /obj/item/screwdriver))
- if(diode)
- to_chat(user, "You remove [diode] from [src].")
- diode.loc = get_turf(src.loc)
- diode = null
- return
- ..()
- return
+/obj/item/laser_pointer/screwdriver_act(mob/living/user, obj/item/I)
+ if(!diode)
+ return
+
+ to_chat(user, "You remove [diode] from [src].")
+ diode.forceMove(get_turf(loc))
+ diode = null
+ return TRUE
/obj/item/laser_pointer/afterattack(atom/target, mob/living/user, flag, params)
if(flag) //we're placing the object on a table or in backpack
diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm
index a649ef540d3..a0764c8ae55 100644
--- a/code/game/objects/items/weapons/defib.dm
+++ b/code/game/objects/items/weapons/defib.dm
@@ -98,16 +98,21 @@
cell = W
to_chat(user, "You install a cell in [src].")
- if(istype(W, /obj/item/screwdriver))
- if(cell)
- cell.update_icon()
- cell.loc = get_turf(loc)
- cell = null
- to_chat(user, "You remove the cell from [src].")
-
update_icon(UPDATE_OVERLAYS)
return
+/obj/item/defibrillator/screwdriver_act(mob/living/user, obj/item/I)
+ if(!cell)
+ to_chat(user, "[src] doesn't have a cell.")
+ return
+
+ cell.update_icon()
+ cell.forceMove(get_turf(loc))
+ cell = null
+ to_chat(user, "You remove the cell from [src].")
+ update_icon(UPDATE_OVERLAYS)
+ return TRUE
+
/obj/item/defibrillator/emag_act(user as mob)
if(safety)
safety = FALSE
diff --git a/code/game/objects/items/weapons/grenades/bananade.dm b/code/game/objects/items/weapons/grenades/bananade.dm
index 130fa098486..11504ffde14 100644
--- a/code/game/objects/items/weapons/grenades/bananade.dm
+++ b/code/game/objects/items/weapons/grenades/bananade.dm
@@ -25,8 +25,6 @@
for(var/j = 1, j <= rand(1, 3), j++)
step(x, pick(NORTH,SOUTH,EAST,WEST))
-
-
qdel(src)
return
@@ -34,26 +32,38 @@
name = "bananium casing"
desc = "A grenade casing made of bananium."
icon_state = "banana_casing"
- var/fillamt = 0
+ deliveryamt = 0
+/obj/item/grenade/bananade/casing/attack_hand()
+ return // No activating an empty grenade
-/obj/item/grenade/bananade/casing/attackby(obj/item/I, mob/user as mob, params)
+/obj/item/grenade/bananade/casing/attack_self()
+ return // Stop trying to break stuff
+
+/obj/item/grenade/bananade/casing/prime()
+ return // The grenade isnt completed yet, dont even try to blow it up
+
+/obj/item/grenade/bananade/casing/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/grown/bananapeel))
- if(fillamt < 9)
- to_chat(usr, "You add another banana peel to the assembly.")
- fillamt += 1
+ if(deliveryamt < 9)
+ to_chat(user, "You add another banana peel to the assembly.")
+ deliveryamt += 1
qdel(I)
else
- to_chat(usr, "The bananade is full, screwdriver it shut to lock it down.")
- if(istype(I, /obj/item/screwdriver))
- if(fillamt)
- var/obj/item/grenade/bananade/G = new /obj/item/grenade/bananade
- user.unEquip(src)
- user.put_in_hands(G)
- G.deliveryamt = src.fillamt
- to_chat(user, "You lock the assembly shut, readying it for HONK.")
- qdel(src)
- else
- to_chat(usr, "You need to add banana peels before you can ready the grenade!.")
- else
- to_chat(usr, "Only banana peels fit in this assembly, up to 9.")
+ to_chat(user, "The bananade is full, screwdriver it shut to ready it.")
+ return
+
+ return ..()
+
+/obj/item/grenade/bananade/casing/screwdriver_act(mob/living/user, obj/item/I)
+ if(!deliveryamt)
+ to_chat(user, "You need to add banana peels before you can ready the grenade!")
+ return TRUE
+
+ var/obj/item/grenade/bananade/G = new /obj/item/grenade/bananade
+ user.unEquip(src)
+ user.put_in_hands(G)
+ G.deliveryamt = deliveryamt
+ to_chat(user, "You lock the assembly shut, readying it for HONK.")
+ qdel(src)
+ return TRUE
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index a4f00302e91..129640a4a02 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -78,7 +78,7 @@
else
icon_state += "_locked"
name = payload_name + "grenade" + label
-
+
underlays.Cut()
if(nadeassembly)
underlays += "[nadeassembly.a_left.icon_state]_left"
@@ -133,38 +133,6 @@
update_icon(UPDATE_ICON_STATE)
to_chat(user, "You remove the label from [src].")
return 1
- if(istype(I, /obj/item/screwdriver))
- if(stage == WIRED)
- if(beakers.len)
- to_chat(user, "You lock the assembly.")
- playsound(loc, prime_sound, 25, -3)
- stage = READY
- update_icon(UPDATE_ICON_STATE)
- contained = ""
- cores = "" // clear them out so no recursive logging by accidentally
- for(var/obj/O in beakers)
- if(!O.reagents) continue
- if(istype(O,/obj/item/slime_extract))
- cores += " [O]"
- for(var/R in O.reagents.reagent_list)
- var/datum/reagent/reagent = R
- contained += "[reagent.volume] [reagent], "
- if(contained)
- if(cores)
- contained = "\[[cores]; [contained]\]"
- else
- contained = "\[ [contained]\]"
- var/turf/bombturf = get_turf(loc)
- add_attack_logs(user, src, "has completed with [contained]", ATKLOG_MOST)
- log_game("[key_name(usr)] has completed [name] at [bombturf.x], [bombturf.y], [bombturf.z]. [contained]")
- else
- to_chat(user, "You need to add at least one beaker before locking the assembly.")
- else if(stage == READY && !nadeassembly)
- det_time = det_time == 50 ? 30 : 50 //toggle between 30 and 50
- to_chat(user, "You modify the time delay. It's set for [det_time / 10] second\s.")
- else if(stage == EMPTY)
- to_chat(user, "You need to add an activation mechanism.")
-
else if(stage == WIRED && is_type_in_list(I, allowed_containers))
if(beakers.len == 2)
to_chat(user, "[src] can not hold more containers.")
@@ -222,6 +190,44 @@
beakers = list()
update_icon(UPDATE_ICON_STATE)
+/obj/item/grenade/chem_grenade/screwdriver_act(mob/living/user, obj/item/I)
+ if(stage == WIRED)
+ if(!length(beakers))
+ to_chat(user, "You need to add at least one beaker before locking the assembly.")
+ return TRUE
+
+ to_chat(user, "You lock the assembly.")
+ playsound(loc, prime_sound, 25, -3)
+ stage = READY
+ update_icon(UPDATE_ICON_STATE)
+ contained = ""
+ cores = "" // clear them out so no recursive logging by accidentally
+ for(var/obj/O in beakers)
+ if(!O.reagents)
+ continue
+ if(istype(O, /obj/item/slime_extract))
+ cores += " [O]"
+ for(var/R in O.reagents.reagent_list)
+ var/datum/reagent/reagent = R
+ contained += "[reagent.volume] [reagent], "
+ if(contained)
+ if(cores)
+ contained = "\[[cores]; [contained]\]"
+ else
+ contained = "\[ [contained]\]"
+ var/turf/bombturf = get_turf(loc)
+ add_attack_logs(user, src, "has completed with [contained]", ATKLOG_MOST)
+ log_game("[key_name(usr)] has completed [name] at [bombturf.x], [bombturf.y], [bombturf.z]. [contained]")
+ return TRUE
+
+ else if(stage == READY && !nadeassembly)
+ det_time = det_time == 50 ? 30 : 50 //toggle between 30 and 50
+ to_chat(user, "You modify the time delay. It's set for [det_time / 10] second\s.")
+ return TRUE
+
+ else if(stage == EMPTY)
+ to_chat(user, "You need to add an activation mechanism.")
+ return TRUE
//assembly stuff
/obj/item/grenade/chem_grenade/receive_signal()
diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm
index 7bbefb57443..20c1ffc74de 100644
--- a/code/game/objects/items/weapons/grenades/grenade.dm
+++ b/code/game/objects/items/weapons/grenades/grenade.dm
@@ -88,24 +88,22 @@
var/mob/M = loc
M.unEquip(src)
-
-/obj/item/grenade/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/screwdriver))
- switch(det_time)
- if("1")
- det_time = 10
- to_chat(user, "You set [src] for 1 second detonation time.")
- if("10")
- det_time = 30
- to_chat(user, "You set [src] for 3 second detonation time.")
- if("30")
- det_time = 50
- to_chat(user, "You set [src] for 5 second detonation time.")
- if("50")
- det_time = 1
- to_chat(user, "You set [src] for instant detonation.")
- add_fingerprint(user)
- ..()
+/obj/item/grenade/screwdriver_act(mob/living/user, obj/item/I)
+ switch(det_time)
+ if(1)
+ det_time = 10
+ to_chat(user, "You set [src] for 1 second detonation time.")
+ if(10)
+ det_time = 30
+ to_chat(user, "You set [src] for 3 second detonation time.")
+ if(30)
+ det_time = 50
+ to_chat(user, "You set [src] for 5 second detonation time.")
+ if(50)
+ det_time = 1
+ to_chat(user, "You set [src] for instant detonation.")
+ add_fingerprint(user)
+ return TRUE
/obj/item/grenade/attack_hand()
walk(src, null, null)
diff --git a/code/game/objects/items/weapons/legcuffs.dm b/code/game/objects/items/weapons/legcuffs.dm
index 05a358c2999..f29a675070d 100644
--- a/code/game/objects/items/weapons/legcuffs.dm
+++ b/code/game/objects/items/weapons/legcuffs.dm
@@ -67,26 +67,29 @@
return
sig = I
if(sig.secured)
- to_chat(user, "The signaler is secured.")
+ to_chat(user, "The signaler is secured.")
sig = null
return
user.drop_item()
I.forceMove(src)
to_chat(user, "You sneak [sig] underneath the pressure plate and connect the trigger wire.")
desc = "A trap used to catch bears and other legged creatures. There is a remote signaler hooked up to it."
- if(istype(I, /obj/item/screwdriver))
- if(IED)
- IED.forceMove(get_turf(src))
- IED = null
- to_chat(user, "You remove the IED from [src].")
- return
- if(sig)
- sig.forceMove(get_turf(src))
- sig = null
- to_chat(user, "You remove the signaler from [src].")
- return
..()
+/obj/item/restraints/legcuffs/beartrap/screwdriver_act(mob/living/user, obj/item/I)
+ if(!IED && !sig)
+ return
+
+ if(IED)
+ IED.forceMove(get_turf(src))
+ IED = null
+ to_chat(user, "You remove the IED from [src].")
+ if(sig)
+ sig.forceMove(get_turf(src))
+ sig = null
+ to_chat(user, "You remove the signaler from [src].")
+ return TRUE
+
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj, oldloc)
if(armed && isturf(src.loc))
if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/hostile/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm
index 66a71ee99a4..2279f8423e4 100644
--- a/code/game/objects/items/weapons/pneumaticCannon.dm
+++ b/code/game/objects/items/weapons/pneumaticCannon.dm
@@ -53,9 +53,6 @@
pressureSetting = 1
to_chat(user, "You tweak \the [src]'s pressure output to [pressureSetting].")
return
- if(istype(W, /obj/item/screwdriver) && tank)
- updateTank(tank, 1, user)
- return
if(loadedWeightClass >= maxWeightClass)
to_chat(user, "\The [src] can't hold any more items!")
return
@@ -78,6 +75,12 @@
IW.loc = src
return
+/obj/item/pneumatic_cannon/screwdriver_act(mob/living/user, obj/item/I)
+ if(!tank)
+ return
+
+ updateTank(tank, 1, user)
+ return TRUE
/obj/item/pneumatic_cannon/afterattack(atom/target, mob/living/carbon/human/user, flag, params)
if(istype(target, /obj/item/storage)) //So you can store it in backpacks
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index 04d625d9491..93ee5d76cc0 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -40,12 +40,6 @@
if((istype(W, /obj/item/melee/energy/blade)) && (!emagged))
emag_act(user, W)
- if(istype(W, /obj/item/screwdriver))
- if(do_after(user, 20 * W.toolspeed, target = src))
- open = !open
- user.show_message("You [open ? "open" : "close"] the service panel.", 1)
- return
-
if(istype(W, /obj/item/multitool) && open && !l_hacking)
user.show_message("Now attempting to reset internal memory, please hold.", 1)
l_hacking = TRUE
@@ -69,6 +63,12 @@
return ..()
+/obj/item/storage/secure/screwdriver_act(mob/living/user, obj/item/I)
+ if(do_after(user, 20 * I.toolspeed, target = src))
+ open = !open
+ user.visible_message("[user] [open ? "opens" : "closes"] the service panel on [src].", "You [open ? "open" : "close"] the service panel.")
+ return TRUE
+
/obj/item/storage/secure/emag_act(user as mob, weapon as obj)
if(!emagged)
emagged = TRUE
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index 5467834f1ed..a7d922fcf62 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -89,22 +89,6 @@
pick_sign()
/obj/structure/sign/barsign/attackby(obj/item/I, mob/user)
- if( istype(I, /obj/item/screwdriver))
- if(!panel_open)
- to_chat(user, "You open the maintenance panel.")
- set_sign(new /datum/barsign/hiddensigns/signoff)
- panel_open = TRUE
- else
- to_chat(user, "You close the maintenance panel.")
- if(!broken && !emagged)
- set_sign(prev_sign)
- set_light(1, LIGHTING_MINIMUM_POWER)
- else if(emagged)
- set_sign(new /datum/barsign/hiddensigns/syndibarsign)
- else
- set_sign(new /datum/barsign/hiddensigns/empbarsign)
- panel_open = FALSE
-
if(istype(I, /obj/item/stack/cable_coil) && panel_open)
var/obj/item/stack/cable_coil/C = I
if(emagged) //Emagged, not broken by EMP
@@ -122,6 +106,23 @@
else
return ..()
+/obj/structure/sign/barsign/screwdriver_act(mob/user, obj/item/I)
+ if(!panel_open)
+ to_chat(user, "You open the maintenance panel.")
+ prev_sign = current_sign
+ set_sign(new /datum/barsign/hiddensigns/signoff)
+ else
+ to_chat(user, "You close the maintenance panel.")
+ if(!broken && !emagged)
+ set_sign(prev_sign)
+ set_light(1, LIGHTING_MINIMUM_POWER)
+ else if(emagged)
+ set_sign(new /datum/barsign/hiddensigns/syndibarsign)
+ else
+ set_sign(new /datum/barsign/hiddensigns/empbarsign)
+ panel_open = !panel_open
+ return TRUE
+
/obj/structure/sign/barsign/emp_act(severity)
set_sign(new /datum/barsign/hiddensigns/empbarsign)
broken = TRUE
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index df44e0164ce..b38335df9d0 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -113,23 +113,28 @@
to_chat(user, "You must wait until the door has stopped moving.")
return
- if(density)
- var/turf/T = get_turf(src)
- if(T.density)
- to_chat(user, "[src] is blocked!")
- return
- if(istype(W, /obj/item/screwdriver))
- if(!istype(T, /turf/simulated/floor))
- to_chat(user, "[src] bolts must be tightened on the floor!")
- return
- user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
- ChangeToWall()
- else
- to_chat(user, "You can't reach, close it first!")
-
if(istype(W, /obj/item/gun/energy/plasmacutter) || istype(W, /obj/item/pickaxe/drill/diamonddrill) || istype(W, /obj/item/pickaxe/drill/jackhammer) || istype(W, /obj/item/melee/energy/blade) || istype(W, /obj/item/twohanded/required/pyro_claws))
dismantle(user, TRUE)
+/obj/structure/falsewall/screwdriver_act(mob/living/user, obj/item/I)
+ if(opening)
+ to_chat(user, "You must wait until the door has stopped moving.")
+ return TRUE
+ if(!density)
+ to_chat(user, "You can't reach, close it first!")
+ return TRUE
+ var/turf/T = get_turf(src)
+ if(T.density)
+ to_chat(user, "[src] is blocked!")
+ return TRUE
+
+ if(!istype(T, /turf/simulated/floor))
+ to_chat(user, "[src] bolts must be tightened on the floor!")
+ return TRUE
+ user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
+ ChangeToWall()
+ return TRUE
+
/obj/structure/falsewall/welder_act(mob/user, obj/item/I)
if(!density)
return
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index a508140b7dd..77152070b06 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -59,32 +59,34 @@
resistance_flags = FLAMMABLE
var/sign_state = ""
-/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction
- if(istype(tool, /obj/item/screwdriver) && isturf(user.loc))
- var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
- if(direction == "Cancel")
- return
- if(QDELETED(src))
- return
- var/obj/structure/sign/S = new(user.loc)
- switch(direction)
- if("North")
- S.pixel_y = 32
- if("East")
- S.pixel_x = 32
- if("South")
- S.pixel_y = -32
- if("West")
- S.pixel_x = -32
- else
- return
- S.name = name
- S.desc = desc
- S.icon_state = sign_state
- to_chat(user, "You fasten \the [S] with your [tool].")
- qdel(src)
- else
- return ..()
+/obj/item/sign/screwdriver_act(mob/living/user, obj/item/I)
+ if(!isturf(user.loc)) // Why does this use user? This should just be loc.
+ return
+
+ var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
+ if(direction == "Cancel")
+ return TRUE // These gotta be true or we stab the sign
+ if(QDELETED(src))
+ return TRUE // Unsure about this, but stabbing something that doesnt exist seems like a bad idea
+
+ var/obj/structure/sign/S = new(user.loc) //This is really awkward to use user.loc
+ switch(direction)
+ if("North")
+ S.pixel_y = 32
+ if("East")
+ S.pixel_x = 32
+ if("South")
+ S.pixel_y = -32
+ if("West")
+ S.pixel_x = -32
+ else
+ return TRUE // We dont want to stab it or place it, so we return
+ S.name = name
+ S.desc = desc
+ S.icon_state = sign_state
+ to_chat(user, "You fasten [S] with your [I].")
+ qdel(src)
+ return TRUE
/obj/structure/sign/double/map
name = "station map"
diff --git a/code/modules/arcade/prize_counter.dm b/code/modules/arcade/prize_counter.dm
index 0a561c7bd64..506bb5fef4c 100644
--- a/code/modules/arcade/prize_counter.dm
+++ b/code/modules/arcade/prize_counter.dm
@@ -39,12 +39,6 @@
else
to_chat(user, "\The [T] seems stuck to your hand!")
return
- if(istype(O, /obj/item/screwdriver) && anchored)
- playsound(src.loc, O.usesound, 50, 1)
- panel_open = !panel_open
- to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
- update_icon(UPDATE_ICON_STATE)
- return
if(panel_open)
if(istype(O, /obj/item/wrench))
default_unfasten_wrench(user, O)
@@ -53,8 +47,18 @@
print_tickets()
default_deconstruction_crowbar(user, O)
return
+
return ..()
+/obj/machinery/prize_counter/screwdriver_act(mob/living/user, obj/item/I)
+ if(!anchored)
+ return
+ I.play_tool_sound(src)
+ panel_open = !panel_open
+ to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
+ update_icon(UPDATE_ICON_STATE)
+ return TRUE
+
/obj/machinery/prize_counter/attack_hand(mob/user as mob)
if(..())
return
diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm
index db38be9a1ea..d8d0ca7cbc6 100644
--- a/code/modules/assembly/shock_kit.dm
+++ b/code/modules/assembly/shock_kit.dm
@@ -26,12 +26,12 @@
part1 = null
part2 = null
qdel(src)
- return
- if(istype(W, /obj/item/screwdriver))
- status = !status
- to_chat(user, "[src] is now [status ? "secured" : "unsecured"]!")
+
+/obj/item/assembly/shock_kit/screwdriver_act(mob/user, obj/item/I)
+ status = !status
+ to_chat(user, "[src] is now [status ? "secured" : "unsecured"]!")
add_fingerprint(user)
- return
+ return TRUE
/obj/item/assembly/shock_kit/attack_self(mob/user as mob)
part1.attack_self(user, status)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
index 1c9afa951aa..d05d68bcc3d 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
@@ -300,21 +300,6 @@
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, TRUE)
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
- if(!welded)
- if(open)
- to_chat(user, "Now closing the vent.")
- if(do_after(user, 20 * W.toolspeed, target = src))
- playsound(loc, W.usesound, 100, 1)
- open = FALSE
- user.visible_message("[user] screwdrivers the vent shut.", "You screwdriver the vent shut.", "You hear a screwdriver.")
- else
- to_chat(user, "Now opening the vent.")
- if(do_after(user, 20 * W.toolspeed, target = src))
- playsound(loc, W.usesound, 100, 1)
- open = TRUE
- user.visible_message("[user] screwdrivers the vent open.", "You screwdriver the vent open.", "You hear a screwdriver.")
- return
if(istype(W, /obj/item/paper))
if(!welded)
if(open)
@@ -335,6 +320,16 @@
return ..()
+/obj/machinery/atmospherics/unary/vent_pump/screwdriver_act(mob/living/user, obj/item/I)
+ if(welded)
+ return
+ to_chat(user, "You start screwing the vent [open ? "shut" : "open"].")
+ if(do_after(user, 20 * I.toolspeed, target = src))
+ I.play_tool_sound(src)
+ user.visible_message("[user] screws the vent [open ? "shut" : "open"].", "You screw the vent [open ? "shut" : "open"].", "You hear a screwdriver.")
+ open = !open
+ return TRUE
+
/obj/machinery/atmospherics/unary/vent_pump/welder_act(mob/user, obj/item/I)
. = TRUE
if(!I.tool_use_check(user, 0))
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index 30e0782da19..3e66c5b3b45 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -21,17 +21,21 @@
name = "prescription [initial(name)]"
// Removing prescription glasses
- else if(prescription && istype(I, /obj/item/screwdriver))
- var/obj/item/clothing/glasses/regular/G = locate() in src
- if(!G)
- G = new(src)
- to_chat(H, "You salvage the prescription lenses from [src].")
- prescription = FALSE
- name = initial(name)
- H.put_in_hands(G)
-
H.update_nearsighted_effects()
+/obj/item/clothing/glasses/screwdriver_act(mob/living/user, obj/item/I)
+ if(!prescription)
+ return
+ var/obj/item/clothing/glasses/regular/G = locate() in src
+ if(!G)
+ G = new(src)
+ to_chat(user, "You salvage the prescription lenses from [src].")
+ prescription = FALSE
+ name = initial(name)
+ user.put_in_hands(G)
+ user.update_nearsighted_effects()
+ return TRUE
+
/obj/item/clothing/glasses/update_icon_state()
if(..())
item_state = "[replacetext("[item_state]", "_up", "")][up ? "_up" : ""]"
diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm
index 2c1696694cc..d825c8e2870 100644
--- a/code/modules/clothing/masks/gasmask.dm
+++ b/code/modules/clothing/masks/gasmask.dm
@@ -327,32 +327,34 @@
to_chat(user, "It's broken.")
/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/screwdriver))
- switch(aggressiveness)
- if(1)
- to_chat(user, "You set the aggressiveness restrictor to the second position.")
- aggressiveness = 2
- phrase = 7
- if(2)
- to_chat(user, "You set the aggressiveness restrictor to the third position.")
- aggressiveness = 3
- phrase = 13
- if(3)
- to_chat(user, "You set the aggressiveness restrictor to the fourth position.")
- aggressiveness = 4
- phrase = 1
- if(4)
- to_chat(user, "You set the aggressiveness restrictor to the first position.")
- aggressiveness = 1
- phrase = 1
- if(5)
- to_chat(user, "You adjust the restrictor but nothing happens, probably because its broken.")
- else if(istype(W, /obj/item/wirecutters))
+ if(istype(W, /obj/item/wirecutters))
if(aggressiveness != 5)
to_chat(user, "You broke it!")
aggressiveness = 5
- else
- ..()
+ return
+ . = ..()
+
+/obj/item/clothing/mask/gas/sechailer/screwdriver_act(mob/living/user, obj/item/I)
+ switch(aggressiveness)
+ if(1)
+ to_chat(user, "You set the aggressiveness restrictor to the second position.")
+ aggressiveness = 2
+ phrase = 7
+ if(2)
+ to_chat(user, "You set the aggressiveness restrictor to the third position.")
+ aggressiveness = 3
+ phrase = 13
+ if(3)
+ to_chat(user, "You set the aggressiveness restrictor to the fourth position.")
+ aggressiveness = 4
+ phrase = 1
+ if(4)
+ to_chat(user, "You set the aggressiveness restrictor to the first position.")
+ aggressiveness = 1
+ phrase = 1
+ if(5)
+ to_chat(user, "You adjust the restrictor but nothing happens, probably because its broken.")
+ return TRUE
/obj/item/clothing/mask/gas/sechailer/attack_self()
halt()
diff --git a/code/modules/crafting/guncrafting.dm b/code/modules/crafting/guncrafting.dm
index 5b842215763..5fad0c8c2e9 100644
--- a/code/modules/crafting/guncrafting.dm
+++ b/code/modules/crafting/guncrafting.dm
@@ -95,14 +95,13 @@
icon = 'icons/obj/improvised.dmi'
icon_state = "ishotgunstep1"
-/obj/item/weaponcrafting/ishotgunconstruction/attackby(obj/item/I, mob/user as mob, params)
- ..()
- if(istype(I, /obj/item/screwdriver))
- var/obj/item/weaponcrafting/ishotgunconstruction2/C = new /obj/item/weaponcrafting/ishotgunconstruction2
- user.unEquip(src)
- user.put_in_hands(C)
- to_chat(user, "You screw the pins into place, securing the pipe to the receiver.")
- qdel(src)
+/obj/item/weaponcrafting/ishotgunconstruction/screwdriver_act(mob/living/user, obj/item/I)
+ var/obj/item/weaponcrafting/ishotgunconstruction2/C = new /obj/item/weaponcrafting/ishotgunconstruction2
+ user.unEquip(src)
+ user.put_in_hands(C)
+ to_chat(user, "You screw the pins into place, securing the pipe to the receiver.")
+ qdel(src)
+ return TRUE
/obj/item/weaponcrafting/ishotgunconstruction2
name = "very conspicuous metal construction"
diff --git a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
index ea48b203009..f8bf94934bd 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
@@ -81,12 +81,8 @@
default_deconstruction_crowbar(user, O)
if(broken > 0)
- if(broken == 2 && istype(O, /obj/item/screwdriver)) // If it's broken and they're using a screwdriver
- user.visible_message("[user] starts to fix part of [src].", "You start to fix part of [src].")
- if(do_after(user, 20 * O.toolspeed, target = src))
- user.visible_message("[user] fixes part of [src].", "You have fixed part of \the [src].")
- broken = 1 // Fix it a bit
- else if(broken == 1 && istype(O, /obj/item/wrench)) // If it's broken and they're doing the wrench
+ // Broken == 2 is handled by screwdriver_act
+ if(broken == 1 && istype(O, /obj/item/wrench)) // If it's broken and they're doing the wrench
user.visible_message("[user] starts to fix part of [src].", "You start to fix part of [src].")
if(do_after(user, 20 * O.toolspeed, target = src))
user.visible_message("[user] fixes [src].", "You have fixed [src].")
@@ -138,6 +134,16 @@
return 1
updateUsrDialog()
+/obj/machinery/kitchen_machine/screwdriver_act(mob/living/user, obj/item/I)
+ if(operating || broken != 2)
+ return
+ user.visible_message("[user] starts to fix part of [src].", "You start to fix part of [src].")
+ if(do_after(user, 20 * I.toolspeed, target = src))
+ I.play_tool_sound(src)
+ user.visible_message("[user] fixes part of [src].", "You have fixed part of [src].")
+ broken = 1 // Fix it a bit
+ return TRUE
+
/obj/machinery/kitchen_machine/proc/add_item(obj/item/I, mob/user)
if(!user.drop_item())
to_chat(user, "\The [I] is stuck to your hand, you cannot put it in [src]")
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index 387fd5deb44..3e2838ffa83 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -307,13 +307,7 @@
show_controls(user)
/mob/living/simple_animal/bot/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/screwdriver))
- if(!locked)
- open = !open
- to_chat(user, "The maintenance panel is now [open ? "opened" : "closed"].")
- else
- to_chat(user, "The maintenance panel is locked.")
- else if(istype(W, /obj/item/card/id) || istype(W, /obj/item/pda))
+ if(istype(W, /obj/item/card/id) || istype(W, /obj/item/pda))
if(allowed(user) && !open && !emagged)
locked = !locked
to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]")
@@ -363,6 +357,19 @@
else
return ..()
+/mob/living/simple_animal/bot/screwdriver_act(mob/living/user, obj/item/I)
+ if(user.a_intent == INTENT_HARM)
+ return ..()
+ if(locked)
+ to_chat(user, "The maintenance panel is locked.")
+ return TRUE // must be true or we attempt to stab the bot
+
+ open = !open
+ I.play_tool_sound(src)
+ to_chat(user, "The maintenance panel is now [open ? "opened" : "closed"].")
+ return TRUE
+
+
/mob/living/simple_animal/bot/welder_act(mob/user, obj/item/I)
if(user.a_intent != INTENT_HELP)
return
diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm
index deb73af8ade..64ff74011c7 100644
--- a/code/modules/mob/living/simple_animal/bot/construction.dm
+++ b/code/modules/mob/living/simple_animal/bot/construction.dm
@@ -157,13 +157,8 @@
qdel(W)
if(8)
- if(istype(W, /obj/item/screwdriver))
- playsound(loc, W.usesound, 100, 1)
- to_chat(user, "You start attaching the gun to the frame...")
- if(do_after(user, 40 * W.toolspeed, target = src))
- build_step++
- update_appearance(UPDATE_NAME)
- to_chat(user, "Taser gun attached.")
+ return
+ // Handled by screwdriver act, return here to prevent errors being thrown for no switch(build_step) = 8 (might not be needed?)
if(9)
if(istype(W, /obj/item/stock_parts/cell))
@@ -177,6 +172,17 @@
user.unEquip(src, 1)
qdel(src)
+/obj/item/ed209_assembly/screwdriver_act(mob/living/user, obj/item/I)
+ if(build_step != 8)
+ return
+ I.play_tool_sound(src)
+ to_chat(user, "You start attaching the gun to the frame...")
+ if(do_after(user, 40 * I.toolspeed, target = src))
+ build_step++
+ update_appearance(UPDATE_NAME)
+ to_chat(user, "You attach the gun to the frame.")
+ return TRUE
+
/obj/item/ed209_assembly/update_name()
. = ..()
switch(build_step)
@@ -439,15 +445,16 @@
..()
return
- if(!S.secured)
- qdel(S)
- var/obj/item/secbot_assembly/A = new /obj/item/secbot_assembly
- user.put_in_hands(A)
- to_chat(user, "You add the signaler to the helmet.")
- user.unEquip(src, 1)
- qdel(src)
- else
+ if(S.secured)
+ to_chat(user, "[S] is secured.")
return
+ qdel(S)
+ var/obj/item/secbot_assembly/A = new /obj/item/secbot_assembly
+ user.put_in_hands(A)
+ to_chat(user, "You add the signaler to the helmet.")
+ user.unEquip(src, 1)
+ qdel(src)
+
/obj/item/secbot_assembly/attackby(obj/item/I, mob/user, params)
..()
@@ -491,34 +498,40 @@
created_name = t
log_game("[key_name(user)] has renamed a robot to [t]")
- else if(istype(I, /obj/item/screwdriver))
- if(!build_step)
- new /obj/item/assembly/signaler(get_turf(src))
- new /obj/item/clothing/head/helmet(get_turf(src))
- to_chat(user, "You disconnect the signaler from the helmet.")
- qdel(src)
-
- else if(build_step == 2)
- new /obj/item/assembly/prox_sensor(get_turf(src))
- to_chat(user, "You detach the proximity sensor from [src].")
- build_step--
-
- else if(build_step == 3)
- new /obj/item/robot_parts/l_arm(get_turf(src))
- to_chat(user, "You remove the robot arm from [src].")
- build_step--
-
//General Griefsky
- else if((istype(I, /obj/item/wrench)) && (build_step == 3))
+ else if(istype(I, /obj/item/wrench) && build_step == 3)
var/obj/item/griefsky_assembly/A = new /obj/item/griefsky_assembly(get_turf(src))
user.put_in_hands(A)
- to_chat(user, "You adjust the arm slots for extra weapons!.")
+ to_chat(user, "You adjust the arm slots for extra weapons!")
user.unEquip(src, 1)
qdel(src)
update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
+/obj/item/secbot_assembly/screwdriver_act(mob/living/user, obj/item/I)
+ if(build_step != 0 && build_step != 2 && build_step != 3)
+ return
+
+ switch(build_step)
+ if(0)
+ new /obj/item/assembly/signaler(get_turf(src))
+ new /obj/item/clothing/head/helmet(get_turf(src))
+ to_chat(user, "You disconnect the signaler from the helmet.")
+ qdel(src)
+ if(2)
+ new /obj/item/assembly/prox_sensor(get_turf(src))
+ to_chat(user, "You detach the proximity sensor from [src].")
+ build_step--
+ if(3)
+ new /obj/item/robot_parts/l_arm(get_turf(src))
+ to_chat(user, "You remove the robot arm from [src].")
+ build_step--
+
+ I.play_tool_sound(src)
+ update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
+ return TRUE
+
/obj/item/secbot_assembly/update_name()
. = ..()
switch(build_step)
@@ -578,15 +591,20 @@
qdel(I)
qdel(src)
- else if(istype(I, /obj/item/screwdriver))
- if((build_step == 1) || (build_step == 2) || (build_step == 3) || (build_step == 4))
- new /obj/item/melee/energy/sword(get_turf(src))
- to_chat(user, "You detach the energy sword from [src].")
- build_step--
- else if((toy_step == 1) || (toy_step == 2) || (toy_step == 3) || (toy_step == 4))
- new /obj/item/toy/sword(get_turf(src))
- to_chat(user, "You detach the toy sword from [src].")
- toy_step--
+/obj/item/griefsky_assembly/screwdriver_act(mob/living/user, obj/item/I)
+ if(!build_step && !toy_step)
+ return
+
+ if(build_step)
+ new /obj/item/melee/energy/sword(get_turf(src))
+ to_chat(user, "You detach the energy sword from [src].")
+ build_step--
+ else if(toy_step)
+ new /obj/item/toy/sword(get_turf(src))
+ to_chat(user, "You detach the toy sword from [src].")
+ toy_step--
+ I.play_tool_sound(src)
+ return TRUE
//Honkbot Assembly
/obj/item/storage/box/clown/attackby(obj/item/W, mob/user, params)
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index 004cfb25080..5f0b14b3e3b 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -193,7 +193,7 @@
..()
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
- if(!istype(W, /obj/item/screwdriver) && (!target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
+ if(!isscrewdriver(W) && !locked && (!target)) //If the target is locked, they are recieving damage from the screwdriver
if(W.force && W.damtype != STAMINA)//If force is non-zero and damage type isn't stamina.
retaliate(user)
if(lasercolor)//To make up for the fact that lasertag bots don't hunt
diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm
index 2f4d419a380..edc01051739 100644
--- a/code/modules/mob/living/simple_animal/bot/honkbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm
@@ -102,7 +102,7 @@
..()
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
- if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
+ if(!isscrewdriver(W) && !locked && (W.force) && (!target) && (W.damtype != STAMINA))//If the target is locked, they are recieving damage from the screwdriver
retaliate(user)
addtimer(CALLBACK(src, .proc/react_buzz), 5)
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index d0507e7f864..9eae54936aa 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -95,12 +95,7 @@
reached_target = 0
/mob/living/simple_animal/bot/mulebot/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/screwdriver))
- ..()
- if(open)
- on = FALSE
- update_controls()
- else if(istype(I,/obj/item/stock_parts/cell) && open && !cell)
+ if(istype(I,/obj/item/stock_parts/cell) && open && !cell)
if(!user.drop_item())
return
var/obj/item/stock_parts/cell/C = I
@@ -141,6 +136,13 @@
update_icon()
return
+/mob/living/simple_animal/bot/mulebot/screwdriver_act(mob/living/user, obj/item/I)
+ if(open)
+ on = FALSE
+ update_controls()
+ update_icon()
+ return TRUE
+
/mob/living/simple_animal/bot/mulebot/emag_act(mob/user)
if(emagged < 1)
emagged = 1
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index be8bd8f6320..e53432074a6 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -197,7 +197,7 @@
..()
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
- if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
+ if(!isscrewdriver(W) && !locked && (W.force) && (!target) && (W.damtype != STAMINA))//If the target is locked, they are recieving damage from the screwdriver
retaliate(user)
/mob/living/simple_animal/bot/secbot/emag_act(mob/user)
diff --git a/code/modules/paperwork/frames.dm b/code/modules/paperwork/frames.dm
index fc251e89104..7f72ddb60c2 100644
--- a/code/modules/paperwork/frames.dm
+++ b/code/modules/paperwork/frames.dm
@@ -1,4 +1,4 @@
-/obj/item/picture_frame
+/obj/item/picture_frame // This seems somewhat broken and not used anywhere
name = "picture frame"
desc = "Its patented design allows it to be folded larger or smaller to accommodate standard paper, photo, and poster, and canvas sizes."
icon = 'icons/obj/bureaucracy.dmi'
@@ -55,24 +55,9 @@
qdel(D)
/obj/item/picture_frame/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/screwdriver))
- if(displayed)
- playsound(src, I.usesound, 100, 1)
- user.visible_message("[user] unfastens \the [displayed] out of \the [src].", "You unfasten \the [displayed] out of \the [src].")
-
- if(istype(displayed, /obj/structure/sign/poster))
- var/obj/structure/sign/poster/P = displayed
- P.roll_and_drop(user.loc)
- else
- displayed.forceMove(user.loc)
- displayed = null
- name = initial(name)
- update_icon()
- else
- to_chat(user, "There is nothing to remove from \the [src].")
- else if(istype(I, /obj/item/crowbar))
+ if(istype(I, /obj/item/crowbar))
playsound(src, I.usesound, 100, 1)
- user.visible_message("[user] breaks down \the [src].", "You break down \the [src].")
+ user.visible_message("[user] breaks down [src].", "You break down [src].")
for(var/A in contents)
if(istype(A, /obj/structure/sign/poster))
var/obj/structure/sign/poster/P = A
@@ -88,10 +73,28 @@
insert(I)
update_icon()
else
- to_chat(user, "\The [src] already contains \a [displayed].")
+ to_chat(user, "[src] already contains \a [displayed].")
else
return ..()
+/obj/item/picture_frame/screwdriver_act(mob/living/user, obj/item/I)
+ if(!displayed)
+ to_chat(user, "There is nothing to remove from [src].")
+ return
+
+ I.play_tool_sound(src)
+ user.visible_message("[user] unfastens [displayed] out of [src].", "You unfasten [displayed] out of [src].")
+
+ if(istype(displayed, /obj/structure/sign/poster))
+ var/obj/structure/sign/poster/P = displayed
+ P.roll_and_drop(user.loc)
+ else
+ displayed.forceMove(user.loc)
+ displayed = null
+ name = initial(name)
+ update_icon()
+ return TRUE
+
/obj/item/picture_frame/afterattack(atom/target, mob/user, proximity_flag)
if(proximity_flag && istype(target, /turf/simulated/wall))
place(target, user)
@@ -102,14 +105,14 @@
var/stuff_on_wall = 0
for(var/obj/O in user.loc.contents) //Let's see if it already has a poster on it or too much stuff
if(istype(O, /obj/structure/sign))
- to_chat(user, "\The [T] is far too cluttered to place \a [src]!")
+ to_chat(user, "[T] is far too cluttered to place \a [src]!")
return
stuff_on_wall++
if(stuff_on_wall >= 4)
- to_chat(user, "\The [T] is far too cluttered to place \a [src]!")
+ to_chat(user, "[T] is far too cluttered to place \a [src]!")
return
- to_chat(user, "You start place \the [src] on \the [T].")
+ to_chat(user, "You start place [src] on [T].")
var/px = 0
var/py = 0
@@ -125,7 +128,7 @@
if(WEST)
px = -32
else
- to_chat(user, "You cannot reach \the [T] from here!")
+ to_chat(user, "You cannot reach [T] from here!")
return
user.unEquip(src)
@@ -212,26 +215,14 @@
overlays |= getFlatIcon(frame)
/obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/screwdriver))
- playsound(src, I.usesound, 100, 1)
- user.visible_message("[user] begins to unfasten \the [src] from the wall.", "You begin to unfasten \the [src] from the wall.")
- if(do_after(user, 100 * I.toolspeed, target = src))
- playsound(src, I.usesound, 100, 1)
- user.visible_message("[user] unfastens \the [src] from the wall.", "You unfasten \the [src] from the wall.")
- frame.forceMove(user.loc)
- frame = null
- if(explosive)
- explosive.forceMove(user.loc)
- explosive = null
- qdel(src)
if(istype(I, /obj/item/grenade) || istype(I, /obj/item/grenade/plastic/c4))
if(explosive)
- to_chat(user, "There is already a device attached behind \the [src], remove it first.")
+ to_chat(user, "There is already a device attached behind [src], remove it first.")
return 1
if(!tilted)
- to_chat(user, "\The [src] needs to be already tilted before being rigged with \the [I].")
+ to_chat(user, "[src] needs to be already tilted before being rigged with [I].")
return 1
- user.visible_message("[user] is fiddling around behind \the [src].", "You begin to secure \the [I] behind \the [src].")
+ user.visible_message("[user] is fiddling around behind [src].", "You begin to secure [I] behind [src].")
if(do_after(user, 150, target = src))
if(explosive || !tilted)
return
@@ -239,7 +230,7 @@
user.unEquip(I)
explosive = I
I.forceMove(src)
- user.visible_message("[user] fiddles with the back of \the [src].", "You secure \the [I] behind \the [src].")
+ user.visible_message("[user] fiddles with the back of [src].", "You secure [I] behind [src].")
message_admins("[key_name_admin(user)] attached [I] to a picture frame.")
log_game("[key_name_admin(user)] attached [I] to a picture frame.")
@@ -247,6 +238,19 @@
else
return ..()
+/obj/structure/sign/picture_frame/screwdriver_act(mob/user, obj/item/I)
+ I.play_tool_sound(src)
+ user.visible_message("[user] begins to unfasten [src] from the wall.", "You begin to unfasten [src] from the wall.")
+ if(do_after(user, 100 * I.toolspeed, target = src))
+ user.visible_message("[user] unfastens [src] from the wall.", "You unfasten [src] from the wall.")
+ frame.forceMove(user.loc)
+ frame = null
+ if(explosive)
+ explosive.forceMove(user.loc)
+ explosive = null
+ qdel(src)
+ return TRUE
+
/obj/structure/sign/picture_frame/examine(mob/user, infix = "", suffix = "")
if(frame)
. += frame.examine(user, infix, suffix)
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 87d1997c009..5e99f742a29 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -489,13 +489,6 @@
// attempt to stick weapon into light socket
if(status == LIGHT_EMPTY)
- if(istype(W, /obj/item/screwdriver)) //If it's a screwdriver open it.
- playsound(loc, W.usesound, W.tool_volume, 1)
- user.visible_message("[user] opens [src]'s casing.", \
- "You open [src]'s casing.", "You hear a screwdriver.")
- deconstruct()
- return
-
if(has_power() && (W.flags & CONDUCT))
do_sparks(3, 1, src)
if(prob(75)) // If electrocuted
@@ -507,6 +500,16 @@
return ..()
+/obj/machinery/light/screwdriver_act(mob/living/user, obj/item/I)
+ if(status != LIGHT_EMPTY)
+ return
+
+ I.play_tool_sound(src)
+ user.visible_message("[user] opens [src]'s casing.", \
+ "You open [src]'s casing.", "You hear a screwdriver.")
+ deconstruct()
+ return TRUE
+
/obj/machinery/light/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
var/obj/machinery/light_construct/newlight = null
diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm
index 76c78afa518..d528a98fdb3 100644
--- a/code/modules/power/port_gen.dm
+++ b/code/modules/power/port_gen.dm
@@ -295,13 +295,6 @@
playsound(src.loc, O.usesound, 50, 1)
anchored = !anchored
- else if(istype(O, /obj/item/screwdriver))
- panel_open = !panel_open
- playsound(src.loc, O.usesound, 50, 1)
- if(panel_open)
- to_chat(user, "You open the access panel.")
- else
- to_chat(user, "You close the access panel.")
else if(istype(O, /obj/item/storage/part_replacer) && panel_open)
exchange_parts(user, O)
return
@@ -310,6 +303,18 @@
else
return ..()
+/obj/machinery/power/port_gen/pacman/screwdriver_act(mob/living/user, obj/item/I)
+ if(active)
+ return
+
+ panel_open = !panel_open
+ I.play_tool_sound(src)
+ if(panel_open)
+ to_chat(user, "You open the access panel.")
+ else
+ to_chat(user, "You close the access panel.")
+ return TRUE
+
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)
..()
ui_interact(user)
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index a1e3422f34c..2b8dde3903e 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -69,27 +69,34 @@
else
to_chat(user, "You fail to collect anything!")
else
- if(istype(I, /obj/item/screwdriver))
- if(BB)
- if(initial(BB.name) == "bullet")
- var/tmp_label = ""
- var/label_text = sanitize(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label))
- if(length(label_text) > 20)
- to_chat(user, "The inscription can be at most 20 characters long.")
- else
- if(label_text == "")
- to_chat(user, "You scratch the inscription off of [initial(BB)].")
- BB.name = initial(BB.name)
- else
- to_chat(user, "You inscribe \"[label_text]\" into \the [initial(BB.name)].")
- BB.name = "[initial(BB.name)] \"[label_text]\""
- else
- to_chat(user, "You can only inscribe a metal bullet.")//because inscribing beanbags is silly
-
- else
- to_chat(user, "There is no bullet in the casing to inscribe anything into.")
..()
+/obj/item/ammo_casing/screwdriver_act(mob/living/user, obj/item/I)
+ . = TRUE
+ if(!BB)
+ to_chat(user, "There is no bullet in the casing to inscribe anything into.")
+ return
+ if(!initial(BB.name) == "bullet")
+ to_chat(user, "You can only inscribe a metal bullet.")//because inscribing beanbags is silly
+ return
+
+ var/tmp_label = ""
+ var/label_text = sanitize(input(user, "Inscribe some text into \the [initial(BB.name)]", "Inscription", tmp_label))
+
+ if(length(label_text) > 20)
+ to_chat(user, "The inscription can be at most 20 characters long.")
+ return
+
+ if(label_text == "")
+ to_chat(user, "You scratch the inscription off of [initial(BB)].")
+ BB.name = initial(BB.name)
+ else
+ to_chat(user, "You inscribe \"[label_text]\" into \the [initial(BB.name)].")
+ BB.name = "[initial(BB.name)] \"[label_text]\""
+
+
+
+
/obj/item/ammo_casing/decompile_act(obj/item/matter_decompiler/C, mob/user)
if(!BB)
C.stored_comms["metal"] += 1
diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm
index 270df98a036..7cad3e11882 100644
--- a/code/modules/projectiles/ammunition/ammo_casings.dm
+++ b/code/modules/projectiles/ammunition/ammo_casings.dm
@@ -356,7 +356,7 @@
caliber = "foam_force"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
- var/modified = 0
+ var/modified = FALSE
harmful = FALSE
/obj/item/ammo_casing/caseless/foam_dart/update_desc()
@@ -377,16 +377,22 @@
/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params)
..()
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
- if(istype(A, /obj/item/screwdriver) && !modified)
- modified = 1
- FD.damage_type = BRUTE
- update_icon()
- else if((istype(A, /obj/item/pen)) && modified && !FD.pen)
+ if((istype(A, /obj/item/pen)) && modified && !FD.pen)
if(!user.unEquip(A))
return
add_pen(A)
to_chat(user, "You insert [A] into [src].")
- return
+
+/obj/item/ammo_casing/caseless/foam_dart/screwdriver_act(mob/living/user, obj/item/I)
+ if(modified)
+ return
+
+ var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
+ I.play_tool_sound(src)
+ modified = TRUE
+ FD.damage_type = BRUTE
+ update_icon()
+ return TRUE
/obj/item/ammo_casing/caseless/foam_dart/proc/add_pen(obj/item/pen/P)
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm
index 2a2e86bdd23..aa6d8f2ac10 100644
--- a/code/modules/reagents/chemistry/machinery/pandemic.dm
+++ b/code/modules/reagents/chemistry/machinery/pandemic.dm
@@ -338,9 +338,11 @@
to_chat(user, "You add the beaker to the machine.")
updateUsrDialog()
icon_state = "pandemic1"
-
- else if(istype(I, /obj/item/screwdriver))
- if(beaker)
- beaker.forceMove(get_turf(src))
else
return ..()
+
+/obj/machinery/computer/pandemic/screwdriver_act(mob/user, obj/item/I)
+ if(beaker)
+ eject_beaker()
+ return TRUE
+ return ..()
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index cbd24e105f9..1c90c07aefb 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -1289,7 +1289,7 @@
var/active = FALSE
var/turf/target // this will be where the output objects are 'thrown' to.
var/obj/structure/disposalpipe/trunk/linkedtrunk
- var/mode = 0
+ var/mode = FALSE // Is the maintenance panel open? Different than normal disposal's mode
/obj/structure/disposaloutlet/Initialize(mapload)
. = ..()
@@ -1326,22 +1326,16 @@
return
AM.throw_at(target, 3, 1)
+/obj/structure/disposaloutlet/screwdriver_act(mob/living/user, obj/item/I)
+ add_fingerprint(user)
-/obj/structure/disposaloutlet/attackby(obj/item/I, mob/user, params)
- if(!I || !user)
- return
- src.add_fingerprint(user)
- if(istype(I, /obj/item/screwdriver))
- if(mode==0)
- mode=1
- playsound(src.loc, I.usesound, 50, 1)
- to_chat(user, "You remove the screws around the power connection.")
- return
- else if(mode==1)
- mode=0
- playsound(src.loc, I.usesound, 50, 1)
- to_chat(user, "You attach the screws around the power connection.")
- return
+ if(mode == FALSE)
+ to_chat(user, "You remove the screws around the power connection.")
+ else if(mode == TRUE)
+ to_chat(user, "You attach the screws around the power connection.")
+ I.play_tool_sound(src)
+ mode = !mode
+ return TRUE
/obj/structure/disposaloutlet/welder_act(mob/user, obj/item/I)
. = TRUE
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index a132e941fae..3635c429151 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -140,10 +140,6 @@
air_update_turf()
/obj/machinery/r_n_d/server/attackby(obj/item/O as obj, mob/user as mob, params)
- if(istype(O, /obj/item/screwdriver))
- default_deconstruction_screwdriver(user, "RD-server-on_t", "RD-server-on", O)
- return 1
-
if(exchange_parts(user, O))
return 1
@@ -155,6 +151,10 @@
else
return ..()
+/obj/machinery/r_n_d/server/screwdriver_act(mob/living/user, obj/item/I)
+ default_deconstruction_screwdriver(user, "RD-server-on_t", "RD-server-on", I)
+ return TRUE
+
/obj/machinery/r_n_d/server/centcom
name = "CentComm. Central R&D Database"
server_id = -1