Gun auto state handlers (#15186)
* battery auto state * basic entity autostate * ballistic autostate * flyby * cartridge ammo * gun * Revert "battery auto state" This reverts commit 35b7d62f303fddb0edd9eb7a922e3c26b7a5f7fb. * silly
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
@@ -8,8 +9,8 @@ namespace Content.Shared.Weapons.Ranged.Components;
|
||||
/// Simply provides a certain capacity of entities that cannot be reloaded through normal means and have
|
||||
/// no special behavior like cycling, magazine
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class BasicEntityAmmoProviderComponent : AmmoProviderComponent
|
||||
[RegisterComponent, AutoGenerateComponentState]
|
||||
public sealed partial class BasicEntityAmmoProviderComponent : AmmoProviderComponent
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
@@ -20,6 +21,7 @@ public sealed class BasicEntityAmmoProviderComponent : AmmoProviderComponent
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("capacity")]
|
||||
[AutoNetworkedField]
|
||||
public int? Capacity = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -27,18 +29,6 @@ public sealed class BasicEntityAmmoProviderComponent : AmmoProviderComponent
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("count")]
|
||||
[AutoNetworkedField]
|
||||
public int? Count = null;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BasicEntityAmmoProviderComponentState : ComponentState
|
||||
{
|
||||
public int? Capacity;
|
||||
public int? Count;
|
||||
|
||||
public BasicEntityAmmoProviderComponentState(int? capacity, int? count)
|
||||
{
|
||||
Capacity = capacity;
|
||||
Count = count;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user