Ejemplo n.º 1
0
        private void OnInteractionAttempt(EntityUid uid, DroneComponent component, InteractionAttemptEvent args)
        {
            if (NonDronesInRange(uid, component))
            {
                args.Cancel();
            }

            if (HasComp <SharedItemComponent>(args.Target) && !HasComp <UnremoveableComponent>(args.Target))
            {
                if (!_tagSystem.HasAnyTag(args.Target.Value, "DroneUsable", "Trash"))
                {
                    args.Cancel();
                }
            }
        }
 private void OnInteractAttempt(EntityUid uid, SharedGhostComponent component, InteractionAttemptEvent args)
 {
     if (!component.CanGhostInteract)
     {
         args.Cancel();
     }
 }
Ejemplo n.º 3
0
 private void OnInteractionAttempt(EntityUid uid, DroneComponent component, InteractionAttemptEvent args)
 {
     if (HasComp <MobStateComponent>(args.Target) && !HasComp <DroneComponent>(args.Target))
     {
         args.Cancel();
     }
 }
        public bool CanInteract(IEntity entity)
        {
            var ev = new InteractionAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

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

            return(!ev.Cancelled);
        }
Ejemplo n.º 5
0
 private void OnInteractAttempt(EntityUid uid, StunnedComponent stunned, InteractionAttemptEvent args)
 {
     args.Cancel();
 }
Ejemplo n.º 6
0
 private void OnInteractAttempt(EntityUid uid, PAIComponent component, InteractionAttemptEvent args)
 {
     args.Cancel();
 }