Files
tbd-station-14/Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs
TaralGit 8acac895fc (Re)Adds open bolt animations for gun sprites (#17219)
Co-authored-by: and_a <and_a@DESKTOP-RJENGIR>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-08-13 15:58:07 +10:00

57 lines
2.1 KiB
C#

using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Weapons.Ranged.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class BallisticAmmoProviderComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("soundRack")]
public SoundSpecifier? SoundRack = new SoundPathSpecifier("/Audio/Weapons/Guns/Cock/smg_cock.ogg");
[ViewVariables(VVAccess.ReadWrite), DataField("soundInsert")]
public SoundSpecifier? SoundInsert = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/bullet_insert.ogg");
[ViewVariables(VVAccess.ReadWrite), DataField("proto", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? FillProto;
[ViewVariables(VVAccess.ReadWrite), DataField("capacity")]
public int Capacity = 30;
public int Count => UnspawnedCount + Container.ContainedEntities.Count;
[ViewVariables(VVAccess.ReadWrite), DataField("unspawnedCount")]
[AutoNetworkedField]
public int UnspawnedCount;
[ViewVariables(VVAccess.ReadWrite), DataField("whitelist")]
public EntityWhitelist? Whitelist;
public Container Container = default!;
// TODO: Make this use stacks when the typeserializer is done.
[DataField("entities")]
[AutoNetworkedField(true)]
public List<EntityUid> Entities = new();
/// <summary>
/// Is the magazine allowed to be manually cycled to eject a cartridge.
/// </summary>
/// <remarks>
/// Set to false for entities like turrets to avoid users being able to cycle them.
/// </remarks>
[ViewVariables(VVAccess.ReadWrite), DataField("cycleable")]
[AutoNetworkedField]
public bool Cycleable = true;
/// <summary>
/// Is it okay for this entity to directly transfer its valid ammunition into another provider?
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("mayTransfer")]
public bool MayTransfer = false;
}