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

@ -26,7 +26,7 @@ namespace Server.Spells.Ninjitsu
);
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;
@ -272,7 +272,7 @@ namespace Server.Spells.Ninjitsu
public static void AddContext(Mobile m, AnimalFormContext context)
{
m_Table[m] = context;
_table[m] = context;
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)
{
m_Table.Remove(m);
_table.Remove(m);
if (context.SpeedBoost)
{
@ -324,9 +324,9 @@ namespace Server.Spells.Ninjitsu
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;

View file

@ -8,7 +8,7 @@ namespace Server.Spells.Ninjitsu
{
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 double RequiredSkill => 85.0;
@ -51,7 +51,7 @@ namespace Server.Spells.Ninjitsu
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!
@ -74,7 +74,7 @@ namespace Server.Spells.Ninjitsu
var t = new DeathStrikeTimer(defender, attacker, damageBonus, isRanged);
m_Table[defender] = t;
_table[defender] = t;
t.Start();
@ -83,7 +83,7 @@ namespace Server.Spells.Ninjitsu
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();
}

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Ninjitsu
{
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 double RequiredSkill => 80.0;
@ -22,7 +22,7 @@ namespace Server.Spells.Ninjitsu
}
var t = new KiAttackTimer(from);
m_Table[from] = t;
_table[from] = t;
t.Start();
}
@ -86,7 +86,7 @@ namespace Server.Spells.Ninjitsu
public override void OnClearMove(Mobile from)
{
if (m_Table.Remove(from, out var t))
if (_table.Remove(from, out var t))
{
t.Stop();
}
@ -94,7 +94,7 @@ namespace Server.Spells.Ninjitsu
public static double GetBonus(Mobile from)
{
if (!m_Table.TryGetValue(from, out var t))
if (!_table.TryGetValue(from, out var t))
{
return 0;
}
@ -121,7 +121,7 @@ namespace Server.Spells.Ninjitsu
ClearCurrentMove(m_Mobile);
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
{
private static readonly Dictionary<Mobile, SurpriseAttackInfo>
m_Table = new();
_table = new();
public override int BaseMana => 20;
public override double RequiredSkill => Core.ML ? 60.0 : 30.0;
@ -62,7 +62,7 @@ namespace Server.Spells.Ninjitsu
var info = new SurpriseAttackInfo(defender, malus);
Timer.StartTimer(TimeSpan.FromSeconds(8.0), () => EndSurprise(info), out info._timerToken);
m_Table[defender] = info;
_table[defender] = info;
CheckGain(attacker);
}
@ -78,7 +78,7 @@ namespace Server.Spells.Ninjitsu
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;
}
@ -89,7 +89,7 @@ namespace Server.Spells.Ninjitsu
private static void StopTimer(Mobile m)
{
if (m_Table.Remove(m, out var info))
if (_table.Remove(m, out var info))
{
info._timerToken.Cancel();
}