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(); } }
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); }
private void OnInteractAttempt(EntityUid uid, StunnedComponent stunned, InteractionAttemptEvent args) { args.Cancel(); }
private void OnInteractAttempt(EntityUid uid, PAIComponent component, InteractionAttemptEvent args) { args.Cancel(); }