Files
crystall-punk-14/Content.Shared/_CP14/WeatherEffect/SpawnEntityOnTop.cs
Ed 011e90a5d1 Weather gameplay effects (#1089)
* pipa

* Weather effects

* Weather in demiplanes!

* demiplane enter roofs

* Demiplane ruins

* Update weather.yml

* Update paper.yml

* Update paper.yml
2025-03-30 17:27:05 +03:00

20 lines
554 B
C#

using Content.Shared.EntityEffects;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Shared._CP14.WeatherEffect;
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);
}
}