* Initial commit * Removed mention of StationAiTurretComponent (for now) * Prep for moving out of draft * Fixing merge conflict * Re-added new net frequencies to AI turrets * Removed turret control content * Removed unintended change * Final tweaks * Fixed incorrect file name * Improvement to fire mode handling * Addressed review comments * Updated how turret wire panel auto-closing is handled * Ranged NPCs no longer waste shots on stunned targets * Fixed bug in tracking broken state * Addressed review comments * Bug fix * Removed unnecessary event call
52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using Content.Shared.Weapons.Ranged.Systems;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Weapons.Ranged.Components;
|
|
|
|
/// <summary>
|
|
/// Allows battery weapons to fire different types of projectiles
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent]
|
|
[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(required: true)]
|
|
[AutoNetworkedField]
|
|
public List<BatteryWeaponFireMode> FireModes = new();
|
|
|
|
/// <summary>
|
|
/// The currently selected firing mode
|
|
/// </summary>
|
|
[DataField]
|
|
[AutoNetworkedField]
|
|
public int CurrentFireMode;
|
|
}
|
|
|
|
[DataDefinition, Serializable, NetSerializable]
|
|
public sealed partial class BatteryWeaponFireMode
|
|
{
|
|
/// <summary>
|
|
/// The projectile prototype associated with this firing mode
|
|
/// </summary>
|
|
[DataField("proto", required: true)]
|
|
public EntProtoId Prototype = default!;
|
|
|
|
/// <summary>
|
|
/// The battery cost to fire the projectile associated with this firing mode
|
|
/// </summary>
|
|
[DataField]
|
|
public float FireCost = 100;
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum BatteryWeaponFireModeVisuals : byte
|
|
{
|
|
State
|
|
}
|