CatStation/Content.Shared/Clumsy/Components/ClumsyGunStatusEffectComponent.cs
āda 9fd1abcff6
Clumsy status effect + tests (#45262)
* component outline

* System port

* super bonk detour

* working good!

* relay changes

* the death of clumsy

* why it stop working??

* now to test it

* tested it

* Actual genuine tests

* final checks

* buff up catch test

* annoying test fail

* refactor: minor whitespace and var rename changes

* refactor: changed comments on top of methods to xml-doc for ClumsyStatusEffectSystem

---------

Co-authored-by: iaada <iaada@users.noreply.github.com>
Co-authored-by: Fildrance <fildrance@gmail.com>
2026-08-11 10:19:19 +00:00

57 lines
1.7 KiB
C#

using Content.Shared.Damage;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Clumsy.Components;
/// <summary>
/// Afflicted entity will occasionally fail to fire a gun.
/// </summary>
/// <seealso cref="GunComponent"/>
[RegisterComponent, NetworkedComponent]
[Access(typeof(ClumsyStatusEffectSystem))]
public sealed partial class ClumsyGunStatusEffectComponent : Component
{
/// <summary>
/// How often to fail.
/// </summary>
[DataField]
public float ClumsyChance = 0.5f;
/// <summary>
/// Sound played upon failure.
/// </summary>
[DataField]
public SoundSpecifier? ClumsySound = new SoundPathSpecifier("/Audio/Items/bikehorn.ogg");
/// <summary>
/// Noise to play after failing to shoot a gun. Boom!
/// </summary>
/// <remarks>This should probably be on the gun itself, but that's a tall order.</remarks>
[DataField]
public SoundSpecifier? GunShootFailSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/bang.ogg");
/// <summary>
/// How much damage to take after failing.
/// </summary>
[DataField]
public DamageSpecifier? FailDamage;
/// <summary>
/// How long to be stunned after failing.
/// </summary>
[DataField]
public TimeSpan StunDuration = TimeSpan.FromSeconds(2.5);
/// <summary>
/// Popup played to the afflicted when they fail.
/// </summary>
/// <value> Parameters passed in:
/// <list type="bullet">
/// <item><c>gun</c> - The gun the blows up.</item>
/// </list>
/// </value>
[DataField]
public LocId? FailedMessage = "clumsy-gun-fail-message";
}