fix: Cleans up some comments and spell code (#1120)

This commit is contained in:
Kamron Batman 2022-07-16 19:45:41 -07:00 • committed by GitHub
parent 56c97ca84a
commit fa3515f930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 338 additions and 469 deletions

View file

@ -10,7 +10,7 @@ namespace Server.Spells.Ninjitsu
{
public class MirrorImage : NinjaSpell
{
private static readonly Dictionary<Mobile, int> m_CloneCount = new();
private static readonly Dictionary<Mobile, int> _cloneCount = new();
private static readonly SpellInfo _info = new(
"Mirror Image",
@ -30,7 +30,7 @@ namespace Server.Spells.Ninjitsu
public override bool BlockedByAnimalForm => false;
public static bool HasClone(Mobile m) => m_CloneCount.ContainsKey(m);
public static bool HasClone(Mobile m) => _cloneCount.ContainsKey(m);
public static void AddClone(Mobile m)
{
@ -39,23 +39,23 @@ namespace Server.Spells.Ninjitsu
return;
}
m_CloneCount[m] = 1 + (m_CloneCount.TryGetValue(m, out var count) ? count : 0);
_cloneCount[m] = 1 + (_cloneCount.TryGetValue(m, out var count) ? count : 0);
}
public static void RemoveClone(Mobile m)
{
if (m == null || !m_CloneCount.TryGetValue(m, out var count))
if (m == null || !_cloneCount.TryGetValue(m, out var count))
{
return;
}
if (count <= 1)
{
m_CloneCount.Remove(m);
_cloneCount.Remove(m);
}
else
{
m_CloneCount[m]--;
_cloneCount[m]--;
}
}