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,150 +3,150 @@ using System.Collections;
|
|||
|
||||
namespace Server.Spells.Bushido
|
||||
{
|
||||
public class Confidence : SamuraiSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Confidence", null,
|
||||
-1,
|
||||
9002
|
||||
);
|
||||
public class Confidence : SamuraiSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Confidence", null,
|
||||
-1,
|
||||
9002
|
||||
);
|
||||
|
||||
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 0.25 );
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public override double RequiredSkill => 25.0;
|
||||
public override int RequiredMana => 10;
|
||||
private static Hashtable m_RegenTable = new Hashtable();
|
||||
|
||||
public Confidence( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public Confidence(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnBeginCast()
|
||||
{
|
||||
base.OnBeginCast();
|
||||
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(0.25);
|
||||
|
||||
Caster.FixedEffect( 0x37C4, 10, 7, 4, 3 );
|
||||
}
|
||||
public override double RequiredSkill => 25.0;
|
||||
public override int RequiredMana => 10;
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if ( CheckSequence() )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1063115 ); // You exude confidence.
|
||||
public override void OnBeginCast()
|
||||
{
|
||||
base.OnBeginCast();
|
||||
|
||||
Caster.FixedParticles( 0x375A, 1, 17, 0x7DA, 0x960, 0x3, EffectLayer.Waist );
|
||||
Caster.PlaySound( 0x51A );
|
||||
Caster.FixedEffect(0x37C4, 10, 7, 4, 3);
|
||||
}
|
||||
|
||||
OnCastSuccessful( Caster );
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
Caster.SendLocalizedMessage(1063115); // You exude confidence.
|
||||
|
||||
BeginConfidence( Caster );
|
||||
BeginRegenerating( Caster );
|
||||
}
|
||||
Caster.FixedParticles(0x375A, 1, 17, 0x7DA, 0x960, 0x3, EffectLayer.Waist);
|
||||
Caster.PlaySound(0x51A);
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
OnCastSuccessful(Caster);
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
BeginConfidence(Caster);
|
||||
BeginRegenerating(Caster);
|
||||
}
|
||||
|
||||
public static bool IsConfident( Mobile m )
|
||||
{
|
||||
return m_Table.Contains( m );
|
||||
}
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public static void BeginConfidence( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
public static bool IsConfident(Mobile m)
|
||||
{
|
||||
return m_Table.Contains(m);
|
||||
}
|
||||
|
||||
t?.Stop();
|
||||
public static void BeginConfidence(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
t = new InternalTimer( m );
|
||||
t?.Stop();
|
||||
|
||||
m_Table[m] = t;
|
||||
t = new InternalTimer(m);
|
||||
|
||||
t.Start();
|
||||
}
|
||||
m_Table[m] = t;
|
||||
|
||||
public static void EndConfidence( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
t.Start();
|
||||
}
|
||||
|
||||
t?.Stop();
|
||||
public static void EndConfidence(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
m_Table.Remove( m );
|
||||
t?.Stop();
|
||||
|
||||
OnEffectEnd( m, typeof( Confidence ) );
|
||||
}
|
||||
m_Table.Remove(m);
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
OnEffectEnd(m, typeof(Confidence));
|
||||
}
|
||||
|
||||
public InternalTimer( Mobile m ) : base( TimeSpan.FromSeconds( 15.0 ) )
|
||||
{
|
||||
m_Mobile = m;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
public static bool IsRegenerating(Mobile m)
|
||||
{
|
||||
return m_RegenTable.Contains(m);
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
EndConfidence( m_Mobile );
|
||||
m_Mobile.SendLocalizedMessage( 1063116 ); // Your confidence wanes.
|
||||
}
|
||||
}
|
||||
public static void BeginRegenerating(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_RegenTable[m];
|
||||
|
||||
private static Hashtable m_RegenTable = new Hashtable();
|
||||
t?.Stop();
|
||||
|
||||
public static bool IsRegenerating( Mobile m )
|
||||
{
|
||||
return m_RegenTable.Contains( m );
|
||||
}
|
||||
t = new RegenTimer(m);
|
||||
|
||||
public static void BeginRegenerating( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_RegenTable[m];
|
||||
m_RegenTable[m] = t;
|
||||
|
||||
t?.Stop();
|
||||
t.Start();
|
||||
}
|
||||
|
||||
t = new RegenTimer( m );
|
||||
public static void StopRegenerating(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_RegenTable[m];
|
||||
|
||||
m_RegenTable[m] = t;
|
||||
t?.Stop();
|
||||
|
||||
t.Start();
|
||||
}
|
||||
m_RegenTable.Remove(m);
|
||||
}
|
||||
|
||||
public static void StopRegenerating( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_RegenTable[m];
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
|
||||
t?.Stop();
|
||||
public InternalTimer(Mobile m) : base(TimeSpan.FromSeconds(15.0))
|
||||
{
|
||||
m_Mobile = m;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
m_RegenTable.Remove( m );
|
||||
}
|
||||
protected override void OnTick()
|
||||
{
|
||||
EndConfidence(m_Mobile);
|
||||
m_Mobile.SendLocalizedMessage(1063116); // Your confidence wanes.
|
||||
}
|
||||
}
|
||||
|
||||
private class RegenTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private int m_Ticks;
|
||||
private int m_Hits;
|
||||
private class RegenTimer : Timer
|
||||
{
|
||||
private int m_Hits;
|
||||
private Mobile m_Mobile;
|
||||
private int m_Ticks;
|
||||
|
||||
public RegenTimer( Mobile m ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Hits = 15 + (m.Skills.Bushido.Fixed * m.Skills.Bushido.Fixed / 57600);
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
public RegenTimer(Mobile m) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Hits = 15 + m.Skills.Bushido.Fixed * m.Skills.Bushido.Fixed / 57600;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
++m_Ticks;
|
||||
protected override void OnTick()
|
||||
{
|
||||
++m_Ticks;
|
||||
|
||||
if ( m_Ticks >= 5 )
|
||||
{
|
||||
m_Mobile.Hits += (m_Hits - (m_Hits * 4 / 5));
|
||||
StopRegenerating( m_Mobile );
|
||||
}
|
||||
if (m_Ticks >= 5)
|
||||
{
|
||||
m_Mobile.Hits += m_Hits - m_Hits * 4 / 5;
|
||||
StopRegenerating(m_Mobile);
|
||||
}
|
||||
|
||||
m_Mobile.Hits += (m_Hits / 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_Mobile.Hits += m_Hits / 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue