Shooting NPCs and more (#18042)
* Add pirate shooting * Shooting working * Basics working * Refactor time * More conversion * Update primitives * Update yml * weh * Building again * Draft * weh * b * Start shutdown * Starting to take form * Code side done * is it worky * Fix prototypes * stuff * Shitty working * Juke events working * Even more cleanup * RTX * Fix interaction combat mode and compquery * GetAmmoCount relays * Fix rotation speed * Juke fixes * fixes * weh * The collision avoidance never ends * Fixes * Pause support * framework * lazy * Fix idling * Fix drip * goobed * Fix takeover shutdown bug * Merge fixes * shitter * Fix carpos
This commit is contained in:
@@ -15,6 +15,7 @@ public abstract partial class SharedGunSystem
|
||||
protected virtual void InitializeChamberMagazine()
|
||||
{
|
||||
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, TakeAmmoEvent>(OnChamberMagazineTakeAmmo);
|
||||
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, GetAmmoCountEvent>(OnChamberAmmoCount);
|
||||
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, GetVerbsEvent<AlternativeVerb>>(OnMagazineVerb);
|
||||
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, EntInsertedIntoContainerMessage>(OnMagazineSlotChange);
|
||||
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, EntRemovedFromContainerMessage>(OnMagazineSlotChange);
|
||||
@@ -73,6 +74,18 @@ public abstract partial class SharedGunSystem
|
||||
slot.Insert(ammo);
|
||||
}
|
||||
|
||||
private void OnChamberAmmoCount(EntityUid uid, ChamberMagazineAmmoProviderComponent component, ref GetAmmoCountEvent args)
|
||||
{
|
||||
OnMagazineAmmoCount(uid, component, ref args);
|
||||
args.Capacity += 1;
|
||||
var chambered = GetChamberEntity(uid);
|
||||
|
||||
if (chambered != null)
|
||||
{
|
||||
args.Count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnChamberMagazineTakeAmmo(EntityUid uid, ChamberMagazineAmmoProviderComponent component, TakeAmmoEvent args)
|
||||
{
|
||||
// So chamber logic is kinda sussier than the others
|
||||
|
||||
Reference in New Issue
Block a user