Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -3,140 +3,139 @@ using Server.Items;
namespace Server.Mobiles
{
public class ShadowFiend : BaseCreature
{
public override bool DeleteCorpseOnDeath => true;
public class ShadowFiend : BaseCreature
{
private UnhideTimer m_Timer;
private UnhideTimer m_Timer;
[Constructible]
public ShadowFiend() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Body = 0xA8;
public override string DefaultName => "a shadow fiend";
// this to allow shadow fiend to loot from corpses
Backpack backpack = new Backpack();
backpack.Movable = false;
AddItem(backpack);
[Constructible]
public ShadowFiend() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Body = 0xA8;
SetStr(46, 55);
SetDex(121, 130);
SetInt(46, 55);
// this to allow shadow fiend to loot from corpses
Backpack backpack = new Backpack();
backpack.Movable = false;
AddItem( backpack );
SetHits(28, 33);
SetStam(46, 55);
SetStr( 46, 55 );
SetDex( 121, 130 );
SetInt( 46, 55 );
SetDamage(10, 22);
SetHits( 28, 33 );
SetStam( 46, 55 );
SetDamageType(ResistanceType.Physical, 20);
SetDamageType(ResistanceType.Cold, 80);
SetDamage( 10, 22 );
SetResistance(ResistanceType.Physical, 20, 25);
SetResistance(ResistanceType.Fire, 20, 25);
SetResistance(ResistanceType.Cold, 40, 45);
SetResistance(ResistanceType.Poison, 60, 70);
SetResistance(ResistanceType.Energy, 5, 10);
SetDamageType( ResistanceType.Physical, 20 );
SetDamageType( ResistanceType.Cold, 80 );
SetSkill(SkillName.MagicResist, 20.1, 30.0);
SetSkill(SkillName.Tactics, 20.1, 30.0);
SetSkill(SkillName.Wrestling, 20.1, 30.0);
SetResistance( ResistanceType.Physical, 20, 25 );
SetResistance( ResistanceType.Fire, 20, 25 );
SetResistance( ResistanceType.Cold, 40, 45 );
SetResistance( ResistanceType.Poison, 60, 70 );
SetResistance( ResistanceType.Energy, 5, 10 );
Fame = 1000;
Karma = -1000;
SetSkill( SkillName.MagicResist, 20.1, 30.0 );
SetSkill( SkillName.Tactics, 20.1, 30.0 );
SetSkill( SkillName.Wrestling, 20.1, 30.0 );
m_Timer = new UnhideTimer(this);
m_Timer.Start();
}
Fame = 1000;
Karma = -1000;
public ShadowFiend(Serial serial) : base(serial)
{
}
m_Timer = new UnhideTimer( this );
m_Timer.Start();
}
public override bool DeleteCorpseOnDeath => true;
public override int GetIdleSound()
{
return 0x37A;
}
public override string DefaultName => "a shadow fiend";
public override int GetAngerSound()
{
return 0x379;
}
public override bool CanRummageCorpses => true;
public override int GetDeathSound()
{
return 0x381;
}
public override int GetIdleSound()
{
return 0x37A;
}
public override int GetAttackSound()
{
return 0x37F;
}
public override int GetAngerSound()
{
return 0x379;
}
public override int GetHurtSound()
{
return 0x380;
}
public override int GetDeathSound()
{
return 0x381;
}
public override bool CanRummageCorpses => true;
public override int GetAttackSound()
{
return 0x37F;
}
public override bool OnBeforeDeath()
{
Backpack?.Destroy();
public override int GetHurtSound()
{
return 0x380;
}
Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
return true;
}
public override bool OnBeforeDeath()
{
Backpack?.Destroy();
public ShadowFiend( Serial serial ) : base( serial )
{
}
Effects.SendLocationEffect(Location, Map, 0x376A, 10, 1);
return true;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(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();
m_Timer = new UnhideTimer( this );
m_Timer.Start();
}
m_Timer = new UnhideTimer(this);
m_Timer.Start();
}
public override void OnAfterDelete()
{
m_Timer?.Stop();
public override void OnAfterDelete()
{
m_Timer?.Stop();
m_Timer = null;
m_Timer = null;
base.OnAfterDelete();
}
base.OnAfterDelete();
}
private class UnhideTimer : Timer
{
private ShadowFiend m_Owner;
private class UnhideTimer : Timer
{
private ShadowFiend m_Owner;
public UnhideTimer( ShadowFiend owner ) : base( TimeSpan.FromSeconds( 30.0 ) )
{
m_Owner = owner;
Priority = TimerPriority.OneSecond;
}
public UnhideTimer(ShadowFiend owner) : base(TimeSpan.FromSeconds(30.0))
{
m_Owner = owner;
Priority = TimerPriority.OneSecond;
}
protected override void OnTick()
{
if ( m_Owner.Deleted )
{
Stop();
return;
}
protected override void OnTick()
{
if (m_Owner.Deleted)
{
Stop();
return;
}
foreach ( Mobile m in m_Owner.GetMobilesInRange( 3 ) )
{
if ( m != m_Owner && m.Player && m.Hidden && m_Owner.CanBeHarmful( m ) && m.AccessLevel == AccessLevel.Player )
m.Hidden = false;
}
}
}
}
}
foreach (Mobile m in m_Owner.GetMobilesInRange(3))
if (m != m_Owner && m.Player && m.Hidden && m_Owner.CanBeHarmful(m) &&
m.AccessLevel == AccessLevel.Player)
m.Hidden = false;
}
}
}
}