Files
Delta-v/Content.Shared/Armor/ArmorComponent.cs
T
Sir WarockandJanet Blackquill 3b61986802 Nerf Web Vest Melee Stamina Resistance (#5627)
* Nerf Web Vest Melee Stamina Resistance

* no need to network

---------

Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2026-05-12 02:59:54 +00:00

71 lines
2.2 KiB
C#

using Content.Shared.Damage;
using Content.Shared.Inventory;
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
namespace Content.Shared.Armor;
/// <summary>
/// Used for clothing that reduces damage when worn.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedArmorSystem))]
public sealed partial class ArmorComponent : Component
{
/// <summary>
/// The damage reduction
/// </summary>
[DataField(required: true)]
public DamageModifierSet Modifiers = default!;
/// <summary>
/// A multiplier applied to the calculated point value
/// to determine the monetary value of the armor
/// </summary>
[DataField]
public float PriceMultiplier = 1;
/// <summary>
/// If true, you can examine the armor to see the protection. If false, the verb won't appear.
/// </summary>
[DataField]
public bool ShowArmorOnExamine = true;
// Start DeltaV - Give armor melee stamina resistance
/// <summary>
/// DeltaV - Gets the effective stamina melee damage coefficient, based on the armor's blunt protection.
/// </summary>
[DataField("staminaMeleeDamageCoefficient")]
private float? _staminaMeleeDamageCoefficient;
public float StaminaMeleeDamageCoefficient => _staminaMeleeDamageCoefficient ?? Modifiers.Coefficients.GetValueOrDefault("Blunt", 1.0f);
// End DeltaV - Give armor melee stamina resistance
}
/// <summary>
/// Event raised on an armor entity to get additional examine text relating to its armor.
/// </summary>
/// <param name="Msg"></param>
[ByRefEvent]
public record struct ArmorExamineEvent(FormattedMessage Msg);
/// <summary>
/// A Relayed inventory event, gets the total Armor for all Inventory slots defined by the Slotflags in TargetSlots
/// </summary>
public sealed class CoefficientQueryEvent : EntityEventArgs, IInventoryRelayEvent
{
/// <summary>
/// All slots to relay to
/// </summary>
public SlotFlags TargetSlots { get; set; }
/// <summary>
/// The Total of all Coefficients.
/// </summary>
public DamageModifierSet DamageModifiers { get; set; } = new DamageModifierSet();
public CoefficientQueryEvent(SlotFlags slots)
{
TargetSlots = slots;
}
}