chore: Cleans up pattern checks. (#892)
This commit is contained in:
parent
171df32257
commit
63e1b02d93
283 changed files with 587 additions and 702 deletions
|
|
@ -50,7 +50,7 @@ namespace Server.Network
|
|||
{
|
||||
EnsureCapacity(256);
|
||||
|
||||
Stream.Write(!(vendor.FindItemOnLayer(Layer.ShopBuy) is Container buyPack) ? Serial.MinusOne : buyPack.Serial);
|
||||
Stream.Write(vendor.FindItemOnLayer(Layer.ShopBuy) is not Container buyPack ? Serial.MinusOne : buyPack.Serial);
|
||||
|
||||
Stream.Write((byte)list.Count);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace Server
|
|||
return 50;
|
||||
}
|
||||
|
||||
if (!(objs[0] is CallPriorityAttribute attr))
|
||||
if (objs[0] is not CallPriorityAttribute attr)
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ namespace Server.Collections
|
|||
|
||||
private void ThrowEnumerationNotStartedOrEnded()
|
||||
{
|
||||
Debug.Assert(_index == -1 || _index == -2);
|
||||
Debug.Assert(_index is -1 or -2);
|
||||
throw new InvalidOperationException(_index == -1 ? CollectionThrowStrings.InvalidOperation_EnumNotStarted : CollectionThrowStrings.InvalidOperation_EnumEnded);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace Server.ContextMenus
|
|||
for (var i = 0; i < Entries.Length; ++i)
|
||||
{
|
||||
var number = Entries[i].Number;
|
||||
if (number < 3000000 || number > 3032767)
|
||||
if (number is < 3000000 or > 3032767)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ namespace Server.Items
|
|||
return container.CheckHold(m, item, message, checkItems, plusItems, plusWeight);
|
||||
}
|
||||
|
||||
if (!(parent is Item parentItem))
|
||||
if (parent is not Item parentItem)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -504,7 +504,7 @@ namespace Server.Items
|
|||
{
|
||||
var item = list[i];
|
||||
|
||||
if (!(item is Container) && CheckHold(from, dropped, false, false) &&
|
||||
if (item is not Container && CheckHold(from, dropped, false, false) &&
|
||||
item.StackWith(from, dropped, playSound))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -540,7 +540,7 @@ namespace Server.Items
|
|||
{
|
||||
var item = list[j];
|
||||
|
||||
if (!(item is Container) && CheckHold(from, dropped, false, false, 0, extraWeight) &&
|
||||
if (item is not Container && CheckHold(from, dropped, false, false, 0, extraWeight) &&
|
||||
item.CanStackWith(dropped))
|
||||
{
|
||||
stackItems.Add(new ItemStackEntry(item, dropped));
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ namespace Server
|
|||
|
||||
var weight = TileData.ItemTable[m_ItemID].Weight;
|
||||
|
||||
if (weight == 255 || weight == 0)
|
||||
if (weight is 255 or 0)
|
||||
{
|
||||
weight = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Server.Json
|
|||
|
||||
reader.Read();
|
||||
|
||||
if (key == "start" || key == "end")
|
||||
if (key is "start" or "end")
|
||||
{
|
||||
if (objType > -1 && objType != 2)
|
||||
{
|
||||
|
|
@ -140,7 +140,7 @@ namespace Server.Json
|
|||
|
||||
objType = 1;
|
||||
data[i - 10] = reader.GetInt32();
|
||||
if (i == 12 || i == 15)
|
||||
if (i is 12 or 15)
|
||||
{
|
||||
hasZ = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@ namespace Server
|
|||
var eable = map.GetItemsInRange(new Point3D(x, y, 0), 0);
|
||||
|
||||
pool.AddRange(
|
||||
eable.Where(item => item.ItemID <= TileData.MaxItemValue && !(item is BaseMulti))
|
||||
eable.Where(item => item.ItemID <= TileData.MaxItemValue && item is not BaseMulti)
|
||||
.OrderBy(item => item.Z)
|
||||
.Take(pool.Capacity)
|
||||
);
|
||||
|
|
@ -715,7 +715,7 @@ namespace Server
|
|||
{
|
||||
var item = sector.Items[i];
|
||||
|
||||
if (!(item is BaseMulti) && item.ItemID <= TileData.MaxItemValue && item.AtWorldPoint(p.X, p.Y) &&
|
||||
if (item is not BaseMulti && item.ItemID <= TileData.MaxItemValue && item.AtWorldPoint(p.X, p.Y) &&
|
||||
!item.Movable)
|
||||
{
|
||||
var id = item.ItemData;
|
||||
|
|
@ -1145,7 +1145,7 @@ namespace Server
|
|||
{
|
||||
var item = items[i];
|
||||
|
||||
if (!(item is BaseMulti) && item.ItemID <= TileData.MaxItemValue && item.AtWorldPoint(x, y))
|
||||
if (item is not BaseMulti && item.ItemID <= TileData.MaxItemValue && item.AtWorldPoint(x, y))
|
||||
{
|
||||
var id = item.ItemData;
|
||||
surface = id.Surface;
|
||||
|
|
|
|||
|
|
@ -1888,7 +1888,7 @@ namespace Server
|
|||
|
||||
item ??= FindItemOnLayer(Layer.Mount);
|
||||
|
||||
if (!(item is IMountItem mountItem))
|
||||
if (item is not IMountItem mountItem)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
@ -8397,7 +8397,7 @@ namespace Server
|
|||
|
||||
var n = Notoriety.Compute(this, target);
|
||||
|
||||
return n == Notoriety.Criminal || n == Notoriety.Murderer;
|
||||
return n is Notoriety.Criminal or Notoriety.Murderer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ namespace Server.Network
|
|||
|
||||
private void SetPacketTime(int packetID)
|
||||
{
|
||||
if (packetID < 0 || packetID >= 0x100)
|
||||
if (packetID is < 0 or >= 0x100)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -233,7 +233,7 @@ namespace Server.Network
|
|||
|
||||
public long GetPacketDelay(int packetID)
|
||||
{
|
||||
if (packetID < 0 || packetID >= 0x100)
|
||||
if (packetID is < 0 or >= 0x100)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ namespace Server.Network
|
|||
|
||||
private void UpdatePacketCount(int packetID)
|
||||
{
|
||||
if (packetID < 0 || packetID >= 0x100)
|
||||
if (packetID is < 0 or >= 0x100)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -728,7 +728,7 @@ namespace Server.Network
|
|||
{
|
||||
reader.Advance((uint)packetLength);
|
||||
}
|
||||
else if (_parserState == ParserState.AwaitingPartialPacket || _parserState == ParserState.Throttled)
|
||||
else if (_parserState is ParserState.AwaitingPartialPacket or ParserState.Throttled)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Server.Network
|
|||
reader.ReadInt16(); // font
|
||||
var text = reader.ReadAsciiSafe().Trim();
|
||||
|
||||
if (text.Length <= 0 || text.Length > 128)
|
||||
if (text.Length is <= 0 or > 128)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ namespace Server.Network
|
|||
var count = (value & 0xFFF0) >> 4;
|
||||
var hold = value & 0xF;
|
||||
|
||||
if (count < 0 || count > 50)
|
||||
if (count is < 0 or > 50)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ namespace Server.Network
|
|||
|
||||
text = text.Trim();
|
||||
|
||||
if (text.Length <= 0 || text.Length > 128)
|
||||
if (text.Length is <= 0 or > 128)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
if (Lock < SkillLock.Up || Lock > SkillLock.Locked)
|
||||
if (Lock is < SkillLock.Up or > SkillLock.Locked)
|
||||
{
|
||||
Console.WriteLine("Bad skill lock -> {0}.{1}", owner.Owner, Lock);
|
||||
Lock = SkillLock.Up;
|
||||
|
|
@ -323,7 +323,7 @@ namespace Server
|
|||
|
||||
public void SetLockNoRelay(SkillLock skillLock)
|
||||
{
|
||||
if (skillLock < SkillLock.Up || skillLock > SkillLock.Locked)
|
||||
if (skillLock is < SkillLock.Up or > SkillLock.Locked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ namespace Server
|
|||
|
||||
if (endOfSection || i + 1 == end)
|
||||
{
|
||||
if (number < 0 || number > 255)
|
||||
if (number is < 0 or > 255)
|
||||
{
|
||||
valid = false;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -758,7 +758,7 @@ namespace Server.Accounting
|
|||
|
||||
private static void EventSink_Connected(Mobile m)
|
||||
{
|
||||
if (!(m.Account is Account acc))
|
||||
if (m.Account is not Account acc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ namespace Server.Misc
|
|||
{
|
||||
var from = e.Mobile;
|
||||
|
||||
if (!(from.Account is Account acct))
|
||||
if (@from.Account is not Account acct)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ namespace Server.Misc
|
|||
|
||||
private static void EventSink_DeleteRequest(NetState state, int index)
|
||||
{
|
||||
if (!(state.Account is Account acct))
|
||||
if (state.Account is not Account acct)
|
||||
{
|
||||
state.Disconnect("Attempted to delete a character but the account could not be found.");
|
||||
return;
|
||||
|
|
@ -349,7 +349,7 @@ namespace Server.Misc
|
|||
|
||||
e.Accepted = false;
|
||||
|
||||
if (!(Accounts.GetAccount(un) is Account acct))
|
||||
if (Accounts.GetAccount(un) is not Account acct)
|
||||
{
|
||||
// To prevent someone from making an account of just '' or a bunch of meaningless spaces
|
||||
if (AutoAccountCreation && un.Trim().Length > 0)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ namespace Server
|
|||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (!(targeted is IPoint3D p))
|
||||
if (targeted is not IPoint3D p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Commands
|
|||
|
||||
foreach (var item in World.Items.Values)
|
||||
{
|
||||
if ((item is Static || item is BaseFloor || item is BaseWall)
|
||||
if (item is Static or BaseFloor or BaseWall
|
||||
&& item.RootParent == null)
|
||||
{
|
||||
w.WriteLine("SECTION WORLDITEM {0}", count);
|
||||
|
|
|
|||
|
|
@ -347,9 +347,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
var result = Properties.IncreaseValue(e.Mobile, obj, e.Arguments);
|
||||
|
||||
if (result == "The property has been increased." || result == "The properties have been increased." ||
|
||||
result == "The property has been decreased." || result == "The properties have been decreased." ||
|
||||
result == "The properties have been changed.")
|
||||
if (result is "The property has been increased." or "The properties have been increased." or "The property has been decreased." or "The properties have been decreased." or "The properties have been changed.")
|
||||
{
|
||||
AddResponse(result);
|
||||
}
|
||||
|
|
@ -556,7 +554,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
public override void Execute(CommandEventArgs e, object obj)
|
||||
{
|
||||
if (!(obj is IPoint3D p))
|
||||
if (obj is not IPoint3D p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -588,7 +586,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
public override void Execute(CommandEventArgs e, object obj)
|
||||
{
|
||||
if (!(obj is IPoint3D p))
|
||||
if (obj is not IPoint3D p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -787,8 +785,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
var result = Properties.GetValue(e.Mobile, obj, e.GetString(i));
|
||||
|
||||
if (result == "Property not found." || result == "Property is write only." ||
|
||||
result.StartsWithOrdinal("Getting this property"))
|
||||
if (result is "Property not found." or "Property is write only." || result.StartsWithOrdinal("Getting this property"))
|
||||
{
|
||||
LogFailure(result);
|
||||
}
|
||||
|
|
@ -1285,7 +1282,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
public override void Execute(CommandEventArgs e, object obj)
|
||||
{
|
||||
if (!(obj is Item item))
|
||||
if (obj is not Item item)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
house = null;
|
||||
|
||||
if (item == null || item is BaseMulti || item is HouseSign || staticsOnly && !(item is Static))
|
||||
if (item is null or BaseMulti or HouseSign || staticsOnly && item is not Static)
|
||||
{
|
||||
return DesignInsertResult.InvalidItem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ namespace Server.Commands.Generic
|
|||
throw new InvalidOperationException("Invalid string comparison operator.");
|
||||
}
|
||||
|
||||
if (m_Operator == StringOperator.Equal || m_Operator == StringOperator.NotEqual)
|
||||
if (m_Operator is StringOperator.Equal or StringOperator.NotEqual)
|
||||
{
|
||||
emitter.BeginCall(
|
||||
type.GetMethod(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace Server.Commands.Generic
|
|||
return; // sanity check
|
||||
}
|
||||
|
||||
if (!(targeted is Container cont))
|
||||
if (targeted is not Container cont)
|
||||
{
|
||||
from.SendMessage("That is not a container.");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
case ObjectTypes.Both:
|
||||
{
|
||||
if (!(targeted is Item || targeted is Mobile))
|
||||
if (!(targeted is Item or Mobile))
|
||||
{
|
||||
from.SendMessage("This command does not work on that.");
|
||||
return;
|
||||
|
|
@ -56,7 +56,7 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
case ObjectTypes.Items:
|
||||
{
|
||||
if (!(targeted is Item))
|
||||
if (targeted is not Item)
|
||||
{
|
||||
from.SendMessage("This command only works on items.");
|
||||
return;
|
||||
|
|
@ -66,7 +66,7 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
case ObjectTypes.Mobiles:
|
||||
{
|
||||
if (!(targeted is Mobile))
|
||||
if (targeted is not Mobile)
|
||||
{
|
||||
from.SendMessage("This command only works on mobiles.");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
case ObjectTypes.Items:
|
||||
{
|
||||
if (!(obj is Item))
|
||||
if (obj is not Item)
|
||||
{
|
||||
e.Mobile.SendMessage("This command only works on items.");
|
||||
return;
|
||||
|
|
@ -62,7 +62,7 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
case ObjectTypes.Mobiles:
|
||||
{
|
||||
if (!(obj is Mobile))
|
||||
if (obj is not Mobile)
|
||||
{
|
||||
e.Mobile.SendMessage("This command only works on mobiles.");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
case ObjectTypes.Both:
|
||||
{
|
||||
if (!(targeted is Item) && !(targeted is Mobile))
|
||||
if (targeted is not Item && targeted is not Mobile)
|
||||
{
|
||||
from.SendMessage("This command does not work on that.");
|
||||
return;
|
||||
|
|
@ -78,7 +78,7 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
case ObjectTypes.Items:
|
||||
{
|
||||
if (!(targeted is Item))
|
||||
if (targeted is not Item)
|
||||
{
|
||||
from.SendMessage("This command only works on items.");
|
||||
return;
|
||||
|
|
@ -88,7 +88,7 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
case ObjectTypes.Mobiles:
|
||||
{
|
||||
if (!(targeted is Mobile))
|
||||
if (targeted is not Mobile)
|
||||
{
|
||||
from.SendMessage("This command only works on mobiles.");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ namespace Server.Commands
|
|||
{
|
||||
map = Map.AllMaps[i];
|
||||
|
||||
if (map.MapIndex == 0x7F || map.MapIndex == 0xFF)
|
||||
if (map.MapIndex is 0x7F or 0xFF)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -595,7 +595,7 @@ namespace Server.Commands
|
|||
{
|
||||
map = Map.AllMaps[i];
|
||||
|
||||
if (map.MapIndex == 0x7F || map.MapIndex == 0xFF || from.Map == map)
|
||||
if (map.MapIndex is 0x7F or 0xFF || @from.Map == map)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -629,7 +629,7 @@ namespace Server.Commands
|
|||
|
||||
from.SendMessage("Region name not found");
|
||||
}
|
||||
else if (e.Length == 2 || e.Length == 3)
|
||||
else if (e.Length is 2 or 3)
|
||||
{
|
||||
var map = from.Map;
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ namespace Server.Commands
|
|||
continue;
|
||||
}
|
||||
|
||||
if (usage == null || !(attrs[0] is DescriptionAttribute desc))
|
||||
if (usage == null || attrs[0] is not DescriptionAttribute desc)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ namespace Server.Commands
|
|||
|
||||
public override void Execute(CommandEventArgs e, object obj)
|
||||
{
|
||||
if (!(obj is IPoint3D point))
|
||||
if (obj is not IPoint3D point)
|
||||
{
|
||||
LogFailure("That cannot be located.");
|
||||
return;
|
||||
}
|
||||
|
||||
var label = $"(x:{point.X}, y:{point.Y}, z:{point.Z})";
|
||||
if (obj is LandTarget || obj is StaticTarget)
|
||||
if (obj is LandTarget or StaticTarget)
|
||||
{
|
||||
List<int> graphics;
|
||||
if (e.Arguments.Length == 0)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace Server.Commands
|
|||
|
||||
var path = Core.BaseDirectory;
|
||||
|
||||
var name = !(from.Account is Account acct) ? from.Name : acct.Username;
|
||||
var name = @from.Account is not Account acct ? from.Name : acct.Username;
|
||||
|
||||
AppendPath(ref path, "Logs");
|
||||
AppendPath(ref path, "Commands");
|
||||
|
|
|
|||
|
|
@ -1107,7 +1107,7 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (srcItem is Teleporter || srcItem is FillableContainer || srcItem is BaseBook)
|
||||
else if (srcItem is Teleporter or FillableContainer or BaseBook)
|
||||
{
|
||||
eable = map.GetItemsInRange(new Point3D(x, y, z), 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (srcItem is Teleporter || srcItem is FillableContainer || srcItem is BaseBook)
|
||||
else if (srcItem is Teleporter or FillableContainer or BaseBook)
|
||||
{
|
||||
eable = map.GetItemsInRange(new Point3D(x, y, z), 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ namespace Server.Commands
|
|||
var count = 0;
|
||||
foreach (var item in eable)
|
||||
{
|
||||
if (!(item is KeywordTeleporter || item is SkillTeleporter) && IsWithinZ(item.Z - worldLocation.Z))
|
||||
if (!(item is KeywordTeleporter or SkillTeleporter) && IsWithinZ(item.Z - worldLocation.Z))
|
||||
{
|
||||
count++;
|
||||
item.Delete();
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ namespace Server.Commands
|
|||
{
|
||||
var obj = realProps[i].GetValue(realObjs[i], null);
|
||||
|
||||
if (!(obj is IConvertible))
|
||||
if (obj is not IConvertible)
|
||||
{
|
||||
return "Property is not IConvertable.";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ namespace Server
|
|||
continue;
|
||||
}
|
||||
|
||||
if (item is Static || item is BaseFloor || item is BaseWall)
|
||||
if (item is Static or BaseFloor or BaseWall)
|
||||
{
|
||||
var itemMap = item.Map;
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ namespace Server
|
|||
|
||||
foreach (var item in eable)
|
||||
{
|
||||
if (item is Static || item is BaseFloor || item is BaseWall)
|
||||
if (item is Static or BaseFloor or BaseWall)
|
||||
{
|
||||
var itemMap = item.Map;
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ namespace Server
|
|||
var xOffset = item.X - state.m_X * 8;
|
||||
var yOffset = item.Y - state.m_Y * 8;
|
||||
|
||||
if (xOffset < 0 || xOffset >= 8 || yOffset < 0 || yOffset >= 8)
|
||||
if (xOffset is < 0 or >= 8 || yOffset is < 0 or >= 8)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace Server.Commands
|
|||
|
||||
foreach (var obj in eable)
|
||||
{
|
||||
if (items && obj is Item && !(obj is BaseMulti || obj is HouseSign))
|
||||
if (items && obj is Item && !(obj is BaseMulti or HouseSign))
|
||||
{
|
||||
toDelete.Add(obj);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
var price = Utility.ToInt32(text);
|
||||
|
||||
if (price < 0 || price > 250000000)
|
||||
if (price is < 0 or > 250000000)
|
||||
{
|
||||
from.SendLocalizedMessage(1062390); // The price you requested is outrageous!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Server.Engines.BulkOrders
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(m_Book.RootParent is PlayerVendor pv))
|
||||
if (m_Book.RootParent is not PlayerVendor pv)
|
||||
{
|
||||
m_From.SendLocalizedMessage(1062382); // The deed selected is not available.
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
private static Item CreatePowerScroll(int type)
|
||||
{
|
||||
if (type == 5 || type == 10 || type == 15 || type == 20)
|
||||
if (type is 5 or 10 or 15 or 20)
|
||||
{
|
||||
return new PowerScroll(SkillName.Blacksmith, 100 + type);
|
||||
}
|
||||
|
|
@ -545,7 +545,7 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
private static Item CreateAncientHammer(int type)
|
||||
{
|
||||
if (type == 10 || type == 15 || type == 30 || type == 60)
|
||||
if (type is 10 or 15 or 30 or 60)
|
||||
{
|
||||
return new AncientSmithyHammer(type);
|
||||
}
|
||||
|
|
@ -848,7 +848,7 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
private static Item CreatePowerScroll(int type)
|
||||
{
|
||||
if (type == 5 || type == 10 || type == 15 || type == 20)
|
||||
if (type is 5 or 10 or 15 or 20)
|
||||
{
|
||||
return new PowerScroll(SkillName.Tailoring, 100 + type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ namespace Server.Engines.BulkOrders
|
|||
from.SendLocalizedMessage(1045166);
|
||||
}
|
||||
else if (Type == null || objectType != Type && !objectType.IsSubclassOf(Type) ||
|
||||
!(item is BaseWeapon) && !(item is BaseArmor) && !(item is BaseClothing))
|
||||
item is not BaseWeapon && item is not BaseArmor && item is not BaseClothing)
|
||||
{
|
||||
from.SendLocalizedMessage(1045169); // The item is not in the request.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if (info.IsSwitched(1))
|
||||
{
|
||||
if (!(m_Challenged is PlayerMobile pm))
|
||||
if (m_Challenged is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public static bool IsFreeConsume(Mobile mob)
|
||||
{
|
||||
if (!(mob is PlayerMobile pm) || pm.DuelContext?.m_EventGame == null)
|
||||
if (mob is not PlayerMobile pm || pm.DuelContext?.m_EventGame == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -257,7 +257,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public static bool AllowSpecialAbility(Mobile from, string name, bool message)
|
||||
{
|
||||
if (!(from is PlayerMobile pm))
|
||||
if (@from is not PlayerMobile pm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -345,7 +345,7 @@ namespace Server.Engines.ConPVP
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!(weapon is BaseRanged) && !Ruleset.GetOption("Weapons", "Melee"))
|
||||
if (weapon is not BaseRanged && !Ruleset.GetOption("Weapons", "Melee"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -411,7 +411,7 @@ namespace Server.Engines.ConPVP
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!(item is BaseRefreshPotion))
|
||||
if (item is not BaseRefreshPotion)
|
||||
{
|
||||
if (CantDoAnything(from))
|
||||
{
|
||||
|
|
@ -513,7 +513,7 @@ namespace Server.Engines.ConPVP
|
|||
return false;
|
||||
}
|
||||
|
||||
if (item is BasePotion && !(item is BaseExplosionPotion) && !(item is BaseRefreshPotion) && IsSuddenDeath)
|
||||
if (item is BasePotion && item is not BaseExplosionPotion && item is not BaseRefreshPotion && IsSuddenDeath)
|
||||
{
|
||||
from.SendMessage(0x22, "You may not drink potions in sudden death.");
|
||||
return false;
|
||||
|
|
@ -655,7 +655,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public void Requip(Mobile from, Container cont)
|
||||
{
|
||||
if (!(cont is Corpse corpse))
|
||||
if (cont is not Corpse corpse)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -670,7 +670,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
var item = items[i];
|
||||
|
||||
if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || !item.Movable)
|
||||
if (item.Layer is Layer.Hair or Layer.FacialHair || !item.Movable)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1295,7 +1295,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
if (!(m is PlayerMobile pm))
|
||||
if (m is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -1385,7 +1385,7 @@ namespace Server.Engines.ConPVP
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(e.Mobile is PlayerMobile pm))
|
||||
if (e.Mobile is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -2048,7 +2048,7 @@ namespace Server.Engines.ConPVP
|
|||
int number = item switch
|
||||
{
|
||||
BaseWeapon _ => 1062001, // You can no longer wield your ~1_WEAPON~
|
||||
_ when !(item is BaseShield) && (item is BaseArmor || item is BaseClothing) => 1062002, // You can no longer wear your ~1_ARMOR~
|
||||
not BaseShield when item is BaseArmor or BaseClothing => 1062002, // You can no longer wear your ~1_ARMOR~
|
||||
_ => 1062003 // You can no longer equip your ~1_SHIELD~
|
||||
};
|
||||
|
||||
|
|
@ -2403,7 +2403,7 @@ namespace Server.Engines.ConPVP
|
|||
m_GateFacet = Initiator.Map;
|
||||
}
|
||||
|
||||
if (!(arena.Teleporter is ExitTeleporter tp))
|
||||
if (arena.Teleporter is not ExitTeleporter tp)
|
||||
{
|
||||
arena.Teleporter = tp = new ExitTeleporter();
|
||||
tp.MoveToWorld(arena.GateOut == Point3D.Zero ? arena.Outside : arena.GateOut, arena.Facet);
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ namespace Server.Engines.ConPVP
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!(obj is IPoint3D))
|
||||
if (obj is not IPoint3D)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1680,7 +1680,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public int GetTeamID(Mobile mob)
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return mob is BaseCreature creature ? creature.Team - 1 : -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -953,7 +953,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public int GetTeamID(Mobile mob)
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public int GetTeamID(Mobile mob)
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -924,7 +924,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public int GetTeamID(Mobile mob)
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return mob is BaseCreature creature ? creature.Team - 1 : -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if (info.IsSwitched(1))
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private void AddPlayer_OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (!(obj is Mobile mob) || mob == from)
|
||||
if (obj is not Mobile mob || mob == from)
|
||||
{
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
|
||||
|
|
@ -604,7 +604,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ namespace Server.Engines.ConPVP
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is Mobile mob))
|
||||
if (targeted is not Mobile mob)
|
||||
{
|
||||
from.SendMessage("That is not a player.");
|
||||
}
|
||||
|
|
@ -238,7 +238,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
case 1: // okay
|
||||
{
|
||||
if (!(m_From is PlayerMobile pm))
|
||||
if (m_From is not PlayerMobile pm)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
case TourneyBracketGumpType.Participant_Info:
|
||||
{
|
||||
if (!(obj is TourneyParticipant part))
|
||||
if (obj is not TourneyParticipant part)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -380,7 +380,7 @@ namespace Server.Engines.ConPVP
|
|||
AddLeftArrow(25, 11, ToButtonID(0, 3));
|
||||
AddHtml(25, 35, 250, 20, Center("Participants"));
|
||||
|
||||
if (!(obj is Mobile mob))
|
||||
if (obj is not Mobile mob)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -428,7 +428,7 @@ namespace Server.Engines.ConPVP
|
|||
AddLeftArrow(25, 11, ToButtonID(0, 2));
|
||||
AddHtml(25, 35, 250, 20, Center("Rounds"));
|
||||
|
||||
if (!(m_Object is PyramidLevel level))
|
||||
if (m_Object is not PyramidLevel level)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -490,9 +490,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
else if (m_Tournament.EventController != null ||
|
||||
m_Tournament.TourneyType == TourneyType.RandomTeam ||
|
||||
m_Tournament.TourneyType == TourneyType.RedVsBlue ||
|
||||
m_Tournament.TourneyType == TourneyType.Faction)
|
||||
m_Tournament.TourneyType is TourneyType.RandomTeam or TourneyType.RedVsBlue or TourneyType.Faction)
|
||||
{
|
||||
for (var j = 0; j < match.Participants.Count; ++j)
|
||||
{
|
||||
|
|
@ -572,7 +570,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
case TourneyBracketGumpType.Match_Info:
|
||||
{
|
||||
if (!(obj is TourneyMatch match))
|
||||
if (obj is not TourneyMatch match)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -605,9 +603,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
else if (m_Tournament.EventController != null ||
|
||||
m_Tournament.TourneyType == TourneyType.RandomTeam ||
|
||||
m_Tournament.TourneyType == TourneyType.RedVsBlue ||
|
||||
m_Tournament.TourneyType == TourneyType.Faction)
|
||||
m_Tournament.TourneyType is TourneyType.RandomTeam or TourneyType.RedVsBlue or TourneyType.Faction)
|
||||
{
|
||||
for (var i = 0; i < match.Participants.Count; ++i)
|
||||
{
|
||||
|
|
@ -840,7 +836,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
case 5:
|
||||
{
|
||||
if (!(m_Object is TourneyMatch match))
|
||||
if (m_Object is not TourneyMatch match)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -990,7 +986,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
if (!(m_Object is PyramidLevel level))
|
||||
if (m_Object is not PyramidLevel level)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
var x = ourLevel - theirLevel;
|
||||
|
||||
if (x < -6 || x > +6)
|
||||
if (x is < -6 or > +6)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
var copy = new List<TourneyParticipant>(participants);
|
||||
|
||||
if (groupType == GroupingType.Nearest || groupType == GroupingType.HighVsLow)
|
||||
if (groupType is GroupingType.Nearest or GroupingType.HighVsLow)
|
||||
{
|
||||
copy.Sort();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
for (var j = 0; j < items[i].Length; ++j)
|
||||
{
|
||||
if (!(items[i][j] is IHasQuantity hq))
|
||||
if (items[i][j] is not IHasQuantity hq)
|
||||
{
|
||||
totals[i] += items[i][j].Amount;
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
var item = items[i][j];
|
||||
|
||||
if (!(item is IHasQuantity hq))
|
||||
if (item is not IHasQuantity hq)
|
||||
{
|
||||
var theirAmount = item.Amount;
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
for (var i = 0; i < items.Length; ++i)
|
||||
{
|
||||
if (!(items[i] is IHasQuantity hq))
|
||||
if (items[i] is not IHasQuantity hq)
|
||||
{
|
||||
amount += items[i].Amount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace Server.Engines.Craft
|
|||
return EnhanceResult.NotInBackpack;
|
||||
}
|
||||
|
||||
if (!(item is BaseArmor) && !(item is BaseWeapon))
|
||||
if (item is not BaseArmor && item is not BaseWeapon)
|
||||
{
|
||||
return EnhanceResult.BadItem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,11 +90,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
if (m_CraftSystem is DefTailoring)
|
||||
{
|
||||
return clothing is BearMask
|
||||
|| clothing is DeerMask
|
||||
|| clothing is TheMostKnowledgePerson
|
||||
|| clothing is TheRobeOfBritanniaAri
|
||||
|| clothing is EmbroideredOakLeafCloak;
|
||||
return clothing is BearMask or DeerMask or TheMostKnowledgePerson or TheRobeOfBritanniaAri or EmbroideredOakLeafCloak;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -106,44 +102,23 @@ namespace Server.Engines.Craft
|
|||
|
||||
if (m_CraftSystem is DefTinkering)
|
||||
{
|
||||
return weapon is Cleaver
|
||||
|| weapon is Hatchet
|
||||
|| weapon is Pickaxe
|
||||
|| weapon is ButcherKnife
|
||||
|| weapon is SkinningKnife;
|
||||
return weapon is Cleaver or Hatchet or Pickaxe or ButcherKnife or SkinningKnife;
|
||||
}
|
||||
|
||||
if (m_CraftSystem is DefCarpentry)
|
||||
{
|
||||
return weapon is Club
|
||||
|| weapon is BlackStaff
|
||||
|| weapon is MagicWand
|
||||
|
||||
// TODO: Make these items craftable
|
||||
|| weapon is WildStaff;
|
||||
return weapon is Club or BlackStaff or MagicWand or WildStaff;
|
||||
}
|
||||
|
||||
if (m_CraftSystem is DefBlacksmithy)
|
||||
{
|
||||
return weapon is Pitchfork
|
||||
|
||||
// TODO: Make these items craftable
|
||||
|| weapon is RadiantScimitar
|
||||
|| weapon is WarCleaver
|
||||
|| weapon is ElvenSpellblade
|
||||
|| weapon is AssassinSpike
|
||||
|| weapon is Leafblade
|
||||
|| weapon is RuneBlade
|
||||
|| weapon is ElvenMachete
|
||||
|| weapon is OrnateAxe
|
||||
|| weapon is DiamondMace;
|
||||
return weapon is Pitchfork or RadiantScimitar or WarCleaver or ElvenSpellblade or AssassinSpike or Leafblade or RuneBlade or ElvenMachete or OrnateAxe or DiamondMace;
|
||||
}
|
||||
|
||||
// TODO: Make these items craftable
|
||||
if (m_CraftSystem is DefBowFletching)
|
||||
{
|
||||
return weapon is ElvenCompositeLongbow
|
||||
|| weapon is MagicalShortbow;
|
||||
return weapon is ElvenCompositeLongbow or MagicalShortbow;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -156,36 +131,17 @@ namespace Server.Engines.Craft
|
|||
// TODO: Make these items craftable
|
||||
if (m_CraftSystem is DefTailoring)
|
||||
{
|
||||
return armor is LeafTonlet
|
||||
|| armor is LeafArms
|
||||
|| armor is LeafChest
|
||||
|| armor is LeafGloves
|
||||
|| armor is LeafGorget
|
||||
|| armor is LeafLegs
|
||||
|| armor is HideChest
|
||||
|| armor is HideGloves
|
||||
|| armor is HideGorget
|
||||
|| armor is HidePants
|
||||
|| armor is HidePauldrons;
|
||||
return armor is LeafTonlet or LeafArms or LeafChest or LeafGloves or LeafGorget or LeafLegs or HideChest or HideGloves or HideGorget or HidePants or HidePauldrons;
|
||||
}
|
||||
|
||||
if (m_CraftSystem is DefCarpentry)
|
||||
{
|
||||
return armor is WingedHelm
|
||||
|| armor is RavenHelm
|
||||
|| armor is VultureHelm
|
||||
|| armor is WoodlandArms
|
||||
|| armor is WoodlandChest
|
||||
|| armor is WoodlandGloves
|
||||
|| armor is WoodlandGorget
|
||||
|| armor is WoodlandLegs;
|
||||
return armor is WingedHelm or RavenHelm or VultureHelm or WoodlandArms or WoodlandChest or WoodlandGloves or WoodlandGorget or WoodlandLegs;
|
||||
}
|
||||
|
||||
if (m_CraftSystem is DefBlacksmithy)
|
||||
{
|
||||
return armor is Circlet
|
||||
|| armor is RoyalCirclet
|
||||
|| armor is GemmedCirclet;
|
||||
return armor is Circlet or RoyalCirclet or GemmedCirclet;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -448,7 +404,7 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
|
||||
if (m_CraftSystem.CraftItems.SearchForSubclass(clothing.GetType()) == null &&
|
||||
!IsSpecialClothing(clothing) && !(clothing is TribalMask || clothing is HornedTribalMask))
|
||||
!IsSpecialClothing(clothing) && !(clothing is TribalMask or HornedTribalMask))
|
||||
{
|
||||
number = usingDeed
|
||||
? 1061136
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace Server.Engines.Craft
|
|||
int index;
|
||||
|
||||
// Other Items
|
||||
if (Core.Expansion == Expansion.AOS || Core.Expansion == Expansion.SE)
|
||||
if (Core.Expansion is Expansion.AOS or Expansion.SE)
|
||||
{
|
||||
index = AddCraft(typeof(Board), 1044294, 1027127, 0.0, 0.0, typeof(Log), 1044466, 1, 1044465);
|
||||
SetUseAllRes(index, true);
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ namespace Server.Engines.Doom
|
|||
_ => new MushroomTrap()
|
||||
};
|
||||
|
||||
if (trap is FireColumnTrap || trap is MushroomTrap)
|
||||
if (trap is FireColumnTrap or MushroomTrap)
|
||||
{
|
||||
trap.Hue = 0x451;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace Server.Engines.Doom
|
|||
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
if (m == null || m is WandererOfTheVoid)
|
||||
if (m is null or WandererOfTheVoid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ namespace Server.Ethics
|
|||
|
||||
foreach (var item in eable)
|
||||
{
|
||||
if (item is AnkhNorth || item is AnkhWest)
|
||||
if (item is AnkhNorth or AnkhWest)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
var fac = Faction.Find(mob);
|
||||
|
||||
return fac is Minax || fac is Shadowlords;
|
||||
return fac is Minax or Shadowlords;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Server.Ethics.Evil
|
|||
|
||||
private void Power_OnTarget(Mobile fromMobile, object obj, Player from)
|
||||
{
|
||||
if (!(obj is IPoint3D p))
|
||||
if (obj is not IPoint3D p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Ethics.Evil
|
|||
|
||||
private void Power_OnTarget(Mobile fromMobile, object obj, Player from)
|
||||
{
|
||||
if (!(obj is Item item))
|
||||
if (obj is not Item item)
|
||||
{
|
||||
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may not imbue that.");
|
||||
return;
|
||||
|
|
@ -45,7 +45,7 @@ namespace Server.Ethics.Evil
|
|||
return;
|
||||
}
|
||||
|
||||
var canImbue = (item is Spellbook || item is BaseClothing || item is BaseArmor || item is BaseWeapon) &&
|
||||
var canImbue = item is Spellbook or BaseClothing or BaseArmor or BaseWeapon &&
|
||||
item.Name == null;
|
||||
|
||||
if (canImbue)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Server.Ethics.Hero
|
|||
|
||||
var fac = Faction.Find(mob);
|
||||
|
||||
return fac is TrueBritannians || fac is CouncilOfMages;
|
||||
return fac is TrueBritannians or CouncilOfMages;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Server.Ethics.Hero
|
|||
|
||||
private void Power_OnTarget(Mobile fromMobile, object obj, Player from)
|
||||
{
|
||||
if (!(obj is IPoint3D p))
|
||||
if (obj is not IPoint3D p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Ethics.Hero
|
|||
|
||||
private void Power_OnTarget(Mobile fromMobile, object obj, Player from)
|
||||
{
|
||||
if (!(obj is Item item))
|
||||
if (obj is not Item item)
|
||||
{
|
||||
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may not imbue that.");
|
||||
return;
|
||||
|
|
@ -45,7 +45,7 @@ namespace Server.Ethics.Hero
|
|||
return;
|
||||
}
|
||||
|
||||
var canImbue = (item is Spellbook || item is BaseClothing || item is BaseArmor || item is BaseWeapon) &&
|
||||
var canImbue = item is Spellbook or BaseClothing or BaseArmor or BaseWeapon &&
|
||||
item.Name == null;
|
||||
|
||||
if (canImbue)
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ namespace Server.Factions
|
|||
|
||||
public static bool IsFactionBanned(Mobile mob)
|
||||
{
|
||||
if (!(mob.Account is Account acct))
|
||||
if (mob.Account is not Account acct)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ namespace Server.Factions
|
|||
|
||||
public void OnJoinAccepted(Mobile mob)
|
||||
{
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return; // sanity
|
||||
}
|
||||
|
|
@ -571,7 +571,7 @@ namespace Server.Factions
|
|||
|
||||
for (var i = 0; i < members.Count; ++i)
|
||||
{
|
||||
if (!(members[i] is PlayerMobile member))
|
||||
if (members[i] is not PlayerMobile member)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -767,7 +767,7 @@ namespace Server.Factions
|
|||
|
||||
foreach (var item in World.Items.Values)
|
||||
{
|
||||
if (item is IFactionItem && !(item is HoodedShroudOfShadows))
|
||||
if (item is IFactionItem && item is not HoodedShroudOfShadows)
|
||||
{
|
||||
items.Add(item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ namespace Server.Factions
|
|||
|
||||
public static Item Imbue(Item item, Faction faction, bool expire, int hue)
|
||||
{
|
||||
if (!(item is IFactionItem))
|
||||
if (item is not IFactionItem)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace Server.Factions
|
|||
{
|
||||
case 1: // continue
|
||||
{
|
||||
if (!(m_From.Guild is Guild guild))
|
||||
if (m_From.Guild is not Guild guild)
|
||||
{
|
||||
var pl = PlayerState.Find(m_From);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Server
|
|||
TargetFlags.None,
|
||||
(from, obj, stormsEye) =>
|
||||
{
|
||||
if (!stormsEye.Movable || stormsEye.Deleted || !(obj is IPoint3D pt))
|
||||
if (!stormsEye.Movable || stormsEye.Deleted || obj is not IPoint3D pt)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ namespace Server.Factions
|
|||
return false;
|
||||
}
|
||||
|
||||
if (m_Guard.Weapon is Item weapon && weapon.Parent == m_Guard && !(weapon is Fists))
|
||||
if (m_Guard.Weapon is Item weapon && weapon.Parent == m_Guard && weapon is not Fists)
|
||||
{
|
||||
pack.DropItem(weapon);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -25,13 +25,12 @@ namespace Server.Engines.Harvest
|
|||
var itemID = target.ItemID;
|
||||
|
||||
// grave
|
||||
if (itemID == 0xED3 || itemID == 0xEDF || itemID == 0xEE0 || itemID == 0xEE1 || itemID == 0xEE2 ||
|
||||
itemID == 0xEE8)
|
||||
if (itemID is 0xED3 or 0xEDF or 0xEE0 or 0xEE1 or 0xEE2 or 0xEE8)
|
||||
{
|
||||
if (from is PlayerMobile player)
|
||||
{
|
||||
var qs = player.Quest;
|
||||
if (!(qs is WitchApprenticeQuest))
|
||||
if (qs is not WitchApprenticeQuest)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ namespace Server.Engines.Harvest
|
|||
|
||||
public override bool Give(Mobile m, Item item, bool placeAtFeet)
|
||||
{
|
||||
if (item is TreasureMap || item is MessageInABottle || item is SpecialFishingNet)
|
||||
if (item is TreasureMap or MessageInABottle or SpecialFishingNet)
|
||||
{
|
||||
BaseCreature serp;
|
||||
|
||||
|
|
@ -395,7 +395,7 @@ namespace Server.Engines.Harvest
|
|||
return true; // we don't want to give the item to the player, it's on the serpent
|
||||
}
|
||||
|
||||
return base.Give(m, item, placeAtFeet || item is BigFish || item is WoodenChest || item is MetalGoldenChest);
|
||||
return base.Give(m, item, placeAtFeet || item is BigFish or WoodenChest or MetalGoldenChest);
|
||||
}
|
||||
|
||||
public override void SendSuccessTo(Mobile from, Item item, HarvestResource resource)
|
||||
|
|
@ -405,7 +405,7 @@ namespace Server.Engines.Harvest
|
|||
from.SendLocalizedMessage(1042635); // Your fishing pole bends as you pull a big fish from the depths!
|
||||
fish.Fisher = from;
|
||||
}
|
||||
else if (item is WoodenChest || item is MetalGoldenChest)
|
||||
else if (item is WoodenChest or MetalGoldenChest)
|
||||
{
|
||||
from.SendLocalizedMessage(503175); // You pull up a heavy chest from the depths of the ocean!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ namespace Server.Engines.Harvest
|
|||
{
|
||||
item.LabelTo(from, 500464); // Use this on corpses to carve away meat and hide
|
||||
}
|
||||
else if (toHarvest is StaticTarget || toHarvest is LandTarget)
|
||||
else if (toHarvest is StaticTarget or LandTarget)
|
||||
{
|
||||
from.SendLocalizedMessage(500489); // You can't use an axe on that.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ namespace Server.Engines.Help
|
|||
|
||||
public static bool CheckAllowedToPage(Mobile from)
|
||||
{
|
||||
if (!(from is PlayerMobile pm))
|
||||
if (@from is not PlayerMobile pm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Server.Engines.Help
|
|||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (!(targeted is PlayerMobile pm))
|
||||
if (targeted is not PlayerMobile pm)
|
||||
{
|
||||
from.SendMessage("Speech logs aren't supported on that target.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (!(sender.Mobile is PlayerMobile pm))
|
||||
if (sender.Mobile is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
|
||||
CloseCurrent(state);
|
||||
|
||||
if (!(state.Mobile is PlayerMobile pm))
|
||||
if (state.Mobile is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -325,7 +325,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!(from is PlayerMobile pm))
|
||||
if (@from is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!(from is PlayerMobile pm) || pm.Backpack == null)
|
||||
if (@from is not PlayerMobile pm || pm.Backpack == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace Server.Engines.MLQuests.Items
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!(m is PlayerMobile pm))
|
||||
if (m is not PlayerMobile pm)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ namespace Server.Engines.MLQuests
|
|||
{
|
||||
var m = e.Mobile;
|
||||
|
||||
if (e.Length == 0 || e.Length > 2)
|
||||
if (e.Length is 0 or > 2)
|
||||
{
|
||||
m.SendMessage("Syntax: SaveQuest <id> [saveEnabled=true]");
|
||||
return;
|
||||
|
|
@ -638,7 +638,7 @@ namespace Server.Engines.MLQuests
|
|||
|
||||
public static void EventSink_QuestGumpRequest(Mobile m)
|
||||
{
|
||||
if (!Enabled || !(m is PlayerMobile pm))
|
||||
if (!Enabled || m is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -809,7 +809,7 @@ namespace Server.Engines.MLQuests
|
|||
{
|
||||
var from = e.Mobile;
|
||||
|
||||
if (!(obj is PlayerMobile pm))
|
||||
if (obj is not PlayerMobile pm)
|
||||
{
|
||||
LogFailure("That is not a player.");
|
||||
return;
|
||||
|
|
@ -840,7 +840,7 @@ namespace Server.Engines.MLQuests
|
|||
|
||||
public override void Execute(CommandEventArgs e, object obj)
|
||||
{
|
||||
if (!(obj is PlayerMobile pm))
|
||||
if (obj is not PlayerMobile pm)
|
||||
{
|
||||
LogFailure("They have no ML quest context.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
{
|
||||
var itemid = LabelToItemID(name.Number);
|
||||
|
||||
if (itemid <= 0 || itemid > 0x4000)
|
||||
if (itemid is <= 0 or > 0x4000)
|
||||
{
|
||||
Console.WriteLine("Warning: cliloc {0} is likely giving the wrong item ID", name.Number);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
{
|
||||
var itemid = CollectObjective.LabelToItemID(name.Number);
|
||||
|
||||
if (itemid <= 0 || itemid > 0x4000)
|
||||
if (itemid is <= 0 or > 0x4000)
|
||||
{
|
||||
logger.Warning("Cliloc {0} is likely giving the wrong item ID", name.Number);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.PathAlgorithms
|
|||
var y = yDest + 1 - ySource;
|
||||
var v = y * 3 + x;
|
||||
|
||||
if (v < 0 || v >= 9)
|
||||
if (v is < 0 or >= 9)
|
||||
{
|
||||
return Direction.North;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ namespace Server.Engines.Plants
|
|||
AddItem(127, 112, 0xC62);
|
||||
}
|
||||
|
||||
if (status == PlantStatus.Stage3 || status == PlantStatus.Stage4)
|
||||
if (status is PlantStatus.Stage3 or PlantStatus.Stage4)
|
||||
{
|
||||
AddItem(129, 85, 0xC7E);
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ namespace Server.Engines.Plants
|
|||
var hueInfo = PlantHueInfo.GetInfo(m_Plant.PlantHue);
|
||||
|
||||
// The large images for these trees trigger a client crash, so use a smaller, generic tree.
|
||||
if (m_Plant.PlantType == PlantType.CypressTwisted || m_Plant.PlantType == PlantType.CypressStraight)
|
||||
if (m_Plant.PlantType is PlantType.CypressTwisted or PlantType.CypressStraight)
|
||||
{
|
||||
AddItem(130 + typeInfo.OffsetX, 96 + typeInfo.OffsetY, 0x0CCA, hueInfo.Hue);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is LandTarget land))
|
||||
if (targeted is not LandTarget land)
|
||||
{
|
||||
from.LocalOverheadMessage(
|
||||
MessageType.Regular,
|
||||
|
|
|
|||
|
|
@ -65,11 +65,11 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is Item item) || !item.IsChildOf(from.Backpack))
|
||||
if (targeted is not Item item || !item.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (!(item is BaseBook))
|
||||
else if (item is not BaseBook)
|
||||
{
|
||||
item.LabelTo(from, 1061911); // You can only use red leaves to seal the ink into book pages!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ namespace Server.Engines.Plants
|
|||
public static PlantHue GetNotBright(PlantHue plantHue) => plantHue & ~PlantHue.Bright;
|
||||
|
||||
public static bool IsPrimary(PlantHue plantHue) =>
|
||||
plantHue == PlantHue.Red || plantHue == PlantHue.Blue || plantHue == PlantHue.Yellow;
|
||||
plantHue is PlantHue.Red or PlantHue.Blue or PlantHue.Yellow;
|
||||
|
||||
public static PlantHue Cross(PlantHue first, PlantHue second)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace Server.Engines.Plants
|
|||
get => m_PlantStatus;
|
||||
set
|
||||
{
|
||||
if (m_PlantStatus == value || value < PlantStatus.BowlOfDirt || value > PlantStatus.DeadTwigs)
|
||||
if (m_PlantStatus == value || value is < PlantStatus.BowlOfDirt or > PlantStatus.DeadTwigs)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -151,7 +151,7 @@ namespace Server.Engines.Plants
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!(RootParent is Mobile owner))
|
||||
if (RootParent is not Mobile owner)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -491,7 +491,7 @@ namespace Server.Engines.Plants
|
|||
|
||||
var full = false;
|
||||
|
||||
if (effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly)
|
||||
if (effect is PotionEffect.PoisonGreater or PotionEffect.PoisonDeadly)
|
||||
{
|
||||
if (PlantSystem.IsFullPoisonPotion)
|
||||
{
|
||||
|
|
@ -535,9 +535,7 @@ namespace Server.Engines.Plants
|
|||
PlantSystem.StrengthPotion++;
|
||||
}
|
||||
}
|
||||
else if (effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison ||
|
||||
effect == PotionEffect.CureLesser || effect == PotionEffect.Cure ||
|
||||
effect == PotionEffect.HealLesser || effect == PotionEffect.Heal || effect == PotionEffect.Strength)
|
||||
else if (effect is PotionEffect.PoisonLesser or PotionEffect.Poison or PotionEffect.CureLesser or PotionEffect.Cure or PotionEffect.HealLesser or PotionEffect.Heal or PotionEffect.Strength)
|
||||
{
|
||||
message = 1053068; // This potion is not powerful enough to use on a plant!
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
var plant = plants[i];
|
||||
|
||||
if (plant.IsGrowable && !(plant.RootParent is Mobile) && now >= plant.PlantSystem.NextGrowth)
|
||||
if (plant.IsGrowable && plant.RootParent is not Mobile && now >= plant.PlantSystem.NextGrowth)
|
||||
{
|
||||
plant.PlantSystem.DoGrowthCheck();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ namespace Server.Engines.Plants
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(targeted is PlantItem targ) || targ.PlantStatus >= PlantStatus.DecorativePlant ||
|
||||
targ.PlantStatus <= PlantStatus.BowlOfDirt)
|
||||
if (targeted is not PlantItem targ || targ.PlantStatus is >= PlantStatus.DecorativePlant or <= PlantStatus.BowlOfDirt)
|
||||
{
|
||||
m_Plant.LabelTo(from, 1053070); // You can only pollinate other specially grown plants!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,8 +129,7 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
var from = sender.Mobile;
|
||||
|
||||
if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant ||
|
||||
m_Plant.PlantStatus == PlantStatus.BowlOfDirt)
|
||||
if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus is >= PlantStatus.DecorativePlant or PlantStatus.BowlOfDirt)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ namespace Server.Engines.Plants
|
|||
|
||||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (!(newItem is Seed newSeed))
|
||||
if (newItem is not Seed newSeed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Server.Engines.Quests.Collector
|
|||
{
|
||||
}
|
||||
|
||||
public override bool CanDrop(PlayerMobile player) => !(player.Quest is CollectorQuest);
|
||||
public override bool CanDrop(PlayerMobile player) => player.Quest is not CollectorQuest;
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -75,7 +75,7 @@ namespace Server.Engines.Quests.Collector
|
|||
{
|
||||
var qs = player.Quest;
|
||||
|
||||
if (!(qs is CollectorQuest))
|
||||
if (qs is not CollectorQuest)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ namespace Server.Engines.Quests.Collector
|
|||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Obsidian.Deleted || m_Obsidian.Quantity >= m_Completed || !(targeted is Item targ))
|
||||
if (m_Obsidian.Deleted || m_Obsidian.Quantity >= m_Completed || targeted is not Item targ)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Server.Engines.Quests.Collector
|
|||
{
|
||||
var qs = player.Quest;
|
||||
|
||||
if (!(qs is CollectorQuest))
|
||||
if (qs is not CollectorQuest)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ namespace Server.Engines.Quests.Collector
|
|||
{
|
||||
var qs = player.Quest;
|
||||
|
||||
if (!(qs is CollectorQuest))
|
||||
if (qs is not CollectorQuest)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
inRestartPeriod = false;
|
||||
|
||||
if (!(check is PlayerMobile pm))
|
||||
if (check is not PlayerMobile pm)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
public static bool HasLostCallingScroll(Mobile from)
|
||||
{
|
||||
if (!(from is PlayerMobile pm))
|
||||
if (@from is not PlayerMobile pm)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Server.Engines.Quests.Necro
|
|||
mob = creature.ControlMaster;
|
||||
}
|
||||
|
||||
if (!(mob is PlayerMobile pm))
|
||||
if (mob is not PlayerMobile pm)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
public override int LabelNumber => 1060149; // Calling of Kronus
|
||||
|
||||
public override bool CanDrop(PlayerMobile player) => !(player.Quest is DarkTidesQuest);
|
||||
public override bool CanDrop(PlayerMobile player) => player.Quest is not DarkTidesQuest;
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@ namespace Server.Engines.Quests.Necro
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(from is PlayerMobile pm))
|
||||
if (@from is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
public override int LabelNumber => 1028827; // Scroll of Abraxus
|
||||
|
||||
public override bool CanDrop(PlayerMobile player) => !(player.Quest is DarkTidesQuest);
|
||||
public override bool CanDrop(PlayerMobile player) => player.Quest is not DarkTidesQuest;
|
||||
|
||||
public override void OnAdded(IEntity parent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
public override bool CanTalkTo(PlayerMobile to)
|
||||
{
|
||||
if (!(to.Quest is DarkTidesQuest qs))
|
||||
if (to.Quest is not DarkTidesQuest qs)
|
||||
{
|
||||
return to.Quest == null && QuestSystem.CanOfferQuest(to, typeof(DarkTidesQuest));
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue