Fixes implicit ternary expressions
This commit is contained in:
parent
c85b0a740c
commit
ff26dfa375
345 changed files with 1905 additions and 2336 deletions
|
|
@ -112,11 +112,9 @@ namespace Server.Items
|
|||
|
||||
return allow;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
|
||||
return false;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
|
||||
|
|
@ -130,11 +128,9 @@ namespace Server.Items
|
|||
|
||||
return allow;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
|
||||
return false;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ namespace Server.Items
|
|||
|
||||
if ( ItemID == 0x232C )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
|
||||
else
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
@ -108,16 +107,12 @@ namespace Server.Items
|
|||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private class WreathAddonGump : Gump
|
||||
|
|
|
|||
|
|
@ -188,18 +188,16 @@ namespace Server.Items
|
|||
"This deed functions as a recall rune marked for the location of the plot it represents." +
|
||||
"</bodytextblack>";
|
||||
}
|
||||
else
|
||||
{
|
||||
int daysLeft = (int)Math.Ceiling( ( deed.Stone.Started + deed.Stone.Duration + HouseRaffleStone.ExpirationTime - DateTime.UtcNow ).TotalDays );
|
||||
|
||||
return "<bodytextblack>" + "This deed entitles the bearer to build a house on the plot of land " +
|
||||
$"located at {HouseRaffleStone.FormatLocation(deed.PlotLocation, deed.PlotFacet, false)} on the {deed.PlotFacet} facet.<br><br>" +
|
||||
$"The deed will expire after {daysLeft} more day{((daysLeft == 1) ? "" : "s")} have passed, and at that time the right to place " +
|
||||
"a house reverts to normal house construction rules.<br><br>" +
|
||||
"This deed functions as a recall rune marked for the location of the plot it represents.<br><br>" +
|
||||
"To place a house on the deeded plot, you must simply have this deed in your backpack " +
|
||||
"or bank box when using a House Placement Tool there." + "</bodytextblack>";
|
||||
}
|
||||
int daysLeft = (int)Math.Ceiling( ( deed.Stone.Started + deed.Stone.Duration + HouseRaffleStone.ExpirationTime - DateTime.UtcNow ).TotalDays );
|
||||
|
||||
return "<bodytextblack>" + "This deed entitles the bearer to build a house on the plot of land " +
|
||||
$"located at {HouseRaffleStone.FormatLocation(deed.PlotLocation, deed.PlotFacet, false)} on the {deed.PlotFacet} facet.<br><br>" +
|
||||
$"The deed will expire after {daysLeft} more day{((daysLeft == 1) ? "" : "s")} have passed, and at that time the right to place " +
|
||||
"a house reverts to normal house construction rules.<br><br>" +
|
||||
"This deed functions as a recall rune marked for the location of the plot it represents.<br><br>" +
|
||||
"To place a house on the deeded plot, you must simply have this deed in your backpack " +
|
||||
"or bank box when using a House Placement Tool there." + "</bodytextblack>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,17 +241,16 @@ namespace Server.Gumps
|
|||
|
||||
if ( xIsNull && yIsNull )
|
||||
return 0;
|
||||
else if ( xIsNull )
|
||||
if ( xIsNull )
|
||||
return -1;
|
||||
else if ( yIsNull )
|
||||
if ( yIsNull )
|
||||
return 1;
|
||||
|
||||
int result = Insensitive.Compare( x.From.Name, y.From.Name );
|
||||
|
||||
if ( result == 0 )
|
||||
return x.Date.CompareTo( y.Date );
|
||||
else
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -270,9 +269,9 @@ namespace Server.Gumps
|
|||
|
||||
if ( xIsNull && yIsNull )
|
||||
return 0;
|
||||
else if ( xIsNull )
|
||||
if ( xIsNull )
|
||||
return -1;
|
||||
else if ( yIsNull )
|
||||
if ( yIsNull )
|
||||
return 1;
|
||||
|
||||
Account a = x.From.Account as Account;
|
||||
|
|
@ -280,17 +279,16 @@ namespace Server.Gumps
|
|||
|
||||
if ( a == null && b == null )
|
||||
return 0;
|
||||
else if ( a == null )
|
||||
if ( a == null )
|
||||
return -1;
|
||||
else if ( b == null )
|
||||
if ( b == null )
|
||||
return 1;
|
||||
|
||||
int result = Insensitive.Compare( a.Username, b.Username );
|
||||
|
||||
if ( result == 0 )
|
||||
return x.Date.CompareTo( y.Date );
|
||||
else
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -309,9 +307,9 @@ namespace Server.Gumps
|
|||
|
||||
if ( xIsNull && yIsNull )
|
||||
return 0;
|
||||
else if ( xIsNull )
|
||||
if ( xIsNull )
|
||||
return -1;
|
||||
else if ( yIsNull )
|
||||
if ( yIsNull )
|
||||
return 1;
|
||||
|
||||
byte[] a = x.Address.GetAddressBytes();
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ namespace Server.Items
|
|||
{
|
||||
int x = m_Bounds.X + m_Bounds.Width / 2;
|
||||
int y = m_Bounds.Y + m_Bounds.Height / 2;
|
||||
int z = ( m_Facet == null ) ? 0 : m_Facet.GetAverageZ( x, y );
|
||||
int z = m_Facet?.GetAverageZ( x, y ) ?? 0;
|
||||
|
||||
return new Point3D( x, y, z );
|
||||
}
|
||||
|
|
@ -379,8 +379,7 @@ namespace Server.Items
|
|||
{
|
||||
if ( m_TicketPrice == 0 )
|
||||
return "FREE";
|
||||
else
|
||||
return $"{m_TicketPrice} gold";
|
||||
return $"{m_TicketPrice} gold";
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace Server.Items
|
|||
for ( int i = 0; i < pack.Items.Count; i++ )
|
||||
{
|
||||
if ( pack.Items[ i ] is PlagueBeastMainOrgan main && main.Complete )
|
||||
main.FinishOpening( @from );
|
||||
main.FinishOpening( from );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ namespace Server.Items
|
|||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071897 ); // You carefully cut into the organ.
|
||||
return true;
|
||||
}
|
||||
else
|
||||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071898 ); // You have already cut this organ open.
|
||||
|
||||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071898 ); // You have already cut this organ open.
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -378,7 +378,8 @@ namespace Server.Items
|
|||
AddComponent( new PlagueBeastBlood(), 47, 72 );
|
||||
return true;
|
||||
}
|
||||
else if ( c.IsGland )
|
||||
|
||||
if ( c.IsGland )
|
||||
{
|
||||
m_Gland = null;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ namespace Server.Items
|
|||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071899 ); // You begin cutting through the vein.
|
||||
return true;
|
||||
}
|
||||
else
|
||||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071900 ); // // This vein has already been cut.
|
||||
|
||||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071900 ); // // This vein has already been cut.
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -162,52 +162,53 @@ namespace Server.Items
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) )
|
||||
|
||||
if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return false;
|
||||
}
|
||||
else if ( Account != null && ( !(from.Account is Account) || from.Account.Username != Account ) )
|
||||
if ( Account != null && ( !(from.Account is Account) || from.Account.Username != Account ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070714 ); // This is an Account Bound Soulstone, and your character is not bound to it. You cannot use this Soulstone.
|
||||
return false;
|
||||
}
|
||||
else if ( CheckCombat( from, TimeSpan.FromMinutes( 2.0 ) ) )
|
||||
if ( CheckCombat( from, TimeSpan.FromMinutes( 2.0 ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070727 ); // You must wait two minutes after engaging in combat before you can use a Soulstone.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Criminal )
|
||||
if ( from.Criminal )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070728 ); // You must wait two minutes after committing a criminal act before you can use a Soulstone.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Region.GetLogoutDelay( from ) > TimeSpan.Zero )
|
||||
if ( from.Region.GetLogoutDelay( from ) > TimeSpan.Zero )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070729 ); // In order to use your Soulstone, you must be in a safe log-out location.
|
||||
return false;
|
||||
}
|
||||
else if ( !from.Alive )
|
||||
if ( !from.Alive )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070730 ); // You may not use a Soulstone while your character is dead.
|
||||
return false;
|
||||
}
|
||||
else if ( Factions.Sigil.ExistsOn( from ) )
|
||||
if ( Factions.Sigil.ExistsOn( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070731 ); // You may not use a Soulstone while your character has a faction town sigil.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Spell != null && from.Spell.IsCasting )
|
||||
if ( from.Spell != null && from.Spell.IsCasting )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070733 ); // You may not use a Soulstone while your character is casting a spell.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Poisoned )
|
||||
if ( from.Poisoned )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070734 ); // You may not use a Soulstone while your character is poisoned.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Paralyzed )
|
||||
if ( from.Paralyzed )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070735 ); // You may not use a Soulstone while your character is paralyzed.
|
||||
return false;
|
||||
|
|
@ -221,10 +222,7 @@ namespace Server.Items
|
|||
}
|
||||
#endregion
|
||||
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
|
|
|
|||
|
|
@ -60,8 +60,7 @@ namespace Server.Items
|
|||
|
||||
if ( index >= 0 && index < table.Length )
|
||||
return table[index].Name.ToLower();
|
||||
else
|
||||
return "???";
|
||||
return "???";
|
||||
}
|
||||
|
||||
public virtual bool CanUse( Mobile from )
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Server.Items
|
|||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(m_LabelNumber, $"{((m_To != null) ? m_To : Unsigned)}\t{((m_From != null) ? m_From : Unsigned)}");
|
||||
list.Add(m_LabelNumber, $"{m_To ?? Unsigned}\t{m_From ?? Unsigned}");
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
|
|
@ -54,7 +54,7 @@ namespace Server.Items
|
|||
base.OnSingleClick( from );
|
||||
|
||||
LabelTo( from, m_LabelNumber,
|
||||
$"{((m_To != null) ? m_To : Unsigned)}\t{((m_From != null) ? m_From : Unsigned)}");
|
||||
$"{m_To ?? Unsigned}\t{m_From ?? Unsigned}");
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -104,8 +104,7 @@ namespace Server.Items
|
|||
|
||||
if ( FacingSouth )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
|
||||
else
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -172,9 +172,9 @@ namespace Server.Items
|
|||
{
|
||||
if ( keg.Type == PotionEffect.ExplosionLesser )
|
||||
return 5;
|
||||
else if ( keg.Type == PotionEffect.Explosion )
|
||||
if ( keg.Type == PotionEffect.Explosion )
|
||||
return 10;
|
||||
else if ( keg.Type == PotionEffect.ExplosionGreater )
|
||||
if ( keg.Type == PotionEffect.ExplosionGreater )
|
||||
return 15;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,8 +107,7 @@ namespace Server.Items
|
|||
|
||||
if ( FacingSouth )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
|
||||
else
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ namespace Server.Items
|
|||
|
||||
if ( Type == StoneFaceTrapType.NorthWestWall )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ) && BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // north and west wall
|
||||
else if ( Type == StoneFaceTrapType.NorthWall )
|
||||
if ( Type == StoneFaceTrapType.NorthWall )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
|
||||
else if ( Type == StoneFaceTrapType.WestWall )
|
||||
if ( Type == StoneFaceTrapType.WestWall )
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -109,8 +109,7 @@ namespace Server.Items
|
|||
|
||||
if ( FacingSouth )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
|
||||
else
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ namespace Server.Items
|
|||
|
||||
public static WeaponEngravingTool Find( Mobile from )
|
||||
{
|
||||
return @from.Backpack?.FindItemByType( typeof( WeaponEngravingTool ) ) as WeaponEngravingTool;
|
||||
return from.Backpack?.FindItemByType( typeof( WeaponEngravingTool ) ) as WeaponEngravingTool;
|
||||
}
|
||||
|
||||
private class TargetWeapon : Target
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue