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,86 +1,86 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseSuit : Item
|
||||
{
|
||||
[CommandProperty( AccessLevel.Administrator )]
|
||||
public AccessLevel AccessLevel { get; set; }
|
||||
public abstract class BaseSuit : Item
|
||||
{
|
||||
public BaseSuit(AccessLevel level, int hue, int itemID) : base(itemID)
|
||||
{
|
||||
Hue = hue;
|
||||
Weight = 1.0;
|
||||
Movable = false;
|
||||
LootType = LootType.Newbied;
|
||||
Layer = Layer.OuterTorso;
|
||||
|
||||
public BaseSuit( AccessLevel level, int hue, int itemID ) : base( itemID )
|
||||
{
|
||||
Hue = hue;
|
||||
Weight = 1.0;
|
||||
Movable = false;
|
||||
LootType = LootType.Newbied;
|
||||
Layer = Layer.OuterTorso;
|
||||
AccessLevel = level;
|
||||
}
|
||||
|
||||
AccessLevel = level;
|
||||
}
|
||||
public BaseSuit(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseSuit( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
[CommandProperty(AccessLevel.Administrator)]
|
||||
public AccessLevel AccessLevel{ get; set; }
|
||||
|
||||
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
|
||||
|
||||
writer.Write( (int) AccessLevel );
|
||||
}
|
||||
writer.Write((int)AccessLevel);
|
||||
}
|
||||
|
||||
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 0:
|
||||
{
|
||||
AccessLevel = (AccessLevel)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
AccessLevel = (AccessLevel)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
object root = RootParent;
|
||||
public bool Validate()
|
||||
{
|
||||
object root = RootParent;
|
||||
|
||||
if ( root is Mobile mobile && mobile.AccessLevel < AccessLevel )
|
||||
{
|
||||
Delete();
|
||||
return false;
|
||||
}
|
||||
if (root is Mobile mobile && mobile.AccessLevel < AccessLevel)
|
||||
{
|
||||
Delete();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if ( Validate() )
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (Validate())
|
||||
base.OnSingleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( Validate() )
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Validate())
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override bool VerifyMove( Mobile from )
|
||||
{
|
||||
return ( from.AccessLevel >= AccessLevel );
|
||||
}
|
||||
public override bool VerifyMove(Mobile from)
|
||||
{
|
||||
return from.AccessLevel >= AccessLevel;
|
||||
}
|
||||
|
||||
public override bool OnEquip( Mobile from )
|
||||
{
|
||||
if ( from.AccessLevel < AccessLevel )
|
||||
from.SendMessage( "You may not wear this." );
|
||||
public override bool OnEquip(Mobile from)
|
||||
{
|
||||
if (from.AccessLevel < AccessLevel)
|
||||
from.SendMessage("You may not wear this.");
|
||||
|
||||
return ( from.AccessLevel >= AccessLevel );
|
||||
}
|
||||
}
|
||||
}
|
||||
return from.AccessLevel >= AccessLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue