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

@ -11,7 +11,7 @@ namespace Server.Spells.Spellweaving
-1
);
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
private static readonly Dictionary<Mobile, ExpireTimer> _table = new();
public AttuneWeaponSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info)
@ -25,7 +25,7 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if (m_Table.ContainsKey(Caster))
if (_table.ContainsKey(Caster))
{
Caster.SendLocalizedMessage(501775); // This spell is already in effect.
return false;
@ -58,7 +58,7 @@ namespace Server.Spells.Spellweaving
var t = new ExpireTimer(Caster, duration);
t.Start();
m_Table[Caster] = t;
_table[Caster] = t;
Caster.BeginAction<AttuneWeaponSpell>();
@ -94,11 +94,11 @@ namespace Server.Spells.Spellweaving
}
}
public static bool IsAbsorbing(Mobile m) => m_Table.ContainsKey(m);
public static bool IsAbsorbing(Mobile m) => _table.ContainsKey(m);
public static void StopAbsorbing(Mobile m, bool message)
{
if (m_Table.TryGetValue(m, out var t))
if (_table.TryGetValue(m, out var t))
{
t.DoExpire(message);
}
@ -129,7 +129,7 @@ namespace Server.Spells.Spellweaving
m_Mobile.PlaySound(0x1F8);
}
m_Table.Remove(m_Mobile);
_table.Remove(m_Mobile);
StartTimer(TimeSpan.FromSeconds(120), m_Mobile.EndAction<AttuneWeaponSpell>);
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.AttuneWeapon);

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Spellweaving
{
private static readonly SpellInfo _info = new("Essence of Wind", "Anathrae", -1);
private static readonly Dictionary<Mobile, EssenceOfWindTimer> m_Table = new();
private static readonly Dictionary<Mobile, EssenceOfWindTimer> _table = new();
public EssenceOfWindSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
@ -56,7 +56,7 @@ namespace Server.Spells.Spellweaving
var t = new EssenceOfWindTimer(m, fcMalus, ssiMalus, duration);
t.Start();
m_Table[m] = t;
_table[m] = t;
BuffInfo.AddBuff(
m,
@ -76,15 +76,15 @@ namespace Server.Spells.Spellweaving
FinishSequence();
}
public static int GetFCMalus(Mobile m) => m_Table.TryGetValue(m, out var timer) ? timer._fcMalus : 0;
public static int GetFCMalus(Mobile m) => _table.TryGetValue(m, out var timer) ? timer._fcMalus : 0;
public static int GetSSIMalus(Mobile m) => m_Table.TryGetValue(m, out var timer) ? timer._ssiMalus : 0;
public static int GetSSIMalus(Mobile m) => _table.TryGetValue(m, out var timer) ? timer._ssiMalus : 0;
public static bool IsDebuffed(Mobile m) => m_Table.ContainsKey(m);
public static bool IsDebuffed(Mobile m) => _table.ContainsKey(m);
public static void StopDebuffing(Mobile m, bool message)
{
if (m_Table.TryGetValue(m, out var timer))
if (_table.TryGetValue(m, out var timer))
{
timer.DoExpire(message);
}
@ -111,7 +111,7 @@ namespace Server.Spells.Spellweaving
internal void DoExpire(bool message = true)
{
Stop();
m_Table.Remove(_defender);
_table.Remove(_defender);
BuffInfo.RemoveBuff(_defender, BuffIcon.EssenceOfWind);
}

View file

@ -14,7 +14,7 @@ namespace Server.Spells.Spellweaving
-1
);
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
private static readonly Dictionary<Mobile, ExpireTimer> _table = new();
public GiftOfLifeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info)
@ -38,7 +38,7 @@ namespace Server.Spells.Spellweaving
{
Caster.SendLocalizedMessage(1072077); // You may only cast this spell on yourself or a bonded pet.
}
else if (m_Table.ContainsKey(m))
else if (_table.ContainsKey(m))
{
Caster.SendLocalizedMessage(501775); // This spell is already in effect.
}
@ -65,7 +65,7 @@ namespace Server.Spells.Spellweaving
var t = new ExpireTimer(m, duration, this);
t.Start();
m_Table[m] = t;
_table[m] = t;
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.GiftOfLife, 1031615, 1075807, duration, m, null, true));
}
@ -85,7 +85,7 @@ namespace Server.Spells.Spellweaving
public static void HandleDeath(Mobile m)
{
if (m_Table.ContainsKey(m))
if (_table.ContainsKey(m))
{
Timer.StartTimer(TimeSpan.FromSeconds(Utility.RandomMinMax(2, 4)), () => HandleDeath_OnCallback(m));
}
@ -93,7 +93,7 @@ namespace Server.Spells.Spellweaving
private static void HandleDeath_OnCallback(Mobile m)
{
if (!m_Table.TryGetValue(m, out var timer))
if (!_table.TryGetValue(m, out var timer))
{
return;
}
@ -138,7 +138,7 @@ namespace Server.Spells.Spellweaving
public static void OnLogin(Mobile m)
{
if (m?.Alive != false || m_Table[m] == null)
if (m?.Alive != false || _table[m] == null)
{
return;
}
@ -169,7 +169,7 @@ namespace Server.Spells.Spellweaving
Stop();
m_Mobile.SendLocalizedMessage(1074776); // You are no longer protected with Gift of Life.
m_Table.Remove(m_Mobile);
_table.Remove(m_Mobile);
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.GiftOfLife);
}

View file

@ -12,7 +12,7 @@ namespace Server.Spells.Spellweaving
-1
);
private static readonly Dictionary<Mobile, GiftOfRenewalTimer> m_Table = new();
private static readonly Dictionary<Mobile, GiftOfRenewalTimer> _table = new();
public GiftOfRenewalSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info)
@ -26,7 +26,7 @@ namespace Server.Spells.Spellweaving
public void Target(Mobile m)
{
if (m_Table.ContainsKey(m))
if (_table.ContainsKey(m))
{
Caster.SendLocalizedMessage(501775); // This spell is already in effect.
}
@ -54,7 +54,7 @@ namespace Server.Spells.Spellweaving
var t = new GiftOfRenewalTimer(Caster, m, hitsPerRound, duration);
m_Table[m] = t;
_table[m] = t;
t.Start();
@ -79,7 +79,7 @@ namespace Server.Spells.Spellweaving
{
BuffInfo.RemoveBuff(m, BuffIcon.GiftOfRenewal);
if (m_Table.Remove(m, out var timer))
if (_table.Remove(m, out var timer))
{
timer.Stop();
Timer.StartTimer(TimeSpan.FromSeconds(60), timer.m_Caster.EndAction<GiftOfRenewalSpell>);
@ -115,7 +115,7 @@ namespace Server.Spells.Spellweaving
var m = m_Mobile;
if (!m_Table.ContainsKey(m))
if (!_table.ContainsKey(m))
{
Stop();
return;

View file

@ -12,7 +12,7 @@ namespace Server.Spells.Spellweaving
-1
);
private static readonly Dictionary<BaseWeapon, ImmolatingWeaponTimer> m_Table = new();
private static readonly Dictionary<BaseWeapon, ImmolatingWeaponTimer> _table = new();
public ImmolatingWeaponSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info)
@ -54,7 +54,7 @@ namespace Server.Spells.Spellweaving
var damage = 5 + (int)(skill / 24) + FocusLevel;
var t = new ImmolatingWeaponTimer(TimeSpan.FromSeconds(duration), damage, Caster, weapon);
m_Table[weapon] = t;
_table[weapon] = t;
t.Start();
weapon.InvalidateProperties();
@ -64,14 +64,14 @@ namespace Server.Spells.Spellweaving
FinishSequence();
}
public static bool IsImmolating(BaseWeapon weapon) => m_Table.ContainsKey(weapon);
public static bool IsImmolating(BaseWeapon weapon) => _table.ContainsKey(weapon);
public static int GetImmolatingDamage(BaseWeapon weapon) =>
m_Table.TryGetValue(weapon, out var entry) ? entry._damage : 0;
_table.TryGetValue(weapon, out var entry) ? entry._damage : 0;
public static void DoEffect(BaseWeapon weapon, Mobile target)
{
if (m_Table.Remove(weapon, out var timer))
if (_table.Remove(weapon, out var timer))
{
timer.Stop();
@ -86,7 +86,7 @@ namespace Server.Spells.Spellweaving
public static void StopImmolating(BaseWeapon weapon)
{
if (m_Table.Remove(weapon, out var timer))
if (_table.Remove(weapon, out var timer))
{
timer._caster?.PlaySound(0x27);
timer.Stop();

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Spellweaving
-1
);
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new();
private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public ThunderstormSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info)
@ -66,7 +66,7 @@ namespace Server.Spells.Spellweaving
StopTimer(m);
Timer.StartTimer(duration, () => DoExpire(m), out var timerToken);
m_Table[m] = timerToken;
_table[m] = timerToken;
BuffInfo.AddBuff(
m,
@ -80,11 +80,11 @@ namespace Server.Spells.Spellweaving
FinishSequence();
}
public static int GetCastRecoveryMalus(Mobile m) => m_Table.ContainsKey(m) ? 6 : 0;
public static int GetCastRecoveryMalus(Mobile m) => _table.ContainsKey(m) ? 6 : 0;
private static void StopTimer(Mobile m)
{
if (m_Table.Remove(m, out var timerToken))
if (_table.Remove(m, out var timerToken))
{
timerToken.Cancel();
}