Overmap exoplanet generation, ported from Bay. (#12362)

This commit is contained in:
Matt Atlas
2022-01-18 02:16:48 +01:00
committed by GitHub
parent 918d43972e
commit 5bcf84cb23
84 changed files with 2321 additions and 4654 deletions
+12 -2
View File
@@ -25,6 +25,8 @@ var/global/list/map_count = list()
var/target_turf_type
var/spawn_roof = FALSE //Set to TRUE if a roof should be spawned based.
var/area/use_area // If set, turfs will be put in this area. If set to type, new instance will be spawned for the map
// Storage for the final iteration of the map.
var/list/map = list() // Actual map.
var/tmp/map_len = 0
@@ -33,7 +35,7 @@ var/global/list/map_count = list()
// Test to see if rand_seed() can be used reliably.
var/priority_process
/datum/random_map/New(var/seed, var/tx, var/ty, var/tz, var/tlx, var/tly, var/do_not_apply, var/do_not_announce)
/datum/random_map/New(var/seed, var/tx, var/ty, var/tz, var/tlx, var/tly, var/do_not_apply, var/do_not_announce, var/never_be_priority = 0, var/used_area)
// Store this for debugging.
if(!map_count[descriptor])
@@ -48,6 +50,12 @@ var/global/list/map_count = list()
if(tlx) limit_x = tlx
if(tly) limit_y = tly
if(used_area)
if(ispath(used_area))
use_area = new(used_area)
else
use_area = used_area
if(do_not_apply)
auto_apply = null
@@ -61,7 +69,7 @@ var/global/list/map_count = list()
// Testing needed to see how reliable this is (asynchronous calls, called during worldgen), DM ref is not optimistic
if(seed)
rand_seed(seed)
priority_process = 1
priority_process = !never_be_priority
for(var/i = 0;i<max_attempts;i++)
if(generate())
@@ -183,6 +191,8 @@ var/global/list/map_count = list()
if(spawn_roof)
T.spawn_roof()
get_additional_spawns(map[tmp_cell],T,get_spawn_dir(x, y))
if(use_area)
ChangeArea(T, use_area)
return T
/datum/random_map/proc/get_spawn_dir()