Fixes chaos damage bug with the spell system. Fixes various small other bugs. Fixes more merge cast type checks and uses default values.

This commit is contained in:
Kamron Batman 2018-09-16 21:04:36 -07:00
parent 9542c79ea4
commit c155c82325
115 changed files with 644 additions and 1041 deletions

View file

@ -85,8 +85,8 @@ namespace Server.Spells.Fifth
protected override void OnTarget(Mobile from, object o)
{
if (o is IPoint3D)
m_Owner.Target((IPoint3D)o);
if (o is IPoint3D d)
m_Owner.Target(d);
}
protected override void OnTargetOutOfLOS(Mobile from, object o)

View file

@ -40,7 +40,7 @@ namespace Server.Spells.Fifth
{
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
}
else if (item is Moongate && !((Moongate)item).Dispellable)
else if (item is Moongate moongate && !moongate.Dispellable)
{
Caster.SendLocalizedMessage(1005047); // That magic is too chaotic
}
@ -69,8 +69,8 @@ namespace Server.Spells.Fifth
protected override void OnTarget(Mobile from, object o)
{
if (o is Item)
m_Owner.Target((Item)o);
if (o is Item item)
m_Owner.Target(item);
else
m_Owner.Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
}

View file

@ -141,8 +141,8 @@ namespace Server.Spells.Fifth
protected override void OnTarget(Mobile from, object o)
{
if (o is Mobile)
m_Owner.Target((Mobile)o);
if (o is Mobile mobile)
m_Owner.Target(mobile);
}
protected override void OnTargetFinish(Mobile from)

View file

@ -71,9 +71,9 @@ namespace Server.Spells.Fifth
duration *= 0.75;
}
if (m is PlagueBeastLord)
if (m is PlagueBeastLord lord)
{
((PlagueBeastLord)m).OnParalyzed(Caster);
lord.OnParalyzed(Caster);
duration = 120;
}
@ -99,8 +99,8 @@ namespace Server.Spells.Fifth
protected override void OnTarget(Mobile from, object o)
{
if (o is Mobile)
m_Owner.Target((Mobile)o);
if (o is Mobile mobile)
m_Owner.Target(mobile);
}
protected override void OnTargetFinish(Mobile from)

View file

@ -281,8 +281,8 @@ namespace Server.Spells.Fifth
protected override void OnTarget(Mobile from, object o)
{
if (o is IPoint3D)
m_Owner.Target((IPoint3D)o);
if (o is IPoint3D d)
m_Owner.Target(d);
}
protected override void OnTargetFinish(Mobile from)