mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user