Re-refactors batons / Refactors attack chain force modifiers (#90809)

## About The Pull Request

Melee attack chain now has a list passed along with it,
`attack_modifiers`, which you can stick force modifiers to change the
resulting attack

This is basically a soft implementation of damage packets until a more
definitive pr, but one that only applies to item attack chain, and not
unarmed attacks.

This change was done to facilitate a baton refactor - batons no longer
hack together their own attack chain, and are now integrated straight
into the real attack chain. This refactor itself was done because batons
don't send any attack signals, which has been annoying in the past (for
swing combat).

## Changelog

🆑 Melbert
refactor: Batons have been refactored again. Baton stuns now properly
count as an attack, when before it was a nothing. Report any oddities,
particularly in regards to harmbatonning vs normal batonning.
refactor: The method of adjusting item damage mid-attack has been
refactored - some affected items include the Nullblade and knives.
Report any strange happenings with damage numbers.
refactor: A few objects have been moved to the new interaction chain -
records consoles, mawed crucible, alien weeds and space vines, hedges,
restaurant portals, and some mobs - to name a few.
fix: Spears only deal bonus damage against secure lockers, not all
closet types (including crates)
/🆑
This commit is contained in:
MrMelbert
2025-05-18 22:32:12 -05:00
committed by GitHub
parent 225300a189
commit 5261efb67f
483 changed files with 1088 additions and 1082 deletions
+1 -1
View File
@@ -113,7 +113,7 @@
return TRUE
. = ..()
/obj/item/clipboard/attackby(obj/item/weapon, mob/user, list/modifiers)
/obj/item/clipboard/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if(istype(weapon, /obj/item/paper))
//Add paper into the clipboard
if(!user.transferItemToLoc(weapon, src))
+1 -1
View File
@@ -57,7 +57,7 @@
/obj/structure/desk_bell/attack_paw(mob/user, list/modifiers)
return attack_hand(user, modifiers)
/obj/structure/desk_bell/attackby(obj/item/weapon, mob/living/user, list/modifiers)
/obj/structure/desk_bell/attackby(obj/item/weapon, mob/living/user, list/modifiers, list/attack_modifiers)
. = ..()
times_rang += weapon.force
ring_bell(user)
+1 -1
View File
@@ -184,7 +184,7 @@ GLOBAL_VAR_INIT(fax_autoprinting, FALSE)
fax_name = new_fax_name
return ITEM_INTERACT_SUCCESS
/obj/machinery/fax/attackby(obj/item/item, mob/user, list/modifiers)
/obj/machinery/fax/attackby(obj/item/item, mob/user, list/modifiers, list/attack_modifiers)
if (jammed && clear_jam(item, user))
return
if (panel_open)
+1 -1
View File
@@ -42,7 +42,7 @@
for(var/obj/item/obj in src)
obj.forceMove(loc)
/obj/structure/filingcabinet/attackby(obj/item/P, mob/living/user, list/modifiers)
/obj/structure/filingcabinet/attackby(obj/item/P, mob/living/user, list/modifiers, list/attack_modifiers)
if(P.tool_behaviour == TOOL_WRENCH && LAZYACCESS(modifiers, RIGHT_CLICK))
to_chat(user, span_notice("You begin to [anchored ? "unwrench" : "wrench"] [src]."))
if(P.use_tool(src, user, 20, volume=50))
+1 -1
View File
@@ -79,7 +79,7 @@
paper_overlay = contents[1].color_atom_overlay(paper_overlay)
return paper_overlay
/obj/item/folder/attackby(obj/item/weapon, mob/user, list/modifiers)
/obj/item/folder/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if(is_type_in_typecache(weapon, folder_insertables))
//Add paper, photo or documents into the folder
if(!user.transferItemToLoc(weapon, src))
+1 -1
View File
@@ -414,7 +414,7 @@
user.put_in_hands(new_plane)
return new_plane
/obj/item/paper/attackby(obj/item/attacking_item, mob/living/user, list/modifiers)
/obj/item/paper/attackby(obj/item/attacking_item, mob/living/user, list/modifiers, list/attack_modifiers)
// Enable picking paper up by clicking on it with the clipboard or folder
if(istype(attacking_item, /obj/item/clipboard) || istype(attacking_item, /obj/item/folder) || istype(attacking_item, /obj/item/paper_bin))
attacking_item.attackby(src, user)
+1 -1
View File
@@ -73,7 +73,7 @@
return ..()
/obj/item/folder/biscuit/attackby(obj/item/weapon, mob/user, list/modifiers)
/obj/item/folder/biscuit/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if (is_type_in_typecache(weapon, folder_insertables) && !crack_check(user))
return
+1 -1
View File
@@ -110,7 +110,7 @@
blade_secured = !blade_secured
return ITEM_INTERACT_SUCCESS
/obj/item/papercutter/attackby(obj/item/inserted_item, mob/user, list/modifiers)
/obj/item/papercutter/attackby(obj/item/inserted_item, mob/user, list/modifiers, list/attack_modifiers)
if(istype(inserted_item, /obj/item/paper))
if(is_type_in_list(inserted_item, list(
/obj/item/paper/fake_report,
+1 -1
View File
@@ -118,7 +118,7 @@
add_fingerprint(user)
return ..()
/obj/item/paper_bin/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/paper_bin/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(at_overlay_limit())
dump_contents(drop_location(), TRUE)
return
+1 -1
View File
@@ -80,7 +80,7 @@
user.put_in_hands(released_paper)
/obj/item/paperplane/attackby(obj/item/attacking_item, mob/user, list/modifiers)
/obj/item/paperplane/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
if(IS_WRITING_UTENSIL(attacking_item))
to_chat(user, span_warning("You should unfold [src] before changing it!"))
return
+2 -2
View File
@@ -39,7 +39,7 @@
detailed_desc = span_notice("<i>As you sift through the papers, you slowly start to piece together what you're reading.</i>")
/obj/item/paperwork/attackby(obj/item/attacking_item, mob/user, list/modifiers)
/obj/item/paperwork/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
. = ..()
if(.)
return
@@ -234,7 +234,7 @@
else
. += span_notice("These appear to just be a photocopy of the original documents.")
/obj/item/paperwork/photocopy/attackby(obj/item/attacking_item, mob/user, list/modifiers)
/obj/item/paperwork/photocopy/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
if(istype(attacking_item, /obj/item/stamp/void) && !stamped && !voided)
to_chat(user, span_notice("You plant the [attacking_item] firmly onto the front of the documents."))
stamp_overlay = mutable_appearance('icons/obj/service/bureaucracy.dmi', "paper_stamp-void")
+2 -2
View File
@@ -242,7 +242,7 @@
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
return CLICK_ACTION_SUCCESS
/obj/item/pen/attack(mob/living/M, mob/user, list/modifiers)
/obj/item/pen/attack(mob/living/M, mob/user, list/modifiers, list/attack_modifiers)
if(force) // If the pen has a force value, call the normal attack procs. Used for e-daggers and captain's pen mostly.
return ..()
if(!M.try_inject(user, injection_flags = INJECT_TRY_SHOW_ERROR_MESSAGE))
@@ -266,7 +266,7 @@
* Sleepypens
*/
/obj/item/pen/sleepy/attack(mob/living/M, mob/user, list/modifiers)
/obj/item/pen/sleepy/attack(mob/living/M, mob/user, list/modifiers, list/attack_modifiers)
. = ..()
if(!.)
return
+1 -1
View File
@@ -546,7 +546,7 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/machinery/photocopier/attackby(obj/item/object, mob/user, list/modifiers)
/obj/machinery/photocopier/attackby(obj/item/object, mob/user, list/modifiers, list/attack_modifiers)
if(istype(object, /obj/item/paper) || istype(object, /obj/item/photo) || istype(object, /obj/item/documents))
if(istype(object, /obj/item/paper))
var/obj/item/paper/paper = object
+1 -1
View File
@@ -177,7 +177,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/ticket_machine, 32)
maptext_x = 4
maptext = MAPTEXT(current_number) //Finally, apply the maptext
/obj/machinery/ticket_machine/attackby(obj/item/I, mob/user, list/modifiers)
/obj/machinery/ticket_machine/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
..()
if(istype(I, /obj/item/hand_labeler_refill))
if(!(ticket_number >= max_number))