public async Task IncomingPlayerDuckFeathersCollectRequest()
            {
                //Checking commands
                if (CharactersData.GetCharacterDuckCarcass(Context.User.Id) < 1)
                {
                    LeatherEmbed.WithColor(Color.Blue);
                    LeatherEmbed.AddField("<:Knife:607575664987734026>```You don't have enough duck carcasses to collect feathers from them!```", "```At least 1 duck carcass required!```");
                    await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build());

                    return;
                }
                //Execution of command
                LeatherEmbed.WithColor(Color.Blue);
                int TotalFeathersToGive = 0, TotalCarcassesToTook = 0, ChanceToGetBonusFeathers, FeathersToGive;

                for (int i = CharactersData.GetCharacterDuckCarcass(Context.User.Id); i >= 1; i -= 1)
                {
                    ChanceToGetBonusFeathers = random.Next(0, 10);
                    if (ChanceToGetBonusFeathers > (7 - CharactersData.GetCharacterHuntingSkill(Context.User.Id) / 10))
                    {
                        FeathersToGive = random.Next(3, 6);
                    }
                    else
                    {
                        FeathersToGive = random.Next(2, 4);
                    }
                    TotalFeathersToGive  += FeathersToGive;
                    TotalCarcassesToTook += 1;
                }
                LeatherEmbed.AddField("<:Knife:607575664987734026>```Success!```", $"```You have received {TotalFeathersToGive} duck feathers!```");
                await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build());

                //Save data
                if (CharactersData.GetCharacterHuntingSkill(Context.User.Id) <= 2)
                {
                    await CharactersData.SaveCharacterDuckFeathers(Context.User.Id, TotalFeathersToGive, 0.3f, TotalCarcassesToTook);
                }
                else
                {
                    await CharactersData.SaveCharacterDuckFeathers(Context.User.Id, TotalFeathersToGive, 0.3f / CharactersData.GetCharacterHuntingSkill(Context.User.Id), TotalCarcassesToTook);;
                }
                return;
            }
Exemplo n.º 2
0
            public async Task IncomingPlayerDuckMeatCollectRequest()
            {
                //Checking commands
                if (CharactersData.GetCharacterDuckCarcass(Context.User.Id) < 1)
                {
                    CookingEmbed.WithColor(Color.Blue);
                    CookingEmbed.AddField("<:Meat:607579880569307146>```You don't have enough duck carcasses to collect meat from them!```", "```At least 1 duck carcass required!```");
                    await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build());

                    return;
                }
                //Execution of command
                CookingEmbed.WithColor(Color.Blue);
                int TotalMeatToGive = 0, TotalCarcassesToTook = 0, ChanceToGetBonusMeat, MeatToGive;

                for (int i = CharactersData.GetCharacterDuckCarcass(Context.User.Id); i >= 1; i -= 1)
                {
                    ChanceToGetBonusMeat = random.Next(0, 10);
                    if (ChanceToGetBonusMeat > (7 - CharactersData.GetCharacterCookingSkill(Context.User.Id) / 10))
                    {
                        MeatToGive = random.Next(3, 6);
                    }
                    else
                    {
                        MeatToGive = random.Next(2, 4);
                    }
                    TotalMeatToGive      += MeatToGive;
                    TotalCarcassesToTook += 1;
                }
                CookingEmbed.AddField("<:Meat:607579880569307146>```Success!```", $"```You have received {TotalMeatToGive} duck meat!```");
                await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build());

                //Save data
                if (CharactersData.GetCharacterHuntingSkill(Context.User.Id) <= 2)
                {
                    await CharactersData.SaveCharacterDuckMeat(Context.User.Id, TotalMeatToGive, 0.3f, TotalCarcassesToTook);
                }
                else
                {
                    await CharactersData.SaveCharacterDuckMeat(Context.User.Id, TotalMeatToGive, 0.3f / CharactersData.GetCharacterCookingSkill(Context.User.Id), TotalCarcassesToTook);;
                }
                return;
            }