From 52bbc38488becbe26fb38517a83edbcd800e448c Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Fri, 19 Apr 2024 20:36:09 -0400 Subject: [PATCH] [MIRROR] Water tiles now put out burning atoms (#2068) * Water tiles now put out burning atoms (#82735) ## About The Pull Request This adds a new "watery tile" element, currently used for (you guessed it) water turfs. This makes a tile extinguish any atom that passes through it. It also makes mobs wet! ![fire test](https://github.com/tgstation/tgstation/assets/28870487/4a19c921-37f3-428d-bb94-0baef7589e1b) This required a minor amount of under-the-hood work regarding firestacks. Essentially, they now get put out when the atom-level `extinguish()` proc is called, as they are now receptive to the `COMSIG_ATOM_EXTINGUISH` signal. ## Why It's Good For The Game It makes sense to me! If I was playing another simulation game and dived into a pool of water on fire, only to remain on fire, I would be very confused and disturbed. Also, it's good for immersion. Get it? Like, because water tiles also have the immerse element? ## Changelog :cl: Rhials qol: Water tiles now extinguish fires on items and people. /:cl: * Water tiles now put out burning atoms --------- Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> --- code/datums/elements/watery_tile.dm | 21 +++++++++++++++++++ .../status_effects/debuffs/fire_stacks.dm | 1 + code/game/turfs/open/water.dm | 1 + tgstation.dme | 1 + 4 files changed, 24 insertions(+) create mode 100644 code/datums/elements/watery_tile.dm diff --git a/code/datums/elements/watery_tile.dm b/code/datums/elements/watery_tile.dm new file mode 100644 index 00000000000..797eda39135 --- /dev/null +++ b/code/datums/elements/watery_tile.dm @@ -0,0 +1,21 @@ +/datum/element/watery_tile + element_flags = ELEMENT_DETACH_ON_HOST_DESTROY + +/datum/element/watery_tile/Attach(turf/target) + . = ..() + if(!isturf(target)) + return ELEMENT_INCOMPATIBLE + + RegisterSignal(target, COMSIG_ATOM_ENTERED, PROC_REF(extinguish_atom)) + +/datum/element/watery_tile/Detach(turf/source) + UnregisterSignal(source, COMSIG_ATOM_ENTERED) + return ..() + +/datum/element/watery_tile/proc/extinguish_atom(atom/source, atom/movable/entered) + SIGNAL_HANDLER + + entered.extinguish() + if(isliving(entered)) + var/mob/living/our_mob = entered + our_mob.adjust_wet_stacks(3) diff --git a/code/datums/status_effects/debuffs/fire_stacks.dm b/code/datums/status_effects/debuffs/fire_stacks.dm index 5bf8269bbbf..62f8c9ca24e 100644 --- a/code/datums/status_effects/debuffs/fire_stacks.dm +++ b/code/datums/status_effects/debuffs/fire_stacks.dm @@ -261,6 +261,7 @@ /datum/status_effect/fire_handler/fire_stacks/on_apply() . = ..() RegisterSignal(owner, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(add_fire_overlay)) + RegisterSignal(owner, COMSIG_ATOM_EXTINGUISH, PROC_REF(extinguish)) owner.update_appearance(UPDATE_OVERLAYS) /datum/status_effect/fire_handler/fire_stacks/proc/add_fire_overlay(mob/living/source, list/overlays) diff --git a/code/game/turfs/open/water.dm b/code/game/turfs/open/water.dm index debf5c0f6b1..55ca23beead 100644 --- a/code/game/turfs/open/water.dm +++ b/code/game/turfs/open/water.dm @@ -23,6 +23,7 @@ /turf/open/water/Initialize(mapload) . = ..() AddElement(/datum/element/immerse, icon, icon_state, "immerse", immerse_overlay_color) + AddElement(/datum/element/watery_tile) /turf/open/water/jungle diff --git a/tgstation.dme b/tgstation.dme index d0d1b3677f8..5894f02310c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1614,6 +1614,7 @@ #include "code\datums\elements\wall_smasher.dm" #include "code\datums\elements\wall_tearer.dm" #include "code\datums\elements\wall_walker.dm" +#include "code\datums\elements\watery_tile.dm" #include "code\datums\elements\weapon_description.dm" #include "code\datums\elements\weather_listener.dm" #include "code\datums\elements\web_walker.dm"