Files
tbd-station-14/Content.Shared/EntityEffects/EntityEffectEvent.cs
2025-10-23 10:33:30 +00:00

28 lines
959 B
C#

namespace Content.Shared.EntityEffects;
/// <summary>
/// An Event carrying an entity effect.
/// </summary>
/// <param name="Effect">The Effect</param>
/// <param name="Scale">A strength scalar for the effect, defaults to 1 and typically only goes under for incomplete reactions.</param>
/// <param name="User">The entity causing the effect.</param>
[ByRefEvent, Access(typeof(SharedEntityEffectsSystem))]
public readonly record struct EntityEffectEvent<T>(T Effect, float Scale, EntityUid? User) where T : EntityEffectBase<T>
{
/// <summary>
/// The Condition being raised in this event
/// </summary>
public readonly T Effect = Effect;
/// <summary>
/// The Scale modifier of this Effect.
/// </summary>
public readonly float Scale = Scale;
/// <summary>
/// The entity that caused this effect.
/// Used for admin logs and prediction purposes.
/// </summary>
public readonly EntityUid? User = User;
}