Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds "ants" reagent to foods that have spawned ants & makes fridges ant-safe #19049

Merged
merged 5 commits into from
May 31, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions code/modules/chemistry/tools/food_and_drink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -186,12 +188,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) && !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)
src.name = "[name_prefix("Ant-covered", 1)][src.name][name_suffix(null, 1)]"
Glamurio marked this conversation as resolved.
Show resolved Hide resolved


attackby(obj/item/W, mob/user)
Expand Down