[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

@@ -273,7 +273,7 @@
visible_message("<b>\The [user]</b> waves \the [src] around [target].")
/obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user)
if(can_anchor && I.is_wrench())
if(can_anchor && I.has_tool_quality(TOOL_WRENCH))
anchored = !anchored
to_chat(user, span("notice", "You've [anchored ? "" : "un"]secured \the [src] to \the [get_turf(src)]."))
if(anchored)
@@ -292,14 +292,14 @@
tgui_interact(user)
return TRUE
else if(I.is_crowbar())
else if(I.has_tool_quality(TOOL_CROWBAR))
playsound(src, 'sound/items/Crowbar.ogg', 50, 1)
opened = !opened
to_chat(user, "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>")
update_icon()
return TRUE
else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.is_screwdriver())
else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.has_tool_quality(TOOL_SCREWDRIVER))
if(opened)
tgui_interact(user)
return TRUE
@@ -399,4 +399,4 @@
// Returns TRUE if I is something that could/should have a valid interaction. Used to tell circuitclothes to hit the circuit with something instead of the clothes
/obj/item/device/electronic_assembly/proc/is_valid_tool(var/obj/item/I)
return I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics)
return I.has_tool_quality(TOOL_CROWBAR) || I.has_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics)

View File

@@ -12,7 +12,7 @@
..()
/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob)
if (I.is_crowbar())
if (I.has_tool_quality(TOOL_CROWBAR))
toggle_open(user)
else if (opened)
EA.attackby(I, user)

View File

@@ -277,7 +277,6 @@
/obj/item/device/integrated_electronics/debugger, //CHOMP Edit,
/obj/item/device/integrated_electronics/detailer, //CHOMP Edit,
)
cant_hold = list(/obj/item/weapon/tool/screwdriver/power)
//CHOMPAdd, this whole proc. Emp'ing this one bag causes a recursion loop of over 700 emp_act's,
//Which is enough to trigger byond's recursion level protection