mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-20 23:17:43 +03:00
* эмалированная репа * локалка, ветка и коммит * Компилить тяжело и неуютно * Зато уютно набегать * и тихо капает ОЗУ * и гит растрёпанный, как блядь
36 lines
1.1 KiB
C#
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);
|
|
}
|