attack chain migration: reagent containers (#28699)

* migrate reagent_containers.dm

* applicator migration + game test

* borg hypo migration

* condiment migration + game test

* fixed and expanded applicator game test, helper proc for puppet activate_self

* expanded condiment game test, added negative any_chatlog define

* drinks_base.dm migration

* bottle.dm migrated

* molotov migrated

* cans migrated

* drinking glass migrated

* shot glass migration

* bottles suck

* some fixes

* more bottle.dm

* bottles finally behave

* bottle fixed, shotglass fixed, everfull migrated

* bottle tests

* cyborg trashbag can crush autopickup is broken

* fixed cans insertion into backpacks

* added zone targeting to puppet

* more tests for drinks

* dropper migration

* dropper finished, removed a repeated proc

* smol tweak

* glass containers

* glass containers finished

* fixed can and bottle tests

* molotov test

* drinking glass and started shot glass

* fixed puppet activate_self + done with drinkingglass

* med containers, shuffle tests around a tiny bit

* fix autoinjectors

* remove return value from spawn block

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: Toastical <toast@toaster.com>
Co-authored-by: Toastical <toastical@toaster.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
warriorstar-orion
2025-03-21 20:42:24 +00:00
committed by GitHub
co-authored by Burzah Toastical Toastical
parent 1df64695d1
commit 7eb404f562
30 changed files with 596 additions and 323 deletions
@@ -31,7 +31,8 @@
icon_state = "borg-spray-smoke"
list_reagents = list("water" = 50)
/obj/item/reagent_containers/spray/alien/smoke/afterattack__legacy__attackchain(atom/A as mob|obj, mob/user as mob)
/obj/item/reagent_containers/spray/alient/normal_act(atom/A, mob/living/user)
. = TRUE
if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1)
if(!A.reagents.total_volume && A.reagents)
to_chat(user, "<span class='notice'>\The [A] is empty.</span>")
@@ -16,16 +16,15 @@
container_type = OPENCONTAINER
blocks_emissive = EMISSIVE_BLOCK_GENERIC
/obj/item/reagent_containers/glass/paint/afterattack__legacy__attackchain(turf/simulated/target, mob/user, proximity)
if(!proximity)
return
/obj/item/reagent_containers/glass/paint/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(!is_open_container())
return
return ITEM_INTERACT_COMPLETE
if(istype(target) && reagents.total_volume >= 5)
user.visible_message("<span class='warning'>[target] has been splashed with something by [user]!</span>")
spawn(5)
reagents.reaction(target, REAGENT_TOUCH)
reagents.remove_any(5)
return ITEM_INTERACT_COMPLETE
else
return ..()
@@ -308,7 +308,7 @@
return
applying_meds = TRUE
for(var/obj/item/reagent_containers/P in contents)
if(P.attack__legacy__attackchain(M, user))
if(P.mob_act(M, user))
applying_meds = FALSE
else
applying_meds = FALSE
@@ -357,7 +357,7 @@
C.visible_message("<span class='danger'>[C] [rapid_intake_message]</span>")
if(do_mob(C, C, 100)) // 10 seconds
for(var/obj/item/reagent_containers/pill/P in contents)
P.attack__legacy__attackchain(C, C)
P.interact_with_atom(C, C)
C.visible_message("<span class='danger'>[C] [rapid_post_instake_message]</span>")
return
@@ -125,6 +125,7 @@
return INITIALIZE_HINT_QDEL
tank = loc
reagents = tank.reagents //This mister is really just a proxy for the tank's reagents
RegisterSignal(src, COMSIG_ACTIVATE_SELF, TYPE_PROC_REF(/datum, signal_cancel_activate_self))
return ..()
/obj/item/reagent_containers/spray/mister/Destroy()
@@ -138,9 +139,6 @@
tank.on = FALSE
loc = tank
/obj/item/reagent_containers/spray/mister/attack_self__legacy__attackchain()
return
/proc/check_tank_exists(parent_tank, mob/living/carbon/human/M, obj/O)
if(!parent_tank || (!istype(parent_tank, /obj/item/watertank) && !istype(parent_tank, /obj/item/mod/module/firefighting_tank))) //To avoid weird issues from admin spawns
return FALSE
@@ -152,10 +150,11 @@
if(loc != tank.loc)
loc = tank.loc
/obj/item/reagent_containers/spray/mister/afterattack__legacy__attackchain(obj/target, mob/user, proximity)
if(target.loc == loc || target == tank) //Safety check so you don't fill your mister with mutagen or something and then blast yourself in the face with it putting it away
return
..()
/obj/item/reagent_containers/spray/mister/normal_act(atom/target, mob/living/user)
if(target.loc == loc || target == tank)
return FALSE
return ..()
//Janitor tank
/obj/item/watertank/janitor
@@ -182,7 +181,10 @@
/obj/item/watertank/janitor/make_noz()
return new /obj/item/reagent_containers/spray/mister/janitor(src)
/obj/item/reagent_containers/spray/mister/janitor/attack_self__legacy__attackchain(mob/user)
/obj/item/reagent_containers/spray/mister/janitor/activate_self(mob/user)
if(..())
return FINISH_ATTACK
amount_per_transfer_from_this = (amount_per_transfer_from_this == 5 ? 10 : 5)
spray_currentrange = (spray_currentrange == 2 ? spray_maxrange : 2)
to_chat(user, "<span class='notice'>You [amount_per_transfer_from_this == 5 ? "remove" : "fix"] the nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>")