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

@@ -88,7 +88,7 @@
return 1
/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)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \

View File

@@ -235,7 +235,7 @@
return
/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 ..()
if (unlocked)
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"

View File

@@ -86,7 +86,7 @@
add_overlay("hi-turb")
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
if(iswrench(W))
anchored = !anchored
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)
if(istype(W, /obj/item/weapon/wrench))
if(iswrench(W))
anchored = !anchored
turbine = null
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()
/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 ..()
if (!(stat & NOPOWER) && use_power)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"

View File

@@ -84,7 +84,7 @@
update_icon()
/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 ..()
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)
if (!istype(W, /obj/item/weapon/wrench))
if (!iswrench(W))
return ..()
if (connected_device)
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)
if (!istype(W, /obj/item/weapon/wrench))
if (!iswrench(W))
return ..()
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()

View File

@@ -104,7 +104,7 @@
return 1
/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 ..()
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()

View File

@@ -342,7 +342,7 @@
go_to_side()
/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 ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"

View File

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

View File

@@ -350,7 +350,7 @@
return
/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
if (!WT.welding)
user << "<span class='danger'>\The [WT] must be turned on!</span>"
@@ -390,7 +390,7 @@
update_icon()
/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 ..()
if (!(stat & NOPOWER) && use_power)
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"

View File

@@ -260,7 +260,7 @@
update_icon()
/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)
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1
@@ -285,7 +285,7 @@
qdel(src)
return 1
if(istype(W, /obj/item/weapon/weldingtool))
if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W
if (!WT.welding)
user << "<span class='danger'>\The [WT] must be turned on!</span>"

View File

@@ -300,7 +300,7 @@
open()
/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 ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital))
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"