* - fix: Ebow. * - fix: Cult deconversion. * - add: Bola update. * - fix: Error. * - fix: Holoprojectors. * - fix: Clumsy.
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Content.Shared.Projectiles;
|
|
using Content.Shared.Standing.Systems;
|
|
using Content.Shared.Throwing;
|
|
|
|
namespace Content.Shared._White.Collision;
|
|
|
|
public sealed class KnockdownOnCollideSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedStandingStateSystem _standing = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<KnockdownOnCollideComponent, ProjectileHitEvent>(OnProjectileHit);
|
|
SubscribeLocalEvent<KnockdownOnCollideComponent, ThrowDoHitEvent>(OnEntityHit);
|
|
}
|
|
|
|
private void OnEntityHit(Entity<KnockdownOnCollideComponent> ent, ref ThrowDoHitEvent args)
|
|
{
|
|
ApplyEffects(args.Target, ent.Comp);
|
|
}
|
|
|
|
private void OnProjectileHit(Entity<KnockdownOnCollideComponent> ent, ref ProjectileHitEvent args)
|
|
{
|
|
ApplyEffects(args.Target, ent.Comp);
|
|
}
|
|
|
|
private void ApplyEffects(EntityUid target, KnockdownOnCollideComponent component)
|
|
{
|
|
_standing.TryLieDown(target, null, component.Behavior);
|
|
}
|
|
}
|