[ViewVariables(VVAccess.ReadWrite)]
[DataField("soundNoDamage"), AutoNetworkedField]
public SoundSpecifier NoDamageSound { get; set; } = new SoundCollectionSpecifier("WeakHit");
+
+ /// <summary>
+ /// If true, the weapon must be equipped for it to be used.
+ /// E.g boxing gloves must be equipped to your gloves,
+ /// not just held in your hand to be used.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public bool MustBeEquippedToUse = false;
}
/// <summary>
if (EntityManager.TryGetComponent(entity, out HandsComponent? hands) &&
hands.ActiveHandEntity is { } held)
{
- if (EntityManager.TryGetComponent(held, out melee))
+ // Make sure the entity is a weapon AND it doesn't need
+ // to be equipped to be used (E.g boxing gloves).
+ if (EntityManager.TryGetComponent(held, out melee) &&
+ !melee.MustBeEquippedToUse)
{
weaponUid = held;
return true;
soundHit:
collection: BoxingHit
animation: WeaponArcFist
+ mustBeEquippedToUse: true
- type: Fiber
fiberMaterial: fibers-leather
fiberColor: fibers-red
types:
Blunt: 8
bluntStaminaDamageFactor: 0.0 # so blunt doesn't deal stamina damage at all
+ mustBeEquippedToUse: true
- type: entity
parent: ClothingHandsBase
soundHit:
collection: Punch
animation: WeaponArcFist
+ mustBeEquippedToUse: true
- type: Fiber
fiberMaterial: fibers-leather
fiberColor: fibers-blue