using Content.Shared.Tools;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.PneumaticCannon;
///
/// Handles gas powered guns--cancels shooting if no gas is available, and takes gas from the given container slot.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class PneumaticCannonComponent : Component
{
public const string TankSlotId = "gas_tank";
[ViewVariables(VVAccess.ReadWrite)]
public PneumaticCannonPower Power = PneumaticCannonPower.Medium;
[DataField("toolModifyPower", customTypeSerializer:typeof(PrototypeIdSerializer))]
public string ToolModifyPower = "Anchoring";
///
/// How long to stun for if they shoot the pneumatic cannon at high power.
///
[DataField("highPowerStunTime")]
[ViewVariables(VVAccess.ReadWrite)]
public float HighPowerStunTime = 3.0f;
///
/// Amount of moles to consume for each shot at any power.
///
[DataField("gasUsage")]
[ViewVariables(VVAccess.ReadWrite)]
public float GasUsage = 0.142f;
///
/// Base projectile speed at default power.
///
[DataField("baseProjectileSpeed")]
public float BaseProjectileSpeed = 20f;
///
/// The current projectile speed setting.
///
[DataField]
public float? ProjectileSpeed;
///
/// If true, will throw ammo rather than shoot it.
///
[DataField("throwItems"), ViewVariables(VVAccess.ReadWrite)]
public bool ThrowItems = true;
}
///
/// How strong the pneumatic cannon should be.
/// Each tier throws items farther and with more speed, but has drawbacks.
/// The highest power knocks the player down for a considerable amount of time.
///
public enum PneumaticCannonPower : byte
{
Low = 0,
Medium = 1,
High = 2,
Len = 3 // used for length calc
}