The Mapping Update
Cleans up the map (again) Makes mining code more better
This commit is contained in:
@@ -34,6 +34,9 @@ SUBSYSTEM_DEF(mapping)
|
||||
var/list/reservation_ready = list()
|
||||
var/clearing_reserved_turfs = FALSE
|
||||
|
||||
///All possible biomes in assoc list as type || instance
|
||||
var/list/biomes = list()
|
||||
|
||||
// Z-manager stuff
|
||||
var/station_start // should only be used for maploading-related tasks
|
||||
var/space_levels_so_far = 0
|
||||
@@ -79,10 +82,12 @@ SUBSYSTEM_DEF(mapping)
|
||||
config = old_config
|
||||
GLOB.year_integer += config.year_offset
|
||||
GLOB.announcertype = (config.announcertype == "standard" ? (prob(1) ? "medibot" : "classic") : config.announcertype)
|
||||
initialize_biomes()
|
||||
loadWorld()
|
||||
repopulate_sorted_areas()
|
||||
process_teleport_locs() //Sets up the wizard teleport locations
|
||||
preloadTemplates()
|
||||
|
||||
#ifndef LOWMEMORYMODE
|
||||
// Create space ruin levels
|
||||
while (space_levels_so_far < config.space_ruin_levels)
|
||||
@@ -92,15 +97,16 @@ SUBSYSTEM_DEF(mapping)
|
||||
for (var/i in 1 to config.space_empty_levels)
|
||||
++space_levels_so_far
|
||||
empty_space = add_new_zlevel("Empty Area [space_levels_so_far]", list(ZTRAIT_LINKAGE = CROSSLINKED))
|
||||
// and the transit level
|
||||
transit = add_new_zlevel("Transit/Reserved", list(ZTRAIT_RESERVED = TRUE))
|
||||
|
||||
// Pick a random away mission.
|
||||
if(CONFIG_GET(flag/roundstart_away))
|
||||
createRandomZlevel()
|
||||
// Pick a random VR level.
|
||||
|
||||
// Load the virtual reality hub
|
||||
if(CONFIG_GET(flag/roundstart_vr))
|
||||
to_chat(world, "<span class='boldannounce'>Loading virtual reality...</span>")
|
||||
createRandomZlevel(VIRT_REALITY_NAME, list(ZTRAIT_AWAY = TRUE, ZTRAIT_VR = TRUE), GLOB.potential_vr_levels)
|
||||
to_chat(world, "<span class='boldannounce'>Virtual reality loaded.</span>")
|
||||
|
||||
// Generate mining ruins
|
||||
loading_ruins = TRUE
|
||||
@@ -115,7 +121,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
// needs to be whitelisted for underground too so place_below ruins work
|
||||
seedRuins(ice_ruins, CONFIG_GET(number/icemoon_budget), list(/area/icemoon/surface/outdoors/unexplored, /area/icemoon/underground/unexplored), ice_ruins_templates)
|
||||
for (var/ice_z in ice_ruins)
|
||||
spawn_rivers(ice_z, 4, /turf/open/transparent/openspace/icemoon, /area/icemoon/surface/outdoors/unexplored/rivers)
|
||||
spawn_rivers(ice_z, 4, /turf/open/openspace/icemoon, /area/icemoon/surface/outdoors/unexplored/rivers)
|
||||
|
||||
var/list/ice_ruins_underground = levels_by_trait(ZTRAIT_ICE_RUINS_UNDERGROUND)
|
||||
if (ice_ruins_underground.len)
|
||||
@@ -133,8 +139,13 @@ SUBSYSTEM_DEF(mapping)
|
||||
if (station_ruins.len)
|
||||
seedRuins(station_ruins, (SSmapping.config.station_ruin_budget < 0) ? CONFIG_GET(number/station_space_budget) : SSmapping.config.station_ruin_budget, list(/area/space/station_ruins), station_ruins_templates)
|
||||
SSmapping.seedStation()
|
||||
|
||||
loading_ruins = FALSE
|
||||
#endif
|
||||
// Run map generation after ruin generation to prevent issues
|
||||
run_map_generation()
|
||||
// Add the transit level
|
||||
transit = add_new_zlevel("Transit/Reserved", list(ZTRAIT_RESERVED = TRUE))
|
||||
repopulate_sorted_areas()
|
||||
// Set up Z-level transitions.
|
||||
setup_map_transitions()
|
||||
@@ -320,7 +331,7 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
||||
for(var/area/A in world)
|
||||
if (is_type_in_typecache(A, station_areas_blacklist))
|
||||
continue
|
||||
if (!A.contents.len || !A.unique)
|
||||
if (!A.contents.len || !(A.area_flags & UNIQUE_AREA))
|
||||
continue
|
||||
var/turf/picked = A.contents[1]
|
||||
if (is_station_level(picked.z))
|
||||
@@ -329,6 +340,10 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
||||
if(!GLOB.the_station_areas.len)
|
||||
log_world("ERROR: Station areas list failed to generate!")
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/run_map_generation()
|
||||
for(var/area/A in world)
|
||||
A.RunGeneration()
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/maprotate()
|
||||
var/players = GLOB.clients.len
|
||||
var/list/mapvotes = list()
|
||||
@@ -584,6 +599,12 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
||||
used_turfs.Cut()
|
||||
reserve_turfs(clearing)
|
||||
|
||||
///Initialize all biomes, assoc as type || instance
|
||||
/datum/controller/subsystem/mapping/proc/initialize_biomes()
|
||||
for(var/biome_path in subtypesof(/datum/biome))
|
||||
var/datum/biome/biome_instance = new biome_path()
|
||||
biomes[biome_path] += biome_instance
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/reg_in_areas_in_z(list/areas)
|
||||
for(var/B in areas)
|
||||
var/area/A = B
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SUBSYSTEM_DEF(min_spawns)
|
||||
name = "Minimum Spawns" /// this hot steaming pile of garbage makes sure theres a minimum of tendrils scattered around
|
||||
init_order = INIT_ORDER_DEFAULT
|
||||
flags = SS_BACKGROUND | SS_NO_FIRE
|
||||
flags = SS_NO_FIRE | SS_NO_INIT
|
||||
wait = 2
|
||||
var/where_we_droppin_boys_iterations = 0
|
||||
var/snaxi_snowflake_check = FALSE
|
||||
|
||||
Reference in New Issue
Block a user