using Content.Shared.Body.Systems; using Content.Shared.Buckle.Components; using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; using Content.Shared.Standing; namespace Content.Shared.Traits.Assorted; public sealed class LegsParalyzedSystem : EntitySystem { [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!; [Dependency] private readonly StandingStateSystem _standingSystem = default!; [Dependency] private readonly SharedBodySystem _bodySystem = default!; public override void Initialize() { SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnShutdown); SubscribeLocalEvent(OnBuckleChange); } private void OnStartup(EntityUid uid, LegsParalyzedComponent component, ComponentStartup args) { // TODO: In future probably must be surgery related wound var movementSpeed = EnsureComp(uid); _movementSpeedModifierSystem.ChangeBaseSpeed(uid, 0, 0, 20, movementSpeed); } private void OnShutdown(EntityUid uid, LegsParalyzedComponent component, ComponentShutdown args) { _standingSystem.Stand(uid); _bodySystem.UpdateMovementSpeed(uid); } private void OnBuckleChange(EntityUid uid, LegsParalyzedComponent component, ref BuckleChangeEvent args) { if (args.Buckling) { _standingSystem.Stand(args.BuckledEntity); } else { _standingSystem.Down(args.BuckledEntity); } } }