Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 • committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -433,7 +433,7 @@ namespace Server.Engines.ConPVP
if (Pyramid.Levels.Count < 1)
break;
PyramidLevel top = Pyramid.Levels[^1];
PyramidLevel top = Pyramid.Levels[Pyramid.Levels.Count - 1];
if (top.FreeAdvance != null || top.Matches.Count != 1)
break;
@ -451,7 +451,7 @@ namespace Server.Engines.ConPVP
if (Pyramid.Levels.Count < 2)
break;
PyramidLevel top = Pyramid.Levels[^1];
PyramidLevel top = Pyramid.Levels[Pyramid.Levels.Count - 1];
if (top.FreeAdvance != null || top.Matches.Count != 1)
break;
@ -471,7 +471,7 @@ namespace Server.Engines.ConPVP
GiveAwards(part.Players, TrophyRank.Silver, cash / 2);
}
PyramidLevel next = Pyramid.Levels[^2];
PyramidLevel next = Pyramid.Levels[Pyramid.Levels.Count - 2];
if (next.Matches.Count > 2)
break;
@ -495,7 +495,7 @@ namespace Server.Engines.ConPVP
}
}
private void GiveAwards(IReadOnlyList<Mobile> players, TrophyRank rank, int cash)
private void GiveAwards(List<Mobile> players, TrophyRank rank, int cash)
{
if (players.Count == 0)
return;
@ -663,39 +663,69 @@ namespace Server.Engines.ConPVP
try
{
if (EventController != null)
{
Alert("The tournament has completed!",
$"Team {EventController.GetTeamName(Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner))} has won!");
}
else if (TourneyType == TourneyType.RandomTeam)
{
Alert("The tournament has completed!",
$"Team {Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) + 1} has won!");
}
else if (TourneyType == TourneyType.Faction)
{
if (m_ParticipantsPerMatch == 4)
{
string name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
string name = "(null)";
switch (Pyramid.Levels[0].Matches[0].Participants.IndexOf(
winner))
{
0 => "Minax",
1 => "Council of Mages",
2 => "True Britannians",
3 => "Shadowlords",
_ => "(null)"
};
case 0:
{
name = "Minax";
break;
}
case 1:
{
name = "Council of Mages";
break;
}
case 2:
{
name = "True Britannians";
break;
}
case 3:
{
name = "Shadowlords";
break;
}
}
Alert("The tournament has completed!", $"The {name} team has won!");
}
else if (m_ParticipantsPerMatch == 2)
{
Alert("The tournament has completed!",
$"The {(Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
}
else
{
Alert("The tournament has completed!",
$"Team {Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) + 1} has won!");
}
}
else if (TourneyType == TourneyType.RedVsBlue)
{
Alert("The tournament has completed!",
$"Team {(Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
}
else
{
Alert("The tournament has completed!",
$"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
}
}
catch
{
@ -709,7 +739,7 @@ namespace Server.Engines.ConPVP
}
else if (Pyramid.Levels.Count > 0)
{
PyramidLevel activeLevel = Pyramid.Levels[^1];
PyramidLevel activeLevel = Pyramid.Levels[Pyramid.Levels.Count - 1];
bool stillGoing = false;
for (int i = 0; i < activeLevel.Matches.Count; ++i)
@ -816,6 +846,7 @@ namespace Server.Engines.ConPVP
$"The {(Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
}
else
{
Alert("The tournament has completed!",
$"Team {Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) + 1} has won!");
}