Ejemplo n.º 1
0
 private void HandleMoveAttempt(EntityUid uid, SharedStunnableComponent component, MovementAttemptEvent args)
 {
     if (component.Stunned)
     {
         args.Cancel();
     }
 }
 private void HandleMove(EntityUid uid, SharedBuckleComponent component, MovementAttemptEvent args)
 {
     if (component.Buckled)
     {
         args.Cancel();
     }
 }
Ejemplo n.º 3
0
 private void HandleMoveAttempt(EntityUid uid, SharedClimbingComponent component, MovementAttemptEvent args)
 {
     if (component.OwnerIsTransitioning)
     {
         args.Cancel();
     }
 }
Ejemplo n.º 4
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.º 5
0
 private void HandleMovementBlock(EntityUid uid, PilotComponent component, MovementAttemptEvent args)
 {
     if (component.Console == null)
     {
         return;
     }
     args.Cancel();
 }
        private void OnMoveAttempt(EntityUid uid, MobStateComponent component, MovementAttemptEvent args)
        {
            switch (component.CurrentState)
            {
            case SharedCriticalMobState:
            case SharedDeadMobState:
                args.Cancel();
                return;

            default:
                return;
            }
        }
        public bool CanMove(IEntity entity)
        {
            var ev = new MovementAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

            foreach (var blocker in entity.GetAllComponents <IActionBlocker>())
            {
                if (!blocker.CanMove())
                {
                    ev.Cancel();
                    break;
                }
            }

            return(!ev.Cancelled);
        }
Ejemplo n.º 8
0
 private void OnMoveAttempt(EntityUid uid, StunnedComponent stunned, MovementAttemptEvent args)
 {
     args.Cancel();
 }
Ejemplo n.º 9
0
 private void OnMoveAttempt(EntityUid uid, PAIComponent component, MovementAttemptEvent args)
 {
     args.Cancel(); // no more scurrying around on lil robot legs.
 }