private void OnUseAttempt(EntityUid uid, SharedGhostComponent component, UseAttemptEvent args)
 {
     if (!component.CanGhostInteract)
     {
         args.Cancel();
     }
 }
        /// <summary>
        ///     Can a user utilize the entity that they are currently holding in their hands.
        /// </summary>>
        /// <remarks>
        ///     This event is automatically checked by <see cref="SharedInteractionSystem"/> for any interactions that
        ///     involve using a held entity. In the majority of cases, systems that provide interactions will not need
        ///     to check this themselves.
        /// </remarks>
        public bool CanUseHeldEntity(EntityUid user)
        {
            var ev = new UseAttemptEvent(user);

            RaiseLocalEvent(user, ev);

            return(!ev.Cancelled);
        }
Beispiel #3
0
        public bool CanUse(EntityUid uid)
        {
            var ev = new UseAttemptEvent(uid);

            RaiseLocalEvent(uid, ev);

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

            RaiseLocalEvent(entity.Uid, ev);

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

            RaiseLocalEvent(entity.Uid, ev);

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

            return(!ev.Cancelled);
        }
Beispiel #6
0
 private void OnUseAttempt(EntityUid uid, SharedCuffableComponent component, UseAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }
 private void OnUseAttempt(EntityUid uid, StunnedComponent stunned, UseAttemptEvent args)
 {
     args.Cancel();
 }
 private void OnUseAttempt(EntityUid uid, MobStateComponent component, UseAttemptEvent args)
 {
     CheckAct(uid, component, args);
 }
Beispiel #9
0
 private void OnUseAttempt(EntityUid uid, PAIComponent component, UseAttemptEvent args)
 {
     args.Cancel();
 }