Revert "Physics (#3452)"

This reverts commit 3e64fd56a1.
This commit is contained in:
Pieter-Jan Briers
2021-02-28 18:49:48 +01:00
parent eddec5fcce
commit 1eb0fbd8d0
211 changed files with 2560 additions and 2600 deletions

View File

@@ -6,7 +6,6 @@ using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Timing;
namespace Content.Server.GameObjects.Components.PA
@@ -16,9 +15,9 @@ namespace Content.Server.GameObjects.Components.PA
{
public override string Name => "ParticleProjectile";
private ParticleAcceleratorPowerState _state;
public void CollideWith(IPhysBody ourBody, IPhysBody otherBody)
public void CollideWith(IEntity collidedWith)
{
if (otherBody.Entity.TryGetComponent<SingularityComponent>(out var singularityComponent))
if (collidedWith.TryGetComponent<SingularityComponent>(out var singularityComponent))
{
var multiplier = _state switch
{
@@ -31,8 +30,8 @@ namespace Content.Server.GameObjects.Components.PA
};
singularityComponent.Energy += 10 * multiplier;
Owner.Delete();
}
else if (otherBody.Entity.TryGetComponent<SingularityGeneratorComponent>(out var singularityGeneratorComponent))
}else if (collidedWith.TryGetComponent<SingularityGeneratorComponent>(out var singularityGeneratorComponent)
)
{
singularityGeneratorComponent.Power += _state switch
{
@@ -56,7 +55,7 @@ namespace Content.Server.GameObjects.Components.PA
Logger.Error("ParticleProjectile tried firing, but it was spawned without a CollidableComponent");
return;
}
physicsComponent.BodyStatus = BodyStatus.InAir;
physicsComponent.Status = BodyStatus.InAir;
if (!Owner.TryGetComponent<ProjectileComponent>(out var projectileComponent))
{
@@ -82,6 +81,7 @@ namespace Content.Server.GameObjects.Components.PA
spriteComponent.LayerSetState(0, $"particle{suffix}");
physicsComponent
.EnsureController<BulletController>()
.LinearVelocity = angle.ToVec() * 20f;
Owner.Transform.LocalRotation = new Angle(angle + Angle.FromDegrees(180));