private void CheckAct(EntityUid uid, SharedCuffableComponent component, CancellableEntityEventArgs args) { if (!component.CanStillInteract) { args.Cancel(); } }
private void OnPull(EntityUid uid, SharedCuffableComponent component, PullMessage args) { if (!component.CanStillInteract) { _blocker.UpdateCanMove(uid); } }
private void HandleMoveAttempt(EntityUid uid, SharedCuffableComponent component, MovementAttemptEvent args) { if (component.CanStillInteract || !EntityManager.TryGetComponent(uid, out SharedPullableComponent? pullable) || !pullable.BeingPulled) return; args.Cancel(); }
private void OnUnequipAttempt(EntityUid uid, SharedCuffableComponent component, IsUnequippingAttemptEvent args) { // is this a self-equip, or are they being stripped? if (args.Unequipee == uid) { CheckAct(uid, component, args); } }
private void HandleStopPull(EntityUid uid, SharedCuffableComponent component, StopPullingEvent args) { if (args.User == null || !EntityManager.EntityExists(args.User.Value)) return; if (args.User.Value == component.Owner && !component.CanStillInteract) { args.Cancel(); } }
private void HandleStopPull(EntityUid uid, SharedCuffableComponent component, StopPullingEvent args) { if (args.User == null || !EntityManager.TryGetEntity(args.User.Value, out var user)) { return; } if (user == component.Owner && !component.CanStillInteract) { args.Cancel(); } }
private void OnBeingPulledAttempt(EntityUid uid, SharedCuffableComponent component, BeingPulledAttemptEvent args) { if (!TryComp <SharedPullableComponent>(uid, out var pullable)) { return; } if (pullable.Puller != null && !component.CanStillInteract) // If we are being pulled already and cuffed, we can't get pulled again. { args.Cancel(); } }
private void OnPickupAttempt(EntityUid uid, SharedCuffableComponent component, PickupAttemptEvent args) { CheckAct(uid, component, args); }
private void OnInteractAttempt(EntityUid uid, SharedCuffableComponent component, InteractionAttemptEvent args) { CheckAct(uid, component, args); }