Fixes implicit ternary expressions

This commit is contained in:
Kamron Batman 2018-09-14 14:56:48 -07:00
parent c85b0a740c
commit ff26dfa375
345 changed files with 1905 additions and 2336 deletions

View file

@ -247,76 +247,74 @@ namespace Server.Items
from.SendLocalizedMessage( 1054005 ); // The bracelet glows black. It must be charged before it can be used again.
return false;
}
else if ( from.FindItemOnLayer( Layer.Bracelet ) != this )
if ( from.FindItemOnLayer( Layer.Bracelet ) != this )
{
from.SendLocalizedMessage( 1054004 ); // You must equip the bracelet in order to use its power.
return false;
}
else if ( boundRoot?.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
if ( boundRoot?.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
{
from.SendLocalizedMessage( 1054006 ); // The bracelet emits a red glow. The bracelet's twin is not available for transport.
return false;
}
else if ( !Core.AOS && from.Map != boundRoot.Map )
if ( !Core.AOS && from.Map != boundRoot.Map )
{
from.SendLocalizedMessage( 1054014 ); // The bracelet glows black. The bracelet's target is on another facet.
return false;
}
else if ( Factions.Sigil.ExistsOn( from ) )
if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
else if ( !SpellHelper.CheckTravel( from, TravelCheckType.RecallFrom ) )
if ( !SpellHelper.CheckTravel( from, TravelCheckType.RecallFrom ) )
{
return false;
}
else if ( !SpellHelper.CheckTravel( from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo ) )
if ( !SpellHelper.CheckTravel( from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo ) )
{
return false;
}
else if ( boundRoot.Map == Map.Felucca && from is PlayerMobile mobile && mobile.Young )
if ( boundRoot.Map == Map.Felucca && from is PlayerMobile mobile && mobile.Young )
{
mobile.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
return false;
}
else if ( from.Kills >= 5 && boundRoot.Map != Map.Felucca )
if ( from.Kills >= 5 && boundRoot.Map != Map.Felucca )
{
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
return false;
}
else if ( from.Criminal )
if ( from.Criminal )
{
from.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( SpellHelper.CheckCombat( from ) )
if ( SpellHelper.CheckCombat( from ) )
{
from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( Misc.WeightOverloading.IsOverloaded( from ) )
if ( Misc.WeightOverloading.IsOverloaded( from ) )
{
from.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
else if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1114345, "", 0x35 ); // You'll need a better jailbreak plan than that!
return false;
}
else if ( boundRoot.Region.IsPartOf( typeof( Regions.Jail ) ) )
if ( boundRoot.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
return false;
}
else
{
if ( successMessage )
from.SendLocalizedMessage( 1054015 ); // The bracelet's twin is available for transport.
if ( successMessage )
from.SendLocalizedMessage( 1054015 ); // The bracelet's twin is available for transport.
return true;
}
return true;
}
public void Bind( Mobile from )