mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* epinephrine overdose !!!!! fleshmend!!!! * antazine * antazine yaml fail * woops * address things (build plz) * REMOVE THE FUN!!!! KILL THE WHISMY!!!! * i am stoopid i am stoopid * modernized * THIS IS ALL BS RAAAAAH --------- Co-authored-by: nomdéraisonnablementlong <you@example.com>
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
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!;
|
|
|
|
[SubscribeLocalEvent]
|
|
private void OnEntityEffectInstantAction(Entity<EntityEffectActionComponent> ent, ref EntityEffectInstantActionEvent args)
|
|
{
|
|
if (ent.Comp.Effects == null)
|
|
return;
|
|
|
|
// we trigger the actions on the user
|
|
if (_effects.TryApplyEffects(args.Performer, ent.Comp.Effects, user: args.Performer))
|
|
args.Handled = true;
|
|
}
|
|
|
|
[SubscribeLocalEvent]
|
|
private void OnEntityEffectAction(Entity<EntityEffectActionComponent> ent, ref EntityEffectActionEvent args)
|
|
{
|
|
if (ent.Comp.Effects == null)
|
|
return;
|
|
|
|
if (_effects.TryApplyEffects(args.Target, ent.Comp.Effects, user: args.Performer))
|
|
args.Handled = true;
|
|
|
|
}
|
|
}
|