mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
Where No Spaceman Has Gone Before: a space sector system (#11801)
This commit is contained in:
@@ -19,6 +19,8 @@ var/datum/controller/subsystem/atlas/SSatlas
|
||||
|
||||
var/list/list/connected_z_cache = list()
|
||||
var/z_levels = 0 // Each bit represents a connection between adjacent levels. So the first bit means levels 1 and 2 are connected.
|
||||
var/datum/space_sector/current_sector
|
||||
var/list/possible_sectors = list ()
|
||||
|
||||
/datum/controller/subsystem/atlas/stat_entry()
|
||||
..("W:{X:[world.maxx] Y:[world.maxy] Z:[world.maxz]} ZL:[z_levels]")
|
||||
@@ -76,6 +78,27 @@ var/datum/controller/subsystem/atlas/SSatlas
|
||||
|
||||
QDEL_NULL(maploader)
|
||||
|
||||
InitializeSectors()
|
||||
|
||||
var/chosen_sector
|
||||
var/using_sector_config = FALSE
|
||||
|
||||
if(config.current_space_sector)
|
||||
chosen_sector = config.current_space_sector
|
||||
using_sector_config = TRUE
|
||||
else
|
||||
chosen_sector = current_map.default_sector
|
||||
|
||||
var/datum/space_sector/selected_sector = SSatlas.possible_sectors[chosen_sector]
|
||||
|
||||
if(!selected_sector)
|
||||
if(using_sector_config)
|
||||
log_debug("atlas: [chosen_sector] used in the config file is not a valid space sector")
|
||||
current_sector = new /datum/space_sector/tau_ceti //if all fails, we go with tau ceti
|
||||
log_debug("atlas: Unable to select [chosen_sector] as a valid space sector. Tau Ceti will be used instead.")
|
||||
else
|
||||
current_sector = selected_sector
|
||||
|
||||
..()
|
||||
|
||||
/datum/controller/subsystem/atlas/proc/load_map_directory(directory, overwrite_default_z = FALSE)
|
||||
@@ -164,6 +187,15 @@ var/datum/controller/subsystem/atlas/SSatlas
|
||||
var/datum/spawnpoint/S = new type
|
||||
spawn_locations[S.display_name] = S
|
||||
|
||||
/datum/controller/subsystem/atlas/proc/InitializeSectors()
|
||||
for (var/type in subtypesof(/datum/space_sector))
|
||||
var/datum/space_sector/space_sector = new type()
|
||||
|
||||
possible_sectors[space_sector.name] = space_sector
|
||||
|
||||
if (!possible_sectors.len)
|
||||
crash_with("No space sectors located in SSatlas.")
|
||||
|
||||
// Called when there's a fatal, unrecoverable error in mapload. This reboots the server.
|
||||
/world/proc/map_panic(reason)
|
||||
to_chat(world, "<span class='danger'>Fatal error during map setup, unable to continue! Server will reboot in 60 seconds.</span>")
|
||||
@@ -185,10 +217,6 @@ var/datum/controller/subsystem/atlas/SSatlas
|
||||
world.name = sname
|
||||
world.log << "Set world.name to [sname]."
|
||||
|
||||
/proc/system_name()
|
||||
ASSERT(current_map)
|
||||
return current_map.system_name
|
||||
|
||||
/proc/commstation_name()
|
||||
ASSERT(current_map)
|
||||
return current_map.dock_name
|
||||
@@ -73,9 +73,9 @@
|
||||
log_ss("map_finalization", "Error while creating away mission datum: [ec]")
|
||||
continue
|
||||
|
||||
if(length(am.valid_maps))
|
||||
if(!(current_map.name in am.valid_maps))
|
||||
log_ss("map_finalization", "[current_map.name] is not a valid map for [am.name]")
|
||||
if(length(am.valid_sectors))
|
||||
if(!(SSatlas.current_sector.name in am.valid_sectors))
|
||||
log_ss("map_finalization", "[SSatlas.current_sector.name] is not a valid map for [am.name]")
|
||||
continue
|
||||
|
||||
if(!am.validate_maps(folder))
|
||||
|
||||
@@ -309,6 +309,11 @@
|
||||
|
||||
Debug("ER/([H]): Entry, joined_late=[joined_late],megavend=[megavend].")
|
||||
|
||||
if(SSatlas.current_sector.description)
|
||||
var/sector_desc = "<hr><div align='center'><hr1><B>Current Sector: [SSatlas.current_sector.name]!</B></hr1><br>"
|
||||
sector_desc += "<i>[SSatlas.current_sector.description]</i><hr></div>"
|
||||
to_chat(H, sector_desc)
|
||||
|
||||
var/datum/job/job = GetJob(rank)
|
||||
var/list/spawn_in_storage = list()
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
for(var/team in all_teams)
|
||||
CHECK_TICK
|
||||
var/datum/responseteam/ert = new team
|
||||
if(!ert.admin)
|
||||
if(SSatlas.current_sector.name in ert.possible_space_sector)
|
||||
available_teams += ert
|
||||
all_ert_teams += ert
|
||||
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
if(!T.tick())
|
||||
traders -= T
|
||||
qdel(T)
|
||||
|
||||
if(!T.system_allowed())
|
||||
traders -= T
|
||||
qdel(T)
|
||||
generateTrader()
|
||||
|
||||
if(prob(100-traders.len*10))
|
||||
generateTrader()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user