2023-05-10 10:01:23 +10:00
|
|
|
using Robust.Shared.Audio;
|
|
|
|
|
using Robust.Shared.GameStates;
|
2023-09-22 02:45:21 -07:00
|
|
|
using Robust.Shared.Serialization;
|
2023-05-10 10:01:23 +10:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2024-04-26 22:31:50 +10:00
|
|
|
/// <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;
|
|
|
|
|
|
2023-05-10 10:01:23 +10:00
|
|
|
[DataField("wieldedInhandPrefix")]
|
2023-06-01 12:27:19 +10:00
|
|
|
public string? WieldedInhandPrefix = "wielded";
|
2023-05-10 10:01:23 +10:00
|
|
|
|
|
|
|
|
public string? OldInhandPrefix = null;
|
|
|
|
|
}
|
2023-09-22 02:45:21 -07:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum WieldableVisuals : byte
|
|
|
|
|
{
|
|
|
|
|
Wielded
|
|
|
|
|
}
|