Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -11,9 +11,8 @@ namespace Server.Items
|
|||
{
|
||||
public override int LabelNumber => 3000541;
|
||||
|
||||
public static Type[] Artifacts => m_Artifacts;
|
||||
|
||||
private static Type[] m_Artifacts = {
|
||||
public static Type[] Artifacts { get; } =
|
||||
{
|
||||
typeof( CandelabraOfSouls ), typeof( GoldBricks ), typeof( PhillipsWoodenSteed ),
|
||||
typeof( ArcticDeathDealer ), typeof( BlazeOfDeath ), typeof( BurglarsBandana ),
|
||||
typeof( CavortingClub ), typeof( DreadPirateHat ),
|
||||
|
|
@ -23,33 +22,21 @@ namespace Server.Items
|
|||
typeof( ColdBlood ), typeof( AlchemistsBauble )
|
||||
};
|
||||
|
||||
private int m_Level;
|
||||
private DateTime m_DeleteTime;
|
||||
private Timer m_Timer;
|
||||
private Mobile m_Owner;
|
||||
private bool m_Temporary;
|
||||
|
||||
private List<Mobile> m_Guardians;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Level{ get => m_Level;
|
||||
set => m_Level = value;
|
||||
}
|
||||
public int Level { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Owner{ get => m_Owner;
|
||||
set => m_Owner = value;
|
||||
}
|
||||
public Mobile Owner { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime DeleteTime => m_DeleteTime;
|
||||
public DateTime DeleteTime { get; private set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Temporary{ get => m_Temporary;
|
||||
set => m_Temporary = value;
|
||||
}
|
||||
public bool Temporary { get; set; }
|
||||
|
||||
public List<Mobile> Guardians => m_Guardians;
|
||||
public List<Mobile> Guardians { get; private set; }
|
||||
|
||||
[Constructible]
|
||||
public TreasureMapChest( int level ) : this( null, level, false )
|
||||
|
|
@ -58,14 +45,14 @@ namespace Server.Items
|
|||
|
||||
public TreasureMapChest( Mobile owner, int level, bool temporary ) : base( 0xE40 )
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_Level = level;
|
||||
m_DeleteTime = DateTime.UtcNow + TimeSpan.FromHours( 3.0 );
|
||||
Owner = owner;
|
||||
Level = level;
|
||||
DeleteTime = DateTime.UtcNow + TimeSpan.FromHours( 3.0 );
|
||||
|
||||
m_Temporary = temporary;
|
||||
m_Guardians = new List<Mobile>();
|
||||
Temporary = temporary;
|
||||
Guardians = new List<Mobile>();
|
||||
|
||||
m_Timer = new DeleteTimer( this, m_DeleteTime );
|
||||
m_Timer = new DeleteTimer( this, DeleteTime );
|
||||
m_Timer.Start();
|
||||
|
||||
Fill( this, level );
|
||||
|
|
@ -278,7 +265,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if ( level == 6 && Core.AOS )
|
||||
cont.DropItem( (Item)Activator.CreateInstance( m_Artifacts[Utility.Random(m_Artifacts.Length)] ) );
|
||||
cont.DropItem( (Item)Activator.CreateInstance( Artifacts[Utility.Random(Artifacts.Length)] ) );
|
||||
}
|
||||
|
||||
public override bool CheckLocked( Mobile from )
|
||||
|
|
@ -308,13 +295,13 @@ namespace Server.Items
|
|||
|
||||
private bool CheckLoot( Mobile m, bool criminalAction )
|
||||
{
|
||||
if ( m_Temporary )
|
||||
if ( Temporary )
|
||||
return false;
|
||||
|
||||
if ( m.AccessLevel >= AccessLevel.GameMaster || m_Owner == null || m == m_Owner )
|
||||
if ( m.AccessLevel >= AccessLevel.GameMaster || Owner == null || m == Owner )
|
||||
return true;
|
||||
|
||||
Party p = Party.Get( m_Owner );
|
||||
Party p = Party.Get( Owner );
|
||||
|
||||
if ( p != null && p.Contains( m ) )
|
||||
return true;
|
||||
|
|
@ -358,7 +345,7 @@ namespace Server.Items
|
|||
m_Lifted.Add( item );
|
||||
|
||||
if ( 0.1 >= Utility.RandomDouble() ) // 10% chance to spawn a new monster
|
||||
TreasureMap.Spawn( m_Level, GetWorldLocation(), Map, from, false );
|
||||
TreasureMap.Spawn( Level, GetWorldLocation(), Map, from, false );
|
||||
}
|
||||
|
||||
base.OnItemLifted( from, item );
|
||||
|
|
@ -385,13 +372,13 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 2 ); // version
|
||||
|
||||
writer.Write( m_Guardians, true );
|
||||
writer.Write( (bool) m_Temporary );
|
||||
writer.Write( Guardians, true );
|
||||
writer.Write( (bool) Temporary );
|
||||
|
||||
writer.Write( m_Owner );
|
||||
writer.Write( Owner );
|
||||
|
||||
writer.Write( (int) m_Level );
|
||||
writer.WriteDeltaTime( m_DeleteTime );
|
||||
writer.Write( (int) Level );
|
||||
writer.WriteDeltaTime( DeleteTime );
|
||||
writer.Write( m_Lifted, true );
|
||||
}
|
||||
|
||||
|
|
@ -405,33 +392,33 @@ namespace Server.Items
|
|||
{
|
||||
case 2:
|
||||
{
|
||||
m_Guardians = reader.ReadStrongMobileList();
|
||||
m_Temporary = reader.ReadBool();
|
||||
Guardians = reader.ReadStrongMobileList();
|
||||
Temporary = reader.ReadBool();
|
||||
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_Owner = reader.ReadMobile();
|
||||
Owner = reader.ReadMobile();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Level = reader.ReadInt();
|
||||
m_DeleteTime = reader.ReadDeltaTime();
|
||||
Level = reader.ReadInt();
|
||||
DeleteTime = reader.ReadDeltaTime();
|
||||
m_Lifted = reader.ReadStrongItemList();
|
||||
|
||||
if ( version < 2 )
|
||||
m_Guardians = new List<Mobile>();
|
||||
Guardians = new List<Mobile>();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !m_Temporary )
|
||||
if ( !Temporary )
|
||||
{
|
||||
m_Timer = new DeleteTimer( this, m_DeleteTime );
|
||||
m_Timer = new DeleteTimer( this, DeleteTime );
|
||||
m_Timer.Start();
|
||||
}
|
||||
else
|
||||
|
|
@ -468,7 +455,7 @@ namespace Server.Items
|
|||
|
||||
public void EndRemove( Mobile from )
|
||||
{
|
||||
if ( Deleted || from != m_Owner || !from.InRange( GetWorldLocation(), 3 ) )
|
||||
if ( Deleted || from != Owner || !from.InRange( GetWorldLocation(), 3 ) )
|
||||
return;
|
||||
|
||||
from.SendLocalizedMessage( 1048124, "", 0x8A5 ); // The old, rusted chest crumbles when you hit it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue