Killing off inconsistencies with impact wrenches / combi-tools (#7269)

Part 1 in the "why my impact wrench no wrench bolt" saga

tl;dr for end users: combitools / impact wrenches now work on everything their non-powered versions do (except mechs and RIGs, tune in next time on dragon ball Z for that)

essentially all this PR does is murder every istype() check possible that could use a helper function instead, most notably many pen checks with ispen(). it also repaths combitools and powerdrills to /obj/item/weapon so they aren't instantly taken out of contention by half of the known attackby() prompts

I already squashed a couple runtimes here and there from the pen changes and it's possible I missed another because pencode is another scourge upon our lives
This commit is contained in:
JohnWildkins
2019-10-26 15:20:40 -04:00
committed by Erki
parent 751f77550a
commit 9c335f6c00
47 changed files with 141 additions and 119 deletions
@@ -153,7 +153,7 @@
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen))
if(W.ispen())
var/t = sanitizeSafe(input(user, "Enter the name for the door.", src.name, src.created_name), MAX_NAME_LEN)
if(!t) return
if(!in_range(src, usr) && src.loc != usr) return
+4 -4
View File
@@ -90,8 +90,8 @@
update()
return
/obj/structure/morgue/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
/obj/structure/morgue/attackby(obj/P, mob/user as mob)
if (P.ispen())
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
if (user.get_active_hand() != P)
return
@@ -274,8 +274,8 @@
src.add_fingerprint(user)
update()
/obj/structure/crematorium/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
/obj/structure/crematorium/attackby(obj/P, mob/user as mob)
if (P.ispen())
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
if (user.get_active_hand() != P)
return
+9 -8
View File
@@ -64,15 +64,16 @@
return
var/obj/item/P = locate(href_list["write"])
if((P && P.loc == src)) //ifthe paper's on the board
if(istype(usr.r_hand, /obj/item/weapon/pen)) //and you're holding a pen
add_fingerprint(usr)
P.attackby(usr.r_hand, usr) //then do ittttt
var/obj/item/R = usr.r_hand
var/obj/item/L = usr.l_hand
if(R.ispen())
P.attackby(R, usr)
else if(L.ispen())
P.attackby(L, usr)
else
if(istype(usr.l_hand, /obj/item/weapon/pen)) //check other hand for pen
add_fingerprint(usr)
P.attackby(usr.l_hand, usr)
else
to_chat(usr, "<span class='notice'>You'll need something to write with!</span>")
to_chat(usr, "<span class='notice'>You'll need something to write with!</span>")
return
add_fingerprint(usr)
if(href_list["read"])
var/obj/item/weapon/paper/P = locate(href_list["read"])
if((P && P.loc == src))