Attack chain refactoring: Broadening tool_act into item_interact, moving some item interactions to... atom/item_interact / item/interact_with_atom (#79968)

## About The Pull Request

Implements half of this (with some minor changes): 


![image](https://github.com/tgstation/tgstation/assets/51863163/bf5cc4bb-5a1f-42e3-921d-9a57bc6096cc)

The ultimate goal of this is to split our attack chain in two: 
- One for non-combat item interactions
  - Health analyzer scanning
  - using tools on stuff
  - surgery
  - Niche other interactions
- One for combat attacking
  - Item hit thing, item deal damage. 
  - Special effects on attack would go here.  

This PR begins this by broadining tool act into item interact. 

Item interact is a catch-all proc ran at the beginning of attack chain,
before `pre_attack` and such, that handles the first part of the chain.

This allows us to easily catch item interaction and cancel the attack
part of the chain by using deliberate bitflag return values, rather than
`TRUE` / `FALSE`*.

*Because right now, `TRUE` = `cancel attack`, no matter what, which is
unclear to people.

Instead of moving as much as possible to the new proc in this PR, I
started by doing some easy, obvious things. More things can be moved in
the future, or technically they don't even need to move in a lot of
cases.

## Changelog

🆑 Melbert
refactor: Refactored some methods of items interacting with other
objects or mobs, such as surgery and health analzyers. Report if
anything seems wrong
/🆑
This commit is contained in:
MrMelbert
2023-12-09 00:50:19 -06:00
committed by GitHub
parent 65a30878cb
commit 1e76fd70b4
153 changed files with 710 additions and 609 deletions
+5 -5
View File
@@ -111,24 +111,24 @@
/obj/machinery/netpod/crowbar_act(mob/living/user, obj/item/tool)
if(user.combat_mode)
attack_hand(user)
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
if(default_pry_open(tool, user) || default_deconstruction_crowbar(tool))
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
/obj/machinery/netpod/screwdriver_act(mob/living/user, obj/item/tool)
if(occupant)
balloon_alert(user, "in use!")
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
if(state_open)
balloon_alert(user, "close first.")
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
if(default_deconstruction_screwdriver(user, "[base_icon_state]_panel", "[base_icon_state]_closed", tool))
update_appearance() // sometimes icon doesnt properly update during flick()
ui_close(user)
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
/obj/machinery/netpod/attack_hand(mob/living/user, list/modifiers)
. = ..()