Пример #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();
 }
 private void OnBuckleChangeDirectionAttempt(EntityUid uid, SharedBuckleComponent component, ChangeDirectionAttemptEvent args)
 {
     if (component.Buckled)
     {
         args.Cancel();
     }
 }
Пример #3
0
 private void OnChangeDirectionAttempt(EntityUid uid, MobStateComponent component, ChangeDirectionAttemptEvent args)
 {
     switch (component.CurrentState)
     {
     case SharedDeadMobState:
     case SharedCriticalMobState:
         args.Cancel();
         break;
     }
 }
        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);
        }