Exemple #1
0
        public static async Task HunterDeath()
        {
            var hunter  = Global.Game.PersonnagesList.Find(p => p.GetType() == typeof(Hunter));
            var message = await hunter.ChannelT.SendMessageAsync(Global.Game.Texts.GameRoles.HunterDeathQuestion);


            foreach (var emoji in (await Global.Game.Guild.GetEmojisAsync()).ToList()
                     .FindAll(emo => emo.Id != hunter.Emoji.Id))
            {
                await message.CreateReactionAsync(emoji);
            }

            await Task.Delay(Global.Config.DayVoteTime);

            var target = (await BotCommands.GetVotes(message)).Voted();
            await Global.Game.Kill(target);

            var embed = new DiscordEmbedBuilder
            {
                Title =
                    $"{hunter.Me.Username} {Global.Game.Texts.Annoucement.PublicHunterMessage} {target.Username}",
                Color = Color.DeadColor
            };
            await Global.Game.DiscordChannels[GameChannel.TownText].SendMessageAsync(embed: embed.Build());
        }
Exemple #2
0
        public static async Task WolfVote()
        {
            Global.Game.NightTargets = new List <Personnage>();
            var embed = new DiscordEmbedBuilder
            {
                Color = Color.PollColor,
                Title = Global.Game.Texts.Annoucement.NightlyWolfMessage
            };

            var msg = await Global.Game.DiscordChannels[GameChannel.WolfText].SendMessageAsync(embed: embed.Build());

            foreach (var personnage in Global.Game.PersonnagesList.FindAll(p => p.GetType() != typeof(Wolf) && p.Alive))
            {
                await msg.CreateReactionAsync(personnage.Emoji);
            }

            await Task.Delay(Global.Config.DayVoteTime);

            var targetMember = (await BotCommands.GetVotes(msg)).Voted();

            if (targetMember != null)
            {
                var targetPersonnage = Global.Game.PersonnagesList.Find(p => p.Me == targetMember);
                Global.Game.NightTargets.Add(targetPersonnage);
            }
            else
            {
                embed = new DiscordEmbedBuilder
                {
                    Color = Color.InfoColor,
                    Title = Global.Game.Texts.Polls.NoWolfKill
                };
                await Global.Game.DiscordChannels[GameChannel.WolfText].SendMessageAsync(embed: embed.Build());
            }
        }