public async Task NextRound(CommandContext ctx) { if (BotInfoHandler.pairsReady == false) { await NextPairs(ctx); //await ctx.RespondAsync(embed: new DiscordEmbedBuilder { // Title = "Pairs Not Assigned", // Description = "Type >nextpairs to be able to proceed to the next round.", // Color = DiscordColor.Red //}).ConfigureAwait(false); //return; } BotInfoHandler.gameHandler.currentRound++; BotInfoHandler.shopsSent = false; BotInfoHandler.pairsReady = false; for (int i = 0; i < BotInfoHandler.UIMessages.Count(); i++) { BotInfoHandler.UIMessages[i] = null; } GameHandlerMethods.NextRound(BotInfoHandler.gameHandler); await Task.Delay(3000); await ctx.RespondAsync(embed : new DiscordEmbedBuilder { Title = "New Round Started", Color = DiscordColor.Green }).ConfigureAwait(false); //await Task.Delay(1000); //await BotInfoHandler.RefreshPlayerList(ctx); await Task.Delay(1000); await SendShops(ctx); await Task.Delay(1000); await CreateInteractivePlayerlist(ctx); }
public async Task Fight(CommandContext ctx, [Description("Player 1")] int pl1, [Description("Player 2")] int pl2) { //should make this send an embed if (pl1 < 1 || pl1 > BotInfoHandler.participantsDiscordIds.Count()) { return; } if (pl2 < 1 || pl2 > BotInfoHandler.participantsDiscordIds.Count()) { return; } //if (pl1 == pl2) return; pl1--; pl2--; if (BotInfoHandler.gameHandler.players[pl1].lives <= 0) { return; } if (BotInfoHandler.gameHandler.players[pl2].lives <= 0) { return; } GameHandlerMethods.StartBattle(BotInfoHandler.gameHandler, pl1, pl2); var fightMessage = new DiscordEmbedBuilder { Title = $"Combat! {BotInfoHandler.gameHandler.players[pl1].name} vs {BotInfoHandler.gameHandler.players[pl2].name}", Color = DiscordColor.Gold }; string msg = string.Empty; for (int i = 0; i < BotInfoHandler.gameHandler.combatOutputCollector.introductionHeader1.Count(); i++) { msg = msg + BotInfoHandler.gameHandler.combatOutputCollector.introductionHeader1[i] + "\n"; } fightMessage.AddField($"{BotInfoHandler.gameHandler.players[pl1].name} upgraded with:", msg, true); msg = string.Empty; for (int i = 0; i < BotInfoHandler.gameHandler.combatOutputCollector.introductionHeader2.Count(); i++) { msg = msg + BotInfoHandler.gameHandler.combatOutputCollector.introductionHeader2[i] + "\n"; } fightMessage.AddField($"{BotInfoHandler.gameHandler.players[pl2].name} upgraded with:", msg, true); //msg = string.Empty; //for (int i = 0; i < BotInfoHandler.gameHandler.combatOutputCollector.statsHeader.Count(); i++) //{ // msg = msg + BotInfoHandler.gameHandler.combatOutputCollector.statsHeader[i] + "\n"; //} //fightMessage.AddField("[Stats]", msg); msg = string.Empty; for (int i = 0; i < BotInfoHandler.gameHandler.combatOutputCollector.preCombatHeader.Count(); i++) { msg = msg + BotInfoHandler.gameHandler.combatOutputCollector.preCombatHeader[i] + "\n"; } fightMessage.AddField("[Pre-Combat]", msg); msg = string.Empty; for (int i = 0; i < BotInfoHandler.gameHandler.combatOutputCollector.combatHeader.Count(); i++) { msg = msg + BotInfoHandler.gameHandler.combatOutputCollector.combatHeader[i] + "\n"; } fightMessage.AddField("[Combat]", msg); await ctx.RespondAsync(embed : fightMessage).ConfigureAwait(false); }