fix: Codegens Food & Beverages (#1021)
- [X] Simplifies beverages - [X] Codegens food & beverages
This commit is contained in:
parent
7b619f23b8
commit
dd95a8a1e3
23 changed files with 965 additions and 1488 deletions
|
|
@ -1,30 +1,16 @@
|
||||||
namespace Server.Items
|
using ModernUO.Serialization;
|
||||||
{
|
|
||||||
public class Wasabi : Item
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Wasabi : Food
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public Wasabi() : base(0x24E8) => Weight = 1.0;
|
public Wasabi() : base(0x24E8) => Weight = 1.0;
|
||||||
|
|
||||||
public Wasabi(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class WasabiClumps : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class WasabiClumps : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public WasabiClumps() : base(0x24EB)
|
public WasabiClumps() : base(0x24EB)
|
||||||
|
|
@ -33,51 +19,18 @@ namespace Server.Items
|
||||||
Weight = 1.0;
|
Weight = 1.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WasabiClumps(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class EmptyBentoBox : Item
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EmptyBentoBox : Item
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public EmptyBentoBox() : base(0x2834) => Weight = 5.0;
|
public EmptyBentoBox() : base(0x2834) => Weight = 5.0;
|
||||||
|
|
||||||
public EmptyBentoBox(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class BentoBox : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BentoBox : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public BentoBox() : base(0x2836)
|
public BentoBox() : base(0x2836)
|
||||||
|
|
@ -87,10 +40,6 @@ namespace Server.Items
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BentoBox(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Eat(Mobile from)
|
public override bool Eat(Mobile from)
|
||||||
{
|
{
|
||||||
if (!base.Eat(from))
|
if (!base.Eat(from))
|
||||||
|
|
@ -101,23 +50,10 @@ namespace Server.Items
|
||||||
from.AddToBackpack(new EmptyBentoBox());
|
from.AddToBackpack(new EmptyBentoBox());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class SushiRolls : Food
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SushiRolls : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public SushiRolls() : base(0x283E)
|
public SushiRolls() : base(0x283E)
|
||||||
|
|
@ -126,27 +62,10 @@ namespace Server.Items
|
||||||
Weight = 3.0;
|
Weight = 3.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SushiRolls(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class SushiPlatter : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SushiPlatter : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public SushiPlatter() : base(0x2840)
|
public SushiPlatter() : base(0x2840)
|
||||||
|
|
@ -155,51 +74,17 @@ namespace Server.Items
|
||||||
Weight = 3.0;
|
Weight = 3.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SushiPlatter(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class GreenTeaBasket : Item
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class GreenTeaBasket : Item
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public GreenTeaBasket() : base(0x284B) => Weight = 10.0;
|
public GreenTeaBasket() : base(0x284B) => Weight = 10.0;
|
||||||
|
|
||||||
public GreenTeaBasket(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class GreenTea : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class GreenTea : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public GreenTea() : base(0x284C)
|
public GreenTea() : base(0x284C)
|
||||||
|
|
@ -208,27 +93,10 @@ namespace Server.Items
|
||||||
Weight = 4.0;
|
Weight = 4.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GreenTea(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class MisoSoup : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class MisoSoup : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public MisoSoup() : base(0x284D)
|
public MisoSoup() : base(0x284D)
|
||||||
|
|
@ -237,27 +105,10 @@ namespace Server.Items
|
||||||
Weight = 4.0;
|
Weight = 4.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MisoSoup(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class WhiteMisoSoup : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class WhiteMisoSoup : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public WhiteMisoSoup() : base(0x284E)
|
public WhiteMisoSoup() : base(0x284E)
|
||||||
|
|
@ -266,27 +117,10 @@ namespace Server.Items
|
||||||
Weight = 4.0;
|
Weight = 4.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WhiteMisoSoup(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class RedMisoSoup : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class RedMisoSoup : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public RedMisoSoup() : base(0x284F)
|
public RedMisoSoup() : base(0x284F)
|
||||||
|
|
@ -295,27 +129,10 @@ namespace Server.Items
|
||||||
Weight = 4.0;
|
Weight = 4.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RedMisoSoup(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class AwaseMisoSoup : Food
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AwaseMisoSoup : Food
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public AwaseMisoSoup() : base(0x2850)
|
public AwaseMisoSoup() : base(0x2850)
|
||||||
|
|
@ -324,23 +141,4 @@ namespace Server.Items
|
||||||
Weight = 4.0;
|
Weight = 4.0;
|
||||||
FillFactor = 2;
|
FillFactor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AwaseMisoSoup(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Engines.Plants;
|
using Server.Engines.Plants;
|
||||||
using Server.Engines.Quests;
|
using Server.Engines.Quests;
|
||||||
using Server.Engines.Quests.Hag;
|
using Server.Engines.Quests.Hag;
|
||||||
|
|
@ -9,8 +10,8 @@ using Server.Multis;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
{
|
|
||||||
public enum BeverageType
|
public enum BeverageType
|
||||||
{
|
{
|
||||||
Ale,
|
Ale,
|
||||||
|
|
@ -31,19 +32,12 @@ namespace Server.Items
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Flippable attributes
|
// TODO: Flippable attributes
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
[TypeAlias("Server.Items.BottleAle", "Server.Items.BottleLiquor", "Server.Items.BottleWine")]
|
[TypeAlias("Server.Items.BottleAle", "Server.Items.BottleLiquor", "Server.Items.BottleWine")]
|
||||||
public class BeverageBottle : BaseBeverage
|
public partial class BeverageBottle : BaseBeverage
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public BeverageBottle(BeverageType type)
|
public BeverageBottle(BeverageType type) : base(type) => Weight = 1.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 1.0;
|
|
||||||
|
|
||||||
public BeverageBottle(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int BaseLabelNumber => 1042959; // a bottle of Ale
|
public override int BaseLabelNumber => 1042959; // a bottle of Ale
|
||||||
public override int MaxQuantity => 5;
|
public override int MaxQuantity => 5;
|
||||||
|
|
@ -51,238 +45,80 @@ namespace Server.Items
|
||||||
|
|
||||||
public override int ComputeItemID()
|
public override int ComputeItemID()
|
||||||
{
|
{
|
||||||
if (!IsEmpty)
|
if (IsEmpty)
|
||||||
{
|
{
|
||||||
switch (Content)
|
|
||||||
{
|
|
||||||
case BeverageType.Ale: return 0x99F;
|
|
||||||
case BeverageType.Cider: return 0x99F;
|
|
||||||
case BeverageType.Liquor: return 0x99B;
|
|
||||||
case BeverageType.Milk: return 0x99B;
|
|
||||||
case BeverageType.Wine: return 0x9C7;
|
|
||||||
case BeverageType.Water: return 0x99B;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
return Content switch
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
BeverageType.Ale => 0x99F,
|
||||||
|
BeverageType.Cider => 0x99F,
|
||||||
writer.Write(1); // version
|
BeverageType.Liquor => 0x99B,
|
||||||
}
|
BeverageType.Milk => 0x99B,
|
||||||
|
BeverageType.Wine => 0x9C7,
|
||||||
public override void Deserialize(IGenericReader reader)
|
BeverageType.Water => 0x99B,
|
||||||
{
|
_ => 0
|
||||||
base.Deserialize(reader);
|
};
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
if (CheckType("BottleAle"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Ale;
|
|
||||||
}
|
|
||||||
else if (CheckType("BottleLiquor"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Liquor;
|
|
||||||
}
|
|
||||||
else if (CheckType("BottleWine"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Wine;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new Exception("Invalid beverage type");
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Jug : BaseBeverage
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Jug : BaseBeverage
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public Jug(BeverageType type)
|
public Jug(BeverageType type) : base(type) => Weight = 1.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 1.0;
|
|
||||||
|
|
||||||
public Jug(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int BaseLabelNumber => 1042965; // a jug of Ale
|
public override int BaseLabelNumber => 1042965; // a jug of Ale
|
||||||
public override int MaxQuantity => 10;
|
public override int MaxQuantity => 10;
|
||||||
public override bool Fillable => false;
|
public override bool Fillable => false;
|
||||||
|
|
||||||
public override int ComputeItemID()
|
public override int ComputeItemID() => !IsEmpty ? 0x9C8 : 0;
|
||||||
{
|
|
||||||
if (!IsEmpty)
|
|
||||||
{
|
|
||||||
return 0x9C8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
[SerializationGenerator(0, false)]
|
||||||
}
|
public partial class CeramicMug : BaseBeverage
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CeramicMug : BaseBeverage
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public CeramicMug() => Weight = 1.0;
|
public CeramicMug() => Weight = 1.0;
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public CeramicMug(BeverageType type)
|
public CeramicMug(BeverageType type) : base(type) => Weight = 1.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 1.0;
|
|
||||||
|
|
||||||
public CeramicMug(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int BaseLabelNumber => 1042982; // a ceramic mug of Ale
|
public override int BaseLabelNumber => 1042982; // a ceramic mug of Ale
|
||||||
public override int MaxQuantity => 1;
|
public override int MaxQuantity => 1;
|
||||||
|
|
||||||
public override int ComputeItemID()
|
public override int ComputeItemID() => ItemID is (< 0x995 or > 0x999) and not 0x9CA ? 0x995 : ItemID;
|
||||||
{
|
|
||||||
if (ItemID >= 0x995 && ItemID <= 0x999)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ItemID == 0x9CA)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class PewterMug : BaseBeverage
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x995;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PewterMug : BaseBeverage
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public PewterMug() => Weight = 1.0;
|
public PewterMug() => Weight = 1.0;
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public PewterMug(BeverageType type)
|
public PewterMug(BeverageType type) : base(type) => Weight = 1.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 1.0;
|
|
||||||
|
|
||||||
public PewterMug(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int BaseLabelNumber => 1042994; // a pewter mug with Ale
|
public override int BaseLabelNumber => 1042994; // a pewter mug with Ale
|
||||||
public override int MaxQuantity => 1;
|
public override int MaxQuantity => 1;
|
||||||
|
|
||||||
public override int ComputeItemID()
|
public override int ComputeItemID() => ItemID is >= 0xFFF and <= 0x1002 ? ItemID : 0xFFF;
|
||||||
{
|
|
||||||
if (ItemID >= 0xFFF && ItemID <= 0x1002)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0xFFF;
|
[SerializationGenerator(0, false)]
|
||||||
}
|
public partial class Goblet : BaseBeverage
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Goblet : BaseBeverage
|
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public Goblet() => Weight = 1.0;
|
public Goblet() => Weight = 1.0;
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public Goblet(BeverageType type)
|
public Goblet(BeverageType type) : base(type) => Weight = 1.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 1.0;
|
|
||||||
|
|
||||||
public Goblet(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int BaseLabelNumber => 1043000; // a goblet of Ale
|
public override int BaseLabelNumber => 1043000; // a goblet of Ale
|
||||||
public override int MaxQuantity => 1;
|
public override int MaxQuantity => 1;
|
||||||
|
|
||||||
public override int ComputeItemID()
|
public override int ComputeItemID() => ItemID is 0x99A or 0x9B3 or 0x9BF or 0x9CB ? ItemID : 0x99A;
|
||||||
{
|
|
||||||
if (ItemID is 0x99A or 0x9B3 or 0x9BF or 0x9CB)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x99A;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TypeAlias(
|
[TypeAlias(
|
||||||
|
|
@ -293,20 +129,14 @@ namespace Server.Items
|
||||||
"Server.Items.GlassWine",
|
"Server.Items.GlassWine",
|
||||||
"Server.Items.GlassWater"
|
"Server.Items.GlassWater"
|
||||||
)]
|
)]
|
||||||
public class GlassMug : BaseBeverage
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class GlassMug : BaseBeverage
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public GlassMug() => Weight = 1.0;
|
public GlassMug() => Weight = 1.0;
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public GlassMug(BeverageType type)
|
public GlassMug(BeverageType type) : base(type) => Weight = 1.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 1.0;
|
|
||||||
|
|
||||||
public GlassMug(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int EmptyLabelNumber => 1022456; // mug
|
public override int EmptyLabelNumber => 1022456; // mug
|
||||||
public override int BaseLabelNumber => 1042976; // a mug of Ale
|
public override int BaseLabelNumber => 1042976; // a mug of Ale
|
||||||
|
|
@ -316,77 +146,20 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
if (IsEmpty)
|
if (IsEmpty)
|
||||||
{
|
{
|
||||||
return ItemID >= 0x1F81 && ItemID <= 0x1F84 ? ItemID : 0x1F81;
|
return ItemID is >= 0x1F81 and <= 0x1F84 ? ItemID : 0x1F81;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Content switch
|
return Content switch
|
||||||
{
|
{
|
||||||
BeverageType.Ale => ItemID == 0x9EF ? 0x9EF : 0x9EE,
|
BeverageType.Ale => ItemID == 0x9EF ? 0x9EF : 0x9EE,
|
||||||
BeverageType.Cider => ItemID >= 0x1F7D && ItemID <= 0x1F80 ? ItemID : 0x1F7D,
|
BeverageType.Cider => Math.Clamp(ItemID, 0x1F7D, 0x1F80),
|
||||||
BeverageType.Liquor => ItemID >= 0x1F85 && ItemID <= 0x1F88 ? ItemID : 0x1F85,
|
BeverageType.Liquor => Math.Clamp(ItemID, 0x1F85, 0x1F88),
|
||||||
BeverageType.Milk => ItemID >= 0x1F89 && ItemID <= 0x1F8C ? ItemID : 0x1F89,
|
BeverageType.Milk => Math.Clamp(ItemID, 0x1F89, 0x1F8C),
|
||||||
BeverageType.Wine => ItemID >= 0x1F8D && ItemID <= 0x1F90 ? ItemID : 0x1F8D,
|
BeverageType.Wine => Math.Clamp(ItemID, 0x1F8D, 0x1F90),
|
||||||
BeverageType.Water => ItemID >= 0x1F91 && ItemID <= 0x1F94 ? ItemID : 0x1F91,
|
BeverageType.Water => Math.Clamp(ItemID, 0x1F91, 0x1F94),
|
||||||
_ => 0
|
_ => 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
if (CheckType("MugAle"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Ale;
|
|
||||||
}
|
|
||||||
else if (CheckType("GlassCider"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Cider;
|
|
||||||
}
|
|
||||||
else if (CheckType("GlassLiquor"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Liquor;
|
|
||||||
}
|
|
||||||
else if (CheckType("GlassMilk"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Milk;
|
|
||||||
}
|
|
||||||
else if (CheckType("GlassWine"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Wine;
|
|
||||||
}
|
|
||||||
else if (CheckType("GlassWater"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Water;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new Exception("Invalid beverage type");
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TypeAlias(
|
[TypeAlias(
|
||||||
|
|
@ -398,20 +171,14 @@ namespace Server.Items
|
||||||
"Server.Items.PitcherWater",
|
"Server.Items.PitcherWater",
|
||||||
"Server.Items.GlassPitcher"
|
"Server.Items.GlassPitcher"
|
||||||
)]
|
)]
|
||||||
public class Pitcher : BaseBeverage
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Pitcher : BaseBeverage
|
||||||
{
|
{
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public Pitcher() => Weight = 2.0;
|
public Pitcher() => Weight = 2.0;
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public Pitcher(BeverageType type)
|
public Pitcher(BeverageType type) : base(type) => Weight = 2.0;
|
||||||
: base(type) =>
|
|
||||||
Weight = 2.0;
|
|
||||||
|
|
||||||
public Pitcher(Serial serial)
|
|
||||||
: base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int BaseLabelNumber => 1048128; // a Pitcher of Ale
|
public override int BaseLabelNumber => 1048128; // a Pitcher of Ale
|
||||||
public override int MaxQuantity => 5;
|
public override int MaxQuantity => 5;
|
||||||
|
|
@ -420,148 +187,26 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
if (IsEmpty)
|
if (IsEmpty)
|
||||||
{
|
{
|
||||||
if (ItemID is 0x9A7 or 0xFF7)
|
return ItemID is 0x9A7 or 0xFF7 ? ItemID : 0xFF6;
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0xFF6;
|
return Content switch
|
||||||
}
|
|
||||||
|
|
||||||
switch (Content)
|
|
||||||
{
|
{
|
||||||
case BeverageType.Ale:
|
BeverageType.Ale => ItemID == 0x1F96 ? ItemID : 0x1F95,
|
||||||
{
|
BeverageType.Cider => ItemID == 0x1F98 ? ItemID : 0x1F97,
|
||||||
if (ItemID == 0x1F96)
|
BeverageType.Liquor => ItemID == 0x1F9A ? ItemID : 0x1F99,
|
||||||
{
|
BeverageType.Milk => ItemID == 0x9AD ? ItemID : 0x9F0,
|
||||||
return ItemID;
|
BeverageType.Wine => ItemID == 0x1F9C ? ItemID : 0x1F9B,
|
||||||
}
|
BeverageType.Water => ItemID is 0xFF8 or 0xFF9 or 0x1F9E ? ItemID : 0x1F9D,
|
||||||
|
_ => 0
|
||||||
return 0x1F95;
|
};
|
||||||
}
|
|
||||||
case BeverageType.Cider:
|
|
||||||
{
|
|
||||||
if (ItemID == 0x1F98)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x1F97;
|
|
||||||
}
|
|
||||||
case BeverageType.Liquor:
|
|
||||||
{
|
|
||||||
if (ItemID == 0x1F9A)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x1F99;
|
|
||||||
}
|
|
||||||
case BeverageType.Milk:
|
|
||||||
{
|
|
||||||
if (ItemID == 0x9AD)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x9F0;
|
|
||||||
}
|
|
||||||
case BeverageType.Wine:
|
|
||||||
{
|
|
||||||
if (ItemID == 0x1F9C)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x1F9B;
|
|
||||||
}
|
|
||||||
case BeverageType.Water:
|
|
||||||
{
|
|
||||||
if (ItemID is 0xFF8 or 0xFF9 or 0x1F9E)
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0x1F9D;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
[SerializationGenerator(2, false)]
|
||||||
}
|
public abstract partial class BaseBeverage : Item, IHasQuantity
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
private readonly int[] _swampTiles =
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
if (CheckType("PitcherWater") || CheckType("GlassPitcher"))
|
|
||||||
{
|
|
||||||
InternalDeserialize(reader, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
InternalDeserialize(reader, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
if (CheckType("PitcherAle"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Ale;
|
|
||||||
}
|
|
||||||
else if (CheckType("PitcherCider"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Cider;
|
|
||||||
}
|
|
||||||
else if (CheckType("PitcherLiquor"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Liquor;
|
|
||||||
}
|
|
||||||
else if (CheckType("PitcherMilk"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Milk;
|
|
||||||
}
|
|
||||||
else if (CheckType("PitcherWine"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Wine;
|
|
||||||
}
|
|
||||||
else if (CheckType("PitcherWater"))
|
|
||||||
{
|
|
||||||
Quantity = MaxQuantity;
|
|
||||||
Content = BeverageType.Water;
|
|
||||||
}
|
|
||||||
else if (CheckType("GlassPitcher"))
|
|
||||||
{
|
|
||||||
Quantity = 0;
|
|
||||||
Content = BeverageType.Water;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new Exception("Invalid beverage type");
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract class BaseBeverage : Item, IHasQuantity
|
|
||||||
{
|
|
||||||
private static readonly int[] m_SwampTiles =
|
|
||||||
{
|
{
|
||||||
0x9C4, 0x9EB,
|
0x9C4, 0x9EB,
|
||||||
0x3D65, 0x3D65,
|
0x3D65, 0x3D65,
|
||||||
|
|
@ -574,37 +219,31 @@ namespace Server.Items
|
||||||
|
|
||||||
private static readonly Dictionary<Mobile, Timer> m_Table = new();
|
private static readonly Dictionary<Mobile, Timer> m_Table = new();
|
||||||
|
|
||||||
private BeverageType m_Content;
|
[SerializableField(0)]
|
||||||
private int m_Quantity;
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private Poison _poison;
|
||||||
|
|
||||||
|
[SerializableField(1)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private Mobile _poisoner;
|
||||||
|
|
||||||
|
[SerializableField(2, getter: "private", setter: "private")]
|
||||||
|
private BeverageType _rawContent;
|
||||||
|
|
||||||
|
[SerializableField(3, getter: "private", setter: "private")]
|
||||||
|
private int _rawQuantity;
|
||||||
|
|
||||||
public BaseBeverage() => ItemID = ComputeItemID();
|
public BaseBeverage() => ItemID = ComputeItemID();
|
||||||
|
|
||||||
public BaseBeverage(BeverageType type)
|
public BaseBeverage(BeverageType type)
|
||||||
{
|
{
|
||||||
m_Content = type;
|
_rawContent = type;
|
||||||
m_Quantity = MaxQuantity;
|
_rawQuantity = MaxQuantity;
|
||||||
ItemID = ComputeItemID();
|
ItemID = ComputeItemID();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseBeverage(Serial serial)
|
public override int LabelNumber =>
|
||||||
: base(serial)
|
IsEmpty || BaseLabelNumber == 0 ? EmptyLabelNumber : BaseLabelNumber + (int)_rawContent;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int LabelNumber
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var num = BaseLabelNumber;
|
|
||||||
|
|
||||||
if (IsEmpty || num == 0)
|
|
||||||
{
|
|
||||||
return EmptyLabelNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
return BaseLabelNumber + (int)m_Content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool ShowQuantity => MaxQuantity > 1;
|
public virtual bool ShowQuantity => MaxQuantity > 1;
|
||||||
public virtual bool Fillable => true;
|
public virtual bool Fillable => true;
|
||||||
|
|
@ -616,27 +255,21 @@ namespace Server.Items
|
||||||
public abstract int MaxQuantity { get; }
|
public abstract int MaxQuantity { get; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool IsEmpty => m_Quantity <= 0;
|
public bool IsEmpty => _rawQuantity <= 0;
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool ContainsAlchohol => !IsEmpty && m_Content != BeverageType.Milk && m_Content != BeverageType.Water;
|
public bool ContainsAlcohol => !IsEmpty && _rawContent is not BeverageType.Milk and not BeverageType.Water;
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool IsFull => m_Quantity >= MaxQuantity;
|
public bool IsFull => _rawQuantity >= MaxQuantity;
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public Poison Poison { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public Mobile Poisoner { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public BeverageType Content
|
public BeverageType Content
|
||||||
{
|
{
|
||||||
get => m_Content;
|
get => _rawContent;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
m_Content = value;
|
RawContent = value;
|
||||||
|
|
||||||
InvalidateProperties();
|
InvalidateProperties();
|
||||||
|
|
||||||
|
|
@ -656,10 +289,10 @@ namespace Server.Items
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Quantity
|
public int Quantity
|
||||||
{
|
{
|
||||||
get => m_Quantity;
|
get => _rawQuantity;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
m_Quantity = Math.Clamp(value, 0, MaxQuantity);
|
RawQuantity = Math.Clamp(value, 0, MaxQuantity);
|
||||||
|
|
||||||
InvalidateProperties();
|
InvalidateProperties();
|
||||||
|
|
||||||
|
|
@ -680,24 +313,13 @@ namespace Server.Items
|
||||||
|
|
||||||
public virtual int GetQuantityDescription()
|
public virtual int GetQuantityDescription()
|
||||||
{
|
{
|
||||||
var perc = m_Quantity * 100 / MaxQuantity;
|
return (_rawQuantity * 100 / MaxQuantity) switch
|
||||||
|
|
||||||
if (perc <= 0)
|
|
||||||
{
|
{
|
||||||
return 1042975; // It's empty.
|
<= 0 => 1042975,
|
||||||
}
|
<= 33 => 1042974,
|
||||||
|
<= 66 => 1042973,
|
||||||
if (perc <= 33)
|
_ => 1042972
|
||||||
{
|
};
|
||||||
return 1042974; // It's nearly empty.
|
|
||||||
}
|
|
||||||
|
|
||||||
if (perc <= 66)
|
|
||||||
{
|
|
||||||
return 1042973; // It's half full.
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1042972; // It's full.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void GetProperties(ObjectPropertyList list)
|
public override void GetProperties(ObjectPropertyList list)
|
||||||
|
|
@ -809,7 +431,7 @@ namespace Server.Items
|
||||||
src = component.Addon as IWaterSource;
|
src = component.Addon as IWaterSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src == null || src.Quantity <= 0)
|
if (src is not { Quantity: > 0 })
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -865,18 +487,17 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
var contains = false;
|
var contains = false;
|
||||||
|
|
||||||
for (var i = 0; !contains && i < m_SwampTiles.Length; i += 2)
|
for (var i = 0; !contains && i < _swampTiles.Length; i += 2)
|
||||||
{
|
{
|
||||||
contains = tileID >= m_SwampTiles[i] && tileID <= m_SwampTiles[i + 1];
|
contains = tileID >= _swampTiles[i] && tileID <= _swampTiles[i + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contains)
|
if (contains)
|
||||||
{
|
{
|
||||||
Delete();
|
Delete();
|
||||||
|
|
||||||
player.SendLocalizedMessage(
|
// You dip the container into the disgusting swamp water, collecting enough for the Hag's vile stew.
|
||||||
1055035
|
player.SendLocalizedMessage(1055035);
|
||||||
); // You dip the container into the disgusting swamp water, collecting enough for the Hag's vile stew.
|
|
||||||
obj.Complete();
|
obj.Complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -933,7 +554,7 @@ namespace Server.Items
|
||||||
from.Thirst += 1;
|
from.Thirst += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ContainsAlchohol)
|
if (ContainsAlcohol)
|
||||||
{
|
{
|
||||||
var bac = Content switch
|
var bac = Content switch
|
||||||
{
|
{
|
||||||
|
|
@ -989,9 +610,7 @@ namespace Server.Items
|
||||||
component.Addon is WaterVatEast or WaterVatSouth &&
|
component.Addon is WaterVatEast or WaterVatSouth &&
|
||||||
Content == BeverageType.Water)
|
Content == BeverageType.Water)
|
||||||
{
|
{
|
||||||
if (from is PlayerMobile player)
|
if (from is PlayerMobile { Quest: SolenMatriarchQuest qs })
|
||||||
{
|
|
||||||
if (player.Quest is SolenMatriarchQuest qs)
|
|
||||||
{
|
{
|
||||||
QuestObjective obj = qs.FindObjective<GatherWaterObjective>();
|
QuestObjective obj = qs.FindObjective<GatherWaterObjective>();
|
||||||
|
|
||||||
|
|
@ -1018,7 +637,6 @@ namespace Server.Items
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage(500846); // Can't pour it there.
|
from.SendLocalizedMessage(500846); // Can't pour it there.
|
||||||
|
|
@ -1093,52 +711,12 @@ namespace Server.Items
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
private void Deserialize(IGenericReader reader, int version)
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
_poison = reader.ReadPoison();
|
||||||
|
_poisoner = reader.ReadEntity<Mobile>();
|
||||||
writer.Write(1); // version
|
_rawContent = (BeverageType)reader.ReadInt();
|
||||||
|
_rawQuantity = reader.ReadInt();
|
||||||
writer.Write(Poisoner);
|
|
||||||
|
|
||||||
writer.Write(Poison);
|
|
||||||
writer.Write((int)m_Content);
|
|
||||||
writer.Write(m_Quantity);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected bool CheckType(string name) => GetType().FullName == $"Server.Items.{name}";
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
InternalDeserialize(reader, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void InternalDeserialize(IGenericReader reader, bool read)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
if (!read)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
Poisoner = reader.ReadEntity<Mobile>();
|
|
||||||
goto case 0;
|
|
||||||
}
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
Poison = reader.ReadPoison();
|
|
||||||
m_Content = (BeverageType)reader.ReadInt();
|
|
||||||
m_Quantity = reader.ReadInt();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
|
|
@ -1165,10 +743,7 @@ namespace Server.Items
|
||||||
from.BAC = 60;
|
from.BAC = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer t = new HeaveTimer(from);
|
m_Table[from] = new HeaveTimer(from).Start();
|
||||||
t.Start();
|
|
||||||
|
|
||||||
m_Table[from] = t;
|
|
||||||
}
|
}
|
||||||
else if (m_Table.Remove(from, out var t))
|
else if (m_Table.Remove(from, out var t))
|
||||||
{
|
{
|
||||||
|
|
@ -1182,11 +757,8 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
private readonly Mobile m_Drunk;
|
private readonly Mobile m_Drunk;
|
||||||
|
|
||||||
public HeaveTimer(Mobile drunk)
|
public HeaveTimer(Mobile drunk) : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0)) =>
|
||||||
: base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
|
|
||||||
{
|
|
||||||
m_Drunk = drunk;
|
m_Drunk = drunk;
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnTick()
|
protected override void OnTick()
|
||||||
{
|
{
|
||||||
|
|
@ -1238,4 +810,3 @@ namespace Server.Items
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.AwaseMisoSoup"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"type": "Server.Items.BaseBeverage",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Poison",
|
||||||
|
"type": "Server.Poison",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Poison"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Poisoner",
|
||||||
|
"type": "Server.Mobile",
|
||||||
|
"rule": "SerializableInterfaceMigrationRule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RawContent",
|
||||||
|
"type": "Server.Items.BeverageType",
|
||||||
|
"rule": "EnumMigrationRule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RawQuantity",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.BentoBox"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.BeverageBottle"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.CeramicMug"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.EmptyBentoBox"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.GlassMug"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.Goblet"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.GreenTea"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.GreenTeaBasket"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Items.Jug.v0.json
Normal file
4
Projects/UOContent/Migrations/Server.Items.Jug.v0.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.Jug"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.MisoSoup"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.PewterMug"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.Pitcher"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.RedMisoSoup"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.SushiPlatter"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.SushiRolls"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.Wasabi"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.WasabiClumps"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.WhiteMisoSoup"
|
||||||
|
}
|
||||||
|
|
@ -158,8 +158,8 @@ namespace Server
|
||||||
|
|
||||||
AOS.Damage(m_Mobile, From, damage, 0, 0, 0, 100, 0);
|
AOS.Damage(m_Mobile, From, damage, 0, 0, 0, 100, 0);
|
||||||
|
|
||||||
if (Utility.RandomDouble() >= 0.60
|
// OSI: randomly revealed between first and third damage tick, guessing 60% chance
|
||||||
) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
|
if (Utility.RandomDouble() >= 0.60)
|
||||||
{
|
{
|
||||||
m_Mobile.RevealingAction();
|
m_Mobile.RevealingAction();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue