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