diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index 29d4fca0b94..d24a278b411 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -179,3 +179,9 @@ /obj/effect/decal/cleanable/glitter/blue name = "blue glitter" icon_state = "freon" + +/obj/effect/decal/cleanable/plasma + name = "stabilized plasma" + desc = "A puddle of stabilized plasma." + icon_state = "flour" + color = "#C8A5DC" \ No newline at end of file diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 5d3a345e8c3..21f04e5cdc9 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -23,6 +23,51 @@ /turf/open/chasm, /turf/open/lava)) +/obj/effect/particle_effect/foam/firefighting + name = "firefighting foam" + lifetime = 20 //doesn't last as long as normal foam + amount = 0 //no spread + var/absorbed_plasma = 0 + +/obj/effect/particle_effect/foam/firefighting/MakeSlippery() + return + +/obj/effect/particle_effect/foam/firefighting/process() + ..() + + var/turf/open/T = get_turf(src) + var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T) + if(hotspot && istype(T) && T.air) + qdel(hotspot) + var/datum/gas_mixture/G = T.air + var/plas_amt = min(30,G.gases[/datum/gas/plasma][MOLES]) //Absorb some plasma + G.gases[/datum/gas/plasma][MOLES] -= plas_amt + absorbed_plasma += plas_amt + if(G.temperature > T20C) + G.temperature = max(G.temperature/2,T20C) + G.garbage_collect() + T.air_update_turf() + +/obj/effect/particle_effect/foam/firefighting/kill_foam() + STOP_PROCESSING(SSfastprocess, src) + + if(absorbed_plasma) + var/obj/effect/decal/cleanable/plasma/P = (locate(/obj/effect/decal/cleanable/plasma) in get_turf(src)) + if(!P) + P = new(loc) + P.reagents.add_reagent("stable_plasma", absorbed_plasma) + + flick("[icon_state]-disolve", src) + QDEL_IN(src, 5) + +/obj/effect/particle_effect/foam/firefighting/foam_mob(mob/living/L) + if(!istype(L)) + return + L.adjust_fire_stacks(-2) + L.ExtinguishMob() + +/obj/effect/particle_effect/foam/firefighting/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + return /obj/effect/particle_effect/foam/metal name = "aluminium foam" diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm index ae625cc5543..a361499baef 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm @@ -248,3 +248,41 @@ L.extract_cooldown = max(0, L.extract_cooldown - 20) ..() +/datum/reagent/firefighting_foam + name = "Firefighting Foam" + id = "firefighting_foam" + description = "A historical fire suppressant. Originally believed to simply displace oxygen to starve fires, it actually interferes with the combustion reaction itself. Vastly superior to the cheap water-based extinguishers found on NT vessels." + reagent_state = LIQUID + color = "#A6FAFF55" + taste_description = "the inside of a fire extinguisher" + +/datum/reagent/firefighting_foam/reaction_turf(turf/open/T, reac_volume) + if (!istype(T)) + return + + if(reac_volume >= 1) + var/obj/effect/particle_effect/foam/firefighting/F = (locate(/obj/effect/particle_effect/foam) in T) + if(!F) + F = new(T) + else if(istype(F)) + F.lifetime = initial(F.lifetime) //reduce object churn a little bit when using smoke by keeping existing foam alive a bit longer + + var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T) + if(hotspot && !isspaceturf(T)) + if(T.air) + var/datum/gas_mixture/G = T.air + if(G.temperature > T20C) + G.temperature = max(G.temperature/2,T20C) + G.react() + qdel(hotspot) + +/datum/reagent/firefighting_foam/reaction_obj(obj/O, reac_volume) + O.extinguish() + +/datum/reagent/firefighting_foam/reaction_mob(mob/living/M, method=TOUCH, reac_volume) + if(!istype(M)) + return + if(method in list(VAPOR, TOUCH)) + M.adjust_fire_stacks(-reac_volume) + M.ExtinguishMob() + ..() \ No newline at end of file diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index e3183fae888..a430d93fba9 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -425,3 +425,11 @@ strengthdiv = 7 required_temp = 575 modifier = 1 + +/datum/chemical_reaction/firefighting_foam + name = "Firefighting Foam" + id = "firefighting_foam" + results = list("firefighting_foam" = 3) + required_reagents = list("stabilizing_agent" = 1,"fluorosurfactant" = 1,"carbon" = 1) + required_temp = 200 + is_cold_recipe = 1