fix: Removes duplicative spell checks (#849)

This commit is contained in:
Kamron Batman 2021-11-14 18:45:16 -08:00 • committed by GitHub
parent e5f55a424a
commit 5df7bf6a75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 78 additions and 425 deletions

View file

@ -25,15 +25,7 @@ namespace Server.Spells.Fifth
public void Target(Item item)
{
if (item == null)
{
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
}
else if (!Caster.CanSee(item))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (!item.GetType().IsDefined(typeof(DispellableFieldAttribute), false))
if (!item.GetType().IsDefined(typeof(DispellableFieldAttribute), false))
{
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
}

View file

@ -30,16 +30,7 @@ namespace Server.Spells.Fifth
public void Target(Mobile m)
{
if (m == null)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (Core.AOS)
if (Core.AOS)
{
if (Caster.CanBeHarmful(m) && CheckSequence())
{

View file

@ -25,17 +25,7 @@ namespace Server.Spells.Fifth
public void Target(Mobile m)
{
if (m == null)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (Core.AOS && (m.Frozen || m.Paralyzed ||
m.Spell?.IsCasting == true && !(m.Spell is PaladinSpell)))
if (Core.AOS && (m.Frozen || m.Paralyzed || m.Spell?.IsCasting == true && m.Spell is not PaladinSpell))
{
Caster.SendLocalizedMessage(1061923); // The target is already frozen.
}

View file

@ -28,11 +28,7 @@ namespace Server.Spells.Fifth
public void Target(IPoint3D p)
{
if (!Caster.CanSee(p))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
SpellHelper.Turn(Caster, p);