chore: Cleans up pattern checks. (#892)

This commit is contained in:
Kamron Batman 2021-12-24 15:53:59 -08:00 • committed by GitHub
parent 171df32257
commit 63e1b02d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
283 changed files with 587 additions and 702 deletions

View file

@ -118,9 +118,7 @@ namespace Server.Spells.Spellweaving
}
public static bool IsValidTile(int itemID) =>
itemID == 0xFEA || itemID == 0x1216 || itemID == 0x307F || itemID == 0x1D10 || itemID == 0x1D0F ||
itemID == 0x1D1F ||
itemID == 0x1D12;
itemID is 0xFEA or 0x1216 or 0x307F or 0x1D10 or 0x1D0F or 0x1D1F or 0x1D12;
private List<Mobile> GetArcanists()
{

View file

@ -34,7 +34,7 @@ namespace Server.Spells.Spellweaving
from.Holding as ArcaneFocus ?? from.Backpack?.FindItemByType<ArcaneFocus>();
public static bool CheckExpansion(Mobile from) =>
!(from is PlayerMobile) || from.NetState?.SupportsExpansion(Expansion.ML) == true;
@from is not PlayerMobile || from.NetState?.SupportsExpansion(Expansion.ML) == true;
public override bool CheckCast()
{

View file

@ -26,7 +26,7 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if (!(Caster.Weapon is BaseWeapon weapon) || weapon is Fists || weapon is BaseRanged)
if (Caster.Weapon is not BaseWeapon weapon || weapon is Fists or BaseRanged)
{
Caster.SendLocalizedMessage(1060179); // You must be wielding a weapon to use this ability!
return false;
@ -37,7 +37,7 @@ namespace Server.Spells.Spellweaving
public override void OnCast()
{
if (!(Caster.Weapon is BaseWeapon weapon) || weapon is Fists || weapon is BaseRanged)
if (Caster.Weapon is not BaseWeapon weapon || weapon is Fists or BaseRanged)
{
Caster.SendLocalizedMessage(1060179); // You must be wielding a weapon to use this ability!
}