Ejemplo n.º 1
0
 private void CheckAct(EntityUid uid, SharedCuffableComponent component, CancellableEntityEventArgs args)
 {
     if (!component.CanStillInteract)
     {
         args.Cancel();
     }
 }
 private void OnPull(EntityUid uid, SharedCuffableComponent component, PullMessage args)
 {
     if (!component.CanStillInteract)
     {
         _blocker.UpdateCanMove(uid);
     }
 }
Ejemplo n.º 3
0
        private void HandleMoveAttempt(EntityUid uid, SharedCuffableComponent component, MovementAttemptEvent args)
        {
            if (component.CanStillInteract || !EntityManager.TryGetComponent(uid, out SharedPullableComponent? pullable) || !pullable.BeingPulled)
                return;

            args.Cancel();
        }
Ejemplo n.º 4
0
 private void OnUnequipAttempt(EntityUid uid, SharedCuffableComponent component, IsUnequippingAttemptEvent args)
 {
     // is this a self-equip, or are they being stripped?
     if (args.Unequipee == uid)
     {
         CheckAct(uid, component, args);
     }
 }
Ejemplo n.º 5
0
        private void HandleStopPull(EntityUid uid, SharedCuffableComponent component, StopPullingEvent args)
        {
            if (args.User == null || !EntityManager.EntityExists(args.User.Value)) return;

            if (args.User.Value == component.Owner && !component.CanStillInteract)
            {
                args.Cancel();
            }
        }
Ejemplo n.º 6
0
        private void HandleStopPull(EntityUid uid, SharedCuffableComponent component, StopPullingEvent args)
        {
            if (args.User == null || !EntityManager.TryGetEntity(args.User.Value, out var user))
            {
                return;
            }

            if (user == component.Owner && !component.CanStillInteract)
            {
                args.Cancel();
            }
        }
        private void OnBeingPulledAttempt(EntityUid uid, SharedCuffableComponent component, BeingPulledAttemptEvent args)
        {
            if (!TryComp <SharedPullableComponent>(uid, out var pullable))
            {
                return;
            }

            if (pullable.Puller != null && !component.CanStillInteract) // If we are being pulled already and cuffed, we can't get pulled again.
            {
                args.Cancel();
            }
        }
Ejemplo n.º 8
0
 private void OnPickupAttempt(EntityUid uid, SharedCuffableComponent component, PickupAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }
Ejemplo n.º 9
0
 private void OnInteractAttempt(EntityUid uid, SharedCuffableComponent component, InteractionAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }