Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 • committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -5,14 +5,13 @@ namespace Server.Spells.Bushido
{
public class Confidence : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Confidence", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static Dictionary<Mobile, Timer> m_RegenTable = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_RegenTable = new Dictionary<Mobile, Timer>();
public Confidence(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -93,7 +92,7 @@ namespace Server.Spells.Bushido
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m) : base(TimeSpan.FromSeconds(15.0))
{
@ -110,8 +109,8 @@ namespace Server.Spells.Bushido
private class RegenTimer : Timer
{
private int m_Hits;
private Mobile m_Mobile;
private readonly int m_Hits;
private readonly Mobile m_Mobile;
private int m_Ticks;
public RegenTimer(Mobile m) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Bushido
{
public class CounterAttack : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"CounterAttack", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public CounterAttack(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -87,7 +86,7 @@ namespace Server.Spells.Bushido
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m) : base(TimeSpan.FromSeconds(30.0))
{

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Bushido
{
public class Evasion : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Evasion", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public Evasion(Mobile caster, Item scroll)
: base(caster, scroll, m_Info)
@ -26,34 +25,34 @@ namespace Server.Spells.Bushido
public override bool CheckCast() => VerifyCast(Caster, true) && base.CheckCast();
public static bool VerifyCast(Mobile Caster, bool messages)
public static bool VerifyCast(Mobile caster, bool messages)
{
if (Caster == null) // Sanity
if (caster == null) // Sanity
return false;
if (!(Caster.FindItemOnLayer(Layer.OneHanded) is BaseWeapon weap))
weap = Caster.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
if (!(caster.FindItemOnLayer(Layer.OneHanded) is BaseWeapon weap))
weap = caster.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
if (weap != null)
{
if (Core.ML && Caster.Skills[weap.Skill].Base < 50)
if (Core.ML && caster.Skills[weap.Skill].Base < 50)
{
if (messages)
Caster.SendLocalizedMessage(
caster.SendLocalizedMessage(
1076206); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
return false;
}
}
else if (!(Caster.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
else if (!(caster.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
{
if (messages)
Caster.SendLocalizedMessage(1062944); // You must have a weapon or a shield equipped to use this ability!
caster.SendLocalizedMessage(1062944); // You must have a weapon or a shield equipped to use this ability!
return false;
}
if (!Caster.CanBeginAction<Evasion>())
if (!caster.CanBeginAction<Evasion>())
{
if (messages) Caster.SendLocalizedMessage(501789); // You must wait before trying again.
if (messages) caster.SendLocalizedMessage(501789); // You must wait before trying again.
return false;
}
@ -109,7 +108,7 @@ namespace Server.Spells.Bushido
BeginEvasion(Caster);
Caster.BeginAction<Evasion>();
Timer.DelayCall(TimeSpan.FromSeconds(20.0), delegate { Caster.EndAction<Evasion>(); });
Timer.DelayCall(TimeSpan.FromSeconds(20.0), Caster.EndAction<Evasion>);
}
FinishSequence();
@ -135,8 +134,7 @@ namespace Server.Spells.Bushido
if (m.Skills.Bushido.Value > 60)
seconds += (m.Skills.Bushido.Value - 60) / 20;
if (m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 && m.Skills.Bushido.Value > 100.0
) //Bushido being HIGHER than 100 for bonus is intended
if (m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 && m.Skills.Bushido.Value > 100.0) // Bushido being HIGHER than 100 for bonus is intended
seconds++;
return TimeSpan.FromSeconds((int)seconds);
@ -161,8 +159,7 @@ namespace Server.Spells.Bushido
if (m.Skills.Bushido.Value >= 60)
bonus += (m.Skills.Bushido.Value - 60) * .004 + 0.16;
if (m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 && m.Skills.Bushido.Value > 100
) //Bushido being HIGHER than 100 for bonus is intended
if (m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 && m.Skills.Bushido.Value > 100) // Bushido being HIGHER than 100 for bonus is intended
bonus += 0.10;
return 1.0 + bonus;
@ -190,7 +187,7 @@ namespace Server.Spells.Bushido
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m, TimeSpan delay)
: base(delay)

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Bushido
{
public class HonorableExecution : SamuraiMove
{
private static Dictionary<Mobile, HonorableExecutionInfo> m_Table = new Dictionary<Mobile, HonorableExecutionInfo>();
private static readonly Dictionary<Mobile, HonorableExecutionInfo> m_Table = new Dictionary<Mobile, HonorableExecutionInfo>();
public override int BaseMana => 0;
public override double RequiredSkill => 25.0;
@ -90,10 +90,10 @@ namespace Server.Spells.Bushido
private class HonorableExecutionInfo
{
public Mobile m_Mobile;
public List<object> m_Mods;
public bool m_Penalty;
public int m_SwingBonus;
public readonly Mobile m_Mobile;
public readonly List<object> m_Mods;
public readonly bool m_Penalty;
public readonly int m_SwingBonus;
public Timer m_Timer;
public HonorableExecutionInfo(Mobile from, List<object> mods) : this(from, 0, mods, mods != null)

View file

@ -6,7 +6,7 @@ namespace Server.Spells
public override void CheckGain(Mobile m)
{
m.CheckSkill(MoveSkill, RequiredSkill - 12.5, RequiredSkill + 37.5); //Per five on friday 02/16/07
m.CheckSkill(MoveSkill, RequiredSkill - 12.5, RequiredSkill + 37.5); // Per five on friday 02/16/07
}
}
}

View file

@ -10,8 +10,8 @@ namespace Server.Spells.Bushido
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill => SkillName.Bushido;
public override SkillName DamageSkill => SkillName.Bushido;
@ -20,7 +20,7 @@ namespace Server.Spells.Bushido
public override bool BlocksMovement => false;
public override bool ShowHandMovement => false;
//public override int CastDelayBase => 1;
// public override int CastDelayBase => 1;
public override double CastDelayFastScalar => 0;
public override int CastRecoveryBase => 7;
@ -86,7 +86,7 @@ namespace Server.Spells.Bushido
public override void GetCastSkills(out double min, out double max)
{
min = RequiredSkill - 12.5; //per 5 on friday, 2/16/07
min = RequiredSkill - 12.5; // per 5 on friday, 2/16/07
max = RequiredSkill + 37.5;
}