Exemple #1
0
        public async Task EventRequest(string Date, string time, [Remainder] string eventInfo)
        {
            if (!RoleCheck.HasClerkRole((SocketGuildUser)Context.User) || !RoleCheck.HasTownMemberRole((SocketGuildUser)Context.User))
            {
                await Context.Channel.SendMessageAsync("**ERROR 404** You lack the role to use this command.");

                return;
            }
            var embed = new EmbedBuilder();

            embed.WithTitle("Event Request")
            .AddField("Who:", Context.User.Mention)
            .AddField("For:", eventInfo)
            .AddField("Date:", eventInfo)
            .AddField("Time:", time);
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Exemple #2
0
        public async Task RequestMeeting(string topic, string when, string length)
        {
            if (!RoleCheck.HasClerkRole((SocketGuildUser)Context.User) || !RoleCheck.HasTownMemberRole((SocketGuildUser)Context.User))
            {
                await Context.Channel.SendMessageAsync("**ERROR 404** You lack the role to use this command.");

                return;
            }
            var embed = new EmbedBuilder();

            embed.WithTitle("Meeting Request:")
            .AddField("Who:", Context.User.Mention)
            .AddField("Topic:", topic)
            .AddField("When:", when)
            .AddField("Length:", length);
            var requestChannel = Global.Client.GetGuild(Config.bot.guildID).GetTextChannel(ChannelIds.channels.requestID);
            await requestChannel.SendMessageAsync("", false, embed.Build());
        }
Exemple #3
0
        public async Task RequestChannel(string channelName, string startDate, string endDate)
        {
            if (!RoleCheck.HasClerkRole((SocketGuildUser)Context.User))
            {
                await Context.Channel.SendMessageAsync("**ERROR 404** You lack the role to use this command.");

                return;
            }
            var embed = new EmbedBuilder();

            embed.WithTitle("Voice Channel Request:")
            .AddField("Who:", Context.User.Mention)
            .AddField("Channel name:", channelName)
            .AddField("Start date:", startDate)
            .AddField("Expected end dated:", endDate);
            var requestChannel = Global.Client.GetGuild(Config.bot.guildID).GetTextChannel(ChannelIds.channels.requestID);
            await requestChannel.SendMessageAsync("", false, embed.Build());
        }
Exemple #4
0
        public async Task HuntCommand()
        {
            Console.WriteLine("Searching for prey." + Context.User.Username + " The Hunt Search command was used.");
            if (!RoleCheck.HasClerkRole((SocketGuildUser)Context.User))
            {
                await ReplyAsync(RoleWarning);

                return;
            }
            var user        = GameUserAccounts.GetAccount(Context.User.Id);
            var interaction = interactionChance.Next(1, 3);

            if (interaction == 3)
            {
                await Context.Channel.SendMessageAsync($"{Context.User} failed to find anything.");

                return;
            }
            MonsterInfo huntingResult;
            Random      xpGained = new Random();
            float       xp       = (float)xpGained.Next(1, 20) * 0.9251f;


            var embed = new EmbedBuilder();


            if (interaction == 1 || interaction == 2)
            {
                string monster = "null", mHP = "null", pHP = "null";
                if (user.HuntingLevel.ToString() == "Noob")
                {
                    Console.WriteLine("In Noob if statment");
                    huntingResult = HuntLogic.HuntingLogic(user, 0);
                    monster       = huntingResult.MonsterName;
                    mHP           = huntingResult.MonsterHP.ToString();
                    pHP           = user.PlayerHp.ToString();
                    embed.WithTitle("Hunting Results")
                    .AddField("Monster:", monster)
                    .AddField("Monster HP:", mHP)
                    .AddField("Player HP:", pHP)
                    .AddField("XP gained:", xp);
                    mHP = huntingResult.MonsterHP.ToString();
                    pHP = user.PlayerHp.ToString();
                    await Context.Channel.SendMessageAsync(Context.User.ToString(), false, embed.Build());

                    user.PlayerHp     = user.PlayerMaxHp;
                    user.HuntingXP   += xp;
                    user.AttributeXP += xp;
                    GameUserAccounts.SaveAccounts();
                }
                else if (user.HuntingLevel.ToString() == "Novice")
                {
                    huntingResult = HuntLogic.HuntingLogic(user, 1);
                    monster       = huntingResult.MonsterName;
                    mHP           = huntingResult.MonsterHP.ToString();
                    pHP           = user.PlayerHp.ToString();
                    embed.WithTitle("Hunting Results")
                    .AddField("Monster:", monster)
                    .AddField("Monster HP:", mHP)
                    .AddField("Player HP:", pHP)
                    .AddField("XP gained:", xp);
                    mHP = huntingResult.MonsterHP.ToString();
                    pHP = user.PlayerHp.ToString();
                    await Context.Channel.SendMessageAsync(Context.User.ToString(), false, embed.Build());

                    user.PlayerHp     = user.PlayerMaxHp;
                    user.HuntingXP   += xp;
                    user.AttributeXP += xp;
                    GameUserAccounts.SaveAccounts();
                }
                else if (user.HuntingLevel.ToString() == "Intermediate")
                {
                    huntingResult = HuntLogic.HuntingLogic(user, 2);
                    monster       = huntingResult.MonsterName;
                    mHP           = huntingResult.MonsterHP.ToString();
                    pHP           = user.PlayerHp.ToString();
                    embed.WithTitle("Hunting Results")
                    .AddField("Monster:", monster)
                    .AddField("Monster HP:", mHP)
                    .AddField("Player HP:", pHP)
                    .AddField("XP gained:", xp);
                    mHP = huntingResult.MonsterHP.ToString();
                    pHP = user.PlayerHp.ToString();
                    await Context.Channel.SendMessageAsync(Context.User.ToString(), false, embed.Build());

                    user.PlayerHp     = user.PlayerMaxHp;
                    user.HuntingXP   += xp;
                    user.AttributeXP += xp;
                    GameUserAccounts.SaveAccounts();
                }
                else if (user.HuntingLevel.ToString() == "Master")
                {
                    huntingResult = HuntLogic.HuntingLogic(user, 3);
                    monster       = huntingResult.MonsterName;
                    mHP           = huntingResult.MonsterHP.ToString();
                    pHP           = user.PlayerHp.ToString();
                    embed.WithTitle("Hunting Results")
                    .AddField("Monster:", monster)
                    .AddField("Monster HP:", mHP)
                    .AddField("Player HP:", pHP)
                    .AddField("XP gained:", xp);
                    mHP = huntingResult.MonsterHP.ToString();
                    pHP = user.PlayerHp.ToString();
                    await Context.Channel.SendMessageAsync(Context.User.ToString(), false, embed.Build());

                    user.PlayerHp     = user.PlayerMaxHp;
                    user.HuntingXP   += xp;
                    user.AttributeXP += xp;
                    GameUserAccounts.SaveAccounts();
                }
                else if (user.HuntingLevel.ToString() == "GrandMaster")
                {
                    huntingResult = HuntLogic.HuntingLogic(user, 4);
                    monster       = huntingResult.MonsterName;
                    mHP           = huntingResult.MonsterHP.ToString();
                    pHP           = user.PlayerHp.ToString();
                    embed.WithTitle("Hunting Results")
                    .AddField("Monster:", monster)
                    .AddField("Monster HP:", mHP)
                    .AddField("Player HP:", pHP)
                    .AddField("XP gained:", xp);
                    mHP = huntingResult.MonsterHP.ToString();
                    pHP = user.PlayerHp.ToString();
                    await Context.Channel.SendMessageAsync(Context.User.ToString(), false, embed.Build());

                    user.PlayerHp     = user.PlayerMaxHp;
                    user.HuntingXP   += xp;
                    user.AttributeXP += xp;
                    GameUserAccounts.SaveAccounts();
                }
                else if (user.HuntingLevel.ToString() == "Phoenix")
                {
                    huntingResult = HuntLogic.HuntingLogic(user, 5);
                    monster       = huntingResult.MonsterName;
                    mHP           = huntingResult.MonsterHP.ToString();
                    pHP           = user.PlayerHp.ToString();
                    embed.WithTitle("Hunting Results")
                    .AddField("Monster:", monster)
                    .AddField("Monster HP:", mHP)
                    .AddField("Player HP:", pHP)
                    .AddField("XP gained:", xp);
                    mHP = huntingResult.MonsterHP.ToString();
                    pHP = user.PlayerHp.ToString();
                    await Context.Channel.SendMessageAsync(Context.User.ToString(), false, embed.Build());

                    user.PlayerHp     = user.PlayerMaxHp;
                    user.HuntingXP   += xp;
                    user.AttributeXP += xp;
                    GameUserAccounts.SaveAccounts();
                }
                else
                {
                    // Failed hunt (precaution for future updates)
                    await Context.Channel.SendMessageAsync("You found nothing");
                }
            }
        }