private void OnPickupAttempt(EntityUid uid, SharedGhostComponent component, PickupAttemptEvent args)
 {
     if (!component.CanGhostInteract)
     {
         args.Cancel();
     }
 }
예제 #2
0
        public bool CanPickup(EntityUid uid)
        {
            var ev = new PickupAttemptEvent(uid);

            RaiseLocalEvent(uid, ev);

            return(!ev.Cancelled);
        }
        public bool CanPickup(IEntity entity)
        {
            var ev = new PickupAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

            return(!ev.Cancelled);
        }
        public bool CanPickup(EntityUid user, EntityUid item)
        {
            var userEv = new PickupAttemptEvent(user, item);

            RaiseLocalEvent(user, userEv, false);

            if (userEv.Cancelled)
            {
                return(false);
            }

            var itemEv = new GettingPickedUpAttemptEvent(user, item);

            RaiseLocalEvent(item, itemEv, false);
            return(!itemEv.Cancelled);
        }
        public bool CanPickup(IEntity entity)
        {
            var ev = new PickupAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

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

            return(!ev.Cancelled);
        }
예제 #6
0
 private void OnPickupAttempt(EntityUid uid, SharedCuffableComponent component, PickupAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }
예제 #7
0
 private void OnPickupAttempt(EntityUid uid, StunnedComponent stunned, PickupAttemptEvent args)
 {
     args.Cancel();
 }
 private void OnPickupAttempt(EntityUid uid, MobStateComponent component, PickupAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }
예제 #9
0
 private void OnPickupAttempt(EntityUid uid, PAIComponent component, PickupAttemptEvent args)
 {
     args.Cancel();
 }