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

@ -8,10 +8,9 @@ namespace Server.Spells.Spellweaving
{
public class ArcaneCircleSpell : ArcanistSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Arcane Circle", "Myrshalee",
-1
);
-1);
public ArcaneCircleSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -34,7 +33,7 @@ namespace Server.Spells.Spellweaving
if (GetArcanists().Count < 2)
{
Caster.SendLocalizedMessage(1080452); //There are not enough spellweavers present to create an Arcane Focus.
Caster.SendLocalizedMessage(1080452); // There are not enough spellweavers present to create an Arcane Focus.
return false;
}
@ -56,7 +55,7 @@ namespace Server.Spells.Spellweaving
Math.Min(Arcanists.Count,
IsSanctuary(Caster.Location, Caster.Map)
? 6
: 5); //The Sanctuary is a special, single location place
: 5); // The Sanctuary is a special, single location place
for (int i = 0; i < Arcanists.Count; i++)
GiveArcaneFocus(Arcanists[i], duration, strengthBonus);
@ -108,7 +107,7 @@ namespace Server.Spells.Spellweaving
{
List<Mobile> weavers = new List<Mobile> { Caster };
//OSI Verified: Even enemies/combatants count
// OSI Verified: Even enemies/combatants count
// Everyone gets the Arcane Focus, power capped elsewhere
weavers.AddRange(Caster.GetMobilesInRange(1)
.Where(m => m != Caster && m is PlayerMobile && Caster.CanBeBeneficial(m, false) &&
@ -119,7 +118,7 @@ namespace Server.Spells.Spellweaving
private void GiveArcaneFocus(Mobile to, TimeSpan duration, int strengthBonus)
{
if (to == null) //Sanity
if (to == null) // Sanity
return;
ArcaneFocus focus = FindArcaneFocus(to);
@ -137,7 +136,7 @@ namespace Server.Spells.Spellweaving
focus.Delete();
}
}
else //OSI renewal rules: the new one will override the old one, always.
else // OSI renewal rules: the new one will override the old one, always.
{
to.SendLocalizedMessage(1072828); // Your arcane focus is renewed.
focus.LifeSpan = duration;

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Spellweaving
{
}
public abstract int Body{ get; }
public abstract int Body { get; }
public virtual int Hue => 0;
public virtual int PhysResistOffset => 0;

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Spellweaving
{
}
public abstract int Sound{ get; }
public abstract int Sound { get; }
public override bool CheckCast()
{

View file

@ -13,8 +13,8 @@ namespace Server.Spells.Spellweaving
{
}
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.Spellweaving;
public override SkillName DamageSkill => SkillName.Spellweaving;
@ -81,7 +81,7 @@ namespace Server.Spells.Spellweaving
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;
}
@ -123,7 +123,7 @@ namespace Server.Spells.Spellweaving
{
double percent =
(50 + 2 * (GetResistSkill(m) - GetDamageSkill(Caster))) /
100; //TODO: According to the guide this is it.. but.. is it correct per OSI?
100; // TODO: According to the guide this is it.. but.. is it correct per OSI?
if (percent <= 0)
return false;

View file

@ -5,12 +5,11 @@ namespace Server.Spells.Spellweaving
{
public class AttuneWeaponSpell : ArcanistSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Attune Weapon", "Haeldril",
-1
);
-1);
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
public AttuneWeaponSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -35,7 +34,6 @@ namespace Server.Spells.Spellweaving
Caster.SendLocalizedMessage(1075124); // You must wait before casting that spell again.
return false;
}
public override void OnCast()
@ -94,7 +92,7 @@ namespace Server.Spells.Spellweaving
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public ExpireTimer(Mobile m, TimeSpan delay)
: base(delay) =>
@ -119,7 +117,7 @@ namespace Server.Spells.Spellweaving
m_Table.Remove(m_Mobile);
DelayCall(TimeSpan.FromSeconds(120), delegate { m_Mobile.EndAction<AttuneWeaponSpell>(); });
DelayCall(TimeSpan.FromSeconds(120), m_Mobile.EndAction<AttuneWeaponSpell>);
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.AttuneWeapon);
}
}

View file

@ -5,9 +5,9 @@ namespace Server.Spells.Spellweaving
{
public class EssenceOfWindSpell : ArcanistSpell
{
private static SpellInfo m_Info = new SpellInfo("Essence of Wind", "Anathrae", -1);
private static readonly SpellInfo m_Info = new SpellInfo("Essence of Wind", "Anathrae", -1);
private static Dictionary<Mobile, EssenceOfWindInfo> m_Table = new Dictionary<Mobile, EssenceOfWindInfo>();
private static readonly Dictionary<Mobile, EssenceOfWindInfo> m_Table = new Dictionary<Mobile, EssenceOfWindInfo>();
public EssenceOfWindSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -85,18 +85,18 @@ namespace Server.Spells.Spellweaving
Timer.Start();
}
public Mobile Defender{ get; }
public Mobile Defender { get; }
public int FCMalus{ get; }
public int FCMalus { get; }
public int SSIMalus{ get; }
public int SSIMalus { get; }
public ExpireTimer Timer{ get; }
public ExpireTimer Timer { get; }
}
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public ExpireTimer(Mobile m, TimeSpan delay) : base(delay) => m_Mobile = m;

View file

@ -4,10 +4,9 @@ namespace Server.Spells.Spellweaving
{
public class EtherealVoyageSpell : ArcaneForm
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Ethereal Voyage", "Orlavdra",
-1
);
-1);
public EtherealVoyageSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -59,7 +58,7 @@ namespace Server.Spells.Spellweaving
Timer.DelayCall(duration, RemoveEffect, Caster);
Caster.BeginAction(
typeof(EtherealVoyageSpell)); //Cannot cast this spell for another 5 minutes(300sec) after effect removed.
typeof(EtherealVoyageSpell)); // Cannot cast this spell for another 5 minutes(300sec) after effect removed.
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.EtherealVoyage, 1031613, 1075805, duration, Caster));
}
@ -70,7 +69,7 @@ namespace Server.Spells.Spellweaving
TransformationSpellHelper.RemoveContext(m, true);
Timer.DelayCall(TimeSpan.FromMinutes(5), delegate { m.EndAction<EtherealVoyageSpell>(); });
Timer.DelayCall(TimeSpan.FromMinutes(5), m.EndAction<EtherealVoyageSpell>);
BuffInfo.RemoveBuff(m, BuffIcon.EtherealVoyage);
}

View file

@ -8,12 +8,11 @@ namespace Server.Spells.Spellweaving
{
public class GiftOfLifeSpell : ArcanistSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Gift of Life", "Illorae",
-1
);
-1);
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
public GiftOfLifeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -63,7 +62,6 @@ namespace Server.Spells.Spellweaving
SpellHelper.Turn(Caster, m);
}
m.PlaySound(0x244);
m.FixedParticles(0x3709, 1, 30, 0x26ED, 5, 2, EffectLayer.Waist);
m.FixedParticles(0x376A, 1, 30, 0x251E, 5, 3, EffectLayer.Waist);
@ -128,7 +126,7 @@ namespace Server.Spells.Spellweaving
m.SendGump(new ResurrectGump(m, hitsScalar));
}
//Per OSI, buff is removed when gump sent, irregardless of online status or acceptance
// Per OSI, buff is removed when gump sent, irregardless of online status or acceptance
timer.DoExpire();
}
@ -142,7 +140,7 @@ namespace Server.Spells.Spellweaving
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public ExpireTimer(Mobile m, TimeSpan delay, GiftOfLifeSpell spell)
: base(delay)
@ -151,7 +149,7 @@ namespace Server.Spells.Spellweaving
Spell = spell;
}
public GiftOfLifeSpell Spell{ get; }
public GiftOfLifeSpell Spell { get; }
protected override void OnTick()
{

View file

@ -6,12 +6,11 @@ namespace Server.Spells.Spellweaving
{
public class GiftOfRenewalSpell : ArcanistSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Gift of Renewal", "Olorisstra",
-1
);
-1);
private static Dictionary<Mobile, GiftOfRenewalInfo> m_Table = new Dictionary<Mobile, GiftOfRenewalInfo>();
private static readonly Dictionary<Mobile, GiftOfRenewalInfo> m_Table = new Dictionary<Mobile, GiftOfRenewalInfo>();
public GiftOfRenewalSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -60,7 +59,7 @@ namespace Server.Spells.Spellweaving
GiftOfRenewalInfo info = new GiftOfRenewalInfo(Caster, m, hitsPerRound);
Timer.DelayCall(duration,
delegate
() =>
{
if (StopEffect(m))
{
@ -69,7 +68,6 @@ namespace Server.Spells.Spellweaving
}
});
m_Table[m] = info;
Caster.BeginAction<GiftOfRenewalSpell>();
@ -92,17 +90,17 @@ namespace Server.Spells.Spellweaving
info.m_Timer.Stop();
BuffInfo.RemoveBuff(m, BuffIcon.GiftOfRenewal);
Timer.DelayCall(TimeSpan.FromSeconds(60), delegate { info.m_Caster.EndAction<GiftOfRenewalSpell>(); });
Timer.DelayCall(TimeSpan.FromSeconds(60), info.m_Caster.EndAction<GiftOfRenewalSpell>);
return true;
}
private class GiftOfRenewalInfo
{
public Mobile m_Caster;
public int m_HitsPerRound;
public Mobile m_Mobile;
public InternalTimer m_Timer;
public readonly Mobile m_Caster;
public readonly int m_HitsPerRound;
public readonly Mobile m_Mobile;
public readonly InternalTimer m_Timer;
public GiftOfRenewalInfo(Mobile caster, Mobile mobile, int hitsPerRound)
{
@ -117,7 +115,7 @@ namespace Server.Spells.Spellweaving
private class InternalTimer : Timer
{
private GiftOfRenewalInfo m_GiftInfo;
private readonly GiftOfRenewalInfo m_GiftInfo;
public InternalTimer(GiftOfRenewalInfo info)
: base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0)) =>

View file

@ -6,12 +6,11 @@ namespace Server.Spells.Spellweaving
{
public class ImmolatingWeaponSpell : ArcanistSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Immolating Weapon", "Thalshara",
-1
);
-1);
private static Dictionary<BaseWeapon, ImmolatingWeaponEntry> m_WeaponDamageTable =
private static readonly Dictionary<BaseWeapon, ImmolatingWeaponEntry> m_WeaponDamageTable =
new Dictionary<BaseWeapon, ImmolatingWeaponEntry>();
public ImmolatingWeaponSpell(Mobile caster, Item scroll = null)
@ -92,9 +91,9 @@ namespace Server.Spells.Spellweaving
private class ImmolatingWeaponEntry
{
public Mobile m_Caster;
public int m_Damage;
public Timer m_Timer;
public readonly Mobile m_Caster;
public readonly int m_Damage;
public readonly Timer m_Timer;
public ImmolatingWeaponEntry(int damage, Timer stopTimer, Mobile caster)
{
@ -106,8 +105,8 @@ namespace Server.Spells.Spellweaving
private class DelayedEffectEntry
{
public Mobile m_Target;
public BaseWeapon m_Weapon;
public readonly Mobile m_Target;
public readonly BaseWeapon m_Weapon;
public DelayedEffectEntry(BaseWeapon weapon, Mobile target)
{

View file

@ -29,7 +29,7 @@ namespace Server.Items
public override int LabelNumber => 1032629; // Arcane Focus
[CommandProperty(AccessLevel.GameMaster)]
public int StrengthBonus{ get; set; }
public int StrengthBonus { get; set; }
public override TextDefinition InvalidTransferMessage => 1073480; // Your arcane focus disappears.
public override bool Nontransferable => true;

View file

@ -22,10 +22,10 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public TimeSpan LifeSpan{ get; set; }
public TimeSpan LifeSpan { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public DateTime CreationTime{ get; set; }
public DateTime CreationTime { get; set; }
public override bool Nontransferable => true;
@ -39,7 +39,6 @@ namespace Server.Items
Delete();
}
public virtual void Expire(Mobile parent)
{
parent?.SendLocalizedMessage(1072515, Name ?? $"#{LabelNumber}"); // The ~1_name~ expired...

View file

@ -45,7 +45,7 @@ namespace Server.Mobiles
public override double DispelFocus => 20.0;
public override PackInstinct PackInstinct => PackInstinct.Daemon;
public override bool BleedImmune => true; //TODO: Verify on OSI. Guide says this.
public override bool BleedImmune => true; // TODO: Verify on OSI. Guide says this.
public override string DefaultName => "an imp";
public override void Serialize(IGenericWriter writer)

View file

@ -7,11 +7,10 @@ namespace Server.Spells.Spellweaving
{
public class NatureFurySpell : ArcanistSpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Nature's Fury", "Rauvvrae",
-1,
false
);
false);
public NatureFurySpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -72,7 +71,7 @@ namespace Server.Spells.Spellweaving
private class InternalTimer : Timer
{
private NatureFury m_NatureFury;
private readonly NatureFury m_NatureFury;
public InternalTimer(NatureFury nf)
: base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0)) =>

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Spellweaving
{
public class ReaperFormSpell : ArcaneForm
{
private static SpellInfo m_Info = new SpellInfo("Reaper Form", "Tarisstree", -1);
private static readonly SpellInfo m_Info = new SpellInfo("Reaper Form", "Tarisstree", -1);
public ReaperFormSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,10 +6,9 @@ namespace Server.Spells.Spellweaving
{
public class SummonFeySpell : ArcaneSummon<ArcaneFey>
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Summon Fey", "Alalithra",
-1
);
-1);
public SummonFeySpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -6,10 +6,9 @@ namespace Server.Spells.Spellweaving
{
public class SummonFiendSpell : ArcaneSummon<ArcaneFiend>
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Summon Fiend", "Nylisstra",
-1
);
-1);
public SummonFiendSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -5,12 +5,11 @@ namespace Server.Spells.Spellweaving
{
public class ThunderstormSpell : ArcanistSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Thunderstorm", "Erelonia",
-1
);
-1);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public ThunderstormSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Spellweaving
{
public class WordOfDeathSpell : ArcanistSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo("Word of Death", "Nyraxle", -1);
private static readonly SpellInfo m_Info = new SpellInfo("Word of Death", "Nyraxle", -1);
public WordOfDeathSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{