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:
Kara
2023-04-13 20:08:56 -05:00
committed by GitHub
parent ccf81a6be9
commit 47262a6998
10 changed files with 31 additions and 173 deletions

View File

@@ -11,23 +11,6 @@ public abstract partial class SharedGunSystem
SubscribeLocalEvent<BasicEntityAmmoProviderComponent, ComponentInit>(OnBasicEntityInit);
SubscribeLocalEvent<BasicEntityAmmoProviderComponent, TakeAmmoEvent>(OnBasicEntityTakeAmmo);
SubscribeLocalEvent<BasicEntityAmmoProviderComponent, GetAmmoCountEvent>(OnBasicEntityAmmoCount);
SubscribeLocalEvent<BasicEntityAmmoProviderComponent, ComponentGetState>(OnBasicEntityGetState);
SubscribeLocalEvent<BasicEntityAmmoProviderComponent, ComponentHandleState>(OnBasicEntityHandleState);
}
private void OnBasicEntityGetState(EntityUid uid, BasicEntityAmmoProviderComponent component, ref ComponentGetState args)
{
args.State = new BasicEntityAmmoProviderComponentState(component.Capacity, component.Count);
}
private void OnBasicEntityHandleState(EntityUid uid, BasicEntityAmmoProviderComponent component, ref ComponentHandleState args)
{
if (args.Current is BasicEntityAmmoProviderComponentState state)
{
component.Capacity = state.Capacity;
component.Count = state.Count;
}
}
private void OnBasicEntityInit(EntityUid uid, BasicEntityAmmoProviderComponent component, ComponentInit args)