Add DefaultName property to Mobiles & Items (#18)

This commit is contained in:
Kamron Batman 2018-08-09 17:18:41 -07:00 committed by GitHub
parent b06f5bf60d
commit 8ee42c8ea2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
713 changed files with 5112 additions and 4987 deletions

View file

@ -13,7 +13,7 @@ namespace Server.Items
public abstract int MinDamage{ get; }
public abstract int MaxDamage{ get; }
public override bool RequireFreeHand{ get{ return false; } }
public override bool RequireFreeHand => false;
public BaseConflagrationPotion( PotionEffect effect ) : base( 0xF06, effect )
{
@ -82,7 +82,7 @@ namespace Server.Items
return;
Consume();
// Check if any other players are using this potion
for ( int i = 0; i < m_Users.Count; i ++ )
{
@ -117,7 +117,7 @@ namespace Server.Items
if ( timer != null )
timer.Stop();
m_Delay[ m ] = Timer.DelayCall( TimeSpan.FromSeconds( 30 ), new TimerStateCallback( EndDelay_Callback ), m );
m_Delay[ m ] = Timer.DelayCall( TimeSpan.FromSeconds( 30 ), new TimerStateCallback( EndDelay_Callback ), m );
}
public static int GetDelay( Mobile m )
@ -166,7 +166,7 @@ namespace Server.Items
{
if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
return;
IPoint3D p = targeted as IPoint3D;
if ( p == null || from.Map == null )
@ -201,7 +201,7 @@ namespace Server.Items
public Mobile From{ get{ return m_From; } }
public override bool BlocksFit{ get{ return true; } }
public override bool BlocksFit => true;
public InternalItem( Mobile from, Point3D loc, Map map, int min, int max ) : base( 0x398C )
{
@ -269,7 +269,7 @@ namespace Server.Items
base.Deserialize( reader );
int version = reader.ReadInt();
m_From = reader.ReadMobile();
m_End = reader.ReadDateTime();
m_MinDamage = reader.ReadInt();
@ -321,7 +321,7 @@ namespace Server.Items
if ( m_Item.Map == null || from == null )
return;
List<Mobile> mobiles = new List<Mobile>();
foreach( Mobile mobile in m_Item.GetMobilesInRange( 0 ) )
@ -330,15 +330,15 @@ namespace Server.Items
for( int i = 0; i < mobiles.Count; i++ )
{
Mobile m = mobiles[i];
if ( (m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && (!Core.AOS || m != from) && SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false ) )
{
if ( from != null )
from.DoHarmful( m );
AOS.Damage( m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0 );
m.PlaySound( 0x208 );
}
}
}
}
}

View file

@ -14,7 +14,7 @@ namespace Server.Items
{
public abstract int Radius{ get; }
public override bool RequireFreeHand{ get{ return false; } }
public override bool RequireFreeHand => false;
public BaseConfusionBlastPotion( PotionEffect effect ) : base( 0xF06, effect )
{
@ -120,11 +120,11 @@ namespace Server.Items
if ( map.CanFit( p, 12, true, false ) )
Effects.SendLocationEffect( p, map, 0x376A, 4, 9 );
}
public void CircleEffect2( object state )
{
object[] states = (object[]) state;
Geometry.Circle2D( (Point3D)states[0], (Map)states[1], Radius, new DoEffect_Callback( BlastEffect ), 90, 270 );
}
#endregion
@ -139,7 +139,7 @@ namespace Server.Items
if ( timer != null )
timer.Stop();
m_Delay[ m ] = Timer.DelayCall( TimeSpan.FromSeconds( 60 ), new TimerStateCallback( EndDelay_Callback ), m );
m_Delay[ m ] = Timer.DelayCall( TimeSpan.FromSeconds( 60 ), new TimerStateCallback( EndDelay_Callback ), m );
}
public static int GetDelay( Mobile m )
@ -168,7 +168,7 @@ namespace Server.Items
m_Delay.Remove( m );
}
}
#endregion
#endregion
private class ThrowTarget : Target
{

View file

@ -13,7 +13,7 @@ namespace Server.Items
public abstract int MinDamage { get; }
public abstract int MaxDamage { get; }
public override bool RequireFreeHand{ get{ return false; } }
public override bool RequireFreeHand => false;
private static bool LeveledExplosion = false; // Should explosion potions explode other nearby potions?
private static bool InstantExplosion = false; // Should explosion potions explode on impact?
@ -207,7 +207,7 @@ namespace Server.Items
if( p is Mobile )
{
if( !RelativeLocation ) // explosion location = current mob location.
if( !RelativeLocation ) // explosion location = current mob location.
p = ((Mobile)p).Location;
else
to = (Mobile)p;
@ -287,7 +287,7 @@ namespace Server.Items
from.DoHarmful( m );
int damage = Utility.RandomMinMax( min, max );
damage += alchemyBonus;
if ( !Core.AOS && damage > 40 )