Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -3,48 +3,54 @@ using Server.Mobiles;
namespace Server.Spells.Spellweaving
{
public abstract class ArcaneSummon<T> : ArcanistSpell where T : BaseCreature
{
public abstract int Sound { get; }
public abstract class ArcaneSummon<T> : ArcanistSpell where T : BaseCreature
{
public ArcaneSummon(Mobile caster, Item scroll, SpellInfo info)
: base(caster, scroll, info)
{
}
public ArcaneSummon( Mobile caster, Item scroll, SpellInfo info )
: base( caster, scroll, info )
{
}
public abstract int Sound{ get; }
public override bool CheckCast()
{
if ( !base.CheckCast() )
return false;
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
if ( (Caster.Followers + 1) > Caster.FollowersMax )
{
Caster.SendLocalizedMessage( 1074270 ); // You have too many followers to summon another one.
return false;
}
if (Caster.Followers + 1 > Caster.FollowersMax)
{
Caster.SendLocalizedMessage(1074270); // You have too many followers to summon another one.
return false;
}
return true;
}
return true;
}
public override void OnCast()
{
if ( CheckSequence() )
{
TimeSpan duration = TimeSpan.FromMinutes( Caster.Skills.Spellweaving.Value /24 + FocusLevel*2 );
int summons = Math.Min( 1+FocusLevel, Caster.FollowersMax - Caster.Followers );
public override void OnCast()
{
if (CheckSequence())
{
TimeSpan duration = TimeSpan.FromMinutes(Caster.Skills.Spellweaving.Value / 24 + FocusLevel * 2);
int summons = Math.Min(1 + FocusLevel, Caster.FollowersMax - Caster.Followers);
for( int i = 0; i < summons; i++ )
{
BaseCreature bc;
for (int i = 0; i < summons; i++)
{
BaseCreature bc;
try { bc = Activator.CreateInstance<T>(); }
catch { break; }
try
{
bc = Activator.CreateInstance<T>();
}
catch
{
break;
}
SpellHelper.Summon( bc, Caster, Sound, duration, false, false );
}
SpellHelper.Summon(bc, Caster, Sound, duration, false, false);
}
FinishSequence();
}
}
}
}
FinishSequence();
}
}
}
}