Skip to content

Commit

Permalink
[MIRROR] Water tiles now put out burning atoms (#2068)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 20, 2024
1 parent d61b324 commit 52bbc38
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions code/datums/elements/watery_tile.dm
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions code/datums/status_effects/debuffs/fire_stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/open/water.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 52bbc38

Please sign in to comment.