Refactor reagent container + all subtypes to interaction chain 2 electric boogaloo (#92763)

This commit is contained in:
MrMelbert
2025-09-27 18:26:45 +00:00
committed by GitHub
parent ced3481146
commit 4684abceb0
40 changed files with 499 additions and 619 deletions
+15
View File
@@ -32,16 +32,31 @@
human.mind = new /datum/mind(null) // Add brain for the food buff
// It's a piece of cake to bake a pretty cake
var/sanity = 0
while(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/sugar) < sugar_required && beaker.reagents.total_volume < total_volume)
sugar_bag.melee_attack_chain(human, beaker)
sanity++
if(sanity > 50)
TEST_FAIL("Failed to add sugar to beaker!")
return
sanity = 0
while(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/flour) < flour_required && beaker.reagents.total_volume < total_volume)
flour_bag.melee_attack_chain(human, beaker)
sanity++
if(sanity > 50)
TEST_FAIL("Failed to add flour to beaker!")
return
sanity = 0
while((beaker.reagents.get_reagent_amount(/datum/reagent/consumable/eggyolk) < eggyolk_required \
|| beaker.reagents.get_reagent_amount(/datum/reagent/consumable/eggwhite) < eggwhite_required) \
&& beaker.reagents.total_volume < total_volume \
&& beaker.reagents.total_volume >= (sugar_required + flour_required)) // Make sure that we won't miss the reaction
var/obj/item/egg = egg_box.contents[1]
egg.melee_attack_chain(human, beaker, list(RIGHT_CLICK = TRUE))
sanity++
if(sanity > 50)
TEST_FAIL("Failed to add egg to beaker!")
return
var/obj/item/food/cake_batter = locate(/obj/item/food/cakebatter) in table_loc
TEST_ASSERT_NOTNULL(cake_batter, "Failed making cake batter!")
TEST_ASSERT_EQUAL(beaker.reagents.total_volume, 0, "Cake batter did not consume all beaker reagents!")
@@ -23,7 +23,7 @@
// INGEST
TEST_ASSERT_EQUAL(human.fire_stacks, 0, "Human has fire stacks before taking phlogiston")
drink.reagents.add_reagent(/datum/reagent/phlogiston, 10)
drink.attack(human, human)
drink.melee_attack_chain(human, human)
TEST_ASSERT_EQUAL(human.fire_stacks, 1, "Human does not have fire stacks after taking phlogiston")
human.Life(SSMOBS_DT)
TEST_ASSERT(human.fire_stacks > 1, "Human fire stacks did not increase after life tick")