Converts some istype's to use helpers (#3224)

Converts various istype's to use helpers. Mainly:
Cable
Wrench
Screwdriver
Multitool
Crowbar
Wirecutter

And makes the helpers defines.
This commit is contained in:
Ron
2017-08-06 15:08:42 -04:00
committed by Erki
parent ad96a34dd8
commit cb5e227320
219 changed files with 546 additions and 572 deletions

View File

@@ -10,7 +10,6 @@
#define DEBUG #define DEBUG
// END_PREFERENCES // END_PREFERENCES
// BEGIN_INCLUDE // BEGIN_INCLUDE
#include "code\_macros.dm"
#include "code\global.dm" #include "code\global.dm"
#include "code\hub.dm" #include "code\hub.dm"
#include "code\names.dm" #include "code\names.dm"
@@ -18,6 +17,7 @@
#include "code\world.dm" #include "code\world.dm"
#include "code\__defines\_compile_options.dm" #include "code\__defines\_compile_options.dm"
#include "code\__defines\_layers.dm" #include "code\__defines\_layers.dm"
#include "code\__defines\_macros.dm"
#include "code\__defines\admin.dm" #include "code\__defines\admin.dm"
#include "code\__defines\atmos.dm" #include "code\__defines\atmos.dm"
#include "code\__defines\callback.dm" #include "code\__defines\callback.dm"

View File

@@ -88,7 +88,7 @@
return 1 return 1
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench)) if(iswrench(W))
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
anchored = !anchored anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \ user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \

View File

@@ -235,7 +235,7 @@
return return
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (unlocked) if (unlocked)
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>" user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"

View File

@@ -86,7 +86,7 @@
add_overlay("hi-turb") add_overlay("hi-turb")
attackby(obj/item/weapon/W as obj, mob/user as mob) attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench)) if(iswrench(W))
anchored = !anchored anchored = !anchored
user << "<span class='notice'>You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.</span>" user << "<span class='notice'>You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.</span>"
@@ -257,7 +257,7 @@
attackby(obj/item/weapon/W as obj, mob/user as mob) attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench)) if(iswrench(W))
anchored = !anchored anchored = !anchored
turbine = null turbine = null
user << "<span class='notice'>You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.</span>" user << "<span class='notice'>You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.</span>"

View File

@@ -214,7 +214,7 @@ Thus, the two variables affect pump operation are set in New():
update_icon() update_icon()
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (!(stat & NOPOWER) && use_power) if (!(stat & NOPOWER) && use_power)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>" user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"

View File

@@ -84,7 +84,7 @@
update_icon() update_icon()
/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(!istype(W, /obj/item/weapon/wrench)) if(!iswrench(W))
return ..() return ..()
var/int_pressure = 0 var/int_pressure = 0

View File

@@ -131,7 +131,7 @@
/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (connected_device) if (connected_device)
user << "<span class='warning'>You cannot unwrench \the [src], dettach \the [connected_device] first.</span>" user << "<span class='warning'>You cannot unwrench \the [src], dettach \the [connected_device] first.</span>"

View File

@@ -129,7 +129,7 @@
..() ..()
/obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air() var/datum/gas_mixture/env_air = loc.return_air()

View File

@@ -104,7 +104,7 @@
return 1 return 1
/obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air() var/datum/gas_mixture/env_air = loc.return_air()

View File

@@ -342,7 +342,7 @@
go_to_side() go_to_side()
/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital)) if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>" user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"

View File

@@ -66,7 +66,7 @@
return 1 return 1
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
var/turf/T = src.loc var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating()) if (level==1 && isturf(T) && !T.is_plating())

View File

@@ -350,7 +350,7 @@
return return
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user) /obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/weldingtool)) if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if (!WT.welding) if (!WT.welding)
user << "<span class='danger'>\The [WT] must be turned on!</span>" user << "<span class='danger'>\The [WT] must be turned on!</span>"
@@ -390,7 +390,7 @@
update_icon() update_icon()
/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (!(stat & NOPOWER) && use_power) if (!(stat & NOPOWER) && use_power)
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>" user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"

View File

@@ -260,7 +260,7 @@
update_icon() update_icon()
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/weapon/wrench)) if (iswrench(W))
if (!(stat & NOPOWER) && use_power) if (!(stat & NOPOWER) && use_power)
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>" user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1 return 1
@@ -285,7 +285,7 @@
qdel(src) qdel(src)
return 1 return 1
if(istype(W, /obj/item/weapon/weldingtool)) if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if (!WT.welding) if (!WT.welding)
user << "<span class='danger'>\The [WT] must be turned on!</span>" user << "<span class='danger'>\The [WT] must be turned on!</span>"

View File

@@ -300,7 +300,7 @@
open() open()
/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital)) if (istype(src, /obj/machinery/atmospherics/valve/digital))
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>" user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"

View File

@@ -80,7 +80,7 @@
if(istype(W,/obj/item/device/pipe_painter)) if(istype(W,/obj/item/device/pipe_painter))
return 0 return 0
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
var/turf/T = src.loc var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating()) if (level==1 && isturf(T) && !T.is_plating())

View File

@@ -1,56 +1,70 @@
#define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x)) #define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x))
#define CLAMP01(x) (Clamp(x, 0, 1)) #define CLAMP01(x) (Clamp(x, 0, 1))
#define span(class, text) ("<span class='[class]'>[text]</span>") #define span(class, text) ("<span class='[class]'>[text]</span>")
#define isAI(A) istype(A, /mob/living/silicon/ai) #define isAI(A) istype(A, /mob/living/silicon/ai)
#define isDrone(A) istype(A, /mob/living/silicon/robot/drone) #define isDrone(A) istype(A, /mob/living/silicon/robot/drone)
#define isalien(A) istype(A, /mob/living/carbon/alien) #define isalien(A) istype(A, /mob/living/carbon/alien)
#define isanimal(A) istype(A, /mob/living/simple_animal) #define isanimal(A) istype(A, /mob/living/simple_animal)
#define isairlock(A) istype(A, /obj/machinery/door/airlock) #define isairlock(A) istype(A, /obj/machinery/door/airlock)
#define isbrain(A) istype(A, /mob/living/carbon/brain) #define isbrain(A) istype(A, /mob/living/carbon/brain)
#define iscarbon(A) istype(A, /mob/living/carbon) #define iscarbon(A) istype(A, /mob/living/carbon)
#define iscorgi(A) istype(A, /mob/living/simple_animal/corgi) #define iscorgi(A) istype(A, /mob/living/simple_animal/corgi)
#define isEye(A) istype(A, /mob/eye) #define isEye(A) istype(A, /mob/eye)
#define ishuman(A) istype(A, /mob/living/carbon/human) #define ishuman(A) istype(A, /mob/living/carbon/human)
#define isliving(A) istype(A, /mob/living) #define isliving(A) istype(A, /mob/living)
#define ismouse(A) istype(A, /mob/living/simple_animal/mouse) #define ismouse(A) istype(A, /mob/living/simple_animal/mouse)
#define isnewplayer(A) istype(A, /mob/new_player) #define isnewplayer(A) istype(A, /mob/new_player)
#define isobj(A) istype(A, /obj) #define isobj(A) istype(A, /obj)
#define isobserver(A) istype(A, /mob/dead/observer) #define isobserver(A) istype(A, /mob/dead/observer)
#define isorgan(A) istype(A, /obj/item/organ/external) #define isorgan(A) istype(A, /obj/item/organ/external)
#define ispAI(A) istype(A, /mob/living/silicon/pai) #define ispAI(A) istype(A, /mob/living/silicon/pai)
#define isrobot(A) istype(A, /mob/living/silicon/robot) #define isrobot(A) istype(A, /mob/living/silicon/robot)
#define issilicon(A) istype(A, /mob/living/silicon) #define issilicon(A) istype(A, /mob/living/silicon)
#define isslime(A) istype(A, /mob/living/carbon/slime) #define isslime(A) istype(A, /mob/living/carbon/slime)
#define to_chat(target, message) target << message #define isscrewdriver(A) istype(A, /obj/item/weapon/screwdriver)
#define MAP_IMAGE_PATH "nano/images/"
#define map_image_file_name(z_level) "Aurora-[z_level].png" #define iswrench(A) istype(A, /obj/item/weapon/wrench)
#define to_world(message) world << message
#define sound_to(target, sound) target << sound #define iswelder(A) istype(A, /obj/item/weapon/weldingtool)
#define to_file(file_entry, file_content) file_entry << file_content
#define show_browser(target, browser_content, browser_name) target << browse(browser_content, browser_name) #define iscoil(A) istype(A, /obj/item/stack/cable_coil)
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name)
#define iswirecutter(A) istype(A, /obj/item/weapon/wirecutters)
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE)
#define ismultitool(A) istype(A, /obj/item/device/multitool)
#define isopenturf(target) istype(target, /turf/simulated/open)
#define iscrowbar(A) istype(A, /obj/item/weapon/crowbar)
#define to_chat(target, message) target << message
#define MAP_IMAGE_PATH "nano/images/"
#define map_image_file_name(z_level) "Aurora-[z_level].png"
#define to_world(message) world << message
#define sound_to(target, sound) target << sound
#define to_file(file_entry, file_content) file_entry << file_content
#define show_browser(target, browser_content, browser_name) target << browse(browser_content, browser_name)
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name)
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE)
#define isopenturf(target) istype(target, /turf/simulated/open)

View File

@@ -827,46 +827,6 @@ var/global/list/common_tools = list(
return 1 return 1
return 0 return 0
/proc/iswrench(O)
if(istype(O, /obj/item/weapon/wrench))
return 1
return 0
/proc/iswelder(O)
if(istype(O, /obj/item/weapon/weldingtool))
return 1
return 0
/proc/iscoil(O)
if(istype(O, /obj/item/stack/cable_coil))
return 1
return 0
/proc/iswirecutter(O)
if(istype(O, /obj/item/weapon/wirecutters))
return 1
return 0
/proc/isscrewdriver(O)
if(istype(O, /obj/item/weapon/screwdriver))
return 1
return 0
/proc/ismultitool(O)
if(istype(O, /obj/item/device/multitool))
return 1
return 0
/proc/iscrowbar(O)
if(istype(O, /obj/item/weapon/crowbar))
return 1
return 0
/proc/iswire(O)
if(istype(O, /obj/item/stack/cable_coil))
return 1
return 0
proc/is_hot(obj/item/W as obj) proc/is_hot(obj/item/W as obj)
switch(W.type) switch(W.type)
if(/obj/item/weapon/weldingtool) if(/obj/item/weapon/weldingtool)
@@ -918,9 +878,9 @@ proc/is_hot(obj/item/W as obj)
if(W.sharp) return 1 if(W.sharp) return 1
return ( \ return ( \
W.sharp || \ W.sharp || \
istype(W, /obj/item/weapon/screwdriver) || \ isscrewdriver(W) || \
istype(W, /obj/item/weapon/pen) || \ istype(W, /obj/item/weapon/pen) || \
istype(W, /obj/item/weapon/weldingtool) || \ iswelder(W) || \
istype(W, /obj/item/weapon/flame/lighter/zippo) || \ istype(W, /obj/item/weapon/flame/lighter/zippo) || \
istype(W, /obj/item/weapon/flame/match) || \ istype(W, /obj/item/weapon/flame/match) || \
istype(W, /obj/item/clothing/mask/smokable/cigarette) || \ istype(W, /obj/item/clothing/mask/smokable/cigarette) || \

View File

@@ -116,14 +116,14 @@ var/list/wireColours = list("red", "blue", "green", "darkred", "orange", "brown"
var/obj/item/I = L.get_active_hand() var/obj/item/I = L.get_active_hand()
holder.add_hiddenprint(L) holder.add_hiddenprint(L)
if(href_list["cut"]) // Toggles the cut/mend status if(href_list["cut"]) // Toggles the cut/mend status
if(istype(I, /obj/item/weapon/wirecutters)) if(iswirecutter(I))
var/colour = href_list["cut"] var/colour = href_list["cut"]
CutWireColour(colour) CutWireColour(colour)
else else
L << "<span class='error'>You need wirecutters!</span>" L << "<span class='error'>You need wirecutters!</span>"
else if(href_list["pulse"]) else if(href_list["pulse"])
if(istype(I, /obj/item/device/multitool)) if(ismultitool(I))
var/colour = href_list["pulse"] var/colour = href_list["pulse"]
PulseColour(colour) PulseColour(colour)
else else

View File

@@ -322,7 +322,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
/obj/item/weapon/module/power_control/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/item/weapon/module/power_control/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/device/multitool)) if (ismultitool(W))
var/obj/item/weapon/circuitboard/ghettosmes/newcircuit = new/obj/item/weapon/circuitboard/ghettosmes(user.loc) var/obj/item/weapon/circuitboard/ghettosmes/newcircuit = new/obj/item/weapon/circuitboard/ghettosmes(user.loc)
qdel(src) qdel(src)
user.put_in_hands(newcircuit) user.put_in_hands(newcircuit)
@@ -406,7 +406,7 @@
icon_state = "neuralbroke" icon_state = "neuralbroke"
/obj/item/weapon/neuralbroke/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/weapon/neuralbroke/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver)) if(isscrewdriver(W))
new /obj/item/device/encryptionkey/hivenet(user.loc) new /obj/item/device/encryptionkey/hivenet(user.loc)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "You bypass the fried security chip and extract the encryption key." user << "You bypass the fried security chip and extract the encryption key."

View File

@@ -86,7 +86,7 @@
/obj/machinery/dna_scannernew/proc/eject_occupant() /obj/machinery/dna_scannernew/proc/eject_occupant()
src.go_out() src.go_out()
for(var/obj/O in src) for(var/obj/O in src)
if((!istype(O,/obj/item/weapon/reagent_containers)) && (!istype(O,/obj/item/weapon/circuitboard/clonescanner)) && (!istype(O,/obj/item/weapon/stock_parts)) && (!istype(O,/obj/item/stack/cable_coil))) if((!istype(O,/obj/item/weapon/reagent_containers)) && (!istype(O,/obj/item/weapon/circuitboard/clonescanner)) && (!istype(O,/obj/item/weapon/stock_parts)) && (!iscoil(O)))
O.loc = get_turf(src)//Ejects items that manage to get in there (exluding the components) O.loc = get_turf(src)//Ejects items that manage to get in there (exluding the components)
if(!occupant) if(!occupant)
for(var/mob/M in src)//Failsafe so you can get mobs out for(var/mob/M in src)//Failsafe so you can get mobs out

View File

@@ -27,7 +27,7 @@
return return
/obj/machinery/cablelayer/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/cablelayer/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/stack/cable_coil)) if(iscoil(O))
var/result = load_cable(O) var/result = load_cable(O)
if(!result) if(!result)
@@ -36,7 +36,7 @@
user << "You load [result] lengths of cable into [src]." user << "You load [result] lengths of cable into [src]."
return return
if(istype(O, /obj/item/weapon/wirecutters)) if(iswirecutter(O))
if(cable && cable.amount) 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) 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) m = min(m, cable.amount)

View File

@@ -751,13 +751,13 @@
switch(buildstage) switch(buildstage)
if(2) if(2)
if(istype(W, /obj/item/weapon/screwdriver)) // Opening that Air Alarm up. if(isscrewdriver(W)) // Opening that Air Alarm up.
wiresexposed = !wiresexposed wiresexposed = !wiresexposed
user << "<span class='notice'>You [wiresexposed ? "open" : "close"] the maintenance panel.</span>" user << "<span class='notice'>You [wiresexposed ? "open" : "close"] the maintenance panel.</span>"
update_icon() update_icon()
return return
if (wiresexposed && istype(W, /obj/item/weapon/wirecutters)) if (wiresexposed && iswirecutter(W))
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You cut the wires inside \the [src].") user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5) new/obj/item/stack/cable_coil(get_turf(src), 5)
@@ -778,7 +778,7 @@
return return
if(1) if(1)
if(istype(W, /obj/item/stack/cable_coil)) if(iscoil(W))
var/obj/item/stack/cable_coil/C = W var/obj/item/stack/cable_coil/C = W
if (C.use(5)) if (C.use(5))
user << "<span class='notice'>You wire \the [src].</span>" user << "<span class='notice'>You wire \the [src].</span>"
@@ -790,7 +790,7 @@
user << "<span class='warning'>You need 5 pieces of cable to do wire \the [src].</span>" user << "<span class='warning'>You need 5 pieces of cable to do wire \the [src].</span>"
return return
else if(istype(W, /obj/item/weapon/crowbar)) else if(iscrowbar(W))
user << "You start prying out the circuit." user << "You start prying out the circuit."
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
if(do_after(user,20)) if(do_after(user,20))
@@ -808,7 +808,7 @@
update_icon() update_icon()
return return
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
user << "You remove the air alarm assembly from the wall!" user << "You remove the air alarm assembly from the wall!"
new /obj/item/frame/air_alarm(get_turf(user)) new /obj/item/frame/air_alarm(get_turf(user))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)

View File

@@ -260,7 +260,7 @@ update_flag
valve_open = !valve_open valve_open = !valve_open
/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(!istype(W, /obj/item/weapon/wrench) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda)) if(!iswrench(W) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
visible_message("<span class='warning'>\The [user] hits \the [src] with \a [W]!</span>") visible_message("<span class='warning'>\The [user] hits \the [src] with \a [W]!</span>")
src.health -= W.force src.health -= W.force
src.add_fingerprint(user) src.add_fingerprint(user)

View File

@@ -91,7 +91,7 @@
return ..() return ..()
/obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You begin to unfasten \the [src]...</span>" user << "<span class='notice'>You begin to unfasten \the [src]...</span>"

View File

@@ -109,7 +109,7 @@
update_icon() update_icon()
return return
else if (istype(W, /obj/item/weapon/wrench)) else if (iswrench(W))
if(connected_port) if(connected_port)
disconnect() disconnect()
user << "<span class='notice'>You disconnect \the [src] from the port.</span>" user << "<span class='notice'>You disconnect \the [src] from the port.</span>"
@@ -168,7 +168,7 @@
power_change() power_change()
return return
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
if(!cell) if(!cell)
user << "<span class='warning'>There is no power cell installed.</span>" user << "<span class='warning'>There is no power cell installed.</span>"
return return

View File

@@ -206,7 +206,7 @@
update_connected_network() update_connected_network()
/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I as obj, var/mob/user as mob) /obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/wrench)) if(iswrench(I))
if(on) if(on)
user << "<span class='warning'>Turn \the [src] off first!</span>" user << "<span class='warning'>Turn \the [src] off first!</span>"
return return
@@ -220,7 +220,7 @@
//doesn't use power cells //doesn't use power cells
if(istype(I, /obj/item/weapon/cell)) if(istype(I, /obj/item/weapon/cell))
return return
if (istype(I, /obj/item/weapon/screwdriver)) if (isscrewdriver(I))
return return
//doesn't hold tanks //doesn't hold tanks
@@ -234,7 +234,7 @@
name = "Stationary Air Scrubber" name = "Stationary Air Scrubber"
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob) /obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/wrench)) if(iswrench(I))
user << "<span class='warning'>The bolts are too tight for you to unscrew!</span>" user << "<span class='warning'>The bolts are too tight for you to unscrew!</span>"
return return

View File

@@ -137,7 +137,7 @@
if(panel_open) if(panel_open)
//Don't eat multitools or wirecutters used on an open lathe. //Don't eat multitools or wirecutters used on an open lathe.
if(istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters)) if(ismultitool(O) || iswirecutter(O))
attack_hand(user) attack_hand(user)
return return

View File

@@ -55,11 +55,11 @@
return return
/obj/machinery/bot/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/bot/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver)) if(isscrewdriver(W))
if(!locked) if(!locked)
open = !open open = !open
user << "<span class='notice'>Maintenance panel is now [src.open ? "opened" : "closed"].</span>" user << "<span class='notice'>Maintenance panel is now [src.open ? "opened" : "closed"].</span>"
else if(istype(W, /obj/item/weapon/weldingtool)) else if(iswelder(W))
if(health < maxhealth) if(health < maxhealth)
if(open) if(open)
health = min(maxhealth, health+10) health = min(maxhealth, health+10)

View File

@@ -94,7 +94,7 @@
C.loc = src C.loc = src
cell = C cell = C
updateDialog() updateDialog()
else if(istype(I,/obj/item/weapon/screwdriver)) else if(isscrewdriver(I))
if(locked) if(locked)
user << "<span class='notice'>The maintenance hatch cannot be opened or closed while the controls are locked.</span>" user << "<span class='notice'>The maintenance hatch cannot be opened or closed while the controls are locked.</span>"
return return
@@ -109,7 +109,7 @@
icon_state = "mulebot0" icon_state = "mulebot0"
updateDialog() updateDialog()
else if (istype(I, /obj/item/weapon/wrench)) else if (iswrench(I))
if (src.health < maxhealth) if (src.health < maxhealth)
src.health = min(maxhealth, src.health+25) src.health = min(maxhealth, src.health+25)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)

View File

@@ -59,7 +59,7 @@
user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.") user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.")
chargelevel = -1 chargelevel = -1
update_icon() update_icon()
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
if(charging) if(charging)
user << "<span class='warning'>Remove the cell first!</span>" user << "<span class='warning'>Remove the cell first!</span>"
return return

View File

@@ -240,7 +240,7 @@
user.drop_item() user.drop_item()
qdel(W) qdel(W)
return return
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
if(locked && (anchored || occupant)) if(locked && (anchored || occupant))
user << "<span class='warning'>Can not do that while [src] is in use.</span>" user << "<span class='warning'>Can not do that while [src] is in use.</span>"
else else

View File

@@ -14,13 +14,13 @@
switch(state) switch(state)
if(0) if(0)
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
user << "<span class='notice'>You wrench the frame into place.</span>" user << "<span class='notice'>You wrench the frame into place.</span>"
anchored = 1 anchored = 1
state = 1 state = 1
if(istype(P, /obj/item/weapon/weldingtool)) if(iswelder(P))
var/obj/item/weapon/weldingtool/WT = P var/obj/item/weapon/weldingtool/WT = P
if(!WT.isOn()) if(!WT.isOn())
user << "The welder must be on for this task." user << "The welder must be on for this task."
@@ -32,7 +32,7 @@
new /obj/item/stack/material/plasteel( loc, 4) new /obj/item/stack/material/plasteel( loc, 4)
qdel(src) qdel(src)
if(1) if(1)
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
user << "<span class='notice'>You unfasten the frame.</span>" user << "<span class='notice'>You unfasten the frame.</span>"
@@ -45,12 +45,12 @@
circuit = P circuit = P
user.drop_item() user.drop_item()
P.loc = src P.loc = src
if(istype(P, /obj/item/weapon/screwdriver) && circuit) if(isscrewdriver(P) && circuit)
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You screw the circuit board into place.</span>" user << "<span class='notice'>You screw the circuit board into place.</span>"
state = 2 state = 2
icon_state = "2" icon_state = "2"
if(istype(P, /obj/item/weapon/crowbar) && circuit) if(iscrowbar(P) && circuit)
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the circuit board.</span>" user << "<span class='notice'>You remove the circuit board.</span>"
state = 1 state = 1
@@ -58,12 +58,12 @@
circuit.loc = loc circuit.loc = loc
circuit = null circuit = null
if(2) if(2)
if(istype(P, /obj/item/weapon/screwdriver) && circuit) if(isscrewdriver(P) && circuit)
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You unfasten the circuit board.</span>" user << "<span class='notice'>You unfasten the circuit board.</span>"
state = 1 state = 1
icon_state = "1" icon_state = "1"
if(istype(P, /obj/item/stack/cable_coil)) if(iscoil(P))
var/obj/item/stack/cable_coil/C = P var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5) if (C.get_amount() < 5)
user << "<span class='warning'>You need five coils of wire to add them to the frame.</span>" user << "<span class='warning'>You need five coils of wire to add them to the frame.</span>"
@@ -77,7 +77,7 @@
user << "<span class='notice'>You add cables to the frame.</span>" user << "<span class='notice'>You add cables to the frame.</span>"
return return
if(3) if(3)
if(istype(P, /obj/item/weapon/wirecutters)) if(iswirecutter(P))
if (brain) if (brain)
user << "Get that brain out of there first" user << "Get that brain out of there first"
else else
@@ -145,7 +145,7 @@
usr << "Added [P]." usr << "Added [P]."
icon_state = "3b" icon_state = "3b"
if(istype(P, /obj/item/weapon/crowbar) && brain) if(iscrowbar(P) && brain)
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the brain.</span>" user << "<span class='notice'>You remove the brain.</span>"
brain.loc = loc brain.loc = loc
@@ -153,7 +153,7 @@
icon_state = "3" icon_state = "3"
if(4) if(4)
if(istype(P, /obj/item/weapon/crowbar)) if(iscrowbar(P))
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the glass panel.</span>" user << "<span class='notice'>You remove the glass panel.</span>"
state = 3 state = 3
@@ -164,7 +164,7 @@
new /obj/item/stack/material/glass/reinforced( loc, 2 ) new /obj/item/stack/material/glass/reinforced( loc, 2 )
return return
if(istype(P, /obj/item/weapon/screwdriver)) if(isscrewdriver(P))
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You connect the monitor.</span>" user << "<span class='notice'>You connect the monitor.</span>"
if(!brain) if(!brain)
@@ -227,7 +227,7 @@
else else
user << "<span class='danger'>ERROR:</span> Unable to locate artificial intelligence." user << "<span class='danger'>ERROR:</span> Unable to locate artificial intelligence."
return return
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
if(anchored) if(anchored)
user.visible_message("<span class='notice'>\The [user] starts to unbolt \the [src] from the plating...</span>") user.visible_message("<span class='notice'>\The [user] starts to unbolt \the [src] from the plating...</span>")
if(!do_after(user,40)) if(!do_after(user,40))

View File

@@ -13,13 +13,13 @@
/obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob) /obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob)
switch(state) switch(state)
if(0) if(0)
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
user << "<span class='notice'>You wrench the frame into place.</span>" user << "<span class='notice'>You wrench the frame into place.</span>"
src.anchored = 1 src.anchored = 1
src.state = 1 src.state = 1
if(istype(P, /obj/item/weapon/weldingtool)) if(iswelder(P))
var/obj/item/weapon/weldingtool/WT = P var/obj/item/weapon/weldingtool/WT = P
if(!WT.remove_fuel(0, user)) if(!WT.remove_fuel(0, user))
user << "The welding tool must be on to complete this task." user << "The welding tool must be on to complete this task."
@@ -31,7 +31,7 @@
new /obj/item/stack/material/steel( src.loc, 5 ) new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src) qdel(src)
if(1) if(1)
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
user << "<span class='notice'>You unfasten the frame.</span>" user << "<span class='notice'>You unfasten the frame.</span>"
@@ -48,12 +48,12 @@
P.loc = src P.loc = src
else else
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>" user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
if(istype(P, /obj/item/weapon/screwdriver) && circuit) if(isscrewdriver(P) && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You screw the circuit board into place.</span>" user << "<span class='notice'>You screw the circuit board into place.</span>"
src.state = 2 src.state = 2
src.icon_state = "2" src.icon_state = "2"
if(istype(P, /obj/item/weapon/crowbar) && circuit) if(iscrowbar(P) && circuit)
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the circuit board.</span>" user << "<span class='notice'>You remove the circuit board.</span>"
src.state = 1 src.state = 1
@@ -61,12 +61,12 @@
circuit.loc = src.loc circuit.loc = src.loc
src.circuit = null src.circuit = null
if(2) if(2)
if(istype(P, /obj/item/weapon/screwdriver) && circuit) if(isscrewdriver(P) && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You unfasten the circuit board.</span>" user << "<span class='notice'>You unfasten the circuit board.</span>"
src.state = 1 src.state = 1
src.icon_state = "1" src.icon_state = "1"
if(istype(P, /obj/item/stack/cable_coil)) if(iscoil(P))
var/obj/item/stack/cable_coil/C = P var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5) if (C.get_amount() < 5)
user << "<span class='warning'>You need five coils of wire to add them to the frame.</span>" user << "<span class='warning'>You need five coils of wire to add them to the frame.</span>"
@@ -79,7 +79,7 @@
state = 3 state = 3
icon_state = "3" icon_state = "3"
if(3) if(3)
if(istype(P, /obj/item/weapon/wirecutters)) if(iswirecutter(P))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>" user << "<span class='notice'>You remove the cables.</span>"
src.state = 2 src.state = 2
@@ -100,13 +100,13 @@
src.state = 4 src.state = 4
src.icon_state = "4" src.icon_state = "4"
if(4) if(4)
if(istype(P, /obj/item/weapon/crowbar)) if(iscrowbar(P))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the glass panel.</span>" user << "<span class='notice'>You remove the glass panel.</span>"
src.state = 3 src.state = 3
src.icon_state = "3" src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 ) new /obj/item/stack/material/glass( src.loc, 2 )
if(istype(P, /obj/item/weapon/screwdriver)) if(isscrewdriver(P))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You connect the monitor.</span>" user << "<span class='notice'>You connect the monitor.</span>"
var/B = new src.circuit.build_path ( src.loc ) var/B = new src.circuit.build_path ( src.loc )

View File

@@ -38,7 +38,7 @@
attackby(var/obj/item/I, var/mob/user)//if(health > 50) attackby(var/obj/item/I, var/mob/user)//if(health > 50)
..() ..()
else if(istype(I,/obj/item/weapon/screwdriver)) else if(isscrewdriver(I))
secured = !secured secured = !secured
user.visible_message("<span class='notice'>The [src] can [secured ? "no longer" : "now"] be modified.</span>") user.visible_message("<span class='notice'>The [src] can [secured ? "no longer" : "now"] be modified.</span>")
updateBuildPath() updateBuildPath()

View File

@@ -93,7 +93,7 @@
return text return text
/obj/machinery/computer/attackby(I as obj, user as mob) /obj/machinery/computer/attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/screwdriver) && circuit) if(isscrewdriver(I) && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )

View File

@@ -53,7 +53,7 @@
/* /*
/obj/machinery/computer/pod/attackby(I as obj, user as mob) /obj/machinery/computer/pod/attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
if(stat & BROKEN) if(stat & BROKEN)

View File

@@ -27,7 +27,7 @@ var/prison_shuttle_timeleft = 0
return src.attack_hand(user) return src.attack_hand(user)
attackby(I as obj, user as mob) attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )

View File

@@ -30,7 +30,7 @@
attackby(obj/item/P as obj, mob/user as mob) attackby(obj/item/P as obj, mob/user as mob)
switch(state) switch(state)
if(1) if(1)
if(istype(P, /obj/item/stack/cable_coil)) if(iscoil(P))
var/obj/item/stack/cable_coil/C = P var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5) if (C.get_amount() < 5)
user << "<span class='warning'>You need five lengths of cable to add them to the frame.</span>" user << "<span class='warning'>You need five lengths of cable to add them to the frame.</span>"
@@ -43,7 +43,7 @@
state = 2 state = 2
icon_state = "box_1" icon_state = "box_1"
else else
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user << "<span class='notice'>You dismantle the frame</span>" user << "<span class='notice'>You dismantle the frame</span>"
new /obj/item/stack/material/steel(src.loc, 5) new /obj/item/stack/material/steel(src.loc, 5)
@@ -73,7 +73,7 @@
else else
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>" user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
else else
if(istype(P, /obj/item/weapon/wirecutters)) if(iswirecutter(P))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>" user << "<span class='notice'>You remove the cables.</span>"
state = 1 state = 1
@@ -82,7 +82,7 @@
A.amount = 5 A.amount = 5
if(3) if(3)
if(istype(P, /obj/item/weapon/crowbar)) if(iscrowbar(P))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
state = 2 state = 2
circuit.loc = src.loc circuit.loc = src.loc
@@ -98,7 +98,7 @@
components = null components = null
icon_state = "box_1" icon_state = "box_1"
else else
if(istype(P, /obj/item/weapon/screwdriver)) if(isscrewdriver(P))
var/component_check = 1 var/component_check = 1
for(var/R in req_components) for(var/R in req_components)
if(req_components[R] > 0) if(req_components[R] > 0)
@@ -134,7 +134,7 @@
for(var/I in req_components) for(var/I in req_components)
if(istype(P, text2path(I)) && (req_components[I] > 0)) if(istype(P, text2path(I)) && (req_components[I] > 0))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(istype(P, /obj/item/stack/cable_coil)) if(iscoil(P))
var/obj/item/stack/cable_coil/CP = P var/obj/item/stack/cable_coil/CP = P
if(CP.get_amount() > 1) if(CP.get_amount() > 1)
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
@@ -153,7 +153,7 @@
update_desc() update_desc()
break break
user << desc user << desc
if(P && P.loc != src && !istype(P, /obj/item/stack/cable_coil)) if(P && P.loc != src && !iscoil(P))
user << "<span class='warning'>You cannot add that component to the machine!</span>" user << "<span class='warning'>You cannot add that component to the machine!</span>"

View File

@@ -181,7 +181,7 @@ for reference:
visible_message("<span class='warning'>BZZzZZzZZzZT</span>") visible_message("<span class='warning'>BZZzZZzZZzZT</span>")
return return
return return
else if (istype(W, /obj/item/weapon/wrench)) else if (iswrench(W))
if (src.health < src.maxhealth) if (src.health < src.maxhealth)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
src.health = src.maxhealth src.health = src.maxhealth

View File

@@ -862,7 +862,7 @@ About the new airlock wires panel:
var/obj/item/device/magnetic_lock/newbracer = C var/obj/item/device/magnetic_lock/newbracer = C
newbracer.attachto(src, user) newbracer.attachto(src, user)
return return
if(!repairing && (istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density)) if(!repairing && (iswelder(C) && !( src.operating > 0 ) && src.density))
var/obj/item/weapon/weldingtool/W = C var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0,user)) if(W.remove_fuel(0,user))
if(!src.welded) if(!src.welded)
@@ -874,7 +874,7 @@ About the new airlock wires panel:
return return
else else
return return
else if(istype(C, /obj/item/weapon/screwdriver)) else if(isscrewdriver(C))
if (src.p_open) if (src.p_open)
if (stat & BROKEN) if (stat & BROKEN)
usr << "<span class='warning'>The panel is broken and cannot be closed.</span>" usr << "<span class='warning'>The panel is broken and cannot be closed.</span>"
@@ -883,16 +883,16 @@ About the new airlock wires panel:
else else
src.p_open = 1 src.p_open = 1
src.update_icon() src.update_icon()
else if(istype(C, /obj/item/weapon/wirecutters)) else if(iswirecutter(C))
return src.attack_hand(user) return src.attack_hand(user)
else if(istype(C, /obj/item/device/multitool)) else if(ismultitool(C))
return src.attack_hand(user) return src.attack_hand(user)
else if(istype(C, /obj/item/device/assembly/signaler)) else if(istype(C, /obj/item/device/assembly/signaler))
return src.attack_hand(user) return src.attack_hand(user)
else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user) cable.plugin(src, user)
else if(!repairing && istype(C, /obj/item/weapon/crowbar)) else if(!repairing && iscrowbar(C))
if(src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) ) if(src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")

View File

@@ -103,7 +103,7 @@
// This only works on broken doors or doors without power. Also allows repair with Plasteel. // This only works on broken doors or doors without power. Also allows repair with Plasteel.
/obj/machinery/door/blast/attackby(obj/item/weapon/C as obj, mob/user as mob) /obj/machinery/door/blast/attackby(obj/item/weapon/C as obj, mob/user as mob)
src.add_fingerprint(user) src.add_fingerprint(user)
if(istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/material/twohanded/fireaxe) && C:wielded == 1) || (istype(C, /obj/item/weapon/melee/hammer))) if(iscrowbar(C) || (istype(C, /obj/item/weapon/material/twohanded/fireaxe) && C:wielded == 1) || (istype(C, /obj/item/weapon/melee/hammer)))
if (((stat & NOPOWER) || (stat & BROKEN)) && !( src.operating )) if (((stat & NOPOWER) || (stat & BROKEN)) && !( src.operating ))
force_toggle() force_toggle()
else else

View File

@@ -296,7 +296,7 @@
return return
if(repairing && istype(I, /obj/item/weapon/weldingtool)) if(repairing && iswelder(I))
if(!density) if(!density)
user << "<span class='warning'>\The [src] must be closed before you can repair it.</span>" user << "<span class='warning'>\The [src] must be closed before you can repair it.</span>"
return return
@@ -313,7 +313,7 @@
repairing = null repairing = null
return return
if(repairing && istype(I, /obj/item/weapon/crowbar)) if(repairing && iscrowbar(I))
user << "<span class='notice'>You remove \the [repairing].</span>" user << "<span class='notice'>You remove \the [repairing].</span>"
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
repairing.loc = user.loc repairing.loc = user.loc

View File

@@ -209,7 +209,7 @@
add_fingerprint(user) add_fingerprint(user)
if(operating) if(operating)
return//Already doing something. return//Already doing something.
if(istype(C, /obj/item/weapon/weldingtool) && !repairing) if(iswelder(C) && !repairing)
var/obj/item/weapon/weldingtool/W = C var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0, user)) if(W.remove_fuel(0, user))
blocked = !blocked blocked = !blocked
@@ -220,14 +220,14 @@
update_icon() update_icon()
return return
if(density && istype(C, /obj/item/weapon/screwdriver)) if(density && isscrewdriver(C))
hatch_open = !hatch_open hatch_open = !hatch_open
user.visible_message("<span class='danger'>[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance panel.</span>", user.visible_message("<span class='danger'>[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance panel.</span>",
"You have [hatch_open ? "opened" : "closed"] the [src] maintenance panel.") "You have [hatch_open ? "opened" : "closed"] the [src] maintenance panel.")
update_icon() update_icon()
return return
if(blocked && istype(C, /obj/item/weapon/crowbar) && !repairing) if(blocked && iscrowbar(C) && !repairing)
if(!hatch_open) if(!hatch_open)
user << "<span class='danger'>You must open the maintenance panel first!</span>" user << "<span class='danger'>You must open the maintenance panel first!</span>"
else else
@@ -256,11 +256,11 @@
user << "<span class='danger'>\The [src] is welded shut!</span>" user << "<span class='danger'>\The [src] is welded shut!</span>"
return return
if(istype(C, /obj/item/weapon/crowbar) || istype(C,/obj/item/weapon/material/twohanded/fireaxe) || (istype(C, /obj/item/weapon/melee/hammer))) if(iscrowbar(C) || istype(C,/obj/item/weapon/material/twohanded/fireaxe) || (istype(C, /obj/item/weapon/melee/hammer)))
if(operating) if(operating)
return return
if(blocked && istype(C, /obj/item/weapon/crowbar)) if(blocked && iscrowbar(C))
user.visible_message("<span class='danger'>\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!</span>",\ user.visible_message("<span class='danger'>\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!</span>",\
"You try to pry \the [src] [density ? "open" : "closed"], but it 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.") "You hear someone struggle and metal straining.")
@@ -275,7 +275,7 @@
"You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\ "You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\
"You hear metal strain.") "You hear metal strain.")
if(do_after(user,30)) if(do_after(user,30))
if(istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/melee/hammer))) if(iscrowbar(C) || (istype(C, /obj/item/weapon/melee/hammer)))
if(stat & (BROKEN|NOPOWER) || !density) if(stat & (BROKEN|NOPOWER) || !density)
user.visible_message("<span class='danger'>\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!</span>",\ user.visible_message("<span class='danger'>\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!</span>",\
"You force \the [src] [density ? "open" : "closed"] with \the [C]!",\ "You force \the [src] [density ? "open" : "closed"] with \the [C]!",\

View File

@@ -15,7 +15,7 @@ obj/structure/firedoor_assembly/update_icon()
icon_state = "door_construction" icon_state = "door_construction"
obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob) obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob)
if(istype(C, /obj/item/stack/cable_coil) && !wired && anchored) if(iscoil(C) && !wired && anchored)
var/obj/item/stack/cable_coil/cable = C var/obj/item/stack/cable_coil/cable = C
if (cable.get_amount() < 1) if (cable.get_amount() < 1)
user << "<span class='warning'>You need one length of coil to wire \the [src].</span>" user << "<span class='warning'>You need one length of coil to wire \the [src].</span>"
@@ -26,7 +26,7 @@ obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob)
wired = 1 wired = 1
user << "<span class='notice'>You wire \the [src].</span>" user << "<span class='notice'>You wire \the [src].</span>"
else if(istype(C, /obj/item/weapon/wirecutters) && wired ) else if(iswirecutter(C) && wired )
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].") user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].")
@@ -46,13 +46,13 @@ obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob)
qdel(src) qdel(src)
else else
user << "<span class='warning'>You must secure \the [src] first!</span>" user << "<span class='warning'>You must secure \the [src] first!</span>"
else if(istype(C, /obj/item/weapon/wrench)) else if(iswrench(C))
anchored = !anchored anchored = !anchored
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message("<span class='warning'>[user] has [anchored ? "" : "un" ]secured \the [src]!</span>", user.visible_message("<span class='warning'>[user] has [anchored ? "" : "un" ]secured \the [src]!</span>",
"You have [anchored ? "" : "un" ]secured \the [src]!") "You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon() update_icon()
else if(!anchored && istype(C, /obj/item/weapon/weldingtool)) else if(!anchored && iswelder(C))
var/obj/item/weapon/weldingtool/WT = C var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user)) if(WT.remove_fuel(0, user))
user.visible_message("<span class='warning'>[user] dissassembles \the [src].</span>", user.visible_message("<span class='warning'>[user] dissassembles \the [src].</span>",

View File

@@ -180,7 +180,7 @@
return 1 return 1
//If it's emagged, crowbar can pry electronics out. //If it's emagged, crowbar can pry electronics out.
if (src.operating == -1 && istype(I, /obj/item/weapon/crowbar)) if (src.operating == -1 && iscrowbar(I))
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the windoor.", "You start to remove electronics from the windoor.") user.visible_message("[user] removes the electronics from the windoor.", "You start to remove electronics from the windoor.")
if (do_after(user,40)) if (do_after(user,40))

View File

@@ -82,7 +82,7 @@
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob) /obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user) src.add_fingerprint(user)
if (istype(W, /obj/item/weapon/screwdriver) && buildstage == 2) if (isscrewdriver(W) && buildstage == 2)
if(!wiresexposed) if(!wiresexposed)
set_light(0) set_light(0)
wiresexposed = !wiresexposed wiresexposed = !wiresexposed
@@ -93,20 +93,20 @@
set_light(0) set_light(0)
switch(buildstage) switch(buildstage)
if(2) if(2)
if (istype(W, /obj/item/device/multitool)) if (ismultitool(W))
src.detecting = !( src.detecting ) src.detecting = !( src.detecting )
if (src.detecting) if (src.detecting)
user.visible_message("<span class='notice'>\The [user] has reconnected [src]'s detecting unit!</span>", "<span class='notice'>You have reconnected [src]'s detecting unit.</span>") user.visible_message("<span class='notice'>\The [user] has reconnected [src]'s detecting unit!</span>", "<span class='notice'>You have reconnected [src]'s detecting unit.</span>")
else else
user.visible_message("<span class='notice'>\The [user] has disconnected [src]'s detecting unit!</span>", "<span class='notice'>You have disconnected [src]'s detecting unit.</span>") user.visible_message("<span class='notice'>\The [user] has disconnected [src]'s detecting unit!</span>", "<span class='notice'>You have disconnected [src]'s detecting unit.</span>")
else if (istype(W, /obj/item/weapon/wirecutters)) else if (iswirecutter(W))
user.visible_message("<span class='notice'>\The [user] has cut the wires inside \the [src]!</span>", "<span class='notice'>You have cut the wires inside \the [src].</span>") user.visible_message("<span class='notice'>\The [user] has cut the wires inside \the [src]!</span>", "<span class='notice'>You have cut the wires inside \the [src].</span>")
new/obj/item/stack/cable_coil(get_turf(src), 5) new/obj/item/stack/cable_coil(get_turf(src), 5)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
buildstage = 1 buildstage = 1
update_icon() update_icon()
if(1) if(1)
if(istype(W, /obj/item/stack/cable_coil)) if(iscoil(W))
var/obj/item/stack/cable_coil/C = W var/obj/item/stack/cable_coil/C = W
if (C.use(5)) if (C.use(5))
user << "<span class='notice'>You wire \the [src].</span>" user << "<span class='notice'>You wire \the [src].</span>"
@@ -115,7 +115,7 @@
else else
user << "<span class='warning'>You need 5 pieces of cable to wire \the [src].</span>" user << "<span class='warning'>You need 5 pieces of cable to wire \the [src].</span>"
return return
else if(istype(W, /obj/item/weapon/crowbar)) else if(iscrowbar(W))
user << "You pry out the circuit!" user << "You pry out the circuit!"
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
spawn(20) spawn(20)
@@ -130,7 +130,7 @@
buildstage = 1 buildstage = 1
update_icon() update_icon()
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
user << "You remove the fire alarm assembly from the wall!" user << "You remove the fire alarm assembly from the wall!"
new /obj/item/frame/fire_alarm(get_turf(user)) new /obj/item/frame/fire_alarm(get_turf(user))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)

View File

@@ -48,7 +48,7 @@
//Don't want to render prison breaks impossible //Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wirecutters)) if (iswirecutter(W))
add_fingerprint(user) add_fingerprint(user)
src.disable = !src.disable src.disable = !src.disable
if (src.disable) if (src.disable)
@@ -112,7 +112,7 @@
src.flash() src.flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench)) if (iswrench(W))
add_fingerprint(user) add_fingerprint(user)
src.anchored = !src.anchored src.anchored = !src.anchored

View File

@@ -102,7 +102,7 @@
/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/screwdriver)) if (isscrewdriver(W))
if (!open) if (!open)
if(unlocked) if(unlocked)
unlocked = 0 unlocked = 0
@@ -111,7 +111,7 @@
unlocked = 1 unlocked = 1
user << "You unscrew the battery panel." user << "You unscrew the battery panel."
if (istype(W, /obj/item/weapon/crowbar)) if (iscrowbar(W))
if(unlocked) if(unlocked)
if(open) if(open)
open = 0 open = 0

View File

@@ -24,10 +24,10 @@ var/list/floor_light_cache = list()
anchored = 1 anchored = 1
/obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user) /obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user)
if(istype(W, /obj/item/weapon/screwdriver)) if(isscrewdriver(W))
anchored = !anchored anchored = !anchored
visible_message("<span class='notice'>\The [user] has [anchored ? "attached" : "detached"] \the [src].</span>") visible_message("<span class='notice'>\The [user] has [anchored ? "attached" : "detached"] \the [src].</span>")
else if(istype(W, /obj/item/weapon/weldingtool) && (damaged || (stat & BROKEN))) else if(iswelder(W) && (damaged || (stat & BROKEN)))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0, user)) if(!WT.remove_fuel(0, user))
user << "<span class='warning'>\The [src] must be on to complete this task.</span>" user << "<span class='warning'>\The [src] must be on to complete this task.</span>"

View File

@@ -36,7 +36,7 @@
/obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob) /obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/weapon/wrench)) if (iswrench(W))
var/m = input("Choose work mode", "Mode") as null|anything in mode var/m = input("Choose work mode", "Mode") as null|anything in mode
mode[m] = !mode[m] mode[m] = !mode[m]
var/O = mode[m] var/O = mode[m]
@@ -49,7 +49,7 @@
TakeTile(T) TakeTile(T)
return return
if(istype(W, /obj/item/weapon/crowbar)) if(iscrowbar(W))
if(!length(contents)) if(!length(contents))
user << "<span class='notice'>\The [src] is empty.</span>" user << "<span class='notice'>\The [src] is empty.</span>"
else else
@@ -60,7 +60,7 @@
T = null T = null
return return
if(istype(W, /obj/item/weapon/screwdriver)) if(isscrewdriver(W))
T = input("Choose tile type.", "Tiles") as null|anything in contents T = input("Choose tile type.", "Tiles") as null|anything in contents
return return
..() ..()

View File

@@ -98,7 +98,7 @@
update_icon() update_icon()
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/screwdriver)) if (isscrewdriver(W))
add_fingerprint(user) add_fingerprint(user)
disable = !disable disable = !disable
if(disable) if(disable)

View File

@@ -166,7 +166,7 @@ datum/track/New(var/title_name, var/audio)
/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob) /obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user) src.add_fingerprint(user)
if(istype(W, /obj/item/weapon/wrench)) if(iswrench(W))
if(playing) if(playing)
StopPlaying() StopPlaying()
user.visible_message("<span class='warning'>[user] has [anchored ? "un" : ""]secured \the [src].</span>", "<span class='notice'>You [anchored ? "un" : ""]secure \the [src].</span>") user.visible_message("<span class='warning'>[user] has [anchored ? "un" : ""]secured \the [src].</span>", "<span class='notice'>You [anchored ? "un" : ""]secure \the [src].</span>")

View File

@@ -56,7 +56,7 @@
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(src.broken > 0) if(src.broken > 0)
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver if(src.broken == 2 && isscrewdriver(O)) // If it's broken and they're using a screwdriver
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \ "<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \
"<span class='notice'>You start to fix part of the microwave.</span>" \ "<span class='notice'>You start to fix part of the microwave.</span>" \
@@ -67,7 +67,7 @@
"<span class='notice'>You have fixed part of the microwave.</span>" \ "<span class='notice'>You have fixed part of the microwave.</span>" \
) )
src.broken = 1 // Fix it a bit src.broken = 1 // Fix it a bit
else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench else if(src.broken == 1 && iswrench(O)) // If it's broken and they're doing the wrench
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \ "<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \
"<span class='notice'>You start to fix part of the microwave.</span>" \ "<span class='notice'>You start to fix part of the microwave.</span>" \
@@ -137,7 +137,7 @@
var/obj/item/weapon/grab/G = O var/obj/item/weapon/grab/G = O
user << "<span class='warning'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>" user << "<span class='warning'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>"
return 1 return 1
else if(istype(O,/obj/item/weapon/crowbar)) else if(iscrowbar(O))
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] begins [src.anchored ? "unsecuring" : "securing"] the microwave.</span>", \ "<span class='notice'>\The [user] begins [src.anchored ? "unsecuring" : "securing"] the microwave.</span>", \
"<span class='notice'>You attempt to [src.anchored ? "unsecure" : "secure"] the microwave.</span>" "<span class='notice'>You attempt to [src.anchored ? "unsecure" : "secure"] the microwave.</span>"

View File

@@ -177,7 +177,7 @@
********************/ ********************/
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/screwdriver)) if(isscrewdriver(O))
panel_open = !panel_open 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].") 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].")
cut_overlays() cut_overlays()
@@ -186,7 +186,7 @@
SSnanoui.update_uis(src) SSnanoui.update_uis(src)
return return
if(istype(O, /obj/item/device/multitool)||istype(O, /obj/item/weapon/wirecutters)) if(ismultitool(O)||iswirecutter(O))
if(panel_open) if(panel_open)
attack_hand(user) attack_hand(user)
return return

View File

@@ -54,7 +54,7 @@
/obj/machinery/mass_driver/attackby(obj/item/W, mob/user) /obj/machinery/mass_driver/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench)) if(iswrench(W))
if(!anchored) if(!anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] secures [src] to the floor.", \ user.visible_message("[user.name] secures [src] to the floor.", \

View File

@@ -109,7 +109,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
if(!T.is_plating()) if(!T.is_plating())
return // prevent intraction when T-scanner revealed return // prevent intraction when T-scanner revealed
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
open = !open open = !open
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")

View File

@@ -44,7 +44,7 @@ var/bomb_set
return return
/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob, params) /obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob, params)
if (istype(O, /obj/item/weapon/screwdriver)) if (isscrewdriver(O))
src.add_fingerprint(user) src.add_fingerprint(user)
if (src.auth) if (src.auth)
if (panel_open == 0) if (panel_open == 0)
@@ -68,7 +68,7 @@ var/bomb_set
flick("lock", src) flick("lock", src)
return return
if (panel_open && (istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters))) if (panel_open && (ismultitool(O) || iswirecutter(O)))
return attack_hand(user) return attack_hand(user)
if (src.extended) if (src.extended)
@@ -82,7 +82,7 @@ var/bomb_set
if (src.anchored) if (src.anchored)
switch(removal_stage) switch(removal_stage)
if(0) if(0)
if(istype(O,/obj/item/weapon/weldingtool)) if(iswelder(O))
var/obj/item/weapon/weldingtool/WT = O var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn()) return if(!WT.isOn()) return
if (WT.get_fuel() < 5) // uses up 5 fuel. if (WT.get_fuel() < 5) // uses up 5 fuel.
@@ -98,7 +98,7 @@ var/bomb_set
return return
if(1) if(1)
if(istype(O,/obj/item/weapon/crowbar)) if(iscrowbar(O))
user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...") user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...")
if(do_after(user,15)) if(do_after(user,15))
@@ -108,7 +108,7 @@ var/bomb_set
return return
if(2) if(2)
if(istype(O,/obj/item/weapon/weldingtool)) if(iswelder(O))
var/obj/item/weapon/weldingtool/WT = O var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn()) return if(!WT.isOn()) return
@@ -125,7 +125,7 @@ var/bomb_set
return return
if(3) if(3)
if(istype(O,/obj/item/weapon/wrench)) if(iswrench(O))
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...") user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
@@ -136,7 +136,7 @@ var/bomb_set
return return
if(4) if(4)
if(istype(O,/obj/item/weapon/crowbar)) if(iscrowbar(O))
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...") user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")

View File

@@ -432,7 +432,7 @@ Buildable meters
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..() ..()
//* //*
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if (!isturf(src.loc)) if (!isturf(src.loc))
return 1 return 1
@@ -1165,7 +1165,7 @@ Buildable meters
/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..() ..()
if (!istype(W, /obj/item/weapon/wrench)) if (!iswrench(W))
return ..() return ..()
if(!locate(/obj/machinery/atmospherics/pipe, src.loc)) if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
user << "<span class='warning'>You need to fasten it to a pipe</span>" user << "<span class='warning'>You need to fasten it to a pipe</span>"

View File

@@ -105,7 +105,7 @@
user.drop_item() user.drop_item()
qdel(W) qdel(W)
return return
else if (istype(W, /obj/item/weapon/wrench)) else if (iswrench(W))
if (unwrenched==0) if (unwrenched==0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You begin to unfasten \the [src] from the floor...</span>" user << "<span class='notice'>You begin to unfasten \the [src] from the floor...</span>"

View File

@@ -39,13 +39,13 @@
/obj/machinery/pipelayer/attackby(var/obj/item/W as obj, var/mob/user as mob) /obj/machinery/pipelayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/weapon/wrench)) if (iswrench(W))
P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes
P_type = Pipes[P_type_t] P_type = Pipes[P_type_t]
user.visible_message("<span class='notice'>[user] has set \the [src] to manufacture [P_type_t].</span>", "<span class='notice'>You set \the [src] to manufacture [P_type_t].</span>") user.visible_message("<span class='notice'>[user] has set \the [src] to manufacture [P_type_t].</span>", "<span class='notice'>You set \the [src] to manufacture [P_type_t].</span>")
return return
if(istype(W, /obj/item/weapon/crowbar)) if(iscrowbar(W))
a_dis=!a_dis a_dis=!a_dis
user.visible_message("<span class='notice'>[user] has [!a_dis?"de":""]activated auto-dismantling.</span>", "<span class='notice'>You [!a_dis?"de":""]activate auto-dismantling.</span>") user.visible_message("<span class='notice'>[user] has [!a_dis?"de":""]activated auto-dismantling.</span>", "<span class='notice'>You [!a_dis?"de":""]activate auto-dismantling.</span>")
return return
@@ -62,7 +62,7 @@
return return
if(istype(W, /obj/item/weapon/screwdriver)) if(isscrewdriver(W))
if(metal) if(metal)
var/m = round(input(usr,"Please specify the amount of metal to remove","Remove metal",min(round(metal),50)) as num, 1) var/m = round(input(usr,"Please specify the amount of metal to remove","Remove metal",min(round(metal),50)) as num, 1)
m = min(m, 50) m = min(m, 50)

View File

@@ -289,7 +289,7 @@ var/list/turret_icons
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user) /obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
if(stat & BROKEN) if(stat & BROKEN)
if(istype(I, /obj/item/weapon/crowbar)) if(iscrowbar(I))
//If the turret is destroyed, you can remove it with a crowbar to //If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components //try and salvage its components
user << "<span class='notice'>You begin prying the metal coverings off.</span>" user << "<span class='notice'>You begin prying the metal coverings off.</span>"
@@ -308,7 +308,7 @@ var/list/turret_icons
user << "<span class='notice'>You remove the turret but did not manage to salvage anything.</span>" user << "<span class='notice'>You remove the turret but did not manage to salvage anything.</span>"
qdel(src) // qdel qdel(src) // qdel
else if((istype(I, /obj/item/weapon/wrench))) else if((iswrench(I)))
if (immobile) if (immobile)
user << "<span class='notice'>[src] is firmly attached to the ground with some form of epoxy.</span>" user << "<span class='notice'>[src] is firmly attached to the ground with some form of epoxy.</span>"
return return
@@ -693,14 +693,14 @@ var/list/turret_icons
//this is a bit unwieldy but self-explanatory //this is a bit unwieldy but self-explanatory
switch(build_step) switch(build_step)
if(0) //first step if(0) //first step
if(istype(I, /obj/item/weapon/wrench) && !anchored) if(iswrench(I) && !anchored)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "<span class='notice'>You secure the external bolts.</span>" user << "<span class='notice'>You secure the external bolts.</span>"
anchored = 1 anchored = 1
build_step = 1 build_step = 1
return return
else if(istype(I, /obj/item/weapon/crowbar) && !anchored) else if(iscrowbar(I) && !anchored)
playsound(loc, 'sound/items/Crowbar.ogg', 75, 1) playsound(loc, 'sound/items/Crowbar.ogg', 75, 1)
user << "<span class='notice'>You dismantle the turret construction.</span>" user << "<span class='notice'>You dismantle the turret construction.</span>"
new /obj/item/stack/material/steel( loc, 5) new /obj/item/stack/material/steel( loc, 5)
@@ -718,7 +718,7 @@ var/list/turret_icons
user << "<span class='warning'>You need two sheets of metal to continue construction.</span>" user << "<span class='warning'>You need two sheets of metal to continue construction.</span>"
return return
else if(istype(I, /obj/item/weapon/wrench)) else if(iswrench(I))
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
user << "<span class='notice'>You unfasten the external bolts.</span>" user << "<span class='notice'>You unfasten the external bolts.</span>"
anchored = 0 anchored = 0
@@ -727,13 +727,13 @@ var/list/turret_icons
if(2) if(2)
if(istype(I, /obj/item/weapon/wrench)) if(iswrench(I))
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "<span class='notice'>You bolt the metal armor into place.</span>" user << "<span class='notice'>You bolt the metal armor into place.</span>"
build_step = 3 build_step = 3
return return
else if(istype(I, /obj/item/weapon/weldingtool)) else if(iswelder(I))
var/obj/item/weapon/weldingtool/WT = I var/obj/item/weapon/weldingtool/WT = I
if(!WT.isOn()) if(!WT.isOn())
return return
@@ -768,7 +768,7 @@ var/list/turret_icons
qdel(I) //delete the gun :( qdel(I) //delete the gun :(
return return
else if(istype(I, /obj/item/weapon/wrench)) else if(iswrench(I))
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "<span class='notice'>You remove the turret's metal armor bolts.</span>" user << "<span class='notice'>You remove the turret's metal armor bolts.</span>"
build_step = 2 build_step = 2
@@ -787,7 +787,7 @@ var/list/turret_icons
//attack_hand() removes the gun //attack_hand() removes the gun
if(5) if(5)
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
build_step = 6 build_step = 6
user << "<span class='notice'>You close the internal access hatch.</span>" user << "<span class='notice'>You close the internal access hatch.</span>"
@@ -805,14 +805,14 @@ var/list/turret_icons
user << "<span class='warning'>You need two sheets of metal to continue construction.</span>" user << "<span class='warning'>You need two sheets of metal to continue construction.</span>"
return return
else if(istype(I, /obj/item/weapon/screwdriver)) else if(isscrewdriver(I))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
build_step = 5 build_step = 5
user << "<span class='notice'>You open the internal access hatch.</span>" user << "<span class='notice'>You open the internal access hatch.</span>"
return return
if(7) if(7)
if(istype(I, /obj/item/weapon/weldingtool)) if(iswelder(I))
var/obj/item/weapon/weldingtool/WT = I var/obj/item/weapon/weldingtool/WT = I
if(!WT.isOn()) return if(!WT.isOn()) return
if(WT.get_fuel() < 5) if(WT.get_fuel() < 5)
@@ -835,7 +835,7 @@ var/list/turret_icons
qdel(src) // qdel qdel(src) // qdel
else if(istype(I, /obj/item/weapon/crowbar)) else if(iscrowbar(I))
playsound(loc, 'sound/items/Crowbar.ogg', 75, 1) playsound(loc, 'sound/items/Crowbar.ogg', 75, 1)
user << "<span class='notice'>You pry off the turret's exterior armor.</span>" user << "<span class='notice'>You pry off the turret's exterior armor.</span>"
new /obj/item/stack/material/steel(loc, 2) new /obj/item/stack/material/steel(loc, 2)

View File

@@ -20,7 +20,7 @@ obj/machinery/recharger
var/portable = 1 var/portable = 1
obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
if(portable && istype(G, /obj/item/weapon/wrench)) if(portable && iswrench(G))
if(charging) if(charging)
user << "<span class='alert'>Remove [charging] first!</span>" user << "<span class='alert'>Remove [charging] first!</span>"
return return

View File

@@ -66,7 +66,7 @@
else else
user << "The hatch must be open to insert a power cell." user << "The hatch must be open to insert a power cell."
return return
else if(istype(I, /obj/item/weapon/screwdriver)) else if(isscrewdriver(I))
panel_open = !panel_open panel_open = !panel_open
user.visible_message("<span class='notice'>[user] [panel_open ? "opens" : "closes"] the hatch on the [src].</span>", "<span class='notice'>You [panel_open ? "open" : "close"] the hatch on the [src].</span>") user.visible_message("<span class='notice'>[user] [panel_open ? "opens" : "closes"] the hatch on the [src].</span>", "<span class='notice'>You [panel_open ? "open" : "close"] the hatch on the [src].</span>")
update_icon() update_icon()

View File

@@ -478,7 +478,7 @@
/obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob) /obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob)
if(!src.ispowered) if(!src.ispowered)
return return
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
src.panelopen = !src.panelopen src.panelopen = !src.panelopen
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user << text("<font color='blue'>You [] the unit's maintenance panel.</font>",(src.panelopen ? "open up" : "close") ) user << text("<font color='blue'>You [] the unit's maintenance panel.</font>",(src.panelopen ? "open up" : "close") )
@@ -681,7 +681,7 @@
return return
//Hacking init. //Hacking init.
if(istype(I, /obj/item/device/multitool) || istype(I, /obj/item/weapon/wirecutters)) if(ismultitool(I) || iswirecutter(I))
if(panel_open) if(panel_open)
attack_hand(user) attack_hand(user)
return return
@@ -717,7 +717,7 @@
src.updateUsrDialog() src.updateUsrDialog()
return return
else if(istype(I,/obj/item/weapon/screwdriver)) else if(isscrewdriver(I))
panel_open = !panel_open panel_open = !panel_open
user << "You [panel_open ? "open" : "close"] the maintenance panel." user << "You [panel_open ? "open" : "close"] the maintenance panel."

View File

@@ -45,7 +45,7 @@
drop_type = "supermatter" drop_type = "supermatter"
/obj/machinery/power/supply_beacon/attackby(var/obj/item/weapon/W, var/mob/user) /obj/machinery/power/supply_beacon/attackby(var/obj/item/weapon/W, var/mob/user)
if(!use_power && istype(W, /obj/item/weapon/wrench)) if(!use_power && iswrench(W))
if(!anchored && !connect_to_network()) if(!anchored && !connect_to_network())
user << "<span class='warning'>This device must be placed over an exposed cable.</span>" user << "<span class='warning'>This device must be placed over an exposed cable.</span>"
return return

View File

@@ -130,7 +130,7 @@
/obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver)) if(isscrewdriver(W))
if(active) if(active)
user << "<span class='danger'>You need to deactivate the beacon first!</span>" user << "<span class='danger'>You need to deactivate the beacon first!</span>"
return return

View File

@@ -189,7 +189,7 @@
return return
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
if(istype(D, /obj/item/weapon/screwdriver)) if(isscrewdriver(D))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
if (src.stat & BROKEN) if (src.stat & BROKEN)

View File

@@ -15,7 +15,7 @@
/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob) /obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob)
// Using a multitool lets you access the receiver's interface // Using a multitool lets you access the receiver's interface
if(istype(P, /obj/item/device/multitool)) if(ismultitool(P))
attack_hand(user) attack_hand(user)
@@ -33,25 +33,25 @@
switch(construct_op) switch(construct_op)
if(0) if(0)
if(istype(P, /obj/item/weapon/screwdriver)) if(isscrewdriver(P))
user << "You unfasten the bolts." user << "You unfasten the bolts."
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
construct_op ++ construct_op ++
if(1) if(1)
if(istype(P, /obj/item/weapon/screwdriver)) if(isscrewdriver(P))
user << "You fasten the bolts." user << "You fasten the bolts."
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
construct_op -- construct_op --
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
user << "You dislodge the external plating." user << "You dislodge the external plating."
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
construct_op ++ construct_op ++
if(2) if(2)
if(istype(P, /obj/item/weapon/wrench)) if(iswrench(P))
user << "You secure the external plating." user << "You secure the external plating."
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
construct_op -- construct_op --
if(istype(P, /obj/item/weapon/wirecutters)) if(iswirecutter(P))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "You remove the cables." user << "You remove the cables."
construct_op ++ construct_op ++
@@ -59,7 +59,7 @@
A.amount = 5 A.amount = 5
stat |= BROKEN // the machine's been borked! stat |= BROKEN // the machine's been borked!
if(3) if(3)
if(istype(P, /obj/item/stack/cable_coil)) if(iscoil(P))
var/obj/item/stack/cable_coil/A = P var/obj/item/stack/cable_coil/A = P
if (A.use(5)) if (A.use(5))
user << "<span class='notice'>You insert the cables.</span>" user << "<span class='notice'>You insert the cables.</span>"
@@ -67,7 +67,7 @@
stat &= ~BROKEN // the machine's not borked anymore! stat &= ~BROKEN // the machine's not borked anymore!
else else
user << "<span class='warning'>You need five coils of wire for this.</span>" user << "<span class='warning'>You need five coils of wire for this.</span>"
if(istype(P, /obj/item/weapon/crowbar)) if(iscrowbar(P))
user << "You begin prying out the circuit board other components..." user << "You begin prying out the circuit board other components..."
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
if(do_after(user,60)) if(do_after(user,60))
@@ -88,7 +88,7 @@
newpath = text2path(I) newpath = text2path(I)
var/obj/item/s = new newpath var/obj/item/s = new newpath
s.loc = user.loc s.loc = user.loc
if(istype(P, /obj/item/stack/cable_coil)) if(iscoil(P))
var/obj/item/stack/cable_coil/A = P var/obj/item/stack/cable_coil/A = P
A.amount = 1 A.amount = 1

View File

@@ -124,7 +124,7 @@
return return
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
if(istype(D, /obj/item/weapon/screwdriver)) if(isscrewdriver(D))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
if (src.stat & BROKEN) if (src.stat & BROKEN)

View File

@@ -207,7 +207,7 @@
return return
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
if(istype(D, /obj/item/weapon/screwdriver)) if(isscrewdriver(D))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20)) if(do_after(user, 20))
if (src.stat & BROKEN) if (src.stat & BROKEN)

View File

@@ -208,7 +208,7 @@
if (I || istype(W, /obj/item/weapon/spacecash)) if (I || istype(W, /obj/item/weapon/spacecash))
attack_hand(user) attack_hand(user)
return return
else if(istype(W, /obj/item/weapon/screwdriver)) else if(isscrewdriver(W))
src.panel_open = !src.panel_open src.panel_open = !src.panel_open
user << "You [src.panel_open ? "open" : "close"] the maintenance panel." user << "You [src.panel_open ? "open" : "close"] the maintenance panel."
cut_overlays() cut_overlays()
@@ -217,7 +217,7 @@
SSnanoui.update_uis(src) // Speaker switch is on the main UI, not wires UI SSnanoui.update_uis(src) // Speaker switch is on the main UI, not wires UI
return return
else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters)) else if(ismultitool(W)||iswirecutter(W))
if(src.panel_open) if(src.panel_open)
attack_hand(user) attack_hand(user)
return return
@@ -229,7 +229,7 @@
user << "<span class='notice'>You insert \the [W] into \the [src].</span>" user << "<span class='notice'>You insert \the [W] into \the [src].</span>"
SSnanoui.update_uis(src) SSnanoui.update_uis(src)
return return
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
if(!can_move) if(!can_move)
return return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)

View File

@@ -10,7 +10,7 @@
var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures) var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures)
/obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench)) if (iswrench(W))
new refund_type( get_turf(src.loc), refund_amt) new refund_type( get_turf(src.loc), refund_amt)
qdel(src) qdel(src)
return return

View File

@@ -73,7 +73,7 @@
icon_state = "wm_[state][panel]" icon_state = "wm_[state][panel]"
/obj/machinery/washing_machine/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/washing_machine/attackby(obj/item/weapon/W as obj, mob/user as mob)
/*if(istype(W,/obj/item/weapon/screwdriver)) /*if(isscrewdriver(W))
panel = !panel panel = !panel
user << "<span class='notice'>You [panel ? "open" : "close"] the [src]'s maintenance panel</span>"*/ user << "<span class='notice'>You [panel ? "open" : "close"] the [src]'s maintenance panel</span>"*/
if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp)) if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp))

View File

@@ -768,7 +768,7 @@
user << "<span class='warning'>Invalid ID: Access denied.</span>" user << "<span class='warning'>Invalid ID: Access denied.</span>"
else else
user << "<span class='warning'>Maintenance protocols disabled by operator.</span>" user << "<span class='warning'>Maintenance protocols disabled by operator.</span>"
else if(istype(W, /obj/item/weapon/wrench)) else if(iswrench(W))
if(state==1) if(state==1)
state = 2 state = 2
user << "You undo the securing bolts." user << "You undo the securing bolts."
@@ -778,7 +778,7 @@
user << "You tighten the securing bolts." user << "You tighten the securing bolts."
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
return return
else if(istype(W, /obj/item/weapon/crowbar)) else if(iscrowbar(W))
if(state==2) if(state==2)
state = 3 state = 3
user << "You open the hatch to the power unit" user << "You open the hatch to the power unit"
@@ -788,7 +788,7 @@
user << "You close the hatch to the power unit" user << "You close the hatch to the power unit"
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1) playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
return return
else if(istype(W, /obj/item/stack/cable_coil)) else if(iscoil(W))
if(state == 3 && hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) if(state == 3 && hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
var/obj/item/stack/cable_coil/CC = W var/obj/item/stack/cable_coil/CC = W
if(CC.use(2)) if(CC.use(2))
@@ -797,7 +797,7 @@
else else
user << "There's not enough wire to finish the task." user << "There's not enough wire to finish the task."
return return
else if(istype(W, /obj/item/weapon/screwdriver)) else if(isscrewdriver(W))
if(hasInternalDamage(MECHA_INT_TEMP_CONTROL)) if(hasInternalDamage(MECHA_INT_TEMP_CONTROL))
clearInternalDamage(MECHA_INT_TEMP_CONTROL) clearInternalDamage(MECHA_INT_TEMP_CONTROL)
user << "You repair the damaged temperature controller." user << "You repair the damaged temperature controller."
@@ -807,7 +807,7 @@
return return
else if(istype(W, /obj/item/device/multitool)) else if(ismultitool(W))
if(state>=3 && src.occupant) if(state>=3 && src.occupant)
user << "You attempt to eject the pilot using the maintenance controls." user << "You attempt to eject the pilot using the maintenance controls."
if(src.occupant.stat) if(src.occupant.stat)
@@ -831,7 +831,7 @@
user << "There's already a powercell installed." user << "There's already a powercell installed."
return return
else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != I_HURT) else if(iswelder(W) && user.a_intent != I_HURT)
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user)) if (WT.remove_fuel(0,user))
if (hasInternalDamage(MECHA_INT_TANK_BREACH)) if (hasInternalDamage(MECHA_INT_TANK_BREACH))

View File

@@ -3,22 +3,22 @@
//////////////////////////////// ////////////////////////////////
/datum/construction/mecha/custom_action(step, atom/used_atom, mob/user) /datum/construction/mecha/custom_action(step, atom/used_atom, mob/user)
if(istype(used_atom, /obj/item/weapon/weldingtool)) if(iswelder(used_atom))
var/obj/item/weapon/weldingtool/W = used_atom var/obj/item/weapon/weldingtool/W = used_atom
if (W.remove_fuel(0, user)) if (W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1) playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else else
return 0 return 0
else if(istype(used_atom, /obj/item/weapon/wrench)) else if(iswrench(used_atom))
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1) playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/screwdriver)) else if(isscrewdriver(used_atom))
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1) playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/wirecutters)) else if(iswirecutter(used_atom))
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1) playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
else if(istype(used_atom, /obj/item/stack/cable_coil)) else if(iscoil(used_atom))
var/obj/item/stack/cable_coil/C = used_atom var/obj/item/stack/cable_coil/C = used_atom
if(C.use(4)) if(C.use(4))
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)
@@ -35,22 +35,22 @@
return 1 return 1
/datum/construction/reversible/mecha/custom_action(index as num, diff as num, atom/used_atom, mob/user as mob) /datum/construction/reversible/mecha/custom_action(index as num, diff as num, atom/used_atom, mob/user as mob)
if(istype(used_atom, /obj/item/weapon/weldingtool)) if(iswelder(used_atom))
var/obj/item/weapon/weldingtool/W = used_atom var/obj/item/weapon/weldingtool/W = used_atom
if (W.remove_fuel(0, user)) if (W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1) playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else else
return 0 return 0
else if(istype(used_atom, /obj/item/weapon/wrench)) else if(iswrench(used_atom))
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1) playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/screwdriver)) else if(isscrewdriver(used_atom))
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1) playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/wirecutters)) else if(iswirecutter(used_atom))
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1) playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
else if(istype(used_atom, /obj/item/stack/cable_coil)) else if(iscoil(used_atom))
var/obj/item/stack/cable_coil/C = used_atom var/obj/item/stack/cable_coil/C = used_atom
if(C.use(4)) if(C.use(4))
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)

View File

@@ -31,7 +31,7 @@
/obj/effect/decal/mecha_wreckage/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/effect/decal/mecha_wreckage/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/weldingtool)) if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(salvage_num <= 0) if(salvage_num <= 0)
user << "You don't see anything that can be cut with [W]." user << "You don't see anything that can be cut with [W]."
@@ -49,7 +49,7 @@
else else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>" user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return return
if(istype(W, /obj/item/weapon/wirecutters)) if(iswirecutter(W))
if(salvage_num <= 0) if(salvage_num <= 0)
user << "You don't see anything that can be cut with [W]." user << "You don't see anything that can be cut with [W]."
return return
@@ -61,7 +61,7 @@
salvage_num-- salvage_num--
else else
user << "You failed to salvage anything valuable from [src]." user << "You failed to salvage anything valuable from [src]."
if(istype(W, /obj/item/weapon/crowbar)) if(iscrowbar(W))
if(!isemptylist(crowbar_salvage)) if(!isemptylist(crowbar_salvage))
var/obj/S = pick(crowbar_salvage) var/obj/S = pick(crowbar_salvage)
if(S) if(S)

View File

@@ -124,7 +124,7 @@
icon_state = design.icon_state // poster[serial_number] icon_state = design.icon_state // poster[serial_number]
/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wirecutters)) if(iswirecutter(W))
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1) playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
if(ruined) if(ruined)
user << "<span class='notice'>You remove the remnants of the poster.</span>" user << "<span class='notice'>You remove the remnants of the poster.</span>"

View File

@@ -25,7 +25,7 @@
var/damage = W.force / 4.0 var/damage = W.force / 4.0
if(istype(W, /obj/item/weapon/weldingtool)) if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user)) if(WT.remove_fuel(0, user))

View File

@@ -9,7 +9,7 @@
/obj/item/frame/apc/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/frame/apc/attackby(obj/item/weapon/W as obj, mob/user as mob)
..() ..()
if (istype(W, /obj/item/weapon/wrench)) if (iswrench(W))
new /obj/item/stack/material/steel( get_turf(src.loc), 2 ) new /obj/item/stack/material/steel( get_turf(src.loc), 2 )
qdel(src) qdel(src)

View File

@@ -58,7 +58,7 @@
src.name = "body bag" src.name = "body bag"
//..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri //..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri
return return
else if(istype(W, /obj/item/weapon/wirecutters)) else if(iswirecutter(W))
user << "You cut the tag off the bodybag" user << "You cut the tag off the bodybag"
src.name = "body bag" src.name = "body bag"
cut_overlays() cut_overlays()

View File

@@ -32,7 +32,7 @@
return ..() return ..()
/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user) /obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
if(mode == 0) if(mode == 0)
var/turf/T = loc var/turf/T = loc
if(isturf(T) && !!T.is_plating()) if(isturf(T) && !!T.is_plating())

View File

@@ -236,10 +236,10 @@
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
// ..() // ..()
user.set_machine(src) user.set_machine(src)
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ )))) if (!( isscrewdriver(W) || (istype(W, /obj/item/device/encryptionkey/ ))))
return return
if(istype(W, /obj/item/weapon/screwdriver)) if(isscrewdriver(W))
if(keyslot1 || keyslot2) if(keyslot1 || keyslot2)

View File

@@ -546,7 +546,7 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob)
..() ..()
user.set_machine(src) user.set_machine(src)
if (!( istype(W, /obj/item/weapon/screwdriver) )) if (!( isscrewdriver(W) ))
return return
b_stat = !( b_stat ) b_stat = !( b_stat )
if(!istype(src, /obj/item/device/radio/beacon)) if(!istype(src, /obj/item/device/radio/beacon))
@@ -599,10 +599,10 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob)
// ..() // ..()
user.set_machine(src) user.set_machine(src)
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ )))) if (!( isscrewdriver(W) || (istype(W, /obj/item/device/encryptionkey/ ))))
return return
if(istype(W, /obj/item/weapon/screwdriver)) if(isscrewdriver(W))
if(keyslot) if(keyslot)

View File

@@ -103,7 +103,7 @@ proc/within_jamming_range(var/atom/test) // tests if an object is near a radio j
/obj/item/device/radiojammer/improvised/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/device/radiojammer/improvised/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/screwdriver)) if (isscrewdriver(W))
user << "<span class='notice'>You disassemble the improvised signal jammer.</span>" user << "<span class='notice'>You disassemble the improvised signal jammer.</span>"
user.put_in_hands(assembly_holder) user.put_in_hands(assembly_holder)
user.put_in_hands(cell) user.put_in_hands(cell)

View File

@@ -146,7 +146,7 @@
user << "You switch on the [src]." user << "You switch on the [src]."
/obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/screwdriver)) if (isscrewdriver(W))
if(cover_open) if(cover_open)
cover_open = 0 cover_open = 0
user << "You screw the panel into place." user << "You screw the panel into place."

View File

@@ -258,7 +258,7 @@
W.loc = src W.loc = src
src.cell = W src.cell = W
user << "<span class='notice'>You insert the cell!</span>" user << "<span class='notice'>You insert the cell!</span>"
if(istype(W, /obj/item/stack/cable_coil)) if(iscoil(W))
if(src.wires) if(src.wires)
user << "<span class='warning'>You have already inserted wire!</span>" user << "<span class='warning'>You have already inserted wire!</span>"
return return

View File

@@ -33,7 +33,7 @@
attackby(obj/item/W as obj, mob/user as mob) attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/weldingtool)) if (iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user)) if(WT.remove_fuel(0, user))
overlays.Cut() overlays.Cut()

View File

@@ -49,7 +49,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list(
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob) /obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob)
..() ..()
if (istype(W, /obj/item/weapon/weldingtool)) if (iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(get_amount() < 2) if(get_amount() < 2)

View File

@@ -26,7 +26,7 @@
/obj/item/stack/material/glass/attackby(obj/item/W, mob/user) /obj/item/stack/material/glass/attackby(obj/item/W, mob/user)
..() ..()
if(!is_reinforced) if(!is_reinforced)
if(istype(W,/obj/item/stack/cable_coil)) if(iscoil(W))
var/obj/item/stack/cable_coil/CC = W var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5) if (get_amount() < 1 || CC.get_amount() < 5)
user << "<span class='warning'>You need five lengths of coil and one sheet of glass to make wired glass.</span>" user << "<span class='warning'>You need five lengths of coil and one sheet of glass to make wired glass.</span>"

View File

@@ -24,7 +24,7 @@
/obj/item/weapon/flame/candle/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/weapon/flame/candle/attackby(obj/item/weapon/W as obj, mob/user as mob)
..() ..()
if(istype(W, /obj/item/weapon/weldingtool)) if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light("<span class='notice'>\The [user] casually lights the [name] with [W].</span>") light("<span class='notice'>\The [user] casually lights the [name] with [W].</span>")

View File

@@ -17,7 +17,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/lit = 0 var/lit = 0
/proc/isflamesource(A) /proc/isflamesource(A)
if(istype(A, /obj/item/weapon/weldingtool)) if(iswelder(A))
var/obj/item/weapon/weldingtool/WT = A var/obj/item/weapon/weldingtool/WT = A
return (WT.isOn()) return (WT.isOn())
else if(istype(A, /obj/item/weapon/flame)) else if(istype(A, /obj/item/weapon/flame))
@@ -186,7 +186,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
text = zippomes text = zippomes
else if(istype(W, /obj/item/weapon/flame/lighter)) else if(istype(W, /obj/item/weapon/flame/lighter))
text = lightermes text = lightermes
else if(istype(W, /obj/item/weapon/weldingtool)) else if(iswelder(W))
text = weldermes text = weldermes
else if(istype(W, /obj/item/device/assembly/igniter)) else if(istype(W, /obj/item/device/assembly/igniter))
text = ignitermes text = ignitermes

View File

@@ -56,7 +56,7 @@
user << "<span class='notice'>You [locked ? "" : "un"]lock the circuit controls.</span>" user << "<span class='notice'>You [locked ? "" : "un"]lock the circuit controls.</span>"
else else
user << "<span class='warning'>Access denied.</span>" user << "<span class='warning'>Access denied.</span>"
else if(istype(I,/obj/item/device/multitool)) else if(ismultitool(I))
if(locked) if(locked)
user << "<span class='warning'>Circuit controls are locked.</span>" user << "<span class='warning'>Circuit controls are locked.</span>"
return return

View File

@@ -7,7 +7,7 @@
build_path = /obj/machinery/computer/rdconsole/core build_path = /obj/machinery/computer/rdconsole/core
/obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/weapon/screwdriver)) if(isscrewdriver(I))
user.visible_message("<span class='notice'>\The [user] adjusts the jumper on \the [src]'s access protocol pins.</span>", "<span class='notice'>You adjust the jumper on the access protocol pins.</span>") user.visible_message("<span class='notice'>\The [user] adjusts the jumper on \the [src]'s access protocol pins.</span>", "<span class='notice'>You adjust the jumper on the access protocol pins.</span>")
if(src.build_path == /obj/machinery/computer/rdconsole/core) if(src.build_path == /obj/machinery/computer/rdconsole/core)
src.name = T_BOARD("RD Console - Robotics") src.name = T_BOARD("RD Console - Robotics")

View File

@@ -17,7 +17,7 @@
contraband_enabled = SC.can_order_contraband contraband_enabled = SC.can_order_contraband
/obj/item/weapon/circuitboard/supplycomp/attackby(obj/item/I as obj, mob/user as mob) /obj/item/weapon/circuitboard/supplycomp/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/device/multitool)) if(ismultitool(I))
var/catastasis = src.contraband_enabled var/catastasis = src.contraband_enabled
var/opposite_catastasis var/opposite_catastasis
if(catastasis) if(catastasis)

View File

@@ -8,7 +8,7 @@
var/init_dirs = SOUTH var/init_dirs = SOUTH
/obj/item/weapon/circuitboard/unary_atmos/attackby(obj/item/I as obj, mob/user as mob) /obj/item/weapon/circuitboard/unary_atmos/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/weapon/screwdriver)) if(isscrewdriver(I))
machine_dir = turn(machine_dir, 90) machine_dir = turn(machine_dir, 90)
init_dirs = machine_dir init_dirs = machine_dir
user.visible_message("<span class='notice'>\The [user] adjusts the jumper on the [src]'s port configuration pins.</span>", "<span class='notice'>You adjust the jumper on the port configuration pins. Now set to [dir2text(machine_dir)].</span>") user.visible_message("<span class='notice'>\The [user] adjusts the jumper on the [src]'s port configuration pins.</span>", "<span class='notice'>You adjust the jumper on the port configuration pins. Now set to [dir2text(machine_dir)].</span>")

View File

@@ -133,7 +133,7 @@
else else
user << "<span class='notice'>[src] already has a cell.</span>" user << "<span class='notice'>[src] already has a cell.</span>"
else if(istype(W, /obj/item/weapon/screwdriver)) else if(isscrewdriver(W))
if(cell) if(cell)
cell.update_icon() cell.update_icon()
cell.forceMove(get_turf(src.loc)) cell.forceMove(get_turf(src.loc))

View File

@@ -25,10 +25,10 @@
return ..() return ..()
/obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user) /obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/screwdriver)) if(isscrewdriver(I))
open_panel = !open_panel open_panel = !open_panel
user << "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>" user << "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>"
else if(istype(I, /obj/item/weapon/wirecutters) || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler )) else if(iswirecutter(I) || ismultitool(I) || istype(I, /obj/item/device/assembly/signaler ))
wires.Interact(user) wires.Interact(user)
else else
..() ..()

View File

@@ -47,7 +47,7 @@
/obj/effect/spresent/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/effect/spresent/attackby(obj/item/weapon/W as obj, mob/user as mob)
..() ..()
if (!istype(W, /obj/item/weapon/wirecutters)) if (!iswirecutter(W))
user << "<span class='warning'>I need wirecutters for that.</span>" user << "<span class='warning'>I need wirecutters for that.</span>"
return return

View File

@@ -72,7 +72,7 @@
icon_state = initial(icon_state) +"_ass" icon_state = initial(icon_state) +"_ass"
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]" name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
stage = 1 stage = 1
else if(istype(W,/obj/item/weapon/screwdriver) && path != 2) else if(isscrewdriver(W) && path != 2)
if(stage == 1) if(stage == 1)
path = 1 path = 1
if(beakers.len) if(beakers.len)

View File

@@ -7,7 +7,7 @@
thrown_force_divisor = 0.1 thrown_force_divisor = 0.1
/obj/item/weapon/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob) /obj/item/weapon/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver)) if(isscrewdriver(W))
user << "You finish the concealed blade weapon." user << "You finish the concealed blade weapon."
new /obj/item/weapon/material/butterfly(user.loc, material.name) new /obj/item/weapon/material/butterfly(user.loc, material.name)
qdel(src) qdel(src)
@@ -58,7 +58,7 @@
var/obj/item/weapon/material/tmp_shard = I var/obj/item/weapon/material/tmp_shard = I
finished = new /obj/item/weapon/material/twohanded/spear(get_turf(user), tmp_shard.material.name) finished = new /obj/item/weapon/material/twohanded/spear(get_turf(user), tmp_shard.material.name)
user << "<span class='notice'>You fasten \the [I] to the top of the rod with the cable.</span>" user << "<span class='notice'>You fasten \the [I] to the top of the rod with the cable.</span>"
else if(istype(I, /obj/item/weapon/wirecutters)) else if(iswirecutter(I))
finished = new /obj/item/weapon/melee/baton/cattleprod(get_turf(user)) finished = new /obj/item/weapon/melee/baton/cattleprod(get_turf(user))
user << "<span class='notice'>You fasten the wirecutters to the top of the rod with the cable, prongs outward.</span>" user << "<span class='notice'>You fasten the wirecutters to the top of the rod with the cable, prongs outward.</span>"
if(finished) if(finished)

Some files were not shown because too many files have changed in this diff Show More