45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
using Content.Server.Weapons.Ranged.Systems;
|
|
|
|
namespace Content.Server.Weapons.Ranged.Components;
|
|
|
|
/// <summary>
|
|
/// Allows battery weapons to fire different types of projectiles
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
[Access(typeof(BatteryWeaponFireModesSystem))]
|
|
[AutoGenerateComponentState]
|
|
public sealed partial class BatteryWeaponFireModesComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// A list of the different firing modes the weapon can switch between
|
|
/// </summary>
|
|
[DataField("fireModes", required: true)]
|
|
[AutoNetworkedField]
|
|
public List<BatteryWeaponFireMode> FireModes = new();
|
|
|
|
/// <summary>
|
|
/// The currently selected firing mode
|
|
/// </summary>
|
|
[DataField("currentFireMode")]
|
|
[AutoNetworkedField]
|
|
public BatteryWeaponFireMode? CurrentFireMode = default!;
|
|
}
|
|
|
|
[DataDefinition]
|
|
public sealed partial class BatteryWeaponFireMode
|
|
{
|
|
/// <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("fireCost")]
|
|
public float FireCost = 100;
|
|
}
|