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

@ -6,7 +6,7 @@ namespace Server.Spells.Seventh
{
public class ChainLightningSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Chain Lightning", "Vas Ort Grav",
209,
9022,
@ -14,8 +14,7 @@ namespace Server.Spells.Seventh
Reagent.BlackPearl,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public ChainLightningSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -55,7 +54,7 @@ namespace Server.Spells.Seventh
targets.AddRange(eable.Where(m =>
{
if (Core.AOS && (m == Caster || !Caster.InLOS(m)) || !SpellHelper.ValidIndirectTarget(Caster, m) ||
if ((Core.AOS && (m == Caster || !Caster.InLOS(m))) || !SpellHelper.ValidIndirectTarget(Caster, m) ||
!Caster.CanBeHarmful(m, false))
return false;

View file

@ -8,7 +8,7 @@ namespace Server.Spells.Seventh
{
public class EnergyFieldSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Energy Field", "In Sanct Grav",
221,
9022,
@ -16,8 +16,7 @@ namespace Server.Spells.Seventh
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public EnergyFieldSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -92,8 +91,8 @@ namespace Server.Spells.Seventh
[DispellableField]
private class InternalItem : Item
{
private Mobile m_Caster;
private Timer m_Timer;
private readonly Mobile m_Caster;
private readonly Timer m_Timer;
public InternalItem(Point3D loc, Map map, TimeSpan duration, int itemID, Mobile caster) : base(itemID)
{
@ -143,7 +142,7 @@ namespace Server.Spells.Seventh
{
if (!(m is PlayerMobile))
return base.OnMoveOver(m);
int noto = Notoriety.Compute(m_Caster, m);
return noto != Notoriety.Enemy && noto != Notoriety.Ally && base.OnMoveOver(m);
}
@ -157,7 +156,7 @@ namespace Server.Spells.Seventh
private class InternalTimer : Timer
{
private InternalItem m_Item;
private readonly InternalItem m_Item;
public InternalTimer(InternalItem item, TimeSpan duration) : base(duration)
{

View file

@ -4,13 +4,12 @@ namespace Server.Spells.Seventh
{
public class FlameStrikeSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Flame Strike", "Kal Vas Flam",
245,
9042,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public FlameStrikeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,16 +9,15 @@ namespace Server.Spells.Seventh
{
public class GateTravelSpell : MagerySpell, IRecallSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Gate Travel", "Vas Rel Por",
263,
9032,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
private RunebookEntry m_Entry;
private readonly RunebookEntry m_Entry;
public GateTravelSpell(Mobile caster, RunebookEntry entry = null, Item scroll = null) : base(caster, scroll, m_Info) => m_Entry = entry;
@ -70,7 +69,7 @@ namespace Server.Spells.Seventh
{
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (map == null || !Core.AOS && Caster.Map != map)
else if (map == null || (!Core.AOS && Caster.Map != map))
{
Caster.SendLocalizedMessage(1005570); // You can not gate to another facet.
}
@ -104,8 +103,7 @@ namespace Server.Spells.Seventh
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (Core.SE && (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location))
) // SE restricted stacking gates
else if (Core.SE && (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location))) // SE restricted stacking gates
{
Caster.SendLocalizedMessage(1071242); // There is already a gate there.
}
@ -163,7 +161,7 @@ namespace Server.Spells.Seventh
private class InternalTimer : Timer
{
private Item m_Item;
private readonly Item m_Item;
public InternalTimer(Item item) : base(TimeSpan.FromSeconds(30.0))
{

View file

@ -4,15 +4,14 @@ namespace Server.Spells.Seventh
{
public class ManaVampireSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mana Vampire", "Ort Sanct",
221,
9032,
Reagent.BlackPearl,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public ManaVampireSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Seventh
{
public class MassDispelSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mass Dispel", "Vas An Ort",
263,
9002,
Reagent.Garlic,
Reagent.MandrakeRoot,
Reagent.BlackPearl,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public MassDispelSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Seventh
{
public class MeteorSwarmSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Meteor Swarm", "Flam Kal Des Ylem",
233,
9042,
@ -14,8 +14,7 @@ namespace Server.Spells.Seventh
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SulfurousAsh,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public MeteorSwarmSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -56,7 +55,7 @@ namespace Server.Spells.Seventh
targets = eable.Where(m =>
{
if (Caster == m || !SpellHelper.ValidIndirectTarget(Caster, m) || !Caster.CanBeHarmful(m, false) ||
Core.AOS && !Caster.InLOS(m))
(Core.AOS && !Caster.InLOS(m)))
return false;
if (m.Player)

View file

@ -10,18 +10,17 @@ namespace Server.Spells.Seventh
{
public class PolymorphSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Polymorph", "Vas Ylem Rel",
221,
9002,
Reagent.Bloodmoss,
Reagent.SpidersSilk,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
private static Dictionary<Mobile, InternalTimer> m_Timers = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Timers = new Dictionary<Mobile, InternalTimer>();
private int m_NewBody;
private readonly int m_NewBody;
public PolymorphSpell(Mobile caster, Item scroll, int body = 0) : base(caster, scroll, m_Info) => m_NewBody = body;
@ -29,7 +28,7 @@ namespace Server.Spells.Seventh
public override bool CheckCast()
{
/*if ( Caster.Mounted )
/*if (Caster.Mounted)
{
Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
return false;
@ -81,7 +80,7 @@ namespace Server.Spells.Seventh
public override void OnCast()
{
/*if ( Caster.Mounted )
/*if (Caster.Mounted)
{
Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
}
@ -182,7 +181,7 @@ namespace Server.Spells.Seventh
private class InternalTimer : Timer
{
private Mobile m_Owner;
private readonly Mobile m_Owner;
public InternalTimer(Mobile owner) : base(TimeSpan.FromSeconds(0))
{