Фиксы (#439)
* - fix: Ebow. * - fix: Cult deconversion. * - add: Bola update. * - fix: Error. * - fix: Holoprojectors. * - fix: Clumsy.
This commit is contained in:
33
Content.Shared/_White/Collision/KnockdownOnCollideSystem.cs
Normal file
33
Content.Shared/_White/Collision/KnockdownOnCollideSystem.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user