diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs index f87d473783..e6f1932905 100644 --- a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs +++ b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs @@ -8,13 +8,16 @@ namespace Exiled.CustomItems.API.Features { using System; + using System.Collections.Generic; using System.ComponentModel; using Exiled.API.Extensions; using Exiled.API.Features; using Exiled.API.Features.Items; + using Exiled.API.Structs; using Exiled.Events.EventArgs.Player; + using InventorySystem.Items.Armor; using MEC; /// @@ -55,6 +58,16 @@ public override ItemType Type [Description("The value must be above 0 and below 100")] public virtual int VestEfficacy { get; set; } = 80; + /// + /// Gets or sets the Ammunition limit the player have. + /// + public virtual List AmmoLimits { get; set; } = new(); + + /// + /// Gets or sets the Item Category limit the player have. + /// + public virtual List CategoryLimits { get; set; } = new(); + /// public override void Give(Player player, bool displayMessage = true) { @@ -66,6 +79,12 @@ public override void Give(Player player, bool displayMessage = true) armor.VestEfficacy = VestEfficacy; armor.HelmetEfficacy = HelmetEfficacy; + if (AmmoLimits.Count != 0) + armor.AmmoLimits = AmmoLimits; + + if (AmmoLimits.Count != 0) + armor.CategoryLimits = CategoryLimits; + player.AddItem(armor); TrackedSerials.Add(armor.Serial); diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs index e775ee3e9f..68fe0103e7 100644 --- a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs +++ b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs @@ -52,7 +52,7 @@ public override ItemType Type /// /// Gets or sets the weapon damage. /// - public abstract float Damage { get; set; } + public virtual float Damage { get; set; } = float.NaN; /// /// Gets or sets a value indicating how big of a clip the weapon will have. @@ -205,7 +205,7 @@ protected virtual void OnShot(ShotEventArgs ev) /// . protected virtual void OnHurting(HurtingEventArgs ev) { - if (ev.IsAllowed && Damage > 0f) + if (ev.IsAllowed && Damage != float.NaN) ev.Amount = Damage; }