Fixes string interpolation
This commit is contained in:
parent
42d0b6271f
commit
7d3a0ca265
233 changed files with 758 additions and 690 deletions
|
|
@ -15,12 +15,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
|
|
|
|||
|
|
@ -248,12 +248,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
|
|
|
|||
|
|
@ -459,7 +459,8 @@ namespace Server.Engines.ConPVP
|
|||
pl.Eliminated = true;
|
||||
|
||||
mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have forfeited your position in the duel." );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has forfeited by leaving the dueling arena.", mob.Name ) );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false,
|
||||
$"{mob.Name} has forfeited by leaving the dueling arena.");
|
||||
|
||||
Participant winner = CheckCompletion();
|
||||
|
||||
|
|
@ -498,7 +499,7 @@ namespace Server.Engines.ConPVP
|
|||
else if ( !m_Yielding )
|
||||
{
|
||||
mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have been defeated." );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has been defeated.", mob.Name ) );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, $"{mob.Name} has been defeated.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1176,7 +1177,8 @@ namespace Server.Engines.ConPVP
|
|||
if ( entry == null )
|
||||
return; // sanity
|
||||
|
||||
string text = String.Format( "{{0}} are ranked {0} at level {1}.", LadderGump.Rank( entry.Index + 1 ), Ladder.GetLevel( entry.Experience ) );
|
||||
string text =
|
||||
$"{{0}} are ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
|
||||
|
||||
pm.PrivateOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, from==pm?"You":"They" ), from.NetState );
|
||||
}
|
||||
|
|
@ -1267,7 +1269,8 @@ namespace Server.Engines.ConPVP
|
|||
if ( entry == null )
|
||||
return; // sanity
|
||||
|
||||
string text = String.Format( "{{0}} {{1}} ranked {0} at level {1}.", LadderGump.Rank( entry.Index + 1 ), Ladder.GetLevel( entry.Experience ) );
|
||||
string text =
|
||||
$"{{0}} {{1}} ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
|
||||
|
||||
pm.LocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, "You", "are" ) );
|
||||
pm.NonlocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, pm.Name, "is" ) );
|
||||
|
|
@ -1474,7 +1477,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
pm.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have yielded." );
|
||||
pm.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has yielded.", pm.Name ) );
|
||||
pm.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, $"{pm.Name} has yielded.");
|
||||
|
||||
pm.DuelContext.m_Yielding=true;
|
||||
pm.Kill();
|
||||
|
|
@ -2325,21 +2328,21 @@ namespace Server.Engines.ConPVP
|
|||
return "a slot is empty";
|
||||
|
||||
if ( dp.Mobile.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
return String.Format( "{0} is in jail", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is in jail";
|
||||
|
||||
if ( Sigil.ExistsOn( dp.Mobile ) )
|
||||
return String.Format( "{0} is holding a sigil", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is holding a sigil";
|
||||
|
||||
if ( !dp.Mobile.Alive )
|
||||
{
|
||||
if ( m_Tournament == null )
|
||||
return String.Format( "{0} is dead", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is dead";
|
||||
else
|
||||
dp.Mobile.Resurrect();
|
||||
}
|
||||
|
||||
if ( m_Tournament == null && CheckCombat( dp.Mobile ) )
|
||||
return String.Format( "{0} is in combat", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is in combat";
|
||||
|
||||
if ( dp.Mobile.Mounted )
|
||||
{
|
||||
|
|
@ -2348,7 +2351,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Tournament != null && mount != null )
|
||||
mount.Rider = null;
|
||||
else
|
||||
return String.Format( "{0} is mounted", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is mounted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
|
|||
|
|
@ -991,12 +991,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -1137,7 +1137,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1}", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor );
|
||||
|
||||
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
|
||||
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
|
||||
|
|
@ -1266,7 +1266,7 @@ namespace Server.Engines.ConPVP
|
|||
return res;
|
||||
}
|
||||
|
||||
public string Name => String.Format( "{0} Team", m_Name );
|
||||
public string Name => $"{m_Name} Team";
|
||||
|
||||
public BRGame Game { get => m_Game;
|
||||
set => m_Game = value;
|
||||
|
|
@ -1399,7 +1399,7 @@ namespace Server.Engines.ConPVP
|
|||
public override string ToString()
|
||||
{
|
||||
if ( m_Name != null )
|
||||
return String.Format( "({0}) ...", Name );
|
||||
return $"({Name}) ...";
|
||||
else
|
||||
return "...";
|
||||
}
|
||||
|
|
@ -1848,7 +1848,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( pl == leader )
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format( "{0}, {1} team", item.Name, ((BRTeamInfo)teams[i]).Name.ToLower() );
|
||||
item.Name = $"{item.Name}, {((BRTeamInfo) teams[i]).Name.ToLower()} team";
|
||||
|
||||
if ( !mob.PlaceInBackpack( item ) )
|
||||
mob.BankBox.DropItem( item );
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -199,7 +199,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1} Team", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name} Team", nameColor, borderColor );
|
||||
|
||||
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
|
||||
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
|
||||
|
|
@ -451,7 +451,8 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
else if ( passTeam == useTeam && passTo.PlaceInBackpack( this ) )
|
||||
{
|
||||
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false, String.Format( "{0} has passed you the cookies!", from.Name ) );
|
||||
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false,
|
||||
$"{@from.Name} has passed you the cookies!");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -605,7 +606,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private Dictionary<Mobile, CTFPlayerInfo> m_Players;
|
||||
|
||||
string IRankedCTF.Name => String.Format( "{0} Team", m_Name );
|
||||
string IRankedCTF.Name => $"{m_Name} Team";
|
||||
|
||||
public CTFGame Game { get => m_Game;
|
||||
set => m_Game = value;
|
||||
|
|
@ -1231,7 +1232,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( pl == leader )
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format( "{0}, {1} team", item.Name, teams[i].Name.ToLower() );
|
||||
item.Name = $"{item.Name}, {teams[i].Name.ToLower()} team";
|
||||
|
||||
if ( !mob.PlaceInBackpack( item ) )
|
||||
mob.BankBox.DropItem( item );
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -195,7 +195,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1}", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor );
|
||||
|
||||
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
|
||||
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
|
||||
|
|
@ -297,7 +297,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private Dictionary<Mobile, DDPlayerInfo> m_Players;
|
||||
|
||||
public string Name => String.Format( "{0} Team", m_Name );
|
||||
public string Name => $"{m_Name} Team";
|
||||
|
||||
public DDGame Game { get => m_Game;
|
||||
set => m_Game = value;
|
||||
|
|
@ -840,7 +840,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( pl == leader )
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format( "{0}, {1} team", item.Name, ((DDTeamInfo)teams[i]).Name.ToLower() );
|
||||
item.Name = $"{item.Name}, {((DDTeamInfo) teams[i]).Name.ToLower()} team";
|
||||
|
||||
if ( !mob.PlaceInBackpack( item ) )
|
||||
mob.BankBox.DropItem( item );
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ namespace Server.Engines.ConPVP
|
|||
m_KingTimer.StartHillTicker();
|
||||
|
||||
if (m_King.Name != null)
|
||||
PublicOverheadMessage(MessageType.Regular, 0x0481, false, String.Format("Taken by {0}!", m_King.Name));
|
||||
PublicOverheadMessage(MessageType.Regular, 0x0481, false, $"Taken by {m_King.Name}!");
|
||||
}
|
||||
|
||||
private class KingTimer : Timer
|
||||
|
|
@ -365,12 +365,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
|
|
@ -490,7 +490,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText(60, 65 + (i * 75), 250, 20, String.Format("{0}: {1}", LadderGump.Rank(1 + i), teamInfo.Name), nameColor, borderColor);
|
||||
AddBorderedText(60, 65 + (i * 75), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor);
|
||||
|
||||
AddBorderedText(50 + 10, 85 + (i * 75), 100, 20, "Score:", 0xFFC000, BlackColor32);
|
||||
AddBorderedText(50 + 15, 105 + (i * 75), 100, 20, teamInfo.Score.ToString("N0"), 0xFFC000, BlackColor32);
|
||||
|
|
@ -627,7 +627,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Name == null)
|
||||
return "(null) Team";
|
||||
return String.Format("{0} Team", m_Name);
|
||||
return $"{m_Name} Team";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -730,7 +730,7 @@ namespace Server.Engines.ConPVP
|
|||
public override string ToString()
|
||||
{
|
||||
if (m_Name != null)
|
||||
return String.Format("({0}) ...", Name);
|
||||
return $"({Name}) ...";
|
||||
else
|
||||
return "...";
|
||||
}
|
||||
|
|
@ -1216,7 +1216,7 @@ namespace Server.Engines.ConPVP
|
|||
if (pl == leader)
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format("{0}, {1}", item.Name, ((KHTeamInfo)teams[i]).Name.ToLower());
|
||||
item.Name = $"{item.Name}, {((KHTeamInfo) teams[i]).Name.ToLower()}";
|
||||
|
||||
if (!mob.PlaceInBackpack(item))
|
||||
mob.BankBox.DropItem(item);
|
||||
|
|
|
|||
|
|
@ -219,12 +219,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
@ -64,7 +64,7 @@ namespace Server.Engines.ConPVP
|
|||
int x = 35;
|
||||
int y = 47;
|
||||
|
||||
AddHtml( x, y, 200, 20, String.Format( "Team Size: {0}", p.Players.Length ), false, false ); y += 22;
|
||||
AddHtml( x, y, 200, 20, $"Team Size: {p.Players.Length}", false, false ); y += 22;
|
||||
|
||||
AddGoldenButtonLabeled( x + 20, y, 1, "Increase" ); y += 22;
|
||||
AddGoldenButtonLabeled( x + 20, y, 2, "Decrease" ); y += 30;
|
||||
|
|
@ -75,7 +75,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
DuelPlayer pl = p.Players[i];
|
||||
|
||||
AddGoldenButtonLabeled( x, y, 5 + i, String.Format( "{0}: {1}", 1 + i, pl == null ? "Empty" : pl.Mobile.Name ) ); y += 22;
|
||||
AddGoldenButtonLabeled( x, y, 5 + i, $"{1 + i}: {(pl == null ? "Empty" : pl.Mobile.Name)}"); y += 22;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public PickRulesetGump( Mobile from, DuelContext context, Ruleset ruleset ) : base( 50, 50 )
|
||||
|
|
|
|||
|
|
@ -265,12 +265,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public ReadyGump( Mobile from, DuelContext context, int count ) : base( 50, 50 )
|
||||
|
|
@ -72,7 +72,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if ( p.Players.Length > 1 )
|
||||
{
|
||||
AddHtml( 35 + 14, y, 176, 20, String.Format( "Participant #{0}", i + 1 ), false, false );
|
||||
AddHtml( 35 + 14, y, 176, 20, $"Participant #{i + 1}", false, false );
|
||||
y += 22;
|
||||
offset = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
@ -82,7 +82,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if ( p.Players.Length > 1 )
|
||||
{
|
||||
AddHtml( 35, y, 176, 20, String.Format( "Team #{0}", i + 1 ), false, false );
|
||||
AddHtml( 35, y, 176, 20, $"Team #{i + 1}", false, false );
|
||||
y += 22;
|
||||
offset = 10;
|
||||
}
|
||||
|
|
@ -152,12 +152,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
AddHtml( 35, 25, 190, 20, Center( "Rules" ), false, false );
|
||||
|
||||
AddHtml( 35, 50, 190, 20, String.Format( "Set: {0}", basedef.Title ), false, false );
|
||||
AddHtml( 35, 50, 190, 20, $"Set: {basedef.Title}", false, false );
|
||||
|
||||
y = 70;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddHtml( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", false, false );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ namespace Server.Engines.ConPVP
|
|||
if ( tourny.HasParticipant( m ) )
|
||||
return;
|
||||
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x35, false, String.Format( "Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord" ), m.NetState );
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x35, false,
|
||||
$"Hello m'{(m.Female ? "Lady" : "Lord")}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.NetState );
|
||||
m.BeginAction( this );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerStateCallback( ReleaseLock_Callback ), m );
|
||||
}
|
||||
|
|
@ -299,12 +300,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -450,7 +451,7 @@ namespace Server.Engines.ConPVP
|
|||
case GroupingType.Random: groupText = "Random"; break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Grouping: {groupText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string tieText = null;
|
||||
|
|
@ -464,22 +465,22 @@ namespace Server.Engines.ConPVP
|
|||
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string sdText = "Off";
|
||||
|
||||
if ( tourny.SuddenDeath > TimeSpan.Zero )
|
||||
{
|
||||
sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
|
||||
sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
|
||||
|
||||
if ( tourny.SuddenDeathRounds > 0 )
|
||||
sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
|
||||
sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
|
||||
else
|
||||
sdText = String.Format( "{0} (all rounds)", sdText );
|
||||
sdText = $"{sdText} (all rounds)";
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
y += 6;
|
||||
|
|
@ -487,11 +488,11 @@ namespace Server.Engines.ConPVP
|
|||
AddImageTiled( 42, y+1, 264, 1, 9157 );
|
||||
y += 6;
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Ruleset: {basedef.Title}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32 );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
@ -642,7 +643,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( "{0} has not yet proven themselves a worthy dueler.", mob.Name ), from.NetState );
|
||||
0x35, false, $"{mob.Name} has not yet proven themselves a worthy dueler.", from.NetState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -669,7 +670,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( "{0} has already entered this tournament.", mob.Name ), from.NetState );
|
||||
0x35, false, $"{mob.Name} has already entered this tournament.", from.NetState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -686,7 +687,8 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( "{0} is already assigned to a duel. They must yield it before joining this tournament.", mobile.Name ), from.NetState );
|
||||
0x35, false,
|
||||
$"{mobile.Name} is already assigned to a duel. They must yield it before joining this tournament.", from.NetState );
|
||||
}
|
||||
|
||||
m_From.SendGump( new ConfirmSignupGump( m_From, m_Registrar, m_Tournament, m_Players ) );
|
||||
|
|
@ -711,7 +713,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( minutesUntil == 0 )
|
||||
timeUntil = "momentarily";
|
||||
else
|
||||
timeUntil = String.Format( "in {0} minute{1}", minutesUntil, minutesUntil == 1 ? "" : "s" );
|
||||
timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}";
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( fmt, from.Female ? "Lady" : "Lord", timeUntil ), from.NetState );
|
||||
|
|
@ -822,7 +824,8 @@ namespace Server.Engines.ConPVP
|
|||
mob.SendGump( new AcceptTeamGump( from, mob, m_Tournament, m_Registrar, m_Players ) );
|
||||
|
||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x59, false, String.Format( "As you command m'{0}. I've given your offer to {1}.", from.Female ? "Lady" : "Lord", mob.Name ), from.NetState );
|
||||
0x59, false,
|
||||
$"As you command m'{(@from.Female ? "Lady" : "Lord")}. I've given your offer to {mob.Name}.", from.NetState );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -843,12 +846,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -965,7 +968,7 @@ namespace Server.Engines.ConPVP
|
|||
AddBorderedText( 22, 22, 294, 20, Center( sb.ToString() ), LabelColor32, BlackColor32 );
|
||||
|
||||
AddBorderedText( 22, 50, 294, 40,
|
||||
String.Format( "You have been asked to partner with {0} in a tournament. Do you accept?", from.Name ),
|
||||
$"You have been asked to partner with {@from.Name} in a tournament. Do you accept?",
|
||||
0xB0C868, BlackColor32 );
|
||||
|
||||
AddImageTiled( 32, 88, 264, 1, 9107 );
|
||||
|
|
@ -983,7 +986,7 @@ namespace Server.Engines.ConPVP
|
|||
case GroupingType.Random: groupText = "Random"; break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Grouping: {groupText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string tieText = null;
|
||||
|
|
@ -997,22 +1000,22 @@ namespace Server.Engines.ConPVP
|
|||
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string sdText = "Off";
|
||||
|
||||
if ( tourny.SuddenDeath > TimeSpan.Zero )
|
||||
{
|
||||
sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
|
||||
sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
|
||||
|
||||
if ( tourny.SuddenDeathRounds > 0 )
|
||||
sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
|
||||
sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
|
||||
else
|
||||
sdText = String.Format( "{0} (all rounds)", sdText );
|
||||
sdText = $"{sdText} (all rounds)";
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
y += 6;
|
||||
|
|
@ -1020,11 +1023,11 @@ namespace Server.Engines.ConPVP
|
|||
AddImageTiled( 42, y+1, 264, 1, 9157 );
|
||||
y += 6;
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Ruleset: {basedef.Title}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32 );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
@ -1092,10 +1095,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Registrar != null )
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "{0} seems unresponsive.", m_Requested.Name ), m_From.NetState );
|
||||
0x22, false, $"{m_Requested.Name} seems unresponsive.", m_From.NetState );
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "You have declined the partnership with {0}.", m_From.Name ), m_Requested.NetState );
|
||||
0x22, false, $"You have declined the partnership with {m_From.Name}.", m_Requested.NetState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1158,10 +1161,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Registrar != null )
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x59, false, String.Format( "{0} has accepted your offer of partnership.", mob.Name ), from.NetState );
|
||||
0x59, false, $"{mob.Name} has accepted your offer of partnership.", from.NetState );
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x59, false, String.Format( "You have accepted the partnership with {0}.", from.Name ), mob.NetState );
|
||||
0x59, false, $"You have accepted the partnership with {@from.Name}.", mob.NetState );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1175,10 +1178,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Registrar != null )
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "{0} has declined your offer of partnership.", mob.Name ), from.NetState );
|
||||
0x22, false, $"{mob.Name} has declined your offer of partnership.", from.NetState );
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "You have declined the partnership with {0}.", from.Name ), mob.NetState );
|
||||
0x22, false, $"You have declined the partnership with {@from.Name}.", mob.NetState );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2041,9 +2044,11 @@ namespace Server.Engines.ConPVP
|
|||
try
|
||||
{
|
||||
if ( m_EventController != null )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", m_EventController.GetTeamName( ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) ) ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {m_EventController.GetTeamName(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner))} has won!");
|
||||
else if ( m_TournyType == TournyType.RandomTeam )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
else if ( m_TournyType == TournyType.Faction ) {
|
||||
if ( m_ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -2069,21 +2074,25 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", name ) );
|
||||
Alert( "The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
else if ( m_ParticipantsPerMatch == 2 )
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Evil" : "Hero" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"The {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
}
|
||||
}
|
||||
else if ( m_TournyType == TournyType.RedVsBlue )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Red" : "Blue" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
|
||||
else
|
||||
Alert( "The tournament has completed!", String.Format( "{0} {1} the champion{2}.", winner.NameList, winner.Players.Count > 1 ? "are" : "is", winner.Players.Count == 1 ? "" : "s" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -2155,9 +2164,11 @@ namespace Server.Engines.ConPVP
|
|||
try
|
||||
{
|
||||
if ( m_EventController != null )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won", m_EventController.GetTeamName( ( (TournyMatch) ( (PyramidLevel) m_Pyramid.Levels[0] ).Matches[0] ).Participants.IndexOf( winner ) ) ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {m_EventController.GetTeamName(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner))} has won");
|
||||
else if ( m_TournyType == TournyType.RandomTeam )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
else if ( m_TournyType == TournyType.Faction ) {
|
||||
if ( m_ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -2183,21 +2194,25 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", name ) );
|
||||
Alert( "The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
else if ( m_ParticipantsPerMatch == 2 )
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Evil" : "Hero" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"The {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
}
|
||||
}
|
||||
else if ( m_TournyType == TournyType.RedVsBlue )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Red" : "Blue" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
|
||||
else
|
||||
Alert( "The tournament has completed!", String.Format( "{0} {1} the champion{2}.", winner.NameList, winner.Players.Count > 1 ? "are" : "is", winner.Players.Count == 1 ? "" : "s" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -2733,12 +2748,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -2882,11 +2897,12 @@ namespace Server.Engines.ConPVP
|
|||
secs %= 60;
|
||||
|
||||
if ( mins > 0 && secs > 0 )
|
||||
text = String.Format( "The tournament will begin in {0} minute{1} and {2} second{3}.", mins, mins==1?"":"s", secs, secs==1?"":"s" );
|
||||
text =
|
||||
$"The tournament will begin in {mins} minute{(mins == 1 ? "" : "s")} and {secs} second{(secs == 1 ? "" : "s")}.";
|
||||
else if ( mins > 0 )
|
||||
text = String.Format( "The tournament will begin in {0} minute{1}.", mins, mins==1?"":"s" );
|
||||
text = $"The tournament will begin in {mins} minute{(mins == 1 ? "" : "s")}.";
|
||||
else if ( secs > 0 )
|
||||
text = String.Format( "The tournament will begin in {0} second{1}.", secs, secs==1?"":"s" );
|
||||
text = $"The tournament will begin in {secs} second{(secs == 1 ? "" : "s")}.";
|
||||
else
|
||||
text = "The tournament will begin shortly.";
|
||||
}
|
||||
|
|
@ -2950,7 +2966,7 @@ namespace Server.Engines.ConPVP
|
|||
case GroupingType.Random: groupText = "Random"; break;
|
||||
}
|
||||
|
||||
AddHtml( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $"Grouping: {groupText}", false, false );
|
||||
y += 20;
|
||||
|
||||
string tieText = null;
|
||||
|
|
@ -2964,31 +2980,31 @@ namespace Server.Engines.ConPVP
|
|||
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
|
||||
}
|
||||
|
||||
AddHtml( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $"Tiebreaker: {tieText}", false, false );
|
||||
y += 20;
|
||||
|
||||
string sdText = "Off";
|
||||
|
||||
if ( tourny.SuddenDeath > TimeSpan.Zero )
|
||||
{
|
||||
sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
|
||||
sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
|
||||
|
||||
if ( tourny.SuddenDeathRounds > 0 )
|
||||
sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
|
||||
sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
|
||||
else
|
||||
sdText = String.Format( "{0} (all rounds)", sdText );
|
||||
sdText = $"{sdText} (all rounds)";
|
||||
}
|
||||
|
||||
AddHtml( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), false, false );
|
||||
AddHtml( 35, y, 240, 20, $"Sudden Death: {sdText}", false, false );
|
||||
y += 20;
|
||||
|
||||
y += 8;
|
||||
|
||||
AddHtml( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $"Ruleset: {basedef.Title}", false, false );
|
||||
y += 20;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddHtml( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", false, false );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
@ -3030,7 +3046,7 @@ namespace Server.Engines.ConPVP
|
|||
m_List = new ArrayList( tourny.Participants );
|
||||
|
||||
AddLeftArrow( 25, 11, ToButtonID( 0, 0 ) );
|
||||
AddHtml( 25, 35, 250, 20, Center( String.Format( "{0} Participant{1}", m_List.Count, m_List.Count == 1 ? "" : "s" ) ), false, false );
|
||||
AddHtml( 25, 35, 250, 20, Center($"{m_List.Count} Participant{(m_List.Count == 1 ? "" : "s")}"), false, false );
|
||||
|
||||
int index, count, y;
|
||||
StartPage( out index, out count, out y, 12 );
|
||||
|
|
@ -3082,7 +3098,8 @@ namespace Server.Engines.ConPVP
|
|||
y += 18;
|
||||
}
|
||||
|
||||
AddHtml( 25, y, 200, 20, String.Format( "Free Advances: {0}", part.FreeAdvances == 0 ? "None" : part.FreeAdvances.ToString() ), false, false );
|
||||
AddHtml( 25, y, 200, 20,
|
||||
$"Free Advances: {(part.FreeAdvances == 0 ? "None" : part.FreeAdvances.ToString())}", false, false );
|
||||
y += 20;
|
||||
|
||||
AddHtml( 25, y, 200, 20, "Log:", false, false );
|
||||
|
|
@ -3119,12 +3136,13 @@ namespace Server.Engines.ConPVP
|
|||
Ladder ladder = Ladder.Instance;
|
||||
LadderEntry entry = ladder?.Find( mob );
|
||||
|
||||
AddHtml( 25, 53, 250, 20, String.Format( "Name: {0}", mob.Name ), false, false );
|
||||
AddHtml( 25, 73, 250, 20, String.Format( "Guild: {0}", mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]" ), false, false );
|
||||
AddHtml( 25, 93, 250, 20, String.Format( "Rank: {0}", entry == null ? "N/A" : LadderGump.Rank( entry.Index + 1 ) ), false, false );
|
||||
AddHtml( 25, 113, 250, 20, String.Format( "Level: {0}", entry == null ? 0 : Ladder.GetLevel( entry.Experience ) ), false, false );
|
||||
AddHtml( 25, 133, 250, 20, String.Format( "Wins: {0:N0}", entry == null ? 0 : entry.Wins ), false, false );
|
||||
AddHtml( 25, 153, 250, 20, String.Format( "Losses: {0:N0}", entry == null ? 0 : entry.Losses ), false, false );
|
||||
AddHtml( 25, 53, 250, 20, $"Name: {mob.Name}", false, false );
|
||||
AddHtml( 25, 73, 250, 20,
|
||||
$"Guild: {(mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]")}", false, false );
|
||||
AddHtml( 25, 93, 250, 20, $"Rank: {(entry == null ? "N/A" : LadderGump.Rank(entry.Index + 1))}", false, false );
|
||||
AddHtml( 25, 113, 250, 20, $"Level: {(entry == null ? 0 : Ladder.GetLevel(entry.Experience))}", false, false );
|
||||
AddHtml( 25, 133, 250, 20, $"Wins: {(entry == null ? 0 : entry.Wins):N0}", false, false );
|
||||
AddHtml( 25, 153, 250, 20, $"Losses: {(entry == null ? 0 : entry.Losses):N0}", false, false );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -3165,9 +3183,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_List == null )
|
||||
m_List = new ArrayList( level.Matches );
|
||||
|
||||
AddRightArrow( 25, 53, ToButtonID( 5, 0 ), String.Format( "Free Advance: {0}", level.FreeAdvance == null ? "None" : level.FreeAdvance.NameList ) );
|
||||
AddRightArrow( 25, 53, ToButtonID( 5, 0 ),
|
||||
$"Free Advance: {(level.FreeAdvance == null ? "None" : level.FreeAdvance.NameList)}");
|
||||
|
||||
AddHtml( 25, 73, 200, 20, String.Format( "{0} Match{1}", m_List.Count, m_List.Count == 1 ? "" : "es" ), false, false );
|
||||
AddHtml( 25, 73, 200, 20, $"{m_List.Count} Match{(m_List.Count == 1 ? "" : "es")}", false, false );
|
||||
|
||||
int index, count, y;
|
||||
StartPage( out index, out count, out y, 10 );
|
||||
|
|
@ -3214,9 +3233,9 @@ namespace Server.Engines.ConPVP
|
|||
string txt;
|
||||
|
||||
if ( m_Tournament.EventController != null )
|
||||
txt = String.Format( "Team {0} ({1})", m_Tournament.EventController.GetTeamName( j ), part.Players.Count );
|
||||
txt = $"Team {m_Tournament.EventController.GetTeamName(j)} ({part.Players.Count})";
|
||||
else if ( m_Tournament.TournyType == TournyType.RandomTeam )
|
||||
txt = String.Format( "Team {0} ({1})", j + 1, part.Players.Count );
|
||||
txt = $"Team {j + 1} ({part.Players.Count})";
|
||||
else if ( m_Tournament.TournyType == TournyType.Faction ) {
|
||||
if ( m_Tournament.ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -3242,19 +3261,19 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
txt = String.Format( "{0} ({1})", name, part.Players.Count );
|
||||
txt = $"{name} ({part.Players.Count})";
|
||||
}
|
||||
else if ( m_Tournament.ParticipantsPerMatch == 2 )
|
||||
{
|
||||
txt = String.Format( "{0} Team ({1})", j==0?"Evil":"Hero", part.Players.Count );
|
||||
txt = $"{(j == 0 ? "Evil" : "Hero")} Team ({part.Players.Count})";
|
||||
}
|
||||
else
|
||||
{
|
||||
txt = String.Format( "Team {0} ({1})", j + 1, part.Players.Count );
|
||||
txt = $"Team {j + 1} ({part.Players.Count})";
|
||||
}
|
||||
}
|
||||
else
|
||||
txt = String.Format( "Team {0} ({1})", j == 0 ? "Red" : "Blue", part.Players.Count );
|
||||
txt = $"Team {(j == 0 ? "Red" : "Blue")} ({part.Players.Count})";
|
||||
|
||||
if ( color == -1 && match.Context != null && match.Winner == part )
|
||||
txt = Color( txt, 0x336633 );
|
||||
|
|
@ -3292,8 +3311,9 @@ namespace Server.Engines.ConPVP
|
|||
AddLeftArrow( 25, 11, ToButtonID( 0, 5 ) );
|
||||
AddHtml( 25, 35, 250, 20, Center( "Rounds" ), false, false );
|
||||
|
||||
AddHtml( 25, 53, 250, 20, String.Format( "Winner: {0}", match.Winner == null ? "N/A" : match.Winner.NameList ), false, false );
|
||||
AddHtml( 25, 73, 250, 20, String.Format( "State: {0}", match.InProgress ? "In progress" : match.Context != null ? "Complete" : "Waiting" ), false, false );
|
||||
AddHtml( 25, 53, 250, 20, $"Winner: {(match.Winner == null ? "N/A" : match.Winner.NameList)}", false, false );
|
||||
AddHtml( 25, 73, 250, 20,
|
||||
$"State: {(match.InProgress ? "In progress" : match.Context != null ? "Complete" : "Waiting")}", false, false );
|
||||
AddHtml( 25, 93, 250, 20, "Participants:", false, false );
|
||||
|
||||
if ( m_Tournament.TournyType == TournyType.Standard )
|
||||
|
|
@ -3312,9 +3332,11 @@ namespace Server.Engines.ConPVP
|
|||
TournyParticipant part = (TournyParticipant)match.Participants[i];
|
||||
|
||||
if ( m_Tournament.EventController != null )
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", m_Tournament.EventController.GetTeamName( i ), part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {m_Tournament.EventController.GetTeamName(i)} ({part.Players.Count})");
|
||||
else if ( m_Tournament.TournyType == TournyType.RandomTeam )
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i+1, part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {i + 1} ({part.Players.Count})");
|
||||
else if ( m_Tournament.TournyType == TournyType.Faction ) {
|
||||
if ( m_Tournament.ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -3340,19 +3362,23 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "{0} ({1})", name, part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"{name} ({part.Players.Count})");
|
||||
}
|
||||
else if ( m_Tournament.ParticipantsPerMatch == 2 )
|
||||
{
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "{0} Team ({1})", i==0?"Evil":"Hero", part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"{(i == 0 ? "Evil" : "Hero")} Team ({part.Players.Count})");
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i+1, part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {i + 1} ({part.Players.Count})");
|
||||
}
|
||||
}
|
||||
else
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i==0?"Red":"Blue", part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {(i == 0 ? "Red" : "Blue")} ({part.Players.Count})");
|
||||
}
|
||||
}
|
||||
else if ( m_Tournament.TournyType == TournyType.FreeForAll )
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ namespace Server.Items
|
|||
|
||||
public void UpdateStyle()
|
||||
{
|
||||
Name = String.Format( "{0} trophy", m_Rank.ToString().ToLower() );
|
||||
Name = $"{m_Rank.ToString().ToLower()} trophy";
|
||||
|
||||
switch ( m_Rank )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue