De-hardcodes wilderness levels z-traits (#96426)

## About The Pull Request
Tin. If someone decides to add wilderness levels for maps that isnt ice,
they will not suffer anymore. Uses default icy wilderness traits
(renamed define for clarity), also adjusted another var name, for
clarity too.
## Why It's Good For The Game
Allows for a higher degree of customisation for wilderness levels, which
is a very good idea, but somehow it was hardcoded to only work with snow
maps.
## Changelog
Nothing player facing (i hope)
This commit is contained in:
Iajret
2026-06-12 01:03:50 +02:00
committed by GitHub
parent 2f401cba7c
commit 8ef4eb31bc
3 changed files with 11 additions and 5 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ Always compile, always use that verb, and always make sure that it works for wha
///Z level traits for Deep Space
#define ZTRAITS_SPACE list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_SPACE_RUINS = TRUE)
///Z level traits for
#define ZTRAITS_WILDS list(\
#define ZTRAITS_ICY_WILDS list(\
ZTRAIT_LINKAGE = GRIDLINKED, \
ZTRAIT_ICE_RUINS = TRUE, \
ZTRAIT_SNOWSTORM = FALSE, \
+1 -1
View File
@@ -144,7 +144,7 @@ SUBSYSTEM_DEF(mapping)
if(current_map.wilderness_levels)
var/list/FailedZs = list()
LoadGroup(FailedZs, "Wilderness Area", current_map.wilderness_directory, current_map.maps_to_spawn, default_traits = ZTRAITS_WILDS, height_autosetup = FALSE)
LoadGroup(FailedZs, "Wilderness Area", current_map.wilderness_directory, current_map.wilderness_maps_to_spawn, default_traits = current_map.wilderness_z_traits, height_autosetup = FALSE)
if(LAZYLEN(FailedZs))
CRASH("Ice wilds failed to load!")
+9 -3
View File
@@ -34,8 +34,10 @@
var/wilderness_levels = 0
/// Directory to the wilderness area we can spawn in
var/wilderness_directory
/// Z-Level traits our wilderness maps will get, ice box traits by default
var/list/wilderness_z_traits = ZTRAITS_ICY_WILDS
/// Index of map names (inside wilderness_directory) with the amount to spawn. ("ice_planes" = 1) for one ice spawn
var/list/maps_to_spawn = list()
var/list/wilderness_maps_to_spawn = list()
///The type of mining Z-level that should be loaded.
var/minetype = MINETYPE_LAVALAND
@@ -259,8 +261,12 @@
// Just pick and take based on weight
for(var/i in 1 to wilderness_levels)
maps_to_spawn += pick_weight_take(wilderness)
shuffle(maps_to_spawn)
wilderness_maps_to_spawn += pick_weight_take(wilderness)
shuffle(wilderness_maps_to_spawn)
var/list/wilderness_level_traits = json["wilderness_level_traits"]
if (islist(wilderness_level_traits))
wilderness_z_traits = wilderness_level_traits
#ifdef UNIT_TESTS
// Check for unit tests to skip, no reason to check these if we're not running tests