You can now interact with held mobs beside wearing them (feat: "minor" melee attack chain cleanup) (#90080)

## About The Pull Request
People can now pet held mothroaches and pugs if they want to, or use
items on them, hopefully without causing many issues. After all, it only
took about a couple dozen lines of code to make...

...Oh, did the 527 files changed or the 850~ lines added/removed perhaps
catch your eye? Made you wonder if I accidentally pushed the wrong
branch? or skewed something up big time? Well, nuh uh. I just happen to
be fed up with the melee attack chain still using stringized params
instead of an array/list. It was frankly revolting to see how I'd have
had to otherwise call `list2params` for what I'm trying to accomplish
here, and make this PR another tessera to the immense stupidity of our
attack chain procs calling `params2list` over and over and over instead
of just using that one call instance from `ClickOn` as an argument. It's
2025, honey, wake up!

I also tried to replace some of those single letter vars/args but there
are just way too many of them.

## Why It's Good For The Game
Improving old code. And I want to be able to pet mobroaches while
holding them too.

## Changelog

🆑
qol: You can now interact with held mobs in more ways beside wearing
them.
/🆑
This commit is contained in:
Ghom
2025-04-23 20:18:26 +00:00
committed by GitHub
parent f7a908db78
commit 339616ae78
519 changed files with 823 additions and 836 deletions

View File

@@ -129,7 +129,7 @@
if(!loaded_projectile)
loaded_projectile = new projectile_type(src, src)
/obj/item/ammo_casing/attackby(obj/item/I, mob/user, params)
/obj/item/ammo_casing/attackby(obj/item/I, mob/user, list/modifiers)
if(istype(I, /obj/item/ammo_box))
var/obj/item/ammo_box/box = I
if(isturf(loc))

View File

@@ -43,7 +43,7 @@
[length(type_initial_names) ? ", such as [english_list(type_initial_names, and_text = "or ", final_comma_text = ", ")]" : ""].")
/obj/item/ammo_casing/foam_dart/attackby(obj/item/attacking_item, mob/user, params)
/obj/item/ammo_casing/foam_dart/attackby(obj/item/attacking_item, mob/user, list/modifiers)
if (attacking_item.tool_behaviour != TOOL_SCREWDRIVER || modified)
return ..()

View File

@@ -312,7 +312,7 @@
return
..()
/obj/item/gun/ballistic/automatic/l6_saw/attackby(obj/item/A, mob/user, params)
/obj/item/gun/ballistic/automatic/l6_saw/attackby(obj/item/A, mob/user, list/modifiers)
if(!cover_open && istype(A, accepted_magazine_type))
balloon_alert(user, "open the cover!")
return

View File

@@ -15,7 +15,7 @@
/obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted
pin = /obj/item/firing_pin
/obj/item/gun/ballistic/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
/obj/item/gun/ballistic/revolver/grenadelauncher/attackby(obj/item/A, mob/user, list/modifiers)
..()
if(istype(A, /obj/item/ammo_box) || isammocasing(A))
chamber_round()

View File

@@ -92,7 +92,7 @@
return underbarrel.try_fire_gun(target, user, params)
return ..()
/obj/item/gun/ballistic/automatic/pistol/clandestine/fisher/afterattack(atom/target, mob/user, click_parameters)
/obj/item/gun/ballistic/automatic/pistol/clandestine/fisher/afterattack(atom/target, mob/user, list/modifiers)
var/obj/projectile/energy/fisher/melee/simulated_hit = new
simulated_hit.firer = user
simulated_hit.on_hit(target)

View File

@@ -165,7 +165,7 @@
setting_overlay = mutable_appearance(icon,setting_iconstate())
add_overlay(setting_overlay)
/obj/item/gun/energy/dueling/attackby(obj/item/W, mob/user, params)
/obj/item/gun/energy/dueling/attackby(obj/item/W, mob/user, list/modifiers)
if(istype(W, /obj/item/gun/energy/dueling))
var/obj/item/gun/energy/dueling/other_gun = W

View File

@@ -53,7 +53,7 @@
else
..()
/obj/item/minigunpack/attackby(obj/item/W, mob/user, params)
/obj/item/minigunpack/attackby(obj/item/W, mob/user, list/modifiers)
if(W == gun) //Don't need armed check, because if you have the gun assume its armed.
user.dropItemToGround(gun, TRUE)
else

View File

@@ -156,7 +156,7 @@
While some would argue that this is a really terrible design choice, others argue that it is very funny to be able to shoot at light sources.<br>\
Caveat emptor.")
/obj/item/gun/energy/recharge/fisher/attack(mob/living/target_mob, mob/living/user, params)
/obj/item/gun/energy/recharge/fisher/attack(mob/living/target_mob, mob/living/user, list/modifiers)
. = ..()
if(.)
return

View File

@@ -24,7 +24,7 @@
max_grenades = reset_fantasy_variable("max_syringes", max_grenades)
return ..()
/obj/item/gun/grenadelauncher/attackby(obj/item/I, mob/user, params)
/obj/item/gun/grenadelauncher/attackby(obj/item/I, mob/user, list/modifiers)
if(istype(I, /obj/item/grenade/c4))
return

View File

@@ -75,7 +75,7 @@
return ITEM_INTERACT_SUCCESS
// If we botch a shot, we have to start over again by inserting gold coins into the gun. Can only be done if it has no charges or gold.
/obj/item/gun/magic/midas_hand/attackby(obj/item/I, mob/living/user, params)
/obj/item/gun/magic/midas_hand/attackby(obj/item/I, mob/living/user, list/modifiers)
. = ..()
if(charges || gold_timer)
balloon_alert(user, "already loaded")

View File

@@ -259,7 +259,7 @@
gun.desc = gun::desc
..()
/obj/item/firing_pin/paywall/attackby(obj/item/M, mob/living/user, params)
/obj/item/firing_pin/paywall/attackby(obj/item/M, mob/living/user, list/modifiers)
if(isidcard(M))
var/obj/item/card/id/id = M
if(!id.registered_account)