#W# Merge: Merged with upstream. Conflicts resolved.

This commit is contained in:
WarrentyExpired 2026-10-27 19:56:03 -04:00
commit f6f50470a9
276 changed files with 6742 additions and 8845 deletions

View file

@ -1,10 +1,11 @@
using ModernUO.Serialization;
using Server.Engines.Craft.T2A;
using Server.Targeting;
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class CookableFood : Item
public abstract partial class CookableFood : Item, IT2ACombinable
{
[SerializableField(0)]
[SerializedCommandProperty(AccessLevel.GameMaster)]
@ -14,6 +15,21 @@ public abstract partial class CookableFood : Item
public abstract Food Cook();
public override void OnDoubleClick(Mobile from)
{
if (T2ACraftSystem.Enabled)
{
T2ACooking.Prompt(from, this);
}
else
{
base.OnDoubleClick(from);
}
}
public bool TryCombine(Mobile from, object target) =>
IsHeatSource(target) ? T2ACooking.BeginHeat(from, this, target) : T2ACooking.CannotCombine(from);
public static bool IsHeatSource(object targeted)
{
int itemID;

View file

@ -1,11 +1,12 @@
using System;
using ModernUO.Serialization;
using Server.Engines.Craft.T2A;
using Server.Targeting;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class Dough : Item
public partial class Dough : Item, IT2ACombinable
{
[Constructible]
public Dough() : base(0x103d)
@ -14,10 +15,68 @@ public partial class Dough : Item
}
public override double DefaultWeight => 1.0;
public override void OnDoubleClick(Mobile from)
{
if (T2ACraftSystem.Enabled)
{
T2ACooking.Prompt(from, this);
}
else
{
base.OnDoubleClick(from);
}
}
public bool TryCombine(Mobile from, object target)
{
if (CookableFood.IsHeatSource(target))
{
return T2ACooking.BeginHeat(from, this, target);
}
if (target is not Item item)
{
return T2ACooking.CannotCombine(from);
}
if (!T2ACooking.ValidateInPack(from, item))
{
return false;
}
Item result = item switch
{
JarHoney => new SweetDough(),
Pear => new UnbakedFruitPie(),
Peach => new UnbakedPeachCobbler(),
Apple => new UnbakedApplePie(),
Pumpkin or SmallPumpkin => new UnbakedPumpkinPie(),
Eggs => new UnbakedQuiche(),
Ham or Spam or CookedBird or FishSteak => new UnbakedMeatPie(),
Sausage => new UncookedSausagePizza(),
_ => null
};
if (result == null)
{
return T2ACooking.CannotCombine(from);
}
return T2ACooking.Combine(
from,
this,
item,
result,
item is JarHoney
? "You mix the dough with honey to make sweet dough."
: "You combine the dough with the ingredient."
);
}
}
[SerializationGenerator(0, false)]
public partial class SweetDough : Item
public partial class SweetDough : Item, IT2ACombinable
{
[Constructible]
public SweetDough() : base(0x103d)
@ -28,10 +87,79 @@ public partial class SweetDough : Item
public override double DefaultWeight => 1.0;
public override int LabelNumber => 1041340; // sweet dough
public override void OnDoubleClick(Mobile from)
{
if (T2ACraftSystem.Enabled)
{
T2ACooking.Prompt(from, this);
}
else
{
base.OnDoubleClick(from);
}
}
public bool TryCombine(Mobile from, object target)
{
if (CookableFood.IsHeatSource(target))
{
return T2ACooking.BeginHeat(from, this, target);
}
switch (target)
{
case JarHoney honey:
{
return T2ACooking.ValidateInPack(from, honey) && T2ACooking.Combine(
from,
this,
honey,
new CookieMix(),
"You mix the sweet dough with honey to make cookie mix."
);
}
case SackFlour sack:
{
if (!T2ACooking.ValidateInPack(from, sack))
{
return false;
}
if (!sack.IsOpen)
{
from.SendAsciiMessage("You must open the sack of flour first.");
return false;
}
return T2ACooking.Combine(
from,
this,
sack,
new CakeMix(),
"You mix the flour with sweet dough to make cake mix."
);
}
case BowlFlour bowl:
{
return T2ACooking.ValidateInPack(from, bowl) && T2ACooking.Combine(
from,
this,
bowl,
new CakeMix(),
"You mix the flour with sweet dough to make cake mix."
);
}
default:
{
return T2ACooking.CannotCombine(from);
}
}
}
}
[SerializationGenerator(0, false)]
public partial class JarHoney : Item
public partial class JarHoney : Item, IT2ACombinable
{
[Constructible]
public JarHoney() : base(0x9ec)
@ -40,10 +168,44 @@ public partial class JarHoney : Item
}
public override double DefaultWeight => 1.0;
public override void OnDoubleClick(Mobile from)
{
if (T2ACraftSystem.Enabled)
{
T2ACooking.Prompt(from, this);
}
else
{
base.OnDoubleClick(from);
}
}
public bool TryCombine(Mobile from, object target)
{
return target switch
{
Dough dough => T2ACooking.ValidateInPack(from, dough) && T2ACooking.Combine(
from,
this,
dough,
new SweetDough(),
"You mix the dough with honey to make sweet dough."
),
SweetDough sweetDough => T2ACooking.ValidateInPack(from, sweetDough) && T2ACooking.Combine(
from,
this,
sweetDough,
new CookieMix(),
"You mix the sweet dough with honey to make cookie mix."
),
_ => T2ACooking.CannotCombine(from)
};
}
}
[SerializationGenerator(0, false)]
public partial class BowlFlour : Item
public partial class BowlFlour : Item, IT2ACombinable
{
[Constructible]
public BowlFlour() : base(0xa1e)
@ -51,6 +213,41 @@ public partial class BowlFlour : Item
}
public override double DefaultWeight => 1.0;
public override void OnDoubleClick(Mobile from)
{
if (T2ACraftSystem.Enabled)
{
T2ACooking.Prompt(from, this);
}
else
{
base.OnDoubleClick(from);
}
}
public bool TryCombine(Mobile from, object target)
{
return target switch
{
SweetDough sweetDough => T2ACooking.ValidateInPack(from, sweetDough) && T2ACooking.Combine(
from,
this,
sweetDough,
new CakeMix(),
"You mix the flour with sweet dough to make cake mix."
),
Item item when T2ACooking.GetWaterSource(item) is { } water =>
T2ACooking.CanReachWater(from, item) && T2ACooking.Combine(
from,
this,
water,
new Dough(),
"You mix the flour with water to make dough."
),
_ => T2ACooking.CannotCombine(from)
};
}
}
[SerializationGenerator(0, false)]
@ -66,7 +263,7 @@ public partial class WoodenBowl : Item
[TypeAlias("Server.Items.SackFlourOpen")]
[SerializationGenerator(0, false)]
public partial class SackFlour : Item, IHasQuantity
public partial class SackFlour : Item, IHasQuantity, IT2ACombinable
{
[Constructible]
public SackFlour() : base(0x1039)
@ -104,7 +301,52 @@ public partial class SackFlour : Item, IHasQuantity
{
++ItemID;
}
if (!T2ACraftSystem.Enabled || !T2ACooking.ValidateInPack(from, this))
{
return;
}
if (IsOpen)
{
T2ACooking.Prompt(from, this);
}
else
{
from.SendAsciiMessage("You must open the sack of flour first.");
}
}
public bool TryCombine(Mobile from, object target)
{
if (!IsOpen)
{
from.SendAsciiMessage("You must open the sack of flour first.");
return false;
}
return target switch
{
SweetDough sweetDough => T2ACooking.ValidateInPack(from, sweetDough) && T2ACooking.Combine(
from,
this,
sweetDough,
new CakeMix(),
"You mix the flour with sweet dough to make cake mix."
),
Item item when T2ACooking.GetWaterSource(item) is { } water =>
T2ACooking.CanReachWater(from, item) && T2ACooking.Combine(
from,
this,
water,
new Dough(),
"You mix the flour with water to make dough."
),
_ => T2ACooking.CannotCombine(from)
};
}
public bool IsOpen => ItemID is not (0x1039 or 0x1045);
}
[SerializationGenerator(0, false)]