Files
wwdpublic/Content.Shared/_White/Animations/SharedWaddleAnimationSystem.cs
RedFoxIV 7f33f5f733 Stab++ (#556)
* эмалированная репа

* локалка, ветка и коммит

* Компилить тяжело и неуютно

* Зато уютно набегать

* и тихо капает ОЗУ

* и гит растрёпанный, как блядь
2025-06-11 11:05:17 +03:00

36 lines
1.1 KiB
C#

using Content.Shared.Buckle;
using Content.Shared.Gravity;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Events;
using Content.Shared.Standing;
using Robust.Shared.Timing;
namespace Content.Shared._White.Animations;
public abstract class SharedWaddleAnimationSystem : EntitySystem
{
[Dependency] protected readonly IGameTiming Timing = default!;
[Dependency] private readonly StandingStateSystem _standingState = default!;
[Dependency] private readonly SharedGravitySystem _gravity = default!;
[Dependency] private readonly SharedBuckleSystem _buckle = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<WaddleAnimationComponent, MoveEventProxy>(OnMovementInput);
}
private void OnMovementInput(EntityUid uid, WaddleAnimationComponent component, MoveEventProxy args)
{
if (_standingState.IsDown(uid)
|| _gravity.IsWeightless(uid)
|| _buckle.IsBuckled(uid))
return;
PlayAnimation(uid);
}
protected abstract void PlayAnimation(EntityUid user);
}