Fixes string interpolation
This commit is contained in:
parent
42d0b6271f
commit
7d3a0ca265
233 changed files with 758 additions and 690 deletions
|
|
@ -69,11 +69,11 @@ namespace Server.Items
|
|||
int minutes = totalSeconds / 60;
|
||||
|
||||
if ( minutes != 0 && seconds != 0 )
|
||||
return String.Format( "{0} minute{1} and {2} second{3}", minutes, minutes==1?"":"s", seconds, seconds==1?"":"s" );
|
||||
return $"{minutes} minute{(minutes == 1 ? "" : "s")} and {seconds} second{(seconds == 1 ? "" : "s")}";
|
||||
else if ( minutes != 0 )
|
||||
return String.Format( "{0} minute{1}", minutes, minutes==1?"":"s" );
|
||||
return $"{minutes} minute{(minutes == 1 ? "" : "s")}";
|
||||
else
|
||||
return String.Format( "{0} second{1}", seconds, seconds==1?"":"s" );
|
||||
return $"{seconds} second{(seconds == 1 ? "" : "s")}";
|
||||
}
|
||||
|
||||
public virtual void Cleanup()
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ namespace Server.Items
|
|||
if ( !Active )
|
||||
return;
|
||||
|
||||
string text = String.Format( "{0} says {1}", from.Name, message );
|
||||
string text = $"{@from.Name} says {message}";
|
||||
|
||||
if ( RootParent is Mobile mobile )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ namespace Server.Items
|
|||
to.Send( new UnicodeMessage( Serial, ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!" ) );
|
||||
to.BoltEffect( 0 );
|
||||
to.LocalOverheadMessage( MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *" );
|
||||
to.NonlocalOverheadMessage( MessageType.Regular, 0xC9, true, string.Format( "* {0} spasms from electric shock *", to.Name ) );
|
||||
to.NonlocalOverheadMessage( MessageType.Regular, 0xC9, true, $"* {to.Name} spasms from electric shock *");
|
||||
|
||||
AOS.Damage( to, to, 60, 0, 0, 0, 0, 100 );
|
||||
|
||||
|
|
@ -485,7 +485,8 @@ namespace Server.Items
|
|||
m_To.PlaySound( 0x28 );
|
||||
|
||||
m_To.LocalOverheadMessage( MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *" );
|
||||
m_To.NonlocalOverheadMessage( MessageType.Regular, 0xC9, true, string.Format( "* {0} spasms from electric shock *", m_To.Name ) );
|
||||
m_To.NonlocalOverheadMessage( MessageType.Regular, 0xC9, true,
|
||||
$"* {m_To.Name} spasms from electric shock *");
|
||||
|
||||
AOS.Damage( m_To, m_To, 20, 0, 0, 0, 0, 100 );
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace Server.Items
|
|||
if ( weight <= 0.0 )
|
||||
message += "It is lighter than a feather.";
|
||||
else
|
||||
message += String.Format( "It weighs {0} stones.", weight );
|
||||
message += $"It weighs {weight} stones.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -615,16 +615,16 @@ namespace Server.Items
|
|||
if (ts.TotalHours >= 1)
|
||||
{
|
||||
int h = (int)Math.Round(ts.TotalHours);
|
||||
return String.Format("{0} hour{1}", h, (h == 1) ? "" : "s");
|
||||
return $"{h} hour{((h == 1) ? "" : "s")}";
|
||||
}
|
||||
else if (ts.TotalMinutes >= 1)
|
||||
{
|
||||
int m = (int)Math.Round(ts.TotalMinutes);
|
||||
return String.Format("{0} minute{1}", m, (m == 1) ? "" : "s");
|
||||
return $"{m} minute{((m == 1) ? "" : "s")}";
|
||||
}
|
||||
|
||||
int s = Math.Max((int)Math.Round(ts.TotalSeconds), 0);
|
||||
return String.Format("{0} second{1}", s, (s == 1) ? "" : "s");
|
||||
return $"{s} second{((s == 1) ? "" : "s")}";
|
||||
}
|
||||
|
||||
private void EndLock(Mobile m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue