Files
ss14-wl/Content.Shared/EntityEffects/SharedEntityEffectsSystem.Nested.cs
Pieter-Jan BriersandGitHub 5168b5f3d4 IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

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);
}
}