Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -5,16 +5,11 @@ namespace Server.Engines.Quests.Necro
{
public class MaabusCoffin : BaseAddon
{
private Maabus m_Maabus;
private Point3D m_SpawnLocation;
[CommandProperty( AccessLevel.GameMaster )]
public Maabus Maabus { get; private set; }
[CommandProperty( AccessLevel.GameMaster )]
public Maabus Maabus => m_Maabus;
[CommandProperty( AccessLevel.GameMaster )]
public Point3D SpawnLocation { get => m_SpawnLocation;
set => m_SpawnLocation = value;
}
public Point3D SpawnLocation { get; set; }
[Constructible]
public MaabusCoffin()
@ -32,42 +27,42 @@ namespace Server.Engines.Quests.Necro
public void Awake( Mobile caller )
{
if ( m_Maabus != null || m_SpawnLocation == Point3D.Zero )
if ( Maabus != null || SpawnLocation == Point3D.Zero )
return;
foreach ( MaabusCoffinComponent c in Components )
c.TurnToEmpty();
m_Maabus = new Maabus();
Maabus = new Maabus();
m_Maabus.Location = m_SpawnLocation;
m_Maabus.Map = Map;
Maabus.Location = SpawnLocation;
Maabus.Map = Map;
m_Maabus.Direction = m_Maabus.GetDirectionTo( caller );
Maabus.Direction = Maabus.GetDirectionTo( caller );
Timer.DelayCall( TimeSpan.FromSeconds( 7.5 ), BeginSleep );
}
public void BeginSleep()
{
if ( m_Maabus == null )
if ( Maabus == null )
return;
Effects.PlaySound( m_Maabus.Location, m_Maabus.Map, 0x48E );
Effects.PlaySound( Maabus.Location, Maabus.Map, 0x48E );
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), Sleep );
}
public void Sleep()
{
if ( m_Maabus == null )
if ( Maabus == null )
return;
Effects.SendLocationParticles( EffectItem.Create( m_Maabus.Location, m_Maabus.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0x7E7 );
Effects.PlaySound( m_Maabus.Location, m_Maabus.Map, 0x1FE );
Effects.SendLocationParticles( EffectItem.Create( Maabus.Location, Maabus.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0x7E7 );
Effects.PlaySound( Maabus.Location, Maabus.Map, 0x1FE );
m_Maabus.Delete();
m_Maabus = null;
Maabus.Delete();
Maabus = null;
foreach ( MaabusCoffinComponent c in Components )
c.TurnToFull();
@ -83,8 +78,8 @@ namespace Server.Engines.Quests.Necro
writer.Write( (int) 0 ); // version
writer.Write( (Mobile) m_Maabus );
writer.Write( (Point3D) m_SpawnLocation );
writer.Write( (Mobile) Maabus );
writer.Write( (Point3D) SpawnLocation );
}
public override void Deserialize( GenericReader reader )
@ -93,8 +88,8 @@ namespace Server.Engines.Quests.Necro
int version = reader.ReadInt();
m_Maabus = reader.ReadMobile() as Maabus;
m_SpawnLocation = reader.ReadPoint3D();
Maabus = reader.ReadMobile() as Maabus;
SpawnLocation = reader.ReadPoint3D();
Sleep();
}