Files
space-station-14/Content.Shared/Actions/EntityEffectActionSystem.cs
T
Pok 61f98c14d3 Changeling reagent stings (#43805)
* Changeling-Stings

* update yml

* attempt failed dead

* sprite and ChangelingNeurodepressantSting

* Update changeling_catalog.yml

* merge

* update

* review

* review 2

* clean up, remove non-blind stings

* fix stuff

* lethal, cryogenic, hallucination + armblade  nerf

* validate deez

* a

* review

---------

Co-authored-by: ScarKy0 <scarky0@onet.eu>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-06-04 19:29:21 +00:00

28 lines
864 B
C#

using Content.Shared.Actions.Components;
using Content.Shared.EntityEffects;
namespace Content.Shared.Actions;
/// <summary>
/// Handles applying entity effects when an entity effect action is performed.
/// </summary>
public sealed partial class EntityEffectActionSystem : EntitySystem
{
[Dependency] private SharedEntityEffectsSystem _effects = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<EntityEffectActionComponent, EntityEffectActionEvent>(OnEntityEffectAction);
}
private void OnEntityEffectAction(Entity<EntityEffectActionComponent> ent, ref EntityEffectActionEvent args)
{
foreach (var effect in ent.Comp.Effects)
{
if (_effects.TryApplyEffect(args.Target, effect, user: args.Performer))
args.Handled = true;
}
}
}