From 0137884e166864c70427976b095cc6ca07e44b0b Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 10 Sep 2021 23:26:38 +1000 Subject: [PATCH] Take TryRepell behind the shed (#4584) Singularity containment uses physics and just workstm --- .../Components/ContainmentFieldConnection.cs | 47 ------------------- .../ContainmentFieldGeneratorSystem.cs | 2 - 2 files changed, 49 deletions(-) diff --git a/Content.Server/Singularity/Components/ContainmentFieldConnection.cs b/Content.Server/Singularity/Components/ContainmentFieldConnection.cs index b0770e1316..893b042dac 100644 --- a/Content.Server/Singularity/Components/ContainmentFieldConnection.cs +++ b/Content.Server/Singularity/Components/ContainmentFieldConnection.cs @@ -83,53 +83,6 @@ namespace Content.Server.Singularity.Components return _sharedEnergyPool > powerNeeded; } - /// - /// Tries to repell a Entity. This deletes the connection if the repelling fails! - /// - /// Entity to repell from. Should be a field, otherwise return will be false. - /// Entity to repell. - public void TryRepell(IEntity repellFrom, IEntity toRepell) - { - // TODO: Fix this also it's fucking repel - if (!_fields.Contains(repellFrom) || !toRepell.TryGetComponent(out var collidableComponent)) return; - - return; - var speed = 5; - //var containmentFieldRepellController = collidableComponent.EnsureController(); - - if (!CanRepell(toRepell)) - { - Dispose(); - return; - } - - if (Math.Abs(repellFrom.Transform.WorldRotation.Degrees + 90f) < 0.1f || - Math.Abs(repellFrom.Transform.WorldRotation.Degrees - 90f) < 0.1f) - { - if (repellFrom.Transform.WorldPosition.X.CompareTo(toRepell.Transform.WorldPosition.X) > 0) - { - //containmentFieldRepellController.Repell(Direction.West, speed); - } - else - { - //containmentFieldRepellController.Repell(Direction.East, speed); - } - } - else - { - if (repellFrom.Transform.WorldPosition.Y.CompareTo(toRepell.Transform.WorldPosition.Y) > 0) - { - //containmentFieldRepellController.Repell(Direction.South, speed); - } - else - { - //containmentFieldRepellController.Repell(Direction.North, speed); - } - } - - return; - } - public void Dispose() { _powerDecreaseCancellationTokenSource.Cancel(); diff --git a/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs b/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs index d553d2e927..3873c57cf7 100644 --- a/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs +++ b/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs @@ -51,8 +51,6 @@ namespace Content.Server.Singularity.EntitySystems EntityManager.QueueDeleteEntity(uid); return; } - - component.Parent.TryRepell(component.Owner, args.OtherFixture.Body.Owner); } private static void BodyTypeChanged(