@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user