Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue