CatStation/Content.Shared/Weapons/Misc/BaseForceGunComponent.cs
Stanislav b22d38f9c0
Yaml audio params are often ignored (#36259)
* Replace WithVolume() with AddVolume(),
Remove AudioHelpers.WithVariation(),
Use specifier options for audio params

* Undo switching to AudioParams.AddVariation()

* Replace AudioHelpers.WithVariation with AudioParams.AddVariation()

* Test AudioParams.AddVariation() and change input parameters to sound like previous AudioHelpers.WithVariation()

* Fix build error

* Fix build error v2

* Remove DoAfter

* fixes

---------

Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
2026-07-25 16:16:23 +00:00

56 lines
1.9 KiB
C#

using Robust.Shared.Audio;
namespace Content.Shared.Weapons.Misc;
public abstract partial class BaseForceGunComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("lineColor"), AutoNetworkedField]
public Color LineColor = Color.Orange;
/// <summary>
/// The entity the tethered target has a joint to.
/// </summary>
[DataField("tetherEntity"), AutoNetworkedField]
public virtual EntityUid? TetherEntity { get; set; }
/// <summary>
/// The entity currently tethered.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("tethered"), AutoNetworkedField]
public virtual EntityUid? Tethered { get; set; }
/// <summary>
/// Can the tethergun unanchor entities.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("canUnanchor"), AutoNetworkedField]
public bool CanUnanchor = false;
[ViewVariables(VVAccess.ReadWrite), DataField("canTetherAlive"), AutoNetworkedField]
public bool CanTetherAlive = false;
/// <summary>
/// Max force between the tether entity and the tethered target.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("maxForce"), AutoNetworkedField]
public float MaxForce = 200f;
[ViewVariables(VVAccess.ReadWrite), DataField("frequency"), AutoNetworkedField]
public float Frequency = 10f;
[ViewVariables(VVAccess.ReadWrite), DataField("dampingRatio"), AutoNetworkedField]
public float DampingRatio = 2f;
/// <summary>
/// Maximum amount of mass a tethered entity can have.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("massLimit"), AutoNetworkedField]
public float MassLimit = 100f;
[ViewVariables(VVAccess.ReadWrite), DataField("sound"), AutoNetworkedField]
public SoundSpecifier? Sound = new SoundPathSpecifier("/Audio/Weapons/weoweo.ogg")
{
Params = AudioParams.Default.WithLoop(true).AddVolume(-8f),
};
public EntityUid? Stream;
}