rename some mapping-related files (#29422)

This commit is contained in:
warriorstar-orion
2025-05-25 16:45:52 +00:00
committed by GitHub
parent 45e07189b3
commit 43fe113250
9 changed files with 30 additions and 28 deletions
+209
View File
@@ -0,0 +1,209 @@
/datum/map_template
var/name = "Default Template Name"
var/width = 0
var/height = 0
var/mappath = null
var/mapfile = null
var/loaded = 0 // Times loaded this round
/// Do we exclude this from CI checks? If so, set this to the templates pathtype itself to avoid it getting passed down
var/ci_exclude = null // DO NOT SET THIS IF YOU DO NOT KNOW WHAT YOU ARE DOING
/datum/map_template/New(path = null, map = null, rename = null)
if(path)
mappath = path
if(mappath)
preload_size(mappath)
if(map)
mapfile = map
if(rename)
name = rename
/datum/map_template/proc/preload_size(path)
var/bounds = GLOB.maploader.load_map(file(path), 1, 1, 1, shouldCropMap = FALSE, measureOnly = TRUE)
if(bounds)
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/load(turf/T, centered = 0)
var/turf/placement = T
var/min_x = placement.x
var/min_y = placement.y
if(centered)
min_x -= round(width/2)
min_y -= round(height/2)
var/max_x = min_x + width - 1
var/max_y = min_y + height - 1
if(!T)
return 0
var/turf/bot_left = locate(max(1, min_x), max(1, min_y), placement.z)
var/turf/top_right = locate(min(world.maxx, max_x), min(world.maxy, max_y), placement.z)
// 1 bigger, to update the turf smoothing
var/turf/ST_bot_left = locate(max(1, min_x-1), max(1, min_y-1), placement.z)
var/turf/ST_top_right = locate(min(world.maxx, max_x+1), min(world.maxy, max_y+1), placement.z)
// This is to place a freeze on initialization until the map's done loading
// otherwise atmos and stuff will start running mid-load
// This system will metaphorically snap in half (not postpone init everywhere)
// if given a multi-z template
// it might need to be adapted for that when that time comes
GLOB.space_manager.add_dirt(placement.z)
var/datum/milla_safe/freeze_z_level/milla_freeze = new()
milla_freeze.invoke_async(T.z)
UNTIL(milla_freeze.done)
try
var/list/bounds = GLOB.maploader.load_map(get_file(), min_x, min_y, placement.z, shouldCropMap = TRUE)
if(!bounds)
return 0
if(bot_left == null || top_right == null)
stack_trace("One of the late setup corners is bust")
if(ST_bot_left == null || ST_top_right == null)
stack_trace("One of the smoothing corners is bust")
catch(var/exception/e)
GLOB.space_manager.remove_dirt(placement.z)
var/datum/milla_safe_must_sleep/late_setup_level/milla = new()
milla.invoke_async(bot_left, top_right, block(ST_bot_left, ST_top_right))
message_admins("Map template [name] threw an error while loading. Safe exit attempted, but check for errors at [ADMIN_COORDJMP(placement)].")
log_admin("Map template [name] threw an error while loading. Safe exit attempted.")
throw e
GLOB.space_manager.remove_dirt(placement.z)
var/datum/milla_safe_must_sleep/late_setup_level/milla = new()
milla.invoke_async(bot_left, top_right, block(ST_bot_left, ST_top_right))
log_game("[name] loaded at [min_x],[min_y],[placement.z]")
return 1
/datum/map_template/proc/get_file()
if(mapfile)
. = mapfile
else if(mappath)
. = wrap_file(mappath)
if(!.)
stack_trace(" The file of [src] appears to be empty/non-existent.")
/datum/map_template/proc/get_affected_turfs(turf/T, centered = 0)
var/list/coordinate_bounds = get_coordinate_bounds(T, centered)
var/datum/coords/bottom_left = coordinate_bounds["bottom_left"]
var/datum/coords/top_right = coordinate_bounds["top_right"]
return block(max(bottom_left.x_pos, 1), max(bottom_left.y_pos, 1), T.z, min(top_right.x_pos, world.maxx), min(top_right.y_pos, world.maxy), T.z)
/datum/map_template/proc/get_coordinate_bounds(turf/T, centered = FALSE)
var/turf/placement = T
var/min_x = placement.x
var/min_y = placement.y
if(centered)
min_x -= round(width/2)
min_y -= round(height/2)
var/max_x = min_x + width-1
var/max_y = min_y + height-1
var/datum/coords/bottom_left = new(min_x, min_y, 1)
var/datum/coords/top_right = new(max_x, max_y, 1)
return list("bottom_left" = bottom_left, "top_right" = top_right)
/datum/map_template/proc/fits_in_map_bounds(turf/T, centered = 0)
var/turf/placement = T
var/min_x = placement.x
var/min_y = placement.y
if(centered)
min_x -= round(width/2)
min_y -= round(height/2)
var/max_x = min_x + width-1
var/max_y = min_y + height-1
if(min_x < 1 || min_y < 1 || max_x > world.maxx || max_y > world.maxy)
return FALSE
else
return TRUE
/proc/preloadTemplates(path = "_maps/map_files/templates/") //see master controller setup
for(var/map in flist(path))
if(cmptext(copytext(map, length(map) - 3), ".dmm"))
var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
GLOB.map_templates[T.name] = T
if(GLOB.configuration.ruins.enable_ruins) // so we don't unnecessarily clutter start-up
preloadRuinTemplates()
preloadShelterTemplates()
preloadShuttleTemplates()
preloadBridgeTemplates()
preloadEventTemplates()
/proc/preloadRuinTemplates()
// Merge the active lists together
var/list/space_ruins = GLOB.configuration.ruins.active_space_ruins.Copy()
var/list/lava_ruins = GLOB.configuration.ruins.active_lava_ruins.Copy()
var/list/all_ruins = space_ruins | lava_ruins
for(var/item in subtypesof(/datum/map_template/ruin))
var/datum/map_template/ruin/ruin_type = item
// screen out the abstract subtypes
if(!initial(ruin_type.id))
continue
var/datum/map_template/ruin/R = new ruin_type()
// If not in the active list, skip it
if(!(R.mappath in all_ruins))
continue
GLOB.map_templates[R.name] = R
if(istype(R, /datum/map_template/ruin/lavaland))
GLOB.lava_ruins_templates[R.name] = R
if(istype(R, /datum/map_template/ruin/space))
GLOB.space_ruins_templates[R.name] = R
/proc/preloadShelterTemplates()
for(var/item in subtypesof(/datum/map_template/shelter))
var/datum/map_template/shelter/shelter_type = item
if(!(initial(shelter_type.mappath)))
continue
var/datum/map_template/shelter/S = new shelter_type()
GLOB.shelter_templates[S.shelter_id] = S
GLOB.map_templates[S.shelter_id] = S
/proc/preloadShuttleTemplates()
for(var/item in subtypesof(/datum/map_template/shuttle))
var/datum/map_template/shuttle/shuttle_type = item
if(!initial(shuttle_type.suffix))
continue
var/datum/map_template/shuttle/S = new shuttle_type()
GLOB.shuttle_templates[S.shuttle_id] = S
GLOB.map_templates[S.shuttle_id] = S
/proc/preloadBridgeTemplates()
for(var/item in subtypesof(/datum/map_template/ruin/lavaland/zlvl_bridge/vertical))
var/datum/map_template/ruin/lavaland/zlvl_bridge/vertical/vertical_type = item
if(!(initial(vertical_type.suffix)))
continue
var/datum/map_template/ruin/lavaland/zlvl_bridge/vertical/V = new vertical_type()
GLOB.lavaland_zlvl_bridge_templates[V.suffix] = V
GLOB.map_templates[V.suffix] = V
for(var/item in subtypesof(/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal))
var/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/horizontal_type = item
if(!(initial(horizontal_type.suffix)))
continue
var/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/V = new horizontal_type()
GLOB.lavaland_zlvl_bridge_templates[V.suffix] = V
GLOB.map_templates[V.suffix] = V
/proc/preloadEventTemplates()
for(var/item in subtypesof(/datum/map_template/event))
var/datum/map_template/event/event_type = item
if(!initial(event_type.mappath))
continue
var/datum/map_template/event/E = new event_type()
GLOB.map_templates[E.event_id] = E
+204
View File
@@ -0,0 +1,204 @@
#define DEFAULT_PADDING 32
/datum/ruin_placement
var/datum/map_template/ruin/ruin
var/base_padding
var/padding
/datum/ruin_placement/New(datum/map_template/ruin/ruin_, padding_ = DEFAULT_PADDING, base_padding_ = 0)
. = ..()
ruin = ruin_
base_padding = base_padding_
padding = padding_
/datum/ruin_placement/proc/reduce_padding()
padding = max(floor(padding / 2) - 1, -1)
/datum/ruin_placement/proc/try_to_place(zlist_or_zlevel, area_whitelist)
var/list/z_levels = islist(zlist_or_zlevel) ? zlist_or_zlevel : list(zlist_or_zlevel)
shuffle_inplace(z_levels)
// Our goal is to maximize padding, so we'll perform some number of attempts
// on one z-level, then the next, until we reach some limit, then reduce the
// padding and start again.
padding = DEFAULT_PADDING
while(padding >= 0)
var/width_border = base_padding + round(ruin.width / 2) + padding
var/height_border = base_padding + round(ruin.height / 2) + padding
for(var/z_level in z_levels)
var/placement_tries = PLACEMENT_TRIES
while(placement_tries > 0)
CHECK_TICK
placement_tries--
var/turf/central_turf = locate(
rand(width_border, world.maxx - width_border),
rand(height_border, world.maxy - height_border),
z_level
)
var/valid = TRUE
if(!central_turf)
continue
// Expand the original bounds of the ruin with our padding and call
// that our list of affected turfs.
var/list/bounds = ruin.get_coordinate_bounds(central_turf, centered = TRUE)
var/datum/coords/bottom_left = bounds["bottom_left"]
var/datum/coords/top_right = bounds["top_right"]
bottom_left.x_pos -= padding
bottom_left.y_pos -= padding
top_right.x_pos += padding
top_right.y_pos += padding
var/list/affected_turfs = block(bottom_left.x_pos, bottom_left.y_pos, z_level, top_right.x_pos, top_right.y_pos, z_level)
// One sanity check just in case
if(!ruin.fits_in_map_bounds(central_turf, centered = TRUE))
valid = FALSE
for(var/turf/check in affected_turfs)
var/area/new_area = get_area(check)
if(!(istype(new_area, area_whitelist)) || check.flags & NO_RUINS)
valid = FALSE
break
if(!valid)
continue
for(var/turf/T in affected_turfs)
for(var/obj/structure/spawner/nest in T)
qdel(nest)
for(var/mob/living/simple_animal/monster in T)
qdel(monster)
for(var/obj/structure/flora/ash/plant in T)
qdel(plant)
var/loaded = ruin.load(central_turf, centered = TRUE)
if(!loaded)
stack_trace("ruin [ruin.suffix] failed to load at [COORD(central_turf)] after valid bounds check")
for(var/turf/T in ruin.get_affected_turfs(central_turf, centered = TRUE)) // Just flag the actual ruin turfs!
T.flags |= NO_RUINS
new /obj/effect/landmark/ruin(central_turf, ruin)
ruin.loaded++
log_world("Ruin \"[ruin.name]\" placed at ([central_turf.x], [central_turf.y], [central_turf.z])")
var/map_filename = splittext(ruin.mappath, "/")
map_filename = map_filename[length(map_filename)]
SSblackbox.record_feedback("associative", "ruin_placement", 1, list(
"map" = map_filename,
"coords" = "[central_turf.x],[central_turf.y],[central_turf.z]"
))
return TRUE
// Ran out of placement tries for this z-level/padding, move to the next z-level
// Ran out of z-levels to try with this padding, cut it and start again
reduce_padding()
// Ran out of z-levels, we got nowhere to place it
return FALSE
/datum/ruin_placer
var/ruin_budget
var/area_whitelist
var/list/templates
var/base_padding
/datum/ruin_placer/proc/place_ruins(z_levels)
if(!z_levels || !length(z_levels))
WARNING("No Z levels provided - Not generating ruins")
return
for(var/zl in z_levels)
var/turf/T = locate(1, 1, zl)
if(!T)
WARNING("Z level [zl] does not exist - Not generating ruins")
return
var/list/ruins = templates.Copy()
var/list/forced_ruins = list() // ruins we are required to place
var/list/ruins_available = list() // ruins we will attempt to place based on budget
// Set up the starting ruin lists
for(var/key in ruins)
var/datum/map_template/ruin/R = ruins[key]
if(R.always_place)
forced_ruins += R
continue
if(R.unpickable)
continue
if(R.get_cost() > ruin_budget) // Why would you do that
continue
ruins_available[R] = R.placement_weight
while(length(forced_ruins))
var/datum/map_template/ruin/ruin = forced_ruins[length(forced_ruins)]
var/datum/ruin_placement/placement = new(ruin, base_padding_ = base_padding)
var/placement_success = placement.try_to_place(z_levels, area_whitelist)
if(placement_success)
// this may push us into the negative but always_place means always_place
ruin_budget -= ruin.get_cost()
else
stack_trace("failed to place required ruin [ruin.suffix]")
forced_ruins.len--
CHECK_TICK
while(ruin_budget > 0 && length(ruins_available))
var/datum/map_template/ruin/current_pick = pickweight(ruins_available)
var/datum/ruin_placement/placement = new(current_pick, base_padding_ = base_padding)
var/placement_success = placement.try_to_place(z_levels, area_whitelist)
if(placement_success)
ruin_budget -= current_pick.get_cost()
if(!current_pick.allow_duplicates)
for(var/datum/map_template/ruin/R in ruins_available)
if(R.id == current_pick.id)
ruins_available -= R
if(current_pick.never_spawn_with)
for(var/blacklisted_type in current_pick.never_spawn_with)
for(var/possible_exclusion in ruins_available)
if(istype(possible_exclusion,blacklisted_type))
ruins_available -= possible_exclusion
else
for(var/datum/map_template/ruin/R in ruins_available)
if(R.id == current_pick.id)
ruins_available -= R
log_debug("failed ruin placement `[current_pick.suffix]` length(z_levels)=[length(z_levels)] budget=[ruin_budget]")
//Update the available list
for(var/datum/map_template/ruin/R in ruins_available)
if(R.get_cost() > ruin_budget)
ruins_available -= R
CHECK_TICK
log_world("Ruin loader finished with [ruin_budget] left to spend.")
#undef DEFAULT_PADDING
/datum/ruin_placer/space
area_whitelist = /area/space
base_padding = TRANSITIONEDGE + SPACERUIN_MAP_EDGE_PAD
/datum/ruin_placer/space/New()
ruin_budget = rand(
GLOB.configuration.ruins.space_ruin_budget_min,
GLOB.configuration.ruins.space_ruin_budget_max
)
templates = GLOB.space_ruins_templates
/datum/ruin_placer/lavaland
area_whitelist = /area/lavaland/surface/outdoors/unexplored
/datum/ruin_placer/lavaland/New()
ruin_budget = rand(
GLOB.configuration.ruins.lavaland_ruin_budget_min,
GLOB.configuration.ruins.lavaland_ruin_budget_max
)
templates = GLOB.lava_ruins_templates
+41
View File
@@ -0,0 +1,41 @@
/datum/map/boxstation
fluff_name = "NSS Cyberiad"
technical_name = "BoxStation"
map_path = "_maps/map_files/stations/boxstation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/cyberiad/"
welcome_sound = 'sound/AI/welcome_cyberiad.ogg'
/datum/map/metastation
fluff_name = "NSS Cerebron"
technical_name = "MetaStation"
map_path = "_maps/map_files/stations/metastation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/metastation/"
welcome_sound = 'sound/AI/welcome_cerebron.ogg'
/datum/map/deltastation
fluff_name = "NSS Kerberos"
technical_name = "DeltaStation"
map_path = "_maps/map_files/stations/deltastation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/deltastation/"
welcome_sound = 'sound/AI/welcome_kerberos.ogg'
/datum/map/cerestation
fluff_name = "NSS Farragus"
technical_name = "CereStation"
map_path = "_maps/map_files/stations/cerestation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/cerestation/"
min_players_random = 60
welcome_sound = 'sound/AI/welcome_farragus.ogg'
/datum/map/emeraldstation
fluff_name = "NSS Diagoras"
technical_name = "EmeraldStation"
map_path = "_maps/map_files/stations/emeraldstation.dmm"
webmap_url = "https://affectedarc07.co.uk/emerald.html"
welcome_sound = 'sound/AI/welcome_diagoras.ogg'
/datum/map/test_tiny
fluff_name = "test_tiny"
technical_name = "test_tiny"
map_path = "_maps/map_files/test_tiny/test_tiny.dmm"
voteable = FALSE
@@ -0,0 +1,291 @@
/datum/map_template/ruin/lavaland
prefix = "_maps/map_files/RandomRuins/LavaRuins/"
ci_exclude = /datum/map_template/ruin/lavaland
/datum/map_template/ruin/lavaland/biodome
allow_duplicates = FALSE
ci_exclude = /datum/map_template/ruin/lavaland/biodome // This is a parent holder, not a ruin itself
/datum/map_template/ruin/lavaland/biodome/winter
name = "Biodome Winter"
id = "biodome-winter"
description = "For those getaways where you want to get back to nature, but you don't want to leave the fortified military compound where you spend your days. \
Includes the recently introduced I.C.E(tm)."
suffix = "lavaland_biodome_winter.dmm"
/datum/map_template/ruin/lavaland/biodome/clown
name = "Biodome Clown Planet"
id = "biodome-clown"
description = "WELCOME TO CLOWN PLANET! HONK HONK HONK etc.!"
suffix = "lavaland_biodome_clown_planet.dmm"
/datum/map_template/ruin/lavaland/seed_vault
name = "Seed Vault"
id = "seed-vault"
description = "The creators of these vaults were a highly advanced and benevolent race, and launched many into the stars, hoping to aid fledgling civilizations. \
However, all the inhabitants seem to do is grow drugs and explosives."
suffix = "lavaland_surface_seed_vault.dmm"
allow_duplicates = FALSE
always_place = TRUE
megafauna_safe_range = TRUE
/datum/map_template/ruin/lavaland/seed_vault_eden
name = "Garden of Eden"
id = "ruin-eden"
description = "Not all of the seed vaulters stay within their tiny sheltered grow rooms to toil with plants. Some desired to spread through the full extent of the wastes \
to research and adapt their creations to the conditions to the dead land. Unfortunately, most did not survive their foray. Even fewer managed \
to secure a foothold before they fell."
suffix = "lavaland_surface_eden.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/ash_walker
name = "Ash Walker Nest"
id = "ash-walker"
description = "A race of unbreathing lizards live here, that run faster than a human can, worship a broken dead city, and are capable of reproducing by something involving tentacles? \
Probably best to stay clear."
suffix = "lavaland_surface_ash_walker1.dmm"
allow_duplicates = FALSE
megafauna_safe_range = TRUE
/datum/map_template/ruin/lavaland/ash_walker_siege
name = "Ash Walker Siege"
id = "ashwalker-siege"
description = "Despite the success of many ashwalker tribes to spread and propagate through the wasteland, this one was besieged by a band of miners looking to pacify the threats of the wasteland. \
While only threat was a singular Ash Walker warrior, they did not go out without the glory of a great combat."
suffix = "lavaland_surface_ash_walker_siege.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/free_golem
name = "Free Golem Ship"
id = "golem-ship"
description = "Lumbering humanoids, made out of precious metals, move inside this ship. They frequently leave to mine more minerals, which they somehow turn into more of them. \
Seem very intent on research and individual liberty, and also geology based naming?"
suffix = "lavaland_surface_golem_ship.dmm"
allow_duplicates = FALSE
always_place = TRUE
megafauna_safe_range = TRUE
/datum/map_template/ruin/lavaland/althland_facility
name = "Althland Facility"
id = "althland-facility"
description = "A grim testament to the Althland Mining Company's ambitions, this facility lies in ruin, swallowed by the very planet it sought to exploit. \
Once a beacon of mining promise, it now stands as a stark reminder of the company's catastrophic demise."
suffix = "lavaland_surface_althland_facility.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/althland_excavation
name = "Althland Excavation"
id = "althland-excavation"
description = "An abandoned mining pit, once operated by the late Althland Mining Corporation, stands as a testament to the extensive efforts of numerous labor groups who endeavored to exploit the ore-rich depths of the planet. \
Now, it lies abandoned, wholly reclaimed by the hostile environment, transforming into yet another relic of a lost company."
suffix = "lavaland_surface_althland_excavation.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/althland_minebot_factory
name = "Althland Minebot Factory"
id = "althland-minebot-factory"
description = "A long-since abandoned factory, teeming with the remains of the abandoned robotics within. This once busy settlement now lay in ruin, a testament to the harsh reality of the wastes. \
On rare occasions such as this, it is a reminder that even in disrepair, some places may still contain great power within."
suffix = "lavaland_surface_althland_minebot_factory.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/sin
allow_duplicates = FALSE
ci_exclude = /datum/map_template/ruin/lavaland/sin // This is a parent holder, not a ruin itself
/datum/map_template/ruin/lavaland/sin/envy
name = "Ruin of Envy"
id = "envy"
description = "When you get what they have, then you'll finally be happy."
suffix = "lavaland_surface_envy.dmm"
/datum/map_template/ruin/lavaland/sin/gluttony
name = "Ruin of Gluttony"
id = "gluttony"
description = "If you eat enough, then eating will be all that you do."
suffix = "lavaland_surface_gluttony.dmm"
/datum/map_template/ruin/lavaland/sin/greed
name = "Ruin of Greed"
id = "greed"
description = "Sure you don't need magical powers, but you WANT them, and that's what's important."
suffix = "lavaland_surface_greed.dmm"
/datum/map_template/ruin/lavaland/sin/pride
name = "Ruin of Pride"
id = "pride"
description = "Wormhole lifebelts are for LOSERS, who you are better than."
suffix = "lavaland_surface_pride.dmm"
/datum/map_template/ruin/lavaland/sin/sloth
name = "Ruin of Sloth"
id = "sloth"
description = "..."
suffix = "lavaland_surface_sloth.dmm"
/datum/map_template/ruin/lavaland/ratvar
name = "Dead God"
id = "ratvar"
description = "Ratvars final resting place."
suffix = "lavaland_surface_dead_ratvar.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/hierophant
name = "Hierophant's Arena"
id = "hierophant"
description = "A strange, square chunk of metal of massive size. Inside awaits only death and many, many squares."
suffix = "lavaland_surface_hierophant.dmm"
always_place = TRUE
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/blood_drunk_miner
name = "Blood-Drunk Miner"
id = "blooddrunk"
description = "A strange arrangement of stone tiles and an insane, beastly miner contemplating them."
suffix = "lavaland_surface_blooddrunk1.dmm"
allow_duplicates = FALSE //will only spawn one variant of the ruin
/datum/map_template/ruin/lavaland/blood_drunk_miner/guardian
name = "Blood-Drunk Miner (Guardian)"
suffix = "lavaland_surface_blooddrunk2.dmm"
/datum/map_template/ruin/lavaland/blood_drunk_miner/hunter
name = "Blood-Drunk Miner (Hunter)"
suffix = "lavaland_surface_blooddrunk3.dmm"
/datum/map_template/ruin/lavaland/ufo_crash
name = "UFO Crash"
id = "ufo-crash"
description = "Turns out that keeping your abductees unconscious is really important. Who knew?"
suffix = "lavaland_surface_ufo_crash.dmm"
/datum/map_template/ruin/lavaland/xeno_nest
name = "Xenomorph Nest"
id = "xeno-nest"
description = "These xenomorphs got bored of horrifically slaughtering people on space stations, and have settled down on a nice lava filled hellscape to focus on what's really important in life. \
Quality memes."
suffix = "lavaland_surface_xeno_nest.dmm"
/datum/map_template/ruin/lavaland/fountain
name = "Fountain Hall"
id = "fountain"
description = "The fountain has a warning on the side. DANGER: May have undeclared side effects that only become obvious when implemented."
suffix = "lavaland_surface_fountain_hall.dmm"
/datum/map_template/ruin/lavaland/survivalcapsule
name = "Survival Capsule Ruins"
id = "survivalcapsule"
description = "What was once sanctuary to the common miner, is now their tomb."
suffix = "lavaland_surface_survivalpod.dmm"
/datum/map_template/ruin/lavaland/pizza
name = "Ruined Pizza Party"
id = "pizza"
description = "Little Timmy's birthday pizza-bash took a turn for the worse when a bluespace anomaly passed by."
suffix = "lavaland_surface_pizzaparty.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/cultaltar
name = "Summoning Ritual"
id = "cultaltar"
description = "A place of vile worship, the scrawling of blood in the middle glowing eerily. A demonic laugh echoes throughout the caverns"
suffix = "lavaland_surface_cultaltar.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/hermit
name = "Makeshift Shelter"
id = "hermitcave"
description = "A place of shelter for a lone hermit, scraping by to live another day."
suffix = "lavaland_surface_hermit.dmm"
allow_duplicates = FALSE
always_place = TRUE
megafauna_safe_range = TRUE
/datum/map_template/ruin/lavaland/miningripley
name = "Ripley"
id = "ripley"
description = "A heavily-damaged mining ripley, property of a very unfortunate miner. You might have to do a bit of work to fix this thing up."
suffix = "lavaland_surface_random_ripley.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/puzzle
name = "Ancient Puzzle"
id = "puzzle"
description = "Mystery to be solved."
suffix = "lavaland_surface_puzzle.dmm"
/datum/map_template/ruin/lavaland/tumor
name = "Elite Tumor"
id = "tumor"
description = "The victor freed, the loser the next fighter. The ghosts, the endless spectators. And thus the cycle loops..."
suffix = "lavaland_surface_elite_tumor.dmm"
always_place = TRUE
/datum/map_template/ruin/lavaland/monster_nest
name = "Monster Nest"
id = "monsternest"
description = "A cave of several tunnels, housing the local fauna deep underground."
suffix = "lavaland_surface_monster_nest.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/watcher_grave
name = "Watchers' Grave"
id = "watcher-grave"
description = "A lonely cave where an orphaned child awaits a new parent."
suffix = "lavaland_surface_watcher_grave.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/shuttlecrash
name = "Crashed Passenger Shuttle"
id = "shuttlecrash"
description = "A passenger shuttle crashsite of indeterminate origin."
suffix = "lavaland_surface_shuttlecrash.dmm"
allow_duplicates = FALSE
/datum/map_template/ruin/lavaland/nt
name = "Nanotrasen Mining Complex"
id = "gulag"
description = "Nanotrasen's sturdy planetside mining station and labor camp."
suffix = "lavaland_surface_nt.dmm"
allow_duplicates = FALSE
always_place = TRUE
/datum/map_template/ruin/lavaland/legiongate
name = "Necropolis Gate"
id = "legiongate"
description = "At the heart of the city of the dead is a horror, so vile, and so powerful, that not even death can claim it."
suffix = "lavaland_surface_legiongate.dmm"
allow_duplicates = FALSE
always_place = TRUE
/datum/map_template/ruin/lavaland/lavaland_relay
id = "lavaland_relay"
suffix = "lavaland_surface_mining_telecomms.dmm"
name = "Nanotrasen Lavaland Relay"
description = "Using the same technology as shelter capsules, these pods have been shot from orbit onto lavaland to demonstrate a quick and efficient way for an army to setup forward bases. \
Sadly, in their mass production rush, they lack a RTG power source and rely on pacmans, with many of the pods being shipped with the wrong fuel inside."
allow_duplicates = FALSE // Less space on lavaland. Ideally we would figure out a way to ban this from spawning the same level as the mining base
always_place = TRUE // Since only one can spawn for now, might as well ensure it.
// MARK: Bridges
/datum/map_template/ruin/lavaland/zlvl_bridge
prefix = "_maps/map_files/RandomRuins/LavaRuins/zlvl_bridges/"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge
/datum/map_template/ruin/lavaland/zlvl_bridge/vertical
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/vertical
/datum/map_template/ruin/lavaland/zlvl_bridge/vertical/one
name = "Vertical Bridge One"
suffix = "lavaland_zlvl_bridge_vertical_1.dmm"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/vertical/one
/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/horizontal
/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/one
name = "Horizontal Bridge One"
suffix = "lavaland_zlvl_bridge_horizontal_1.dmm"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/one
@@ -0,0 +1,402 @@
/datum/map_template/ruin/space
prefix = "_maps/map_files/RandomRuins/SpaceRuins/"
ci_exclude = /datum/map_template/ruin/space
/datum/map_template/ruin/space/zoo
id = "zoo"
suffix = "abandonedzoo.dmm"
name = "Biological Storage Facility"
description = "In case society crumbles, we will be able to restore our \
zoos to working order with the breeding stock kept in these 100% \
secure and unbreachable storage facilities. At no point has anything \
escaped. That's our story, and we're sticking to it."
/datum/map_template/ruin/space/asteroid1
id = "asteroid1"
suffix = "asteroid1.dmm"
name = "Asteroid 1"
description = "I-spy with my little eye, something beginning with R."
/datum/map_template/ruin/space/asteroid2
id = "asteroid2"
suffix = "asteroid2.dmm"
name = "Asteroid 2"
description = "Oh my god, a giant rock!"
/datum/map_template/ruin/space/asteroid3
id = "asteroid3"
suffix = "asteroid3.dmm"
name = "Asteroid 3"
description = "This asteroid floating in space has no official \
designation, because the scientist that discovered it deemed it \
'super dull'."
/datum/map_template/ruin/space/asteroid4
id = "asteroid4"
suffix = "asteroid4.dmm"
name = "Asteroid 4"
description = "Nanotrasen Escape Pods have a 100%* success rate, and a \
99%* customer satisfaction rate. *Please note that these statistics, \
are taken from pods that have successfully docked with a recovery \
vessel."
/datum/map_template/ruin/space/asteroid5
id = "asteroid5"
suffix = "asteroid5.dmm"
name = "Asteroid 5"
description = "Oh my god, another giant rock!"
/datum/map_template/ruin/space/asteroidmining1
id = "asteroidmining1"
suffix = "asteroidmining1.dmm"
name = "Mining Asteroid 1"
description = "A giant rock rich in ores!"
/datum/map_template/ruin/space/asteroidmining2
id = "asteroidmining2"
suffix = "asteroidmining2.dmm"
name = "Mining Asteroid 2"
description = "A cluster of rocks rich in ore."
/datum/map_template/ruin/space/asteroidmining3
id = "asteroidmining3"
suffix = "asteroidmining3.dmm"
name = "Mining Asteroid 3"
description = "They dug too greedily, and too deeply..."
/datum/map_template/ruin/space/deep_storage
id = "deep-storage"
suffix = "deepstorage.dmm"
name = "Survivalist Bunker"
description = "Assume the best, prepare for the worst. Generally, you \
should do so by digging a three man heavily fortified bunker into \
a giant unused asteroid. Then make it self sufficient, mask any \
evidence of construction, hook it covertly into the \
telecommunications network and hope for the best."
allow_duplicates = FALSE // this shouldn't be spawning more than once anymore
/datum/map_template/ruin/space/derelict1
id = "derelict1"
suffix = "derelict1.dmm"
name = "Derelict 1"
description = "Nothing to see here citizen, move along, certainly no \
xeno outbreaks on this piece of station debris. That purple stuff? \
It's uh... station nectar. It's a top secret research installation."
/datum/map_template/ruin/space/derelict2
id = "derelict2"
suffix = "derelict2.dmm"
name = "Dinner for Two"
description = "Oh this is the night\n\
It's a beautiful night\n\
And we call it bella notte"
/datum/map_template/ruin/space/derelict3
id = "derelict3"
suffix = "derelict3.dmm"
name = "Derelict 3"
description = "These hulks were once part of a larger structure, where \
the three great \[REDACTED\] were forged."
allow_duplicates = FALSE
/datum/map_template/ruin/space/derelict4
id = "derelict4"
suffix = "derelict4.dmm"
name = "Derelict 4"
description = "Centcom ferries have never crashed, will never crash, \
there is no current investigation into a crashed ferry, and we \
will not let Internal Affairs trample over high security information \
in the name of this baseless witchhunt."
/datum/map_template/ruin/space/derelict5
id = "derelict5"
suffix = "derelict5.dmm"
name = "Derelict 5"
description = "The plan is, we put a whole bunch of crates full of \
treasure in this disused warehouse, launch it into space, and then \
ignore it. Forever."
/datum/map_template/ruin/space/listeningpost
id = "listeningpost"
suffix = "listeningpost.dmm"
name = "Syndie Listening Post"
description = "What happens to Nuclear Operatives that fail in their mission? \
Certainly not assignment to a backwater listening post..."
/datum/map_template/ruin/space/empty_shell
id = "empty-shell"
suffix = "emptyshell.dmm"
name = "Empty Shell"
description = "Cosy, rural property available for young professional \
couple. Only twelve parsecs from the nearest hyperspace lane!"
/datum/map_template/ruin/space/intact_empty_ship
id = "intact-empty-ship"
suffix = "intactemptyship.dmm"
name = "Authorship"
description = "Just somewhere quiet, where I can focus on my work with \
no interruptions."
/datum/map_template/ruin/space/mech_transport
id = "mech-transport"
suffix = "mechtransport.dmm"
name = "Cybersun Exosuit Factory Ship"
description = "A crashed mobile mech factory under security lockdown."
allow_duplicates = FALSE
/datum/map_template/ruin/space/onehalf
id = "onehalf"
suffix = "onehalf.dmm"
name = "DK Excavator 453"
description = "Based on the trace elements we've detected on the \
gutted asteroids, we suspect that a mining ship using a restricted \
engine is somewhere in the area. We'd like to request a patrol vessel \
to investigate."
/datum/map_template/ruin/space/spacebar
id = "spacebar"
suffix = "spacebar.dmm"
name = "The Rampant Golem and Yellow Hound"
description = "No questions asked. No shoes/foot protection, no service. \
No tabs. No violence in the inside areas. That's it. Welcome to the \
Rampant Golem and Yellow Hound. Can I take your order?"
allow_duplicates = FALSE //it spawn ship docking, no more than one to avoid duplication in console.
always_place = TRUE
/datum/map_template/ruin/space/turreted_outpost
id = "turreted-outpost"
suffix = "turretedoutpost.dmm"
name = "Syndicate Interdiction Platform"
description = "Taking a departure from their usual MO of hiding their installations away from prying eyes, \
the Syndicate deployed this asset right in the open and bolted enough guns onto the hull to keep all but the most determined attackers at bay. \
The jolly crew perform raiding operations against poorly protected NT assets."
allow_duplicates = FALSE
/datum/map_template/ruin/space/way_home
id = "way-home"
suffix = "way_home.dmm"
name = "Salvation"
description = "In the darkest times, we will find our way home."
/datum/map_template/ruin/space/oldstation
id = "oldstation"
suffix = "oldstation.dmm"
name = "Ancient Space Station"
description = "The crew of a space station awaken one hundred years after a crisis. Awaking to a derelict space station on the verge of collapse, and a hostile force of invading \
hivebots. Can the surviving crew overcome the odds and survive and rebuild, or will the cold embrace of the stars become their new home?"
always_place = TRUE
allow_duplicates = FALSE
/datum/map_template/ruin/space/wizardcrash
id = "wizardcrash"
suffix = "wizardcrash.dmm"
name = "Crashed Wizard Shuttle"
description = "A shuttle of the Wizard Federation, sent out to crush some wandless scum. Unfortunately, the pilot suffered a magic-related accident and the shuttle crashed into a nearby asteroid."
/datum/map_template/ruin/space/abandonedtele
id = "abandonedtele"
suffix = "abandonedtele.dmm"
name = "Abandoned Teleporter"
description = "An old teleporter, seemingly part of what used to be a larger satellite."
/datum/map_template/ruin/space/blowntcommsat
id = "blowntcommsat"
suffix = "blowntcommsat.dmm"
name = "Blown-out Telecommunications Satellite"
description = "The remains of an old telecommunications satellite once utilised by Nanotrasen. It lays derelict, with quite a few pieces missing."
allow_duplicates = FALSE // Absolutely huge, also has its own APC and the area isnt set to allow many
/datum/map_template/ruin/space/malftcommsat
id = "malftcommsat"
suffix = "telecomns_returns.dmm"
name = "D.V.O.R.A.K'S Telecommunications Satellite"
description = "Seems the telecomunication satellite that went dark 4 years ago finally re-appeared on scanners? Strange signals are coming from it."
allow_duplicates = FALSE // One sadistic malfunctioning AI is enough. Also unique apcs.
/datum/map_template/ruin/space/clownmime
id = "clownmime"
suffix = "clownmime.dmm"
name = "Clown & Mime Mineral Deposits"
description = "A crash site of two opposing factions, both trying to complete mining trips for their own valuable minerals. While all the crew have long perished, the minerals are likely intact."
/datum/map_template/ruin/space/dj
id = "dj"
suffix = "dj.dmm"
name = "Soviet DJ Station"
description = "A USSP listening post masquerading as a popular Soviet entertainment broadcaster, keeping tabs on Nanotrasen activity in the system and relaying it back to the Union."
allow_duplicates = FALSE
/datum/map_template/ruin/space/druglab
id = "druglab"
suffix = "druglab.dmm"
name = "Drug Lab"
description = "An old abandoned \"Chemistry\" site, which has a strong aura of amphetamines around it."
/datum/map_template/ruin/space/syndicatedruglab
id = "syndicatedruglab"
suffix = "syndicatedruglab.dmm"
name = "Suspicious Station"
description = "A syndicate drug laboratory hidden on an asteroid. It is strangely well-protected."
allow_duplicates = FALSE
/datum/map_template/ruin/space/syndiedepot
id = "syndiedepot"
suffix = "syndiedepot.dmm"
name = "Suspicious Supply Depot"
description = "A syndicate supply depot, heavily stocked, but heavily guarded with an assortment of shields, sentry bots, armed operatives and more."
allow_duplicates = FALSE // One of these is enough
/datum/map_template/ruin/space/ussp_tele
id = "ussp_tele"
suffix = "ussp_tele.dmm"
name = "Derelict USSP Teleporter"
description = "An experimental teleporter of USSP origin, some terrible calamity has ripped it free from a larger structure and sent drifting through space."
allow_duplicates = FALSE // One uniquely flavoured abandoned tele to keep the flavour fresh.
/datum/map_template/ruin/space/ussp
id = "ussp"
suffix = "ussp.dmm"
name = "USSP"
description = "A decript station of seemingly Soviet origin. The last contact had with this station was a distress signal, and the rest was dark."
allow_duplicates = FALSE // One of these has enough loot
/datum/map_template/ruin/space/whiteship
id = "whiteship"
suffix = "whiteship.dmm"
name = "NEV Limulus"
description = "A small expeditionary ship for use in local space exploration and salvaging."
allow_duplicates = FALSE // I dont even want to think about what happens if you have 2 shuttles with the same ID. Likely scary stuff.
always_place = TRUE // Its designed to make exploring other space ruins more accessible
/datum/map_template/ruin/space/golem_destination
id = "golemtarget"
suffix = "golemtarget.dmm"
name = "Golem Shuttle Destination"
description = "Just a handful of rocks floating in space. Guaranteed space destination for the Golem shuttle in case other destinations don't spawn."
allow_duplicates = FALSE
always_place = TRUE
/datum/map_template/ruin/space/syndicate_space_base
name = "Syndicate Space Base"
id = "syndie-space-base"
description = "A secret base researching illegal bioweapons, it is closely guarded by an elite team of syndicate agents."
suffix = "syndie_space_base.dmm"
always_place = TRUE
allow_duplicates = FALSE
/datum/map_template/ruin/space/syndiecakesfactory
id = "Syndiecakes Factory"
suffix = "syndiecakesfactory.dmm"
name = "Syndicakes Factory"
description = "Syndicate used to get funds selling corgi cakes produced here. Was it hit by meteors or by a Nanotrasen comando?"
allow_duplicates = FALSE
/datum/map_template/ruin/space/debris1
id = "debris1"
suffix = "debris1.dmm"
name = "Debris field 1"
description = "A bunch of metal chunks, wires and space waste"
/datum/map_template/ruin/space/debris2
id = "debris2"
suffix = "debris2.dmm"
name = "Debris field 2"
description = "A bunch of metal chunks, wires and space waste that used to be some kind of secure storage facility"
/datum/map_template/ruin/space/debris3
id = "debris3"
suffix = "debris3.dmm"
name = "Debris field 3"
description = "A bunch of metal chunks, wires and space waste. It used to be an arcade."
/datum/map_template/ruin/space/meatpackers
id = "meatpackers"
suffix = "meatpackers.dmm"
name = "Meat Packers"
description = "An old transport ship, possibly with a dubious past. It smells faintly of meat."
allow_duplicates = FALSE
/datum/map_template/ruin/space/mo19
id = "mo19"
suffix = "moonoutpost19.dmm"
name = "Moon Outpost 19"
description = "A now-defunct outpost, with the last received signal being that of distress."
allow_duplicates = FALSE
/datum/map_template/ruin/space/voyager
id = "voyager"
suffix = "voyager.dmm"
name = "Voyager"
description = "A relic of old times, you don't know what it hide inside."
allow_duplicates = FALSE
/datum/map_template/ruin/space/wreckedcargoship
id = "wreckedcargoship"
suffix = "wreckedcargoship.dmm"
name = "Wrecked Cargoship"
description = "A cargo shuttle in a wrecked condition. There are many unknown horrors in space and looks like its last crew has faced one of them."
allow_duplicates = FALSE
/datum/map_template/ruin/space/abandoned_engi_sat
id = "abandoned_engi_sat"
suffix = "abandoned_engi_sat.dmm"
name = "Abandoned NT Engineering Satellite"
description = "A derelict operating base for NT engineering crew."
allow_duplicates = FALSE
/datum/map_template/ruin/space/rocky_motel
id = "rocky_motel"
suffix = "rocky_motel.dmm"
name = "Rocky Motel"
description = "A cozy little home nestled in an asteroid, perfect for one or two people!"
allow_duplicates = FALSE
/datum/map_template/ruin/space/casino
id = "casino"
suffix = "casino.dmm"
name = "Dorian Casino"
description = "A swanky space casino."
allow_duplicates = FALSE
/datum/map_template/ruin/space/abandoned_security_shuttle
id = "abandoned_sec_shuttle"
suffix = "abandoned_sec_shuttle.dmm"
name = "Abandoned Security Shuttle"
description = "A security shuttle that has been floating in space."
allow_duplicates = FALSE
/datum/map_template/ruin/space/freighter
id = "freighter"
suffix = "freighter.dmm"
name = "Voidhopper of Nexus"
description = "A cargo ship headed to a nearby system."
/datum/map_template/ruin/space/drakehound_breacher
id = "drakehound_breacher"
suffix = "unathi_skiff.dmm"
name = "Damaged Drakehound Skiff"
description = "A small Drakehound craft, damaged from an engine malfunction."
allow_duplicates = FALSE
/datum/map_template/ruin/space/sieged_lab
id = "sieged_lab"
suffix = "sieged_lab.dmm"
name = "Sieged Lab"
description = "A destroyed laboratory, under siege from forces unknown."
allow_duplicates = FALSE
/datum/map_template/ruin/space/clockwork_monastery
id = "clockwork_monastery"
suffix = "clockwork_monastery.dmm"
name = "Abandoned Clockwork Monastery"
description = "A hidden monastery once used by the followers of Ratvar's clockwork cult. The original inhabitants have departed for City of Cogs, Reebe. \
The constructs that were left behind to guard the monastery will ruthlessly cut down anyone that does not swear their fealty to Ratvar."
allow_duplicates = FALSE
/datum/map_template/ruin/space/bluespace_relay_beacon
id = "bluespace_relay_beacon"
suffix = "bluespace_relay_beacon.dmm"
name = "Nanotrasen Bluespace Relay"
description = "Nanotrasen uses relays like these to further extend telecommunications around an area of space, as well as long range beacons for easier deployment in the future. \
Unfortunately, the anomalous activity around Epsilon Eridani, along with orbital debris and space-faring hostiles, has rendered many of these relay stations inoperable, leaving their communications and teleportation systems offline."
+165
View File
@@ -0,0 +1,165 @@
/// Approximate lower bound of the walkable land area on Lavaland, north of the southern lava border.
#define LAVALAND_MIN_CAVE_Y 10
/// Approximate upper bound of the walkable land area on Lavaland, south of the Legion entrance.
#define LAVALAND_MAX_CAVE_Y 222
/// Effective probability modifier for spawning flora and fauna in oases.
#define OASIS_SPAWNER_PROB_MODIFIER 43
GLOBAL_LIST_INIT(caves_default_flora_spawns, list(
/obj/structure/flora/ash/cacti = 1,
/obj/structure/flora/ash/cap_shroom = 2,
/obj/structure/flora/ash/leaf_shroom = 2,
/obj/structure/flora/ash/rock/style_random = 1,
/obj/structure/flora/ash/stem_shroom = 2,
/obj/structure/flora/ash/tall_shroom = 2,
))
/proc/lavaland_caves_spawn_flora(turf/T)
var/flora_spawn = pickweight(GLOB.caves_default_flora_spawns)
for(var/obj/structure/flora/ash/F in range(4, T)) //Allows for growing patches, but not ridiculous stacks of flora
if(!istype(F, flora_spawn))
return
new flora_spawn(T)
/datum/caves_theme
var/name = "Not Specified"
var/seed
var/perlin_accuracy = 5
var/perlin_stamp_size = 10
var/perlin_lower_range = 0
var/perlin_upper_range = 0.3
var/fauna_scan_range = 12
var/megafauna_scan_range = 16
/datum/caves_theme/New()
seed = rand(1, 999999)
/datum/caves_theme/proc/setup()
var/result = rustlibs_dbp_generate("[seed]", "[perlin_accuracy]", "[perlin_stamp_size]", "[world.maxx]", "[perlin_lower_range]", "[perlin_upper_range]")
for(var/zlvl in levels_by_trait(ORE_LEVEL))
for(var/turf/T in block(1, 1, zlvl, world.maxx, world.maxy, zlvl))
if(!istype(get_area(T), /area/lavaland/surface/outdoors/unexplored))
continue
if(!istype(T, /turf/simulated/mineral))
continue
var/c = result[world.maxx * (T.y - 1) + T.x]
if(c == "1")
T.ChangeTurf(/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface)
on_change(T)
CHECK_TICK
/datum/caves_theme/proc/on_change(turf/T)
if(prob(2))
lavaland_caves_spawn_flora(T)
else if(prob(1))
new /obj/effect/spawner/random/lavaland_fauna(T)
/datum/caves_theme/proc/safe_replace(turf/T)
if(T.flags & NO_LAVA_GEN)
return FALSE
if(istype(T, /turf/template_noop))
return TRUE
if(!istype(get_area(T), /area/lavaland/surface/outdoors/unexplored))
return FALSE
if(istype(T, /turf/simulated/floor/chasm))
return FALSE
if(istype(T, /turf/simulated/floor/lava/lava_land_surface))
return FALSE
if(istype(T, /turf/simulated/floor/lava/mapping_lava))
return FALSE
return TRUE
/datum/caves_theme/classic
name = "Classic Caves"
/datum/caves_theme/burrows
name = "Blocked Burrows"
perlin_accuracy = 90
perlin_stamp_size = 7
perlin_lower_range = 0
perlin_upper_range = 0.3
/datum/caves_theme/burrows/on_change(turf/T)
if(prob(7))
new /obj/structure/flora/ash/rock/style_random(T)
else if(prob(5))
lavaland_caves_spawn_flora(T)
else if(prob(1))
new /obj/effect/spawner/random/lavaland_fauna(T)
/datum/caves_theme/deeprock/New()
. = ..()
fauna_scan_range = rand(4, 7)
megafauna_scan_range = rand(8, 16)
/datum/caves_theme/deeprock/proc/maybe_make_room(turf/T)
if(rand(1, 150) != 1)
return
for(var/turf/oasis_centroid in oasis_centroids)
if(get_dist(T, oasis_centroid) < oasis_padding)
return
oasis_centroids |= T
var/tempradius = rand(10, 15)
var/probmodifer = OASIS_SPAWNER_PROB_MODIFIER * tempradius
var/list/oasis_turfs = list()
for(var/turf/NT in circlerangeturfs(T, tempradius))
var/distance = (max(get_dist(T, NT), 1)) //Get dist throws -1 if same turf
if(safe_replace(NT) && prob(min(probmodifer / distance, 100)))
var/turf/changed = NT.ChangeTurf(/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface)
if(prob(5))
new /obj/effect/spawner/random/lavaland_fauna(changed)
else if(prob(10))
lavaland_caves_spawn_flora(changed)
oasis_turfs |= changed
if(prob(50))
tempradius = round(tempradius / 3)
var/oasis_laketype = pickweight(lake_weights)
if(oasis_laketype == /turf/simulated/floor/plating/asteroid)
new /obj/effect/spawner/oasisrock(T, tempradius)
for(var/turf/oasis in circlerangeturfs(T, tempradius))
if(safe_replace(oasis))
oasis.ChangeTurf(oasis_laketype)
oasis_turfs -= oasis
// Move tendrils out of the oasis
for(var/obj/effect/spawner/random/pool/tendril_spawner/O in circlerange(T, tempradius))
O.forceMove(pick_n_take(oasis_turfs))
return T
/datum/caves_theme/deeprock
name = "Deadly Deeprock"
perlin_stamp_size = 12
perlin_lower_range = 0
perlin_upper_range = 0.2
var/oasis_padding = 50
var/list/oasis_centroids = list()
var/lake_weights = list(
/turf/simulated/floor/lava/lava_land_surface = 4,
/turf/simulated/floor/lava/lava_land_surface/plasma = 4,
/turf/simulated/floor/chasm/straight_down/lava_land_surface = 4,
/turf/simulated/floor/lava/mapping_lava = 6,
/turf/simulated/floor/beach/away/water/lavaland_air = 1,
/turf/simulated/floor/plating/asteroid = 1
)
/datum/caves_theme/deeprock/on_change(turf/T)
maybe_make_room(T)
if(prob(3))
lavaland_caves_spawn_flora(T)
else if(prob(2))
new /obj/effect/spawner/random/lavaland_fauna(T)
#undef OASIS_SPAWNER_PROB_MODIFIER
#undef LAVALAND_MIN_CAVE_Y
#undef LAVALAND_MAX_CAVE_Y
@@ -0,0 +1,123 @@
/datum/lavaland_theme
/// Name of lavaland theme
var/name = "Not Specified"
/// Typepath of turf the `/turf/simulated/floor/lava/mapping_lava` will be changed to on Late Initialization
var/turf/simulated/floor/primary_turf_type
/// Icon state of planet present on background of station Z-level
var/planet_icon_state
var/list/built_bridges
/// Icon for glass floors
var/primary_turf_type_icon
/datum/lavaland_theme/New()
if(!primary_turf_type)
stack_trace("Turf type is `null` in `[type]` lavaland theme")
else if(!ispath(primary_turf_type))
stack_trace("Wrong turf type `[primary_turf_type.type]` in `[type]` lavaland theme")
built_bridges = list()
/**
* This proc should do all theme specific thing.
* Now it only generates rivers, but it can do all stuff you desire.
*/
/datum/lavaland_theme/proc/setup()
SHOULD_CALL_PARENT(TRUE)
setup_multisector()
/datum/lavaland_theme/proc/setup_multisector()
var/bridge_diameter = 14
var/interval = 20
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/space_level/level = GLOB.space_manager.get_zlev(zlvl)
if(!built_bridges["[zlvl]"])
built_bridges["[zlvl]"] = list()
for(var/d in level.neighbors)
if(d == Z_LEVEL_SOUTH)
var/datum/space_level/connected = level.get_connection(Z_LEVEL_SOUTH)
if(!built_bridges["[connected.zpos]"])
built_bridges["[connected.zpos]"] = list()
var/left_margin = TRANSITIONEDGE + 5
while(left_margin < world.maxx - TRANSITIONEDGE)
if(prob(50))
var/left_edge = rand(left_margin, left_margin + bridge_diameter)
var/loc = locate(left_edge, bridge_diameter / 2 + 1, level.zpos)
var/datum/map_template/ruin/lavaland/zlvl_bridge/template = GLOB.lavaland_zlvl_bridge_templates["lavaland_zlvl_bridge_vertical_1.dmm"]
template.load(loc, centered = TRUE)
// now make sure we line up another bridge on the linked map
loc = locate(left_edge, world.maxy - (bridge_diameter / 2) + 1, connected.zpos)
template.load(loc, centered = TRUE)
left_margin += interval
built_bridges["[zlvl]"]["[connected.zpos]"] = Z_LEVEL_SOUTH
built_bridges["[connected.zpos]"]["[zlvl]"] = Z_LEVEL_NORTH
else if(d == Z_LEVEL_EAST)
var/datum/space_level/connected = level.get_connection(Z_LEVEL_EAST)
if(!built_bridges["[connected.zpos]"])
built_bridges["[connected.zpos]"] = list()
var/north_margin = TRANSITIONEDGE + 5
while(north_margin < world.maxy - TRANSITIONEDGE)
if(prob(50))
var/north_edge = rand(north_margin, north_margin + bridge_diameter)
var/loc = locate(bridge_diameter / 2, north_edge, level.zpos)
var/datum/map_template/ruin/lavaland/zlvl_bridge/template = GLOB.lavaland_zlvl_bridge_templates["lavaland_zlvl_bridge_horizontal_1.dmm"]
template.load(loc, centered = TRUE)
// now make sure we line up another bridge on the linked map
loc = locate(world.maxx - (bridge_diameter / 2) + 1, north_edge, connected.zpos)
template.load(loc, centered = TRUE)
north_margin += interval
built_bridges["[zlvl]"]["[connected.zpos]"] = Z_LEVEL_EAST
built_bridges["[connected.zpos]"]["[zlvl]"] = Z_LEVEL_WEST
/datum/lavaland_theme/proc/get_bridge_direction(z1, z2)
if(z1 == z2)
return null
if(("[z1]" in built_bridges) && ("[z2]" in built_bridges["[z1]"]))
return built_bridges["[z1]"]["[z2]"]
if(("[z2]" in built_bridges) && ("[z1]" in built_bridges["[z2]"]))
return built_bridges["[z2]"]["[z1]"]
return null
/datum/lavaland_theme/lava
name = "lava"
primary_turf_type = /turf/simulated/floor/lava/lava_land_surface
planet_icon_state = "planet_lava"
primary_turf_type_icon = 'icons/turf/floors/lava.dmi'
/datum/lavaland_theme/lava/setup()
. = ..()
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/river_spawner/lava_spawner = new(zlvl)
lava_spawner.generate()
/datum/lavaland_theme/plasma
name = "plasma"
primary_turf_type = /turf/simulated/floor/lava/lava_land_surface/plasma
planet_icon_state = "planet_plasma"
primary_turf_type_icon = 'icons/turf/floors/liquidplasma.dmi'
/datum/lavaland_theme/plasma/setup()
. = ..()
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/river_spawner/spawner = new(zlvl)
spawner.generate(nodes = 2)
spawner.generate(nodes = 2) // twice
/datum/lavaland_theme/chasm
name = "chasm"
primary_turf_type = /turf/simulated/floor/chasm/straight_down/lava_land_surface
planet_icon_state = "planet_chasm"
primary_turf_type_icon = 'icons/turf/floors/Chasms.dmi'
/datum/lavaland_theme/chasm/setup()
. = ..()
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/river_spawner/spawner = new(zlvl, spread_prob_ = 10, spread_prob_loss_ = 5)
spawner.generate(nodes = 6, min_x = 50, min_y = 7, max_x = 250, max_y = 225)