Skip to content
3 changes: 3 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6918,6 +6918,7 @@
#include "voidcrew\edits\mobs\respawn_timer.dm"
#include "voidcrew\edits\mobs\ruin_icons.dm"
#include "voidcrew\edits\mobs\ship_join_menu.dm"
#include "voidcrew\edits\objects\items\event_horizon_rifle.dm"
#include "voidcrew\edits\objects\items\extinguisher.dm"
#include "voidcrew\edits\objects\items\kinetic_accelerator_modkits.dm"
#include "voidcrew\edits\objects\items\posibrain.dm"
Expand Down Expand Up @@ -7097,6 +7098,7 @@
#include "voidcrew\modules\captain_management\captain_management.dm"
#include "voidcrew\modules\captain_management\command_transfer.dm"
#include "voidcrew\modules\captain_management\ship_applications.dm"
#include "voidcrew\modules\cargo\anomaly_packs.dm"
#include "voidcrew\modules\cargo\bank_account.dm"
#include "voidcrew\modules\cargo\bank_machine.dm"
#include "voidcrew\modules\cargo\exports.dm"
Expand Down Expand Up @@ -7631,6 +7633,7 @@
#include "voidcrew\modules\storage\wall_locker.dm"
#include "voidcrew\modules\surgery\experimental_dissection.dm"
#include "voidcrew\modules\teams\_team.dm"
#include "voidcrew\modules\trade\anomaly_charts.dm"
#include "voidcrew\modules\trade\blueprint_imprinter.dm"
#include "voidcrew\modules\trade\modsuit_bench.dm"
#include "voidcrew\modules\trade\outpost.dm"
Expand Down
19 changes: 9 additions & 10 deletions voidcrew/_DEFINES/overmap_zones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,26 @@
#define ZONE_PLANET_SPAWNER_SPACING 24

/**
* How many anomalies a planet may seed, per zone.
* Percent chance a planet seeds an anomaly, per zone. At most one per planet: they are
* meant to be a rare find, and a planet rebuilds with a fresh roll each time it reloads.
*
* Anomalies used to be a ship-scoped dynamic event, which made them something that
* happened TO a crew in their own corridors with nowhere to stand back to. On a planet
* the same object reads the opposite way: it is stationary, it is visible from across
* open ground, and the crew chose to walk over there. Approaching one is a decision, and
* a crew carrying a neutralizer (Anomaly Research, tier 3) gets a core out of it.
*
* Green stays empty for the same reason it seeds no megafauna: it is where a crew takes
* its first landing.
* Green gets the occasional one, deeper bands more often.
*/
#define ZONE_PLANET_ANOMALY_BUDGET_GREEN 0
#define ZONE_PLANET_ANOMALY_BUDGET_YELLOW 2
#define ZONE_PLANET_ANOMALY_BUDGET_RED 3
#define ZONE_PLANET_ANOMALY_CHANCE_GREEN 5
#define ZONE_PLANET_ANOMALY_CHANCE_YELLOW 15
#define ZONE_PLANET_ANOMALY_CHANCE_RED 25

/// Minimum tiles between two planet anomalies, so a budget of 3 is three separate finds
/// rather than one lethal clearing.
/// Minimum tiles between two planet anomalies, should a planet ever seed more than one
#define ZONE_PLANET_ANOMALY_SPACING 20

/// Cap on random turf draws while placing the anomaly budget. A planet whose open ground
/// is nearly all taken simply seeds fewer than its budget rather than spinning.
/// Cap on random turf draws while placing a planet's anomaly. A planet whose open ground
/// is nearly all taken simply goes without rather than spinning.
#define PLANET_ANOMALY_PLACEMENT_ATTEMPTS 400

/// Multiplier on ore mined per planet rock wall (mineralAmt), per zone, green stays baseline (x1). Applied in /turf/closed/mineral/proc/zone_scaled_ore_amount()
Expand Down
8 changes: 5 additions & 3 deletions voidcrew/datums/mapgen/PlanetGenerator.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define BIOME_RANDOM_SQUARE_DRIFT 2

/**
Expand Down Expand Up @@ -397,7 +397,7 @@
var/mob_chance_mult = 1
var/mob_upgrade_prob = 0
var/spawner_budget = ZONE_PLANET_SPAWNER_BUDGET_GREEN
var/anomaly_budget = ZONE_PLANET_ANOMALY_BUDGET_GREEN
var/anomaly_chance = ZONE_PLANET_ANOMALY_CHANCE_GREEN
// Megafauna are apex content and stay out of the shallow end entirely - a green-zone
// planet is where a crew takes its first landing.
var/megafauna_allowed = FALSE
Expand All @@ -418,13 +418,13 @@
mob_chance_mult = ZONE_PLANET_MOB_CHANCE_MULT_YELLOW
mob_upgrade_prob = ZONE_PLANET_MOB_UPGRADE_PROB_YELLOW
spawner_budget = ZONE_PLANET_SPAWNER_BUDGET_YELLOW
anomaly_budget = ZONE_PLANET_ANOMALY_BUDGET_YELLOW
anomaly_chance = ZONE_PLANET_ANOMALY_CHANCE_YELLOW
megafauna_allowed = TRUE
if(ZONE_RED)
mob_chance_mult = ZONE_PLANET_MOB_CHANCE_MULT_RED
mob_upgrade_prob = ZONE_PLANET_MOB_UPGRADE_PROB_RED
spawner_budget = ZONE_PLANET_SPAWNER_BUDGET_RED
anomaly_budget = ZONE_PLANET_ANOMALY_BUDGET_RED
anomaly_chance = ZONE_PLANET_ANOMALY_CHANCE_RED
megafauna_allowed = TRUE

// Structure spawners and megafauna are placed after the pass, not during it. Both are
Expand Down Expand Up @@ -562,6 +562,8 @@

var/spawners_placed = place_budgeted_spawners(spawner_candidates, spawner_budget)
var/megafauna_placed = place_planet_megafauna(megafauna_candidates)
// One anomaly at most, and only on a successful roll: they are a rare find
var/anomaly_budget = prob(anomaly_chance) ? 1 : 0
var/anomalies_placed = place_budgeted_anomalies(turfs, anomaly_budget)

log_world("[name] terrain population finished in [(REALTIMEOFDAY - start_time)/10]s! \
Expand Down
Loading
Loading