Fixes string interpolation

This commit is contained in:
Kamron Batman 2018-09-14 13:07:43 -07:00
parent 42d0b6271f
commit 7d3a0ca265
233 changed files with 758 additions and 690 deletions

View file

@ -1141,7 +1141,7 @@ namespace Server.Factions
silver = killerState.Faction.AwardSilver( killer, award * 40 );
if ( silver > 0 )
killer.SendLocalizedMessage( 1042736, String.Format( "{0:N0} silver\t{1}", silver, victim.Name ) ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
killer.SendLocalizedMessage( 1042736, $"{silver:N0} silver\t{victim.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
}
victimState.KillPoints -= award;
@ -1149,7 +1149,7 @@ namespace Server.Factions
int offset = ( award != 1 ? 0 : 2 ); // for pluralization
string args = String.Format( "{0}\t{1}\t{2}", award, victim.Name, killer.Name );
string args = $"{award}\t{victim.Name}\t{killer.Name}";
killer.SendLocalizedMessage( 1042737 + offset, args ); // Thou hast been honored with ~1_KILL_POINTS~ kill point(s) for vanquishing ~2_DEAD_PLAYER~!
victim.SendLocalizedMessage( 1042738 + offset, args ); // Thou has lost ~1_KILL_POINTS~ kill point(s) to ~3_ATTACKER_NAME~ for being vanquished!

View file

@ -8,22 +8,22 @@ namespace Server.Factions
{
public string Right( string text )
{
return String.Format( "<DIV ALIGN=RIGHT>{0}</DIV>", text );
return $"<DIV ALIGN=RIGHT>{text}</DIV>";
}
public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
return $"<CENTER>{text}</CENTER>";
}
public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
public static string FormatTimeSpan( TimeSpan ts )
{
return String.Format( "{0:D2}:{1:D2}:{2:D2}:{3:D2}", ts.Days, ts.Hours % 24, ts.Minutes % 60, ts.Seconds % 60 );
return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
}
public const int LabelColor = 0xFFFFFF;

View file

@ -93,7 +93,7 @@ namespace Server.Factions
if ( from.Alive )
m_Placer.SendMessage( "You have earned {0} silver pieces because {1} fell for your trap.", silverGiven, from.Name );
else
m_Placer.SendLocalizedMessage( 1042736, String.Format( "{0} silver\t{1}", silverGiven, from.Name ) ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
m_Placer.SendLocalizedMessage( 1042736, $"{silverGiven} silver\t{@from.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
}
victimState.OnGivenSilverTo( m_Placer );

View file

@ -215,7 +215,7 @@ namespace Server.Factions
public int GetStatMod( Mobile mob, StatType type )
{
StatMod mod = mob.GetStatMod( String.Format( "[Magic] {0} Offset", type ) );
StatMod mod = mob.GetStatMod($"[Magic] {type} Offset");
if ( mod == null )
return 0;