[MIRROR] Refactors tool typechecks, refactors transforming tools, makes Altevian wrench into one (#7062)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com>
This commit is contained in:
CHOMPStation2
2023-10-04 15:37:41 -07:00
committed by GitHub
parent 00a5f09ad4
commit d2e66e6410
310 changed files with 1035 additions and 944 deletions

View File

@@ -31,7 +31,7 @@
update_icon()
/obj/item/ammo_casing/attackby(obj/item/I as obj, mob/user as mob)
if(I.is_screwdriver())
if(I.has_tool_quality(TOOL_SCREWDRIVER))
if(!BB)
to_chat(user, "<font color='blue'>There is no bullet in the casing to inscribe anything into.</font>")
return

View File

@@ -87,7 +87,7 @@
update_icon()
return
else if(I.is_screwdriver())
else if(I.has_tool_quality(TOOL_SCREWDRIVER))
if(attached_cell)
to_chat(user, "You begin removing \the [attached_cell] from \the [src].")
if(do_after(user, 10)) // Faster than doing it by hand

View File

@@ -283,7 +283,7 @@
verbs += /obj/item/weapon/gun/verb/allow_dna
return
if(A.is_screwdriver())
if(A.has_tool_quality(TOOL_SCREWDRIVER))
if(dna_lock && attached_lock && !attached_lock.controller_lock)
to_chat(user, "<span class='notice'>You begin removing \the [attached_lock] from \the [src].</span>")
playsound(src, A.usesound, 50, 1)

View File

@@ -42,7 +42,7 @@
if(!istype(user))
return
if(I.is_screwdriver())
if(I.has_tool_quality(TOOL_SCREWDRIVER))
if(!scanmod)
to_chat(user, "<span class='warning'>There's no scanner module installed!</span>")
return

View File

@@ -82,7 +82,7 @@
else
to_chat(user, "<span class='notice'>[src] already has a laser.</span>")
else if(W.is_screwdriver())
else if(W.has_tool_quality(TOOL_SCREWDRIVER))
if(emitter)
to_chat(user, "<span class='notice'>You remove the [emitter.name] from the [src].</span>")
emitter.loc = get_turf(src.loc)

View File

@@ -167,7 +167,7 @@
else
to_chat(user, "<span class='notice'>[src] already has a cell installed.</span>")
else if(W.is_screwdriver())
else if(W.has_tool_quality(TOOL_SCREWDRIVER))
if(cell)
var/obj/item/C = cell
C.loc = get_turf(user)
@@ -237,9 +237,9 @@
else
to_chat(user, "<span class='notice'>You need at least three rods to complete this task.</span>")
return
else if(istype(W, /obj/item/weapon/weldingtool))
else if(W.has_tool_quality(TOOL_WELDER))
if(buildstate == 1)
var/obj/item/weapon/weldingtool/T = W
var/obj/item/weapon/weldingtool/T = W.get_welder()
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 50, 1)
@@ -275,7 +275,7 @@
else
to_chat(user, "<span class='notice'>You need at least three plastic sheets to complete this task.</span>")
return
else if(W.is_screwdriver())
else if(W.has_tool_quality(TOOL_SCREWDRIVER))
if(buildstate == 5)
to_chat(user, "<span class='notice'>You secure the crossbow's various parts.</span>")
playsound(src, W.usesound, 50, 1)

View File

@@ -190,9 +190,9 @@
buildstate++
update_icon()
return
else if(istype(W,/obj/item/weapon/weldingtool))
else if(W.has_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/T = W.get_welder()
if(buildstate == 1)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 100, 1)
@@ -200,7 +200,6 @@
buildstate++
update_icon()
if(buildstate == 3)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 100, 1)
@@ -208,7 +207,6 @@
buildstate++
update_icon()
if(buildstate == 5)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 100, 1)

View File

@@ -88,7 +88,7 @@
. = ..()
update_rating_mod()
if(removable_components)
if(thing.is_crowbar())
if(thing.has_tool_quality(TOOL_CROWBAR))
if(!manipulator)
to_chat(user, "<span class='warning'>\The [src] has no manipulator installed.</span>")
return

View File

@@ -155,7 +155,7 @@
update_icon()
return
if(thing.is_screwdriver())
if(thing.has_tool_quality(TOOL_SCREWDRIVER))
if(!capacitor)
to_chat(user, "<span class='warning'>\The [src] has no capacitor installed.</span>")
return

View File

@@ -33,8 +33,8 @@
increment_construction_stage()
return
if(istype(thing, /obj/item/weapon/weldingtool) && construction_stage == 4)
var/obj/item/weapon/weldingtool/welder = thing
if(thing.has_tool_quality(TOOL_WELDER) && construction_stage == 4)
var/obj/item/weapon/weldingtool/welder = thing.get_welder()
if(!welder.isOn())
to_chat(user, "<span class='warning'>Turn it on first!</span>")
@@ -66,7 +66,7 @@
increment_construction_stage()
return
if(thing.is_screwdriver() && construction_stage >= 9)
if(thing.has_tool_quality(TOOL_SCREWDRIVER) && construction_stage >= 9)
user.visible_message("<b>\The [user]</b> secures \the [src] and finishes it off.")
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/item/weapon/gun/magnetic/coilgun = new(loc)

View File

@@ -51,12 +51,12 @@
FireModeModify()
/obj/item/weapon/gun/energy/modular/attackby(obj/item/O, mob/user)
if(O.is_screwdriver())
if(O.has_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, "<span class='notice'>You [assembled ? "disassemble" : "assemble"] the gun.</span>")
assembled = !assembled
playsound(src, O.usesound, 50, 1)
return
if(O.is_crowbar())
if(O.has_tool_quality(TOOL_CROWBAR))
if(assembled == 1)
to_chat(user, "<span class='warning'>Disassemble the [src] first!</span>")
return