Space cola removes rust (#90452)

This commit is contained in:
John Willard
2025-04-08 12:07:21 -07:00
committed by GitHub
parent ada8b6392d
commit 63e652eb37
8 changed files with 25 additions and 11 deletions
+3
View File
@@ -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
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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
+11
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
@@ -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)
+3 -3
View File
@@ -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)