Files
tbd-station-14/Content.Server/GameObjects/Components/Projectiles/ExplosiveProjectileComponent.cs
Pieter-Jan Briers 1eb0fbd8d0 Revert "Physics (#3452)"
This reverts commit 3e64fd56a1.
2021-02-28 18:49:48 +01:00

33 lines
850 B
C#

using Content.Server.GameObjects.Components.Explosion;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Projectiles
{
[RegisterComponent]
public class ExplosiveProjectileComponent : Component, ICollideBehavior
{
public override string Name => "ExplosiveProjectile";
public override void Initialize()
{
base.Initialize();
Owner.EnsureComponent<ExplosiveComponent>();
}
void ICollideBehavior.CollideWith(IEntity entity)
{
if (Owner.TryGetComponent(out ExplosiveComponent explosive))
{
explosive.Explosion();
}
}
// Projectile should handle the deleting
void ICollideBehavior.PostCollide(int collisionCount)
{
return;
}
}
}