mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-29 03:21:30 +00:00
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:
@@ -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.", \
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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>"
|
||||
|
||||
Reference in New Issue
Block a user