Files
Delta-v/Content.Server/_DV/Weapons/Ranged/Components/EnergyGunComponent.cs
T
BarryNorfolk bf8cce52a1 Remove warnings in Content.Server for _DV content (#5114)
* Cleanup datafields with matching autogenerated tag [RA0027]

* Remove unused dependencies [CS0414]

* Swap to AddMarkupOrThrow over PushMarkup [CS0618]

* Fix namespacing [CA1050]

* Prefer the generic overload [CA2263]

* Fix exception throwing [CA2208]

* Mark RoundStartCaptain as static [CA1822]

* Don't use string literal [RA0033]

* Remove un-needed null check [CS8073]

* Explicitly set webhookData to null [CS0649]

* Use protoId over bare string

* Prefer HasComp over TryComp with no usage of the actual comp
2026-01-06 10:31:51 -06:00

58 lines
1.8 KiB
C#

using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Server._DV.Weapons.Ranged.Systems;
namespace Content.Server._DV.Weapons.Ranged.Components;
/// <summary>
/// Allows for energy gun to switch between three modes. This also changes the sprite accordingly.
/// </summary>
/// <remarks>This is BatteryWeaponFireModesSystem with additional changes to allow for different sprites.</remarks>
[RegisterComponent]
[Access(typeof(EnergyGunSystem))]
[AutoGenerateComponentState]
public sealed partial class EnergyGunComponent : Component
{
/// <summary>
/// A list of the different firing modes the energy gun can switch between
/// </summary>
[DataField(required: true)]
[AutoNetworkedField]
public List<EnergyWeaponFireMode> FireModes = new();
/// <summary>
/// The currently selected firing mode
/// </summary>
[DataField]
[AutoNetworkedField]
public EnergyWeaponFireMode? CurrentFireMode = default!;
}
[DataDefinition]
public sealed partial class EnergyWeaponFireMode
{
/// <summary>
/// The projectile prototype associated with this firing mode
/// </summary>
[DataField("proto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Prototype = default!;
/// <summary>
/// The battery cost to fire the projectile associated with this firing mode
/// </summary>
[DataField]
public float FireCost = 100;
/// <summary>
/// The name of the selected firemode
/// </summary>
[DataField]
public string Name = string.Empty;
/// <summary>
/// What RsiState we use for that firemode if it needs to change.
/// </summary>
[DataField]
public string State = string.Empty;
}