Implements fuel fires

Implements liquid fuel fires using the liquid fuel cleanable decal objects.
Rewrites zburn to be more sane, replaces convoluted calculations with straightforward reaction limit.
Fixes issue with liquid fuel spreading caused by thee object being deleted.
Prevents zones from being repeatedly added to the active fire zones list, and processed repeatedly.
This commit is contained in:
mwerezak
2015-03-02 12:40:01 -05:00
committed by mwerezak
parent 3ba295dadb
commit 49b3db964f
8 changed files with 155 additions and 1198 deletions
@@ -1,10 +1,10 @@
obj/effect/decal/cleanable/liquid_fuel
/obj/effect/decal/cleanable/liquid_fuel
//Liquid fuel is used for things that used to rely on volatile fuels or phoron being contained to a couple tiles.
icon = 'icons/effects/effects.dmi'
icon_state = "fuel"
layer = TURF_LAYER+0.2
anchored = 1
var/amount = 1 //Basically moles.
var/amount = 1
New(turf/newLoc,amt=1,nologs=0)
if(!nologs)
@@ -16,25 +16,34 @@ obj/effect/decal/cleanable/liquid_fuel
for(var/obj/effect/decal/cleanable/liquid_fuel/other in newLoc)
if(other != src)
other.amount += src.amount
var/oldsrc = src
src = null
spawn other.Spread()
del src
del(oldsrc)
Spread()
. = ..()
proc/Spread()
proc/Spread(exclude=list())
//Allows liquid fuels to sometimes flow into other tiles.
if(amount < 5.0) return
if(amount < 15) return //lets suppose welder fuel is fairly thick and sticky. For something like water, 5 or less would be more appropriate.
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in cardinal)
if(rand(25))
var/turf/simulated/target = get_step(src,d)
var/turf/simulated/origin = get_turf(src)
if(origin.CanPass(null, target, 0, 0) && target.CanPass(null, origin, 0, 0))
if(!locate(/obj/effect/decal/cleanable/liquid_fuel) in target)
new/obj/effect/decal/cleanable/liquid_fuel(target, amount*0.25,1)
amount *= 0.75
var/turf/simulated/target = get_step(src,d)
var/turf/simulated/origin = get_turf(src)
if(origin.CanPass(null, target, 0, 0) && target.CanPass(null, origin, 0, 0))
var/obj/effect/decal/cleanable/liquid_fuel/other_fuel = locate() in target
if(other_fuel)
other_fuel.amount += amount*0.25
if(!(other_fuel in exclude))
exclude += src
other_fuel.Spread(exclude)
else
new/obj/effect/decal/cleanable/liquid_fuel(target, amount*0.25,1)
amount *= 0.75
flamethrower_fuel
icon_state = "mustard"
@@ -246,7 +246,7 @@
/obj/item/weapon/tank/process()
//Allow for reactions
air_contents.react()
air_contents.react() //cooking up air tanks - add phoron and oxygen, then heat above PHORON_MINIMUM_BURN_TEMPERATURE
check_status()