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

@ -1,154 +1,159 @@
namespace Server.Items
{
[Flippable( 0x2328, 0x2329 )]
public class Snowman : Item, IDyable
{
public static string GetRandomTitle()
{
// All hail OSI staff
string[] titles = {
/* 1 */ "Backflash",
/* 2 */ "Carbon",
/* 3 */ "Colbalistic",
/* 4 */ "Comforl",
/* 5 */ "Coppacchia",
/* 6 */ "Cyrus",
/* 7 */ "DannyB",
/* 8 */ "DJSoul",
/* 9 */ "DraconisRex",
/* 10 */ "Earia",
/* 11 */ "Foster",
/* 12 */ "Gonzo",
/* 13 */ "Haan",
/* 14 */ "Halona",
/* 15 */ "Hugo",
/* 16 */ "Hyacinth",
/* 17 */ "Imirian",
/* 18 */ "Jinsol",
/* 19 */ "Liciatia",
/* 20 */ "Loewen",
/* 21 */ "Loke",
/* 22 */ "Magnus",
/* 23 */ "Maleki",
/* 24 */ "Morpheus",
/* 25 */ "Obberron",
/* 26 */ "Odee",
/* 27 */ "Orbeus",
/* 28 */ "Pax",
/* 29 */ "Phields",
/* 30 */ "Pigpen",
/* 31 */ "Platinum",
/* 32 */ "Polpol",
/* 33 */ "Prume",
/* 34 */ "Quinnly",
/* 35 */ "Ragnarok",
/* 36 */ "Rend",
/* 37 */ "Roland",
/* 38 */ "RyanM",
/* 39 */ "Screach",
/* 40 */ "Seraph",
/* 41 */ "Silvani",
/* 42 */ "Sherbear",
/* 43 */ "SkyWalker",
/* 44 */ "Snark",
/* 45 */ "Sowl",
/* 46 */ "Spada",
/* 47 */ "Starblade",
/* 48 */ "Tenacious",
/* 49 */ "Tnez",
/* 50 */ "Wasia",
/* 51 */ "Zilo",
/* 52 */ "Zippy",
/* 53 */ "Zoer"
};
[Flippable(0x2328, 0x2329)]
public class Snowman : Item, IDyable
{
private string m_Title;
if ( titles.Length > 0 )
return titles[Utility.Random( titles.Length )];
[Constructible]
public Snowman() : this(Utility.RandomDyedHue(), GetRandomTitle())
{
}
return null;
}
[Constructible]
public Snowman(int hue) : this(hue, GetRandomTitle())
{
}
private string m_Title;
[Constructible]
public Snowman(string title) : this(Utility.RandomDyedHue(), title)
{
}
[CommandProperty( AccessLevel.GameMaster )]
public string Title
{
get => m_Title;
set{ m_Title = value; InvalidateProperties(); }
}
[Constructible]
public Snowman(int hue, string title) : base(Utility.Random(0x2328, 2))
{
Weight = 10.0;
Hue = hue;
LootType = LootType.Blessed;
[Constructible]
public Snowman() : this( Utility.RandomDyedHue(), GetRandomTitle() )
{
}
m_Title = title;
}
[Constructible]
public Snowman( int hue ) : this( hue, GetRandomTitle() )
{
}
public Snowman(Serial serial) : base(serial)
{
}
[Constructible]
public Snowman( string title ) : this( Utility.RandomDyedHue(), title )
{
}
[CommandProperty(AccessLevel.GameMaster)]
public string Title
{
get => m_Title;
set
{
m_Title = value;
InvalidateProperties();
}
}
[Constructible]
public Snowman( int hue, string title ) : base( Utility.Random( 0x2328, 2 ) )
{
Weight = 10.0;
Hue = hue;
LootType = LootType.Blessed;
public bool Dye(Mobile from, DyeTub sender)
{
if (Deleted)
return false;
m_Title = title;
}
Hue = sender.DyedHue;
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
return true;
}
if ( m_Title != null )
list.Add( 1062841, m_Title ); // ~1_NAME~ the Snowman
}
public static string GetRandomTitle()
{
// All hail OSI staff
string[] titles =
{
/* 1 */ "Backflash",
/* 2 */ "Carbon",
/* 3 */ "Colbalistic",
/* 4 */ "Comforl",
/* 5 */ "Coppacchia",
/* 6 */ "Cyrus",
/* 7 */ "DannyB",
/* 8 */ "DJSoul",
/* 9 */ "DraconisRex",
/* 10 */ "Earia",
/* 11 */ "Foster",
/* 12 */ "Gonzo",
/* 13 */ "Haan",
/* 14 */ "Halona",
/* 15 */ "Hugo",
/* 16 */ "Hyacinth",
/* 17 */ "Imirian",
/* 18 */ "Jinsol",
/* 19 */ "Liciatia",
/* 20 */ "Loewen",
/* 21 */ "Loke",
/* 22 */ "Magnus",
/* 23 */ "Maleki",
/* 24 */ "Morpheus",
/* 25 */ "Obberron",
/* 26 */ "Odee",
/* 27 */ "Orbeus",
/* 28 */ "Pax",
/* 29 */ "Phields",
/* 30 */ "Pigpen",
/* 31 */ "Platinum",
/* 32 */ "Polpol",
/* 33 */ "Prume",
/* 34 */ "Quinnly",
/* 35 */ "Ragnarok",
/* 36 */ "Rend",
/* 37 */ "Roland",
/* 38 */ "RyanM",
/* 39 */ "Screach",
/* 40 */ "Seraph",
/* 41 */ "Silvani",
/* 42 */ "Sherbear",
/* 43 */ "SkyWalker",
/* 44 */ "Snark",
/* 45 */ "Sowl",
/* 46 */ "Spada",
/* 47 */ "Starblade",
/* 48 */ "Tenacious",
/* 49 */ "Tnez",
/* 50 */ "Wasia",
/* 51 */ "Zilo",
/* 52 */ "Zippy",
/* 53 */ "Zoer"
};
public bool Dye( Mobile from, DyeTub sender )
{
if ( Deleted )
return false;
if (titles.Length > 0)
return titles[Utility.Random(titles.Length)];
Hue = sender.DyedHue;
return null;
}
return true;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
public Snowman( Serial serial ) : base( serial )
{
}
if (m_Title != null)
list.Add(1062841, m_Title); // ~1_NAME~ the Snowman
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 1 ); // version
writer.Write(1); // version
writer.Write( (string) m_Title );
}
writer.Write(m_Title);
}
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();
switch ( version )
{
case 1:
{
m_Title = reader.ReadString();
break;
}
}
switch (version)
{
case 1:
{
m_Title = reader.ReadString();
break;
}
}
Utility.Intern( ref m_Title );
}
}
Utility.Intern(ref m_Title);
}
}
}