C# 9 Cleanup (#325)

- [X] Removes EventArgs - not needed
- [X] Merges sequential checks
- [X] Removes redundant type declarations
This commit is contained in:
Kamron Batman 2020-11-27 00:29:21 -08:00 • committed by GitHub
parent 351611a23a
commit 3551d962f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
417 changed files with 2209 additions and 2213 deletions

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Necromancy
{
public class AnimateDeadSpell : NecromancerSpell, ISpellTargetingItem
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Animate Dead",
"Uus Corp",
203,
@ -23,9 +23,9 @@ namespace Server.Spells.Necromancy
private static readonly CreatureGroup[] m_Groups =
{
// Undead group--empty
new CreatureGroup(SlayerGroup.GetEntryByName(SlayerName.Silver).Types, Array.Empty<SummonEntry>()),
new(SlayerGroup.GetEntryByName(SlayerName.Silver).Types, Array.Empty<SummonEntry>()),
// Insects
new CreatureGroup(
new(
new[]
{
typeof(DreadSpider), typeof(FrostSpider), typeof(GiantSpider), typeof(GiantBlackWidow),
@ -43,7 +43,7 @@ namespace Server.Spells.Necromancy
}
),
// Mounts
new CreatureGroup(
new(
new[]
{
typeof(Horse), typeof(Nightmare), typeof(FireSteed),
@ -56,7 +56,7 @@ namespace Server.Spells.Necromancy
}
),
// Elementals
new CreatureGroup(
new(
new[]
{
typeof(BloodElemental), typeof(EarthElemental), typeof(SummonedEarthElemental),
@ -74,7 +74,7 @@ namespace Server.Spells.Necromancy
}
),
// Dragons
new CreatureGroup(
new(
new[]
{
typeof(AncientWyrm), typeof(Dragon), typeof(GreaterDragon), typeof(SerpentineDragon),
@ -93,7 +93,7 @@ namespace Server.Spells.Necromancy
}
),
// Default group
new CreatureGroup(
new(
Array.Empty<Type>(),
new[]
{
@ -108,7 +108,7 @@ namespace Server.Spells.Necromancy
)
};
private static readonly Dictionary<Mobile, List<Mobile>> m_Table = new Dictionary<Mobile, List<Mobile>>();
private static readonly Dictionary<Mobile, List<Mobile>> m_Table = new();
public AnimateDeadSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -157,7 +157,7 @@ namespace Server.Spells.Necromancy
}
if (c.ItemID != 0x2006 || c.Animated || type == typeof(PlayerMobile) || type == null ||
c.Owner != null && c.Owner.Fame < 100 ||
c.Owner?.Fame < 100 ||
c.Owner is BaseCreature creature && (creature.Summoned || creature.IsBonded))
{
Caster.SendLocalizedMessage(1061085); // There's not enough life force there to animate.

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Necromancy
{
public class BloodOathSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Blood Oath",
"In Jux Mani Xen",
203,
@ -15,8 +15,8 @@ namespace Server.Spells.Necromancy
Reagent.DaemonBlood
);
private static readonly Dictionary<Mobile, Mobile> m_OathTable = new Dictionary<Mobile, Mobile>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, Mobile> m_OathTable = new();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
public BloodOathSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Necromancy
{
public class CorpseSkinSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Corpse Skin",
"In Agle Corp Ylem",
203,
@ -15,7 +15,7 @@ namespace Server.Spells.Necromancy
Reagent.GraveDust
);
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
public CorpseSkinSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Necromancy
{
public class CurseWeaponSpell : NecromancerSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Curse Weapon",
"An Sanct Gra Char",
203,
@ -14,7 +14,7 @@ namespace Server.Spells.Necromancy
Reagent.PigIron
);
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new();
public CurseWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Necromancy
{
public class EvilOmenSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Evil Omen",
"Pas Tym An Sanct",
203,
@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.NoxCrystal
);
private static readonly Dictionary<Mobile, DefaultSkillMod> m_Table = new Dictionary<Mobile, DefaultSkillMod>();
private static readonly Dictionary<Mobile, DefaultSkillMod> m_Table = new();
public EvilOmenSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Necromancy
{
public class ExorcismSpell : NecromancerSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Exorcism",
"Ort Corp Grav",
203,
@ -24,38 +24,38 @@ namespace Server.Spells.Necromancy
private static readonly Point3D[] m_BritanniaLocs =
{
new Point3D(1470, 843, 0),
new Point3D(1857, 865, -1),
new Point3D(4220, 563, 36),
new Point3D(1732, 3528, 0),
new Point3D(1300, 644, 8),
new Point3D(3355, 302, 9),
new Point3D(1606, 2490, 5),
new Point3D(2500, 3931, 3),
new Point3D(4264, 3707, 0)
new(1470, 843, 0),
new(1857, 865, -1),
new(4220, 563, 36),
new(1732, 3528, 0),
new(1300, 644, 8),
new(3355, 302, 9),
new(1606, 2490, 5),
new(2500, 3931, 3),
new(4264, 3707, 0)
};
private static readonly Point3D[] m_IllshLocs =
{
new Point3D(1222, 474, -17),
new Point3D(718, 1360, -60),
new Point3D(297, 1014, -19),
new Point3D(986, 1006, -36),
new Point3D(1180, 1288, -30),
new Point3D(1538, 1341, -3),
new Point3D(528, 223, -38)
new(1222, 474, -17),
new(718, 1360, -60),
new(297, 1014, -19),
new(986, 1006, -36),
new(1180, 1288, -30),
new(1538, 1341, -3),
new(528, 223, -38)
};
private static readonly Point3D[] m_MalasLocs =
{
new Point3D(976, 517, -30)
new(976, 517, -30)
};
private static readonly Point3D[] m_TokunoLocs =
{
new Point3D(710, 1162, 25),
new Point3D(1034, 515, 18),
new Point3D(295, 712, 55)
new(710, 1162, 25),
new(1034, 515, 18),
new(295, 712, 55)
};
public ExorcismSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)

View file

@ -4,7 +4,7 @@ namespace Server.Spells.Necromancy
{
public class HorrificBeastSpell : TransformationSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Horrific Beast",
"Rel Xen Vas Bal",
203,

View file

@ -4,7 +4,7 @@ namespace Server.Spells.Necromancy
{
public class LichFormSpell : TransformationSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Lich Form",
"Rel Xen Corp Ort",
203,

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Necromancy
{
public class MindRotSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Mind Rot",
"Wis An Ben",
203,
@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.DaemonBlood
);
private static readonly Dictionary<Mobile, MRBucket> m_Table = new Dictionary<Mobile, MRBucket>();
private static readonly Dictionary<Mobile, MRBucket> m_Table = new();
public MindRotSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Necromancy
{
public class PainSpikeSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Pain Spike",
"In Sar",
203,
@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.PigIron
);
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new();
public PainSpikeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,7 +9,7 @@ namespace Server.Spells.Necromancy
{
public class PoisonStrikeSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Poison Strike",
"In Vas Nox",
203,

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Necromancy
{
public class StrangleSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Strangle",
"In Bal Nox",
209,
@ -15,7 +15,7 @@ namespace Server.Spells.Necromancy
Reagent.NoxCrystal
);
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new();
public StrangleSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,7 +9,7 @@ namespace Server.Spells.Necromancy
{
public class SummonFamiliarSpell : NecromancerSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Summon Familiar",
"Kal Xen Bal",
203,
@ -28,15 +28,15 @@ namespace Server.Spells.Necromancy
public override double RequiredSkill => 30.0;
public override int RequiredMana => 17;
public static Dictionary<Mobile, BaseCreature> Table { get; } = new Dictionary<Mobile, BaseCreature>();
public static Dictionary<Mobile, BaseCreature> Table { get; } = new();
public static SummonFamiliarEntry[] Entries { get; } =
{
new SummonFamiliarEntry(typeof(HordeMinionFamiliar), 1060146, 30.0, 30.0), // Horde Minion
new SummonFamiliarEntry(typeof(ShadowWispFamiliar), 1060142, 50.0, 50.0), // Shadow Wisp
new SummonFamiliarEntry(typeof(DarkWolfFamiliar), 1060143, 60.0, 60.0), // Dark Wolf
new SummonFamiliarEntry(typeof(DeathAdder), 1060145, 80.0, 80.0), // Death Adder
new SummonFamiliarEntry(typeof(VampireBatFamiliar), 1060144, 100.0, 100.0) // Vampire Bat
new(typeof(HordeMinionFamiliar), 1060146, 30.0, 30.0), // Horde Minion
new(typeof(ShadowWispFamiliar), 1060142, 50.0, 50.0), // Shadow Wisp
new(typeof(DarkWolfFamiliar), 1060143, 60.0, 60.0), // Dark Wolf
new(typeof(DeathAdder), 1060145, 80.0, 80.0), // Death Adder
new(typeof(VampireBatFamiliar), 1060144, 100.0, 100.0) // Vampire Bat
};
public override bool CheckCast()

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Necromancy
{
public class VampiricEmbraceSpell : TransformationSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Vampiric Embrace",
"Rel Xen An Sanct",
203,

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Necromancy
{
public class VengefulSpiritSpell : NecromancerSpell, ISpellTargetingMobile
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Vengeful Spirit",
"Kal Xen Bal Beh",
203,

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Necromancy
{
public class WitherSpell : NecromancerSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Wither",
"Kal Vas An Flam",
203,

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Necromancy
{
public class WraithFormSpell : TransformationSpell
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Wraith Form",
"Rel Xen Um",
203,