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

@@ -67,11 +67,11 @@ var/global/list/rad_collectors = list()
W.loc = src
update_icons()
return 1
else if(istype(W, /obj/item/weapon/crowbar))
else if(iscrowbar(W))
if(P && !src.locked)
eject()
return 1
else if(istype(W, /obj/item/weapon/wrench))
else if(iswrench(W))
if(P)
user << "<span class='notice'>Remove the phoron tank first.</span>"
return 1

View File

@@ -151,7 +151,7 @@
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(iswrench(W))
if(active)
user << "Turn off [src] first."
return
@@ -174,7 +174,7 @@
user << "<span class='warning'>\The [src] needs to be unwelded from the floor.</span>"
return
if(istype(W, /obj/item/weapon/weldingtool))
if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W
if(active)
user << "Turn off [src] first."

View File

@@ -93,7 +93,7 @@ field_generator power level display
if(active)
user << "The [src] needs to be off."
return
else if(istype(W, /obj/item/weapon/wrench))
else if(iswrench(W))
switch(state)
if(0)
state = 1
@@ -112,7 +112,7 @@ field_generator power level display
if(2)
user << "<span class='warning'>The [src.name] needs to be unwelded from the floor.</span>"
return
else if(istype(W, /obj/item/weapon/weldingtool))
else if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W
switch(state)
if(0)

View File

@@ -17,7 +17,7 @@
if(src) qdel(src)
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(iswrench(W))
anchored = !anchored
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
if(anchored)