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

@ -16,30 +16,14 @@ namespace Server.Engines.Quests.Doom
Movable = false;
}
private Chyloth m_Chyloth;
private SkeletalDragon m_Dragon;
private bool m_Summoning;
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public Chyloth Chyloth { get; set; }
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public Chyloth Chyloth
{
get => m_Chyloth;
set => m_Chyloth = value;
}
public SkeletalDragon Dragon { get; set; }
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public SkeletalDragon Dragon
{
get => m_Dragon;
set => m_Dragon = value;
}
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public bool Summoning
{
get => m_Summoning;
set => m_Summoning = value;
}
public bool Summoning { get; set; }
public override void OnDoubleClick( Mobile from )
{
@ -51,17 +35,17 @@ namespace Server.Engines.Quests.Doom
public virtual void BeginSummon( Mobile from )
{
if ( m_Chyloth != null && !m_Chyloth.Deleted )
if ( Chyloth != null && !Chyloth.Deleted )
{
from.SendLocalizedMessage( 1050010 ); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if ( m_Dragon != null && !m_Dragon.Deleted )
else if ( Dragon != null && !Dragon.Deleted )
{
from.SendLocalizedMessage( 1050017 ); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
}
else if ( !m_Summoning )
else if ( !Summoning )
{
m_Summoning = true;
Summoning = true;
Effects.PlaySound( GetWorldLocation(), Map, 0x100 );
@ -73,17 +57,17 @@ namespace Server.Engines.Quests.Doom
{
Mobile from = (Mobile)state;
if ( m_Chyloth != null && !m_Chyloth.Deleted )
if ( Chyloth != null && !Chyloth.Deleted )
{
from.SendLocalizedMessage( 1050010 ); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if ( m_Dragon != null && !m_Dragon.Deleted )
else if ( Dragon != null && !Dragon.Deleted )
{
from.SendLocalizedMessage( 1050017 ); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
}
else if ( m_Summoning )
else if ( Summoning )
{
m_Summoning = false;
Summoning = false;
Point3D loc = GetWorldLocation();
@ -92,15 +76,15 @@ namespace Server.Engines.Quests.Doom
Effects.SendLocationParticles( EffectItem.Create( loc, Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0, 0, 2023, 0 );
Effects.PlaySound( loc, Map, 0x1FE );
m_Chyloth = new Chyloth();
Chyloth = new Chyloth();
m_Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo( loc )));
m_Chyloth.MoveToWorld( loc, Map );
Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo( loc )));
Chyloth.MoveToWorld( loc, Map );
m_Chyloth.Bell = this;
m_Chyloth.AngryAt = from;
m_Chyloth.BeginGiveWarning();
m_Chyloth.BeginRemove( TimeSpan.FromSeconds( 40.0 ) );
Chyloth.Bell = this;
Chyloth.AngryAt = from;
Chyloth.BeginGiveWarning();
Chyloth.BeginRemove( TimeSpan.FromSeconds( 40.0 ) );
}
}
@ -114,8 +98,8 @@ namespace Server.Engines.Quests.Doom
writer.Write( (int) 0 ); // version
writer.Write( (Mobile) m_Chyloth );
writer.Write( (Mobile) m_Dragon );
writer.Write( (Mobile) Chyloth );
writer.Write( (Mobile) Dragon );
}
public override void Deserialize( GenericReader reader )
@ -124,10 +108,10 @@ namespace Server.Engines.Quests.Doom
int version = reader.ReadInt();
m_Chyloth = reader.ReadMobile() as Chyloth;
m_Dragon = reader.ReadMobile() as SkeletalDragon;
Chyloth = reader.ReadMobile() as Chyloth;
Dragon = reader.ReadMobile() as SkeletalDragon;
m_Chyloth?.Delete();
Chyloth?.Delete();
}
}
}

View file

@ -34,24 +34,13 @@ namespace Server.Engines.Quests.Doom
EquipItem( new ChylothStaff() );
}
private Mobile m_AngryAt;
private BellOfTheDead m_Bell;
public BellOfTheDead Bell { get; set; }
public BellOfTheDead Bell
{
get => m_Bell;
set => m_Bell = value;
}
public Mobile AngryAt
{
get => m_AngryAt;
set => m_AngryAt = value;
}
public Mobile AngryAt { get; set; }
public virtual void BeginGiveWarning()
{
if ( Deleted || m_AngryAt == null )
if ( Deleted || AngryAt == null )
return;
Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), EndGiveWarning );
@ -59,10 +48,10 @@ namespace Server.Engines.Quests.Doom
public virtual void EndGiveWarning()
{
if ( Deleted || m_AngryAt == null )
if ( Deleted || AngryAt == null )
return;
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050013, m_AngryAt.Name ); // You have summoned me in vain ~1_NAME~! Only the dead may cross!
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050013, AngryAt.Name ); // You have summoned me in vain ~1_NAME~! Only the dead may cross!
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050014 ); // Why have you disturbed me, mortal?!?
BeginSummonDragon();
@ -70,7 +59,7 @@ namespace Server.Engines.Quests.Doom
public virtual void BeginSummonDragon()
{
if ( Deleted || m_AngryAt == null )
if ( Deleted || AngryAt == null )
return;
Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), EndSummonDragon );
@ -108,15 +97,15 @@ namespace Server.Engines.Quests.Doom
public virtual void EndSummonDragon()
{
if ( Deleted || m_AngryAt == null )
if ( Deleted || AngryAt == null )
return;
Map map = m_AngryAt.Map;
Map map = AngryAt.Map;
if ( map == null )
return;
if ( !m_AngryAt.Region.IsPartOf( "Doom" ) )
if ( !AngryAt.Region.IsPartOf( "Doom" ) )
return;
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050015 ); // Feel the wrath of my legions!!!
@ -130,12 +119,12 @@ namespace Server.Engines.Quests.Doom
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = m_AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = m_AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
int x = AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, m_AngryAt.Z ) )
if ( map.CanSpawnMobile( x, y, AngryAt.Z ) )
{
dragon.MoveToWorld( new Point3D( x, y, m_AngryAt.Z ), map );
dragon.MoveToWorld( new Point3D( x, y, AngryAt.Z ), map );
foundLoc = true;
break;
}
@ -151,12 +140,12 @@ namespace Server.Engines.Quests.Doom
}
if ( !foundLoc )
dragon.MoveToWorld( m_AngryAt.Location, map );
dragon.MoveToWorld( AngryAt.Location, map );
dragon.Combatant = m_AngryAt;
dragon.Combatant = AngryAt;
if ( m_Bell != null )
m_Bell.Dragon = dragon;
if ( Bell != null )
Bell.Dragon = dragon;
}
public static void TeleportToFerry( Mobile from )
@ -192,8 +181,8 @@ namespace Server.Engines.Quests.Doom
if ( member != from && member.Map == Map.Malas && member.Region.IsPartOf( "Doom" ) )
{
if ( m_AngryAt == member )
m_AngryAt = null;
if ( AngryAt == member )
AngryAt = null;
member.CloseGump( typeof( ChylothPartyGump ) );
member.SendGump( new ChylothPartyGump( from, member ) );
@ -201,8 +190,8 @@ namespace Server.Engines.Quests.Doom
}
}
if ( m_AngryAt == from )
m_AngryAt = null;
if ( AngryAt == from )
AngryAt = null;
TeleportToFerry( from );

View file

@ -72,13 +72,8 @@ namespace Server.Engines.Quests.Doom
public class VanquishDaemonObjective : QuestObjective
{
private BoneDemon m_Daemon;
private Corpse m_CorpseWithSkull;
public Corpse CorpseWithSkull
{
get => m_CorpseWithSkull;
set => m_CorpseWithSkull = value;
}
public Corpse CorpseWithSkull { get; set; }
public override object Message => 1050037;
@ -143,7 +138,7 @@ namespace Server.Engines.Quests.Doom
from.SendLocalizedMessage( 1050035 ); // The devourer lies dead. Search his corpse to claim your prize!
if ( m_Daemon != null )
m_CorpseWithSkull = m_Daemon.Corpse as Corpse;
CorpseWithSkull = m_Daemon.Corpse as Corpse;
}
}
}
@ -153,7 +148,7 @@ namespace Server.Engines.Quests.Doom
int version = reader.ReadEncodedInt();
m_Daemon = reader.ReadMobile() as BoneDemon;
m_CorpseWithSkull = reader.ReadItem() as Corpse;
CorpseWithSkull = reader.ReadItem() as Corpse;
}
public override void ChildSerialize( GenericWriter writer )
@ -161,7 +156,7 @@ namespace Server.Engines.Quests.Doom
writer.WriteEncodedInt( (int) 0 ); // version
writer.Write( (Mobile) m_Daemon );
writer.Write( (Item) m_CorpseWithSkull );
writer.Write( (Item) CorpseWithSkull );
}
}
}

View file

@ -15,16 +15,9 @@ namespace Server.Engines.Quests.Doom
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
private Victoria m_Victoria;
private bool m_WaitForSummon;
public Victoria Victoria { get; private set; }
public Victoria Victoria => m_Victoria;
public bool WaitForSummon
{
get => m_WaitForSummon;
set => m_WaitForSummon = value;
}
public bool WaitForSummon { get; set; }
public override object Name => 1050025;
@ -38,15 +31,15 @@ namespace Server.Engines.Quests.Doom
public override void Slice()
{
if ( m_WaitForSummon && m_Victoria != null )
if ( WaitForSummon && Victoria != null )
{
SummoningAltar altar = m_Victoria.Altar;
SummoningAltar altar = Victoria.Altar;
if ( altar != null && (altar.Daemon == null || !altar.Daemon.Alive) )
{
if ( From.Map == m_Victoria.Map && From.InRange( m_Victoria, 8 ) )
if ( From.Map == Victoria.Map && From.InRange( Victoria, 8 ) )
{
m_WaitForSummon = false;
WaitForSummon = false;
AddConversation( new VanquishDaemonConversation() );
}
@ -72,7 +65,7 @@ namespace Server.Engines.Quests.Doom
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )
{
m_Victoria = victoria;
Victoria = victoria;
}
public TheSummoningQuest()
@ -104,16 +97,16 @@ namespace Server.Engines.Quests.Doom
{
int version = reader.ReadEncodedInt();
m_Victoria = reader.ReadMobile() as Victoria;
m_WaitForSummon = reader.ReadBool();
Victoria = reader.ReadMobile() as Victoria;
WaitForSummon = reader.ReadBool();
}
public override void ChildSerialize( GenericWriter writer )
{
writer.WriteEncodedInt( (int) 0 ); // version
writer.Write( (Mobile) m_Victoria );
writer.Write( (bool) m_WaitForSummon );
writer.Write( (Mobile) Victoria );
writer.Write( (bool) WaitForSummon );
}
}
}