mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-06-09 10:06:43 +02:00
61f98c14d3
* 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>
28 lines
864 B
C#
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;
|
|
}
|
|
}
|
|
}
|