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

@ -2,72 +2,76 @@ using Server.Targeting;
namespace Server.Spells.First
{
public class NightSightSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Night Sight", "In Lor",
236,
9031,
Reagent.SulfurousAsh,
Reagent.SpidersSilk
);
public class NightSightSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Night Sight", "In Lor",
236,
9031,
Reagent.SulfurousAsh,
Reagent.SpidersSilk
);
public override SpellCircle Circle => SpellCircle.First;
public NightSightSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public NightSightSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override SpellCircle Circle => SpellCircle.First;
public override void OnCast()
{
Caster.Target = new NightSightTarget( this );
}
public override void OnCast()
{
Caster.Target = new NightSightTarget(this);
}
private class NightSightTarget : Target
{
private Spell m_Spell;
private class NightSightTarget : Target
{
private Spell m_Spell;
public NightSightTarget( Spell spell ) : base( 12, false, TargetFlags.Beneficial )
{
m_Spell = spell;
}
public NightSightTarget(Spell spell) : base(12, false, TargetFlags.Beneficial)
{
m_Spell = spell;
}
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Mobile && m_Spell.CheckBSequence( (Mobile) targeted ) )
{
Mobile targ = (Mobile)targeted;
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Mobile && m_Spell.CheckBSequence((Mobile)targeted))
{
Mobile targ = (Mobile)targeted;
SpellHelper.Turn( m_Spell.Caster, targ );
SpellHelper.Turn(m_Spell.Caster, targ);
if ( targ.BeginAction( typeof( LightCycle ) ) )
{
new LightCycle.NightSightTimer( targ ).Start();
int level = (int)( LightCycle.DungeonLevel * ( (Core.AOS ? targ.Skills[SkillName.Magery].Value : from.Skills[SkillName.Magery].Value )/ 100 ) );
if (targ.BeginAction(typeof(LightCycle)))
{
new LightCycle.NightSightTimer(targ).Start();
int level = (int)(LightCycle.DungeonLevel *
((Core.AOS
? targ.Skills[SkillName.Magery].Value
: from.Skills[SkillName.Magery].Value) / 100));
if ( level < 0 )
level = 0;
if (level < 0)
level = 0;
targ.LightLevel = level;
targ.LightLevel = level;
targ.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
targ.PlaySound( 0x1E3 );
targ.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
targ.PlaySound(0x1E3);
BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.NightSight, 1075643 ) ); //Night Sight/You ignore lighting effects
}
else
{
from.SendMessage( "{0} already have nightsight.", from == targ ? "You" : "They" );
}
}
BuffInfo.AddBuff(targ,
new BuffInfo(BuffIcon.NightSight, 1075643)); //Night Sight/You ignore lighting effects
}
else
{
from.SendMessage("{0} already have nightsight.", from == targ ? "You" : "They");
}
}
m_Spell.FinishSequence();
}
m_Spell.FinishSequence();
}
protected override void OnTargetFinish( Mobile from )
{
m_Spell.FinishSequence();
}
}
}
}
protected override void OnTargetFinish(Mobile from)
{
m_Spell.FinishSequence();
}
}
}
}