Spiders Buff and critters change (#13377)

This commit is contained in:
Jackrost
2023-01-23 01:50:05 +03:00
committed by GitHub
parent 4915ff6f5b
commit 12fb4b2097
18 changed files with 332 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
using Content.Server.StationEvents.Components;
using Content.Shared.Actions;
using Robust.Shared.Random;
using System.Linq;
namespace Content.Server.StationEvents.Events;
public sealed class SpiderSpawn : StationEventSystem
{
public override string Prototype => "SpiderSpawn";
public override void Started()
{
base.Started();
var spawnLocations = EntityManager.EntityQuery<VentCritterSpawnLocationComponent>().ToList();
RobustRandom.Shuffle(spawnLocations);
var mod = Math.Sqrt(GetSeverityModifier());
var spawnAmount = (int) (RobustRandom.Next(4, 8) * mod);
Sawmill.Info($"Spawning {spawnAmount} of spiders");
foreach (var location in spawnLocations)
{
if (spawnAmount-- == 0)
break;
var coords = EntityManager.GetComponent<TransformComponent>(location.Owner);
EntityManager.SpawnEntity("MobGiantSpiderAngry", coords.Coordinates);
}
}
}

View File

@@ -1,4 +1,5 @@
using Content.Server.StationEvents.Components;
using Content.Shared.Actions;
using Robust.Shared.Random;
using System.Linq;
@@ -7,7 +8,7 @@ namespace Content.Server.StationEvents.Events;
public sealed class VentCritters : StationEventSystem
{
public static List<string> SpawnedPrototypeChoices = new List<string>()
{"MobGiantSpiderAngry", "MobMouse", "MobMouse1", "MobMouse2"};
{"MobMouse", "MobMouse1", "MobMouse2"};
public override string Prototype => "VentCritters";
@@ -18,9 +19,7 @@ public sealed class VentCritters : StationEventSystem
var spawnLocations = EntityManager.EntityQuery<VentCritterSpawnLocationComponent>().ToList();
RobustRandom.Shuffle(spawnLocations);
var mod = Math.Sqrt(GetSeverityModifier());
var spawnAmount = (int) (RobustRandom.Next(4, 12) * mod); // A small colony of critters.
var spawnAmount = (int) (RobustRandom.Next(4, 12)); // A small colony of critters.
Sawmill.Info($"Spawning {spawnAmount} of {spawnChoice}");
foreach (var location in spawnLocations)
{