Upgrades code style - First batch (#22)
This commit is contained in:
parent
8ee42c8ea2
commit
632e8b4757
1834 changed files with 10245 additions and 10437 deletions
|
|
@ -5,8 +5,8 @@ using Server;
|
|||
namespace Server.Items
|
||||
{
|
||||
public class InvisibilityPotion : BasePotion
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1072941; } } // Potion of Invisibility
|
||||
{
|
||||
public override int LabelNumber => 1072941; // Potion of Invisibility
|
||||
|
||||
[Constructible]
|
||||
public InvisibilityPotion() : base( 0xF0A, PotionEffect.Invisibility )
|
||||
|
|
@ -17,7 +17,7 @@ namespace Server.Items
|
|||
public InvisibilityPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.Hidden )
|
||||
|
|
@ -25,51 +25,51 @@ namespace Server.Items
|
|||
from.SendLocalizedMessage( 1073185 ); // You are already unseen.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( HasTimer( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1073186 ); // An invisibility potion is already taking effect on your person.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Consume();
|
||||
m_Table[ from ] = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerStateCallback( Hide_Callback ), from );
|
||||
m_Table[ from ] = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerStateCallback( Hide_Callback ), from );
|
||||
PlayDrinkEffect( from );
|
||||
}
|
||||
|
||||
|
||||
private static void Hide_Callback( object obj )
|
||||
{
|
||||
if ( obj is Mobile )
|
||||
Hide( (Mobile) obj );
|
||||
}
|
||||
|
||||
|
||||
public static void Hide( Mobile m )
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), m.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 );
|
||||
m.PlaySound( 0x3C4 );
|
||||
|
||||
|
||||
m.Hidden = true;
|
||||
|
||||
|
||||
BuffInfo.RemoveBuff( m, BuffIcon.HidingAndOrStealth );
|
||||
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Invisibility, 1075825 ) ); //Invisibility/Invisible
|
||||
|
||||
|
||||
RemoveTimer( m );
|
||||
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 30 ), new TimerStateCallback( EndHide_Callback ), m );
|
||||
}
|
||||
|
||||
|
||||
private static void EndHide_Callback( object obj )
|
||||
{
|
||||
if ( obj is Mobile )
|
||||
EndHide( (Mobile) obj );
|
||||
}
|
||||
|
||||
|
||||
public static void EndHide( Mobile m )
|
||||
{
|
||||
m.RevealingAction();
|
||||
RemoveTimer( m );
|
||||
}
|
||||
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static bool HasTimer( Mobile m )
|
||||
|
|
@ -87,11 +87,11 @@ namespace Server.Items
|
|||
m_Table.Remove( m );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void Iterrupt( Mobile m )
|
||||
{
|
||||
m.SendLocalizedMessage( 1073187 ); // The invisibility effect is interrupted.
|
||||
RemoveTimer( m );
|
||||
RemoveTimer( m );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue