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-19 13:32:12 +10:00
committed by GitHub
parent 225300a189
commit 5261efb67f
483 changed files with 1088 additions and 1082 deletions
@@ -75,7 +75,7 @@
return .
/obj/item/bee_smoker/attackby(obj/item/herb, mob/living/carbon/human/user, list/modifiers)
/obj/item/bee_smoker/attackby(obj/item/herb, mob/living/carbon/human/user, list/modifiers, list/attack_modifiers)
. = ..()
if(.)
return
@@ -145,7 +145,7 @@
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/structure/beebox/attackby(obj/item/item, mob/user, list/modifiers)
/obj/structure/beebox/attackby(obj/item/item, mob/user, list/modifiers, list/attack_modifiers)
if(istype(item, /obj/item/honey_frame))
var/obj/item/honey_frame/frame = item
if(honey_frames.len < BEEBOX_MAX_FRAMES)
+1 -1
View File
@@ -199,7 +199,7 @@
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/machinery/biogenerator/attackby(obj/item/attacking_item, mob/living/user, list/modifiers)
/obj/machinery/biogenerator/attackby(obj/item/attacking_item, mob/living/user, list/modifiers, list/attack_modifiers)
if(user.combat_mode)
return ..()
@@ -56,7 +56,7 @@
else
. += span_notice("It is currently closed, letting it ferment fruits or draw reagents from its tap.")
/obj/structure/fermenting_barrel/attackby(obj/item/object, mob/user, list/modifiers)
/obj/structure/fermenting_barrel/attackby(obj/item/object, mob/user, list/modifiers, list/attack_modifiers)
if(open)
if(istype(object, /obj/item/food/grown) && insert_fruit(user, object))
balloon_alert(user, "added fruit")
+1 -1
View File
@@ -47,7 +47,7 @@
throw_range = 7
grind_results = list(/datum/reagent/cellulose = 10) //really partially hemicellulose
/obj/item/grown/corncob/attackby(obj/item/grown/W, mob/user, list/modifiers)
/obj/item/grown/corncob/attackby(obj/item/grown/W, mob/user, list/modifiers, list/attack_modifiers)
if(W.get_sharpness())
to_chat(user, span_notice("You use [W] to fashion a pipe out of the corn cob!"))
new /obj/item/cigarette/pipe/cobpipe (user.loc)
+9 -8
View File
@@ -46,14 +46,15 @@
opacity = FALSE
max_integrity = 80
/obj/structure/hedge/attacked_by(obj/item/I, mob/living/user)
if(opacity && HAS_TRAIT(user, TRAIT_BONSAI) && I.get_sharpness())
to_chat(user,span_notice("You start trimming \the [src]."))
if(do_after(user, 3 SECONDS,target=src))
to_chat(user,span_notice("You finish trimming \the [src]."))
opacity = FALSE
else
return ..()
/obj/structure/hedge/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(!opacity || !HAS_TRAIT(user, TRAIT_BONSAI) || !tool.get_sharpness())
return NONE
balloon_alert(user, "trimming...")
if(!do_after(user, 3 SECONDS, target=src))
return ITEM_INTERACT_BLOCKING
opacity = FALSE
return ITEM_INTERACT_SUCCESS
/**
* useful for mazes and such
*/
+3 -3
View File
@@ -40,7 +40,7 @@
/obj/item/food/grown/watermelon/make_dryable()
return //No drying
/obj/item/food/grown/watermelon/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/watermelon/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(I, /obj/item/kitchen/spoon))
return ..()
@@ -110,7 +110,7 @@
AddComponentFrom(SOURCE_EDIBLE_INNATE, /datum/component/edible, check_liked = CALLBACK(src, PROC_REF(check_holyness)))
/obj/item/food/grown/holymelon/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/holymelon/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(I, /obj/item/kitchen/spoon))
return ..()
@@ -183,7 +183,7 @@
/obj/item/food/grown/barrelmelon/make_processable()
AddElement(/datum/element/processable, TOOL_KNIFE, /obj/item/food/barrelmelonslice, 5, 20, screentip_verb = "Chop")
/obj/item/food/grown/barrelmelon/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/barrelmelon/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(I, /obj/item/kitchen/spoon))
return ..()
+1 -1
View File
@@ -197,7 +197,7 @@
desc = "<I>Cantharellus Cibarius</I>: These jolly yellow little shrooms sure look tasty!"
icon_state = "chanterelle"
/obj/item/food/grown/mushroom/chanterelle/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/mushroom/chanterelle/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(I, /obj/item/kitchen/spoon))
return ..()
if(seed.potency < 95)
+1 -1
View File
@@ -37,7 +37,7 @@
icon_state = "potato_wedges"
bite_consumption_mod = 100
/obj/item/food/grown/potato/attackby(obj/item/W, mob/user, list/modifiers)
/obj/item/food/grown/potato/attackby(obj/item/W, mob/user, list/modifiers, list/attack_modifiers)
if(W.get_sharpness())
to_chat(user, span_notice("You cut the potato into wedges with [W]."))
var/obj/item/food/grown/potato/wedges/Wedges = new /obj/item/food/grown/potato/wedges
+1 -1
View File
@@ -29,7 +29,7 @@
///Which type of lantern this gourd produces when carved.
var/carved_type = /obj/item/clothing/head/utility/hardhat/pumpkinhead
/obj/item/food/grown/pumpkin/attackby(obj/item/W as obj, mob/user as mob, list/modifiers)
/obj/item/food/grown/pumpkin/attackby(obj/item/W as obj, mob/user as mob, list/modifiers, list/attack_modifiers)
if(W.get_sharpness())
user.show_message(span_notice("You carve a face into [src]!"), MSG_VISUAL)
new carved_type(user.loc)
+3 -3
View File
@@ -25,7 +25,7 @@
juice_typepath = /datum/reagent/consumable/carrotjuice
wine_power = 30
/obj/item/food/grown/carrot/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/carrot/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!I.get_sharpness())
return ..()
@@ -64,7 +64,7 @@
juice_typepath = /datum/reagent/consumable/parsnipjuice
wine_power = 35
/obj/item/food/grown/parsnip/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/parsnip/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!I.get_sharpness())
return ..()
@@ -110,7 +110,7 @@
tastes = list("sweet dirt" = 1)
distill_reagent = /datum/reagent/consumable/rootbeer
/obj/item/food/grown/cahnroot/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/food/grown/cahnroot/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!I.get_sharpness())
return ..()
+1 -1
View File
@@ -78,7 +78,7 @@
return NONE
/obj/item/grown/log/attackby(obj/item/attacking_item, mob/user, list/modifiers)
/obj/item/grown/log/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
if(attacking_item.get_sharpness())
var/plank_count = 1
if(seed)
+1 -1
View File
@@ -188,7 +188,7 @@
playsound(src, SFX_DESECRATION ,50, TRUE, -1)
return BRUTELOSS
/obj/item/scythe/pre_attack(atom/target, mob/living/user, list/modifiers)
/obj/item/scythe/pre_attack(atom/target, mob/living/user, list/modifiers, list/attack_modifiers)
if(!istype(target, /obj/structure/alien/resin/flower_bud) && !istype(target, /obj/structure/spacevine))
return ..()
if(swiping || get_turf(target) == get_turf(user))
+4 -4
View File
@@ -225,7 +225,7 @@
QDEL_NULL(our_snail)
/obj/machinery/hydroponics/constructable/attackby(obj/item/I, mob/living/user, list/modifiers)
/obj/machinery/hydroponics/constructable/attackby(obj/item/I, mob/living/user, list/modifiers, list/attack_modifiers)
if (!user.combat_mode)
// handle opening the panel
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
@@ -865,7 +865,7 @@
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, list/modifiers)
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, list/modifiers, list/attack_modifiers)
//Called when mob user "attacks" it with object O
if(IS_EDIBLE(O) || is_reagent_container(O)) // Syringe stuff (and other reagent containers now too)
var/obj/item/reagent_containers/reagent_source = O
@@ -1085,7 +1085,7 @@
else
return ..()
/obj/machinery/hydroponics/attackby_secondary(obj/item/weapon, mob/user, list/modifiers)
/obj/machinery/hydroponics/attackby_secondary(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if (istype(weapon, /obj/item/reagent_containers/syringe))
to_chat(user, span_warning("You can't get any extract out of this plant."))
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
@@ -1209,7 +1209,7 @@
/obj/machinery/hydroponics/soil/update_status_light_overlays()
return // Has no lights
/obj/machinery/hydroponics/soil/attackby_secondary(obj/item/weapon, mob/user, list/modifiers)
/obj/machinery/hydroponics/soil/attackby_secondary(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if(weapon.tool_behaviour != TOOL_SHOVEL) //Spades can still uproot plants on left click
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
balloon_alert(user, "clearing up soil...")
+1 -1
View File
@@ -93,7 +93,7 @@
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/machinery/seed_extractor/attackby(obj/item/attacking_item, mob/living/user, list/modifiers)
/obj/machinery/seed_extractor/attackby(obj/item/attacking_item, mob/living/user, list/modifiers, list/attack_modifiers)
if(!isliving(user) || user.combat_mode)
return ..()
+1 -1
View File
@@ -463,7 +463,7 @@
/obj/item/seeds/proc/on_chem_reaction(datum/reagents/reagents)
return
/obj/item/seeds/attackby(obj/item/O, mob/user, list/modifiers)
/obj/item/seeds/attackby(obj/item/O, mob/user, list/modifiers, list/attack_modifiers)
if(IS_WRITING_UTENSIL(O))
var/choice = tgui_input_list(usr, "What would you like to change?", "Seed Alteration", list("Plant Name", "Seed Description", "Product Description"))
if(isnull(choice))