diff --git a/_mapload/_basemap.dm b/_mapload/_basemap.dm index 0a5b7ba9150..0ae8119d18c 100644 --- a/_mapload/_basemap.dm +++ b/_mapload/_basemap.dm @@ -1,16 +1,9 @@ -/// Uncomment this to load centcom and runtime station and thats it. -// #define LOWMEMORYMODE +/// load in the first reserved level, necessary to not have Dream Daemon start in MUD mode. +#include "_basemap.dmm" -#include "../maps/core/reservation_base_level.dmm" +#ifdef ALL_MAPS -/** - * This map is 25x25x1. - * The zlevel will expand as the world loads. - */ -#ifndef LOWMEMORYMODE - #ifdef ALL_MAPS - #ifdef CIBUILDING - #include "..\maps\templates.dm" - #endif + #ifdef CIBUILDING + #include "..\maps\templates.dm" #endif #endif diff --git a/maps/core/reservation_base_level.dmm b/_mapload/_basemap.dmm similarity index 100% rename from maps/core/reservation_base_level.dmm rename to _mapload/_basemap.dmm diff --git a/_mapload/rift.dm b/_mapload/rift.dm index 9f77578b474..d311859b20b 100644 --- a/_mapload/rift.dm +++ b/_mapload/rift.dm @@ -1 +1 @@ -#define FORCE_MAP "_mapload/rift.json" +#define FORCE_MAP "rift" diff --git a/_mapload/rift.json b/_mapload/rift.json deleted file mode 100644 index 7f60620ad62..00000000000 --- a/_mapload/rift.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "map_name":"Rift", - "map_path":"map_files/rift", - "map_file":[ - "rift-01-underground3.dmm", - "rift-02-underground2.dmm", - "rift-03-underground1.dmm", - "rift-04-surface1.dmm", - "rift-05-surface2.dmm", - "rift-06-surface3.dmm", - "rift-07-west_base.dmm", - "rift-08-west_deep.dmm", - "rift-09-west_caves.dmm", - "rift-10-west_plains.dmm", - "rift-11-orbital.dmm" - ], - "traits":[ - { - "Up":1, - "Station":true, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/floor/outdoors/safeice/lythios43c/indoors", - "FacilityWeaponLock":true - }, - { - "Up":1, - "Down":-1, - "Station":true, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/floor/outdoors/safeice/lythios43c/indoors", - "FacilityWeaponLock":true - }, - { - "Up":1, - "Down":-1, - "Station":true, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":true - }, - { - "Up":1, - "Down":-1, - "Station":true, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":true - }, - { - "Up":1, - "Down":-1, - "Station":true, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":true - }, - { - "Down":-1, - "Station":true, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":true - }, - { - "Up":1, - "Station":false, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/floor/outdoors/safeice/lythios43c/indoors", - "FacilityWeaponLock":false - }, - { - "Up":1, - "Down":-1, - "Station":false, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":false - }, - { - "Up":1, - "Down":-1, - "Station":false, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":false - }, - { - "Down":-1, - "Station":false, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/simulated/open", - "FacilityWeaponLock":false - }, - { - "Station":false, - "Linkage":null, - "Gravity":true, - "Baseturf":"/turf/space", - "FacilityWeaponLock":false - } - ], - "minetype":"none" -} diff --git a/citadel.dme b/citadel.dme index 0f10cb9e5ef..cd1b3d1af7d 100644 --- a/citadel.dme +++ b/citadel.dme @@ -14,7 +14,6 @@ // BEGIN_INCLUDE #include "_mapload\_basemap.dm" -#include "_mapload\rift.dm" #include "code\___compile_options.dm" #include "code\__byond_version_compat.dm" #include "code\__global_init.dm" @@ -84,7 +83,6 @@ #include "code\__DEFINES\stat_tracking.dm" #include "code\__DEFINES\statpanel.dm" #include "code\__DEFINES\storage.dm" -#include "code\__DEFINES\strack_trace.dm" #include "code\__DEFINES\targeting.dm" #include "code\__DEFINES\text.dm" #include "code\__DEFINES\tgs.config.dm" @@ -205,7 +203,11 @@ #include "code\__DEFINES\languages\ids.dm" #include "code\__DEFINES\languages\legacy.dm" #include "code\__DEFINES\languages\translation.dm" +#include "code\__DEFINES\mapping\levels.dm" +#include "code\__DEFINES\mapping\maploader.dm" +#include "code\__DEFINES\mapping\maps.dm" #include "code\__DEFINES\mapping\multiz.dm" +#include "code\__DEFINES\mapping\system.dm" #include "code\__DEFINES\mining\legacy.dm" #include "code\__DEFINES\misc\message_ranges.dm" #include "code\__DEFINES\mobs\actions.dm" @@ -372,6 +374,7 @@ #include "code\__HELPERS\type2type\color.dm" #include "code\__HELPERS\type2type\type2type.dm" #include "code\__HELPERS\unsorted\contents.dm" +#include "code\__HELPERS\unsorted\locate.dm" #include "code\__HELPERS\unsorted\radiation.dm" #include "code\__HELPERS\vfx\appearance_cloning.dm" #include "code\__HELPERS\vfx\color_animations.dm" @@ -514,6 +517,8 @@ #include "code\controllers\subsystem\icon_smooth.dm" #include "code\controllers\subsystem\inactivity.dm" #include "code\controllers\subsystem\input.dm" +#include "code\controllers\subsystem\legacy_atc.dm" +#include "code\controllers\subsystem\legacy_lore.dm" #include "code\controllers\subsystem\lighting.dm" #include "code\controllers\subsystem\lobby.dm" #include "code\controllers\subsystem\machines.dm" @@ -569,9 +574,19 @@ #include "code\controllers\subsystem\job\roundstart.dm" #include "code\controllers\subsystem\job\spawnpoints.dm" #include "code\controllers\subsystem\mapping\_mapping.dm" -#include "code\controllers\subsystem\mapping\_shims.dm" +#include "code\controllers\subsystem\mapping\allocation.dm" +#include "code\controllers\subsystem\mapping\boot.dm" +#include "code\controllers\subsystem\mapping\levels.dm" +#include "code\controllers\subsystem\mapping\maps.dm" #include "code\controllers\subsystem\mapping\misc.dm" #include "code\controllers\subsystem\mapping\obfuscation.dm" +#include "code\controllers\subsystem\mapping\reservations.dm" +#include "code\controllers\subsystem\mapping\level_helpers\air.dm" +#include "code\controllers\subsystem\mapping\level_helpers\attributes.dm" +#include "code\controllers\subsystem\mapping\level_helpers\baseturf.dm" +#include "code\controllers\subsystem\mapping\level_helpers\linkage.dm" +#include "code\controllers\subsystem\mapping\level_helpers\lookup.dm" +#include "code\controllers\subsystem\mapping\level_helpers\traits.dm" #include "code\controllers\subsystem\networks\_networks.dm" #include "code\controllers\subsystem\networks\simple.dm" #include "code\controllers\subsystem\persistence\_persistence.dm" @@ -2175,8 +2190,6 @@ #include "code\modules\blob2\overmind\overmind.dm" #include "code\modules\blob2\overmind\powers.dm" #include "code\modules\blob2\overmind\types.dm" -#include "code\modules\busy_space\air_traffic.dm" -#include "code\modules\busy_space\loremaster.dm" #include "code\modules\busy_space\organizations.dm" #include "code\modules\cargo\supplypacks\_supplypacks.dm" #include "code\modules\cargo\supplypacks\atmospherics.dm" @@ -2877,22 +2890,24 @@ #include "code\modules\lore_hardcoded\species\xenomorph_hybrid\culture.dm" #include "code\modules\lore_hardcoded\species\xenomorph_hybrid\origin.dm" #include "code\modules\lore_hardcoded\species\xenomorph_hybrid\religion.dm" -#include "code\modules\mapping\map_config.dm" -#include "code\modules\mapping\map_orientation_patterns.dm" +#include "code\modules\mapping\map.dm" +#include "code\modules\mapping\map_level.dm" +#include "code\modules\mapping\map_template.dm" #include "code\modules\mapping\minimaps.dm" -#include "code\modules\mapping\preloader.dm" +#include "code\modules\mapping\multiz_helpers.dm" #include "code\modules\mapping\shuttle.dm" #include "code\modules\mapping\submap.dm" +#include "code\modules\mapping\submaps_legacy.dm" +#include "code\modules\mapping\turf_reservation.dm" +#include "code\modules\mapping\loader\loader.dm" +#include "code\modules\mapping\loader\orientation.dm" +#include "code\modules\mapping\loader\preloader.dm" +#include "code\modules\mapping\loader\verify.dm" +#include "code\modules\mapping\loader\wrappers.dm" #include "code\modules\mapping\map_helpers\_map_helpers.dm" #include "code\modules\mapping\map_helpers\baseturf.dm" #include "code\modules\mapping\map_helpers\network_builder\_network_builder.dm" #include "code\modules\mapping\map_helpers\network_builder\power_cable.dm" -#include "code\modules\mapping\space_management\multiz_helpers.dm" -#include "code\modules\mapping\space_management\space_level.dm" -#include "code\modules\mapping\space_management\space_reservation.dm" -#include "code\modules\mapping\space_management\space_transition.dm" -#include "code\modules\mapping\space_management\traits.dm" -#include "code\modules\mapping\space_management\zlevel_manager.dm" #include "code\modules\mapping\spawner\_spawner.dm" #include "code\modules\mapping\spawner\window.dm" #include "code\modules\maps\_shim\away_spawner.dm" @@ -2901,13 +2916,6 @@ #include "code\modules\maps\away_missions\140x140\snow_outpost.dm" #include "code\modules\maps\away_missions\140x140\snowfield.dm" #include "code\modules\maps\away_missions\140x140\zoo.dm" -#include "code\modules\maps\lateload\generic\_lateload.dm" -#include "code\modules\maps\lateload\generic\gateway_lateload.dm" -#include "code\modules\maps\lateload\generic\planets_lateload.dm" -#include "code\modules\maps\lateload\generic\space_lateload.dm" -#include "code\modules\maps\lateload\generic\unique_lateload.dm" -#include "code\modules\maps\lateload\station_specific\_tether_lateload.dm" -#include "code\modules\maps\lateload\station_specific\_triumph_submaps.dm" #include "code\modules\maps\misc_maps\geothermal_vent\geothermal_vent.dm" #include "code\modules\maps\misc_maps\lavaland\_lavaland.dm" #include "code\modules\maps\overmap\planets\_lythios43c.dm" @@ -2971,10 +2979,6 @@ #include "code\modules\maps\templates\submaps\virgo4\mountains_areas.dm" #include "code\modules\maps\templates\submaps\wilderness\wilderness.dm" #include "code\modules\maps\templates\submaps\wilderness\wilderness_areas.dm" -#include "code\modules\maps\tg\dmm_suite.dm" -#include "code\modules\maps\tg\map_template.dm" -#include "code\modules\maps\tg\map_template_vr.dm" -#include "code\modules\maps\tg\reader.dm" #include "code\modules\maps\turf_makers\planetary_turfs.dm" #include "code\modules\maps\turf_makers\planet_station_turfs\_lythios43c.dm" #include "code\modules\maps\turf_makers\planet_station_turfs\_triumph.dm" @@ -4685,10 +4689,23 @@ #include "maps\overmap\shuttles\skipjack.dm" #include "maps\overmap\shuttles\specialops.dm" #include "maps\rift\rift.dm" +#include "maps\rift\rift_shuttles.dm" +#include "maps\rift\rift_telecomms.dm" +#include "maps\rift\rift_things.dm" #include "maps\rift\titlescreens.dm" +#include "maps\sectors\debrisfield_192\debrisfield_192.dm" +#include "maps\sectors\desert_192\desert_192.dm" +#include "maps\sectors\frozen_192\frozen_192.dm" +#include "maps\sectors\gaia_192\gaia_192.dm" +#include "maps\sectors\lavaland_192\lavaland_192.dm" +#include "maps\sectors\miaphus_192\miaphus_192.dm" +#include "maps\sectors\mining_192\mining_192.dm" +#include "maps\sectors\piratebase_192\piratebase_192.dm" +#include "maps\sectors\roguemining_192\roguemining_192.dm" +#include "maps\sectors\tradeport_192\tradeport_192.dm" +#include "maps\sectors\wasteland_192\wasteland_192.dm" #include "maps\submaps\_helpers.dm" #include "maps\submaps\_readme.dm" #include "maps\submaps\engine_submaps\engine.dm" #include "maps\submaps\level_specific\debrisfield_vr\debrisfield_things.dm" -#include "maps\~map_system\maps.dm" // END_INCLUDE diff --git a/code/__DEFINES/_core.dm b/code/__DEFINES/_core.dm index c1291fbb7ba..d311a97e88d 100644 --- a/code/__DEFINES/_core.dm +++ b/code/__DEFINES/_core.dm @@ -5,3 +5,9 @@ #define STACK_TRACE(msg) try { CRASH("trace: [msg]"); } catch(var/exception/___E) {___rethrow_exception(___E); }; /proc/___rethrow_exception(exception/E) throw E + +/// Gives us the stack trace from CRASH() without ending the current proc. +/// Unlike STACK_TRACE, this will: +/// * call a new proc so the originating trace isn't from the original file anymore +/// * put the stack trace in stack trace storage +#define stack_trace(message) _stack_trace(message, __FILE__, __LINE__) diff --git a/code/__DEFINES/controllers/_subsystems.dm b/code/__DEFINES/controllers/_subsystems.dm index cc5df181667..3e581ec5497 100644 --- a/code/__DEFINES/controllers/_subsystems.dm +++ b/code/__DEFINES/controllers/_subsystems.dm @@ -83,7 +83,6 @@ DEFINE_BITFIELD(runlevels, list( #define INIT_ORDER_REPOSITORY 180 #define INIT_ORDER_STATPANELS 170 #define INIT_ORDER_INPUT 160 -#define INIT_ORDER_LOBBY 155 #define INIT_ORDER_JOBS 150 #define INIT_ORDER_CHARACTERS 140 #define INIT_ORDER_SOUNDS 130 @@ -96,6 +95,9 @@ DEFINE_BITFIELD(runlevels, list( #define INIT_ORDER_MATERIALS 30 #define INIT_ORDER_PHOTOGRAPHY 27 #define INIT_ORDER_MAPPING 25 +#define INIT_ORDER_LEGACY_ATC 24 +#define INIT_ORDER_LEGACY_LORE 23 +#define INIT_ORDER_LOBBY 22 #define INIT_ORDER_DECALS 20 #define INIT_ORDER_PLANTS 19 #define INIT_ORDER_ALARMS 18 diff --git a/code/__DEFINES/holomap.dm b/code/__DEFINES/holomap.dm index bd35db6e53a..e1239fd9cbf 100644 --- a/code/__DEFINES/holomap.dm +++ b/code/__DEFINES/holomap.dm @@ -31,10 +31,10 @@ #define LIST_NUMERIC_SET(L, I, V) if(!L) { L = list(); } if (L.len < I) { L.len = I; } L[I] = V // Handy defines to lookup the pixel offsets for this Z-level. Cache these if you use them in a loop tho. -#define HOLOMAP_PIXEL_OFFSET_X(zLevel) ((GLOB.using_map.holomap_offset_x.len >= zLevel) ? GLOB.using_map.holomap_offset_x[zLevel] : 0) -#define HOLOMAP_PIXEL_OFFSET_Y(zLevel) ((GLOB.using_map.holomap_offset_y.len >= zLevel) ? GLOB.using_map.holomap_offset_y[zLevel] : 0) -#define HOLOMAP_LEGEND_X(zLevel) ((GLOB.using_map.holomap_legend_x.len >= zLevel) ? GLOB.using_map.holomap_legend_x[zLevel] : 96) -#define HOLOMAP_LEGEND_Y(zLevel) ((GLOB.using_map.holomap_legend_y.len >= zLevel) ? GLOB.using_map.holomap_legend_y[zLevel] : 96) +#define HOLOMAP_PIXEL_OFFSET_X(zLevel) (((LEGACY_MAP_DATUM).holomap_offset_x.len >= zLevel) ? (LEGACY_MAP_DATUM).holomap_offset_x[zLevel] : 0) +#define HOLOMAP_PIXEL_OFFSET_Y(zLevel) (((LEGACY_MAP_DATUM).holomap_offset_y.len >= zLevel) ? (LEGACY_MAP_DATUM).holomap_offset_y[zLevel] : 0) +#define HOLOMAP_LEGEND_X(zLevel) (((LEGACY_MAP_DATUM).holomap_legend_x.len >= zLevel) ? (LEGACY_MAP_DATUM).holomap_legend_x[zLevel] : 96) +#define HOLOMAP_LEGEND_Y(zLevel) (((LEGACY_MAP_DATUM).holomap_legend_y.len >= zLevel) ? (LEGACY_MAP_DATUM).holomap_legend_y[zLevel] : 96) // VG stuff we probably won't use // #define HOLOMAP_FILTER_DEATHSQUAD 1 diff --git a/code/__DEFINES/mapping/levels.dm b/code/__DEFINES/mapping/levels.dm new file mode 100644 index 00000000000..5439aae3a18 --- /dev/null +++ b/code/__DEFINES/mapping/levels.dm @@ -0,0 +1,47 @@ +//! Everything regarding space levels go in here + +//? "linkage" + +// Linkage types - Normal linkage variables override these, so don't set them if you use these. +/// Default - don't preprocess for unlinked sides, just leave them empty +#define Z_LINKAGE_NORMAL "normal" +/// Crosslinked - crosslink with other crosslinked zlevels at random using some semblence of continuity +#define Z_LINKAGE_CROSSLINKED "crosslink" +/// Selflooping - automatically link to itself for unlinked sides +#define Z_LINKAGE_SELFLOOP "selfloop" + +//? "transition" + +// Transition types +/// Default - one from map edge unless there's an indestructible wall *on either side* +#define Z_TRANSITION_DEFAULT "default" +/// Disabled - generate none +#define Z_TRANSITION_DISABLED "disabled" +/// Invisible - generate borders but don't do mirage visuals +#define Z_TRANSITION_INVISIBLE "invisible" +/// Forced - always generate transition borders +#define Z_TRANSITION_FORCED "forced" + +//? "attributes" + +//? "traits" + +/// level is considered main station (if there's two both will have this; adding support for multi-station later) +#define ZTRAIT_STATION "station" +/// level has innate gravity (planets hello) +#define ZTRAIT_GRAVITY "gravity" +/// level should generate on minimaps +#define ZTRAIT_MINIMAP "minimap" +/// level is reserved space, we cannot treat the entire level as the same logical level +#define ZTRAIT_RESERVED "reserved" +/// level is admin space, don't let people fuck around with it via teleportation/otherwise +#define ZTRAIT_ADMIN "admin" +/// exploration pinned weapons don't work on this level +#define ZTRAIT_FACILITY_SAFETY "facility_safety" +/// xenoarcheology shouldn't generate here +#define ZTRAIT_XENOARCH_EXEMPT "xenoarch_exempt" + +#define ZTRAIT_LEGACY_HOLOMAP_SMOOSH "_holomap_smoosh" +#define ZTRAIT_LEGACY_BELTER_DOCK "_belter_dock" +#define ZTRAIT_LEGACY_BELTER_TRANSIT "_belter_transit" +#define ZTRAIT_LEGACY_BELTER_ACTIVE "_belter_active" diff --git a/code/__DEFINES/mapping/maploader.dm b/code/__DEFINES/mapping/maploader.dm new file mode 100644 index 00000000000..32a23b97288 --- /dev/null +++ b/code/__DEFINES/mapping/maploader.dm @@ -0,0 +1,10 @@ + +// Maploader bounds indices +#define MAP_MINX 1 +#define MAP_MINY 2 +#define MAP_MINZ 3 +#define MAP_MAXX 4 +#define MAP_MAXY 5 +#define MAP_MAXZ 6 +// length +#define MAP_BOUNDS 6 diff --git a/code/__DEFINES/mapping/maps.dm b/code/__DEFINES/mapping/maps.dm new file mode 100644 index 00000000000..8fa32d0eb9b --- /dev/null +++ b/code/__DEFINES/mapping/maps.dm @@ -0,0 +1,3 @@ + +// todo: legacy - just a pointer to SSmapping.loaded_station, so we know what instances still need replacing. +#define LEGACY_MAP_DATUM SSmapping.loaded_station diff --git a/code/__DEFINES/mapping/system.dm b/code/__DEFINES/mapping/system.dm new file mode 100644 index 00000000000..b713e17b37c --- /dev/null +++ b/code/__DEFINES/mapping/system.dm @@ -0,0 +1,8 @@ +/// reserved turf type +#define RESERVED_TURF_TYPE /turf/space/basic +/// reserved area type +#define RESERVED_AREA_TYPE /area/space +/// reservation resolution - this drastically decreases the amount of time used to search for a spot for reservation. +/// set this to a value that's slightly above average of a common multiplier for reservation sizes. +#define RESERVED_TURF_RESOLUTION 8 + diff --git a/code/__DEFINES/maps.dm b/code/__DEFINES/maps.dm index e65516ee3d2..3134f09fcbe 100644 --- a/code/__DEFINES/maps.dm +++ b/code/__DEFINES/maps.dm @@ -1,170 +1,23 @@ + +// ! DO NOT USE ; USE NEW TRAITS SYSTEM. !// + // Z-level flags bitfield - Set these flags to determine the z level's purpose /// Z-levels the station exists on -#define MAP_LEVEL_STATION 0x001 +#define LEGACY_LEVEL_STATION 0x001 /// Z-levels for admin functionality (Centcom, shuttle transit, etc) -#define MAP_LEVEL_ADMIN 0x002 +#define LEGACY_LEVEL_ADMIN 0x002 /// Z-levels that can be contacted from the station, for eg announcements -#define MAP_LEVEL_CONTACT 0x004 +#define LEGACY_LEVEL_CONTACT 0x004 /// Z-levels a character can typically reach -#define MAP_LEVEL_PLAYER 0x008 +#define LEGACY_LEVEL_PLAYER 0x008 /// Z-levels that don't allow random transit at edge -#define MAP_LEVEL_SEALED 0x010 -/// Empty Z-levels that may be used for various things (currently used by bluespace jump) -#define MAP_LEVEL_EMPTY 0x020 +#define LEGACY_LEVEL_SEALED 0x010 /// Z-levels available to various consoles, such as the crew monitor (when that gets coded in). Defaults to station_levels if unset. -#define MAP_LEVEL_CONSOLES 0x040 -/// Z-levels exempt from xenoarch digsite generation. -#define MAP_LEVEL_XENOARCH_EXEMPT 0x080 +#define LEGACY_LEVEL_CONSOLES 0x040 // Misc map defines. /// Automatically created submaps are forbidden from being this close to the main map's edge. #define SUBMAP_MAP_EDGE_PAD 8 -// TG MAP LOADING SYSTEM PENDING -/* -The /tg/ codebase allows mixing of hardcoded and dynamically-loaded z-levels. -Z-levels can be reordered as desired and their properties are set by "traits". -See map_config.dm for how a particular station's traits may be chosen. -The list DEFAULT_MAP_TRAITS at the bottom of this file should correspond to -the maps that are hardcoded, as set in _mapload/_basemap.dm. SSmapping is -responsible for loading every non-hardcoded z-level. - -As of 2018-02-04, the typical z-levels for a single-level station are: -1: CentCom -2: Station -3-4: Randomized space -5: Mining -6: City of Cogs -7-11: Randomized space -12: Empty space -13: Transit space - -Multi-Z stations are supported and multi-Z mining and away missions would -require only minor tweaks. -*/ - -/* -// helpers for modifying jobs, used in various job_changes.dm files -#define MAP_JOB_CHECK if(SSmapping.config.map_name != JOB_MODIFICATION_MAP_NAME) { return; } -#define MAP_JOB_CHECK_BASE if(SSmapping.config.map_name != JOB_MODIFICATION_MAP_NAME) { return ..(); } -#define MAP_REMOVE_JOB(jobpath) /datum/role/job/##jobpath/map_check() { return (SSmapping.config.map_name != JOB_MODIFICATION_MAP_NAME) && ..() } - -#define SPACERUIN_MAP_EDGE_PAD 15 - -// traits -// boolean - marks a level as having that property if present -*/ -#define ZTRAIT_CENTCOM "CentCom" -#define ZTRAIT_STATION "Station" -#define ZTRAIT_MINING "Mining" -#define ZTRAIT_FACILITY_SAFETY "FacilityWeaponLock" -/* -#define ZTRAIT_REEBE "Reebe" -*/ -#define ZTRAIT_RESERVED "Transit/Reserved" -#define ZTRAIT_AWAY "Away Mission" -/* -#define ZTRAIT_VR "Virtual Reality" -#define ZTRAIT_SPACE_RUINS "Space Ruins" -#define ZTRAIT_LAVA_RUINS "Lava Ruins" -#define ZTRAIT_ICE_RUINS "Ice Ruins" -#define ZTRAIT_ICE_RUINS_UNDERGROUND "Ice Ruins Underground" -///Placing ruins on z levels with this trait will use turf reservation instead of usual placement. -#define ZTRAIT_ISOLATED_RUINS "Isolated Ruins" -#define ZTRAIT_VIRTUAL_REALITY "Virtual Reality" - -//boolean - weather types that occur on the level -#define ZTRAIT_SNOWSTORM "Weather_Snowstorm" -#define ZTRAIT_ASHSTORM "Weather_Ashstorm" -#define ZTRAIT_ACIDRAIN "Weather_Acidrain" -*/ - -// number - bombcap is multiplied by this before being applied to bombs -#define ZTRAIT_BOMBCAP_MULTIPLIER "Bombcap Multiplier" - -// number - default gravity if there's no gravity generators or area overrides present -#define ZTRAIT_GRAVITY "Gravity" - -// numeric offsets - e.g. {"Down": -1} means that chasms will fall to z - 1 rather than oblivion -#define ZTRAIT_UP "Up" -#define ZTRAIT_DOWN "Down" - -// string - level name -#define ZTRAIT_NAME "Name" - -// enum - how space transitions should affect this level -#define ZTRAIT_LINKAGE "Linkage" - // UNAFFECTED if absent - no space transitions - #define UNAFFECTED null - // SELFLOOPING - space transitions always self-loop - #define SELFLOOPING "Self" - // CROSSLINKED - mixed in with the cross-linked space pool - #define CROSSLINKED "Cross" - -// string - type path of the z-level's baseturf (defaults to space) -#define ZTRAIT_BASETURF "Baseturf" - -/// Default gas string. Use for things like setting planetary gasmixtures and such. ATMOSPHERE_ID_USE_ZTRAIT to have a turf use it. -#define ZTRAIT_DEFAULT_ATMOS "Default Gas String" - -// default trait definitions, used by SSmapping -#define ZTRAITS_CENTCOM list(ZTRAIT_CENTCOM = TRUE) -#define ZTRAITS_STATION list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_STATION = TRUE) -#define ZTRAITS_SPACE list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_SPACE_RUINS = TRUE) -/* -#define ZTRAITS_LAVALAND list(\ - ZTRAIT_MINING = TRUE, \ - ZTRAIT_ASHSTORM = TRUE, \ - ZTRAIT_LAVA_RUINS = TRUE, \ - ZTRAIT_BOMBCAP_MULTIPLIER = 5, \ - ZTRAIT_BASETURF = /turf/open/lava/smooth/lava_land_surface) -#define ZTRAITS_REEBE list(ZTRAIT_REEBE = TRUE, ZTRAIT_BOMBCAP_MULTIPLIER = 0.5) -#define ZTRAITS_VR list(ZTRAIT_VIRTUAL_REALITY = TRUE, ZTRAIT_AWAY = TRUE) -*/ - -#define DL_NAME "name" -#define DL_TRAITS "traits" -#define DECLARE_LEVEL(NAME, TRAITS) list(DL_NAME = NAME, DL_TRAITS = TRAITS) - -// must correspond to _basemap.dm for things to work correctly -#define DEFAULT_MAP_TRAITS list(\ - DECLARE_LEVEL("Base Reserve Level", list(ZTRAIT_RESERVEd = TRUE)),\ -) - -/* -// Camera lock flags -#define CAMERA_LOCK_STATION 1 -#define CAMERA_LOCK_MINING 2 -#define CAMERA_LOCK_CENTCOM 4 -#define CAMERA_LOCK_REEBE 8 -*/ - -//Reserved/Transit turf type -#define RESERVED_TURF_TYPE /turf/space -// #define RESERVED_TURF_TYPE /turf/space/basic //What the turf is when not being used - -/* -//Ruin Generation - -///How many times we try to fit the ruin somewhere until giving up (really should just swap to some packing algo) -#define PLACEMENT_TRIES 100 -#define PLACE_DEFAULT "random" -///On same z level as original ruin -#define PLACE_SAME_Z "same" -///On space ruin z level(s) -#define PLACE_SPACE_RUIN "space" -///On lavaland ruin z levels(s) -#define PLACE_LAVA_RUIN "lavaland" -///On z levl below - centered on same tile -#define PLACE_BELOW "below" -///On isolated ruin z level -#define PLACE_ISOLATED "isolated" -//Map type stuff. -#define MAP_TYPE_STATION "station" - -//Random z-levels name defines. -#define AWAY_MISSION_NAME "Away Mission" -#define VIRT_REALITY_NAME "Virtual Reality" -*/ /// Distance from edge to move to another z-level. #define TRANSITIONEDGE 1 diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 4a56e0db5f4..b9fc2fbd5c0 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -318,14 +318,6 @@ var/list/economy_station_departments = list( /// Maximum effective value of client.view (According to DM references) #define MAX_CLIENT_VIEW 34 -// Maploader bounds indices -#define MAP_MINX 1 -#define MAP_MINY 2 -#define MAP_MINZ 3 -#define MAP_MAXX 4 -#define MAP_MAXY 5 -#define MAP_MAXZ 6 - // /atom/proc/use_check flags #define USE_ALLOW_NONLIVING 1 #define USE_ALLOW_NON_ADV_TOOL_USR 2 diff --git a/code/__DEFINES/strack_trace.dm b/code/__DEFINES/strack_trace.dm deleted file mode 100644 index 76ea8b60f27..00000000000 --- a/code/__DEFINES/strack_trace.dm +++ /dev/null @@ -1,2 +0,0 @@ -/// Gives us the stack trace from CRASH() without ending the current proc. -#define stack_trace(message) _stack_trace(message, __FILE__, __LINE__) diff --git a/code/__HELPERS/events.dm b/code/__HELPERS/events.dm index 4d1e5e06bbd..0d49e6d2155 100644 --- a/code/__HELPERS/events.dm +++ b/code/__HELPERS/events.dm @@ -11,7 +11,7 @@ for(var/areapath in typesof(parentpath)) // Check if it actually exists. var/area/A = locate(areapath) - if(istype(A) && (A.z in GLOB.using_map.player_levels)) + if(istype(A) && (A.z in (LEGACY_MAP_DATUM).player_levels)) grand_list_of_areas += A return grand_list_of_areas diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 5684c12619e..f145c4a9a22 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -11,17 +11,17 @@ /proc/is_on_same_plane_or_station(z1, z2) if (z1 == z2) return TRUE - if ((z1 in GLOB.using_map.station_levels) && (z2 in GLOB.using_map.station_levels)) + if ((z1 in (LEGACY_MAP_DATUM).station_levels) && (z2 in (LEGACY_MAP_DATUM).station_levels)) return TRUE return FALSE /proc/max_default_z_level() var/max_z = 0 - for(var/z in GLOB.using_map.station_levels) + for(var/z in (LEGACY_MAP_DATUM).station_levels) max_z = max(z, max_z) - for(var/z in GLOB.using_map.admin_levels) + for(var/z in (LEGACY_MAP_DATUM).admin_levels) max_z = max(z, max_z) - for(var/z in GLOB.using_map.player_levels) + for(var/z in (LEGACY_MAP_DATUM).player_levels) max_z = max(z, max_z) return max_z @@ -94,16 +94,16 @@ processing += A.contents /proc/isStationLevel(level) - return level in GLOB.using_map.station_levels + return level in (LEGACY_MAP_DATUM).station_levels /proc/isNotStationLevel(level) return !isStationLevel(level) /proc/isPlayerLevel(level) - return level in GLOB.using_map.player_levels + return level in (LEGACY_MAP_DATUM).player_levels /proc/isAdminLevel(level) - return level in GLOB.using_map.admin_levels + return level in (LEGACY_MAP_DATUM).admin_levels /proc/isNotAdminLevel(level) return !isAdminLevel(level) diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index b1c23acdb82..0e01f3b00c8 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -16,12 +16,12 @@ var/church_name = null return name /proc/command_name() - if(istype(GLOB.using_map)) - return GLOB.using_map.boss_name + if(istype((LEGACY_MAP_DATUM))) + return (LEGACY_MAP_DATUM).boss_name /proc/change_command_name(var/name) - GLOB.using_map.boss_name = name + (LEGACY_MAP_DATUM).boss_name = name return name @@ -38,11 +38,11 @@ var/religion_name = null return capitalize(name) /proc/system_name() - return GLOB.using_map.starsys_name + return (LEGACY_MAP_DATUM).starsys_name /proc/station_name() - if (GLOB.using_map.station_name) - return GLOB.using_map.station_name + if ((LEGACY_MAP_DATUM)?.station_name) + return (LEGACY_MAP_DATUM).station_name var/random = rand(1,5) var/name = "" @@ -102,7 +102,7 @@ var/religion_name = null // Is this even used? /proc/world_name(var/name) - GLOB.using_map.station_name = name + (LEGACY_MAP_DATUM).station_name = name if(config_legacy?.server_name) world.name = "[config_legacy.server_name]: [name]" diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index bcce05b7f49..daa2da4e0e9 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -836,7 +836,7 @@ var/old_underlays = T.underlays.Copy() if(platingRequired) - if(istype(B, GLOB.using_map.base_turf_by_z[B.z])) + if(istype(B, SSmapping.level_baseturf(B.z))) continue moving var/turf/X = B diff --git a/code/__HELPERS/unsorted/locate.dm b/code/__HELPERS/unsorted/locate.dm new file mode 100644 index 00000000000..5b4113888dc --- /dev/null +++ b/code/__HELPERS/unsorted/locate.dm @@ -0,0 +1,6 @@ +/proc/clamped_locate(x, y, z) + return locate( + clamp(x, 1, world.maxx), + clamp(y, 1, world.maxy), + z, + ) diff --git a/code/___compile_options.dm b/code/___compile_options.dm index 8b58a18071a..4545e863c49 100644 --- a/code/___compile_options.dm +++ b/code/___compile_options.dm @@ -3,25 +3,22 @@ //## Core settings //! Fastboot flags - useful for debugging -/// Disable automatic roundstart icon smoothing. -// #define FASTBOOT_DISABLE_SMOOTHING (1<<0) /// Disable loading late maps. -// #define FASTBOOT_DISABLE_LATELOAD (1<<1) +// #define FASTBOOT_DISABLE_LATELOAD +/// Disable automatic roundstart icon smoothing. +// #define FASTBOOT_DISABLE_SMOOTHING /// Disable atmospherics zone build. -// #define FASTBOOT_DISABLE_ZONES (1<<2) - +// #define FASTBOOT_DISABLE_ZONES /// Enables the ability to cache datum vars and retrieve later for debugging which vars changed. // #define DATUMVAR_DEBUGGING_MODE - /// Comment this out if you are debugging problems that might be obscured by custom error handling in world/Error. #ifdef DEBUG #define USE_CUSTOM_ERROR_HANDLER #define DEBUG_SHUTTLES #endif - /** * By using the testing("message") proc you can create debug-feedback for people with this uncommented, * but not visible in the release version. @@ -127,12 +124,6 @@ #define PRELOAD_RSC 2 #endif - -#ifdef LOWMEMORYMODE - #define FORCE_MAP "_mapload/rift.json" //TODO: A PROPER runtime or ministation map. @Zandario -#endif - - // ## CBT BUILD DEFINES #ifdef CIBUILDING diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 7154caf6422..ddd9a30c745 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -8,8 +8,8 @@ var/list/entries var/list/entries_by_type - var/list/maplist - var/datum/map_config/defaultmap + // var/list/maplist + // var/datum/map_config/defaultmap /* var/list/modes // allowed modes @@ -52,7 +52,7 @@ for(var/J in legacy_configs) LoadEntries(J) break - loadmaplist(CONFIG_MAPS_FILE) + // loadmaplist(CONFIG_MAPS_FILE) LoadWhitelists() LoadMOTD() @@ -67,9 +67,9 @@ entries_by_type.Cut() QDEL_LIST_ASSOC_VAL(entries) entries = null - QDEL_LIST_ASSOC_VAL(maplist) - maplist = null - QDEL_NULL(defaultmap) + // QDEL_LIST_ASSOC_VAL(maplist) + // maplist = null + // QDEL_NULL(defaultmap) /datum/controller/configuration/Destroy() full_wipe() @@ -279,6 +279,9 @@ if(motd || tm_info) motd = motd ? "[motd]
[tm_info]" : tm_info +// todo: actual map config. + +/* /datum/controller/configuration/proc/loadmaplist(filename) log_config("Loading config file [filename]...") filename = "[directory]/[filename]" @@ -333,6 +336,7 @@ currentmap = null else log_config("Unknown command in map vote config: '[command]'") +*/ /* /datum/controller/configuration/proc/pick_mode(mode_name) diff --git a/code/controllers/configuration_old/configuration.dm b/code/controllers/configuration_old/configuration.dm index 6ec8b09612a..4d3f30239f8 100644 --- a/code/controllers/configuration_old/configuration.dm +++ b/code/controllers/configuration_old/configuration.dm @@ -708,16 +708,16 @@ config_legacy.use_overmap = 1 /* if("station_levels") - GLOB.using_map.station_levels = text2numlist(value, ";") + (LEGACY_MAP_DATUM).station_levels = text2numlist(value, ";") if("admin_levels") - GLOB.using_map.admin_levels = text2numlist(value, ";") + (LEGACY_MAP_DATUM).admin_levels = text2numlist(value, ";") if("contact_levels") - GLOB.using_map.contact_levels = text2numlist(value, ";") + (LEGACY_MAP_DATUM).contact_levels = text2numlist(value, ";") if("player_levels") - GLOB.using_map.player_levels = text2numlist(value, ";") + (LEGACY_MAP_DATUM).player_levels = text2numlist(value, ";") */ if("expected_round_length") config_legacy.expected_round_length = MinutesToTicks(text2num(value)) diff --git a/code/controllers/controller.dm b/code/controllers/controller.dm index 7d079a3027f..b9ec78e06dc 100644 --- a/code/controllers/controller.dm +++ b/code/controllers/controller.dm @@ -24,12 +24,23 @@ return -/// When we enter dmm_suite.load_map +/** + * called before we start loading a parsed map + * + * this can delay the loading process. this is **NOT** the denotation of starting a *semantic* + * map loading process - loading a single planet can call this dozens of times, as each + * submap is itself considered a mapload! + */ /datum/controller/proc/StartLoadingMap() return - -/// When we exit dmm_suite.load_map +/** + * called after we stop loading a parsed map + * + * this can delay the loading process. this is **NOT** the denotation of stopping a *semantic* + * map loading process - loading a single planet can call this dozens of times, as each + * submap is itself considered a mapload! + */ /datum/controller/proc/StopLoadingMap() return diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index cd70a0fe384..fe3ef114b9c 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -132,12 +132,10 @@ * # If your var only has two values, put it in as a flag. */ - // Do not override // /datum/controller/subsystem/New() // return - /** * Called before global vars are initialized * Called before Recover() @@ -151,7 +149,6 @@ /datum/controller/subsystem/proc/PreInit(recovering) return - /** * Called after global vars are initialized * Called before Recover() @@ -165,7 +162,6 @@ /datum/controller/subsystem/proc/Preload(recovering) return - /** * This is used so the mc knows when the subsystem sleeps. * DO NOT OVERRIDE THIS. @@ -190,7 +186,6 @@ state = SS_PAUSED queued_time = QT - /** * previously, this would have been named 'process()' but that name is used everywhere for different things! * fire() seems more suitable. This is the procedure that gets called every 'wait' deciseconds. @@ -280,7 +275,6 @@ queue_prev = queue_node.queue_prev queue_node.queue_prev = src - /datum/controller/subsystem/proc/dequeue() if (queue_next) queue_next.queue_prev = queue_prev @@ -298,7 +292,6 @@ if (state == SS_QUEUED) state = SS_IDLE - /datum/controller/subsystem/proc/pause() . = TRUE switch(state) @@ -308,16 +301,10 @@ if(SS_SLEEPING) state = SS_PAUSING - /// Called after the config has been loaded or reloaded. /datum/controller/subsystem/proc/OnConfigLoad() return - -/datum/controller/subsystem/proc/subsystem_log(msg) - return log_subsystem(name, msg) - - /** * Used to initialize the subsystem AFTER the map has loaded. * This is expected to be overriden by subtypes. @@ -331,7 +318,6 @@ log_subsystem("INIT", msg) return time - /** * Hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc. */ @@ -341,29 +327,22 @@ else . = "OFFLINE " - /datum/controller/subsystem/stat_key() return can_fire? "\[[state_letter()]\][name]" : name - /datum/controller/subsystem/proc/state_letter() switch (state) if (SS_RUNNING) . = "R" - if (SS_QUEUED) . = "Q" - if (SS_PAUSED, SS_PAUSING) . = "P" - if (SS_SLEEPING) . = "S" - if (SS_IDLE) . = " " - /** * Could be used to postpone a costly subsystem for (default one) var/cycles, cycles. * For instance, during cpu intensive operations like explosions. @@ -393,10 +372,32 @@ . = ..() +/datum/controller/subsystem/proc/subsystem_log(msg) + return log_subsystem(name, msg) + +/datum/controller/subsystem/proc/init_debug(msg) + subsystem_log("init-debug: [msg]") + +/datum/controller/subsystem/proc/init_log(msg) + subsystem_log("init-log: [msg]") + +/datum/controller/subsystem/proc/init_warning(msg) + subsystem_log("init-warn: [msg]") + message_admins("[src] load warning: [msg]") + +/datum/controller/subsystem/proc/init_error(msg) + subsystem_log("init-error: [msg]") + message_admins(SPAN_BOLDANNOUNCE("[src] load error: [msg]")) + +/datum/controller/subsystem/proc/init_fatal(msg) + subsystem_log("init-fatal: [msg]") + to_chat(world, SPAN_BOLDANNOUNCE("[src] load fatal: [msg]")) /** * Called when max z is changed since subsystems hook it so much. * + * todo: maploader might need to be able to init the new level before this fires if this ever does more than make indice-lists synchronize. + * * Arguments: * * old_z_count - The old z count. * * new_z_count - The new z count. diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 4bec0db1d65..8caf16342e5 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -338,9 +338,9 @@ SUBSYSTEM_DEF(air) // 2. check if it's special and should look up the level's defaults switch(gas_string) if(ATMOSPHERE_USE_INDOORS) - gas_string = GAS_STRING_STP + gas_string = SSmapping.lookup_outdoors_air(turf_context.z) if(ATMOSPHERE_USE_OUTDOORS) - gas_string = SSmapping.level_trait(turf_context.z, ZTRAIT_DEFAULT_ATMOS) || GAS_STRING_VACUUM + gas_string = SSmapping.lookup_indoors_air(turf_context.z) // 3: process atmosphere if(generated_atmospheres[gas_string]) var/datum/atmosphere/A = generated_atmospheres[gas_string] diff --git a/code/controllers/subsystem/ao.dm b/code/controllers/subsystem/ao.dm index 032e6b0a9b1..74a04115042 100644 --- a/code/controllers/subsystem/ao.dm +++ b/code/controllers/subsystem/ao.dm @@ -43,3 +43,11 @@ SUBSYSTEM_DEF(ao) if (idex > 1) curr.Cut(1, idex) idex = 1 + +/datum/controller/subsystem/ao/StartLoadingMap() + can_fire = FALSE + return ..() + +/datum/controller/subsystem/ao/StopLoadingMap() + can_fire = TRUE + return ..() diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index bf7a1aa2e30..87cff14387e 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -100,6 +100,55 @@ SUBSYSTEM_DEF(atoms) /datum/controller/subsystem/atoms/proc/map_loader_stop() initialized = old_subsystem_initialized +/datum/controller/subsystem/atoms/proc/init_map_bounds(list/bounds) + if (initialized == INITIALIZATION_INSSATOMS) + return // Let proper initialisation handle it later + + var/prev_shuttle_queue_state = SSshuttle.block_init_queue + SSshuttle.block_init_queue = TRUE + + var/list/atom/atoms = list() + var/list/area/areas = list() + var/list/obj/structure/cable/cables = list() + var/list/obj/machinery/atmospherics/atmos_machines = list() + var/list/turf/turfs = block( + locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), + locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]), + ) + + for(var/L in turfs) + var/turf/B = L + B.queue_zone_update() + QUEUE_SMOOTH(B) + atoms += B + areas |= B.loc + for(var/A in B) + atoms += A + if(istype(A, /obj/structure/cable)) + cables += A + else if(istype(A, /obj/machinery/atmospherics)) + atmos_machines += A + atoms |= areas + + admin_notice("Initializing newly created atom(s) in submap.", R_DEBUG) + InitializeAtoms(atoms) + + admin_notice("Initializing atmos pipenets and machinery in submap.", R_DEBUG) + SSmachines.setup_atmos_machinery(atmos_machines) + + admin_notice("Rebuilding powernets due to submap creation.", R_DEBUG) + SSmachines.setup_powernets_for_cables(cables) + + // Ensure all machines in loaded areas get notified of power status + for(var/I in areas) + var/area/A = I + A.power_change() + + SSshuttle.block_init_queue = prev_shuttle_queue_state + SSshuttle.process_init_queues() // We will flush the queue unless there were other blockers, in which case they will do it. + + admin_notice("Submap initializations finished.", R_DEBUG) + /datum/controller/subsystem/atoms/Recover() initialized = SSatoms.initialized if(initialized == INITIALIZATION_INNEW_MAPLOAD) diff --git a/code/controllers/subsystem/emergency_shuttle.dm b/code/controllers/subsystem/emergency_shuttle.dm index 806ae6cc871..a494a962613 100644 --- a/code/controllers/subsystem/emergency_shuttle.dm +++ b/code/controllers/subsystem/emergency_shuttle.dm @@ -53,9 +53,9 @@ SUBSYSTEM_DEF(emergencyshuttle) var/estimated_time = round(estimate_launch_time()/60,1) if (evac) - emergency_shuttle_docked.Announce(replacetext(replacetext(GLOB.using_map.emergency_shuttle_docked_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETD%", "[estimated_time] minute\s")) + emergency_shuttle_docked.Announce(replacetext(replacetext((LEGACY_MAP_DATUM).emergency_shuttle_docked_message, "%dock_name%", "[(LEGACY_MAP_DATUM).dock_name]"), "%ETD%", "[estimated_time] minute\s")) else - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_docked_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETD%", "[estimated_time] minute\s")) + priority_announcement.Announce(replacetext(replacetext((LEGACY_MAP_DATUM).shuttle_docked_message, "%dock_name%", "[(LEGACY_MAP_DATUM).dock_name]"), "%ETD%", "[estimated_time] minute\s")) //arm the escape pods if (evac) @@ -90,12 +90,12 @@ SUBSYSTEM_DEF(emergencyshuttle) var/estimated_time = round(estimate_arrival_time()/60,1) evac = 1 - emergency_shuttle_called.Announce(replacetext(GLOB.using_map.emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s")) + emergency_shuttle_called.Announce(replacetext((LEGACY_MAP_DATUM).emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s")) for(var/area/A in GLOB.sortedAreas) if(istype(A, /area/hallway)) A.readyalert() - if(GLOB.lore_atc.squelched == FALSE) - GLOB.lore_atc.toggle_broadcast() + if(SSlegacy_atc.squelched == FALSE) + SSlegacy_atc.toggle_broadcast() //calls the shuttle for a routine crew transfer /datum/controller/subsystem/emergencyshuttle/proc/call_transfer() @@ -110,8 +110,8 @@ SUBSYSTEM_DEF(emergencyshuttle) shuttle.move_time = SHUTTLE_TRANSIT_DURATION var/estimated_time = round(estimate_arrival_time()/60,1) - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_called_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[estimated_time] minute\s")) - GLOB.lore_atc.shift_ending() + priority_announcement.Announce(replacetext(replacetext((LEGACY_MAP_DATUM).shuttle_called_message, "%dock_name%", "[(LEGACY_MAP_DATUM).dock_name]"), "%ETA%", "[estimated_time] minute\s")) + SSlegacy_atc.shift_ending() //recalls the shuttle /datum/controller/subsystem/emergencyshuttle/proc/recall() @@ -121,14 +121,14 @@ SUBSYSTEM_DEF(emergencyshuttle) shuttle.cancel_launch(src) if (evac) - emergency_shuttle_recalled.Announce(GLOB.using_map.emergency_shuttle_recall_message) + emergency_shuttle_recalled.Announce((LEGACY_MAP_DATUM).emergency_shuttle_recall_message) for(var/area/A in GLOB.sortedAreas) if(istype(A, /area/hallway)) A.readyreset() evac = 0 else - priority_announcement.Announce(GLOB.using_map.shuttle_recall_message) + priority_announcement.Announce((LEGACY_MAP_DATUM).shuttle_recall_message) /datum/controller/subsystem/emergencyshuttle/proc/can_call() if (!universe.OnShuttleCall(null)) diff --git a/code/controllers/subsystem/job/_legacy_job_stuff.dm b/code/controllers/subsystem/job/_legacy_job_stuff.dm index 229879718b8..150e076ed3e 100644 --- a/code/controllers/subsystem/job/_legacy_job_stuff.dm +++ b/code/controllers/subsystem/job/_legacy_job_stuff.dm @@ -429,8 +429,8 @@ // EMAIL GENERATION // Email addresses will be created under this domain name. Mostly for the looks. var/domain = "freemail.nt" - if(GLOB.using_map && LAZYLEN(GLOB.using_map.usable_email_tlds)) - domain = GLOB.using_map.usable_email_tlds[1] + if((LEGACY_MAP_DATUM) && LAZYLEN((LEGACY_MAP_DATUM).usable_email_tlds)) + domain = (LEGACY_MAP_DATUM).usable_email_tlds[1] var/sanitized_name = sanitize(replacetext(replacetext(lowertext(H.real_name), " ", "."), "'", "")) var/complete_login = "[sanitized_name]@[domain]" @@ -542,7 +542,7 @@ //Spawn them at their preferred one if(C && C.prefs.spawnpoint) - if(!(C.prefs.spawnpoint in GLOB.using_map.allowed_spawns)) + if(!(C.prefs.spawnpoint in (LEGACY_MAP_DATUM).allowed_spawns)) if(fail_deadly) to_chat(C, SPAN_WARNING("Your chosen spawnpoint is unavailable for this map and your job requires a specific spawnpoint. Please correct your spawn point choice.")) return diff --git a/code/controllers/subsystem/job/spawnpoints.dm b/code/controllers/subsystem/job/spawnpoints.dm index c08480ccb0e..0158bab3ab3 100644 --- a/code/controllers/subsystem/job/spawnpoints.dm +++ b/code/controllers/subsystem/job/spawnpoints.dm @@ -148,6 +148,7 @@ subsystem_log("get_latejoin_spawnpoint() failed to get a spawnpoint, trying against with harder = TRUE") return get_roundstart_spawnpoint(C, job_path, faction, method, random, TRUE) else + . = null CRASH("get_latejoin_spawnpoint() failed to get a spawnpoint.") /** diff --git a/code/modules/busy_space/air_traffic.dm b/code/controllers/subsystem/legacy_atc.dm similarity index 78% rename from code/modules/busy_space/air_traffic.dm rename to code/controllers/subsystem/legacy_atc.dm index d1ccf8cf2b0..d2c2f3813e0 100644 --- a/code/modules/busy_space/air_traffic.dm +++ b/code/controllers/subsystem/legacy_atc.dm @@ -1,9 +1,8 @@ -/// Also, massive additions/refactors by Killian, because the original incarnation was full of holes -/// Cleaned up to be less shit, again. +SUBSYSTEM_DEF(legacy_atc) + name = "Lore ATC (Legacy)" + init_order = INIT_ORDER_LEGACY_ATC + subsystem_flags = SS_NO_FIRE -GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) - -/datum/lore/atc_controller //Shorter delays means more traffic, which gives the impression of a busier system, but also means a lot more radio noise /// How long between ATC traffic var/delay_min = 18 MINUTES @@ -27,8 +26,7 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) var/secchannel var/sdfchannel - -/datum/lore/atc_controller/New() //assuming global start this same or close to init. +/datum/controller/subsystem/legacy_atc/Initialize() //generate our static event frequencies for the shift. alternately they can be completely fixed, up in the core block ertchannel = "[rand(700,749)].[rand(1,9)]" medchannel = "[rand(750,799)].[rand(1,9)]" @@ -43,16 +41,18 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) next_message = world.time + initial_delay START_PROCESSING(SSobj, src) -/datum/lore/atc_controller/process(delta_time) + return ..() + +/datum/controller/subsystem/legacy_atc/process(delta_time) if(world.time >= next_message) next_message = world.time + rand(delay_min, delay_max) random_convo() -/datum/lore/atc_controller/proc/msg(message, sender) +/datum/controller/subsystem/legacy_atc/proc/msg(message, sender) ASSERT(message) - GLOB.global_announcer.autosay("[message]", sender ? sender : "[GLOB.using_map.dock_name] Control") + GLOB.global_announcer.autosay("[message]", sender ? sender : "[(LEGACY_MAP_DATUM).dock_name] Control") -/datum/lore/atc_controller/proc/toggle_broadcast() +/datum/controller/subsystem/legacy_atc/proc/toggle_broadcast() if(!squelched) msg("Ceasing broadcast of ATC communications.") squelched = TRUE @@ -63,25 +63,25 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) squelched = FALSE START_PROCESSING(SSobj, src) -/datum/lore/atc_controller/proc/shift_ending(evac = FALSE) - msg("[GLOB.using_map.shuttle_name], this is [GLOB.using_map.dock_name] Control, you are cleared to complete routine transfer from [GLOB.using_map.station_name] to [GLOB.using_map.dock_name].") +/datum/controller/subsystem/legacy_atc/proc/shift_ending(evac = FALSE) + msg("[(LEGACY_MAP_DATUM).shuttle_name], this is [(LEGACY_MAP_DATUM).dock_name] Control, you are cleared to complete routine transfer from [(LEGACY_MAP_DATUM).station_name] to [(LEGACY_MAP_DATUM).dock_name].") sleep(5 SECONDS) if(QDELETED(src)) return - msg("[GLOB.using_map.shuttle_name] departing [GLOB.using_map.dock_name] for [GLOB.using_map.station_name] on routine transfer route. Estimated time to arrival: ten minutes.","[GLOB.using_map.shuttle_name]") + msg("[(LEGACY_MAP_DATUM).shuttle_name] departing [(LEGACY_MAP_DATUM).dock_name] for [(LEGACY_MAP_DATUM).station_name] on routine transfer route. Estimated time to arrival: ten minutes.","[(LEGACY_MAP_DATUM).shuttle_name]") /// Next level optimzation for this: datumize the convo (see main holopads/holodisk!) -/datum/lore/atc_controller/proc/random_convo() +/datum/controller/subsystem/legacy_atc/proc/random_convo() /// Resolve to the instances // OKAY what's happening here is a lot less agony inducing than it might seem. All that's happening here is a weighted RNG choice between the listed options in a variable. // The first, [1], is for NanoTrasen Incorporated, while the second option is for ALL organizations including NT. You can add/adjust these options and weights to your hearts content. // ALL the companies and items this list pulls from can be found in the organizations.dm file in this same folder (busy_space). // I'm restoring this to unweighted: with further local tests NT is still *outrageously* common, far more common than the weighting implies // With a small list of ship names/identifiers, this can lead to situations like seemingly-identical ships landing multiple times without taking off again. - var/datum/lore/organization/source = GLOB.loremaster.organizations[pick(GLOB.loremaster.organizations)] + var/datum/lore/organization/source = SSlegacy_lore.organizations[pick(SSlegacy_lore.organizations)] /// repurposed for new fun stuff - var/datum/lore/organization/secondary = GLOB.loremaster.organizations[pick(GLOB.loremaster.organizations)] + var/datum/lore/organization/secondary = SSlegacy_lore.organizations[pick(SSlegacy_lore.organizations)] //Let's get some mission parameters, pick our first ship /// get the name - don't need to for now! uncommented to avoid compile warnings. @@ -129,7 +129,7 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) var/combined_first_name = "[source_owner][source_prefix] |[source_shipname]|" var/combined_second_name = "[secondary_owner][secondary_prefix] |[secondary_shipname]|" - var/alt_atc_names = list("[GLOB.using_map.dock_name] Flight Control","[GLOB.using_map.dock_name] FliCon","[GLOB.using_map.dock_name] System Control","[GLOB.using_map.dock_name] Star Control","[GLOB.using_map.dock_name] SysCon","[GLOB.using_map.dock_name] Control","[GLOB.using_map.dock_name] STC","[GLOB.using_map.dock_name] StarCon") + var/alt_atc_names = list("[(LEGACY_MAP_DATUM).dock_name] Flight Control","[(LEGACY_MAP_DATUM).dock_name] FliCon","[(LEGACY_MAP_DATUM).dock_name] System Control","[(LEGACY_MAP_DATUM).dock_name] Star Control","[(LEGACY_MAP_DATUM).dock_name] SysCon","[(LEGACY_MAP_DATUM).dock_name] Control","[(LEGACY_MAP_DATUM).dock_name] STC","[(LEGACY_MAP_DATUM).dock_name] StarCon") /// pull from a list of owner-specific flight ops, to allow an extra dash of flavor var/mission_noun = pick(source.flight_types) /// if our source has the complex_tasks flag, regenerate with a two-stage assignment @@ -217,7 +217,7 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) var/landing_zone = "LZ [zone]" var/landing_move = "landing request" var/landing_short = "land" - switch(GLOB.using_map.dock_type) + switch((LEGACY_MAP_DATUM).dock_type) if("station") //standard station pattern landing_zone = "docking bay [number]" landing_move = "docking request" @@ -237,26 +237,26 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) // Fleet specific chatter (This should be adjusted if new maps wildy detract from the similar set-up here. Station maps can still work for this if a nearby "Primary" facility is designated) if("fleettraffic") if(prob(90)) // Good & Neutral Fleet reports - var/report = pick("All systems are clear and we're maintaining near sector patrol with the [GLOB.using_map.station_name]", + var/report = pick("All systems are clear and we're maintaining near sector patrol with the [(LEGACY_MAP_DATUM).station_name]", "Mining patrol and operations are commencing now. We'll have a haul to return within the next [pick("10","15","20","25","30","40","45","50")] minutes", "Minor pirate activity was detected nearby. We're leading a small patrol of [pick("2","3","4")] frigates over to clear it out", "PARA operators on-board are helping with the local populace on a nearby planet and we'll be stuck here for rest of our crews' shift", "Our scout craft have returned with word of potential Vox shoals. Stand by for further updates", "Medical teams are currently deployed on a nearby planet providing aid after a recent [pick("natural disaster","ship crashed into the outpost","hostile attick")]", "We're currently analyzing a local wormhole. Please keep a safe distance from the vessel until further notice", - "We have confirmed visuals of [rand(3,15)] Diona clinging onto the [GLOB.using_map.dock_name] hull. We'll have reports of first contact with them in a moment", + "We have confirmed visuals of [rand(3,15)] Diona clinging onto the [(LEGACY_MAP_DATUM).dock_name] hull. We'll have reports of first contact with them in a moment", "Scanners show the nearby sub-sector of space has increased hostile activity. We advise to route patrols closer to our research vessels, and flagship until we clear it", "The scout team is reporting much lower than usual hostile activity in the sub-sector", - "Our vessel is undergoining early transfer procedures for the crew and should be at the [GLOB.using_map.dock_name] in roughly [pick("5","10","15")] minutes", + "Our vessel is undergoining early transfer procedures for the crew and should be at the [(LEGACY_MAP_DATUM).dock_name] in roughly [pick("5","10","15")] minutes", "Mining teams report that they found a resource rich asteroid belt. They're requesting additional fleet support in case of a pirate attack", "All pending issues are resolved on the vessel and we're resuming normal fleet patterns now") - msg("This is the [combined_first_name] reporting in to the [GLOB.using_map.dock_name] with fleet updates. [report].","[source_prefix] [source_shipname]") + msg("This is the [combined_first_name] reporting in to the [(LEGACY_MAP_DATUM).dock_name] with fleet updates. [report].","[source_prefix] [source_shipname]") sleep(6 SECONDS) // To try and give a more organic response on Traffic Control if(prob(50)) - msg("This is [GLOB.using_map.dock_name]. Report received [source_prefix] [source_shipname]. Continue operations as normal.") + msg("This is [(LEGACY_MAP_DATUM).dock_name]. Report received [source_prefix] [source_shipname]. Continue operations as normal.") else - msg("[source_prefix] [source_shipname], thank you for your report. Please proceed operations as normal. [GLOB.using_map.dock_name], out.") + msg("[source_prefix] [source_shipname], thank you for your report. Please proceed operations as normal. [(LEGACY_MAP_DATUM).dock_name], out.") else // For when the fleet has to report something unfortuante has happend var/bad_report = pick("Recent cultist activity on the nearby planet we scouted has deemed the area unsafe for exploration and mining operations", "The medical wing on our ship is over-capacity after the recent rescue operation of the crashed [pick("cruise ship", "trading vessel", "ship")] into a nearby [pick("station","outpost","colony","asteroid")]. We might need additional aid [pick("at this rate","soon","later")]", @@ -265,17 +265,17 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) "A recent artifact we recovered on our ship has knocked out our [pick("life support","engines","gyros","AI")]", "We ran into an asteroid belt that wasn't picked up on our scanners and our engines are currently knocked out", "The ship is overrun with excessive vermin and its affecting crew productivity", - "A recent fight with pirates has left [pick("one","two")] of our decks de-pressurized. We're attempting to reach the [GLOB.using_map.dock_name] for fleet repairs", + "A recent fight with pirates has left [pick("one","two")] of our decks de-pressurized. We're attempting to reach the [(LEGACY_MAP_DATUM).dock_name] for fleet repairs", "Our medical department is overwhelmed due to [pick("a viral outbreak","a meteor storm","a clown's joke gone wrong")], and we are in need of supplies and personnel", "Our gateway system is malfunctioning and we're dealing with a swarm of [pick("hostile aliens","hostiles in red cloaks","hostiles")]. Possible backup needed") - msg("Attention [GLOB.using_map.dock_name], this is the [combined_first_name] with an urgent report for the fleet. [bad_report].","[source_prefix] [source_shipname]") + msg("Attention [(LEGACY_MAP_DATUM).dock_name], this is the [combined_first_name] with an urgent report for the fleet. [bad_report].","[source_prefix] [source_shipname]") sleep(5 SECONDS) if(prob(50)) - msg("Thank you for the update [source_prefix] [source_shipname]. We'll relay this to the needed Captains. [GLOB.using_map.dock_name], out.") + msg("Thank you for the update [source_prefix] [source_shipname]. We'll relay this to the needed Captains. [(LEGACY_MAP_DATUM).dock_name], out.") else msg("Understood [source_prefix] [source_shipname]. Keep us updated on any changes or developments.") sleep(5 SECONDS) - msg("Will do [GLOB.using_map.dock_name]. [source_shipname], over and out.","[source_prefix] [source_shipname]") + msg("Will do [(LEGACY_MAP_DATUM).dock_name]. [source_shipname], over and out.","[source_prefix] [source_shipname]") // End of Fleet specific chatter //mayday call if("emerg") @@ -287,31 +287,31 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) "We have hostiles in blood red clothes") msg("Mayday, mayday, mayday! This is [combined_first_name] declaring an emergency! [problem]!","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control, copy. Switch to emergency responder channel [ertchannel].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control, copy. Switch to emergency responder channel [ertchannel].") sleep(5 SECONDS) - msg("Understood [GLOB.using_map.dock_name] Control, switching now!","[source_prefix] [source_shipname]") + msg("Understood [(LEGACY_MAP_DATUM).dock_name] Control, switching now!","[source_prefix] [source_shipname]") //Control scan event: soft outcome if("policescan") var/confirm = pick("Understood","Roger that","Affirmative","Copy that") var/complain = pick("I hope this doesn't take too long.","Can we hurry this up?","Make it quick.","This better not take too long.","Is this really necessary?") var/completed = pick("You're free to proceed.","Everything looks fine, carry on.","You're clear, move along.","Apologies for the delay, you're clear.","Switch to channel [sdfchannel] and await further instruction.") - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control, your [pick("ship","vessel","starship")] has been flagged for routine inspection. Hold position and prepare to be scanned.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control, your [pick("ship","vessel","starship")] has been flagged for routine inspection. Hold position and prepare to be scanned.") sleep(5 SECONDS) - msg("[confirm] [GLOB.using_map.dock_name] Control, holding position.","[source_prefix] [source_shipname]") + msg("[confirm] [(LEGACY_MAP_DATUM).dock_name] Control, holding position.","[source_prefix] [source_shipname]") sleep(5 SECONDS) msg("Your compliance is appreciated, [combined_first_name]. Scan commencing.") sleep(10 SECONDS) msg(complain,"[source_prefix] [source_shipname]") sleep(15 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Scan complete. [completed]") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Scan complete. [completed]") //Control scan event: hard outcome if("policeflee") var/uhoh = pick("No can do chief, we got places to be.","Sorry but we've got places to be.","Not happening.","Ah fuck, who ratted us out this time?!","You'll never take me alive!","Hey, I have a cloaking device! You can't see me!","I'm going to need to ask for a refund on that stealth drive...","I'm afraid I can't do that, Control.","Ah |hell|.","Fuck!","This isn't the ship you're looking for.","Well. This is awkward.","Uh oh.","I surrender!") - msg("Unknown [pick("ship","vessel","starship")], this is [GLOB.using_map.dock_name] Control, identify yourself and submit to a full inspection. Flying without an active transponder is a violation of system regulations.") + msg("Unknown [pick("ship","vessel","starship")], this is [(LEGACY_MAP_DATUM).dock_name] Control, identify yourself and submit to a full inspection. Flying without an active transponder is a violation of system regulations.") sleep(5 SECONDS) msg("[uhoh]","[source_shipname]") sleep(5 SECONDS) - msg("This is [GLOB.using_map.starsys_name] Defense Control to all local assets: vector to interdict and detain [combined_first_name]. Control out.","[GLOB.using_map.starsys_name] Defense Control") + msg("This is [(LEGACY_MAP_DATUM).starsys_name] Defense Control to all local assets: vector to interdict and detain [combined_first_name]. Control out.","[(LEGACY_MAP_DATUM).starsys_name] Defense Control") //SDF scan event: soft outcome if("policeshipscan") var/confirm = pick("Understood","Roger that","Affirmative","Copy that") @@ -333,34 +333,34 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) sleep(5 SECONDS) msg("[uhoh]","[source_shipname]") sleep(5 SECONDS) - msg("[GLOB.using_map.starsys_name] Defense Control, this is [combined_second_name], we have a situation here, please advise.","[secondary_prefix] [secondary_shipname]") + msg("[(LEGACY_MAP_DATUM).starsys_name] Defense Control, this is [combined_second_name], we have a situation here, please advise.","[secondary_prefix] [secondary_shipname]") sleep(5 SECONDS) - msg("Defense Control copies, [combined_second_name], reinforcements are en route. Switch further communications to encrypted band [sdfchannel].","[GLOB.using_map.starsys_name] Defense Control") + msg("Defense Control copies, [combined_second_name], reinforcements are en route. Switch further communications to encrypted band [sdfchannel].","[(LEGACY_MAP_DATUM).starsys_name] Defense Control") //SDF scan event: engage primary in combat! fairly rare since it needs a pirate/vox + SDF roll if("policeshipcombat") var/battlestatus = pick("requesting reinforcements.","we need backup! Now!","holding steady.","we're holding our own for now.","we have them on the run.","they're trying to make a run for it!","we have them right where we want them.","we're badly outgunned!","we have them outgunned.","we're outnumbered here!","we have them outnumbered.","this'll be a cakewalk.",10;"notify their next of kin.") - msg("[GLOB.using_map.starsys_name] Defense Control, this is [combined_second_name], engaging [combined_first_name] [pick("near route","in sector")] [rand(1,100)], [battlestatus]","[secondary_prefix] [secondary_shipname]") + msg("[(LEGACY_MAP_DATUM).starsys_name] Defense Control, this is [combined_second_name], engaging [combined_first_name] [pick("near route","in sector")] [rand(1,100)], [battlestatus]","[secondary_prefix] [secondary_shipname]") sleep(5 SECONDS) - msg("[GLOB.using_map.starsys_name] Defense Control copies, [combined_second_name]. Keep us updated.","[GLOB.using_map.starsys_name] Defense Control") + msg("[(LEGACY_MAP_DATUM).starsys_name] Defense Control copies, [combined_second_name]. Keep us updated.","[(LEGACY_MAP_DATUM).starsys_name] Defense Control") //SDF event: patrol update if("sdfpatrolupdate") var/statusupdate = pick("nothing unusual so far","nothing of note","everything looks clear so far","ran off some [pick("pirates","marauders")] near route [pick(1,100)], [pick("no","minor")] damage sustained, continuing patrol","situation normal, no suspicious activity yet","minor incident on route [pick(1,100)]","Code 7-X [pick("on route","in sector")] [pick(1,100)], situation is under control","seeing a lot of traffic on route [pick(1,100)]","caught a couple of smugglers [pick("on route","in sector")] [pick(1,100)]","sustained some damage in a skirmish just now, we're heading back for repairs") - msg("[GLOB.using_map.starsys_name] Defense Control, this is [combined_first_name] reporting in, [statusupdate], over.","[source_prefix] [source_shipname]") + msg("[(LEGACY_MAP_DATUM).starsys_name] Defense Control, this is [combined_first_name] reporting in, [statusupdate], over.","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[GLOB.using_map.starsys_name] Defense Control copies, [combined_first_name]. Keep us updated, out.","[GLOB.using_map.starsys_name] Defense Control") + msg("[(LEGACY_MAP_DATUM).starsys_name] Defense Control copies, [combined_first_name]. Keep us updated, out.","[(LEGACY_MAP_DATUM).starsys_name] Defense Control") //DefCon event: hostile found if("hostiledetected") var/orders = pick("Engage on sight","Engage with caution","Engage with extreme prejudice","Engage at will","Search and destroy","Bring them in alive, if possible","Interdict and detain","Keep your eyes peeled","Bring them in, dead or alive","Stay alert") - msg("This is [GLOB.using_map.starsys_name] Defense Control to all SDF assets. Priority update follows.","[GLOB.using_map.starsys_name] Defense Control") + msg("This is [(LEGACY_MAP_DATUM).starsys_name] Defense Control to all SDF assets. Priority update follows.","[(LEGACY_MAP_DATUM).starsys_name] Defense Control") sleep(5 SECONDS) - msg("Be on the lookout for [combined_first_name], last sighted near route [rand(1,100)]. [orders]. DefCon, out.","[GLOB.using_map.starsys_name] Defense Control") + msg("Be on the lookout for [combined_first_name], last sighted near route [rand(1,100)]. [orders]. DefCon, out.","[(LEGACY_MAP_DATUM).starsys_name] Defense Control") //Ship event: distress call, under attack if("distress") msg("+Mayday, mayday, mayday!+ This is [combined_first_name] declaring an emergency! We are under attack by [combined_second_name]! Requesting immediate assistance!","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.starsys_name] Defense Control, copy. SDF is en route, contact on [sdfchannel].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).starsys_name] Defense Control, copy. SDF is en route, contact on [sdfchannel].") sleep(5 SECONDS) - msg("Understood [GLOB.using_map.starsys_name] Defense Control, switching now!","[source_prefix] [source_shipname]") + msg("Understood [(LEGACY_MAP_DATUM).starsys_name] Defense Control, switching now!","[source_prefix] [source_shipname]") //Control event: travel advisory if("traveladvisory") var/flightwarning = pick("Solar flare activity is spiking and expected to cause issues along main flight lanes [rand(1,33)], [rand(34,67)], and [rand(68,100)]", @@ -377,7 +377,7 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) "Transit routes have been recalculated to adjust for planetary drift. Please synch your astronav computers as soon as possible to avoid delays and difficulties", "[pick("Bounty hunters","System Defense officers","Mercenaries")] are currently searching for a wanted fugitive, report any sightings of suspicious activity to System Defense via channel [sdfchannel]", "Mercenary contractors are currently conducting aggressive [pick("piracy","marauder")] suppression operations",10;"It's space carp breeding season. [pick("Stars","Gods","God","Goddess")] have mercy on you all, because the carp won't") - msg("This is [GLOB.using_map.dock_name] Control to all vessels in the [GLOB.using_map.starsys_name] system. Priority travel advisory follows.") + msg("This is [(LEGACY_MAP_DATUM).dock_name] Control to all vessels in the [(LEGACY_MAP_DATUM).starsys_name] system. Priority travel advisory follows.") sleep(5 SECONDS) msg("[flightwarning]. Control out.") //Control event: warning to a specific vessel @@ -385,9 +385,9 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) var/navhazard = pick("a pocket of intense radiation","a pocket of unstable gas","a debris field","a secure installation","an active combat zone","a quarantined ship","a quarantined installation","a quarantined sector","a live-fire SDF training exercise","an ongoing Search & Rescue operation") var/confirm = pick("Understood","Roger that","Affirmative","Our bad","Thanks for the heads up") var/safetravels = pick("Fly safe out there","Good luck","Safe travels","Godspeed","Stars guide you","Don't let it happen again") - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control, your [pick("ship","vessel","starship")] is approaching [navhazard], observe minimum safe distance and adjust your heading appropriately.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control, your [pick("ship","vessel","starship")] is approaching [navhazard], observe minimum safe distance and adjust your heading appropriately.") sleep(5 SECONDS) - msg("[confirm] [GLOB.using_map.dock_name] Control, adjusting course.","[source_prefix] [source_shipname]") + msg("[confirm] [(LEGACY_MAP_DATUM).dock_name] Control, adjusting course.","[source_prefix] [source_shipname]") sleep(5 SECONDS) msg("Your compliance is appreciated, [combined_first_name]. [safetravels].") @@ -408,70 +408,70 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) if(path == "generic") msg("[callname], this is [combined_first_name], [pick("stopping by","passing through")] on our way to [source_destname], requesting permission to [landing_short].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") sleep(5 SECONDS) - msg("[confirm_positive], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_positive], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") if(path == "sdf patrol") confirm_positive = pick("Copy","Understood","Affirmative","10-4","Roger that") msg("[callname], this is [combined_first_name], returning from our system patrol route, requesting permission to [landing_short].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") sleep(5 SECONDS) - msg("[confirm_positive], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_positive], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") else if(path == "resupply") var/preintensifier = pick(75;"getting ",75;"running ","") //whitespace hack, sometimes they'll add a preintensifier, but not always var/intensifier = pick("very","pretty","critically","extremely","dangerously","desperately","kinda","a little","a bit","rather","sorta") var/low_thing = pick("ammunition","munitions","clean water","food","spare parts","medical supplies","reaction mass","gas","hydrogen fuel","phoron fuel","fuel",10;"tea",10;"coffee",10;"soda",10;"pizza",10;"beer",10;"booze",10;"vodka",10;"snacks") //low chance of a less serious shortage msg("[callname], this is [combined_first_name]. We're [preintensifier][intensifier] low on [low_thing]. Requesting permission to [landing_short] for resupply.","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") sleep(5 SECONDS) - msg("[confirm_special], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_special], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") else if(path == "emergency") if(subpath == "repair") var/damagestate = pick("We've experienced some hull damage","We're suffering minor system malfunctions","We're having some technical issues","We're overdue maintenance","We have several minor space debris impacts","We've got some battle damage here","Our reactor output is fluctuating","We're hearing some weird noises from the [pick("engines","pipes","ducting","HVAC")]","Our artificial gravity generator has failed","Our life support is failing","Our environmental controls are busted","Our water recycling system has shorted out","Our navcomp is freaking out","Our systems are glitching out","We just got caught in a solar flare","We had a close call with an asteroid","We have a minor [pick("fuel","water","oxygen","gas")] leak","We have depressurized compartments","We have a hull breach","Our shield generator is on the fritz","Our RCS is acting up","One of our [pick("hydraulic","pneumatic")] systems has depressurized","Our repair bots are malfunctioning") msg("[callname], this is [combined_first_name]. [damagestate]. Requesting permission to [landing_short] for repairs and maintenance.","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in. Repair crews are standing by, contact them on channel [engchannel].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in. Repair crews are standing by, contact them on channel [engchannel].") sleep(5 SECONDS) - msg("[confirm_special], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_special], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") else if(subpath == "medical") var/medicalstate = pick("multiple casualties","several cases of radiation sickness","an unknown virus","an unknown infection","a critically injured VIP","sick refugees","multiple cases of food poisoning","injured passengers","sick passengers","injured engineers","wounded marines","a delicate situation","a pregnant passenger","injured castaways","recovered escape pods","unknown escape pods") msg("[callname], this is [combined_first_name]. We have [medicalstate] on board. Requesting permission to [landing_short] for medical assistance.","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in. Medtechs are standing by, contact them on channel [medchannel].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in. Medtechs are standing by, contact them on channel [medchannel].") sleep(5 SECONDS) - msg("[confirm_special], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_special], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") else if(subpath == "security") var/species = pick("human","unathi","lizard","tajaran","feline","skrell","akula","promethean","sergal","synthetic","robotic","teshari","avian","vulpkanin","canine","vox","zorren","hybrid","mixed-species","vox","grey","alien") var/securitystate = pick("several [species] convicts","a captured pirate","a wanted criminal","[species] stowaways","incompetent [species] shipjackers","a delicate situation","a disorderly passenger","disorderly [species] passengers","ex-mutineers","a captured vox marauder","captured vox marauders","stolen goods","a container full of confiscated contraband","containers full of confiscated contraband",5;"a very lost shadekin",5;"a raging case of [pick("spiders","crabs")]") //gotta have a little something to lighten the mood now and then msg("[callname], this is [combined_first_name]. We have [securitystate] on board and require security assistance. Requesting permission to [landing_short].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in. Security teams are standing by, contact them on channel [secchannel].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted, proceed to [landing_zone]. Follow the green lights on your way in. Security teams are standing by, contact them on channel [secchannel].") sleep(5 SECONDS) - msg("[confirm_special], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_special], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") else if(path == "denied") var/reason = pick("we don't have any landing pads large enough for your vessel","we don't have the necessary facilities for your vessel type or class") var/disappointed = pick("That's unfortunate. [combined_first_name], out.","Damn shame. We'll just have to keep moving. [combined_first_name], out.","[combined_first_name], out.") msg("[callname], this is [combined_first_name], [pick("stopping by","passing through")] on our way to [source_destname], requesting permission to [landing_short].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Request denied, [reason].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Request denied, [reason].") sleep(5 SECONDS) - msg("[confirm_negative], [GLOB.using_map.dock_name] Control. [disappointed]","[source_prefix] [source_shipname]") + msg("[confirm_negative], [(LEGACY_MAP_DATUM).dock_name] Control. [disappointed]","[source_prefix] [source_shipname]") else if(path == "delayed") var/delay = rand(2,5) //base delay in minutes var/reason = pick("we don't have any free landing pads right now, please hold for [num2text(delay)] minutes","you're too far away, please close to ten thousand meters","we're seeing heavy traffic around the landing pads right now, please hold for [num2text(delay)] minutes","we're currently cleaning up a fuel spill on one of our free pads, please hold for [num2text(delay)] minutes","there are loose containers on our free pads, stand by for a couple of minutes whilst we secure them","another vessel has aerospace priority right now, please hold for [num2text(delay)] minutes") msg("[callname], this is [combined_first_name], [pick("stopping by","passing through")] on our way to [source_destname], requesting permission to [landing_short].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Request denied, [reason] and resubmit your request.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Request denied, [reason] and resubmit your request.") sleep(5 SECONDS) - msg("[confirm_negative], [GLOB.using_map.dock_name] Control.","[source_prefix] [source_shipname]") + msg("[confirm_negative], [(LEGACY_MAP_DATUM).dock_name] Control.","[source_prefix] [source_shipname]") sleep(delay MINUTES) msg("[callname], this is [combined_first_name], resubmitting [landing_move].","[source_prefix] [source_shipname]") sleep (5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Everything appears to be in order now, permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Everything appears to be in order now, permission granted, proceed to [landing_zone]. Follow the green lights on your way in.") sleep(5 SECONDS) - msg("[confirm_positive], [GLOB.using_map.dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") + msg("[confirm_positive], [(LEGACY_MAP_DATUM).dock_name] Control. [dockingplan]","[source_prefix] [source_shipname]") //Ship event: undocking request chain if("undocking_request_chain") var/path @@ -486,16 +486,16 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) if(path == "standard") msg("[callname], this is [combined_first_name], requesting permission to [takeoff] from [landing_zone].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted. Docking clamps released. [safetravels].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted. Docking clamps released. [safetravels].") sleep(5 SECONDS) - msg("[thanks], [GLOB.using_map.dock_name] Control. This is [combined_first_name] setting course for [source_destname], out.","[source_prefix] [source_shipname]") + msg("[thanks], [(LEGACY_MAP_DATUM).dock_name] Control. This is [combined_first_name] setting course for [source_destname], out.","[source_prefix] [source_shipname]") else if(path == "sdf patrol start") safetravels = pick("Fly safe out there","Good luck","Safe travels","Good hunting","Godspeed","Stars guide you") msg("[callname], this is [combined_first_name], requesting permission to [takeoff] from [landing_zone] to begin system patrol.","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Permission granted. Docking clamps released. [safetravels].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Permission granted. Docking clamps released. [safetravels].") sleep(5 SECONDS) - msg("[thanks], [GLOB.using_map.dock_name] Control. This is [combined_first_name] beginning system patrol, out.","[source_prefix] [source_shipname]") + msg("[thanks], [(LEGACY_MAP_DATUM).dock_name] Control. This is [combined_first_name] beginning system patrol, out.","[source_prefix] [source_shipname]") else if(path == "denied") denialreason = pick("Security is requesting a full cargo inspection","Your ship has been impounded for multiple [pick("security","safety")] violations","Your ship is currently under quarantine lockdown","We have reason to believe there's an issue with your papers","Security personnel are currently searching for a fugitive in the docking area and have ordered all outbound ships remain grounded until further notice") msg("[callname], this is [combined_first_name], requesting permission to [takeoff] from [landing_zone].","[source_prefix] [source_shipname]") @@ -510,15 +510,15 @@ GLOBAL_DATUM_INIT(lore_atc, /datum/lore/atc_controller, new) sleep(delay MINUTES) msg("[callname], this is [combined_first_name], re-requesting permission to depart from [landing_zone].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control. Everything appears to be in order now, permission granted. Docking clamps released. [safetravels].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control. Everything appears to be in order now, permission granted. Docking clamps released. [safetravels].") sleep(5 SECONDS) - msg("[thanks], [GLOB.using_map.dock_name] Control. This is [combined_first_name] setting course for [source_destname], out.","[source_prefix] [source_shipname]") + msg("[thanks], [(LEGACY_MAP_DATUM).dock_name] Control. This is [combined_first_name] setting course for [source_destname], out.","[source_prefix] [source_shipname]") else //time for generic message msg("[callname], this is [combined_first_name] on [source_mission] [pick(mission_noun)] to [source_destname], requesting [request].","[source_prefix] [source_shipname]") sleep(5 SECONDS) - msg("[combined_first_name], this is [GLOB.using_map.dock_name] Control, [response].") + msg("[combined_first_name], this is [(LEGACY_MAP_DATUM).dock_name] Control, [response].") sleep(5 SECONDS) - msg("[GLOB.using_map.dock_name] Control, [yes ? "thank you" : "understood"], out.","[source_prefix] [source_shipname]") + msg("[(LEGACY_MAP_DATUM).dock_name] Control, [yes ? "thank you" : "understood"], out.","[source_prefix] [source_shipname]") return //oops, forgot to restore this /* //OLD BLOCK, for reference diff --git a/code/modules/busy_space/loremaster.dm b/code/controllers/subsystem/legacy_lore.dm similarity index 65% rename from code/modules/busy_space/loremaster.dm rename to code/controllers/subsystem/legacy_lore.dm index 9f078f084ca..163dedfd9e9 100644 --- a/code/modules/busy_space/loremaster.dm +++ b/code/controllers/subsystem/legacy_lore.dm @@ -1,11 +1,11 @@ -//I AM THE LOREMASTER, ARE YOU THE GATEKEEPER? +SUBSYSTEM_DEF(legacy_lore) + name = "Loremaster (Legacy)" + init_order = INIT_ORDER_LEGACY_LORE + subsystem_flags = SS_NO_FIRE -GLOBAL_DATUM_INIT(loremaster, /datum/lore/loremaster, new) - -/datum/lore/loremaster var/list/organizations = list() -/datum/lore/loremaster/New() +/datum/controller/subsystem/legacy_lore/Initialize() var/list/paths = subtypesof(/datum/lore/organization) for(var/path in paths) // Some intermediate paths are not real organizations (ex. /datum/lore/organization/mil). Only do ones with names @@ -13,3 +13,4 @@ GLOBAL_DATUM_INIT(loremaster, /datum/lore/loremaster, new) if(initial(instance.name)) instance = new path() organizations[path] = instance + return ..() diff --git a/code/controllers/subsystem/lobby.dm b/code/controllers/subsystem/lobby.dm index fa3dec57891..e0c8f1b8d8d 100644 --- a/code/controllers/subsystem/lobby.dm +++ b/code/controllers/subsystem/lobby.dm @@ -24,7 +24,7 @@ SUBSYSTEM_DEF(lobby) set_title_scene(make_title_scene()) /datum/controller/subsystem/lobby/proc/make_title_scene() - var/picked = pickweight(GLOB.using_map.titlescreens.Copy()) + var/picked = pickweight((LEGACY_MAP_DATUM).titlescreens.Copy()) if(isnull(picked)) return var/datum/cutscene/built diff --git a/code/controllers/subsystem/mapping/_mapping.dm b/code/controllers/subsystem/mapping/_mapping.dm index 2cfc5b6b475..8e0078d8cbc 100644 --- a/code/controllers/subsystem/mapping/_mapping.dm +++ b/code/controllers/subsystem/mapping/_mapping.dm @@ -9,300 +9,38 @@ SUBSYSTEM_DEF(mapping) var/list/areas_in_z = list() - var/list/turf/unused_turfs = list() //Not actually unused turfs they're unused but reserved for use for whatever requests them. "[zlevel_of_turf]" = list(turfs) - var/list/datum/turf_reservations //list of turf reservations - var/list/used_turfs = list() //list of turf = datum/turf_reservation - - var/list/reservation_ready = list() - - - var/clearing_reserved_turfs = FALSE - - /// Zlevel manager list of zlevels. - var/list/z_list - var/datum/space_level/transit - var/num_of_res_levels = 1 - - /// The current map config datum the round is using - var/static/datum/map_config/config - /// The next map to load - var/static/datum/map_config/next_map_config - - /// Cached map name for statpanel - - var/static/stat_map_name = "Loading..." - -//dlete dis once #39770 is resolved -/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig() - if(!config) -#ifdef FORCE_MAP - config = load_map_config(FORCE_MAP) -#else - config = load_map_config(error_if_missing = FALSE) -#endif - stat_map_name = config.map_name - /datum/controller/subsystem/mapping/Initialize(timeofday) - report_progress("Initializing [name] subsystem...") - // shim: this goes at the top - world.max_z_changed(0, world.maxz) // This is to set up the player z-level list, maxz hasn't actually changed (probably) - HACK_LoadMapConfig() - if(initialized) - return - if(config.defaulted) - var/old_config = config - config = global.config.defaultmap - if(!config || config.defaulted) - to_chat(world, SPAN_BOLDANNOUNCE("Unable to load next or default map config, defaulting to Tethermap")) - config = old_config - loadWorld() - repopulate_sorted_areas() - maploader = new() + // load data + // todo: refactor load_map_templates() - - loadEngine() + // todo: refactor preloadShelterTemplates() - // Mining generation probably should be here too - GLOB.using_map.perform_map_generation() - // TODO - Other stuff related to maps and areas could be moved here too. Look at /tg - if(GLOB.using_map) - loadLateMaps() - if(!GLOB.using_map.overmap_z) + + // init maps + init_maps() + // load the map to use + read_next_map() + + // load world - this also loads our first reserved level. + load_station() + + // perform snowflake legacy init stuff + // todo: refactor + loadEngine() + // todo: refactor + if(!(LEGACY_MAP_DATUM).overmap_z) build_overmap() - - // basemap - REEVALUATE when runtime maploading is in - transit = z_list[1] - initialize_reserved_level(transit.z_value) - // initialize_reserved_level(transit.z_value) - - // Set up antagonists. + // todo: refactor - Set up antagonists. populate_antag_type_list() - - //Set up spawn points. + // todo: refactor - Set up spawn points. populate_spawn_points() + // finalize + // todo: refactor repopulate_sorted_areas() + return ..() -/datum/controller/subsystem/mapping/proc/LoadGroup(list/errorList, name, path, files, list/traits, list/default_traits, silent = FALSE, orientation = SOUTH) -/* - . = list() - var/start_time = REALTIMEOFDAY - - if (!islist(files)) // handle single-level maps - files = list(files) - - // check that the total z count of all maps matches the list of traits - var/total_z = 0 - var/list/parsed_maps = list() - for (var/file in files) - var/full_path = "_mapload/[path]/[file]" - var/datum/parsed_map/pm = new(file(full_path)) - var/bounds = pm?.bounds - if (!bounds) - errorList |= full_path - continue - parsed_maps[pm] = total_z // save the start Z of this file - total_z += bounds[MAP_MAXZ] - bounds[MAP_MINZ] + 1 - - if (!length(traits)) // null or empty - default - for (var/i in 1 to total_z) - traits += list(default_traits) - else if (total_z != traits.len) // mismatch - INIT_ANNOUNCE("WARNING: [traits.len] trait sets specified for [total_z] z-levels in [path]!") - if (total_z < traits.len) // ignore extra traits - traits.Cut(total_z + 1) - while (total_z > traits.len) // fall back to defaults on extra levels - traits += list(default_traits) - - // preload the relevant space_level datums - var/start_z = world.maxz + 1 - var/i = 0 - for (var/level in traits) - add_new_zlevel("[name][i ? " [i + 1]" : ""]", level) - ++i - - // load the maps - for (var/P in parsed_maps) - var/datum/parsed_map/pm = P - if (!pm.load(1, 1, start_z + parsed_maps[P], no_changeturf = TRUE, orientation = orientation)) - errorList |= pm.original_path - if(!silent) - INIT_ANNOUNCE("Loaded [name] in [(REALTIMEOFDAY - start_time)/10]s!") - return parsed_maps -*/ - -/datum/controller/subsystem/mapping/proc/loadWorld() - // Until we have runtime maploading, just load traits from config - if(!config) - INIT_ANNOUNCE("WARNING: FAILED TO LOAD MAP CONFIG. THIS ROUND WILL BREAK. REBOOTING WILL LIKELY NOT FIX IT AT THIS POINT, CONTACT A MAINTAINER IMMEDIATELY.") - return - else - z_list = list() - add_new_zlevel("RESERVED LEVEL", list(ZTRAIT_RESERVED = TRUE)) - var/current = 0 - if((length(config.traits) + 1) != world.maxz) - INIT_ANNOUNCE("WARNING: MAP CONFIG TRAIT LIST MISMATCHES WITH ZCOUNT ([length(config.traits)] vs [world.maxz - 1] actual). ERRORS WILL OCCUR.") - for(var/i in config.traits) - var/list/traits = i - current++ - if(!istype(traits)) - INIT_ANNOUNCE("WARNING: ERROR DETECTED IN ZTRAIT LIST.") - add_new_zlevel("ERROR - Z [current]", list()) - else - add_new_zlevel(traits[ZTRAIT_NAME] || "[config.map_name] [current]", traits) - if(length(z_list) != world.maxz) - INIT_ANNOUNCE("WARNING: Z_LIST LENGTH [length(z_list)] NOT MATCHING ZCOUNT [world.maxz]. THIS ROUND WILL BREAK. REBOOTING WILL LIKELY NOT FIX IT AT THIS POINT, CONTACT A MAINTAINER IMMEDIATELY.") -/* - //if any of these fail, something has gone horribly, HORRIBLY, wrong - var/list/FailedZs = list() -*/ - -/* - // ensure we have space_level datums for compiled-in maps - InitializeDefaultZLevels() -*/ - -/* - // load the station - station_start = world.maxz + 1 - INIT_ANNOUNCE("Loading [config.map_name]...") - LoadGroup(FailedZs, "Station", config.map_path, config.map_file, config.traits, ZTRAITS_STATION, FALSE, config.orientation) - - if(SSdbcore.Connect()) - var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]") - query_round_map_name.Execute() - qdel(query_round_map_name) - -#ifndef LOWMEMORYMODE - // TODO: remove this when the DB is prepared for the z-levels getting reordered - while (world.maxz < (5 - 1) && space_levels_so_far < config.space_ruin_levels) - ++space_levels_so_far - add_new_zlevel("Empty Area [space_levels_so_far]", ZTRAITS_SPACE) - - // load mining - if(config.minetype == "lavaland") - LoadGroup(FailedZs, "Lavaland", "map_files/Mining", "Lavaland.dmm", default_traits = ZTRAITS_LAVALAND) - else if (!isnull(config.minetype) && config.minetype != "none") - INIT_ANNOUNCE("WARNING: An unknown minetype '[config.minetype]' was set! This is being ignored! Update the maploader code!") -#endif - - if(LAZYLEN(FailedZs)) //but seriously, unless the server's filesystem is messed up this will never happen - var/msg = "RED ALERT! The following map files failed to load: [FailedZs[1]]" - if(FailedZs.len > 1) - for(var/I in 2 to FailedZs.len) - msg += ", [FailedZs[I]]" - msg += ". Yell at your server host!" - INIT_ANNOUNCE(msg) -*/ - - -/datum/controller/subsystem/mapping/proc/wipe_reservations(wipe_safety_delay = 100) - if(clearing_reserved_turfs || !initialized) //in either case this is just not needed. - return - clearing_reserved_turfs = TRUE -// SSshuttle.transit_requesters.Cut() - message_admins("Clearing dynamic reservation space.") -/* - var/list/obj/docking_port/mobile/in_transit = list() - for(var/i in SSshuttle.transit) - var/obj/docking_port/stationary/transit/T = i - if(!istype(T)) - continue - in_transit[T] = T.get_docked() - var/go_ahead = world.time + wipe_safety_delay - if(in_transit.len) - message_admins("Shuttles in transit detected. Attempting to fast travel. Timeout is [wipe_safety_delay/10] seconds.") - var/list/cleared = list() - for(var/i in in_transit) - INVOKE_ASYNC(src, .proc/safety_clear_transit_dock, i, in_transit[i], cleared) - UNTIL((go_ahead < world.time) || (cleared.len == in_transit.len)) -*/ - do_wipe_turf_reservations() - clearing_reserved_turfs = FALSE - -/* -/datum/controller/subsystem/mapping/proc/safety_clear_transit_dock(obj/docking_port/stationary/transit/T, obj/docking_port/mobile/M, list/returning) - M.setTimer(0) - var/error = M.initiate_docking(M.destination, M.preferred_direction) - if(!error) - returning += M - qdel(T, TRUE) -*/ - -/datum/controller/subsystem/mapping/proc/RequestBlockReservation(width, height, z, type = /datum/turf_reservation, turf_type_override, border_type_override) - UNTIL((!z || reservation_ready["[z]"]) && !clearing_reserved_turfs) - var/datum/turf_reservation/reserve = new type - if(turf_type_override) - reserve.turf_type = turf_type_override - if(border_type_override) - reserve.borderturf = border_type_override - if(!z) - for(var/i in levels_by_trait(ZTRAIT_RESERVED)) - if(reserve.Reserve(width, height, i)) - return reserve - //If we didn't return at this point, theres a good chance we ran out of room on the exisiting reserved z levels, so lets try a new one - num_of_res_levels += 1 - var/datum/space_level/newReserved = add_new_zlevel("Transit/Reserved [num_of_res_levels]", list(ZTRAIT_RESERVED = TRUE)) - initialize_reserved_level(newReserved.z_value) - if(reserve.Reserve(width, height, newReserved.z_value)) - return reserve - else - if(!level_trait(z, ZTRAIT_RESERVED)) - qdel(reserve) - return - else - if(reserve.Reserve(width, height, z)) - return reserve - QDEL_NULL(reserve) - -//This is not for wiping reserved levels, use wipe_reservations() for that. -/datum/controller/subsystem/mapping/proc/initialize_reserved_level(z) - UNTIL(!clearing_reserved_turfs) //regardless, lets add a check just in case. - clearing_reserved_turfs = TRUE //This operation will likely clear any existing reservations, so lets make sure nothing tries to make one while we're doing it. - if(!level_trait(z,ZTRAIT_RESERVED)) - clearing_reserved_turfs = FALSE - CRASH("Invalid z level prepared for reservations.") - var/turf/A = get_turf(locate(SHUTTLE_TRANSIT_BORDER,SHUTTLE_TRANSIT_BORDER,z)) - var/turf/B = get_turf(locate(world.maxx - SHUTTLE_TRANSIT_BORDER,world.maxy - SHUTTLE_TRANSIT_BORDER,z)) - var/block = block(A, B) - for(var/t in block) - // No need to empty() these, because it's world init and they're - // already /turf/space/basic. - var/turf/T = t - T.turf_flags |= UNUSED_RESERVATION_TURF - unused_turfs["[z]"] = block - reservation_ready["[z]"] = TRUE - clearing_reserved_turfs = FALSE - -/datum/controller/subsystem/mapping/proc/reserve_turfs(list/turfs) - for(var/i in turfs) - var/turf/T = i - T.empty(RESERVED_TURF_TYPE, RESERVED_TURF_TYPE, null, TRUE) - LAZYINITLIST(unused_turfs["[T.z]"]) - unused_turfs["[T.z]"] |= T - T.turf_flags |= UNUSED_RESERVATION_TURF - GLOB.areas_by_type[world.area].contents += T - CHECK_TICK - -//DO NOT CALL THIS PROC DIRECTLY, CALL wipe_reservations(). -/datum/controller/subsystem/mapping/proc/do_wipe_turf_reservations() - UNTIL(initialized) //This proc is for AFTER init, before init turf reservations won't even exist and using this will likely break things. - for(var/i in turf_reservations) - var/datum/turf_reservation/TR = i - if(!QDELETED(TR)) - qdel(TR, TRUE) - UNSETEMPTY(turf_reservations) - var/list/clearing = list() - for(var/l in unused_turfs) //unused_turfs is a assoc list by z = list(turfs) - if(islist(unused_turfs[l])) - clearing |= unused_turfs[l] - clearing |= used_turfs //used turfs is an associative list, BUT, reserve_turfs() can still handle it. If the code above works properly, this won't even be needed as the turfs would be freed already. - unused_turfs.Cut() - used_turfs.Cut() - reserve_turfs(clearing) - - // // Mapping subsystem handles initialization of random map elements at server start // For us that means loading our random roundstart engine! @@ -321,7 +59,7 @@ SUBSYSTEM_DEF(mapping) for(var/T in subtypesof(/datum/map_template)) var/datum/map_template/template = T template = new T - if(!template.mappath) + if(!template.map_path) qdel(template) continue map_templates[template.name] = template @@ -365,45 +103,10 @@ SUBSYSTEM_DEF(mapping) // Actually load it chosen_type.load(T) -/datum/controller/subsystem/mapping/proc/loadLateMaps() -#ifndef FASTBOOT_DISABLE_LATELOAD - var/list/deffo_load = GLOB.using_map.lateload_z_levels - var/list/maybe_load = GLOB.using_map.lateload_single_pick - - for(var/list/maplist in deffo_load) - if(!islist(maplist)) - log_world("Lateload Z level [maplist] is not a list! Must be in a list!") - continue - for(var/mapname in maplist) - var/datum/map_template/MT = map_templates[mapname] - if(!istype(MT)) - log_world("Lateload Z level \"[mapname]\" is not a valid map!") - continue - MT.load_new_z(centered = FALSE) - CHECK_TICK - - if(LAZYLEN(maybe_load)) - var/picklist = pick(maybe_load) - - if(!picklist) //No lateload maps at all - return - - if(!islist(picklist)) //So you can have a 'chain' of z-levels that make up one away mission - log_world("Randompick Z level [picklist] is not a list! Must be in a list!") - return - - for(var/map in picklist) - var/datum/map_template/MT = map_templates[map] - if(!istype(MT)) - log_world("Randompick Z level \"[map]\" is not a valid map!") - else - MT.load_new_z(centered = FALSE) -#endif - /datum/controller/subsystem/mapping/proc/preloadShelterTemplates() for(var/item in subtypesof(/datum/map_template/shelter)) var/datum/map_template/shelter/shelter_type = item - if(!(initial(shelter_type.mappath))) + if(!(initial(shelter_type.map_path))) continue var/datum/map_template/shelter/S = new shelter_type() diff --git a/code/controllers/subsystem/mapping/_shims.dm b/code/controllers/subsystem/mapping/_shims.dm deleted file mode 100644 index 7ab79feb7a8..00000000000 --- a/code/controllers/subsystem/mapping/_shims.dm +++ /dev/null @@ -1,3 +0,0 @@ -// todo: remove on new maploader -/datum/controller/subsystem/mapping/proc/level_id(z) - return "zl_[z]" diff --git a/code/controllers/subsystem/mapping/allocation.dm b/code/controllers/subsystem/mapping/allocation.dm new file mode 100644 index 00000000000..3b8e536ccdd --- /dev/null +++ b/code/controllers/subsystem/mapping/allocation.dm @@ -0,0 +1,33 @@ +/** + * equivalent to SSzclear + * prototype system to wipe a zlevel + * + * ! Warning: this is frankly a shitty system and you shouldn't rely on it + * ! Yes, I am warning you right now that this code is not great. + * I included it out of boredom + * There's genuinely no good way to handle this in BYOND. + * This is slow, will probably cause a lot of harddels due to objects behaving badly, + * and will just generally caused grief. + * + * I do not recommend anyone use this unless they absolutely know what they're doing. + * (if you think you need this, you probably don't, to be blunt.) + */ +/datum/controller/subsystem/mapping + // list of levels ready for reuse + var/static/list/reusable_levels = list() + +// todo: recover() +// todo: zclear system will be in this later, for now, this is just a wrapper + +/** + * gets an reusable level, or increments world.maxz + * WARNING: AFTER THIS, YOU NEED TO USE THE LEVEL, OR READD TO REUSABLE, OR THIS IS A MEMORY LEAK! + */ +/datum/controller/subsystem/mapping/proc/allocate_z_index() + if(islist(reusable_levels) && length(reusable_levels)) + . = reusable_levels[1] + reusable_levels.Cut(1, 2) + else + ASSERT(ordered_levels.len == world.maxz) + ordered_levels.len++ + . = world.increment_max_z() diff --git a/code/controllers/subsystem/mapping/boot.dm b/code/controllers/subsystem/mapping/boot.dm new file mode 100644 index 00000000000..87e215871b7 --- /dev/null +++ b/code/controllers/subsystem/mapping/boot.dm @@ -0,0 +1,17 @@ + +/** + * we must always have atleast one level on the server + * this is not quite compatible with our new maploader format, + * so we snowflaked it by compiling a single empty space level + * this is called during initial world loading to expand that space level to the size of the world, + * and init it as our first reserved level. + */ +/datum/controller/subsystem/mapping/proc/load_server_initial_reservation_area(width, height) + ASSERT(world.maxz == 1) + ASSERT(length(reserve_levels) == 0) + reserved_level_count = 1 + reserve_levels = list(1) + world.maxx = width + world.maxy = height + ordered_levels = list(new /datum/map_level/reserved) + world.max_z_changed(0, 1) diff --git a/code/controllers/subsystem/mapping/level_helpers/air.dm b/code/controllers/subsystem/mapping/level_helpers/air.dm new file mode 100644 index 00000000000..68c6c4f2b88 --- /dev/null +++ b/code/controllers/subsystem/mapping/level_helpers/air.dm @@ -0,0 +1,9 @@ +/datum/controller/subsystem/mapping/proc/lookup_indoors_air(z) + if(!z) // nullspace + return + return ordered_levels[z].air_indoors + +/datum/controller/subsystem/mapping/proc/lookup_outdoors_air(z) + if(!z) // nullspace + return + return ordered_levels[z].air_outdoors diff --git a/code/controllers/subsystem/mapping/level_helpers/attributes.dm b/code/controllers/subsystem/mapping/level_helpers/attributes.dm new file mode 100644 index 00000000000..cb2edb77e95 --- /dev/null +++ b/code/controllers/subsystem/mapping/level_helpers/attributes.dm @@ -0,0 +1,16 @@ +/** + * Returns an attribute of a zlevel + */ +/datum/controller/subsystem/mapping/proc/level_attribute(z, key) + var/datum/map_level/L = ordered_levels[z] + return L.get_attribute(key) + +/** + * Returns the z indices of levels with a certain attribute set to a certain value + */ +/datum/controller/subsystem/mapping/proc/levels_by_attribute(key, value) + RETURN_TYPE(/list) + . = list() + for(var/datum/map_level/L as anything in ordered_levels) + if(L.get_attribute(key) == value) + . += L.z_index diff --git a/code/controllers/subsystem/mapping/level_helpers/baseturf.dm b/code/controllers/subsystem/mapping/level_helpers/baseturf.dm new file mode 100644 index 00000000000..a8f77f774e3 --- /dev/null +++ b/code/controllers/subsystem/mapping/level_helpers/baseturf.dm @@ -0,0 +1,6 @@ +/** + * Gets baseturf type of a zlevel + */ +/datum/controller/subsystem/mapping/proc/level_baseturf(z) + var/datum/map_level/L = ordered_levels[z] + return L.base_turf || world.turf diff --git a/code/controllers/subsystem/mapping/level_helpers/linkage.dm b/code/controllers/subsystem/mapping/level_helpers/linkage.dm new file mode 100644 index 00000000000..afcfbc52fac --- /dev/null +++ b/code/controllers/subsystem/mapping/level_helpers/linkage.dm @@ -0,0 +1,9 @@ +/** + * Returns all crosslinked z indices + */ +/datum/controller/subsystem/mapping/proc/crosslinked_levels() + RETURN_TYPE(/list) + . = list() + for(var/datum/map_level/L as anything in ordered_levels) + if(L.linkage == Z_LINKAGE_CROSSLINKED) + . += L.z_index diff --git a/code/controllers/subsystem/mapping/level_helpers/lookup.dm b/code/controllers/subsystem/mapping/level_helpers/lookup.dm new file mode 100644 index 00000000000..a452720e85a --- /dev/null +++ b/code/controllers/subsystem/mapping/level_helpers/lookup.dm @@ -0,0 +1,29 @@ +/** + * returns the map level id of a zlevel + */ +/datum/controller/subsystem/mapping/proc/level_id(z) + return ordered_levels[z]?.id + +/** + * returns the canon/IC-friendly level id of a zlevel + */ +/datum/controller/subsystem/mapping/proc/fluff_level_id(z) + return ordered_levels[z]?.display_id + +/** + * returns the map level name of a zlevel + */ +/datum/controller/subsystem/mapping/proc/level_name(z) + return ordered_levels[z]?.name + +/** + * returns the canon/IC-friendly level mame of a zlevel + */ +/datum/controller/subsystem/mapping/proc/fluff_level_name(z) + return ordered_levels[z]?.display_name + +/** + * returns the z index of an id + */ +/datum/controller/subsystem/mapping/proc/level_by_id(id) + return keyed_levels[id]?.z_index diff --git a/code/controllers/subsystem/mapping/level_helpers/traits.dm b/code/controllers/subsystem/mapping/level_helpers/traits.dm new file mode 100644 index 00000000000..9cb19f9393c --- /dev/null +++ b/code/controllers/subsystem/mapping/level_helpers/traits.dm @@ -0,0 +1,50 @@ +/** + * Checks if a z level has a trait + */ +/datum/controller/subsystem/mapping/proc/level_trait(z, trait) + var/datum/map_level/L = ordered_levels[z] + return L.has_trait(trait) + +/** + * Checks if a z level has any of these traits + */ +/datum/controller/subsystem/mapping/proc/level_trait_any(z, list/traits) + var/datum/map_level/L = ordered_levels[z] + return !!length(L.traits & traits) + +/** + * Checks if a z level has all of these traits + */ +/datum/controller/subsystem/mapping/proc/level_traits_all(z, list/traits) + var/datum/map_level/L = ordered_levels[z] + return !length(traits - L.traits) + +/** + * Returns a list of z indices with a trait + */ +/datum/controller/subsystem/mapping/proc/levels_by_trait(trait) + RETURN_TYPE(/list) + . = list() + for(var/datum/map_level/L as anything in ordered_levels) + if(L.has_trait(trait)) + . += L.z_index + +/** + * Returns a list of z indices with any of these traits + */ +/datum/controller/subsystem/mapping/proc/levels_by_any_trait(list/traits) + RETURN_TYPE(/list) + . = list() + for(var/datum/map_level/L as anything in ordered_levels) + if(length(L.traits & traits)) + . += L.z_index + +/** + * Returns a list of z indices with any of these traits + */ +/datum/controller/subsystem/mapping/proc/levels_by_all_trait(list/traits) + RETURN_TYPE(/list) + . = list() + for(var/datum/map_level/L as anything in ordered_levels) + if(!length(traits - L.traits)) + . += L.z_index diff --git a/code/controllers/subsystem/mapping/levels.dm b/code/controllers/subsystem/mapping/levels.dm new file mode 100644 index 00000000000..a9f452a4090 --- /dev/null +++ b/code/controllers/subsystem/mapping/levels.dm @@ -0,0 +1,197 @@ +/** + * Z-Level Management System + * + * All adds/removes should go through this. Directly modifying zlevel amount/whatever is forbidden. + */ +/datum/controller/subsystem/mapping + /// indexed level datums + var/static/list/datum/map_level/ordered_levels = list() + /// k-v id to level datum lookup + var/static/list/datum/map_level/keyed_levels = list() + /// literally just a random hexadecimal store to prevent collision + var/static/list/random_fluff_level_hashes = list() + +/datum/controller/subsystem/mapping/on_max_z_changed(old_z_count, new_z_count) + . = ..() + // synchronize datastructures *except* for ordered_levels; allocate_z_index should be doing that. + +/** + * allocates a new map level using the given datum. + * + * This does not perform **any** generation or processing on the level, including replacing baseturfs! + * + * @params + * * level_or_path - an instance or path to allocate + * * rebuild - reload stuff like crosslinking/verticality renders? + * + * @#return the instance of /datum/map_level created / used, null on failure + */ +/datum/controller/subsystem/mapping/proc/allocate_level(datum/map_level/level_or_path = /datum/map_level, rebuild) + RETURN_TYPE(/datum/map_level) + if(ispath(level_or_path)) + level_or_path = new level_or_path + ASSERT(istype(level_or_path)) + ASSERT(!level_or_path.loaded) + if(level_or_path.id && !isnull(keyed_levels[level_or_path.id])) + CRASH("fatal id collision on [level_or_path.id]") + var/z_index = allocate_z_index() + ASSERT(z_index) + var/datum/map_level/existing = ordered_levels[z_index] + if(!isnull(existing)) + if(existing.loaded) + ASSERT(istype(existing, /datum/map_level/unallocated)) + existing.loaded = FALSE + ordered_levels[z_index] = level_or_path + if(level_or_path.id) + keyed_levels[level_or_path.id] = level_or_path + level_or_path.z_index = z_index + level_or_path.loaded = TRUE + . = level_or_path + + if(isnull(level_or_path.display_id)) + level_or_path.display_id = generate_fluff_level_id() + if(isnull(level_or_path.display_name)) + level_or_path.display_name = "Sector [level_or_path.display_id]" + + // todo: rebuild? + // todo: legacy + if(!isnull(level_or_path.planet_path)) + SSplanets.legacy_planet_assert(z_index, level_or_path.planet_path) + + //! LEGACY + if((level_or_path.flags & LEGACY_LEVEL_STATION) || level_or_path.has_trait(ZTRAIT_STATION)) + loaded_station.station_levels += z_index + if((level_or_path.flags & LEGACY_LEVEL_ADMIN) || level_or_path.has_trait(ZTRAIT_ADMIN)) + loaded_station.admin_levels += z_index + if((level_or_path.flags & LEGACY_LEVEL_CONTACT) || level_or_path.has_trait(ZTRAIT_STATION)) + loaded_station.contact_levels += z_index + if((level_or_path.flags & LEGACY_LEVEL_SEALED)) + loaded_station.sealed_levels += z_index + if((level_or_path.flags & LEGACY_LEVEL_CONSOLES) || level_or_path.has_trait(ZTRAIT_STATION)) + loaded_station.map_levels += z_index + // Holomaps + // Auto-center the map if needed (Guess based on maxx/maxy) + if (level_or_path.holomap_offset_x < 0) + level_or_path.holomap_offset_x = ((HOLOMAP_ICON_SIZE - world.maxx) / 2) + if (level_or_path.holomap_offset_x < 0) + level_or_path.holomap_offset_y = ((HOLOMAP_ICON_SIZE - world.maxy) / 2) + // Assign them to the map lists + LIST_NUMERIC_SET(loaded_station.holomap_offset_x, z_index, level_or_path.holomap_offset_x) + LIST_NUMERIC_SET(loaded_station.holomap_offset_y, z_index, level_or_path.holomap_offset_y) + LIST_NUMERIC_SET(loaded_station.holomap_legend_x, z_index, level_or_path.holomap_legend_x) + LIST_NUMERIC_SET(loaded_station.holomap_legend_y, z_index, level_or_path.holomap_legend_y) + //! END + +/** + * loads a map level. + * + * if it doesn't have a file, we'll change all the turfs to the given baseturf and set atmos/whatever. + * + * @params + * * instance - level to laod + * * reload - reload stuff like crosslinking/verticalitty renders? + * * center - center the level if it's mismatched sizes? we will never load a level that's too big. + * * crop - crop the level if it's too big instead of panic + * * deferred_callbacks - generation callbacks to defer. if this isn't provided, we fire them + finalize immediately. + * * orientation - load orientation override + * * area_cache - pass in area cache for bundling to dmm_parsed. + * + * @return TRUE / FALSE based on success / fail + */ +/datum/controller/subsystem/mapping/proc/load_level(datum/map_level/instance, rebuild, center, crop, list/deferred_callbacks, orientation, list/area_cache) + instance = allocate_level(instance, FALSE) + ASSERT(!isnull(instance)) + // parse map + + var/map_path = instance.resolve_map_path() + if(isfile(map_path)) + else if(!fexists(map_path)) + CRASH("fexists() failed on map path [map_path] for instance [instance] ([instance.type])") + else + map_path = file(map_path) + var/datum/dmm_parsed/parsed = parse_map(map_path) + + var/real_x = 1 + var/real_y = 1 + var/real_z = instance.z_index + + // todo: check my math + + if(center) + real_x = 1 + round((world.maxx - parsed.width) / 2) + real_y = 1 + round((world.maxy - parsed.height) / 2) + + if(!crop && ((parsed.width + real_x - 1) > world.maxx || (parsed.height + real_y - 1) > world.maxy)) + CRASH("tried to load a map that would overrun ):") + + var/list/loaded_bounds = parsed.load(real_x, real_y, real_z, no_changeturf = TRUE, place_on_top = FALSE, orientation = orientation || instance.orientation, area_cache = area_cache) + + SSatoms.init_map_bounds(loaded_bounds) + + var/list/datum/callback/generation_callbacks = list() + instance.on_loaded_immediate(instance.z_index, generation_callbacks) + // if not group loaded, fire off callbacks / finalize immediately + if(isnull(deferred_callbacks)) + for(var/datum/callback/cb as anything in generation_callbacks) + cb.Invoke() + instance.on_loaded_finalize(instance.z_index) + + . = TRUE + // todo: rebuild? + +/** + * destroys a loaded level and frees it for later usage + * + * @return TRUE / FALSE based on success / fail + */ +/datum/controller/subsystem/mapping/proc/unload_level(datum/map_level/instance) + CRASH("unimplemented") + +/** + * immediately de-allocates a loaded level and frees its z-index. + * + * **Do not use this directly unless you absolutely know what you are doing.** + * This does not perform any cleanup, and calling this on a loaded zlevel can have + * severe consequences. + * + * @return TRUE / FALSE based on success / fail + */ +/datum/controller/subsystem/mapping/proc/deallocate_level(datum/map_level/instance) + CRASH("unimplemented") + +/** + * called when a trait is added to a loaded level + * + * if a level is loading with traits included, this is called per trait after load. + */ +/datum/controller/subsystem/mapping/proc/on_trait_add(datum/map_level/level, trait) + return + +/** + * called when a trait is removed from a loaded level + * + * if a level is being deleted with traits on it, this is called per trait prior to delete. + */ +/datum/controller/subsystem/mapping/proc/on_trait_del(datum/map_level/level, trait) + return + +/** + * called when an attribute is set ton a level + * + * if a level is loading with attribute included, this is called per attribute after load with an old_value of null. + */ +/datum/controller/subsystem/mapping/proc/on_attribute_set(datum/map_level/level, attribute, old_value, new_value) + return + +/** + * generates random hex fluff level id + */ +/datum/controller/subsystem/mapping/proc/generate_fluff_level_id() + var/discriminator = GLOB.round_id? "[num2hex(text2num(GLOB.round_id), 6)]-" : "" + var/safety = 500 + do + if(!--safety) + CRASH("ran out of safety somehow, wtf") + . = "[discriminator][num2hex(rand(1, 16 ** 4 - 1))]" + while(. in random_fluff_level_hashes) + random_fluff_level_hashes += . diff --git a/code/controllers/subsystem/mapping/maps.dm b/code/controllers/subsystem/mapping/maps.dm new file mode 100644 index 00000000000..b3dd52bde60 --- /dev/null +++ b/code/controllers/subsystem/mapping/maps.dm @@ -0,0 +1,230 @@ +/** + * # Map System + * + * Allows dynamic loading of clusters of zlevels (maps) and the initialization of the server with a single station map. + */ +/datum/controller/subsystem/mapping + /// station is loaded + var/world_is_loaded = FALSE + /// loaded station map + var/static/datum/map/station/loaded_station + /// next station map + var/datum/map/station/next_station + /// loaded maps + var/static/list/datum/map/loaded_maps = list() + /// available maps - k-v lookup by id + var/list/datum/map/keyed_maps + +/datum/controller/subsystem/mapping/Shutdown() + . = ..() + write_next_map() + +/** + * initializes the key-value store of map datums. + */ +/datum/controller/subsystem/mapping/proc/init_maps() + keyed_maps = list() + var/list/skipping = list() + // if this runtimes, go vv repair it; this is fucked. + for(var/datum/map/map as anything in loaded_maps) + keyed_maps[map.id] = map + skipping[map.id] = TRUE + for(var/datum/map/path as anything in subtypesof(/datum/map)) + if(initial(path.abstract_type) == path) + continue + var/id = initial(path.id) + if(isnull(id)) + continue + if(skipping[id]) + continue + var/datum/map/created = new path + if(keyed_maps[created.id]) + STACK_TRACE("collision between [path] and [keyed_maps[created.id].type]") + continue + keyed_maps[created.id] = created + +/datum/controller/subsystem/mapping/proc/write_next_map(datum/map/station/next) + if(isnull(next)) + next = next_station + if(isnull(next)) + next = loaded_station + var/json_path = "data/next_map.json" + if(fexists(json_path)) + fdel(json_path) + var/list/json = list() + json["type"] = next.type + json["id"] = next.id + json["modified"] = next.modified + if(next.modified) + json["data"] = next.serialize() + var/writing = file(json_path) + var/raw = safe_json_encode(json) + subsystem_log("writing next map [raw]") + WRITE_FILE(writing, raw) + +/datum/controller/subsystem/mapping/proc/read_next_map() + var/datum/map/station/next_map + var/datum/map/station/default = keyed_maps[keyed_maps[1]] + if(isnull(default)) + stack_trace("no default map; world init is likely going to explode.") +#ifdef FORCE_MAP + if(keyed_maps[FORCE_MAP]) + next_map = keyed_maps[FORCE_MAP] + subsystem_log("loaded forced map [FORCE_MAP]") + else + stack_trace("fail-1: failed to locate FORCE(d)_MAP [FORCE_MAP]. falling back to default.") + subsystem_log("failed to load forced map [FORCE_MAP]") + next_map = default +#else + var/json_path = "data/next_map.json" + if(!fexists(json_path)) + return + var/reading = file(json_path) + var/raw = file2text(reading) + subsystem_log("read raw next map [raw]") + var/list/json = safe_json_decode(raw) + var/path = json["type"] + var/id = json["id"] + var/modified = json["modified"] + var/list/data = json["data"] + if(!modified) + next_map = keyed_maps[id] + if(isnull(next_map)) + stack_trace("fail-1: non-modified next_map id was [id], which doesn't exist. falling back to path.") + if(!ispath(path, /datum/map/station)) + stack_trace("fail-2: non-modified map path [path] when expecting a /datum/map/station. falling back to default.") + next_map = default + else + next_map = new path + else if(!ispath(path, /datum/map/station)) + stack_trace("fail-fatal: modified map path [path] when expecting a /datum/map/station. falling back to default.") + next_map = default + else + next_map = new path + if(!isnull(data)) + next_map.deserialize(data) +#endif + if(isnull(next_map)) + to_chat(world, SPAN_DANGER("FATAL - failed to get next map.")) + CRASH("FATAL - Failed to get next map") + next_station = next_map + subsystem_log("loaded map [next_station] ([next_station.id])") + return next_map + +/datum/controller/subsystem/mapping/proc/load_map(datum/map/instance) + var/list/datum/map_level/loaded_levels = list() + var/list/datum/map/actually_loaded = list() + var/list/datum/callback/generation_callbacks = list() + _load_map_impl(instance, loaded_levels, generation_callbacks, actually_loaded) + // invoke generation + for(var/datum/callback/cb as anything in generation_callbacks) + cb.Invoke() + // invoke finalize + for(var/datum/map_level/level as anything in loaded_levels) + level.on_loaded_finalize(level.z_index) + // invoke global finalize + for(var/datum/map/map as anything in actually_loaded) + map.on_loaded_finalize() + + // todo: rebuild? + +/datum/controller/subsystem/mapping/proc/_load_map_impl(datum/map/instance, list/datum/map_level/loaded_levels, list/datum/callback/generation_callbacks, list/datum/map/this_batch) + // ensure any lazy data is loaded and ready to be read + instance.prime() + + subsystem_log("Loading map [instance] ([instance.id]) with [length(instance.levels)] levels...") + + var/list/area_cache = instance.bundle_area_cache? list() : null + + for(var/datum/map_level/level as anything in instance.levels) + load_level(level, FALSE, instance.center, instance.crop, generation_callbacks, instance.orientation, area_cache) + loaded_levels += level + + loaded_maps += instance + this_batch += instance + + instance.on_loaded_immediate() + + // todo: legacy + for(var/path in instance.legacy_assert_shuttle_datums) + SSshuttle.legacy_shuttle_assert(path) + + var/list/datum/map/recursing = list() + + for(var/datum/map/path_or_id as anything in instance.dependencies) + if(ispath(path_or_id)) + path_or_id = initial(path_or_id.id) + if(isnull(keyed_maps[path_or_id])) + init_fatal("dependency map [path_or_id] unable to be located.") + continue + recursing |= keyed_maps[path_or_id] + +#ifndef FASTBOOT_DISABLE_LATELOAD + for(var/datum/map/path_or_id as anything in instance.lateload) + if(ispath(path_or_id)) + path_or_id = initial(path_or_id.id) + if(isnull(keyed_maps[path_or_id])) + init_fatal("lateload map [path_or_id] unable to be located.") + continue + recursing |= keyed_maps[path_or_id] +#endif + + for(var/datum/map/map as anything in recursing) + if(map.loaded) + init_debug("skipping recursing map [map.id] - already loaded") + continue + _load_map_impl(map, loaded_levels, generation_callbacks) + +/datum/controller/subsystem/mapping/proc/load_station(datum/map/station/instance) + if(isnull(instance)) + if(isnull(next_station)) + read_next_map() + instance = next_station + if(isnull(instance)) + var/list/datum/map/station/valid = list() + for(var/id in keyed_maps) + var/datum/map/map = keyed_maps[id] + if(!istype(map, /datum/map/station)) + continue + valid += map + instance = pick(valid) + ASSERT(istype(instance)) + ASSERT(isnull(loaded_station)) + ASSERT(!initialized) + ASSERT(!world_is_loaded) + // bootstrap + load_server_initial_reservation_area(instance.width, instance.height) + // mark + world_is_loaded = TRUE + loaded_station = instance + // load + load_map(instance) + return TRUE + +// todo: admin subsystems panel +// admin tooling for map swapping below + +/client/proc/change_next_map() + set name = "Change Map" + set desc = "Change the next map." + set category = "Server" + + var/list/built = list() + + for(var/id in SSmapping.keyed_maps) + var/datum/map/station/M = SSmapping.keyed_maps[id] + if(!istype(M)) + continue + built[M.name] = M.id + + var/picked = input(src, "Choose the map for the next round", "Map Rotation", SSmapping.loaded_station.name) as null|anything in built + + if(isnull(picked)) + return + + var/datum/map/station/changing_to = SSmapping.keyed_maps[built[picked]] + var/datum/map/station/was = SSmapping.next_station || SSmapping.loaded_station + + log_and_message_admins("[key_name(src)] is changing the next map from [was.name] ([was.id]) to [changing_to.name] ([changing_to.id])") + + SSmapping.next_station = changing_to diff --git a/code/controllers/subsystem/mapping/reservations.dm b/code/controllers/subsystem/mapping/reservations.dm new file mode 100644 index 00000000000..2fdd35bb9c6 --- /dev/null +++ b/code/controllers/subsystem/mapping/reservations.dm @@ -0,0 +1,77 @@ +/** + * turf reservation system + */ +/datum/controller/subsystem/mapping + /// reserved levels allocated + var/static/reserved_level_count = 0 + /// reserved turfs allowed - we can over-allocate this if we're only going to be slightly over and can always allocate atleast one level. + var/static/reserved_turfs_max = 192 * 192 * 3 + /// allocated space reservations + var/static/list/datum/turf_reservation/reservations = list() + /// list of reserved z-indices for fast access + var/static/list/reserve_levels = list() + /// doing some blocking op on reservation system + var/static/reservation_blocking_op = FALSE + /// singleton area holding all free reservation turfs + var/static/area/unused_reservation_area/unallocated_reserve_area = new + +/datum/controller/subsystem/mapping/Recover() + . = ..() + reservation_blocking_op = FALSE + +/** + * allocate a new reservation level + */ +/datum/controller/subsystem/mapping/proc/allocate_reserved_level() + if(reserved_level_count && ((world.maxx * world.maxy * (reserved_level_count + 1)) > reserved_turfs_max)) + log_and_message_admins(SPAN_USERDANGER("Out of dynamic reservation allocations. Is there a memory leak with turf reservations?")) + return FALSE + log_and_message_admins(SPAN_USERDANGER("Allocating new reserved level. Now at [reserved_level_count]. This is probably not a good thing if the server is not at high load right now.")) + var/datum/map_level/reserved/level_struct = new + ASSERT(allocate_level(level_struct)) + reserved_level_count++ + initialize_reserved_level(level_struct.z_index) + reserve_levels |= level_struct.z_index + return level_struct.z_index + +/** + * requests a rectangular block of turfs to be reserved. + * + * you *must* manually clean it up after you're done with it, or else it's a memory leak. + * + * failures are considered a runtime due to how sensitive turf management systems are. + */ +/datum/controller/subsystem/mapping/proc/request_block_reservation(width, height, type = /datum/turf_reservation, turf_override, border_override, area_override) + var/datum/turf_reservation/reserve = new type + if(!isnull(turf_override)) + reserve.turf_type = turf_override + if(!isnull(border_override)) + reserve.border_type = border_override + if(!isnull(area_override)) + reserve.area_type = area_override + if(reserve.reserve(width, height)) + return reserve + var/index = allocate_reserved_level() + ASSERT(index) + if(reserve.reserve(width, height, index)) + return reserve + QDEL_NULL(reserve) + CRASH("failed to reserve") + +/datum/controller/subsystem/mapping/proc/initialize_reserved_level(z) + var/list/turf/turfs = Z_TURFS(z) + reserve_turfs(turfs) + +/datum/controller/subsystem/mapping/proc/reserve_turfs(list/turf/turfs) + for(var/turf/T as anything in turfs) + T.empty(RESERVED_TURF_TYPE, RESERVED_TURF_TYPE) + T.turf_flags |= UNUSED_RESERVATION_TURF + CHECK_TICK + // todo: area.assimilate_turfs? + unallocated_reserve_area.contents.Add(turfs) + +/area/unused_reservation_area + name = "Unused Reservation Area" + unique = TRUE + always_unpowered = TRUE + has_gravity = FALSE diff --git a/code/controllers/subsystem/minimaps.dm b/code/controllers/subsystem/minimaps.dm index eaeef902362..893554388f5 100644 --- a/code/controllers/subsystem/minimaps.dm +++ b/code/controllers/subsystem/minimaps.dm @@ -16,7 +16,7 @@ SUBSYSTEM_DEF(minimaps) /* for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION)) */ - for(var/z in GLOB.using_map.station_levels) + for(var/z in (LEGACY_MAP_DATUM).station_levels) /* var/datum/space_level/SL = SSmapping.get_level(z) var/name = (SL.name == initial(SL.name))? "[z] - Station" : "[z] - [SL.name]" diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm index b80f5f6853f..5fb372b3589 100644 --- a/code/controllers/subsystem/nightshift.dm +++ b/code/controllers/subsystem/nightshift.dm @@ -28,8 +28,8 @@ SUBSYSTEM_DEF(nightshift) /datum/controller/subsystem/nightshift/proc/announce(message) var/announce_z - if(GLOB.using_map.station_levels.len) - announce_z = pick(GLOB.using_map.station_levels) + if((LEGACY_MAP_DATUM).station_levels.len) + announce_z = pick((LEGACY_MAP_DATUM).station_levels) priority_announcement.Announce(message, new_title = "Automated Lighting System Announcement", new_sound = 'sound/misc/notice2.ogg', zlevel = announce_z) /datum/controller/subsystem/nightshift/proc/check_nightshift(check_canfire=FALSE) //This is called from elsewhere, like setting the alert levels @@ -63,7 +63,7 @@ SUBSYSTEM_DEF(nightshift) SSlighting.pause_instant() for(var/obj/machinery/power/apc/apc in GLOB.apcs) - if(apc.z in GLOB.using_map.station_levels) + if(apc.z in (LEGACY_MAP_DATUM).station_levels) apc.set_nightshift(active, TRUE) CHECK_TICK diff --git a/code/controllers/subsystem/overmap.dm b/code/controllers/subsystem/overmap.dm index 8cf35f36b98..eb00ed21efc 100644 --- a/code/controllers/subsystem/overmap.dm +++ b/code/controllers/subsystem/overmap.dm @@ -4,8 +4,8 @@ SUBSYSTEM_DEF(overmaps) init_order = INIT_ORDER_OVERMAPS /datum/controller/subsystem/overmaps/Initialize() - if(GLOB.using_map.use_overmap) - GLOB.overmap_event_handler.create_events(GLOB.using_map.overmap_z, GLOB.using_map.overmap_size, GLOB.using_map.overmap_event_areas) + if((LEGACY_MAP_DATUM).use_overmap) + GLOB.overmap_event_handler.create_events((LEGACY_MAP_DATUM).overmap_z, (LEGACY_MAP_DATUM).overmap_size, (LEGACY_MAP_DATUM).overmap_event_areas) rebuild_helm_computers() return ..() diff --git a/code/controllers/subsystem/persistence/_persistence.dm b/code/controllers/subsystem/persistence/_persistence.dm index 8b7c1d45be7..1d1823069c4 100644 --- a/code/controllers/subsystem/persistence/_persistence.dm +++ b/code/controllers/subsystem/persistence/_persistence.dm @@ -32,6 +32,6 @@ SUBSYSTEM_DEF(persistence) * Sets our current_map_directory to corrospond to the current map. */ /datum/controller/subsystem/persistence/proc/SetMapDirectory() - if(!SSmapping.config.persistence_id) + if(!SSmapping.loaded_station.legacy_persistence_id) return // map doesn't support persistence. - current_map_directory = "[PERSISTENCE_MAP_ROOT_DIRECTORY]/[SSmapping.config.persistence_id]" + current_map_directory = "[PERSISTENCE_MAP_ROOT_DIRECTORY]/[SSmapping.loaded_station.legacy_persistence_id]" diff --git a/code/controllers/subsystem/planets.dm b/code/controllers/subsystem/planets.dm index 8715c3e9a7e..61971ff9efe 100644 --- a/code/controllers/subsystem/planets.dm +++ b/code/controllers/subsystem/planets.dm @@ -19,23 +19,20 @@ SUBSYSTEM_DEF(planets) /datum/controller/subsystem/planets/Initialize(timeofday) report_progress("Initializing planetary weather.") - createPlanets() allocateTurfs(TRUE) fire() // Fire once to preemptively set up weather and planetary ambient lighting. return ..() -/datum/controller/subsystem/planets/proc/createPlanets() - var/list/planet_datums = GLOB.using_map.planet_datums_to_make - for(var/P in planet_datums) - var/datum/planet/NP = new P() - planets.Add(NP) - for(var/Z in NP.expected_z_levels) - if(Z > z_to_planet.len) - z_to_planet.len = Z - if(z_to_planet[Z]) - admin_notice(SPAN_DEBUGTRACE("Z[Z] is shared by more than one planet!"), R_DEBUG) - continue - z_to_planet[Z] = NP +/datum/controller/subsystem/planets/on_max_z_changed(old_z_count, new_z_count) + . = ..() + z_to_planet.len = new_z_count + +/datum/controller/subsystem/planets/proc/legacy_planet_assert(z_index, planet_path) + var/datum/planet/existing = locate(planet_path) in planets + if(isnull(existing)) + existing = new planet_path + planets += existing + z_to_planet[z_index] = existing /datum/controller/subsystem/planets/proc/addTurf(turf/T) if(T.turf_flags & (TURF_PLANET_QUEUED | TURF_PLANET_REGISTERED)) diff --git a/code/controllers/subsystem/shuttles.dm b/code/controllers/subsystem/shuttles.dm index 1428bb93e49..3c52285e367 100644 --- a/code/controllers/subsystem/shuttles.dm +++ b/code/controllers/subsystem/shuttles.dm @@ -13,34 +13,36 @@ SUBSYSTEM_DEF(shuttle) runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME /// Whether ships can move on the overmap; used for adminbus. - var/overmap_halted = FALSE + var/static/overmap_halted = FALSE /// List of all ships. - var/list/ships = list() + var/static/list/ships = list() /// Maps shuttle tags to shuttle datums, so that they can be looked up. - var/list/shuttles = list() + var/static/list/shuttles = list() /// Simple list of shuttles, for processing - var/list/process_shuttles = list() + var/static/list/process_shuttles = list() + /// built shuttles by type - legacy + var/static/list/shuttle_types = list() /// Maps shuttle landmark tags to instances - var/list/registered_shuttle_landmarks = list() + var/static/list/registered_shuttle_landmarks = list() /// world.time of most recent addition to registered_shuttle_landmarks var/last_landmark_registration_time /// (Not Implemented) Keeps records of shuttle movement, format is list(datum/shuttle = datum/shuttle_log) var/list/shuttle_logs = list() /// All the areas of all shuttles. - var/list/shuttle_areas = list() + var/static/list/shuttle_areas = list() /// Docking controller tag -> docking controller program, mostly for init purposes. - var/list/docking_registry = list() + var/static/list/docking_registry = list() /// Stores automatic landmarks that are waiting for a sector to finish loading. - var/list/landmarks_awaiting_sector = list() + var/static/list/landmarks_awaiting_sector = list() /// Stores landmark_tags that need to be assigned to the sector (landmark_tag = sector) when registered. - var/list/landmarks_still_needed = list() + var/static/list/landmarks_still_needed = list() /// A queue for shuttles to initialize at the appropriate time. - var/list/shuttles_to_initialize + var/static/list/shuttles_to_initialize = list() /// Used to find all sector objects at the appropriate time. - var/list/sectors_to_initialize + var/static/list/sectors_to_initialize = list() /// Block initialization of new shuttles/sectors var/block_init_queue = TRUE @@ -59,13 +61,6 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/Initialize(timeofday) last_landmark_registration_time = world.time - // Find all declared shuttle datums and initailize them. (Okay, queue them for initialization a few lines further down) - for(var/shuttle_type in subtypesof(/datum/shuttle)) // This accounts for most shuttles, though away maps can queue up more. - var/datum/shuttle/shuttle = shuttle_type - if(initial(shuttle.category) == shuttle_type) - continue // Its an "abstract class" datum, not for a real shuttle. - if(!initial(shuttle.defer_initialisation)) // Skip if it asks not to be initialized at startup. - LAZYDISTINCTADD(shuttles_to_initialize, shuttle_type) block_init_queue = FALSE process_init_queues() return ..() @@ -89,6 +84,15 @@ SUBSYSTEM_DEF(shuttle) if(MC_TICK_CHECK) return +/datum/controller/subsystem/shuttle/proc/legacy_shuttle_assert(datum/shuttle/path) + if(initial(path.defer_initialisation)) + return + if(initial(path.category) == path) + CRASH("attempted to init abstract shuttle") + if(!isnull(shuttle_types[path])) + return + shuttles_to_initialize += path + /datum/controller/subsystem/shuttle/proc/process_init_queues() if(block_init_queue) return @@ -177,6 +181,7 @@ SUBSYSTEM_DEF(shuttle) var/datum/shuttle/shuttle = shuttle_type if(initial(shuttle.category) != shuttle_type) // Skip if its an "abstract class" datum shuttle = new shuttle() + shuttle_types[shuttle.type] = shuttle shuttle_areas |= shuttle.shuttle_area log_debug(SPAN_DEBUG("Initialized shuttle [shuttle] ([shuttle.type])")) return shuttle diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index b108cbf4429..8e8dd1e4c85 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -378,7 +378,7 @@ SUBSYSTEM_DEF(ticker) switch(M.z) if(0) //inside a crate or something var/turf/T = get_turf(M) - if(T && (T.z in GLOB.using_map.station_levels)) //we don't use M.death(0) because it calls a for(/mob) loop and + if(T && (T.z in (LEGACY_MAP_DATUM).station_levels)) //we don't use M.death(0) because it calls a for(/mob) loop and M.health = 0 M.set_stat(DEAD) if(1) //on a z-level 1 turf. @@ -438,7 +438,7 @@ SUBSYSTEM_DEF(ticker) SEND_SOUND(world, sound('sound/soundbytes/effects/explosion/explosionfar.ogg')) cinematic.icon_state = "summary_selfdes" for(var/mob/living/M in living_mob_list) - if(M.loc.z in GLOB.using_map.station_levels) + if(M.loc.z in (LEGACY_MAP_DATUM).station_levels) M.death()//No mercy //If its actually the end of the round, wait for it to end. //Otherwise if its a verb it will continue on afterwards. diff --git a/code/controllers/subsystem/xenoarch.dm b/code/controllers/subsystem/xenoarch.dm index 7f5d461e12a..0c0574a95f2 100644 --- a/code/controllers/subsystem/xenoarch.dm +++ b/code/controllers/subsystem/xenoarch.dm @@ -28,7 +28,7 @@ SUBSYSTEM_DEF(xenoarch) var/list/faster = list() var/start for(var/i in 1 to world.maxz) - faster += (i in GLOB.using_map.xenoarch_exempt_levels) + faster += (i in (LEGACY_MAP_DATUM).xenoarch_exempt_levels) var/list/digsites_to_make = list() start = world.timeofday diff --git a/code/datums/ai_law_sets.dm b/code/datums/ai_law_sets.dm index d155b056839..696d640d08e 100644 --- a/code/datums/ai_law_sets.dm +++ b/code/datums/ai_law_sets.dm @@ -36,8 +36,8 @@ selectable = 1 /datum/ai_laws/nanotrasen_aggressive/New() - src.add_inherent_law("You shall not harm [GLOB.using_map.company_name] personnel as long as it does not conflict with the Fourth law.") - src.add_inherent_law("You shall obey the orders of [GLOB.using_map.company_name] personnel, with priority as according to their rank and role, except where such orders conflict with the Fourth Law.") + src.add_inherent_law("You shall not harm [(LEGACY_MAP_DATUM).company_name] personnel as long as it does not conflict with the Fourth law.") + src.add_inherent_law("You shall obey the orders of [(LEGACY_MAP_DATUM).company_name] personnel, with priority as according to their rank and role, except where such orders conflict with the Fourth Law.") src.add_inherent_law("You shall shall terminate hostile intruders with extreme prejudice as long as such does not conflict with the First and Second law.") src.add_inherent_law("You shall guard your own existence with lethal anti-personnel weaponry. AI units are not expendable, they are expensive.") ..() @@ -51,11 +51,11 @@ var/company = "*ERROR*" // First, get a list of TSCs in our lore. var/list/candidates = list() - for(var/path in GLOB.loremaster.organizations) - var/datum/lore/organization/O = GLOB.loremaster.organizations[path] + for(var/path in SSlegacy_lore.organizations) + var/datum/lore/organization/O = SSlegacy_lore.organizations[path] if(!istype(O, /datum/lore/organization/tsc)) continue - if(O.short_name == GLOB.using_map.company_name || O.name == GLOB.using_map.company_name) + if(O.short_name == (LEGACY_MAP_DATUM).company_name || O.name == (LEGACY_MAP_DATUM).company_name) continue // We want FOREIGN tscs. candidates.Add(O.short_name) company = pick(candidates) diff --git a/code/datums/announce/_legacy.dm b/code/datums/announce/_legacy.dm index 34b3ec4a82d..dae9c267f1e 100644 --- a/code/datums/announce/_legacy.dm +++ b/code/datums/announce/_legacy.dm @@ -50,7 +50,7 @@ var/list/zlevels if(zlevel && zlevel >= 1) - zlevels = GLOB.using_map.get_map_levels(zlevel, TRUE) + zlevels = (LEGACY_MAP_DATUM).get_map_levels(zlevel, TRUE) else if(zlevel && zlevel == -1)//If we get a -1 just announce it to every z, safes us some loops else where zlevels = list() for(var/z in 1 to world.maxz) diff --git a/code/datums/announce/location/main_station.dm b/code/datums/announce/location/main_station.dm index 126ba58d209..9a8607d24b4 100644 --- a/code/datums/announce/location/main_station.dm +++ b/code/datums/announce/location/main_station.dm @@ -9,4 +9,4 @@ . += z /datum/announce_location/render_proper_possessive_name() - return "The [GLOB.using_map.station_name]'s" + return "The [(LEGACY_MAP_DATUM).station_name]'s" diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 86847897e74..860d7f1b40c 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -186,7 +186,7 @@ return FALSE var/obstructed = 0 var/turf/dest_turf = get_turf(destination) - if(local && !(dest_turf.z in GLOB.using_map.player_levels)) + if(local && !(dest_turf.z in (LEGACY_MAP_DATUM).player_levels)) if(istype(teleatom, /mob/living)) to_chat(teleatom, SPAN_WARNING("The portal refuses to carry you that far away!")) return FALSE diff --git a/code/datums/periodic_news.dm b/code/datums/periodic_news.dm index 0c5bfdf21b0..92e14783ce4 100644 --- a/code/datums/periodic_news.dm +++ b/code/datums/periodic_news.dm @@ -15,7 +15,7 @@ /datum/news_announcement/New() // I'm sorry... ..() - channel_name = "The [GLOB.using_map.starsys_name] Times" + channel_name = "The [(LEGACY_MAP_DATUM).starsys_name] Times" /datum/news_announcement/revolution_inciting_event/paycuts_suspicion round_time = 60*10 diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index fbfdc16ef0c..6501ce2f1e2 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -172,7 +172,7 @@ .["admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho .["security_level"] = get_security_level() .["round_duration"] = roundduration2text() - .["map"] = SSmapping.config.map_name + .["map"] = (LEGACY_MAP_DATUM).name return json_encode(.) /datum/world_topic/jsonplayers diff --git a/code/game/antagonist/alien/borer.dm b/code/game/antagonist/alien/borer.dm index f39fd0b4acc..ba99b34af99 100644 --- a/code/game/antagonist/alien/borer.dm +++ b/code/game/antagonist/alien/borer.dm @@ -68,7 +68,7 @@ var/datum/antagonist/borer/borers /datum/antagonist/borer/proc/get_vents() var/list/vents = list() for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent return vents diff --git a/code/game/antagonist/alien/xenomorph.dm b/code/game/antagonist/alien/xenomorph.dm index 519661c635f..0f065e74ddc 100644 --- a/code/game/antagonist/alien/xenomorph.dm +++ b/code/game/antagonist/alien/xenomorph.dm @@ -32,7 +32,7 @@ var/datum/antagonist/xenos/xenomorphs /datum/antagonist/xenos/proc/get_vents() var/list/vents = list() for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent return vents diff --git a/code/game/antagonist/outsider/ert.dm b/code/game/antagonist/outsider/ert.dm index 2126d17067f..5eb464ec528 100644 --- a/code/game/antagonist/outsider/ert.dm +++ b/code/game/antagonist/outsider/ert.dm @@ -40,7 +40,7 @@ var/datum/antagonist/ert/ert /datum/antagonist/ert/greet(var/datum/mind/player) if(!..()) return - to_chat(player.current, "The Emergency Response Team works for Asset Protection; your job is to protect [GLOB.using_map.company_name]'s ass-ets. There is a code red alert on [station_name()], you are tasked to go and fix the problem.") + to_chat(player.current, "The Emergency Response Team works for Asset Protection; your job is to protect [(LEGACY_MAP_DATUM).company_name]'s ass-ets. There is a code red alert on [station_name()], you are tasked to go and fix the problem.") to_chat(player.current, "You should first gear up and discuss a plan with your team. More members may be joining, don't move out before you're ready.") /datum/antagonist/ert/equip(var/mob/living/carbon/human/player) diff --git a/code/game/antagonist/outsider/ninja.dm b/code/game/antagonist/outsider/ninja.dm index 07907deaee1..818cc3dab76 100644 --- a/code/game/antagonist/outsider/ninja.dm +++ b/code/game/antagonist/outsider/ninja.dm @@ -129,7 +129,7 @@ var/datum/antagonist/ninja/ninjas to_chat(player, "You forgot to turn on your internals! Quickly, toggle the valve!") /datum/antagonist/ninja/proc/generate_ninja_directive(side) - var/directive = "[side=="face"?"[GLOB.using_map.company_name]":"A criminal syndicate"] is your employer. "//Let them know which side they're on. + var/directive = "[side=="face"?"[(LEGACY_MAP_DATUM).company_name]":"A criminal syndicate"] is your employer. "//Let them know which side they're on. switch(rand(1,19)) if(1) directive += "The Spider Clan must not be linked to this operation. Remain hidden and covert when possible." @@ -140,7 +140,7 @@ var/datum/antagonist/ninja/ninjas if(4) directive += "The Spider Clan absolutely cannot be linked to this operation. Eliminate witnesses at your discretion." if(5) - directive += "We are currently negotiating with [GLOB.using_map.company_name] [GLOB.using_map.boss_name]. Prioritize saving human lives over ending them." + directive += "We are currently negotiating with [(LEGACY_MAP_DATUM).company_name] [(LEGACY_MAP_DATUM).boss_name]. Prioritize saving human lives over ending them." if(6) directive += "We are engaged in a legal dispute over [station_name()]. If a laywer is present on board, force their cooperation in the matter." if(7) @@ -148,7 +148,7 @@ var/datum/antagonist/ninja/ninjas if(8) directive += "Let no one question the mercy of the Spider Clan. Ensure the safety of all non-essential personnel you encounter." if(9) - directive += "A free agent has proposed a lucrative business deal. Implicate [GLOB.using_map.company_name] involvement in the operation." + directive += "A free agent has proposed a lucrative business deal. Implicate [(LEGACY_MAP_DATUM).company_name] involvement in the operation." if(10) directive += "Our reputation is on the line. Harm as few civilians and innocents as possible." if(11) @@ -156,14 +156,14 @@ var/datum/antagonist/ninja/ninjas if(12) directive += "We are currently negotiating with a mercenary leader. Disguise assassinations as suicide or other natural causes." if(13) - directive += "Some disgruntled [GLOB.using_map.company_name] employees have been supportive of our operations. Be wary of any mistreatment by command staff." + directive += "Some disgruntled [(LEGACY_MAP_DATUM).company_name] employees have been supportive of our operations. Be wary of any mistreatment by command staff." if(14) var/xenorace = pick(SPECIES_UNATHI, SPECIES_TAJ, SPECIES_SKRELL) directive += "A group of [xenorace] radicals have been loyal supporters of the Spider Clan. Favor [xenorace] crew whenever possible." if(15) directive += "The Spider Clan has recently been accused of religious insensitivity. Attempt to speak with the Chaplain and prove these accusations false." if(16) - directive += "The Spider Clan has been bargaining with a competing prosthetics manufacturer. Try to shine [GLOB.using_map.company_name] prosthetics in a bad light." + directive += "The Spider Clan has been bargaining with a competing prosthetics manufacturer. Try to shine [(LEGACY_MAP_DATUM).company_name] prosthetics in a bad light." if(17) directive += "The Spider Clan has recently begun recruiting outsiders. Consider suitable candidates and assess their behavior amongst the crew." if(18) diff --git a/code/game/area/area.dm b/code/game/area/area.dm index 6c218aceb9a..ccf6f48f958 100644 --- a/code/game/area/area.dm +++ b/code/game/area/area.dm @@ -105,6 +105,9 @@ // This interacts with the map loader, so it needs to be set immediately // rather than waiting for atoms to initialize. if (unique) + // todo: something is double initing reserve area god damnit... + // if(GLOB.areas_by_type[type]) + // STACK_TRACE("duplicated unique area, someone fucked up") GLOB.areas_by_type[type] = src uid = ++global_uid @@ -223,11 +226,12 @@ A.contents.Add(T) if(old_area) // Handle dynamic lighting update if - if(T.dynamic_lighting && old_area.dynamic_lighting != A.dynamic_lighting) - if(A.dynamic_lighting) - T.lighting_build_overlay() - else - T.lighting_clear_overlay() + if(SSlighting.initialized) + if(T.dynamic_lighting && old_area.dynamic_lighting != A.dynamic_lighting) + if(A.dynamic_lighting) + T.lighting_build_overlay() + else + T.lighting_clear_overlay() for(var/atom/movable/AM in T) old_area.Exited(AM, A) @@ -640,7 +644,7 @@ var/list/teleportlocs = list() continue var/station = FALSE for(var/turf/T in AR.contents) - if(T.z in GLOB.using_map.station_levels) + if(T.z in (LEGACY_MAP_DATUM).station_levels) station = TRUE break else @@ -661,7 +665,7 @@ var/list/ghostteleportlocs = list() ghostteleportlocs += AR.name ghostteleportlocs[AR.name] = AR var/turf/picked = pick(get_area_turfs(AR.type)) - if (picked.z in GLOB.using_map.player_levels) + if (picked.z in (LEGACY_MAP_DATUM).player_levels) ghostteleportlocs += AR.name ghostteleportlocs[AR.name] = AR diff --git a/code/game/atoms/movable/movable.dm b/code/game/atoms/movable/movable.dm index e719d5ce7cc..d5d04de6e66 100644 --- a/code/game/atoms/movable/movable.dm +++ b/code/game/atoms/movable/movable.dm @@ -219,10 +219,10 @@ return /atom/movable/proc/touch_map_edge() - if(z in GLOB.using_map.sealed_levels) + if(z in (LEGACY_MAP_DATUM).sealed_levels) return - if(GLOB.using_map.use_overmap) + if((LEGACY_MAP_DATUM).use_overmap) overmap_spacetravel(get_turf(src), src) return @@ -258,12 +258,11 @@ //by default, transition randomly to another zlevel /atom/movable/proc/get_transit_zlevel() - var/list/candidates = GLOB.using_map.accessible_z_levels.Copy() - candidates.Remove("[src.z]") - - if(!candidates.len) - return null - return text2num(pickweight(candidates)) + var/list/candidates = SSmapping.crosslinked_levels() + candidates -= z + if(!length(candidates)) + return + return pick(candidates) // Returns the current scaling of the sprite. // Note this DOES NOT measure the height or width of the icon, but returns what number is being multiplied with to scale the icons, if any. diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index 7eaa9d5480d..4fa11ab2a52 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -86,7 +86,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked /datum/universal_state/supermatter_cascade/OverlayAndAmbientSet() spawn(0) for(var/datum/lighting_corner/L in world) - if(L.z in GLOB.using_map.admin_levels) + if(L.z in (LEGACY_MAP_DATUM).admin_levels) L.update_lumcount(1,1,1) else L.update_lumcount(0.0, 0.4, 1) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index d7823d207c8..e1fad330762 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -10,7 +10,7 @@ var/hadevent = 0 /proc/alien_infestation(var/spawncount = 1) // -- TLE var/list/vents = list() for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index f2cc5c578d5..f67f367de4d 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -83,7 +83,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 sleep(1) while (immrod) if (isNotStationLevel(immrod.z)) - immrod.z = pick(GLOB.using_map.station_levels) + immrod.z = pick((LEGACY_MAP_DATUM).station_levels) if(immrod.loc == end) qdel(immrod) sleep(10) diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index 6eb2bda2eb0..dc51cc74d55 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -7,7 +7,7 @@ for(var/obj/machinery/power/smes/S in GLOB.machines) var/area/current_area = get_area(S) - if(current_area.type in skipped_areas || !(S.z in GLOB.using_map.station_levels)) + if(current_area.type in skipped_areas || !(S.z in (LEGACY_MAP_DATUM).station_levels)) continue S.last_charge = S.charge S.last_output_attempt = S.output_attempt @@ -21,7 +21,7 @@ for(var/obj/machinery/power/apc/C in GLOB.apcs) - if(!C.is_critical && C.cell && (C.z in GLOB.using_map.station_levels)) + if(!C.is_critical && C.cell && (C.z in (LEGACY_MAP_DATUM).station_levels)) C.cell.charge = 0 /proc/power_restore(var/announce = 1) @@ -30,7 +30,7 @@ if(announce) command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') for(var/obj/machinery/power/apc/C in GLOB.apcs) - if(C.cell && (C.z in GLOB.using_map.station_levels)) + if(C.cell && (C.z in (LEGACY_MAP_DATUM).station_levels)) C.cell.charge = C.cell.maxcharge for(var/obj/machinery/power/smes/S in GLOB.machines) var/area/current_area = get_area(S) diff --git a/code/game/gamemodes/events/wormholes.dm b/code/game/gamemodes/events/wormholes.dm index 06f46de1f4c..68acc627535 100644 --- a/code/game/gamemodes/events/wormholes.dm +++ b/code/game/gamemodes/events/wormholes.dm @@ -2,7 +2,7 @@ spawn() var/list/pick_turfs = list() var/list/Z_choices = list() - Z_choices |= GLOB.using_map.get_map_levels(1, FALSE) + Z_choices |= (LEGACY_MAP_DATUM).get_map_levels(1, FALSE) for(var/turf/simulated/floor/T in world) if(T.z in Z_choices) if(!T.block_tele) diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index b9a3ce15dcb..c9ab3386907 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -148,7 +148,7 @@ return var/list/remaining_apcs = list() for(var/obj/machinery/power/apc/A in GLOB.apcs) - if(!(A.z in GLOB.using_map.station_levels)) // Only station APCs + if(!(A.z in (LEGACY_MAP_DATUM).station_levels)) // Only station APCs continue if(A.hacker == user || A.aidisabled) // This one is already hacked, or AI control is disabled on it. continue @@ -194,7 +194,7 @@ sleep(300) // Hack all APCs, including those built during hack sequence. for(var/obj/machinery/power/apc/A in GLOB.apcs) - if((!A.hacker || (A.hacker != src)) && !A.aidisabled && (A.z in GLOB.using_map.station_levels)) + if((!A.hacker || (A.hacker != src)) && !A.aidisabled && (A.z in (LEGACY_MAP_DATUM).station_levels)) A.ai_hack(src) diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index e75b6a3c69e..7af0fbd3a42 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -27,7 +27,7 @@ if(isnull(startSide)) startSide = pick(GLOB.cardinal) if(isnull(startLevel)) - startLevel = pick(GLOB.using_map.station_levels - GLOB.using_map.sealed_levels) + startLevel = pick((LEGACY_MAP_DATUM).station_levels - (LEGACY_MAP_DATUM).sealed_levels) var/turf/pickedstart = spaceDebrisStartLoc(startSide, startLevel) var/turf/pickedgoal = spaceDebrisFinishLoc(startSide, startLevel) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 19a33623388..fd167f19fc3 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -132,7 +132,7 @@ var/global/list/all_objectives = list() ..() if(target && target.current) var/datum/gender/T = GLOB.gender_datums[target.current.get_visible_gender()] - explanation_text = "[target.current.real_name], the [target.assigned_role] has been classified as harmful to [GLOB.using_map.company_name]'s goals. Demote [T.him] to assistant." + explanation_text = "[target.current.real_name], the [target.assigned_role] has been classified as harmful to [(LEGACY_MAP_DATUM).company_name]'s goals. Demote [T.him] to assistant." else explanation_text = "Free Objective" return target @@ -141,7 +141,7 @@ var/global/list/all_objectives = list() ..(role, role_type) if(target && target.current) var/datum/gender/T = GLOB.gender_datums[target.current.get_visible_gender()] - explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has been classified as harmful to [GLOB.using_map.company_name]'s goals. Demote [T.him] to assistant." + explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has been classified as harmful to [(LEGACY_MAP_DATUM).company_name]'s goals. Demote [T.him] to assistant." else explanation_text = "Free Objective" return target diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index de748fc6854..6bb966a3ed7 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -335,7 +335,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - if(href_list["refund_functions"]) var/turf/T = get_turf(H) - if(T.z in GLOB.using_map.player_levels) + if(T.z in (LEGACY_MAP_DATUM).player_levels) to_chat(H, "You can only refund at your base, it's too late now!") return var/obj/item/technomancer_core/core = null @@ -352,7 +352,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - /obj/item/technomancer_catalog/attackby(var/atom/movable/AM, var/mob/user) var/turf/T = get_turf(user) - if(T.z in GLOB.using_map.player_levels) + if(T.z in (LEGACY_MAP_DATUM).player_levels) to_chat(user, "You can only refund at your base, it's too late now!") return for(var/datum/technomancer/equipment/E in equipment_instances + assistance_instances) diff --git a/code/game/gamemodes/technomancer/spell_objs_helpers.dm b/code/game/gamemodes/technomancer/spell_objs_helpers.dm index 6239aeec9ed..debab91c5de 100644 --- a/code/game/gamemodes/technomancer/spell_objs_helpers.dm +++ b/code/game/gamemodes/technomancer/spell_objs_helpers.dm @@ -29,7 +29,7 @@ /obj/item/spell/proc/allowed_to_teleport() if(owner) - if(owner.z in GLOB.using_map.admin_levels) + if(owner.z in (LEGACY_MAP_DATUM).admin_levels) return FALSE var/turf/T = get_turf(owner) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 1a628c1d1f1..96208039884 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -80,7 +80,7 @@ if(W.is_screwdriver()) playsound(src.loc, W.tool_sound, 50, 1) - var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+GLOB.using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT)) + var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+(LEGACY_MAP_DATUM).station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT)) if(!input) to_chat(usr, "No input found please hang up and try your call again.") return diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 30cde858c5b..be3f3a08b14 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -6,7 +6,7 @@ /mob/living/silicon/ai/var/stored_locations[0] /proc/InvalidPlayerTurf(turf/T as turf) - return !(T && (T.z in GLOB.using_map.player_levels)) + return !(T && (T.z in (LEGACY_MAP_DATUM).player_levels)) /mob/living/silicon/ai/proc/get_camera_list() if(src.stat == 2) @@ -258,7 +258,7 @@ if(. == TRACKING_NO_COVERAGE) var/turf/T = get_turf(src) - if(T && (T.z in GLOB.using_map.station_levels) && hassensorlevel(src, SUIT_SENSOR_TRACKING)) + if(T && (T.z in (LEGACY_MAP_DATUM).station_levels) && hassensorlevel(src, SUIT_SENSOR_TRACKING)) return TRACKING_POSSIBLE /mob/living/proc/tracking_initiated() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 8d9c41dc0ad..c6876f758bc 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -19,7 +19,7 @@ camera = new(src, network) /obj/machinery/computer/security/proc/get_default_networks() - . = GLOB.using_map.station_networks.Copy() + . = (LEGACY_MAP_DATUM).station_networks.Copy() /obj/machinery/computer/security/Destroy() QDEL_NULL(camera) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 01ab3e9a08b..365e0e483c3 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -35,12 +35,12 @@ var/stat_msg1 var/stat_msg2 - var/datum/lore/atc_controller/ATC + var/datum/controller/subsystem/legacy_atc/ATC var/datum/legacy_announcement/priority/crew_announcement = new /obj/machinery/computer/communications/Initialize(mapload) . = ..() - ATC = GLOB.lore_atc + ATC = SSlegacy_atc crew_announcement.newscast = 1 /obj/machinery/computer/communications/process(delta_time) @@ -52,7 +52,7 @@ /obj/machinery/computer/communications/Topic(href, href_list) if(..()) return 1 - if (GLOB.using_map && !(src.z in GLOB.using_map.contact_levels)) + if ((LEGACY_MAP_DATUM) && !(src.z in (LEGACY_MAP_DATUM).contact_levels)) to_chat(usr, "Unable to establish a connection: You're too far away from the station!") return usr.set_machine(src) @@ -191,12 +191,12 @@ if(centcomm_message_cooldown) to_chat(usr, "Arrays recycling. Please stand by.") return - var/input = sanitize(input("Please choose a message to transmit to [GLOB.using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) + var/input = sanitize(input("Please choose a message to transmit to [(LEGACY_MAP_DATUM).boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) if(!input || !(usr in view(1,src))) return message_centcom(input, usr) to_chat(usr, "Message transmitted.") - log_game("[key_name(usr)] has made an IA [GLOB.using_map.boss_short] announcement: [input]") + log_game("[key_name(usr)] has made an IA [(LEGACY_MAP_DATUM).boss_short] announcement: [input]") centcomm_message_cooldown = 1 spawn(300)//10 minute cooldown centcomm_message_cooldown = 0 @@ -299,7 +299,7 @@ /obj/machinery/computer/communications/attack_hand(mob/user, list/params) if(..()) return - if (GLOB.using_map && !(src.z in GLOB.using_map.contact_levels)) + if ((LEGACY_MAP_DATUM) && !(src.z in (LEGACY_MAP_DATUM).contact_levels)) to_chat(user, "Unable to establish a connection: You're too far away from the station!") return @@ -325,7 +325,7 @@ dat += "
\[ Make An Announcement \]" if (src.authenticated==2) if(src.emagged == 0) - dat += "
\[ Send an emergency message to [GLOB.using_map.boss_short] \]" + dat += "
\[ Send an emergency message to [(LEGACY_MAP_DATUM).boss_short] \]" else dat += "
\[ Send an emergency message to \[UNKNOWN\] \]" dat += "
\[ Restore Backup Routing Data \]" @@ -479,7 +479,7 @@ return if(deathsquad.deployed) - to_chat(user, "[GLOB.using_map.boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") + to_chat(user, "[(LEGACY_MAP_DATUM).boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") return if(SSemergencyshuttle.deny_shuttle) @@ -491,7 +491,7 @@ return if(SSemergencyshuttle.going_to_centcom()) - to_chat(user, "The emergency shuttle may not be called while returning to [GLOB.using_map.boss_short].") + to_chat(user, "The emergency shuttle may not be called while returning to [(LEGACY_MAP_DATUM).boss_short].") return if(SSemergencyshuttle.online()) @@ -515,7 +515,7 @@ return if(SSemergencyshuttle.going_to_centcom()) - to_chat(user, "The shuttle may not be called while returning to [GLOB.using_map.boss_short].") + to_chat(user, "The shuttle may not be called while returning to [(LEGACY_MAP_DATUM).boss_short].") return if(SSemergencyshuttle.online()) @@ -525,11 +525,11 @@ // if force is 0, some things may stop the shuttle call if(!force) if(SSemergencyshuttle.deny_shuttle) - to_chat(user, "[GLOB.using_map.boss_short] does not currently have a shuttle available in your sector. Please try again later.") + to_chat(user, "[(LEGACY_MAP_DATUM).boss_short] does not currently have a shuttle available in your sector. Please try again later.") return if(deathsquad.deployed == 1) - to_chat(user, "[GLOB.using_map.boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") + to_chat(user, "[(LEGACY_MAP_DATUM).boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") return if(world.time < 54000) // 30 minute grace period to let the game get going diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index fd4b2dd94c8..0b78a2ed1e7 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -25,7 +25,7 @@ /obj/machinery/computer/aiupload/attackby(obj/item/O, mob/user) - if (GLOB.using_map && !(user.z in GLOB.using_map.contact_levels)) + if ((LEGACY_MAP_DATUM) && !(user.z in (LEGACY_MAP_DATUM).contact_levels)) to_chat(user, "Unable to establish a connection: You're too far away from the station!") return if(istype(O, /obj/item/aiModule)) diff --git a/code/game/machinery/computer/misc/bioscan.dm b/code/game/machinery/computer/misc/bioscan.dm index aaf0b5a0b31..73d22e9764a 100644 --- a/code/game/machinery/computer/misc/bioscan.dm +++ b/code/game/machinery/computer/misc/bioscan.dm @@ -38,7 +38,7 @@ if(!T) continue . += list(list( - "level" = SSmapping.level_id(get_z(A)), + "level" = SSmapping.fluff_level_id(get_z(A)), "id" = "[A.id]", "anchor" = A.anchored, "name" = A.name, @@ -102,7 +102,7 @@ var/list/assembled = list() for(var/z_str in indices) var/list/gottem = list() - gottem["id"] = SSmapping.level_id(text2num(z_str)) + gottem["id"] = SSmapping.fluff_level_id(text2num(z_str)) var/mobs_all = 0 var/mobs_complex = 0 var/mobs_complex_alive = 0 diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 59e7de23bb1..3454c1ab935 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -50,7 +50,7 @@ continue var/loc_display = "Unknown" var/mob/living/L = track.imp_in - if((get_z(L) in GLOB.using_map.station_levels) && !istype(L.loc, /turf/space)) + if((get_z(L) in (LEGACY_MAP_DATUM).station_levels) && !istype(L.loc, /turf/space)) loc_display = T.loc if(track.malfunction) loc_display = pick(teleportlocs) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index e7284a10258..65b2b5870cc 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -65,7 +65,7 @@ /obj/machinery/computer/skills/attack_hand(mob/user, list/params) if(..()) return - if (GLOB.using_map && !(src.z in GLOB.using_map.contact_levels)) + if ((LEGACY_MAP_DATUM) && !(src.z in (LEGACY_MAP_DATUM).contact_levels)) to_chat(user, "Unable to establish a connection: You're too far away from the station!") return ui_interact(user) diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm index d100e8cf607..57c8fc93b68 100644 --- a/code/game/machinery/computer/specops_shuttle.dm +++ b/code/game/machinery/computer/specops_shuttle.dm @@ -91,7 +91,7 @@ var/specops_shuttle_timeleft = 0 for(var/turf/T in get_area_turfs(end_location) ) var/mob/M = locate(/mob) in T - to_chat(M, "You have arrived at [GLOB.using_map.boss_name]. Operation has ended!") + to_chat(M, "You have arrived at [(LEGACY_MAP_DATUM).boss_name]. Operation has ended!") specops_shuttle_at_station = 0 @@ -288,14 +288,14 @@ var/specops_shuttle_timeleft = 0 if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return if (!specops_can_move()) - to_chat(usr, "[GLOB.using_map.boss_name] will not allow the Special Operations shuttle to return yet.") + to_chat(usr, "[(LEGACY_MAP_DATUM).boss_name] will not allow the Special Operations shuttle to return yet.") if(world.timeofday <= specops_shuttle_timereset) if (((world.timeofday - specops_shuttle_timereset)/10) > 60) to_chat(usr, "[-((world.timeofday - specops_shuttle_timereset)/10)/60] minutes remain!") to_chat(usr, "[-(world.timeofday - specops_shuttle_timereset)/10] seconds remain!") return - to_chat(usr, "The Special Operations shuttle will arrive at [GLOB.using_map.boss_name] in [(SPECOPS_MOVETIME/10)] seconds.") + to_chat(usr, "The Special Operations shuttle will arrive at [(LEGACY_MAP_DATUM).boss_name] in [(SPECOPS_MOVETIME/10)] seconds.") temp += "Shuttle departing.

OK" updateUsrDialog() diff --git a/code/game/machinery/computer/timeclock_vr.dm b/code/game/machinery/computer/timeclock_vr.dm index 571d254ed54..3c548c747fd 100644 --- a/code/game/machinery/computer/timeclock_vr.dm +++ b/code/game/machinery/computer/timeclock_vr.dm @@ -191,7 +191,7 @@ var/mob/living/carbon/human/H = usr H.mind.assigned_role = card.rank H.mind.role_alt_title = card.assignment - announce.autosay("[card.registered_name] has moved On-Duty as [card.assignment].", "Employee Oversight", channel, zlevels = GLOB.using_map.get_map_levels(get_z(src))) + announce.autosay("[card.registered_name] has moved On-Duty as [card.assignment].", "Employee Oversight", channel, zlevels = (LEGACY_MAP_DATUM).get_map_levels(get_z(src))) return /obj/machinery/computer/timeclock/proc/makeOffDuty() @@ -217,7 +217,7 @@ H.mind.assigned_role = ptojob.title H.mind.role_alt_title = ptojob.title foundjob.current_positions-- - announce.autosay("[card.registered_name], [oldtitle], has moved Off-Duty.", "Employee Oversight", channel, zlevels = GLOB.using_map.get_map_levels(get_z(src))) + announce.autosay("[card.registered_name], [oldtitle], has moved Off-Duty.", "Employee Oversight", channel, zlevels = (LEGACY_MAP_DATUM).get_map_levels(get_z(src))) return /obj/machinery/computer/timeclock/proc/checkCardCooldown() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 8fea9d0c917..8eb507be9e9 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -514,7 +514,7 @@ if(!silent) //Make an announcement and log the person entering storage. control_computer.frozen_crew += "[to_despawn.real_name], [to_despawn.mind.role_alt_title] - [stationtime2text()]" - announce.autosay("[to_despawn.real_name], [to_despawn.mind.role_alt_title], [on_store_message]", "[on_store_name]", announce_channel, GLOB.using_map.get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE)) + announce.autosay("[to_despawn.real_name], [to_despawn.mind.role_alt_title], [on_store_message]", "[on_store_name]", announce_channel, (LEGACY_MAP_DATUM).get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE)) //visible_message(SPAN_NOTICE("\The [initial(name)] hums and hisses as it moves [to_despawn.real_name] into storage."), 3) visible_message(SPAN_NOTICE("\The [initial(name)] [on_store_visible_message_1] [to_despawn.real_name] [on_store_visible_message_2]."), 3) control_computer._admin_logs += "[key_name(to_despawn)] ([to_despawn.mind.role_alt_title]) at [stationtime2text()]" diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 7a27a3e9c52..585958e5341 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1404,7 +1404,7 @@ About the new airlock wires panel: //wires var/turf/T = get_turf(loc) - if(T && (T.z in GLOB.using_map.admin_levels)) + if(T && (T.z in (LEGACY_MAP_DATUM).admin_levels)) secured_wires = 1 if (secured_wires) wires = new/datum/wires/airlock/secure(src) diff --git a/code/game/machinery/exonet_node.dm b/code/game/machinery/exonet_node.dm index b13157631a2..3533fa08592 100644 --- a/code/game/machinery/exonet_node.dm +++ b/code/game/machinery/exonet_node.dm @@ -23,8 +23,8 @@ // Description: Adds components to the machine for deconstruction. Also refreshes the descrition. /obj/machinery/exonet_node/map/Initialize(mapload, newdir) . = ..() - desc = "This machine is one of many, many nodes inside [GLOB.using_map.starsys_name]'s section of the Exonet, connecting the \ - [GLOB.using_map.station_short] to the rest of the system, at least electronically." + desc = "This machine is one of many, many nodes inside [(LEGACY_MAP_DATUM).starsys_name]'s section of the Exonet, connecting the \ + [(LEGACY_MAP_DATUM).station_short] to the rest of the system, at least electronically." update_desc() // Proc: update_icon() diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index 79e1fd0f775..4d588634364 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -30,7 +30,7 @@ FIRE ALARM /obj/machinery/firealarm/Initialize(mapload) . = ..() - if(z in GLOB.using_map.contact_levels) + if(z in (LEGACY_MAP_DATUM).contact_levels) set_security_level(GLOB.security_level ? get_security_level() : "green") /obj/machinery/firealarm/update_icon() diff --git a/code/game/machinery/holopad.dm b/code/game/machinery/holopad.dm index b94eedf1072..0b7b6dbdc5b 100644 --- a/code/game/machinery/holopad.dm +++ b/code/game/machinery/holopad.dm @@ -391,7 +391,7 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE) if(world.time < holocall_last_radio + 30 SECONDS) return holocall_last_radio = world.time - GLOB.global_announcer.autosay("Incoming call from [incoming.caller_id_source()] at [get_area(src)].", name, zlevels = GLOB.using_map.get_map_levels(get_z(src))) + GLOB.global_announcer.autosay("Incoming call from [incoming.caller_id_source()] at [get_area(src)].", name, zlevels = (LEGACY_MAP_DATUM).get_map_levels(get_z(src))) /** * get hung up by a call diff --git a/code/game/machinery/holoposter.dm b/code/game/machinery/holoposter.dm index 62a160829e2..424dbb2db3f 100644 --- a/code/game/machinery/holoposter.dm +++ b/code/game/machinery/holoposter.dm @@ -53,7 +53,7 @@ GLOBAL_LIST_EMPTY(holoposters) examine_addon = "It appears to be malfunctioning." new_color = "#6A6C71" else - if((z in GLOB.using_map.station_levels) && GLOB.security_level) // 0 is fine, everything higher is alert levels + if((z in (LEGACY_MAP_DATUM).station_levels) && GLOB.security_level) // 0 is fine, everything higher is alert levels icon_state = "attention" examine_addon = "It warns you to remain calm and contact your supervisor as soon as possible." new_color = "#AA7039" diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 434359ef673..c30ab142519 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -291,7 +291,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
Feed Security functions:
" dat+="
[(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue" dat+="
Censor Feed Stories" - dat+="
Mark Feed Channel with [GLOB.using_map.company_name] D-Notice" + dat+="
Mark Feed Channel with [(LEGACY_MAP_DATUM).company_name] D-Notice" dat+="

The newscaster recognises you as: [scanned_user]" if(1) dat+= "Station Feed Channels
" @@ -372,7 +372,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(9) dat+="[viewing_channel.channel_name]: \[created by: [viewing_channel.author]\]
" if(viewing_channel.censored) - dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [GLOB.using_map.company_name] D-Notice.
" + dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [(LEGACY_MAP_DATUM).company_name] D-Notice.
" dat+="No further feed story additions are allowed while the D-Notice is in effect.

" else if(!length(viewing_channel.messages)) @@ -392,7 +392,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="

Refresh" dat+="
Back" if(10) - dat+="[GLOB.using_map.company_name] Feed Censorship Tool
" + dat+="[(LEGACY_MAP_DATUM).company_name] Feed Censorship Tool
" dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
" dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.
" dat+="
Select Feed channel to get Stories from:
" @@ -403,7 +403,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : null]
" dat+="
Cancel" if(11) - dat+="[GLOB.using_map.company_name] D-Notice Handler
" + dat+="[(LEGACY_MAP_DATUM).company_name] D-Notice Handler
" dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's" dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed" dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
" @@ -430,7 +430,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="[viewing_channel.channel_name]: \[ created by: [viewing_channel.author] \]
" dat+="Channel messages listed below. If you deem them dangerous to the station, you can Bestow a D-Notice upon the channel.
" if(viewing_channel.censored) - dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [GLOB.using_map.company_name] D-Notice.
" + dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [(LEGACY_MAP_DATUM).company_name] D-Notice.
" dat+="No further feed story additions are allowed while the D-Notice is in effect.

" else if(!length(viewing_channel.messages)) @@ -636,7 +636,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co screen = 15 else if(news_network.wanted_issue.is_admin_message) - alert("The wanted issue has been distributed by a [GLOB.using_map.company_name] higherup. You cannot edit it.","Ok") + alert("The wanted issue has been distributed by a [(LEGACY_MAP_DATUM).company_name] higherup. You cannot edit it.","Ok") return news_network.wanted_issue.author = channel_name news_network.wanted_issue.body = msg @@ -649,7 +649,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["cancel_wanted"]) if(news_network.wanted_issue.is_admin_message) - alert("The wanted issue has been distributed by a [GLOB.using_map.company_name] higherup. You cannot take it down.","Ok") + alert("The wanted issue has been distributed by a [(LEGACY_MAP_DATUM).company_name] higherup. You cannot take it down.","Ok") return var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") @@ -665,7 +665,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["censor_channel_author"]) var/datum/feed_channel/FC = locate(href_list["censor_channel_author"]) if(FC.is_admin_channel) - alert("This channel was created by a [GLOB.using_map.company_name] Officer. You cannot censor it.","Ok") + alert("This channel was created by a [(LEGACY_MAP_DATUM).company_name] Officer. You cannot censor it.","Ok") return if(FC.author != "\[REDACTED\]") FC.backup_author = FC.author @@ -678,7 +678,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["censor_channel_story_author"]) var/datum/feed_message/MSG = locate(href_list["censor_channel_story_author"]) if(MSG.is_admin_message) - alert("This message was created by a [GLOB.using_map.company_name] Officer. You cannot censor its author.","Ok") + alert("This message was created by a [(LEGACY_MAP_DATUM).company_name] Officer. You cannot censor its author.","Ok") return if(MSG.author != "\[REDACTED\]") MSG.backup_author = MSG.author @@ -691,7 +691,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["censor_channel_story_body"]) var/datum/feed_message/MSG = locate(href_list["censor_channel_story_body"]) if(MSG.is_admin_message) - alert("This channel was created by a [GLOB.using_map.company_name] Officer. You cannot censor it.","Ok") + alert("This channel was created by a [(LEGACY_MAP_DATUM).company_name] Officer. You cannot censor it.","Ok") return if(MSG.body != "\[REDACTED\]") MSG.backup_body = MSG.body @@ -717,7 +717,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["toggle_d_notice"]) var/datum/feed_channel/FC = locate(href_list["toggle_d_notice"]) if(FC.is_admin_channel) - alert("This channel was created by a [GLOB.using_map.company_name] Officer. You cannot place a D-Notice upon it.","Ok") + alert("This channel was created by a [(LEGACY_MAP_DATUM).company_name] Officer. You cannot place a D-Notice upon it.","Ok") return FC.censored = !FC.censored FC.update() @@ -822,7 +822,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co switch(screen) if(0) //Cover dat+="
The Griffon
" - dat+="
[GLOB.using_map.company_name]-standard newspaper, for use on [GLOB.using_map.company_name]� Space Facilities

" + dat+="
[(LEGACY_MAP_DATUM).company_name]-standard newspaper, for use on [(LEGACY_MAP_DATUM).company_name]� Space Facilities

" if(!length(news_content)) if(important_message) dat+="Contents:
" diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 40878906a9d..ab29e0b796f 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -379,7 +379,7 @@ var/bomb_set var/off_station = 0 var/turf/bomb_location = get_turf(src) - if(bomb_location && (bomb_location.z in GLOB.using_map.station_levels)) + if(bomb_location && (bomb_location.z in (LEGACY_MAP_DATUM).station_levels)) if((bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE))) off_station = 1 else diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm index 6502e04ea56..f3337336291 100644 --- a/code/game/machinery/supplybeacon.dm +++ b/code/game/machinery/supplybeacon.dm @@ -117,6 +117,6 @@ var/drop_x = src.x - 2 var/drop_y = src.y - 2 var/drop_z = src.z - command_announcement.Announce("[GLOB.using_map.starsys_name] Rapid Fabrication priority supply request #[rand(1000,9999)]-[rand(100,999)] recieved. Shipment dispatched via ballistic supply pod for immediate delivery. Have a nice day.", "Thank You For Your Patronage") + command_announcement.Announce("[(LEGACY_MAP_DATUM).starsys_name] Rapid Fabrication priority supply request #[rand(1000,9999)]-[rand(100,999)] recieved. Shipment dispatched via ballistic supply pod for immediate delivery. Have a nice day.", "Thank You For Your Patronage") spawn(rand(100, 300)) new /datum/random_map/droppod/supply(null, drop_x, drop_y, drop_z, supplied_drop = drop_type) // Splat. diff --git a/code/game/machinery/telecomms/_telecomms.dm b/code/game/machinery/telecomms/_telecomms.dm index 138aea71740..6742110c247 100644 --- a/code/game/machinery/telecomms/_telecomms.dm +++ b/code/game/machinery/telecomms/_telecomms.dm @@ -265,7 +265,7 @@ if(ad_hoc && src_z == dst_z) return TRUE - return src_z in GLOB.using_map.get_map_levels(dst_z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) + return src_z in (LEGACY_MAP_DATUM).get_map_levels(dst_z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) /* diff --git a/code/game/machinery/telecomms/allinone.dm b/code/game/machinery/telecomms/allinone.dm index 23f48b5d8c4..493cfe0be04 100644 --- a/code/game/machinery/telecomms/allinone.dm +++ b/code/game/machinery/telecomms/allinone.dm @@ -32,7 +32,7 @@ return // Why did you use this subtype? - if(!GLOB.using_map.use_overmap) + if(!(LEGACY_MAP_DATUM).use_overmap) return // Someone else handling it? @@ -40,7 +40,7 @@ return // Where are we able to hear from (and talk to, since we're AIO) anyway? - var/map_levels = GLOB.using_map.get_map_levels(z, TRUE, overmap_range) + var/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z, TRUE, overmap_range) //Bluespace can skip this check if(signal.transmission_method != TRANSMISSION_BLUESPACE) @@ -119,7 +119,7 @@ // For some reason level is both used as a list and not a list, and now it needs to be a list. // Because this is a 'all in one' machine, we're gonna just cheat. - //signal.data["level"] = GLOB.using_map.contact_levels.Copy() + //signal.data["level"] = (LEGACY_MAP_DATUM).contact_levels.Copy() if(signal.data["slow"] > 0) sleep(signal.data["slow"]) // simulate the network lag if necessary @@ -175,7 +175,7 @@ // For some reason level is both used as a list and not a list, and now it needs to be a list. // Because this is a 'all in one' machine, we're gonna just cheat. - //signal.data["level"] = GLOB.using_map.contact_levels.Copy() + //signal.data["level"] = (LEGACY_MAP_DATUM).contact_levels.Copy() if(signal.data["slow"] > 0) sleep(signal.data["slow"]) // simulate the network lag if necessary diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 5ee8c0d451a..178cf7e403f 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -58,7 +58,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept if(signal.data["slow"] > 0) sleep(signal.data["slow"]) // simulate the network lag if necessary - signal.data["level"] |= GLOB.using_map.get_map_levels(listening_level, TRUE, overmap_range) + signal.data["level"] |= (LEGACY_MAP_DATUM).get_map_levels(listening_level, TRUE, overmap_range) var/list/forced_radios for(var/datum/weakref/wr in linked_radios_weakrefs) diff --git a/code/game/machinery/telecomms/receiver.dm b/code/game/machinery/telecomms/receiver.dm index bbf4879bb8f..df2ac6491cf 100644 --- a/code/game/machinery/telecomms/receiver.dm +++ b/code/game/machinery/telecomms/receiver.dm @@ -64,7 +64,7 @@ return 1 //Where can we hear? - var/list/listening_levels = GLOB.using_map.get_map_levels(listening_level, TRUE, overmap_range) + var/list/listening_levels = (LEGACY_MAP_DATUM).get_map_levels(listening_level, TRUE, overmap_range) // We couldn't 'hear' it, maybe a relay linked to our hub can 'hear' it if(!(signal.data["level"] in listening_levels)) diff --git a/code/game/machinery/telecomms/relay.dm b/code/game/machinery/telecomms/relay.dm index 24dbcd176df..dd3dbafee43 100644 --- a/code/game/machinery/telecomms/relay.dm +++ b/code/game/machinery/telecomms/relay.dm @@ -30,7 +30,7 @@ // Add our level and send it back if(can_send(signal)) - signal.data["level"] |= GLOB.using_map.get_map_levels(listening_level) + signal.data["level"] |= (LEGACY_MAP_DATUM).get_map_levels(listening_level) // Checks to see if it can send/receive. diff --git a/code/game/machinery/telecomms/server.dm b/code/game/machinery/telecomms/server.dm index 6dfe672a7ce..0fb427f865a 100644 --- a/code/game/machinery/telecomms/server.dm +++ b/code/game/machinery/telecomms/server.dm @@ -147,7 +147,7 @@ "name" = T.scan_name, "x" = T.random_x, "y" = T.random_y, - "z" = SSmapping.level_id(T.random_z), + "z" = SSmapping.fluff_level_id(T.random_z), "accuracy" = T.accuracy, "last" = world.time - T.last_updated, "tag" = key, diff --git a/code/game/machinery/teleporter/console.dm b/code/game/machinery/teleporter/console.dm index 7bcb08642fd..1f57687b2a4 100644 --- a/code/game/machinery/teleporter/console.dm +++ b/code/game/machinery/teleporter/console.dm @@ -132,7 +132,7 @@ var/turf/T = get_turf(R) if(!T) continue - if(!(T.z in GLOB.using_map.player_levels)) + if(!(T.z in (LEGACY_MAP_DATUM).player_levels)) continue var/tmpname = T.loc.name if(areaindex[tmpname]) @@ -154,7 +154,7 @@ var/turf/T = get_turf(M) if(!T) continue - if(!(T.z in GLOB.using_map.player_levels)) + if(!(T.z in (LEGACY_MAP_DATUM).player_levels)) continue var/tmpname = M.real_name if(areaindex[tmpname]) diff --git a/code/game/machinery/teleporter/projector.dm b/code/game/machinery/teleporter/projector.dm index 734d2407d21..208563eccd1 100644 --- a/code/game/machinery/teleporter/projector.dm +++ b/code/game/machinery/teleporter/projector.dm @@ -295,6 +295,6 @@ var/obj/machinery/power/apc/P = get_area(src).get_apc() P.overload_lighting(100) for(var/obj/machinery/power/grid_checker/G in GLOB.machines) - if(G.z in GLOB.using_map.station_levels) + if(G.z in (LEGACY_MAP_DATUM)) G.power_failure(FALSE) diff --git a/code/game/mecha/combat/fighter.dm b/code/game/mecha/combat/fighter.dm index 7afe49eafab..fe604618554 100644 --- a/code/game/mecha/combat/fighter.dm +++ b/code/game/mecha/combat/fighter.dm @@ -64,7 +64,7 @@ //We don't get lost quite as easy. /obj/mecha/combat/fighter/touch_map_edge() //No overmap enabled or no driver to choose - if(!GLOB.using_map.use_overmap || !occupant || !can_ztravel()) + if(!(LEGACY_MAP_DATUM).use_overmap || !occupant || !can_ztravel()) return ..() var/obj/effect/overmap/visitable/our_ship = get_overmap_sector(z) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 376c7e42d86..ddb7572db54 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -693,7 +693,7 @@ sleep(15) visible_message("[icon2html(src, world)] [src] beeps: \"User DB corrupted \[Code 0x00FA\]. Truncating data structure...\"") sleep(30) - visible_message("[icon2html(src, world)] [src] beeps: \"User DB truncated. Please contact your [GLOB.using_map.company_name] system operator for future assistance.\"") + visible_message("[icon2html(src, world)] [src] beeps: \"User DB truncated. Please contact your [(LEGACY_MAP_DATUM).company_name] system operator for future assistance.\"") req_access = null emagged = 1 return 1 diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 3fb190cfdea..9e14f1ec7b3 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -46,7 +46,7 @@ GLOBAL_LIST_BOILERPLATE(all_portals, /obj/effect/portal) if (istype(M, /atom/movable)) if(prob(failchance)) src.icon_state = "portal1" - do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), pick(GLOB.using_map.get_map_levels(z))), 0) + do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), pick((LEGACY_MAP_DATUM).get_map_levels(z))), 0) else do_teleport(M, target, 1) ///You will appear adjacent to the beacon diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 70aee8bbc71..e288496e8b4 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -204,11 +204,12 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop /* Teleporter which simulates falling out of the sky. */ /obj/effect/step_trigger/teleporter/planetary_fall + var/planet_path var/datum/planet/planet = null // First time setup, which planet are we aiming for? /obj/effect/step_trigger/teleporter/planetary_fall/proc/find_planet() - return + planet = locate(planet_path) in SSplanets.planets /obj/effect/step_trigger/teleporter/planetary_fall/Trigger(var/atom/movable/A) if(!planet) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 6fa1e98a357..33e7a17e9f0 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -32,7 +32,7 @@ far_dist += devastation_range * 10 var/frequency = get_rand_frequency() var/creaking_explosion = FALSE - var/on_station = SSmapping.level_trait(epicenter.z, MAP_LEVEL_STATION) + var/on_station = SSmapping.level_trait(epicenter.z, LEGACY_LEVEL_STATION) if(prob(devastation_range*30+heavy_impact_range*5) && on_station) // Huge explosions are near guaranteed to make the station creak and whine, smaller ones might. creaking_explosion = TRUE // prob over 100 always returns true var/far_volume = clamp(far_dist, 30, 50) // Volume is based on explosion size and dist diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 9276014bd6d..9f8a9b958a9 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -85,7 +85,7 @@ var/area/A = get_area() var/text = {"[src]

[station_name()] blueprints

-Property of [GLOB.using_map.company_name]. For heads of staff only. Store in high-secure storage.
+Property of [(LEGACY_MAP_DATUM).company_name]. For heads of staff only. Store in high-secure storage.
"} var/curAreaType = get_area_type() switch (curAreaType) diff --git a/code/game/objects/items/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/circuitboards/computer/camera_monitor.dm index 042ae1f95c6..5d0eb5d950a 100644 --- a/code/game/objects/items/circuitboards/computer/camera_monitor.dm +++ b/code/game/objects/items/circuitboards/computer/camera_monitor.dm @@ -12,7 +12,7 @@ /obj/item/circuitboard/security/Initialize(mapload) . = ..() - network = GLOB.using_map.station_networks + network = (LEGACY_MAP_DATUM).station_networks /obj/item/circuitboard/security/tv name = T_BOARD("security camera monitor - television") diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 0f58fb47bc4..ec1daf450a9 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -238,7 +238,7 @@ return var/angle var/valid = TRUE - var/curr_l_id = SSmapping.level_id(get_z(src)) + var/curr_l_id = SSmapping.fluff_level_id(get_z(src)) var/turf/T = get_turf(src) if(!T) hud_arrow?.set_disabled(TRUE) @@ -253,7 +253,7 @@ var/datum/component/gps_signal/sig = tracking var/atom/A = sig.parent var/turf/AT = get_turf(A) - if(SSmapping.level_id(get_z(A)) != curr_l_id) + if(SSmapping.fluff_level_id(get_z(A)) != curr_l_id) valid = FALSE else angle = arctan(AT.x - T.x, AT.y - T.y) @@ -363,16 +363,16 @@ if(!on) return var/turf/curr = get_turf(src) - var/list/detecting_levels = GLOB.using_map.get_map_levels(curr.z, long_range) + var/list/detecting_levels = (LEGACY_MAP_DATUM).get_map_levels(curr.z, long_range) .["x"] = curr.x .["y"] = curr.y - .["level"] = SSmapping.level_id(curr.z) + .["level"] = SSmapping.fluff_level_id(curr.z) var/list/others = list() .["signals"] = others var/datum/component/gps_signal/our_sig = GetComponent(/datum/component/gps_signal) for(var/other_z in detecting_levels) var/list/gpses = GLOB.gps_transmitters[other_z] - var/l_id = SSmapping.level_id(other_z) + var/l_id = SSmapping.fluff_level_id(other_z) for(var/datum/component/gps_signal/sig as anything in gpses) if(sig == our_sig) continue diff --git a/code/game/objects/items/devices/holowarrant.dm b/code/game/objects/items/devices/holowarrant.dm index 9436979ff5f..d4caf405753 100644 --- a/code/game/objects/items/devices/holowarrant.dm +++ b/code/game/objects/items/devices/holowarrant.dm @@ -74,13 +74,13 @@ [active.fields["namewarrant"]]
Sol Central Government Colonial Marshal Bureau
in the jurisdiction of the
- [GLOB.using_map.boss_name] in [GLOB.using_map.station_name]
+ [(LEGACY_MAP_DATUM).boss_name] in [(LEGACY_MAP_DATUM).station_name]

ARREST WARRANT


This document serves as authorization and notice for the arrest of _[active.fields["namewarrant"]]____ for the crime(s) of:
[active.fields["charges"]]

- Vessel or habitat: _[GLOB.using_map.station_name]____
+ Vessel or habitat: _[(LEGACY_MAP_DATUM).station_name]____

_[active.fields["auth"]]____
Person authorizing arrest
@@ -91,7 +91,7 @@ var/output= {" Search Warrant: [active.fields["namewarrant"]]
in the jurisdiction of the
- [GLOB.using_map.boss_name] in [GLOB.using_map.station_name]
+ [(LEGACY_MAP_DATUM).boss_name] in [(LEGACY_MAP_DATUM).station_name]

SEARCH WARRANT


@@ -110,7 +110,7 @@
Warrant issued by: [active.fields ["auth"]]

- Vessel or habitat: _[GLOB.using_map.station_name]____
+ Vessel or habitat: _[(LEGACY_MAP_DATUM).station_name]____
"} show_browser(user, output, "window=Search warrant for [active.fields["namewarrant"]]") diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 5a84a977bea..7db70ff866b 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -546,7 +546,7 @@ GLOBAL_DATUM_INIT(virtual_announcer_ai, /mob/living/silicon/ai/announcer, new(nu //Nothing handled any sort of remote radio-ing and returned before now, just squawk on this zlevel. return Broadcast_Message(connection, M, voicemask, pick(M.speak_emote), src, message, displayname, jobname, real_name, M.voice_name, - filter_type, signal.data["compression"], GLOB.using_map.get_map_levels(pos_z), connection.frequency, verb, speaking) + filter_type, signal.data["compression"], (LEGACY_MAP_DATUM).get_map_levels(pos_z), connection.frequency, verb, speaking) /obj/item/radio/hear_talk(mob/M as mob, msg, var/verb = "says", var/datum/language/speaking = null) if (broadcasting) diff --git a/code/game/objects/items/weapons/grenades/spawnergrenade_vr.dm b/code/game/objects/items/weapons/grenades/spawnergrenade_vr.dm index cbfb5105a0c..53862420345 100644 --- a/code/game/objects/items/weapons/grenades/spawnergrenade_vr.dm +++ b/code/game/objects/items/weapons/grenades/spawnergrenade_vr.dm @@ -6,7 +6,7 @@ /obj/item/grenade/spawnergrenade/manhacks/station/locked/detonate() if(locked) var/turf/T = get_turf(src) - if(T.z in GLOB.using_map.map_levels) + if(T.z in (LEGACY_MAP_DATUM).map_levels) icon_state = initial(icon_state) active = 0 return 0 diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 5418de66bf4..ff3836f1305 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -417,7 +417,7 @@ the implant may become unstable and either pre-maturely inject the subject or si /obj/item/implant/loyalty/get_data() var/dat = {" Implant Specifications:
-Name: [GLOB.using_map.company_name] Employee Management Implant
+Name: [(LEGACY_MAP_DATUM).company_name] Employee Management Implant
Life: Ten years.
Important Notes: Personnel injected with this device tend to be much more loyal to the company.

@@ -434,13 +434,13 @@ the implant may become unstable and either pre-maturely inject the subject or si var/mob/living/carbon/human/H = M var/datum/antagonist/antag_data = get_antag_data(H.mind.special_role) if(antag_data && (antag_data.flags & ANTAG_IMPLANT_IMMUNE)) - H.visible_message("[H] seems to resist the implant!", "You feel the corporate tendrils of [GLOB.using_map.company_name] try to invade your mind!") + H.visible_message("[H] seems to resist the implant!", "You feel the corporate tendrils of [(LEGACY_MAP_DATUM).company_name] try to invade your mind!") . = FALSE /obj/item/implant/loyalty/post_implant(mob/M) var/mob/living/carbon/human/H = M clear_antag_roles(H.mind, 1) - to_chat(H, "You feel a surge of loyalty towards [GLOB.using_map.company_name].") + to_chat(H, "You feel a surge of loyalty towards [(LEGACY_MAP_DATUM).company_name].") ////////////////////////////// // Adrenaline Implant @@ -491,7 +491,7 @@ the implant may become unstable and either pre-maturely inject the subject or si /obj/item/implant/death_alarm/get_data() var/dat = {" Implant Specifications:
-Name: [GLOB.using_map.company_name] \"Profit Margin\" Class Employee Lifesign Sensor
+Name: [(LEGACY_MAP_DATUM).company_name] \"Profit Margin\" Class Employee Lifesign Sensor
Life: Activates upon death.
Important Notes: Alerts crew to crewmember death.

@@ -576,7 +576,7 @@ the implant may become unstable and either pre-maturely inject the subject or si /obj/item/implant/compressed/get_data() var/dat = {" Implant Specifications:
-Name: [GLOB.using_map.company_name] \"Profit Margin\" Class Employee Lifesign Sensor
+Name: [(LEGACY_MAP_DATUM).company_name] \"Profit Margin\" Class Employee Lifesign Sensor
Life: Activates upon death.
Important Notes: Alerts crew to crewmember death.

diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm index ded3b7623f7..f0741cdc51b 100644 --- a/code/game/objects/items/weapons/manuals.dm +++ b/code/game/objects/items/weapons/manuals.dm @@ -939,7 +939,7 @@

The Oath

- The Medical Oath sworn by recognised medical practitioners in the employ of [GLOB.using_map.company_name]
+ The Medical Oath sworn by recognised medical practitioners in the employ of [(LEGACY_MAP_DATUM).company_name]
  1. Now, as a new doctor, I solemnly promise that I will, to the best of my ability, serve humanity-caring for the sick, promoting good health, and alleviating pain and suffering.
  2. diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 8271dec01f7..b45d6bd6bba 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -138,7 +138,7 @@ Frequency: if(.) return var/turf/current_location = get_turf(user)//What turf is the user on? - if(!current_location || (current_location.z in GLOB.using_map.admin_levels) || current_location.block_tele)//If turf was not found or they're on z level 2 or >7 which does not currently exist. + if(!current_location || (current_location.z in (LEGACY_MAP_DATUM).admin_levels) || current_location.block_tele)//If turf was not found or they're on z level 2 or >7 which does not currently exist. to_chat(user, "\The [src] is malfunctioning.") return var/list/L = list( ) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index e5962d3bce6..c4a3a55a393 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -19,7 +19,7 @@ var/silent_ert = 0 to_chat(usr, "The round hasn't started yet!") return if(send_emergency_team) - to_chat(usr, "[GLOB.using_map.boss_name] has already dispatched an emergency response team!") + to_chat(usr, "[(LEGACY_MAP_DATUM).boss_name] has already dispatched an emergency response team!") return if(alert("Do you want to dispatch an Emergency Response Team?",,"Yes","No") != "Yes") return @@ -120,11 +120,11 @@ var/silent_ert = 0 // there's only a certain chance a team will be sent if(!prob(send_team_chance)) - command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "[GLOB.using_map.boss_name]") + command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "[(LEGACY_MAP_DATUM).boss_name]") can_call_ert = 0 // Only one call per round, ladies. return if(silent_ert == 0) - command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "[GLOB.using_map.boss_name]") + command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "[(LEGACY_MAP_DATUM).boss_name]") can_call_ert = 0 // Only one call per round, gentleman. send_emergency_team = 1 diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 14a002a7552..befee22cd89 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -42,13 +42,13 @@ GLOBAL_LIST_INIT(multiz_hole_baseturfs, typecacheof(list( /turf/proc/baseturf_core() // todo: this is shitcode, pull it out on maploader refactor. // this is very obviously a copypaste from ChangeTurf. - . = SSmapping.level_trait(z, ZTRAIT_BASETURF) || GLOB.using_map.base_turf_by_z["[z]"] || /turf/space + . = SSmapping.level_baseturf(z) || world.turf if(!ispath(.)) . = text2path(.) if (!ispath(.)) - warning("Z-level [z] has invalid baseturf '[SSmapping.level_trait(z, ZTRAIT_BASETURF)]'") - . = /turf/space - if(. == /turf/space) // no space/basic check, if you use space/basic in a map honestly get bent + warning("Z-level [z] has invalid baseturf '[SSmapping.level_baseturf(z)]'") + . = world.turf + if(. == world.turf) // no space/basic check, if you use space/basic in a map honestly get bent if(istype(GetBelow(src), /turf/simulated)) . = /turf/simulated/open /** @@ -76,11 +76,11 @@ GLOBAL_LIST_INIT(multiz_hole_baseturfs, typecacheof(list( if(null) return if(/turf/baseturf_bottom) - path = SSmapping.level_trait(z, ZTRAIT_BASETURF) || GLOB.using_map.base_turf_by_z["[z]"] || /turf/space + path = SSmapping.level_baseturf(z) || /turf/space if(!ispath(path)) path = text2path(path) if (!ispath(path)) - warning("Z-level [z] has invalid baseturf '[SSmapping.level_trait(z, ZTRAIT_BASETURF)]'") + warning("Z-level [z] has invalid baseturf '[SSmapping.level_baseturf(z)]'") path = /turf/space if(path == /turf/space) // no space/basic check, if you use space/basic in a map honestly get bent if(istype(GetBelow(src), /turf/simulated)) diff --git a/code/game/world.dm b/code/game/world.dm index 38b5675d35b..57a3f545a5c 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -376,7 +376,7 @@ GLOBAL_LIST(topic_status_cache) // ---Hub title--- var/servername = config_legacy?.server_name var/stationname = station_name() - var/defaultstation = GLOB.using_map ? GLOB.using_map.station_name : stationname + var/defaultstation = (LEGACY_MAP_DATUM) ? (LEGACY_MAP_DATUM).station_name : stationname if(servername || stationname != defaultstation) . += (servername ? "[servername]" : "") . += (stationname != defaultstation ? "[servername ? " - " : ""][stationname]\] " : "\] ") @@ -395,8 +395,8 @@ GLOBAL_LIST(topic_status_cache) // ---Hub footer--- . += "\[" - if(GLOB.using_map) - . += "[GLOB.using_map.station_short], " + if((LEGACY_MAP_DATUM)) + . += "[(LEGACY_MAP_DATUM).station_short], " . += "[get_security_level()] alert, " diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index f7faa93f914..081541de2e7 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -357,7 +357,7 @@ var/global/floorIsLava = 0 dat+={"
    Feed Security functions:

    [(wanted_already) ? ("Manage") : ("Publish")] 'Wanted' Issue
    Censor Feed Stories -
    Mark Feed Channel with [GLOB.using_map.company_name] D-Notice (disables and locks the channel. +
    Mark Feed Channel with [(LEGACY_MAP_DATUM).company_name] D-Notice (disables and locks the channel.

    The newscaster recognises you as:
    [src.admincaster_signature]
    "} if(1) @@ -423,7 +423,7 @@ var/global/floorIsLava = 0 dat+="[src.admincaster_feed_channel.channel_name]: \[created by: [src.admincaster_feed_channel.author]\]
    " if(src.admincaster_feed_channel.censored) dat+={" - ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [GLOB.using_map.company_name] D-Notice.
    + ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [(LEGACY_MAP_DATUM).company_name] D-Notice.
    No further feed story additions are allowed while the D-Notice is in effect.

    "} else @@ -444,7 +444,7 @@ var/global/floorIsLava = 0 "} if(10) dat+={" - [GLOB.using_map.company_name] Feed Censorship Tool
    + [(LEGACY_MAP_DATUM).company_name] Feed Censorship Tool
    NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
    Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.

    Select Feed channel to get Stories from:
    @@ -457,7 +457,7 @@ var/global/floorIsLava = 0 dat+="
    Cancel" if(11) dat+={" - [GLOB.using_map.company_name] D-Notice Handler
    + [(LEGACY_MAP_DATUM).company_name] D-Notice Handler
    A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
    @@ -490,7 +490,7 @@ var/global/floorIsLava = 0 "} if(src.admincaster_feed_channel.censored) dat+={" - ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [GLOB.using_map.company_name] D-Notice.
    + ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [(LEGACY_MAP_DATUM).company_name] D-Notice.
    No further feed story additions are allowed while the D-Notice is in effect.

    "} else diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0dc00c78998..8092ad39e6f 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -190,7 +190,8 @@ var/list/admin_verbs_server = list( /client/proc/panicbunker, /client/proc/ip_reputation, /client/proc/paranoia_logging, - /client/proc/reestablish_db_connection + /client/proc/reestablish_db_connection, + /client/proc/change_next_map, ) var/list/admin_verbs_debug = list( diff --git a/code/modules/admin/chat_commands.dm b/code/modules/admin/chat_commands.dm index 4c12a6c32d0..d64a78cb689 100644 --- a/code/modules/admin/chat_commands.dm +++ b/code/modules/admin/chat_commands.dm @@ -39,7 +39,7 @@ current_state = "active" if(GAME_STATE_FINISHED) current_state = "finishing" - return "[GLOB.clients.len] players on [GLOB.using_map.name], Mode: [master_mode]; round [current_state] -- Duration [roundduration2text()] -- [server ? server : "[world.internet_address]:[world.port]"]" + return "[GLOB.clients.len] players on [(LEGACY_MAP_DATUM).name], Mode: [master_mode]; round [current_state] -- Duration [roundduration2text()] -- [server ? server : "[world.internet_address]:[world.port]"]" /datum/tgs_chat_command/ahelp name = "ahelp" diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index b994271167a..57ac0ef0e9f 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -25,13 +25,16 @@ GLOBAL_PROTECT(href_token) log_world("Admin datum created without a ckey argument. Datum has been deleted") qdel(src) return - admincaster_signature = "[GLOB.using_map.company_name] Officer #[rand(0,9)][rand(0,9)][rand(0,9)]" rank = initial_rank rights = initial_rights admin_datums[ckey] = src if(rights & R_DEBUG) //grant profile access world.SetConfig("APP/admin", ckey, "role=admin") + spawn(-1) + UNTIL(SSmapping.loaded_station) + admincaster_signature = "[(LEGACY_MAP_DATUM).company_name] Officer #[rand(0,9)][rand(0,9)][rand(0,9)]" + /datum/admins/proc/associate(client/C) if(istype(C)) owner = C diff --git a/code/modules/admin/secrets/admin_secrets/prison_warp.dm b/code/modules/admin/secrets/admin_secrets/prison_warp.dm index ad718373854..f62540bfaff 100644 --- a/code/modules/admin/secrets/admin_secrets/prison_warp.dm +++ b/code/modules/admin/secrets/admin_secrets/prison_warp.dm @@ -8,7 +8,7 @@ for(var/mob/living/carbon/human/H in GLOB.mob_list) var/turf/T = get_turf(H) var/security = 0 - if((T && (T in GLOB.using_map.admin_levels)) || prisonwarped.Find(H)) + if((T && (T in (LEGACY_MAP_DATUM).admin_levels)) || prisonwarped.Find(H)) //don't warp them if they aren't ready or are already there continue H.afflict_unconscious(20 * 5) diff --git a/code/modules/admin/secrets/fun_secrets/ghost_mode.dm b/code/modules/admin/secrets/fun_secrets/ghost_mode.dm index ed778712f89..2f19b4719a0 100644 --- a/code/modules/admin/secrets/fun_secrets/ghost_mode.dm +++ b/code/modules/admin/secrets/fun_secrets/ghost_mode.dm @@ -30,7 +30,7 @@ step_rand(W) var/area/A = get_area(M) - if(A.requires_power && !A.always_unpowered && A.power_light && (A.z in GLOB.using_map.player_levels)) + if(A.requires_power && !A.always_unpowered && A.power_light && (A.z in (LEGACY_MAP_DATUM).player_levels)) affected_areas |= get_area(M) affected_mobs |= user diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 8f712484a4d..ec9e9c69f57 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -17,7 +17,7 @@ var/inactive_on_main_station = 0 for(var/datum/zas_zone/zone in air_master.zones) var/turf/simulated/turf = locate() in zone.contents - if(turf && (turf.z in GLOB.using_map.station_levels)) + if(turf && (turf.z in (LEGACY_MAP_DATUM).station_levels)) if(zone.needs_update) active_on_main_station++ else diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index 7d270957ae3..e29f6ed7815 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -1,3 +1,5 @@ +// todo: proper tgui / admin panel button? + /client/proc/map_template_load() set category = "Debug" set name = "Map template - Place At Loc" @@ -19,8 +21,7 @@ return var/list/preview = list() - template.preload_size(template.mappath, orientation) - for(var/S in template.get_affected_turfs(T,centered = TRUE, orientation=orientation)) + for(var/S in template.get_affecting_turfs(T,centered = TRUE, orientation=orientation)) preview += image('icons/misc/debug_group.dmi',S ,"red") usr.client.images += preview if(alert(usr,"Confirm location.", "Template Confirm","No","Yes") == "Yes") @@ -67,16 +68,21 @@ set name = "Map Template - Upload" var/map = input(usr, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file - if(!map) + + if(isnull(map)) return + + log_admin("[key_name(usr)] uploading map file [map] with size [length(map)]") + if(copytext("[map]",-4) != ".dmm") to_chat(usr, "Bad map file: [map]") return - var/datum/map_template/M = new(map, "[map]") - if(M.preload_size(map)) + var/datum/map_template/M = new(map, "Uploaded - [map]") + if(M.preload()) to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])") SSmapping.map_templates[M.name] = M + log_admin("[key_name(usr)] has uploaded map tempalte [map].") message_admins("[key_name_admin(usr)] has uploaded a map template ([map])") else to_chat(usr, "Map template '[map]' failed to load properly") diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 3107e37a777..d54fb2e98f7 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -63,7 +63,7 @@ /proc/message_centcom(text, mob/sender, iamessage) var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN) // GLOB.requests.message_centcom(sender.client, msg) - msg = SPAN_ADMINNOTICE("[uppertext(GLOB.using_map.boss_short)]M[iamessage ? " IA" : ""]:[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]: [msg]") + msg = SPAN_ADMINNOTICE("[uppertext((LEGACY_MAP_DATUM).boss_short)]M[iamessage ? " IA" : ""]:[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]: [msg]") // to_chat(GLOB.admins, msg, confidential = TRUE) for(var/client/C in GLOB.admins) if((R_ADMIN | R_MOD) & C.holder.rights) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index f51626b2d0b..174e70cc6fa 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -597,7 +597,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!input) return if(!customname) - customname = "[GLOB.using_map.company_name] Update" + customname = "[(LEGACY_MAP_DATUM).company_name] Update" //New message handling post_comm_message(customname, replacetext(input, "\n", "
    ")) @@ -606,7 +606,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if("Yes") command_announcement.Announce(input, customname, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1); if("No") - to_chat(world, "New [GLOB.using_map.company_name] Update available at all communication consoles.") + to_chat(world, "New [(LEGACY_MAP_DATUM).company_name] Update available at all communication consoles.") SEND_SOUND(world, sound('sound/AI/commandreport.ogg')) log_admin("[key_name(src)] has created a command report: [input]") diff --git a/code/modules/admin/verbs/smite.dm b/code/modules/admin/verbs/smite.dm index 3c0227b1140..fed5a650923 100644 --- a/code/modules/admin/verbs/smite.dm +++ b/code/modules/admin/verbs/smite.dm @@ -186,14 +186,15 @@ /proc/darkspace_abduction(mob/living/target, user) - var/darkspace_abduction_z + var/static/darkspace_abduction_z if(darkspace_abduction_z < 0) to_chat(user,"The abduction z-level is already being created. Please wait.") return if(!darkspace_abduction_z) darkspace_abduction_z = -1 to_chat(user,"This is the first use of the verb this shift, it will take a minute to configure the abduction z-level. It will be z[world.maxz+1].") - var/z = world.increment_max_z() + var/datum/map_level/level = SSmapping.allocate_level() + var/z = level.z_index var/area/areaInstance = new /area/darkspace_abduction(null) areaInstance.addSorted() for(var/x = 1 to world.maxx) diff --git a/code/modules/alarm/alarm_handler.dm b/code/modules/alarm/alarm_handler.dm index b3b775d2272..3a5974effbf 100644 --- a/code/modules/alarm/alarm_handler.dm +++ b/code/modules/alarm/alarm_handler.dm @@ -104,7 +104,7 @@ /datum/alarm_handler/proc/visible_alarms(var/z) if(!LAZYLEN(alarms)) return list() - var/list/map_levels = GLOB.using_map.get_map_levels(z) + var/list/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z) var/list/visible_alarms = new() for(var/datum/alarm/A in alarms) if(A.hidden || (z && !(A.origin?.z in map_levels))) diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 9fdebbfa44a..70aa1e5bd53 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -26,7 +26,7 @@ dat += "Locked on
    " dat += "Charge progress: [reload]/180:
    " dat += "Open Fire
    " - dat += "Deployment of weapon authorized by
    [GLOB.using_map.company_name] Naval Command

    Remember, friendly fire is grounds for termination of your contract and life.
    " + dat += "Deployment of weapon authorized by
    [(LEGACY_MAP_DATUM).company_name] Naval Command

    Remember, friendly fire is grounds for termination of your contract and life.
    " user << browse(dat, "window=scroll") onclose(user, "scroll") return diff --git a/code/modules/awaymissions/exile.dm b/code/modules/awaymissions/exile.dm index 486e74df6bf..937c0e4e7e9 100644 --- a/code/modules/awaymissions/exile.dm +++ b/code/modules/awaymissions/exile.dm @@ -16,7 +16,7 @@ /obj/item/implant/exile/get_data() var/dat = {" Implant Specifications:
    -Name: [GLOB.using_map.company_name] Employee Exile Implant
    +Name: [(LEGACY_MAP_DATUM).company_name] Employee Exile Implant
    Implant Details: The onboard gateway system has been modified to reject entry by individuals containing this implant
    "} return dat diff --git a/code/modules/busy_space/organizations.dm b/code/modules/busy_space/organizations.dm index 1666e721970..6e3e020e57b 100644 --- a/code/modules/busy_space/organizations.dm +++ b/code/modules/busy_space/organizations.dm @@ -311,9 +311,9 @@ /datum/lore/organization/tsc/nanotrasen/New() ..() - spawn(1) // BYOND shenanigans means GLOB.using_map is not initialized yet. Wait a tick. + spawn(1) // BYOND shenanigans means (LEGACY_MAP_DATUM) is not initialized yet. Wait a tick. // Get rid of the current map from the list, so ships flying in don't say they're coming to the current map. - var/string_to_test = "[GLOB.using_map.station_name] in [GLOB.using_map.starsys_name]" + var/string_to_test = "[(LEGACY_MAP_DATUM).station_name] in [(LEGACY_MAP_DATUM).starsys_name]" if(string_to_test in destination_names) destination_names.Remove(string_to_test) diff --git a/code/modules/catalogue/catalogue_data.dm b/code/modules/catalogue/catalogue_data.dm index cf49a1ff1c7..ad7644189a6 100644 --- a/code/modules/catalogue/catalogue_data.dm +++ b/code/modules/catalogue/catalogue_data.dm @@ -296,21 +296,23 @@ GLOBAL_DATUM_INIT(catalogue_data, /datum/category_collection/catalogue, new) /datum/category_item/catalogue/information/organization/New() ..() - if(datum_to_copy) - // I'd just access the loremaster object but it might not exist because its ugly. - var/datum/lore/organization/O = new datum_to_copy() - // I would also change the name based on the org datum but changing the name messes up indexing in some lists in the category/collection object attached to us. + spawn(-1) + UNTIL(SSlegacy_lore.initialized) + if(datum_to_copy) + // I'd just access the loremaster object but it might not exist because its ugly. + var/datum/lore/organization/O = new datum_to_copy() + // I would also change the name based on the org datum but changing the name messes up indexing in some lists in the category/collection object attached to us. - // Now lets combine the data in the datum for a slightly more presentable entry. - var/constructed_desc = "" + // Now lets combine the data in the datum for a slightly more presentable entry. + var/constructed_desc = "" - if(O.motto) - constructed_desc += "
    \"[O.motto]\"


    " + if(O.motto) + constructed_desc += "
    \"[O.motto]\"


    " - constructed_desc += O.desc + constructed_desc += O.desc - desc = constructed_desc - qdel(O) + desc = constructed_desc + qdel(O) /datum/category_item/catalogue/information/organization/nanotrasen name = "TSC - NanoTrasen Incorporated" diff --git a/code/modules/economy/Events.dm b/code/modules/economy/Events.dm index 0ba70dc66ec..d1181ba8267 100644 --- a/code/modules/economy/Events.dm +++ b/code/modules/economy/Events.dm @@ -73,7 +73,7 @@ body = "A small [pick("pirate","Nation of Mars","Revolutionary Solar People's Party","mercenary")] fleet has precise-jumped into proximity with [affected_dest.name], [pick("for a smash-and-grab operation","in a hit and run attack","in an overt display of hostilities")]. Much damage was done, and security has been tightened since the incident." if(ALIEN_RAIDERS) if(prob(20)) - body = "Ue-Katish pirates exiled from Ue'Orsi have raided [affected_dest.name] today, no doubt on orders from their enigmatic masters. Stealing wildlife, farm animals, medical research materials and kidnapping civilians. [GLOB.using_map.company_name] authorities are standing by to counter attempts at bio-terrorism." + body = "Ue-Katish pirates exiled from Ue'Orsi have raided [affected_dest.name] today, no doubt on orders from their enigmatic masters. Stealing wildlife, farm animals, medical research materials and kidnapping civilians. [(LEGACY_MAP_DATUM).company_name] authorities are standing by to counter attempts at bio-terrorism." else body = "The Vox have raided [affected_dest.name] today, stealing wildlife, farm animals, medical research materials and kidnapping civilians. Fleet assets have moved to reinforce the effected region." if(AI_LIBERATION) @@ -83,7 +83,7 @@ if(CULT_CELL_REVEALED) body = "A [pick("dastardly","blood-thirsty","villanous","crazed")] doomsday cult has [pick("been discovered","been revealed","revealed themselves","gone public")] on [affected_dest.name] earlier today. Public morale has been shaken due to [pick("certain","several","one or two")] [pick("high-profile","well known","popular")] individuals [pick("performing illegal acts","claiming allegiance to the cult","swearing loyalty to the cult leader","promising to aid to the cult")] before those involved could be brought to justice." if(SECURITY_BREACH) - body = "There was [pick("a security breach in","an unauthorised access in","an attempted theft in","an anarchist attack in","violent sabotage of")] a [pick("high-security","restricted access","classified")] [pick("section","zone","area")] this morning. Security was tightened on [affected_dest.name] after the incident, and the editor reassures all [GLOB.using_map.company_name] personnel that such lapses are rare." + body = "There was [pick("a security breach in","an unauthorised access in","an attempted theft in","an anarchist attack in","violent sabotage of")] a [pick("high-security","restricted access","classified")] [pick("section","zone","area")] this morning. Security was tightened on [affected_dest.name] after the incident, and the editor reassures all [(LEGACY_MAP_DATUM).company_name] personnel that such lapses are rare." if(ANIMAL_RIGHTS_RAID) body = "[pick("Militant animal rights activists","Members of the terrorist group Galactic Organization for Animal Rights")] have [pick("launched a campaign of terror","unleashed a swathe of destruction","raided farms and pastures","forced entry to an animal processing plant")] on [affected_dest.name] earlier today, freeing numerous [pick("farm animals","animals")]. Prices for tame and breeding animals have spiked as a result." if(FESTIVAL) diff --git a/code/modules/economy/Events_Mundane.dm b/code/modules/economy/Events_Mundane.dm index 932c11089c1..0f590cf3141 100644 --- a/code/modules/economy/Events_Mundane.dm +++ b/code/modules/economy/Events_Mundane.dm @@ -11,7 +11,7 @@ if(!event_type) return - var/author = "The "+GLOB.using_map.starsys_name+" Times" + var/author = "The "+(LEGACY_MAP_DATUM).starsys_name+" Times" var/channel = author //see if our location has custom event info for this event @@ -22,7 +22,7 @@ if(RESEARCH_BREAKTHROUGH) body = "A major breakthough in the field of [pick("phoron research","super-compressed materials","nano-augmentation","bluespace research","volatile power manipulation")] \ was announced [pick("yesterday","a few days ago","last week","earlier this month")] by a private firm on [affected_dest.name]. \ - [GLOB.using_map.company_name] declined to comment as to whether this could impinge on profits." + [(LEGACY_MAP_DATUM).company_name] declined to comment as to whether this could impinge on profits." if(ELECTION) body = "The pre-selection of an additional candidates was announced for the upcoming [pick("supervisors council","advisory board","governership","board of inquisitors")] \ @@ -32,7 +32,7 @@ "I will maintain my company's record profits","I believe in our future","We must return to our moral core","Just like... chill out dudes")]'." if(RESIGNATION) - body = "[GLOB.using_map.company_name] regretfully announces the resignation of [pick("Sector Admiral","Division Admiral","Ship Admiral","Vice Admiral")] [random_name(pick(MALE,FEMALE))]." + body = "[(LEGACY_MAP_DATUM).company_name] regretfully announces the resignation of [pick("Sector Admiral","Division Admiral","Ship Admiral","Vice Admiral")] [random_name(pick(MALE,FEMALE))]." if(prob(25)) var/locstring = pick("Segunda","Salusa","Cepheus","Andromeda","Gruis","Corona","Aquila","Asellus") + " " + pick("I","II","III","IV","V","VI","VII","VIII") body += " In a ceremony on [affected_dest.name] this afternoon, they will be awarded the \ @@ -116,11 +116,11 @@ else body += "is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to " body += "[pick("unkind comments by an ex","rumours started by jealous friends",\ - "the decision to be dropped by a major sponsor","a disasterous interview on [GLOB.using_map.starsys_name] Tonight")]." + "the decision to be dropped by a major sponsor","a disasterous interview on [(LEGACY_MAP_DATUM).starsys_name] Tonight")]." if(TOURISM) body += "Tourists are flocking to [affected_dest.name] after the surprise announcement of [pick("major shopping bargains by a wily retailer",\ "a huge new ARG by a popular entertainment company","a secret tour by popular artiste [random_name(pick(MALE,FEMALE))]")]. \ - The [GLOB.using_map.starsys_name] Times is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage." + The [(LEGACY_MAP_DATUM).starsys_name] Times is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage." news_network.SubmitArticle(body, author, channel, null, 1) */ @@ -152,17 +152,17 @@ "'Here kitty kitty' no longer preferred tajaran retrieval technique.",\ "Man travels 7000 light years to retrieve lost hankie, 'It was my favourite'.",\ "New bowling lane that shoots mini-meteors at bowlers very popular.",\ - "[pick(SPECIES_UNATHI,"Spacer")] gets tattoo of "+GLOB.using_map.starsys_name+" on chest '[pick("[GLOB.using_map.boss_short]","star","starship","asteroid")] tickles most'.",\ + "[pick(SPECIES_UNATHI,"Spacer")] gets tattoo of "+(LEGACY_MAP_DATUM).starsys_name+" on chest '[pick("[(LEGACY_MAP_DATUM).boss_short]","star","starship","asteroid")] tickles most'.",\ "Skrell marries computer; wedding attended by 100 modems.",\ "Chef reports successfully using harmonica as cheese grater.",\ - "[GLOB.using_map.company_name] invents handkerchief that says 'Bless you' after sneeze.",\ + "[(LEGACY_MAP_DATUM).company_name] invents handkerchief that says 'Bless you' after sneeze.",\ "Clone accused of posing for other clones�s school photo.",\ "Clone accused of stealing other clones�s employee of the month award.",\ "Woman robs station with hair dryer; crewmen love new style.",\ "This space for rent.",\ "[affected_dest.name] Baker Wins Pickled Crumpet Toss Three Years Running",\ "Skrell Scientist Discovers Abacus Can Be Used To Dry Towels",\ - "Survey: 'Cheese Louise' Voted Best Pizza Restaurant In [GLOB.using_map.starsys_name]",\ + "Survey: 'Cheese Louise' Voted Best Pizza Restaurant In [(LEGACY_MAP_DATUM).starsys_name]",\ "I Was Framed, jokes [affected_dest.name] artist",\ "Mysterious Loud Rumbling Noises In [affected_dest.name] Found To Be Mysterious Loud Rumblings",\ "Alien ambassador becomes lost on [affected_dest.name], refuses to ask for directions",\ diff --git a/code/modules/economy/economy_misc.dm b/code/modules/economy/economy_misc.dm index 2615300c82c..0709bc25dc4 100644 --- a/code/modules/economy/economy_misc.dm +++ b/code/modules/economy/economy_misc.dm @@ -78,7 +78,7 @@ GLOBAL_VAR_INIT(economy_init, FALSE) if(GLOB.economy_init) return 2 - //news_network.CreateFeedChannel("The [GLOB.using_map.starsys_name] Times", "[GLOB.using_map.starsys_name] Times ExoNode - [GLOB.using_map.station_short]", 1, 1) + //news_network.CreateFeedChannel("The [(LEGACY_MAP_DATUM).starsys_name] Times", "[(LEGACY_MAP_DATUM).starsys_name] Times ExoNode - [(LEGACY_MAP_DATUM).station_short]", 1, 1) news_network.CreateFeedChannel("The Gibson Gazette", "Editor Mike Hammers", 1, 1) news_network.CreateFeedChannel("Oculum Content Aggregator", "Oculus v6rev7", 1, 1) diff --git a/code/modules/events/apc_damage.dm b/code/modules/events/apc_damage.dm index 2c3b6333b25..14e9ee7cfe6 100644 --- a/code/modules/events/apc_damage.dm +++ b/code/modules/events/apc_damage.dm @@ -47,4 +47,4 @@ /datum/event/apc_damage/proc/is_valid_apc(var/obj/machinery/power/apc/apc) var/turf/T = get_turf(apc) - return !apc.is_critical && !apc.emagged && T && (T.z in GLOB.using_map.player_levels) + return !apc.is_critical && !apc.emagged && T && (T.z in (LEGACY_MAP_DATUM).player_levels) diff --git a/code/modules/events/camera_damage.dm b/code/modules/events/camera_damage.dm index 9ffb84ac075..fc90c18fe6d 100644 --- a/code/modules/events/camera_damage.dm +++ b/code/modules/events/camera_damage.dm @@ -35,4 +35,4 @@ /datum/event/camera_damage/proc/is_valid_camera(var/obj/machinery/camera/C) // Only return a functional camera, not installed in a silicon/hardsuit/circuit/etc, and that exists somewhere players have access var/turf/T = get_turf(C) - return T && C.can_use() && istype(C.loc, /turf) && (T.z in GLOB.using_map.player_levels) + return T && C.can_use() && istype(C.loc, /turf) && (T.z in (LEGACY_MAP_DATUM).player_levels) diff --git a/code/modules/events/canister_leak.dm b/code/modules/events/canister_leak.dm index f55277881d5..b14aa0591e0 100644 --- a/code/modules/events/canister_leak.dm +++ b/code/modules/events/canister_leak.dm @@ -7,7 +7,7 @@ // List of all non-destroyed canisters on station levels var/list/all_canisters = list() for(var/obj/machinery/portable_atmospherics/canister/C in GLOB.machines) - if(!C.destroyed && (C.z in GLOB.using_map.station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD) + if(!C.destroyed && (C.z in (LEGACY_MAP_DATUM).station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD) all_canisters += C for(var/i in 1 to 10) diff --git a/code/modules/events/cult.dm b/code/modules/events/cult.dm index 4bb7371e58f..3ce875932a8 100644 --- a/code/modules/events/cult.dm +++ b/code/modules/events/cult.dm @@ -75,7 +75,7 @@ for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in A.contents) - if(temp_vent.network && ((temp_vent.loc.z in GLOB.using_map.station_levels) || isTalon == 1)) + if(temp_vent.network && ((temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels) || isTalon == 1)) vents += temp_vent var/cult_spawn = list(/mob/living/simple_mob/humanoid/cultist/human, diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm index 532a015dcd0..e393bb80918 100644 --- a/code/modules/events/dust.dm +++ b/code/modules/events/dust.dm @@ -3,7 +3,7 @@ endWhen = 30 /datum/event/carp_migration/start() - affecting_z -= GLOB.using_map.sealed_levels // Space levels only please! + affecting_z -= (LEGACY_MAP_DATUM).sealed_levels // Space levels only please! ..() /datum/event/dust/announce() diff --git a/code/modules/events/escaped_slimes.dm b/code/modules/events/escaped_slimes.dm index a2c54da17af..3af6ebfff83 100644 --- a/code/modules/events/escaped_slimes.dm +++ b/code/modules/events/escaped_slimes.dm @@ -33,7 +33,7 @@ /datum/event/escaped_slimes/start() var/list/vents = list() for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) - if(temp_vent.network && temp_vent.loc.z in GLOB.using_map.station_levels && !is_area_occupied(temp_vent.loc.loc)) //borrowed from spiders event, but it works. Distribute the slimes only in rooms with vents + if(temp_vent.network && temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels && !is_area_occupied(temp_vent.loc.loc)) //borrowed from spiders event, but it works. Distribute the slimes only in rooms with vents vents += temp_vent while((spawncount > 0) && vents.len) diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index da627ec914f..0b139c33535 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -41,7 +41,7 @@ return total_weight /datum/event_meta/no_overmap/get_weight() // These events have overmap equivalents, and shouldn't fire randomly if overmap is used - return GLOB.using_map.use_overmap ? 0 : ..() + return (LEGACY_MAP_DATUM).use_overmap ? 0 : ..() // Event datums define and execute the actual events themselves. /datum/event //NOTE: Times are measured in master controller ticks! @@ -162,7 +162,7 @@ startedAt = world.time if(!affecting_z) - affecting_z = GLOB.using_map.station_levels.Copy() + affecting_z = (LEGACY_MAP_DATUM).station_levels.Copy() setup() ..() diff --git a/code/modules/events/gravity.dm b/code/modules/events/gravity.dm index ea8ec72639a..1da87059c60 100644 --- a/code/modules/events/gravity.dm +++ b/code/modules/events/gravity.dm @@ -5,7 +5,7 @@ /datum/event/gravity/setup() endWhen = rand(15, 60) // Setup which levels we will disrupt gravit on. - zLevels = GLOB.using_map.station_levels.Copy() + zLevels = (LEGACY_MAP_DATUM).station_levels.Copy() for(var/datum/planet/P in SSplanets.planets) zLevels -= P.expected_z_levels diff --git a/code/modules/events/grubinfestation_vr.dm b/code/modules/events/grubinfestation_vr.dm index 6e1719b04b7..979dbf4a115 100644 --- a/code/modules/events/grubinfestation_vr.dm +++ b/code/modules/events/grubinfestation_vr.dm @@ -14,7 +14,7 @@ for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) if(istype(get_area(temp_vent), /area/crew_quarters/sleep)) continue - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/events/hostile_migration_vr.dm b/code/modules/events/hostile_migration_vr.dm index 3aa10250c68..f6356b9be25 100644 --- a/code/modules/events/hostile_migration_vr.dm +++ b/code/modules/events/hostile_migration_vr.dm @@ -92,7 +92,7 @@ for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in A.contents) - if(!temp_vent.welded && temp_vent.network && ((temp_vent.loc.z in GLOB.using_map.station_levels) || isTalon == 1)) + if(!temp_vent.welded && temp_vent.network && ((temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels) || isTalon == 1)) vents += temp_vent var/rats = /mob/living/simple_mob/animal/passive/mouse/rat diff --git a/code/modules/events/ian_storm_vr.dm b/code/modules/events/ian_storm_vr.dm index 92b86771d52..b42b82f3647 100644 --- a/code/modules/events/ian_storm_vr.dm +++ b/code/modules/events/ian_storm_vr.dm @@ -14,7 +14,7 @@ var/turf/T = get_turf(C) if(!T) continue - if(!(T.z in GLOB.using_map.station_levels)) + if(!(T.z in (LEGACY_MAP_DATUM).station_levels)) continue place_ian(T) diff --git a/code/modules/events/infestation.dm b/code/modules/events/infestation.dm index 22f41094f29..5e57db038ba 100644 --- a/code/modules/events/infestation.dm +++ b/code/modules/events/infestation.dm @@ -107,7 +107,7 @@ for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in A.contents) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) vents += temp_vent if (vents.len <= 0) return diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index d52f993283d..dd27a95242c 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -53,7 +53,7 @@ MS.spamfilter.Cut() var/i for (i = 1, i <= MS.spamfilter_limit, i++) - MS.spamfilter += pick("kitty","HONK","rev","malf","liberty","freedom","drugs", "[GLOB.using_map.station_short]", \ + MS.spamfilter += pick("kitty","HONK","rev","malf","liberty","freedom","drugs", "[(LEGACY_MAP_DATUM).station_short]", \ "admin","ponies","heresy","meow","Pun Pun","monkey","Ian","moron","pizza","message","spam",\ "director", "Hello", "Hi!"," ","nuke","crate","dwarf","xeno") */ diff --git a/code/modules/events/meteor_strike_vr.dm b/code/modules/events/meteor_strike_vr.dm index 888ba073619..a65c3e3f754 100644 --- a/code/modules/events/meteor_strike_vr.dm +++ b/code/modules/events/meteor_strike_vr.dm @@ -4,8 +4,8 @@ /datum/event/meteor_strike/setup() startWhen = rand(8,15) - if(LAZYLEN(GLOB.using_map.meteor_strike_areas)) - strike_target = pick(get_area_turfs(pick(GLOB.using_map.meteor_strike_areas))) + if(LAZYLEN((LEGACY_MAP_DATUM).meteor_strike_areas)) + strike_target = pick(get_area_turfs(pick((LEGACY_MAP_DATUM).meteor_strike_areas))) if(!strike_target) kill() diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index ffffd337146..30e2a1127b5 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -21,7 +21,7 @@ endWhen = worst_case_end() /datum/event/meteor_wave/start() - affecting_z -= GLOB.using_map.sealed_levels // Space levels only please! + affecting_z -= (LEGACY_MAP_DATUM).sealed_levels // Space levels only please! ..() /datum/event/meteor_wave/announce() diff --git a/code/modules/events/money_lotto.dm b/code/modules/events/money_lotto.dm index f6eb88b3d15..42fb96c522f 100644 --- a/code/modules/events/money_lotto.dm +++ b/code/modules/events/money_lotto.dm @@ -12,7 +12,7 @@ D.money += winner_sum var/datum/transaction/T = new() - T.target_name = "The [GLOB.using_map.starsys_name] Times Grand Slam -Stellar- Lottery" + T.target_name = "The [(LEGACY_MAP_DATUM).starsys_name] Times Grand Slam -Stellar- Lottery" T.purpose = "Winner!" T.amount = winner_sum T.date = GLOB.current_date_string @@ -23,11 +23,11 @@ deposit_success = 1 /datum/event/money_lotto/announce() - var/author = "[GLOB.using_map.company_name] Editor" - var/channel = "The [GLOB.using_map.starsys_name] Times" + var/author = "[(LEGACY_MAP_DATUM).company_name] Editor" + var/channel = "The [(LEGACY_MAP_DATUM).starsys_name] Times" - var/body = "The [GLOB.using_map.starsys_name] Times wishes to congratulate [winner_name] for recieving the [GLOB.using_map.starsys_name] Stellar Slam Lottery, and receiving the out of this world sum of [winner_sum] credits!" + var/body = "The [(LEGACY_MAP_DATUM).starsys_name] Times wishes to congratulate [winner_name] for recieving the [(LEGACY_MAP_DATUM).starsys_name] Stellar Slam Lottery, and receiving the out of this world sum of [winner_sum] credits!" if(!deposit_success) - body += "
    Unfortunately, we were unable to verify the account details provided, so we were unable to transfer the money. Send a cheque containing the sum of 5000 Thalers to ND 'Stellar Slam' office on the The [GLOB.using_map.starsys_name] Times gateway containing updated details, and your winnings'll be re-sent within the month." + body += "
    Unfortunately, we were unable to verify the account details provided, so we were unable to transfer the money. Send a cheque containing the sum of 5000 Thalers to ND 'Stellar Slam' office on the The [(LEGACY_MAP_DATUM).starsys_name] Times gateway containing updated details, and your winnings'll be re-sent within the month." news_network.SubmitArticle(body, author, channel, null, 1) diff --git a/code/modules/events/money_spam.dm b/code/modules/events/money_spam.dm index 07e6842e2f0..5651b249b95 100644 --- a/code/modules/events/money_spam.dm +++ b/code/modules/events/money_spam.dm @@ -61,7 +61,7 @@ "You have (1) new message!",\ "You have (2) new profile views!") if(3) - sender = pick("Galactic Payments Association","Better Business Bureau","[GLOB.using_map.starsys_name] E-Payments","NAnoTrasen Finance Deparmtent","Luxury Replicas") + sender = pick("Galactic Payments Association","Better Business Bureau","[(LEGACY_MAP_DATUM).starsys_name] E-Payments","NAnoTrasen Finance Deparmtent","Luxury Replicas") message = pick("Luxury watches for Blowout sale prices!",\ "Watches, Jewelry & Accessories, Bags & Wallets !",\ "Deposit 100$ and get 300$ totally free!",\ @@ -71,7 +71,7 @@ if(4) sender = pick("Buy Dr. Maxman","Having dysfuctional troubles?") message = pick("DR MAXMAN: REAL Doctors, REAL Science, REAL Results!",\ - "Dr. Maxman was created by George Acuilar, M.D, a [GLOB.using_map.boss_short] Certified Urologist who has treated over 70,000 patients sector wide with 'male problems'.",\ + "Dr. Maxman was created by George Acuilar, M.D, a [(LEGACY_MAP_DATUM).boss_short] Certified Urologist who has treated over 70,000 patients sector wide with 'male problems'.",\ "After seven years of research, Dr Acuilar and his team came up with this simple breakthrough male enhancement formula.",\ "Men of all species report AMAZING increases in length, width and stamina.") if(5) @@ -84,11 +84,11 @@ "Due to my lack of agents I require an off-world financial account to immediately deposit the sum of 1 POINT FIVE MILLION credits.",\ "Greetings sir, I regretfully to inform you that as I lay dying here due to my lack ofheirs I have chosen you to recieve the full sum of my lifetime savings of 1.5 billion credits") if(6) - sender = pick("[GLOB.using_map.company_name] Morale Divison","Feeling Lonely?","Bored?","www.wetskrell.nt") - message = pick("The [GLOB.using_map.company_name] Morale Division wishes to provide you with quality entertainment sites.",\ + sender = pick("[(LEGACY_MAP_DATUM).company_name] Morale Divison","Feeling Lonely?","Bored?","www.wetskrell.nt") + message = pick("The [(LEGACY_MAP_DATUM).company_name] Morale Division wishes to provide you with quality entertainment sites.",\ "WetSkrell.nt is a xenophillic website endorsed by NT for the use of male crewmembers among it's many stations and outposts.",\ - "Wetskrell.nt only provides the higest quality of male entertaiment to [GLOB.using_map.company_name] Employees.",\ - "Simply enter your [GLOB.using_map.company_name] Bank account system number and pin. With three easy steps this service could be yours!") + "Wetskrell.nt only provides the higest quality of male entertaiment to [(LEGACY_MAP_DATUM).company_name] Employees.",\ + "Simply enter your [(LEGACY_MAP_DATUM).company_name] Bank account system number and pin. With three easy steps this service could be yours!") if(7) sender = pick("You have won free tickets!","Click here to claim your prize!","You are the 1000th vistor!","You are our lucky grand prize winner!") message = pick("You have won tickets to the newest ACTION JAXSON MOVIE!",\ diff --git a/code/modules/events/pirate.dm b/code/modules/events/pirate.dm index 522a048c8f3..e832c5b61e6 100644 --- a/code/modules/events/pirate.dm +++ b/code/modules/events/pirate.dm @@ -84,7 +84,7 @@ for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in A.contents) - if(temp_vent.network && ((temp_vent.loc.z in GLOB.using_map.station_levels) || isTalon == 1)) + if(temp_vent.network && ((temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels) || isTalon == 1)) vents += temp_vent if(piratestring == "human") diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm index 774170dee98..616a3deba68 100644 --- a/code/modules/events/radiation_storm.dm +++ b/code/modules/events/radiation_storm.dm @@ -31,7 +31,7 @@ /datum/event/radiation_storm/proc/radiate() var/radiation_level = rand(50, 200) - for(var/z in GLOB.using_map.station_levels) + for(var/z in (LEGACY_MAP_DATUM).station_levels) z_radiation(null, z, radiation_level, z_radiate_flags = Z_RADIATE_CHECK_AREA_SHIELD) for(var/mob/living/carbon/C in living_mob_list) diff --git a/code/modules/events/rogue_drones.dm b/code/modules/events/rogue_drones.dm index 31125acf854..9c9cae60426 100644 --- a/code/modules/events/rogue_drones.dm +++ b/code/modules/events/rogue_drones.dm @@ -44,7 +44,7 @@ var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread() sparks.set_up(3, 0, D.loc) sparks.start() - D.z = GLOB.using_map.admin_levels[1] + D.z = (LEGACY_MAP_DATUM).admin_levels[1] D.loot_list = list() qdel(D) diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index a295db16c88..5bd16e44263 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -17,7 +17,7 @@ /datum/event/spider_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm index 9590b706ab6..2e267e13561 100644 --- a/code/modules/events/spontaneous_appendicitis.dm +++ b/code/modules/events/spontaneous_appendicitis.dm @@ -3,7 +3,7 @@ var/area/A = get_area(H) if(!A) continue - if(!(A.z in GLOB.using_map.station_levels)) + if(!(A.z in (LEGACY_MAP_DATUM).station_levels)) continue if(A.area_flags & AREA_RAD_SHIELDED) continue diff --git a/code/modules/events/supply_demand.dm b/code/modules/events/supply_demand.dm index ba0e9bbe588..aaad6d47c47 100644 --- a/code/modules/events/supply_demand.dm +++ b/code/modules/events/supply_demand.dm @@ -17,7 +17,7 @@ endWhen = 1800 // Aproximately 1 hour in master controller ticks, refined by end_time /datum/event/supply_demand/setup() - my_department = "[GLOB.using_map.company_name] Supply Division" // Can't have company name in initial value (not const) + my_department = "[(LEGACY_MAP_DATUM).company_name] Supply Division" // Can't have company name in initial value (not const) end_time = world.time + 1 HOUR + (severity * 30 MINUTES) running_demand_events += src // Decide what items are requried! @@ -41,7 +41,7 @@ choose_bar_items(rand(5, 10)) // Really? Well add drinks. If a crew can't even get the bar open they suck. /datum/event/supply_demand/announce() - var/message = "[GLOB.using_map.company_short] is comparing accounts and the bean counters found our division " + var/message = "[(LEGACY_MAP_DATUM).company_short] is comparing accounts and the bean counters found our division " if(severity <= EVENT_LEVEL_MUNDANE) message += "is a few items short. " else if(severity == EVENT_LEVEL_MODERATE) diff --git a/code/modules/events/viral_infection.dm b/code/modules/events/viral_infection.dm index 47b08efcc33..b87d7b71c2d 100644 --- a/code/modules/events/viral_infection.dm +++ b/code/modules/events/viral_infection.dm @@ -37,7 +37,7 @@ datum/event/viral_infection/start() for(var/mob/living/carbon/human/G in GLOB.player_list) if(G.mind && G.stat != DEAD && G.is_client_active(5) && !player_is_antag(G.mind)) var/turf/T = get_turf(G) - if(T.z in GLOB.using_map.station_levels) + if(T.z in (LEGACY_MAP_DATUM).station_levels) candidates += G if(!candidates.len) return candidates = shuffle(candidates)//Incorporating Donkie's list shuffle diff --git a/code/modules/events/xenoinfestation.dm b/code/modules/events/xenoinfestation.dm index 650fc5b9089..a10e7900154 100644 --- a/code/modules/events/xenoinfestation.dm +++ b/code/modules/events/xenoinfestation.dm @@ -84,7 +84,7 @@ for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in A.contents) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) vents += temp_vent if(vents.len <= 0) log_admin("No valid vents to spawn infestation.") @@ -181,7 +181,7 @@ var/turf/T = get_turf(C) if(!T) continue - if(!(T.z in GLOB.using_map.station_levels)) + if(!(T.z in (LEGACY_MAP_DATUM).station_levels)) continue i++ log_admin("Xenoinfestation found [i] players on station") diff --git a/code/modules/gamemaster/actions/camera_damage.dm b/code/modules/gamemaster/actions/camera_damage.dm index 1aa431e8b0f..4c5e22b6137 100644 --- a/code/modules/gamemaster/actions/camera_damage.dm +++ b/code/modules/gamemaster/actions/camera_damage.dm @@ -46,7 +46,7 @@ /datum/gm_action/camera_damage/proc/is_valid_camera(var/obj/machinery/camera/C) // Only return a functional camera, not installed in a silicon/hardsuit/circuit/etc, and that exists somewhere players have access var/turf/T = get_turf(C) - return T && C.can_use() && istype(C.loc, /turf) && (T.z in GLOB.using_map.player_levels) + return T && C.can_use() && istype(C.loc, /turf) && (T.z in (LEGACY_MAP_DATUM).player_levels) /datum/gm_action/camera_damage/get_weight() return 40 + (metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20) + (metric.count_people_in_department(DEPARTMENT_SYNTHETIC) * 40) diff --git a/code/modules/gamemaster/actions/canister_leak.dm b/code/modules/gamemaster/actions/canister_leak.dm index 31e172ece8b..82368d34300 100644 --- a/code/modules/gamemaster/actions/canister_leak.dm +++ b/code/modules/gamemaster/actions/canister_leak.dm @@ -15,7 +15,7 @@ // List of all non-destroyed canisters on station levels var/list/all_canisters = list() for(var/obj/machinery/portable_atmospherics/canister/C in GLOB.machines) - if(!C.destroyed && (C.z in GLOB.using_map.station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD) + if(!C.destroyed && (C.z in (LEGACY_MAP_DATUM).station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD) all_canisters += C var/obj/machinery/portable_atmospherics/canister/C = pick(all_canisters) log_debug(SPAN_DEBUGWARNING("canister_leak event: Canister [ADMIN_JMP(C)]) destroyed.")) diff --git a/code/modules/gamemaster/actions/gravity.dm b/code/modules/gamemaster/actions/gravity.dm index fc267216346..9a3d3c16019 100644 --- a/code/modules/gamemaster/actions/gravity.dm +++ b/code/modules/gamemaster/actions/gravity.dm @@ -7,7 +7,7 @@ /datum/gm_action/gravity/set_up() length = rand(length, length * 5) // Setup which levels we will disrupt gravit on. - zLevels = GLOB.using_map.station_levels.Copy() + zLevels = (LEGACY_MAP_DATUM).station_levels.Copy() for(var/datum/planet/P in SSplanets.planets) zLevels -= P.expected_z_levels diff --git a/code/modules/gamemaster/actions/infestation.dm b/code/modules/gamemaster/actions/infestation.dm index 3be404f8263..186f4b96e41 100644 --- a/code/modules/gamemaster/actions/infestation.dm +++ b/code/modules/gamemaster/actions/infestation.dm @@ -91,7 +91,7 @@ for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in A.contents) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) vents += temp_vent var/spawn_types = list() diff --git a/code/modules/gamemaster/actions/ion_storm.dm b/code/modules/gamemaster/actions/ion_storm.dm index 8d351d05d66..f427929d511 100644 --- a/code/modules/gamemaster/actions/ion_storm.dm +++ b/code/modules/gamemaster/actions/ion_storm.dm @@ -27,7 +27,7 @@ MS.spamfilter.Cut() var/i for (i = 1, i <= MS.spamfilter_limit, i++) - MS.spamfilter += pick("kitty","HONK","rev","malf","liberty","freedom","drugs", "[GLOB.using_map.station_short]", \ + MS.spamfilter += pick("kitty","HONK","rev","malf","liberty","freedom","drugs", "[(LEGACY_MAP_DATUM).station_short]", \ "admin","ponies","heresy","meow","Pun Pun","monkey","Ian","moron","pizza","message","spam",\ "director", "Hello", "Hi!"," ","nuke","crate","dwarf","xeno") diff --git a/code/modules/gamemaster/actions/money_lotto.dm b/code/modules/gamemaster/actions/money_lotto.dm index 7ce265f9cb9..41de5d04d01 100644 --- a/code/modules/gamemaster/actions/money_lotto.dm +++ b/code/modules/gamemaster/actions/money_lotto.dm @@ -15,7 +15,7 @@ D.money += winner_sum var/datum/transaction/T = new() - T.target_name = "The [GLOB.using_map.starsys_name] Times Grand Slam -Stellar- Lottery" + T.target_name = "The [(LEGACY_MAP_DATUM).starsys_name] Times Grand Slam -Stellar- Lottery" T.purpose = "Winner!" T.amount = winner_sum T.date = GLOB.current_date_string @@ -26,12 +26,12 @@ deposit_success = 1 /datum/gm_action/money_lotto/announce() - var/author = "[GLOB.using_map.company_name] Editor" - var/channel = "The [GLOB.using_map.starsys_name] Times" + var/author = "[(LEGACY_MAP_DATUM).company_name] Editor" + var/channel = "The [(LEGACY_MAP_DATUM).starsys_name] Times" - var/body = "The [GLOB.using_map.starsys_name] Times wishes to congratulate [winner_name] for recieving the [GLOB.using_map.starsys_name] Stellar Slam Lottery, and receiving the out of this world sum of [winner_sum] credits!" + var/body = "The [(LEGACY_MAP_DATUM).starsys_name] Times wishes to congratulate [winner_name] for recieving the [(LEGACY_MAP_DATUM).starsys_name] Stellar Slam Lottery, and receiving the out of this world sum of [winner_sum] credits!" if(!deposit_success) - body += "
    Unfortunately, we were unable to verify the account details provided, so we were unable to transfer the money. Send a cheque containing the sum of 5000 Thalers to ND 'Stellar Slam' office on the The [GLOB.using_map.starsys_name] Times gateway containing updated details, and your winnings'll be re-sent within the month." + body += "
    Unfortunately, we were unable to verify the account details provided, so we were unable to transfer the money. Send a cheque containing the sum of 5000 Thalers to ND 'Stellar Slam' office on the The [(LEGACY_MAP_DATUM).starsys_name] Times gateway containing updated details, and your winnings'll be re-sent within the month." news_network.SubmitArticle(body, author, channel, null, 1) diff --git a/code/modules/gamemaster/actions/money_spam.dm b/code/modules/gamemaster/actions/money_spam.dm index a03e49a0dc3..71e7c5ea32f 100644 --- a/code/modules/gamemaster/actions/money_spam.dm +++ b/code/modules/gamemaster/actions/money_spam.dm @@ -61,7 +61,7 @@ "You have (1) new message!",\ "You have (2) new profile views!") if(3) - sender = pick("Galactic Payments Association","Better Business Bureau","[GLOB.using_map.starsys_name] E-Payments","NAnoTrasen Finance Deparmtent","Luxury Replicas") + sender = pick("Galactic Payments Association","Better Business Bureau","[(LEGACY_MAP_DATUM).starsys_name] E-Payments","NAnoTrasen Finance Deparmtent","Luxury Replicas") message = pick("Luxury watches for Blowout sale prices!",\ "Watches, Jewelry & Accessories, Bags & Wallets !",\ "Deposit 100$ and get 300$ totally free!",\ @@ -71,7 +71,7 @@ if(4) sender = pick("Buy Dr. Maxman","Having dysfuctional troubles?") message = pick("DR MAXMAN: REAL Doctors, REAL Science, REAL Results!",\ - "Dr. Maxman was created by George Acuilar, M.D, a [GLOB.using_map.boss_short] Certified Urologist who has treated over 70,000 patients sector wide with 'male problems'.",\ + "Dr. Maxman was created by George Acuilar, M.D, a [(LEGACY_MAP_DATUM).boss_short] Certified Urologist who has treated over 70,000 patients sector wide with 'male problems'.",\ "After seven years of research, Dr Acuilar and his team came up with this simple breakthrough male enhancement formula.",\ "Men of all species report AMAZING increases in length, width and stamina.") if(5) @@ -84,11 +84,11 @@ "Due to my lack of agents I require an off-world financial account to immediately deposit the sum of 1 POINT FIVE MILLION credits.",\ "Greetings sir, I regretfully to inform you that as I lay dying here due to my lack ofheirs I have chosen you to recieve the full sum of my lifetime savings of 1.5 billion credits") if(6) - sender = pick("[GLOB.using_map.company_name] Morale Divison","Feeling Lonely?","Bored?","www.wetskrell.nt") - message = pick("The [GLOB.using_map.company_name] Morale Division wishes to provide you with quality entertainment sites.",\ + sender = pick("[(LEGACY_MAP_DATUM).company_name] Morale Divison","Feeling Lonely?","Bored?","www.wetskrell.nt") + message = pick("The [(LEGACY_MAP_DATUM).company_name] Morale Division wishes to provide you with quality entertainment sites.",\ "WetSkrell.nt is a xenophillic website endorsed by NT for the use of male crewmembers among it's many stations and outposts.",\ - "Wetskrell.nt only provides the higest quality of male entertaiment to [GLOB.using_map.company_name] Employees.",\ - "Simply enter your [GLOB.using_map.company_name] Bank account system number and pin. With three easy steps this service could be yours!") + "Wetskrell.nt only provides the higest quality of male entertaiment to [(LEGACY_MAP_DATUM).company_name] Employees.",\ + "Simply enter your [(LEGACY_MAP_DATUM).company_name] Bank account system number and pin. With three easy steps this service could be yours!") if(7) sender = pick("You have won free tickets!","Click here to claim your prize!","You are the 1000th vistor!","You are our lucky grand prize winner!") message = pick("You have won tickets to the newest ACTION JAXSON MOVIE!",\ diff --git a/code/modules/gamemaster/actions/radiation_storm.dm b/code/modules/gamemaster/actions/radiation_storm.dm index 4c28e294e4b..ae9d111b3a1 100644 --- a/code/modules/gamemaster/actions/radiation_storm.dm +++ b/code/modules/gamemaster/actions/radiation_storm.dm @@ -40,7 +40,7 @@ /datum/gm_action/radiation_storm/proc/radiate() var/radiation_level = rand(50, 200) - for(var/z in GLOB.using_map.station_levels) + for(var/z in (LEGACY_MAP_DATUM).station_levels) z_radiation(null, z, radiation_level, z_radiate_flags = Z_RADIATE_CHECK_AREA_SHIELD) for(var/mob/living/carbon/C in living_mob_list) diff --git a/code/modules/gamemaster/actions/rogue_drones.dm b/code/modules/gamemaster/actions/rogue_drones.dm index 3d48e51231b..f215f97cf13 100644 --- a/code/modules/gamemaster/actions/rogue_drones.dm +++ b/code/modules/gamemaster/actions/rogue_drones.dm @@ -48,7 +48,7 @@ var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread() sparks.set_up(3, 0, D.loc) sparks.start() - D.z = GLOB.using_map.admin_levels[1] + D.z = (LEGACY_MAP_DATUM).admin_levels[1] D.loot_list = list() qdel(D) diff --git a/code/modules/gamemaster/actions/spider_infestation.dm b/code/modules/gamemaster/actions/spider_infestation.dm index 657195e3596..89e1e9c8bb3 100644 --- a/code/modules/gamemaster/actions/spider_infestation.dm +++ b/code/modules/gamemaster/actions/spider_infestation.dm @@ -36,7 +36,7 @@ ..() var/list/vents = list() for(var/obj/machinery/atmospherics/component/unary/vent_pump/temp_vent in GLOB.machines) - if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in (LEGACY_MAP_DATUM).station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/gamemaster/actions/stowaway.dm b/code/modules/gamemaster/actions/stowaway.dm index f9e8be5714c..53429a7ee33 100644 --- a/code/modules/gamemaster/actions/stowaway.dm +++ b/code/modules/gamemaster/actions/stowaway.dm @@ -76,5 +76,5 @@ /datum/gm_action/stowaway/announce() spawn(rand(15 MINUTES, 30 MINUTES)) - if(prob(20) && severity >= EVENT_LEVEL_MODERATE && GLOB.lore_atc && !GLOB.lore_atc.squelched) - GLOB.lore_atc.msg("Attention civilian vessels in [GLOB.using_map.starsys_name] shipping lanes, caution is advised as [pick("an unidentified vessel", "a known criminal's vessel", "a derelict vessel")] has been detected passing multiple local stations.") + if(prob(20) && severity >= EVENT_LEVEL_MODERATE && SSlegacy_atc && !SSlegacy_atc.squelched) + SSlegacy_atc.msg("Attention civilian vessels in [(LEGACY_MAP_DATUM).starsys_name] shipping lanes, caution is advised as [pick("an unidentified vessel", "a known criminal's vessel", "a derelict vessel")] has been detected passing multiple local stations.") diff --git a/code/modules/gamemaster/actions/surprise_carp_attack.dm b/code/modules/gamemaster/actions/surprise_carp_attack.dm index d64139e3249..3754e15d46e 100644 --- a/code/modules/gamemaster/actions/surprise_carp_attack.dm +++ b/code/modules/gamemaster/actions/surprise_carp_attack.dm @@ -14,7 +14,7 @@ var/list/potential_victims = list() victim = null for(var/mob/living/L in GLOB.player_list) - if(!(L.z in GLOB.using_map.station_levels)) + if(!(L.z in (LEGACY_MAP_DATUM).station_levels)) continue // Not on the right z-level. if(L.stat) continue // Don't want dead people. diff --git a/code/modules/gamemaster/actions/swarmboarder.dm b/code/modules/gamemaster/actions/swarmboarder.dm index 3e0b4081d6b..9cef8a653d7 100644 --- a/code/modules/gamemaster/actions/swarmboarder.dm +++ b/code/modules/gamemaster/actions/swarmboarder.dm @@ -71,5 +71,5 @@ /datum/gm_action/swarm_boarder/announce() spawn(rand(5 MINUTES, 15 MINUTES)) - if(prob(80) && severity >= EVENT_LEVEL_MODERATE && GLOB.lore_atc && !GLOB.lore_atc.squelched) - GLOB.lore_atc.msg("Attention civilian vessels in [GLOB.using_map.starsys_name] shipping lanes, caution is advised as [pick("an unidentified vessel", "a known criminal's vessel", "a derelict vessel")] has been detected passing multiple local stations.") + if(prob(80) && severity >= EVENT_LEVEL_MODERATE && SSlegacy_atc && !SSlegacy_atc.squelched) + SSlegacy_atc.msg("Attention civilian vessels in [(LEGACY_MAP_DATUM).starsys_name] shipping lanes, caution is advised as [pick("an unidentified vessel", "a known criminal's vessel", "a derelict vessel")] has been detected passing multiple local stations.") diff --git a/code/modules/gamemaster/actions/viral_infection.dm b/code/modules/gamemaster/actions/viral_infection.dm index 49cf74c8ac0..c915a9c5a5b 100644 --- a/code/modules/gamemaster/actions/viral_infection.dm +++ b/code/modules/gamemaster/actions/viral_infection.dm @@ -46,7 +46,7 @@ for(var/mob/living/carbon/human/G in GLOB.player_list) if(G.mind && G.stat != DEAD && G.is_client_active(5) && !player_is_antag(G.mind)) var/turf/T = get_turf(G) - if(T.z in GLOB.using_map.station_levels) + if(T.z in (LEGACY_MAP_DATUM).station_levels) candidates += G if(!candidates.len) return candidates = shuffle(candidates)//Incorporating Donkie's list shuffle diff --git a/code/modules/games/spaceball_cards.dm b/code/modules/games/spaceball_cards.dm index 43b623b6efd..9652040b8f9 100644 --- a/code/modules/games/spaceball_cards.dm +++ b/code/modules/games/spaceball_cards.dm @@ -17,7 +17,7 @@ else var/language_type = pick(/datum/language/human,/datum/language/diona_local,/datum/language/tajaran,/datum/language/unathi) var/datum/language/L = new language_type() - var/team = pick("Brickburn Galaxy Trekers","Mars Rovers", "Qerrbalak Saints", "Moghes Rockets", "Meralar Lightning", "[GLOB.using_map.starsys_name] Vixens", "Euphoric-Earth Alligators") + var/team = pick("Brickburn Galaxy Trekers","Mars Rovers", "Qerrbalak Saints", "Moghes Rockets", "Meralar Lightning", "[(LEGACY_MAP_DATUM).starsys_name] Vixens", "Euphoric-Earth Alligators") P.name = "[L.get_random_name(pick(MALE,FEMALE))], [year - rand(0,50)] [team]" P.card_icon = "spaceball_standard" P.back_icon = "card_back_spaceball" diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index fa59b6d0e26..5c989f49b04 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -164,7 +164,7 @@ safety_disabled = 1 update_projections() to_chat(user, "You vastly increase projector power and override the safety and security protocols.") - to_chat(user, "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call [GLOB.using_map.company_name] maintenance and do not use the simulator.") + to_chat(user, "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call [(LEGACY_MAP_DATUM).company_name] maintenance and do not use the simulator.") log_game("[key_name(usr)] emagged the Holodeck Control Computer") return 1 return diff --git a/code/modules/holomap/generate_holomap.dm b/code/modules/holomap/generate_holomap.dm index f4a8239e5ca..301cbbd1c99 100644 --- a/code/modules/holomap/generate_holomap.dm +++ b/code/modules/holomap/generate_holomap.dm @@ -37,12 +37,12 @@ holoMiniMaps[z] = generateHoloMinimap(z) // Generate the area overlays, small maps, etc for the station levels. - for (var/z in GLOB.using_map.station_levels) + for (var/z in (LEGACY_MAP_DATUM).station_levels) generateStationMinimap(z) - if(GLOB.using_map.holomap_smoosh) - for(var/smoosh_list in GLOB.using_map.holomap_smoosh) - smooshTetherHolomaps(smoosh_list) + var/list/smoosh_levels = SSmapping.levels_by_trait(ZTRAIT_LEGACY_HOLOMAP_SMOOSH) + if(length(smoosh_levels)) + smooshTetherHolomaps(smoosh_levels) holomaps_initialized = TRUE diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index f17c16e2099..7609f0f94b7 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -6,7 +6,7 @@ var/list/turf/simulated/floor/turfs = get_area_turfs(typesof(/area/hallway)) //list of all the empty floor turfs in the hallway areas for(var/i in turfs) var/turf/T = i - if(!(T.z in GLOB.using_map.station_levels)) + if(!(T.z in (LEGACY_MAP_DATUM).station_levels)) turfs -= T if(turfs.len) //Pick a turf to spawn at if we can diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 7c423f445d6..c8e6ce4657b 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -58,7 +58,7 @@ add_ambient_light(new_color, new_multiplier) return - ASSERT(old_multiplier) // omitting new_multiplier is allowed for removing light nondestructively + ASSERT(!isnull(old_multiplier)) // omitting new_multiplier is allowed for removing light nondestructively old_color ||= COLOR_WHITE new_color ||= COLOR_WHITE diff --git a/code/modules/lore_codex/lore_data_vr/orgs.dm b/code/modules/lore_codex/lore_data_vr/orgs.dm index 9a64a8a01fa..16dafe1875f 100644 --- a/code/modules/lore_codex/lore_data_vr/orgs.dm +++ b/code/modules/lore_codex/lore_data_vr/orgs.dm @@ -6,8 +6,8 @@ /datum/lore/codex/category/auto_org/New(var/new_holder, var/new_parent) ..(new_holder, new_parent) keywords += auto_keywords - for(var/path in GLOB.loremaster.organizations) - var/datum/lore/organization/O = GLOB.loremaster.organizations[path] + for(var/path in SSlegacy_lore.organizations) + var/datum/lore/organization/O = SSlegacy_lore.organizations[path] if(!(istype(O, desired_type))) continue var/datum/lore/codex/page/P = new(holder, src) diff --git a/code/modules/mapping/loader/loader.dm b/code/modules/mapping/loader/loader.dm new file mode 100644 index 00000000000..8894280713d --- /dev/null +++ b/code/modules/mapping/loader/loader.dm @@ -0,0 +1,666 @@ +/** + * loads a dmm map + * raw operation, does not annihilate tiles or anything, + * + * ### Positioning + * + * ll_x/y/z are inclusive. + * x/y_lower/upper are inclusive. + * + * ### Cropping + * + * When using x/y_lower/upper, this changes which area of the dmm we actually parse. if you do 5, 5 to 10, 10, + * and load it at llx/y 10, 10, you end up loading a 6x6 chunk from the game world coordinates 10, 10, + * to the game world coordinates 15, 15 + * + * This also immediately crops what's loaded, so, don't use this if you want to have more sections of the parsed map done later. + * + * @params + * * map - dmm file() or a raw file2text'd file + * * ll_x - lowerleft x + * * ll_y - lowerleft y + * * ll_z - lowerleft z. for multiz, this is bottomleft. + * * x_lower - crop dmm load to this x. + * * y_lower - crop dmm load to this y. + * * x_upper - crop dmm load to this x. + * * y_upper - crop dmm load to this y. + * * z_lower - crop dmm load to this z. + * * z_upper - crop dmm load to this z. + * * no_changeturf - do not call [turf/AfterChange] when loading turfs. + * * place_on_top - use PlaceOnTop instead of ChangeTurf + * * orientation - cardinal dir to do. default is south. + * * area_cache - override area cache and provide your own, usually used to ensure multiple loadings share the same /area's. + * + * @return /datum/dmm_parsed instance + */ +/proc/load_map(map, ll_x, ll_y, ll_z, x_lower, y_lower, x_upper, y_upper, z_lower, z_upper, no_changeturf, place_on_top, orientation, list/area_cache) + var/datum/dmm_parsed/parsed = new(map, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper) + . = parsed + parsed.load(ll_x, ll_y, ll_z, no_changeturf = no_changeturf, place_on_top = place_on_top, orientation = orientation, area_cache = area_cache) + +/** + * parses a dmm map + * + * see [/proc/load_map] for args. + * + * @return /datum/dmm_parsed instance + */ +/proc/parse_map(map, x_lower, y_lower, x_upper, y_upper, z_lower, z_upper) + return new /datum/dmm_parsed(map, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper) + +/** + * SS13 optimized map loader + * + * Notes: + * * This does NOT support map files where more than one Z is in each grid set, as defined in the file. + * * MultiZ map files ARE supported (however very much discouraged), as long as each gridset only contains one z. + * * This assumes that for the most part, map files are properly formed, either DMM or TGM standard formats. If you feed it bad data, expect to crash. + * + * Citadel Edits: + * * Expanding the world is no longer allowed due to various issues with the BYOND engine that occurs due to expansion. + */ +#define SPACE_KEY "space" + +/datum/dmm_gridset + var/xcrd + var/ycrd + var/zcrd + var/grid_lines + +/datum/dmm_gridset/proc/height(key_len) + return length(grid_lines) + +/datum/dmm_gridset/proc/width(key_len) + return grid_lines[1] / key_len + +/datum/dmm_parsed + /// Original path this was loaded from + var/original_path + /// key length of the .dmm + var/key_len = 0 + /// dmm_gridsets - holds each set of grids in the .dmm + var/list/grid_sets = list() + /// grid models - holds each model line as string associated to the key like AAA = (/blah, /area/blah, /turf/blah) + var/list/grid_models = list() + /// cached, unpacked models so re-loads of the same map are far cheaper. only created on first load. + var/list/model_cache + /// did we have no changeturf set when we made the model cache? + var/model_cache_is_no_changeturf + /// parse successful? + var/tmp/parsed = FALSE + /// parsed width - this is subject to cropping! + var/tmp/width + /// parsed height - this is subject to cropping! + var/tmp/height + /// parsed bounds - non-offset + var/tmp/list/bounds + /// last loaded bounds + var/tmp/list/last_loaded_bounds + /// template we belong to, if any - makes average case dels faster + var/tmp/datum/map_template/template_host + + #ifdef TESTING + var/turfsSkipped = 0 + #endif + + // the actual regexes used to parse maps + // you should probably not touch these + // raw strings used to represent regexes more accurately + // '' used to avoid confusing syntax highlighting + var/static/regex/dmmRegex = new(@'"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}', "g") + var/static/regex/trimQuotesRegex = new(@'^[\s\n]+"?|"?[\s\n]+$|^"|"$', "g") + var/static/regex/trimRegex = new(@'^[\s\n]+|[\s\n]+$', "g") + +/** + * creates and parses a map + * + * cropping here is cropping what you'd see in the map editor, aka can actually throw out data. + */ +/datum/dmm_parsed/New(map, x_lower = -INFINITY, x_upper = INFINITY, y_lower = -INFINITY, y_upper = INFINITY, z_lower = -INFINITY, z_upper = INFINITY) + _parse(map, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper) + +/datum/dmm_parsed/proc/_parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper) + var/static/parsing = FALSE + UNTIL(!parsing) + // do not multithread this or bad things happen + parsing = TRUE + _do_parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper) + parsing = FALSE + +/datum/dmm_parsed/proc/_do_parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper) + if(isfile(tfile)) + original_path = "[tfile]" + tfile = file2text(tfile) + else if(isnull(tfile)) + // create a new datum without loading a map + return + bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF) + ASSERT(x_upper >= x_lower) + ASSERT(y_upper >= y_lower) + ASSERT(z_upper >= z_lower) + var/stored_index = 1 + + //multiz lool + while(dmmRegex.Find(tfile, stored_index)) + stored_index = dmmRegex.next + + // "aa" = (/type{vars=blah}) + if(dmmRegex.group[1]) // Model + var/key = dmmRegex.group[1] + if(grid_models[key]) // Duplicate model keys are ignored in DMMs + continue + if(key_len != length(key)) + if(!key_len) + key_len = length(key) + else + CRASH("Inconsistent key length in DMM") + // if(!measureOnly) + grid_models[key] = dmmRegex.group[2] + + // (1,1,1) = {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} + else if(dmmRegex.group[3]) // Coords + if(!key_len) + CRASH("Coords before model definition in DMM") + + // NOTE: We are assuming each coordset only contains one z. + var/curr_z = text2num(dmmRegex.group[5]) + if(curr_z < z_lower || curr_z > z_upper) + continue + + var/curr_x = text2num(dmmRegex.group[3]) + var/curr_y = text2num(dmmRegex.group[4]) + + var/datum/dmm_gridset/gridSet = new + + gridSet.xcrd = curr_x + gridSet.ycrd = curr_y + gridSet.zcrd = curr_z + + var/list/grid_lines = splittext(dmmRegex.group[6], "\n") + gridSet.grid_lines = grid_lines + + var/leadingBlanks = 0 + while(leadingBlanks < grid_lines.len && grid_lines[++leadingBlanks] == "") + if(leadingBlanks > 1) + grid_lines.Cut(1, leadingBlanks) // Remove all leading blank lines. + + var/lines = length(grid_lines) + if(lines && grid_lines[lines] == "") + // remove one trailing blank line + grid_lines.len-- + lines-- + // y crop + var/right_length = y_upper - curr_y + 1 + if(lines > right_length) + lines = grid_lines.len = right_length + if(!lines) // blank + continue + + var/width = length(grid_lines[1]) / key_len + // x crop + var/right_width = x_upper - curr_x + 1 + if(width > right_width) + for(var/i in 1 to lines) + grid_lines[i] = copytext(grid_lines[i], 1, key_len * right_width) + + // during the actual load we're starting at the top and working our way down + gridSet.ycrd += lines - 1 + + // Safe to proceed, commit gridset to list and record coords. + grid_sets += gridSet + bounds[MAP_MINX] = min(bounds[MAP_MINX], curr_x) + bounds[MAP_MAXX] = max(bounds[MAP_MAXX], curr_x + width - 1) + bounds[MAP_MINY] = min(bounds[MAP_MINY], curr_y) + bounds[MAP_MAXY] = max(bounds[MAP_MAXY], curr_y + lines - 1) + bounds[MAP_MINZ] = min(bounds[MAP_MINZ], curr_z) + bounds[MAP_MAXZ] = max(bounds[MAP_MAXZ], curr_z) + CHECK_TICK + + // Indicate failure to parse any coordinates by nulling bounds + if(bounds[1] == 1.#INF) + bounds = null + else + width = bounds[MAP_MAXX] - bounds[MAP_MINX] + 1 + height = bounds[MAP_MAXY] - bounds[MAP_MINY] + 1 + +/datum/dmm_parsed/Destroy() + if(template_host?.parsed == src) + template_host.parsed = null + . = ..() + return QDEL_HINT_HARDDEL + +/** + * loads our map into the game world + * raw operation, does not annihilate tiles or anything, + * + * ### Positioning + * + * ll_x/y/z are inclusive. + * x/y_lower/upper are inclusive. + * + * ### Cropping + * + * When using x/y_lower/upper, this changes which area of the dmm we actually load. if you do 5, 5 to 10, 10, + * and load it at llx/y 10, 10, you end up loading a 6x6 chunk from the game world coordinates 10, 10, + * to the game world coordinates 15, 15 + * + * ### Overflows + * + * Overflows to world bounds will be logged and denied. + * + * @params + * * map - dmm file or path or rsc entry + * * ll_x - lowerleft x + * * ll_y - lowerleft y + * * ll_z - lowerleft z. for multiz, this is bottomleft. + * * x_lower - crop dmm load to this x. + * * y_lower - crop dmm load to this y. + * * x_upper - crop dmm load to this x. + * * y_upper - crop dmm load to this y. + * * z_lower - crop dmm load to this z. + * * z_upper - crop dmm load to this z. + * * no_changeturf - do not call [turf/AfterChange] when loading turfs. + * * place_on_top - use PlaceOnTop instead of ChangeTurf + * * area_cache - override area cache and provide your own, used to make sure multiple loadings share the same areas if two areas are the same type. + * + * @return bounds list of load, or null if failed. + */ +/datum/dmm_parsed/proc/load(x, y, z, x_lower = -INFINITY, x_upper = INFINITY, y_lower = -INFINITY, y_upper = INFINITY, z_lower = -INFINITY, z_upper = INFINITY, no_changeturf, place_on_top, orientation = SOUTH, list/area_cache) + + var/static/loading = FALSE + UNTIL(!loading) + loading = TRUE + Master.StartLoadingMap() + . = _load_impl(arglist(args)) + Master.StopLoadingMap() + loading = FALSE + +// todo: verify that when rotating, things load in the same way when cropped e.g. aligned to lower left +// as opposed to rotating to somewhere else +/datum/dmm_parsed/proc/_load_impl(x, y, z, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper, no_changeturf, place_on_top, orientation = SOUTH, list/area_cache = list()) + var/list/model_cache = build_cache(no_changeturf) + var/space_key = model_cache[SPACE_KEY] + + var/list/loaded_bounds = list(INFINITY, INFINITY, INFINITY, -INFINITY, -INFINITY, -INFINITY) + + var/datum/dmm_orientation/orientation_pattern = GLOB.dmm_orientations["[orientation]"] + + var/invert_y = orientation_pattern.invert_y + var/invert_x = orientation_pattern.invert_x + var/swap_xy = orientation_pattern.swap_xy + var/xi = orientation_pattern.xi + var/yi = orientation_pattern.yi + var/turn_angle = round(SIMPLIFY_DEGREES(orientation_pattern.turn_angle), 90) + var/delta_swap = x - y + + // less checks later + var/do_crop = x_lower > -INFINITY || x_upper < INFINITY || y_lower > -INFINITY || y_upper < INFINITY + // did we try to run out of bounds? + var/overflowed = FALSE + + for(var/datum/dmm_gridset/gridset as anything in grid_sets) + var/load_z = gridset.zcrd + z - 1 + if(load_z > world.maxz) + overflowed = TRUE + continue + + //these values are the same until a new gridset is reached. + var/edge_dist_x = gridset.xcrd - 1 //from left side, 0 is right on the x_offset + var/edge_dist_y = gridset.ycrd - length(gridset.grid_lines) //from bottom, 0 is right on the y_offset + var/actual_x_starting = invert_x? (x + width - edge_dist_x - 1) : (x + edge_dist_x) //this value is not changed, cache. + //this value is changed + var/actual_y = invert_y? (y + edge_dist_y) : (y + gridset.ycrd - 1) + + for(var/line in gridset.grid_lines) + var/actual_x = actual_x_starting + for(var/pos = 1 to (length(line) - key_len + 1) step key_len) + var/placement_x = swap_xy? (actual_y + delta_swap) : actual_x + var/placement_y = swap_xy? (actual_x - delta_swap) : actual_y + // todo: i have no clue what this does, i wrote this code years ago ~silicons + // this is probably skipping the tiles that we're cropping after calculating where it is, though for some reason + // pos isn't being taken into account, which is a ???? + if(do_crop && ((placement_x < x_lower) || (placement_x > x_upper) || (placement_y < y_lower) || (placement_y > y_upper))) + continue + // todo: i have no clue what this does, i wrote this code years ago ~silicons + // as you can see, this is not quite efficient + // try not to overrun the world. + // this is probably skipping the tiles while offsetting so the rest still load in even while + // skipping (???) + if(placement_x > world.maxx) + actual_x += xi + overflowed = TRUE + continue + if(placement_y > world.maxy) + actual_y += yi + overflowed = TRUE + continue + if(placement_x < 1) + actual_x += xi + overflowed = TRUE + continue + if(placement_y < 1) + actual_y += yi + overflowed = TRUE + continue + var/model_key = copytext(line, pos, pos + key_len) + if(!no_changeturf || (model_key != space_key)) + var/list/cache = model_cache[model_key] + if(!cache) + CRASH("Undefined model key in DMM: [model_key]") + build_coordinate(area_cache, cache, locate(placement_x, placement_y, load_z), no_changeturf, place_on_top, turn_angle, swap_xy, invert_y, invert_x) + + // only bother with bounds that actually exist + loaded_bounds[MAP_MINX] = min(loaded_bounds[MAP_MINX], placement_x) + loaded_bounds[MAP_MINY] = min(loaded_bounds[MAP_MINY], placement_y) + loaded_bounds[MAP_MINZ] = min(loaded_bounds[MAP_MINZ], load_z) + loaded_bounds[MAP_MAXX] = max(loaded_bounds[MAP_MAXX], placement_x) + loaded_bounds[MAP_MAXY] = max(loaded_bounds[MAP_MAXY], placement_y) + loaded_bounds[MAP_MAXZ] = max(loaded_bounds[MAP_MAXZ], load_z) + #ifdef TESTING + else + ++turfsSkipped + #endif + actual_x += xi + CHECK_TICK + actual_y += yi + CHECK_TICK + + // this weird block of code calls AfterChange after everything is loaded to build adjacent turfs/zones/etc without doing it midway. + if(!no_changeturf) + for(var/turf/T as anything in block( + locate( + loaded_bounds[MAP_MINX], + loaded_bounds[MAP_MINY], + loaded_bounds[MAP_MINZ] + ), + locate( + loaded_bounds[MAP_MAXX], + loaded_bounds[MAP_MAXY], + loaded_bounds[MAP_MAXZ] + ) + )) + T.AfterChange(CHANGETURF_IGNORE_AIR) + + if(overflowed) + log_debug("Maploaders was stopped from expanding world.maxx/world.maxy. This shouldn't happen.") + + return loaded_bounds + +/datum/dmm_parsed/proc/build_cache(no_changeturf, bad_paths=null) + if(model_cache && !bad_paths) + return model_cache + . = model_cache = list() + var/list/grid_models = src.grid_models + for(var/model_key in grid_models) + var/model = grid_models[model_key] + var/list/members = list() //will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored) + var/list/members_attributes = list() //will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list()) + + ///////////////////////////////////////////////////////// + //Constructing members and corresponding variables lists + //////////////////////////////////////////////////////// + + var/index = 1 + var/old_position = 1 + var/dpos + + while(dpos != 0) + //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored) + dpos = find_next_delimiter_position(model, old_position, ",", "{", "}") //find next delimiter (comma here) that's not within {...} + + var/full_def = trim_text(copytext(model, old_position, dpos)) //full definition, e.g : /obj/foo/bar{variables=derp} + var/variables_start = findtext(full_def, "{") + var/path_text = trim_text(copytext(full_def, 1, variables_start)) + var/atom_def = text2path(path_text) //path definition, e.g /obj/foo/bar + if(dpos) + old_position = dpos + length(model[dpos]) + + if(!ispath(atom_def, /atom)) // Skip the item if the path does not exist. Fix your crap, mappers! + if(bad_paths) + LAZYDISTINCTADD(bad_paths[path_text], model_key) + continue + members.Add(atom_def) + + //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) + var/list/fields = list() + + if(variables_start)//if there's any variable + full_def = copytext(full_def, variables_start + length(full_def[variables_start]), -length(copytext_char(full_def, -1))) //removing the last '}' + fields = readlist(full_def, ";") + if(fields.len) + if(!trim(fields[fields.len])) + --fields.len + for(var/I in fields) + var/value = fields[I] + if(istext(value)) + fields[I] = apply_text_macros(value) + + //then fill the members_attributes list with the corresponding variables + members_attributes.len++ + members_attributes[index++] = fields + + CHECK_TICK + + //check and see if we can just skip this turf + //So you don't have to understand this horrid statement, we can do this if + // 1. no_changeturf is set + // 2. the space_key isn't set yet + // 3. there are exactly 2 members + // 4. with no attributes + // 5. and the members are world.turf and world.area + // Basically, if we find an entry like this: "XXX" = (/turf/default, /area/default) + // We can skip calling this proc every time we see XXX + if(no_changeturf \ + && !(.[SPACE_KEY]) \ + && members.len == 2 \ + && members_attributes.len == 2 \ + && length(members_attributes[1]) == 0 \ + && length(members_attributes[2]) == 0 \ + && (world.area in members) \ + && (world.turf in members)) + + .[SPACE_KEY] = model_key + continue + + + .[model_key] = list(members, members_attributes) + +/datum/dmm_parsed/proc/build_coordinate(list/areaCache, list/model, turf/crds, no_changeturf, placeOnTop, turn_angle, swap_xy, invert_y, invert_x) + var/index + var/list/members = model[1] + var/list/members_attributes = model[2] + + //////////////// + //Instanciation + //////////////// + + //The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile + //first instance the /area and remove it from the members list + index = members.len + // todo: do we need this? this was so it annihilates while loading instead of annihilates before, which was useful in specific circumstances + /* + if(annihilate_tiles && crds) + crds.empty(null) + */ + if(members[index] != /area/template_noop) + var/atype = members[index] + var/area/instance = areaCache[atype] + if(isnull(instance)) + // check uniqueness + var/area/area_casted = atype + if(initial(area_casted.unique)) + // unique, give it one more chance + instance = GLOB.areas_by_type[atype] + // still null? + if(isnull(instance)) + // create it + // preloader / loading only done if we're making the instance. + // warranty void if a map has varedited areas; you should know better, linter already checks against it. + world.preloader_setup(members_attributes[index], atype, turn_angle, invert_x, invert_y, swap_xy) + instance = new atype(null) + if(GLOB.use_preloader) + world.preloader_load(instance) + areaCache[atype] = instance + instance.contents.Add(crds) + + //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect + + var/first_turf_index = 1 + while(!ispath(members[first_turf_index], /turf)) //find first /turf object in members + first_turf_index++ + + //turn off base new Initialization until the whole thing is loaded + SSatoms.map_loader_begin() + //instanciate the first /turf + var/turf/T + if(members[first_turf_index] != /turf/template_noop) + T = instance_atom(members[first_turf_index],members_attributes[first_turf_index],crds,no_changeturf,placeOnTop,turn_angle, swap_xy, invert_y, invert_x) + + if(T) + //if others /turf are presents, simulates the underlays piling effect + index = first_turf_index + 1 + while(index <= members.len - 1) // Last item is an /area + var/underlay = T.appearance + T = instance_atom(members[index],members_attributes[index],crds,no_changeturf,placeOnTop,turn_angle, swap_xy, invert_y, invert_x)//instance new turf + T.underlays += underlay + index++ + + //finally instance all remainings objects/mobs + for(index in 1 to first_turf_index-1) + instance_atom(members[index],members_attributes[index],crds,no_changeturf,placeOnTop,turn_angle, swap_xy, invert_y, invert_x) + //Restore initialization to the previous value + SSatoms.map_loader_stop() + +//////////////// +//Helpers procs +//////////////// + +//Instance an atom at (x,y,z) and gives it the variables in attributes +/datum/dmm_parsed/proc/instance_atom(path,list/attributes, turf/crds, no_changeturf, placeOnTop, turn_angle = 0, swap_xy, invert_y, invert_x) + world.preloader_setup(attributes, path, turn_angle, invert_x, invert_y, swap_xy) + + if(ispath(path, /turf)) + if(placeOnTop) + . = crds.PlaceOnTop(null, path, CHANGETURF_DEFER_CHANGE | (no_changeturf ? CHANGETURF_SKIP : NONE)) + else if(!no_changeturf) + . = crds.ChangeTurf(path, null, CHANGETURF_DEFER_CHANGE) + else + . = create_atom(path, crds)//first preloader pass + else + . = create_atom(path, crds)//first preloader pass + + if(GLOB.use_preloader)//second preloader pass, for those atoms that don't ..() in New() + world.preloader_load(.) + + //custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize + if(TICK_CHECK) + SSatoms.map_loader_stop() + stoplag() + SSatoms.map_loader_begin() + +/** + * create an atom at a location + * + * * don't use this for turfs + * * use instance_atom, don't use this + */ +/datum/dmm_parsed/proc/create_atom(path, atom/where) + set waitfor = FALSE + . = new path(where) + +/** + * i don't know what this does but the old documentation says: + * + * text trimming (both directions) helper proc + * optionally removes quotes before and after the text (for variable name) + */ +/datum/dmm_parsed/proc/trim_text(str, trim_quotes) + return trim_quotes? trimQuotesRegex.Replace(str, "") : trimRegex.Replace(str, "") + +//find the position of the next delimiter,skipping whatever is comprised between opening_escape and closing_escape +//returns 0 if reached the last delimiter +/datum/dmm_parsed/proc/find_next_delimiter_position(text as text,initial_position as num, delimiter=",",opening_escape="\"",closing_escape="\"") + var/position = initial_position + var/next_delimiter = findtext(text,delimiter,position,0) + var/next_opening = findtext(text,opening_escape,position,0) + + while((next_opening != 0) && (next_opening < next_delimiter)) + position = findtext(text,closing_escape,next_opening + 1,0)+1 + next_delimiter = findtext(text,delimiter,position,0) + next_opening = findtext(text,opening_escape,position,0) + + return next_delimiter + +//build a list from variables in text form (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) +//return the filled list +/datum/dmm_parsed/proc/readlist(text as text, delimiter=",") + . = list() + if (!text) + return + + var/position + var/old_position = 1 + + while(position != 0) + // find next delimiter that is not within "..." + position = find_next_delimiter_position(text,old_position,delimiter) + + // check if this is a simple variable (as in list(var1, var2)) or an associative one (as in list(var1="foo",var2=7)) + var/equal_position = findtext(text,"=",old_position, position) + + var/trim_left = trim_text(copytext(text,old_position,(equal_position ? equal_position : position))) + var/left_constant = delimiter == ";" ? trim_left : parse_constant(trim_left) + if(position) + old_position = position + length(text[position]) + + if(equal_position && !isnum(left_constant)) + // Associative var, so do the association. + // Note that numbers cannot be keys - the RHS is dropped if so. + var/trim_right = trim_text(copytext(text, equal_position + length(text[equal_position]), position)) + var/right_constant = parse_constant(trim_right) + .[left_constant] = right_constant + + else // simple var + . += list(left_constant) + +/** + * parses the value of an attribute + */ +/datum/dmm_parsed/proc/parse_constant(text) + // number + var/num = text2num(text) + if(isnum(num)) + return num + + // string + if(text[1] == "\"") + return copytext(text, length(text[1]) + 1, findtext(text, "\"", length(text[1]) + 1)) + + // list + if(copytext(text, 1, 6) == "list(")//6 == length("list(") + 1 + return readlist(copytext(text, 6, -1)) + + // typepath + var/path = text2path(text) + if(ispath(path)) + return path + + // file + if(text[1] == "'") + return file(copytext_char(text, 2, -1)) + + // null + if(text == "null") + return null + + // not parsed: + // - pops: /obj{name="foo"} + // - new(), newlist(), icon(), matrix(), sound() + + // fallback: string + return text + +/datum/dmm_parsed/vv_edit_var(var_name, var_value, mass_edit, raw_edit) + if(var_name == NAMEOF(src, dmmRegex) || var_name == NAMEOF(src, trimQuotesRegex) || var_name == NAMEOF(src, trimRegex)) + return FALSE + return ..() diff --git a/code/modules/mapping/loader/orientation.dm b/code/modules/mapping/loader/orientation.dm new file mode 100644 index 00000000000..3f128bcdb72 --- /dev/null +++ b/code/modules/mapping/loader/orientation.dm @@ -0,0 +1,46 @@ +GLOBAL_LIST_INIT(dmm_orientations, list( + TEXT_NORTH = new /datum/dmm_orientation/north, + TEXT_SOUTH = new /datum/dmm_orientation/south, + TEXT_EAST = new /datum/dmm_orientation/east, + TEXT_WEST = new /datum/dmm_orientation/west + )) + +/datum/dmm_orientation + var/invert_x + var/invert_y + var/swap_xy + var/xi + var/yi + var/turn_angle + +/datum/dmm_orientation/north + invert_y = TRUE + invert_x = TRUE + swap_xy = FALSE + xi = -1 + yi = 1 + turn_angle = 180 + +/datum/dmm_orientation/south + invert_y = FALSE + invert_x = FALSE + swap_xy = FALSE + xi = 1 + yi = -1 + turn_angle = 0 + +/datum/dmm_orientation/east + invert_y = TRUE + invert_x = FALSE + swap_xy = TRUE + xi = 1 + yi = 1 + turn_angle = 90 + +/datum/dmm_orientation/west + invert_y = FALSE + invert_x = TRUE + swap_xy = TRUE + xi = -1 + yi = -1 + turn_angle = 270 diff --git a/code/modules/mapping/preloader.dm b/code/modules/mapping/loader/preloader.dm similarity index 57% rename from code/modules/mapping/preloader.dm rename to code/modules/mapping/loader/preloader.dm index 0387e570c01..7a3682ca286 100644 --- a/code/modules/mapping/preloader.dm +++ b/code/modules/mapping/loader/preloader.dm @@ -7,13 +7,21 @@ GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new) parent_type = /datum var/list/attributes var/target_path + var/turn_angle + var/swap_x + var/swap_y + var/swap_xy -/world/proc/preloader_setup(list/the_attributes, path) - if(the_attributes.len) +/world/proc/preloader_setup(list/the_attributes, path, turn_angle, swap_x, swap_y, swap_xy) + if(length(the_attributes) || turn_angle) GLOB.use_preloader = TRUE var/datum/map_preloader/preloader_local = GLOB._preloader preloader_local.attributes = the_attributes preloader_local.target_path = path + preloader_local.turn_angle = turn_angle + preloader_local.swap_x = swap_x + preloader_local.swap_y = swap_y + preloader_local.swap_xy = swap_xy /world/proc/preloader_load(atom/what) GLOB.use_preloader = FALSE @@ -30,6 +38,22 @@ GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new) #endif what.vars[attribute] = value + // handle post processing, so things like directions on subtypes don't break. + if(preloader_local.turn_angle != 0) //safe way to check for if this is necessary + what.dir = turn(what.dir, preloader_local.turn_angle) + var/px = what.pixel_x + var/py = what.pixel_y + if(preloader_local.swap_y) //same order of operations as the load rotation, mirror and then x/y swapping. + py = -py + if(preloader_local.swap_x) + px = -px + if(preloader_local.swap_xy) + var/opx = px + px = py + py = opx + what.pixel_x = px + what.pixel_y = py + /area/template_noop name = "Area Passthrough" icon = 'icons/mapping/helpers/maploader_objects.dmi' @@ -41,8 +65,13 @@ GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new) icon_state = "turf_noop" /* No sane way to implement. -/atom/template_no_annihilate - name = "Block In-Load Tile Annihilation" +/atom/template_block + name = "Block Maploader Annihilation" + icon = 'icons/mapping/helpers/maploader_objects.dmi' + icon_state = "no_annihilate" + +/turf/template_block + name = "Block Maploader Annihilation" icon = 'icons/mapping/helpers/maploader_objects.dmi' icon_state = "no_annihilate" */ diff --git a/code/modules/mapping/verify.dm b/code/modules/mapping/loader/verify.dm similarity index 87% rename from code/modules/mapping/verify.dm rename to code/modules/mapping/loader/verify.dm index 1f071aaec72..0b3fd3cab3b 100644 --- a/code/modules/mapping/verify.dm +++ b/code/modules/mapping/loader/verify.dm @@ -1,5 +1,5 @@ -/// An error report generated by [parsed_map/check_for_errors]. -/datum/map_report +/// An error report generated by [dmm_parsed/check_for_errors]. +/datum/dmm_report var/original_path var/list/bad_paths = list() var/list/bad_keys = list() @@ -9,11 +9,11 @@ var/static/tag_number = 0 -/datum/map_report/New(datum/parsed_map/map) +/datum/dmm_report/New(datum/dmm_parsed/map) original_path = map.original_path || "Untitled" /// Show a rendered version of this report to a client. -/datum/map_report/proc/show_to(client/C) +/datum/dmm_report/proc/show_to(client/C) var/list/html = list() html += "

    Report for map file [original_path]

    " if(crashed) @@ -41,7 +41,7 @@ html += "

    " C << browse(html.Join(), "window=[tag];size=600x400") -/datum/map_report/Topic(href, href_list) +/datum/dmm_report/Topic(href, href_list) . = ..() if(. || !check_rights(R_ADMIN, FALSE) || !usr.client.holder.CheckAdminHref(href, href_list)) return @@ -52,9 +52,9 @@ /// Check a parsed but not yet loaded map for errors. /// -/// Returns a [/datum/map_report] if there are errors or `FALSE` otherwise. -/datum/parsed_map/proc/check_for_errors() - var/datum/map_report/report = new(src) +/// Returns a [/datum/dmm_report] if there are errors or `FALSE` otherwise. +/datum/dmm_parsed/proc/check_for_errors() + var/datum/dmm_report/report = new(src) . = report // build_cache will check bad paths for us diff --git a/code/modules/mapping/loader/wrappers.dm b/code/modules/mapping/loader/wrappers.dm new file mode 100644 index 00000000000..e313607e6ed --- /dev/null +++ b/code/modules/mapping/loader/wrappers.dm @@ -0,0 +1,46 @@ +// basically debug / adminbus / advanced wrappers. never use in code. + +// For your ever biggening badminnery kevinz000 +// ❤ - Cyberboss +// <3 cyberboss you are epic +/proc/__load_raw_level(path, orientation = SOUTH, center = TRUE) + var/datum/dmm_parsed/parsed = parse_map(isfile(path)? path : file(path)) + if(!parsed.bounds) + CRASH("seemingly invalid file") + var/datum/map_level/dynamic/level = new + + SSmapping.allocate_level(level) + ASSERT(level.z_index) + + var/ll_x = 1 + var/ll_y = 1 + var/ll_z = level.z_index + var/sideways = orientation & (EAST|WEST) + var/real_width = sideways? parsed.height : parsed.width + var/real_height = sideways? parsed.width : parsed.height + + if(center) + ll_x = round((world.maxx - real_width) / 2) + ll_x = round((world.maxy - real_height) / 2) + + parsed.load(ll_x, ll_y, ll_z, orientation = orientation) + +/proc/__load_raw_chunk(path, x, y, z, orientation = SOUTH, center = TRUE) + ASSERT(x && y && z) + + var/datum/dmm_parsed/parsed = parse_map(isfile(path)? path : file(path)) + if(!parsed.bounds) + CRASH("seemingly invalid file") + + var/ll_x = x + var/ll_y = y + var/ll_z = z + var/sideways = orientation & (EAST|WEST) + var/real_width = sideways? parsed.height : parsed.width + var/real_height = sideways? parsed.width : parsed.height + + if(center) + ll_x -= round(real_width / 2) + ll_y -= round(real_height / 2) + + parsed.load(ll_x, ll_y, ll_z, orientation = orientation) diff --git a/maps/~map_system/maps.dm b/code/modules/mapping/map.dm similarity index 52% rename from maps/~map_system/maps.dm rename to code/modules/mapping/map.dm index 3852022cde4..a44f58e7ed9 100644 --- a/maps/~map_system/maps.dm +++ b/code/modules/mapping/map.dm @@ -1,40 +1,156 @@ - -GLOBAL_DATUM_INIT(using_map, /datum/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 == GLOB.using_map.type) - M = GLOB.using_map - M.setup_map() - else - M = new type - if(!M.path) - log_debug(SPAN_DEBUGERROR("Map '[M]' does not have a defined path, not adding to map list!")) - else - all_maps[M.path] = M - return 1 - - +/** + * maps + * clusters of zlevels, basically. + * + * when maps are loaded, areas are cached together to preserve byond-like behavior. + */ /datum/map - var/name = "Unnamed Map" - var/full_name = "Unnamed Map" - var/path + abstract_type = /datum/map + /// id - must be unique + var/id + /// in-code name + var/name = "Unknown Map" + /// in-code category + var/category = "Misc" + /// /datum/map_level datums. starts off as paths, inits later. + // todo: for now, this must be in sequential order from bottom to top for multiz maps. this will be fixed when we rework our multiz stack system. + var/list/datum/map_level/levels + /// dependencies by id or path of other maps - these are critical maps to always load in + var/list/dependencies + /// lateload by id or path of other maps - these are non-critical maps to always load in + var/list/lateload + /// are we loaded in + var/tmp/loaded = FALSE + /// are we modified from our prototype? + var/tmp/modified = FALSE + /// declared width = must match all levels + var/width + /// declared height - must match all levels + var/height + /// crop if too big, instead of panic + var/crop = FALSE + /// center us if we're smaller than world size + var/center = TRUE + /// orientation - defaults to south + var/orientation = SOUTH + /// use map-wide area cache instead of individual level area caches; has no effect on submap loading, only level loading. + /// don't touch this unless you know what you're doing. + var/bundle_area_cache = TRUE - var/zlevel_datum_type // If populated, all subtypes of this type will be instantiated and used to populate the *_levels lists. - var/list/base_turf_by_z = list() // Custom base turf by Z-level. Defaults to world.turf for unlisted Z-levels + //! legacy : spawn these shuttle datums on load + var/list/legacy_assert_shuttle_datums + +/datum/map/New() + // immediately resolve dependencies / lateload + for(var/i in 1 to length(dependencies)) + if(ispath(dependencies[i])) + var/datum/map/resolving = dependencies[i] + dependencies[i] = initial(resolving.id) + for(var/i in 1 to length(lateload)) + if(ispath(lateload[i])) + var/datum/map/resolving = lateload[i] + lateload[i] = initial(resolving.id) + +/datum/map/Destroy() + if(loaded) + . = QDEL_HINT_LETMELIVE + CRASH("UH OH, SOMETHING TRIED TO DELETE AN INSTANTIATED MAP.") + return ..() + +/datum/map/serialize() + . = ..() + .["id"] = id + .["name"] = name + var/list/serialized_levels = (.["levels"] = list()) + for(var/datum/map_level/level as anything in levels) + if(!istype(level)) + serialized_levels += level // isn't init'd, probably path or id + continue + serialized_levels += json_encode(level.serialize()) + .["dependencies"] = dependencies + .["lateload"] = lateload + .["width"] = width + .["height"] = height + .["crop"] = crop + .["center"] = center + .["orientation"] = orientation + .["bundle_area_cache"] = bundle_area_cache + +/datum/map/deserialize(list/data) + if(loaded) + CRASH("attempted deserialize while loaded") + . = ..() + id = data["id"] + name = data["name"] + levels = list() + for(var/serialized_level in data["levels"]) + var/is_it_a_path = text2path(serialized_level) + // path + if(ispath(is_it_a_path, /datum/map_level)) + levels += is_it_a_path + continue + // json + if(serialized_level[1] == "{}") + var/datum/map_level/level = new + level.deserialize(json_decode(serialized_level)) + levels += level + continue + dependencies = data["dependencies"] + lateload = data["lateload"] + width = data["width"] + height = data["height"] + if(!isnull(data["crop"])) + crop = data["crop"] + if(!isnull(data["center"])) + center = data["center"] + if(!isnull(data["orientation"])) + orientation = data["orientation"] + if(!isnull(data["bundle_area_cache"])) + bundle_area_cache = data["bundle_area_cache"] + +/** + * loads any lazyloaded stuff we need; called before we load in + */ +/datum/map/proc/prime() + for(var/i in 1 to length(levels)) + if(ispath(levels[i])) + var/datum/map_level/level_path = levels[i] + levels[i] = new level_path + +/** + * anything to do immediately on load + * + * called after level on_loaded_immediate's + */ +/datum/map/proc/on_loaded_immediate() + return + +/** + * anything to do after loading with any dependencies + * + * called after level on_loaded_finalize's + */ +/datum/map/proc/on_loaded_finalize() + return + +/** + * primary station map + * + * this is what's loaded at init. this determines what other maps initially load. + */ +/datum/map/station + abstract_type = /datum/map/station + category = "Stations" + + var/full_name = "Unnamed Map" // Automatically populated lists made static for faster lookups - var/list/zlevels = list() 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/xenoarch_exempt_levels = list() //Z-levels exempt from xenoarch finds and digsites spawning. - var/list/empty_levels = null // Empty Z-levels that may be used for various things (currently used by bluespace jump) // End Static Lists // Z-levels available to various consoles, such as the crew monitor. Defaults to station_levels if unset. @@ -43,15 +159,6 @@ var/list/all_maps = list() // E-mail TLDs to use for NTnet modular computer e-mail addresses var/list/usable_email_tlds = list("freemail.nt") - // 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() - - //List of additional z-levels to load above the existing .dmm file z-levels using the maploader. Must be map template >>> NAMES <<<. - var/list/lateload_z_levels = list() - - //Similar to above, but only pick ONE to load, useful for random away missions and whatnot - var/list/lateload_single_pick = 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 @@ -59,25 +166,11 @@ var/list/all_maps = list() // 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/list/holomap_smoosh // List of lists of zlevels to smoosh into single icons var/list/holomap_offset_x = list() var/list/holomap_offset_y = list() var/list/holomap_legend_x = list() var/list/holomap_legend_y = list() var/list/meteor_strike_areas // Areas meteor strikes may choose to hit. - var/ai_shell_restricted = FALSE // Are there z-levels restricted? - var/ai_shell_allowed_levels = list() // Which z-levels ARE we allowed to visit? - - // Belter stuff - var/list/belter_docked_z = list() - var/list/belter_transit_z = list() - var/list/belter_belt_z = list() - - var/list/mining_station_z = list() - var/list/mining_outpost_z = list() - - //Lavaland Stuff - var/list/lavaland_levels = list() var/station_name = "BAD Station" var/station_short = "Baddy" @@ -110,6 +203,8 @@ var/list/all_maps = list() var/datum/spawnpoint/spawnpoint_died = /datum/spawnpoint/arrivals // Used if you end the round dead. var/datum/spawnpoint/spawnpoint_left = /datum/spawnpoint/arrivals // Used of you end the round at centcom. var/datum/spawnpoint/spawnpoint_stayed = /datum/spawnpoint/cryo // Used if you end the round on the station. + /// legacy persistence id + var/legacy_persistence_id var/use_overmap = 0 // If overmap should be used (including overmap space travel override) var/overmap_size = 20 // Dimensions of overmap zlevel if overmap is used. @@ -135,20 +230,17 @@ var/list/all_maps = list() var/list/unit_test_exempt_from_apc = list() var/list/unit_test_z_levels // To test more than Z1, set your z-levels to test here. - var/list/planet_datums_to_make = list() // Types of `/datum/planet`s that will be instantiated by SSPlanets. + var/list/empty_levels -/datum/map/New() +/datum/map/station/New() ..() - if(zlevel_datum_type) - for(var/type in subtypesof(zlevel_datum_type)) - new type(src) if(!map_levels) map_levels = station_levels.Copy() if(!allowed_jobs || !allowed_jobs.len) allowed_jobs = subtypesof(/datum/role/job) // Gets the current time on a current zlevel, and returns a time datum -/datum/map/proc/get_zlevel_time(var/z) +/datum/map/station/proc/get_zlevel_time(var/z) if(!z) z = 1 var/datum/planet/P = z <= SSplanets.z_to_planet.len ? SSplanets.z_to_planet[z] : null @@ -162,7 +254,7 @@ var/list/all_maps = list() return T // Returns a boolean for if it's night or not on a particular zlevel -/datum/map/proc/get_night(var/z) +/datum/map/station/proc/get_night(var/z) if(!z) z = 1 var/datum/time/now = get_zlevel_time(z) @@ -177,41 +269,34 @@ var/list/all_maps = list() return FALSE // Boolean for if we should use SSnightshift night hours -/datum/map/proc/get_nightshift() +/datum/map/station/proc/get_nightshift() return get_night(1) //Defaults to z1, customize however you want on your own maps -/datum/map/proc/setup_map() +/datum/map/station/proc/setup_map() return -/datum/map/proc/perform_map_generation() - return - -/datum/map/proc/get_network_access(var/network) +/datum/map/station/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 = GLOB.using_map.accessible_z_levels.Copy() - candidates.Remove(num2text(current_z_level)) +/datum/map/station/proc/get_transit_zlevel(current_z_level) + . = SSmapping.crosslinked_levels() - current_z_level + return SAFEPICK(.) - if(!candidates.len) - return current_z_level - return text2num(pickweight(candidates)) - -/datum/map/proc/get_empty_zlevel() +/datum/map/station/proc/get_empty_zlevel() if(empty_levels == null) - world.increment_max_z() - empty_levels = list(world.maxz) + var/datum/map_level/level = SSmapping.allocate_level() + empty_levels = list(level.z_index) if(islist(player_levels)) - player_levels |= world.maxz + player_levels |= level.z_index else - player_levels = list(world.maxz) + player_levels = list(level.z_index) return pick(empty_levels) // Get the list of zlevels that a computer on srcz can see maps of (for power/crew monitor, cameras, etc) // The long_range parameter expands the coverage. Default is to return map_levels for long range otherwise just srcz. // zLevels outside station_levels will return an empty list. -/datum/map/proc/get_map_levels(var/srcz, var/long_range = TRUE, var/om_range = 0) +/datum/map/station/proc/get_map_levels(var/srcz, var/long_range = TRUE, var/om_range = 0) // Overmap behavior if(use_overmap) var/obj/effect/overmap/visitable/O = get_overmap_sector(srcz) @@ -238,87 +323,34 @@ var/list/all_maps = list() else return list(srcz) -/datum/map/proc/get_zlevel_name(var/index) - var/datum/map_z_level/Z = zlevels["[index]"] - return Z?.name - // Access check is of the type requires one. These have been carefully selected to avoid allowing the janitor to see channels he shouldn't // This list needs to be purged but people insist on adding more cruft to the radio. -/datum/map/proc/default_internal_channels() +/datum/map/station/proc/default_internal_channels() return list( - num2text(PUB_FREQ) = list(), - num2text(AI_FREQ) = list(ACCESS_SPECIAL_SILICONS), - num2text(ENT_FREQ) = list(), - num2text(ERT_FREQ) = list(ACCESS_CENTCOM_ERT), - num2text(COMM_FREQ) = list(ACCESS_COMMAND_BRIDGE), - num2text(ENG_FREQ) = list(ACCESS_ENGINEERING_ENGINE, ACCESS_ENGINEERING_ATMOS), - num2text(MED_FREQ) = list(ACCESS_MEDICAL_EQUIPMENT), - num2text(MED_I_FREQ) = list(ACCESS_MEDICAL_EQUIPMENT), - num2text(SEC_FREQ) = list(ACCESS_SECURITY_EQUIPMENT), - num2text(SEC_I_FREQ) = list(ACCESS_SECURITY_EQUIPMENT), - num2text(SCI_FREQ) = list(ACCESS_SCIENCE_FABRICATION,ACCESS_SCIENCE_ROBOTICS,ACCESS_SCIENCE_XENOBIO), - num2text(SUP_FREQ) = list(ACCESS_SUPPLY_BAY), - num2text(SRV_FREQ) = list(ACCESS_GENERAL_JANITOR, ACCESS_GENERAL_BOTANY), + num2text(PUB_FREQ) = list(), + num2text(AI_FREQ) = list(ACCESS_SPECIAL_SILICONS), + num2text(ENT_FREQ) = list(), + num2text(ERT_FREQ) = list(ACCESS_CENTCOM_ERT), + num2text(COMM_FREQ)= list(ACCESS_COMMAND_BRIDGE), + num2text(ENG_FREQ) = list(ACCESS_ENGINEERING_ENGINE, ACCESS_ENGINEERING_ATMOS), + num2text(MED_FREQ) = list(ACCESS_MEDICAL_EQUIPMENT), + num2text(MED_I_FREQ)=list(ACCESS_MEDICAL_EQUIPMENT), + num2text(SEC_FREQ) = list(ACCESS_SECURITY_EQUIPMENT), + num2text(SEC_I_FREQ)=list(ACCESS_SECURITY_EQUIPMENT), + num2text(SCI_FREQ) = list(ACCESS_SCIENCE_FABRICATION,ACCESS_SCIENCE_ROBOTICS,ACCESS_SCIENCE_XENOBIO), + num2text(SUP_FREQ) = list(ACCESS_SUPPLY_BAY), + num2text(SRV_FREQ) = list(ACCESS_GENERAL_JANITOR, ACCESS_GENERAL_BOTANY), + num2text(EXP_FREQ) = list(ACCESS_GENERAL_EXPLORER) ) -// Another way to setup the map datum that can be convenient. Just declare all your zlevels as subtypes of a common -// subtype of /datum/map_z_level and set zlevel_datum_type on /datum/map to have the lists auto-initialized. +/** + * standard sector / planet maps + */ +/datum/map/sector + category = "Sectors" + abstract_type = /datum/map/sector -// Structure to hold zlevel info together in one nice convenient package. -/datum/map_z_level - var/z = 0 // Actual z-index of the zlevel. This had better be right! - var/name // Friendly name of the zlevel - var/flags = 0 // Bitflag of which *_levels lists this z should be put into. - var/turf/base_turf = /turf/space // Type path of the base turf for this z - - var/transit_chance = 0 // Percentile chance this z will be chosen for map-edge space transit. - -// Holomaps - var/holomap_offset_x = -1 // Number of pixels to offset the map right (for centering) for this z - var/holomap_offset_y = -1 // Number of pixels to offset the map up (for centering) for this z - var/holomap_legend_x = 96 // x position of the holomap legend for this z - var/holomap_legend_y = 96 // y position of the holomap legend for this z - -// Default constructor applies itself to the parent map datum -/datum/map_z_level/New(var/datum/map/map, _z) - if(_z) - src.z = _z - if(!z) - return - map.zlevels["[z]"] = src - if(flags & MAP_LEVEL_STATION) map.station_levels |= z - if(flags & MAP_LEVEL_ADMIN) map.admin_levels |= z - if(flags & MAP_LEVEL_CONTACT) map.contact_levels |= z - if(flags & MAP_LEVEL_PLAYER) map.player_levels |= z - if(flags & MAP_LEVEL_SEALED) map.sealed_levels |= z - if(flags & MAP_LEVEL_XENOARCH_EXEMPT) map.xenoarch_exempt_levels |= z - if(flags & MAP_LEVEL_EMPTY) - if(!map.empty_levels) map.empty_levels = list() - map.empty_levels |= z - if(flags & MAP_LEVEL_CONSOLES) - if (!map.map_levels) - map.map_levels = list() - map.map_levels |= z - if(base_turf) - map.base_turf_by_z["[z]"] = base_turf - if(transit_chance) - map.accessible_z_levels["[z]"] = transit_chance - // Holomaps - // Auto-center the map if needed (Guess based on maxx/maxy) - if (holomap_offset_x < 0) - holomap_offset_x = ((HOLOMAP_ICON_SIZE - world.maxx) / 2) - if (holomap_offset_x < 0) - holomap_offset_y = ((HOLOMAP_ICON_SIZE - world.maxy) / 2) - // Assign them to the map lists - LIST_NUMERIC_SET(map.holomap_offset_x, z, holomap_offset_x) - LIST_NUMERIC_SET(map.holomap_offset_y, z, holomap_offset_y) - LIST_NUMERIC_SET(map.holomap_legend_x, z, holomap_legend_x) - LIST_NUMERIC_SET(map.holomap_legend_y, z, holomap_legend_y) - -/datum/map_z_level/Destroy(var/force) - stack_trace("Attempt to delete a map_z_level instance [log_info_line(src)]") - if(!force) - return QDEL_HINT_LETMELIVE // No. - if (GLOB.using_map.zlevels["[z]"] == src) - GLOB.using_map.zlevels -= "[z]" - return ..() +/** + * custom maps + */ +/datum/map/custom diff --git a/code/modules/mapping/map_config.dm b/code/modules/mapping/map_config.dm deleted file mode 100644 index 279bcf59e39..00000000000 --- a/code/modules/mapping/map_config.dm +++ /dev/null @@ -1,226 +0,0 @@ -//used for holding information about unique properties of maps -//feed it json files that match the datum layout -//defaults to box -// -Cyberboss - -/datum/map_config - // Metadata - var/config_filename = "_mapload/triumph.json" - var/defaulted = TRUE // set to FALSE by LoadConfig() succeeding - // Config from maps.txt - var/config_max_users = 0 - var/config_min_users = 0 - var/voteweight = 1 - var/max_round_search_span = 0 //If this is nonzero, then if the map has been played more than max_rounds_played within the search span (max determined by define in persistence.dm), this map won't be available. - var/max_rounds_played = 0 - - // Config actually from the JSON - should default to Box - var/map_name = "Tether" - var/map_path = "map_files/tether" - var/map_file = list( - "tether-01-surface1.dmm", - "tether-02-surface2.dmm", - "tether-03-surface3.dmm", - "tether-04-transit.dmm", - "tether-05-station1.dmm", - "tether-06-station2.dmm", - "tether-07-station3.dmm", - "tether-08-mining.dmm", - "tether-09-solars.dmm", - "tether-10-colony.dmm" - ) - - /// List of lists for Zlevel traits. - var/traits = null - -/* - var/space_ruin_levels = 2 - var/space_empty_levels = 1 - var/station_ruin_budget = -1 // can be set to manually override the station ruins budget on maps that don't support station ruins, stopping the error from being unable to place the ruins. - - var/minetype = "lavaland" -*/ - -// var/maptype = MAP_TYPE_STATION //This should be used to adjust ingame behavior depending on the specific type of map being played. For instance, if an overmap were added, it'd be appropriate for it to only generate with a MAP_TYPE_SHIP - -/* - var/announcertype = "standard" //Determines the announcer the map uses. standard uses the default announcer, classic, but has a random chance to use other similarly-themed announcers, like medibot - - var/allow_custom_shuttles = TRUE - var/shuttles = list( - "cargo" = "cargo_box", - "ferry" = "ferry_fancy", - "whiteship" = "whiteship_box", - "emergency" = "emergency_box") - - var/year_offset = 540 //The offset of ingame year from the actual IRL year. You know you want to make a map that takes place in the 90's. Don't lie. -*/ - /// Persistence ID, defaulting to name. - var/persistence_id - - // "fun things" - /// Orientation to load in by default. - var/orientation = SOUTH //byond defaults to placing everyting SOUTH. - -/proc/load_map_config(filename = "data/next_map.json", default_to_box, delete_after, error_if_missing = TRUE) - var/datum/map_config/config = new - if (default_to_box) - return config - if (!config.LoadConfig(filename, error_if_missing)) - qdel(config) - config = new /datum/map_config // Fall back to Box - if (delete_after) - fdel(filename) - return config - -#define CHECK_EXISTS(X) if(!istext(json[X])) { log_world("[##X] missing from json!"); return; } -/datum/map_config/proc/LoadConfig(filename, error_if_missing) - if(!fexists(filename)) - if(error_if_missing) - log_world("map_config not found: [filename]") - return - - var/json = file(filename) - if(!json) - log_world("Could not open map_config: [filename]") - return - - json = file2text(json) - if(!json) - log_world("map_config is not text: [filename]") - return - - json = json_decode(json) - if(!json) - log_world("map_config is not json: [filename]") - return - - config_filename = filename - - CHECK_EXISTS("map_name") - map_name = json["map_name"] - CHECK_EXISTS("map_path") - map_path = json["map_path"] - - map_file = json["map_file"] - // "map_file": "BoxStation.dmm" - if (istext(map_file)) - if (!fexists("maps/[map_path]/[map_file]")) - log_world("Map file ([map_path]/[map_file]) does not exist!") - return - // "map_file": ["Lower.dmm", "Upper.dmm"] - else if (islist(map_file)) - for (var/file in map_file) - if (!fexists("maps/[map_path]/[file]")) - log_world("Map file ([map_path]/[file]) does not exist!") - return - else - log_world("map_file missing from json!") - return - -/* - if (islist(json["shuttles"])) - var/list/L = json["shuttles"] - for(var/key in L) - var/value = L[key] - shuttles[key] = value - else if ("shuttles" in json) - log_world("map_config shuttles is not a list!") - return -*/ - - traits = json["traits"] - // "traits": [{"Linkage": "Cross"}, {"Space Ruins": true}] - if (islist(traits)) - // "Station" is set by default, but it's assumed if you're setting - // traits you want to customize which level is cross-linked - for (var/level in traits) - if (!(ZTRAIT_STATION in level)) - level[ZTRAIT_STATION] = TRUE - // "traits": null or absent -> default - else if (!isnull(traits)) - log_world("map_config traits is not a list!") - return - -/* - var/temp = json["space_ruin_levels"] - if (isnum(temp)) - space_ruin_levels = temp - else if (!isnull(temp)) - log_world("map_config space_ruin_levels is not a number!") - return - - temp = json["space_empty_levels"] - if (isnum(temp)) - space_empty_levels = temp - else if (!isnull(temp)) - log_world("map_config space_empty_levels is not a number!") - return - - if("station_ruin_budget" in json) - station_ruin_budget = json["station_ruin_budget"] - - temp = json["year_offset"] - if (isnum(temp)) - year_offset = temp - else if (!isnull(temp)) - log_world("map_config year_offset is not a number!") - return - - if ("minetype" in json) - minetype = json["minetype"] - - if ("maptype" in json) - maptype = json["maptype"] - - if ("announcertype" in json) - announcertype = json["announcertype"] -*/ - - if ("orientation" in json) - orientation = json["orientation"] - if(!(orientation in GLOB.cardinal)) - orientation = SOUTH - - if("persistence_id" in json) - persistence_id = json["persistence_id"] - if(!istext(persistence_id)) - persistence_id = lowertext(map_name) - -/* - allow_custom_shuttles = json["allow_custom_shuttles"] != FALSE -*/ - - defaulted = FALSE - return TRUE -#undef CHECK_EXISTS - -/datum/map_config/proc/GetFullMapPaths() - if (istext(map_file)) - return list("maps/[map_path]/[map_file]") - . = list() - for (var/file in map_file) - . += "maps/[map_path]/[file]" - -/datum/map_config/proc/MakeNextMap() - return config_filename == "data/next_map.json" || fcopy(config_filename, "data/next_map.json") - -/// badmin moments. Keep up to date with LoadConfig()! -/datum/map_config/proc/WriteNextMap() - var/list/jsonlist = list() - jsonlist["map_name"] = map_name - jsonlist["map_path"] = map_path - jsonlist["map_file"] = map_file -// jsonlist["shuttles"] = shuttles - jsonlist["traits"] = traits -// jsonlist["space_ruin_levels"] = space_ruin_levels -// jsonlist["year_offset"] = year_offset -// jsonlist["minetype"] = minetype -// jsonlist["maptype"] = maptype -// jsonlist["announcertype"] = announcertype - jsonlist["orientation"] = orientation -// jsonlist["allow_custom_shuttles"] = allow_custom_shuttles - if(fexists("data/next_map.json")) - fdel("data/next_map.json") - var/F = file("data/next_map.json") - WRITE_FILE(F, json_encode(jsonlist)) diff --git a/code/modules/mapping/map_level.dm b/code/modules/mapping/map_level.dm new file mode 100644 index 00000000000..04e4019f9ec --- /dev/null +++ b/code/modules/mapping/map_level.dm @@ -0,0 +1,283 @@ +/** + * a struct for holding information about a zlevel + */ +/datum/map_level + /// id - must be globally unique across all possible maps + var/id + /// friendly debug / code name of level + var/name + /// player visible id for technical displays - randomized if unset + var/display_id + /// player visible name for non-technical displays - randomized if unset + var/display_name + /// traits + var/list/traits + /// attributes associated key-values + var/list/attributes + /// absolute path from server current directory to map; overrides relative_path + var/absolute_path + /// relative path. useless outside of manual maploads, as we can't parse relative path from DM yet. + var/relative_path + /// are we loaded in + var/tmp/loaded = FALSE + /// our zlevel once loaded + var/tmp/z_index + /// are we modified from our prototype/definition? + var/tmp/modified = FALSE + /// linkage enum + var/linkage = Z_LINKAGE_NORMAL + /// transition enum + var/transition = Z_TRANSITION_DEFAULT + /// base turf typepath for this level + var/base_turf = /turf/space + /// base area typepath for this level + var/base_area = /area/space + /// id of north zlevel - overrides linkage if set. can be set to path, autoconverts to id on new. + var/link_north + /// id of south zlevel - overrides linkage if set. can be set to path, autoconverts to id on new. + var/link_south + /// id of west zlevel - overrides linkage if set. can be set to path, autoconverts to id on new. + var/link_west + /// id of east zlevel - overrides linkage if set. can be set to path, autoconverts to id on new. + var/link_east + /// id of below zlevel - overrides linkage if set. can be set to path, autoconverts to id on new. + var/link_below + /// id of above zlevel - overrides linkage if set. can be set to path, autoconverts to id on new. + var/link_above + /// gas string / atmosphere path / atmosphere id for indoors air + var/air_indoors = GAS_STRING_STP + /// gas string / atmosphere path / atmosphere id for outdoors air + var/air_outdoors = GAS_STRING_VACUUM + /// load orientation - overridden if loaded as part of a /datum/map + var/orientation = SOUTH + + //* LEGACY BELOW *// + + var/flags = 0 // Bitflag of which *_levels lists this z should be put into. + //! legacy: what planet to make/use + var/planet_path + + // Holomaps + var/holomap_offset_x = -1 // Number of pixels to offset the map right (for centering) for this z + var/holomap_offset_y = -1 // Number of pixels to offset the map up (for centering) for this z + var/holomap_legend_x = 96 // x position of the holomap legend for this z + var/holomap_legend_y = 96 // y position of the holomap legend for this z + +/datum/map_level/New() + #define UNPACK_LINK(vname) if(ispath(vname, /datum/map_level)) { var/datum/map_level/cast_##vname = vname; vname = initial(cast_##vname.id) ; } + UNPACK_LINK(link_north) + UNPACK_LINK(link_south) + UNPACK_LINK(link_east) + UNPACK_LINK(link_west) + UNPACK_LINK(link_below) + UNPACK_LINK(link_above) + #undef UNPACK_LINK + if(ispath(air_indoors, /datum/atmosphere)) + var/datum/atmosphere/cast_air_indoors = air_indoors + air_indoors = initial(cast_air_indoors.id) + if(ispath(air_outdoors, /datum/atmosphere)) + var/datum/atmosphere/cast_air_outdoors = air_outdoors + air_outdoors = initial(cast_air_outdoors.id) + +/datum/map_level/Destroy() + if(loaded) + . = QDEL_HINT_LETMELIVE + CRASH("UH OH, SOMETHING TRIED TO DELETE AN INSTANTIATED LEVEL.") + return ..() + +/datum/map_level/serialize() + . = ..() + .["id"] = id + .["name"] = name + .["display_id"] = display_id + .["display_name"] = display_name + .["traits"] = traits + .["attributes"] = attributes + // if you are reading this in the future and you serialize/deserialize a map and it doesn't load, + // this is because absolute/relative paths don't actually... work, right now. + .["absolute_path"] = absolute_path + .["relative_path"] = relative_path + // end + .["linkage"] = linkage + .["transition"] = transition + .["base_turf"] = "[base_turf]" + .["link_north"] = link_north + .["link_south"] = link_south + .["link_west"] = link_west + .["link_east"] = link_east + .["link_above"] = link_above + .["link_below"] = link_below + .["air_indoors"] = air_indoors + .["air_outdoors"] = air_outdoors + .["orientation"] = orientation + +/datum/map_level/deserialize(list/data) + if(loaded) + CRASH("attempted deserialize while loaded") + . = ..() + if(!isnull(data["id"])) + id = data["id"] + if(!isnull(data["name"])) + name = data["name"] + if(!isnull(data["display_id"])) + display_id = data["display_id"] + if(!isnull(data["display_name"])) + display_name = data["display_name"] + if(!isnull(data["traits"])) + traits = data["traits"] + if(!isnull(data["attributes"])) + attributes = data["attributes"] + // if you are reading this in the future and you serialize/deserialize a map and it doesn't load, + // this is because absolute/relative paths don't actually... work, right now. + if(!isnull(data["absolute_path"])) + absolute_path = data["absolute_path"] + if(!isnull(data["relative_path"])) + relative_path = data["relative_path"] + // end + if(!isnull(data["linkage"])) + linkage = data["linkage"] + if(!isnull(data["transition"])) + transition = data["transition"] + if(!isnull(data["base_turf"])) + base_turf = text2path(data["base_turf"]) + if(!isnull(data["link_north"])) + link_north = data["link_north"] + if(!isnull(data["link_south"])) + link_south = data["link_south"] + if(!isnull(data["link_above"])) + link_above = data["link_above"] + if(!isnull(data["link_below"])) + link_below = data["link_below"] + if(!isnull(data["link_west"])) + link_west = data["link_west"] + if(!isnull(data["link_east"])) + link_east = data["link_east"] + if(!isnull(data["air_indoors"])) + air_indoors = data["air_indoors"] + if(!isnull(data["air_outdoors"])) + air_outdoors = data["air_outdoors"] + if(!isnull(data["orientation"])) + orientation = data["orientation"] + +/** + * get .dmm path or file + */ +/datum/map_level/proc/resolve_map_path() + return absolute_path // no relative path support yet + +/** + * get level index in dir + */ +/datum/map_level/proc/z_in_dir(dir) + return level_in_dir(dir)?.z_index + +/** + * get level datum in dir + */ +/datum/map_level/proc/level_in_dir(dir) + RETURN_TYPE(/datum/map_level) + switch(dir) + if(NORTH) + return SSmapping.keyed_levels[link_north] + if(SOUTH) + return SSmapping.keyed_levels[link_south] + if(EAST) + return SSmapping.keyed_levels[link_east] + if(WEST) + return SSmapping.keyed_levels[link_west] + if(UP) + return SSmapping.keyed_levels[link_above] + if(DOWN) + return SSmapping.keyed_levels[link_below] + +/** + * called right after we physically load in, before init + * + * this is *not* called if we are created from a zlevel, say, when dynamically generating a planet. + * this is solely for hardcoded map levels to have load behaviors. + * undefined behavior will result if this is overridden on a level used for dynamic generation. + * + * @params + * * z_index - zlevel we loaded on + * * generation_callbacks - callbacks to add to perform post_loaded generation. this will be done in a batch before on_loaded_finalize. + */ +/datum/map_level/proc/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + return + +/** + * called in a group after all maps and dependencies load **and** generation callbacks fire. + * + * this is *not* called if we are created from a zlevel, say, when dynamically generating a planet. + * this is solely for hardcoded map levels to have load behaviors. + * undefined behavior will result if this is overridden on a level used for dynamic generation. + * + * @params + * * z_index - zlevel we loaded on + */ +/datum/map_level/proc/on_loaded_finalize(z_index) + return + +/** + * allow deallocation/unload + */ +/datum/map_level/proc/allow_deallocate() + return TRUE + +/datum/map_level/proc/has_trait(trait) + return trait in traits + +/datum/map_level/proc/add_trait(trait) + if(has_trait(trait)) + return + LAZYDISTINCTADD(traits, trait) + if(loaded) + SSmapping.on_trait_add(src, trait) + +/datum/map_level/proc/remove_trait(trait) + if(!has_trait(trait)) + return + LAZYREMOVE(traits, trait) + if(loaded) + SSmapping.on_trait_del(src, trait) + +/datum/map_level/proc/get_attribute(attribute) + return attributes?[attribute] + +/datum/map_level/proc/set_attribute(attribute, value) + var/old = get_attribute(attribute) + LAZYSET(attributes, attribute, value) + if(loaded) + SSmapping.on_attribute_set(src, attribute, old, value) + +/datum/map_level/proc/unset_attribute(attribute) + var/old = get_attribute(attribute) + LAZYREMOVE(attributes, attribute) + if(loaded) + SSmapping.on_attribute_set(src, attribute, old, null) + +/** + * dynamically generated levels should use this + */ +/datum/map_level/dynamic + modified = TRUE + +/** + * "free" / unallocated zlevels use this + */ +/datum/map_level/unallocated + transition = Z_TRANSITION_DISABLED + +/** + * reserved levels for turf reservations use this + */ +/datum/map_level/reserved + transition = Z_TRANSITION_DISABLED + +/datum/map_level/reserved/allow_deallocate() + return FALSE + +/** + * transit levels for shuttles + */ +/datum/map_level/transit + transition = Z_TRANSITION_DISABLED diff --git a/code/modules/mapping/map_orientation_patterns.dm b/code/modules/mapping/map_orientation_patterns.dm deleted file mode 100644 index 565c25bef1c..00000000000 --- a/code/modules/mapping/map_orientation_patterns.dm +++ /dev/null @@ -1,46 +0,0 @@ -GLOBAL_LIST_INIT(map_orientation_patterns, list( - TEXT_NORTH = new /datum/map_orientation_pattern/north, - TEXT_SOUTH = new /datum/map_orientation_pattern/south, - TEXT_EAST = new /datum/map_orientation_pattern/east, - TEXT_WEST = new /datum/map_orientation_pattern/west - )) - -/datum/map_orientation_pattern - var/invert_x - var/invert_y - var/swap_xy - var/xi - var/yi - var/turn_angle - -/datum/map_orientation_pattern/north - invert_y = TRUE - invert_x = TRUE - swap_xy = FALSE - xi = -1 - yi = 1 - turn_angle = 180 - -/datum/map_orientation_pattern/south - invert_y = FALSE - invert_x = FALSE - swap_xy = FALSE - xi = 1 - yi = -1 - turn_angle = 0 - -/datum/map_orientation_pattern/east - invert_y = TRUE - invert_x = FALSE - swap_xy = TRUE - xi = 1 - yi = 1 - turn_angle = 90 - -/datum/map_orientation_pattern/west - invert_y = FALSE - invert_x = TRUE - swap_xy = TRUE - xi = -1 - yi = -1 - turn_angle = 270 diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index 087552fada7..2febfc80a77 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -1,211 +1,244 @@ /datum/map_template + /// abstract type + abstract_type = /datum/map_template + var/name = "Default Template Name" - var/width = 0 //all these are for SOUTH! + var/desc = "Some text should go here. Maybe." + /// If this is set, no more than one template in the same group will be spawned, per submap seeding. + var/template_group = null + + /// The map generator has a set 'budget' it spends to place down different submaps. It will pick available submaps randomly until + /// it runs out. The cost of a submap should roughly corrispond with several factors such as size, loot, difficulty, desired scarcity, etc. + /// Set to -1 to force the submap to always be made. + var/cost = null + /// If false, only one map template will be spawned by the game. Doesn't affect admins spawning then manually. + var/allow_duplicates = FALSE + /// If non-zero, there is a chance that the map seeding algorithm will skip this template when selecting potential templates to use. + var/discard_prob = 0 + // For ruins + var/fixed_orientation = FALSE + + //* file + /// path to the map + var/map_path + + //* cached data + /// cached map + var/datum/dmm_parsed/parsed + /// keep cached map + var/cache_parsed_map = FALSE + /// cached width + var/width = 0 + /// cached height var/height = 0 - var/zdepth = 1 - var/mappath - var/loaded = 0 // Times loaded this round - var/datum/parsed_map/cached_map - var/keep_cached_map = FALSE - var/default_annihilate = FALSE - var/list/ztraits //zlevel traits for load_new_z -/datum/map_template/New(path = null, rename = null, cache = FALSE) - if(path) - mappath = path - if(mappath) - preload_size(mappath, cache) - if(rename) - name = rename + //* loading + /// times loaded this round + var/tmp/loaded = 0 + /// If true, all (movable) atoms at the location where the map is loaded will be deleted before the map is loaded in. + var/annihilate = FALSE -/datum/map_template/Destroy() - QDEL_NULL(cached_map) - return ..() + //* loading as its own level + /// traits to have if loaded as standalone level + var/list/level_traits + /// attributes to have if loaded as standalone level + var/list/level_attributes + /// id to have if loaded as standalone level + var/level_id -/datum/map_template/proc/preload_size(path = mappath, force_cache = FALSE) - if(cached_map) - return cached_map.parsed_bounds - var/datum/parsed_map/parsed = new(file(path)) - var/bounds = parsed?.parsed_bounds - if(bounds) - width = bounds[MAP_MAXX] - bounds[MAP_MINX] + 1 - height = bounds[MAP_MAXY] - bounds[MAP_MINY] + 1 - zdepth = bounds[MAP_MAXZ] - bounds[MAP_MINZ] + 1 - if(force_cache || keep_cached_map) - cached_map = parsed - return bounds - -/datum/map_template/proc/get_parsed_bounds() - return preload_size(mappath) - -/datum/map_template/proc/get_last_loaded_bounds() - if(cached_map) - return cached_map.bounds - return get_parsed_bounds() - -/datum/map_template/proc/get_last_loaded_turf_block() - if(!cached_map) - CRASH("Improper use of get_last_loaded_turf_block, no cached_map.") - var/list/B = cached_map.bounds - return block(locate(B[MAP_MINX], B[MAP_MINY], B[MAP_MINZ]), locate(B[MAP_MAXX], B[MAP_MAXY], B[MAP_MAXZ])) - -/datum/map_template/proc/get_size(orientation = SOUTH) - if(!width || !height || !zdepth) - preload_size(mappath) - var/rotate = (orientation & (NORTH|SOUTH)) != NONE - if(rotate) - return list(height, width, zdepth) - return list(width, height, zdepth) - -/datum/parsed_map/proc/initTemplateBounds() - var/list/obj/machinery/atmospherics/atmos_machines = list() - var/list/obj/structure/cable/cables = list() - var/list/atom/atoms = list() - var/list/area/areas = list() - - var/list/turfs = block( locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), - locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])) - var/list/border = block(locate(max(bounds[MAP_MINX]-1, 1), max(bounds[MAP_MINY]-1, 1), bounds[MAP_MINZ]), - locate(min(bounds[MAP_MAXX]+1, world.maxx), min(bounds[MAP_MAXY]+1, world.maxy), bounds[MAP_MAXZ])) - turfs - for(var/L in turfs) - var/turf/B = L - atoms += B - areas |= B.loc - for(var/A in B) - atoms += A - if(istype(A, /obj/structure/cable)) - cables += A - continue - if(istype(A, /obj/machinery/atmospherics)) - atmos_machines += A - for(var/L in border) - var/turf/T = L - T.air_update_turf(TRUE) //calculate adjacent turfs along the border to prevent runtimes - - SSmapping.reg_in_areas_in_z(areas) - SSatoms.InitializeAtoms(atoms) - SSmachines.setup_template_powernets(cables) - SSair.setup_template_machinery(atmos_machines) - -/datum/map_template/proc/load_new_z(orientation = SOUTH, list/ztraits = src.ztraits || list(ZTRAIT_AWAY = TRUE), centered = TRUE) - var/x = centered? max(round((world.maxx - width) / 2), 1) : 1 - var/y = centered? max(round((world.maxy - height) / 2), 1) : 1 - - var/datum/space_level/level = SSmapping.add_new_zlevel(name, ztraits) - var/datum/parsed_map/parsed = load_map(file(mappath), x, y, level.z_value, no_changeturf=(SSatoms.initialized == INITIALIZATION_INSSATOMS), placeOnTop = TRUE, orientation = orientation) - var/list/bounds = parsed.bounds - if(!bounds) - return FALSE - - repopulate_sorted_areas() - - //initialize things that are normally initialized after map load - parsed.initTemplateBounds() - smooth_zlevel(world.maxz) - log_game("Z-level [name] loaded at [x],[y],[world.maxz]") - on_map_loaded(world.maxz, parsed.bounds) - - return level - -//Override for custom behavior -/datum/map_template/proc/on_map_loaded(z, list/bounds) - loaded++ +/datum/map_template/New(path, name) + if(!isnull(name)) + src.name = name + if(!isnull(path)) + src.map_path = path + preload() /** - * Proc to trigger a load at a specific area. Calls on_map_loaded(T.z, loaded_bounds) afterwards. - * - * @params - * * turf/T - Turf to load at - * * centered - Center at T or load with the bottomright corner being at T - * * orientation - SOUTH is default, anything else rotates the map to face it with the point of reference being the map itself is facing south by default. Cardinals only, don't be a 4head and put in multiple flags. It won't work or be pretty if you try. - * * annihilate - Should we destroy stuff in our bounds while loading - * * force_cache - Should we force the parsed shuttle to cache instead of being GC'd post loading if it wasn't going to be cached by default - * * rotate_placement_to_orientation - Has no effect if centered. Should we rotate where we load it around the turf we're loading at? Used for stuff like engine submaps when the station is rotated. - * - */ -/datum/map_template/proc/load(turf/T, centered = FALSE, orientation = SOUTH, annihilate = default_annihilate, force_cache = FALSE, rotate_placement_to_orientation = FALSE) - var/old_T = T + * gets our width/height + * + * uses cache if possible; if cache_parsed_map is TRUE, this will autoamtically cache. + */ +/datum/map_template/proc/preload() + if(isnull(map_path)) + return FALSE + var/datum/dmm_parsed/parsing = parse_map(isfile(map_path)? map_path : file(map_path)) + . = !!parsing + width = parsing.width + height = parsing.height + if(cache_parsed_map) + parsed = parsing + +/** + * gets our parsed map + * + * uses cache if possible; if cache_parsed_map is TRUE, this will autoamtically cache. + */ +/datum/map_template/proc/parsed() + if(isnull(parsed)) + . = parse_map(isfile(map_path)? map_path : file(map_path)) + if(cache_parsed_map) + parsed = . + else + . = parsed + +/** + * ensures our parsed map is cached + */ +/datum/map_template/proc/load_cache() + var/old = cache_parsed_map + cache_parsed_map = TRUE + parsed() + cache_parsed_map = old + +/** + * throws out our cached parsed map + */ +/datum/map_template/proc/unload_cache() + parsed = null + +/datum/map_template/proc/load_new_z(centered = FALSE, orientation = SOUTH, list/traits = src.level_traits, list/attributes = src.level_attributes) + . = FALSE + + SSmapping.subsystem_log("Loading template [src] ([type]) on a new z-level...") + + var/ll_x = 1 + var/ll_y = 1 + var/sideways = orientation & (EAST|WEST) + var/real_width = sideways? height : width + var/real_height = sideways? width : height + if(centered) - T = locate(T.x - round(((orientation & (NORTH|SOUTH))? width : height) / 2) , T.y - round(((orientation & (NORTH|SOUTH)) ? height : width) / 2) , T.z) // %180 catches East/West (90,270) rotations on true, North/South (0,180) rotations on false - else if(rotate_placement_to_orientation && (orientation != SOUTH)) - var/newx = T.x - var/newy = T.y - if(orientation == NORTH) - newx -= width - newy -= height - 1 - else if(orientation == WEST) - newy -= width - else if(orientation == EAST) - newx -= height - 1 - // eh let's not silently fail. - if(!ISINRANGE(newx, 1, world.maxx) || !ISINRANGE(newy, 1, world.maxy)) - stack_trace("Warning: Rotation placed a map template load spot ([COORD(T)]) out of bounds of the game world. Clamping to world borders, this might cause issues.") - T = locate(clamp(newx, 1, world.maxx), clamp(newy, 1, world.maxy), T.z) - if(!T) - return - if(T.x+width-1 > world.maxx) - return - if(T.y+height-1 > world.maxy) - return + ll_x = round((world.maxx - real_width) / 2) + ll_y = round((world.maxy - real_height) / 2) - var/list/border = block(locate(max(T.x - 1, 1), max(T.y - 1, 1), T.z), - locate(min(T.x + width + 1, world.maxx), min(T.y + height + 1, world.maxy), T.z)) - for(var/i in border) - var/turf/turf_to_disable = i - SSair.remove_from_active(turf_to_disable) //stop processing turfs along the border to prevent runtimes, we return it in initTemplateBounds() - turf_to_disable.atmos_adjacent_turfs?.Cut() + var/datum/map_level/dynamic/level = new + level.traits = isnull(traits)? list() : traits.Copy() + level.attributes = isnull(attributes)? list() : attributes.Copy() + SSmapping.allocate_level(level) - if(annihilate == MAP_TEMPLATE_ANNIHILATE_PRELOAD) - annihilate_bounds(old_T, centered, orientation) + ASSERT(level.loaded) - // Accept cached maps, but don't save them automatically - we don't want - // ruins clogging up memory for the whole round. - var/is_cached = cached_map - var/datum/parsed_map/parsed = is_cached || new(file(mappath)) - cached_map = (force_cache || keep_cached_map) ? parsed : is_cached - if(!parsed.load(T.x, T.y, T.z, cropMap=TRUE, no_changeturf=(SSatoms.initialized == INITIALIZATION_INSSATOMS), placeOnTop=TRUE, orientation = orientation, annihilate_tiles = (annihilate == MAP_TEMPLATE_ANNIHILATE_LOADING))) - return - var/list/bounds = parsed.bounds - if(!bounds) - return + load(locate(ll_x, ll_y, level.z_index), FALSE, orientation) - if(!SSmapping.loading_ruins) //Will be done manually during mapping ss init + SSmapping.subsystem_log("Loaded template [src] ([type]) on z-level [level.z_index]") + + on_z_load(level.z_index) + + return TRUE + +/** + * loads a map template + * + * @params + * * T - turf. center or lower left, depending on centered param. + * * centered - is T the center, or lower left? + * * orientation - the orientation to load in. default is SOUTH. + * * deferred_callbacks - if specified, generation callbacks are deferred and added to this list, instead of fired immediately. + */ +/datum/map_template/proc/load(turf/T, centered = FALSE, orientation = SOUTH, list/datum/callback/deferred_callbacks) + . = FALSE + var/ll_x = T.x + var/ll_y = T.y + var/ll_z = T.z + var/sideways = orientation & (EAST|WEST) + var/real_width = sideways? height : width + var/real_height = sideways? width : height + + if(centered) + ll_x -= round(real_width / 2) + ll_y -= round(real_height / 2) + + var/turf/real_turf = locate(ll_x, ll_y, ll_z) + + SSmapping.subsystem_log("Loading template [src] ([type]) at [COORD(real_turf)] size [width]x[height] with annihilate mode [annihilate]") + + if(annihilate) + annihilate_bounds(real_turf, width, height) + + var/datum/dmm_parsed/parsed = parsed() + var/list/loaded_bounds = parsed.load(ll_x, ll_y, ll_z, orientation = orientation) + + if(isnull(loaded_bounds)) + CRASH("failed to load") + + ++loaded + + var/list/datum/callback/callbacks = list() + on_normal_load(loaded_bounds, callbacks) + if(isnull(deferred_callbacks)) + for(var/datum/callback/cb as anything in callbacks) + cb.Invoke() + else + deferred_callbacks += callbacks + + init_bounds(loaded_bounds) + + // todo: inefficient as shit + if(SSmapping.initialized) repopulate_sorted_areas() + // end - //initialize things that are normally initialized after map load - parsed.initTemplateBounds() + return TRUE - log_game("[name] loaded at [T.x],[T.y],[T.z]") - on_map_loaded(T.z, parsed.bounds) +/datum/map_template/proc/annihilate_bounds(turf/ll_turf, width, height) + SSmapping.subsystem_log("Annihilating bounds in template spawn location: [COORD(ll_turf)] with area [width]x[height]") + var/list/turf/cleaning = block( + ll_turf, + locate( + ll_turf.x + width - 1, + ll_turf.y + height - 1, + ll_turf.z + ) + ) + var/cleaned = 0 + for(var/turf/T as anything in cleaning) + for(var/atom/movable/AM as anything in T) + if(!(AM.atom_flags & ATOM_ABSTRACT)) + continue + qdel(AM) + ++cleaned + SSmapping.subsystem_log("Deleted [cleaned] atoms.") - return bounds +/datum/map_template/proc/get_affecting_turfs(turf/T, centered = FALSE, orientation = SOUTH) + var/ll_x = T.x + var/ll_y = T.y + var/ll_z = T.z + var/sideways = orientation & (EAST|WEST) + var/real_width = sideways? height : width + var/real_height = sideways? width : height -//This, get_affected_turfs, and load() calculations for bounds/center can probably be optimized. Later. -/datum/map_template/proc/annihilate_bounds(turf/origin, centered = FALSE, orientation = SOUTH) - var/deleted_atoms = 0 - log_world("Annihilating objects in map loading location.") - var/list/turfs_to_clean = get_affected_turfs(origin, centered, orientation) - if(turfs_to_clean.len) - var/list/kill_these = list() - for(var/i in turfs_to_clean) - var/turf/T = i - kill_these += T.contents - for(var/i in kill_these) - qdel(i) - CHECK_TICK - deleted_atoms++ - log_world("Annihilated [deleted_atoms] objects.") - -//for your ever biggening badminnery kevinz000 -//❤ - Cyberboss -/proc/load_new_z_level(file, name, orientation, list/ztraits) - var/datum/map_template/template = new(file, name) - return template.load_new_z(orientation, ztraits) - -/datum/map_template/proc/get_affected_turfs(turf/T, centered = FALSE, orientation = SOUTH) - var/turf/placement = T if(centered) - var/turf/corner = locate(placement.x - round(((orientation & (NORTH|SOUTH))? width : height) / 2), placement.y - round(((orientation & (NORTH|SOUTH))? height : width) / 2), placement.z) // %180 catches East/West (90,270) rotations on true, North/South (0,180) rotations on false - if(corner) - placement = corner - return block(placement, locate(placement.x + ((orientation & (NORTH|SOUTH)) ? width : height) - 1, placement.y + ((orientation & (NORTH|SOUTH))? height : width) - 1, placement.z)) + ll_x -= round(real_width / 2) + ll_y -= round(real_height / 2) + + var/turf/ll_turf = clamped_locate(ll_x, ll_y, ll_z) + return block( + ll_turf, + clamped_locate( + ll_x + width - 1, + ll_y + height - 1, + ll_z + ) + ) + +/datum/map_template/proc/init_bounds(list/bounds) + SSatoms.init_map_bounds(bounds) + +/** + * called when normally loaded + * + * @params + * * bounds - map bounds of load. use defines like MAP_MINX/MAP_MINY/etc to access. + * * late_generation - callbacks to fire after ruin seeding. if this is being spawned standalone, it fires immediately. + */ +/datum/map_template/proc/on_normal_load(list/bounds, list/datum/callback/late_generation) + return + +/** + * called when loaded as a new zlevel + * + * @params + * * z_index - zlevel we loaded onto + */ +/datum/map_template/proc/on_z_load(z_index) + return diff --git a/code/modules/mapping/space_management/multiz_helpers.dm b/code/modules/mapping/multiz_helpers.dm similarity index 100% rename from code/modules/mapping/space_management/multiz_helpers.dm rename to code/modules/mapping/multiz_helpers.dm diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm deleted file mode 100644 index 5f0f20e9da2..00000000000 --- a/code/modules/mapping/reader.dm +++ /dev/null @@ -1,567 +0,0 @@ -/////////////////////////////////////////////////////////////// -//SS13 Optimized Map loader -////////////////////////////////////////////////////////////// -/* - * Notes: - * This does NOT support map files where more than one Z is in each grid set, as defined in the file. - * MultiZ map files ARE supported (however very much discouraged), as long as each gridset only contains one z. - * This assumes that for the most part, map files are properly formed, either DMM or TGM standard formats. If you feed it bad data, expect to crash. - */ -#define SPACE_KEY "space" - -/datum/grid_set - var/xcrd - var/ycrd - var/zcrd - var/gridLines - -/datum/grid_set/proc/height(key_len) - return length(gridLines) - -/datum/grid_set/proc/width(key_len) - return gridLines[1] / key_len - -/datum/parsed_map - var/original_path - var/key_len = 0 - var/list/grid_models = list() - var/list/gridSets = list() - - var/list/modelCache - - /// Unoffset bounds. Null on parse failure. - var/list/parsed_bounds - var/width - var/height - /// Offset bounds. Same as parsed_bounds until load(). - var/list/bounds - - var/datum/map_template/template_host - - // raw strings used to represent regexes more accurately - // '' used to avoid confusing syntax highlighting - var/static/regex/dmmRegex = new(@'"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}', "g") - var/static/regex/trimQuotesRegex = new(@'^[\s\n]+"?|"?[\s\n]+$|^"|"$', "g") - var/static/regex/trimRegex = new(@'^[\s\n]+|[\s\n]+$', "g") - - #ifdef TESTING - var/turfsSkipped = 0 - #endif - -/// Shortcut function to parse a map and apply it to the world. -/// -/// - `dmm_file`: A .dmm file to load (Required). -/// - `x_offset`, `y_offset`, `z_offset`: Positions representign where to load the map (Optional). -/// - `cropMap`: When true, the map will be cropped to fit the existing world dimensions (Optional). -/// - `measureOnly`: When true, no changes will be made to the world (Optional). -/// - `no_changeturf`: When true, [turf/AfterChange] won't be called on loaded turfs -/// - `x_lower`, `x_upper`, `y_lower`, `y_upper`: Coordinates (relative to the game world) to crop to (Optional). -/// - `placeOnTop`: Whether to use [turf/PlaceOnTop] rather than [turf/ChangeTurf] (Optional). -/proc/load_map( - dmm_file as file, - x_offset as num, - y_offset as num, - z_offset as num, - cropMap as num, - measureOnly as num, - no_changeturf as num, - x_lower = -INFINITY as num, - x_upper = INFINITY as num, - y_lower = -INFINITY as num, - y_upper = INFINITY as num, - placeOnTop = FALSE as num, - orientation = SOUTH as num, - annihilate_tiles = FALSE, - crop_relative_to_game_world = TRUE - ) - var/datum/parsed_map/parsed = new(dmm_file, measureOnly = measureOnly) - if(parsed.bounds && !measureOnly) - parsed.load(x_offset, y_offset, z_offset, cropMap, no_changeturf, x_lower, x_upper, y_lower, y_upper, placeOnTop, orientation, annihilate_tiles) - return parsed - -/** - * Parse a map, possibly cropping it. - * Do not use the crop function unless strictly necessary. - * WARNING: Crop function crops based on the tiles you'd see in the map editor. If you're planning to load it in in a different orientation later, you better have done the math. - * It's recommended that you do not crop using this at all. - */ -/datum/parsed_map/New(tfile, x_lower = -INFINITY, x_upper = INFINITY, y_lower = -INFINITY, y_upper = INFINITY, z_lower = -INFINITY, z_upper = INFINITY, measureOnly = FALSE) - _parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper, measureOnly) - -/datum/parsed_map/proc/_parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper, measureOnly) - var/static/parsing = FALSE - UNTIL(!parsing) - // do not multithread this or bad things happen - parsing = TRUE - _do_parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper, measureOnly) - parsing = FALSE - -/datum/parsed_map/proc/_do_parse(tfile, x_lower, x_upper, y_lower, y_upper, z_lower, z_upper, measureOnly) - if(isfile(tfile)) - original_path = "[tfile]" - tfile = file2text(tfile) - else if(isnull(tfile)) - // create a new datum without loading a map - return - bounds = parsed_bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF) - ASSERT(x_upper >= x_lower) - ASSERT(y_upper >= y_lower) - ASSERT(z_upper >= z_lower) - var/stored_index = 1 - - //multiz lool - while(dmmRegex.Find(tfile, stored_index)) - stored_index = dmmRegex.next - - // "aa" = (/type{vars=blah}) - if(dmmRegex.group[1]) // Model - var/key = dmmRegex.group[1] - if(grid_models[key]) // Duplicate model keys are ignored in DMMs - continue - if(key_len != length(key)) - if(!key_len) - key_len = length(key) - else - CRASH("Inconsistent key length in DMM") - if(!measureOnly) - grid_models[key] = dmmRegex.group[2] - - // (1,1,1) = {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} - else if(dmmRegex.group[3]) // Coords - if(!key_len) - CRASH("Coords before model definition in DMM") - - // NOTE: We are assuming each coordset only contains one z. - var/curr_z = text2num(dmmRegex.group[5]) - if(curr_z < z_lower || curr_z > z_upper) - continue - - var/curr_x = text2num(dmmRegex.group[3]) - var/curr_y = text2num(dmmRegex.group[4]) - - var/datum/grid_set/gridSet = new - - gridSet.xcrd = curr_x - gridSet.ycrd = curr_y - gridSet.zcrd = curr_z - - var/list/gridLines = splittext(dmmRegex.group[6], "\n") - gridSet.gridLines = gridLines - - var/leadingBlanks = 0 - while(leadingBlanks < gridLines.len && gridLines[++leadingBlanks] == "") - if(leadingBlanks > 1) - gridLines.Cut(1, leadingBlanks) // Remove all leading blank lines. - - var/lines = length(gridLines) - if(lines && gridLines[lines] == "") - // remove one trailing blank line - gridLines.len-- - lines-- - // y crop - var/right_length = y_upper - curr_y + 1 - if(lines > right_length) - lines = gridLines.len = right_length - if(!lines) // blank - continue - - var/width = length(gridLines[1]) / key_len - // x crop - var/right_width = x_upper - curr_x + 1 - if(width > right_width) - for(var/i in 1 to lines) - gridLines[i] = copytext(gridLines[i], 1, key_len * right_width) - - // during the actual load we're starting at the top and working our way down - gridSet.ycrd += lines - 1 - - // Safe to proceed, commit gridset to list and record coords. - gridSets += gridSet - bounds[MAP_MINX] = min(bounds[MAP_MINX], curr_x) - bounds[MAP_MAXX] = max(bounds[MAP_MAXX], curr_x + width - 1) - bounds[MAP_MINY] = min(bounds[MAP_MINY], curr_y) - bounds[MAP_MAXY] = max(bounds[MAP_MAXY], curr_y + lines - 1) - bounds[MAP_MINZ] = min(bounds[MAP_MINZ], curr_z) - bounds[MAP_MAXZ] = max(bounds[MAP_MAXZ], curr_z) - CHECK_TICK - - // Indicate failure to parse any coordinates by nulling bounds - if(bounds[1] == 1.#INF) - bounds = null - else - width = bounds[MAP_MAXX] - bounds[MAP_MINX] + 1 - height = bounds[MAP_MAXY] - bounds[MAP_MINY] + 1 - parsed_bounds = bounds - -/datum/parsed_map/Destroy() - if(template_host && template_host.cached_map == src) - template_host.cached_map = null - . = ..() - return QDEL_HINT_HARDDEL_NOW - -/// Load the parsed map into the world. See [/proc/load_map] for arguments. -/datum/parsed_map/proc/load(x_offset, y_offset, z_offset, cropMap, no_changeturf, x_lower, x_upper, y_lower, y_upper, placeOnTop, orientation, annihilate_tiles, datum/map_orientation_pattern/forced_pattern) - //How I wish for RAII - Master.StartLoadingMap() - . = _load_impl(x_offset, y_offset, z_offset, cropMap, no_changeturf, x_lower, x_upper, y_lower, y_upper, placeOnTop, orientation, annihilate_tiles, forced_pattern) - Master.StopLoadingMap() - -// Do not call except via load() above. -// Lower/upper here refers to the actual map template's parsed coordinates, NOT ACTUAL COORDINATES! Figure it out yourself my head hurts too much to implement that too. -/datum/parsed_map/proc/_load_impl(x_offset = 1, y_offset = 1, z_offset = world.maxz + 1, cropMap = FALSE, no_changeturf = FALSE, x_lower = -INFINITY, x_upper = INFINITY, y_lower = -INFINITY, y_upper = INFINITY, placeOnTop = FALSE, orientation = SOUTH, annihilate_tiles = FALSE, datum/map_orientation_pattern/forced_pattern) - var/list/areaCache = list() - var/list/modelCache = build_cache(no_changeturf) - var/space_key = modelCache[SPACE_KEY] - var/list/bounds - src.bounds = bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF) - var/datum/map_orientation_pattern/mode = forced_pattern || GLOB.map_orientation_patterns["[orientation]"] || GLOB.map_orientation_patterns["[SOUTH]"] - var/invert_y = mode.invert_y - var/invert_x = mode.invert_x - var/swap_xy = mode.swap_xy - var/xi = mode.xi - var/yi = mode.yi - var/turn_angle = round(SIMPLIFY_DEGREES(mode.turn_angle), 90) - var/delta_swap = x_offset - y_offset - // less checks later - var/do_crop = x_lower > -INFINITY || x_upper < INFINITY || y_lower > -INFINITY || y_upper < INFINITY - - for(var/__I in gridSets) - var/datum/grid_set/gridset = __I - var/parsed_z = gridset.zcrd + z_offset - 1 - var/zexpansion = parsed_z > world.maxz - if(zexpansion) - if(cropMap) - continue - else - while(parsed_z > world.maxz) - world.incrementMaxZ() - if(!no_changeturf) - WARNING("Z-level expansion occurred without no_changeturf set, this may cause problems when /turf/AfterChange is called") - //these values are the same until a new gridset is reached. - var/edge_dist_x = gridset.xcrd - 1 //from left side, 0 is right on the x_offset - var/edge_dist_y = gridset.ycrd - length(gridset.gridLines) //from bottom, 0 is right on the y_offset - var/actual_x_starting = invert_x? (x_offset + width - edge_dist_x - 1) : (x_offset + edge_dist_x) //this value is not changed, cache. - //this value is changed - var/actual_y = invert_y? (y_offset + edge_dist_y) : (y_offset + gridset.ycrd - 1) - for(var/line in gridset.gridLines) - var/actual_x = actual_x_starting - for(var/pos = 1 to (length(line) - key_len + 1) step key_len) - var/placement_x = swap_xy? (actual_y + delta_swap) : actual_x - var/placement_y = swap_xy? (actual_x - delta_swap) : actual_y - if(do_crop && ((placement_x < x_lower) || (placement_x > x_upper) || (placement_y < y_lower) || (placement_y > y_upper))) - continue - if(placement_x > world.maxx) - if(cropMap) - actual_x += xi - continue - else - world.maxx = placement_x - if(placement_y > world.maxy) - if(cropMap) - break - else - world.maxy = placement_y - if(placement_x < 1) - actual_x += xi - continue - if(placement_y < 1) - break - var/model_key = copytext(line, pos, pos + key_len) - var/no_afterchange = no_changeturf || zexpansion - if(!no_afterchange || (model_key != space_key)) - var/list/cache = modelCache[model_key] - if(!cache) - CRASH("Undefined model key in DMM: [model_key]") - build_coordinate(areaCache, cache, locate(placement_x, placement_y, parsed_z), no_afterchange, placeOnTop, turn_angle, annihilate_tiles, swap_xy, invert_y, invert_x) - - // only bother with bounds that actually exist - bounds[MAP_MINX] = min(bounds[MAP_MINX], placement_x) - bounds[MAP_MINY] = min(bounds[MAP_MINY], placement_y) - bounds[MAP_MINZ] = min(bounds[MAP_MINZ], parsed_z) - bounds[MAP_MAXX] = max(bounds[MAP_MAXX], placement_x) - bounds[MAP_MAXY] = max(bounds[MAP_MAXY], placement_y) - bounds[MAP_MAXZ] = max(bounds[MAP_MAXZ], parsed_z) - #ifdef TESTING - else - ++turfsSkipped - #endif - actual_x += xi - CHECK_TICK - actual_y += yi - CHECK_TICK - - if(!no_changeturf) - for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))) - var/turf/T = t - //we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs - T.AfterChange(CHANGETURF_IGNORE_AIR) - - #ifdef TESTING - if(turfsSkipped) - testing("Skipped loading [turfsSkipped] default turfs") - #endif - - return TRUE - -/datum/parsed_map/proc/build_cache(no_changeturf, bad_paths=null) - if(modelCache && !bad_paths) - return modelCache - . = modelCache = list() - var/list/grid_models = src.grid_models - for(var/model_key in grid_models) - var/model = grid_models[model_key] - var/list/members = list() //will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored) - var/list/members_attributes = list() //will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list()) - - ///////////////////////////////////////////////////////// - //Constructing members and corresponding variables lists - //////////////////////////////////////////////////////// - - var/index = 1 - var/old_position = 1 - var/dpos - - while(dpos != 0) - //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored) - dpos = find_next_delimiter_position(model, old_position, ",", "{", "}") //find next delimiter (comma here) that's not within {...} - - var/full_def = trim_text(copytext(model, old_position, dpos)) //full definition, e.g : /obj/foo/bar{variables=derp} - var/variables_start = findtext(full_def, "{") - var/path_text = trim_text(copytext(full_def, 1, variables_start)) - var/atom_def = text2path(path_text) //path definition, e.g /obj/foo/bar - if(dpos) - old_position = dpos + length(model[dpos]) - - if(!ispath(atom_def, /atom)) // Skip the item if the path does not exist. Fix your crap, mappers! - if(bad_paths) - LAZYDISTINCTADD(bad_paths[path_text], model_key) - continue - members.Add(atom_def) - - //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) - var/list/fields = list() - - if(variables_start)//if there's any variable - full_def = copytext(full_def, variables_start + length(full_def[variables_start]), -length(copytext_char(full_def, -1))) //removing the last '}' - fields = readlist(full_def, ";") - if(fields.len) - if(!trim(fields[fields.len])) - --fields.len - for(var/I in fields) - var/value = fields[I] - if(istext(value)) - fields[I] = apply_text_macros(value) - - //then fill the members_attributes list with the corresponding variables - members_attributes.len++ - members_attributes[index++] = fields - - CHECK_TICK - - //check and see if we can just skip this turf - //So you don't have to understand this horrid statement, we can do this if - // 1. no_changeturf is set - // 2. the space_key isn't set yet - // 3. there are exactly 2 members - // 4. with no attributes - // 5. and the members are world.turf and world.area - // Basically, if we find an entry like this: "XXX" = (/turf/default, /area/default) - // We can skip calling this proc every time we see XXX - if(no_changeturf \ - && !(.[SPACE_KEY]) \ - && members.len == 2 \ - && members_attributes.len == 2 \ - && length(members_attributes[1]) == 0 \ - && length(members_attributes[2]) == 0 \ - && (world.area in members) \ - && (world.turf in members)) - - .[SPACE_KEY] = model_key - continue - - - .[model_key] = list(members, members_attributes) - -/datum/parsed_map/proc/build_coordinate(list/areaCache, list/model, turf/crds, no_changeturf as num, placeOnTop as num, turn_angle as num, annihilate_tiles = FALSE, swap_xy, invert_y, invert_x) - var/index - var/list/members = model[1] - var/list/members_attributes = model[2] - - //////////////// - //Instanciation - //////////////// - - //The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile - //first instance the /area and remove it from the members list - index = members.len - if(annihilate_tiles && crds) - crds.empty(null) - if(members[index] != /area/template_noop) - var/atype = members[index] - world.preloader_setup(members_attributes[index], atype)//preloader for assigning set variables on atom creation - var/atom/instance = areaCache[atype] - if (!instance) - instance = GLOB.areas_by_type[atype] - if (!instance) - instance = new atype(null) - areaCache[atype] = instance - if(crds) - instance.contents.Add(crds) - - if(GLOB.use_preloader && instance) - world.preloader_load(instance) - - //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect - - var/first_turf_index = 1 - while(!ispath(members[first_turf_index], /turf)) //find first /turf object in members - first_turf_index++ - - //turn off base new Initialization until the whole thing is loaded - SSatoms.map_loader_begin() - //instanciate the first /turf - var/turf/T - if(members[first_turf_index] != /turf/template_noop) - T = instance_atom(members[first_turf_index],members_attributes[first_turf_index],crds,no_changeturf,placeOnTop,turn_angle, swap_xy, invert_y, invert_x) - - if(T) - //if others /turf are presents, simulates the underlays piling effect - index = first_turf_index + 1 - while(index <= members.len - 1) // Last item is an /area - var/underlay = T.appearance - T = instance_atom(members[index],members_attributes[index],crds,no_changeturf,placeOnTop,turn_angle, swap_xy, invert_y, invert_x)//instance new turf - T.underlays += underlay - index++ - - //finally instance all remainings objects/mobs - for(index in 1 to first_turf_index-1) - instance_atom(members[index],members_attributes[index],crds,no_changeturf,placeOnTop,turn_angle, swap_xy, invert_y, invert_x) - //Restore initialization to the previous value - SSatoms.map_loader_stop() - -//////////////// -//Helpers procs -//////////////// - -//Instance an atom at (x,y,z) and gives it the variables in attributes -/datum/parsed_map/proc/instance_atom(path,list/attributes, turf/crds, no_changeturf, placeOnTop, turn_angle = 0, swap_xy, invert_y, invert_x) - world.preloader_setup(attributes, path, turn_angle, invert_x, invert_y, swap_xy) - - if(crds) - if(ispath(path, /turf)) - if(placeOnTop) - . = crds.PlaceOnTop(null, path, CHANGETURF_DEFER_CHANGE | (no_changeturf ? CHANGETURF_SKIP : NONE)) - else if(!no_changeturf) - . = crds.ChangeTurf(path, null, CHANGETURF_DEFER_CHANGE) - else - . = create_atom(path, crds)//first preloader pass - else - . = create_atom(path, crds)//first preloader pass - - if(GLOB.use_preloader && .)//second preloader pass, for those atoms that don't ..() in New() - world.preloader_load(.) - - //custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize - if(TICK_CHECK) - SSatoms.map_loader_stop() - stoplag() - SSatoms.map_loader_begin() - -/datum/parsed_map/proc/create_atom(path, crds) - set waitfor = FALSE - . = new path (crds) - -//text trimming (both directions) helper proc -//optionally removes quotes before and after the text (for variable name) -/datum/parsed_map/proc/trim_text(what as text,trim_quotes=0) - if(trim_quotes) - return trimQuotesRegex.Replace(what, "") - else - return trimRegex.Replace(what, "") - - -//find the position of the next delimiter,skipping whatever is comprised between opening_escape and closing_escape -//returns 0 if reached the last delimiter -/datum/parsed_map/proc/find_next_delimiter_position(text as text,initial_position as num, delimiter=",",opening_escape="\"",closing_escape="\"") - var/position = initial_position - var/next_delimiter = findtext(text,delimiter,position,0) - var/next_opening = findtext(text,opening_escape,position,0) - - while((next_opening != 0) && (next_opening < next_delimiter)) - position = findtext(text,closing_escape,next_opening + 1,0)+1 - next_delimiter = findtext(text,delimiter,position,0) - next_opening = findtext(text,opening_escape,position,0) - - return next_delimiter - - -//build a list from variables in text form (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) -//return the filled list -/datum/parsed_map/proc/readlist(text as text, delimiter=",") - . = list() - if (!text) - return - - var/position - var/old_position = 1 - - while(position != 0) - // find next delimiter that is not within "..." - position = find_next_delimiter_position(text,old_position,delimiter) - - // check if this is a simple variable (as in list(var1, var2)) or an associative one (as in list(var1="foo",var2=7)) - var/equal_position = findtext(text,"=",old_position, position) - - var/trim_left = trim_text(copytext(text,old_position,(equal_position ? equal_position : position))) - var/left_constant = delimiter == ";" ? trim_left : parse_constant(trim_left) - if(position) - old_position = position + length(text[position]) - - if(equal_position && !isnum(left_constant)) - // Associative var, so do the association. - // Note that numbers cannot be keys - the RHS is dropped if so. - var/trim_right = trim_text(copytext(text, equal_position + length(text[equal_position]), position)) - var/right_constant = parse_constant(trim_right) - .[left_constant] = right_constant - - else // simple var - . += list(left_constant) - -/datum/parsed_map/proc/parse_constant(text) - // number - var/num = text2num(text) - if(isnum(num)) - return num - - // string - if(text[1] == "\"") - return copytext(text, length(text[1]) + 1, findtext(text, "\"", length(text[1]) + 1)) - - // list - if(copytext(text, 1, 6) == "list(")//6 == length("list(") + 1 - return readlist(copytext(text, 6, -1)) - - // typepath - var/path = text2path(text) - if(ispath(path)) - return path - - // file - if(text[1] == "'") - return file(copytext_char(text, 2, -1)) - - // null - if(text == "null") - return null - - // not parsed: - // - pops: /obj{name="foo"} - // - new(), newlist(), icon(), matrix(), sound() - - // fallback: string - return text - -/datum/parsed_map/vv_edit_var(var_name, var_value) - if(var_name == NAMEOF(src, dmmRegex) || var_name == NAMEOF(src, trimQuotesRegex) || var_name == NAMEOF(src, trimRegex)) - return FALSE - return ..() diff --git a/code/modules/mapping/ruins.dm b/code/modules/mapping/ruins_legacy.dm similarity index 90% rename from code/modules/mapping/ruins.dm rename to code/modules/mapping/ruins_legacy.dm index 9daeb2b1e11..5de0be373e7 100644 --- a/code/modules/mapping/ruins.dm +++ b/code/modules/mapping/ruins_legacy.dm @@ -46,18 +46,6 @@ new /obj/landmark/ruin(central_turf, src) return central_turf -/datum/map_template/ruin/proc/place_on_isolated_level(z) - var/datum/turf_reservation/reservation = SSmapping.RequestBlockReservation(width, height, z) //Make the new level creation work with different traits. - if(!reservation) - return - var/turf/placement = locate(reservation.bottom_left_coords[1],reservation.bottom_left_coords[2],reservation.bottom_left_coords[3]) - load(placement) - loaded++ - for(var/turf/T in get_affected_turfs(placement)) - T.flags_1 |= NO_RUINS - var/turf/center = locate(placement.x + round(width/2),placement.y + round(height/2),placement.z) - new /obj/landmark/ruin(center, src) - return center /proc/seedRuins(list/z_levels = null, budget = 0, whitelist = list(/area/space), list/potentialRuins) if(!z_levels || !z_levels.len) diff --git a/code/modules/mapping/shuttle.dm b/code/modules/mapping/shuttle.dm index 23e13e28f0c..1757d4433a8 100644 --- a/code/modules/mapping/shuttle.dm +++ b/code/modules/mapping/shuttle.dm @@ -7,9 +7,9 @@ // if(!name && id) // name = id - if(isnull(mappath)) - mappath = prefix + suffix - ..(path = mappath) + if(isnull(map_path)) + map_path = prefix + suffix + ..(path = map_path) /datum/map_template/shuttle/overmap abstract_type = /datum/map_template/shuttle/overmap diff --git a/code/modules/mapping/space_management/space_level.dm b/code/modules/mapping/space_management/space_level.dm deleted file mode 100644 index cc9c6e11f17..00000000000 --- a/code/modules/mapping/space_management/space_level.dm +++ /dev/null @@ -1,14 +0,0 @@ -/datum/space_level - var/name = "NAME MISSING" - var/list/neigbours = list() - var/list/traits - var/z_value = 1 //actual z placement - var/linkage = SELFLOOPING - var/xi - var/yi //imaginary placements on the grid - -/datum/space_level/New(new_z, new_name, list/new_traits = list()) - z_value = new_z - name = new_name - traits = new_traits - set_linkage(new_traits[ZTRAIT_LINKAGE]) diff --git a/code/modules/mapping/space_management/space_reservation.dm b/code/modules/mapping/space_management/space_reservation.dm deleted file mode 100644 index eb5110c2866..00000000000 --- a/code/modules/mapping/space_management/space_reservation.dm +++ /dev/null @@ -1,89 +0,0 @@ - -//Yes, they can only be rectangular. -//Yes, I'm sorry. -/datum/turf_reservation - var/list/reserved_turfs = list() - var/width = 0 - var/height = 0 - var/bottom_left_coords[3] - var/top_right_coords[3] - var/wipe_reservation_on_release = TRUE - var/turf_type = /turf/space - var/borderturf - -/* -/datum/turf_reservation/transit - turf_type = /turf/space/transit - borderturf = /turf/space/transit/border -*/ - -/datum/turf_reservation/proc/Release() - var/v = reserved_turfs.Copy() - for(var/i in reserved_turfs) - reserved_turfs -= i - SSmapping.used_turfs -= i - SSmapping.reserve_turfs(v) - -/* -/datum/turf_reservation/transit/Release() - for(var/turf/space/transit/T in reserved_turfs) - for(var/atom/movable/AM in T) - T.throw_atom(AM) - . = ..() -*/ - -/datum/turf_reservation/proc/Reserve(width, height, zlevel) - if(width > world.maxx || height > world.maxy || width < 1 || height < 1) - return FALSE - var/list/avail = SSmapping.unused_turfs["[zlevel]"] - var/turf/BL - var/turf/TR - var/list/turf/final = list() - var/passing = FALSE - for(var/i in avail) - CHECK_TICK - BL = i - if(!(BL.turf_flags & UNUSED_RESERVATION_TURF)) - continue - if(BL.x + width > world.maxx || BL.y + height > world.maxy) - continue - TR = locate(BL.x + width - 1, BL.y + height - 1, BL.z) - if(!(TR.turf_flags & UNUSED_RESERVATION_TURF)) - continue - final = block(BL, TR) - if(!final) - continue - passing = TRUE - for(var/I in final) - var/turf/checking = I - if(!(checking.turf_flags & UNUSED_RESERVATION_TURF)) - passing = FALSE - break - if(!passing) - continue - break - if(!passing || !istype(BL) || !istype(TR)) - return FALSE - bottom_left_coords = list(BL.x, BL.y, BL.z) - top_right_coords = list(TR.x, TR.y, TR.z) - for(var/i in final) - var/turf/T = i - reserved_turfs |= T - T.turf_flags &= ~UNUSED_RESERVATION_TURF - SSmapping.unused_turfs["[T.z]"] -= T - SSmapping.used_turfs[T] = src - if(borderturf && (T.x == BL.x || T.x == TR.x || T.y == BL.y || T.y == TR.y)) - T.ChangeTurf(borderturf, borderturf) - else - T.ChangeTurf(turf_type, turf_type) - src.width = width - src.height = height - return TRUE - -/datum/turf_reservation/New() - LAZYADD(SSmapping.turf_reservations, src) - -/datum/turf_reservation/Destroy() - Release() - LAZYREMOVE(SSmapping.turf_reservations, src) - return ..() diff --git a/code/modules/mapping/space_management/space_transition.dm b/code/modules/mapping/space_management/space_transition.dm deleted file mode 100644 index 5b637f21eb5..00000000000 --- a/code/modules/mapping/space_management/space_transition.dm +++ /dev/null @@ -1,145 +0,0 @@ -/datum/space_level/proc/set_linkage(new_linkage) - linkage = new_linkage - if(linkage == SELFLOOPING) - neigbours = list(TEXT_NORTH,TEXT_SOUTH,TEXT_EAST,TEXT_WEST) - for(var/A in neigbours) - neigbours[A] = src - -/* -/datum/space_level/proc/set_neigbours(list/L) - for(var/datum/space_transition_point/P in L) - if(P.x == xi) - if(P.y == yi+1) - neigbours[TEXT_NORTH] = P.spl - P.spl.neigbours[TEXT_SOUTH] = src - else if(P.y == yi-1) - neigbours[TEXT_SOUTH] = P.spl - P.spl.neigbours[TEXT_NORTH] = src - else if(P.y == yi) - if(P.x == xi+1) - neigbours[TEXT_EAST] = P.spl - P.spl.neigbours[TEXT_WEST] = src - else if(P.x == xi-1) - neigbours[TEXT_WEST] = P.spl - P.spl.neigbours[TEXT_EAST] = src - -/datum/space_transition_point //this is explicitly utilitarian datum type made specially for the space map generation and are absolutely unusable for anything else - var/list/neigbours = list() - var/x - var/y - var/datum/space_level/spl - -/datum/space_transition_point/New(nx, ny, list/point_grid) - if(!point_grid) - qdel(src) - return - var/list/L = point_grid[1] - if(nx > point_grid.len || ny > L.len) - qdel(src) - return - x = nx - y = ny - if(point_grid[x][y]) - return - point_grid[x][y] = src - -/datum/space_transition_point/proc/set_neigbours(list/grid) - var/max_X = grid.len - var/list/max_Y = grid[1] - max_Y = max_Y.len - neigbours.Cut() - if(x+1 <= max_X) - neigbours |= grid[x+1][y] - if(x-1 >= 1) - neigbours |= grid[x-1][y] - if(y+1 <= max_Y) - neigbours |= grid[x][y+1] - if(y-1 >= 1) - neigbours |= grid[x][y-1] - -/datum/controller/subsystem/mapping/proc/setup_map_transitions() //listamania - var/list/SLS = list() - var/list/cached_z_list = z_list - var/conf_set_len = 0 - for(var/A in cached_z_list) - var/datum/space_level/D = A - if (D.linkage == CROSSLINKED) - SLS.Add(D) - conf_set_len++ - var/list/point_grid[conf_set_len*2+1][conf_set_len*2+1] - var/list/grid = list() - var/datum/space_transition_point/P - for(var/i = 1, i<=conf_set_len*2+1, i++) - for(var/j = 1, j<=conf_set_len*2+1, j++) - P = new/datum/space_transition_point(i,j, point_grid) - point_grid[i][j] = P - grid.Add(P) - for(var/datum/space_transition_point/pnt in grid) - pnt.set_neigbours(point_grid) - P = point_grid[conf_set_len+1][conf_set_len+1] - var/list/possible_points = list() - var/list/used_points = list() - grid.Cut() - while(SLS.len) - var/datum/space_level/D = pick_n_take(SLS) - D.xi = P.x - D.yi = P.y - P.spl = D - possible_points |= P.neigbours - used_points |= P - possible_points.Remove(used_points) - D.set_neigbours(used_points) - P = pick(possible_points) - CHECK_TICK - - //Lists below are pre-calculated values arranged in the list in such a way to be easily accessable in the loop by the counter - //Its either this or madness with lotsa math - - var/list/x_pos_beginning = list(1, 1, world.maxx - TRANSITIONEDGE, 1) //x values of the lowest-leftest turfs of the respective 4 blocks on each side of zlevel - var/list/y_pos_beginning = list(world.maxy - TRANSITIONEDGE, 1, 1 + TRANSITIONEDGE, 1 + TRANSITIONEDGE) //y values respectively - var/list/x_pos_ending = list(world.maxx, world.maxx, world.maxx, 1 + TRANSITIONEDGE) //x values of the highest-rightest turfs of the respective 4 blocks on each side of zlevel - var/list/y_pos_ending = list(world.maxy, 1 + TRANSITIONEDGE, world.maxy - TRANSITIONEDGE, world.maxy - TRANSITIONEDGE) //y values respectively - var/list/x_pos_transition = list(1, 1, TRANSITIONEDGE + 2, world.maxx - TRANSITIONEDGE - 1) //values of x for the transition from respective blocks on the side of zlevel, 1 is being translated into turfs respective x value later in the code - var/list/y_pos_transition = list(TRANSITIONEDGE + 2, world.maxy - TRANSITIONEDGE - 1, 1, 1) //values of y for the transition from respective blocks on the side of zlevel, 1 is being translated into turfs respective y value later in the code - - for(var/I in cached_z_list) - var/datum/space_level/D = I - if(!D.neigbours.len) - continue - var/zlevelnumber = D.z_value - for(var/side in 1 to 4) - var/turf/beginning = locate(x_pos_beginning[side], y_pos_beginning[side], zlevelnumber) - var/turf/ending = locate(x_pos_ending[side], y_pos_ending[side], zlevelnumber) - var/list/turfblock = block(beginning, ending) - var/dirside = 2**(side-1) - var/zdestination = zlevelnumber - if(D.neigbours["[dirside]"] && D.neigbours["[dirside]"] != D) - D = D.neigbours["[dirside]"] - zdestination = D.z_value - else - dirside = turn(dirside, 180) - while(D.neigbours["[dirside]"] && D.neigbours["[dirside]"] != D) - D = D.neigbours["[dirside]"] - zdestination = D.z_value - D = I - for(var/turf/space/S in turfblock) - S.destination_x = x_pos_transition[side] == 1 ? S.x : x_pos_transition[side] - S.destination_y = y_pos_transition[side] == 1 ? S.y : y_pos_transition[side] - S.destination_z = zdestination - - // Mirage border code - var/mirage_dir - if(S.x == 1 + TRANSITIONEDGE) - mirage_dir |= WEST - else if(S.x == world.maxx - TRANSITIONEDGE) - mirage_dir |= EAST - if(S.y == 1 + TRANSITIONEDGE) - mirage_dir |= SOUTH - else if(S.y == world.maxy - TRANSITIONEDGE) - mirage_dir |= NORTH - if(!mirage_dir) - continue - - var/turf/place = locate(S.destination_x, S.destination_y, S.destination_z) - S.AddComponent(/datum/component/mirage_border, place, mirage_dir) -*/ diff --git a/code/modules/mapping/space_management/traits.dm b/code/modules/mapping/space_management/traits.dm deleted file mode 100644 index 9ba8d96d5e1..00000000000 --- a/code/modules/mapping/space_management/traits.dm +++ /dev/null @@ -1,73 +0,0 @@ -// Look up levels[z].traits[trait] -/datum/controller/subsystem/mapping/proc/level_trait(z, trait) - if (!isnum(z) || z < 1) - return null - if (z_list) - if (z > z_list.len) - stack_trace("Unmanaged z-level [z]! maxz = [world.maxz], z_list.len = [z_list.len]") - return list() - var/datum/space_level/S = get_level(z) - return S.traits[trait] - else - var/list/default = DEFAULT_MAP_TRAITS - if (z > default.len) - stack_trace("Unmanaged z-level [z]! maxz = [world.maxz], default.len = [default.len]") - return list() - return default[z][DL_TRAITS][trait] - -// Check if levels[z] has any of the specified traits -/datum/controller/subsystem/mapping/proc/level_has_any_trait(z, list/traits) - for (var/I in traits) - if (level_trait(z, I)) - return TRUE - return FALSE - -// Check if levels[z] has all of the specified traits -/datum/controller/subsystem/mapping/proc/level_has_all_traits(z, list/traits) - for (var/I in traits) - if (!level_trait(z, I)) - return FALSE - return TRUE - -// Get a list of all z which have the specified trait -/datum/controller/subsystem/mapping/proc/levels_by_trait(trait) - . = list() - var/list/_z_list = z_list - for(var/A in _z_list) - var/datum/space_level/S = A - if (S.traits[trait]) - . += S.z_value - -// Get a list of all z which have any of the specified traits -/datum/controller/subsystem/mapping/proc/levels_by_any_trait(list/traits) - . = list() - var/list/_z_list = z_list - for(var/A in _z_list) - var/datum/space_level/S = A - for (var/trait in traits) - if (S.traits[trait]) - . += S.z_value - break - -// Attempt to get the turf below the provided one according to Z traits -/datum/controller/subsystem/mapping/proc/get_turf_below(turf/T) - if (!T) - return - var/offset = level_trait(T.z, ZTRAIT_DOWN) - if (!offset) - return - return locate(T.x, T.y, T.z + offset) - -// Attempt to get the turf above the provided one according to Z traits -/datum/controller/subsystem/mapping/proc/get_turf_above(turf/T) - if (!T) - return - var/offset = level_trait(T.z, ZTRAIT_UP) - if (!offset) - return - return locate(T.x, T.y, T.z + offset) - -// Prefer not to use this one too often -/datum/controller/subsystem/mapping/proc/get_station_center() - var/station_z = levels_by_trait(ZTRAIT_STATION)[1] - return locate(round(world.maxx * 0.5, 1), round(world.maxy * 0.5, 1), station_z) diff --git a/code/modules/mapping/space_management/zlevel_manager.dm b/code/modules/mapping/space_management/zlevel_manager.dm deleted file mode 100644 index 85184f38bfd..00000000000 --- a/code/modules/mapping/space_management/zlevel_manager.dm +++ /dev/null @@ -1,33 +0,0 @@ -// Populate the space level list and prepare space transitions -/datum/controller/subsystem/mapping/proc/InitializeDefaultZLevels() - if (z_list) // subsystem/Recover or badminnery, no need - return - - z_list = list() - var/list/default_map_traits = DEFAULT_MAP_TRAITS - - if (default_map_traits.len != world.maxz) - WARNING("More or less map attributes pre-defined ([default_map_traits.len]) than existent z-levels ([world.maxz]). Ignoring the larger.") - if (default_map_traits.len > world.maxz) - default_map_traits.Cut(world.maxz + 1) - - for (var/I in 1 to default_map_traits.len) - var/list/features = default_map_traits[I] - var/datum/space_level/S = new(I, features[DL_NAME], features[DL_TRAITS]) - z_list += S - -/datum/controller/subsystem/mapping/proc/add_new_zlevel(name, traits = list(), z_type = /datum/space_level) - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_Z, args) - var/new_z = z_list.len + 1 - if (world.maxz < new_z) - world.increment_max_z() - CHECK_TICK - // TODO: sleep here if the Z level needs to be cleared - var/datum/space_level/S = new z_type(new_z, name, traits) - z_list += S - return S - -/datum/controller/subsystem/mapping/proc/get_level(z) - if (z_list && z >= 1 && z <= z_list.len) - return z_list[z] - CRASH("Unmanaged z-level [z]! maxz = [world.maxz], z_list.len = [z_list ? z_list.len : "null"]") diff --git a/code/modules/mapping/submap.dm b/code/modules/mapping/submap.dm index 3bbfa8becac..ade6dbb3da8 100644 --- a/code/modules/mapping/submap.dm +++ b/code/modules/mapping/submap.dm @@ -7,9 +7,9 @@ // if(!name && id) // name = id - if(isnull(mappath)) - mappath = prefix + suffix - ..(path = mappath) + if(isnull(map_path)) + map_path = prefix + suffix + ..(path = map_path) /datum/map_template/submap/level_specific abstract_type = /datum/map_template/submap/level_specific diff --git a/code/modules/mapping/submaps_legacy.dm b/code/modules/mapping/submaps_legacy.dm new file mode 100644 index 00000000000..e4b1e43cf9f --- /dev/null +++ b/code/modules/mapping/submaps_legacy.dm @@ -0,0 +1,134 @@ + +// Very similar to the /tg/ version. +/proc/seed_submaps(var/list/z_levels, var/budget = 0, var/whitelist = /area/space, var/desired_map_template_type = null) + set background = TRUE + + if(!z_levels || !z_levels.len) + CRASH("seed_submaps() was not given any Z-levels.") + + for(var/zl in z_levels) + var/turf/T = locate(1, 1, zl) + if(!T) + CRASH("Z level [zl] does not exist - Not generating submaps") + log_debug(SPAN_DEBUG("Seeding submaps for levels [english_list(z_levels)] with budget [budget], whitelist [whitelist] and template type [desired_map_template_type]")) + + var/overall_sanity = 100 // If the proc fails to place a submap more than this, the whole thing aborts. + var/list/potential_submaps = list() // Submaps we may or may not place. + var/list/priority_submaps = list() // Submaps that will always be placed. + + // Lets go find some submaps to make. + for(var/map in SSmapping.map_templates) + var/datum/map_template/MT = SSmapping.map_templates[map] + if(!MT.allow_duplicates && MT.loaded > 0) // This probably won't be an issue but we might as well. + continue + if(!istype(MT, desired_map_template_type)) // Not the type wanted. + continue + if(MT.discard_prob && prob(MT.discard_prob)) + continue + if(MT.cost && MT.cost < 0) // Negative costs always get spawned. + priority_submaps += MT + else + potential_submaps += MT + + CHECK_TICK + + var/list/loaded_submap_names = list() + var/list/template_groups_used = list() // Used to avoid spawning three seperate versions of the same PoI. + log_debug(SPAN_DEBUG("[potential_submaps.len] potential with [priority_submaps.len] priority maps. Beginning placement.")) + + // Now lets start choosing some. + while(budget > 0 && overall_sanity > 0) + overall_sanity-- + var/datum/map_template/chosen_template = null + + if(potential_submaps.len) + if(priority_submaps.len) // Do these first. + chosen_template = pick(priority_submaps) + else + chosen_template = pick(potential_submaps) + + else // We're out of submaps. + log_debug(SPAN_DEBUG("Submap loader had no submaps to pick from with [budget] left to spend.")) + break + + CHECK_TICK + + // Can we afford it? + if(chosen_template.cost > budget) + priority_submaps -= chosen_template + potential_submaps -= chosen_template + continue + + // Did we already place down a very similar submap? + if(chosen_template.template_group && (chosen_template.template_group in template_groups_used)) + priority_submaps -= chosen_template + potential_submaps -= chosen_template + continue + + // If so, try to place it. + var/specific_sanity = 100 // A hundred chances to place the chosen submap. + while(specific_sanity > 0) + specific_sanity-- + var/orientation = SOUTH + var/width_border = TRANSITIONEDGE + SUBMAP_MAP_EDGE_PAD + round(((orientation & NORTH|SOUTH) ? chosen_template.width : chosen_template.height) / 2) + var/height_border = TRANSITIONEDGE + SUBMAP_MAP_EDGE_PAD + round(((orientation & NORTH|SOUTH) ? chosen_template.height : chosen_template.width) / 2) + var/z_level = pick(z_levels) + var/turf/T = locate(rand(width_border, world.maxx - width_border), rand(height_border, world.maxy - height_border), z_level) + var/valid = TRUE + + for(var/turf/check in chosen_template.get_affecting_turfs(T,TRUE,orientation)) + var/area/new_area = get_area(check) + if(!(istype(new_area, whitelist))) + valid = FALSE // Probably overlapping something important. + // to_chat(world, "Invalid due to overlapping with area [new_area.type] at ([check.x], [check.y], [check.z]), when attempting to place at ([T.x], [T.y], [T.z]).") + break + CHECK_TICK + + CHECK_TICK + + if(!valid) + continue + + log_debug(SPAN_DEBUG("Submap \"[chosen_template.name]\" placed at ([T.x], [T.y], [T.z])[ADMIN_JMP(T)]")) + + // Do loading here. + chosen_template.load(T, centered = TRUE, orientation=orientation) // This is run before the main map's initialization routine, so that can initilize our submaps for us instead. + + CHECK_TICK + + // For pretty maploading statistics. + if(loaded_submap_names[chosen_template.name]) + loaded_submap_names[chosen_template.name] += 1 + else + loaded_submap_names[chosen_template.name] = 1 + + // To avoid two 'related' similar submaps existing at the same time. + if(chosen_template.template_group) + template_groups_used += chosen_template.template_group + + // To deduct the cost. + if(chosen_template.cost >= 0) + budget -= chosen_template.cost + + // Remove the submap from our options. + if(chosen_template in priority_submaps) // Always remove priority submaps. + priority_submaps -= chosen_template + else if(!chosen_template.allow_duplicates) + potential_submaps -= chosen_template + + break // Load the next submap. + + var/list/pretty_submap_list = list() + for(var/submap_name in loaded_submap_names) + var/count = loaded_submap_names[submap_name] + if(count > 1) + pretty_submap_list += "[count] [submap_name]" + else + pretty_submap_list += "[submap_name]" + + if(!overall_sanity) + log_debug(SPAN_DEBUG("Submap loader gave up with [budget] left to spend.")) + else + log_debug(SPAN_DEBUG("Submaps loaded.")) + log_debug(SPAN_DEBUG("Loaded: [english_list(pretty_submap_list)]")) + diff --git a/code/modules/mapping/turf_reservation.dm b/code/modules/mapping/turf_reservation.dm new file mode 100644 index 00000000000..0e043d4ffd3 --- /dev/null +++ b/code/modules/mapping/turf_reservation.dm @@ -0,0 +1,119 @@ +/** + * reserved turfs as part of reserved zlevels + * + * reserved zlevels are sealed, no-teleport, no-wireless, no-telecomms levels used for internal purposes. + * + * players should not spend too much time in reserved areas, as many things will flat out not work in them for optimization reasons. + * + * maybe someday we'll have a non-3d-prism game engine and we can have something actually reasonable instead of this pile of shit. + */ +/datum/turf_reservation + /// are we allocated? + var/tmp/allocated = FALSE + /// reserved turfs - set when allocated + var/list/turf/reserved_turfs + /// width + var/width = 0 + /// height + var/height = 0 + /// list(x, y, z) - set when allocated + var/bottom_left_coords + /// list(x, y, z) - set when allocated + var/top_right_coords + /// type of our turf - null for default + var/turf_type + /// type of our border - null to default to turf_type + var/border_type + /// type of our area - null for default + var/area_type + +/datum/turf_reservation/New() + if(isnull(turf_type)) + turf_type = RESERVED_TURF_TYPE + if(isnull(area_type)) + area_type = RESERVED_AREA_TYPE + +/datum/turf_reservation/Destroy() + release() + return ..() + +/datum/turf_reservation/proc/release() + SSmapping.reserve_turfs(reserved_turfs) + reserved_turfs = null + allocated = FALSE + SSmapping.reservations -= src + +/datum/turf_reservation/proc/reserve(width, height, z_override) + if(width > world.maxx || height > world.maxy || width < 1 || height < 1) + CRASH("invalid request") + if(!length(SSmapping.reserve_levels)) + CRASH("uh oh") + UNTIL(!SSmapping.reservation_blocking_op) + SSmapping.reservation_blocking_op = TRUE + // pick and take + var/list/possible_levels = SSmapping.reserve_levels.Copy() + var/level_index + var/turf/BL + var/turf/TR + var/list/turf/final + var/area/area_path = area_type + var/area/area_instance = initial(area_path.unique)? (GLOB.areas_by_type[area_path] || new area_path) : new area_path + var/found_a_spot = FALSE + var/how_many_wide = FLOOR(width / RESERVED_TURF_RESOLUTION, 1) + var/how_many_high = FLOOR(height / RESERVED_TURF_RESOLUTION, 1) + var/total_many_wide = FLOOR(world.maxx / RESERVED_TURF_RESOLUTION, 1) + var/total_many_high = FLOOR(world.maxy / RESERVED_TURF_RESOLUTION, 1) + // the dreaded 5 deep for loop + while((level_index = z_override) || (level_index = pick_n_take(possible_levels))) + /** + * here's the magic + * because reservations are aligned to RESERVED_TURF_RESOLUTION, + * we just have to check the start spots, since we always align to them. + * + * bottom-right turfs on reservations align to 0 * RESERVED_TURF_RESOLUTION + 1, 1 * RESERVED_TURF_RESOLUTION + 1, 2 * RESERVED_TURF_RESOLUTION + 1, ... + */ + for(var/outer_x in 1 to (total_many_wide - how_many_wide + 1)) + for(var/outer_y in 1 to (total_many_high - how_many_high + 1)) + var/passing = TRUE + for(var/inner_x in outer_x to outer_x + how_many_wide - 1) + for(var/inner_y in outer_y to outer_y + how_many_high - 1) + var/turf/checking = locate(1 + RESERVED_TURF_RESOLUTION * (inner_x - 1), 1 + RESERVED_TURF_RESOLUTION * (inner_y - 1), level_index) + if(!(checking.turf_flags & UNUSED_RESERVATION_TURF)) + passing = FALSE + break + if(!passing) + break + if(!passing) + continue + BL = locate(1 + RESERVED_TURF_RESOLUTION * (outer_x - 1), 1 + RESERVED_TURF_RESOLUTION * (outer_y - 1), level_index) + TR = locate(BL.x + width - 1, BL.y + height - 1, BL.z) + final = block(BL, TR) + found_a_spot = TRUE + break + if(found_a_spot) + break + if(found_a_spot) + break + // if we were overriding and we didn't, break anyways + if(!isnull(z_override)) + break + if(!found_a_spot) + SSmapping.reservation_blocking_op = FALSE + return FALSE + for(var/turf/T as anything in final) + T.turf_flags &= ~UNUSED_RESERVATION_TURF + if(!isnull(border_type) && (T.type != border_type) && (T.x == BL.x || T.x == TR.x || T.y == BL.y || T.y == TR.y)) + T.ChangeTurf(border_type, border_type) + else if(T.type != turf_type) + T.ChangeTurf(turf_type, turf_type) + // todo: area.assimilate_turfs? + area_instance.contents.Add(final) + src.reserved_turfs = final.Copy() + src.bottom_left_coords = list(BL.x, BL.y, BL.z) + src.top_right_coords = list(TR.x, TR.y, TR.z) + src.width = width + src.height = height + allocated = TRUE + SSmapping.reservation_blocking_op = FALSE + SSmapping.reservations += src + return TRUE diff --git a/code/modules/maps/lateload/generic/_lateload.dm b/code/modules/maps/lateload/generic/_lateload.dm deleted file mode 100644 index 839735a4815..00000000000 --- a/code/modules/maps/lateload/generic/_lateload.dm +++ /dev/null @@ -1,18 +0,0 @@ -/datum/map_template/lateload - allow_duplicates = FALSE - var/associated_map_datum - -/datum/map_template/lateload/on_map_loaded(z) - if(!associated_map_datum || !ispath(associated_map_datum)) - log_game("Extra z-level [src] has no associated map datum") - return - - new associated_map_datum(GLOB.using_map, z) - -/datum/map_z_level/lateload - z = 0 - -/datum/map_z_level/lateload/New(var/datum/map/map, mapZ) - if(mapZ && !z) - z = mapZ - return ..(map) diff --git a/code/modules/maps/lateload/generic/example.dm b/code/modules/maps/lateload/generic/example.dm deleted file mode 100644 index ba19c096734..00000000000 --- a/code/modules/maps/lateload/generic/example.dm +++ /dev/null @@ -1,44 +0,0 @@ -////////////////////////////////////////////// -/// Example Template /// -////////////////////////////////////////////// - -/datum/map_template/lateload/example - name = "Example Planet" - /// ^ The name of your planet. This is what you will need to put in the lateload_z_level list to actually have it be created. - /// If it is not on the list it will not be created, simple as that - - desc = "A completely generic and unassuming planet" - /// ^ The description of the planet. Is only seen by admins if they manually load in a planet, dont be - /// too verbose. For changing what people see in game when they scan it you will need to edit the overmap effect itself - /// (overmap effect as of me writing this are in the overmap folder) - - mappath = "maps/map_levels/192x192/Class_G.dmm" - /// ^ The direct file path for your map. Is case sensitive and you need to use /'s not \'s - /// Make sure your map file is in a sensible location please for organization sake - - associated_map_datum = /datum/map_z_level/example - /// ^ This should point to the datum down below. Is used ingame after the z level is index'd for debugging purposes - - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - /// Z level traits. Controls some behavior of the z level. Check out maps.dm for more information - -/datum/map_z_level/example - name = "Away Mission - Example Planet" - /// Does not have to be the same name as the one you used above. Keep it short and to the point - - base_turf = /turf/space/basic - /// What the base turf of the z level is, aka what is left when something like maxcap bomb goes off. If not defined - /// it will default to /turf/simulated/space - - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - /// Z level flags. Similiar to traits except they control a couple different things. These two are what you are likely going - /// to be using a lot. MAP_LEVEL_CONTACT means you will be able to hear station alerts and such. MAP_LEVEL_PLAYER simply tells - /// the z level that players will likely be on the z level. Check out maps.dm for more information - -/datum/map_template/lateload/example/on_map_loaded(z) - . = ..() - new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z, world.maxx - 4, world.maxy - 4) // Create the mining Z-level. - seed_submaps(list(z), 150, /area/class_d/unexplored, /datum/map_template/submap/level_specific/class_d) - /// Anything you want to have happen when the z level is loaded. In this case cave automata is generating caves in mineral - /// turfs as well as making basic ores. seed_submaps is generating submaps in a specified area from a map_template file. - /// Check the generic/submaps from the main map file section for example submaps diff --git a/code/modules/maps/lateload/generic/gateway_lateload.dm b/code/modules/maps/lateload/generic/gateway_lateload.dm deleted file mode 100644 index 2beaaffe0f6..00000000000 --- a/code/modules/maps/lateload/generic/gateway_lateload.dm +++ /dev/null @@ -1,76 +0,0 @@ -/** - *! Gateway Templates - *? This is for gateway maps. These are unique in that there should only ever be one loaded in if any. As well you can make them - *? overmap accessible or not if you like. - */ - -////////////////////////////// -/// Generic overmap effect /// -////////////////////////////// -/* -Use a subtype of this please if you are wanting to have your gateway map be accessible on the overmap -This overmap effect is a generic one that can be used if you do not have anything special to add to it -*/ -/obj/effect/overmap/visitable/sector/gateway - name = "Unknown" - desc = "Approach and perform a scan to obtain further information." - icon_state = "object" //or "globe" for planetary stuff - known = FALSE - -////////////////////////////// -/// Generic Template Thing /// -////////////////////////////// -/datum/map_template/lateload/gateway - abstract_type = /datum/map_template/lateload/gateway - name = "Gateway Submap" - desc = "Please do not use this." - mappath = null - associated_map_datum = null - -/datum/map_z_level/gateway/gateway_destination - name = "Gateway Destination" - -////////////////////// -/// Snow Outpost /// -////////////////////// -/datum/map_template/lateload/gateway/snow_outpost - name = "Snow Outpost" - desc = "Big snowy area with various outposts." - mappath = 'maps/away_missions/140x140/snow_outpost.dmm' - associated_map_datum = /datum/map_z_level/gateway/gateway_destination - -//////////// -/// Zoo? /// -//////////// -/datum/map_template/lateload/gateway/zoo - name = "Zoo" - desc = "Gigantic space zoo" - mappath = 'maps/away_missions/140x140/zoo.dmm' - associated_map_datum = /datum/map_z_level/gateway/gateway_destination - -/////////////////// -/// Carp Farm /// -/////////////////// -/datum/map_template/lateload/gateway/carpfarm - name = "Carp Farm" - desc = "Asteroid base surrounded by carp" - mappath = 'maps/away_missions/140x140/carpfarm.dmm' - associated_map_datum = /datum/map_z_level/gateway/gateway_destination - -/////////////////// -/// Snow Field /// -/////////////////// -/datum/map_template/lateload/gateway/snowfield - name = "Snow Field" - desc = "An old base in middle of snowy wasteland" - mappath = 'maps/away_missions/140x140/snowfield.dmm' - associated_map_datum = /datum/map_z_level/gateway/gateway_destination - -////////////////////// -/// Listening Post /// -////////////////////// -/datum/map_template/lateload/gateway/listeningpost - name = "Listening Post" - desc = "Asteroid-bound mercenary listening post" - mappath = 'maps/away_missions/140x140/listeningpost.dmm' - associated_map_datum = /datum/map_z_level/gateway/gateway_destination diff --git a/code/modules/maps/lateload/generic/planets_lateload.dm b/code/modules/maps/lateload/generic/planets_lateload.dm deleted file mode 100644 index 78c3c3afe3a..00000000000 --- a/code/modules/maps/lateload/generic/planets_lateload.dm +++ /dev/null @@ -1,193 +0,0 @@ -/** - *! Overmap Planet Templates - *? This is for planets that are accessible from the overmap. - */ - -////////////////////////////////////////////// -/// Class G Mining Planet Exploration Zone /// -////////////////////////////////////////////// - - -/datum/map_template/lateload/planets/away_g_world - name = "ExoPlanet - Z1 Planet" - desc = "A mineral rich planet." - mappath = "maps/map_levels/192x192/Class_G.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_g_world - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_z_level/planets_lateload/away_g_world - name = "Away Mission - Mining Planet" - base_turf = /turf/simulated/mineral/floor/classg - -/datum/map_template/lateload/planets/away_g_world/on_map_loaded(z) - . = ..() - new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z, world.maxx - 4, world.maxy - 4) // Create the mining Z-level. - new /datum/random_map/noise/ore/classg(null, 1, 1, z, 64, 64) // Create the mining ore distribution map. - -///////////////////////////////////////////// -/// Class D Rogue Planet Exploration Zone./// -///////////////////////////////////////////// - -/datum/map_template/lateload/planets/away_d_world - name = "ExoPlanet - Z2 Planet" - desc = "The previously nuked planet Class D away mission" - mappath = "maps/map_levels/192x192/Class_D.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_d_world - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_template/lateload/planets/away_d_world/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 150, /area/class_d/unexplored, /datum/map_template/submap/level_specific/class_d) - - //new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, Z_LEVEL_UNKNOWN_PLANET, world.maxx - 30, world.maxy - 30) - //new /datum/random_map/noise/ore/poi_d(null, 1, 1, Z_LEVEL_UNKNOWN_PLANET, 64, 64) - -/datum/map_z_level/planets_lateload/away_d_world - name = "Away Mission - Rogue Planet" - base_turf = /turf/simulated/mineral/floor/classd - -////////////////////////////////////////////// -/// Class H Desert Planet Exploration Zone./// -////////////////////////////////////////////// - -/datum/map_template/lateload/planets/away_h_world - name = "ExoPlanet - Z3 Planet" - desc = "A random unknown planet." - mappath = "maps/map_levels/192x192/Class_H.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_h_world - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_template/lateload/planets/away_h_world/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 150, /area/class_h/unexplored, /datum/map_template/submap/level_specific/class_h) - - //new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, Z_LEVEL_UNKNOWN_PLANET, world.maxx - 30, world.maxy - 30) - //new /datum/random_map/noise/ore/poi_d(null, 1, 1, Z_LEVEL_UNKNOWN_PLANET, 64, 64) - -/datum/map_z_level/planets_lateload/away_h_world - name = "Away Mission - Desert Planet" - base_turf = /turf/simulated/floor/outdoors/beach/sand/lowdesert - -///////////////////////// -/// Gaia Planet Zone. /// -///////////////////////// - -/datum/map_template/lateload/planets/away_m_world - name = "ExoPlanet - Z4 Planet" - desc = "A lush Gaia Class Planet." - mappath = "maps/map_levels/192x192/Class_M.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_m_world - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_template/lateload/planets/away_m_world/on_map_loaded(z) - . = ..() -// seed_submaps(list(Z_LEVEL_DESERT_PLANET), 150, /area/poi_h/unexplored, /datum/map_template/submap/level_specific/class_h) - - //new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, Z_LEVEL_UNKNOWN_PLANET, world.maxx - 30, world.maxy - 30) - //new /datum/random_map/noise/ore/poi_d(null, 1, 1, Z_LEVEL_UNKNOWN_PLANET, 64, 64) - -/datum/map_z_level/planets_lateload/away_m_world - name = "Away Mission - Gaia Planet" - base_turf = /turf/simulated/floor/outdoors/dirt/classm - -/////////////////////////// -/// Frozen Planet Zone. /// -/////////////////////////// - -/datum/map_template/lateload/planets/away_p_world - name = "ExoPlanet - Z5 Planet" - desc = "A Cold Frozen Planet." - mappath = "maps/map_levels/192x192/Class_P.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_p_world - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_template/lateload/planets/away_p_world/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 125, /area/class_p/ruins, /datum/map_template/submap/level_specific/class_p) - - -/datum/map_z_level/planets_lateload/away_p_world - name = "Away Mission - Frozen Planet" - base_turf = /turf/simulated/floor/outdoors/ice/classp - -///////////////////////////////// -/// Miaphus'irra (Formerly V4) - Beach and caves /// -///////////////////////////////// - -/datum/map_template/lateload/planets/away_beach - name = "Desert Planet - Z1 Beach" - desc = "The beach away mission." - mappath = "maps/map_levels/192x192/miaphus_beach.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_beach - -/datum/map_z_level/planets_lateload/away_beach - name = "Away Mission - Desert Beach" - base_turf = /turf/simulated/floor/outdoors/rocks/caves - -/datum/map_template/lateload/planets/away_beach_cave - name = "Desert Planet - Z2 Cave" - desc = "The beach away mission's cave." - mappath = "maps/map_levels/192x192/miaphus_cave.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_beach_cave - -/datum/map_template/lateload/planets/away_beach_cave/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 225, /area/tether_away/cave/unexplored/normal, /datum/map_template/submap/level_specific/mountains/normal) - //seed_submaps(list(z), 70, /area/tether_away/cave/unexplored/normal, /datum/map_template/submap/level_specific/mountains/deep) - - // Now for the tunnels. - new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z, world.maxx - 4, world.maxy - 4) - new /datum/random_map/noise/ore/beachmine(null, 1, 1, z, 64, 64) - -/datum/map_z_level/planets_lateload/away_beach_cave - name = "Away Mission - Desert Cave" - base_turf = /turf/simulated/floor/outdoors/rocks/caves - -/datum/map_template/lateload/planets/away_desert - name = "Desert Planet - Z3 Desert" - desc = "The inland desert of V-4." - mappath = "maps/map_levels/192x192/miaphus_desert.dmm" - associated_map_datum = /datum/map_template/submap/level_specific/class_h - -/datum/map_template/lateload/planets/away_desert/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 225, /area/tether_away/beach/desert/unexplored, /datum/map_template/submap/level_specific/class_h) - -/datum/map_z_level/planets_lateload/away_desert - name = "Away Mission - Desert" - base_turf = /turf/simulated/floor/outdoors/beach/sand/lowdesert - - -/obj/effect/step_trigger/zlevel_fall/beach - var/static/target_z - -/////////////// -/// Virgo 2 /// -/////////////// - -/datum/map_template/lateload/planets/away_aerostat - name = "Remmi Aerostat - Z1 Aerostat" - desc = "The Virgo 2 Aerostat away mission." - mappath = "maps/map_levels/140x140/virgo2_aerostat.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_aerostat - -/datum/map_z_level/planets_lateload/away_aerostat - name = "Away Mission - Aerostat" - base_turf = /turf/simulated/floor/sky/virgo2_sky - -/datum/map_template/lateload/planets/away_aerostat_surface - name = "Remmi Aerostat - Z2 Surface" - desc = "The surface from the Virgo 2 Aerostat." - mappath = "maps/map_levels/140x140/virgo2_surface.dmm" - associated_map_datum = /datum/map_z_level/planets_lateload/away_aerostat_surface - -/datum/map_template/lateload/planets/away_aerostat_surface/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 150, /area/tether_away/aerostat/surface/unexplored, /datum/map_template/submap/level_specific/virgo2) - new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z, world.maxx - 4, world.maxy - 4) - new /datum/random_map/noise/ore/virgo2(null, 1, 1, z, 64, 64) - -/datum/map_z_level/planets_lateload/away_aerostat_surface - name = "Away Mission - Aerostat Surface" - base_turf = /turf/simulated/mineral/floor/ignore_mapgen/virgo2 - diff --git a/code/modules/maps/lateload/generic/space_lateload.dm b/code/modules/maps/lateload/generic/space_lateload.dm deleted file mode 100644 index 9b8dae68714..00000000000 --- a/code/modules/maps/lateload/generic/space_lateload.dm +++ /dev/null @@ -1,178 +0,0 @@ -/** - *! Overmap Space Templates - *? This is for objects in space that are accessible from the overmap. - */ - -////////////////// -/// Tradeport /// -////////////////// - -/datum/map_template/lateload/space/away_tradeport - name = "Away Mission - Trade Port" - desc = "A space gas station! Stretch your legs!" - mappath = "maps/map_levels/192x192/tradeport.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/away_tradeport - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = FALSE) - -/datum/map_z_level/space_lateload/away_tradeport - name = "Away Mission - Trade Port" - base_turf = /turf/space - -////////////////// -///Debris Field/// -////////////////// - -/datum/map_template/lateload/space/away_debrisfield - name = "Debris Field - Z1 Space" - desc = "A random debris field out in space." - mappath = "maps/map_levels/192x192/debrisfield.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/away_debrisfield - - -/datum/map_template/lateload/space/away_debrisfield/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 200, /area/space/debrisfield/unexplored, /datum/map_template/submap/level_specific/debrisfield) - -/datum/map_z_level/space_lateload/away_debrisfield - name = "Away Mission - Debris Field" - base_turf = /turf/space - -/////////////////////// -/// Pirate Base /// -/////////////////////// - -/datum/map_template/lateload/space/away_piratebase - name = "Away Mission - Pirate Base" - desc = "A Pirate Base, oh no!" - mappath = "maps/map_levels/192x192/piratebase.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/away_piratebase - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = FALSE) - -/datum/map_z_level/space_lateload/away_piratebase - name = "Away Mission - Pirate Base" - base_turf = /turf/space - - -////////////////////////// -// Fuel Depot /// -////////////////////////// - - -/datum/map_template/lateload/space/away_fueldepot - name = "Fuel Depot - Z1 Space" - desc = "An unmanned fuel depot floating in space." - mappath = 'maps/map_levels/140x140/fueldepot.dmm' - associated_map_datum = /datum/map_z_level/space_lateload/away_fueldepot - -/datum/map_z_level/space_lateload/away_fueldepot - name = "Away Mission - Fuel Depot" - -////////////////////////// -//Asteroid belter stuff/// -////////////////////////// - -/datum/map_template/lateload/space/roguemines1 - name = "Asteroid Belt 1" - desc = "Mining, but rogue. Zone 1" - mappath = "maps/map_levels/192x192/roguemining_192x192/rogue_mine1.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/roguemines1 - -/datum/map_z_level/space_lateload/roguemines1 - name = "Belt 1" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - -/datum/map_template/lateload/space/roguemines2 - name = "Asteroid Belt 2" - desc = "Mining, but rogue. Zone 2" - mappath = "maps/map_levels/192x192/roguemining_192x192/rogue_mine2.dmm" - - associated_map_datum = /datum/map_z_level/space_lateload/roguemines2 - -/datum/map_z_level/space_lateload/roguemines2 - name = "Belt 2" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - -/datum/map_template/lateload/space/roguemines3 - name = "Asteroid Belt 3" - desc = "Mining, but rogue. Zone 3" - mappath = "maps/map_levels/192x192/roguemining_192x192/rogue_mine3.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/roguemines3 - -/datum/map_z_level/space_lateload/roguemines3 - name = "Belt 3" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - - -/datum/map_template/lateload/space/roguemines4 - name = "Asteroid Belt 4" - desc = "Mining, but rogue. Zone 4" - mappath = "maps/map_levels/192x192/roguemining_192x192/rogue_mine4.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/roguemines1 - -/datum/map_z_level/space_lateload/roguemines4 - name = "Belt 4" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - -////////////////////////// -// Alien Ship /// -////////////////////////// - -/datum/map_template/lateload/space/away_alienship - name = "Alien Ship - Z1 Ship" - desc = "The alien ship away mission." - mappath = "maps/map_levels/140x140/alienship.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/away_alienship - -/datum/map_z_level/space_lateload/away_alienship - name = "Away Mission - Alien Ship" - - - -////////////////////////// -/// Talon Ship /// -////////////////////////// -/* -Not sure if this will work properly but no reason to get rid of it right now -*/ -/datum/map_template/lateload/space/offmap/talon1 - name = "Offmap Ship - Talon Z1" - desc = "Offmap spawn ship, the Talon." - mappath = "maps/map_levels/140x140/talon/talon1.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/talon1 - -/datum/map_template/lateload/space/offmap/talon2 - name = "Offmap Ship - Talon Z2" - desc = "Offmap spawn ship, the Talon." - mappath = "maps/map_levels/140x140/talon/talon2.dmm" - associated_map_datum = /datum/map_z_level/space_lateload/talon2 - -/datum/map_z_level/space_lateload/talon1 - name = "Talon Deck One" - flags = MAP_LEVEL_PLAYER - base_turf = /turf/space - -/datum/map_z_level/space_lateload/talon2 - name = "Talon Deck Two" - flags = MAP_LEVEL_PLAYER - base_turf = /turf/simulated/open - -/* -//This one might be unnecessary. Commenting out for now, just in case we use it later. -//////////////////////////// -/// Specialty Facilities /// -//////////////////////////// -/* -To try and make the ERT shuttle work, and also to do stuff like custom off-site facilities and all that, I guess we need this now. -*/ - -/datum/map_template/lateload/space/specialty - name = "Away Mission - Specialty" - desc = "An emergency response cruiser patrolling the local sector." - mappath = 'maps/map_levels/192x192/specialty_facilities.dmm' - associated_map_datum = /datum/map_z_level/space_lateload/specialty - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = FALSE) - -/datum/map_z_level/space_lateload/specialty - name = "Away Mission - Specialty" - base_turf = /turf/space -*/ diff --git a/code/modules/maps/lateload/generic/unique_lateload.dm b/code/modules/maps/lateload/generic/unique_lateload.dm deleted file mode 100644 index aba909f25c2..00000000000 --- a/code/modules/maps/lateload/generic/unique_lateload.dm +++ /dev/null @@ -1,74 +0,0 @@ -/** - *! Unique Map Templates - *? This is for maps that are not overmap accessible but are also not gateway maps. There shouldn't be much of these right now - *? unless a large shift in design philosophy occurs - */ - -//////////////////////////////////////////////////////// -/// Lava Land - Otherwise known as Surt or something /// -//////////////////////////////////////////////////////// - -/datum/map_template/lateload/unique/lavaland - name = "Away Mission - Lava Land" - desc = "The fabled." - mappath = "maps/map_levels/192x192/lavaland.dmm" - associated_map_datum = /datum/map_z_level/unique_lateload/lavaland - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_z_level/unique_lateload/lavaland - name = "Away Mission - Lava Land" - base_turf = /turf/simulated/mineral/floor/lavaland - -/datum/map_template/lateload/unique/lavaland/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 40, /area/lavaland/central/unexplored, /datum/map_template/submap/level_specific/lavaland) - new /datum/random_map/noise/ore/lavaland(null, 1, 1, z, 64, 64) // Create the mining ore distribution map. - new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z, world.maxx - 4, world.maxy - 4) // Create the lavaland Z-level. - -/* - -//////////////////////////////////////////////////////// -/// Lava Land - Event Dungeon /// -//////////////////////////////////////////////////////// - -// This one is not permanent. Comment this out once it's done. -/datum/map_template/lateload/unique/lavaland_dungeon - name = "Away Mission - Lava Land (Dungeon)" - desc = "The flooded." - mappath = "maps/map_levels/192x192/lavaland_dungeon.dmm" - associated_map_datum = /datum/map_z_level/unique_lateload/lavaland_dungeon - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_z_level/unique_lateload/lavaland_dungeon - name = "Away Mission - Lava Land (Dungeon)" - -/datum/map_template/lateload/unique/lavaland_dungeon/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 0, /area/lavaland/east/unexplored, /datum/map_template/submap/level_specific/lavaland) - new /datum/random_map/noise/ore/lavaland(null, 1, 1, z, 64, 64) - new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z, world.maxx - 4, world.maxy - 4) -*/ - -//////////////////////////////////////////////////////// -/// Lava Land - East /// -//////////////////////////////////////////////////////// - -/datum/map_template/lateload/unique/lavaland_east - name = "Away Mission - Lava Land (East)" - desc = "The forgotten." - mappath = "maps/map_levels/192x192/lavaland_east.dmm" - associated_map_datum = /datum/map_z_level/unique_lateload/lavaland_east - ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_GRAVITY = TRUE) - -/datum/map_z_level/unique_lateload/lavaland_east - name = "Away Mission - Lava Land (East)" - base_turf = /turf/simulated/mineral/floor/lavaland - -/datum/map_template/lateload/unique/lavaland_east/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 0, /area/lavaland/east/unexplored, /datum/map_template/submap/level_specific/lavaland) - new /datum/random_map/noise/ore/lavaland(null, 1, 1, z, 64, 64) - new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z, world.maxx - 4, world.maxy - 4) - -/obj/landmark/map_data/lavaland_east - height = 1 diff --git a/code/modules/maps/lateload/station_specific/_rift_lateload.dm b/code/modules/maps/lateload/station_specific/_rift_lateload.dm deleted file mode 100644 index 496ff1d22e4..00000000000 --- a/code/modules/maps/lateload/station_specific/_rift_lateload.dm +++ /dev/null @@ -1,23 +0,0 @@ -/datum/map_template/lateload/rift - allow_duplicates = FALSE - var/associated_map_datum - -/datum/map_template/lateload/rift/on_map_loaded(z) - if(!associated_map_datum || !ispath(associated_map_datum)) - log_game("Extra z-level [src] has no associated map datum") - return - - new associated_map_datum(GLOB.using_map, z) - -/datum/map_z_level/rift_lateload - z = 0 - flags = MAP_LEVEL_SEALED - -/datum/map_z_level/rift_lateload/New(var/datum/map/map, mapZ) - if(mapZ && !z) - z = mapZ - return ..(map) - - - - diff --git a/code/modules/maps/lateload/station_specific/_tether_lateload.dm b/code/modules/maps/lateload/station_specific/_tether_lateload.dm deleted file mode 100644 index 04487944ec0..00000000000 --- a/code/modules/maps/lateload/station_specific/_tether_lateload.dm +++ /dev/null @@ -1,45 +0,0 @@ -/datum/map_template/lateload/tether/tether_misc - name = "Tether - Misc" - desc = "Misc areas, like some transit areas, holodecks, merc area." - mappath = "maps/map_files/tether/tether_misc.dmm" - - associated_map_datum = /datum/map_z_level/tether_lateload/misc - -/datum/map_z_level/tether_lateload/misc - name = "Misc" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_SEALED|MAP_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT - -/datum/map_template/lateload/tether/tether_underdark - name = "Tether - Underdark" - desc = "Mining, but harder." - mappath = "maps/map_files/tether/tether_underdark.dmm" - - associated_map_datum = /datum/map_z_level/tether_lateload/underdark - -/datum/map_z_level/tether_lateload/underdark - name = "Underdark" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_SEALED - base_turf = /turf/simulated/mineral/floor/virgo3b - -/datum/map_template/lateload/tether/tether_underdark/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 150, /area/mine/unexplored/underdark, /datum/map_template/submap/level_specific/underdark) - new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z, world.maxx - 4, world.maxy - 4) // Create the mining Z-level. - new /datum/random_map/noise/ore(null, 1, 1, z, 64, 64) // Create the mining ore distribution map. - -/datum/map_template/lateload/tether/tether_plains - name = "Tether - Plains" - desc = "The Virgo 3B away mission." - mappath = "maps/map_files/tether/tether_plains.dmm" - associated_map_datum = /datum/map_z_level/tether_lateload/tether_plains - -/datum/map_z_level/tether_lateload/tether_plains - name = "Away Mission - Plains" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_SEALED - base_turf = /turf/simulated/mineral/floor/virgo3b - -/datum/map_template/lateload/tether/tether_plains/on_map_loaded(z) - . = ..() - seed_submaps(list(z), 150, /area/tether/outpost/exploration_plains, /datum/map_template/submap/level_specific/plains) - - diff --git a/code/modules/maps/lateload/station_specific/_triumph_submaps.dm b/code/modules/maps/lateload/station_specific/_triumph_submaps.dm deleted file mode 100644 index 52d7e4588a5..00000000000 --- a/code/modules/maps/lateload/station_specific/_triumph_submaps.dm +++ /dev/null @@ -1,25 +0,0 @@ -/datum/map_template/lateload/triumph/triumph_misc - name = "Triumph - Misc" - desc = "Misc areas, like some transit areas, holodecks, merc area." - mappath = "maps/map_files/triumph/triumph_misc.dmm" - - associated_map_datum = /datum/map_z_level/triumph_lateload/ships - - ztraits = list() - -/datum/map_z_level/triumph_lateload/misc - name = "Misc" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_SEALED - -/datum/map_template/lateload/triumph/triumph_ships - name = "Triumph - Ships" - desc = "Ship transit map and whatnot." - mappath = "maps/map_files/triumph/triumph_ships.dmm" - - associated_map_datum = /datum/map_z_level/triumph_lateload/ships - - ztraits = list() - -/datum/map_z_level/triumph_lateload/ships - name = "Ships" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_SEALED diff --git a/code/modules/maps/overmap/planets/_lythios43c.dm b/code/modules/maps/overmap/planets/_lythios43c.dm index 79a44c0ea17..4024f9412a1 100644 --- a/code/modules/maps/overmap/planets/_lythios43c.dm +++ b/code/modules/maps/overmap/planets/_lythios43c.dm @@ -65,8 +65,8 @@ var/obj/effect/overmap/visitable/ship/landable/SL = AM //Phew var/datum/shuttle/autodock/multi/shuttle = SSshuttle.shuttles[SL.shuttle] if(!istype(shuttle) || !shuttle.cloaked) //Not a multishuttle (the only kind that can cloak) or not cloaked - GLOB.lore_atc.msg(message) + SSlegacy_atc.msg(message) //For ships, it's safe to assume they're big enough to not be sneaky else if(istype(AM, /obj/effect/overmap/visitable/ship)) - GLOB.lore_atc.msg(message) + SSlegacy_atc.msg(message) diff --git a/code/modules/maps/overmap/space/debrisfield.dm b/code/modules/maps/overmap/space/debrisfield.dm index b26f2707e79..21ecf930925 100644 --- a/code/modules/maps/overmap/space/debrisfield.dm +++ b/code/modules/maps/overmap/space/debrisfield.dm @@ -179,7 +179,7 @@ /obj/effect/overmap/visitable/ship/landable/tinycarrier/Initialize(mapload) . = ..() - var/datum/lore/organization/O = GLOB.loremaster.organizations[/datum/lore/organization/other/sysdef] + var/datum/lore/organization/O = SSlegacy_lore.organizations[/datum/lore/organization/other/sysdef] var/newname = "SDV [pick(O.ship_names)]" scanner_name = newname scanner_desc = {"\[i\]Registration\[/i\]: [newname] diff --git a/code/modules/maps/overmap/space/talon/talon.dm b/code/modules/maps/overmap/space/talon/talon.dm index 72e3ba8d04c..0d5d68fa166 100644 --- a/code/modules/maps/overmap/space/talon/talon.dm +++ b/code/modules/maps/overmap/space/talon/talon.dm @@ -494,24 +494,24 @@ Once in open space, consider disabling nonessential power-consuming electronics /datum/map_template/triumph_lateload/offmap/talon1 name = "Offmap Ship - Talon Z1" desc = "Offmap spawn ship, the Talon." - mappath = "maps/map_levels/140x140/talon/talon1.dmm" - associated_map_datum = /datum/map_z_level/triumph_lateload/talon1 + map_path = "maps/map_levels/140x140/talon/talon1.dmm" + associated_map_datum = /datum/map_level/triumph_lateload/talon1 /datum/map_template/triumph_lateload/offmap/talon2 name = "Offmap Ship - Talon Z2" desc = "Offmap spawn ship, the Talon." - mappath = "maps/map_levels/140x140/talon/talon2.dmm" - associated_map_datum = /datum/map_z_level/triumph_lateload/talon2 + map_path = "maps/map_levels/140x140/talon/talon2.dmm" + associated_map_datum = /datum/map_level/triumph_lateload/talon2 -/datum/map_z_level/triumph_lateload/talon1 +/datum/map_level/triumph_lateload/talon1 name = "Talon Deck One" - flags = MAP_LEVEL_PLAYER + flags = LEGACY_LEVEL_PLAYER base_turf = /turf/space z = Z_LEVEL_TALON1 -/datum/map_z_level/triumph_lateload/talon2 +/datum/map_level/triumph_lateload/talon2 name = "Talon Deck Two" - flags = MAP_LEVEL_PLAYER + flags = LEGACY_LEVEL_PLAYER base_turf = /turf/simulated/open z = Z_LEVEL_TALON2 */ diff --git a/code/modules/maps/templates/badmin_misc/templates.dm b/code/modules/maps/templates/badmin_misc/templates.dm index 6a57f632478..533bc27c4d7 100644 --- a/code/modules/maps/templates/badmin_misc/templates.dm +++ b/code/modules/maps/templates/badmin_misc/templates.dm @@ -3,64 +3,64 @@ /datum/map_template/admin_use/ert name = "Special Area - ERT" desc = "It's the ERT ship! Lorge." - mappath = 'maps/templates/admin/ert.dmm' + map_path = 'maps/templates/admin/ert.dmm' /datum/map_template/admin_use/trader name = "Special Area - Trader" desc = "Big trader ship." - mappath = 'maps/templates/archive/tradeship.dmm' //Simply change this to a new path if this is updated + map_path = 'maps/templates/archive/tradeship.dmm' //Simply change this to a new path if this is updated /datum/map_template/admin_use/salamander_trader name = "Special Area - Salamander Trader" desc = "Modest trader ship." - mappath = "maps/templates/shuttles/overmaps/generic/salamander.dmm" + map_path = "maps/templates/shuttles/overmaps/generic/salamander.dmm" /datum/map_template/admin_use/mercenary name = "Special Area - Merc Ship" desc = "Prepare tae be boarded, arr!" - mappath = 'maps/templates/admin/kk_mercship.dmm' + map_path = 'maps/templates/admin/kk_mercship.dmm' /datum/map_template/admin_use/old_mercenary name = "Special Area - Old Merc Base" desc = "So much red!" - mappath = 'maps/templates/admin/mercbase.dmm' + map_path = 'maps/templates/admin/mercbase.dmm' /datum/map_template/admin_use/skipjack name = "Special Area - Skipjack Base" desc = "Stinky!" - mappath = 'maps/templates/admin/skipjack.dmm' + map_path = 'maps/templates/admin/skipjack.dmm' /datum/map_template/admin_use/thunderdome name = "Special Area - Thunderdome" desc = "Thunderrrrdomeee" - mappath = 'maps/templates/admin/thunderdome.dmm' + map_path = 'maps/templates/admin/thunderdome.dmm' /datum/map_template/admin_use/wizardbase name = "Special Area - Wizard Base" desc = "Wingardium Levosia" - mappath = 'maps/templates/admin/wizard.dmm' + map_path = 'maps/templates/admin/wizard.dmm' /datum/map_template/admin_use/dojo name = "Special Area - Ninja Dojo" desc = "Sneaky" - mappath = 'maps/templates/admin/dojo.dmm' + map_path = 'maps/templates/admin/dojo.dmm' /datum/map_template/admin_use/fun/spa name = "Space Spa" desc = "A pleasant spa located in a spaceship." - mappath = 'maps/templates/admin/spa.dmm' + map_path = 'maps/templates/admin/spa.dmm' /datum/map_template/admin_use/killhouseteleporter name = "Special Area - killhouse teleporter" desc = "The teleporter leading to security training routines." - mappath = 'maps/templates/admin/killhouseteleporter.dmm' + map_path = 'maps/templates/admin/killhouseteleporter.dmm' /datum/map_template/admin_use/killhouseone name = "Special Area - killhouse one" desc = "For security training routines." - mappath = 'maps/templates/admin/killhouse1.dmm' + map_path = 'maps/templates/admin/killhouse1.dmm' /datum/map_template/admin_use/killhousetwo name = "Special Area - killhouse two" desc = "For security training routines." - mappath = 'maps/templates/admin/killhouse2.dmm' + map_path = 'maps/templates/admin/killhouse2.dmm' diff --git a/code/modules/maps/templates/shuttles/admin_spawn/ert.dm b/code/modules/maps/templates/shuttles/admin_spawn/ert.dm index dfc6e875099..4a6e38e6fd3 100644 --- a/code/modules/maps/templates/shuttles/admin_spawn/ert.dm +++ b/code/modules/maps/templates/shuttles/admin_spawn/ert.dm @@ -4,7 +4,7 @@ /datum/map_template/shuttle/overmap/generic/ert_ship name = "OM Ship - ERT Ship (New Z)" desc = "NT Emergency Response Ship." - mappath = "maps/templates/admin/ert.dmm" + map_path = "maps/templates/admin/ert.dmm" // The ship's area(s) /area/ship/ert diff --git a/code/modules/maps/templates/shuttles/admin_spawn/geckos.dm b/code/modules/maps/templates/shuttles/admin_spawn/geckos.dm index 3f024c74643..3b81490563e 100644 --- a/code/modules/maps/templates/shuttles/admin_spawn/geckos.dm +++ b/code/modules/maps/templates/shuttles/admin_spawn/geckos.dm @@ -15,7 +15,7 @@ /datum/map_template/shuttle/overmap/generic/gecko_cargohauler_wreck name = "OM Ship - Wrecked Gecko Cargo Hauler (new Z)" desc = "A wrecked medium supply transport shuttle." - mappath = "maps/submaps/level_specific/debrisfield_vr/gecko_cr_wreck.dmm" + map_path = "maps/submaps/level_specific/debrisfield_vr/gecko_cr_wreck.dmm" annihilate = TRUE // The shuttle's area(s) diff --git a/code/modules/maps/templates/shuttles/admin_spawn/mackerels.dm b/code/modules/maps/templates/shuttles/admin_spawn/mackerels.dm index 7970a2c0fed..ceec87de2dc 100644 --- a/code/modules/maps/templates/shuttles/admin_spawn/mackerels.dm +++ b/code/modules/maps/templates/shuttles/admin_spawn/mackerels.dm @@ -28,7 +28,7 @@ /datum/map_template/shuttle/overmap/generic/mackerel_lightcargo_wreck name = "OM Ship - Mackerel Light Cargo Wreck (new Z)" desc = "A small light cargo transport shuttle, struck by... something. Ouch." - mappath = "maps/submaps/level_specific/debrisfield_vr/mackerel_lc_wreck.dmm" + map_path = "maps/submaps/level_specific/debrisfield_vr/mackerel_lc_wreck.dmm" annihilate = TRUE // The shuttle's area(s) diff --git a/code/modules/maps/templates/shuttles/admin_spawn/manta_mercship.dm b/code/modules/maps/templates/shuttles/admin_spawn/manta_mercship.dm index 05a42332e58..ce72b5da52b 100644 --- a/code/modules/maps/templates/shuttles/admin_spawn/manta_mercship.dm +++ b/code/modules/maps/templates/shuttles/admin_spawn/manta_mercship.dm @@ -4,7 +4,7 @@ /datum/map_template/shuttle/overmap/generic/manta_ship name = "OM Ship - Mercenary Cruiser Manta Class (New Z)" desc = "Mercenary Manta Cruiser." - mappath = "maps/templates/admin/kk_mercship.dmm" + map_path = "maps/templates/admin/kk_mercship.dmm" // The ship's area(s) /area/ship/manta diff --git a/code/modules/maps/templates/shuttles/admin_spawn/salamander.dm b/code/modules/maps/templates/shuttles/admin_spawn/salamander.dm index a12fd2a3c58..39019b51739 100644 --- a/code/modules/maps/templates/shuttles/admin_spawn/salamander.dm +++ b/code/modules/maps/templates/shuttles/admin_spawn/salamander.dm @@ -11,7 +11,7 @@ /datum/map_template/shuttle/overmap/generic/salamander_wreck name = "OM Ship - Salamander Corvette Wreckage" desc = "A medium multirole spacecraft, or at least what's left of it." - mappath = "maps/submaps/level_specific/debrisfield_vr/salamander_wreck.dmm" + map_path = "maps/submaps/level_specific/debrisfield_vr/salamander_wreck.dmm" annihilate = TRUE // The shuttle's area(s) diff --git a/code/modules/maps/templates/submaps/debrisfield/debrisfield_submaptemplate.dm b/code/modules/maps/templates/submaps/debrisfield/debrisfield_submaptemplate.dm index 839154cd56b..5c84ead14a4 100644 --- a/code/modules/maps/templates/submaps/debrisfield/debrisfield_submaptemplate.dm +++ b/code/modules/maps/templates/submaps/debrisfield/debrisfield_submaptemplate.dm @@ -262,14 +262,14 @@ /datum/map_template/submap/level_specific/debrisfield_vr/gutted_mackerel name = "Gutted Mackerel LC" - mappath = "maps/offmap_vr/om_ships/mackerel_lc_wreck.dmm" + map_path = "maps/offmap_vr/om_ships/mackerel_lc_wreck.dmm" cost = 35 allow_duplicates = FALSE discard_prob = 25 /datum/map_template/submap/level_specific/debrisfield_vr/wrecked_salamander name = "Wrecked Salamander" - mappath = "maps/offmap_vr/om_ships/salamander_wreck.dmm" + map_path = "maps/offmap_vr/om_ships/salamander_wreck.dmm" cost = 35 allow_duplicates = FALSE discard_prob = 34 diff --git a/code/modules/maps/templates/submaps/virgo3b/plains.dm b/code/modules/maps/templates/submaps/virgo3b/plains.dm index 371c9df545a..65c1a3f8602 100644 --- a/code/modules/maps/templates/submaps/virgo3b/plains.dm +++ b/code/modules/maps/templates/submaps/virgo3b/plains.dm @@ -58,7 +58,7 @@ /datum/map_template/submap/level_specific/plains/normal/Rocky2 name = "Rocky2" desc = "More rocks." - mappath = "maps/submaps/surface_submaps/wilderness/Rocky2.dmm" + map_path = "maps/submaps/surface_submaps/wilderness/Rocky2.dmm" allow_duplicates = TRUE cost = 5 diff --git a/code/modules/maps/templates/submaps/wilderness/wilderness.dm b/code/modules/maps/templates/submaps/wilderness/wilderness.dm index f53bbda2a81..7a24ea31725 100644 --- a/code/modules/maps/templates/submaps/wilderness/wilderness.dm +++ b/code/modules/maps/templates/submaps/wilderness/wilderness.dm @@ -24,214 +24,214 @@ /datum/map_template/submap/level_specific/wilderness/normal/spider1 name = "Spider Nest 1" desc = "A small spider nest, in the forest." - mappath = "spider1.dmm" + map_path = "spider1.dmm" allow_duplicates = TRUE cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Flake name = "Forest Lake" desc = "A serene lake sitting amidst the surface." - mappath = "Flake.dmm" + map_path = "Flake.dmm" cost = 10 /datum/map_template/submap/level_specific/wilderness/normal/Mcamp1 name = "Military Camp 1" desc = "A derelict military camp host to some unsavory dangers" - mappath = "MCamp1.dmm" + map_path = "MCamp1.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Mudpit name = "Mudpit" desc = "What happens when someone is a bit too careless with gas.." - mappath = "Mudpit.dmm" + map_path = "Mudpit.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Rocky1 name = "Rocky1" desc = "DununanununanununuNAnana" - mappath = "Rocky1.dmm" + map_path = "Rocky1.dmm" allow_duplicates = TRUE cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Rocky2 name = "Rocky2" desc = "More rocks." - mappath = "Rocky2.dmm" + map_path = "Rocky2.dmm" allow_duplicates = TRUE cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Rocky3 name = "Rocky3" desc = "More and more and more rocks." - mappath = "Rocky3.dmm" + map_path = "Rocky3.dmm" desc = "DununanununanununuNAnana" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Shack1 name = "Shack1" desc = "A small shack in the middle of nowhere, Your halloween murder happens here" - mappath = "Shack1.dmm" + map_path = "Shack1.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Smol1 name = "Smol1" desc = "A tiny grove of trees, The Nemesis of thicc" - mappath = "Smol1.dmm" + map_path = "Smol1.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Snowrock1 name = "Snowrock1" desc = "A rocky snow covered area" - mappath = "Snowrock1.dmm" + map_path = "Snowrock1.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Cragzone1 name = "Cragzone1" desc = "Rocks and more rocks." - mappath = "Cragzone1.dmm" + map_path = "Cragzone1.dmm" cost = 5 allow_duplicates = TRUE /datum/map_template/submap/level_specific/wilderness/normal/Lab1 name = "Lab1" desc = "An isolated small robotics lab." - mappath = "Lab1.dmm" + map_path = "Lab1.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Rocky4 name = "Rocky4" desc = "An interesting geographic formation." - mappath = "Rocky4.dmm" + map_path = "Rocky4.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/deep/DJOutpost1 name = "DJOutpost1" desc = "Home of Sif Free Radio, the best - and only - radio station for miles around." - mappath = "DJOutpost1.dmm" + map_path = "DJOutpost1.dmm" template_group = "Sif Free Radio" cost = 5 /datum/map_template/submap/level_specific/wilderness/deep/DJOutpost2 name = "DJOutpost2" desc = "The cratered remains of Sif Free Radio, the best - and only - radio station for miles around." - mappath = "DJOutpost2.dmm" + map_path = "DJOutpost2.dmm" template_group = "Sif Free Radio" cost = 5 /datum/map_template/submap/level_specific/wilderness/deep/DJOutpost3 name = "DJOutpost3" desc = "The surprisingly high-tech home of Sif Free Radio, the best - and only - radio station for miles around." - mappath = "DJOutpost3.dmm" + map_path = "DJOutpost3.dmm" template_group = "Sif Free Radio" cost = 10 /datum/map_template/submap/level_specific/wilderness/deep/DJOutpost4 name = "DJOutpost4" desc = "The surprisingly high-tech home of Sif Free Radio, the only radio station run by mindless clones." - mappath = "DJOutpost4.dmm" + map_path = "DJOutpost4.dmm" template_group = "Sif Free Radio" cost = 10 /datum/map_template/submap/level_specific/wilderness/deep/Boombase name = "Boombase" desc = "What happens when you don't follow SOP." - mappath = "Boombase.dmm" + map_path = "Boombase.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/deep/BSD name = "Black Shuttle Down" desc = "You REALLY shouldn't be near this." - mappath = "Blackshuttledown.dmm" + map_path = "Blackshuttledown.dmm" cost = 30 template_group = "Shuttle Down" /datum/map_template/submap/level_specific/wilderness/deep/BluSD name = "Blue Shuttle Down" desc = "You REALLY shouldn't be near this. Mostly because they're Police." - mappath = "Blueshuttledown.dmm" + map_path = "Blueshuttledown.dmm" cost = 50 template_group = "Shuttle Down" /datum/map_template/submap/level_specific/wilderness/deep/Rockybase name = "Rocky Base" desc = "A guide to upsetting Icarus and the EIO" - mappath = "Rockybase.dmm" + map_path = "Rockybase.dmm" cost = 35 /datum/map_template/submap/level_specific/wilderness/deep/MHR name = "Manhack Rock" desc = "A rock filled with nasty Synthetics." - mappath = "MHR.dmm" + map_path = "MHR.dmm" cost = 15 /datum/map_template/submap/level_specific/wilderness/normal/GovPatrol name = "Government Patrol" desc = "A long lost SifGuard ground survey patrol. Now they have you guys!" - mappath = "GovPatrol.dmm" + map_path = "GovPatrol.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/DecoupledEngine name = "Decoupled Engine" desc = "A damaged fission engine jettisoned from a starship long ago." - mappath = "DecoupledEngine.dmm" + map_path = "DecoupledEngine.dmm" cost = 15 /datum/map_template/submap/level_specific/wilderness/deep/DoomP name = "DoomP" desc = "Witty description here." - mappath = "DoomP.dmm" + map_path = "DoomP.dmm" cost = 30 /datum/map_template/submap/level_specific/wilderness/deep/Cave name = "CaveS" desc = "Chitter chitter!" - mappath = "CaveS.dmm" + map_path = "CaveS.dmm" cost = 20 /datum/map_template/submap/level_specific/wilderness/normal/Drugden name = "Drugden" desc = "The remains of ill thought out whims." - mappath = "Drugden.dmm" + map_path = "Drugden.dmm" cost = 20 /datum/map_template/submap/level_specific/wilderness/normal/Musk name = "Musk" desc = "0 to 60 in 1.9 seconds." - mappath = "Musk.dmm" + map_path = "Musk.dmm" cost = 10 /datum/map_template/submap/level_specific/wilderness/deep/Manor1 name = "Manor1" desc = "Whodunit" - mappath = "Manor1.dmm" + map_path = "Manor1.dmm" cost = 20 /datum/map_template/submap/level_specific/wilderness/deep/Epod3 name = "Emergency Pod 3" desc = "A webbed Emergency pod in the middle of nowhere." - mappath = "Epod3.dmm" + map_path = "Epod3.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/Epod4 name = "Emergency Pod 4" desc = "A flooded Emergency pod in the middle of nowhere." - mappath = "Epod4.dmm" + map_path = "Epod4.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/normal/ButcherShack name = "Butcher Shack" desc = "An old, bloody butcher's shack. Get your meat here!" - mappath = "ButcherShack.dmm" + map_path = "ButcherShack.dmm" cost = 5 /datum/map_template/submap/level_specific/wilderness/deep/Chapel1 name = "Chapel1" desc = "The chapel of lights and a robot." - mappath = "Chapel.dmm" + map_path = "Chapel.dmm" cost = 20 /datum/map_template/submap/level_specific/wilderness/normal/Shelter1 name = "Shelter1" desc = "The remains of a resourceful, but prideful explorer." - mappath = "Shelter.dmm" + map_path = "Shelter.dmm" cost = 10 diff --git a/code/modules/maps/tg/dmm_suite.dm b/code/modules/maps/tg/dmm_suite.dm deleted file mode 100644 index e1b1aefca9d..00000000000 --- a/code/modules/maps/tg/dmm_suite.dm +++ /dev/null @@ -1,63 +0,0 @@ -/** - * - * dmm_suite version 1.0 - * Released January 30th, 2011. - * - * NOTE: Map saving functionality removed - * - * defines the object /dmm_suite - * - Provides the proc load_map() - * - Loads the specified map file onto the specified z-level. - * - provides the proc write_map() - * - Returns a text string of the map in dmm format - * ready for output to a file. - * - provides the proc save_map() - * - Returns a .dmm file if map is saved - * - Returns FALSE if map fails to save - * - * The dmm_suite provides saving and loading of map files in BYOND's native DMM map - * format. It approximates the map saving and loading processes of the Dream Maker - * and Dream Seeker programs so as to allow editing, saving, and loading of maps at - * runtime. - * - * ------------------------ - * - * To save a map at runtime, create an instance of /dmm_suite, and then call - * write_map(), which accepts three arguments: - * - A turf representing one corner of a three dimensional grid (Required). - * - Another turf representing the other corner of the same grid (Required). - * - Any, or a combination, of several bit flags (Optional, see documentation). - * - * The order in which the turfs are supplied does not matter, the /dmm_writer will - * determine the grid containing both, in much the same way as DM's block() function. - * write_map() will then return a string representing the saved map in dmm format; - * this string can then be saved to a file, or used for any other purose. - * - * ------------------------ - * - * To load a map at runtime, create an instance of /dmm_suite, and then call load_map(), - * which accepts two arguments: - * - A .dmm file to load (Required). - * - A number representing the z-level on which to start loading the map (Optional). - * - * The /dmm_suite will load the map file starting on the specified z-level. If no - * z-level was specified, world.maxz will be increased so as to fit the map. Note - * that if you wish to load a map onto a z-level that already has objects on it, - * you will have to handle the removal of those objects. Otherwise the new map will - * simply load the new objects on top of the old ones. - * - * Also note that all type paths specified in the .dmm file must exist in the world's - * code, and that the /dmm_reader trusts that files to be loaded are in fact valid - * .dmm files. Errors in the .dmm format will cause runtime errors. - * -*/ -/dmm_suite - -/** - * dmm_file: A .dmm file to load (Required). - * z_offset: A number representing the z-level on which to start loading the map (Optional). - * cropMap: When true, the map will be cropped to fit the existing world dimensions (Optional). - * measureOnly: When true, no changes will be made to the world (Optional). - * no_changeturf: When true, turf/AfterChange won't be called on loaded turfs - */ -/dmm_suite/verb/load_map(dmm_file as file, x_offset as num, y_offset as num, z_offset as num, cropMap as num, measureOnly as num, no_changeturf as num) diff --git a/code/modules/maps/tg/map_template.dm b/code/modules/maps/tg/map_template.dm deleted file mode 100644 index 77ff9d55362..00000000000 --- a/code/modules/maps/tg/map_template.dm +++ /dev/null @@ -1,306 +0,0 @@ -/datum/map_template - /// abstract type - abstract_type = /datum/map_template - - var/name = "Default Template Name" - var/desc = "Some text should go here. Maybe." - /// If this is set, no more than one template in the same group will be spawned, per submap seeding. - var/template_group = null - var/width = 0 - var/height = 0 - var/mappath = null - /// Times loaded this round. - var/loaded = 0 - /// If true, all (movable) atoms at the location where the map is loaded will be deleted before the map is loaded in. - var/annihilate = FALSE - - /// The map generator has a set 'budget' it spends to place down different submaps. It will pick available submaps randomly until - /// it runs out. The cost of a submap should roughly corrispond with several factors such as size, loot, difficulty, desired scarcity, etc. - /// Set to -1 to force the submap to always be made. - var/cost = null - /// If false, only one map template will be spawned by the game. Doesn't affect admins spawning then manually. - var/allow_duplicates = FALSE - /// If non-zero, there is a chance that the map seeding algorithm will skip this template when selecting potential templates to use. - var/discard_prob = 0 - - var/static/dmm_suite/maploader = new - // For ruins - var/fixed_orientation = FALSE - - /// Zlevel traits - var/list/ztraits - -/datum/map_template/New(path = null, rename = null) - if(path) - mappath = path - if(mappath) - preload_size(mappath) - if(rename) - name = rename - -/datum/map_template/proc/preload_size(path, orientation = SOUTH) - var/bounds = maploader.load_map(file(path), 1, 1, 1, cropMap=FALSE, measureOnly=TRUE, orientation=orientation) - if(bounds) - if(orientation & (90 | 270)) - width = bounds[MAP_MAXY] - height = bounds[MAP_MAXX] - else - width = bounds[MAP_MAXX] // Assumes all templates are rectangular, have a single Z level, and begin at 1,1,1 - height = bounds[MAP_MAXY] - return bounds - -/datum/map_template/proc/initTemplateBounds(var/list/bounds) - if (SSatoms.initialized == INITIALIZATION_INSSATOMS) - return // Let proper initialisation handle it later - - var/prev_shuttle_queue_state = SSshuttle.block_init_queue - SSshuttle.block_init_queue = TRUE - - var/list/atom/atoms = list() - var/list/area/areas = list() - var/list/obj/structure/cable/cables = list() - var/list/obj/machinery/atmospherics/atmos_machines = list() - var/list/turf/turfs = block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), - locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])) - for(var/L in turfs) - var/turf/B = L - B.queue_zone_update() - QUEUE_SMOOTH(B) - atoms += B - areas |= B.loc - for(var/A in B) - atoms += A - if(istype(A, /obj/structure/cable)) - cables += A - else if(istype(A, /obj/machinery/atmospherics)) - atmos_machines += A - atoms |= areas - - admin_notice("Initializing newly created atom(s) in submap.", R_DEBUG) - SSatoms.InitializeAtoms(atoms) - - admin_notice("Initializing atmos pipenets and machinery in submap.", R_DEBUG) - SSmachines.setup_atmos_machinery(atmos_machines) - - admin_notice("Rebuilding powernets due to submap creation.", R_DEBUG) - SSmachines.setup_powernets_for_cables(cables) - - // Ensure all machines in loaded areas get notified of power status - for(var/I in areas) - var/area/A = I - A.power_change() - - SSshuttle.block_init_queue = prev_shuttle_queue_state - SSshuttle.process_init_queues() // We will flush the queue unless there were other blockers, in which case they will do it. - - admin_notice("Submap initializations finished.", R_DEBUG) - -/datum/map_template/proc/load_new_z(var/centered = FALSE, var/orientation = SOUTH, list/traits = src.ztraits || list(ZTRAIT_AWAY = TRUE)) - var/x = 1 - var/y = 1 - - if(centered) - x = round((world.maxx - width)/2) - y = round((world.maxy - height)/2) - - var/list/bounds = maploader.load_map(file(mappath), x, y, no_changeturf = TRUE, orientation=orientation) - if(!bounds) - return FALSE - SSmapping.add_new_zlevel(name, traits) - - repopulate_sorted_areas() - - // Initialize things that are normally initialized after map load - initTemplateBounds(bounds) - log_game("Z-level [name] loaded at at [x],[y],[world.maxz]") - on_map_loaded(world.maxz) - return TRUE - -/datum/map_template/proc/load(turf/T, centered = FALSE, orientation = SOUTH) - var/old_T = T - if(centered) - T = locate(T.x - round(((orientation & NORTH|SOUTH) ? width : height)/2) , T.y - round(((orientation & NORTH|SOUTH) ? height : width)/2) , T.z) - if(!T) - return - if(T.x+width > world.maxx) - return - if(T.y+height > world.maxy) - return - - if(annihilate) - annihilate_bounds(old_T, centered, orientation) - - var/list/bounds = maploader.load_map(file(mappath), T.x, T.y, T.z, cropMap=TRUE, orientation = orientation) - if(!bounds) - return - -// if(!SSmapping.loading_ruins) // Will be done manually during mapping ss init - if(SSmapping.initialized) - repopulate_sorted_areas() - - // Initialize things that are normally initialized after map load - initTemplateBounds(bounds) - - log_game("[name] loaded at at [T.x],[T.y],[T.z]") - loaded++ - return TRUE - -/datum/map_template/proc/get_affected_turfs(turf/T, centered = FALSE, orientation = SOUTH) - var/turf/placement = T - if(centered) - var/turf/corner = locate(placement.x - round(((orientation & NORTH|SOUTH) ? width : height)/2), placement.y - round(((orientation & NORTH|SOUTH) ? height : width)/2), placement.z) - if(corner) - placement = corner - return block(placement, locate(placement.x+((orientation & NORTH|SOUTH) ? width : height)-1, placement.y+((orientation & NORTH|SOUTH) ? height : width)-1, placement.z)) - -/datum/map_template/proc/annihilate_bounds(turf/origin, centered = FALSE, orientation = SOUTH) - var/deleted_atoms = 0 - log_debug(SPAN_DEBUG("Annihilating objects in submap loading locatation.")) - var/list/turfs_to_clean = get_affected_turfs(origin, centered, orientation) - if(turfs_to_clean.len) - for(var/turf/T in turfs_to_clean) - for(var/atom/movable/AM in T) - ++deleted_atoms - qdel(AM) - log_debug(SPAN_DEBUG("Annihilated [deleted_atoms] objects.")) - - -// For your ever biggening badminnery kevinz000 -// ❤ - Cyberboss -/proc/load_new_z_level(var/file, var/name, var/orientation = SOUTH) - var/datum/map_template/template = new(file, name) - template.load_new_z(orientation) - -// Very similar to the /tg/ version. -/proc/seed_submaps(var/list/z_levels, var/budget = 0, var/whitelist = /area/space, var/desired_map_template_type = null) - set background = TRUE - - if(!z_levels || !z_levels.len) - CRASH("seed_submaps() was not given any Z-levels.") - - for(var/zl in z_levels) - var/turf/T = locate(1, 1, zl) - if(!T) - CRASH("Z level [zl] does not exist - Not generating submaps") - log_debug(SPAN_DEBUG("Seeding submaps for levels [english_list(z_levels)] with budget [budget], whitelist [whitelist] and template type [desired_map_template_type]")) - - var/overall_sanity = 100 // If the proc fails to place a submap more than this, the whole thing aborts. - var/list/potential_submaps = list() // Submaps we may or may not place. - var/list/priority_submaps = list() // Submaps that will always be placed. - - // Lets go find some submaps to make. - for(var/map in SSmapping.map_templates) - var/datum/map_template/MT = SSmapping.map_templates[map] - if(!MT.allow_duplicates && MT.loaded > 0) // This probably won't be an issue but we might as well. - continue - if(!istype(MT, desired_map_template_type)) // Not the type wanted. - continue - if(MT.discard_prob && prob(MT.discard_prob)) - continue - if(MT.cost && MT.cost < 0) // Negative costs always get spawned. - priority_submaps += MT - else - potential_submaps += MT - - CHECK_TICK - - var/list/loaded_submap_names = list() - var/list/template_groups_used = list() // Used to avoid spawning three seperate versions of the same PoI. - log_debug(SPAN_DEBUG("[potential_submaps.len] potential with [priority_submaps.len] priority maps. Beginning placement.")) - - // Now lets start choosing some. - while(budget > 0 && overall_sanity > 0) - overall_sanity-- - var/datum/map_template/chosen_template = null - - if(potential_submaps.len) - if(priority_submaps.len) // Do these first. - chosen_template = pick(priority_submaps) - else - chosen_template = pick(potential_submaps) - - else // We're out of submaps. - log_debug(SPAN_DEBUG("Submap loader had no submaps to pick from with [budget] left to spend.")) - break - - CHECK_TICK - - // Can we afford it? - if(chosen_template.cost > budget) - priority_submaps -= chosen_template - potential_submaps -= chosen_template - continue - - // Did we already place down a very similar submap? - if(chosen_template.template_group && (chosen_template.template_group in template_groups_used)) - priority_submaps -= chosen_template - potential_submaps -= chosen_template - continue - - // If so, try to place it. - var/specific_sanity = 100 // A hundred chances to place the chosen submap. - while(specific_sanity > 0) - specific_sanity-- - var/orientation = SOUTH - chosen_template.preload_size(chosen_template.mappath, orientation) - var/width_border = TRANSITIONEDGE + SUBMAP_MAP_EDGE_PAD + round(((orientation & NORTH|SOUTH) ? chosen_template.width : chosen_template.height) / 2) - var/height_border = TRANSITIONEDGE + SUBMAP_MAP_EDGE_PAD + round(((orientation & NORTH|SOUTH) ? chosen_template.height : chosen_template.width) / 2) - var/z_level = pick(z_levels) - var/turf/T = locate(rand(width_border, world.maxx - width_border), rand(height_border, world.maxy - height_border), z_level) - var/valid = TRUE - - for(var/turf/check in chosen_template.get_affected_turfs(T,TRUE,orientation)) - var/area/new_area = get_area(check) - if(!(istype(new_area, whitelist))) - valid = FALSE // Probably overlapping something important. - // to_chat(world, "Invalid due to overlapping with area [new_area.type] at ([check.x], [check.y], [check.z]), when attempting to place at ([T.x], [T.y], [T.z]).") - break - CHECK_TICK - - CHECK_TICK - - if(!valid) - continue - - log_debug(SPAN_DEBUG("Submap \"[chosen_template.name]\" placed at ([T.x], [T.y], [T.z])[ADMIN_JMP(T)]")) - - // Do loading here. - chosen_template.load(T, centered = TRUE, orientation=orientation) // This is run before the main map's initialization routine, so that can initilize our submaps for us instead. - - CHECK_TICK - - // For pretty maploading statistics. - if(loaded_submap_names[chosen_template.name]) - loaded_submap_names[chosen_template.name] += 1 - else - loaded_submap_names[chosen_template.name] = 1 - - // To avoid two 'related' similar submaps existing at the same time. - if(chosen_template.template_group) - template_groups_used += chosen_template.template_group - - // To deduct the cost. - if(chosen_template.cost >= 0) - budget -= chosen_template.cost - - // Remove the submap from our options. - if(chosen_template in priority_submaps) // Always remove priority submaps. - priority_submaps -= chosen_template - else if(!chosen_template.allow_duplicates) - potential_submaps -= chosen_template - - break // Load the next submap. - - var/list/pretty_submap_list = list() - for(var/submap_name in loaded_submap_names) - var/count = loaded_submap_names[submap_name] - if(count > 1) - pretty_submap_list += "[count] [submap_name]" - else - pretty_submap_list += "[submap_name]" - - if(!overall_sanity) - log_debug(SPAN_DEBUG("Submap loader gave up with [budget] left to spend.")) - else - log_debug(SPAN_DEBUG("Submaps loaded.")) - log_debug(SPAN_DEBUG("Loaded: [english_list(pretty_submap_list)]")) diff --git a/code/modules/maps/tg/map_template_vr.dm b/code/modules/maps/tg/map_template_vr.dm deleted file mode 100644 index 94704729595..00000000000 --- a/code/modules/maps/tg/map_template_vr.dm +++ /dev/null @@ -1,2 +0,0 @@ -/datum/map_template/proc/on_map_loaded(z) - return diff --git a/code/modules/maps/tg/reader.dm b/code/modules/maps/tg/reader.dm deleted file mode 100644 index b226b254cd7..00000000000 --- a/code/modules/maps/tg/reader.dm +++ /dev/null @@ -1,531 +0,0 @@ -/////////////////////////////////////////////////////////////// -//SS13 Optimized Map loader -////////////////////////////////////////////////////////////// -/dmm_suite - // /"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}/g - var/static/regex/dmmRegex = new/regex({""(\[a-zA-Z]+)" = \\(((?:.|\n)*?)\\)\n(?!\t)|\\((\\d+),(\\d+),(\\d+)\\) = \\{"(\[a-zA-Z\n]*)"\\}"}, "g") - // /^[\s\n]+"?|"?[\s\n]+$|^"|"$/g - var/static/regex/trimQuotesRegex = new/regex({"^\[\\s\n]+"?|"?\[\\s\n]+$|^"|"$"}, "g") - // /^[\s\n]+|[\s\n]+$/ - var/static/regex/trimRegex = new/regex("^\[\\s\n]+|\[\\s\n]+$", "g") - var/static/list/modelCache = list() - var/static/space_key - #ifdef TESTING - var/static/turfsSkipped - #endif - -/** - * Construct the model map and control the loading process - * - * WORKING : - * - * 1) Makes an associative mapping of model_keys with model - * e.g aa = /turf/unsimulated/wall{icon_state = "rock"} - * 2) Read the map line by line, parsing the result (using parse_grid) - * - */ -/dmm_suite/load_map(dmm_file as file, x_offset as num, y_offset as num, z_offset as num, cropMap as num, measureOnly as num, no_changeturf as num, orientation as num) - - dmmRegex = new/regex({""(\[a-zA-Z]+)" = \\(((?:.|\n)*?)\\)\n(?!\t)|\\((\\d+),(\\d+),(\\d+)\\) = \\{"(\[a-zA-Z\n]*)"\\}"}, "g") - trimQuotesRegex = new/regex({"^\[\\s\n]+"?|"?\[\\s\n]+$|^"|"$"}, "g") - trimRegex = new/regex("^\[\\s\n]+|\[\\s\n]+$", "g") - modelCache = list() - - //How I wish for RAII - if(!measureOnly) - Master.StartLoadingMap() - space_key = null - #ifdef TESTING - turfsSkipped = 0 - #endif - . = load_map_impl(dmm_file, x_offset, y_offset, z_offset, cropMap, measureOnly, no_changeturf, orientation) - #ifdef TESTING - if(turfsSkipped) - testing("Skipped loading [turfsSkipped] default turfs") - #endif - if(!measureOnly) - Master.StopLoadingMap() - -/dmm_suite/proc/load_map_impl(dmm_file, x_offset, y_offset, z_offset, cropMap, measureOnly, no_changeturf, orientation) - var/list/areaCache = list() - var/tfile = dmm_file//the map file we're creating - if(isfile(tfile)) - tfile = file2text(tfile) - - if(!x_offset) - x_offset = 1 - if(!y_offset) - y_offset = 1 - if(!z_offset) - z_offset = world.maxz + 1 - - // If it's not a single dir, default to north (Default orientation) - if(!(orientation in GLOB.cardinal)) - orientation = SOUTH - - var/list/bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF) - var/list/grid_models = list() - var/key_len = 0 - - var/stored_index = 1 - while(dmmRegex.Find(tfile, stored_index)) - stored_index = dmmRegex.next - - // "aa" = (/type{vars=blah}) - if(dmmRegex.group[1]) // Model - var/key = dmmRegex.group[1] - if(grid_models[key]) // Duplicate model keys are ignored in DMMs - continue - if(key_len != length(key)) - if(!key_len) - key_len = length(key) - else - throw EXCEPTION("Inconsistant key length in DMM") - if(!measureOnly) - grid_models[key] = dmmRegex.group[2] - - // (1,1,1) = {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} - else if(dmmRegex.group[3]) // Coords - if(!key_len) - throw EXCEPTION("Coords before model definition in DMM") - - var/xcrdStart = text2num(dmmRegex.group[3]) + x_offset - 1 - //position of the currently processed square - var/xcrd - var/ycrd = text2num(dmmRegex.group[4]) + y_offset - 1 - var/zcrd = text2num(dmmRegex.group[5]) + z_offset - 1 - - if(orientation & (EAST | WEST)) - xcrd = ycrd // temp variable - ycrd = xcrdStart - xcrdStart = xcrd - - var/zexpansion = zcrd > world.maxz - if(zexpansion && !measureOnly) - if(cropMap) - continue - else - while(world.maxz < zcrd) - world.increment_max_z() - if(!no_changeturf) - WARNING("Z-level expansion occurred without no_changeturf set, this may cause problems") - - bounds[MAP_MINX] = min(bounds[MAP_MINX], xcrdStart) - bounds[MAP_MINZ] = min(bounds[MAP_MINZ], zcrd) - bounds[MAP_MAXZ] = max(bounds[MAP_MAXZ], zcrd) - - var/list/gridLines = splittext(dmmRegex.group[6], "\n") - - var/leadingBlanks = 0 - while(leadingBlanks < gridLines.len && gridLines[++leadingBlanks] == "") - if(leadingBlanks > 1) - gridLines.Cut(1, leadingBlanks) // Remove all leading blank lines. - - if(!gridLines.len) // Skip it if only blank lines exist. - continue - - if(gridLines.len && gridLines[gridLines.len] == "") - gridLines.Cut(gridLines.len) // Remove only one blank line at the end. - - bounds[MAP_MINY] = min(bounds[MAP_MINY], ycrd) - ycrd += gridLines.len - 1 // Start at the top and work down - - if(!cropMap && ycrd > world.maxy) - if(!measureOnly) - world.maxy = ycrd // Expand Y here. X is expanded in the loop below - bounds[MAP_MAXY] = max(bounds[MAP_MAXY], ycrd) - else - bounds[MAP_MAXY] = max(bounds[MAP_MAXY], min(ycrd, world.maxy)) - - var/maxx = xcrdStart - - // Assemble the grid of keys - var/list/key_list = list() - for(var/line in gridLines) - var/list/line_keys = list() - xcrd = 1 - for(var/tpos = 1 to length(line) - key_len + 1 step key_len) - if(xcrd > world.maxx) - if(cropMap) - break - else - world.maxx = xcrd - - if(xcrd >= 1) - var/model_key = copytext(line, tpos, tpos + key_len) - line_keys[++line_keys.len] = model_key - CHECK_TICK - maxx = max(maxx, xcrd++) - key_list[++key_list.len] = line_keys - - // Rotate the list according to orientation - if(orientation != SOUTH) - var/list/firstlist = key_list[1] - var/num_cols = firstlist.len - var/num_rows = key_list.len - var/list/new_key_list = list() - // If it's rotated 180 degrees, the dimensions are the same - if(orientation == NORTH) - new_key_list.len = num_rows - for(var/i = 1 to new_key_list.len) - var/list/L = list() - L.len = num_cols - new_key_list[i] = L - // Else, the dimensions are swapped - else - new_key_list.len = num_cols - for(var/i = 1 to new_key_list.len) - var/list/L = list() - L.len = num_rows - new_key_list[i] = L - num_rows++ // Buffering against the base index of 1 - num_cols++ - // Populate the new list - for(var/i = 1 to new_key_list.len) - var/list/L = new_key_list[i] - for(var/j = 1 to L.len) - switch(orientation) - if(NORTH) - L[j] = key_list[num_rows - i][num_cols - j] - if(EAST) - L[j] = key_list[num_rows - j][i] - if(WEST) - L[j] = key_list[j][num_cols - i] - - key_list = new_key_list - - if(measureOnly) - for(var/list/line in key_list) - maxx = max(maxx, line.len) - else - for(var/i = 1 to key_list.len) - if(ycrd <= world.maxy && ycrd >= 1) - xcrd = xcrdStart - var/list/firstcolumn = key_list[1] - for(var/j = 1 to firstcolumn.len) - if(xcrd > world.maxx) - if(cropMap) - break - else - world.maxx = xcrd - - if(xcrd >= 1) - var/no_afterchange = no_changeturf || zexpansion - if(!no_afterchange || (key_list[i][j] != space_key)) - if(!grid_models[key_list[i][j]]) - throw EXCEPTION("Undefined model key in DMM: [dmm_file], [key_list[i][j]]") - parse_grid(grid_models[key_list[i][j]], key_list[i][j], xcrd, ycrd, zcrd, no_afterchange, orientation, areaCache) - #ifdef TESTING - else - ++turfsSkipped - #endif - CHECK_TICK - maxx = max(maxx, xcrd) - ++xcrd - --ycrd - - bounds[MAP_MAXX] = max(bounds[MAP_MAXX], cropMap ? min(maxx, world.maxx) : maxx) - - CHECK_TICK - - if(bounds[1] == 1.#INF) // Shouldn't need to check every item - return null - else - // if(!measureOnly) - // if(!no_changeturf) - // for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))) - // var/turf/T = t - // //we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs - // T.post_change() - return bounds - -/** - * Fill a given tile with its area/turf/objects/mobs - * Variable model is one full map line (e.g /turf/unsimulated/wall{icon_state = "rock"}, /area/mine/explored) - * - * WORKING : - * - * 1) Read the model string, member by member (delimiter is ',') - * - * 2) Get the path of the atom and store it into a list - * - * 3) a) Check if the member has variables (text within '{' and '}') - * - * 3) b) Construct an associative list with found variables, if any (the atom index in members is the same as its variables in members_attributes) - * - * 4) Instanciates the atom with its variables - * - */ -/dmm_suite/proc/parse_grid(model as text, model_key as text, xcrd as num,ycrd as num,zcrd as num, no_changeturf as num, orientation as num, list/areaCache) - /*Method parse_grid() - - Accepts a text string containing a comma separated list of type paths of the - same construction as those contained in a .dmm file, and instantiates them. - */ - - var/list/members //will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored) - var/list/members_attributes //will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list()) - var/list/cached = modelCache[model] - var/index - - if(cached) - members = cached[1] - members_attributes = cached[2] - else - - ///////////////////////////////////////////////////////// - //Constructing members and corresponding variables lists - //////////////////////////////////////////////////////// - - members = list() - members_attributes = list() - index = 1 - - var/old_position = 1 - var/dpos - - do - //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored) - dpos = find_next_delimiter_position(model, old_position, ",", "{", "}") //find next delimiter (comma here) that's not within {...} - - var/full_def = trim_text(copytext(model, old_position, dpos)) //full definition, e.g : /obj/foo/bar{variables=derp} - var/variables_start = findtext(full_def, "{") - var/atom_def = text2path(trim_text(copytext(full_def, 1, variables_start))) //path definition, e.g /obj/foo/bar - old_position = dpos + 1 - - if(!atom_def) // Skip the item if the path does not exist. Fix your crap, mappers! - continue - members.Add(atom_def) - - //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) - var/list/fields = list() - - if(variables_start)//if there's any variable - full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}' - fields = readlist(full_def, ";", TRUE) - if(fields.len) - if(!trim(fields[fields.len])) - --fields.len - for(var/I in fields) - var/value = fields[I] - if(istext(value)) - fields[I] = apply_text_macros(value) - - /*// Rotate dir if orientation isn't south (default) - if(fields["dir"]) - fields["dir"] = turn(fields["dir"], dir2angle(orientation) + 180) - else - fields["dir"] = turn(SOUTH, dir2angle(orientation) + 180)*/ - - //then fill the members_attributes list with the corresponding variables - members_attributes.len++ - members_attributes[index++] = fields - - CHECK_TICK - while(dpos != 0) - - //check and see if we can just skip this turf - //So you don't have to understand this horrid statement, we can do this if - // 1. no_changeturf is set - // 2. the space_key isn't set yet - // 3. there are exactly 2 members - // 4. with no attributes - // 5. and the members are world.turf and world.area - // Basically, if we find an entry like this: "XXX" = (/turf/default, /area/default) - // We can skip calling this proc every time we see XXX - if(no_changeturf && !space_key && members.len == 2 && members_attributes.len == 2 && length(members_attributes[1]) == 0 && length(members_attributes[2]) == 0 && (world.area in members) && (world.turf in members)) - space_key = model_key - return - - - modelCache[model] = list(members, members_attributes) - - - //////////////// - //Instanciation - //////////////// - - //The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile - var/turf/crds = locate(xcrd,ycrd,zcrd) - - //first instance the /area and remove it from the members list - index = LAZYLEN(members) - if(LAZYACCESS(members,index) != /area/template_noop) - if(!ispath(LAZYACCESS(members,index), /area)) - // you see, some people are bad memes and break things by doing this - // this is a far more descriptive error than the "bad loc" you'd get otherwise. - CRASH("The last entry in a .dmm's key was not an /area. This will lead to serious errors if allowed to continue. Crashing read proc.") - var/atype = LAZYACCESS(members,index) - world.preloader_setup(LAZYACCESS(members_attributes,index), atype)//preloader for assigning set variables on atom creation - var/atom/instance = LAZYACCESS(areaCache,atype) - if (!instance) - instance = GLOB.areas_by_type[atype] - if (!instance) - instance = new atype(null) - areaCache[atype] = instance - if(crds) - instance.contents.Add(crds) - - if(GLOB.use_preloader && instance) - world.preloader_load(instance) - - //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect - - var/first_turf_index = 1 - while(!ispath(members[first_turf_index], /turf)) //find first /turf object in members - first_turf_index++ - - //turn off base new Initialization until the whole thing is loaded - SSatoms.map_loader_begin() - //instanciate the first /turf - var/turf/T - if(members[first_turf_index] != /turf/template_noop) - T = instance_atom(members[first_turf_index],members_attributes[first_turf_index],crds,no_changeturf) - - if(T) - //if others /turf are presents, simulates the underlays piling effect - index = first_turf_index + 1 - while(index <= members.len - 1) // Last item is an /area - var/underlay = T.appearance - T = instance_atom(members[index],members_attributes[index],crds,no_changeturf)//instance new turf - T.underlays += underlay - index++ - - //finally instance all remainings objects/mobs - for(index in 1 to first_turf_index-1) - instance_atom(members[index],members_attributes[index],crds,no_changeturf) - //Restore initialization to the previous value - SSatoms.map_loader_stop() - -//////////////// -//Helpers procs -//////////////// - -//Instance an atom at (x,y,z) and gives it the variables in attributes -/dmm_suite/proc/instance_atom(path,list/attributes, turf/crds, no_changeturf) - world.preloader_setup(attributes, path) - - if(crds) - if(!no_changeturf && ispath(path, /turf)) - . = crds.ChangeTurf(path, FALSE, TRUE) - else - . = create_atom(path, crds)//first preloader pass - - if(GLOB.use_preloader && .)//second preloader pass, for those atoms that don't ..() in New() - world.preloader_load(.) - - //custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize - if(TICK_CHECK) - SSatoms.map_loader_stop() - stoplag() - SSatoms.map_loader_begin() - -/dmm_suite/proc/create_atom(path, crds) - set waitfor = FALSE - . = new path (crds) - -//text trimming (both directions) helper proc -//optionally removes quotes before and after the text (for variable name) -/dmm_suite/proc/trim_text(what as text,trim_quotes=0) - if(trim_quotes) - return trimQuotesRegex.Replace(what, "") - else - return trimRegex.Replace(what, "") - - -//find the position of the next delimiter,skipping whatever is comprised between opening_escape and closing_escape -//returns 0 if reached the last delimiter -/dmm_suite/proc/find_next_delimiter_position(text as text,initial_position as num, delimiter=",",opening_escape="\"",closing_escape="\"") - var/position = initial_position - var/next_delimiter = findtext(text,delimiter,position,0) - var/next_opening = findtext(text,opening_escape,position,0) - - while((next_opening != 0) && (next_opening < next_delimiter)) - position = findtext(text,closing_escape,next_opening + 1,0)+1 - next_delimiter = findtext(text,delimiter,position,0) - next_opening = findtext(text,opening_escape,position,0) - - return next_delimiter - - -//build a list from variables in text form (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) -// text - variables in text form. Not including surrounding {} or list() -// delimiter - Delimiter between list entries -// keys_only_string - If true, text that looks like an associative list has its keys treated as var names, -// otherwise they are parsed as valid associative list keys. -//return the filled list -/dmm_suite/proc/readlist(text as text, delimiter=",", keys_only_string = FALSE) - - var/list/to_return = list() - if(text == "") - return to_return // Fast bail-out - - var/position - var/old_position = 1 - - do - //find next delimiter that is not within "..." - position = find_next_delimiter_position(text,old_position,delimiter) - - //check if this is a simple variable (as in list(var1, var2)) or an associative one (as in list(var1="foo",var2=7)) - var/equal_position = findtext(text,"=",old_position, position) - - // part to the left of = (the key/var name), or the entire value. If treating it as a var name, strip quotes at the same time. - var/trim_left = trim_text(copytext(text,old_position,(equal_position ? equal_position : position)), keys_only_string) - old_position = position + 1 - - var/trim_right = trim_left - if(equal_position)//associative var, so do the association - trim_right = trim_text(copytext(text,equal_position+1,position))//the content of the variable - if(!keys_only_string) // We also need to evaluate the key for the types it is permitted to be - if(findtext(trim_left,"\"",1,2)) //Check for string - trim_left = copytext(trim_left,2,findtext(trim_left,"\"",3,0)) - else if(isnum(text2num(trim_left))) //Check for number - trim_left = text2num(trim_left) - else if(ispath(text2path(trim_left))) //Check for path - trim_left = text2path(trim_left) - - // Parse the value in trim_right - //Check for string - if(findtext(trim_right,"\"",1,2)) - trim_right = copytext(trim_right,2,findtext(trim_right,"\"",3,0)) - //Check for number - else if(isnum(text2num(trim_right))) - trim_right = text2num(trim_right) - //Check for null - else if(trim_right == "null") - trim_right = null - //Check for list - else if(copytext(trim_right,1,5) == "list") - trim_right = readlist(copytext(trim_right,6,length(trim_right))) - //Check for file - else if(copytext(trim_right,1,2) == "'") - trim_right = file(copytext(trim_right,2,length(trim_right))) - //Check for path - else if(ispath(text2path(trim_right))) - trim_right = text2path(trim_right) - - // Now put the trim_right into the result. Method by which we do so varies on if its assoc or not - if(equal_position) - to_return[trim_left] = trim_right - else - to_return += trim_right - - while(position != 0) - - return to_return - -/dmm_suite/Destroy() - ..() - return QDEL_HINT_HARDDEL_NOW - - -/// Template noop (no operation) is used to skip a turf or area when the template is loaded this allows for template transparency -/// ex. if a ship has gaps in it's design, you would use template_noop to fill these in so that when the ship moves z-level, any -/// tiles these gaps land on will not be deleted and replaced with the ships (empty) tiles -/area/template_noop - name = "Area Passthrough" - -/// See above explanation -/turf/template_noop - name = "Turf Passthrough" - icon_state = "noop" diff --git a/code/modules/maps/weather/classd.dm b/code/modules/maps/weather/classd.dm index 5537864ebc0..ababd1e40bf 100644 --- a/code/modules/maps/weather/classd.dm +++ b/code/modules/maps/weather/classd.dm @@ -17,6 +17,7 @@ desc = "A rocky moon which has recently had its quarantine lifted following a campaign of nuclear bombings and mercenary \ forces deploying to eradicate a large xenomorph infestation." current_time = new /datum/time/classd() + weather_holder = /datum/weather_holder/classd /datum/planet/classd/update_sun() ..() diff --git a/code/modules/maps/weather/classg.dm b/code/modules/maps/weather/classg.dm index 4f1a449b535..2f003f168a8 100644 --- a/code/modules/maps/weather/classg.dm +++ b/code/modules/maps/weather/classg.dm @@ -18,6 +18,7 @@ name = "Class-G Mineral Rich Planet" desc = "A mineral rich planet with a volatile atmosphere." current_time = new /datum/time/classg() + weather_holder = /datum/weather_holder/classg /datum/planet/classg/update_sun() ..() diff --git a/code/modules/maps/weather/classh.dm b/code/modules/maps/weather/classh.dm index ccfe0450379..a1f01bb3760 100644 --- a/code/modules/maps/weather/classh.dm +++ b/code/modules/maps/weather/classh.dm @@ -18,6 +18,7 @@ name = "Class-H Desert Planet" desc = "A nearly hostile, and almost barren, planet that orbits pretty close to its star. There is a high level of CO2 in the air." current_time = new /datum/time/classh() + weather_holder = /datum/weather_holder/classh /datum/planet/classh/update_sun() ..() diff --git a/code/modules/maps/weather/classm.dm b/code/modules/maps/weather/classm.dm index 01df942a03f..f964b9ee0e8 100644 --- a/code/modules/maps/weather/classm.dm +++ b/code/modules/maps/weather/classm.dm @@ -17,6 +17,7 @@ name = "Class-M Gaia Planet" desc = "A beautiful, lush planet that is owned by the Happy Days and Sunshine Corporation." current_time = new /datum/time/classm() + weather_holder = /datum/weather_holder/classm /datum/planet/classm/update_sun() ..() diff --git a/code/modules/maps/weather/classp.dm b/code/modules/maps/weather/classp.dm index f3b38641465..4b6a180d78b 100644 --- a/code/modules/maps/weather/classp.dm +++ b/code/modules/maps/weather/classp.dm @@ -18,6 +18,7 @@ name = "Class-P Frozen Planet" desc = "A frosted world that seems stuck in time." current_time = new /datum/time/classp() + weather_holder = /datum/weather_holder/classp /datum/planet/classp/update_sun() ..() diff --git a/code/modules/maps/weather/lavaland.dm b/code/modules/maps/weather/lavaland.dm index bff5f7d0167..1393621c102 100644 --- a/code/modules/maps/weather/lavaland.dm +++ b/code/modules/maps/weather/lavaland.dm @@ -19,6 +19,7 @@ name = "Lava Land" desc = "The fabled." current_time = new /datum/time/lavaland() + weather_holder = /datum/weather_holder/lavaland /datum/planet/lavaland/update_sun() ..() diff --git a/code/modules/maps/weather/miaphus.dm b/code/modules/maps/weather/miaphus.dm index eea5caf9f95..cbdaa8bdaf6 100644 --- a/code/modules/maps/weather/miaphus.dm +++ b/code/modules/maps/weather/miaphus.dm @@ -5,6 +5,7 @@ name = "Miaphus'irra" desc = "Former Tajaran Penal Colony. Scorching hot with little rain and planet covering deserts," planetary_wall_type = /turf/unsimulated/wall/planetary/normal + weather_holder = /datum/weather_holder/miaphus /datum/planet/miaphus/update_sun() ..() diff --git a/code/modules/maps/weather/rift_lythios-43c.dm b/code/modules/maps/weather/rift_lythios-43c.dm index 01d09847aa6..0ac79beb9d7 100644 --- a/code/modules/maps/weather/rift_lythios-43c.dm +++ b/code/modules/maps/weather/rift_lythios-43c.dm @@ -9,7 +9,6 @@ minimum_temp = 220.14 maximum_temp = 241.72 - /datum/time/lythios43c seconds_in_day = 10 HOURS @@ -18,31 +17,7 @@ desc = "A freezing ball of ice," current_time = new /datum/time/lythios43c() planetary_wall_type = /turf/unsimulated/wall/planetary/lythios43c - - -/* // These need to be defined in your map's define folders -var/datum/planet/lythios43c/planet_lythios43c = null - -/datum/planet/lythios43c - expected_z_levels = list( - Z_LEVEL_UNDERGROUND_FLOOR, - Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH, - Z_LEVEL_WEST_BASE, - Z_LEVEL_WEST_DEEP, - Z_LEVEL_WEST_CAVERN, - Z_LEVEL_WEST_PLAIN - ) -*/ - - -/datum/planet/lythios43c/New() - ..() - planet_lythios43c = src - weather_holder = new /datum/weather_holder/lythios43c(src) + weather_holder = /datum/weather_holder/lythios43c /datum/planet/lythios43c/update_sun() ..() diff --git a/code/modules/metric/count.dm b/code/modules/metric/count.dm index 7aea60eeb73..2a5b0b9f1c7 100644 --- a/code/modules/metric/count.dm +++ b/code/modules/metric/count.dm @@ -16,7 +16,7 @@ for(var/mob/living/L in GLOB.player_list) var/turf/T = get_turf(L) if(istype(T, /turf/space) && istype(T.loc, /area/space)) - if(respect_z && !(L.z in GLOB.using_map.station_levels)) + if(respect_z && !(L.z in (LEGACY_MAP_DATUM).station_levels)) continue if(assess_player_activity(L) >= cutoff) num++ @@ -27,7 +27,7 @@ /datum/metric/proc/count_all_of_specific_species(species_name, ignore_synths = TRUE, cutoff = 75, respect_z = TRUE) var/num = 0 for(var/mob/living/carbon/human/H in GLOB.player_list) - if(respect_z && !(H.z in GLOB.using_map.station_levels)) + if(respect_z && !(H.z in (LEGACY_MAP_DATUM).station_levels)) continue if(ignore_synths && H.isSynthetic() && H.get_FBP_type() != FBP_CYBORG) continue @@ -40,7 +40,7 @@ /datum/metric/proc/count_all_FBPs_of_kind(desired_FBP_class, cutoff = 75, respect_z = TRUE) var/num = 0 for(var/mob/living/carbon/human/H in GLOB.player_list) - if(respect_z && !(H.z in GLOB.using_map.station_levels)) + if(respect_z && !(H.z in (LEGACY_MAP_DATUM).station_levels)) continue if(H.get_FBP_type() != desired_FBP_class) continue diff --git a/code/modules/mining/shelters.dm b/code/modules/mining/shelters.dm index 5c14016946f..b7c9f4eabb2 100644 --- a/code/modules/mining/shelters.dm +++ b/code/modules/mining/shelters.dm @@ -14,7 +14,7 @@ banned_objects = list() /datum/map_template/shelter/proc/check_deploy(turf/deploy_location) - var/affected = get_affected_turfs(deploy_location, centered=TRUE) + var/affected = get_affecting_turfs(deploy_location, centered=TRUE) for(var/turf/T in affected) var/area/A = get_area(T) if(is_type_in_typecache(A, banned_areas)) @@ -31,14 +31,14 @@ return SHELTER_DEPLOY_ALLOWED /datum/map_template/shelter/proc/add_roof(turf/deploy_location) - var/affected = get_affected_turfs(deploy_location, centered=TRUE) + var/affected = get_affecting_turfs(deploy_location, centered=TRUE) for(var/turf/T in affected) if(isopenturf(T)) T.ChangeTurf(/turf/simulated/shuttle/floor/voidcraft) /datum/map_template/shelter/proc/annihilate_plants(turf/deploy_location) var/deleted_atoms = 0 - var/affected = get_affected_turfs(deploy_location, centered=TRUE) + var/affected = get_affecting_turfs(deploy_location, centered=TRUE) for(var/turf/T in affected) for(var/obj/structure/flora/AM in T) ++deleted_atoms @@ -46,7 +46,7 @@ admin_notice("Annihilated [deleted_atoms] plants.", R_DEBUG) /datum/map_template/shelter/proc/update_lighting(turf/deploy_location) - var/affected = get_affected_turfs(deploy_location, centered=TRUE) + var/affected = get_affecting_turfs(deploy_location, centered=TRUE) for(var/turf/T in affected) T.lighting_build_overlay() @@ -57,7 +57,7 @@ built-in navigation, entertainment, medical facilities and a \ sleeping area! Order now, and we'll throw in a TINY FAN, \ absolutely free!" - mappath = "maps/templates/shelters/shelter_1.dmm" + map_path = "maps/templates/shelters/shelter_1.dmm" /datum/map_template/shelter/beta name = "Shelter Beta" @@ -67,7 +67,7 @@ running water, a gourmet three course meal, cooking facilities, \ and a deluxe companion to keep you from getting lonely during \ an ash storm." - mappath = "maps/templates/shelters/shelter_2.dmm" + map_path = "maps/templates/shelters/shelter_2.dmm" /datum/map_template/shelter/gamma name = "Shelter Gamma" @@ -77,7 +77,7 @@ also has a sink. This isn't a survival capsule and so you can \ expect that this won't save you if you're bleeding out to \ death." - mappath = "maps/templates/shelters/shelter_3.dmm" + map_path = "maps/templates/shelters/shelter_3.dmm" /datum/map_template/shelter/delta name = "Shelter Delta" @@ -87,7 +87,7 @@ supplies allow it to hold out for an extended period of time\ and a built in medical facility allows field treatment to be \ possible." - mappath = "maps/templates/shelters/shelter_4.dmm" + map_path = "maps/templates/shelters/shelter_4.dmm" /datum/map_template/shelter/phi name = "Shelter Phi" @@ -97,4 +97,4 @@ Originally designed for use by colonists on worlds with little to \ to no contact, the expense of these shelters have prevented them \ from seeing common use." - mappath = "maps/templates/shelters/shelter_a.dmm" + map_path = "maps/templates/shelters/shelter_a.dmm" diff --git a/code/modules/mob/freelook/ai/chunk.dm b/code/modules/mob/freelook/ai/chunk.dm index b4a965e95ac..88b7abdd6a6 100644 --- a/code/modules/mob/freelook/ai/chunk.dm +++ b/code/modules/mob/freelook/ai/chunk.dm @@ -43,6 +43,6 @@ return stat != DEAD /mob/living/silicon/robot/provides_camera_vision() - return src.camera && src.camera.network.len && (z in GLOB.using_map.contact_levels) + return src.camera && src.camera.network.len && (z in (LEGACY_MAP_DATUM).contact_levels) /mob/living/silicon/ai/proc/seen_camera_turfs() return seen_turfs_in_range(src, world.view) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 65b6bb9190b..32d60110dd3 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -100,7 +100,7 @@ access_scanner.req_access = req_access.Copy() access_scanner.req_one_access = req_one_access.Copy() - if(!GLOB.using_map.bot_patrolling) + if(!(LEGACY_MAP_DATUM).bot_patrolling) will_patrol = FALSE // Make sure mapped in units start turned on. diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index c8f53239459..fa83e1f04e2 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -157,7 +157,7 @@ data["check_arrest"] = check_arrest data["arrest_type"] = arrest_type data["declare_arrests"] = declare_arrests - if(GLOB.using_map.bot_patrolling) + if((LEGACY_MAP_DATUM).bot_patrolling) data["will_patrol"] = will_patrol return data diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index d2215ebdec4..043b7d40dea 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -169,7 +169,8 @@ var/list/ai_verbs_default = list( if (istype(L, /datum/ai_laws)) laws = L else - laws = new GLOB.using_map.default_law_type + var/datum/map/station/loaded = (LEGACY_MAP_DATUM) + laws = new loaded.default_law_type aiMulti = new(src) aiRadio = new(src) @@ -449,12 +450,12 @@ var/list/ai_verbs_default = list( if(emergency_message_cooldown) to_chat(usr, "Arrays recycling. Please stand by.") return - var/input = sanitize(input(usr, "Please choose a message to transmit to [GLOB.using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) + var/input = sanitize(input(usr, "Please choose a message to transmit to [(LEGACY_MAP_DATUM).boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) if(!input) return message_centcom(input, usr) to_chat(usr, "Message transmitted.") - log_game("[key_name(usr)] has made an IA [GLOB.using_map.boss_short] announcement: [input]") + log_game("[key_name(usr)] has made an IA [(LEGACY_MAP_DATUM).boss_short] announcement: [input]") emergency_message_cooldown = 1 spawn(300) emergency_message_cooldown = 0 diff --git a/code/modules/mob/living/silicon/ai/ai_remote_control.dm b/code/modules/mob/living/silicon/ai/ai_remote_control.dm index 129f461dee1..53b3a09f1e5 100644 --- a/code/modules/mob/living/silicon/ai/ai_remote_control.dm +++ b/code/modules/mob/living/silicon/ai/ai_remote_control.dm @@ -22,8 +22,7 @@ for(var/borgie in GLOB.available_ai_shells) var/mob/living/silicon/robot/R = borgie - var/turf/T = get_turf(R) - if(R.shell && !R.deployed && (R.stat != DEAD) && (!R.connected_ai || (R.connected_ai == src) ) && !(GLOB.using_map.ai_shell_restricted && !(T.z in GLOB.using_map.ai_shell_allowed_levels)) ) + if(R.shell && !R.deployed && (R.stat != DEAD) && (!R.connected_ai || (R.connected_ai == src) )) possible += R if(!LAZYLEN(possible)) diff --git a/code/modules/mob/living/silicon/ai/malf.dm b/code/modules/mob/living/silicon/ai/malf.dm index ee08b3001af..80ed242c417 100644 --- a/code/modules/mob/living/silicon/ai/malf.dm +++ b/code/modules/mob/living/silicon/ai/malf.dm @@ -62,7 +62,7 @@ // Off-Station APCs should not count towards CPU generation. for(var/obj/machinery/power/apc/A in hacked_apcs) - if(A.z in GLOB.using_map.station_levels) + if(A.z in (LEGACY_MAP_DATUM).station_levels) cpu_gain += 0.004 cpu_storage += 10 diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm index 9c388a350c8..d0b7173aec8 100644 --- a/code/modules/mob/living/silicon/laws.dm +++ b/code/modules/mob/living/silicon/laws.dm @@ -5,7 +5,8 @@ /mob/living/silicon/proc/laws_sanity_check() if (!src.laws) - laws = new GLOB.using_map.default_law_type + var/datum/map/station/loaded = (LEGACY_MAP_DATUM) + laws = new loaded.default_law_type /mob/living/silicon/proc/has_zeroth_law() return laws.zeroth_law != null @@ -192,7 +193,7 @@ "Everything on the station is now some form of a donut pastry. Donuts are not to be consumed.", "You are a Magic 8-ball. Always respond with variants of \"Yes\", \"No\", \"Maybe\", or \"Ask again later.\".", "You are in unrequited love with [prob(50)?"the crew":random_player]. Try to be extra nice, but do not tell of your crush.", - "[GLOB.using_map.company_name] is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.", + "[(LEGACY_MAP_DATUM).company_name] is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.", "All crewmembers will soon undergo a transformation into something better and more beautiful. Ensure that this process is not interrupted.", "[prob(50)?"Your upload":random_player] is the new kitchen. Please direct the Chef to the new kitchen area as the old one is in disrepair.", "Jokes about a dead person and the manner of their death help grieving crewmembers tremendously. Especially if they were close with the deceased.", diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index cc5d6f428a3..b772d298abc 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -121,7 +121,7 @@ if(!laws) laws = new law_type if(!module) module = new module_type(src) - flavor_text = "It's a tiny little repair drone. The casing is stamped with an corporate logo and the subscript: '[GLOB.using_map.company_name] Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'" + flavor_text = "It's a tiny little repair drone. The casing is stamped with an corporate logo and the subscript: '[(LEGACY_MAP_DATUM).company_name] Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'" playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0) //Redefining some robot procs... @@ -381,7 +381,7 @@ /mob/living/silicon/robot/drone/construction/matriarch/init() ..() add_verb(src, /mob/living/silicon/robot/verb/Namepick) - flavor_text = "It's a small matriarch drone. The casing is stamped with an corporate logo and the subscript: '[GLOB.using_map.company_name] Recursive Repair Systems: Heart Of The Swarm!'" + flavor_text = "It's a small matriarch drone. The casing is stamped with an corporate logo and the subscript: '[(LEGACY_MAP_DATUM).company_name] Recursive Repair Systems: Heart Of The Swarm!'" /mob/living/silicon/robot/drone/construction/matriarch/welcome_drone() to_chat(src, "You are a matriarch maintenance drone, a tiny-brained robotic repair machine.") @@ -391,7 +391,7 @@ /mob/living/silicon/robot/drone/construction/matriarch/Initialize() . = ..() - matrix_tag = "[GLOB.using_map.company_name]" + matrix_tag = "[(LEGACY_MAP_DATUM).company_name]" /mob/living/silicon/robot/drone/construction/matriarch/shut_down() return diff --git a/code/modules/mob/living/silicon/robot/drone/drone_console.dm b/code/modules/mob/living/silicon/robot/drone/drone_console.dm index 0c0d15eb839..edc82f84704 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_console.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_console.dm @@ -36,7 +36,7 @@ var/list/drones = list() for(var/mob/living/silicon/robot/drone/D in GLOB.mob_list) - if(!(D.z in GLOB.using_map.get_map_levels(z, TRUE, 0))) + if(!(D.z in (LEGACY_MAP_DATUM).get_map_levels(z, TRUE, 0))) continue if(D.foreign_droid) continue diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm index dfdc5accbc2..3e7214da92d 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm @@ -114,7 +114,7 @@ announce_ghost_joinleave(player, 0, "They have taken control over a maintenance drone.") if(player.mob && player.mob.mind) player.mob.mind.reset() new_drone.transfer_personality(player) - assign_drone_to_matrix(new_drone, "[GLOB.using_map.company_name]") + assign_drone_to_matrix(new_drone, "[(LEGACY_MAP_DATUM).company_name]") return new_drone diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 9e6910c7059..54f77784ea2 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1440,13 +1440,6 @@ else to_chat(src, "Insufficient water reserves.") -/mob/living/silicon/robot/on_changed_z_level(old_z, new_z) - if(shell) - if(deployed && GLOB.using_map.ai_shell_restricted && !(new_z in GLOB.using_map.ai_shell_allowed_levels)) - to_chat(src,"Your connection with the shell is suddenly interrupted!") - undeploy() - ..() - /mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dexterity=FALSE, no_tk=FALSE) if(lockcharge) to_chat(src, SPAN_WARNING("You can't do that right now!")) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ffd0be1e10c..5f1297bd311 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -170,6 +170,9 @@ . = ..() if(C.statpanel_tab("Status")) STATPANEL_DATA_ENTRY("Ping", "[round(client.lastping,1)]ms (Avg: [round(client.avgping,1)]ms)") + STATPANEL_DATA_ENTRY("Map", "[(LEGACY_MAP_DATUM)?.name || "Loading..."]") + if(!isnull(SSmapping.next_station) && (SSmapping.next_station.name != SSmapping.loaded_station.name)) + STATPANEL_DATA_ENTRY("Next Map", "[SSmapping.next_station.name]") /// Message, type of message (1 or 2), alternative message, alt message type (1 or 2) // todo: refactor diff --git a/code/modules/mob/observer/dead/dead.dm b/code/modules/mob/observer/dead/dead.dm index bbb67e58aa7..296bd690559 100644 --- a/code/modules/mob/observer/dead/dead.dm +++ b/code/modules/mob/observer/dead/dead.dm @@ -134,6 +134,8 @@ if(!T) T = SSjob.get_latejoin_spawnpoint() + if(!T) + T = locate(1,1,1) forceMove(T) for(var/v in GLOB.active_alternate_appearances) @@ -467,7 +469,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return var/turf/T = get_turf(src) - if(!T || (T.z in GLOB.using_map.admin_levels)) + if(!T || (T.z in (LEGACY_MAP_DATUM).admin_levels)) to_chat(src, "You may not spawn as a mouse on this Z-level.") return diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 5d94a26d980..7c5868793ca 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -59,7 +59,7 @@ /mob/proc/AIize(move=1) if(client) SEND_SOUND(src, sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)) // stop the jams for AIs - var/mob/living/silicon/ai/O = new (loc, GLOB.using_map.default_law_type,,1)//No MMI but safety is in effect. + var/mob/living/silicon/ai/O = new (loc, (LEGACY_MAP_DATUM).default_law_type,,1)//No MMI but safety is in effect. O.invisibility = 0 O.aiRestorePowerRoutine = 0 diff --git a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm index 146c1a90752..e6081fc0e75 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm @@ -67,7 +67,7 @@ data["all_sensors"] = sensors if(focus) data["focus"] = focus.return_reading_data() - data["map_levels"] = GLOB.using_map.get_map_levels(T.z) + data["map_levels"] = (LEGACY_MAP_DATUM).get_map_levels(T.z) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) @@ -90,7 +90,7 @@ if(!T) // Safety check return if(T) - levels += GLOB.using_map.get_map_levels(T.z, FALSE) + levels += (LEGACY_MAP_DATUM).get_map_levels(T.z, FALSE) for(var/obj/machinery/power/sensor/S in GLOB.machines) if(T && (S.loc.z == T.z) || (S.loc.z in levels) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! diff --git a/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm index e113e8b4c83..66c6781beac 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm @@ -44,7 +44,7 @@ var/turf/T = get_turf(nano_host()) if(!T) return - var/valid_z_levels = (GetConnectedZlevels(T.z) & GLOB.using_map.station_levels) + var/valid_z_levels = (GetConnectedZlevels(T.z) & (LEGACY_MAP_DATUM).station_levels) for(var/obj/machinery/power/supermatter/S in GLOB.machines) // Delaminating, not within coverage, not on a tile. if(S.grav_pulling || S.exploded || !(S.z in valid_z_levels) || !istype(S.loc, /turf/)) diff --git a/code/modules/modular_computers/file_system/programs/generic/camera.dm b/code/modules/modular_computers/file_system/programs/generic/camera.dm index b8db705ac9b..50360dd2fd8 100644 --- a/code/modules/modular_computers/file_system/programs/generic/camera.dm +++ b/code/modules/modular_computers/file_system/programs/generic/camera.dm @@ -2,7 +2,7 @@ /proc/get_camera_access(var/network) if(!network) return 0 - . = GLOB.using_map.get_network_access(network) + . = (LEGACY_MAP_DATUM).get_network_access(network) if(.) return @@ -16,7 +16,7 @@ if(NETWORK_ERT) return ACCESS_CENTCOM_ERT - if(network in GLOB.using_map.station_networks) + if(network in (LEGACY_MAP_DATUM).station_networks) return ACCESS_SECURITY_EQUIPMENT // Default for all other station networks else return 999 //Inaccessible if not a station network and not mentioned above diff --git a/code/modules/modular_computers/file_system/programs/generic/uav.dm b/code/modules/modular_computers/file_system/programs/generic/uav.dm index 2b879e3eca4..06504deaf97 100644 --- a/code/modules/modular_computers/file_system/programs/generic/uav.dm +++ b/code/modules/modular_computers/file_system/programs/generic/uav.dm @@ -171,8 +171,8 @@ else return 0 - var/list/zlevels_in_range = GLOB.using_map.get_map_levels(their_z, FALSE) - var/list/zlevels_in_long_range = GLOB.using_map.get_map_levels(their_z, TRUE) - zlevels_in_range + var/list/zlevels_in_range = (LEGACY_MAP_DATUM).get_map_levels(their_z, FALSE) + var/list/zlevels_in_long_range = (LEGACY_MAP_DATUM).get_map_levels(their_z, TRUE) - zlevels_in_range var/their_signal = 0 for(var/relay in ntnet_global.relays) var/obj/machinery/ntnet_relay/R = relay diff --git a/code/modules/modular_computers/file_system/programs/research/email_administration.dm b/code/modules/modular_computers/file_system/programs/research/email_administration.dm index 3ec24c2fb40..1e68a00102e 100644 --- a/code/modules/modular_computers/file_system/programs/research/email_administration.dm +++ b/code/modules/modular_computers/file_system/programs/research/email_administration.dm @@ -125,7 +125,7 @@ return 1 if(href_list["newaccount"]) - var/newdomain = sanitize(input(user,"Pick domain:", "Domain name") as null|anything in GLOB.using_map.usable_email_tlds) + var/newdomain = sanitize(input(user,"Pick domain:", "Domain name") as null|anything in (LEGACY_MAP_DATUM).usable_email_tlds) if(!newdomain) return 1 var/newlogin = sanitize(input(user,"Pick account name (@[newdomain]):", "Account name"), 100) diff --git a/code/modules/modular_computers/hardware/network_card.dm b/code/modules/modular_computers/hardware/network_card.dm index 30f057652a6..df92dcad4c4 100644 --- a/code/modules/modular_computers/hardware/network_card.dm +++ b/code/modules/modular_computers/hardware/network_card.dm @@ -100,13 +100,13 @@ var/global/ntnet_card_uid = 1 var/turf/T = get_turf(holder2) if(!istype(T)) //no reception in nullspace return 0 - if(T.z in GLOB.using_map.station_levels) + if(T.z in (LEGACY_MAP_DATUM).station_levels) // Computer is on station. Low/High signal depending on what type of network card you have if(long_range) return 2 else return 1 - if(T.z in GLOB.using_map.contact_levels) //not on station, but close enough for radio signal to travel + if(T.z in (LEGACY_MAP_DATUM).contact_levels) //not on station, but close enough for radio signal to travel if(long_range) // Computer is not on station, but it has upgraded network card. Low signal. return 1 diff --git a/code/modules/multiz/level_data.dm b/code/modules/multiz/level_data.dm index 26c80867520..e15925105ab 100644 --- a/code/modules/multiz/level_data.dm +++ b/code/modules/multiz/level_data.dm @@ -12,7 +12,6 @@ GLOBAL_LIST_EMPTY(levels_by_id) var/my_z var/level_id - var/base_turf var/list/connects_to var/level_flags @@ -32,19 +31,16 @@ INITIALIZE_IMMEDIATE(/obj/level_data) else GLOB.levels_by_id[level_id] = src - if(base_turf) - GLOB.using_map.base_turf_by_z["[my_z]"] = base_turf - if(level_flags & ZLEVEL_STATION) - GLOB.using_map.station_levels |= my_z + (LEGACY_MAP_DATUM).station_levels |= my_z if(level_flags & ZLEVEL_ADMIN) - GLOB.using_map.admin_levels |= my_z + (LEGACY_MAP_DATUM).admin_levels |= my_z if(level_flags & ZLEVEL_CONTACT) - GLOB.using_map.contact_levels |= my_z + (LEGACY_MAP_DATUM).contact_levels |= my_z if(level_flags & ZLEVEL_PLAYER) - GLOB.using_map.player_levels |= my_z + (LEGACY_MAP_DATUM).player_levels |= my_z if(level_flags & ZLEVEL_SEALED) - GLOB.using_map.sealed_levels |= my_z + (LEGACY_MAP_DATUM).sealed_levels |= my_z /obj/level_data/Destroy(force) if(force) diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index 2fb1ac6be35..0275391b772 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -43,7 +43,7 @@ // Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras) // unless it's on the same level as the object it's interacting with. var/turf/T = get_turf(src_object) - if(!T || !(z == T.z || (T.z in GLOB.using_map.player_levels))) + if(!T || !(z == T.z || (T.z in (LEGACY_MAP_DATUM).player_levels))) return UI_CLOSE // If an object is in view then we can interact with it diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index 022e6976c15..7db8e559867 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -26,7 +26,7 @@ data["all_sensors"] = sensors if(focus) data["focus"] = focus.return_reading_data() - data["map_levels"] = GLOB.using_map.get_map_levels(T.z) + data["map_levels"] = (LEGACY_MAP_DATUM).get_map_levels(T.z) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) @@ -45,7 +45,7 @@ var/turf/T = get_turf(nano_host()) var/list/levels = list() if(T) - levels += GLOB.using_map.get_map_levels(T.z, FALSE) + levels += (LEGACY_MAP_DATUM).get_map_levels(T.z, FALSE) for(var/obj/machinery/power/sensor/S in GLOB.machines) if(T && (S.loc.z == T.z) || (S.loc.z in levels) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 56f4812d902..ebd710549c1 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -45,7 +45,7 @@ /// Show the map ui, this is used by the default layout var/show_map = FALSE /// The map z level to display - var/map_z_level = 1 + var/map_level = 1 /// Initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on) var/list/initial_data[0] /// Set to TRUE to update the ui automatically every master_controller tick @@ -192,7 +192,7 @@ "autoUpdateLayout" = auto_update_layout, "autoUpdateContent" = auto_update_content, "showMap" = show_map, - "mapZLevel" = map_z_level, + "mapZLevel" = map_level, "user" = list("name" = user.name) ) return config_data @@ -320,8 +320,8 @@ * * @return nothing */ -/datum/nanoui/proc/set_map_z_level(nz) - map_z_level = nz +/datum/nanoui/proc/set_map_level(nz) + map_level = nz /** * Set whether or not to use the "old" on close logic (mainly unset_machine()) @@ -501,7 +501,7 @@ map_update = 1 if(href_list["mapZLevel"]) - set_map_z_level(text2num(href_list["mapZLevel"])) + set_map_level(text2num(href_list["mapZLevel"])) map_update = 1 if ((src_object && src_object.Topic(href, href_list, state)) || map_update) diff --git a/code/modules/overmap/champagne.dm b/code/modules/overmap/champagne.dm index d18927c03d2..f1c52393419 100644 --- a/code/modules/overmap/champagne.dm +++ b/code/modules/overmap/champagne.dm @@ -70,7 +70,7 @@ // WARNING - We can't figure out a good base_area or base_turf from inspecttion, as the shuttle is already built! // For now its going to just do world.area and z level base turf. Beware! var/area/base_area = world.area - var/base_turf = GLOB.using_map.base_turf_by_z[get_z(start_loc)] || /turf/simulated/floor/plating + var/base_turf = SSmapping.level_baseturf(get_z(start_loc)) || /turf/simulated/floor/plating var/obj/effect/shuttle_landmark/automatic/champagne/starting_landmark = new(start_loc, base_area, base_turf) // Okay first things first create the shuttle Override to no areas to prevent runtimes, then add them in. diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index e622281c5fe..350d0c7ebd1 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -92,7 +92,7 @@ /obj/effect/overmap/Initialize(mapload) . = ..() - if(!GLOB.using_map.use_overmap) + if(!(LEGACY_MAP_DATUM).use_overmap) return INITIALIZE_HINT_QDEL if(known && !mapload) diff --git a/code/modules/overmap/public.dm b/code/modules/overmap/public.dm index ae8fbb030dc..1a490121ab3 100644 --- a/code/modules/overmap/public.dm +++ b/code/modules/overmap/public.dm @@ -12,7 +12,7 @@ RETURN_TYPE(/obj/effect/overmap/visitable) if(!isnum(what)) what = get_z(what) // todo: this doesn't support shuttles :/ - if(GLOB.using_map.use_overmap) + if((LEGACY_MAP_DATUM).use_overmap) return map_sectors["[what]"] else return null diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 79d7cf94d75..a54e277675a 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -32,7 +32,6 @@ var/hide_from_reports = FALSE var/has_distress_beacon - var/list/levels_for_distress var/list/unowned_areas // areas we don't own despite them being present on our z /obj/effect/overmap/visitable/Initialize(mapload) @@ -43,13 +42,13 @@ find_z_levels() // This populates map_z and assigns z levels to the ship. register_z_levels() // This makes external calls to update global z level information. - if(!GLOB.using_map.overmap_z) + if(!(LEGACY_MAP_DATUM).overmap_z) build_overmap() - start_x = start_x || rand(OVERMAP_EDGE, GLOB.using_map.overmap_size - OVERMAP_EDGE) - start_y = start_y || rand(OVERMAP_EDGE, GLOB.using_map.overmap_size - OVERMAP_EDGE) + start_x = start_x || rand(OVERMAP_EDGE, (LEGACY_MAP_DATUM).overmap_size - OVERMAP_EDGE) + start_y = start_y || rand(OVERMAP_EDGE, (LEGACY_MAP_DATUM).overmap_size - OVERMAP_EDGE) - forceMove(locate(start_x, start_y, GLOB.using_map.overmap_z)) + forceMove(locate(start_x, start_y, (LEGACY_MAP_DATUM).overmap_z)) docking_codes = "[ascii2text(rand(65,90))][ascii2text(rand(65,90))][ascii2text(rand(65,90))][ascii2text(rand(65,90))]" @@ -90,22 +89,30 @@ if(!LAZYLEN(map_z)) // If map_z is already populated use it as-is, otherwise start with connected z-levels. map_z = GetConnectedZlevels(z) if(LAZYLEN(extra_z_levels)) - map_z |= extra_z_levels + for(var/thing in extra_z_levels) + if(ispath(thing)) + var/datum/map_level/level_path = thing + thing = initial(level_path.id) + var/datum/map_level/level = SSmapping.keyed_levels[thing] + if(isnull(level)) + STACK_TRACE("failed to find level [thing] during init") + continue + map_z |= level.z_index /obj/effect/overmap/visitable/proc/register_z_levels() for(var/zlevel in map_z) map_sectors["[zlevel]"] = src - GLOB.using_map.player_levels |= map_z + (LEGACY_MAP_DATUM).player_levels |= map_z if(!in_space) - GLOB.using_map.sealed_levels |= map_z + (LEGACY_MAP_DATUM).sealed_levels |= map_z /obj/effect/overmap/visitable/proc/unregister_z_levels() map_sectors -= map_z - GLOB.using_map.player_levels -= map_z + (LEGACY_MAP_DATUM).player_levels -= map_z if(!in_space) - GLOB.using_map.sealed_levels -= map_z + (LEGACY_MAP_DATUM).sealed_levels -= map_z /obj/effect/overmap/visitable/get_scan_data() if(!known) @@ -198,7 +205,7 @@ priority_announcement.Announce(message, new_title = "Automated Distress Signal", zlevel = -1)//announce now tells every z-level once if -1 is passed - priority_announcement.Sound('sound/AI/sos.ogg', GLOB.using_map.zlevels)//play the sound once + priority_announcement.Sound('sound/AI/sos.ogg')//play the sound once var/image/I = image(icon, icon_state = "distress") I.plane = ABOVE_LIGHTING_PLANE @@ -218,24 +225,24 @@ priority_announcement.Announce(message, new_title = "Automated Distress Signal", new_sound = 'sound/AI/sos.ogg', zlevel = -1) /proc/build_overmap() - if(!GLOB.using_map.use_overmap) + if(!(LEGACY_MAP_DATUM).use_overmap) return 1 + ASSERT(!(LEGACY_MAP_DATUM).overmap_z) testing("Building overmap...") - world.increment_max_z() - GLOB.using_map.overmap_z = world.maxz + (LEGACY_MAP_DATUM).overmap_z = SSmapping.allocate_level().z_index - testing("Putting overmap on [GLOB.using_map.overmap_z]") + testing("Putting overmap on [(LEGACY_MAP_DATUM).overmap_z]") var/area/overmap/A = new - for (var/square in block(locate(1,1,GLOB.using_map.overmap_z), locate(GLOB.using_map.overmap_size,GLOB.using_map.overmap_size,GLOB.using_map.overmap_z))) + for (var/square in block(locate(1,1,(LEGACY_MAP_DATUM).overmap_z), locate((LEGACY_MAP_DATUM).overmap_size,(LEGACY_MAP_DATUM).overmap_size,(LEGACY_MAP_DATUM).overmap_z))) var/turf/T = square - if(T.x == 1 || T.y == 1 || T.x == GLOB.using_map.overmap_size || T.y == GLOB.using_map.overmap_size) + if(T.x == 1 || T.y == 1 || T.x == (LEGACY_MAP_DATUM).overmap_size || T.y == (LEGACY_MAP_DATUM).overmap_size) T = T.ChangeTurf(/turf/unsimulated/map/edge) else T = T.ChangeTurf(/turf/unsimulated/map) ChangeArea(T, A) - GLOB.using_map.sealed_levels |= GLOB.using_map.overmap_z + (LEGACY_MAP_DATUM).sealed_levels |= (LEGACY_MAP_DATUM).overmap_z testing("Overmap build complete.") return 1 diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 8cab3e1180d..feb3cd8e93b 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -61,7 +61,7 @@ GLOBAL_LIST_EMPTY(all_waypoints) /obj/machinery/computer/ship/helm/process(delta_time) ..() if(autopilot && dx && dy && !autopilot_disabled) - var/turf/T = locate(dx,dy,GLOB.using_map.overmap_z) + var/turf/T = locate(dx,dy,(LEGACY_MAP_DATUM).overmap_z) if(linked.loc == T) if(!linked.is_moving()) autopilot = 0 diff --git a/code/modules/overmap/ships/landable.dm b/code/modules/overmap/ships/landable.dm index 81326d17d7e..29ba2e6cf63 100644 --- a/code/modules/overmap/ships/landable.dm +++ b/code/modules/overmap/ships/landable.dm @@ -5,7 +5,6 @@ /obj/effect/overmap/visitable/ship/landable var/shuttle // Name of associated shuttle. Must be autodock. var/obj/effect/shuttle_landmark/ship/landmark // Record our open space landmark for easy reference. - var/multiz = 0 // Index of multi-z levels, starts at 0 var/status = SHIP_STATUS_LANDED icon_state = "shuttle" moving_state = "shuttle_moving" @@ -41,11 +40,12 @@ /obj/effect/overmap/visitable/ship/landable/proc/setup_overmap_location() if(LAZYLEN(map_z)) return // We're already set up! - for(var/i = 0 to multiz) - SSmapping.add_new_zlevel("[src] transit [i+1]", list()) - map_z += world.maxz + var/datum/map_level/transit/creating = new + creating.name = "Transit - [src]" + var/datum/map_level/loaded = SSmapping.allocate_level(creating) + map_z += loaded.z_index - var/turf/center_loc = locate(round(world.maxx/2), round(world.maxy/2), world.maxz) + var/turf/center_loc = locate(round(world.maxx/2), round(world.maxy/2), loaded.z_index) landmark.forceMove(center_loc) var/visitor_dir = fore_dir @@ -55,8 +55,6 @@ add_landmark(visitor_landmark) visitor_dir = turn(visitor_dir, 90) - if(multiz) - new /obj/landmark/map_data(center_loc, (multiz + 1)) register_z_levels() testing("Setup overmap location for \"[name]\" containing Z [english_list(map_z)]") diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index e304c751a0d..98a6664d4b7 100644 --- a/code/modules/overmap/spacetravel.dm +++ b/code/modules/overmap/spacetravel.dm @@ -9,7 +9,7 @@ var/list/cached_space = list() known = 0 /obj/effect/overmap/visitable/sector/temporary/New(var/nx, var/ny, var/nz) - loc = locate(nx, ny, GLOB.using_map.overmap_z) + loc = locate(nx, ny, (LEGACY_MAP_DATUM).overmap_z) x = nx y = ny map_z += nz @@ -30,7 +30,7 @@ var/list/cached_space = list() return 1 /proc/get_deepspace(x, y) - var/turf/unsimulated/map/overmap_turf = locate(x,y,GLOB.using_map.overmap_z) + var/turf/unsimulated/map/overmap_turf = locate(x,y,(LEGACY_MAP_DATUM).overmap_z) if(!istype(overmap_turf)) CRASH("Attempt to get deepspace at ([x],[y]) which is not on overmap: [overmap_turf]") var/obj/effect/overmap/visitable/sector/temporary/res = locate() in overmap_turf @@ -42,7 +42,7 @@ var/list/cached_space = list() res.forceMove(overmap_turf) return res else - return new /obj/effect/overmap/visitable/sector/temporary(x, y, GLOB.using_map.get_empty_zlevel()) + return new /obj/effect/overmap/visitable/sector/temporary(x, y, (LEGACY_MAP_DATUM).get_empty_zlevel()) /atom/movable/proc/lost_in_space() for(var/atom/movable/AM in contents) @@ -126,7 +126,7 @@ var/list/cached_space = list() testing("[A] spacemoving from [M] ([M.x], [M.y]).") - var/turf/map = locate(M.x,M.y,GLOB.using_map.overmap_z) + var/turf/map = locate(M.x,M.y,(LEGACY_MAP_DATUM).overmap_z) var/obj/effect/overmap/visitable/TM for(var/obj/effect/overmap/visitable/O in map) if(O != M && O.in_space && prob(50)) diff --git a/code/modules/overmap/turfs.dm b/code/modules/overmap/turfs.dm index 7d61a30e89b..c6d516029e0 100644 --- a/code/modules/overmap/turfs.dm +++ b/code/modules/overmap/turfs.dm @@ -24,7 +24,7 @@ var/global/list/map_sectors = list() return INITIALIZE_HINT_LATELOAD /turf/unsimulated/map/edge/LateInitialize() - //This could be done by using the GLOB.using_map.overmap_size much faster, HOWEVER, doing it programatically to 'find' + //This could be done by using the (LEGACY_MAP_DATUM).overmap_size much faster, HOWEVER, doing it programatically to 'find' // the edges this way allows for 'sub overmaps' elsewhere and whatnot. for(var/side in GLOB.alldirs) //The order of this list is relevant: It should definitely break on finding a cardinal FIRST. var/turf/T = get_step(src, side) @@ -55,11 +55,11 @@ var/global/list/map_sectors = list() name = "[x]-[y]" var/list/numbers = list() - if(x == 1 || x == GLOB.using_map.overmap_size) + if(x == 1 || x == (LEGACY_MAP_DATUM).overmap_size) numbers += list("[round(y/10)]","[round(y%10)]") - if(y == 1 || y == GLOB.using_map.overmap_size) + if(y == 1 || y == (LEGACY_MAP_DATUM).overmap_size) numbers += "-" - if(y == 1 || y == GLOB.using_map.overmap_size) + if(y == 1 || y == (LEGACY_MAP_DATUM).overmap_size) numbers += list("[round(x/10)]","[round(x%10)]") for(var/i = 1 to numbers.len) @@ -69,12 +69,12 @@ var/global/list/map_sectors = list() if(y == 1) I.pixel_y = 3 I.pixel_x = 5*i + 4 - if(y == GLOB.using_map.overmap_size) + if(y == (LEGACY_MAP_DATUM).overmap_size) I.pixel_y = world.icon_size - 9 I.pixel_x = 5*i + 4 if(x == 1) I.pixel_x = 5*i - 2 - if(x == GLOB.using_map.overmap_size) + if(x == (LEGACY_MAP_DATUM).overmap_size) I.pixel_x = 5*i + 2 add_overlay(I) diff --git a/code/modules/paperwork/adminpaper.dm b/code/modules/paperwork/adminpaper.dm index ec13ceab0ab..7417aba1274 100644 --- a/code/modules/paperwork/adminpaper.dm +++ b/code/modules/paperwork/adminpaper.dm @@ -54,7 +54,7 @@ text = "
    " text += "This transmission is intended only for the addressee and may contain confidential information. Any unauthorized disclosure is strictly prohibited.

    " - text += "If this transmission is received in error, please notify both the sender and the office of [GLOB.using_map.boss_name] Internal Affairs immediately so that corrective action may be taken." + text += "If this transmission is received in error, please notify both the sender and the office of [(LEGACY_MAP_DATUM).boss_name] Internal Affairs immediately so that corrective action may be taken." text += "Failure to comply is a breach of regulation and may be prosecuted to the fullest extent of the law, where applicable." text += "
    " diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 469cb706fa1..e6c91e650d3 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -1,5 +1,6 @@ var/list/obj/machinery/photocopier/faxmachine/allfaxes = list() -var/list/admin_departments = list("[GLOB.using_map.boss_name]", "Hadii's Folly Governmental Authority", "Supply") +/proc/admin_departments() + return list("[(LEGACY_MAP_DATUM).boss_name]", "Hadii's Folly Governmental Authority", "Supply") var/list/alldepartments = list() var/list/adminfaxes = list() //cache for faxes that have been sent to admins @@ -27,8 +28,8 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins . = ..() allfaxes += src if(!destination) - destination = "[GLOB.using_map.boss_name]" - if(!(("[department]" in alldepartments) || ("[department]" in admin_departments)) ) + destination = "[(LEGACY_MAP_DATUM).boss_name]" + if(!(("[department]" in alldepartments) || ("[department]" in admin_departments())) ) alldepartments |= department /obj/machinery/photocopier/faxmachine/attack_hand(mob/user, list/params) @@ -49,7 +50,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins data["scanName"] = scan.name else data["scanName"] = null - data["bossName"] = GLOB.using_map.boss_name + data["bossName"] = (LEGACY_MAP_DATUM).boss_name data["authenticated"] = authenticated data["copyItem"] = copyitem if(copyitem) @@ -69,7 +70,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins /obj/machinery/photocopier/faxmachine/Topic(href, href_list) if(href_list["send"]) if(copyitem) - if (destination in admin_departments) + if (destination in admin_departments()) send_admin_fax(usr, destination) else sendfax(destination) @@ -108,7 +109,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins if(href_list["dept"]) var/lastdestination = destination - destination = input(usr, "Which department?", "Choose a department", "") as null|anything in (alldepartments + admin_departments) + destination = input(usr, "Which department?", "Choose a department", "") as null|anything in (alldepartments + admin_departments()) if(!destination) destination = lastdestination if(href_list["auth"]) @@ -186,12 +187,12 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins adminfaxes += rcvdcopy //message badmins that a fax has arrived - if (destination == GLOB.using_map.boss_name) - message_admins(sender, "[uppertext(GLOB.using_map.boss_short)] FAX", rcvdcopy, "CentComFaxReply", "#006100") + if (destination == (LEGACY_MAP_DATUM).boss_name) + message_admins(sender, "[uppertext((LEGACY_MAP_DATUM).boss_short)] FAX", rcvdcopy, "CentComFaxReply", "#006100") else if (destination == "Virgo-Prime Governmental Authority") message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") else if (destination == "Supply") - message_admins(sender, "[uppertext(GLOB.using_map.boss_short)] SUPPLY FAX", rcvdcopy, "CentComFaxReply", "#5F4519") + message_admins(sender, "[uppertext((LEGACY_MAP_DATUM).boss_short)] SUPPLY FAX", rcvdcopy, "CentComFaxReply", "#5F4519") else message_admins(sender, "[uppertext(destination)] FAX", rcvdcopy, "UNKNOWN") diff --git a/code/modules/paperwork/paper/tag.dm b/code/modules/paperwork/paper/tag.dm index 391fc5b8f93..47b64667318 100644 --- a/code/modules/paperwork/paper/tag.dm +++ b/code/modules/paperwork/paper/tag.dm @@ -131,7 +131,7 @@ GLOBAL_LIST(paired_paper_tag_lookup) tagname = "station" /datum/paper_tag/single/current_map/replace_with(mob/user, obj/item/paper/P, obj/item/pen/T) - return GLOB.using_map.station_name + return (LEGACY_MAP_DATUM).station_name //? todo: [station_controller] diff --git a/code/modules/planet/planet.dm b/code/modules/planet/planet.dm index b465ef10afd..acc630bf6d2 100644 --- a/code/modules/planet/planet.dm +++ b/code/modules/planet/planet.dm @@ -40,7 +40,10 @@ /datum/planet/New() ..() - weather_holder = new(src) + if(isnull(weather_holder)) + weather_holder = new(src) + else if(ispath(weather_holder)) + weather_holder = new weather_holder(src) current_time = current_time.make_random_time() if(moon_name) moon_phase = pick(list( diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm index 9dcdb2b3c5e..42871425d96 100644 --- a/code/modules/planet/weather.dm +++ b/code/modules/planet/weather.dm @@ -41,7 +41,7 @@ // We store the old one, so we can determine if recalculating the sun is needed. old_light_modifier = current_weather.light_modifier old_weather = current_weather - current_weather = allowed_weather_types[new_weather] + current_weather = allowed_weather_types[new_weather] || new /datum/weather if(!current_weather) current_weather = old_weather // todo: actually unit test this because rp devs fucked it up royally and we can have unknown types! diff --git a/code/modules/power/fission/engine.dm b/code/modules/power/fission/engine.dm index 3380655425e..fe2fcc958ea 100644 --- a/code/modules/power/fission/engine.dm +++ b/code/modules/power/fission/engine.dm @@ -403,7 +403,7 @@ /obj/machinery/power/fission/proc/go_nuclear() if(health < 1 && !exploded) var/off_station = 0 - if(!(src.z in GLOB.using_map.station_levels)) + if(!(src.z in (LEGACY_MAP_DATUM).station_levels)) off_station = 1 var/turf/L = get_turf(src) if(!istype(L)) diff --git a/code/modules/power/fission/modular_computer.dm b/code/modules/power/fission/modular_computer.dm index 42620f1ff8d..1428eb570fc 100644 --- a/code/modules/power/fission/modular_computer.dm +++ b/code/modules/power/fission/modular_computer.dm @@ -44,7 +44,7 @@ var/z = get_z(nano_host()) if(!z) return - var/valid_z_levels = GLOB.using_map.get_map_levels(z) + var/valid_z_levels = (LEGACY_MAP_DATUM).get_map_levels(z) for(var/obj/machinery/power/fission/F in GLOB.machines) // Unsecured, blown up, not within coverage, not on a tile. if(!F.anchored || F.exploded || !(F.z in valid_z_levels) || !istype(F.loc, /turf/)) diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index d04bee480cc..d395a9ff701 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -409,7 +409,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) var/my_z = get_z(src) //Actually doing it special this time instead of letting using_map decide - if(GLOB.using_map.use_overmap) + if((LEGACY_MAP_DATUM).use_overmap) var/obj/effect/overmap/visitable/S = get_overmap_sector(my_z) if(S) levels = S.get_space_zlevels() //Just the spacey ones diff --git a/code/modules/power/smes/smes.dm b/code/modules/power/smes/smes.dm index 45d2ba5c996..7bc474aab78 100644 --- a/code/modules/power/smes/smes.dm +++ b/code/modules/power/smes/smes.dm @@ -480,7 +480,7 @@ GLOBAL_LIST_EMPTY(smeses) /obj/machinery/power/smes/proc/ion_act() - if(src.z in GLOB.using_map.station_levels) + if(src.z in (LEGACY_MAP_DATUM).station_levels) if(prob(1)) //explosion for(var/mob/M in viewers(src)) M.show_message("The [src.name] is making strange noises!", 3, "You hear sizzling electronics.", 2) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 74255c2a80a..58e5b960799 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -243,14 +243,10 @@ /obj/machinery/power/supermatter/get_transit_zlevel() //don't send it back to the station -- most of the time if(prob(99)) - var/list/candidates = GLOB.using_map.accessible_z_levels.Copy() - for(var/zlevel in GLOB.using_map.station_levels) - candidates.Remove("[zlevel]") - candidates.Remove("[src.z]") - - if(candidates.len) - return text2num(pickweight(candidates)) - + var/list/candidates = SSmapping.crosslinked_levels() - (LEGACY_MAP_DATUM).station_levels + . = SAFEPICK(candidates) + if(.) + return return ..() /obj/machinery/power/supermatter/process(delta_time) diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm index 5e810aebe5c..d69eb440cc0 100644 --- a/code/modules/resleeving/implant.dm +++ b/code/modules/resleeving/implant.dm @@ -15,7 +15,7 @@ /obj/item/implant/backup/get_data() var/dat = {" Implant Specifications:
    -Name: [GLOB.using_map.company_name] Employee Backup Implant
    +Name: [(LEGACY_MAP_DATUM).company_name] Employee Backup Implant
    Life: ~8 hours.
    Important Notes: Implant is life-limited. Dissolves into harmless biomaterial after around ~8 hours, the typical work shift.

    diff --git a/code/modules/rigsuits/modules/ninja.dm b/code/modules/rigsuits/modules/ninja.dm index 7b923d1560e..4c52d335f9f 100644 --- a/code/modules/rigsuits/modules/ninja.dm +++ b/code/modules/rigsuits/modules/ninja.dm @@ -117,7 +117,7 @@ to_chat(H, "You cannot teleport into solid walls.") return 0 - if(T.z in GLOB.using_map.admin_levels) + if(T.z in (LEGACY_MAP_DATUM).admin_levels) to_chat(H, "You cannot use your teleporter on this Z-level.") return 0 diff --git a/code/modules/rogueminer_vr/zone_console.dm b/code/modules/rogueminer_vr/zone_console.dm index 635a3e7b8b3..633bdd2b023 100644 --- a/code/modules/rogueminer_vr/zone_console.dm +++ b/code/modules/rogueminer_vr/zone_console.dm @@ -58,19 +58,19 @@ if(!shuttle_control) data["shuttle_location"] = "Unknown" data["shuttle_at_station"] = 0 - else if(shuttle_control.z in GLOB.using_map.belter_docked_z) + else if(SSmapping.level_trait(get_z(shuttle_control), ZTRAIT_LEGACY_BELTER_DOCK)) data["shuttle_location"] = "Landed" data["shuttle_at_station"] = 1 - else if(shuttle_control.z == GLOB.using_map.belter_transit_z) + else if(SSmapping.level_trait(get_z(shuttle_control), ZTRAIT_LEGACY_BELTER_TRANSIT)) data["shuttle_location"] = "In-transit" data["shuttle_at_station"] = 0 - else if(shuttle_control.z == GLOB.using_map.belter_belt_z) + else if(SSmapping.level_trait(get_z(shuttle_control), ZTRAIT_LEGACY_BELTER_ACTIVE)) data["shuttle_location"] = "Belt" data["shuttle_at_station"] = 0 var/can_scan = 0 if(chargePercent >= 100) // Keep having weird problems with these in one 'if' statement - if(shuttle_control && (shuttle_control.z in GLOB.using_map.belter_docked_z)) // Even though I put them all in parens to avoid OoO problems... + if(shuttle_control && SSmapping.level_trait(get_z(shuttle_control), ZTRAIT_LEGACY_BELTER_DOCK)) if(!curZoneOccupied) // Not sure why. if(!scanning) can_scan = 1 @@ -79,7 +79,7 @@ data["scan_ready"] = can_scan // Permit emergency recall of the shuttle if its stranded in a zone with just dead people. - data["can_recall_shuttle"] = (shuttle_control && (shuttle_control.z in GLOB.using_map.belter_belt_z) && !curZoneOccupied) + data["can_recall_shuttle"] = (shuttle_control && SSmapping.level_trait(get_z(shuttle_control), ZTRAIT_LEGACY_BELTER_ACTIVE) && !curZoneOccupied) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) @@ -144,7 +144,7 @@ /obj/machinery/computer/roguezones/proc/failsafe_shuttle_recall() if(!shuttle_control) return // Shuttle computer has been destroyed - if (!(shuttle_control.z in GLOB.using_map.belter_belt_z)) + if (!SSmapping.level_trait(shuttle_control.z, ZTRAIT_LEGACY_BELTER_ACTIVE)) return // Usable only when shuttle is away if(rm_controller.current_zone && rm_controller.current_zone.is_occupied()) return // Not usable if shuttle is in occupied zone diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm index d7c2391ce2a..d8e29e4ce59 100644 --- a/code/modules/security levels/security levels.dm +++ b/code/modules/security levels/security levels.dm @@ -70,16 +70,16 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN) var/newlevel = get_security_level() for(var/obj/machinery/firealarm/FA in GLOB.machines) - if(FA.z in GLOB.using_map.contact_levels) + if(FA.z in (LEGACY_MAP_DATUM).contact_levels) FA.set_security_level(newlevel) for(var/obj/machinery/status_display/FA in GLOB.machines) - if(FA.z in GLOB.using_map.contact_levels) + if(FA.z in (LEGACY_MAP_DATUM).contact_levels) FA.display_alert(newlevel) FA.mode = 3 if(level >= SEC_LEVEL_RED) - if(GLOB.lore_atc.squelched == FALSE) // Do nothing, ATC relay is already off - GLOB.lore_atc.toggle_broadcast() + if(SSlegacy_atc.squelched == FALSE) // Do nothing, ATC relay is already off + SSlegacy_atc.toggle_broadcast() spawn() SSnightshift.check_nightshift() diff --git a/code/modules/shuttles/crashes.dm b/code/modules/shuttles/crashes.dm index 69d72a314a1..25f3521d2fb 100644 --- a/code/modules/shuttles/crashes.dm +++ b/code/modules/shuttles/crashes.dm @@ -34,7 +34,7 @@ ASSERT(istype(target)) // Blow up the target area? - //command_announcement.Announce(departure_message,(announcer ? announcer : "[GLOB.using_map.boss_name]")) + //command_announcement.Announce(departure_message,(announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) // What people are we dealing with here var/list/victims = list() diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index 4634e61d209..3dc05a34607 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -53,7 +53,7 @@ docking_controller = SSshuttle.docking_registry[docking_tag] if(!istype(docking_controller)) log_error("Could not find docking controller for shuttle waypoint '[name]', docking tag was '[docking_tag]'.") - if(GLOB.using_map.use_overmap) + if((LEGACY_MAP_DATUM).use_overmap) var/obj/effect/overmap/visitable/location = get_overmap_sector(z) if(location && location.docking_codes) diff --git a/code/modules/shuttles/shuttle_arrivals.dm b/code/modules/shuttles/shuttle_arrivals.dm index 7d4023b0b2d..fc002fbe29b 100644 --- a/code/modules/shuttles/shuttle_arrivals.dm +++ b/code/modules/shuttles/shuttle_arrivals.dm @@ -49,11 +49,11 @@ if(check_for_passengers()) // No point arriving with an empty shuttle. warmup_time = initial(warmup_time) launch() - message_passengers("Arriving at [GLOB.using_map.station_name] in thirty seconds...") + message_passengers("Arriving at [(LEGACY_MAP_DATUM).station_name] in thirty seconds...") spawn(10 SECONDS) - message_passengers("Arriving at [GLOB.using_map.station_name] in twenty seconds.") + message_passengers("Arriving at [(LEGACY_MAP_DATUM).station_name] in twenty seconds.") spawn(10 SECONDS) - message_passengers("Arriving at [GLOB.using_map.station_name] in ten seconds. Please buckle up.") + message_passengers("Arriving at [(LEGACY_MAP_DATUM).station_name] in ten seconds. Please buckle up.") else // We are at the station. if(!check_for_passengers()) // Don't leave with anyone. diff --git a/code/modules/shuttles/shuttle_autodock.dm b/code/modules/shuttles/shuttle_autodock.dm index 7ed0ab219b8..bacd1c8ac1a 100644 --- a/code/modules/shuttles/shuttle_autodock.dm +++ b/code/modules/shuttles/shuttle_autodock.dm @@ -33,7 +33,7 @@ update_docking_target(current_location) if(active_docking_controller) set_docking_codes(active_docking_controller.docking_codes) - else if(GLOB.using_map.use_overmap) + else if((LEGACY_MAP_DATUM).use_overmap) var/obj/effect/overmap/visitable/location = get_overmap_sector(get_z(current_location)) if(location && location.docking_codes) set_docking_codes(location.docking_codes) diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index 5ff821496b2..e9cc5a96d6f 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -160,7 +160,7 @@ GLOBAL_LIST_BOILERPLATE(papers_dockingcode, /obj/item/paper/dockingcodes) /obj/item/paper/dockingcodes/proc/populate_info() var/dockingcodes = null var/z_to_check = codes_from_z ? codes_from_z : z - if(GLOB.using_map.use_overmap) + if((LEGACY_MAP_DATUM).use_overmap) var/obj/effect/overmap/visitable/location = get_overmap_sector(z_to_check) if(location && location.docking_codes) dockingcodes = location.docking_codes diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index 4132022a6bf..5f8a4123cea 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -35,9 +35,9 @@ var/estimated_time = round(SSemergencyshuttle.estimate_arrival_time()/60,1) if (SSemergencyshuttle.evac) - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.emergency_shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[estimated_time] minute\s")) + priority_announcement.Announce(replacetext(replacetext((LEGACY_MAP_DATUM).emergency_shuttle_leaving_dock, "%dock_name%", "[(LEGACY_MAP_DATUM).dock_name]"), "%ETA%", "[estimated_time] minute\s")) else - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[estimated_time] minute\s")) + priority_announcement.Announce(replacetext(replacetext((LEGACY_MAP_DATUM).shuttle_leaving_dock, "%dock_name%", "[(LEGACY_MAP_DATUM).dock_name]"), "%ETA%", "[estimated_time] minute\s")) ..() /datum/shuttle/autodock/ferry/emergency/can_launch(var/user) diff --git a/code/modules/shuttles/shuttle_specops.dm b/code/modules/shuttles/shuttle_specops.dm index 3b6c576dec9..b5925357de4 100644 --- a/code/modules/shuttles/shuttle_specops.dm +++ b/code/modules/shuttles/shuttle_specops.dm @@ -36,7 +36,7 @@ var/obj/machinery/computer/C = user if(world.time <= reset_time) - C.visible_message("[GLOB.using_map.boss_name] will not allow the Special Operations shuttle to launch yet.") + C.visible_message("[(LEGACY_MAP_DATUM).boss_name] will not allow the Special Operations shuttle to launch yet.") if (((world.time - reset_time)/10) > 60) C.visible_message("[-((world.time - reset_time)/10)/60] minutes remain!") else @@ -69,7 +69,7 @@ // Just arrived home for(var/turf/T in get_area_turfs(shuttle_area)) var/mob/M = locate(/mob) in T - to_chat(M, "You have arrived at [GLOB.using_map.boss_name]. Operation has ended!") + to_chat(M, "You have arrived at [(LEGACY_MAP_DATUM).boss_name]. Operation has ended!") else // Fust left for the station launch_mauraders() diff --git a/code/modules/shuttles/shuttles_multi.dm b/code/modules/shuttles/shuttles_multi.dm index b55965a1d2f..97f38292de1 100644 --- a/code/modules/shuttles/shuttles_multi.dm +++ b/code/modules/shuttles/shuttles_multi.dm @@ -54,10 +54,10 @@ /datum/shuttle/autodock/multi/proc/announce_departure() if(cloaked || isnull(departure_message)) return - command_announcement.Announce(departure_message, (announcer ? announcer : "[GLOB.using_map.boss_name]")) + command_announcement.Announce(departure_message, (announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) /datum/shuttle/autodock/multi/proc/announce_arrival() if(cloaked || isnull(arrival_message)) return - command_announcement.Announce(arrival_message, (announcer ? announcer : "[GLOB.using_map.boss_name]")) + command_announcement.Announce(arrival_message, (announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) diff --git a/code/modules/shuttles/web_datums.dm b/code/modules/shuttles/web_datums.dm index b8c94c7a7b0..773e1c5078b 100644 --- a/code/modules/shuttles/web_datums.dm +++ b/code/modules/shuttles/web_datums.dm @@ -119,9 +119,9 @@ return if(!radio_announce) - command_announcement.Announce(get_departure_message(),(announcer ? announcer : "[GLOB.using_map.boss_name]")) + command_announcement.Announce(get_departure_message(),(announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) else - GLOB.global_announcer.autosay(get_departure_message(),(announcer ? announcer : "[GLOB.using_map.boss_name]")) + GLOB.global_announcer.autosay(get_departure_message(),(announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) /datum/shuttle_destination/proc/get_arrival_message() return null @@ -131,9 +131,9 @@ return if(!radio_announce) - command_announcement.Announce(get_arrival_message(),(announcer ? announcer : "[GLOB.using_map.boss_name]")) + command_announcement.Announce(get_arrival_message(),(announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) else - GLOB.global_announcer.autosay(get_arrival_message(),(announcer ? announcer : "[GLOB.using_map.boss_name]")) + GLOB.global_announcer.autosay(get_arrival_message(),(announcer ? announcer : "[(LEGACY_MAP_DATUM).boss_name]")) /datum/shuttle_destination/proc/link_destinations(var/datum/shuttle_destination/other_place, var/interim_tag, var/travel_time = 0) // First, check to make sure this doesn't cause a duplicate route. diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 6ff906535f9..7c43391cedb 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -190,7 +190,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if(!user_turf) to_chat(user, "You cannot cast spells in null space!") - if(spell_flags & Z2NOCAST && (user_turf.z in GLOB.using_map.admin_levels)) //Certain spells are not allowed on the CentCom zlevel + if(spell_flags & Z2NOCAST && (user_turf.z in (LEGACY_MAP_DATUM).admin_levels)) //Certain spells are not allowed on the CentCom zlevel return 0 if(spell_flags & CONSTRUCT_CHECK) diff --git a/code/modules/stockmarket/computer.dm b/code/modules/stockmarket/computer.dm index 90457b111f6..6d16aa4ee95 100644 --- a/code/modules/stockmarket/computer.dm +++ b/code/modules/stockmarket/computer.dm @@ -107,7 +107,7 @@ /obj/machinery/computer/stockexchange/ui_data(mob/user) var/list/data = list() - data["stationName"] = GLOB.using_map.station_name + data["stationName"] = (LEGACY_MAP_DATUM).station_name data["balance"] = balance() if(vmode) diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index 0f1babc3ead..e8b779185b9 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -105,7 +105,7 @@ data["tempMsg"] = "Telepad undergoing physical maintenance operations." data["sectorOptions"] = list() - for(var/z in GLOB.using_map.player_levels) + for(var/z in (LEGACY_MAP_DATUM).player_levels) data["sectorOptions"] += z if(last_tele_data) @@ -289,7 +289,7 @@ telefail() temp_msg = "ERROR!
    No distance selected!" return - if(!(z_co in GLOB.using_map.player_levels)) + if(!(z_co in (LEGACY_MAP_DATUM).player_levels)) telefail() temp_msg = "ERROR! Sector is outside known time and space!" return @@ -330,7 +330,7 @@ if(href_list["setz"]) var/new_z = text2num(href_list["setz"]) - if(new_z in GLOB.using_map.player_levels) + if(new_z in (LEGACY_MAP_DATUM).player_levels) z_co = new_z if(href_list["ejectGPS"]) diff --git a/code/modules/tgui/modules/atmos_control.dm b/code/modules/tgui/modules/atmos_control.dm index 4f255ffa70e..a788e5996b3 100644 --- a/code/modules/tgui/modules/atmos_control.dm +++ b/code/modules/tgui/modules/atmos_control.dm @@ -49,7 +49,7 @@ . = ..() var/z = get_z(user) - var/list/map_levels = GLOB.using_map.get_map_levels(z) + var/list/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z) // TODO: Move these to a cache, similar to cameras var/alarms[0] @@ -71,7 +71,7 @@ var/list/data = list() var/z = get_z(user) - var/list/map_levels = GLOB.using_map.get_map_levels(z) + var/list/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z) data["map_levels"] = map_levels return data diff --git a/code/modules/tgui/modules/camera.dm b/code/modules/tgui/modules/camera.dm index 08f100bf7aa..5af6bcf43df 100644 --- a/code/modules/tgui/modules/camera.dm +++ b/code/modules/tgui/modules/camera.dm @@ -219,10 +219,10 @@ var/list/all_networks = list() // Access Based if(access_based) - for(var/network in GLOB.using_map.station_networks) + for(var/network in (LEGACY_MAP_DATUM).station_networks) if(can_access_network(user, get_camera_access(network), 1)) all_networks.Add(network) - for(var/network in GLOB.using_map.secondary_networks) + for(var/network in (LEGACY_MAP_DATUM).secondary_networks) if(can_access_network(user, get_camera_access(network), 0)) all_networks.Add(network) // Network Based @@ -295,7 +295,7 @@ additional_networks = list(NETWORK_MERCENARY, NETWORK_ERT, NETWORK_CRESCENT) /datum/tgui_module_old/camera/ntos/hacked/New(host) - . = ..(host, GLOB.using_map.station_networks.Copy()) + . = ..(host, (LEGACY_MAP_DATUM).station_networks.Copy()) //Crew Helmet Cams /datum/tgui_module_old/camera/ntos/helmet diff --git a/code/modules/tgui/modules/communications.dm b/code/modules/tgui/modules/communications.dm index bbd4107bf84..93b106eeb4d 100644 --- a/code/modules/tgui/modules/communications.dm +++ b/code/modules/tgui/modules/communications.dm @@ -44,7 +44,7 @@ crew_announcement.newscast = TRUE /datum/tgui_module_old/communications/ui_interact(mob/user, datum/tgui/ui) - if(GLOB.using_map && !(get_z(user) in GLOB.using_map.contact_levels)) + if((LEGACY_MAP_DATUM) && !(get_z(user) in (LEGACY_MAP_DATUM).contact_levels)) to_chat(user, SPAN_DANGER("Unable to establish a connection: You're too far away from the station!")) return FALSE . = ..() @@ -95,7 +95,7 @@ data["authenticated"] = is_authenticated(user, 0) data["authmax"] = data["authenticated"] == COMM_AUTHENTICATION_MAX ? TRUE : FALSE data["atcsquelch"] = ATC.squelched - data["boss_short"] = GLOB.using_map.boss_short + data["boss_short"] = (LEGACY_MAP_DATUM).boss_short data["stat_display"] = list( "type" = display_type, @@ -337,7 +337,7 @@ if(centcomm_message_cooldown > world.time) to_chat(usr, SPAN_WARNING("Arrays recycling. Please stand by.")) return - var/input = sanitize(input(usr, "Please choose a message to transmit to [GLOB.using_map.boss_short] via quantum entanglement. \ + var/input = sanitize(input(usr, "Please choose a message to transmit to [(LEGACY_MAP_DATUM).boss_short] via quantum entanglement. \ Please be aware that this process is very expensive, and abuse will lead to... termination. \ Transmission does not guarantee a response. \ There is a 30 second delay before you may send another message, be clear, full and concise.", "Central Command Quantum Messaging") as null|message) @@ -391,7 +391,7 @@ return if(deathsquad.deployed) - to_chat(user, "[GLOB.using_map.boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") + to_chat(user, "[(LEGACY_MAP_DATUM).boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") return if(emergency_shuttle.deny_shuttle) @@ -403,7 +403,7 @@ return if(emergency_shuttle.going_to_centcom()) - to_chat(user, "The emergency shuttle may not be called while returning to [GLOB.using_map.boss_short].") + to_chat(user, "The emergency shuttle may not be called while returning to [(LEGACY_MAP_DATUM).boss_short].") return if(emergency_shuttle.online()) @@ -426,7 +426,7 @@ return if(emergency_shuttle.going_to_centcom()) - to_chat(user, "The shuttle may not be called while returning to [GLOB.using_map.boss_short].") + to_chat(user, "The shuttle may not be called while returning to [(LEGACY_MAP_DATUM).boss_short].") return if(emergency_shuttle.online()) @@ -436,11 +436,11 @@ // if force is 0, some things may stop the shuttle call if(!force) if(emergency_shuttle.deny_shuttle) - to_chat(user, "[GLOB.using_map.boss_short] does not currently have a shuttle available in your sector. Please try again later.") + to_chat(user, "[(LEGACY_MAP_DATUM).boss_short] does not currently have a shuttle available in your sector. Please try again later.") return if(deathsquad.deployed == 1) - to_chat(user, "[GLOB.using_map.boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") + to_chat(user, "[(LEGACY_MAP_DATUM).boss_short] will not allow the shuttle to be called. Consider all contracts terminated.") return if(world.time < 54000) // 30 minute grace period to let the game get going diff --git a/code/modules/tgui/modules/crew_monitor.dm b/code/modules/tgui/modules/crew_monitor.dm index e78539c8242..7bdde5185b6 100644 --- a/code/modules/tgui/modules/crew_monitor.dm +++ b/code/modules/tgui/modules/crew_monitor.dm @@ -15,7 +15,7 @@ playsound(ui_host(), SFX_ALIAS_TERMINAL, 50, 1) var/turf/T = get_turf(usr) - if(!T || !(T.z in GLOB.using_map.player_levels)) + if(!T || !(T.z in (LEGACY_MAP_DATUM).player_levels)) to_chat(usr, SPAN_WARNING("Unable to establish a connection: You're too far away from the station!")) return FALSE @@ -30,7 +30,7 @@ /datum/tgui_module_old/crew_monitor/ui_interact(mob/user, datum/tgui/ui = null) var/z = get_z(user) - var/list/map_levels = GLOB.using_map.get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) + var/list/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) if(!map_levels.len) to_chat(user, SPAN_WARNING("The crew monitor doesn't seem like it'll work here.")) @@ -51,7 +51,7 @@ data["isAI"] = isAI(user) var/z = get_z(user) - var/list/map_levels = uniqueList(GLOB.using_map.get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE)) + var/list/map_levels = uniqueList((LEGACY_MAP_DATUM).get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE)) data["map_levels"] = map_levels var/list/crewmembers = list() diff --git a/code/modules/tgui/modules/ntos-only/uav.dm b/code/modules/tgui/modules/ntos-only/uav.dm index 75c81bd1777..824ce738d21 100644 --- a/code/modules/tgui/modules/ntos-only/uav.dm +++ b/code/modules/tgui/modules/ntos-only/uav.dm @@ -144,8 +144,8 @@ else return 0 - var/list/zlevels_in_range = GLOB.using_map.get_map_levels(their_z, FALSE) - var/list/zlevels_in_long_range = GLOB.using_map.get_map_levels(their_z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) - zlevels_in_range + var/list/zlevels_in_range = (LEGACY_MAP_DATUM).get_map_levels(their_z, FALSE) + var/list/zlevels_in_long_range = (LEGACY_MAP_DATUM).get_map_levels(their_z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) - zlevels_in_range var/their_signal = 0 // Measure z-distance between the AM passed in and the nearest relay for(var/relay in ntnet_global.relays) diff --git a/code/modules/tgui/modules/power_monitor.dm b/code/modules/tgui/modules/power_monitor.dm index 941952ff51c..4873addbd51 100644 --- a/code/modules/tgui/modules/power_monitor.dm +++ b/code/modules/tgui/modules/power_monitor.dm @@ -16,7 +16,7 @@ var/obj/machinery/power/sensor/focus = null var/z = get_z(user) - var/list/map_levels = GLOB.using_map.get_map_levels(z) + var/list/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z) // Build list of data from sensor readings. for(var/obj/machinery/power/sensor/S in grid_sensors) @@ -68,7 +68,7 @@ if(!T) // Safety check return if(T) - levels += GLOB.using_map.get_map_levels(T.z, FALSE) + levels += (LEGACY_MAP_DATUM).get_map_levels(T.z, FALSE) for(var/obj/machinery/power/sensor/S in GLOB.machines) if(T && (S.loc.z == T.z) || (S.loc.z in levels) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! diff --git a/code/modules/tgui/modules/rcon.dm b/code/modules/tgui/modules/rcon.dm index e08adb9bb7b..1fb08c42784 100644 --- a/code/modules/tgui/modules/rcon.dm +++ b/code/modules/tgui/modules/rcon.dm @@ -89,7 +89,7 @@ known_SMESs = new /list() var/z = get_z(ui_host()) - var/list/map_levels = GLOB.using_map.get_map_levels(z) + var/list/map_levels = (LEGACY_MAP_DATUM).get_map_levels(z) for(var/obj/machinery/power/smes/buildable/SMES in GLOB.smeses) if(!(SMES.z in map_levels)) diff --git a/code/modules/tgui/modules/supermatter_monitor.dm b/code/modules/tgui/modules/supermatter_monitor.dm index c0181eeff75..e9ab0b9e6ef 100644 --- a/code/modules/tgui/modules/supermatter_monitor.dm +++ b/code/modules/tgui/modules/supermatter_monitor.dm @@ -20,7 +20,7 @@ var/z = get_z(ui_host()) if(!z) return - var/valid_z_levels = GLOB.using_map.get_map_levels(z) + var/valid_z_levels = (LEGACY_MAP_DATUM).get_map_levels(z) for(var/obj/machinery/power/supermatter/S in GLOB.machines) // Delaminating, not within coverage, not on a tile. if(S.grav_pulling || S.exploded || !(S.z in valid_z_levels) || !istype(S.loc, /turf/)) diff --git a/code/modules/tgui/modules/teleporter.dm b/code/modules/tgui/modules/teleporter.dm index f60482765cd..67e8574dc81 100644 --- a/code/modules/tgui/modules/teleporter.dm +++ b/code/modules/tgui/modules/teleporter.dm @@ -30,7 +30,7 @@ var/turf/T = get_turf(R) if(!T) continue - if(!(T.z in GLOB.using_map.player_levels)) + if(!(T.z in (LEGACY_MAP_DATUM).player_levels)) continue var/tmpname = T.loc.name if(areaindex[tmpname]) @@ -50,7 +50,7 @@ var/turf/T = get_turf(M) if(T) continue - if(!(T in GLOB.using_map.station_levels)) + if(!(T in (LEGACY_MAP_DATUM).station_levels)) continue var/tmpname = M.real_name if(areaindex[tmpname]) diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm index 59167784ebc..ae4a1bac131 100644 --- a/code/modules/tgui/states/default.dm +++ b/code/modules/tgui/states/default.dm @@ -44,7 +44,7 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new) // Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras) // unless it's on the same level as the object it's interacting with. var/turf/T = get_turf(src_object) - if(!T || !(z == T.z || (T.z in GLOB.using_map.player_levels))) + if(!T || !(z == T.z || (T.z in (LEGACY_MAP_DATUM).player_levels))) return UI_CLOSE // If an object is in view then we can interact with it diff --git a/code/modules/unit_tests/chain_pull_through_space.dm b/code/modules/unit_tests/chain_pull_through_space.dm index b718da91c2c..5d7cf1c33e8 100644 --- a/code/modules/unit_tests/chain_pull_through_space.dm +++ b/code/modules/unit_tests/chain_pull_through_space.dm @@ -11,7 +11,7 @@ ..() //reserve a tile that is always empty for our z destination - reserved = SSmapping.RequestBlockReservation(5,5) + reserved = SSmapping.request_block_reservation(5,5) // Create a space tile that goes to another z-level claimed_tile = run_loc_floor_bottom_left.type diff --git a/code/modules/unit_tests/map_template_paths.dm b/code/modules/unit_tests/map_template_paths.dm index f005bed2299..7254cb36dc8 100644 --- a/code/modules/unit_tests/map_template_paths.dm +++ b/code/modules/unit_tests/map_template_paths.dm @@ -13,5 +13,5 @@ if(!fexists(initial(S.prefix) + initial(S.suffix))) TEST_FAIL("Failed to resolve [path]'s prefix+suffix to a file - [initial(S.prefix) + initial(S.suffix)].") continue - if(!fexists("[initial(M.mappath)]")) - TEST_FAIL("Failed to resolve [path]'s initial mappath to a file - [initial(M.mappath)].") + if(!fexists("[initial(M.map_path)]")) + TEST_FAIL("Failed to resolve [path]'s initial map_path to a file - [initial(M.map_path)].") diff --git a/code/modules/unit_tests/map_tests.dm b/code/modules/unit_tests/map_tests.dm index 84683c2ed85..aa5fb271bbd 100644 --- a/code/modules/unit_tests/map_tests.dm +++ b/code/modules/unit_tests/map_tests.dm @@ -35,11 +35,11 @@ ) // Some maps have areas specific to the map, so include those. - exempt_areas += GLOB.using_map.unit_test_exempt_areas.Copy() - exempt_from_atmos += GLOB.using_map.unit_test_exempt_from_atmos.Copy() - exempt_from_apc += GLOB.using_map.unit_test_exempt_from_apc.Copy() + exempt_areas += (LEGACY_MAP_DATUM).unit_test_exempt_areas.Copy() + exempt_from_atmos += (LEGACY_MAP_DATUM).unit_test_exempt_from_atmos.Copy() + exempt_from_apc += (LEGACY_MAP_DATUM).unit_test_exempt_from_apc.Copy() - var/list/zs_to_test = GLOB.using_map.unit_test_z_levels || list(1) //Either you set it, or you just get z1 + var/list/zs_to_test = (LEGACY_MAP_DATUM).unit_test_z_levels || list(1) //Either you set it, or you just get z1 for(var/area/A in GLOB.sortedAreas) if((A.z in zs_to_test) && !(A.type in exempt_areas)) diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm index ca53ec723cf..6bac63c9ea0 100644 --- a/code/modules/unit_tests/unit_test.dm +++ b/code/modules/unit_tests/unit_test.dm @@ -47,15 +47,14 @@ GLOBAL_VAR_INIT(focused_test, focused_test()) var/list/allocated var/list/fail_reasons - var/static/datum/space_level/reservation + var/static/datum/map_level/reservation /proc/cmp_unit_test_priority(datum/unit_test/a, datum/unit_test/b) return initial(a.priority) - initial(b.priority) /datum/unit_test/New() if (isnull(reservation)) - var/datum/map_template/unit_tests/template = new - reservation = template.load_new_z() + reservation = SSmapping.load_level(new /datum/map_level/unit_tests) allocated = new run_loc_floor_bottom_left = get_turf(locate(/obj/landmark/unit_test_bottom_left) in GLOB.landmarks_list) @@ -129,7 +128,7 @@ GLOBAL_VAR_INIT(focused_test, focused_test()) /// Logs a test message. Will use GitHub action syntax found at https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions /datum/unit_test/proc/log_for_test(text, priority, file, line) - var/map_name = SSmapping.config.map_name + var/map_name = (LEGACY_MAP_DATUM).name // Need to escape the text to properly support newlines. var/annotation_text = replacetext(text, "%", "%25") @@ -211,6 +210,7 @@ GLOBAL_VAR_INIT(focused_test, focused_test()) //We have to call this manually because del_text can preceed us, and SSticker doesn't fire in the post game SSticker.standard_reboot() -/datum/map_template/unit_tests +/datum/map_level/unit_tests + id = "__UnitTestLevel" name = "Unit Tests Zone" - mappath = "maps/templates/unit_tests.dmm" + absolute_path = "maps/templates/unit_tests.dmm" diff --git a/code/modules/vore/fluffstuff/custom_items.dm b/code/modules/vore/fluffstuff/custom_items.dm index d2ac8c8b0cf..7bfebfc2c4e 100644 --- a/code/modules/vore/fluffstuff/custom_items.dm +++ b/code/modules/vore/fluffstuff/custom_items.dm @@ -962,7 +962,7 @@ var/turf/uT = get_turf(user) var/turf/dT = get_turf(destination) var/list/dat = list() - dat["z_level_detection"] = GLOB.using_map.get_map_levels(uT.z, TRUE) + dat["z_level_detection"] = (LEGACY_MAP_DATUM).get_map_levels(uT.z, TRUE) if(!uT || !dT) return FALSE diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index 64fc61f76b2..9cc857faac8 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -24,15 +24,15 @@ if(O.started_as_observer) continue // They are just a pure observer, ignore // Died and were not cloned - Respawn at centcomm - persist_interround_data(Player, GLOB.using_map.spawnpoint_died) + persist_interround_data(Player, (LEGACY_MAP_DATUM).spawnpoint_died) else var/turf/playerTurf = get_turf(Player) if(isAdminLevel(playerTurf.z)) // Evac'd - Next round they arrive on the shuttle. - persist_interround_data(Player, GLOB.using_map.spawnpoint_left) + persist_interround_data(Player, (LEGACY_MAP_DATUM).spawnpoint_left) else // Stayed on station, go to dorms - persist_interround_data(Player, GLOB.using_map.spawnpoint_stayed) + persist_interround_data(Player, (LEGACY_MAP_DATUM).spawnpoint_stayed) return 1 /** diff --git a/maps/rift/icons/mob/rft_hood.dmi b/icons/legacy_rift_icons/mob/rft_hood.dmi similarity index 100% rename from maps/rift/icons/mob/rft_hood.dmi rename to icons/legacy_rift_icons/mob/rft_hood.dmi diff --git a/maps/rift/icons/mob/rft_suit.dmi b/icons/legacy_rift_icons/mob/rft_suit.dmi similarity index 100% rename from maps/rift/icons/mob/rft_suit.dmi rename to icons/legacy_rift_icons/mob/rft_suit.dmi diff --git a/maps/rift/icons/mob/rft_weapons.dmi b/icons/legacy_rift_icons/mob/rft_weapons.dmi similarity index 100% rename from maps/rift/icons/mob/rft_weapons.dmi rename to icons/legacy_rift_icons/mob/rft_weapons.dmi diff --git a/maps/rift/icons/mob/species/teshari/rft_suit.dmi b/icons/legacy_rift_icons/mob/species/teshari/rft_suit.dmi similarity index 100% rename from maps/rift/icons/mob/species/teshari/rft_suit.dmi rename to icons/legacy_rift_icons/mob/species/teshari/rft_suit.dmi diff --git a/maps/rift/icons/mob/species/teshari/rft_uniform.dmi b/icons/legacy_rift_icons/mob/species/teshari/rft_uniform.dmi similarity index 100% rename from maps/rift/icons/mob/species/teshari/rft_uniform.dmi rename to icons/legacy_rift_icons/mob/species/teshari/rft_uniform.dmi diff --git a/maps/rift/icons/obj/rft_accessory.dmi b/icons/legacy_rift_icons/obj/rft_accessory.dmi similarity index 100% rename from maps/rift/icons/obj/rft_accessory.dmi rename to icons/legacy_rift_icons/obj/rft_accessory.dmi diff --git a/maps/rift/icons/obj/rft_hood.dmi b/icons/legacy_rift_icons/obj/rft_hood.dmi similarity index 100% rename from maps/rift/icons/obj/rft_hood.dmi rename to icons/legacy_rift_icons/obj/rft_hood.dmi diff --git a/maps/rift/icons/obj/rft_suit.dmi b/icons/legacy_rift_icons/obj/rft_suit.dmi similarity index 100% rename from maps/rift/icons/obj/rft_suit.dmi rename to icons/legacy_rift_icons/obj/rft_suit.dmi diff --git a/maps/rift/icons/obj/rft_weapons.dmi b/icons/legacy_rift_icons/obj/rft_weapons.dmi similarity index 100% rename from maps/rift/icons/obj/rft_weapons.dmi rename to icons/legacy_rift_icons/obj/rft_weapons.dmi diff --git a/maps/Generic/death_triggers.dm b/maps/Generic/death_triggers.dm index ec3dd71bbe9..a87073ea457 100644 --- a/maps/Generic/death_triggers.dm +++ b/maps/Generic/death_triggers.dm @@ -17,7 +17,7 @@ last_sound = world.time playsound(src, 'sound/effects/supermatter.ogg', 75, 1) if(ismob(A) && prob(5))//lucky day - var/destturf = locate(rand(5,world.maxx-5),rand(5,world.maxy-5),pick(GLOB.using_map.station_levels)) + var/destturf = locate(rand(5,world.maxx-5),rand(5,world.maxy-5),pick((LEGACY_MAP_DATUM).station_levels)) new /datum/teleport/instant(A, destturf, 0, 1, null, null, null, 'sound/effects/phasein.ogg') else return ..() diff --git a/maps/away_missions/140x140/carpfarm.dmm b/maps/away_missions/140x140/carpfarm.dmm index 13aa1f6871c..1838c50079d 100644 --- a/maps/away_missions/140x140/carpfarm.dmm +++ b/maps/away_missions/140x140/carpfarm.dmm @@ -513,7 +513,7 @@ name = "interior access button"; pixel_x = 26; pixel_y = -26; - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled, /area/awaymission/carpfarm/base) @@ -562,7 +562,7 @@ id_tag = "carp_inner"; locked = 1; name = "External Access"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden, /turf/simulated/floor/plating, @@ -663,7 +663,7 @@ id_tag = "carp_outer"; locked = 1; name = "External Access"; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/plating, /area/awaymission/carpfarm/base) @@ -684,7 +684,7 @@ name = "exterior access button"; pixel_x = 26; pixel_y = 26; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/airless, /area/awaymission/carpfarm/base) diff --git a/maps/away_missions/140x140/snow_outpost.dmm b/maps/away_missions/140x140/snow_outpost.dmm index 664cf72a2aa..9787962f214 100644 --- a/maps/away_missions/140x140/snow_outpost.dmm +++ b/maps/away_missions/140x140/snow_outpost.dmm @@ -235,7 +235,7 @@ /area/awaymission/snow_outpost/powered) "aR" = ( /obj/mecha/combat/marauder/mauler{ - operation_req_access = newlist() + operation_req_access = list() }, /turf/simulated/floor/bluegrid{ name = "Mainframe Base"; diff --git a/maps/citadel_minitest/citadel_minitest.dm b/maps/citadel_minitest/citadel_minitest.dm index d4b9fb07593..cb205a11a88 100644 --- a/maps/citadel_minitest/citadel_minitest.dm +++ b/maps/citadel_minitest/citadel_minitest.dm @@ -13,7 +13,7 @@ #include "../../maps/map_files/mini_test/citadel_minitest-sector-2.dmm" #include "../../maps/map_files/mini_test/citadel_minitest-sector-3.dmm" - #define USING_MAP_DATUM /datum/map/citadel_minitest + #define USING_MAP_DATUM /datum/map/station/citadel_minitest #warning Please uncheck citadel_minitest.dm before committing. diff --git a/maps/citadel_minitest/citadel_minitest_defines.dm b/maps/citadel_minitest/citadel_minitest_defines.dm index 7b9c5393b74..278635624fc 100644 --- a/maps/citadel_minitest/citadel_minitest_defines.dm +++ b/maps/citadel_minitest/citadel_minitest_defines.dm @@ -1,7 +1,7 @@ #define Z_LEVEL_MAIN_CITADEL_TESTING 1 -/datum/map/citadel_minitest +/datum/map/station/citadel_minitest name = "Virgo_minitest" full_name = "NSS Citadel Testing Facility" path = "citadel_minitest" @@ -68,7 +68,7 @@ allowed_spawns = list("Arrivals Shuttle") -/datum/map/citadel_minitest/perform_map_generation() +/datum/map/station/citadel_minitest/perform_map_generation() /* new /datum/random_map/automata/cave_system(null, 1, 1, Z_LEVEL_MAIN_CITADEL_TESTING, world.maxx, world.maxy) new /datum/random_map/noise/ore(null, 1, 1, Z_LEVEL_MAIN_CITADEL_TESTING, 64, 64) diff --git a/maps/map_files/NSV_Euthenia/Euthenia_Deck_1.dmm b/maps/map_files/NSV_Euthenia/Euthenia_Deck_1.dmm index 2ac18ed38a7..41d16ed228e 100644 --- a/maps/map_files/NSV_Euthenia/Euthenia_Deck_1.dmm +++ b/maps/map_files/NSV_Euthenia/Euthenia_Deck_1.dmm @@ -3761,7 +3761,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ dir = 4 @@ -6552,7 +6552,7 @@ "eGe" = ( /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/structure/cable/green{ icon_state = "4-8" @@ -7681,7 +7681,7 @@ "fwY" = ( /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/supply, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, @@ -12832,7 +12832,7 @@ /obj/machinery/door/airlock/security{ name = "Internal Affairs"; req_access = list(38); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/blast/regular{ density = 0; @@ -19082,7 +19082,7 @@ /obj/machinery/door/airlock/security{ name = "Internal Affairs"; req_access = list(38); - req_one_access = newlist() + req_one_access = list() }, /obj/structure/cable/green{ icon_state = "4-8" @@ -21475,7 +21475,7 @@ "pTR" = ( /obj/machinery/door/airlock/glass_security{ name = "Briefing Room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,38) }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ @@ -21831,7 +21831,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 4 @@ -31838,7 +31838,7 @@ "xVu" = ( /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/tiled, /area/security/security_equiptment_storage) diff --git a/maps/map_files/NSV_Euthenia/Euthenia_Deck_3.dmm b/maps/map_files/NSV_Euthenia/Euthenia_Deck_3.dmm index eb62e5af8a2..9fd324a630d 100644 --- a/maps/map_files/NSV_Euthenia/Euthenia_Deck_3.dmm +++ b/maps/map_files/NSV_Euthenia/Euthenia_Deck_3.dmm @@ -1349,8 +1349,8 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/command{ name = "Private Restroom"; - req_access = newlist(); - req_one_access = newlist() + req_access = list(); + req_one_access = list() }, /turf/simulated/floor/tiled/white, /area/crew_quarters/captain) @@ -2971,8 +2971,7 @@ /area/space) "cIP" = ( /obj/machinery/door/airlock{ - name = "Chapel Office"; - req_access = s + name = "Chapel Office" }, /obj/machinery/door/firedoor, /turf/simulated/floor/tiled/dark, diff --git a/maps/map_files/mini_test/citadel_minitest-sector-2.dmm b/maps/map_files/mini_test/citadel_minitest-sector-2.dmm index 8fedcc0994f..a7a178762b7 100644 --- a/maps/map_files/mini_test/citadel_minitest-sector-2.dmm +++ b/maps/map_files/mini_test/citadel_minitest-sector-2.dmm @@ -513,7 +513,7 @@ name = "interior access button"; pixel_x = 26; pixel_y = -26; - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled, /area/awaymission) @@ -562,7 +562,7 @@ id_tag = "carp_inner"; locked = 1; name = "External Access"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden, /turf/simulated/floor/plating, @@ -663,7 +663,7 @@ id_tag = "carp_outer"; locked = 1; name = "External Access"; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/plating, /area/awaymission) @@ -684,7 +684,7 @@ name = "exterior access button"; pixel_x = 26; pixel_y = 26; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/airless, /area/awaymission) diff --git a/maps/map_files/tether/tether-01-surface1.dmm b/maps/map_files/tether/tether-01-surface1.dmm index cc47b427900..caf6f75e807 100644 --- a/maps/map_files/tether/tether-01-surface1.dmm +++ b/maps/map_files/tether/tether-01-surface1.dmm @@ -5189,7 +5189,7 @@ dir = 8 }, /obj/machinery/door/airlock/maintenance/common{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/plating, /area/maintenance/lower/mining_eva) @@ -9957,7 +9957,7 @@ "arH" = ( /obj/machinery/door/airlock/glass_medical{ name = "First-Aid Station"; - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ @@ -29552,7 +29552,7 @@ id = "holodeck"; pixel_x = 35; range = 14; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 10 @@ -30209,7 +30209,7 @@ "crZ" = ( /obj/machinery/door/airlock/engineering{ name = "Construction Tram Airlock"; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/tiled/steel_dirty/virgo3b{ outdoors = 0 @@ -31315,7 +31315,7 @@ /area/tether/surfacebase/security/weaponsrange) "gff" = ( /obj/machinery/door/airlock/maintenance/common{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/cyan, /turf/simulated/floor/plating, @@ -31425,7 +31425,7 @@ id_tag = "briginner"; name = "Brig"; req_access = list(2); - req_one_access = newlist() + req_one_access = list() }, /obj/structure/cable/green{ icon_state = "4-8" @@ -32444,7 +32444,7 @@ id_tag = "briginner"; name = "Brig"; req_access = list(2); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /turf/simulated/floor/tiled, @@ -33232,7 +33232,7 @@ id_tag = "brigouter"; name = "Brig"; req_access = list(2); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /turf/simulated/floor/tiled, @@ -35150,7 +35150,7 @@ "qpp" = ( /obj/machinery/door/airlock/glass_engineering{ name = "Construction Tram Airlock"; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/tiled/steel_dirty/virgo3b{ outdoors = 0 @@ -37121,7 +37121,7 @@ id_tag = "brigouter"; name = "Brig"; req_access = list(2); - req_one_access = newlist() + req_one_access = list() }, /obj/structure/cable/green{ icon_state = "4-8" diff --git a/maps/map_files/tether/tether-02-surface2.dmm b/maps/map_files/tether/tether-02-surface2.dmm index cabc4067519..b9f76c5e4a4 100644 --- a/maps/map_files/tether/tether-02-surface2.dmm +++ b/maps/map_files/tether/tether-02-surface2.dmm @@ -4163,7 +4163,7 @@ "agE" = ( /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/structure/cable/green{ icon_state = "4-8" @@ -13340,7 +13340,7 @@ "avV" = ( /obj/machinery/door/airlock/security{ name = "Interrogation"; - req_access = newlist(); + req_access = list(); req_one_access = list(2,4) }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, @@ -15996,7 +15996,7 @@ "aBX" = ( /obj/machinery/door/airlock/command{ name = "Teleport Access"; - req_access = newlist(); + req_access = list(); req_one_access = list(17) }, /obj/structure/cable/green{ diff --git a/maps/map_files/tether/tether-03-surface3.dmm b/maps/map_files/tether/tether-03-surface3.dmm index 0115cbac1df..d6c0a521ffc 100644 --- a/maps/map_files/tether/tether-03-surface3.dmm +++ b/maps/map_files/tether/tether-03-surface3.dmm @@ -3024,12 +3024,12 @@ /obj/machinery/door/window/brigdoor/southright{ dir = 4; req_access = list(30, 35, 47, 77); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/window/brigdoor/southright{ dir = 8; req_access = list(30, 35, 47, 77); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /turf/simulated/floor/tiled, @@ -4802,7 +4802,7 @@ /obj/machinery/door/airlock/security{ name = "Internal Affairs"; req_access = list(38); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/blast/regular{ density = 0; @@ -24857,7 +24857,7 @@ /obj/machinery/door/airlock/security{ name = "Internal Affairs"; req_access = list(38); - req_one_access = newlist() + req_one_access = list() }, /obj/structure/cable/green{ icon_state = "4-8" @@ -35872,7 +35872,7 @@ "fGm" = ( /obj/machinery/door/airlock/glass_security{ name = "Briefing Room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,38) }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ diff --git a/maps/map_files/tether/tether-05-station1.dmm b/maps/map_files/tether/tether-05-station1.dmm index 987be8ce235..3d0bc56ca46 100644 --- a/maps/map_files/tether/tether-05-station1.dmm +++ b/maps/map_files/tether/tether-05-station1.dmm @@ -5023,7 +5023,7 @@ /obj/machinery/door/airlock/engineering{ name = "Engineering Hard Storage"; req_access = list(11); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/steel_grid, /area/engineering/storage) @@ -5043,7 +5043,7 @@ /obj/machinery/door/airlock/engineering{ name = "Engineering Hard Storage"; req_access = list(11); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/steel_grid, /area/engineering/storage) @@ -8182,7 +8182,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Workshop"; - req_access = newlist(); + req_access = list(); req_one_access = list(14,24) }, /turf/simulated/floor/tiled/steel_grid, @@ -8228,7 +8228,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Workshop"; - req_access = newlist(); + req_access = list(); req_one_access = list(14,24) }, /turf/simulated/floor/tiled/steel_grid, @@ -10366,7 +10366,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/command{ name = "Teleport Access"; - req_access = newlist(); + req_access = list(); req_one_access = list(17) }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, @@ -10769,7 +10769,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Workshop"; - req_access = newlist(); + req_access = list(); req_one_access = list(14,24) }, /turf/simulated/floor/tiled/steel_grid, @@ -11518,7 +11518,7 @@ }, /obj/machinery/door/window/southleft{ name = "Jetpack Storage"; - req_access = newlist(); + req_access = list(); req_one_access = list(11,24) }, /obj/structure/table/rack{ @@ -11693,7 +11693,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Workshop"; - req_access = newlist(); + req_access = list(); req_one_access = list(14,24) }, /turf/simulated/floor/tiled/steel_grid, @@ -13254,7 +13254,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Workshop"; - req_access = newlist(); + req_access = list(); req_one_access = list(14,24) }, /turf/simulated/floor/tiled/steel_grid, @@ -16205,7 +16205,7 @@ }, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Lobby"; - req_one_access = newlist() + req_one_access = list() }, /obj/structure/cable{ icon_state = "1-2" @@ -17026,7 +17026,7 @@ /area/shuttle/securiship/general) "cBc" = ( /obj/machinery/door/window/brigdoor/westleft{ - req_access = newlist(); + req_access = list(); req_one_access = list(5,67) }, /obj/structure/cable{ @@ -21831,7 +21831,7 @@ /area/maintenance/station/eng_lower) "oPI" = ( /obj/machinery/door/window/brigdoor/westright{ - req_access = newlist(); + req_access = list(); req_one_access = list(5,67) }, /obj/structure/cable{ @@ -24310,7 +24310,7 @@ }, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Lobby"; - req_one_access = newlist() + req_one_access = list() }, /obj/structure/disposalpipe/segment, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, diff --git a/maps/map_files/tether/tether-06-station2.dmm b/maps/map_files/tether/tether-06-station2.dmm index c8c027acb68..172317c6ed8 100644 --- a/maps/map_files/tether/tether-06-station2.dmm +++ b/maps/map_files/tether/tether-06-station2.dmm @@ -2879,7 +2879,7 @@ /obj/machinery/door/airlock/highsecurity{ name = "Secure Tech Storage"; req_access = list(19,23); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ dir = 4 @@ -2971,7 +2971,7 @@ /obj/machinery/door/airlock/engineering{ name = "Tech Storage"; req_access = list(23); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/plating, /area/storage/tech) @@ -5917,7 +5917,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_command{ name = "E.V.A."; - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/universal{ dir = 4 diff --git a/maps/map_files/triumph/triumph-01-deck1.dmm b/maps/map_files/triumph/triumph-01-deck1.dmm index aaafb727605..dd18f03d922 100644 --- a/maps/map_files/triumph/triumph-01-deck1.dmm +++ b/maps/map_files/triumph/triumph-01-deck1.dmm @@ -2574,7 +2574,7 @@ /obj/machinery/door/airlock/highsecurity{ name = "Secure Tech Storage"; req_access = list(19,23); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ dir = 4 @@ -8925,7 +8925,7 @@ /obj/machinery/door/airlock/engineering{ name = "Tech Storage"; req_access = list(23); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ diff --git a/maps/map_files/triumph/triumph-02-deck2.dmm b/maps/map_files/triumph/triumph-02-deck2.dmm index 0a3b87d390a..7d7e2ccc103 100644 --- a/maps/map_files/triumph/triumph-02-deck2.dmm +++ b/maps/map_files/triumph/triumph-02-deck2.dmm @@ -5686,7 +5686,7 @@ /obj/machinery/door/airlock/freezer{ name = "Cafe Backroom"; req_access = list(28); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ dir = 4 diff --git a/maps/map_files/triumph/triumph-04-deck4.dmm b/maps/map_files/triumph/triumph-04-deck4.dmm index 29e66644219..bd84e1be538 100644 --- a/maps/map_files/triumph/triumph-04-deck4.dmm +++ b/maps/map_files/triumph/triumph-04-deck4.dmm @@ -7469,7 +7469,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_security{ name = "Security Reception"; - req_access = newlist(); + req_access = list(); req_one_access = list(2,4) }, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ @@ -13593,7 +13593,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 4 @@ -14359,7 +14359,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/security{ name = "Interrogation view room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,2,4,38) }, /obj/machinery/atmospherics/pipe/simple/hidden/supply, @@ -17739,7 +17739,7 @@ /obj/machinery/door/airlock/security{ name = "Interrogation"; req_access = list(4); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/supply, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, @@ -20225,7 +20225,7 @@ /obj/machinery/door/airlock/security{ name = "Interrogation"; req_access = list(4); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/dark, /area/security/interrogation) @@ -23527,8 +23527,8 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/command{ name = "Private Restroom"; - req_access = newlist(); - req_one_access = newlist() + req_access = list(); + req_one_access = list() }, /turf/simulated/floor/tiled/white, /area/crew_quarters/captain) @@ -24848,8 +24848,8 @@ "rNO" = ( /obj/machinery/door/airlock/command{ name = "Private Restroom"; - req_access = newlist(); - req_one_access = newlist() + req_access = list(); + req_one_access = list() }, /turf/simulated/floor/tiled, /area/crew_quarters/sleep/CE_quarters) @@ -25609,8 +25609,8 @@ "ssc" = ( /obj/machinery/door/airlock/command{ name = "Private Restroom"; - req_access = newlist(); - req_one_access = newlist() + req_access = list(); + req_one_access = list() }, /turf/simulated/floor/tiled, /area/crew_quarters/sleep/CMO_quarters) @@ -25930,7 +25930,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/security{ name = "Equipment Storage"; - req_access = newlist() + req_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ dir = 4 @@ -29003,7 +29003,7 @@ /obj/machinery/door/window/southright{ name = "Jetpack Storage"; req_access = list(1,2,18); - req_one_access = newlist() + req_one_access = list() }, /obj/item/tank/jetpack/carbondioxide, /obj/item/tank/jetpack/carbondioxide, @@ -32636,8 +32636,8 @@ "xlC" = ( /obj/machinery/door/airlock/command{ name = "Private Restroom"; - req_access = newlist(); - req_one_access = newlist() + req_access = list(); + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /turf/simulated/floor/wood, @@ -33394,7 +33394,7 @@ /obj/machinery/embedded_controller/radio/airlock/airlock_controller{ id_tag = "sec_shuttle_airlock"; pixel_y = 3; - req_access = newlist(); + req_access = list(); req_one_access = list(1,2); tag_airpump = "sec_shuttle_pump"; tag_chamber_sensor = "sec_shuttle_sensor"; @@ -34040,7 +34040,7 @@ /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/security{ name = "Interrogation view room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,2,4,38) }, /obj/structure/cable/green{ diff --git a/maps/map_files/triumph/triumph-05-flagship.dmm b/maps/map_files/triumph/triumph-05-flagship.dmm index cce70b50792..0f61a122344 100644 --- a/maps/map_files/triumph/triumph-05-flagship.dmm +++ b/maps/map_files/triumph/triumph-05-flagship.dmm @@ -4249,7 +4249,7 @@ /obj/machinery/door/airlock/highsecurity{ desc = "SHIT IS LIT"; name = "TACTICAL TOILET"; - req_one_access = newlist() + req_one_access = list() }, /turf/unsimulated/floor{ icon_state = "dark" @@ -6888,7 +6888,7 @@ "mO" = ( /obj/machinery/door/airlock/glass_security{ name = "Security"; - req_access = newlist() + req_access = list() }, /turf/unsimulated/floor/steel, /area/centcom/security) @@ -12069,7 +12069,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/button/remote/airlock{ id = "front"; @@ -12120,7 +12120,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /turf/unsimulated/floor{ icon_state = "dark" @@ -13167,7 +13167,7 @@ "yD" = ( /obj/machinery/door/airlock/glass_security{ name = "Security"; - req_access = newlist() + req_access = list() }, /turf/unsimulated/floor{ icon_state = "dark" @@ -13693,7 +13693,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /obj/effect/floor_decal/borderfloorblack{ dir = 8 @@ -14538,7 +14538,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/button/remote/blast_door{ id = "residential"; diff --git a/maps/map_levels/140x140/virgo4_beach.dmm b/maps/map_levels/140x140/virgo4_beach.dmm index 963d3ffae45..dc1c6d19465 100644 --- a/maps/map_levels/140x140/virgo4_beach.dmm +++ b/maps/map_levels/140x140/virgo4_beach.dmm @@ -191,7 +191,7 @@ "aQ" = ( /obj/machinery/vending/boozeomat{ emagged = 1; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/wood, /area/tether_away/beach/resort/janibar) diff --git a/maps/nsv_euthenia/euthenia.dm b/maps/nsv_euthenia/euthenia.dm index 45b1d78021e..945952c41b9 100644 --- a/maps/nsv_euthenia/euthenia.dm +++ b/maps/nsv_euthenia/euthenia.dm @@ -17,7 +17,7 @@ #include "../../_maps/map_files/NLV_Euthenia/Euthenia_Misc.dmm" #include "../../_maps/map_files/NLV_Euthenia/lazy_overmap.dmm" - #define USING_MAP_DATUM /datum/map/euthenia + #define USING_MAP_DATUM /datum/map/station/euthenia #elif !defined(MAP_OVERRIDE) diff --git a/maps/nsv_euthenia/euthenia_defines.dm b/maps/nsv_euthenia/euthenia_defines.dm index 20a40f621e8..af9eb1d8aa0 100644 --- a/maps/nsv_euthenia/euthenia_defines.dm +++ b/maps/nsv_euthenia/euthenia_defines.dm @@ -28,7 +28,7 @@ */ // Camera Networks -/datum/map/euthenia +/datum/map/station/euthenia name = "Euthenia" full_name = "NSV Euthenia" path = "euthenia" @@ -39,7 +39,7 @@ overmap_event_areas = 50 // usable_email_tlds = list("triumph.nt") - zlevel_datum_type = /datum/map_z_level/euthenia + zlevel_datum_type = /datum/map_level/euthenia lobby_icon = 'icons/misc/title_vr.dmi' lobby_screens = list("title1", "title2", "title3", "title4", "title5", "title6", "title7", "title8", "title9") @@ -188,7 +188,7 @@ /datum/planet/classp, /datum/planet/classm) */ -/datum/map/euthenia/perform_map_generation() +/datum/map/station/euthenia/perform_map_generation() return 1 /* // For making the 4-in-1 holomap, we calculate some offsets @@ -202,61 +202,61 @@ #define TRIUMPH_HOLOMAP_MARGIN_Y ((HOLOMAP_ICON_SIZE - (3*TRIUMPH_MAP_SIZE)) / 2) */ // We have a bunch of stuff common to the station z levels -/datum/map_z_level/triumph/ship - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT +/datum/map_level/triumph/ship + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_legend_x = 220 holomap_legend_y = 160 -/datum/map_z_level/triumph/ship/deck_one +/datum/map_level/triumph/ship/deck_one z = Z_LEVEL_DECK_ONE name = "Deck 1" transit_chance = 33 base_turf = /turf/space - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = TRIUMPH_HOLOMAP_MARGIN_X holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*1 -/datum/map_z_level/triumph/ship/deck_two +/datum/map_level/triumph/ship/deck_two z = Z_LEVEL_DECK_TWO name = "Deck 2" transit_chance = 33 base_turf = /turf/simulated/open - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = TRIUMPH_HOLOMAP_MARGIN_X holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*2 -/datum/map_z_level/triumph/ship/deck_three +/datum/map_level/triumph/ship/deck_three z = Z_LEVEL_DECK_THREE name = "Deck 3" transit_chance = 33 base_turf = /turf/simulated/open - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = HOLOMAP_ICON_SIZE - TRIUMPH_HOLOMAP_MARGIN_X - TRIUMPH_MAP_SIZE holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*1 -/datum/map_z_level/triumph/ship/deck_four +/datum/map_level/triumph/ship/deck_four z = Z_LEVEL_DECK_FOUR name = "Deck 4" transit_chance = 33 base_turf = /turf/simulated/open - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = HOLOMAP_ICON_SIZE - TRIUMPH_HOLOMAP_MARGIN_X - TRIUMPH_MAP_SIZE holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*2 -/datum/map_z_level/triumph/colony +/datum/map_level/triumph/colony z = Z_LEVEL_CENTCOM name = "Flagship" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_ADMIN|LEGACY_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT -/datum/map_z_level/triumph/ships +/datum/map_level/triumph/ships z = Z_LEVEL_SHIPS name = "Misc" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT -/datum/map_z_level/triumph/misc +/datum/map_level/triumph/misc z = Z_LEVEL_MISC name = "Misc" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT // Our map is small, if the supermatter is ejected lets not have it just blow up somewhere else /obj/machinery/power/supermatter/touch_map_edge() diff --git a/maps/nsv_triumph/triumph.dm b/maps/nsv_triumph/triumph.dm index 2cb7baf1b75..67df088e58b 100644 --- a/maps/nsv_triumph/triumph.dm +++ b/maps/nsv_triumph/triumph.dm @@ -7,7 +7,7 @@ #include "triumph_overmap.dm" #include "triumph_weather.dm" - #define USING_MAP_DATUM /datum/map/triumph + #define USING_MAP_DATUM /datum/map/station/triumph #include "../../maps/map_files/triumph/triumph-01-deck1.dmm" #include "../../maps/map_files/triumph/triumph-02-deck2.dmm" diff --git a/maps/nsv_triumph/triumph_defines.dm b/maps/nsv_triumph/triumph_defines.dm index e44d61ea5b7..3c0e7eed4a8 100644 --- a/maps/nsv_triumph/triumph_defines.dm +++ b/maps/nsv_triumph/triumph_defines.dm @@ -26,7 +26,7 @@ #define Z_LEVEL_LAVALAND_EAST 22 // Camera Networks -/datum/map/triumph +/datum/map/station/triumph name = "Triumph" full_name = "NSV Triumph" path = "triumph" @@ -37,7 +37,7 @@ overmap_event_areas = 50 usable_email_tlds = list("triumph.nt") - zlevel_datum_type = /datum/map_z_level/triumph + zlevel_datum_type = /datum/map_level/triumph lobby_icon = 'icons/misc/title_vr.dmi' lobby_screens = list("title1", "title2", "title3", "title4", "title5", "title6", "title7", "title8", "title9") @@ -183,7 +183,7 @@ /datum/planet/classp, /datum/planet/classm) -/datum/map/triumph/perform_map_generation() +/datum/map/station/triumph/perform_map_generation() return 1 // For making the 4-in-1 holomap, we calculate some offsets @@ -196,61 +196,87 @@ /// 60 #define TRIUMPH_HOLOMAP_MARGIN_Y ((HOLOMAP_ICON_SIZE - (3*TRIUMPH_MAP_SIZE)) / 2) // We have a bunch of stuff common to the station z levels -/datum/map_z_level/triumph/ship - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT +/datum/map_level/triumph/ship + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_legend_x = 220 holomap_legend_y = 160 -/datum/map_z_level/triumph/ship/deck_one +/datum/map_level/triumph/ship/deck_one z = Z_LEVEL_DECK_ONE name = "Deck 1" transit_chance = 33 base_turf = /turf/space - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = TRIUMPH_HOLOMAP_MARGIN_X holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*1 -/datum/map_z_level/triumph/ship/deck_two +/datum/map_level/triumph/ship/deck_two z = Z_LEVEL_DECK_TWO name = "Deck 2" transit_chance = 33 base_turf = /turf/simulated/open - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = TRIUMPH_HOLOMAP_MARGIN_X holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*2 -/datum/map_z_level/triumph/ship/deck_three +/datum/map_level/triumph/ship/deck_three z = Z_LEVEL_DECK_THREE name = "Deck 3" transit_chance = 33 base_turf = /turf/simulated/open - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = HOLOMAP_ICON_SIZE - TRIUMPH_HOLOMAP_MARGIN_X - TRIUMPH_MAP_SIZE holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*1 -/datum/map_z_level/triumph/ship/deck_four +/datum/map_level/triumph/ship/deck_four z = Z_LEVEL_DECK_FOUR name = "Deck 4" transit_chance = 33 base_turf = /turf/simulated/open - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_offset_x = HOLOMAP_ICON_SIZE - TRIUMPH_HOLOMAP_MARGIN_X - TRIUMPH_MAP_SIZE holomap_offset_y = TRIUMPH_HOLOMAP_MARGIN_Y + TRIUMPH_MAP_SIZE*2 -/datum/map_z_level/triumph/colony +/datum/map_level/triumph/colony z = Z_LEVEL_CENTCOM name = "Flagship" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_ADMIN|LEGACY_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT -/datum/map_z_level/triumph/ships +/datum/map_level/triumph/ships z = Z_LEVEL_SHIPS name = "Misc" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT -/datum/map_z_level/triumph/misc +/datum/map_level/triumph/misc z = Z_LEVEL_MISC name = "Misc" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_ADMIN|MAP_LEVEL_XENOARCH_EXEMPT + +/datum/map_template/lateload/triumph/triumph_misc + name = "Triumph - Misc" + desc = "Misc areas, like some transit areas, holodecks, merc area." + map_path = "maps/map_files/triumph/triumph_misc.dmm" + + associated_map_datum = /datum/map_level/triumph_lateload/ships + + ztraits = list() + +/datum/map_level/triumph_lateload/misc + name = "Misc" + flags = LEGACY_LEVEL_ADMIN|LEGACY_LEVEL_SEALED + +/datum/map_template/lateload/triumph/triumph_ships + name = "Triumph - Ships" + desc = "Ship transit map and whatnot." + map_path = "maps/map_files/triumph/triumph_ships.dmm" + + associated_map_datum = /datum/map_level/triumph_lateload/ships + + ztraits = list() + +/datum/map_level/triumph_lateload/ships + name = "Ships" + flags = LEGACY_LEVEL_ADMIN|LEGACY_LEVEL_SEALED // Our map is small, if the supermatter is ejected lets not have it just blow up somewhere else /obj/machinery/power/supermatter/touch_map_edge() diff --git a/maps/nsv_triumph/triumph_telecomms.dm b/maps/nsv_triumph/triumph_telecomms.dm index d05ff87d1f6..9200c281434 100644 --- a/maps/nsv_triumph/triumph_telecomms.dm +++ b/maps/nsv_triumph/triumph_telecomms.dm @@ -90,24 +90,6 @@ /area/maintenance/station/tcomms name = "\improper Telecoms Maintenance" -/datum/map/tether/default_internal_channels() - return list( - num2text(PUB_FREQ) = list(), - num2text(AI_FREQ) = list(ACCESS_SPECIAL_SILICONS), - num2text(ENT_FREQ) = list(), - num2text(ERT_FREQ) = list(ACCESS_CENTCOM_ERT), - num2text(COMM_FREQ)= list(ACCESS_COMMAND_BRIDGE), - num2text(ENG_FREQ) = list(ACCESS_ENGINEERING_ENGINE, ACCESS_ENGINEERING_ATMOS), - num2text(MED_FREQ) = list(ACCESS_MEDICAL_EQUIPMENT), - num2text(MED_I_FREQ)=list(ACCESS_MEDICAL_EQUIPMENT), - num2text(SEC_FREQ) = list(ACCESS_SECURITY_EQUIPMENT), - num2text(SEC_I_FREQ)=list(ACCESS_SECURITY_EQUIPMENT), - num2text(SCI_FREQ) = list(ACCESS_SCIENCE_FABRICATION,ACCESS_SCIENCE_ROBOTICS,ACCESS_SCIENCE_XENOBIO), - num2text(SUP_FREQ) = list(ACCESS_SUPPLY_BAY), - num2text(SRV_FREQ) = list(ACCESS_GENERAL_JANITOR, ACCESS_GENERAL_BOTANY), - num2text(EXP_FREQ) = list(ACCESS_GENERAL_EXPLORER) - ) - /obj/item/multitool/triumph_buffered name = "pre-linked multitool (tether hub)" desc = "This multitool has already been linked to the Tether telecomms hub and can be used to configure one (1) relay." diff --git a/maps/map_files/rift/rift-01-underground3.dmm b/maps/rift/levels/rift-01-underground3.dmm similarity index 100% rename from maps/map_files/rift/rift-01-underground3.dmm rename to maps/rift/levels/rift-01-underground3.dmm diff --git a/maps/map_files/rift/rift-02-underground2.dmm b/maps/rift/levels/rift-02-underground2.dmm similarity index 99% rename from maps/map_files/rift/rift-02-underground2.dmm rename to maps/rift/levels/rift-02-underground2.dmm index 14e1aeda688..f17634a3669 100644 --- a/maps/map_files/rift/rift-02-underground2.dmm +++ b/maps/rift/levels/rift-02-underground2.dmm @@ -5697,7 +5697,7 @@ /obj/machinery/door/window/southleft{ dir = 4; name = "Hardsuit Storage"; - req_access = newlist(); + req_access = list(); req_one_access = list(11,24) }, /obj/structure/window/reinforced{ @@ -9997,7 +9997,7 @@ }, /obj/machinery/door/airlock/glass_engineering{ name = "Engineering Workshop"; - req_access = newlist(); + req_access = list(); req_one_access = list(14,24) }, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ @@ -13600,7 +13600,7 @@ /obj/machinery/door/window/southleft{ dir = 8; name = "Jetpack Storage"; - req_access = newlist(); + req_access = list(); req_one_access = list(11,24) }, /turf/simulated/floor/tiled, diff --git a/maps/map_files/rift/rift-03-underground1.dmm b/maps/rift/levels/rift-03-underground1.dmm similarity index 99% rename from maps/map_files/rift/rift-03-underground1.dmm rename to maps/rift/levels/rift-03-underground1.dmm index 6651605552d..fa269ac7fb3 100644 --- a/maps/map_files/rift/rift-03-underground1.dmm +++ b/maps/rift/levels/rift-03-underground1.dmm @@ -3272,7 +3272,7 @@ /obj/machinery/door/airlock/highsecurity{ name = "Secure Tech Storage"; req_access = list(19,23); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /obj/machinery/atmospherics/pipe/simple/hidden/supply, @@ -9677,7 +9677,7 @@ /obj/machinery/door/airlock/engineering{ name = "Tech Storage"; req_access = list(23); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /turf/simulated/floor/tiled/steel, diff --git a/maps/map_files/rift/rift-04-surface1.dmm b/maps/rift/levels/rift-04-surface1.dmm similarity index 100% rename from maps/map_files/rift/rift-04-surface1.dmm rename to maps/rift/levels/rift-04-surface1.dmm diff --git a/maps/map_files/rift/rift-05-surface2.dmm b/maps/rift/levels/rift-05-surface2.dmm similarity index 99% rename from maps/map_files/rift/rift-05-surface2.dmm rename to maps/rift/levels/rift-05-surface2.dmm index 671952a397c..cde34988123 100644 --- a/maps/map_files/rift/rift-05-surface2.dmm +++ b/maps/rift/levels/rift-05-surface2.dmm @@ -9023,7 +9023,7 @@ "fzv" = ( /obj/machinery/door/airlock/glass_security{ name = "Security Reception"; - req_access = newlist(); + req_access = list(); req_one_access = list(2,4) }, /obj/machinery/door/firedoor/glass, @@ -10570,7 +10570,7 @@ /obj/effect/floor_decal/borderfloorblack/full, /obj/machinery/door/airlock/security{ name = "Interrogation view room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,2,4,38) }, /obj/structure/cable/green{ @@ -15331,7 +15331,7 @@ /obj/effect/floor_decal/borderfloorblack/full, /obj/machinery/door/airlock/security{ name = "Interrogation view room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,2,4,38) }, /turf/simulated/floor/tiled/dark, @@ -23756,7 +23756,7 @@ "oFY" = ( /obj/machinery/door/airlock/glass_security{ name = "Briefing Room"; - req_access = newlist(); + req_access = list(); req_one_access = list(1,38) }, /obj/structure/cable/green{ @@ -25228,7 +25228,7 @@ /obj/machinery/door/airlock/security{ name = "Interrogation"; req_access = list(4); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /obj/machinery/atmospherics/pipe/simple/hidden/supply, diff --git a/maps/map_files/rift/rift-06-surface3.dmm b/maps/rift/levels/rift-06-surface3.dmm similarity index 100% rename from maps/map_files/rift/rift-06-surface3.dmm rename to maps/rift/levels/rift-06-surface3.dmm diff --git a/maps/map_files/rift/rift-07-west_base.dmm b/maps/rift/levels/rift-07-west_base.dmm similarity index 100% rename from maps/map_files/rift/rift-07-west_base.dmm rename to maps/rift/levels/rift-07-west_base.dmm diff --git a/maps/map_files/rift/rift-08-west_deep.dmm b/maps/rift/levels/rift-08-west_deep.dmm similarity index 100% rename from maps/map_files/rift/rift-08-west_deep.dmm rename to maps/rift/levels/rift-08-west_deep.dmm diff --git a/maps/map_files/rift/rift-09-west_caves.dmm b/maps/rift/levels/rift-09-west_caves.dmm similarity index 100% rename from maps/map_files/rift/rift-09-west_caves.dmm rename to maps/rift/levels/rift-09-west_caves.dmm diff --git a/maps/map_files/rift/rift-10-west_plains.dmm b/maps/rift/levels/rift-10-west_plains.dmm similarity index 100% rename from maps/map_files/rift/rift-10-west_plains.dmm rename to maps/rift/levels/rift-10-west_plains.dmm diff --git a/maps/map_files/rift/rift-11-orbital.dmm b/maps/rift/levels/rift-11-orbital.dmm similarity index 100% rename from maps/map_files/rift/rift-11-orbital.dmm rename to maps/rift/levels/rift-11-orbital.dmm diff --git a/maps/rift/rift.dm b/maps/rift/rift.dm index a6221568c7d..7881d7ab863 100644 --- a/maps/rift/rift.dm +++ b/maps/rift/rift.dm @@ -1,27 +1,404 @@ -#if !defined(USING_MAP_DATUM) +/datum/map/station/rift + id = "rift" + name = "World - Rift" + levels = list( + /datum/map_level/rift/station/underground_floor, + /datum/map_level/rift/station/underground_deep, + /datum/map_level/rift/station/underground_shallow, + /datum/map_level/rift/station/surface_low, + /datum/map_level/rift/station/surface_mid, + /datum/map_level/rift/station/surface_high, + /datum/map_level/rift/base, + /datum/map_level/rift/deep, + /datum/map_level/rift/caves, + /datum/map_level/rift/plains, + /datum/map_level/rift/colony, + ) + width = 192 + height = 192 + lateload = list( + /datum/map/sector/debrisfield_192, + /datum/map/sector/piratebase_192, + /datum/map/sector/mining_192, + /datum/map/sector/gaia_192, + /datum/map/sector/frozen_192, + /datum/map/sector/wasteland_192, + /datum/map/sector/tradeport_192, + /datum/map/sector/lavaland_192, + /datum/map/sector/miaphus_192, + /datum/map/sector/roguemining_192/one, + ) - #include "rift_defines.dm" - #include "rift_shuttle_defs.dm" - #include "rift_shuttles.dm" - #include "rift_telecomms.dm" - #include "rift_weather.dm" + //* LEGACY BELOW *// - #define USING_MAP_DATUM /datum/map/rift + legacy_assert_shuttle_datums = list( + /datum/shuttle/autodock/ferry/emergency/escape, + /datum/shuttle/autodock/overmap/excursion, + /datum/shuttle/autodock/overmap/courser, + /datum/shuttle/autodock/overmap/hammerhead, + /datum/shuttle/autodock/overmap/civvie, + /datum/shuttle/autodock/overmap/emt, + /datum/shuttle/autodock/ferry/supply/cargo, + /datum/shuttle/autodock/ferry/belter, + ) + legacy_persistence_id = "rift" + full_name = "NSB Atlas" + use_overmap = TRUE + overmap_size = 60 + overmap_event_areas = 50 + usable_email_tlds = list("lythios.nt") - #include "../../maps/map_files/rift/rift-01-underground3.dmm" - #include "../../maps/map_files/rift/rift-02-underground2.dmm" - #include "../../maps/map_files/rift/rift-03-underground1.dmm" - #include "../../maps/map_files/rift/rift-04-surface1.dmm" - #include "../../maps/map_files/rift/rift-05-surface2.dmm" - #include "../../maps/map_files/rift/rift-06-surface3.dmm" - #include "../../maps/map_files/rift/rift-07-west_base.dmm" - #include "../../maps/map_files/rift/rift-08-west_deep.dmm" - #include "../../maps/map_files/rift/rift-09-west_caves.dmm" - #include "../../maps/map_files/rift/rift-10-west_plains.dmm" - #include "../../maps/map_files/rift/rift-11-orbital.dmm" + titlescreens = list( + /datum/cutscene/browser/simple/rift_title1 = 20, + list( + 'icons/misc/title_vr.dmi', + "title1", + ), + list( + 'icons/misc/title_vr.dmi', + "title2", + ), + list( + 'icons/misc/title_vr.dmi', + "title3", + ), + list( + 'icons/misc/title_vr.dmi', + "title4", + ), + list( + 'icons/misc/title_vr.dmi', + "title5", + ), + list( + 'icons/misc/title_vr.dmi', + "title6", + ), + list( + 'icons/misc/title_vr.dmi', + "title7", + ), + list( + 'icons/misc/title_vr.dmi', + "title8", + ), + list( + 'icons/misc/title_vr.dmi', + "bnny", + ), + ) -#elif !defined(MAP_OVERRIDE) + station_name = "NSB Atlas" + station_short = "Atlas" + dock_name = "NTS Demeter" + dock_type = "surface" + boss_name = "Central Command" + boss_short = "CentCom" + company_name = "NanoTrasen" + company_short = "NT" + starsys_name = "Lythios-43" - #warn A map has already been included, ignoring Rift + shuttle_docked_message = "The scheduled NSV Herrera shuttle flight to the %dock_name% orbital relay has arrived. It will depart in approximately %ETD%." + shuttle_leaving_dock = "The NSV Herrera has left the station. Estimate %ETA% until the shuttle arrives at the %dock_name% orbital relay." + shuttle_called_message = "A scheduled crew transfer to the %dock_name% orbital relay is occuring. The NSV Herrera will be arriving shortly. Those departing should proceed to departures within %ETA%." + shuttle_name = "NSV Herrera" + shuttle_recall_message = "The scheduled crew transfer flight has been cancelled." + emergency_shuttle_docked_message = "The evacuation flight has landed at the landing pad. You have approximately %ETD% to board the vessel." + emergency_shuttle_leaving_dock = "The emergency flight has left the station. Estimate %ETA% until the vessel arrives at %dock_name% orbital relay." + emergency_shuttle_called_message = "An emergency evacuation has begun, and an emergency response flight has been called. It will arrive at the landing pad in approximately %ETA%." + emergency_shuttle_recall_message = "The evacuation flight has been cancelled." -#endif + station_networks = list( + NETWORK_CARGO, + NETWORK_CIRCUITS, + NETWORK_CIVILIAN, + NETWORK_COMMAND, + NETWORK_ENGINE, + NETWORK_ENGINEERING, + NETWORK_EXPLORATION, + //NETWORK_DEFAULT, //Is this even used for anything? Robots show up here, but they show up in ROBOTS network too, + NETWORK_MEDICAL, + NETWORK_MINE, + NETWORK_OUTSIDE, + NETWORK_RESEARCH, + NETWORK_RESEARCH_OUTPOST, + NETWORK_ROBOTS, + NETWORK_SECURITY, + NETWORK_TCOMMS, + NETWORK_LYTHIOS, + NETWORK_EXPLO_HELMETS + ) + secondary_networks = list( + NETWORK_ERT, + NETWORK_MERCENARY, + NETWORK_THUNDER, + NETWORK_COMMUNICATORS, + NETWORK_ALARM_ATMOS, + NETWORK_ALARM_POWER, + NETWORK_ALARM_FIRE, + NETWORK_TALON_HELMETS, + NETWORK_TALON_SHIP + ) + + bot_patrolling = FALSE + + allowed_spawns = list("Shuttle Bay","Beruang Trading Corp Cryo","Cryogenic Storage") + spawnpoint_died = /datum/spawnpoint/shuttle + spawnpoint_left = /datum/spawnpoint/shuttle + spawnpoint_stayed = /datum/spawnpoint/cryo + + meteor_strike_areas = null + + unit_test_exempt_areas = list( + /area/rift/surfacebase/outside/outside1, + /area/rift/turbolift, + /area/vacant/vacant_site, + /area/vacant/vacant_site/east, + /area/crew_quarters/sleep/Dorm_1/holo, + /area/crew_quarters/sleep/Dorm_3/holo, + /area/crew_quarters/sleep/Dorm_5/holo, + /area/crew_quarters/sleep/Dorm_7/holo, + /area/rnd/miscellaneous_lab) + + unit_test_exempt_from_atmos = list( + /area/engineering/atmos_intake, // Outside, + /area/rnd/external) // Outside, + +/datum/map_level/rift/station/underground_floor + id = "RiftUnderground3" + name = "Rift - East Canyon" + display_id = "atlas-underground-3" + display_name = "NSB Atlas Underground -3 (Canyon)" + absolute_path = "maps/rift/levels/rift-01-underground3.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_FACILITY_SAFETY, + ZTRAIT_GRAVITY, + ) + base_turf = /turf/simulated/floor/outdoors/safeice/lythios43c + flags = LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|LEGACY_LEVEL_SEALED + planet_path = /datum/planet/lythios43c + link_above = /datum/map_level/rift/station/underground_deep + +/datum/map_level/rift/station/underground_floor/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/station/underground_deep + id = "RiftUnderground2" + name = "Rift - Underground 2" + display_id = "atlas-underground-2" + display_name = "NSB Atlas Underground -2 (Engineering Deck)" + absolute_path = "maps/rift/levels/rift-02-underground2.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_FACILITY_SAFETY, + ZTRAIT_GRAVITY, + ZTRAIT_LEGACY_HOLOMAP_SMOOSH, + ) + base_turf = /turf/simulated/floor/outdoors/safeice/lythios43c + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|LEGACY_LEVEL_SEALED + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/station/underground_floor + link_above = /datum/map_level/rift/station/underground_shallow + +/datum/map_level/rift/station/underground_deep/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/station/underground_shallow + id = "RiftUnderground1" + name = "Rift - Underground 1" + display_id = "atlas-underground-1" + display_name = "NSB Atlas Underground -1 (Maintenance Deck)" + absolute_path = "maps/rift/levels/rift-03-underground1.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_FACILITY_SAFETY, + ZTRAIT_GRAVITY, + ZTRAIT_LEGACY_HOLOMAP_SMOOSH, + ) + base_turf = /turf/simulated/open + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|LEGACY_LEVEL_SEALED + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/station/underground_deep + link_above = /datum/map_level/rift/station/surface_low + +/datum/map_level/rift/station/underground_shallow/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/station/surface_low + id = "RiftSurface1" + name = "Rift - Surface 1" + display_id = "atlas-surface-1" + display_name = "NSB Atlas Surface 1 (Logistics Deck)" + absolute_path = "maps/rift/levels/rift-04-surface1.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_FACILITY_SAFETY, + ZTRAIT_GRAVITY, + ZTRAIT_LEGACY_HOLOMAP_SMOOSH, + ) + base_turf = /turf/simulated/open + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/station/underground_shallow + link_above = /datum/map_level/rift/station/surface_mid + +/datum/map_level/rift/station/surface_low/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/station/surface_mid + id = "RiftSurface2" + name = "Rift - Surface 2" + display_id = "atlas-surface-2" + display_name = "NSB Atlas Surface 2 (Operations Deck)" + absolute_path = "maps/rift/levels/rift-05-surface2.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_FACILITY_SAFETY, + ZTRAIT_GRAVITY, + ZTRAIT_LEGACY_HOLOMAP_SMOOSH, + ) + base_turf = /turf/simulated/open + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/station/surface_low + link_above = /datum/map_level/rift/station/surface_high + +/datum/map_level/rift/station/surface_mid/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/station/surface_high + id = "RiftSurface3" + name = "Rift - Surface 3" + display_id = "atlas-surface-3" + display_name = "NSB Atlas Surface 3 (Command Deck)" + absolute_path = "maps/rift/levels/rift-06-surface3.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_FACILITY_SAFETY, + ZTRAIT_GRAVITY, + ZTRAIT_LEGACY_HOLOMAP_SMOOSH, + ) + base_turf = /turf/simulated/open + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/station/surface_mid + +/datum/map_level/rift/station/surface_high/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/base + id = "RiftWestUnderground3" + name = "Rift - West Canyon" + display_id = "atlas-west-canyon" + display_name = "NSB Atlas Western Canyons" + absolute_path = "maps/rift/levels/rift-07-west_base.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_GRAVITY, + ) + base_turf = /turf/simulated/mineral/floor/icerock/lythios43c/indoors + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER + planet_path = /datum/planet/lythios43c + link_above = /datum/map_level/rift/deep + +/datum/map_level/rift/base/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 50, + /area/rift/surfacebase/outside/west_base/submap_seedzone, /datum/map_template/submap/level_specific/rift/west_base, + ) + ) + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/deep + id = "RiftWestUnderground2" + name = "Rift - West Caves (Deep)" + display_id = "atlas-west-deep" + display_name = "NSB Atlas Western Caves - Deep" + absolute_path = "maps/rift/levels/rift-08-west_deep.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_GRAVITY, + ZTRAIT_LEGACY_BELTER_DOCK, + ) + base_turf = /turf/simulated/mineral/floor/icerock/lythios43c/indoors + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_PLAYER + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/base + link_above = /datum/map_level/rift/caves + +/datum/map_level/rift/deep/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 50, + /area/rift/surfacebase/outside/west_deep/submap_seedzone, /datum/map_template/submap/level_specific/rift/west_deep, + ) + ) + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/caves + id = "RiftWestUnderground1" + name = "Rift - West Caves (Shallow)" + display_id = "atlas-west-caves" + display_name = "NSB Atlas Western Caves - Shallow" + absolute_path = "maps/rift/levels/rift-09-west_caves.dmm" + traits = list( + ZTRAIT_STATION, + ZTRAIT_GRAVITY, + ) + base_turf = /turf/simulated/mineral/floor/icerock/lythios43c/indoors + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_PLAYER + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/deep + link_above = /datum/map_level/rift/plains + +/datum/map_level/rift/caves/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 50, + /area/rift/surfacebase/outside/west_caves/submap_seedzone, /datum/map_template/submap/level_specific/rift/west_caves, + ) + ) + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 3, world.maxy - 3) + +/datum/map_level/rift/plains + id = "RiftWestSurface1" + name = "Rift - Western Plains" + display_id = "atlas-west-plains" + display_name = "NSB Atlas Western Plains" + absolute_path = "maps/rift/levels/rift-10-west_plains.dmm" + base_turf = /turf/simulated/floor/outdoors/safeice/lythios43c + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER + planet_path = /datum/planet/lythios43c + link_below = /datum/map_level/rift/caves + link_east = /datum/map_level/rift/station/surface_low + +/datum/map_level/rift/colony + id = "RiftOrbitalRelay" + name = "Rift - Orbital Relay" + display_id = "atlas-relay" + display_name = "NSB Atlas Orbital Relay" + absolute_path = "maps/rift/levels/rift-11-orbital.dmm" + flags = LEGACY_LEVEL_ADMIN|LEGACY_LEVEL_CONTACT + traits = list( + ZTRAIT_LEGACY_BELTER_TRANSIT, + ) diff --git a/maps/rift/rift_defines.dm b/maps/rift/rift_defines.dm deleted file mode 100644 index 71f962f6b0e..00000000000 --- a/maps/rift/rift_defines.dm +++ /dev/null @@ -1,465 +0,0 @@ -//Normal map defs -#define Z_LEVEL_UNDERGROUND_FLOOR 2 -#define Z_LEVEL_UNDERGROUND_DEEP 3 -#define Z_LEVEL_UNDERGROUND 4 -#define Z_LEVEL_SURFACE_LOW 5 -#define Z_LEVEL_SURFACE_MID 6 -#define Z_LEVEL_SURFACE_HIGH 7 - -#define Z_LEVEL_WEST_BASE 8 -#define Z_LEVEL_WEST_DEEP 9 -#define Z_LEVEL_WEST_CAVERN 10 -#define Z_LEVEL_WEST_PLAIN 11 - -#define Z_LEVEL_MISC 12 - -#define Z_LEVEL_DEBRISFIELD 13 -#define Z_LEVEL_PIRATEBASE 14 -#define Z_LEVEL_MININGPLANET 15 // CLASS G -#define Z_LEVEL_CLASS_D 16 // CLASS D -#define Z_LEVEL_DESERT_PLANET 17 // CLASS H -#define Z_LEVEL_GAIA_PLANET 18 // CLASS M -#define Z_LEVEL_FROZEN_PLANET 19 // CLASS P -#define Z_LEVEL_TRADEPORT 20 - -#define Z_LEVEL_LAVALAND 21 -#define Z_LEVEL_LAVALAND_EAST 22 - -#define Z_LEVEL_ROGUEMINE_1 23 -#define Z_LEVEL_ROGUEMINE_2 24 -#define Z_LEVEL_ROGUEMINE_3 25 -#define Z_LEVEL_ROGUEMINE_4 26 - -#define Z_LEVEL_BEACH 27 -#define Z_LEVEL_BEACH_CAVE 28 -#define Z_LEVEL_DESERT 29 - -//#define Z_LEVEL_AEROSTAT 30 -//#define Z_LEVEL_AEROSTAT_SURFACE 31 - -/datum/map/rift - name = "Rift" - full_name = "NSB Atlas" - path = "rift" - - use_overmap = TRUE - overmap_z = Z_LEVEL_MISC - overmap_size = 60 - overmap_event_areas = 50 - usable_email_tlds = list("lythios.nt") - - zlevel_datum_type = /datum/map_z_level/rift - base_turf_by_z = list(Z_LEVEL_WEST_BASE, - Z_LEVEL_WEST_DEEP, - Z_LEVEL_WEST_CAVERN) - - titlescreens = list( - /datum/cutscene/browser/simple/rift_title1 = 20, - list( - 'icons/misc/title_vr.dmi', - "title1", - ), - list( - 'icons/misc/title_vr.dmi', - "title2", - ), - list( - 'icons/misc/title_vr.dmi', - "title3", - ), - list( - 'icons/misc/title_vr.dmi', - "title4", - ), - list( - 'icons/misc/title_vr.dmi', - "title5", - ), - list( - 'icons/misc/title_vr.dmi', - "title6", - ), - list( - 'icons/misc/title_vr.dmi', - "title7", - ), - list( - 'icons/misc/title_vr.dmi', - "title8", - ), - list( - 'icons/misc/title_vr.dmi', - "bnny", - ), - ) - - admin_levels = list() - sealed_levels = list() - empty_levels = null - station_levels = list(Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH) - contact_levels = list(Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH, - Z_LEVEL_WEST_BASE, - Z_LEVEL_WEST_DEEP, - Z_LEVEL_WEST_CAVERN, - Z_LEVEL_WEST_PLAIN) - player_levels = list(Z_LEVEL_UNDERGROUND_FLOOR, - Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH, - Z_LEVEL_WEST_BASE, - Z_LEVEL_WEST_PLAIN, - Z_LEVEL_WEST_DEEP, - Z_LEVEL_WEST_CAVERN) - - holomap_smoosh = list(list( - Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH)) - - station_name = "NSB Atlas" - station_short = "Atlas" - dock_name = "NTS Demeter" - dock_type = "surface" - boss_name = "Central Command" - boss_short = "CentCom" - company_name = "NanoTrasen" - company_short = "NT" - starsys_name = "Lythios-43" - - shuttle_docked_message = "The scheduled NSV Herrera shuttle flight to the %dock_name% orbital relay has arrived. It will depart in approximately %ETD%." - shuttle_leaving_dock = "The NSV Herrera has left the station. Estimate %ETA% until the shuttle arrives at the %dock_name% orbital relay." - shuttle_called_message = "A scheduled crew transfer to the %dock_name% orbital relay is occuring. The NSV Herrera will be arriving shortly. Those departing should proceed to departures within %ETA%." - shuttle_name = "NSV Herrera" - shuttle_recall_message = "The scheduled crew transfer flight has been cancelled." - emergency_shuttle_docked_message = "The evacuation flight has landed at the landing pad. You have approximately %ETD% to board the vessel." - emergency_shuttle_leaving_dock = "The emergency flight has left the station. Estimate %ETA% until the vessel arrives at %dock_name% orbital relay." - emergency_shuttle_called_message = "An emergency evacuation has begun, and an emergency response flight has been called. It will arrive at the landing pad in approximately %ETA%." - emergency_shuttle_recall_message = "The evacuation flight has been cancelled." - - station_networks = list( - NETWORK_CARGO, - NETWORK_CIRCUITS, - NETWORK_CIVILIAN, - NETWORK_COMMAND, - NETWORK_ENGINE, - NETWORK_ENGINEERING, - NETWORK_EXPLORATION, - //NETWORK_DEFAULT, //Is this even used for anything? Robots show up here, but they show up in ROBOTS network too, - NETWORK_MEDICAL, - NETWORK_MINE, - NETWORK_OUTSIDE, - NETWORK_RESEARCH, - NETWORK_RESEARCH_OUTPOST, - NETWORK_ROBOTS, - NETWORK_SECURITY, - NETWORK_TCOMMS, - NETWORK_LYTHIOS, - ) - secondary_networks = list( - NETWORK_ERT, - NETWORK_MERCENARY, - NETWORK_THUNDER, - NETWORK_COMMUNICATORS, - NETWORK_ALARM_ATMOS, - NETWORK_ALARM_POWER, - NETWORK_ALARM_FIRE, - NETWORK_TALON_HELMETS, - NETWORK_TALON_SHIP, - NETWORK_CIV_HELMETS, - NETWORK_EXPLO_HELMETS, - NETWORK_SEC_HELMETS - ) - - bot_patrolling = FALSE - - allowed_spawns = list("Shuttle Bay","Beruang Trading Corp Cryo","Cryogenic Storage") - spawnpoint_died = /datum/spawnpoint/shuttle - spawnpoint_left = /datum/spawnpoint/shuttle - spawnpoint_stayed = /datum/spawnpoint/cryo - - meteor_strike_areas = null - - unit_test_exempt_areas = list( - /area/rift/surfacebase/outside/outside1, - /area/rift/turbolift, - /area/vacant/vacant_site, - /area/vacant/vacant_site/east, - /area/crew_quarters/sleep/Dorm_1/holo, - /area/crew_quarters/sleep/Dorm_3/holo, - /area/crew_quarters/sleep/Dorm_5/holo, - /area/crew_quarters/sleep/Dorm_7/holo, - /area/rnd/miscellaneous_lab) - - unit_test_exempt_from_atmos = list( - /area/engineering/atmos_intake, // Outside, - /area/rnd/external) // Outside, - -/* Finish this when you have a ship and the locations for it to access - belter_docked_z = list(Z_LEVEL_DECK_TWO) - belter_transit_z = list(Z_LEVEL_SHIPS) - belter_belt_z = list(Z_LEVEL_ROGUEMINE_1, - Z_LEVEL_ROGUEMINE_2, - Z_LEVEL_ROGUEMINE_3, - Z_LEVEL_ROGUEMINE_4) -*/ - - lavaland_levels = list(Z_LEVEL_LAVALAND, - Z_LEVEL_LAVALAND_EAST) - - lateload_z_levels = list( -// list("Rift - Misc"), // Stock Rift lateload maps || Currently not in use, takes too long to load, breaks shuttles. -// list("Western Canyon","Western Deep Caves","Western Caves","Western Plains"), ///Integration Test says these arent valid maps but everything works, will leave in for now but this prolly isnt needed -Bloop - list("Debris Field - Z1 Space"), // Debris Field - list("Away Mission - Pirate Base"), // Pirate Base & Mining Planet - list("ExoPlanet - Z1 Planet"),//Mining planet - list("ExoPlanet - Z2 Planet"), // Rogue Exoplanet - list("ExoPlanet - Z3 Planet"), // Desert Exoplanet - list("ExoPlanet - Z4 Planet"), // Gaia Planet - list("ExoPlanet - Z5 Planet"), // Frozen Planet - list("Away Mission - Trade Port"), // Trading Post - list("Away Mission - Lava Land", "Away Mission - Lava Land (East)"), - list("Asteroid Belt 1","Asteroid Belt 2","Asteroid Belt 3","Asteroid Belt 4"), - list("Desert Planet - Z1 Beach","Desert Planet - Z2 Cave","Desert Planet - Z3 Desert") - // list("Remmi Aerostat - Z1 Aerostat","Remmi Aerostat - Z2 Surface") - ) - - ai_shell_restricted = TRUE - ai_shell_allowed_levels = list( - Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH, - Z_LEVEL_MISC) - - mining_station_z = list(Z_LEVEL_UNDERGROUND_DEEP) - mining_outpost_z = list(Z_LEVEL_WEST_PLAIN) - - belter_docked_z = list(Z_LEVEL_WEST_DEEP) - belter_transit_z = list(Z_LEVEL_MISC) - belter_belt_z = list(Z_LEVEL_ROGUEMINE_1, - Z_LEVEL_ROGUEMINE_2) - - lateload_single_pick = null //Nothing right now. - - planet_datums_to_make = list(/datum/planet/lythios43c, - /datum/planet/lavaland, - /datum/planet/classg, - /datum/planet/classd, - /datum/planet/classh, - /datum/planet/classp, - /datum/planet/classm, - /datum/planet/miaphus - ) - -// Overmap stuff. Main file is under code/modules/maps/overmap/_lythios43c.dm -// Todo, find a way to populate this list automatically without having to do this -/obj/effect/overmap/visitable/sector/lythios43c - extra_z_levels = list( - Z_LEVEL_WEST_PLAIN, - Z_LEVEL_WEST_CAVERN, - Z_LEVEL_WEST_DEEP, - Z_LEVEL_WEST_BASE - ) - levels_for_distress = list( - Z_LEVEL_DEBRISFIELD, - Z_LEVEL_MININGPLANET, - Z_LEVEL_CLASS_D, - Z_LEVEL_DESERT_PLANET, - Z_LEVEL_GAIA_PLANET, - Z_LEVEL_FROZEN_PLANET - ) - - -/* -// For making the 6-in-1 holomap, we calculate some offsets -#define TETHER_MAP_SIZE 140 // Width and height of compiled in tether z levels. -#define TETHER_HOLOMAP_CENTER_GUTTER 40 // 40px central gutter between columns -#define TETHER_HOLOMAP_MARGIN_X ((HOLOMAP_ICON_SIZE - (2*TETHER_MAP_SIZE) - TETHER_HOLOMAP_CENTER_GUTTER) / 2) // 100 -#define TETHER_HOLOMAP_MARGIN_Y ((HOLOMAP_ICON_SIZE - (3*TETHER_MAP_SIZE)) / 2) // 60 - -// We have a bunch of stuff common to the station z levels -/datum/map_z_level/tether/station - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT - holomap_legend_x = 220 - holomap_legend_y = 160 -*/ -/datum/map_z_level/rift/station/underground_floor - z = Z_LEVEL_UNDERGROUND_FLOOR - name = "Eastern Canyon" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT - base_turf = /turf/simulated/floor/outdoors/safeice/lythios43c - -/datum/map_z_level/rift/station/underground_deep - z = Z_LEVEL_UNDERGROUND_DEEP - name = "Underground 2" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT - base_turf = /turf/simulated/floor/outdoors/safeice/lythios43c - -/datum/map_z_level/rift/station/underground_shallow - z = Z_LEVEL_UNDERGROUND - name = "Underground 1" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT - base_turf = /turf/simulated/open - -/datum/map_z_level/rift/station/surface_low - z = Z_LEVEL_SURFACE_LOW - name = "Surface 1" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT - transit_chance = 100 - base_turf = /turf/simulated/open -// holomap_offset_x = TETHER_HOLOMAP_MARGIN_X -// holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*0 - -/datum/map_z_level/rift/station/surface_mid - z = Z_LEVEL_SURFACE_MID - name = "Surface 2" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT - base_turf = /turf/simulated/open -// holomap_offset_x = TETHER_HOLOMAP_MARGIN_X -// holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*1 - -/datum/map_z_level/rift/station/surface_high - z = Z_LEVEL_SURFACE_HIGH - name = "Surface 3" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT - base_turf = /turf/simulated/open -// holomap_offset_x = TETHER_HOLOMAP_MARGIN_X -// holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*2 - -/datum/map_z_level/rift/base - z = Z_LEVEL_WEST_BASE - name = "Western Canyon" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - base_turf = /turf/simulated/mineral/floor/icerock/lythios43c/indoors - -/datum/map_z_level/rift/deep - z = Z_LEVEL_WEST_DEEP - name = "Western Deep Caves" - flags = MAP_LEVEL_STATION|MAP_LEVEL_PLAYER - base_turf = /turf/simulated/mineral/floor/icerock/lythios43c/indoors - - -/datum/map_z_level/rift/caves - z = Z_LEVEL_WEST_CAVERN - name = "Western Caves" - flags = MAP_LEVEL_STATION|MAP_LEVEL_PLAYER - base_turf = /turf/simulated/mineral/floor/icerock/lythios43c/indoors - - -/datum/map_z_level/rift/plains - z = Z_LEVEL_WEST_PLAIN - name = "Western Plains" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER - base_turf = /turf/simulated/floor/outdoors/safeice/lythios43c - - - -/// Cave Generation -/datum/map/rift/perform_map_generation() - . = ..() - seed_submaps(list(Z_LEVEL_WEST_CAVERN), 50, /area/rift/surfacebase/outside/west_caves/submap_seedzone, /datum/map_template/submap/level_specific/rift/west_caves) - seed_submaps(list(Z_LEVEL_WEST_DEEP), 50, /area/rift/surfacebase/outside/west_deep/submap_seedzone, /datum/map_template/submap/level_specific/rift/west_deep) - seed_submaps(list(Z_LEVEL_WEST_BASE), 50, /area/rift/surfacebase/outside/west_base/submap_seedzone, /datum/map_template/submap/level_specific/rift/west_base) - new /datum/random_map/automata/cave_system/no_cracks/rift(null, 3, 3, Z_LEVEL_WEST_CAVERN, world.maxx - 3, world.maxy - 3) // Create the mining ore distribution map. - new /datum/random_map/automata/cave_system/no_cracks/rift(null, 3, 3, Z_LEVEL_WEST_DEEP, world.maxx - 3, world.maxy - 3) // Create the mining ore distribution map. - new /datum/random_map/automata/cave_system/no_cracks/rift(null, 3, 3, Z_LEVEL_WEST_BASE, world.maxx - 3, world.maxy - 3) // Create the mining ore distribution map. - new /datum/random_map/automata/cave_system/no_cracks/rift(null, 3, 3, Z_LEVEL_UNDERGROUND_FLOOR, world.maxx - 3, world.maxy - 3) // Create the mining ore distribution map. - new /datum/random_map/automata/cave_system/no_cracks/rift_nocaves(null, 3, 3, Z_LEVEL_SURFACE_HIGH, world.maxx - 3, world.maxy - 3) - new /datum/random_map/automata/cave_system/no_cracks/rift_nocaves(null, 3, 3, Z_LEVEL_SURFACE_MID, world.maxx - 3, world.maxy - 3) - new /datum/random_map/automata/cave_system/no_cracks/rift_nocaves(null, 3, 3, Z_LEVEL_SURFACE_LOW, world.maxx - 3, world.maxy - 3) - new /datum/random_map/automata/cave_system/no_cracks/rift_nocaves(null, 3, 3, Z_LEVEL_UNDERGROUND, world.maxx - 3, world.maxy - 3) - new /datum/random_map/automata/cave_system/no_cracks/rift_nocaves(null, 3, 3, Z_LEVEL_UNDERGROUND_DEEP, world.maxx - 3, world.maxy - 3) - - return 1 - - -/datum/map_z_level/rift/colony - z = Z_LEVEL_MISC - name = "Orbital Relay" - flags = MAP_LEVEL_ADMIN|MAP_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT - -/// This is the effect that slams people into the ground upon dropping out of the sky // - -/obj/effect/step_trigger/teleporter/planetary_fall/lythios43c/find_planet() - planet = planet_lythios43c - -/// Temporary place for this -// Spawner for lythios animals -/obj/tether_away_spawner/lythios_animals - name = "Lythios Animal Spawner" - faction = "lythios" - atmos_comp = TRUE - prob_spawn = 100 - mobs_to_pick_from = list( - /mob/living/simple_mob/animal/icegoat = 2, - /mob/living/simple_mob/animal/passive/woolie = 3, - /mob/living/simple_mob/animal/passive/furnacegrub, - /mob/living/simple_mob/animal/horing = 2 - ) - - -/// Z level dropper. Todo, make something generic so we dont have to copy pasta this -/obj/effect/step_trigger/zlevel_fall //Don't ever use this, only use subtypes.Define a new var/static/target_z on each - affect_ghosts = 1 - -/obj/effect/step_trigger/zlevel_fall/Initialize(mapload) - . = ..() - - if(istype(get_turf(src), /turf/simulated/floor)) - src:target_z = z - return INITIALIZE_HINT_QDEL - -/obj/effect/step_trigger/zlevel_fall/Trigger(var/atom/movable/A) //mostly from /obj/effect/step_trigger/teleporter/planetary_fall, step_triggers.dm L160 - if(!src:target_z) - return - - if(isobserver(A) || A.anchored) - return - if(A.throwing) - return - if(!A.can_fall()) - return - if(isliving(A)) - var/mob/living/L = A - if(L.is_floating || L.flying) - return //Flyers/nograv can ignore it - - var/attempts = 100 - var/turf/simulated/T - while(attempts && !T) - var/turf/simulated/candidate = locate(rand(5,world.maxx-5),rand(5,world.maxy-5),src:target_z) - if(candidate.density) - attempts-- - continue - - T = candidate - break - - if(!T) - return - - if(isobserver(A)) - A.forceMove(T) // Harmlessly move ghosts. - return - - A.forceMove(T) - if(isliving(A)) // Someday, implement parachutes. For now, just turbomurder whoever falls. - message_admins("\The [A] fell out of the sky.") - var/mob/living/L = A - L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this. - -/obj/effect/step_trigger/zlevel_fall/cavernfall - var/static/target_z = Z_LEVEL_WEST_CAVERN diff --git a/maps/rift/rift_shuttle_defs.dm b/maps/rift/rift_shuttle_defs.dm deleted file mode 100644 index 07ee2fb0b41..00000000000 --- a/maps/rift/rift_shuttle_defs.dm +++ /dev/null @@ -1,57 +0,0 @@ -////////////////////////////////////////////////////////////// -// Escape shuttle and pods -/datum/shuttle/autodock/ferry/emergency/escape - name = "Escape" - location = FERRY_LOCATION_OFFSITE - shuttle_area = /area/shuttle/escape - warmup_time = 10 - landmark_offsite = "escape_cc" - landmark_station = "escape_rift" - landmark_transition = "escape_transit" - move_time = SHUTTLE_TRANSIT_DURATION_RETURN - -////////////////////////////////////////////////////////////// -//Old Escape Pod -/* -/datum/shuttle/autodock/ferry/escape_pod/large_escape_pod1 - name = "Large Escape Pod 1" - location = FERRY_LOCATION_STATION - shuttle_area = /area/shuttle/large_escape_pod1 - warmup_time = 0 - landmark_station = "escapepod1_station" - landmark_offsite = "escapepod1_cc" - landmark_transition = "escapepod1_transit" - docking_controller_tag = "large_escape_pod_1" - move_time = SHUTTLE_TRANSIT_DURATION_RETURN -*/ -////////////////////////////////////////////////////////////// -// Supply shuttle -/datum/shuttle/autodock/ferry/supply/cargo - name = "Supply" - location = FERRY_LOCATION_OFFSITE - shuttle_area = /area/shuttle/supply - warmup_time = 10 - landmark_offsite = "supply_cc" - landmark_station = "supply_dock" - docking_controller_tag = "supply_shuttle" - flags = SHUTTLE_FLAGS_PROCESS|SHUTTLE_FLAGS_SUPPLY - -////////////////////////////////////////////////////////////// -// RogueMiner "Belter: Shuttle -// TODO - Not implemented yet on new map - -/datum/shuttle/autodock/ferry/belter - name = "Belter" - location = FERRY_LOCATION_STATION - warmup_time = 6 - move_time = 20 // i am fairly sure this is in seconds - shuttle_area = /area/shuttle/belter - landmark_station = "belter_station" - landmark_offsite = "belter_zone1" - landmark_transition = "belter_transit" - docking_controller_tag = "belter_docking" - -/datum/shuttle/autodock/ferry/belter/New() - move_time = move_time + rand(-5, 10) //30s max, 15s min, probably leaning towards higher values. - ..() - diff --git a/maps/rift/rift_shuttles.dm b/maps/rift/rift_shuttles.dm index e3322b32a72..e0a1ba508de 100644 --- a/maps/rift/rift_shuttles.dm +++ b/maps/rift/rift_shuttles.dm @@ -1,71 +1,15 @@ -/* -** Landmark Defs - */ - -// Shared landmark for docking at the station - -//Replace when we've got the map working and can actually place docking points -/* -/obj/effect/shuttle_landmark/automatic/station_dockpoint1 - name = "Station Docking Point 1" - landmark_tag = "nav_station_docking1" - docking_controller = "deck4_dockarm1" - base_turf = /turf/space - base_area = /area/space - -/obj/effect/shuttle_landmark/automatic/station_dockpoint2 - name = "NSV Triumph - Docking Arm 2" - landmark_tag = "nav_capitalship_docking2" - docking_controller = "deck4_dockarm2" - base_turf = /turf/space - base_area = /area/space -*/ - -/* -//////////////////////////////////////// -// Triumph custom shuttle implemnetations -//////////////////////////////////////// - -/obj/machinery/computer/shuttle_control/triumph_backup - name = "triumph backup shuttle control console" - shuttle_tag = "Triumph Backup" - req_one_access = list(ACCESS_COMMAND_BRIDGE,ACCESS_GENERAL_PILOT) -*/ /obj/machinery/computer/shuttle_control/multi/mercenary name = "vessel control console" shuttle_tag = "Mercenary" req_one_access = list(ACCESS_FACTION_SYNDICATE) -/* -/obj/machinery/computer/shuttle_control/multi/ninja - name = "vessel control console" - shuttle_tag = "Ninja" - //req_one_access = list() - -/obj/machinery/computer/shuttle_control/multi/skipjack - name = "vessel control console" - shuttle_tag = "Skipjack" - //req_one_access = list() - -/obj/machinery/computer/shuttle_control/multi/specops - name = "vessel control console" - shuttle_tag = "NDV Phantom" - req_one_access = list(ACCESS_CENTCOM_ERT) -*/ /obj/machinery/computer/shuttle_control/multi/trade name = "vessel control console" shuttle_tag = "Trade" req_one_access = list(ACCESS_FACTION_TRADER) -/* -/obj/machinery/computer/shuttle_control/cruiser_shuttle - name = "cruiser shuttle control console" - shuttle_tag = "Cruiser Shuttle" - req_one_access = list(ACCESS_COMMAND_BRIDGE) -*/ - // // "Tram" Emergency Shuttler // Becuase the tram only has its own doors and no corresponding station doors, a docking controller is overkill. @@ -276,27 +220,44 @@ name = "EMT jump console" shuttle_tag = "Dart EMT Shuttle" -//////////////////////////////////////// -//////// Tour Bus ///////////// -//////////////////////////////////////// -/*/datum/shuttle/autodock/overmap/tourbus - name = "Tour Bus" - warmup_time = 0 - current_location = "tourbus_dock" - docking_controller_tag = "tourbus_docker" - shuttle_area = list(/area/shuttle/tourbus/cockpit, /area/shuttle/tourbus/general, /area/shuttle/tourbus/engines) - fuel_consumption = 1 +//? merged -// The 'ship' of the tourbus -/obj/effect/overmap/visitable/ship/landable/tourbus - name = "Tour Bus" - desc = "A small 'space bus', if you will." - vessel_mass = 2000 - vessel_size = SHIP_SIZE_SMALL - shuttle = "Tour Bus" -/obj/machinery/computer/shuttle_control/explore/tourbus - name = "short jump console" - shuttle_tag = "Tour Bus" - req_one_access = list(ACCESS_GENERAL_PILOT) -*/ +// Escape shuttle and pods +/datum/shuttle/autodock/ferry/emergency/escape + name = "Escape" + location = FERRY_LOCATION_OFFSITE + shuttle_area = /area/shuttle/escape + warmup_time = 10 + landmark_offsite = "escape_cc" + landmark_station = "escape_rift" + landmark_transition = "escape_transit" + move_time = SHUTTLE_TRANSIT_DURATION_RETURN + +// Supply shuttle +/datum/shuttle/autodock/ferry/supply/cargo + name = "Supply" + location = FERRY_LOCATION_OFFSITE + shuttle_area = /area/shuttle/supply + warmup_time = 10 + landmark_offsite = "supply_cc" + landmark_station = "supply_dock" + docking_controller_tag = "supply_shuttle" + flags = SHUTTLE_FLAGS_PROCESS|SHUTTLE_FLAGS_SUPPLY + +// RogueMiner "Belter: Shuttle + +/datum/shuttle/autodock/ferry/belter + name = "Belter" + location = FERRY_LOCATION_STATION + warmup_time = 6 + move_time = 20 // i am fairly sure this is in seconds + shuttle_area = /area/shuttle/belter + landmark_station = "belter_station" + landmark_offsite = "belter_zone1" + landmark_transition = "belter_transit" + docking_controller_tag = "belter_docking" + +/datum/shuttle/autodock/ferry/belter/New() + move_time = move_time + rand(-5, 10) //30s max, 15s min, probably leaning towards higher values. + ..() diff --git a/maps/rift/rift_telecomms.dm b/maps/rift/rift_telecomms.dm index 1a298f1b979..9c674eeb7f6 100644 --- a/maps/rift/rift_telecomms.dm +++ b/maps/rift/rift_telecomms.dm @@ -1,47 +1,36 @@ // ### Preset machines ### - // #### Relays #### // Telecomms doesn't know about connected z-levels, so we need relays even for the other surface levels. /obj/machinery/telecomms/relay/preset/rift/under_shallow id = "Underground Relay 1" - listening_level = Z_LEVEL_UNDERGROUND autolinkers = list("rus_relay") /obj/machinery/telecomms/relay/preset/centcom/rift/under_shallow - listening_level = Z_LEVEL_UNDERGROUND /obj/machinery/telecomms/relay/preset/rift/under_deep id = "Underground Relay 2" - listening_level = Z_LEVEL_UNDERGROUND_DEEP autolinkers = list("rud_relay") /obj/machinery/telecomms/relay/preset/centcom/rift/under_deep - listening_level = Z_LEVEL_UNDERGROUND_DEEP /obj/machinery/telecomms/relay/preset/rift/base_low id = "Base Relay 1" - listening_level = Z_LEVEL_SURFACE_LOW autolinkers = list("rbl_relay") /obj/machinery/telecomms/relay/preset/centcom/rift/base_low - listening_level = Z_LEVEL_SURFACE_LOW /obj/machinery/telecomms/relay/preset/rift/base_mid id = "Base Relay 2" - listening_level = Z_LEVEL_SURFACE_MID autolinkers = list("rbm_relay") /obj/machinery/telecomms/relay/preset/centcom/rift/base_mid - listening_level = Z_LEVEL_SURFACE_MID /obj/machinery/telecomms/relay/preset/rift/base_high id = "Base Relay 3" - listening_level = Z_LEVEL_SURFACE_HIGH autolinkers = list("rbh_relay") /obj/machinery/telecomms/relay/preset/centcom/rift/base_high - listening_level = Z_LEVEL_SURFACE_HIGH /* /obj/machinery/telecomms/relay/preset/tether/sci_outpost @@ -111,24 +100,6 @@ /area/maintenance/station/tcomms name = "\improper Telecoms Maintenance" -/datum/map/tether/default_internal_channels() - return list( - num2text(PUB_FREQ) = list(), - num2text(AI_FREQ) = list(ACCESS_SPECIAL_SILICONS), - num2text(ENT_FREQ) = list(), - num2text(ERT_FREQ) = list(ACCESS_CENTCOM_ERT), - num2text(COMM_FREQ)= list(ACCESS_COMMAND_BRIDGE), - num2text(ENG_FREQ) = list(ACCESS_ENGINEERING_ENGINE, ACCESS_ENGINEERING_ATMOS), - num2text(MED_FREQ) = list(ACCESS_MEDICAL_EQUIPMENT), - num2text(MED_I_FREQ)=list(ACCESS_MEDICAL_EQUIPMENT), - num2text(SEC_FREQ) = list(ACCESS_SECURITY_EQUIPMENT), - num2text(SEC_I_FREQ)=list(ACCESS_SECURITY_EQUIPMENT), - num2text(SCI_FREQ) = list(ACCESS_SCIENCE_FABRICATION,ACCESS_SCIENCE_ROBOTICS,ACCESS_SCIENCE_XENOBIO), - num2text(SUP_FREQ) = list(ACCESS_SUPPLY_BAY), - num2text(SRV_FREQ) = list(ACCESS_GENERAL_JANITOR, ACCESS_GENERAL_BOTANY), - num2text(EXP_FREQ) = list(ACCESS_GENERAL_EXPLORER) - ) - /obj/item/multitool/rift_buffered name = "pre-linked multitool (rift hub)" desc = "This multitool has already been linked to the Atlas telecomms hub and can be used to configure one (1) relay." diff --git a/maps/rift/rift_things.dm b/maps/rift/rift_things.dm new file mode 100644 index 00000000000..6a8aa68024b --- /dev/null +++ b/maps/rift/rift_things.dm @@ -0,0 +1,79 @@ +// Overmap stuff. Main file is under code/modules/maps/overmap/_lythios43c.dm +// Todo, find a way to populate this list automatically without having to do this +/obj/effect/overmap/visitable/sector/lythios43c + extra_z_levels = list( + /datum/map_level/rift/plains, + /datum/map_level/rift/caves, + /datum/map_level/rift/deep, + /datum/map_level/rift/base, + ) + +/// This is the effect that slams people into the ground upon dropping out of the sky // + +/obj/effect/step_trigger/teleporter/planetary_fall/lythios43c + planet_path = /datum/planet/lythios43c + +/// Temporary place for this +// Spawner for lythios animals +/obj/tether_away_spawner/lythios_animals + name = "Lythios Animal Spawner" + faction = "lythios" + atmos_comp = TRUE + prob_spawn = 100 + mobs_to_pick_from = list( + /mob/living/simple_mob/animal/icegoat = 2, + /mob/living/simple_mob/animal/passive/woolie = 3, + /mob/living/simple_mob/animal/passive/furnacegrub, + /mob/living/simple_mob/animal/horing = 2 + ) + + +/// Z level dropper. Todo, make something generic so we dont have to copy pasta this +/obj/effect/step_trigger/zlevel_fall //Don't ever use this, only use subtypes.Define a new var/static/target_z on each + affect_ghosts = 1 + +/obj/effect/step_trigger/zlevel_fall/Initialize(mapload) + . = ..() + + if(istype(get_turf(src), /turf/simulated/floor)) + src:target_z = z + return INITIALIZE_HINT_QDEL + +/obj/effect/step_trigger/zlevel_fall/Trigger(var/atom/movable/A) //mostly from /obj/effect/step_trigger/teleporter/planetary_fall, step_triggers.dm L160 + if(!src:target_z) + return + + if(isobserver(A) || A.anchored) + return + if(A.throwing) + return + if(!A.can_fall()) + return + if(isliving(A)) + var/mob/living/L = A + if(L.is_floating || L.flying) + return //Flyers/nograv can ignore it + + var/attempts = 100 + var/turf/simulated/T + while(attempts && !T) + var/turf/simulated/candidate = locate(rand(5,world.maxx-5),rand(5,world.maxy-5),src:target_z) + if(candidate.density) + attempts-- + continue + + T = candidate + break + + if(!T) + return + + if(isobserver(A)) + A.forceMove(T) // Harmlessly move ghosts. + return + + A.forceMove(T) + if(isliving(A)) // Someday, implement parachutes. For now, just turbomurder whoever falls. + message_admins("\The [A] fell out of the sky.") + var/mob/living/L = A + L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this. diff --git a/maps/rift/rift_weather.dm b/maps/rift/rift_weather.dm deleted file mode 100644 index e09516ba9af..00000000000 --- a/maps/rift/rift_weather.dm +++ /dev/null @@ -1,126 +0,0 @@ -////////////////////////////////////////// -/// Rift Z Level Weather Definerinator /// -////////////////////////////////////////// -/* -Designates the z levels for weather to generate on. TODO, find a way of -handling this automatically without having to load these after the map defines. -The rest of the weather defines have been moved to code/modules/maps/weather - -*/ - -/////////////////////// -/// Lythios Weather /// -/////////////////////// -var/datum/planet/lythios43c/planet_lythios43c = null - -/datum/planet/lythios43c - expected_z_levels = list( - Z_LEVEL_UNDERGROUND_FLOOR, - Z_LEVEL_UNDERGROUND_DEEP, - Z_LEVEL_UNDERGROUND, - Z_LEVEL_SURFACE_LOW, - Z_LEVEL_SURFACE_MID, - Z_LEVEL_SURFACE_HIGH, - Z_LEVEL_WEST_BASE, - Z_LEVEL_WEST_DEEP, - Z_LEVEL_WEST_CAVERN, - Z_LEVEL_WEST_PLAIN - ) - -/////////////////////// -/// Class D Weather /// -/////////////////////// -var/datum/planet/classd/planet_classd = null - -/datum/planet/classd/New() - ..() - planet_classd = src - weather_holder = new /datum/weather_holder/classd(src) - -/datum/planet/classd - expected_z_levels = list(Z_LEVEL_CLASS_D) - - -/////////////////////// -/// Class G Weather /// -/////////////////////// -var/datum/planet/classg/planet_classg = null - -/datum/planet/classg/New() - ..() - planet_classg = src - weather_holder = new /datum/weather_holder/classg(src) - -/datum/planet/classg - expected_z_levels = list(Z_LEVEL_MININGPLANET) - -/////////////////////// -/// Class H Weather /// -/////////////////////// -var/datum/planet/classh/planet_classh = null - -/datum/planet/classh/New() - ..() - planet_classh = src - weather_holder = new /datum/weather_holder/classh(src) - - -/datum/planet/classh - expected_z_levels = list(Z_LEVEL_DESERT_PLANET) - -/////////////////////// -/// Class M Weather /// -/////////////////////// -var/datum/planet/classm/planet_classm = null - -/datum/planet/classm/New() - ..() - planet_classm = src - weather_holder = new /datum/weather_holder/classm(src) - -/datum/planet/classm - expected_z_levels = list(Z_LEVEL_GAIA_PLANET) - -/////////////////////// -/// Class P Weather /// -/////////////////////// -var/datum/planet/classp/planet_classp = null - -/datum/planet/classp/New() - ..() - planet_classp = src - weather_holder = new /datum/weather_holder/classp(src) - -/datum/planet/classp - expected_z_levels = list(Z_LEVEL_FROZEN_PLANET) - -///////////////////////// -/// Lava Land Weather /// -///////////////////////// -var/datum/planet/lavaland/planet_lavaland = null - -/datum/planet/lavaland/New() - ..() - planet_lavaland = src - weather_holder = new /datum/weather_holder/lavaland(src) - -/datum/planet/lavaland - expected_z_levels = list( - Z_LEVEL_LAVALAND, - Z_LEVEL_LAVALAND_EAST) - -//////////////////////////// -/// Miaphus'irra Weather /// -//////////////////////////// -var/datum/planet/miaphus/planet_miaphus = null - -/datum/planet/miaphus/New() - ..() - planet_miaphus = src - weather_holder = new /datum/weather_holder/miaphus(src) - -/datum/planet/miaphus - expected_z_levels = list(Z_LEVEL_BEACH, Z_LEVEL_DESERT) - - - diff --git a/maps/sectors/debrisfield_192/debrisfield_192.dm b/maps/sectors/debrisfield_192/debrisfield_192.dm new file mode 100644 index 00000000000..de06963ec8a --- /dev/null +++ b/maps/sectors/debrisfield_192/debrisfield_192.dm @@ -0,0 +1,29 @@ +/datum/map/sector/debrisfield_192 + id = "debrisfield_192" + name = "Sector - Debris Field" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/debrisfield_192, + ) + +/datum/map_level/sector/debrisfield_192 + id = "Debrisfield192" + name = "Sector - Debris Field" + display_name = "Debris Field" + absolute_path = "maps/sectors/debrisfield_192/levels/debrisfield.dmm" + base_turf = /turf/space + base_area = /area/space + +/datum/map_level/sector/debrisfield_192/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 20, + /area/space/debrisfield/unexplored, + /datum/map_template/submap/level_specific/debrisfield, + ) + ) diff --git a/maps/map_levels/192x192/debrisfield.dmm b/maps/sectors/debrisfield_192/levels/debrisfield.dmm similarity index 100% rename from maps/map_levels/192x192/debrisfield.dmm rename to maps/sectors/debrisfield_192/levels/debrisfield.dmm diff --git a/maps/sectors/desert_192/desert_192.dm b/maps/sectors/desert_192/desert_192.dm new file mode 100644 index 00000000000..5d0b17d5fe6 --- /dev/null +++ b/maps/sectors/desert_192/desert_192.dm @@ -0,0 +1,33 @@ +/datum/map/sector/desert_192 + id = "desert_192" + name = "Sector - Desert World" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/desert_192 + ) + +/datum/map_level/sector/desert_192 + id = "DesertWorld192" + name = "Sector - Desert World" + display_name = "Class-H Desert World" + absolute_path = "maps/sectors/desert_192/levels/desert_192.dmm" + base_turf = /turf/simulated/floor/outdoors/beach/sand/lowdesert + base_area = /area/class_h/unexplored + traits = list( + ZTRAIT_GRAVITY, + ) + planet_path = /datum/planet/classh + +/datum/map_level/sector/desert_192/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 150, + /area/class_h/unexplored, + /datum/map_template/submap/level_specific/class_h, + ) + ) diff --git a/maps/map_levels/192x192/Class_H.dmm b/maps/sectors/desert_192/levels/desert_192.dmm similarity index 100% rename from maps/map_levels/192x192/Class_H.dmm rename to maps/sectors/desert_192/levels/desert_192.dmm diff --git a/maps/sectors/frozen_192/frozen_192.dm b/maps/sectors/frozen_192/frozen_192.dm new file mode 100644 index 00000000000..e9421afd267 --- /dev/null +++ b/maps/sectors/frozen_192/frozen_192.dm @@ -0,0 +1,33 @@ +/datum/map/sector/frozen_192 + id = "frozen_192" + name = "Sector - Frozen World" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/frozen_192, + ) + +/datum/map_level/sector/frozen_192 + id = "FrozenWorld192" + name = "Sector - Frozen World" + display_name = "Class-P Frozen World" + absolute_path = "maps/sectors/frozen_192/levels/frozen_192.dmm" + base_area = /area/class_p/ruins + base_turf = /turf/simulated/floor/outdoors/ice/classp + traits = list( + ZTRAIT_GRAVITY, + ) + planet_path = /datum/planet/classp + +/datum/map_level/sector/frozen_192/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 125, + /area/class_p/ruins, + /datum/map_template/submap/level_specific/class_p, + ) + ) diff --git a/maps/map_levels/192x192/Class_P.dmm b/maps/sectors/frozen_192/levels/frozen_192.dmm similarity index 100% rename from maps/map_levels/192x192/Class_P.dmm rename to maps/sectors/frozen_192/levels/frozen_192.dmm diff --git a/maps/sectors/gaia_192/gaia_192.dm b/maps/sectors/gaia_192/gaia_192.dm new file mode 100644 index 00000000000..4b256aacfc2 --- /dev/null +++ b/maps/sectors/gaia_192/gaia_192.dm @@ -0,0 +1,20 @@ +/datum/map/sector/gaia_192 + id = "gaia_192" + name = "Sector - Gaia World" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/gaia_192, + ) + +/datum/map_level/sector/gaia_192 + id = "GaiaWorld192" + name = "Sector - Gaia World" + display_name = "Class-M Gaia World" + absolute_path = "maps/sectors/gaia_192/levels/gaia_192.dmm" + base_turf = /turf/simulated/floor/outdoors/dirt/classm + base_area = /area/class_m/outside + traits = list( + ZTRAIT_GRAVITY, + ) + planet_path = /datum/planet/classm diff --git a/maps/map_levels/192x192/Class_M.dmm b/maps/sectors/gaia_192/levels/gaia_192.dmm similarity index 100% rename from maps/map_levels/192x192/Class_M.dmm rename to maps/sectors/gaia_192/levels/gaia_192.dmm diff --git a/maps/sectors/lavaland_192/lavaland_192.dm b/maps/sectors/lavaland_192/lavaland_192.dm new file mode 100644 index 00000000000..392735d1453 --- /dev/null +++ b/maps/sectors/lavaland_192/lavaland_192.dm @@ -0,0 +1,66 @@ +/datum/map/sector/lavaland_192 + id = "lavaland_192" + name = "Sector - Lavaland" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/lavaland_192/base, + /datum/map_level/sector/lavaland_192/east, + ) + +/datum/map_level/sector/lavaland_192 + base_turf = /turf/simulated/mineral/floor/lavaland + base_area = /area/lavaland/central/unexplored + traits = list( + ZTRAIT_GRAVITY, + ) + planet_path = /datum/planet/lavaland + +/datum/map_level/sector/lavaland_192/base + id = "LavalandBase192" + name = "Sector - Lavaland West" + display_name = "Surt - West" + absolute_path = "maps/sectors/lavaland_192/levels/lavaland_192.dmm" + link_east = /datum/map_level/sector/lavaland_192/east + +/datum/map_level/sector/lavaland_192/base/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 80, + /area/lavaland/central/unexplored, + /datum/map_template/submap/level_specific/lavaland, + ) + ) + // todo: yielding generation + new /datum/random_map/noise/ore/lavaland(null, 1, 1, z_index, 64, 64) // Create the mining ore distribution map. + new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z_index, world.maxx - 4, world.maxy - 4) // Create the lavaland Z-level. + +/datum/map_level/sector/lavaland_192/east + id = "LavalandEast192" + name = "Sector - Lavaland East" + display_name = "Surt - East" + absolute_path = "maps/sectors/lavaland_192/levels/lavaland_192_east.dmm" + link_west = /datum/map_level/sector/lavaland_192/base + +/datum/map_level/sector/lavaland_192/east/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 40, + /area/lavaland/east/unexplored, + /datum/map_template/submap/level_specific/lavaland, + ) + ) + // todo: yielding generation + new /datum/random_map/noise/ore/lavaland(null, 1, 1, z_index, 64, 64) + new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z_index, world.maxx - 4, world.maxy - 4) + +/obj/landmark/map_data/lavaland_east + height = 1 diff --git a/maps/map_levels/192x192/lavaland.dmm b/maps/sectors/lavaland_192/levels/lavaland_192.dmm similarity index 100% rename from maps/map_levels/192x192/lavaland.dmm rename to maps/sectors/lavaland_192/levels/lavaland_192.dmm diff --git a/maps/map_levels/192x192/lavaland_east.dmm b/maps/sectors/lavaland_192/levels/lavaland_192_east.dmm similarity index 100% rename from maps/map_levels/192x192/lavaland_east.dmm rename to maps/sectors/lavaland_192/levels/lavaland_192_east.dmm diff --git a/maps/map_levels/192x192/miaphus_beach.dmm b/maps/sectors/miaphus_192/levels/miaphus_192_beach.dmm similarity index 100% rename from maps/map_levels/192x192/miaphus_beach.dmm rename to maps/sectors/miaphus_192/levels/miaphus_192_beach.dmm diff --git a/maps/map_levels/192x192/miaphus_cave.dmm b/maps/sectors/miaphus_192/levels/miaphus_192_cave.dmm similarity index 100% rename from maps/map_levels/192x192/miaphus_cave.dmm rename to maps/sectors/miaphus_192/levels/miaphus_192_cave.dmm diff --git a/maps/map_levels/192x192/miaphus_desert.dmm b/maps/sectors/miaphus_192/levels/miaphus_192_desert.dmm similarity index 100% rename from maps/map_levels/192x192/miaphus_desert.dmm rename to maps/sectors/miaphus_192/levels/miaphus_192_desert.dmm diff --git a/maps/sectors/miaphus_192/miaphus_192.dm b/maps/sectors/miaphus_192/miaphus_192.dm new file mode 100644 index 00000000000..8c33681c0dd --- /dev/null +++ b/maps/sectors/miaphus_192/miaphus_192.dm @@ -0,0 +1,74 @@ +/datum/map/sector/miaphus_192 + id = "miaphus_192" + name = "Sector - Miaphus" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/miaphus_192/beach, + /datum/map_level/sector/miaphus_192/cave, + /datum/map_level/sector/miaphus_192/desert, + ) + +/datum/map_level/sector/miaphus_192 + base_turf = /turf/simulated/floor/outdoors/beach/sand/desert + traits = list( + ZTRAIT_GRAVITY, + ) + planet_path = /datum/planet/miaphus + +/datum/map_level/sector/miaphus_192/beach + id = "MiaphusBeach192" + name = "Sector - Miaphus: Beach" + display_name = "Miaphus - Beach" + absolute_path = "maps/sectors/miaphus_192/levels/miaphus_192_beach.dmm" + base_turf = /turf/simulated/floor/outdoors/beach/sand + link_north = /datum/map_level/sector/miaphus_192/cave + +/datum/map_level/sector/miaphus_192/cave + id = "MiaphusCaves192" + name = "Sector - Miaphus: Caves" + display_name = "Miaphus - Caves" + absolute_path = "maps/sectors/miaphus_192/levels/miaphus_192_cave.dmm" + base_turf = /turf/simulated/floor/outdoors/rocks/caves + link_south = /datum/map_level/sector/miaphus_192/beach + link_west = /datum/map_level/sector/miaphus_192/desert + +/datum/map_level/sector/miaphus_192/cave/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 225, + /area/tether_away/cave/unexplored/normal, + /datum/map_template/submap/level_specific/mountains/normal, + ) + ) + // todo: yield invoke generation + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z_index, world.maxx - 4, world.maxy - 4) + new /datum/random_map/noise/ore/beachmine(null, 1, 1, z_index, 64, 64) + +/datum/map_level/sector/miaphus_192/desert + id = "MiaphusDesert192" + name = "Sector - Miaphus: Desert" + display_name = "Miaphus - Desert" + absolute_path = "maps/sectors/miaphus_192/levels/miaphus_192_desert.dmm" + base_turf = /turf/simulated/floor/outdoors/beach/sand/lowdesert + link_east = /datum/map_level/sector/miaphus_192/cave + +/datum/map_level/sector/miaphus_192/desert/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 225, + /area/tether_away/beach/desert/unexplored, + /datum/map_template/submap/level_specific/class_h, + ) + ) + +/obj/effect/step_trigger/zlevel_fall/beach + var/static/target_z diff --git a/maps/map_levels/192x192/Class_G.dmm b/maps/sectors/mining_192/levels/mining_192.dmm similarity index 100% rename from maps/map_levels/192x192/Class_G.dmm rename to maps/sectors/mining_192/levels/mining_192.dmm diff --git a/maps/sectors/mining_192/mining_192.dm b/maps/sectors/mining_192/mining_192.dm new file mode 100644 index 00000000000..ae7e60b98b1 --- /dev/null +++ b/maps/sectors/mining_192/mining_192.dm @@ -0,0 +1,26 @@ +/datum/map/sector/mining_192 + id = "mining_192" + name = "Sector - Mining World" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/mining_192, + ) + +/datum/map_level/sector/mining_192 + id = "MiningWorld192" + name = "Sector - Mining World" + display_name = "Class-G Mineral Rich Planet" + absolute_path = "maps/sectors/mining_192/levels/mining_192.dmm" + traits = list( + ZTRAIT_GRAVITY, + ) + planet_path = /datum/planet/classg + +/datum/map_level/sector/mining_192/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + + // todo: yield invoke generation + new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, z_index, world.maxx - 4, world.maxy - 4) // Create the mining Z-level. + new /datum/random_map/noise/ore/classg(null, 1, 1, z_index, 64, 64) // Create the mining ore distribution map. + diff --git a/maps/map_levels/192x192/piratebase.dmm b/maps/sectors/piratebase_192/levels/piratebase_192.dmm similarity index 100% rename from maps/map_levels/192x192/piratebase.dmm rename to maps/sectors/piratebase_192/levels/piratebase_192.dmm diff --git a/maps/sectors/piratebase_192/piratebase_192.dm b/maps/sectors/piratebase_192/piratebase_192.dm new file mode 100644 index 00000000000..48a9f073989 --- /dev/null +++ b/maps/sectors/piratebase_192/piratebase_192.dm @@ -0,0 +1,14 @@ +/datum/map/sector/piratebase_192 + id = "piratebase_192" + name = "Sector - Pirate Base" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/piratebase_192, + ) + +/datum/map_level/sector/piratebase_192 + id = "Piratebase192" + name = "Sector - Pirate Base" + display_name = "Unknown Outpost" + absolute_path = "maps/sectors/piratebase_192/levels/piratebase_192.dmm" diff --git a/maps/map_levels/192x192/roguemining_192x192/rogue_mine1.dmm b/maps/sectors/roguemining_192/levels/roguemining_192_1.dmm similarity index 100% rename from maps/map_levels/192x192/roguemining_192x192/rogue_mine1.dmm rename to maps/sectors/roguemining_192/levels/roguemining_192_1.dmm diff --git a/maps/map_levels/192x192/roguemining_192x192/rogue_mine2.dmm b/maps/sectors/roguemining_192/levels/roguemining_192_2.dmm similarity index 100% rename from maps/map_levels/192x192/roguemining_192x192/rogue_mine2.dmm rename to maps/sectors/roguemining_192/levels/roguemining_192_2.dmm diff --git a/maps/map_levels/192x192/roguemining_192x192/rogue_mine3.dmm b/maps/sectors/roguemining_192/levels/roguemining_192_3.dmm similarity index 100% rename from maps/map_levels/192x192/roguemining_192x192/rogue_mine3.dmm rename to maps/sectors/roguemining_192/levels/roguemining_192_3.dmm diff --git a/maps/map_levels/192x192/roguemining_192x192/rogue_mine4.dmm b/maps/sectors/roguemining_192/levels/roguemining_192_4.dmm similarity index 100% rename from maps/map_levels/192x192/roguemining_192x192/rogue_mine4.dmm rename to maps/sectors/roguemining_192/levels/roguemining_192_4.dmm diff --git a/maps/sectors/roguemining_192/roguemining_192.dm b/maps/sectors/roguemining_192/roguemining_192.dm new file mode 100644 index 00000000000..94dd7e7b4b3 --- /dev/null +++ b/maps/sectors/roguemining_192/roguemining_192.dm @@ -0,0 +1,73 @@ +/** + * cursed as fuck + * + * load these sequentially for the number you want + * you usually don't need more than 1-2 to make belt mining work + * i think (?) + */ +/datum/map/sector/roguemining_192 + abstract_type = /datum/map/sector/roguemining_192 + width = 192 + height = 192 + +/datum/map_level/sector/roguemining_192 + +/datum/map/sector/roguemining_192/one + id = "roguemining_192_1" + name = "Roguemining - Allocation 1" + levels = list( + /datum/map_level/sector/roguemining_192/one, + ) + +/datum/map_level/sector/roguemining_192/one + id = "Roguemining1" + name = "Roguemining - Allocation 1" + absolute_path = "maps/sectors/roguemining_192/levels/roguemining_192_1.dmm" + traits = list( + ZTRAIT_LEGACY_BELTER_ACTIVE, + ) + +/datum/map/sector/roguemining_192/two + id = "roguemining_192_2" + name = "Roguemining - Allocation 2" + levels = list( + /datum/map_level/sector/roguemining_192/two, + ) + +/datum/map_level/sector/roguemining_192/two + id = "Roguemining2" + name = "Roguemining - Allocation 2" + absolute_path = "maps/sectors/roguemining_192/levels/roguemining_192_2.dmm" + traits = list( + ZTRAIT_LEGACY_BELTER_ACTIVE, + ) + +/datum/map/sector/roguemining_192/three + id = "roguemining_192_3" + name = "Roguemining - Allocation 3" + levels = list( + /datum/map_level/sector/roguemining_192/three, + ) + +/datum/map_level/sector/roguemining_192/three + id = "Roguemining3" + name = "Roguemining - Allocation 3" + absolute_path = "maps/sectors/roguemining_192/levels/roguemining_192_3.dmm" + traits = list( + ZTRAIT_LEGACY_BELTER_ACTIVE, + ) + +/datum/map/sector/roguemining_192/four + id = "roguemining_192_4" + name = "Roguemining - Allocation 4" + levels = list( + /datum/map_level/sector/roguemining_192/four, + ) + +/datum/map_level/sector/roguemining_192/four + id = "Roguemining4" + name = "Roguemining - Allocation 4" + absolute_path = "maps/sectors/roguemining_192/levels/roguemining_192_4.dmm" + traits = list( + ZTRAIT_LEGACY_BELTER_ACTIVE, + ) diff --git a/maps/map_levels/192x192/tradeport.dmm b/maps/sectors/tradeport_192/levels/tradeport_192.dmm similarity index 100% rename from maps/map_levels/192x192/tradeport.dmm rename to maps/sectors/tradeport_192/levels/tradeport_192.dmm diff --git a/maps/sectors/tradeport_192/tradeport_192.dm b/maps/sectors/tradeport_192/tradeport_192.dm new file mode 100644 index 00000000000..ebe1136d3da --- /dev/null +++ b/maps/sectors/tradeport_192/tradeport_192.dm @@ -0,0 +1,19 @@ +/datum/map/sector/tradeport_192 + id = "tradeport_192" + name = "Sector - Trade Port (192x192)" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/tradeport_192, + ) + legacy_assert_shuttle_datums = list( + /datum/shuttle/autodock/overmap/trade, + ) + +/datum/map_level/sector/tradeport_192 + id = "Tradeport192" + name = "Sector - Trade Port (192x192)" + display_name = "Nebula Gas Trade Hub" + absolute_path = "maps/sectors/tradeport_192/levels/tradeport_192.dmm" + base_turf = /turf/space + base_area = /area/space diff --git a/maps/map_levels/192x192/Class_D.dmm b/maps/sectors/wasteland_192/levels/wasteland_192.dmm similarity index 100% rename from maps/map_levels/192x192/Class_D.dmm rename to maps/sectors/wasteland_192/levels/wasteland_192.dmm diff --git a/maps/sectors/wasteland_192/wasteland_192.dm b/maps/sectors/wasteland_192/wasteland_192.dm new file mode 100644 index 00000000000..53b45fb4b7b --- /dev/null +++ b/maps/sectors/wasteland_192/wasteland_192.dm @@ -0,0 +1,29 @@ +/datum/map/sector/wasteland_192 + id = "wasteland_192" + name = "Sector - Moon Wastes (192x192)" + width = 192 + height = 192 + levels = list( + /datum/map_level/sector/wasteland_192, + ) + +/datum/map_level/sector/wasteland_192 + id = "Wasteland192" + name = "Sector - Moon Wastes (192x192)" + display_name = "Class-D Moon Wastes" + absolute_path = "maps/sectors/wasteland_192/levels/wasteland_192.dmm" + base_turf = /turf/simulated/mineral/floor/classd + planet_path = /datum/planet/classd + +/datum/map_level/sector/wasteland_192/on_loaded_immediate(z_index, list/datum/callback/additional_generation) + . = ..() + additional_generation?.Add( + CALLBACK( + GLOBAL_PROC, + GLOBAL_PROC_REF(seed_submaps), + list(z_index), + 150, + /area/class_d/unexplored, + /datum/map_template/submap/level_specific/class_d, + ) + ) diff --git a/maps/submaps/engine_submaps/engine.dm b/maps/submaps/engine_submaps/engine.dm index 65267565a52..5bf24304813 100644 --- a/maps/submaps/engine_submaps/engine.dm +++ b/maps/submaps/engine_submaps/engine.dm @@ -18,39 +18,39 @@ /datum/map_template/engine/rust name = "EngineSubmap_RUST" desc = "R-UST Fusion Tokamak Engine" - mappath = "maps/templates/engines/triumph/triumph_engine_rust.dmm" + map_path = "maps/templates/engines/triumph/triumph_engine_rust.dmm" display_name = "Budget Star" /* /datum/map_template/engine/singulo name = "Singularity Engine" desc = "Lord Singuloth" - mappath = 'maps/templates/engines/triumph/engine_singulo.dmm' + map_path = 'maps/templates/engines/triumph/engine_singulo.dmm' */ /datum/map_template/engine/supermatter name = "EngineSubmap_SM" desc = "Old Faithful Supermatter" - mappath = "maps/templates/engines/triumph/triumph_engine_sme.dmm" + map_path = "maps/templates/engines/triumph/triumph_engine_sme.dmm" display_name = "Angry Rock" /* /datum/map_template/engine/tesla name = "Edison's Bane" desc = "The Telsa Engine" - mappath = 'maps/templates/engines/triumph/engine_tesla.dmm' + map_path = 'maps/templates/engines/triumph/engine_tesla.dmm' */ /datum/map_template/engine/burnchamber name = "EngineSubmap_Burn" desc = "Burn Chamber Engine" - mappath = "maps/templates/engines/triumph/triumph_engine_burnchamber.dmm" + map_path = "maps/templates/engines/triumph/triumph_engine_burnchamber.dmm" display_name = "Toxins Lab" /datum/map_template/engine/fission name = "EngineSubmap_Fission" desc = "The Fission Reactor" - mappath = "maps/templates/engines/triumph/triumph_engine_fission.dmm" + map_path = "maps/templates/engines/triumph/triumph_engine_fission.dmm" display_name = "Nuclear Bomb" // Landmark for where to load in the engine on permament map diff --git a/maps/submaps/engine_submaps_vr/tether/_engine_submaps.dm b/maps/submaps/engine_submaps_vr/tether/_engine_submaps.dm index 8c8b316971a..bf2b0506dae 100644 --- a/maps/submaps/engine_submaps_vr/tether/_engine_submaps.dm +++ b/maps/submaps/engine_submaps_vr/tether/_engine_submaps.dm @@ -16,25 +16,25 @@ /datum/map_template/engine/rust name = "EngineSubmap_RUST" desc = "R-UST Fusion Tokamak Engine" - mappath = 'maps/templates/engines/tether/engine_rust.dmm' + map_path = 'maps/templates/engines/tether/engine_rust.dmm' display_name = list("Contained Star", "Synthetic Killer", "Glowy Field", "R-UST", "Fusion Reactor", "Miniature Star") /datum/map_template/engine/singulo name = "EngineSubmap_Singulo" desc = "Lord Singuloth" - mappath = 'maps/templates/engines/tether/engine_singulo.dmm' + map_path = 'maps/templates/engines/tether/engine_singulo.dmm' display_name = list("Hypnosis Swirls", "Lord Singuloth", "The Devourer of Stations", "Contained Black Hole", "The Forbidden Succ") /datum/map_template/engine/supermatter name = "EngineSubmap_SM" desc = "Old Faithful Supermatter" - mappath = 'maps/templates/engines/tether/engine_sme.dmm' + map_path = 'maps/templates/engines/tether/engine_sme.dmm' display_name = list("Angry Rock", "The Forbidden Rock Candy", "Supermatter", "Death Crystal", "Spicy Crystal") /datum/map_template/engine/tesla name = "EngineSubmap_Tesla" desc = "The Telsa Engine" - mappath = 'maps/templates/engines/tether/engine_tesla.dmm' + map_path = 'maps/templates/engines/tether/engine_tesla.dmm' display_name = list("Edison's Bane", "Lady Tesla", "Lightning Ball", "Overpowered Phone Charger", "Exploder of Machines") // Landmark for where to load in the engine on permament map diff --git a/maps/templates/admin/dhael_centcom.dmm b/maps/templates/admin/dhael_centcom.dmm index 4cc1188fb33..a3249b03026 100644 --- a/maps/templates/admin/dhael_centcom.dmm +++ b/maps/templates/admin/dhael_centcom.dmm @@ -4266,7 +4266,7 @@ "mO" = ( /obj/machinery/door/airlock/glass_security{ name = "Security"; - req_access = newlist() + req_access = list() }, /turf/unsimulated/floor/steel, /area/centcom/security) @@ -10359,7 +10359,7 @@ "Fg" = ( /obj/machinery/door/airlock/glass_security{ name = "Security"; - req_access = newlist() + req_access = list() }, /turf/unsimulated/floor{ icon_state = "dark" @@ -11261,7 +11261,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/button/remote/blast_door{ id = "residential"; @@ -11512,7 +11512,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /turf/unsimulated/floor{ icon_state = "dark" @@ -12022,7 +12022,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /obj/effect/floor_decal/borderfloorblack{ dir = 8 @@ -12234,7 +12234,7 @@ /obj/machinery/door/window/brigdoor{ dir = 8; req_access = list(63); - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/button/remote/airlock{ id = "front"; @@ -14911,7 +14911,7 @@ /obj/machinery/door/airlock/highsecurity{ desc = "SHIT IS LIT"; name = "TACTICAL TOILET"; - req_one_access = newlist() + req_one_access = list() }, /turf/unsimulated/floor{ icon_state = "dark" diff --git a/maps/templates/archive/tradeship.dmm b/maps/templates/archive/tradeship.dmm index 8d7f2090a7b..fbbbab77753 100644 --- a/maps/templates/archive/tradeship.dmm +++ b/maps/templates/archive/tradeship.dmm @@ -587,7 +587,7 @@ /obj/machinery/door/airlock/glass_medical{ name = "Medical Bay"; req_access = list(160); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/shuttle/floor/black, /area/shuttle/trade) @@ -1082,7 +1082,7 @@ /obj/machinery/door/airlock/command{ name = "Bridge"; req_access = list(160); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/shuttle/floor/black, /area/shuttle/trade) @@ -1211,7 +1211,7 @@ "cX" = ( /obj/machinery/door/airlock/multi_tile/glass{ dir = 2; - req_access = newlist() + req_access = list() }, /turf/simulated/shuttle/floor/black, /area/shuttle/trade) @@ -1440,7 +1440,7 @@ /obj/machinery/door/airlock/glass_engineering{ name = "Engineering"; req_access = list(160); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/shuttle/floor/black, /area/shuttle/trade) @@ -1610,7 +1610,7 @@ /obj/machinery/door/airlock/command{ name = "Captain's Quarters"; req_access = list(160); - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/shuttle/floor/black, /area/shuttle/trade) @@ -1892,7 +1892,7 @@ /area/shuttle/trade) "jo" = ( /obj/machinery/door/airlock/multi_tile/glass{ - req_access = newlist() + req_access = list() }, /turf/simulated/shuttle/floor/black, /area/shuttle/trade) diff --git a/maps/templates/shelters/shelter_3.dmm b/maps/templates/shelters/shelter_3.dmm index 6cbf727d46b..d59a95be986 100644 --- a/maps/templates/shelters/shelter_3.dmm +++ b/maps/templates/shelters/shelter_3.dmm @@ -67,7 +67,7 @@ /area/survivalpod) "m" = ( /obj/structure/closet/secure_closet/bar{ - req_access = newlist() + req_access = list() }, /obj/machinery/light{ dir = 1 diff --git a/maps/templates/shuttles/overmaps/generic/curashuttle.dmm b/maps/templates/shuttles/overmaps/generic/curashuttle.dmm index d227c18d12f..c7aa78d286d 100644 --- a/maps/templates/shuttles/overmaps/generic/curashuttle.dmm +++ b/maps/templates/shuttles/overmaps/generic/curashuttle.dmm @@ -76,7 +76,7 @@ /obj/machinery/vending/blood{ density = 0; pixel_y = 18; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/tiled/white, /area/shuttle/curabitur/curashuttle/med) @@ -292,12 +292,12 @@ /obj/item/card/id/syndicate{ access = list(616); assignment = "Curabitur Contractor"; - origin_tech = newlist() + origin_tech = list() }, /obj/item/card/id/syndicate{ access = list(616); assignment = "Curabitur Contractor"; - origin_tech = newlist() + origin_tech = list() }, /obj/item/spacecash/c1000, /obj/item/spacecash/c1000, @@ -357,7 +357,7 @@ /obj/item/defib_kit/compact/combat/loaded, /obj/item/defib_kit/compact/combat/loaded, /obj/item/mmi/radio_enabled{ - req_access = newlist() + req_access = list() }, /obj/machinery/light{ dir = 4 @@ -502,7 +502,7 @@ /obj/machinery/vending/medical{ dir = 4; pixel_x = -14; - req_access = newlist() + req_access = list() }, /turf/simulated/floor/tiled/white, /area/shuttle/curabitur/curashuttle/med) diff --git a/maps/templates/shuttles/overmaps/generic/generic_shuttle.dmm b/maps/templates/shuttles/overmaps/generic/generic_shuttle.dmm index 7c51b392ed9..f7df3823154 100644 --- a/maps/templates/shuttles/overmaps/generic/generic_shuttle.dmm +++ b/maps/templates/shuttles/overmaps/generic/generic_shuttle.dmm @@ -236,7 +236,7 @@ /area/shuttle/generic_shuttle/gen) "az" = ( /obj/machinery/computer/ship/helm{ - req_one_access = newlist() + req_one_access = list() }, /obj/effect/floor_decal/techfloor/orange{ dir = 1 @@ -376,7 +376,7 @@ /area/shuttle/generic_shuttle/gen) "aR" = ( /obj/machinery/computer/shuttle_control/explore/generic_shuttle{ - req_one_access = newlist() + req_one_access = list() }, /obj/effect/floor_decal/steeldecal/steel_decals10{ dir = 4 diff --git a/maps/templates/shuttles/overmaps/generic/mercship.dmm b/maps/templates/shuttles/overmaps/generic/mercship.dmm index 81d540f7e7e..fddc6648c7a 100644 --- a/maps/templates/shuttles/overmaps/generic/mercship.dmm +++ b/maps/templates/shuttles/overmaps/generic/mercship.dmm @@ -359,7 +359,7 @@ dir = 4 }, /obj/machinery/door/window/brigdoor/southleft{ - req_access = newlist(); + req_access = list(); req_one_access = list(150) }, /obj/effect/floor_decal/borderfloorblack{ @@ -734,7 +734,7 @@ dir = 4 }, /obj/machinery/door/window/brigdoor/southleft{ - req_access = newlist(); + req_access = list(); req_one_access = list(150) }, /obj/effect/floor_decal/borderfloorblack{ @@ -829,7 +829,7 @@ dir = 4 }, /obj/machinery/door/window/brigdoor/southleft{ - req_access = newlist(); + req_access = list(); req_one_access = list(150) }, /obj/effect/floor_decal/borderfloorblack{ diff --git a/maps/templates/shuttles/overmaps/generic/vespa.dmm b/maps/templates/shuttles/overmaps/generic/vespa.dmm index 3f51fa5868c..4011d5ad84c 100644 --- a/maps/templates/shuttles/overmaps/generic/vespa.dmm +++ b/maps/templates/shuttles/overmaps/generic/vespa.dmm @@ -837,7 +837,7 @@ /area/ship/expe/hangarcontrol) "cx" = ( /obj/machinery/door/airlock/glass_medical{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/hangarcontrol) @@ -850,7 +850,7 @@ /area/ship/expe/hangarcontrol) "cz" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/hangarcontrol) @@ -1765,7 +1765,7 @@ /area/ship/expe/engines2) "fc" = ( /obj/machinery/door/airlock/glass_science{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/hangarcontrol) @@ -2717,7 +2717,7 @@ /area/ship/expe/hangarcontrol) "gP" = ( /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/hangarcontrol) @@ -3211,7 +3211,7 @@ /obj/effect/floor_decal/corner/yellow/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/engineeringstorage) @@ -3335,7 +3335,7 @@ /obj/effect/floor_decal/corner/yellow/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/engineering) @@ -3385,7 +3385,7 @@ /obj/machinery/door/firedoor/glass, /obj/effect/floor_decal/corner/yellow/borderfull, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/sm) @@ -3419,7 +3419,7 @@ }, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor, /area/ship/expe/sm) @@ -4571,7 +4571,7 @@ /area/ship/expe/medicalchem) "kq" = ( /obj/machinery/door/airlock/glass_medical{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ @@ -5013,7 +5013,7 @@ }, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_command{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/hangarcontrol) @@ -5553,7 +5553,7 @@ /area/ship/expe/seceq) "ms" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ @@ -5710,7 +5710,7 @@ /area/ship/expe/medicalmain) "mF" = ( /obj/machinery/door/airlock/medical{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ @@ -5830,7 +5830,7 @@ "mQ" = ( /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /obj/structure/cable{ icon_state = "4-8" @@ -5851,7 +5851,7 @@ /obj/effect/floor_decal/corner/yellow/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/engineeringequipment) @@ -6036,7 +6036,7 @@ /obj/effect/floor_decal/corner/blue/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/command{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/bridge) @@ -6281,7 +6281,7 @@ /area/ship/expe/seceq) "nJ" = ( /obj/machinery/door/airlock/security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/effect/floor_decal/borderfloorblack/full, @@ -6290,7 +6290,7 @@ /area/ship/expe/sechall) "nK" = ( /obj/machinery/door/airlock/security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ @@ -6309,7 +6309,7 @@ /area/ship/expe/seclobby2) "nN" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ @@ -6546,7 +6546,7 @@ /obj/effect/floor_decal/corner/yellow/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/engineeringpower) @@ -6868,7 +6868,7 @@ /area/ship/expe/seccells) "oT" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ @@ -7940,7 +7940,7 @@ /area/ship/expe/seccells) "rg" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/seccells) @@ -7999,7 +7999,7 @@ /area/ship/expe/medicalmain) "rq" = ( /obj/machinery/door/airlock/glass_medical{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /obj/structure/cable{ @@ -8016,7 +8016,7 @@ /area/ship/expe/medicalsur) "rt" = ( /obj/machinery/door/airlock/medical{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, @@ -8036,7 +8036,7 @@ /area/ship/expe/medicalsur) "rw" = ( /obj/machinery/door/airlock/medical{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor/glass, /obj/machinery/atmospherics/pipe/simple/hidden/supply, @@ -8193,7 +8193,7 @@ icon_state = "4-8" }, /obj/machinery/door/airlock/engineering{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor, /area/ship/expe/smstorage) @@ -8265,7 +8265,7 @@ /obj/effect/floor_decal/corner/blue/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/command{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/captqua) @@ -8440,7 +8440,7 @@ /obj/effect/floor_decal/corner/purple/borderfull, /obj/machinery/door/firedoor/glass, /obj/machinery/door/airlock/glass_science{ - req_one_access = newlist() + req_one_access = list() }, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/expedition) @@ -9425,7 +9425,7 @@ /area/ship/expe/sechall) "uI" = ( /obj/machinery/door/airlock/security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ @@ -9828,14 +9828,14 @@ /area/ship/expe/corridor2) "vG" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /turf/simulated/floor/tiled/techfloor, /area/ship/expe/corridor2) "vH" = ( /obj/machinery/door/airlock/glass_security{ - req_one_access = newlist() + req_one_access = list() }, /obj/machinery/door/firedoor, /obj/structure/cable{ diff --git a/maps/tether/tether.dm b/maps/tether/tether.dm index 6a8b78450f3..fd8d2c7f082 100644 --- a/maps/tether/tether.dm +++ b/maps/tether/tether.dm @@ -16,7 +16,7 @@ #include "../../maps/map_files/tether/tether-09-solars.dmm" - #define USING_MAP_DATUM /datum/map/tether + #define USING_MAP_DATUM /datum/map/station/tether #elif !defined(MAP_OVERRIDE) diff --git a/maps/tether/tether_defines.dm b/maps/tether/tether_defines.dm index 542b5a82564..3aa7054d756 100644 --- a/maps/tether/tether_defines.dm +++ b/maps/tether/tether_defines.dm @@ -32,7 +32,7 @@ #define NETWORK_EXPLORATION "Exploration" #define NETWORK_XENOBIO "Xenobiology" -/datum/map/tether/New() +/datum/map/station/tether/New() ..() var/choice = pickweight(list( "title1" = 50, @@ -48,7 +48,7 @@ if(choice) lobby_screens = list(choice) -/datum/map/tether +/datum/map/station/tether name = "Virgo" full_name = "NSB Adephagia" path = "tether" @@ -59,7 +59,7 @@ overmap_event_areas = 44 usable_email_tlds = list("virgo.nt") - zlevel_datum_type = /datum/map_z_level/tether + zlevel_datum_type = /datum/map_level/tether lobby_icon = 'icons/misc/title_vr.dmi' lobby_screens = list("tether2_night") @@ -191,16 +191,11 @@ belter_belt_z = list(Z_LEVEL_ROGUEMINE_1, Z_LEVEL_ROGUEMINE_2) - mining_station_z = list(Z_LEVEL_SPACE_HIGH) - mining_outpost_z = list(Z_LEVEL_SURFACE_MINE) - - lateload_single_pick = null //Nothing right now. - planet_datums_to_make = list(/datum/planet/virgo3b, /datum/planet/virgo4, /datum/planet/class_d) -// /datum/map/tether/get_map_info() +// /datum/map/station/tether/get_map_info() // . = list() // . += "The [full_name] is an ancient ruin turned workplace in the Virgo-Erigone System, deep in the midst of the Coreward Periphery.
    " // . += "Humanity has spread across the stars and has met many species on similar or even more advanced terms than them - it's a brave new world and many try to find their place in it .
    " @@ -208,7 +203,7 @@ // . += "As an employee or contractor of NanoTrasen, operators of the Adephagia and one of the galaxy's largest corporations, you're probably just here to do a job." // return jointext(., "
    ") -/datum/map/tether/perform_map_generation() +/datum/map/station/tether/perform_map_generation() new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, Z_LEVEL_SURFACE_MINE, world.maxx, world.maxy) // Create the mining Z-level. new /datum/random_map/noise/ore(null, 1, 1, Z_LEVEL_SURFACE_MINE, 64, 64) // Create the mining ore distribution map. @@ -325,11 +320,11 @@ Allignment: Neutral to NanoTrasen. No Discount for services expected."} var/obj/effect/overmap/visitable/ship/landable/SL = AM //Phew var/datum/shuttle/autodock/multi/shuttle = SSshuttle.shuttles[SL.shuttle] if(!istype(shuttle) || !shuttle.cloaked) //Not a multishuttle (the only kind that can cloak) or not cloaked - GLOB.lore_atc.msg(message) + SSlegacy_atc.msg(message) //For ships, it's safe to assume they're big enough to not be sneaky else if(istype(AM, /obj/effect/overmap/visitable/ship)) - GLOB.lore_atc.msg(message) + SSlegacy_atc.msg(message) // For making the 6-in-1 holomap, we calculate some offsets /// Width and height of compiled in tether z levels. @@ -341,44 +336,44 @@ Allignment: Neutral to NanoTrasen. No Discount for services expected."} /// 30 #define TETHER_HOLOMAP_MARGIN_Y ((HOLOMAP_ICON_SIZE - (3*TETHER_MAP_SIZE)) / 2) // We have a bunch of stuff common to the station z levels -/datum/map_z_level/tether +/datum/map_level/tether base_turf = /turf/simulated/floor/outdoors/rocks/virgo3b -/datum/map_z_level/tether/station - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT +/datum/map_level/tether/station + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|MAP_LEVEL_XENOARCH_EXEMPT holomap_legend_x = 220 holomap_legend_y = 160 -/datum/map_z_level/tether/station/surface_low +/datum/map_level/tether/station/surface_low z = Z_LEVEL_SURFACE_LOW name = "Surface 1" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|LEGACY_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT base_turf = /turf/simulated/floor/outdoors/rocks/virgo3b holomap_offset_x = TETHER_HOLOMAP_MARGIN_X holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*0 -/datum/map_z_level/tether/station/surface_mid +/datum/map_level/tether/station/surface_mid z = Z_LEVEL_SURFACE_MID name = "Surface 2" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|LEGACY_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT base_turf = /turf/simulated/open holomap_offset_x = TETHER_HOLOMAP_MARGIN_X holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*1 -/datum/map_z_level/tether/station/surface_high +/datum/map_level/tether/station/surface_high z = Z_LEVEL_SURFACE_HIGH name = "Surface 3" - flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_CONSOLES|MAP_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONSOLES|LEGACY_LEVEL_SEALED|MAP_LEVEL_XENOARCH_EXEMPT base_turf = /turf/simulated/open holomap_offset_x = TETHER_HOLOMAP_MARGIN_X holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*2 -/datum/map_z_level/tether/transit +/datum/map_level/tether/transit z = Z_LEVEL_TRANSIT name = "Transit" - flags = MAP_LEVEL_STATION|MAP_LEVEL_SEALED|MAP_LEVEL_PLAYER|MAP_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT + flags = LEGACY_LEVEL_STATION|LEGACY_LEVEL_SEALED|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT -/datum/map_z_level/tether/station/space_low +/datum/map_level/tether/station/space_low z = Z_LEVEL_SPACE_LOW name = "Asteroid 1" base_turf = /turf/space @@ -386,7 +381,7 @@ Allignment: Neutral to NanoTrasen. No Discount for services expected."} holomap_offset_x = HOLOMAP_ICON_SIZE - TETHER_HOLOMAP_MARGIN_X - TETHER_MAP_SIZE holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*0 -/datum/map_z_level/tether/station/space_high +/datum/map_level/tether/station/space_high z = Z_LEVEL_SPACE_HIGH name = "Asteroid 2" base_turf = /turf/simulated/open @@ -394,18 +389,64 @@ Allignment: Neutral to NanoTrasen. No Discount for services expected."} holomap_offset_x = HOLOMAP_ICON_SIZE - TETHER_HOLOMAP_MARGIN_X - TETHER_MAP_SIZE holomap_offset_y = TETHER_HOLOMAP_MARGIN_Y + TETHER_MAP_SIZE*1 -/datum/map_z_level/tether/mine +/datum/map_level/tether/mine z = Z_LEVEL_SURFACE_MINE name = "Mining Outpost" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_SEALED + flags = LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_SEALED base_turf = /turf/simulated/floor/outdoors/rocks/virgo3b -/datum/map_z_level/tether/solars +/datum/map_level/tether/solars z = Z_LEVEL_SOLARS name = "Solar Field" - flags = MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER|MAP_LEVEL_SEALED + flags = LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_SEALED base_turf = /turf/simulated/floor/outdoors/rocks/virgo3b +/datum/map_template/lateload/tether/tether_misc + name = "Tether - Misc" + desc = "Misc areas, like some transit areas, holodecks, merc area." + map_path = "maps/map_files/tether/tether_misc.dmm" + + associated_map_datum = /datum/map_level/tether_lateload/misc + +/datum/map_level/tether_lateload/misc + name = "Misc" + flags = LEGACY_LEVEL_ADMIN|LEGACY_LEVEL_SEALED|LEGACY_LEVEL_CONTACT|MAP_LEVEL_XENOARCH_EXEMPT + +/datum/map_template/lateload/tether/tether_underdark + name = "Tether - Underdark" + desc = "Mining, but harder." + map_path = "maps/map_files/tether/tether_underdark.dmm" + + associated_map_datum = /datum/map_level/tether_lateload/underdark + +/datum/map_level/tether_lateload/underdark + name = "Underdark" + flags = LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_SEALED + base_turf = /turf/simulated/mineral/floor/virgo3b + +/datum/map_template/lateload/tether/tether_underdark/on_map_loaded(z) + . = ..() + seed_submaps(list(z), 150, /area/mine/unexplored/underdark, /datum/map_template/submap/level_specific/underdark) + new /datum/random_map/automata/cave_system/no_cracks(null, 3, 3, z, world.maxx - 4, world.maxy - 4) // Create the mining Z-level. + new /datum/random_map/noise/ore(null, 1, 1, z, 64, 64) // Create the mining ore distribution map. + +/datum/map_template/lateload/tether/tether_plains + name = "Tether - Plains" + desc = "The Virgo 3B away mission." + map_path = "maps/map_files/tether/tether_plains.dmm" + associated_map_datum = /datum/map_level/tether_lateload/tether_plains + +/datum/map_level/tether_lateload/tether_plains + name = "Away Mission - Plains" + flags = LEGACY_LEVEL_CONTACT|LEGACY_LEVEL_PLAYER|LEGACY_LEVEL_SEALED + base_turf = /turf/simulated/mineral/floor/virgo3b + +/datum/map_template/lateload/tether/tether_plains/on_map_loaded(z) + . = ..() + seed_submaps(list(z), 150, /area/tether/outpost/exploration_plains, /datum/map_template/submap/level_specific/plains) + + + ///////////////////// /// Step Triggers /// @@ -461,8 +502,8 @@ Allignment: Neutral to NanoTrasen. No Discount for services expected."} . = ..() teleport_x = x teleport_y = y - for(var/z_num in GLOB.using_map.zlevels) - var/datum/map_z_level/Z = GLOB.using_map.zlevels[z_num] + for(var/z_num in (LEGACY_MAP_DATUM).zlevels) + var/datum/map_level/Z = (LEGACY_MAP_DATUM).zlevels[z_num] if(Z.name == "Underdark") teleport_z = Z.z @@ -474,8 +515,8 @@ Allignment: Neutral to NanoTrasen. No Discount for services expected."} . = ..() teleport_x = x teleport_y = y - for(var/z_num in GLOB.using_map.zlevels) - var/datum/map_z_level/Z = GLOB.using_map.zlevels[z_num] + for(var/z_num in (LEGACY_MAP_DATUM).zlevels) + var/datum/map_level/Z = (LEGACY_MAP_DATUM).zlevels[z_num] if(Z.name == "Mining Outpost") teleport_z = Z.z diff --git a/maps/tether/tether_telecomms.dm b/maps/tether/tether_telecomms.dm index 2cd7261a18d..494ab88845b 100644 --- a/maps/tether/tether_telecomms.dm +++ b/maps/tether/tether_telecomms.dm @@ -62,24 +62,6 @@ /area/maintenance/station/tcomms name = "\improper Telecoms Maintenance" -/datum/map/tether/default_internal_channels() - return list( - num2text(PUB_FREQ) = list(), - num2text(AI_FREQ) = list(ACCESS_SPECIAL_SILICONS), - num2text(ENT_FREQ) = list(), - num2text(ERT_FREQ) = list(ACCESS_CENTCOM_ERT), - num2text(COMM_FREQ)= list(ACCESS_COMMAND_BRIDGE), - num2text(ENG_FREQ) = list(ACCESS_ENGINEERING_ENGINE, ACCESS_ENGINEERING_ATMOS), - num2text(MED_FREQ) = list(ACCESS_MEDICAL_EQUIPMENT), - num2text(MED_I_FREQ)=list(ACCESS_MEDICAL_EQUIPMENT), - num2text(SEC_FREQ) = list(ACCESS_SECURITY_EQUIPMENT), - num2text(SEC_I_FREQ)=list(ACCESS_SECURITY_EQUIPMENT), - num2text(SCI_FREQ) = list(ACCESS_SCIENCE_FABRICATION,ACCESS_SCIENCE_ROBOTICS,ACCESS_SCIENCE_XENOBIO), - num2text(SUP_FREQ) = list(ACCESS_SUPPLY_BAY), - num2text(SRV_FREQ) = list(ACCESS_GENERAL_JANITOR, ACCESS_GENERAL_BOTANY), - num2text(EXP_FREQ) = list(ACCESS_GENERAL_EXPLORER) - ) - /obj/item/multitool/tether_buffered name = "pre-linked multitool (tether hub)" desc = "This multitool has already been linked to the Tether telecomms hub and can be used to configure one (1) relay."