5 new triggers: EmptyContainers, Knockdown, Stun, TriggerOnThrowDoHit (#41472)

* ideas

* finish components

* systems

* one more

* requested

---------

Co-authored-by: iaada <iaada@users.noreply.github.com>
This commit is contained in:
āda
2025-11-18 20:05:13 -06:00
committed by GitHub
parent 414817e38a
commit 78101bceac
9 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using Content.Shared.Stunnable;
using Content.Shared.Trigger.Components.Effects;
namespace Content.Shared.Trigger.Systems;
public sealed class StunOnTriggerSystem : XOnTriggerSystem<StunOnTriggerComponent>
{
[Dependency] private readonly 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);
}
}