# Conflicts: # .github/workflows/build-test-debug.yml # Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.Server/StoreDiscount/Systems/StoreDiscountSystem.cs # Content.Server/Zombies/ZombieSystem.cs # Content.Shared/Nutrition/EntitySystems/HungerSystem.cs # Resources/Locale/en-US/_strings/atmos/gases.ftl # Resources/Locale/en-US/_strings/components/atmos-monitoring-component.ftl # Resources/Locale/en-US/_strings/tools/components/tool-component.ftl # Resources/Prototypes/Entities/Mobs/Player/silicon.yml # Resources/Prototypes/Research/industrial.yml # Resources/Prototypes/Voice/speech_emotes.yml # Resources/Prototypes/ai_factions.yml # Resources/toolshedEngineCommandPerms.yml
58 lines
1.8 KiB
C#
58 lines
1.8 KiB
C#
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Shared.Weapons.Ranged.Components;
|
|
|
|
/// <summary>
|
|
/// Allows the entity to be fired from a gun.
|
|
/// </summary>
|
|
[RegisterComponent, Virtual]
|
|
public partial class AmmoComponent : Component, IShootable
|
|
{
|
|
// Muzzle flash stored on ammo because if we swap a gun to whatever we may want to override it.
|
|
|
|
[DataField]
|
|
public EntProtoId? MuzzleFlash = "MuzzleFlashEffect";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Spawns another prototype to be shot instead of itself.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true)]
|
|
public sealed partial class CartridgeAmmoComponent : AmmoComponent
|
|
{
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("proto", required: true)]
|
|
public EntProtoId Prototype;
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField]
|
|
[AutoNetworkedField]
|
|
public bool Spent;
|
|
|
|
/// <summary>
|
|
/// Caseless ammunition.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool DeleteOnSpawn;
|
|
|
|
[DataField("soundEject")]
|
|
public SoundSpecifier? EjectSound = new SoundCollectionSpecifier("CasingEject");
|
|
}
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class HitScanCartridgeAmmoComponent : AmmoComponent
|
|
{
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("proto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<HitscanPrototype>))]
|
|
public string Prototype = default!;
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("spent")]
|
|
[AutoNetworkedField]
|
|
public bool Spent = false;
|
|
|
|
[DataField("deleteOnSpawn")]
|
|
public bool DeleteOnSpawn;
|
|
|
|
[DataField("soundEject")]
|
|
public SoundSpecifier? EjectSound = new SoundCollectionSpecifier("CasingEject");
|
|
}
|