Adds more formatting

This commit is contained in:
Kamron Batman 2018-08-19 21:28:24 +08:00
parent e77d695684
commit f674ec2be0
68 changed files with 530 additions and 876 deletions

View file

@ -27,7 +27,7 @@ namespace Server.Items
{
InvalidateProperties();
if ( m_Commodity == null && item is ICommodity && ((ICommodity)item).IsDeedable )
if ( m_Commodity == null && (item as ICommodity)?.IsDeedable == true )
{
m_Commodity = item;
m_Commodity.Internalize();
@ -35,10 +35,8 @@ namespace Server.Items
return true;
}
else
{
return false;
}
return false;
}
public override void Serialize( GenericWriter writer )
@ -109,7 +107,7 @@ namespace Server.Items
string args;
if ( m_Commodity.Name == null )
args = String.Format( "#{0}\t{1}", ( m_Commodity is ICommodity ) ? ((ICommodity)m_Commodity).DescriptionNumber : m_Commodity.LabelNumber, m_Commodity.Amount );
args = String.Format( "#{0}\t{1}", ( m_Commodity is ICommodity commodity ) ? commodity.DescriptionNumber : m_Commodity.LabelNumber, m_Commodity.Amount );
else
args = String.Format( "{0}\t{1}", m_Commodity.Name, m_Commodity.Amount );
@ -130,7 +128,7 @@ namespace Server.Items
string args;
if ( m_Commodity.Name == null )
args = String.Format( "#{0}\t{1}", ( m_Commodity is ICommodity ) ? ((ICommodity)m_Commodity).DescriptionNumber : m_Commodity.LabelNumber, m_Commodity.Amount );
args = String.Format( "#{0}\t{1}", ( m_Commodity is ICommodity commodity ) ? commodity.DescriptionNumber : m_Commodity.LabelNumber, m_Commodity.Amount );
else
args = String.Format( "{0}\t{1}", m_Commodity.Name, m_Commodity.Amount );
@ -228,16 +226,16 @@ namespace Server.Items
{
number = 1047028; // The commodity deed has already been filled.
}
else if ( targeted is Item )
else if ( targeted is Item item )
{
BankBox box = from.FindBankNoCreate();
CommodityDeedBox cox = CommodityDeedBox.Find( m_Deed );
// Veteran Rewards mods
if ( box != null && m_Deed.IsChildOf( box ) && ((Item)targeted).IsChildOf( box ) ||
cox != null && cox.IsSecure && ((Item)targeted).IsChildOf( cox ) )
if ( box != null && m_Deed.IsChildOf( box ) && item.IsChildOf( box ) ||
cox != null && cox.IsSecure && item.IsChildOf( cox ) )
{
if ( m_Deed.SetCommodity( (Item) targeted ) )
if ( m_Deed.SetCommodity( item ) )
{
m_Deed.Hue = 0x592;
number = 1047030; // The commodity deed has been filled.
@ -247,16 +245,13 @@ namespace Server.Items
number = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
}
}
else if ( Core.ML )
{
number = 1080526; // That must be in your bank box or commodity deed box to use it.
}
else
{
if ( Core.ML )
{
number = 1080526; // That must be in your bank box or commodity deed box to use it.
}
else
{
number = 1047026; // That must be in your bank box to use it.
}
number = 1047026; // That must be in your bank box to use it.
}
}
else