Added a ruins UT (#18290)

* sdfa

* fas

* the godness guides, the godness protects

* sadf

* sdf

* fsa

* exoplanets_ruins config for UT

* sdaf

* sdf

* curse upon me
This commit is contained in:
Fluffy
2024-01-30 12:00:23 +01:00
committed by GitHub
parent 45390466f7
commit 1da2f6e7b8
21 changed files with 450 additions and 294 deletions
@@ -27,6 +27,8 @@
set_light(MINIMUM_USEFUL_LIGHT_RANGE, E.lightlevel, COLOR_WHITE)
if(E.planetary_area && istype(loc, world.area))
ChangeArea(src, E.planetary_area)
else
log_module_exoplanets("Simulated exoplanet turf NAME: [src.name] LOC [src.x]-[src.y]-[src.z] did not find any exoplanet to copy info from!")
..()
/turf/simulated/floor/exoplanet/attackby(obj/item/C, mob/user)
+40 -2
View File
@@ -57,10 +57,15 @@
var/features_budget = 4
var/list/possible_features = list()
var/list/spawned_features
/// List of ruin types that can be chosen from; supercedes ruin tags system, ignores TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED
var/list/ruin_type_whitelist
// Ruin tags: used to dynamically select what ruins are valid for this exoplanet, if any
// See code/__defines/ruin_tags.dm
/**
* Ruin tags: used to dynamically select what ruins are valid for this exoplanet, if any
*
* See `code/__DEFINES/ruin_tags.dm`
*/
var/ruin_planet_type = PLANET_BARREN
var/ruin_allowed_tags = RUIN_ALL_TAGS
@@ -107,12 +112,44 @@
if(LAZYLEN(possible_themes))
var/datum/exoplanet_theme/T = pick(possible_themes)
theme = new T
#if defined(UNIT_TEST)
///If we have shown one warning for the exoplanets_ruins config preventing us from loading ruins
var/shown_warning_for_exoplanets_ruins_config = FALSE
#endif //UNIT_TEST
if(ruin_type_whitelist)
for(var/T in ruin_type_whitelist)
//If the exoplanet_ruins setting in the UT is FALSE, do not generate ruins
//yes we could skip the list traversing but it would be more shitcode to do that, since it's not that expensive, fuck it
#if defined(UNIT_TEST)
if((SSunit_tests_config.config["exoplanets_ruins"] == FALSE))
if(!shown_warning_for_exoplanets_ruins_config)
LOG_GITHUB_WARNING("Not spawning ruins in 'ruin_type_whitelist' for [src.name] because 'exoplanets_ruins' is FALSE in the UT config")
shown_warning_for_exoplanets_ruins_config = TRUE
LOG_GITHUB_DEBUG("Ruin [T] in 'ruin_type_whitelist' for [src.name] not spawned because 'exoplanets_ruins' is FALSE in the UT config")
continue
#endif //UNIT_TEST
var/datum/map_template/ruin/exoplanet/ruin = T
possible_features += new ruin
else
for(var/T in subtypesof(/datum/map_template/ruin/exoplanet))
//If the exoplanet_ruins setting in the UT is FALSE or the type is not listed, do not generate ruins
//If it's set to TRUE, we want the normal behavior, otherwise check if the subtype is present in the list
#if defined(UNIT_TEST)
if((SSunit_tests_config.config["exoplanets_ruins"] == FALSE) || ((SSunit_tests_config.config["exoplanets_ruins"] != TRUE) && !(T in SSunit_tests_config.config["exoplanets_ruins"])))
if(!shown_warning_for_exoplanets_ruins_config && (SSunit_tests_config.config["exoplanets_ruins"] == FALSE))
LOG_GITHUB_WARNING("Not spawning ruins for [src.name] because 'exoplanets_ruins' is FALSE in the UT config")
shown_warning_for_exoplanets_ruins_config = TRUE
LOG_GITHUB_DEBUG("Ruin [T] for [src.name] not spawned because either 'exoplanets_ruins' is FALSE or it does not contain it in the UT config")
continue
#endif //UNIT_TEST
var/datum/map_template/ruin/exoplanet/ruin = T
if((initial(ruin.template_flags) & TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED))
continue
@@ -122,6 +159,7 @@
if(filtered_tags != initial(ruin.ruin_tags))
continue
possible_features += new ruin
..()
/obj/effect/overmap/visitable/sector/exoplanet/proc/build_level()