mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* 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
17 lines
620 B
C#
17 lines
620 B
C#
using Content.Shared.Stunnable;
|
|
using Content.Shared.Trigger.Components.Effects;
|
|
|
|
namespace Content.Shared.Trigger.Systems;
|
|
|
|
public sealed partial class StunOnTriggerSystem : XOnTriggerSystem<StunOnTriggerComponent>
|
|
{
|
|
[Dependency] private SharedStunSystem _stun = default!;
|
|
|
|
protected override void OnTrigger(Entity<StunOnTriggerComponent> ent, EntityUid target, ref TriggerEvent args)
|
|
{
|
|
if (ent.Comp.Refresh)
|
|
args.Handled |= _stun.TryUpdateStunDuration(target, ent.Comp.StunAmount);
|
|
else
|
|
args.Handled |= _stun.TryAddStunDuration(target, ent.Comp.StunAmount);
|
|
}
|
|
}
|