Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Server.Mobiles;
using Server.Targeting;
@ -14,7 +15,7 @@ namespace Server.Spells.Sixth
Reagent.SulfurousAsh
);
public RevealSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
public RevealSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
}
@ -34,11 +35,7 @@ namespace Server.Spells.Sixth
else if (CheckSequence())
{
SpellHelper.Turn(Caster, p);
SpellHelper.GetSurfaceTop(ref p);
List<Mobile> targets = new List<Mobile>();
Map map = Caster.Map;
if (map != null)
@ -48,26 +45,20 @@ namespace Server.Spells.Sixth
foreach (Mobile m in eable)
{
if (m is ShadowKnight && (m.X != p.X || m.Y != p.Y))
if (m is ShadowKnight &&
(m.X != p.X || m.Y != p.Y || !m.Hidden || m.AccessLevel != AccessLevel.Player &&
Caster.AccessLevel <= m.AccessLevel ||
!CheckDifficulty(Caster, m)))
continue;
if (m.Hidden && (m.AccessLevel == AccessLevel.Player || Caster.AccessLevel > m.AccessLevel) &&
CheckDifficulty(Caster, m))
targets.Add(m);
m.RevealingAction();
m.FixedParticles(0x375A, 9, 20, 5049, EffectLayer.Head);
m.PlaySound(0x1FD);
}
eable.Free();
}
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = targets[i];
m.RevealingAction();
m.FixedParticles(0x375A, 9, 20, 5049, EffectLayer.Head);
m.PlaySound(0x1FD);
}
}
FinishSequence();
@ -117,4 +108,4 @@ namespace Server.Spells.Sixth
}
}
}
}
}