CatStation/Content.Shared/EntityEffects/SharedEntityEffectsSystem.Nested.cs
Whatstone a8453723d8
Cleanup: ProtoMan Part 1 - remove Shared EntitySystem IPrototypeManager instances (#44386)
* Remove Shared System IPrototypeManager instances

* Remove RecipeManager IPrototypeManager instance

* Fix ItemSystem IPrototypeManager refs, use TryComp

* SharedItemSystem changes, EntWhitelist CompName

* HasComponent->HasComp
2026-06-29 10:18:44 +00:00

19 lines
756 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
{
/// <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 = ProtoMan.Index(id);
if (_condition.TryConditions(target, proto.Conditions))
ApplyEffects(target, proto.Effects, scale, user);
}
}