Merge pull request #8336 from mwerezak/liquidfire

Implements liquid fuel fires
This commit is contained in:
Chinsky
2015-03-03 10:31:49 +03:00
8 changed files with 155 additions and 1198 deletions

View File

@@ -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"