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

@ -15,10 +15,11 @@ namespace Server.Mobiles
public override TimeSpan ReacquireDelay { get { return TimeSpan.FromSeconds( 1.0 ); } }
public override string DefaultName => "a wisp";
[Constructible]
public DarkWisp() : base( AIType.AI_Mage, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a wisp";
Body = 165;
BaseSoundID = 466;
@ -81,4 +82,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,16 +3,16 @@ using Server;
using Server.Items;
using Server.Gumps;
namespace Server.Mobiles
{
[CorpseName( "an ethereal warrior corpse" )]
public class EtherealWarrior : BaseCreature
{
public override bool InitialInnocent{ get{ return true; } }
namespace Server.Mobiles
{
[CorpseName( "an ethereal warrior corpse" )]
public class EtherealWarrior : BaseCreature
{
public override bool InitialInnocent => true;
[Constructible]
public EtherealWarrior() : base( AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4 )
{
[Constructible]
public EtherealWarrior() : base( AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4 )
{
Name = NameList.RandomName( "ethereal warrior" );
Body = 123;
@ -129,20 +129,20 @@ namespace Server.Mobiles
attacker.Mana -= Utility.Random( 10, 10 );
}
public EtherealWarrior( Serial serial ) : base( serial )
{
}
public EtherealWarrior( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
}

View file

@ -8,7 +8,7 @@ namespace Server.Mobiles
[CorpseName( "a pixie corpse" )]
public class Pixie : BaseCreature
{
public override bool InitialInnocent{ get{ return true; } }
public override bool InitialInnocent => true;
[Constructible]
public Pixie() : base( AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4 )
@ -88,4 +88,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -7,10 +7,11 @@ namespace Server.Mobiles
[CorpseName( "a wisp corpse" )]
public class ShadowWisp : BaseCreature
{
public override string DefaultName => "a shadow wisp";
[Constructible]
public ShadowWisp() : base( AIType.AI_Mage, FightMode.Aggressor, 10, 1, 0.3, 0.6 )
{
Name = "a shadow wisp";
Body = 165;
BaseSoundID = 466;
@ -78,4 +79,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -16,10 +16,11 @@ namespace Server.Mobiles
public override TimeSpan ReacquireDelay { get { return TimeSpan.FromSeconds( 1.0 ); } }
public override string DefaultName => "a wisp";
[Constructible]
public Wisp() : base( AIType.AI_Mage, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a wisp";
Body = 58;
BaseSoundID = 466;
@ -84,4 +85,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -5,8 +5,8 @@ namespace Server.Mobiles
[CorpseName( "an animated weapon corpse" )]
public class AnimatedWeapon : BaseCreature
{
public override bool DeleteCorpseOnDeath { get { return true; } }
public override bool IsHouseSummonable { get { return true; } }
public override bool DeleteCorpseOnDeath => true;
public override bool IsHouseSummonable => true;
public override double DispelDifficulty { get { return 0.0; } }
public override double DispelFocus { get { return 20.0; } }
@ -16,11 +16,12 @@ namespace Server.Mobiles
return m.Str / Math.Max( this.GetDistanceToSqrt( m ), 1.0 );
}
public override string DefaultName => "an animated weapon";
[Constructible]
public AnimatedWeapon( Mobile caster, int level )
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.3, 0.6 )
{
Name = "an animated weapon";
Body = 692;
SetStr( 10 + level );
@ -69,7 +70,7 @@ namespace Server.Mobiles
ControlSlots = 4;
}
public override bool BleedImmune { get { return true; } }
public override bool BleedImmune => true;
public override Poison PoisonImmune { get { return Poison.Lethal; } }
public override int GetAngerSound()

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
public class BladeSpirits : BaseCreature
{
public override bool DeleteCorpseOnDeath { get { return Core.AOS; } }
public override bool IsHouseSummonable { get { return true; } }
public override bool IsHouseSummonable => true;
public override double DispelDifficulty { get { return 0.0; } }
public override double DispelFocus { get { return 20.0; } }
@ -19,11 +19,12 @@ namespace Server.Mobiles
return ( m.Str + m.Skills[SkillName.Tactics].Value ) / Math.Max( GetDistanceToSqrt( m ), 1.0 );
}
public override string DefaultName => "a blade spirit";
[Constructible]
public BladeSpirits()
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.3, 0.6 )
{
Name = "a blade spirit";
Body = 574;
SetStr( 150 );
@ -57,7 +58,7 @@ namespace Server.Mobiles
ControlSlots = ( Core.SE ) ? 2 : 1;
}
public override bool BleedImmune{ get{ return true; } }
public override bool BleedImmune => true;
public override Poison PoisonImmune { get { return Poison.Lethal; } }
public override int GetAngerSound()
@ -120,4 +121,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
public class EnergyVortex : BaseCreature
{
public override bool DeleteCorpseOnDeath { get { return Summoned; } }
public override bool AlwaysMurderer{ get{ return true; } } // Or Llama vortices will appear gray.
public override bool AlwaysMurderer => true; // Or Llama vortices will appear gray.
public override double DispelDifficulty { get { return 80.0; } }
public override double DispelFocus { get { return 20.0; } }
@ -19,13 +19,13 @@ namespace Server.Mobiles
return ( m.Int + m.Skills[SkillName.Magery].Value ) / Math.Max( GetDistanceToSqrt( m ), 1.0 );
}
public override string DefaultName => "an energy vortex";
[Constructible]
public EnergyVortex()
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an energy vortex";
if( Core.SE && 0.002 > Utility.RandomDouble() ) // Per OSI FoF, it's a 1/500 chance.
if ( Core.SE && 0.002 > Utility.RandomDouble() ) // Per OSI FoF, it's a 1/500 chance.
{
// Llama vortex!
Body = 0xDC;
@ -66,7 +66,7 @@ namespace Server.Mobiles
ControlSlots = ( Core.SE ) ? 2 : 1;
}
public override bool BleedImmune{ get{ return true; } }
public override bool BleedImmune => true;
public override Poison PoisonImmune { get { return Poison.Lethal; } }
public override int GetAngerSound()
@ -129,4 +129,4 @@ namespace Server.Mobiles
BaseSoundID = 0;
}
}
}
}

View file

@ -8,10 +8,11 @@ namespace Server.Mobiles
[CorpseName( "a frost ooze corpse" )]
public class FrostOoze : BaseCreature
{
public override string DefaultName => "a frost ooze";
[Constructible]
public FrostOoze() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a frost ooze";
Body = 94;
BaseSoundID = 456;
@ -61,4 +62,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -9,14 +9,16 @@ namespace Server.Mobiles
{
private bool m_Stunning;
public override bool IsScaredOfScaryThings{ get{ return false; } }
public override bool IsScaryToPets{ get{ return true; } }
public override bool IsScaredOfScaryThings => false;
public override bool IsScaryToPets => true;
public override bool IsBondable{ get{ return false; } }
public override bool IsBondable => false;
public override FoodType FavoriteFood { get { return FoodType.None; } }
public override bool CanBeDistracted { get { return false; } }
public override bool CanBeDistracted => false;
public override string DefaultName => "a golem";
[Constructible]
public Golem() : this( false, 1.0 )
@ -26,7 +28,6 @@ namespace Server.Mobiles
[Constructible]
public Golem( bool summoned, double scalar ) : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8 )
{
Name = "a golem";
Body = 752;
if ( summoned )
@ -106,7 +107,7 @@ namespace Server.Mobiles
}
}
public override bool DeleteOnRelease{ get{ return true; } }
public override bool DeleteOnRelease => true;
public override int GetAngerSound()
{
@ -142,8 +143,8 @@ namespace Server.Mobiles
return base.GetHurtSound();
}
public override bool AutoDispel{ get{ return !Controlled; } }
public override bool BleedImmune{ get{ return true; } }
public override bool AutoDispel => !Controlled;
public override bool BleedImmune => true;
public override void OnGaveMeleeAttack( Mobile defender )
{
@ -210,8 +211,8 @@ namespace Server.Mobiles
base.OnDamage( amount, from, willKill );
}
public override bool BardImmune{ get{ return !Core.AOS || Controlled; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override bool BardImmune => !Core.AOS || Controlled;
public override Poison PoisonImmune => Poison.Lethal;
public Golem( Serial serial ) : base( serial )
{
@ -229,4 +230,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -33,10 +33,11 @@ namespace Server.Mobiles
get { return m_HasMetalChest; }
}
public override string DefaultName => "a plague beast";
[Constructible]
public PlagueBeast() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a plague beast";
Body = 775;
SetStr( 302, 500 );
@ -107,8 +108,8 @@ namespace Server.Mobiles
base.OnDamagedBySpell( caster );
}
public override bool AutoDispel{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override bool AutoDispel => true;
public override Poison PoisonImmune => Poison.Lethal;
public override void OnGotMeleeAttack( Mobile attacker )
{

View file

@ -42,10 +42,11 @@ namespace Server.Mobiles
private DecayTimer m_Timer;
public override string DefaultName => "a plague beast lord";
[Constructible]
public PlagueBeastLord() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a plague beast lord";
Body = 775;
BaseSoundID = 679;
SpeechHue = 0x3B2;
@ -99,7 +100,7 @@ namespace Server.Mobiles
public override void OnDeath( Container c )
{
base.OnDeath( c );
for ( int i = c.Items.Count - 1; i >= 0; i-- )
c.Items[ i ].Delete();
}
@ -204,10 +205,10 @@ namespace Server.Mobiles
if ( m_OpenedBy == null && IsAccessibleTo( from ) )
{
m_OpenedBy = from;
if ( m_Timer == null )
m_Timer = new DecayTimer( this );
if ( !m_Timer.Running )
m_Timer.Start();

View file

@ -32,7 +32,7 @@ namespace Server.Mobiles
{
}
public override bool AlwaysMurderer{ get{ return true; } }
public override bool AlwaysMurderer => true;
public override void DisplayPaperdollTo(Mobile to)
{
@ -62,12 +62,13 @@ namespace Server.Mobiles
}
}
public override string DefaultName => "a plague spawn";
public PlagueSpawn( Mobile owner ) : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
m_Owner = owner;
m_ExpireTime = DateTime.UtcNow + TimeSpan.FromMinutes( 1.0 );
Name = "a plague spawn";
Hue = Utility.Random( 0x11, 15 );
switch ( Utility.Random( 12 ) )
@ -146,4 +147,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -7,10 +7,11 @@ namespace Server.Mobiles
[CorpseName( "a sand vortex corpse" )]
public class SandVortex : BaseCreature
{
public override string DefaultName => "a sand vortex";
[Constructible]
public SandVortex() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a sand vortex";
Body = 790;
BaseSoundID = 263;
@ -108,4 +109,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -8,10 +8,11 @@ namespace Server.Mobiles
[CorpseName( "a slimey corpse" )]
public class Slime : BaseCreature
{
public override string DefaultName => "a slime";
[Constructible]
public Slime() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a slime";
Body = 51;
BaseSoundID = 456;
@ -51,8 +52,8 @@ namespace Server.Mobiles
AddLoot( LootPack.Gems );
}
public override Poison PoisonImmune{ get{ return Poison.Lesser; } }
public override Poison HitPoison{ get{ return Poison.Lesser; } }
public override Poison PoisonImmune => Poison.Lesser;
public override Poison HitPoison => Poison.Lesser;
public override FoodType FavoriteFood{ get{ return FoodType.Meat | FoodType.Fish | FoodType.FruitsAndVegies | FoodType.GrainsAndHay | FoodType.Eggs; } }
public Slime( Serial serial ) : base( serial )