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,111 +3,135 @@ using Server.Mobiles;
namespace Server.Items
{
public class UnholyBone : Item, ICarvable
{
private SpawnTimer m_Timer;
public class UnholyBone : Item, ICarvable
{
private SpawnTimer m_Timer;
public override string DefaultName => "unholy bone";
[Constructible]
public UnholyBone() : base(0xF7E)
{
Movable = false;
Hue = 0x497;
[Constructible]
public UnholyBone() : base( 0xF7E )
{
Movable = false;
Hue = 0x497;
m_Timer = new SpawnTimer(this);
m_Timer.Start();
}
m_Timer = new SpawnTimer( this );
m_Timer.Start();
}
public UnholyBone(Serial serial) : base(serial)
{
}
public void Carve( Mobile from, Item item )
{
Effects.PlaySound( GetWorldLocation(), Map, 0x48F );
Effects.SendLocationEffect( GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0 );
public override string DefaultName => "unholy bone";
if ( 0.3 > Utility.RandomDouble() )
{
if ( ItemID == 0xF7E )
from.SendMessage( "You destroy the bone." );
else
from.SendMessage( "You destroy the bone pile." );
public void Carve(Mobile from, Item item)
{
Effects.PlaySound(GetWorldLocation(), Map, 0x48F);
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0);
Gold gold = new Gold( 25, 100 );
if (0.3 > Utility.RandomDouble())
{
if (ItemID == 0xF7E)
from.SendMessage("You destroy the bone.");
else
from.SendMessage("You destroy the bone pile.");
gold.MoveToWorld( GetWorldLocation(), Map );
Gold gold = new Gold(25, 100);
Delete();
gold.MoveToWorld(GetWorldLocation(), Map);
m_Timer.Stop();
}
else
{
if ( ItemID == 0xF7E )
from.SendMessage( "You damage the bone." );
else
from.SendMessage( "You damage the bone pile." );
}
}
Delete();
public UnholyBone( Serial serial ) : base( serial )
{
}
m_Timer.Stop();
}
else
{
if (ItemID == 0xF7E)
from.SendMessage("You damage the bone.");
else
from.SendMessage("You damage the bone pile.");
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
int version = reader.ReadInt();
m_Timer = new SpawnTimer( this );
m_Timer.Start();
}
m_Timer = new SpawnTimer(this);
m_Timer.Start();
}
private class SpawnTimer : Timer
{
private Item m_Item;
private class SpawnTimer : Timer
{
private Item m_Item;
public SpawnTimer( Item item ) : base( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 10 ) ) )
{
Priority = TimerPriority.FiftyMS;
public SpawnTimer(Item item) : base(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10)))
{
Priority = TimerPriority.FiftyMS;
m_Item = item;
}
m_Item = item;
}
protected override void OnTick()
{
if ( m_Item.Deleted )
return;
protected override void OnTick()
{
if (m_Item.Deleted)
return;
Mobile spawn;
Mobile spawn;
switch ( Utility.Random( 12 ) )
{
default:
case 0: spawn = new Skeleton(); break;
case 1: spawn = new Zombie(); break;
case 2: spawn = new Wraith(); break;
case 3: spawn = new Spectre(); break;
case 4: spawn = new Ghoul(); break;
case 5: spawn = new Mummy(); break;
case 6: spawn = new Bogle(); break;
case 7: spawn = new RottingCorpse(); break;
case 8: spawn = new BoneKnight(); break;
case 9: spawn = new SkeletalKnight(); break;
case 10: spawn = new Lich(); break;
case 11: spawn = new LichLord(); break;
}
switch (Utility.Random(12))
{
default:
case 0:
spawn = new Skeleton();
break;
case 1:
spawn = new Zombie();
break;
case 2:
spawn = new Wraith();
break;
case 3:
spawn = new Spectre();
break;
case 4:
spawn = new Ghoul();
break;
case 5:
spawn = new Mummy();
break;
case 6:
spawn = new Bogle();
break;
case 7:
spawn = new RottingCorpse();
break;
case 8:
spawn = new BoneKnight();
break;
case 9:
spawn = new SkeletalKnight();
break;
case 10:
spawn = new Lich();
break;
case 11:
spawn = new LichLord();
break;
}
spawn.MoveToWorld( m_Item.Location, m_Item.Map );
spawn.MoveToWorld(m_Item.Location, m_Item.Map);
m_Item.Delete();
}
}
}
m_Item.Delete();
}
}
}
}