mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-09-16 07:12:18 +02:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
22 lines
817 B
C#
22 lines
817 B
C#
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityEffects;
|
|
|
|
/// <summary>
|
|
/// Entity effects API counterparts using <see cref="EntityEffectPrototype"/> instead of <see cref="EntityEffect"/>.
|
|
// </summary>
|
|
public sealed partial class SharedEntityEffectsSystem
|
|
{
|
|
[Dependency] private IPrototypeManager _proto = default!;
|
|
|
|
/// <summary>
|
|
/// <c>TryApplyEffect</c> overload using a <see cref="EntityEffectPrototype"/> instead of <see cref="EntityEffect"/>.
|
|
/// </summary>
|
|
public void TryApplyEffect(EntityUid target, [ForbidLiteral] ProtoId<EntityEffectPrototype> id, float scale = 1f, EntityUid? user = null)
|
|
{
|
|
var proto = _proto.Index(id);
|
|
if (_condition.TryConditions(target, proto.Conditions))
|
|
ApplyEffects(target, proto.Effects, scale, user);
|
|
}
|
|
}
|