From 48eddea2a2b6cf807dffaef543004d35bcf5efa2 Mon Sep 17 00:00:00 2001 From: Ryou Date: Mon, 20 May 2024 11:15:32 +0200 Subject: [PATCH 1/4] The ant goes IN the food --- code/modules/chemistry/tools/food_and_drink.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/chemistry/tools/food_and_drink.dm b/code/modules/chemistry/tools/food_and_drink.dm index 917b19a14e2be..5fb7a24f693bb 100644 --- a/code/modules/chemistry/tools/food_and_drink.dm +++ b/code/modules/chemistry/tools/food_and_drink.dm @@ -40,13 +40,15 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food) owner.organHolder.stomach.eject(src) qdel(src) - proc/on_table() + proc/ant_safe() if (!isturf(src.loc)) return FALSE if (locate(/obj/table) in src.loc) // locate is faster than typechecking each movable return TRUE if (locate(/obj/surgery_tray) in src.loc) // includes kitchen islands return TRUE + if (locate(/obj/storage/secure/closet/fridge) in src.loc) // includes fridges + return TRUE return FALSE proc/get_food_color() @@ -186,12 +188,13 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks) process() if (world.time - create_time >= 3 MINUTES) create_time = world.time - if (!src.disposed && isturf(src.loc) && !on_table()) + if (!src.disposed && isturf(src.loc) && !ant_safe()) if (prob(50)) made_ants = 1 processing_items -= src if (!(locate(/obj/reagent_dispensers/cleanable/ants) in src.loc)) new/obj/reagent_dispensers/cleanable/ants(src.loc) + src.reagents.add_reagent("ants", 5) attackby(obj/item/W, mob/user) From a4df6b2b9e8bf5a0bdf4975538bd7bb089499ef3 Mon Sep 17 00:00:00 2001 From: Ryou Date: Mon, 20 May 2024 17:40:58 +0200 Subject: [PATCH 2/4] Add prefix to food --- code/modules/chemistry/tools/food_and_drink.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/chemistry/tools/food_and_drink.dm b/code/modules/chemistry/tools/food_and_drink.dm index 5fb7a24f693bb..bd387239a70fe 100644 --- a/code/modules/chemistry/tools/food_and_drink.dm +++ b/code/modules/chemistry/tools/food_and_drink.dm @@ -195,6 +195,7 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks) if (!(locate(/obj/reagent_dispensers/cleanable/ants) in src.loc)) new/obj/reagent_dispensers/cleanable/ants(src.loc) src.reagents.add_reagent("ants", 5) + src.name = "[name_prefix("Ant-covered", 1)][src.name][name_suffix(null, 1)]" attackby(obj/item/W, mob/user) From 89a5dc69b0f14497eb9b1c53933dc7fa7ed94f49 Mon Sep 17 00:00:00 2001 From: Ryou Date: Sun, 26 May 2024 11:52:37 +0200 Subject: [PATCH 3/4] Ants to ants --- code/modules/chemistry/tools/food_and_drink.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/chemistry/tools/food_and_drink.dm b/code/modules/chemistry/tools/food_and_drink.dm index bd387239a70fe..257070125e572 100644 --- a/code/modules/chemistry/tools/food_and_drink.dm +++ b/code/modules/chemistry/tools/food_and_drink.dm @@ -195,7 +195,7 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks) if (!(locate(/obj/reagent_dispensers/cleanable/ants) in src.loc)) new/obj/reagent_dispensers/cleanable/ants(src.loc) src.reagents.add_reagent("ants", 5) - src.name = "[name_prefix("Ant-covered", 1)][src.name][name_suffix(null, 1)]" + src.name = "[name_prefix("ant-covered", 1)][src.name][name_suffix(null, 1)]" attackby(obj/item/W, mob/user) From f6a30dfcbe2151d384f02441ee6d5ddb026d6e03 Mon Sep 17 00:00:00 2001 From: Ryou Date: Tue, 28 May 2024 09:53:37 +0200 Subject: [PATCH 4/4] Remove reagents equal to ants added --- code/modules/chemistry/tools/food_and_drink.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/chemistry/tools/food_and_drink.dm b/code/modules/chemistry/tools/food_and_drink.dm index 257070125e572..947e1e6d396c3 100644 --- a/code/modules/chemistry/tools/food_and_drink.dm +++ b/code/modules/chemistry/tools/food_and_drink.dm @@ -16,6 +16,7 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food) var/from_emagged_oven = 0 //! Was this food created by an emagged oven? To prevent re-rolling of food in emagged ovens. var/doants = TRUE //! Will ants spawn to eat this food if it's on the floor var/tmp/made_ants = FALSE //! Has this food already spawned ants + var/ant_amnt = 5 //! How many ants are added to food / how much reagents removed? var/sliceable = FALSE //! Can this food be sliced with a knife var/slice_product = null //! Type to spawn when we slice this food var/slice_amount = 1 //! How many slices to spawn after slicing @@ -188,13 +189,14 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks) process() if (world.time - create_time >= 3 MINUTES) create_time = world.time - if (!src.disposed && isturf(src.loc) && !ant_safe()) + if (!src.disposed && isturf(src.loc) && !src.ant_safe()) if (prob(50)) - made_ants = 1 + src.made_ants = 1 processing_items -= src if (!(locate(/obj/reagent_dispensers/cleanable/ants) in src.loc)) new/obj/reagent_dispensers/cleanable/ants(src.loc) - src.reagents.add_reagent("ants", 5) + src.reagents.remove_any(src.ant_amnt) + src.reagents.add_reagent("ants", src.ant_amnt) src.name = "[name_prefix("ant-covered", 1)][src.name][name_suffix(null, 1)]"