mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Enable multi-sector lavaland. (#28358)
* Enable multi-sector lavaland. * fix exclude ci paths * remove old lavaland * Lewc review and other cleanups, add GPS stuff * rebuild tgui * fix ash storm no eligible areas * update test config, don't skip out on test level creation * unfuck example config * whoops * add north entrances to legion arena for easier traversal * TM config -- REVERT BEFORE MERGE * Make SSweather work on traits directly * flip order of procgen/ruin placement * fix GPS * fix budget in code * clobber prod config for lavaland ruin budget for TM * add relay to gulag * some more guards for procgen * separate relays * make gulag and base one ruin * bridge improvements * actually remove gulag map * make linter happy * harden ruin placement against failing Config changes made. Bypassing code ownership.
This commit is contained in:
@@ -133,6 +133,7 @@
|
||||
preloadRuinTemplates()
|
||||
preloadShelterTemplates()
|
||||
preloadShuttleTemplates()
|
||||
preloadBridgeTemplates()
|
||||
preloadEventTemplates()
|
||||
|
||||
/proc/preloadRuinTemplates()
|
||||
@@ -180,6 +181,23 @@
|
||||
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
|
||||
|
||||
@@ -70,6 +70,19 @@
|
||||
if(end.flags & LAVA_BRIDGE || !(ismineralturf(end) || istype(end, /turf/simulated/floor/plating/asteroid)))
|
||||
return FALSE
|
||||
|
||||
var/area/A = get_area(end)
|
||||
if(istype(A, /area/lavaland/surface/gulag_rock))
|
||||
return FALSE
|
||||
|
||||
if(istype(A, /area/lavaland/surface/outdoors/outpost))
|
||||
return FALSE
|
||||
|
||||
if(istype(A, /area/mine/outpost))
|
||||
return FALSE
|
||||
|
||||
if(istype(A, /area/shuttle))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/// Returns whether the passed in turf is a valid "passage". A valid passage is
|
||||
@@ -85,6 +98,9 @@
|
||||
return FALSE
|
||||
if(!istype(get_step(T, side_to_side[2]), /turf/simulated/floor/lava/mapping_lava))
|
||||
return FALSE
|
||||
var/area/A = get_area(T)
|
||||
if(istype(A, /area/lavaland/surface/gulag_rock))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -280,6 +296,26 @@
|
||||
return current_turf.x <= 2
|
||||
return TRUE
|
||||
|
||||
/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
|
||||
|
||||
#undef LONG_BRIDGE_THEME_CULT
|
||||
#undef LONG_BRIDGE_THEME_HIERO
|
||||
#undef LONG_BRIDGE_THEME_CLOCKWORK
|
||||
|
||||
@@ -238,3 +238,19 @@
|
||||
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
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
/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
|
||||
@@ -28,6 +29,8 @@
|
||||
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(
|
||||
@@ -72,7 +75,9 @@
|
||||
for(var/obj/structure/flora/ash/plant in T)
|
||||
qdel(plant)
|
||||
|
||||
ruin.load(central_turf, centered = TRUE)
|
||||
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)
|
||||
@@ -116,66 +121,62 @@
|
||||
|
||||
var/list/ruins = templates.Copy()
|
||||
|
||||
var/list/forced_ruins = list() //These go first on the z level associated (same random one by default)
|
||||
var/list/ruins_availible = list() //we can try these in the current pass
|
||||
var/forced_z //If set we won't pick z level and use this one instead.
|
||||
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 list
|
||||
// Set up the starting ruin lists
|
||||
for(var/key in ruins)
|
||||
var/datum/map_template/ruin/R = ruins[key]
|
||||
if(R.get_cost() > ruin_budget) //Why would you do that
|
||||
continue
|
||||
if(R.always_place)
|
||||
forced_ruins[R] = -1
|
||||
forced_ruins += R
|
||||
continue
|
||||
if(R.unpickable)
|
||||
continue
|
||||
ruins_availible[R] = R.placement_weight
|
||||
if(R.get_cost() > ruin_budget) // Why would you do that
|
||||
continue
|
||||
ruins_available[R] = R.placement_weight
|
||||
|
||||
while(ruin_budget > 0 && (length(ruins_availible) || length(forced_ruins)))
|
||||
var/datum/map_template/ruin/current_pick
|
||||
var/forced = FALSE
|
||||
if(length(forced_ruins)) //We have something we need to load right now, so just pick it
|
||||
for(var/ruin in forced_ruins)
|
||||
current_pick = ruin
|
||||
if(forced_ruins[ruin] > 0) //Load into designated z
|
||||
forced_z = forced_ruins[ruin]
|
||||
forced = TRUE
|
||||
break
|
||||
else //Otherwise just pick random one
|
||||
current_pick = pickweight(ruins_availible)
|
||||
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(forced_z ? forced_z : z_levels, area_whitelist)
|
||||
|
||||
//That's done remove from priority even if it failed
|
||||
if(forced)
|
||||
//TODO : handle forced ruins with multiple variants
|
||||
forced_ruins -= current_pick
|
||||
forced = FALSE
|
||||
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_availible)
|
||||
for(var/datum/map_template/ruin/R in ruins_available)
|
||||
if(R.id == current_pick.id)
|
||||
ruins_availible -= R
|
||||
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_availible)
|
||||
for(var/possible_exclusion in ruins_available)
|
||||
if(istype(possible_exclusion,blacklisted_type))
|
||||
ruins_availible -= possible_exclusion
|
||||
ruins_available -= possible_exclusion
|
||||
else
|
||||
for(var/datum/map_template/ruin/R in ruins_availible)
|
||||
for(var/datum/map_template/ruin/R in ruins_available)
|
||||
if(R.id == current_pick.id)
|
||||
ruins_availible -= R
|
||||
log_world("Failed to place [current_pick.name] ruin.")
|
||||
ruins_available -= R
|
||||
stack_trace("failed to place ruin [current_pick.suffix]")
|
||||
|
||||
forced_z = 0
|
||||
|
||||
//Update the availible list
|
||||
for(var/datum/map_template/ruin/R in ruins_availible)
|
||||
//Update the available list
|
||||
for(var/datum/map_template/ruin/R in ruins_available)
|
||||
if(R.get_cost() > ruin_budget)
|
||||
ruins_availible -= R
|
||||
ruins_available -= R
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
log_world("Ruin loader finished with [ruin_budget] left to spend.")
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
var/list/outside_areas = list()
|
||||
var/list/eligible_areas = list()
|
||||
for(var/z in impacted_z_levels)
|
||||
eligible_areas += GLOB.space_manager.areas_in_z["[z]"]
|
||||
if("[z]" in GLOB.space_manager.areas_in_z)
|
||||
eligible_areas += GLOB.space_manager.areas_in_z["[z]"]
|
||||
|
||||
// Don't play storm audio to shuttles that are not at lavaland
|
||||
var/miningShuttleDocked = is_shuttle_docked("mining", "mining_away")
|
||||
@@ -54,12 +55,13 @@
|
||||
if(!golemShuttleOnPlanet)
|
||||
eligible_areas -= get_areas(/area/shuttle/freegolem)
|
||||
|
||||
for(var/i in 1 to length(eligible_areas))
|
||||
var/area/place = eligible_areas[i]
|
||||
while(length(eligible_areas))
|
||||
var/area/place = eligible_areas[length(eligible_areas)]
|
||||
if(place.outdoors)
|
||||
outside_areas += place
|
||||
else
|
||||
inside_areas += place
|
||||
eligible_areas.len--
|
||||
|
||||
sound_ao.output_atoms = outside_areas
|
||||
sound_ai.output_atoms = inside_areas
|
||||
@@ -90,6 +92,11 @@
|
||||
sound_wo.stop()
|
||||
sound_wi.stop()
|
||||
|
||||
/datum/weather/ash_storm/generate_area_list()
|
||||
. = ..()
|
||||
// I'm a lazy fuck and it's either this or refactor procgen again
|
||||
impacted_areas |= get_areas(/area/lavaland/surface/gulag_rock)
|
||||
|
||||
/datum/weather/ash_storm/telegraph()
|
||||
. = ..()
|
||||
update_eligible_areas()
|
||||
|
||||
Reference in New Issue
Block a user