feat: Adds IAosItem for items with AosAttributes (#1268)

This commit is contained in:
Kamron Batman 2022-11-23 10:49:30 -08:00 • committed by GitHub
parent 02cee4815e
commit df9a58dd49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 7 deletions

View file

@ -12,7 +12,7 @@ using AMT = Server.Items.ArmorMaterialType;
namespace Server.Items namespace Server.Items
{ {
[SerializationGenerator(9, false)] [SerializationGenerator(9, false)]
public abstract partial class BaseArmor : Item, IScissorable, IFactionItem, ICraftable, IWearableDurability public abstract partial class BaseArmor : Item, IScissorable, IFactionItem, ICraftable, IWearableDurability, IAosItem
{ {
[SerializableField(0, setter: "private")] [SerializableField(0, setter: "private")]
[SerializedCommandProperty(AccessLevel.GameMaster, canModify: true)] [SerializedCommandProperty(AccessLevel.GameMaster, canModify: true)]

View file

@ -24,7 +24,8 @@ namespace Server.Items
} }
[SerializationGenerator(7, false)] [SerializationGenerator(7, false)]
public abstract partial class BaseClothing : Item, IDyable, IScissorable, IFactionItem, ICraftable, IWearableDurability public abstract partial class BaseClothing
: Item, IDyable, IScissorable, IFactionItem, ICraftable, IWearableDurability, IAosItem
{ {
[SerializableFieldSaveFlag(0)] [SerializableFieldSaveFlag(0)]
private bool ShouldSerializeResource() => _resource != DefaultResource; private bool ShouldSerializeResource() => _resource != DefaultResource;

View file

@ -19,7 +19,7 @@ public enum GemType
} }
[SerializationGenerator(4, false)] [SerializationGenerator(4, false)]
public abstract partial class BaseJewel : Item, ICraftable public abstract partial class BaseJewel : Item, ICraftable, IAosItem
{ {
[EncodedInt] [EncodedInt]
[InvalidateProperties] [InvalidateProperties]

View file

@ -3,7 +3,7 @@ using Server.Engines.Craft;
namespace Server.Items namespace Server.Items
{ {
public class BaseQuiver : Container, ICraftable public class BaseQuiver : Container, ICraftable, IAosItem
{ {
private static readonly Type[] m_Ammo = private static readonly Type[] m_Ammo =
{ {

View file

@ -28,7 +28,7 @@ namespace Server.Items
Exceptional Exceptional
} }
public class Spellbook : Item, ICraftable, ISlayer public class Spellbook : Item, ICraftable, ISlayer, IAosItem
{ {
private static readonly Dictionary<Mobile, List<Spellbook>> m_Table = new(); private static readonly Dictionary<Mobile, List<Spellbook>> m_Table = new();

View file

@ -19,7 +19,7 @@ namespace Server.Items
Wildfire = 2843 Wildfire = 2843
} }
public class BaseTalisman : Item public class BaseTalisman : Item, IAosItem
{ {
private static readonly int[] m_ItemIDs = private static readonly int[] m_ItemIDs =
{ {

View file

@ -23,7 +23,7 @@ namespace Server.Items
SlayerName Slayer2 { get; set; } SlayerName Slayer2 { get; set; }
} }
public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability, IAosItem
{ {
private static bool _enableInstaHit; private static bool _enableInstaHit;

View file

@ -304,6 +304,11 @@ namespace Server
IncreasedKarmaLoss = 0x00800000 IncreasedKarmaLoss = 0x00800000
} }
public interface IAosItem
{
public AosAttributes Attributes { get; }
}
public sealed class AosAttributes : BaseAttributes public sealed class AosAttributes : BaseAttributes
{ {
public AosAttributes(Item owner) : base(owner) public AosAttributes(Item owner) : base(owner)