Replaces istypes with the proper tool_behaviour checks. (#40414)

This commit is contained in:
ShizCalev
2018-10-01 03:10:31 +03:00
committed by vuonojenmustaturska
parent 2dfa05a848
commit 2fa1ac1349
179 changed files with 489 additions and 464 deletions
+3 -3
View File
@@ -106,7 +106,7 @@
toggle_lock(user)
else
to_chat(user, "<span class='warning'>Access denied.</span>")
else if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
else if(W.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=5))
return
@@ -119,7 +119,7 @@
else
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
else if(!alert && istype(W, /obj/item/crowbar) && openable) //Only applies to the lab cage and player made display cases
else if(!alert && W.tool_behaviour == TOOL_CROWBAR && openable) //Only applies to the lab cage and player made display cases
if(broken)
if(showpiece)
to_chat(user, "<span class='notice'>Remove the displayed object first.</span>")
@@ -189,7 +189,7 @@
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench)) //The player can only deconstruct the wooden frame
if(I.tool_behaviour == TOOL_WRENCH) //The player can only deconstruct the wooden frame
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))