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,93 +3,93 @@ using System.Collections;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HitLower
|
||||
{
|
||||
public static readonly TimeSpan AttackEffectDuration = TimeSpan.FromSeconds( 10.0 );
|
||||
public static readonly TimeSpan DefenseEffectDuration = TimeSpan.FromSeconds( 8.0 );
|
||||
public class HitLower
|
||||
{
|
||||
public static readonly TimeSpan AttackEffectDuration = TimeSpan.FromSeconds(10.0);
|
||||
public static readonly TimeSpan DefenseEffectDuration = TimeSpan.FromSeconds(8.0);
|
||||
|
||||
private static Hashtable m_AttackTable = new Hashtable();
|
||||
private static Hashtable m_AttackTable = new Hashtable();
|
||||
|
||||
public static bool IsUnderAttackEffect( Mobile m )
|
||||
{
|
||||
return m_AttackTable.Contains( m );
|
||||
}
|
||||
private static Hashtable m_DefenseTable = new Hashtable();
|
||||
|
||||
public static bool ApplyAttack( Mobile m )
|
||||
{
|
||||
if ( IsUnderAttackEffect( m ) )
|
||||
return false;
|
||||
public static bool IsUnderAttackEffect(Mobile m)
|
||||
{
|
||||
return m_AttackTable.Contains(m);
|
||||
}
|
||||
|
||||
m_AttackTable[m] = new AttackTimer( m );
|
||||
m.SendLocalizedMessage( 1062319 ); // Your attack chance has been reduced!
|
||||
return true;
|
||||
}
|
||||
public static bool ApplyAttack(Mobile m)
|
||||
{
|
||||
if (IsUnderAttackEffect(m))
|
||||
return false;
|
||||
|
||||
private static void RemoveAttack( Mobile m )
|
||||
{
|
||||
m_AttackTable.Remove( m );
|
||||
m.SendLocalizedMessage( 1062320 ); // Your attack chance has returned to normal.
|
||||
}
|
||||
m_AttackTable[m] = new AttackTimer(m);
|
||||
m.SendLocalizedMessage(1062319); // Your attack chance has been reduced!
|
||||
return true;
|
||||
}
|
||||
|
||||
private class AttackTimer : Timer
|
||||
{
|
||||
private Mobile m_Player;
|
||||
private static void RemoveAttack(Mobile m)
|
||||
{
|
||||
m_AttackTable.Remove(m);
|
||||
m.SendLocalizedMessage(1062320); // Your attack chance has returned to normal.
|
||||
}
|
||||
|
||||
public AttackTimer( Mobile player ) : base( AttackEffectDuration )
|
||||
{
|
||||
m_Player = player;
|
||||
public static bool IsUnderDefenseEffect(Mobile m)
|
||||
{
|
||||
return m_DefenseTable.Contains(m);
|
||||
}
|
||||
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
public static bool ApplyDefense(Mobile m)
|
||||
{
|
||||
if (IsUnderDefenseEffect(m))
|
||||
return false;
|
||||
|
||||
Start();
|
||||
}
|
||||
m_DefenseTable[m] = new DefenseTimer(m);
|
||||
m.SendLocalizedMessage(1062318); // Your defense chance has been reduced!
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
RemoveAttack( m_Player );
|
||||
}
|
||||
}
|
||||
private static void RemoveDefense(Mobile m)
|
||||
{
|
||||
m_DefenseTable.Remove(m);
|
||||
m.SendLocalizedMessage(1062321); // Your defense chance has returned to normal.
|
||||
}
|
||||
|
||||
private static Hashtable m_DefenseTable = new Hashtable();
|
||||
private class AttackTimer : Timer
|
||||
{
|
||||
private Mobile m_Player;
|
||||
|
||||
public static bool IsUnderDefenseEffect( Mobile m )
|
||||
{
|
||||
return m_DefenseTable.Contains( m );
|
||||
}
|
||||
public AttackTimer(Mobile player) : base(AttackEffectDuration)
|
||||
{
|
||||
m_Player = player;
|
||||
|
||||
public static bool ApplyDefense( Mobile m )
|
||||
{
|
||||
if ( IsUnderDefenseEffect( m ) )
|
||||
return false;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
|
||||
m_DefenseTable[m] = new DefenseTimer( m );
|
||||
m.SendLocalizedMessage( 1062318 ); // Your defense chance has been reduced!
|
||||
return true;
|
||||
}
|
||||
Start();
|
||||
}
|
||||
|
||||
private static void RemoveDefense( Mobile m )
|
||||
{
|
||||
m_DefenseTable.Remove( m );
|
||||
m.SendLocalizedMessage( 1062321 ); // Your defense chance has returned to normal.
|
||||
}
|
||||
protected override void OnTick()
|
||||
{
|
||||
RemoveAttack(m_Player);
|
||||
}
|
||||
}
|
||||
|
||||
private class DefenseTimer : Timer
|
||||
{
|
||||
private Mobile m_Player;
|
||||
private class DefenseTimer : Timer
|
||||
{
|
||||
private Mobile m_Player;
|
||||
|
||||
public DefenseTimer( Mobile player ) : base( DefenseEffectDuration )
|
||||
{
|
||||
m_Player = player;
|
||||
public DefenseTimer(Mobile player) : base(DefenseEffectDuration)
|
||||
{
|
||||
m_Player = player;
|
||||
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
|
||||
Start();
|
||||
}
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
RemoveDefense( m_Player );
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void OnTick()
|
||||
{
|
||||
RemoveDefense(m_Player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue