Files
tbd-station-14/Content.Shared/Wieldable/Components/WieldableComponent.cs
WarMechanic 498109a833 fix wieldable guns not being able to cycle inhand (#27307)
* Add UnwieldOverride variable that overrides unwielding inhand to enable other interactions

* Give LMGs UnwieldOverride

* logically inverted UnwieldOverride to UnwieldOnUse

* fixed typo
2024-04-26 08:31:50 -04:00

47 lines
1.3 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Wieldable.Components;
/// <summary>
/// Used for objects that can be wielded in two or more hands,
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(WieldableSystem)), AutoGenerateComponentState]
public sealed partial class WieldableComponent : Component
{
[DataField("wieldSound")]
public SoundSpecifier? WieldSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
[DataField("unwieldSound")]
public SoundSpecifier? UnwieldSound;
/// <summary>
/// Number of free hands required (excluding the item itself) required
/// to wield it
/// </summary>
[DataField("freeHandsRequired")]
public int FreeHandsRequired = 1;
[AutoNetworkedField, DataField("wielded")]
public bool Wielded = false;
/// <summary>
/// Whether using the item inhand while wielding causes the item to unwield.
/// Unwielding can conflict with other inhand actions.
/// </summary>
[DataField]
public bool UnwieldOnUse = true;
[DataField("wieldedInhandPrefix")]
public string? WieldedInhandPrefix = "wielded";
public string? OldInhandPrefix = null;
}
[Serializable, NetSerializable]
public enum WieldableVisuals : byte
{
Wielded
}