Make flare gun explode, damage and stun the player when used with the wrong ammo (#22349)

* Flare gun can now only be loaded with actual flares

* Make flare gun loadable with other shells, but destroy it and damage and stun the user when used

* tweak

* Logic fix + QOL add-ons

* damageOnWrongAmmo in gun component

* cleanup
This commit is contained in:
MendaxxDev
2023-12-15 10:57:59 +01:00
committed by GitHub
parent 353ab95446
commit e301378114
7 changed files with 52 additions and 2 deletions

View File

@@ -1,7 +1,11 @@
using Content.Shared.Damage;
using Content.Shared.Tag;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Weapons.Ranged.Components;
@@ -110,6 +114,18 @@ public partial class GunComponent : Component
[ViewVariables(VVAccess.ReadWrite), DataField("resetOnHandSelected")]
public bool ResetOnHandSelected = true;
/// <summary>
/// Type of ammo the gun can work with
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("compatibleAmmo")]
public List<ProtoId<TagPrototype>>? CompatibleAmmo;
/// <summary>
/// Damage the gun deals when used with wrong ammo
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("damageOnWrongAmmo")]
public DamageSpecifier? DamageOnWrongAmmo = null;
/// <summary>
/// How fast the projectile moves.
/// </summary>