Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -3,140 +3,139 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Server.Spells.Spellweaving
|
||||
{
|
||||
public class EssenceOfWindSpell : ArcanistSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo( "Essence of Wind", "Anathrae", -1 );
|
||||
public class EssenceOfWindSpell : ArcanistSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo("Essence of Wind", "Anathrae", -1);
|
||||
|
||||
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 3.0 );
|
||||
private static Dictionary<Mobile, EssenceOfWindInfo> m_Table = new Dictionary<Mobile, EssenceOfWindInfo>();
|
||||
|
||||
public override double RequiredSkill => 52.0;
|
||||
public override int RequiredMana => 40;
|
||||
public EssenceOfWindSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public EssenceOfWindSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(3.0);
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if ( CheckSequence() )
|
||||
{
|
||||
Caster.PlaySound( 0x5C6 );
|
||||
public override double RequiredSkill => 52.0;
|
||||
public override int RequiredMana => 40;
|
||||
|
||||
int range = 5 + FocusLevel;
|
||||
int damage = 25 + FocusLevel;
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
Caster.PlaySound(0x5C6);
|
||||
|
||||
double skill = Caster.Skills[SkillName.Spellweaving].Value;
|
||||
int range = 5 + FocusLevel;
|
||||
int damage = 25 + FocusLevel;
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( (int)(skill / 24) + FocusLevel );
|
||||
double skill = Caster.Skills[SkillName.Spellweaving].Value;
|
||||
|
||||
int fcMalus = FocusLevel + 1;
|
||||
int ssiMalus = 2 * (FocusLevel + 1);
|
||||
TimeSpan duration = TimeSpan.FromSeconds((int)(skill / 24) + FocusLevel);
|
||||
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
int fcMalus = FocusLevel + 1;
|
||||
int ssiMalus = 2 * (FocusLevel + 1);
|
||||
|
||||
foreach( Mobile m in Caster.GetMobilesInRange( range ) )
|
||||
{
|
||||
if ( Caster != m && Caster.InLOS( m ) && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
|
||||
for( int i = 0; i < targets.Count; i++ )
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
foreach (Mobile m in Caster.GetMobilesInRange(range))
|
||||
if (Caster != m && Caster.InLOS(m) && SpellHelper.ValidIndirectTarget(Caster, m) &&
|
||||
Caster.CanBeHarmful(m, false))
|
||||
targets.Add(m);
|
||||
|
||||
Caster.DoHarmful( m );
|
||||
for (int i = 0; i < targets.Count; i++)
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
SpellHelper.Damage( this, m, damage, 0, 0, 100, 0, 0 );
|
||||
Caster.DoHarmful(m);
|
||||
|
||||
if ( !CheckResisted( m ) ) //No message on resist
|
||||
{
|
||||
m_Table[m] = new EssenceOfWindInfo( m, fcMalus, ssiMalus, duration );
|
||||
SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
|
||||
|
||||
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.EssenceOfWind, 1075802, duration, m,
|
||||
$"{fcMalus.ToString()}\t{ssiMalus.ToString()}") );
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!CheckResisted(m)) //No message on resist
|
||||
{
|
||||
m_Table[m] = new EssenceOfWindInfo(m, fcMalus, ssiMalus, duration);
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.EssenceOfWind, 1075802, duration, m,
|
||||
$"{fcMalus.ToString()}\t{ssiMalus.ToString()}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, EssenceOfWindInfo> m_Table = new Dictionary<Mobile, EssenceOfWindInfo>();
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class EssenceOfWindInfo
|
||||
{
|
||||
public Mobile Defender { get; }
|
||||
public static int GetFCMalus(Mobile m)
|
||||
{
|
||||
if (m_Table.TryGetValue(m, out EssenceOfWindInfo info))
|
||||
return info.FCMalus;
|
||||
|
||||
public int FCMalus { get; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int SSIMalus { get; }
|
||||
public static int GetSSIMalus(Mobile m)
|
||||
{
|
||||
if (m_Table.TryGetValue(m, out EssenceOfWindInfo info))
|
||||
return info.SSIMalus;
|
||||
|
||||
public ExpireTimer Timer { get; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
public EssenceOfWindInfo( Mobile defender, int fcMalus, int ssiMalus, TimeSpan duration )
|
||||
{
|
||||
Defender = defender;
|
||||
FCMalus = fcMalus;
|
||||
SSIMalus = ssiMalus;
|
||||
public static bool IsDebuffed(Mobile m)
|
||||
{
|
||||
return m_Table.ContainsKey(m);
|
||||
}
|
||||
|
||||
Timer = new ExpireTimer( Defender, duration );
|
||||
Timer.Start();
|
||||
}
|
||||
}
|
||||
public static void StopDebuffing(Mobile m, bool message)
|
||||
{
|
||||
if (m_Table.TryGetValue(m, out EssenceOfWindInfo info))
|
||||
info.Timer.DoExpire(message);
|
||||
}
|
||||
|
||||
public static int GetFCMalus( Mobile m )
|
||||
{
|
||||
if (m_Table.TryGetValue( m, out EssenceOfWindInfo info ))
|
||||
return info.FCMalus;
|
||||
private class EssenceOfWindInfo
|
||||
{
|
||||
public EssenceOfWindInfo(Mobile defender, int fcMalus, int ssiMalus, TimeSpan duration)
|
||||
{
|
||||
Defender = defender;
|
||||
FCMalus = fcMalus;
|
||||
SSIMalus = ssiMalus;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Timer = new ExpireTimer(Defender, duration);
|
||||
Timer.Start();
|
||||
}
|
||||
|
||||
public static int GetSSIMalus( Mobile m )
|
||||
{
|
||||
if (m_Table.TryGetValue( m, out EssenceOfWindInfo info ))
|
||||
return info.SSIMalus;
|
||||
public Mobile Defender{ get; }
|
||||
|
||||
return 0;
|
||||
}
|
||||
public int FCMalus{ get; }
|
||||
|
||||
public static bool IsDebuffed( Mobile m )
|
||||
{
|
||||
return m_Table.ContainsKey( m );
|
||||
}
|
||||
public int SSIMalus{ get; }
|
||||
|
||||
public static void StopDebuffing( Mobile m, bool message )
|
||||
{
|
||||
if (m_Table.TryGetValue( m, out EssenceOfWindInfo info ))
|
||||
info.Timer.DoExpire( message );
|
||||
}
|
||||
public ExpireTimer Timer{ get; }
|
||||
}
|
||||
|
||||
private class ExpireTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private class ExpireTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
|
||||
public ExpireTimer( Mobile m, TimeSpan delay ) : base( delay )
|
||||
{
|
||||
m_Mobile = m;
|
||||
}
|
||||
public ExpireTimer(Mobile m, TimeSpan delay) : base(delay)
|
||||
{
|
||||
m_Mobile = m;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
DoExpire( true );
|
||||
}
|
||||
protected override void OnTick()
|
||||
{
|
||||
DoExpire(true);
|
||||
}
|
||||
|
||||
public void DoExpire( bool message )
|
||||
{
|
||||
Stop();
|
||||
/*
|
||||
if ( message )
|
||||
{
|
||||
}
|
||||
*/
|
||||
m_Table.Remove( m_Mobile );
|
||||
public void DoExpire(bool message)
|
||||
{
|
||||
Stop();
|
||||
/*
|
||||
if ( message )
|
||||
{
|
||||
}
|
||||
*/
|
||||
m_Table.Remove(m_Mobile);
|
||||
|
||||
BuffInfo.RemoveBuff( m_Mobile, BuffIcon.EssenceOfWind );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BuffInfo.RemoveBuff(m_Mobile, BuffIcon.EssenceOfWind);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue