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

@ -18,15 +18,15 @@ namespace Server.Spells.Ninjitsu
NoSkill
}
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Animal Form",
null,
-1,
9002
);
private static readonly Dictionary<Mobile, int> m_LastAnimalForms = new Dictionary<Mobile, int>();
private static readonly Dictionary<Mobile, AnimalFormContext> m_Table = new Dictionary<Mobile, AnimalFormContext>();
private static readonly Dictionary<Mobile, int> m_LastAnimalForms = new();
private static readonly Dictionary<Mobile, AnimalFormContext> m_Table = new();
private bool m_WasMoving;
@ -45,22 +45,22 @@ namespace Server.Spells.Ninjitsu
public static AnimalFormEntry[] Entries { get; } =
{
new AnimalFormEntry(typeof(Kirin), 1029632, 9632, 0, 1070811, 100.0, 0x84, 0, 0),
new AnimalFormEntry(typeof(Unicorn), 1018214, 9678, 0, 1070812, 100.0, 0x7A, 0, 0),
new AnimalFormEntry(typeof(BakeKitsune), 1030083, 10083, 0, 1070810, 82.5, 0xF6, 0, 0),
new AnimalFormEntry(typeof(GreyWolf), 1028482, 9681, 2309, 1070810, 82.5, 0x19, 0x8FD, 0x90E),
new AnimalFormEntry(typeof(Llama), 1028438, 8438, 0, 1070809, 70.0, 0xDC, 0, 0),
new AnimalFormEntry(typeof(ForestOstard), 1018273, 8503, 2212, 1070809, 70.0, 0xDB, 0x899, 0x8B0),
new AnimalFormEntry(typeof(BullFrog), 1028496, 8496, 2003, 1070807, 50.0, 0x51, 0x7D1, 0x7D6, false, false),
new AnimalFormEntry(typeof(GiantSerpent), 1018114, 9663, 2009, 1070808, 50.0, 0x15, 0x7D1, 0x7E2, false, false),
new AnimalFormEntry(typeof(Dog), 1018280, 8476, 2309, 1070806, 40.0, 0xD9, 0x8FD, 0x90E, false, false),
new AnimalFormEntry(typeof(Cat), 1018264, 8475, 2309, 1070806, 40.0, 0xC9, 0x8FD, 0x90E, false, false),
new AnimalFormEntry(typeof(Rat), 1018294, 8483, 2309, 1070805, 20.0, 0xEE, 0x8FD, 0x90E, true, false),
new AnimalFormEntry(typeof(Rabbit), 1028485, 8485, 2309, 1070805, 20.0, 0xCD, 0x8FD, 0x90E, true, false),
new AnimalFormEntry(typeof(Squirrel), 1031671, 11671, 0, 0, 20.0, 0x116, 0, 0, false, false),
new AnimalFormEntry(typeof(Ferret), 1031672, 11672, 0, 1075220, 40.0, 0x117, 0, 0, false, false, true),
new AnimalFormEntry(typeof(CuSidhe), 1031670, 11670, 0, 1075221, 60.0, 0x115, 0, 0, false, false),
new AnimalFormEntry(typeof(Reptalon), 1075202, 11669, 0, 1075222, 90.0, 0x114, 0, 0, false, false)
new(typeof(Kirin), 1029632, 9632, 0, 1070811, 100.0, 0x84, 0, 0),
new(typeof(Unicorn), 1018214, 9678, 0, 1070812, 100.0, 0x7A, 0, 0),
new(typeof(BakeKitsune), 1030083, 10083, 0, 1070810, 82.5, 0xF6, 0, 0),
new(typeof(GreyWolf), 1028482, 9681, 2309, 1070810, 82.5, 0x19, 0x8FD, 0x90E),
new(typeof(Llama), 1028438, 8438, 0, 1070809, 70.0, 0xDC, 0, 0),
new(typeof(ForestOstard), 1018273, 8503, 2212, 1070809, 70.0, 0xDB, 0x899, 0x8B0),
new(typeof(BullFrog), 1028496, 8496, 2003, 1070807, 50.0, 0x51, 0x7D1, 0x7D6, false, false),
new(typeof(GiantSerpent), 1018114, 9663, 2009, 1070808, 50.0, 0x15, 0x7D1, 0x7E2, false, false),
new(typeof(Dog), 1018280, 8476, 2309, 1070806, 40.0, 0xD9, 0x8FD, 0x90E, false, false),
new(typeof(Cat), 1018264, 8475, 2309, 1070806, 40.0, 0xC9, 0x8FD, 0x90E, false, false),
new(typeof(Rat), 1018294, 8483, 2309, 1070805, 20.0, 0xEE, 0x8FD, 0x90E, true, false),
new(typeof(Rabbit), 1028485, 8485, 2309, 1070805, 20.0, 0xCD, 0x8FD, 0x90E, true, false),
new(typeof(Squirrel), 1031671, 11671, 0, 0, 20.0, 0x116, 0, 0, false, false),
new(typeof(Ferret), 1031672, 11672, 0, 1075220, 40.0, 0x117, 0, 0, false, false, true),
new(typeof(CuSidhe), 1031670, 11670, 0, 1075221, 60.0, 0x115, 0, 0, false, false),
new(typeof(Reptalon), 1075202, 11669, 0, 1075222, 90.0, 0x114, 0, 0, false, false)
};
public static void Initialize()

View file

@ -9,7 +9,7 @@ namespace Server.Spells.Ninjitsu
public override double RequiredSkill => Core.ML ? 40.0 : 20.0;
public override TextDefinition AbilityMessage =>
new TextDefinition(1063089); // You prepare to Backstab your opponent.
new(1063089); // You prepare to Backstab your opponent.
public override bool ValidatesDuringHit => false;

View file

@ -7,13 +7,13 @@ namespace Server.Spells.Ninjitsu
{
public class DeathStrike : NinjaMove
{
private static readonly Dictionary<Mobile, DeathStrikeInfo> m_Table = new Dictionary<Mobile, DeathStrikeInfo>();
private static readonly Dictionary<Mobile, DeathStrikeInfo> m_Table = new();
public override int BaseMana => 30;
public override double RequiredSkill => 85.0;
public override TextDefinition AbilityMessage =>
new TextDefinition(1063091); // You prepare to hit your opponent with a Death Strike.
new(1063091); // You prepare to hit your opponent with a Death Strike.
public override double GetDamageScalar(Mobile attacker, Mobile defender) => 0.5;

View file

@ -8,7 +8,7 @@ namespace Server.Spells.Ninjitsu
public override double RequiredSkill => Core.ML ? 30.0 : 60;
public override TextDefinition AbilityMessage =>
new TextDefinition(1063095); // You prepare to focus all of your abilities into your next strike.
new(1063095); // You prepare to focus all of your abilities into your next strike.
public override bool Validate(Mobile from)
{

View file

@ -6,13 +6,13 @@ namespace Server.Spells.Ninjitsu
{
public class KiAttack : NinjaMove
{
private static readonly Dictionary<Mobile, KiAttackInfo> m_Table = new Dictionary<Mobile, KiAttackInfo>();
private static readonly Dictionary<Mobile, KiAttackInfo> m_Table = new();
public override int BaseMana => 25;
public override double RequiredSkill => 80.0;
public override TextDefinition AbilityMessage =>
new TextDefinition(1063099); // Your Ki Attack must be complete within 2 seconds for the damage bonus!
new(1063099); // Your Ki Attack must be complete within 2 seconds for the damage bonus!
public override void OnUse(Mobile from)
{

View file

@ -10,9 +10,9 @@ namespace Server.Spells.Ninjitsu
{
public class MirrorImage : NinjaSpell
{
private static readonly Dictionary<Mobile, int> m_CloneCount = new Dictionary<Mobile, int>();
private static readonly Dictionary<Mobile, int> m_CloneCount = new();
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Mirror Image",
null,
-1,

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Ninjitsu
{
public class Shadowjump : NinjaSpell, ISpellTargetingPoint3D
{
private static readonly SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new(
"Shadowjump",
null,
-1,

View file

@ -7,12 +7,12 @@ namespace Server.Spells.Ninjitsu
public class SurpriseAttack : NinjaMove
{
private static readonly Dictionary<Mobile, SurpriseAttackInfo>
m_Table = new Dictionary<Mobile, SurpriseAttackInfo>();
m_Table = new();
public override int BaseMana => 20;
public override double RequiredSkill => Core.ML ? 60.0 : 30.0;
public override TextDefinition AbilityMessage => new TextDefinition(1063128); // You prepare to surprise your prey.
public override TextDefinition AbilityMessage => new(1063128); // You prepare to surprise your prey.
public override bool ValidatesDuringHit => false;