atmos: make fires more destructive

Fires can now burn through walls, windows, and (with a high enough
 temperature) rwalls.
New proc: adjacent_fire_act().  Called on turfs that a fire isn't able
 to spread to. (walls, floor surrounded by windows, etc.)

Signed-off-by: Mloc-Argent <colmohici@gmail.com>

Conflicts:
	code/game/objects/structures/window.dm
This commit is contained in:
Mloc-Argent
2014-06-24 06:48:08 -04:00
committed by ZomgPonies
parent 511d695fad
commit 69d9d9fc49
6 changed files with 40 additions and 4 deletions
+11 -4
View File
@@ -63,9 +63,11 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(!istype(S))
del src
return
if(!S.zone)
del src
return
var/datum/gas_mixture/air_contents = S.return_air()
//get liquid fuels on the ground.
@@ -87,6 +89,7 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(!air_contents.check_combustability(liquid))
//del src
RemoveFire()
return
//get a firelevel and set the icon
firelevel = air_contents.calculate_firelevel(liquid)
@@ -104,15 +107,16 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
//im not sure how to implement a version that works for every creature so for now monkeys are firesafe
for(var/mob/living/carbon/human/M in loc)
M.FireBurn(firelevel, air_contents.temperature, air_contents.return_pressure() ) //Burn the humans!
loc.fire_act(air_contents, air_contents.temperature, air_contents.return_volume())
for(var/atom/A in loc)
A.fire_act(air_contents, air_contents.temperature, air_contents.return_volume())
//spread
for(var/direction in cardinal)
if(S.open_directions & direction) //Grab all valid bordering tiles
var/turf/simulated/enemy_tile = get_step(S, direction)
var/turf/simulated/enemy_tile = get_step(S, direction)
if(istype(enemy_tile))
if(istype(enemy_tile))
if(S.open_directions & direction) //Grab all valid bordering tiles
var/datum/gas_mixture/acs = enemy_tile.return_air()
var/obj/effect/decal/cleanable/liquid_fuel/liq = locate() in enemy_tile
if(!acs) continue
@@ -128,6 +132,9 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if( prob( 50 + 50 * (firelevel/vsc.fire_firelevel_multiplier) ) && S.CanPass(null, enemy_tile, 0,0) && enemy_tile.CanPass(null, S, 0,0))
new/obj/fire(enemy_tile,firelevel)
else
enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.return_volume())
//seperate part of the present gas
//this is done to prevent the fire burning all gases in a single pass
var/datum/gas_mixture/flow = air_contents.remove_ratio(vsc.fire_consuption_rate)
+2
View File
@@ -352,6 +352,8 @@
//checks if this window is full-tile one
/obj/structure/window/proc/is_fulltile()
if(dir & (dir - 1))
return 1
return 0
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
+15
View File
@@ -77,6 +77,21 @@ var/list/wood_icons = list("wood","wood-broken")
src.hotspot_expose(500,CELL_VOLUME)
return
/turf/simulated/floor/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(!burnt && prob(5))
burn_tile()
else if(prob(1) && !is_plating())
make_plating()
burn_tile()
return
/turf/simulated/floor/adjacent_fire_act(turf/simulated/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume)
var/dir_to = get_dir(src, adj_turf)
for(var/obj/structure/window/W in src)
if(W.dir == dir_to || W.is_fulltile()) //Same direction or diagonal (full tile)
W.fire_act(adj_air, adj_temp, adj_volume)
/turf/simulated/floor/blob_act()
return
+8
View File
@@ -11,6 +11,8 @@
var/damage_overlay
var/global/damage_overlays[8]
var/max_temperature = 1800 //K, walls will take damage if they're next to a fire hotter than this
opacity = 1
density = 1
blocks_air = 1
@@ -97,6 +99,12 @@
return
/turf/simulated/wall/adjacent_fire_act(turf/simulated/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume)
if(adj_temp > max_temperature)
take_damage(rand(10, 20) * (adj_temp / max_temperature))
return ..()
/turf/simulated/wall/proc/dismantle_wall(devastated=0, explode=0)
if(istype(src,/turf/simulated/wall/r_wall))
if(!devastated)
@@ -6,6 +6,7 @@
density = 1
damage_cap = 200
max_temperature = 6000
walltype = "rwall"
+3
View File
@@ -137,6 +137,9 @@
return
return
/turf/proc/adjacent_fire_act(turf/simulated/floor/source, temperature, volume)
return
/turf/proc/is_plating()
return 0
/turf/proc/is_asteroid_floor()