Files
Ed 26d81b684b Weather refill (#1175)
* refillable by weather

* fix
2025-04-13 01:01:22 +03:00

19 lines
526 B
C#

using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Shared._CP14.WeatherEffect.Effects;
public sealed partial class SpawnEntityOnTop : CP14WeatherEffect
{
[DataField(required: true)]
public EntProtoId Entity;
public override void ApplyEffect(IEntityManager entManager, IRobustRandom random, EntityUid target)
{
if (!random.Prob(Prob))
return;
entManager.SpawnAtPosition(Entity, entManager.GetComponent<TransformComponent>(target).Coordinates);
}
}