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

@ -1226,7 +1226,7 @@ namespace Server.Spells
public static class TransformationSpellHelper public static class TransformationSpellHelper
{ {
private static readonly Dictionary<Mobile, TransformContext> m_Table = new(); private static readonly Dictionary<Mobile, TransformContext> _table = new();
public static bool CheckCast(Mobile caster, Spell spell) public static bool CheckCast(Mobile caster, Spell spell)
{ {
@ -1360,7 +1360,7 @@ namespace Server.Spells
public static void AddContext(Mobile m, TransformContext context) public static void AddContext(Mobile m, TransformContext context)
{ {
m_Table[m] = context; _table[m] = context;
} }
public static void RemoveContext(Mobile m, bool resetGraphics) public static void RemoveContext(Mobile m, bool resetGraphics)
@ -1375,7 +1375,7 @@ namespace Server.Spells
public static void RemoveContext(Mobile m, TransformContext context, bool resetGraphics) public static void RemoveContext(Mobile m, TransformContext context, bool resetGraphics)
{ {
if (!m_Table.Remove(m)) if (!_table.Remove(m))
{ {
return; return;
} }
@ -1399,7 +1399,7 @@ namespace Server.Spells
public static TransformContext GetContext(Mobile m) public static TransformContext GetContext(Mobile m)
{ {
m_Table.TryGetValue(m, out var context); _table.TryGetValue(m, out var context);
return context; return context;
} }

View file

@ -12,7 +12,7 @@ namespace Server.Spells.Bushido
9002 9002
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
private static readonly Dictionary<Mobile, TimerExecutionToken> m_RegenTable = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> m_RegenTable = new();
public Confidence(Mobile caster, Item scroll) : base(caster, scroll, _info) public Confidence(Mobile caster, Item scroll) : base(caster, scroll, _info)
@ -49,7 +49,7 @@ namespace Server.Spells.Bushido
FinishSequence(); FinishSequence();
} }
public static bool IsConfident(Mobile m) => m_Table.ContainsKey(m); public static bool IsConfident(Mobile m) => _table.ContainsKey(m);
public static void BeginConfidence(Mobile m) public static void BeginConfidence(Mobile m)
{ {
@ -64,12 +64,12 @@ namespace Server.Spells.Bushido
out var timerToken out var timerToken
); );
m_Table[m] = timerToken; _table[m] = timerToken;
} }
private static bool StopConfidenceTimer(Mobile m) private static bool StopConfidenceTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
return true; return true;

View file

@ -13,7 +13,7 @@ namespace Server.Spells.Bushido
9002 9002
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public CounterAttack(Mobile caster, Item scroll) : base(caster, scroll, _info) public CounterAttack(Mobile caster, Item scroll) : base(caster, scroll, _info)
{ {
@ -71,11 +71,11 @@ namespace Server.Spells.Bushido
FinishSequence(); FinishSequence();
} }
public static bool IsCountering(Mobile m) => m_Table.ContainsKey(m); public static bool IsCountering(Mobile m) => _table.ContainsKey(m);
private static bool StopCounterTimer(Mobile m) private static bool StopCounterTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
return true; return true;
@ -97,7 +97,7 @@ namespace Server.Spells.Bushido
out var timerToken out var timerToken
); );
m_Table[m] = timerToken; _table[m] = timerToken;
} }
public static void StopCountering(Mobile m) public static void StopCountering(Mobile m)

View file

@ -13,7 +13,7 @@ namespace Server.Spells.Bushido
9002 9002
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public Evasion(Mobile caster, Item scroll) : base(caster, scroll, _info) public Evasion(Mobile caster, Item scroll) : base(caster, scroll, _info)
{ {
@ -138,7 +138,7 @@ namespace Server.Spells.Bushido
FinishSequence(); FinishSequence();
} }
public static bool IsEvading(Mobile m) => m_Table.ContainsKey(m); public static bool IsEvading(Mobile m) => _table.ContainsKey(m);
public static TimeSpan GetEvadeDuration(Mobile m) public static TimeSpan GetEvadeDuration(Mobile m)
{ {
@ -216,12 +216,12 @@ namespace Server.Spells.Bushido
out var timerToken out var timerToken
); );
m_Table[m] = timerToken; _table[m] = timerToken;
} }
private static bool StopEvasionTimer(Mobile m) private static bool StopEvasionTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timer)) if (_table.Remove(m, out var timer))
{ {
timer.Cancel(); timer.Cancel();
return true; return true;

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Bushido
{ {
public class HonorableExecution : SamuraiMove public class HonorableExecution : SamuraiMove
{ {
private static readonly Dictionary<Mobile, HonorableExecutionTimer> m_Table = new(); private static readonly Dictionary<Mobile, HonorableExecutionTimer> _table = new();
public override int BaseMana => 0; public override int BaseMana => 0;
public override double RequiredSkill => 25.0; public override double RequiredSkill => 25.0;
@ -63,20 +63,20 @@ namespace Server.Spells.Bushido
timer = new HonorableExecutionTimer(attacker, mods); timer = new HonorableExecutionTimer(attacker, mods);
} }
m_Table[attacker] = timer; _table[attacker] = timer;
timer.Start(); timer.Start();
attacker.Delta(MobileDelta.WeaponDamage); attacker.Delta(MobileDelta.WeaponDamage);
CheckGain(attacker); CheckGain(attacker);
} }
public static int GetSwingBonus(Mobile target) => m_Table.TryGetValue(target, out var info) ? info.m_SwingBonus : 0; public static int GetSwingBonus(Mobile target) => _table.TryGetValue(target, out var info) ? info.m_SwingBonus : 0;
public static bool IsUnderPenalty(Mobile target) => m_Table.TryGetValue(target, out var info) && info.m_Penalty; public static bool IsUnderPenalty(Mobile target) => _table.TryGetValue(target, out var info) && info.m_Penalty;
public static void RemovePenalty(Mobile target) public static void RemovePenalty(Mobile target)
{ {
if (m_Table.Remove(target, out var timer)) if (_table.Remove(target, out var timer))
{ {
timer.Clear(); timer.Clear();
} }

View file

@ -13,7 +13,7 @@ namespace Server.Spells.Chivalry
9002 9002
); );
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new(); private static readonly Dictionary<BaseWeapon, ExpireTimer> _table = new();
public ConsecrateWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public ConsecrateWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -86,12 +86,12 @@ namespace Server.Spells.Chivalry
var duration = TimeSpan.FromSeconds(seconds); var duration = TimeSpan.FromSeconds(seconds);
m_Table.TryGetValue(weapon, out var timer); _table.TryGetValue(weapon, out var timer);
timer?.Stop(); timer?.Stop();
weapon.Consecrated = true; weapon.Consecrated = true;
m_Table[weapon] = timer = new ExpireTimer(weapon, duration); _table[weapon] = timer = new ExpireTimer(weapon, duration);
timer.Start(); timer.Start();
} }
@ -112,7 +112,7 @@ namespace Server.Spells.Chivalry
{ {
m_Weapon.Consecrated = false; m_Weapon.Consecrated = false;
Effects.PlaySound(m_Weapon.GetWorldLocation(), m_Weapon.Map, 0x1F8); Effects.PlaySound(m_Weapon.GetWorldLocation(), m_Weapon.Map, 0x1F8);
m_Table.Remove(m_Weapon); _table.Remove(m_Weapon);
} }
} }
} }

View file

@ -12,7 +12,7 @@ namespace Server.Spells.Chivalry
9002 9002
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public DivineFurySpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public DivineFurySpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -46,7 +46,7 @@ namespace Server.Spells.Chivalry
out var timerToken out var timerToken
); );
m_Table[Caster] = timerToken; _table[Caster] = timerToken;
Caster.Delta(MobileDelta.WeaponDamage); Caster.Delta(MobileDelta.WeaponDamage);
@ -61,7 +61,7 @@ namespace Server.Spells.Chivalry
private static void RemoveTimer(Mobile m) private static void RemoveTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
} }
@ -74,6 +74,6 @@ namespace Server.Spells.Chivalry
m.PlaySound(0xF8); m.PlaySound(0xF8);
} }
public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public static bool UnderEffect(Mobile m) => _table.ContainsKey(m);
} }
} }

View file

@ -13,7 +13,7 @@ namespace Server.Spells.Chivalry
9002 9002
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public EnemyOfOneSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public EnemyOfOneSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -42,7 +42,7 @@ namespace Server.Spells.Chivalry
Timer.StartTimer(TimeSpan.FromMinutes(delay), () => Expire_Callback(Caster), out var timerToken); Timer.StartTimer(TimeSpan.FromMinutes(delay), () => Expire_Callback(Caster), out var timerToken);
m_Table[Caster] = timerToken; _table[Caster] = timerToken;
if (Caster is PlayerMobile mobile) if (Caster is PlayerMobile mobile)
{ {
@ -61,7 +61,7 @@ namespace Server.Spells.Chivalry
private static void RemoveTimer(Mobile m) private static void RemoveTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
} }

View file

@ -19,7 +19,7 @@ namespace Server.Spells.Fifth
Reagent.Nightshade Reagent.Nightshade
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public IncognitoSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public IncognitoSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -112,7 +112,7 @@ namespace Server.Spells.Fifth
var length = TimeSpan.FromSeconds(timeVal); var length = TimeSpan.FromSeconds(timeVal);
Timer.StartTimer(length, () => EndIncognito(Caster), out var timerToken); Timer.StartTimer(length, () => EndIncognito(Caster), out var timerToken);
m_Table[Caster] = timerToken; _table[Caster] = timerToken;
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, Caster)); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, Caster));
} }
@ -127,7 +127,7 @@ namespace Server.Spells.Fifth
public static void StopTimer(Mobile m) public static void StopTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
} }

View file

@ -14,7 +14,7 @@ namespace Server.Spells.Fifth
Reagent.SpidersSilk Reagent.SpidersSilk
); );
private static readonly Dictionary<Mobile, ResistanceMod[]> m_Table = new(); private static readonly Dictionary<Mobile, ResistanceMod[]> _table = new();
public MagicReflectSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public MagicReflectSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -59,7 +59,7 @@ namespace Server.Spells.Fifth
{ {
var targ = Caster; var targ = Caster;
if (m_Table.Remove(targ, out var mods)) if (_table.Remove(targ, out var mods))
{ {
targ.PlaySound(0x1ED); targ.PlaySound(0x1ED);
targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
@ -88,7 +88,7 @@ namespace Server.Spells.Fifth
new ResistanceMod(ResistanceType.Energy, otherMod) new ResistanceMod(ResistanceType.Energy, otherMod)
}; };
m_Table[targ] = mods; _table[targ] = mods;
for (var i = 0; i < mods.Length; ++i) for (var i = 0; i < mods.Length; ++i)
{ {
@ -137,7 +137,7 @@ namespace Server.Spells.Fifth
public static void EndReflect(Mobile m) public static void EndReflect(Mobile m)
{ {
if (!m_Table.Remove(m, out var mods)) if (!_table.Remove(m, out var mods))
{ {
return; return;
} }

View file

@ -15,7 +15,7 @@ namespace Server.Spells.First
Reagent.SulfurousAsh Reagent.SulfurousAsh
); );
private static readonly Dictionary<Mobile, ResistanceMod[]> m_Table = new(); private static readonly Dictionary<Mobile, ResistanceMod[]> _table = new();
public ReactiveArmorSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public ReactiveArmorSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -61,7 +61,7 @@ namespace Server.Spells.First
{ {
var targ = Caster; var targ = Caster;
if (m_Table.Remove(targ, out var mods)) if (_table.Remove(targ, out var mods))
{ {
targ.PlaySound(0x1ED); targ.PlaySound(0x1ED);
targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
@ -90,7 +90,7 @@ namespace Server.Spells.First
new ResistanceMod(ResistanceType.Energy, -5) new ResistanceMod(ResistanceType.Energy, -5)
}; };
m_Table[targ] = mods; _table[targ] = mods;
for (var i = 0; i < mods.Length; ++i) for (var i = 0; i < mods.Length; ++i)
{ {
@ -144,7 +144,7 @@ namespace Server.Spells.First
public static void EndArmor(Mobile m) public static void EndArmor(Mobile m)
{ {
if (!m_Table.Remove(m, out var mods)) if (!_table.Remove(m, out var mods))
{ {
return; return;
} }

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Fourth
Reagent.SpidersSilk Reagent.SpidersSilk
); );
private static readonly HashSet<Mobile> m_Table = new(); private static readonly HashSet<Mobile> _table = new();
public ManaDrainSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public ManaDrainSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -40,7 +40,7 @@ namespace Server.Spells.Fourth
{ {
var toDrain = Math.Clamp(40 + (int)(GetDamageSkill(Caster) - GetResistSkill(m)), 0, m.Mana); var toDrain = Math.Clamp(40 + (int)(GetDamageSkill(Caster) - GetResistSkill(m)), 0, m.Mana);
if (m_Table.Contains(m)) if (_table.Contains(m))
{ {
toDrain = 0; toDrain = 0;
} }
@ -52,7 +52,7 @@ namespace Server.Spells.Fourth
{ {
m.Mana -= toDrain; m.Mana -= toDrain;
m_Table.Add(m); _table.Add(m);
Timer.StartTimer(TimeSpan.FromSeconds(5.0), () => AosDelay_Callback(m, toDrain)); Timer.StartTimer(TimeSpan.FromSeconds(5.0), () => AosDelay_Callback(m, toDrain));
} }
} }
@ -96,7 +96,7 @@ namespace Server.Spells.Fourth
m.PlaySound(0x28E); m.PlaySound(0x28E);
} }
m_Table.Remove(m); _table.Remove(m);
} }
public override double GetResistPercent(Mobile target) => 99.0; public override double GetResistPercent(Mobile target) => 99.0;

View file

@ -17,7 +17,7 @@ namespace Server.Spells.Mysticism
Reagent.SulfurousAsh Reagent.SulfurousAsh
); );
private static readonly Dictionary<Mobile, SpellPlagueTimer> m_Table = new(); private static readonly Dictionary<Mobile, SpellPlagueTimer> _table = new();
public SpellPlagueSpell(Mobile caster, Item scroll = null) public SpellPlagueSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : base(caster, scroll, _info)
@ -64,13 +64,13 @@ namespace Server.Spells.Mysticism
var timer = new SpellPlagueTimer(this, targeted); var timer = new SpellPlagueTimer(this, targeted);
if (m_Table.TryGetValue(targeted, out var oldtimer)) if (_table.TryGetValue(targeted, out var oldtimer))
{ {
oldtimer.SetNext(timer); oldtimer.SetNext(timer);
} }
else else
{ {
m_Table[targeted] = timer; _table[targeted] = timer;
timer.StartPlague(); timer.StartPlague();
} }
} }
@ -78,11 +78,11 @@ namespace Server.Spells.Mysticism
FinishSequence(); FinishSequence();
} }
public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public static bool UnderEffect(Mobile m) => _table.ContainsKey(m);
public static void RemoveEffect(Mobile m) public static void RemoveEffect(Mobile m)
{ {
if (m_Table.TryGetValue(m, out var context)) if (_table.TryGetValue(m, out var context))
{ {
context.EndPlague(false); context.EndPlague(false);
} }
@ -90,7 +90,7 @@ namespace Server.Spells.Mysticism
public static void CheckPlague(Mobile m) public static void CheckPlague(Mobile m)
{ {
if (m_Table.TryGetValue(m, out var context)) if (_table.TryGetValue(m, out var context))
{ {
context.OnDamage(); context.OnDamage();
} }
@ -183,12 +183,12 @@ namespace Server.Spells.Mysticism
{ {
if (restart && m_Next != null) if (restart && m_Next != null)
{ {
m_Table[m_Target] = m_Next; _table[m_Target] = m_Next;
m_Next.StartPlague(); m_Next.StartPlague();
} }
else else
{ {
m_Table.Remove(m_Target); _table.Remove(m_Target);
BuffInfo.RemoveBuff(m_Target, BuffIcon.SpellPlague); BuffInfo.RemoveBuff(m_Target, BuffIcon.SpellPlague);
} }
} }

View file

@ -19,7 +19,7 @@ namespace Server.Spells.Mysticism
Reagent.Garlic Reagent.Garlic
); );
private static readonly Dictionary<Mobile, ResistanceMod[]> m_Table = new(); private static readonly Dictionary<Mobile, ResistanceMod[]> _table = new();
public StoneFormSpell(Mobile caster, Item scroll = null) public StoneFormSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : base(caster, scroll, _info)
@ -36,7 +36,7 @@ namespace Server.Spells.Mysticism
EventSink.PlayerDeath += OnPlayerDeath; EventSink.PlayerDeath += OnPlayerDeath;
} }
public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public static bool UnderEffect(Mobile m) => _table.ContainsKey(m);
public override bool CheckCast() public override bool CheckCast()
{ {
@ -118,7 +118,7 @@ namespace Server.Spells.Mysticism
Caster.AddResistanceMod(mods[i]); Caster.AddResistanceMod(mods[i]);
} }
m_Table[Caster] = mods; _table[Caster] = mods;
Caster.PlaySound(0x65A); Caster.PlaySound(0x65A);
Caster.Delta(MobileDelta.Resistances); Caster.Delta(MobileDelta.Resistances);
@ -145,7 +145,7 @@ namespace Server.Spells.Mysticism
public static void RemoveEffects(Mobile m) public static void RemoveEffects(Mobile m)
{ {
if (!m_Table.Remove(m, out var mods)) if (!_table.Remove(m, out var mods))
{ {
return; return;
} }

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) 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) 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; return;
} }
@ -244,7 +244,7 @@ namespace Server.Spells.Necromancy
if (list.Count == 0) if (list.Count == 0)
{ {
m_Table.Remove(master); _table.Remove(master);
} }
} }
@ -255,9 +255,9 @@ namespace Server.Spells.Necromancy
return; 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) 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, 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) public BloodOathSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -65,7 +65,7 @@ namespace Server.Spells.Necromancy
* ((ss-rm)/8)+8 * ((ss-rm)/8)+8
*/ */
m_Table.TryGetValue(m, out var timer); _table.TryGetValue(m, out var timer);
timer?.DoExpire(); timer?.DoExpire();
m_OathTable[Caster] = Caster; 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(Caster, new BuffInfo(BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name));
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name)); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name));
m_Table[m] = timer; _table[m] = timer;
HarmfulSpell(m); HarmfulSpell(m);
} }
@ -104,7 +104,7 @@ namespace Server.Spells.Necromancy
public static void RemoveCurse(Mobile m) public static void RemoveCurse(Mobile m)
{ {
m_Table.TryGetValue(m, out var t); _table.TryGetValue(m, out var t);
t?.DoExpire(); t?.DoExpire();
} }
@ -153,7 +153,7 @@ namespace Server.Spells.Necromancy
BuffInfo.RemoveBuff(m_Caster, BuffIcon.BloodOathCaster); BuffInfo.RemoveBuff(m_Caster, BuffIcon.BloodOathCaster);
BuffInfo.RemoveBuff(m_Target, BuffIcon.BloodOathCurse); 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 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) 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 * 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(); timer.DoExpire();
} }
@ -82,7 +82,7 @@ namespace Server.Spells.Necromancy
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.CorpseSkin, 1075663, duration, m)); 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) for (var i = 0; i < mods.Length; ++i)
{ {
@ -102,7 +102,7 @@ namespace Server.Spells.Necromancy
public static bool RemoveCurse(Mobile m) public static bool RemoveCurse(Mobile m)
{ {
if (!m_Table.TryGetValue(m, out var t)) if (!_table.TryGetValue(m, out var t))
{ {
return false; return false;
} }
@ -132,7 +132,7 @@ namespace Server.Spells.Necromancy
Stop(); Stop();
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.CorpseSkin); BuffInfo.RemoveBuff(m_Mobile, BuffIcon.CorpseSkin);
m_Table.Remove(m_Mobile); _table.Remove(m_Mobile);
} }
protected override void OnTick() protected override void OnTick()

View file

@ -14,7 +14,7 @@ namespace Server.Spells.Necromancy
Reagent.PigIron 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) 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); 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(); timer?.Stop();
weapon.Cursed = true; weapon.Cursed = true;
m_Table[weapon] = timer = new ExpireTimer(weapon, duration); _table[weapon] = timer = new ExpireTimer(weapon, duration);
timer.Start(); timer.Start();
} }
@ -75,7 +75,7 @@ namespace Server.Spells.Necromancy
{ {
m_Weapon.Cursed = false; m_Weapon.Cursed = false;
Effects.PlaySound(m_Weapon.GetWorldLocation(), m_Weapon.Map, 0xFA); 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 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) public EvilOmenSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : base(caster, scroll, _info)
@ -52,7 +52,7 @@ namespace Server.Spells.Necromancy
m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head); m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
m.FixedParticles(0x3779, 1, 15, 9502, 67, 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); var mod = new DefaultSkillMod(SkillName.MagicResist, false, 50.0);
@ -61,7 +61,7 @@ namespace Server.Spells.Necromancy
m.AddSkillMod(mod); m.AddSkillMod(mod);
} }
m_Table[m] = mod; _table[m] = mod;
} }
var duration = TimeSpan.FromSeconds(Caster.Skills.SpiritSpeak.Value / 12 + 1.0); 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) public static bool TryEndEffect(Mobile m)
{ {
if (!m_Table.Remove(m, out var mod)) if (!_table.Remove(m, out var mod))
{ {
return false; return false;
} }

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.DaemonBlood 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) 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) 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(); tmpB.m_MRExpireTimer.Stop();
m.SendLocalizedMessage(1060872); // Your mind feels normal again. m.SendLocalizedMessage(1060872); // Your mind feels normal again.
@ -82,11 +82,11 @@ namespace Server.Spells.Necromancy
BuffInfo.RemoveBuff(m, BuffIcon.Mindrot); 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) 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; scalar = tmpB.m_Scalar;
return true; return true;
@ -97,10 +97,10 @@ namespace Server.Spells.Necromancy
public static void SetMindRotScalar(Mobile caster, Mobile target, double scalar, TimeSpan duration) 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)); 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)); BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Mindrot, 1075665, duration, target));
tmpB.m_MRExpireTimer.Start(); tmpB.m_MRExpireTimer.Start();
target.SendLocalizedMessage(1074384); target.SendLocalizedMessage(1074384);

View file

@ -16,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.PigIron 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) 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); 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(); timer.Start();
} }
else else
@ -102,7 +102,7 @@ namespace Server.Spells.Necromancy
protected override void OnTick() protected override void OnTick()
{ {
m_Table.Remove(m_Mobile); _table.Remove(m_Mobile);
if (m_Mobile.Alive && !m_Mobile.IsDeadBondedPet) if (m_Mobile.Alive && !m_Mobile.IsDeadBondedPet)
{ {

View file

@ -15,7 +15,7 @@ namespace Server.Spells.Necromancy
Reagent.NoxCrystal 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) 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(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
m.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255); 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(); timer.Start();
} }
@ -118,7 +118,7 @@ namespace Server.Spells.Necromancy
public static bool RemoveCurse(Mobile m) public static bool RemoveCurse(Mobile m)
{ {
if (!m_Table.Remove(m, out var timer)) if (!_table.Remove(m, out var timer))
{ {
return false; return false;
} }
@ -168,7 +168,7 @@ namespace Server.Spells.Necromancy
{ {
if (!m_Target.Alive) if (!m_Target.Alive)
{ {
m_Table.Remove(m_Target); _table.Remove(m_Target);
Stop(); Stop();
} }
@ -203,7 +203,7 @@ namespace Server.Spells.Necromancy
if (m_Count == 0) if (m_Count == 0)
{ {
m_Target.SendLocalizedMessage(1061687); // You can breath normally again. m_Target.SendLocalizedMessage(1061687); // You can breath normally again.
m_Table.Remove(m_Target); _table.Remove(m_Target);
Stop(); Stop();
} }
else else

View file

@ -26,7 +26,7 @@ namespace Server.Spells.Ninjitsu
); );
private static readonly Dictionary<Mobile, int> m_LastAnimalForms = new(); private static readonly Dictionary<Mobile, int> m_LastAnimalForms = new();
private static readonly Dictionary<Mobile, AnimalFormContext> m_Table = new(); private static readonly Dictionary<Mobile, AnimalFormContext> _table = new();
private bool m_WasMoving; private bool m_WasMoving;
@ -272,7 +272,7 @@ namespace Server.Spells.Ninjitsu
public static void AddContext(Mobile m, AnimalFormContext context) public static void AddContext(Mobile m, AnimalFormContext context)
{ {
m_Table[m] = context; _table[m] = context;
if (context.Type == typeof(BakeKitsune) || context.Type == typeof(GreyWolf)) if (context.Type == typeof(BakeKitsune) || context.Type == typeof(GreyWolf))
{ {
@ -292,7 +292,7 @@ namespace Server.Spells.Ninjitsu
public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics) public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics)
{ {
m_Table.Remove(m); _table.Remove(m);
if (context.SpeedBoost) if (context.SpeedBoost)
{ {
@ -324,9 +324,9 @@ namespace Server.Spells.Ninjitsu
context.Timer.Stop(); context.Timer.Stop();
} }
public static AnimalFormContext GetContext(Mobile m) => m_Table.TryGetValue(m, out var context) ? context : null; public static AnimalFormContext GetContext(Mobile m) => _table.TryGetValue(m, out var context) ? context : null;
public static bool UnderTransformation(Mobile m) => m_Table.ContainsKey(m); public static bool UnderTransformation(Mobile m) => _table.ContainsKey(m);
public static bool UnderTransformation(Mobile m, Type type) => GetContext(m)?.Type == type; public static bool UnderTransformation(Mobile m, Type type) => GetContext(m)?.Type == type;

View file

@ -8,7 +8,7 @@ namespace Server.Spells.Ninjitsu
{ {
public class DeathStrike : NinjaMove public class DeathStrike : NinjaMove
{ {
private static readonly Dictionary<Mobile, DeathStrikeTimer> m_Table = new(); private static readonly Dictionary<Mobile, DeathStrikeTimer> _table = new();
public override int BaseMana => 30; public override int BaseMana => 30;
public override double RequiredSkill => 85.0; public override double RequiredSkill => 85.0;
@ -51,7 +51,7 @@ namespace Server.Spells.Ninjitsu
var damageBonus = 0; var damageBonus = 0;
if (m_Table.Remove(defender, out var timer)) if (_table.Remove(defender, out var timer))
{ {
defender.SendLocalizedMessage(1063092); // Your opponent lands another Death Strike! defender.SendLocalizedMessage(1063092); // Your opponent lands another Death Strike!
@ -74,7 +74,7 @@ namespace Server.Spells.Ninjitsu
var t = new DeathStrikeTimer(defender, attacker, damageBonus, isRanged); var t = new DeathStrikeTimer(defender, attacker, damageBonus, isRanged);
m_Table[defender] = t; _table[defender] = t;
t.Start(); t.Start();
@ -83,7 +83,7 @@ namespace Server.Spells.Ninjitsu
public static void AddStep(Mobile m) public static void AddStep(Mobile m)
{ {
if (m_Table.TryGetValue(m, out var timer) && ++timer.Steps >= 5) if (_table.TryGetValue(m, out var timer) && ++timer.Steps >= 5)
{ {
timer.ProcessDeathStrike(); timer.ProcessDeathStrike();
} }

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Ninjitsu
{ {
public class KiAttack : NinjaMove public class KiAttack : NinjaMove
{ {
private static readonly Dictionary<Mobile, KiAttackTimer> m_Table = new(); private static readonly Dictionary<Mobile, KiAttackTimer> _table = new();
public override int BaseMana => 25; public override int BaseMana => 25;
public override double RequiredSkill => 80.0; public override double RequiredSkill => 80.0;
@ -22,7 +22,7 @@ namespace Server.Spells.Ninjitsu
} }
var t = new KiAttackTimer(from); var t = new KiAttackTimer(from);
m_Table[from] = t; _table[from] = t;
t.Start(); t.Start();
} }
@ -86,7 +86,7 @@ namespace Server.Spells.Ninjitsu
public override void OnClearMove(Mobile from) public override void OnClearMove(Mobile from)
{ {
if (m_Table.Remove(from, out var t)) if (_table.Remove(from, out var t))
{ {
t.Stop(); t.Stop();
} }
@ -94,7 +94,7 @@ namespace Server.Spells.Ninjitsu
public static double GetBonus(Mobile from) public static double GetBonus(Mobile from)
{ {
if (!m_Table.TryGetValue(from, out var t)) if (!_table.TryGetValue(from, out var t))
{ {
return 0; return 0;
} }
@ -121,7 +121,7 @@ namespace Server.Spells.Ninjitsu
ClearCurrentMove(m_Mobile); ClearCurrentMove(m_Mobile);
m_Mobile.SendLocalizedMessage(1063102); // You failed to complete your Ki Attack in time. m_Mobile.SendLocalizedMessage(1063102); // You failed to complete your Ki Attack in time.
m_Table.Remove(m_Mobile); _table.Remove(m_Mobile);
} }
} }
} }

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Ninjitsu
public class SurpriseAttack : NinjaMove public class SurpriseAttack : NinjaMove
{ {
private static readonly Dictionary<Mobile, SurpriseAttackInfo> private static readonly Dictionary<Mobile, SurpriseAttackInfo>
m_Table = new(); _table = new();
public override int BaseMana => 20; public override int BaseMana => 20;
public override double RequiredSkill => Core.ML ? 60.0 : 30.0; public override double RequiredSkill => Core.ML ? 60.0 : 30.0;
@ -62,7 +62,7 @@ namespace Server.Spells.Ninjitsu
var info = new SurpriseAttackInfo(defender, malus); var info = new SurpriseAttackInfo(defender, malus);
Timer.StartTimer(TimeSpan.FromSeconds(8.0), () => EndSurprise(info), out info._timerToken); Timer.StartTimer(TimeSpan.FromSeconds(8.0), () => EndSurprise(info), out info._timerToken);
m_Table[defender] = info; _table[defender] = info;
CheckGain(attacker); CheckGain(attacker);
} }
@ -78,7 +78,7 @@ namespace Server.Spells.Ninjitsu
public static bool GetMalus(Mobile target, ref int malus) public static bool GetMalus(Mobile target, ref int malus)
{ {
if (!m_Table.TryGetValue(target, out var info)) if (!_table.TryGetValue(target, out var info))
{ {
return false; return false;
} }
@ -89,7 +89,7 @@ namespace Server.Spells.Ninjitsu
private static void StopTimer(Mobile m) private static void StopTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var info)) if (_table.Remove(m, out var info))
{ {
info._timerToken.Cancel(); info._timerToken.Cancel();
} }

View file

@ -15,7 +15,7 @@ namespace Server.Spells.Second
Reagent.SulfurousAsh Reagent.SulfurousAsh
); );
private static readonly Dictionary<Mobile, Tuple<ResistanceMod, DefaultSkillMod>> m_Table = private static readonly Dictionary<Mobile, Tuple<ResistanceMod, DefaultSkillMod>> _table =
new(); new();
public ProtectionSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public ProtectionSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
@ -60,7 +60,7 @@ namespace Server.Spells.Second
* even after dying<EFBFBD>until you <EFBFBD>turn them off<EFBFBD> by casting them again. * even after dying<EFBFBD>until you <EFBFBD>turn them off<EFBFBD> by casting them again.
*/ */
if (m_Table.Remove(target, out var mods)) if (_table.Remove(target, out var mods))
{ {
target.PlaySound(0x1ED); target.PlaySound(0x1ED);
target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);
@ -89,7 +89,7 @@ namespace Server.Spells.Second
) )
); );
m_Table[target] = mods; _table[target] = mods;
Registry[target] = 1000; // 100.0% protection from disruption Registry[target] = 1000; // 100.0% protection from disruption
target.AddResistanceMod(mods.Item1); target.AddResistanceMod(mods.Item1);
@ -104,7 +104,7 @@ namespace Server.Spells.Second
public static void EndProtection(Mobile m) public static void EndProtection(Mobile m)
{ {
if (!m_Table.Remove(m, out var mods)) if (!_table.Remove(m, out var mods))
{ {
return; return;
} }

View file

@ -19,7 +19,7 @@ namespace Server.Spells.Seventh
Reagent.MandrakeRoot Reagent.MandrakeRoot
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
private readonly int m_NewBody; private readonly int m_NewBody;
@ -170,7 +170,7 @@ namespace Server.Spells.Seventh
var duration = Math.Max((int)caster.Skills.Magery.Value, 120); var duration = Math.Max((int)caster.Skills.Magery.Value, 120);
Timer.StartTimer(TimeSpan.FromSeconds(duration), () => EndPolymorph(caster), out var timerToken); Timer.StartTimer(TimeSpan.FromSeconds(duration), () => EndPolymorph(caster), out var timerToken);
m_Table[caster] = timerToken; _table[caster] = timerToken;
} }
} }
} }
@ -185,7 +185,7 @@ namespace Server.Spells.Seventh
public static void StopTimer(Mobile m) public static void StopTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timer)) if (_table.Remove(m, out var timer))
{ {
timer.Cancel(); timer.Cancel();
} }

View file

@ -18,7 +18,7 @@ namespace Server.Spells.Sixth
Reagent.Nightshade Reagent.Nightshade
); );
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new(); private static readonly Dictionary<Mobile, TimerExecutionToken> _table = new();
public InvisibilitySpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info) public InvisibilitySpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{ {
@ -65,7 +65,7 @@ namespace Server.Spells.Sixth
out var timerToken out var timerToken
); );
m_Table[m] = timerToken; _table[m] = timerToken;
} }
FinishSequence(); FinishSequence();
@ -87,11 +87,11 @@ namespace Server.Spells.Sixth
Caster.Target = new SpellTargetMobile(this, TargetFlags.Beneficial, Core.ML ? 10 : 12); Caster.Target = new SpellTargetMobile(this, TargetFlags.Beneficial, Core.ML ? 10 : 12);
} }
public static bool HasTimer(Mobile m) => m_Table.ContainsKey(m); public static bool HasTimer(Mobile m) => _table.ContainsKey(m);
public static void StopTimer(Mobile m) public static void StopTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
} }

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Spellweaving
-1 -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) public AttuneWeaponSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : base(caster, scroll, _info)
@ -25,7 +25,7 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast() public override bool CheckCast()
{ {
if (m_Table.ContainsKey(Caster)) if (_table.ContainsKey(Caster))
{ {
Caster.SendLocalizedMessage(501775); // This spell is already in effect. Caster.SendLocalizedMessage(501775); // This spell is already in effect.
return false; return false;
@ -58,7 +58,7 @@ namespace Server.Spells.Spellweaving
var t = new ExpireTimer(Caster, duration); var t = new ExpireTimer(Caster, duration);
t.Start(); t.Start();
m_Table[Caster] = t; _table[Caster] = t;
Caster.BeginAction<AttuneWeaponSpell>(); 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) 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); t.DoExpire(message);
} }
@ -129,7 +129,7 @@ namespace Server.Spells.Spellweaving
m_Mobile.PlaySound(0x1F8); m_Mobile.PlaySound(0x1F8);
} }
m_Table.Remove(m_Mobile); _table.Remove(m_Mobile);
StartTimer(TimeSpan.FromSeconds(120), m_Mobile.EndAction<AttuneWeaponSpell>); StartTimer(TimeSpan.FromSeconds(120), m_Mobile.EndAction<AttuneWeaponSpell>);
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.AttuneWeapon); 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 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) 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); var t = new EssenceOfWindTimer(m, fcMalus, ssiMalus, duration);
t.Start(); t.Start();
m_Table[m] = t; _table[m] = t;
BuffInfo.AddBuff( BuffInfo.AddBuff(
m, m,
@ -76,15 +76,15 @@ namespace Server.Spells.Spellweaving
FinishSequence(); 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) 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); timer.DoExpire(message);
} }
@ -111,7 +111,7 @@ namespace Server.Spells.Spellweaving
internal void DoExpire(bool message = true) internal void DoExpire(bool message = true)
{ {
Stop(); Stop();
m_Table.Remove(_defender); _table.Remove(_defender);
BuffInfo.RemoveBuff(_defender, BuffIcon.EssenceOfWind); BuffInfo.RemoveBuff(_defender, BuffIcon.EssenceOfWind);
} }

View file

@ -14,7 +14,7 @@ namespace Server.Spells.Spellweaving
-1 -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) public GiftOfLifeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : 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. 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. Caster.SendLocalizedMessage(501775); // This spell is already in effect.
} }
@ -65,7 +65,7 @@ namespace Server.Spells.Spellweaving
var t = new ExpireTimer(m, duration, this); var t = new ExpireTimer(m, duration, this);
t.Start(); t.Start();
m_Table[m] = t; _table[m] = t;
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.GiftOfLife, 1031615, 1075807, duration, m, null, true)); 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) 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)); 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) private static void HandleDeath_OnCallback(Mobile m)
{ {
if (!m_Table.TryGetValue(m, out var timer)) if (!_table.TryGetValue(m, out var timer))
{ {
return; return;
} }
@ -138,7 +138,7 @@ namespace Server.Spells.Spellweaving
public static void OnLogin(Mobile m) public static void OnLogin(Mobile m)
{ {
if (m?.Alive != false || m_Table[m] == null) if (m?.Alive != false || _table[m] == null)
{ {
return; return;
} }
@ -169,7 +169,7 @@ namespace Server.Spells.Spellweaving
Stop(); Stop();
m_Mobile.SendLocalizedMessage(1074776); // You are no longer protected with Gift of Life. 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); BuffInfo.RemoveBuff(m_Mobile, BuffIcon.GiftOfLife);
} }

View file

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

View file

@ -12,7 +12,7 @@ namespace Server.Spells.Spellweaving
-1 -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) public ImmolatingWeaponSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : base(caster, scroll, _info)
@ -54,7 +54,7 @@ namespace Server.Spells.Spellweaving
var damage = 5 + (int)(skill / 24) + FocusLevel; var damage = 5 + (int)(skill / 24) + FocusLevel;
var t = new ImmolatingWeaponTimer(TimeSpan.FromSeconds(duration), damage, Caster, weapon); var t = new ImmolatingWeaponTimer(TimeSpan.FromSeconds(duration), damage, Caster, weapon);
m_Table[weapon] = t; _table[weapon] = t;
t.Start(); t.Start();
weapon.InvalidateProperties(); weapon.InvalidateProperties();
@ -64,14 +64,14 @@ namespace Server.Spells.Spellweaving
FinishSequence(); 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) => 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) 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(); timer.Stop();
@ -86,7 +86,7 @@ namespace Server.Spells.Spellweaving
public static void StopImmolating(BaseWeapon weapon) 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._caster?.PlaySound(0x27);
timer.Stop(); timer.Stop();

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Spellweaving
-1 -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) public ThunderstormSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, _info) : base(caster, scroll, _info)
@ -66,7 +66,7 @@ namespace Server.Spells.Spellweaving
StopTimer(m); StopTimer(m);
Timer.StartTimer(duration, () => DoExpire(m), out var timerToken); Timer.StartTimer(duration, () => DoExpire(m), out var timerToken);
m_Table[m] = timerToken; _table[m] = timerToken;
BuffInfo.AddBuff( BuffInfo.AddBuff(
m, m,
@ -80,11 +80,11 @@ namespace Server.Spells.Spellweaving
FinishSequence(); 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) private static void StopTimer(Mobile m)
{ {
if (m_Table.Remove(m, out var timerToken)) if (_table.Remove(m, out var timerToken))
{ {
timerToken.Cancel(); timerToken.Cancel();
} }