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:
metalgearsloth
2022-06-01 19:59:58 +10:00
committed by GitHub
parent 1ced3c5002
commit fb943a61dc
1051 changed files with 8230 additions and 99090 deletions

View 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!;
}

View 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;
}

View File

@@ -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;
}
}

View 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;
}

View File

@@ -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;
}

View 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;
}
}