Skip to content

Commit

Permalink
fix: Consolidates commodity interface for reagents. (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Mar 21, 2024
1 parent 3332fab commit f3d1fb8
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 80 deletions.
7 changes: 5 additions & 2 deletions Projects/UOContent/Items/Resources/Reagents/BaseReagent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public abstract partial class BaseReagent : Item
public abstract partial class BaseReagent : Item, ICommodity
{
public BaseReagent(int itemID, int amount = 1) : base(itemID)
{
Expand All @@ -12,4 +12,7 @@ public BaseReagent(int itemID, int amount = 1) : base(itemID)
}

public override double DefaultWeight => 0.1;
}

public virtual int DescriptionNumber => LabelNumber;
public virtual bool IsDeedable => true;
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/BatWing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class BatWing : BaseReagent, ICommodity
public partial class BatWing : BaseReagent
{
[Constructible]
public BatWing(int amount = 1) : base(0xF78, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/BlackPearl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class BlackPearl : BaseReagent, ICommodity
public partial class BlackPearl : BaseReagent
{
[Constructible]
public BlackPearl(int amount = 1) : base(0xF7A, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/Bloodmoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class Bloodmoss : BaseReagent, ICommodity
public partial class Bloodmoss : BaseReagent
{
[Constructible]
public Bloodmoss(int amount = 1) : base(0xF7B, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/DaemonBlood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class DaemonBlood : BaseReagent, ICommodity
public partial class DaemonBlood : BaseReagent
{
[Constructible]
public DaemonBlood(int amount = 1) : base(0xF7D, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 3 additions & 4 deletions Projects/UOContent/Items/Resources/Reagents/DaemonBone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class DaemonBone : BaseReagent, ICommodity
public partial class DaemonBone : BaseReagent
{
[Constructible]
public DaemonBone(int amount = 1) : base(0xF80, amount)
Expand All @@ -12,6 +12,5 @@ public DaemonBone(int amount = 1) : base(0xF80, amount)

public override double DefaultWeight => 1.0;

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => Core.ML;
}
public override bool IsDeedable => Core.ML;
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/DeadWood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class DeadWood : BaseReagent, ICommodity
public partial class DeadWood : BaseReagent
{
[Constructible]
public DeadWood(int amount = 1) : base(0xF90, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 3 additions & 4 deletions Projects/UOContent/Items/Resources/Reagents/DragonsBlood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class DragonsBlood : BaseReagent, ICommodity
public partial class DragonsBlood : BaseReagent
{
[Constructible]
public DragonsBlood(int amount = 1) : base(0x4077, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => Core.ML;
}
public override bool IsDeedable => Core.ML;
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/Garlic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class Garlic : BaseReagent, ICommodity
public partial class Garlic : BaseReagent
{
[Constructible]
public Garlic(int amount = 1) : base(0xF84, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/Ginseng.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class Ginseng : BaseReagent, ICommodity
public partial class Ginseng : BaseReagent
{
[Constructible]
public Ginseng(int amount = 1) : base(0xF85, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/GraveDust.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class GraveDust : BaseReagent, ICommodity
public partial class GraveDust : BaseReagent
{
[Constructible]
public GraveDust(int amount = 1) : base(0xF8F, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/MandrakeRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class MandrakeRoot : BaseReagent, ICommodity
public partial class MandrakeRoot : BaseReagent
{
[Constructible]
public MandrakeRoot(int amount = 1) : base(0xF86, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/Nightshade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class Nightshade : BaseReagent, ICommodity
public partial class Nightshade : BaseReagent
{
[Constructible]
public Nightshade(int amount = 1) : base(0xF88, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/NoxCrystal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class NoxCrystal : BaseReagent, ICommodity
public partial class NoxCrystal : BaseReagent
{
[Constructible]
public NoxCrystal(int amount = 1) : base(0xF8E, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/PigIron.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class PigIron : BaseReagent, ICommodity
public partial class PigIron : BaseReagent
{
[Constructible]
public PigIron(int amount = 1) : base(0xF8A, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/SpidersSilk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class SpidersSilk : BaseReagent, ICommodity
public partial class SpidersSilk : BaseReagent
{
[Constructible]
public SpidersSilk(int amount = 1) : base(0xF8D, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}
7 changes: 2 additions & 5 deletions Projects/UOContent/Items/Resources/Reagents/SulfurousAsh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace Server.Items;

[SerializationGenerator(0, false)]
public partial class SulfurousAsh : BaseReagent, ICommodity
public partial class SulfurousAsh : BaseReagent
{
[Constructible]
public SulfurousAsh(int amount = 1) : base(0xF8C, amount)
{
}

int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => true;
}
}

0 comments on commit f3d1fb8

Please sign in to comment.