#W# Merge: Merged with upstream. Conflicts resolved.
This commit is contained in:
commit
f6f50470a9
276 changed files with 6742 additions and 8845 deletions
|
|
@ -12,12 +12,6 @@ public partial class SOS : Item
|
|||
// By default let's use the old gump, because we can.
|
||||
private static bool UseNewMessages = false;
|
||||
|
||||
private static int[] WaterTiles =
|
||||
{
|
||||
0x00A8, 0x00AB,
|
||||
0x0136, 0x0137
|
||||
};
|
||||
|
||||
private static Rectangle2D[] BritRegions = { new(0, 0, 5120, 4096) };
|
||||
|
||||
private static Rectangle2D[] IlshRegions =
|
||||
|
|
@ -179,34 +173,7 @@ public partial class SOS : Item
|
|||
var x = Utility.Random(reg.X, reg.Width);
|
||||
var y = Utility.Random(reg.Y, reg.Height);
|
||||
|
||||
if (!ValidateDeepWater(map, x, y))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var valid = true;
|
||||
|
||||
for (int j = 1, offset = 5; valid && j <= 5; ++j, offset += 5)
|
||||
{
|
||||
if (!ValidateDeepWater(map, x + offset, y + offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x + offset, y - offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x - offset, y + offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x - offset, y - offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid)
|
||||
if (SpecialFishingNet.FullValidation(map, x, y))
|
||||
{
|
||||
return new Point3D(x, y, 0);
|
||||
}
|
||||
|
|
@ -215,19 +182,6 @@ public partial class SOS : Item
|
|||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
private static bool ValidateDeepWater(Map map, int x, int y)
|
||||
{
|
||||
var tileID = map.Tiles.GetLandTile(x, y).ID;
|
||||
var water = false;
|
||||
|
||||
for (var i = 0; !water && i < WaterTiles.Length; i += 2)
|
||||
{
|
||||
water = tileID >= WaterTiles[i] && tileID <= WaterTiles[i + 1];
|
||||
}
|
||||
|
||||
return water;
|
||||
}
|
||||
|
||||
private class MessageGump : StaticGump<MessageGump>
|
||||
{
|
||||
private readonly string _fmt;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ namespace Server.Items;
|
|||
[SerializationGenerator(0, false)]
|
||||
public partial class SpecialFishingNet : Item
|
||||
{
|
||||
private static int[] _hues =
|
||||
{
|
||||
private static readonly int[] _hues =
|
||||
[
|
||||
0x09B,
|
||||
0x0CD,
|
||||
0x0D3,
|
||||
|
|
@ -26,25 +26,19 @@ public partial class SpecialFishingNet : Item
|
|||
0x492,
|
||||
0x4B5,
|
||||
0x8AA
|
||||
};
|
||||
];
|
||||
|
||||
private static int[] _waterTiles =
|
||||
{
|
||||
0x00A8, 0x00AB,
|
||||
0x0136, 0x0137
|
||||
};
|
||||
private static readonly int[] _waterTiles = [0x00A8, 0x00AB, 0x0136, 0x0137 ];
|
||||
|
||||
private static int[] _shallowWaterTiles =
|
||||
{
|
||||
0x1797, 0x179C
|
||||
};
|
||||
private static readonly int[] _shallowWaterTiles = [0x1797, 0x179C];
|
||||
|
||||
[SerializableField(0)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private bool _inUse;
|
||||
|
||||
[Constructible]
|
||||
public SpecialFishingNet() : base(0x0DCA) => Hue = Utility.RandomDouble() < 0.01 ? _hues.RandomElement() : 0x8A0;
|
||||
public SpecialFishingNet() : base(0x0DCA) =>
|
||||
Hue = Core.LBR && Utility.RandomDouble() < 0.1 ? _hues.RandomElement() : 0x8A0;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
|
|
@ -322,31 +316,15 @@ public partial class SpecialFishingNet : Item
|
|||
|
||||
public static bool FullValidation(Map map, int x, int y)
|
||||
{
|
||||
if (!ValidateDeepWater(map, x, y))
|
||||
// Every tile closer than 14 must be water, so land and the edge of the map are at least 14 tiles away.
|
||||
for (var ty = y - 13; ty <= y + 13; ++ty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int j = 1, offset = 5; j <= 5; ++j, offset += 5)
|
||||
{
|
||||
if (!ValidateDeepWater(map, x + offset, y + offset))
|
||||
for (var tx = x - 13; tx <= x + 13; ++tx)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ValidateDeepWater(map, x + offset, y - offset))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ValidateDeepWater(map, x - offset, y + offset))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ValidateDeepWater(map, x - offset, y - offset))
|
||||
{
|
||||
return false;
|
||||
if (!ValidateDeepWater(map, tx, ty))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public partial class Spellbook : Item, ICraftable, ISlayer, IAosItem
|
|||
[SerializedCommandProperty(AccessLevel.GameMaster, canModify: true)]
|
||||
private AosSkillBonuses _skillBonuses;
|
||||
|
||||
[InvalidateProperties]
|
||||
[SerializableField(8)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private int _spellCount;
|
||||
|
|
@ -135,7 +136,6 @@ public partial class Spellbook : Item, ICraftable, ISlayer, IAosItem
|
|||
|
||||
[SerializableField(7, fieldChanged: nameof(OnContentChanged))]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
[InvalidateProperties]
|
||||
private ulong _content;
|
||||
|
||||
private void OnContentChanged(ulong oldValue, ulong newValue)
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ public abstract partial class BaseTool : Item, IUsesRemaining, ICraftable
|
|||
{
|
||||
from.SendLocalizedMessage(num);
|
||||
}
|
||||
else if (T2ACraftSystem.Enabled)
|
||||
else if (T2ACraftSystem.Enabled && T2ACraftSystem.HasMenu(system))
|
||||
{
|
||||
from.Target = new T2ACraftToolTarget(this, system);
|
||||
from.SendAsciiMessage("Target this tool to make last item, or any other target to begin crafting.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue