Gun refactor (#8301)
Co-authored-by: Kara <lunarautomaton6@gmail.com> Co-authored-by: T-Stalker <le0nel_1van@hotmail.com> Co-authored-by: T-Stalker <43253663+DogZeroX@users.noreply.github.com> Co-authored-by: ElectroJr <leonsfriedrich@gmail.com> Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
9
Content.Shared/Weapons/Ranged/Events/AmmoShotEvent.cs
Normal file
9
Content.Shared/Weapons/Ranged/Events/AmmoShotEvent.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on a gun when projectiles have been fired from it.
|
||||
/// </summary>
|
||||
public sealed class AmmoShotEvent : EntityEventArgs
|
||||
{
|
||||
public List<EntityUid> FiredProjectiles = default!;
|
||||
}
|
||||
11
Content.Shared/Weapons/Ranged/Events/GetAmmoCountEvent.cs
Normal file
11
Content.Shared/Weapons/Ranged/Events/GetAmmoCountEvent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on an AmmoProvider to request deets.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public struct GetAmmoCountEvent
|
||||
{
|
||||
public int Count;
|
||||
public int Capacity;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// This is sent if the MagazineBarrel AutoEjects the magazine
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class MagazineAutoEjectEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid Uid;
|
||||
}
|
||||
}
|
||||
14
Content.Shared/Weapons/Ranged/Events/RequestShootEvent.cs
Normal file
14
Content.Shared/Weapons/Ranged/Events/RequestShootEvent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on the client to indicate it'd like to shoot.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class RequestShootEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid Gun;
|
||||
public EntityCoordinates Coordinates;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on the client to request it would like to stop hooting.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class RequestStopShootEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid Gun;
|
||||
}
|
||||
26
Content.Shared/Weapons/Ranged/Events/TakeAmmoEvent.cs
Normal file
26
Content.Shared/Weapons/Ranged/Events/TakeAmmoEvent.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on a gun when it would like to take the specified amount of ammo.
|
||||
/// </summary>
|
||||
public sealed class TakeAmmoEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid? User;
|
||||
public readonly int Shots;
|
||||
public List<IShootable> Ammo;
|
||||
|
||||
/// <summary>
|
||||
/// Coordinates to spawn the ammo at.
|
||||
/// </summary>
|
||||
public EntityCoordinates Coordinates;
|
||||
|
||||
public TakeAmmoEvent(int shots, List<IShootable> ammo, EntityCoordinates coordinates, EntityUid? user)
|
||||
{
|
||||
Shots = shots;
|
||||
Ammo = ammo;
|
||||
Coordinates = coordinates;
|
||||
User = user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user