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

@ -1,89 +1,89 @@
using System;
using Server.Targeting;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Spells.Mysticism
{
public class AnimatedWeaponSpell : MysticSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Animated Weapon", "In Jux Por Ylem",
-1,
9002,
Reagent.Bone,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
public class AnimatedWeaponSpell : MysticSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Animated Weapon", "In Jux Por Ylem",
-1,
9002,
Reagent.Bone,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public AnimatedWeaponSpell(Mobile caster, Item scroll)
: base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 33.0;
public override int RequiredMana => 11;
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.5);
public AnimatedWeaponSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 33.0;
public override int RequiredMana => 11;
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public override void OnCast()
{
Caster.Target = new InternalTarget(this);
}
public void Target( IPoint3D p )
{
if ( ( Caster.Followers + 4 ) > Caster.FollowersMax )
{
Caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
return;
}
public void Target(IPoint3D p)
{
if (Caster.Followers + 4 > Caster.FollowersMax)
{
Caster.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
return;
}
var map = Caster.Map;
Map map = Caster.Map;
SpellHelper.GetSurfaceTop( ref p );
SpellHelper.GetSurfaceTop(ref p);
if ( map == null || ( Caster.Player && !map.CanSpawnMobile( p.X, p.Y, p.Z ) ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
{
var level = (int) ( ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 2.0 );
if (map == null || Caster.Player && !map.CanSpawnMobile(p.X, p.Y, p.Z))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
int level = (int)((GetBaseSkill(Caster) + GetBoostSkill(Caster)) / 2.0);
var duration = TimeSpan.FromSeconds( 10 + level );
TimeSpan duration = TimeSpan.FromSeconds(10 + level);
var summon = new AnimatedWeapon( Caster, level );
BaseCreature.Summon( summon, false, Caster, new Point3D( p ), 0x212, duration );
AnimatedWeapon summon = new AnimatedWeapon(Caster, level);
BaseCreature.Summon(summon, false, Caster, new Point3D(p), 0x212, duration);
summon.PlaySound( 0x64A );
summon.PlaySound(0x64A);
Effects.SendTargetParticles( summon, 0x3728, 10, 10, 0x13AA, (EffectLayer) 255 );
}
Effects.SendTargetParticles(summon, 0x3728, 10, 10, 0x13AA, (EffectLayer)255);
}
FinishSequence();
}
FinishSequence();
}
public class InternalTarget : Target
{
private AnimatedWeaponSpell m_Owner;
public class InternalTarget : Target
{
private AnimatedWeaponSpell m_Owner;
public InternalTarget( AnimatedWeaponSpell owner )
: base( 12, true, TargetFlags.None )
{
m_Owner = owner;
}
public InternalTarget(AnimatedWeaponSpell owner)
: base(12, true, TargetFlags.None)
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is IPoint3D )
m_Owner.Target( (IPoint3D) o );
}
protected override void OnTarget(Mobile from, object o)
{
if (o is IPoint3D)
m_Owner.Target((IPoint3D)o);
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}
protected override void OnTargetFinish(Mobile from)
{
m_Owner.FinishSequence();
}
}
}
}