Files
tbd-station-14/Content.Shared/Weapons/Ranged/Components/AmmoComponent.cs
metalgearsloth 9f4aa1ebe0 Implement some field-level deltas (#28242)
* Update GasTileOverlayState

* Update DecalGridState

* Update NavMapState

* poke

* poke2

* poke3

* Implement field deltas for guns

* Content done

* Update

---------

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2024-12-21 15:54:11 +11:00

42 lines
1.2 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Weapons.Ranged.Components;
/// <summary>
/// Allows the entity to be fired from a gun.
/// </summary>
[RegisterComponent, Virtual]
public partial class AmmoComponent : Component, IShootable
{
// Muzzle flash stored on ammo because if we swap a gun to whatever we may want to override it.
[DataField]
public EntProtoId? MuzzleFlash = "MuzzleFlashEffect";
}
/// <summary>
/// Spawns another prototype to be shot instead of itself.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true)]
public sealed partial class CartridgeAmmoComponent : AmmoComponent
{
[ViewVariables(VVAccess.ReadWrite), DataField("proto", required: true)]
public EntProtoId Prototype;
[ViewVariables(VVAccess.ReadWrite), DataField]
[AutoNetworkedField]
public bool Spent;
/// <summary>
/// Caseless ammunition.
/// </summary>
[DataField]
public bool DeleteOnSpawn;
[DataField("soundEject")]
public SoundSpecifier? EjectSound = new SoundCollectionSpecifier("CasingEject");
}