From: beck-thompson <107373427+beck-thompson@users.noreply.github.com> Date: Fri, 2 May 2025 04:09:23 +0000 (-0700) Subject: Species are now picked at random in the developer environment! (#37057) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=1fbc84512643f05e2c0032f4659a6204839e51a2;p=space-station-14.git Species are now picked at random in the developer environment! (#37057) * Various changes to random species in dev * This should be split --- diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs index 70176ea071..16400039b9 100644 --- a/Content.Server/Station/Systems/StationSpawningSystem.cs +++ b/Content.Server/Station/Systems/StationSpawningSystem.cs @@ -140,8 +140,29 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem if (_randomizeCharacters) { var weightId = _configurationManager.GetCVar(CCVars.ICRandomSpeciesWeights); - var weights = _prototypeManager.Index(weightId); - speciesId = weights.Pick(_random); + + // If blank, choose a round start species. + if (string.IsNullOrEmpty(weightId)) + { + var roundStart = new List>(); + + var speciesPrototypes = _prototypeManager.EnumeratePrototypes(); + foreach (var proto in speciesPrototypes) + { + if (proto.RoundStart) + roundStart.Add(proto.ID); + } + + if (roundStart.Count == 0) + speciesId = SharedHumanoidAppearanceSystem.DefaultSpecies; + else + speciesId = _random.Pick(roundStart); + } + else + { + var weights = _prototypeManager.Index(weightId); + speciesId = weights.Pick(_random); + } } else if (profile != null) { diff --git a/Content.Shared/CCVar/CCVars.Ic.cs b/Content.Shared/CCVar/CCVars.Ic.cs index 54ab69b3fa..b835a8f20e 100644 --- a/Content.Shared/CCVar/CCVars.Ic.cs +++ b/Content.Shared/CCVar/CCVars.Ic.cs @@ -36,6 +36,7 @@ public sealed partial class CCVars /// /// A weighted random prototype used to determine the species selected for random characters. + /// If blank, will use a round start species picked at random. /// public static readonly CVarDef ICRandomSpeciesWeights = CVarDef.Create("ic.random_species_weights", "SpeciesWeights", CVar.SERVER); diff --git a/Resources/ConfigPresets/Build/development.toml b/Resources/ConfigPresets/Build/development.toml index 4465ea8ee0..710885a8b4 100644 --- a/Resources/ConfigPresets/Build/development.toml +++ b/Resources/ConfigPresets/Build/development.toml @@ -37,3 +37,7 @@ preload_grids = false [admin] see_own_notes = true + +[ic] +random_characters = true +random_species_weights = ""