chore: Cleans up pattern checks. (#892)
This commit is contained in:
parent
171df32257
commit
63e1b02d93
283 changed files with 587 additions and 702 deletions
|
|
@ -39,7 +39,7 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if (defender is ChaosDragoon || defender is ChaosDragoonElite)
|
||||
if (defender is ChaosDragoon or ChaosDragoonElite)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(HarvestSystem is Mining))
|
||||
if (HarvestSystem is not Mining)
|
||||
{
|
||||
from.SendLocalizedMessage(1010018); // What do you want to use this item on?
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ namespace Server.Items
|
|||
{
|
||||
var item = m.FindItemOnLayer(Layer.OneHanded);
|
||||
|
||||
return (item == null || item is Spellbook) && m.FindItemOnLayer(Layer.TwoHanded) == null;
|
||||
return item is null or Spellbook && m.FindItemOnLayer(Layer.TwoHanded) == null;
|
||||
}
|
||||
|
||||
private static void EventSink_DisarmRequest(Mobile m)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Server.Items
|
|||
|
||||
if (canSwing)
|
||||
{
|
||||
canSwing = !(attacker.Spell is Spell sp) || !sp.IsCasting || !sp.BlocksMovement;
|
||||
canSwing = attacker.Spell is not Spell sp || !sp.IsCasting || !sp.BlocksMovement;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ namespace Server.Items
|
|||
|
||||
public void OnTargetGears(Mobile from, object targ)
|
||||
{
|
||||
if (!(targ is Gears g) || !g.IsChildOf(from.Backpack))
|
||||
if (targ is not Gears g || !g.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendMessage(
|
||||
"Those are not gears."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue