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 22:08:42 +03:00
committed by Erki
parent ad96a34dd8
commit cb5e227320
219 changed files with 546 additions and 572 deletions
+1 -1
View File
@@ -199,7 +199,7 @@
/obj/structure/closet/crate/secure/loot/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(locked)
if (istype(W, /obj/item/device/multitool)) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
if (ismultitool(W)) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
user << "<span class='notice'>DECA-CODE LOCK ANALYSIS:</span>"
if (attempts == 1)
user << "<span class='warning'>* Anti-Tamper system will activate on the next failed access attempt.</span>"
+2 -2
View File
@@ -45,7 +45,7 @@
icon_state = "coin_adamantine"
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/stack/cable_coil))
if(iscoil(W))
var/obj/item/stack/cable_coil/CC = W
if(string_attached)
user << "<span class='notice'>There already is a string attached to this coin.</span>"
@@ -57,7 +57,7 @@
else
user << "<span class='notice'>This cable coil appears to be empty.</span>"
return
else if(istype(W,/obj/item/weapon/wirecutters))
else if(iswirecutter(W))
if(!string_attached)
..()
return
+2 -2
View File
@@ -158,7 +158,7 @@
return
if(active) return ..()
if(istype(O, /obj/item/weapon/crowbar))
if(iscrowbar(O))
if (panel_open && cell)
user << "You wrench out \the [cell]."
cell.forceMove(get_turf(user))
@@ -375,7 +375,7 @@
if(default_deconstruction_crowbar(user, W))
return
if(istype(W,/obj/item/weapon/wrench))
if(iswrench(W))
if(istype(get_turf(src), /turf/space))
user << "<span class='notice'>You send the [src] careening into space. Idiot.</span>"
+2 -2
View File
@@ -546,7 +546,7 @@
var/turf/T = get_turf(src)
T.attackby(C, user)
return
if (istype(C, /obj/item/weapon/weldingtool))
if (iswelder(C))
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
user << "<span class='notice'>Slicing apart connectors ...</span>"
@@ -1176,7 +1176,7 @@ var/list/total_extraction_beacons = list()
/obj/structure/sculpting_block/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/weapon/wrench))
if (iswrench(C))
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "<span class='notice'>You [anchored ? "un" : ""]anchor the [name].</span>"
anchored = !anchored