Converts most istype(thing,tool) procs into an appropriate thing.is_tool() format

This commit is contained in:
Anewbe
2018-08-02 21:45:15 -05:00
parent 8b6377016f
commit 729ce71aa0
294 changed files with 20414 additions and 3197 deletions

View File

@@ -254,10 +254,10 @@
/obj/machinery/shieldgen/attack_hand(mob/user as mob)
if(locked)
user << "The machine is locked, you are unable to use it."
to_chat(user, "The machine is locked, you are unable to use it.")
return
if(is_open)
user << "The panel must be closed before operating this machine."
to_chat(user, "The panel must be closed before operating this machine.")
return
if (src.active)
@@ -272,7 +272,7 @@
"You hear heavy droning.")
src.shields_up()
else
user << "The device must first be secured to the floor."
to_chat(user, "The device must first be secured to the floor.")
return
/obj/machinery/shieldgen/emag_act(var/remaining_charges, var/mob/user)
@@ -282,50 +282,50 @@
return 1
/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
playsound(src, W.usesound, 100, 1)
if(is_open)
user << "<font color='blue'>You close the panel.</font>"
to_chat(user, "<font color='blue'>You close the panel.</font>")
is_open = 0
else
user << "<font color='blue'>You open the panel and expose the wiring.</font>"
to_chat(user, "<font color='blue'>You open the panel and expose the wiring.</font>")
is_open = 1
else if(istype(W, /obj/item/stack/cable_coil) && malfunction && is_open)
else if(W.is_cable_coil() && malfunction && is_open)
var/obj/item/stack/cable_coil/coil = W
user << "<span class='notice'>You begin to replace the wires.</span>"
to_chat(user, "<span class='notice'>You begin to replace the wires.</span>")
//if(do_after(user, min(60, round( ((getMaxHealth()/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage
if(do_after(user, 30))
if (coil.use(1))
health = max_health
malfunction = 0
user << "<span class='notice'>You repair the [src]!</span>"
to_chat(user, "<span class='notice'>You repair the [src]!</span>")
update_icon()
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
if(locked)
user << "The bolts are covered, unlocking this would retract the covers."
to_chat(user, "The bolts are covered, unlocking this would retract the covers.")
return
if(anchored)
playsound(src, W.usesound, 100, 1)
user << "<font color='blue'>You unsecure the [src] from the floor!</font>"
to_chat(user, "<font color='blue'>You unsecure the [src] from the floor!</font>")
if(active)
user << "<font color='blue'>The [src] shuts off!</font>"
to_chat(user, "<font color='blue'>The [src] shuts off!</font>")
src.shields_down()
anchored = 0
else
if(istype(get_turf(src), /turf/space)) return //No wrenching these in space!
playsound(src, W.usesound, 100, 1)
user << "<font color='blue'>You secure the [src] to the floor!</font>"
to_chat(user, "<font color='blue'>You secure the [src] to the floor!</font>")
anchored = 1
else if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(src.allowed(user))
src.locked = !src.locked
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
else
user << "<font color='red'>Access denied.</font>"
to_chat(user, "<font color='red'>Access denied.</font>")
else
..()

View File

@@ -158,7 +158,7 @@
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
if(active)
user << "Turn off the field generator first."
return

View File

@@ -45,7 +45,7 @@
updateDialog()
else
user << "<font color='red'>Access denied.</font>"
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
src.anchored = !src.anchored
playsound(src, W.usesound, 75, 1)
src.visible_message("<font color='blue'>\icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].</font>")

View File

@@ -64,7 +64,7 @@
updateDialog()
else
user << "<font color='red'>Access denied.</font>"
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
src.anchored = !src.anchored
playsound(src, W.usesound, 75, 1)
src.visible_message("<font color='blue'>\icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].</font>")