mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
54 lines
2 KiB
C#
54 lines
2 KiB
C#
using Content.Shared.Buckle.Components;
|
|
using Content.Shared.Movement.Events;
|
|
using Content.Shared.Movement.Systems;
|
|
using Content.Shared.Standing;
|
|
using Content.Shared.Throwing;
|
|
|
|
namespace Content.Shared.Traits.Assorted;
|
|
|
|
public sealed partial class LegsParalyzedSystem : EntitySystem
|
|
{
|
|
[Dependency] private MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
|
|
[Dependency] private StandingStateSystem _standingSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<LegsParalyzedComponent, ComponentStartup>(OnStartup);
|
|
SubscribeLocalEvent<LegsParalyzedComponent, ComponentShutdown>(OnShutdown);
|
|
SubscribeLocalEvent<LegsParalyzedComponent, BuckledEvent>(OnBuckled);
|
|
SubscribeLocalEvent<LegsParalyzedComponent, UnbuckledEvent>(OnUnbuckled);
|
|
SubscribeLocalEvent<LegsParalyzedComponent, ThrowPushbackAttemptEvent>(OnThrowPushbackAttempt);
|
|
SubscribeLocalEvent<LegsParalyzedComponent, UpdateCanMoveEvent>(OnUpdateCanMoveEvent);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, LegsParalyzedComponent component, ComponentStartup args)
|
|
{
|
|
// TODO: In future probably must be surgery related wound
|
|
_movementSpeedModifierSystem.ChangeBaseSpeed(uid, 0, 0, 20);
|
|
}
|
|
|
|
private void OnShutdown(EntityUid uid, LegsParalyzedComponent component, ComponentShutdown args)
|
|
{
|
|
_standingSystem.Stand(uid);
|
|
}
|
|
|
|
private void OnBuckled(EntityUid uid, LegsParalyzedComponent component, ref BuckledEvent args)
|
|
{
|
|
_standingSystem.Stand(uid);
|
|
}
|
|
|
|
private void OnUnbuckled(EntityUid uid, LegsParalyzedComponent component, ref UnbuckledEvent args)
|
|
{
|
|
_standingSystem.Down(uid);
|
|
}
|
|
|
|
private void OnUpdateCanMoveEvent(EntityUid uid, LegsParalyzedComponent component, UpdateCanMoveEvent args)
|
|
{
|
|
args.Cancel();
|
|
}
|
|
|
|
private void OnThrowPushbackAttempt(EntityUid uid, LegsParalyzedComponent component, ThrowPushbackAttemptEvent args)
|
|
{
|
|
args.Cancel();
|
|
}
|
|
}
|