Cleans up Spell Targeting (#36)

This commit is contained in:
Kamron Batman 2019-03-15 15:23:03 -07:00 • committed by GitHub
parent de50bc9e43
commit 472b84f5ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
99 changed files with 653 additions and 2192 deletions

View file

@ -1,3 +1,4 @@
using Server.Spells;
using Server.Spells.First;
using Server.Spells.Fourth;
using Server.Spells.Second;
@ -28,11 +29,13 @@ namespace Server.Mobiles
if (targ != null)
{
if (targ is CureSpell.InternalTarget)
ISpellTarget spellTarg = targ as ISpellTarget;
if (spellTarg?.Spell is CureSpell)
ProcessTarget(targ, m_ACure);
else if (targ is GreaterHealSpell.InternalTarget)
else if (spellTarg?.Spell is GreaterHealSpell)
ProcessTarget(targ, m_AGHeal);
else if (targ is HealSpell.InternalTarget)
else if (spellTarg?.Spell is HealSpell)
ProcessTarget(targ, m_ALHeal);
else
targ.Cancel(m_Mobile, TargetCancelType.Canceled);

View file

@ -960,11 +960,13 @@ namespace Server.Mobiles
if (targ == null)
return false;
bool isReveal = targ is RevealSpell.InternalTarget;
bool isDispel = targ is DispelSpell.InternalTarget;
bool isParalyze = targ is ParalyzeSpell.InternalTarget;
bool isTeleport = targ is TeleportSpell.InternalTarget;
bool isInvisible = targ is InvisibilitySpell.InternalTarget;
ISpellTarget spellTarg = targ as ISpellTarget;
bool isReveal = spellTarg?.Spell is RevealSpell;
bool isDispel = spellTarg?.Spell is DispelSpell;
bool isParalyze = spellTarg?.Spell is ParalyzeSpell;
bool isTeleport = spellTarg?.Spell is TeleportSpell;
bool isInvisible = spellTarg?.Spell is InvisibilitySpell;
bool teleportAway = false;
Mobile toTarget;