Make more use of <tool>_act (#64375)

Replaces a bunch of tool behavior checks in attackby to instead use the respective procs.
For instance, the behavior under a if(I.tool_behaviour == TOOL_SCREWDRIVER) check in attackby() will instead be found under that same object's screwdriver_act() proc. This is the first of a few PRs that I'd like to make to address this, since there's going to be a lot of code shuffled around.

This shouldn't have any impact on players, though some super observant folks might notice that they don't bash some items with tools when they meant to interact with them. I've tested all of these in game and they seem to still have the same behavior as before.
This commit is contained in:
Luc
2022-01-25 15:17:30 +00:00
committed by GitHub
parent 4626105bf9
commit 4fd16bcbdb
29 changed files with 624 additions and 523 deletions
+13 -12
View File
@@ -59,20 +59,21 @@
return TRUE
return FALSE
/obj/item/inducer/screwdriver_act(mob/living/user, obj/item/tool)
. = TRUE
tool.play_tool_sound(src)
if(!opened)
to_chat(user, span_notice("You unscrew the battery compartment."))
opened = TRUE
update_appearance()
return
else
to_chat(user, span_notice("You close the battery compartment."))
opened = FALSE
update_appearance()
return
/obj/item/inducer/attackby(obj/item/W, mob/user)
if(W.tool_behaviour == TOOL_SCREWDRIVER)
W.play_tool_sound(src)
if(!opened)
to_chat(user, span_notice("You unscrew the battery compartment."))
opened = TRUE
update_appearance()
return
else
to_chat(user, span_notice("You close the battery compartment."))
opened = FALSE
update_appearance()
return
if(istype(W, /obj/item/stock_parts/cell))
if(opened)
if(!cell)