* pipa * Weather effects * Weather in demiplanes! * demiplane enter roofs * Demiplane ruins * Update weather.yml * Update paper.yml * Update paper.yml
20 lines
554 B
C#
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);
|
|
}
|
|
}
|