Adds lava interaction (#4037)

Adds lava interaction: humans walking on lava titles will suffer a slowdown then being set on fire, cyborgs and simple mobs will only take burn damage.

Added the lava and basalt turfs to a random map generator, and replaces the tundra's ocean with the title just named water.
This commit is contained in:
Alberyk
2018-01-07 07:21:42 -02:00
committed by Erki
parent 1816de4da8
commit 005f7f8c30
4 changed files with 64 additions and 53 deletions

View File

@@ -1,44 +1,31 @@
// This is basically filler at this point. Subsidence and all kinds of fun
// hazards will be included when it is done.
/datum/random_map/noise/volcanism
descriptor = "volcanism"
smoothing_iterations = 6
target_turf_type = /turf/simulated
/datum/random_map/noise/magma
descriptor = "magma"
smoothing_iterations = 1
// Get rid of those dumb little single-tile volcanic areas.
/datum/random_map/noise/volcanism/cleanup()
for(var/x = 1, x <= limit_x, x++)
for(var/y = 1, y <= limit_y, y++)
var/current_cell = get_map_cell(x,y)
if(map[current_cell] < 178)
continue
var/count
var/tmp_cell = get_map_cell(x+1,y+1)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x-1,y-1)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x+1,y-1)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x-1,y+1)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x-1,y)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x,y-1)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x+1,y)
if(tmp_cell && map[tmp_cell] >= 178) count++
tmp_cell = get_map_cell(x,y+1)
if(tmp_cell && map[tmp_cell] >= 178) count++
if(!count)
map[current_cell] = 177
/datum/random_map/noise/magma/replace_space
descriptor = "magma (replacement)"
target_turf_type = /turf/space
/datum/random_map/noise/volcanism/get_appropriate_path(var/value)
return
/datum/random_map/noise/magma/get_map_char(var/value)
var/val = min(9,max(0,round((value/cell_range)*10)))
if(isnull(val)) val = 0
switch(val)
if(0)
return "<font color='#000099'>~</font>"
if(1)
return "<font color='#0000BB'>~</font>"
if(2)
return "<font color='#0000DD'>~</font>"
if(3)
return "<font color='#66AA00'>[pick(list(".",","))]</font>"
if(4)
return "<font color='#77CC00'>[pick(list(".",","))]</font>"
/datum/random_map/noise/volcanism/get_additional_spawns(var/value, var/turf/T)
if(value>=178)
if(istype(T,/turf/simulated/floor/asteroid))
T.ChangeTurf(/turf/simulated/floor/airless/lava)
else if(istype(T,/turf/simulated/mineral))
var/turf/simulated/mineral/M = T
M.mined_turf = /turf/simulated/floor/airless/lava
/datum/random_map/noise/magma/get_appropriate_path(var/value)
var/val = min(9,max(0,round((value/cell_range)*10)))
if(isnull(val)) val = 0
switch(val)
if(0 to 4)
return /turf/simulated/lava
else
return /turf/simulated/floor/asteroid/basalt

View File

@@ -36,7 +36,7 @@
if(isnull(val)) val = 0
switch(val)
if(0 to 4)
return /turf/simulated/floor/beach/water/ocean
return /turf/simulated/floor/beach/water
else
return /turf/simulated/floor/snow