Files
SmArtKarandGitHub d532cc9003 Adds plumbing to toilets (#92695)
## About The Pull Request

Toilets no longer act as infinite instant water sources, instead working
like showers and sinks - requiring either plumbing, or water reclaimers
to restore their cistern's supply. If a toilet has a large enough fish
inside, or if someone accidentally drops a small item into it, when
flushing it'll spew out all of its cistern's contents around itself
(Dropped items can be removed using a plunger after a small delay).
Also fixed plunger act code on some plumbing objects, and converted
toilets to use item interactions.

### This is a commission for ImprovedName/Ezel

## Why It's Good For The Game

Makes toilets more intresting with plumbing, and brings them more inline
with other plumbing appliances so that way you can't just make a toilet
with 1 material sheet and conjure a infinite water resouce anywhere you
please without a water recycler.
Also you can get up to some silly stuff with foam production.

## Changelog
🆑
add: Toilets now require plumbing or water reclaimers to function, and
can get clogged by small items.
fix: Trying to use plungers on plumbing objects will no longer hit them
after finishing the interaction.
code: Updated toilet item interaction code
/🆑
2025-09-07 09:52:07 +02:00

40 lines
1.6 KiB
Plaintext

///modified IV that can be anchored and takes plumbing in- and output
/obj/machinery/iv_drip/plumbing
name = "automated IV drip"
desc = "A modified IV drip with plumbing connects. Reagents received from the connect are injected directly into their bloodstream, blood that is drawn goes to the internal storage and then into the ducting."
icon_state = "plumb"
base_icon_state = "plumb"
density = TRUE
use_internal_storage = TRUE
processing_flags = START_PROCESSING_MANUALLY
/obj/machinery/iv_drip/plumbing/Initialize(mapload, bolt, layer)
. = ..()
AddComponent(/datum/component/plumbing/simple_demand, bolt, layer)
AddComponent(/datum/component/simple_rotation)
/obj/machinery/iv_drip/plumbing/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if(held_item.tool_behaviour != TOOL_WRENCH)
return
context[SCREENTIP_CONTEXT_LMB] = "[anchored ? "Una" : "A"]nchor"
return CONTEXTUAL_SCREENTIP_SET
/obj/machinery/iv_drip/plumbing/plunger_act(obj/item/plunger/attacking_plunger, mob/living/user, reinforced)
user.balloon_alert_to_viewers("furiously plunging...", "plunging iv drip...")
if(!do_after(user, 3 SECONDS, target = src))
return TRUE
user.balloon_alert_to_viewers("finished plunging")
reagents.expose(get_turf(src), TOUCH) //splash on the floor
reagents.clear_reagents()
return TRUE
/obj/machinery/iv_drip/plumbing/wrench_act(mob/living/user, obj/item/tool)
if(default_unfasten_wrench(user, tool) != SUCCESSFUL_UNFASTEN)
return ITEM_INTERACT_BLOCKING
if(anchored)
begin_processing()
else
end_processing()
return ITEM_INTERACT_SUCCESS