Files
VOREStation/code/modules/random_map/automata/caves.dm
T
Will f67d095338 Reagent Refinery (#17955)
* starting port

* missed one

* fixes and wip

* more cleanup

* reagent data setup

* distillation testing

* tanker dmi again

* supply pack fix

* Tiny fix

* better formatting

* metallic paints and outpost reagents

* working on refinery tutorial, reactor construction icons

* reactor activation dot

* updated for new reagent hoses

* This as well

* pump relay object

* climbing support

* less ugly trolly tanker handling

* more cleanup

* reagent pumping updated

* climbable tanker

* fixed test

* test fails

* smart centrifuge board

* pump relay art updated

* hose doesn't show message when stacking

* gas cracks and fracking

* randomly spawned gas gracks

* indentation

* fixed

* runtime fix, lore fix

* turf change respecting atmos

* args

* nevermind

* gas cracks to poi fodder

* less gamer

* compile fix

* oops

* Old ores enabled

* paint distillations

* unittest

* many more distillation reactions

* nullcheck

* guide book

* tweaks to globs

* moved designs

* techweb

* reagent tanker sale element

* proper tag

* sellable

* typo, reduced hose connectors

* show reagent

* synthfab fix

* Revert "synthfab fix"

This reverts commit b7764cfb33.

* post sale tank handling

* tweak

* oops

* another oops

* smasher recipe now valid

* condensing gas recipies

* those too

* condensing tweaks

* matching mols better

* fluid pump missing

* code review

* no rain code here

* smart centrifuge update

* small grinder patch

* grinding fix

* fix
2025-08-02 07:07:17 +02:00

86 lines
2.2 KiB
Plaintext

/datum/random_map/automata/cave_system
iterations = 5
descriptor = "moon caves"
var/list/ore_turfs = list()
var/list/turfs_changed
var/make_cracked_turfs = TRUE
/datum/random_map/automata/cave_system/no_cracks
make_cracked_turfs = FALSE
/datum/random_map/automata/cave_system/get_appropriate_path(var/value)
return
/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()
var/tmp_cell
for (var/x = 1 to limit_x)
for (var/y = 1 to limit_y)
tmp_cell = TRANSLATE_COORD(x, y)
if (CELL_ALIVE(map[tmp_cell]))
ore_turfs += tmp_cell
#ifdef TESTING
testing("ASGEN: Found [ore_turfs.len] ore turfs.")
#endif
var/ore_count = round(map.len/20)
var/door_count = 0
var/empty_count = 0
while((ore_count>0) && (ore_turfs.len>0))
if(!priority_process)
CHECK_TICK
var/check_cell = pick(ore_turfs)
ore_turfs -= check_cell
if(prob(75))
map[check_cell] = DOOR_CHAR // Mineral block
door_count += 1
else
map[check_cell] = EMPTY_CHAR // Rare mineral block.
empty_count += 1
ore_count--
#ifdef TESTING
testing("ASGEN: Set [door_count] turfs to random minerals.")
testing("ASGEN: Set [empty_count] turfs to high-chance random minerals.")
#endif
return 1
/datum/random_map/automata/cave_system/apply_to_turf(var/x,var/y)
var/current_cell = get_map_cell(x,y)
if(!current_cell)
return 0
var/turf/simulated/mineral/T = locate((origin_x-1)+x,(origin_y-1)+y,origin_z)
if(istype(T) && !T.ignore_mapgen)
if(!T.ignore_cavegen)
if(map[current_cell] == FLOOR_CHAR)
T.make_floor()
else
T.make_wall()
LAZYSET(turfs_changed, T, TRUE)
if(T.density && !T.ignore_oregen)
if(map[current_cell] == DOOR_CHAR)
T.turf_resource_types |= TURF_HAS_ORE
else if(map[current_cell] == EMPTY_CHAR)
T.turf_resource_types |= TURF_HAS_RARE_ORE
get_additional_spawns(map[current_cell],T,get_spawn_dir(x, y))
return T
/datum/random_map/automata/cave_system/apply_to_map()
. = ..()
for(var/turf/simulated/mineral/T as anything in turfs_changed)
T.update_icon(1, turfs_changed)
LAZYCLEARLIST(turfs_changed)