Flesh Anomaly spawns a lot more kudzu (#16800)

This commit is contained in:
Tom Leys
2023-06-04 07:31:10 +12:00
committed by GitHub
parent e4670a0636
commit 4cc988b668
2 changed files with 10 additions and 6 deletions

View File

@@ -31,17 +31,20 @@ public sealed class EntityAnomalySystem : EntitySystem
var amount = (int) (component.MaxSpawnAmount * args.Severity + 0.5f);
var xform = Transform(uid);
SpawnMonstersOnOpenTiles(component, xform, amount, range);
SpawnMonstersOnOpenTiles(component, xform, amount, range, component.Spawns);
}
private void OnSupercritical(EntityUid uid, EntitySpawnAnomalyComponent component, ref AnomalySupercriticalEvent args)
{
var xform = Transform(uid);
SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange);
// A cluster of monsters
SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, component.Spawns);
// And so much meat (for the meat anomaly at least)
Spawn(component.SupercriticalSpawn, xform.Coordinates);
SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, new List<string>(){component.SupercriticalSpawn});
}
private void SpawnMonstersOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius)
private void SpawnMonstersOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius, List<string> spawns)
{
if (!component.Spawns.Any())
return;
@@ -76,7 +79,7 @@ public sealed class EntityAnomalySystem : EntitySystem
if (!valid)
continue;
amountCounter++;
Spawn(_random.Pick(component.Spawns), tileref.GridIndices.ToEntityCoordinates(xform.GridUid.Value, _map));
Spawn(_random.Pick(spawns), tileref.GridIndices.ToEntityCoordinates(xform.GridUid.Value, _map));
if (amountCounter >= amount)
return;
}