You can now go through atmos resin with slowdown (#21551)

* e

* comments

* lol

* Update effects_foam.dm
This commit is contained in:
Bop
2024-02-29 06:33:34 +07:00
committed by GitHub
parent 51fafe790f
commit a2a9f068b8
2 changed files with 36 additions and 1 deletions

View File

@@ -79,3 +79,5 @@
#define MOVESPEED_ID_SPACE_DRAGON_SAD "SPACE_DRAGON_SAD" #define MOVESPEED_ID_SPACE_DRAGON_SAD "SPACE_DRAGON_SAD"
#define MOVESPEED_ID_SPACE_DRAGON_RAGE "SPACE_DRAGON_RAGE" #define MOVESPEED_ID_SPACE_DRAGON_RAGE "SPACE_DRAGON_RAGE"
#define MOVESPEED_ID_RESIN_FOAM "RESIN_FOAM"

View File

@@ -386,8 +386,10 @@
/// Atmos Backpack Resin, transparent, prevents atmos and filters the air /// Atmos Backpack Resin, transparent, prevents atmos and filters the air
/obj/structure/foamedmetal/resin /obj/structure/foamedmetal/resin
name = "\improper ATMOS Resin" name = "\improper ATMOS Resin"
desc = "A lightweight, transparent resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature. It can be used as base to construct a wall." desc = "A lightweight, transparent and passable resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature. It can be used as base to construct a wall."
opacity = FALSE opacity = FALSE
density = FALSE
can_atmos_pass = ATMOS_PASS_NO
icon_state = "atmos_resin" icon_state = "atmos_resin"
alpha = 120 alpha = 120
max_integrity = 10 max_integrity = 10
@@ -395,6 +397,11 @@
/obj/structure/foamedmetal/resin/Initialize(mapload) /obj/structure/foamedmetal/resin/Initialize(mapload)
. = ..() . = ..()
var/turf/open/location = loc var/turf/open/location = loc
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
COMSIG_ATOM_EXITED = PROC_REF(on_exited),
)
AddElement(/datum/element/connect_loc, loc_connections)
if(!istype(location)) if(!istype(location))
return return
@@ -422,3 +429,29 @@
potential_tinder.extinguish_mob() potential_tinder.extinguish_mob()
for(var/obj/item/potential_tinder in location) for(var/obj/item/potential_tinder in location)
potential_tinder.extinguish() potential_tinder.extinguish()
/obj/structure/foamedmetal/resin/proc/on_entered(datum/source, atom/movable/arrived)
SIGNAL_HANDLER
if(isliving(arrived)) //I guess living subtype is fine
var/mob/living/living = arrived
living.add_movespeed_modifier(MOVESPEED_ID_RESIN_FOAM, multiplicative_slowdown = 0.4)
/obj/structure/foamedmetal/resin/proc/on_exited(datum/source, atom/movable/gone, direction)
if(isliving(gone))
var/mob/living/living = gone
var/turf/T = get_turf(src)
var/turf/them = get_step(T, direction)
for(var/obj/structure/foamedmetal/resin/S in them)
if(S.loc == living.loc) //No removing speed if has same loc
return
living.remove_movespeed_modifier(MOVESPEED_ID_RESIN_FOAM)
/obj/structure/foamedmetal/resin/Destroy() //Make sure to remove the speed if the resin is destroyed while the mob is in it
var/turf/T = get_turf(src)
for(var/mob/living/living in T)
living.remove_movespeed_modifier(MOVESPEED_ID_RESIN_FOAM)
return ..()