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

@ -1,7 +1,7 @@
namespace Server.Items
{
[FlippableAttribute( 0xFAF, 0xFB0 )]
[Server.Engines.Craft.Anvil]
[Engines.Craft.Anvil]
public class Anvil : Item
{
[Constructible]
@ -29,7 +29,7 @@ namespace Server.Items
}
}
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
public class Forge : Item
{
[Constructible]

View file

@ -1,6 +1,6 @@
namespace Server.Items
{
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
public class LargeForgeWest : Item
{
private InternalItem m_Item;
@ -65,7 +65,7 @@ namespace Server.Items
m_Item2 = reader.ReadItem() as InternalItem2;
}
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
private class InternalItem : Item
{
private LargeForgeWest m_Item;
@ -120,7 +120,7 @@ namespace Server.Items
}
}
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
private class InternalItem2 : Item
{
private LargeForgeWest m_Item;
@ -176,7 +176,7 @@ namespace Server.Items
}
}
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
public class LargeForgeEast : Item
{
private InternalItem m_Item;
@ -241,7 +241,7 @@ namespace Server.Items
m_Item2 = reader.ReadItem() as InternalItem2;
}
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
private class InternalItem : Item
{
private LargeForgeEast m_Item;
@ -296,7 +296,7 @@ namespace Server.Items
}
}
[Server.Engines.Craft.Forge]
[Engines.Craft.Forge]
private class InternalItem2 : Item
{
private LargeForgeEast m_Item;

View file

@ -20,7 +20,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( this.Parent != null || !this.VerifyMove( from ) )
if ( Parent != null || !VerifyMove( from ) )
return;
if ( !from.InRange( this, 2 ) )
@ -29,18 +29,18 @@ namespace Server.Items
return;
}
if ( this.ItemID == 0xA57 ) // rolled
if ( ItemID == 0xA57 ) // rolled
{
Direction dir = PlayerMobile.GetDirection4( from.Location, this.Location );
Direction dir = PlayerMobile.GetDirection4( from.Location, Location );
if ( dir == Direction.North || dir == Direction.South )
this.ItemID = 0xA55;
ItemID = 0xA55;
else
this.ItemID = 0xA56;
ItemID = 0xA56;
}
else // unrolled
{
this.ItemID = 0xA57;
ItemID = 0xA57;
if ( !from.HasGump( typeof( LogoutGump ) ) )
{

View file

@ -57,7 +57,7 @@ namespace Server.Items
{
get
{
switch ( this.ItemID )
switch ( ItemID )
{
case 0xDE3:
return CampfireStatus.Burning;
@ -71,24 +71,24 @@ namespace Server.Items
}
set
{
if ( this.Status == value )
if ( Status == value )
return;
switch ( value )
{
case CampfireStatus.Burning:
this.ItemID = 0xDE3;
this.Light = LightType.Circle300;
ItemID = 0xDE3;
Light = LightType.Circle300;
break;
case CampfireStatus.Extinguishing:
this.ItemID = 0xDE9;
this.Light = LightType.Circle150;
ItemID = 0xDE9;
Light = LightType.Circle150;
break;
default:
this.ItemID = 0xDEA;
this.Light = LightType.ArchedWindowEast;
ItemID = 0xDEA;
Light = LightType.ArchedWindowEast;
ClearEntries();
break;
}
@ -98,16 +98,16 @@ namespace Server.Items
private void OnTick()
{
DateTime now = DateTime.UtcNow;
TimeSpan age = now - this.Created;
TimeSpan age = now - Created;
if ( age >= TimeSpan.FromSeconds( 100.0 ) )
this.Delete();
Delete();
else if ( age >= TimeSpan.FromSeconds( 90.0 ) )
this.Status = CampfireStatus.Off;
Status = CampfireStatus.Off;
else if ( age >= TimeSpan.FromSeconds( 60.0 ) )
this.Status = CampfireStatus.Extinguishing;
Status = CampfireStatus.Extinguishing;
if ( this.Status == CampfireStatus.Off || this.Deleted )
if ( Status == CampfireStatus.Off || Deleted )
return;
foreach ( CampfireEntry entry in new ArrayList( m_Entries ) )
@ -123,7 +123,7 @@ namespace Server.Items
}
}
IPooledEnumerable<NetState> eable = this.GetClientsInRange( SecureRange );
IPooledEnumerable<NetState> eable = GetClientsInRange( SecureRange );
foreach ( NetState state in eable )
{
@ -172,7 +172,7 @@ namespace Server.Items
int version = reader.ReadInt();
this.Delete();
Delete();
}
}

View file

@ -41,10 +41,10 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( !this.VerifyMove( from ) )
if ( !VerifyMove( from ) )
return;
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
if ( !from.InRange( GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
@ -64,7 +64,7 @@ namespace Server.Items
{
Consume();
if ( !this.Deleted && this.Parent == null )
if ( !Deleted && Parent == null )
from.PlaceInBackpack( this );
new Campfire().MoveToWorld( fireLocation, from.Map );
@ -76,8 +76,8 @@ namespace Server.Items
if ( from.Region.IsPartOf( typeof( DungeonRegion ) ) )
return Point3D.Zero;
if ( this.Parent == null )
return this.Location;
if ( Parent == null )
return Location;
ArrayList list = new ArrayList( 4 );

View file

@ -247,10 +247,10 @@ namespace Server.Items
public bool CouldFit( IPoint3D p, Map map )
{
if ( !map.CanFit( p.X, p.Y, p.Z, this.ItemData.Height ) )
if ( !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
return false;
if ( this.ItemID == m_NorthID )
if ( ItemID == m_NorthID )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
else
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
@ -300,21 +300,21 @@ namespace Server.Items
private void FixMovingCrate()
{
if ( this.Deleted )
if ( Deleted )
return;
if ( this.Movable || this.IsLockedDown )
if ( Movable || IsLockedDown )
{
Item deed = this.Deed;
Item deed = Deed;
if ( this.Parent is Item item )
if ( Parent is Item item )
{
item.AddItem( deed );
deed.Location = this.Location;
deed.Location = Location;
}
else
{
deed.MoveToWorld( this.Location, this.Map );
deed.MoveToWorld( Location, Map );
}
Delete();
@ -331,7 +331,7 @@ namespace Server.Items
{
if ( from.InRange( GetWorldLocation(), 1 ) )
{
from.AddToBackpack( this.Deed );
from.AddToBackpack( Deed );
Delete();
}
else

View file

@ -131,7 +131,7 @@ namespace Server.Items
}
case 0:
{
m_TargetMap = this.Map;
m_TargetMap = Map;
if ( m_TargetMap == null || m_TargetMap == Map.Internal )
m_TargetMap = Map.Trammel;

View file

@ -35,9 +35,9 @@ namespace Server.Items
int xMins = 0, yMins = 0;
bool xEast = false, ySouth = false;
if ( Sextant.Format( from.Location, from.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
if ( Format( from.Location, from.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
{
string location = String.Format( "{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
string location = String.Format( "{0}<EFBFBD> {1}'{2}, {3}<7D> {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
from.LocalOverheadMessage( MessageType.Regular, from.SpeechHue, false, location );
}
}

View file

@ -11,17 +11,17 @@ namespace Server.Items
{
public ShipwreckedItem( int itemID ) : base( itemID )
{
int weight = this.ItemData.Weight;
int weight = ItemData.Weight;
if ( weight >= 255 )
weight = 1;
this.Weight = weight;
Weight = weight;
}
public override void OnSingleClick( Mobile from )
{
this.LabelTo( from, 1050039, String.Format( "#{0}\t#1041645", LabelNumber ) );
LabelTo( from, 1050039, String.Format( "#{0}\t#1041645", LabelNumber ) );
}
public override void AddNameProperties( ObjectPropertyList list )

View file

@ -221,7 +221,7 @@ namespace Server.Items
if ( index == 14 )
FinishEffect( p, Map, from );
else
this.Z -= 1;
Z -= 1;
}
}
@ -252,7 +252,7 @@ namespace Server.Items
LandTile t = map.Tiles.GetLandTile( tx, ty );
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
{
x = tx;
y = ty;

View file

@ -148,7 +148,7 @@ namespace Server.Items
bool stoneMining = ( mobile.StoneMining && mobile.Skills[SkillName.Mining].Base >= 100.0 );
if ( mobile.ToggleMiningStone == value || ( value && !stoneMining ) )
this.Flags |= CMEFlags.Disabled;
Flags |= CMEFlags.Disabled;
}
public override void OnClick()

View file

@ -161,10 +161,10 @@ namespace Server.Items
public virtual bool ValidateUse( Mobile from, bool message )
{
if ( from.Deleted || this.Deleted )
if ( from.Deleted || Deleted )
return false;
if ( from.Map != this.Map || !from.InRange( this, 1 ) )
if ( from.Map != Map || !from.InRange( this, 1 ) )
{
if ( message )
from.SendLocalizedMessage( 500446 ); // That is too far away.

View file

@ -43,7 +43,7 @@ namespace Server.Items
{
int held = Math.Max( 0, Math.Min( m_Held, 100 ) );
this.Weight = 20 + ((held * 80) / 100);
Weight = 20 + ((held * 80) / 100);
}
public PotionKeg( Serial serial ) : base( serial )
@ -160,7 +160,7 @@ namespace Server.Items
else
number = 502258; // The keg is completely full.
this.LabelTo( from, number );
LabelTo( from, number );
}
public override void OnDoubleClick( Mobile from )

View file

@ -47,10 +47,10 @@ namespace Server.Items
{
if ( DoAgility( from ) )
{
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
}
}
}

View file

@ -89,13 +89,13 @@ namespace Server.Items
if ( !Movable )
return;
if ( from.InRange( this.GetWorldLocation(), 1 ) )
if ( from.InRange( GetWorldLocation(), 1 ) )
{
if (!RequireFreeHand || HasFreeHand(from))
{
if (this is BaseExplosionPotion && Amount > 1)
{
BasePotion pot = (BasePotion)Activator.CreateInstance(this.GetType());
BasePotion pot = (BasePotion)Activator.CreateInstance(GetType());
if (pot != null)
{
@ -114,7 +114,7 @@ namespace Server.Items
}
else
{
this.Drink( from );
Drink( from );
}
}
else

View file

@ -84,13 +84,13 @@ namespace Server.Items
{
DoCure( from );
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
from.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
from.PlaySound( 0x1E0 );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
}
else
{

View file

@ -42,12 +42,12 @@ namespace Server.Items
public virtual object FindParent( Mobile from )
{
Mobile m = this.HeldBy;
Mobile m = HeldBy;
if ( m != null && m.Holding == this )
return m;
object obj = this.RootParent;
object obj = RootParent;
if ( obj != null )
return obj;
@ -73,7 +73,7 @@ namespace Server.Items
}
ThrowTarget targ = from.Target as ThrowTarget;
this.Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
if ( targ != null && targ.Potion == this )
return;

View file

@ -53,10 +53,10 @@ namespace Server.Items
{
DoHeal( from );
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseHealLock ), from );
}

View file

@ -35,10 +35,10 @@ namespace Server.Items
from.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
from.PlaySound( 0x1E3 );
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
}
else
{

View file

@ -38,10 +38,10 @@ namespace Server.Items
{
DoPoison( from );
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
}
}
}

View file

@ -32,10 +32,10 @@ namespace Server.Items
{
from.Stam += Scale( from, (int)(Refresh * from.StamMax) );
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
}
else
{

View file

@ -47,10 +47,10 @@ namespace Server.Items
{
if ( DoStrength( from ) )
{
BasePotion.PlayDrinkEffect( from );
PlayDrinkEffect( from );
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Consume();
}
}
}

View file

@ -62,8 +62,8 @@ namespace Server.Items
{
base.GetContextMenuEntries( from, list );
if ( from.Alive && this.Movable )
list.Add( new ContextMenus.AddToSpellbookEntry() );
if ( from.Alive && Movable )
list.Add( new AddToSpellbookEntry() );
}
public override void OnDoubleClick( Mobile from )

View file

@ -102,7 +102,7 @@ namespace Server.Items
case 7: type = SpellbookType.Mystic; break;
}
Spellbook book = Spellbook.Find( from, -1, type );
Spellbook book = Find( from, -1, type );
if ( book != null )
book.DisplayTo( from );
@ -353,7 +353,7 @@ namespace Server.Items
{
SpellbookType type = GetTypeForSpell( scroll.SpellID );
if ( type != this.SpellbookType )
if ( type != SpellbookType )
{
return false;
}
@ -452,7 +452,7 @@ namespace Server.Items
if ( strBonus != 0 || dexBonus != 0 || intBonus != 0 )
{
string modName = this.Serial.ToString();
string modName = Serial.ToString();
if ( strBonus != 0 )
from.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );
@ -474,7 +474,7 @@ namespace Server.Items
{
m_AosSkillBonuses.Remove();
string modName = this.Serial.ToString();
string modName = Serial.ToString();
from.RemoveStatMod( modName + "Str" );
from.RemoveStatMod( modName + "Dex" );
@ -506,7 +506,7 @@ namespace Server.Items
if ( Parent == null )
{
to.Send( this.WorldPacket );
to.Send( WorldPacket );
}
else if ( Parent is Item )
{
@ -668,9 +668,9 @@ namespace Server.Items
base.OnSingleClick( from );
if ( m_Crafter != null )
this.LabelTo( from, 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
LabelTo( from, 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
this.LabelTo( from, 1042886, m_Count.ToString() );
LabelTo( from, 1042886, m_Count.ToString() );
}
public override void OnDoubleClick( Mobile from )

View file

@ -23,10 +23,10 @@ namespace Server.Items
private bool CheckUse( Mobile from )
{
if ( !this.IsAccessibleTo( from ) )
if ( !IsAccessibleTo( from ) )
return false;
if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 2 ) )
if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return false;
@ -171,7 +171,7 @@ namespace Server.Items
if ( Utility.RandomDouble() < breakChance )
{
from.SendLocalizedMessage( 1049619 ); // The fire horn crumbles in your hands.
this.Delete();
Delete();
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Items
{
base.GetProperties( list );
Recipe r = this.Recipe;
Recipe r = Recipe;
if ( r != null )
list.Add( 1049644, r.TextDefinition.ToString() ); // [~1_stuff~]
@ -57,13 +57,13 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
if ( !from.InRange( GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
}
Recipe r = this.Recipe;
Recipe r = Recipe;
if ( r != null && from is PlayerMobile pm )
{
@ -76,7 +76,7 @@ namespace Server.Items
{
pm.SendLocalizedMessage( 1073451, r.TextDefinition.ToString() ); // You have learned a new recipe: ~1_RECIPE~
pm.AcquireRecipe( r );
this.Delete();
Delete();
}
else
{

View file

@ -110,10 +110,10 @@ namespace Server.Items
if ( Deleted || !from.CanSee( this ) )
return;
this.LabelTo( from, 1061133, String.Format( "{0}\t{1}", GetSkillTitle( m_SkillLevel ).ToString(), RepairSkillInfo.GetInfo( m_Skill ).Name ) ); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
LabelTo( from, 1061133, String.Format( "{0}\t{1}", GetSkillTitle( m_SkillLevel ).ToString(), RepairSkillInfo.GetInfo( m_Skill ).Name ) ); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
if ( m_Crafter != null )
this.LabelTo( from, 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
LabelTo( from, 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
}
[Constructible]
@ -208,7 +208,7 @@ namespace Server.Items
if ( !m.Region.IsPartOf( typeof( TownRegion ) ) )
return false;
return Server.Factions.Faction.IsNearType( m, RepairSkillInfo.GetInfo( m_Skill ).NearbyTypes, 6 );
return Factions.Faction.IsNearType( m, RepairSkillInfo.GetInfo( m_Skill ).NearbyTypes, 6 );
}
public override void Serialize( GenericWriter writer )

View file

@ -410,7 +410,7 @@ namespace Server.Items
}
else
{
this.LabelTo( from, Name );
LabelTo( from, Name );
number = 1041000;
}

View file

@ -37,8 +37,8 @@ namespace Server.Items
int version = reader.ReadInt();
if ( version == 0 && this.Name == "sand" )
this.Name = null;
if ( version == 0 && Name == "sand" )
Name = null;
}
}
}

View file

@ -119,7 +119,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( this.GetWorldLocation(), 1 ) )
if ( from.InRange( GetWorldLocation(), 1 ) )
{
from.SendLocalizedMessage( TargetMessage );
from.Target = new InternalTarget( this );

View file

@ -24,7 +24,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
return;
base.OnDoubleClick( from );

View file

@ -128,7 +128,7 @@ namespace Server.Items
{
if ( IsChildOf( from.Backpack ) || Parent == from )
{
CraftSystem system = this.CraftSystem;
CraftSystem system = CraftSystem;
int num = system.CanCraft( from, this, null );