fix: More spell variable cleanup (#850)

This commit is contained in:
Kamron Batman 2021-11-14 18:48:44 -08:00 • committed by GitHub
parent 5df7bf6a75
commit 15b2d08ea2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 162 additions and 162 deletions

View file

@ -108,7 +108,7 @@ namespace Server.Spells.Necromancy
)
};
private static readonly Dictionary<Mobile, List<Mobile>> m_Table = new();
private static readonly Dictionary<Mobile, List<Mobile>> _table = new();
public AnimateDeadSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -235,7 +235,7 @@ namespace Server.Spells.Necromancy
public static void Unregister(Mobile master, Mobile summoned)
{
if (master == null || !m_Table.TryGetValue(master, out var list))
if (master == null || !_table.TryGetValue(master, out var list))
{
return;
}
@ -244,7 +244,7 @@ namespace Server.Spells.Necromancy
if (list.Count == 0)
{
m_Table.Remove(master);
_table.Remove(master);
}
}
@ -255,9 +255,9 @@ namespace Server.Spells.Necromancy
return;
}
if (!m_Table.TryGetValue(master, out var list))
if (!_table.TryGetValue(master, out var list))
{
m_Table[master] = list = new List<Mobile>();
_table[master] = list = new List<Mobile>();
}
for (var i = list.Count - 1; i >= 0; --i)

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
);
private static readonly Dictionary<Mobile, Mobile> m_OathTable = new();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
private static readonly Dictionary<Mobile, ExpireTimer> _table = new();
public BloodOathSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -65,7 +65,7 @@ namespace Server.Spells.Necromancy
* ((ss-rm)/8)+8
*/
m_Table.TryGetValue(m, out var timer);
_table.TryGetValue(m, out var timer);
timer?.DoExpire();
m_OathTable[Caster] = Caster;
@ -90,7 +90,7 @@ namespace Server.Spells.Necromancy
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name));
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name));
m_Table[m] = timer;
_table[m] = timer;
HarmfulSpell(m);
}
@ -104,7 +104,7 @@ namespace Server.Spells.Necromancy
public static void RemoveCurse(Mobile m)
{
m_Table.TryGetValue(m, out var t);
_table.TryGetValue(m, out var t);
t?.DoExpire();
}
@ -153,7 +153,7 @@ namespace Server.Spells.Necromancy
BuffInfo.RemoveBuff(m_Caster, BuffIcon.BloodOathCaster);
BuffInfo.RemoveBuff(m_Target, BuffIcon.BloodOathCurse);
m_Table.Remove(m_Caster);
_table.Remove(m_Caster);
}
}
}

View file

@ -15,7 +15,7 @@ namespace Server.Spells.Necromancy
Reagent.GraveDust
);
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
private static readonly Dictionary<Mobile, ExpireTimer> _table = new();
public CorpseSkinSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -49,7 +49,7 @@ namespace Server.Spells.Necromancy
* NOTE: Resistance is not checked if targeting yourself
*/
if (m_Table.TryGetValue(m, out var timer))
if (_table.TryGetValue(m, out var timer))
{
timer.DoExpire();
}
@ -82,7 +82,7 @@ namespace Server.Spells.Necromancy
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.CorpseSkin, 1075663, duration, m));
m_Table[m] = timer;
_table[m] = timer;
for (var i = 0; i < mods.Length; ++i)
{
@ -102,7 +102,7 @@ namespace Server.Spells.Necromancy
public static bool RemoveCurse(Mobile m)
{
if (!m_Table.TryGetValue(m, out var t))
if (!_table.TryGetValue(m, out var t))
{
return false;
}
@ -132,7 +132,7 @@ namespace Server.Spells.Necromancy
Stop();
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.CorpseSkin);
m_Table.Remove(m_Mobile);
_table.Remove(m_Mobile);
}
protected override void OnTick()

View file

@ -14,7 +14,7 @@ namespace Server.Spells.Necromancy
Reagent.PigIron
);
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new();
private static readonly Dictionary<BaseWeapon, ExpireTimer> _table = new();
public CurseWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -50,11 +50,11 @@ namespace Server.Spells.Necromancy
var duration = TimeSpan.FromSeconds(Caster.Skills.SpiritSpeak.Value / 3.4 + 1.0);
m_Table.TryGetValue(weapon, out var timer);
_table.TryGetValue(weapon, out var timer);
timer?.Stop();
weapon.Cursed = true;
m_Table[weapon] = timer = new ExpireTimer(weapon, duration);
_table[weapon] = timer = new ExpireTimer(weapon, duration);
timer.Start();
}
@ -75,7 +75,7 @@ namespace Server.Spells.Necromancy
{
m_Weapon.Cursed = false;
Effects.PlaySound(m_Weapon.GetWorldLocation(), m_Weapon.Map, 0xFA);
m_Table.Remove(m_Weapon);
_table.Remove(m_Weapon);
}
}

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.NoxCrystal
);
private static readonly Dictionary<Mobile, DefaultSkillMod> m_Table = new();
private static readonly Dictionary<Mobile, DefaultSkillMod> _table = new();
public EvilOmenSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info)
@ -52,7 +52,7 @@ namespace Server.Spells.Necromancy
m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
if (!m_Table.ContainsKey(m))
if (!_table.ContainsKey(m))
{
var mod = new DefaultSkillMod(SkillName.MagicResist, false, 50.0);
@ -61,7 +61,7 @@ namespace Server.Spells.Necromancy
m.AddSkillMod(mod);
}
m_Table[m] = mod;
_table[m] = mod;
}
var duration = TimeSpan.FromSeconds(Caster.Skills.SpiritSpeak.Value / 12 + 1.0);
@ -83,7 +83,7 @@ namespace Server.Spells.Necromancy
public static bool TryEndEffect(Mobile m)
{
if (!m_Table.Remove(m, out var mod))
if (!_table.Remove(m, out var mod))
{
return false;
}

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.DaemonBlood
);
private static readonly Dictionary<Mobile, MRBucket> m_Table = new();
private static readonly Dictionary<Mobile, MRBucket> _table = new();
public MindRotSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -73,7 +73,7 @@ namespace Server.Spells.Necromancy
public static void ClearMindRotScalar(Mobile m)
{
if (m_Table.Remove(m, out var tmpB))
if (_table.Remove(m, out var tmpB))
{
tmpB.m_MRExpireTimer.Stop();
m.SendLocalizedMessage(1060872); // Your mind feels normal again.
@ -82,11 +82,11 @@ namespace Server.Spells.Necromancy
BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
}
public static bool HasMindRotScalar(Mobile m) => m_Table.ContainsKey(m);
public static bool HasMindRotScalar(Mobile m) => _table.ContainsKey(m);
public static bool GetMindRotScalar(Mobile m, ref double scalar)
{
if (m_Table.TryGetValue(m, out var tmpB))
if (_table.TryGetValue(m, out var tmpB))
{
scalar = tmpB.m_Scalar;
return true;
@ -97,10 +97,10 @@ namespace Server.Spells.Necromancy
public static void SetMindRotScalar(Mobile caster, Mobile target, double scalar, TimeSpan duration)
{
if (!m_Table.ContainsKey(target))
if (!_table.ContainsKey(target))
{
var tmpB = new MRBucket(scalar, new MRExpireTimer(target, duration));
m_Table.Add(target, tmpB);
_table.Add(target, tmpB);
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Mindrot, 1075665, duration, target));
tmpB.m_MRExpireTimer.Start();
target.SendLocalizedMessage(1074384);

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.PigIron
);
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new();
private static readonly Dictionary<Mobile, InternalTimer> _table = new();
public PainSpikeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -56,9 +56,9 @@ namespace Server.Spells.Necromancy
var buffTime = TimeSpan.FromSeconds(10.0);
if (!m_Table.TryGetValue(m, out var timer))
if (!_table.TryGetValue(m, out var timer))
{
m_Table[m] = timer = new InternalTimer(m, damage);
_table[m] = timer = new InternalTimer(m, damage);
timer.Start();
}
else
@ -102,7 +102,7 @@ namespace Server.Spells.Necromancy
protected override void OnTick()
{
m_Table.Remove(m_Mobile);
_table.Remove(m_Mobile);
if (m_Mobile.Alive && !m_Mobile.IsDeadBondedPet)
{

View file

@ -15,7 +15,7 @@ namespace Server.Spells.Necromancy
Reagent.NoxCrystal
);
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new();
private static readonly Dictionary<Mobile, InternalTimer> _table = new();
public StrangleSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -60,9 +60,9 @@ namespace Server.Spells.Necromancy
m.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
m.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);
if (!m_Table.TryGetValue(m, out var timer))
if (!_table.TryGetValue(m, out var timer))
{
m_Table[m] = timer = new InternalTimer(m, Caster);
_table[m] = timer = new InternalTimer(m, Caster);
timer.Start();
}
@ -118,7 +118,7 @@ namespace Server.Spells.Necromancy
public static bool RemoveCurse(Mobile m)
{
if (!m_Table.Remove(m, out var timer))
if (!_table.Remove(m, out var timer))
{
return false;
}
@ -168,7 +168,7 @@ namespace Server.Spells.Necromancy
{
if (!m_Target.Alive)
{
m_Table.Remove(m_Target);
_table.Remove(m_Target);
Stop();
}
@ -203,7 +203,7 @@ namespace Server.Spells.Necromancy
if (m_Count == 0)
{
m_Target.SendLocalizedMessage(1061687); // You can breath normally again.
m_Table.Remove(m_Target);
_table.Remove(m_Target);
Stop();
}
else