Adds more formatting
This commit is contained in:
parent
e77d695684
commit
f674ec2be0
68 changed files with 530 additions and 876 deletions
|
|
@ -30,24 +30,20 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
Key key = dropped as Key;
|
||||
|
||||
if ( key == null || key.KeyValue == 0 )
|
||||
if ( !(dropped is Key key) || key.KeyValue == 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 501689 ); // Only non-blank keys can be put on a keyring.
|
||||
return false;
|
||||
}
|
||||
else if ( this.Keys.Count >= MaxKeys )
|
||||
if ( this.Keys.Count >= MaxKeys )
|
||||
{
|
||||
from.SendLocalizedMessage( 1008138 ); // This keyring is full.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Add( key );
|
||||
from.SendLocalizedMessage( 501691 ); // You put the key on the keyring.
|
||||
return true;
|
||||
}
|
||||
|
||||
Add( key );
|
||||
from.SendLocalizedMessage( 501691 ); // You put the key on the keyring.
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
|
|
@ -84,10 +80,8 @@ namespace Server.Items
|
|||
m_KeyRing.Open( from );
|
||||
from.SendLocalizedMessage( 501685 ); // You open the keyring.
|
||||
}
|
||||
else if ( targeted is ILockable )
|
||||
else if ( targeted is ILockable o )
|
||||
{
|
||||
ILockable o = (ILockable) targeted;
|
||||
|
||||
foreach ( Key key in m_KeyRing.Keys )
|
||||
{
|
||||
if ( key.UseOn( from, o ) )
|
||||
|
|
@ -125,9 +119,7 @@ namespace Server.Items
|
|||
|
||||
public void Open( Mobile from )
|
||||
{
|
||||
Container cont = this.Parent as Container;
|
||||
|
||||
if ( cont == null )
|
||||
if ( !(this.Parent is Container cont) )
|
||||
return;
|
||||
|
||||
for ( int i = m_Keys.Count - 1; i >= 0; i-- )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue