mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
8
code/__defines/map.dm
Normal file
8
code/__defines/map.dm
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Z-level flags bitfield - Set these flags to determine the z level's purpose
|
||||||
|
#define MAP_LEVEL_STATION 0x001 // Z-levels the station exists on
|
||||||
|
#define MAP_LEVEL_ADMIN 0x002 // Z-levels for admin functionality (Centcom, shuttle transit, etc)
|
||||||
|
#define MAP_LEVEL_CONTACT 0x004 // Z-levels that can be contacted from the station, for eg announcements
|
||||||
|
#define MAP_LEVEL_PLAYER 0x008 // Z-levels a character can typically reach
|
||||||
|
#define MAP_LEVEL_SEALED 0x010 // Z-levels that don't allow random transit at edge
|
||||||
|
#define MAP_LEVEL_EMPTY 0x020 // Empty Z-levels that may be used for various things (currently used by bluespace jump)
|
||||||
|
#define MAP_LEVEL_CONSOLES 0x040 // Z-levels available to various consoles, such as the crew monitor (when that gets coded in). Defaults to station_levels if unset.
|
||||||
@@ -176,6 +176,7 @@ var/list/admin_verbs_debug = list(
|
|||||||
/client/proc/debug_controller,
|
/client/proc/debug_controller,
|
||||||
/client/proc/debug_antagonist_template,
|
/client/proc/debug_antagonist_template,
|
||||||
/client/proc/cmd_debug_mob_lists,
|
/client/proc/cmd_debug_mob_lists,
|
||||||
|
/client/proc/cmd_debug_using_map,
|
||||||
/client/proc/cmd_admin_delete,
|
/client/proc/cmd_admin_delete,
|
||||||
/client/proc/cmd_debug_del_all,
|
/client/proc/cmd_debug_del_all,
|
||||||
/client/proc/cmd_debug_tog_aliens,
|
/client/proc/cmd_debug_tog_aliens,
|
||||||
@@ -286,6 +287,7 @@ var/list/admin_verbs_hideable = list(
|
|||||||
/client/proc/debug_controller,
|
/client/proc/debug_controller,
|
||||||
/client/proc/startSinglo,
|
/client/proc/startSinglo,
|
||||||
/client/proc/cmd_debug_mob_lists,
|
/client/proc/cmd_debug_mob_lists,
|
||||||
|
/client/proc/cmd_debug_using_map,
|
||||||
/client/proc/cmd_debug_del_all,
|
/client/proc/cmd_debug_del_all,
|
||||||
/client/proc/cmd_debug_tog_aliens,
|
/client/proc/cmd_debug_tog_aliens,
|
||||||
/client/proc/air_report,
|
/client/proc/air_report,
|
||||||
|
|||||||
@@ -943,6 +943,15 @@
|
|||||||
if("Clients")
|
if("Clients")
|
||||||
usr << jointext(clients,",")
|
usr << jointext(clients,",")
|
||||||
|
|
||||||
|
/client/proc/cmd_debug_using_map()
|
||||||
|
set category = "Debug"
|
||||||
|
set name = "Debug Map Datum"
|
||||||
|
set desc = "Debug the map metadata about the currently compiled in map."
|
||||||
|
|
||||||
|
if(!check_rights(R_DEBUG))
|
||||||
|
return
|
||||||
|
debug_variables(using_map)
|
||||||
|
|
||||||
// DNA2 - Admin Hax
|
// DNA2 - Admin Hax
|
||||||
/client/proc/cmd_admin_toggle_block(var/mob/M,var/block)
|
/client/proc/cmd_admin_toggle_block(var/mob/M,var/block)
|
||||||
if(!ticker)
|
if(!ticker)
|
||||||
|
|||||||
4
html/changelogs/Leshana-mapz.yml
Normal file
4
html/changelogs/Leshana-mapz.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Leshana
|
||||||
|
delete-after: True
|
||||||
|
changes:
|
||||||
|
- rscadd: "Added an admin verb to debug the map datum."
|
||||||
@@ -9,26 +9,7 @@
|
|||||||
lobby_icon = 'icons/misc/title.dmi'
|
lobby_icon = 'icons/misc/title.dmi'
|
||||||
lobby_screens = list("mockingjay00")
|
lobby_screens = list("mockingjay00")
|
||||||
|
|
||||||
station_levels = list(
|
zlevel_datum_type = /datum/map_z_level/example
|
||||||
Z_LEVEL_FIRST_EXAMPLE,
|
|
||||||
Z_LEVEL_SECOND_EXAMPLE
|
|
||||||
)
|
|
||||||
|
|
||||||
admin_levels = list()
|
|
||||||
contact_levels = list(
|
|
||||||
Z_LEVEL_FIRST_EXAMPLE,
|
|
||||||
Z_LEVEL_SECOND_EXAMPLE
|
|
||||||
)
|
|
||||||
|
|
||||||
player_levels = list(
|
|
||||||
Z_LEVEL_FIRST_EXAMPLE,
|
|
||||||
Z_LEVEL_SECOND_EXAMPLE
|
|
||||||
)
|
|
||||||
|
|
||||||
sealed_levels = list()
|
|
||||||
empty_levels = list()
|
|
||||||
accessible_z_levels = list("1" = 50, "2" = 50) // The defines can't be used here sadly.
|
|
||||||
base_turf_by_z = list("2" = /turf/simulated/open)
|
|
||||||
|
|
||||||
station_name = "The Funhouse"
|
station_name = "The Funhouse"
|
||||||
station_short = "Funhouse"
|
station_short = "Funhouse"
|
||||||
@@ -46,4 +27,17 @@
|
|||||||
emergency_shuttle_docked_message = "The Emergency Shuttle has docked with the station at docks one and two. You have approximately %ETD% to board the Emergency Shuttle."
|
emergency_shuttle_docked_message = "The Emergency Shuttle has docked with the station at docks one and two. You have approximately %ETD% to board the Emergency Shuttle."
|
||||||
emergency_shuttle_leaving_dock = "The Emergency Shuttle has left the station. Estimate %ETA% until the shuttle docks at %dock_name%."
|
emergency_shuttle_leaving_dock = "The Emergency Shuttle has left the station. Estimate %ETA% until the shuttle docks at %dock_name%."
|
||||||
emergency_shuttle_called_message = "An emergency evacuation shuttle has been called. It will arrive at docks one and two in approximately %ETA%"
|
emergency_shuttle_called_message = "An emergency evacuation shuttle has been called. It will arrive at docks one and two in approximately %ETA%"
|
||||||
emergency_shuttle_recall_message = "The emergency shuttle has been recalled."
|
emergency_shuttle_recall_message = "The emergency shuttle has been recalled."
|
||||||
|
|
||||||
|
/datum/map_z_level/example/first
|
||||||
|
z = Z_LEVEL_FIRST_EXAMPLE
|
||||||
|
name = "First Floor"
|
||||||
|
flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 50
|
||||||
|
|
||||||
|
/datum/map_z_level/example/second
|
||||||
|
z = Z_LEVEL_SECOND_EXAMPLE
|
||||||
|
name = "Second Floor"
|
||||||
|
flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 50
|
||||||
|
base_turf = /turf/simulated/open
|
||||||
|
|||||||
@@ -14,34 +14,7 @@
|
|||||||
lobby_icon = 'icons/misc/title.dmi'
|
lobby_icon = 'icons/misc/title.dmi'
|
||||||
lobby_screens = list("mockingjay00")
|
lobby_screens = list("mockingjay00")
|
||||||
|
|
||||||
station_levels = list(
|
zlevel_datum_type = /datum/map_z_level/northern_star
|
||||||
Z_LEVEL_MAIN_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_MINING_NORTHERN_STAR
|
|
||||||
)
|
|
||||||
|
|
||||||
admin_levels = list(Z_LEVEL_CENTCOM_NORTHERN_STAR)
|
|
||||||
contact_levels = list(
|
|
||||||
Z_LEVEL_MAIN_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_CENTCOM_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_MINING_NORTHERN_STAR
|
|
||||||
)
|
|
||||||
|
|
||||||
player_levels = list(
|
|
||||||
Z_LEVEL_MAIN_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_TELECOMMS_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_ABANDONED_ASTEROID_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_MINING_NORTHERN_STAR,
|
|
||||||
Z_LEVEL_EMPTY_NORTHERN_STAR
|
|
||||||
)
|
|
||||||
|
|
||||||
sealed_levels = list()
|
|
||||||
empty_levels = list()
|
|
||||||
accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" = 60) // The defines can't be used here sadly.
|
|
||||||
base_turf_by_z = list(
|
|
||||||
"1" = /turf/simulated/mineral/floor,
|
|
||||||
"4" = /turf/simulated/mineral/floor,
|
|
||||||
"5" = /turf/simulated/mineral/floor
|
|
||||||
)
|
|
||||||
|
|
||||||
station_name = "NCS Northern Star"
|
station_name = "NCS Northern Star"
|
||||||
station_short = "Northern Star"
|
station_short = "Northern Star"
|
||||||
@@ -92,4 +65,42 @@
|
|||||||
|
|
||||||
new /datum/random_map/automata/cave_system(null, 1, 1, Z_LEVEL_MINING_NORTHERN_STAR, world.maxx, world.maxy) // Create the mining Z-level.
|
new /datum/random_map/automata/cave_system(null, 1, 1, Z_LEVEL_MINING_NORTHERN_STAR, world.maxx, world.maxy) // Create the mining Z-level.
|
||||||
new /datum/random_map/noise/ore(null, 1, 1, Z_LEVEL_MINING_NORTHERN_STAR, 64, 64) // Create the mining ore distribution map.
|
new /datum/random_map/noise/ore(null, 1, 1, Z_LEVEL_MINING_NORTHERN_STAR, 64, 64) // Create the mining ore distribution map.
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
/datum/map_z_level/northern_star/main
|
||||||
|
z = Z_LEVEL_MAIN_NORTHERN_STAR
|
||||||
|
name = "Main"
|
||||||
|
flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 5
|
||||||
|
base_turf = /turf/simulated/mineral/floor
|
||||||
|
|
||||||
|
/datum/map_z_level/northern_star/centcomm
|
||||||
|
z = Z_LEVEL_CENTCOM_NORTHERN_STAR
|
||||||
|
name = "Centcomm"
|
||||||
|
flags = MAP_LEVEL_ADMIN|MAP_LEVEL_CONTACT
|
||||||
|
|
||||||
|
/datum/map_z_level/northern_star/telecomms
|
||||||
|
z = Z_LEVEL_TELECOMMS_NORTHERN_STAR
|
||||||
|
name = "Telecomms"
|
||||||
|
flags = MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 10
|
||||||
|
|
||||||
|
/datum/map_z_level/northern_star/abandoned_asteroid
|
||||||
|
z = Z_LEVEL_ABANDONED_ASTEROID_NORTHERN_STAR
|
||||||
|
name = "Abandoned Asteroid"
|
||||||
|
flags = MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 15
|
||||||
|
base_turf = /turf/simulated/mineral/floor
|
||||||
|
|
||||||
|
/datum/map_z_level/northern_star/mining
|
||||||
|
z = Z_LEVEL_MINING_NORTHERN_STAR
|
||||||
|
name = "Mining"
|
||||||
|
flags = MAP_LEVEL_STATION|MAP_LEVEL_CONTACT|MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 10
|
||||||
|
base_turf = /turf/simulated/mineral/floor
|
||||||
|
|
||||||
|
/datum/map_z_level/northern_star/empty
|
||||||
|
z = Z_LEVEL_EMPTY_NORTHERN_STAR
|
||||||
|
name = "Empty"
|
||||||
|
flags = MAP_LEVEL_PLAYER
|
||||||
|
transit_chance = 60
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ var/list/all_maps = list()
|
|||||||
var/full_name = "Unnamed Map"
|
var/full_name = "Unnamed Map"
|
||||||
var/path
|
var/path
|
||||||
|
|
||||||
|
var/list/zlevels = list()
|
||||||
|
var/zlevel_datum_type // If populated, all subtypes of this type will be instantiated and used to populate the *_levels lists.
|
||||||
|
|
||||||
var/list/station_levels = list() // Z-levels the station exists on
|
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/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/contact_levels = list() // Z-levels that can be contacted from the station, for eg announcements
|
||||||
@@ -73,6 +76,9 @@ var/list/all_maps = list()
|
|||||||
|
|
||||||
/datum/map/New()
|
/datum/map/New()
|
||||||
..()
|
..()
|
||||||
|
if(zlevel_datum_type)
|
||||||
|
for(var/type in subtypesof(zlevel_datum_type))
|
||||||
|
new type(src)
|
||||||
if(!map_levels)
|
if(!map_levels)
|
||||||
map_levels = station_levels.Copy()
|
map_levels = station_levels.Copy()
|
||||||
if(!allowed_jobs || !allowed_jobs.len)
|
if(!allowed_jobs || !allowed_jobs.len)
|
||||||
@@ -111,4 +117,38 @@ var/list/all_maps = list()
|
|||||||
if(empty_levels == null)
|
if(empty_levels == null)
|
||||||
world.maxz++
|
world.maxz++
|
||||||
empty_levels = list(world.maxz)
|
empty_levels = list(world.maxz)
|
||||||
return pick(empty_levels)
|
return pick(empty_levels)
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
// 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 // 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.
|
||||||
|
|
||||||
|
// Default constructor applies itself to the parent map datum
|
||||||
|
/datum/map_z_level/New(var/datum/map/map)
|
||||||
|
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_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
|
||||||
|
|
||||||
|
/datum/map_z_level/Destroy()
|
||||||
|
return TRUE // No.
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "code\__defines\items_clothing.dm"
|
#include "code\__defines\items_clothing.dm"
|
||||||
#include "code\__defines\lighting.dm"
|
#include "code\__defines\lighting.dm"
|
||||||
#include "code\__defines\machinery.dm"
|
#include "code\__defines\machinery.dm"
|
||||||
|
#include "code\__defines\map.dm"
|
||||||
#include "code\__defines\math_physics.dm"
|
#include "code\__defines\math_physics.dm"
|
||||||
#include "code\__defines\misc.dm"
|
#include "code\__defines\misc.dm"
|
||||||
#include "code\__defines\mobs.dm"
|
#include "code\__defines\mobs.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user