Files
Aurora.3/code/modules/random_map/automata/caves.dm
LordFowl 76a891930e Bugfix Bonanza + Z-code and stuff. (#1819)
* Bugfix Bonfire #1

* Bugfix Bonanza #2

* BigBomba

* Banner.dmi

* Fixing Cyborg spawn

* Re-enabling asteroid gen
2017-02-22 14:42:49 -05:00

47 lines
1.2 KiB
Plaintext

/datum/random_map/automata/cave_system
iterations = 5
descriptor = "moon caves"
wall_type = /turf/simulated/mineral
floor_type = /turf/simulated/floor/asteroid
target_turf_type = /turf/unsimulated/mask
var/mineral_sparse = /turf/simulated/mineral/random
var/mineral_rich = /turf/simulated/mineral/random/high_chance
var/list/ore_turfs = list()
/datum/random_map/automata/cave_system/get_appropriate_path(var/value)
switch(value)
if(DOOR_CHAR)
return mineral_sparse
if(EMPTY_CHAR)
return mineral_rich
if(FLOOR_CHAR)
return floor_type
if(WALL_CHAR)
return wall_type
/datum/random_map/automata/cave_system/get_map_char(var/value)
switch(value)
if(DOOR_CHAR)
return "x"
if(EMPTY_CHAR)
return "X"
return ..(value)
// Create ore turfs.
/datum/random_map/automata/cave_system/cleanup()
for (var/cell in map)
if (cell == cell_live_value)
ore_turfs += cell
var/ore_count = round(map.len/20)
while((ore_count>0) && (ore_turfs.len>0))
if(!priority_process) sleep(-1)
var/check_cell = pick(ore_turfs)
ore_turfs -= check_cell
if(prob(75))
map[check_cell] = DOOR_CHAR // Mineral block
else
map[check_cell] = EMPTY_CHAR // Rare mineral block.
ore_count--
return 1