Merge pull request #7356 from VOREStation/aro-tanks

Tank sprites, foam
This commit is contained in:
Aronai Sieyes
2020-04-20 19:48:18 -04:00
committed by GitHub
12 changed files with 109 additions and 22 deletions
@@ -14,14 +14,14 @@
. = ..()
reagents = new/datum/reagents(max_water)
reagents.my_atom = src
reagents.add_reagent("water", max_water)
reagents.add_reagent("firefoam", max_water) //VOREStation Edit
/obj/item/mecha_parts/mecha_equipment/tool/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch.
if(!action_checks(target) || get_dist(chassis, target)>3) return
if(get_dist(chassis, target)>2) return
set_ready_state(0)
if(do_after_cooldown(target))
if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
if( istype(target, /obj/structure/reagent_dispensers) && get_dist(chassis,target) <= 1) //VOREStation Edit
var/obj/o = target
var/amount = o.reagents.trans_to_obj(src, 200)
occupant_message("<span class='notice'>[amount] units transferred into internal tank.</span>")
+9 -7
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)
+20
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)
+1 -1
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
@@ -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>")
@@ -53,3 +53,48 @@
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)
if(istype(M, /mob/living/simple_mob/slime)) //I'm sure foam is water-based!
var/mob/living/simple_mob/slime/S = M
S.adjustToxLoss(15 * reac_volume)
S.visible_message("<span class='warning'>[S]'s flesh sizzles where the foam touches it!</span>", "<span class='danger'>Your flesh burns in the foam!</span>")
M.adjust_fire_stacks(-reac_volume)
M.ExtinguishMob()
+25 -2
View File
@@ -69,7 +69,7 @@
/obj/structure/reagent_dispensers/watertank
name = "watertank"
desc = "A watertank."
icon = 'icons/obj/objects.dmi'
icon = 'icons/obj/objects_vr.dmi' //VOREStation Edit
icon_state = "watertank"
amount_per_transfer_from_this = 10
@@ -89,7 +89,7 @@
/obj/structure/reagent_dispensers/fueltank
name = "fueltank"
desc = "A fueltank."
icon = 'icons/obj/objects.dmi'
icon = 'icons/obj/objects_vr.dmi' //VOREStation Edit
icon_state = "weldtank"
amount_per_transfer_from_this = 10
var/modded = 0
@@ -99,6 +99,29 @@
. = ..()
reagents.add_reagent("fuel",1000)
//VOREStation Add
/obj/structure/reagent_dispensers/fueltank/high
name = "high-capacity fuel tank"
desc = "A highly-pressurized fuel tank made to hold vast amounts of fuel."
icon_state = "weldtank_high"
/obj/structure/reagent_dispensers/fueltank/high/Initialize()
. = ..()
reagents.add_reagent("fuel",4000)
/obj/structure/reagent_dispensers/foam
name = "foamtank"
desc = "A foam tank."
icon = 'icons/obj/objects_vr.dmi' //VOREStation Edit
icon_state = "foamtank"
amount_per_transfer_from_this = 10
/obj/structure/reagent_dispensers/foam/Initialize()
. = ..()
reagents.add_reagent("firefoam",1000)
//VOREStation Add End
/obj/structure/reagent_dispensers/fueltank/examine(mob/user)
if(!..(user, 2))
return
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 3.0 KiB

+1 -5
View File
@@ -3883,14 +3883,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" = (
+1 -1
View File
@@ -13705,7 +13705,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" = (
+1
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"