Readded welder fuel.

Fixed issue with fire not generating light.
Fixed pre-merge issue with fuel passing through closed airlocks.
This commit is contained in:
Chinsky
2012-10-18 21:25:24 +04:00
parent 7f9132e23a
commit 5f7c9d5518
5 changed files with 73 additions and 72 deletions

View File

@@ -40,7 +40,7 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(locate(/obj/fire) in src) if(locate(/obj/fire) in src)
return 1 return 1
var/datum/gas/volatile_fuel/fuel = locate() in air_contents.trace_gases var/datum/gas/volatile_fuel/fuel = locate() in air_contents.trace_gases
var/obj/liquid_fuel/liquid = locate() in src var/obj/effect/decal/cleanable/liquid_fuel/liquid = locate() in src
if(air_contents.calculate_firelevel(liquid) > vsc.IgnitionLevel && (fuel || liquid || air_contents.toxins > 0.5)) if(air_contents.calculate_firelevel(liquid) > vsc.IgnitionLevel && (fuel || liquid || air_contents.toxins > 0.5))
igniting = 1 igniting = 1
if(air_contents.oxygen < 0.5) if(air_contents.oxygen < 0.5)
@@ -63,7 +63,7 @@ obj
anchored = 1 anchored = 1
mouse_opacity = 0 mouse_opacity = 0
//luminosity = 3 luminosity = 3
icon = 'fire.dmi' icon = 'fire.dmi'
icon_state = "1" icon_state = "1"
@@ -90,7 +90,7 @@ obj
//Get whatever trace fuels are in the area //Get whatever trace fuels are in the area
datum/gas/volatile_fuel/fuel = locate(/datum/gas/volatile_fuel/) in air_contents.trace_gases datum/gas/volatile_fuel/fuel = locate(/datum/gas/volatile_fuel/) in air_contents.trace_gases
//Also get liquid fuels on the ground. //Also get liquid fuels on the ground.
obj/liquid_fuel/liquid = locate() in S obj/effect/decal/cleanable/liquid_fuel/liquid = locate() in S
var/datum/gas_mixture/flow = air_contents.remove_ratio(0.25) var/datum/gas_mixture/flow = air_contents.remove_ratio(0.25)
//The reason we're taking a part of the air instead of all of it is so that it doesn't jump to //The reason we're taking a part of the air instead of all of it is so that it doesn't jump to
@@ -177,67 +177,12 @@ obj
..() ..()
obj/liquid_fuel
//Liquid fuel is used for things that used to rely on volatile fuels or plasma 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.
New(newLoc,amt=1)
src.amount = amt
//Be absorbed by any other liquid fuel in the tile.
for(var/obj/liquid_fuel/other in newLoc)
if(other != src)
other.amount += src.amount
spawn other.Spread()
del src
Spread()
. = ..()
proc/Spread()
//Allows liquid fuels to sometimes flow into other tiles.
if(amount < 0.5) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in cardinal)
if(S.air_check_directions & d)
if(rand(25))
var/turf/simulated/O = get_step(src,d)
if(!locate(/obj/liquid_fuel) in O)
new/obj/liquid_fuel(O,amount*0.25)
amount *= 0.75
flamethrower_fuel
icon_state = "mustard"
anchored = 0
New(newLoc, amt = 1, d = 0)
dir = d //Setting this direction means you won't get torched by your own flamethrower.
. = ..()
Spread()
//The spread for flamethrower fuel is much more precise, to create a wide fire pattern.
if(amount < 0.1) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in list(turn(dir,90),turn(dir,-90)))
if(S.air_check_directions & d)
var/turf/simulated/O = get_step(S,d)
new/obj/liquid_fuel/flamethrower_fuel(O,amount*0.25,d)
O.hotspot_expose((T20C*2) + 380,500) //Light flamethrower fuel on fire immediately.
amount *= 0.5
turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again. turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again.
turf/proc/apply_fire_protection() turf/proc/apply_fire_protection()
turf/simulated/apply_fire_protection() turf/simulated/apply_fire_protection()
fire_protection = world.time fire_protection = world.time
datum/gas_mixture/proc/zburn(obj/liquid_fuel/liquid) datum/gas_mixture/proc/zburn(obj/effect/decal/cleanable/liquid_fuel/liquid)
//This proc is similar to fire(), but uses a simple logarithm to calculate temp, and is thus more stable with ZAS. //This proc is similar to fire(), but uses a simple logarithm to calculate temp, and is thus more stable with ZAS.
if(temperature > PLASMA_MINIMUM_BURN_TEMPERATURE) if(temperature > PLASMA_MINIMUM_BURN_TEMPERATURE)
var var
@@ -295,7 +240,7 @@ datum/gas_mixture/proc/zburn(obj/liquid_fuel/liquid)
return 0 return 0
datum/gas_mixture/proc/calculate_firelevel(obj/liquid_fuel/liquid) datum/gas_mixture/proc/calculate_firelevel(obj/effect/decal/cleanable/liquid_fuel/liquid)
//Calculates the firelevel based on one equation instead of having to do this multiple times in different areas. //Calculates the firelevel based on one equation instead of having to do this multiple times in different areas.
var var
datum/gas/volatile_fuel/fuel = locate() in trace_gases datum/gas/volatile_fuel/fuel = locate() in trace_gases

View File

@@ -301,6 +301,7 @@ text("<A href='?src=\ref[src];operation=oddbutton'>[src.oddbutton ? "Yes" : "No"
target_types += /obj/effect/decal/cleanable/vomit target_types += /obj/effect/decal/cleanable/vomit
target_types += /obj/effect/decal/cleanable/robot_debris target_types += /obj/effect/decal/cleanable/robot_debris
target_types += /obj/effect/decal/cleanable/crayon target_types += /obj/effect/decal/cleanable/crayon
target_types += /obj/effect/decal/cleanable/liquid_fuel
if(src.blood) if(src.blood)
target_types += /obj/effect/decal/cleanable/xenoblood/ target_types += /obj/effect/decal/cleanable/xenoblood/

View File

@@ -0,0 +1,58 @@
obj/effect/decal/cleanable/liquid_fuel
//Liquid fuel is used for things that used to rely on volatile fuels or plasma 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.
New(newLoc,amt=1)
src.amount = amt
//Be absorbed by any other liquid fuel in the tile.
for(var/obj/effect/decal/cleanable/liquid_fuel/other in newLoc)
if(other != src)
other.amount += src.amount
spawn other.Spread()
del src
Spread()
. = ..()
proc/Spread()
//Allows liquid fuels to sometimes flow into other tiles.
if(amount < 0.5) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in cardinal)
if(S.air_check_directions & d)
if(rand(25))
var/turf/simulated/O = get_step(src,d)
var/can_pass = 1
for (var/obj/machinery/door/airlock/door in O)
if (door.density)
can_pass = 0
if (can_pass)
if(!locate(/obj/effect/decal/cleanable/liquid_fuel) in O)
new/obj/effect/decal/cleanable/liquid_fuel(O,amount*0.25)
amount *= 0.75
flamethrower_fuel
icon_state = "mustard"
anchored = 0
New(newLoc, amt = 1, d = 0)
dir = d //Setting this direction means you won't get torched by your own flamethrower.
. = ..()
Spread()
//The spread for flamethrower fuel is much more precise, to create a wide fire pattern.
if(amount < 0.1) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in list(turn(dir,90),turn(dir,-90)))
if(S.air_check_directions & d)
var/turf/simulated/O = get_step(S,d)
new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(O,amount*0.25,d)
O.hotspot_expose((T20C*2) + 380,500) //Light flamethrower fuel on fire immediately.
amount *= 0.5

View File

@@ -993,25 +993,22 @@ datum
color = "#660000" // rgb: 102, 0, 0 color = "#660000" // rgb: 102, 0, 0
//Commenting this out as it's horribly broken. It's a neat effect though, so it might be worth making a new reagent (that is less common) with similar effects. -Pete //Commenting this out as it's horribly broken. It's a neat effect though, so it might be worth making a new reagent (that is less common) with similar effects. -Pete
/*
reaction_obj(var/obj/O, var/volume) reaction_obj(var/obj/O, var/volume)
src = null src = null
var/turf/the_turf = get_turf(O) var/turf/the_turf = get_turf(O)
if(!the_turf) if(!the_turf)
return //No sense trying to start a fire if you don't have a turf to set on fire. --NEO return //No sense trying to start a fire if you don't have a turf to set on fire. --NEO
var/datum/gas_mixture/napalm = new new/obj/effect/decal/cleanable/liquid_fuel(the_turf, volume)
var/datum/gas/volatile_fuel/fuel = new
fuel.moles = 15
napalm.trace_gases += fuel
the_turf.assume_air(napalm)
reaction_turf(var/turf/T, var/volume) reaction_turf(var/turf/T, var/volume)
src = null src = null
var/datum/gas_mixture/napalm = new
var/datum/gas/volatile_fuel/fuel = new if(!T)
fuel.moles = 15 return //No sense trying to start a fire if you don't have a turf to set on fire. --NEO
napalm.trace_gases += fuel new/obj/effect/decal/cleanable/liquid_fuel(T, volume)
T.assume_air(napalm) return
return*/
on_mob_life(var/mob/living/M as mob) on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom if(!M) M = holder.my_atom
M.adjustToxLoss(1) M.adjustToxLoss(1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 188 KiB