FOAAAAAAAM

This commit is contained in:
Aronai Sieyes
2020-04-20 17:16:25 -04:00
parent 7a43642cbe
commit a2e6467936
8 changed files with 77 additions and 18 deletions

View File

@@ -14,23 +14,25 @@
var/amount = 3
var/expand = 1
var/metal = 0
var/dries = 1 //VOREStation Add
var/slips = 0 //VOREStation Add
/obj/effect/effect/foam/Initialize(var/mapload, var/ismetal = 0)
. = ..()
icon_state = "[ismetal? "m" : ""]foam"
//icon_state = "[ismetal? "m" : ""]foam" //VOREStation Removal
metal = ismetal
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
addtimer(CALLBACK(src, .proc/post_spread), 3 + metal * 3)
addtimer(CALLBACK(src, .proc/pre_harden), 12 SECONDS)
addtimer(CALLBACK(src, .proc/harden), 15 SECONDS)
if(dries) //VOREStation Add
addtimer(CALLBACK(src, .proc/post_spread), 3 + metal * 3)
addtimer(CALLBACK(src, .proc/pre_harden), 12 SECONDS)
addtimer(CALLBACK(src, .proc/harden), 15 SECONDS)
/obj/effect/effect/foam/proc/post_spread()
process()
checkReagents()
/obj/effect/effect/foam/proc/pre_harden()
STOP_PROCESSING(SSobj, src)
return //VOREStation Edit
/obj/effect/effect/foam/proc/harden()
if(metal)
@@ -83,7 +85,7 @@
return
if(metal)
return
if(istype(AM, /mob/living))
if(slips && istype(AM, /mob/living)) //VOREStation Add
var/mob/living/M = AM
M.slip("the foam", 6)

View File

@@ -0,0 +1,20 @@
/obj/effect/effect/foam/firefighting
name = "firefighting foam"
icon_state = "mfoam" //Whiter
color = "#A6FAFF"
var/lifetime = 3
dries = FALSE // We do this ourselves
slips = FALSE
/obj/effect/effect/foam/firefighting/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
/obj/effect/effect/foam/firefighting/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/effect/effect/foam/firefighting/process()
if(lifetime-- <= 0)
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)

View File

@@ -21,7 +21,7 @@
step_towards(src, target)
var/turf/T = get_turf(src)
if(T && reagents)
reagents.touch_turf(T)
reagents.touch_turf(T, reagents.total_volume) //VOREStation Add
var/mob/M
for(var/atom/A in T)
if(!ismob(A) && A.simulated) // Mobs are handled differently

View File

@@ -1,7 +1,7 @@
/obj/item/weapon/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/items_vr.dmi' //VOREStation Edit
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
@@ -36,12 +36,12 @@
/obj/item/weapon/extinguisher/Initialize()
create_reagents(max_water)
reagents.add_reagent("water", max_water)
reagents.add_reagent("firefoam", max_water) //VOREStation Edit
. = ..()
/obj/item/weapon/extinguisher/examine(mob/user)
if(..(user, 0))
to_chat(user, "[bicon(src)] [src.name] contains [src.reagents.total_volume] units of water left!")
to_chat(user, "[bicon(src)] [src.name] contains [src.reagents.total_volume] units of foam left!") //VOREStation Edit
/obj/item/weapon/extinguisher/attack_self(mob/user as mob)
safety = !safety
@@ -70,7 +70,7 @@
/obj/item/weapon/extinguisher/afterattack(var/atom/target, var/mob/user, var/flag)
//TODO; Add support for reagents in water.
if( istype(target, /obj/structure/reagent_dispensers/watertank) && flag)
if( istype(target, /obj/structure/reagent_dispensers) && flag) //VOREStation Edit
var/obj/o = target
var/amount = o.reagents.trans_to_obj(src, 50)
to_chat(user, "<span class='notice'>You fill [src] with [amount] units of the contents of [target].</span>")

View File

@@ -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()

View File

@@ -3878,14 +3878,10 @@
/turf/simulated/floor/plating,
/area/maintenance/lower/trash_pit)
"agI" = (
/obj/structure/table/standard,
/obj/random/tech_supply,
/obj/random/tech_supply,
/obj/random/tech_supply,
/obj/random/tech_supply,
/obj/machinery/newscaster{
pixel_x = -30
},
/obj/structure/reagent_dispensers/foam,
/turf/simulated/floor/tiled,
/area/storage/primary)
"agJ" = (

View File

@@ -13706,7 +13706,7 @@
/turf/simulated/floor/tiled,
/area/hallway/station/atrium)
"axz" = (
/obj/structure/reagent_dispensers/watertank,
/obj/structure/reagent_dispensers/foam,
/turf/simulated/floor/tiled,
/area/storage/tools)
"axA" = (

View File

@@ -1008,6 +1008,7 @@
#include "code\game\objects\effects\chem\chemsmoke.dm"
#include "code\game\objects\effects\chem\coating.dm"
#include "code\game\objects\effects\chem\foam.dm"
#include "code\game\objects\effects\chem\foam_vr.dm"
#include "code\game\objects\effects\chem\water.dm"
#include "code\game\objects\effects\decals\cleanable.dm"
#include "code\game\objects\effects\decals\contraband.dm"