private void OnUnanchorAttempt(EntityUid uid, SubFloorHideComponent component, UnanchorAttemptEvent args) { // No un-anchoring things under the floor. Only required for something like vents, which are still interactable // despite being partially under the floor. if (component.IsUnderCover) { args.Cancel(); } }
private void OnUnanchorAttempt(EntityUid uid, NukeComponent component, UnanchorAttemptEvent args) { CheckAnchorAttempt(uid, component, args); }
private void OnUnanchorAttempt(EntityUid uid, ContainmentFieldGeneratorComponent component, UnanchorAttemptEvent args) { if (component.Enabled) { _popupSystem.PopupEntity(Loc.GetString("comp-containment-anchor-warning"), args.User, Filter.Entities(args.User)); args.Cancel(); } }
private void OnUnanchorAttempt(EntityUid uid, AtmosUnsafeUnanchorComponent component, UnanchorAttemptEvent args) { if (!component.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes)) { return; } if (_atmosphereSystem.GetTileMixture(EntityManager.GetComponent <TransformComponent>(component.Owner).Coordinates) is not { } environment) { return; } foreach (var node in nodes.Nodes.Values) { if (node is not PipeNode pipe) { continue; } if ((pipe.Air.Pressure - environment.Pressure) > 2 * Atmospherics.OneAtmosphere) { args.Delay += 1.5f; _popupSystem.PopupCursor(Loc.GetString("comp-atmos-unsafe-unanchor-warning"), Filter.Entities(args.User)); return; // Show the warning only once. } } }
private void OnUnanchorAttempt(EntityUid uid, AtmosUnsafeUnanchorComponent component, UnanchorAttemptEvent args) { if (!component.Enabled || !ComponentManager.TryGetComponent(uid, out NodeContainerComponent? nodes)) { return; } if (!component.Owner.Transform.Coordinates.TryGetTileAir(out var environment, EntityManager)) { return; } foreach (var node in nodes.Nodes.Values) { if (node is not PipeNode pipe) { continue; } if ((pipe.Air.Pressure - environment.Pressure) > 2 * Atmospherics.OneAtmosphere) { args.Delay += 1.5f; args.User?.PopupMessageCursor(Loc.GetString("comp-atmos-unsafe-unanchor-warning")); return; // Show the warning only once. } } }