diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index 9cb5769d0cb..17c77541f95 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -46,6 +46,9 @@ /// Used by smoke or inhaling from a source. Smoke and cigarettes. #define INHALE (1<<6) +///Smoke machines are both touch and inhaling +#define SMOKE_MACHINE (TOUCH | INHALE) + /// When returned by on_mob_life(), on_mob_dead(), overdose_start() or overdose_processed(), will cause the mob to updatehealth() afterwards #define UPDATE_MOB_HEALTH 1 diff --git a/code/datums/components/acid.dm b/code/datums/components/acid.dm index ff63ed985a2..dbf2e8e6e5d 100644 --- a/code/datums/components/acid.dm +++ b/code/datums/components/acid.dm @@ -226,7 +226,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e return COMPONENT_CLEANED /// Handles water diluting the acid on the object. -/datum/component/acid/proc/on_expose_reagent(atom/parent_atom, datum/reagent/exposing_reagent, reac_volume) +/datum/component/acid/proc/on_expose_reagent(atom/parent_atom, datum/reagent/exposing_reagent, reac_volume, methods) SIGNAL_HANDLER if(!istype(exposing_reagent, /datum/reagent/water)) diff --git a/code/datums/elements/light_eater.dm b/code/datums/elements/light_eater.dm index 3f51590da1c..c13712cbce8 100644 --- a/code/datums/elements/light_eater.dm +++ b/code/datums/elements/light_eater.dm @@ -195,7 +195,7 @@ * - [target][/atom]: The atom that was exposed to the light reater reagents * - reac_volume: The volume of the reagents the target was exposed to */ -/datum/element/light_eater/proc/on_expose_atom(datum/reagent/source, atom/target, reac_volume) +/datum/element/light_eater/proc/on_expose_atom(datum/reagent/source, atom/target, reac_volume, methods) SIGNAL_HANDLER eat_lights(target, source) return NONE diff --git a/code/datums/elements/rust.dm b/code/datums/elements/rust.dm index 265e23c5a31..2bc63c12737 100644 --- a/code/datums/elements/rust.dm +++ b/code/datums/elements/rust.dm @@ -19,6 +19,7 @@ RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(handle_examine)) RegisterSignal (target, COMSIG_ATOM_ITEM_INTERACTION, PROC_REF(on_interaction)) RegisterSignals(target, list(COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_WELDER), COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_RUSTSCRAPER)), PROC_REF(secondary_tool_act)) + RegisterSignal(target, COMSIG_ATOM_EXPOSE_REAGENT, PROC_REF(on_reagent_expose)) // Unfortunately registering with parent sometimes doesn't cause an overlay update target.update_appearance() @@ -28,6 +29,7 @@ UnregisterSignal(source, COMSIG_ATOM_EXAMINE) UnregisterSignal(source, COMSIG_ATOM_ITEM_INTERACTION) UnregisterSignal(source, list(COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_WELDER), COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_RUSTSCRAPER))) + UnregisterSignal(source, COMSIG_ATOM_EXPOSE_REAGENT) REMOVE_TRAIT(source, TRAIT_RUSTY, ELEMENT_TRAIT(type)) source.update_appearance() @@ -75,6 +77,15 @@ Detach(source) return +///Immediately removes rust if exposed to space cola. +/datum/element/rust/proc/on_reagent_expose(atom/source, datum/reagent/reagent_splashed, reac_volume, methods) + SIGNAL_HANDLER + if(!istype(reagent_splashed, /datum/reagent/consumable/space_cola)) + return + if(methods & INHALE) + return + Detach(source) + /// Prevents placing floor tiles on rusted turf /datum/element/rust/proc/on_interaction(datum/source, mob/user, obj/item/tool, modifiers) SIGNAL_HANDLER diff --git a/code/game/atom/_atom.dm b/code/game/atom/_atom.dm index 88ce25b4e2d..06728752c2a 100644 --- a/code/game/atom/_atom.dm +++ b/code/game/atom/_atom.dm @@ -420,7 +420,7 @@ SEND_SIGNAL(source, COMSIG_REAGENTS_EXPOSE_ATOM, src, reagents, methods, volume_modifier, show_message) for(var/datum/reagent/current_reagent as anything in reagents) - . |= current_reagent.expose_atom(src, reagents[current_reagent]) + . |= current_reagent.expose_atom(src, reagents[current_reagent], methods) SEND_SIGNAL(src, COMSIG_ATOM_AFTER_EXPOSE_REAGENTS, reagents, source, methods, volume_modifier, show_message) /// Are you allowed to drop this atom diff --git a/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm b/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm index 09613c60e5c..6efb99137bd 100644 --- a/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm @@ -376,9 +376,9 @@ continue if(location.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(thing, TRAIT_T_RAY_VISIBLE)) continue - reagents.expose(thing, TOUCH, fraction) + reagents.expose(thing, SMOKE_MACHINE, fraction) - reagents.expose(location, TOUCH, fraction) + reagents.expose(location, SMOKE_MACHINE, fraction) return TRUE /obj/effect/particle_effect/fluid/smoke/chem/smoke_mob(mob/living/carbon/smoker, seconds_per_tick) @@ -390,8 +390,8 @@ return FALSE var/fraction = (seconds_per_tick SECONDS) / initial(lifetime) - reagents.copy_to(smoker, reagents.total_volume, fraction, copy_methods = INHALE) - reagents.expose(smoker, INHALE, fraction) + reagents.copy_to(smoker, reagents.total_volume, fraction, copy_methods = SMOKE_MACHINE) + reagents.expose(smoker, SMOKE_MACHINE, fraction) return TRUE /// Helper to quickly create a cloud of reagent smoke diff --git a/code/modules/food_and_drinks/machinery/griddle.dm b/code/modules/food_and_drinks/machinery/griddle.dm index ed1884c89af..d4c83ea5b27 100644 --- a/code/modules/food_and_drinks/machinery/griddle.dm +++ b/code/modules/food_and_drinks/machinery/griddle.dm @@ -41,7 +41,7 @@ return variant = rand(1,3) -/obj/machinery/griddle/proc/on_expose_reagent(atom/parent_atom, datum/reagent/exposing_reagent, reac_volume) +/obj/machinery/griddle/proc/on_expose_reagent(atom/parent_atom, datum/reagent/exposing_reagent, reac_volume, methods) SIGNAL_HANDLER if(griddled_objects.len >= max_items || !istype(exposing_reagent, /datum/reagent/consumable/pancakebatter) || reac_volume < 5) diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 3d4e2d57732..c1cb20f0d9c 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -109,12 +109,12 @@ holder = null /// Applies this reagent to an [/atom] -/datum/reagent/proc/expose_atom(atom/exposed_atom, reac_volume) +/datum/reagent/proc/expose_atom(atom/exposed_atom, reac_volume, methods = TOUCH) SHOULD_CALL_PARENT(TRUE) . = 0 - . |= SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_ATOM, exposed_atom, reac_volume) - . |= SEND_SIGNAL(exposed_atom, COMSIG_ATOM_EXPOSE_REAGENT, src, reac_volume) + . |= SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_ATOM, exposed_atom, reac_volume, methods) + . |= SEND_SIGNAL(exposed_atom, COMSIG_ATOM_EXPOSE_REAGENT, src, reac_volume, methods) /// Applies this reagent to a [/mob/living] /datum/reagent/proc/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message = TRUE, touch_protection = 0)