mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-15 20:52:41 +00:00
Links many map-specific details such as the station name, z-level information, and allowed jobs from global vars to map datum vars, which should help us maintain multiple maps at once in the future, which will be needed for the future Southern Cross. Note that a config change will be needed to change GENERATE_ASTEROID to GENERATE_MAP, otherwise no changes should be required to continue normal map usage. To change to a different map, it's suggested to tick the file that ticks all the other needed files, which for the Northern Star is called northern_star.dm.
114 lines
4.3 KiB
Plaintext
114 lines
4.3 KiB
Plaintext
|
|
var/datum/map/using_map = new USING_MAP_DATUM
|
|
var/list/all_maps = list()
|
|
|
|
/hook/startup/proc/initialise_map_list()
|
|
for(var/type in typesof(/datum/map) - /datum/map)
|
|
var/datum/map/M
|
|
if(type == using_map.type)
|
|
M = using_map
|
|
M.setup_map()
|
|
else
|
|
M = new type
|
|
if(!M.path)
|
|
log_debug("Map '[M]' does not have a defined path, not adding to map list!")
|
|
else
|
|
all_maps[M.path] = M
|
|
return 1
|
|
|
|
|
|
/datum/map
|
|
var/name = "Unnamed Map"
|
|
var/full_name = "Unnamed Map"
|
|
var/path
|
|
|
|
var/list/station_levels = list() // Z-levels the station exists on
|
|
var/list/admin_levels = list() // Z-levels for admin functionality (Centcom, shuttle transit, etc)
|
|
var/list/contact_levels = list() // Z-levels that can be contacted from the station, for eg announcements
|
|
var/list/player_levels = list() // Z-levels a character can typically reach
|
|
var/list/sealed_levels = list() // Z-levels that don't allow random transit at edge
|
|
var/list/empty_levels = null // Empty Z-levels that may be used for various things (currently used by bluespace jump)
|
|
|
|
var/list/map_levels // Z-levels available to various consoles, such as the crew monitor (when that gets coded in). Defaults to station_levels if unset.
|
|
var/list/base_turf_by_z = list() // Custom base turf by Z-level. Defaults to world.turf for unlisted Z-levels
|
|
|
|
//This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there.
|
|
var/list/accessible_z_levels = list()
|
|
|
|
var/list/allowed_jobs = list() //Job datums to use.
|
|
//Works a lot better so if we get to a point where three-ish maps are used
|
|
//We don't have to C&P ones that are only common between two of them
|
|
//That doesn't mean we have to include them with the rest of the jobs though, especially for map specific ones.
|
|
//Also including them lets us override already created jobs, letting us keep the datums to a minimum mostly.
|
|
//This is probably a lot longer explanation than it needs to be.
|
|
|
|
var/station_name = "BAD Station"
|
|
var/station_short = "Baddy"
|
|
var/dock_name = "THE PirateBay"
|
|
var/boss_name = "Captain Roger"
|
|
var/boss_short = "Cap'"
|
|
var/company_name = "BadMan"
|
|
var/company_short = "BM"
|
|
var/starsys_name = "Dull Star"
|
|
|
|
var/shuttle_docked_message
|
|
var/shuttle_leaving_dock
|
|
var/shuttle_called_message
|
|
var/shuttle_recall_message
|
|
var/emergency_shuttle_docked_message
|
|
var/emergency_shuttle_leaving_dock
|
|
var/emergency_shuttle_called_message
|
|
var/emergency_shuttle_recall_message
|
|
|
|
var/list/station_networks = list() // Camera networks that will show up on the console.
|
|
|
|
var/allowed_spawns = list("Arrivals Shuttle","Gateway", "Cryogenic Storage", "Cyborg Storage")
|
|
|
|
var/lobby_icon = 'icons/misc/title.dmi' // The icon which contains the lobby image(s)
|
|
var/list/lobby_screens = list("mockingjay00") // The list of lobby screen to pick() from. If left unset the first icon state is always selected.
|
|
|
|
var/default_law_type = /datum/ai_laws/nanotrasen // The default lawset use by synth units, if not overriden by their laws var.
|
|
|
|
var/id_hud_icons = 'icons/mob/hud.dmi' // Used by the ID HUD (primarily sechud) overlay.
|
|
|
|
/datum/map/New()
|
|
..()
|
|
if(!map_levels)
|
|
map_levels = station_levels.Copy()
|
|
if(!allowed_jobs || !allowed_jobs.len)
|
|
allowed_jobs = subtypesof(/datum/job)
|
|
|
|
/datum/map/proc/setup_map()
|
|
return
|
|
|
|
/datum/map/proc/perform_map_generation()
|
|
return
|
|
|
|
// Used to apply various post-compile procedural effects to the map.
|
|
/datum/map/proc/refresh_mining_turfs()
|
|
|
|
set background = 1
|
|
set waitfor = 0
|
|
|
|
// Update all turfs to ensure everything looks good post-generation. Yes,
|
|
// it's brute-forcey, but frankly the alternative is a mine turf rewrite.
|
|
for(var/turf/simulated/mineral/M in world) // Ugh.
|
|
M.update_icon()
|
|
|
|
/datum/map/proc/get_network_access(var/network)
|
|
return 0
|
|
|
|
// By default transition randomly to another zlevel
|
|
/datum/map/proc/get_transit_zlevel(var/current_z_level)
|
|
var/list/candidates = using_map.accessible_z_levels.Copy()
|
|
candidates.Remove(num2text(current_z_level))
|
|
|
|
if(!candidates.len)
|
|
return current_z_level
|
|
return text2num(pickweight(candidates))
|
|
|
|
/datum/map/proc/get_empty_zlevel()
|
|
if(empty_levels == null)
|
|
world.maxz++
|
|
empty_levels = list(world.maxz)
|
|
return pick(empty_levels) |