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
|
|
@ -6,84 +6,76 @@ namespace Server.Items
|
|||
{
|
||||
public class DeceitBrazier : Item
|
||||
{
|
||||
private static Type[] m_Creatures = {
|
||||
#region Animals
|
||||
typeof( FireSteed ), //Set the tents up people!
|
||||
#endregion
|
||||
public static Type[] Creatures { get; } =
|
||||
{
|
||||
#region Animals
|
||||
typeof( FireSteed ), //Set the tents up people!
|
||||
#endregion
|
||||
|
||||
#region Undead
|
||||
typeof( Skeleton ), typeof( SkeletalKnight ), typeof( SkeletalMage ), typeof( Mummy ),
|
||||
typeof( BoneKnight ), typeof( Lich ), typeof( LichLord ), typeof( BoneMagi ),
|
||||
typeof( Wraith ), typeof( Shade ), typeof( Spectre ), typeof( Zombie ),
|
||||
typeof( RottingCorpse ), typeof( Ghoul ),
|
||||
#endregion
|
||||
#region Undead
|
||||
typeof( Skeleton ), typeof( SkeletalKnight ), typeof( SkeletalMage ), typeof( Mummy ),
|
||||
typeof( BoneKnight ), typeof( Lich ), typeof( LichLord ), typeof( BoneMagi ),
|
||||
typeof( Wraith ), typeof( Shade ), typeof( Spectre ), typeof( Zombie ),
|
||||
typeof( RottingCorpse ), typeof( Ghoul ),
|
||||
#endregion
|
||||
|
||||
#region Demons
|
||||
typeof( Balron ), typeof( Daemon ), typeof( Imp ), typeof( GreaterMongbat ),
|
||||
typeof( Mongbat ), typeof( IceFiend ), typeof( Gargoyle ), typeof( StoneGargoyle ),
|
||||
typeof( FireGargoyle ), typeof( HordeMinion ),
|
||||
#endregion
|
||||
#region Demons
|
||||
typeof( Balron ), typeof( Daemon ), typeof( Imp ), typeof( GreaterMongbat ),
|
||||
typeof( Mongbat ), typeof( IceFiend ), typeof( Gargoyle ), typeof( StoneGargoyle ),
|
||||
typeof( FireGargoyle ), typeof( HordeMinion ),
|
||||
#endregion
|
||||
|
||||
#region Gazers
|
||||
typeof( Gazer ), typeof( ElderGazer ), typeof( GazerLarva ),
|
||||
#endregion
|
||||
#region Gazers
|
||||
typeof( Gazer ), typeof( ElderGazer ), typeof( GazerLarva ),
|
||||
#endregion
|
||||
|
||||
#region Uncategorized
|
||||
typeof( Harpy ), typeof( StoneHarpy ), typeof( HeadlessOne ), typeof( HellHound ),
|
||||
typeof( HellCat ), typeof( Phoenix ), typeof( LavaLizard ), typeof( SandVortex ),
|
||||
typeof( ShadowWisp ), typeof( SwampTentacle ), typeof( PredatorHellCat ), typeof( Wisp ),
|
||||
#endregion
|
||||
#region Uncategorized
|
||||
typeof( Harpy ), typeof( StoneHarpy ), typeof( HeadlessOne ), typeof( HellHound ),
|
||||
typeof( HellCat ), typeof( Phoenix ), typeof( LavaLizard ), typeof( SandVortex ),
|
||||
typeof( ShadowWisp ), typeof( SwampTentacle ), typeof( PredatorHellCat ), typeof( Wisp ),
|
||||
#endregion
|
||||
|
||||
#region Arachnid
|
||||
typeof( GiantSpider ), typeof( DreadSpider ), typeof( FrostSpider ), typeof( Scorpion ),
|
||||
#endregion
|
||||
#region Arachnid
|
||||
typeof( GiantSpider ), typeof( DreadSpider ), typeof( FrostSpider ), typeof( Scorpion ),
|
||||
#endregion
|
||||
|
||||
#region Repond
|
||||
typeof( ArcticOgreLord ), typeof( Cyclops ), typeof( Ettin ), typeof( EvilMage ),
|
||||
typeof( FrostTroll ), typeof( Ogre ), typeof( OgreLord ), typeof( Orc ),
|
||||
typeof( OrcishLord ), typeof( OrcishMage ), typeof( OrcBrute ), typeof( Ratman ),
|
||||
typeof( RatmanMage ), typeof( OrcCaptain ), typeof( Troll ), typeof( Titan ),
|
||||
typeof( EvilMageLord ), typeof( OrcBomber ), typeof( RatmanArcher ),
|
||||
#endregion
|
||||
#region Repond
|
||||
typeof( ArcticOgreLord ), typeof( Cyclops ), typeof( Ettin ), typeof( EvilMage ),
|
||||
typeof( FrostTroll ), typeof( Ogre ), typeof( OgreLord ), typeof( Orc ),
|
||||
typeof( OrcishLord ), typeof( OrcishMage ), typeof( OrcBrute ), typeof( Ratman ),
|
||||
typeof( RatmanMage ), typeof( OrcCaptain ), typeof( Troll ), typeof( Titan ),
|
||||
typeof( EvilMageLord ), typeof( OrcBomber ), typeof( RatmanArcher ),
|
||||
#endregion
|
||||
|
||||
#region Reptilian
|
||||
typeof( Dragon ), typeof( Drake ), typeof( Snake ), typeof( GreaterDragon ),
|
||||
typeof( IceSerpent ), typeof( GiantSerpent ), typeof( IceSnake ), typeof( LavaSerpent ),
|
||||
typeof( Lizardman ), typeof( Wyvern ), typeof( WhiteWyrm ),
|
||||
typeof( ShadowWyrm ), typeof( SilverSerpent ), typeof( LavaSnake ),
|
||||
#endregion
|
||||
#region Reptilian
|
||||
typeof( Dragon ), typeof( Drake ), typeof( Snake ), typeof( GreaterDragon ),
|
||||
typeof( IceSerpent ), typeof( GiantSerpent ), typeof( IceSnake ), typeof( LavaSerpent ),
|
||||
typeof( Lizardman ), typeof( Wyvern ), typeof( WhiteWyrm ),
|
||||
typeof( ShadowWyrm ), typeof( SilverSerpent ), typeof( LavaSnake ),
|
||||
#endregion
|
||||
|
||||
#region Elementals
|
||||
typeof( EarthElemental ), typeof( PoisonElemental ), typeof( FireElemental ), typeof( SnowElemental ),
|
||||
typeof( IceElemental ), typeof( AcidElemental ), typeof( WaterElemental ), typeof( Efreet ),
|
||||
typeof( AirElemental ), typeof( Golem ),
|
||||
#endregion
|
||||
#region Elementals
|
||||
typeof( EarthElemental ), typeof( PoisonElemental ), typeof( FireElemental ), typeof( SnowElemental ),
|
||||
typeof( IceElemental ), typeof( AcidElemental ), typeof( WaterElemental ), typeof( Efreet ),
|
||||
typeof( AirElemental ), typeof( Golem ),
|
||||
#endregion
|
||||
|
||||
#region Random Critters
|
||||
typeof( SewerRat ), typeof( GiantRat ), typeof( DireWolf ), typeof( TimberWolf ),
|
||||
typeof( Cougar ), typeof( Alligator )
|
||||
#endregion
|
||||
};
|
||||
|
||||
public static Type[] Creatures => m_Creatures;
|
||||
#region Random Critters
|
||||
typeof( SewerRat ), typeof( GiantRat ), typeof( DireWolf ), typeof( TimberWolf ),
|
||||
typeof( Cougar ), typeof( Alligator )
|
||||
#endregion
|
||||
};
|
||||
|
||||
private Timer m_Timer;
|
||||
private DateTime m_NextSpawn;
|
||||
private int m_SpawnRange;
|
||||
private TimeSpan m_NextSpawnDelay;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime NextSpawn => m_NextSpawn;
|
||||
public DateTime NextSpawn { get; private set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int SpawnRange { get => m_SpawnRange;
|
||||
set => m_SpawnRange = value;
|
||||
}
|
||||
public int SpawnRange { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TimeSpan NextSpawnDelay { get => m_NextSpawnDelay;
|
||||
set => m_NextSpawnDelay = value;
|
||||
}
|
||||
public TimeSpan NextSpawnDelay { get; set; }
|
||||
|
||||
public override int LabelNumber => 1023633; // Brazier
|
||||
|
||||
|
|
@ -92,9 +84,9 @@ namespace Server.Items
|
|||
{
|
||||
Movable = false;
|
||||
Light = LightType.Circle225;
|
||||
m_NextSpawn = DateTime.UtcNow;
|
||||
m_NextSpawnDelay = TimeSpan.FromMinutes( 15.0 );
|
||||
m_SpawnRange = 5;
|
||||
NextSpawn = DateTime.UtcNow;
|
||||
NextSpawnDelay = TimeSpan.FromMinutes( 15.0 );
|
||||
SpawnRange = 5;
|
||||
}
|
||||
|
||||
public DeceitBrazier( Serial serial ) : base( serial )
|
||||
|
|
@ -107,8 +99,8 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int)0 ); // version
|
||||
|
||||
writer.Write( (int)m_SpawnRange );
|
||||
writer.Write( m_NextSpawnDelay );
|
||||
writer.Write( (int)SpawnRange );
|
||||
writer.Write( NextSpawnDelay );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -119,11 +111,11 @@ namespace Server.Items
|
|||
|
||||
if ( version >= 0 )
|
||||
{
|
||||
m_SpawnRange = reader.ReadInt();
|
||||
m_NextSpawnDelay = reader.ReadTimeSpan();
|
||||
SpawnRange = reader.ReadInt();
|
||||
NextSpawnDelay = reader.ReadTimeSpan();
|
||||
}
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow;
|
||||
NextSpawn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public virtual void HeedWarning()
|
||||
|
|
@ -135,7 +127,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
if ( m_NextSpawn < DateTime.UtcNow ) // means we haven't spawned anything if the next spawn is below
|
||||
if ( NextSpawn < DateTime.UtcNow ) // means we haven't spawned anything if the next spawn is below
|
||||
{
|
||||
if ( Utility.InRange( m.Location, Location, 1 ) && !Utility.InRange( oldLocation, Location, 1 ) && m.Player && !(m.AccessLevel > AccessLevel.Player || m.Hidden) )
|
||||
{
|
||||
|
|
@ -157,8 +149,8 @@ namespace Server.Items
|
|||
// Try 10 times to find a Spawnable location.
|
||||
for( int i = 0; i < 10; i++ )
|
||||
{
|
||||
int x = Location.X + (Utility.Random( (m_SpawnRange * 2) + 1 ) - m_SpawnRange);
|
||||
int y = Location.Y + (Utility.Random( (m_SpawnRange * 2) + 1 ) - m_SpawnRange);
|
||||
int x = Location.X + (Utility.Random( (SpawnRange * 2) + 1 ) - SpawnRange);
|
||||
int y = Location.Y + (Utility.Random( (SpawnRange * 2) + 1 ) - SpawnRange);
|
||||
int z = Map.GetAverageZ( x, y );
|
||||
|
||||
if ( Map.CanSpawnMobile( new Point2D( x, y ), Z ) )
|
||||
|
|
@ -182,10 +174,10 @@ namespace Server.Items
|
|||
{
|
||||
try
|
||||
{
|
||||
if ( m_NextSpawn < DateTime.UtcNow )
|
||||
if ( NextSpawn < DateTime.UtcNow )
|
||||
{
|
||||
Map map = Map;
|
||||
BaseCreature bc = (BaseCreature)Activator.CreateInstance( m_Creatures[Utility.Random( m_Creatures.Length )] );
|
||||
BaseCreature bc = (BaseCreature)Activator.CreateInstance( Creatures[Utility.Random( Creatures.Length )] );
|
||||
|
||||
if ( bc != null )
|
||||
{
|
||||
|
|
@ -196,7 +188,7 @@ namespace Server.Items
|
|||
Timer.DelayCall( TimeSpan.FromSeconds( 1 ), delegate
|
||||
{
|
||||
bc.Home = Location;
|
||||
bc.RangeHome = m_SpawnRange;
|
||||
bc.RangeHome = SpawnRange;
|
||||
bc.FightMode = FightMode.Closest;
|
||||
|
||||
bc.MoveToWorld( spawnLoc, map );
|
||||
|
|
@ -206,7 +198,7 @@ namespace Server.Items
|
|||
bc.ForceReacquire();
|
||||
} );
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow + m_NextSpawnDelay;
|
||||
NextSpawn = DateTime.UtcNow + NextSpawnDelay;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue