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
@@ -100,7 +100,7 @@
for(var/obj/item/crusher_trophy/crusher_trophy as anything in trophies)
. += span_notice("It has \a [crusher_trophy] attached, which causes [crusher_trophy.effect_desc()].")
/obj/item/kinetic_crusher/attackby(obj/item/attacking_item, mob/user, list/modifiers)
/obj/item/kinetic_crusher/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
if(istype(attacking_item, /obj/item/crusher_trophy))
var/obj/item/crusher_trophy/crusher_trophy = attacking_item
crusher_trophy.add_to(src, user)
@@ -158,7 +158,7 @@
return FALSE
return TRUE
/obj/item/kinetic_crusher/pre_attack(atom/A, mob/living/user, list/modifiers)
/obj/item/kinetic_crusher/pre_attack(atom/A, mob/living/user, list/modifiers, list/attack_modifiers)
. = ..()
if(.)
return TRUE
@@ -171,7 +171,7 @@
target.apply_status_effect(/datum/status_effect/crusher_damage)
return ..()
/obj/item/kinetic_crusher/afterattack(mob/living/target, mob/living/user, list/modifiers)
/obj/item/kinetic_crusher/afterattack(mob/living/target, mob/living/user, list/modifiers, list/attack_modifiers)
if(!isliving(target))
return
// Melee effect
@@ -346,4 +346,3 @@
used_crusher.attempt_recharge_projectile(used_crusher.charge_time * skill_modifier) //If you hit a mineral, you might get a quicker reload. epic gamer style.
return ..()
@@ -134,7 +134,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, sort_list(list(
/obj/structure/marker_beacon/attack_tk(mob/user)
return
/obj/structure/marker_beacon/attackby(obj/item/I, mob/user, list/modifiers)
/obj/structure/marker_beacon/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(istype(I, /obj/item/stack/marker_beacon))
var/obj/item/stack/marker_beacon/M = I
to_chat(user, span_notice("You start picking [src] up..."))
+1 -1
View File
@@ -43,7 +43,7 @@
new /obj/effect/temp_visual/resonance(target_turf, user, src, mode, adding_failure)
user.changeNext_move(CLICK_CD_MELEE)
/obj/item/resonator/pre_attack(atom/target, mob/user, list/modifiers)
/obj/item/resonator/pre_attack(atom/target, mob/user, list/modifiers, list/attack_modifiers)
if(check_allowed_items(target, not_inside = TRUE))
create_resonance(target, user)
return ..()
@@ -213,7 +213,7 @@
return
user.examinate(src)
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/weapon, mob/user, list/modifiers)
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(weapon, /obj/item/card/id/advanced/prisoner))
return ..()
var/obj/item/card/id/advanced/prisoner/prisoner_id = weapon
@@ -99,7 +99,7 @@
if(isturf(loc))
qdel(src)
/obj/item/cursed_katana/attack(mob/living/target, mob/user, list/modifiers)
/obj/item/cursed_katana/attack(mob/living/target, mob/user, list/modifiers, list/attack_modifiers)
if(target.stat < DEAD && target != user)
drew_blood = TRUE
if(ismining(target))
@@ -63,23 +63,17 @@
if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
user.changeNext_move(CLICK_CD_MELEE * 0.5) //when closed, it attacks very rapidly
/obj/item/melee/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user)
/obj/item/melee/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user, list/modifiers, list/attack_modifiers)
var/is_open = HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)
if(!is_open || swiping || !target.density || get_turf(target) == get_turf(user))
if(!is_open)
faction_bonus_force = 0
var/is_nemesis_faction = FALSE
for(var/found_faction in target.faction)
if(found_faction in nemesis_factions)
is_nemesis_faction = TRUE
force += faction_bonus_force
nemesis_effects(user, target)
break
if(!(found_faction in nemesis_factions))
continue
if(is_open)
MODIFY_ATTACK_FORCE(attack_modifiers, faction_bonus_force)
nemesis_effects(user, target)
break
. = ..()
if(is_nemesis_faction)
force -= faction_bonus_force
if(!is_open)
faction_bonus_force = initial(faction_bonus_force)
return
var/turf/user_turf = get_turf(user)
@@ -172,7 +172,7 @@
. = ..()
. += soul.ckey ? span_nicegreen("There is a soul inhabiting it.") : span_danger("It's dormant.")
/obj/item/soulscythe/attack(mob/living/attacked, mob/living/user, list/modifiers)
/obj/item/soulscythe/attack(mob/living/attacked, mob/living/user, list/modifiers, list/attack_modifiers)
. = ..()
if(attacked.stat != DEAD)
give_blood(10)
@@ -123,7 +123,7 @@
return
ActivationReaction(user, ACTIVATE_TOUCH)
/obj/machinery/anomalous_crystal/attackby(obj/item/I, mob/user, list/modifiers)
/obj/machinery/anomalous_crystal/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(I.get_temperature())
ActivationReaction(user, ACTIVATE_HEAT)
else
@@ -67,7 +67,7 @@
/obj/item/storm_staff/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
return thunder_blast(interacting_with, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
/obj/item/storm_staff/afterattack(atom/target, mob/user, list/modifiers)
/obj/item/storm_staff/afterattack(atom/target, mob/user, list/modifiers, list/attack_modifiers)
thunder_blast(target, user)
/obj/item/storm_staff/proc/thunder_blast(atom/target, mob/user)
@@ -16,7 +16,7 @@
/// var to check if it got opened by a key
var/spawned_loot = FALSE
/obj/structure/closet/crate/necropolis/tendril/attackby(obj/item/item, mob/user, list/modifiers)
/obj/structure/closet/crate/necropolis/tendril/attackby(obj/item/item, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(item, /obj/item/skeleton_key) || spawned_loot)
return ..()
var/loot = rand(1,21)
+2 -2
View File
@@ -280,7 +280,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/gibtonite/IsSpecialAssembly()
return TRUE
/obj/item/gibtonite/attackby(obj/item/I, mob/user, list/modifiers)
/obj/item/gibtonite/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(istype(I, /obj/item/assembly_holder) && !rig)
var/obj/item/assembly_holder/holder = I
if(!(locate(/obj/item/assembly/igniter) in holder.assemblies))
@@ -472,7 +472,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
. = ..()
. += span_info("It's worth [value] credit\s.")
/obj/item/coin/attackby(obj/item/W, mob/user, list/modifiers)
/obj/item/coin/attackby(obj/item/W, mob/user, list/modifiers, list/attack_modifiers)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(string_attached)
+1 -1
View File
@@ -55,7 +55,7 @@
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS
/obj/structure/ore_box/attackby(obj/item/weapon, mob/user, list/modifiers)
/obj/structure/ore_box/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
if(istype(weapon, /obj/item/stack/ore) || istype(weapon, /obj/item/boulder))
user.transferItemToLoc(weapon, src)
return TRUE