Removes implicit this.

This commit is contained in:
Kamron Batman 2018-09-14 12:56:58 -07:00
parent 04b4cfe75b
commit 83dcf536d8
533 changed files with 2804 additions and 2806 deletions

View file

@ -35,8 +35,8 @@ namespace Server.Items
get => m_Charges;
set
{
if ( value > this.MaxCharges )
m_Charges = this.MaxCharges;
if ( value > MaxCharges )
m_Charges = MaxCharges;
else if ( value < 0 )
m_Charges = 0;
else
@ -52,8 +52,8 @@ namespace Server.Items
get => m_Recharges;
set
{
if ( value > this.MaxRecharges )
m_Recharges = this.MaxRecharges;
if ( value > MaxRecharges )
m_Recharges = MaxRecharges;
else if ( value < 0 )
m_Recharges = 0;
else
@ -83,9 +83,9 @@ namespace Server.Items
switch ( value )
{
case BagOfSendingHue.Yellow: this.Hue = 0x8A5; break;
case BagOfSendingHue.Blue: this.Hue = 0x8AD; break;
case BagOfSendingHue.Red: this.Hue = 0x89B; break;
case BagOfSendingHue.Yellow: Hue = 0x8A5; break;
case BagOfSendingHue.Blue: Hue = 0x8AD; break;
case BagOfSendingHue.Red: Hue = 0x89B; break;
}
}
}
@ -100,7 +100,7 @@ namespace Server.Items
{
Weight = 2.0;
this.BagOfSendingHue = hue;
BagOfSendingHue = hue;
m_Charges = Utility.RandomMinMax( 3, 9 );
}
@ -157,11 +157,11 @@ namespace Server.Items
{
from.SendMessage( "You may not do that in jail." );
}
else if ( !this.IsChildOf( from.Backpack ) )
else if ( !IsChildOf( from.Backpack ) )
{
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
}
else if ( this.Charges == 0 )
else if ( Charges == 0 )
{
MessageHelper.SendLocalizedMessageTo( this, from, 1042544, 0x59 ); // This item is out of charges.
}
@ -213,7 +213,7 @@ namespace Server.Items
{
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054108, 0x59 ); // The bag of sending rejects the cursed item.
}
else if ( !item.VerifyMove( from ) || item is Server.Engines.Quests.QuestItem || item.Nontransferable )
else if ( !item.VerifyMove( from ) || item is Engines.Quests.QuestItem || item.Nontransferable )
{
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054109, 0x59 ); // The bag of sending rejects that item.
}

View file

@ -23,8 +23,8 @@ namespace Server.Items
get => m_Charges;
set
{
if ( value > this.MaxCharges )
m_Charges = this.MaxCharges;
if ( value > MaxCharges )
m_Charges = MaxCharges;
else if ( value < 0 )
m_Charges = 0;
else
@ -40,8 +40,8 @@ namespace Server.Items
get => m_Recharges;
set
{
if ( value > this.MaxRecharges )
m_Recharges = this.MaxRecharges;
if ( value > MaxRecharges )
m_Recharges = MaxRecharges;
else if ( value < 0 )
m_Recharges = 0;
else
@ -109,7 +109,7 @@ namespace Server.Items
{
base.GetContextMenuEntries( from, list );
if ( from.Alive && this.RootParent == from )
if ( from.Alive && RootParent == from )
{
if ( Pet == null )
{
@ -144,7 +144,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( this.RootParent != from ) // TODO: Previous implementation allowed use on ground, without house protection checks. What is the correct behavior?
if ( RootParent != from ) // TODO: Previous implementation allowed use on ground, without house protection checks. What is the correct behavior?
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1042001 ); // That must be in your pack for you to use it.
return;
@ -170,9 +170,9 @@ namespace Server.Items
public void LinkPet( Mobile from )
{
BaseCreature pet = this.Pet;
BaseCreature pet = Pet;
if ( Deleted || pet != null || this.RootParent != from )
if ( Deleted || pet != null || RootParent != from )
return;
from.SendLocalizedMessage( 1054114 ); // Target your pet that you wish to link to this Crystal Ball of Pet Summoning.
@ -227,9 +227,9 @@ namespace Server.Items
public void CastSummonPet( Mobile from )
{
BaseCreature pet = this.Pet;
BaseCreature pet = Pet;
if ( Deleted || pet == null || this.RootParent != from )
if ( Deleted || pet == null || RootParent != from )
return;
if ( Charges == 0 )
@ -252,9 +252,9 @@ namespace Server.Items
{
MessageHelper.SendLocalizedMessageTo( this, from, 1054127, 0x22 ); // The Crystal Ball fills with a red mist. You appear to have let your bond to your pet deteriorate.
}
else if ( from.Map == Map.Ilshenar || from.Region.IsPartOf( typeof( DungeonRegion ) ) || from.Region.IsPartOf( typeof( Jail ) ) || from.Region.IsPartOf( typeof( Server.Engines.ConPVP.SafeZone ) ) )
else if ( from.Map == Map.Ilshenar || from.Region.IsPartOf( typeof( DungeonRegion ) ) || from.Region.IsPartOf( typeof( Jail ) ) || from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
{
from.Send( new AsciiMessage( this.Serial, this.ItemID, MessageType.Regular, 0x22, 3, "", "You cannot summon your pet to this location." ) );
from.Send( new AsciiMessage( Serial, ItemID, MessageType.Regular, 0x22, 3, "", "You cannot summon your pet to this location." ) );
}
else if ( Core.ML && from is PlayerMobile mobile && DateTime.UtcNow < mobile.LastPetBallTime.AddSeconds( 15.0 ) )
{
@ -273,7 +273,7 @@ namespace Server.Items
public void SummonPet( Mobile from )
{
BaseCreature pet = this.Pet;
BaseCreature pet = Pet;
if ( pet == null )
return;
@ -310,7 +310,7 @@ namespace Server.Items
public void UnlinkPet( Mobile from )
{
if ( !Deleted && Pet != null && this.RootParent == from )
if ( !Deleted && Pet != null && RootParent == from )
{
Pet = null;
@ -325,7 +325,7 @@ namespace Server.Items
private void InternalUpdatePetName()
{
BaseCreature pet = this.Pet;
BaseCreature pet = Pet;
if ( pet == null )
m_PetName = "";
@ -348,7 +348,7 @@ namespace Server.Items
writer.WriteEncodedInt( (int) m_Recharges );
writer.WriteEncodedInt( (int) m_Charges );
writer.Write( (Mobile) this.Pet );
writer.Write( (Mobile) Pet );
writer.Write( (string) m_PetName );
}
@ -368,7 +368,7 @@ namespace Server.Items
case 0:
{
m_Charges = Math.Min( reader.ReadEncodedInt(), MaxCharges );
this.Pet = (BaseCreature) reader.ReadMobile();
Pet = (BaseCreature) reader.ReadMobile();
m_PetName = reader.ReadString();
break;
}

View file

@ -23,8 +23,8 @@ namespace Server.Items
get => m_Charges;
set
{
if ( value > this.MaxCharges )
m_Charges = this.MaxCharges;
if ( value > MaxCharges )
m_Charges = MaxCharges;
else if ( value < 0 )
m_Charges = 0;
else
@ -40,8 +40,8 @@ namespace Server.Items
get => m_Recharges;
set
{
if ( value > this.MaxRecharges )
m_Recharges = this.MaxRecharges;
if ( value > MaxRecharges )
m_Recharges = MaxRecharges;
else if ( value < 0 )
m_Recharges = 0;
else
@ -106,9 +106,9 @@ namespace Server.Items
{
base.GetContextMenuEntries( from, list );
if ( from.Alive && this.IsChildOf( from ) )
if ( from.Alive && IsChildOf( from ) )
{
BraceletOfBinding bound = this.Bound;
BraceletOfBinding bound = Bound;
list.Add( new BraceletEntry( new BraceletCallback( Activate ), 6170, bound != null ) );
list.Add( new BraceletEntry( new BraceletCallback( Search ), 6171, bound != null ) );
@ -142,7 +142,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
BraceletOfBinding bound = this.Bound;
BraceletOfBinding bound = Bound;
if ( Bound == null )
{
@ -156,12 +156,12 @@ namespace Server.Items
public void Activate( Mobile from )
{
BraceletOfBinding bound = this.Bound;
BraceletOfBinding bound = Bound;
if ( Deleted || bound == null )
return;
if ( !this.IsChildOf( from ) )
if ( !IsChildOf( from ) )
{
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
}
@ -218,12 +218,12 @@ namespace Server.Items
public void Search( Mobile from )
{
BraceletOfBinding bound = this.Bound;
BraceletOfBinding bound = Bound;
if ( Deleted || bound == null )
return;
if ( !this.IsChildOf( from ) )
if ( !IsChildOf( from ) )
{
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
}
@ -235,7 +235,7 @@ namespace Server.Items
private bool CheckUse( Mobile from, bool successMessage )
{
BraceletOfBinding bound = this.Bound;
BraceletOfBinding bound = Bound;
if ( bound == null )
return false;
@ -295,17 +295,17 @@ namespace Server.Items
from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( from ) )
else if ( Misc.WeightOverloading.IsOverloaded( from ) )
{
from.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
else if ( from.Region.IsPartOf( typeof( Server.Regions.Jail ) ) )
else if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1114345, "", 0x35 ); // You'll need a better jailbreak plan than that!
return false;
}
else if ( boundRoot.Region.IsPartOf( typeof( Server.Regions.Jail ) ) )
else if ( boundRoot.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
return false;
@ -324,7 +324,7 @@ namespace Server.Items
if ( Deleted )
return;
if ( !this.IsChildOf( from ) )
if ( !IsChildOf( from ) )
{
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
}
@ -383,7 +383,7 @@ namespace Server.Items
if ( Deleted )
return;
if ( !this.IsChildOf( from ) )
if ( !IsChildOf( from ) )
{
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
}
@ -439,7 +439,7 @@ namespace Server.Items
writer.WriteEncodedInt( (int) m_Charges );
writer.Write( (string) m_Inscription );
writer.Write( (Item) this.Bound );
writer.Write( (Item) Bound );
}
public override void Deserialize( GenericReader reader )
@ -459,7 +459,7 @@ namespace Server.Items
{
m_Charges = Math.Min( reader.ReadEncodedInt(), MaxCharges );
m_Inscription = reader.ReadString();
this.Bound = (BraceletOfBinding) reader.ReadItem();
Bound = (BraceletOfBinding) reader.ReadItem();
break;
}
}

View file

@ -29,7 +29,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( this.GetWorldLocation(), 2 ) )
if ( from.InRange( GetWorldLocation(), 2 ) )
{
from.Target = new InternalTarget( this );
}