Esempio n. 1
0
        public async Task SayCreateGame()
        {
            GvGGame CurrentGame = GameService.GetServerInstance(Context.Guild);

            if (CurrentGame.Status > GameStatus.GamePreparation)
            {
                await ReplyAsync("The Game has already started!");

                return;
            }
            if (CurrentGame.Status == GameStatus.GamePreparation)
            {
                await ReplyAsync("The Game has already been created!");

                return;
            }

            var pub_chan = Context.Guild.TextChannels.First((x) => x.Name == "public_gvg");
            var gua_chan = Context.Guild.TextChannels.First((x) => x.Name == "guardian");
            var gai_chan = Context.Guild.TextChannels.First((x) => x.Name == "gaia");
            var oc_chan  = Context.Guild.TextChannels.First((x) => x.Name == "occult_club");

            await GameService.GetServerInstance(Context.Guild)?
            .CreateGame(Context.User, Context.Guild,
                        pub_chan,
                        gua_chan,
                        gai_chan,
                        oc_chan);
        }
Esempio n. 2
0
        public async Task Patrol(
            [SummaryResx("PatrolDesc_RemainderSummary")]
            string patrolString,
            [Remainder, SummaryResx("PatrolDesc_ServerSummary")]
            string serverName = ""
            )
        {
            if (Context.Guild != null && GameService.ListOfGames.ContainsKey(Context.Guild.Id))
            {
                Game = GameService.GetServerInstance(Context.Guild);
            }
            else
            {
                Game = GameService.ListOfGames.First((x) => Context.Client.GetGuild(x.Key).Name.Contains(serverName)).Value;
                if (Game == null)
                {
                    await ReplyAsync("You aren't in a GvG Game.");

                    return;
                }
            }
            try
            {
                var translatedMove = Vector2D.Parse(patrolString);
                await ReplyAsync("", false, (await Game.PatrolQueue(await Game.GvG_Player.Guild.GetUserAsync(Context.User.Id), Context, translatedMove)).Build());
            } catch (FormatException e)
            {
                await ReplyAsync("", false, new EmbedBuilder()
                                 .WithTitle(ResultMessages.PatrolError)
                                 .WithDescription(ResultMessages.PatrolError_ParseError).Build());
            } catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Esempio n. 3
0
        public async Task ContinueGame()
        {
            GvGGame CurrentGame = GameService.GetServerInstance(Context.Guild);

            if (CurrentGame.Status == GameStatus.ActionPhase || CurrentGame.Status == GameStatus.IdlePhase)
            {
                await ReplyAsync("", false, CurrentGame.Continue(Context).Build());
            }
            else
            {
                await ReplyAsync("The Game isn't even running.");
            }
        }