mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
FOAAAAAAAM
This commit is contained in:
@@ -53,3 +53,43 @@
|
||||
if(nif.stat == NIF_TEMPFAIL)
|
||||
nif.stat = NIF_INSTALLING
|
||||
nif.durability = min(nif.durability + removed, initial(nif.durability))
|
||||
|
||||
/datum/reagent/firefighting_foam
|
||||
name = "Firefighting Foam"
|
||||
id = "firefoam"
|
||||
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 most NT vessels."
|
||||
reagent_state = LIQUID
|
||||
color = "#A6FAFF"
|
||||
taste_description = "the inside of a fire extinguisher"
|
||||
|
||||
/datum/reagent/firefighting_foam/touch_turf(var/turf/T, reac_volume)
|
||||
if(reac_volume >= 1)
|
||||
var/obj/effect/effect/foam/firefighting/F = (locate(/obj/effect/effect/foam/firefighting) 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/datum/gas_mixture/environment = T.return_air()
|
||||
var/min_temperature = T0C + 100 // 100C, the boiling point of water
|
||||
|
||||
var/hotspot = (locate(/obj/fire) in T)
|
||||
if(hotspot && !isspace(T))
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles)
|
||||
lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0)
|
||||
lowertemp.react()
|
||||
T.assume_air(lowertemp)
|
||||
qdel(hotspot)
|
||||
|
||||
if (environment && environment.temperature > min_temperature) // Abstracted as steam or something
|
||||
var/removed_heat = between(0, volume * 19000, -environment.get_thermal_energy_change(min_temperature))
|
||||
environment.add_thermal_energy(-removed_heat)
|
||||
if(prob(5))
|
||||
T.visible_message("<span class='warning'>The foam sizzles as it lands on \the [T]!</span>")
|
||||
|
||||
/datum/reagent/firefighting_foam/touch_obj(var/obj/O, reac_volume)
|
||||
O.water_act(reac_volume / 5)
|
||||
|
||||
/datum/reagent/firefighting_foam/touch_mob(var/mob/living/M, reac_volume)
|
||||
M.adjust_fire_stacks(-reac_volume)
|
||||
M.ExtinguishMob()
|
||||
Reference in New Issue
Block a user