fix(Flax.cs): Makes flax flippable and fixes stacking (#1874)

This commit is contained in:
Mink80 2024-07-20 00:21:44 +02:00 committed by GitHub
parent db31c07017
commit eed11be012
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,16 +4,29 @@ using Server.Targeting;
namespace Server.Items; namespace Server.Items;
[SerializationGenerator(0, false)] [SerializationGenerator(0, false)]
[Flippable(0x1A9C, 0x1A9D)]
public partial class Flax : Item public partial class Flax : Item
{ {
[Constructible] [Constructible]
public Flax(int amount = 1) : base(0x1A9C) public Flax(int amount = 1) : base(0x1A9C)
{ {
Stackable = true; Stackable = true;
Weight = 1.0;
Amount = amount; Amount = amount;
} }
public override double DefaultWeight => 1;
public override int LabelNumber => 1026812; // Flax Bundle
public override bool CanStackWith(Item dropped) =>
dropped.Stackable && Stackable &&
dropped.GetType() == GetType() &&
dropped.ItemID is 0x1A9C or 0x1A9D &&
dropped.Hue == Hue &&
dropped.Name == Name &&
dropped.Amount + Amount <= 60000 &&
dropped != this;
public override void OnDoubleClick(Mobile from) public override void OnDoubleClick(Mobile from)
{ {
if (IsChildOf(from.Backpack)) if (IsChildOf(from.Backpack))
@ -77,4 +90,4 @@ public partial class Flax : Item
} }
} }
} }
} }