コード例 #1
0
 private void OnChangeDirectionAttempt(EntityUid uid, PAIComponent component, ChangeDirectionAttemptEvent args)
 {
     // PAIs can't rotate, but decapitated heads and sentient crowbars can, life isn't fair. Seriously though, why
     // tf does this have to be actively blocked, surely this should just not be blanket enabled for any player
     // controlled entity. Same goes for moving really.
     args.Cancel();
 }
コード例 #2
0
        public bool CanChangeDirection(EntityUid uid)
        {
            var ev = new ChangeDirectionAttemptEvent(uid);

            RaiseLocalEvent(uid, ev);

            return(!ev.Cancelled);
        }
コード例 #3
0
        public bool CanChangeDirection(IEntity entity)
        {
            var ev = new ChangeDirectionAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

            return(!ev.Cancelled);
        }
コード例 #4
0
        public bool CanChangeDirection(IEntity entity)
        {
            var ev = new ChangeDirectionAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

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

            return(!ev.Cancelled);
        }
コード例 #5
0
 private void OnChangeDirectionAttempt(EntityUid uid, MobStateComponent component, ChangeDirectionAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }
コード例 #6
0
 private void OnBuckleChangeDirectionAttempt(EntityUid uid, SharedBuckleComponent component, ChangeDirectionAttemptEvent args)
 {
     if (component.Buckled)
     {
         args.Cancel();
     }
 }
コード例 #7
0
 private void OnChangeDirectionAttempt(EntityUid uid, MobStateComponent component, ChangeDirectionAttemptEvent args)
 {
     switch (component.CurrentState)
     {
     case SharedDeadMobState:
     case SharedCriticalMobState:
         args.Cancel();
         break;
     }
 }