Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,85 +1,96 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HalloweenPumpkin : Item
|
||||
{
|
||||
private static readonly string[] m_Staff =
|
||||
{
|
||||
"Ryan", "Mark", "Eos", "Athena", "Xavier", "Krrios", "Zippy"
|
||||
};
|
||||
public class HalloweenPumpkin : Item
|
||||
{
|
||||
private static readonly string[] m_Staff =
|
||||
{
|
||||
"Ryan", "Mark", "Eos", "Athena", "Xavier", "Krrios", "Zippy"
|
||||
};
|
||||
|
||||
[Constructible]
|
||||
public HalloweenPumpkin()
|
||||
{
|
||||
Weight = Utility.RandomMinMax( 3, 20 );
|
||||
ItemID = ( Utility.RandomDouble() <= .02 ) ? Utility.RandomList( 0x4694, 0x4698 ) : Utility.RandomList( 0xc6a, 0xc6b, 0xc6c );
|
||||
}
|
||||
[Constructible]
|
||||
public HalloweenPumpkin()
|
||||
{
|
||||
Weight = Utility.RandomMinMax(3, 20);
|
||||
ItemID = Utility.RandomDouble() <= .02
|
||||
? Utility.RandomList(0x4694, 0x4698)
|
||||
: Utility.RandomList(0xc6a, 0xc6b, 0xc6c);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
return;
|
||||
public HalloweenPumpkin(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
bool douse = false;
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
return;
|
||||
|
||||
switch ( ItemID )
|
||||
{
|
||||
case 0x4694: ItemID = 0x4691; break;
|
||||
case 0x4691: ItemID = 0x4694; douse = true; break;
|
||||
case 0x4698: ItemID = 0x4695; break;
|
||||
case 0x4695: ItemID = 0x4698; douse = true; break;
|
||||
default: return;
|
||||
}
|
||||
bool douse = false;
|
||||
|
||||
from.SendLocalizedMessage( douse ? 1113988 : 1113987 ); // You extinguish/light the Jack-O-Lantern
|
||||
Effects.PlaySound( GetWorldLocation(), Map, douse ? 0x3be : 0x47 );
|
||||
}
|
||||
switch (ItemID)
|
||||
{
|
||||
case 0x4694:
|
||||
ItemID = 0x4691;
|
||||
break;
|
||||
case 0x4691:
|
||||
ItemID = 0x4694;
|
||||
douse = true;
|
||||
break;
|
||||
case 0x4698:
|
||||
ItemID = 0x4695;
|
||||
break;
|
||||
case 0x4695:
|
||||
ItemID = 0x4698;
|
||||
douse = true;
|
||||
break;
|
||||
default: return;
|
||||
}
|
||||
|
||||
private void AssignRandomName()
|
||||
{
|
||||
Name = $"{m_Staff[Utility.Random(m_Staff.Length)]}'s Jack-O-Lantern";
|
||||
}
|
||||
from.SendLocalizedMessage(douse ? 1113988 : 1113987); // You extinguish/light the Jack-O-Lantern
|
||||
Effects.PlaySound(GetWorldLocation(), Map, douse ? 0x3be : 0x47);
|
||||
}
|
||||
|
||||
public override bool OnDragLift( Mobile from )
|
||||
{
|
||||
if ( Name == null && ( ItemID == 0x4694 || ItemID == 0x4691 || ItemID == 0x4698 || ItemID == 0x4695 ) )
|
||||
{
|
||||
if ( Utility.RandomBool() )
|
||||
{
|
||||
new PumpkinHead().MoveToWorld( GetWorldLocation(), Map );
|
||||
private void AssignRandomName()
|
||||
{
|
||||
Name = $"{m_Staff[Utility.Random(m_Staff.Length)]}'s Jack-O-Lantern";
|
||||
}
|
||||
|
||||
Delete();
|
||||
return false;
|
||||
}
|
||||
public override bool OnDragLift(Mobile from)
|
||||
{
|
||||
if (Name == null && (ItemID == 0x4694 || ItemID == 0x4691 || ItemID == 0x4698 || ItemID == 0x4695))
|
||||
{
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
new PumpkinHead().MoveToWorld(GetWorldLocation(), Map);
|
||||
|
||||
AssignRandomName();
|
||||
}
|
||||
Delete();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
AssignRandomName();
|
||||
}
|
||||
|
||||
public HalloweenPumpkin( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
if ( version == 0 && Name == null && ItemID == 0x4698 )
|
||||
AssignRandomName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (version == 0 && Name == null && ItemID == 0x4698)
|
||||
AssignRandomName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,32 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class PumpkinScarecrow : Item
|
||||
{
|
||||
public override int LabelNumber => 1096947;
|
||||
public class PumpkinScarecrow : Item
|
||||
{
|
||||
[Constructible]
|
||||
public PumpkinScarecrow()
|
||||
: base(Utility.RandomBool() ? 0x469B : 0x469C)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public PumpkinScarecrow()
|
||||
: base( Utility.RandomBool() ? 0x469B : 0x469C )
|
||||
{
|
||||
}
|
||||
public PumpkinScarecrow(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public PumpkinScarecrow( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1096947;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,32 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class RuinedTapestry : Item
|
||||
{
|
||||
public override string DefaultName => "Ruined Tapestry ";
|
||||
public class RuinedTapestry : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RuinedTapestry()
|
||||
: base(Utility.RandomBool() ? 0x4699 : 0x469A)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public RuinedTapestry()
|
||||
: base( Utility.RandomBool() ? 0x4699 : 0x469A )
|
||||
{
|
||||
}
|
||||
public RuinedTapestry(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public RuinedTapestry( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
public override string DefaultName => "Ruined Tapestry ";
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +1,44 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class TwilightLantern : Lantern
|
||||
{
|
||||
[Constructible]
|
||||
public TwilightLantern()
|
||||
{
|
||||
Hue = Utility.RandomBool() ? 244 : 997;
|
||||
}
|
||||
|
||||
public class TwilightLantern : Lantern
|
||||
{
|
||||
public override string DefaultName => "Twilight Lantern";
|
||||
public TwilightLantern(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public TwilightLantern()
|
||||
{
|
||||
Hue = Utility.RandomBool() ? 244 : 997;
|
||||
}
|
||||
public override string DefaultName => "Twilight Lantern";
|
||||
|
||||
public override bool AllowEquippedCast( Mobile from )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool AllowEquippedCast(Mobile from)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1060482 ); // Spell Channeling
|
||||
}
|
||||
list.Add(1060482); // Spell Channeling
|
||||
}
|
||||
|
||||
public TwilightLantern( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
writer.Write( ( int )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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue