Remove IStartCollide from containment fields (#4318)

* Remove IStartCollide from containment fields

* Emitter namespace

* vera reviews
This commit is contained in:
metalgearsloth
2021-07-21 22:26:18 +10:00
committed by GitHub
parent 3775d329bd
commit 39801372be
4 changed files with 50 additions and 46 deletions

View File

@@ -12,30 +12,14 @@ using Robust.Shared.Timing;
namespace Content.Server.ParticleAccelerator.Components
{
[RegisterComponent]
public class ParticleProjectileComponent : Component, IStartCollide
public class ParticleProjectileComponent : Component
{
public override string Name => "ParticleProjectile";
private ParticleAcceleratorPowerState _state;
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
{
if (otherFixture.Body.Owner.TryGetComponent<SingularityGeneratorComponent>(out var singularityGeneratorComponent))
{
singularityGeneratorComponent.Power += _state switch
{
ParticleAcceleratorPowerState.Standby => 0,
ParticleAcceleratorPowerState.Level0 => 1,
ParticleAcceleratorPowerState.Level1 => 2,
ParticleAcceleratorPowerState.Level2 => 4,
ParticleAcceleratorPowerState.Level3 => 8,
_ => 0
};
Owner.Delete();
}
}
public ParticleAcceleratorPowerState State;
public void Fire(ParticleAcceleratorPowerState state, Angle angle, IEntity firer)
{
_state = state;
State = state;
if (!Owner.TryGetComponent<PhysicsComponent>(out var physicsComponent))
{
@@ -56,7 +40,7 @@ namespace Content.Server.ParticleAccelerator.Components
Logger.Error("ParticleProjectile tried firing, but it was spawned without a SinguloFoodComponent");
return;
}
var multiplier = _state switch
var multiplier = State switch
{
ParticleAcceleratorPowerState.Standby => 0,
ParticleAcceleratorPowerState.Level0 => 1,