using Content.Server.Explosion.EntitySystems;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
namespace Content.Server.Explosion.Components
{
[RegisterComponent, Access(typeof(ClusterGrenadeSystem))]
public sealed partial class ClusterGrenadeComponent : Component
{
public Container GrenadesContainer = default!;
///
/// What we fill our prototype with if we want to pre-spawn with grenades.
///
[DataField("fillPrototype")]
public EntProtoId? FillPrototype;
///
/// If we have a pre-fill how many more can we spawn.
///
public int UnspawnedCount;
///
/// Maximum grenades in the container.
///
[DataField("maxGrenadesCount")]
public int MaxGrenades = 3;
///
/// Maximum delay in seconds between individual grenade triggers
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("grenadeTriggerIntervalMax")]
public float GrenadeTriggerIntervalMax = 0f;
///
/// Minimum delay in seconds between individual grenade triggers
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("grenadeTriggerIntervalMin")]
public float GrenadeTriggerIntervalMin = 0f;
///
/// Minimum delay in seconds before any grenades start to be triggered.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("baseTriggerDelay")]
public float BaseTriggerDelay = 1.0f;
///
/// Decides if grenades trigger after getting launched
///
[DataField("triggerGrenades")]
public bool TriggerGrenades = true;
///
/// Does the cluster grenade shoot or throw
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("grenadeType")]
public Enum GrenadeType = Components.GrenadeType.Throw;
///
/// The speed at which grenades get thrown
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("velocity")]
public float Velocity = 5;
///
/// Should the spread be random
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("randomSpread")]
public bool RandomSpread = false;
///
/// Should the angle be random
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("randomAngle")]
public bool RandomAngle = false;
///
/// Static distance grenades will be thrown to.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("distance")]
public float Distance = 1f;
///
/// Max distance grenades should randomly be thrown to.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxSpreadDistance")]
public float MaxSpreadDistance = 2.5f;
///
/// Minimal distance grenades should randomly be thrown to.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("minSpreadDistance")]
public float MinSpreadDistance = 0f;
///
/// This is the end.
///
public bool CountDown;
}
public enum GrenadeType
{
Throw,
Shoot
}
}