mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-31 07:57:47 +01:00
refactor: Remove cave generation from mineral ore generation odds (#24783)
* Remove cave generation from mineral ore generation odds * use clearer vars
This commit is contained in:
@@ -76,6 +76,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
seedRuins(list(level_name_to_num(MINING)), GLOB.configuration.ruins.lavaland_ruin_budget, /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates)
|
||||
if(lavaland_theme)
|
||||
lavaland_theme.setup()
|
||||
lavaland_theme.setup_caves()
|
||||
var/time_spent = stop_watch(lavaland_setup_timer)
|
||||
log_startup_progress("Successfully populated lavaland in [time_spent]s.")
|
||||
else
|
||||
|
||||
@@ -306,9 +306,16 @@
|
||||
|
||||
mineralChance = 10
|
||||
mineralSpawnChanceList = list(
|
||||
/turf/simulated/mineral/uranium/volcanic = 5, /turf/simulated/mineral/diamond/volcanic = 1, /turf/simulated/mineral/gold/volcanic = 10, /turf/simulated/mineral/titanium/volcanic = 11,
|
||||
/turf/simulated/mineral/silver/volcanic = 12, /turf/simulated/mineral/plasma/volcanic = 20, /turf/simulated/mineral/iron/volcanic = 40,
|
||||
/turf/simulated/mineral/gibtonite/volcanic = 4, /turf/simulated/floor/plating/asteroid/airless/cave/volcanic = 1, /turf/simulated/mineral/bscrystal/volcanic = 1)
|
||||
/turf/simulated/mineral/uranium/volcanic = 5,
|
||||
/turf/simulated/mineral/diamond/volcanic = 1,
|
||||
/turf/simulated/mineral/gold/volcanic = 10,
|
||||
/turf/simulated/mineral/titanium/volcanic = 11,
|
||||
/turf/simulated/mineral/silver/volcanic = 12,
|
||||
/turf/simulated/mineral/plasma/volcanic = 20,
|
||||
/turf/simulated/mineral/iron/volcanic = 40,
|
||||
/turf/simulated/mineral/gibtonite/volcanic = 4,
|
||||
/turf/simulated/mineral/bscrystal/volcanic = 1
|
||||
)
|
||||
|
||||
/turf/simulated/mineral/random/labormineral
|
||||
mineralSpawnChanceList = list(
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/// 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
|
||||
|
||||
/datum/lavaland_theme
|
||||
/// Name of lavaland theme
|
||||
var/name = "Not Specified"
|
||||
@@ -12,6 +17,20 @@
|
||||
else if(!ispath(primary_turf_type))
|
||||
stack_trace("Wrong turf type `[primary_turf_type.type]` in `[type]` lavaland theme")
|
||||
|
||||
/datum/lavaland_theme/proc/setup_caves()
|
||||
var/max_attempts = 100
|
||||
var/max_cave_spawns = 40
|
||||
var/z = level_name_to_num(MINING)
|
||||
while(max_attempts > 0 && max_cave_spawns > 0)
|
||||
var/x = rand(1, world.maxx)
|
||||
var/y = rand(LAVALAND_MIN_CAVE_Y, LAVALAND_MAX_CAVE_Y)
|
||||
var/turf/next_turf = locate(x, y, z)
|
||||
var/area/next_area = get_area(next_turf)
|
||||
if(istype(next_turf, /turf/simulated/mineral/random/volcanic) && istype(next_area, /area/lavaland/surface/outdoors/unexplored/danger))
|
||||
next_turf.ChangeTurf(/turf/simulated/floor/plating/asteroid/airless/cave/volcanic, FALSE, TRUE, TRUE)
|
||||
max_cave_spawns--
|
||||
max_attempts--
|
||||
|
||||
/**
|
||||
* This proc should do all theme specific thing.
|
||||
* Now it only generates rivers, but it can do all stuff you desire.
|
||||
@@ -46,3 +65,6 @@
|
||||
/datum/lavaland_theme/chasm/setup()
|
||||
var/datum/river_spawner/spawner = new(level_name_to_num(MINING), spread_prob_ = 10, spread_prob_loss_ = 5)
|
||||
spawner.generate(nodes = 6, min_x = 50, min_y = 7, max_x = 250, max_y = 225)
|
||||
|
||||
#undef LAVALAND_MIN_CAVE_Y
|
||||
#undef LAVALAND_MAX_CAVE_Y
|
||||
|
||||
Reference in New Issue
Block a user