Esempio n. 1
0
            public async Task IncomingPlayerBunnyMeatCollectingRequest()
            {
                if (CharactersData.GetCharacterCookingSkill(Context.User.Id) >= 5)
                {
                    //Checking commands
                    if (CharactersData.GetCharacterBunnyCarcass(Context.User.Id) < 1)
                    {
                        CookingEmbed.WithColor(Color.Blue);
                        CookingEmbed.AddField("<:Meat:607579880569307146>```You don't have enough bunny carcasses to collect meat from them!```", "```At least 1 bunny 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.GetCharacterBunnyCarcass(Context.User.Id); i >= 1; i -= 1)
                    {
                        ChanceToGetBonusMeat = random.Next(0, 10);
                        if (ChanceToGetBonusMeat > (7 - CharactersData.GetCharacterCookingSkill(Context.User.Id) / 12))
                        {
                            MeatToGive = random.Next(3, 6);
                        }
                        else
                        {
                            MeatToGive = random.Next(2, 4);
                        }
                        TotalMeatToGive      += MeatToGive;
                        TotalCarcassesToTook += 1;
                    }
                    CookingEmbed.AddField("<:Meat:607579880569307146>```Success!```", $"```You have received {TotalMeatToGive} units of bunny meat!```");
                    await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build());

                    //Save data
                    await CharactersData.SaveCharacterBunnyMeat(Context.User.Id, TotalMeatToGive, 0.3f / CharactersData.GetCharacterCookingSkill(Context.User.Id), TotalCarcassesToTook);;
                    return;
                }
                else
                {
                    CookingEmbed.WithColor(Color.Blue);
                    CookingEmbed.AddField($"<:Meat:607579880569307146>```Cooking skill comes with time, {CharactersData.GetCharacterName(Context.User.Id)}```",
                                          "```Required level of skill is: [5]\n" +
                                          $"Your current skill level is: [{CharactersData.GetCharacterCookingSkill(Context.User.Id)}]```");
                    await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build());

                    return;
                }
            }
Esempio 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;
            }
Esempio n. 3
0
            public async Task DisplayCharacterInfo(IUser User = null)
            {
                if (User == null)
                {
                    CharacterCreationEmbed.WithColor(Color.Blue);
                    CharacterCreationEmbed.AddField($"<:InfoBook:603974731535876106>```{Context.User}, your character info:```", $"```Name is: {CharactersData.GetCharacterName(Context.User.Id)}" +
                                                    $"\nGold: {CharactersData.GetCharacterMoney(Context.User.Id)}\n――――――――――Skills――――――――――\nMining:             |" +
                                                    $"{Math.Round(Convert.ToDouble(CharactersData.GetCharacterMiningSkill(Context.User.Id)),1)}\nWood chopping:      |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterWoodChoppingSkill(Context.User.Id)),1)}" +
                                                    $"\nHunting:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterHuntingSkill(Context.User.Id)),1)}\nFishing:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterFishingSkill(Context.User.Id)),1)}" +
                                                    $"\nFarming:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterFarmingSkill(Context.User.Id)),1)}\nTrade:              |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterTradeSkill(Context.User.Id)),1)}" +
                                                    $"\n――――――CraftingSkills―――――――\nOre melting:        |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterOreMeltingSkill(Context.User.Id)),1)}\nWoodworking:        |" +
                                                    $"{Math.Round(Convert.ToDouble(CharactersData.GetCharacterWoodworkingSkill(Context.User.Id)),1)}\nBlacksmith:         |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterBlacksmithSkill(Context.User.Id)),1)}" +
                                                    $"\nFurniture maker:    |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterFurnitureMakerSkill(Context.User.Id)),1)}\nCooking:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterCookingSkill(Context.User.Id)),1)}" +
                                                    $"\nSnipper:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterSnipperSkill(Context.User.Id)),1)}```");
                }
                else
                {
                    CharacterCreationEmbed.WithColor(Color.Blue);
                    CharacterCreationEmbed.AddField($"<:InfoBook:603974731535876106>```{User.Username}, your character info:```", $"```Name is: {CharactersData.GetCharacterName(User.Id)}" +
                                                    $"\nGold: {CharactersData.GetCharacterMoney(User.Id)}\n――――――――――Skills――――――――――\nMining:             |" +
                                                    $"{Math.Round(Convert.ToDouble(CharactersData.GetCharacterMiningSkill(User.Id)), 1)}\nWood chopping:      |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterWoodChoppingSkill(User.Id)), 1)}" +
                                                    $"\nHunting:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterHuntingSkill(User.Id)), 1)}\nFishing:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterFishingSkill(User.Id)), 1)}" +
                                                    $"\nFarming:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterFarmingSkill(User.Id)), 1)}\nTrade:              |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterTradeSkill(User.Id)), 1)}" +
                                                    $"\n――――――CraftingSkills―――――――\nOre melting:        |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterOreMeltingSkill(User.Id)), 1)}\nWoodworking:        |" +
                                                    $"{Math.Round(Convert.ToDouble(CharactersData.GetCharacterWoodworkingSkill(User.Id)), 1)}\nBlacksmith:         |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterBlacksmithSkill(User.Id)), 1)}" +
                                                    $"\nFurniture maker:    |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterFurnitureMakerSkill(User.Id)), 1)}\nCooking:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterCookingSkill(User.Id)), 1)}" +
                                                    $"\nSnipper:            |{Math.Round(Convert.ToDouble(CharactersData.GetCharacterSnipperSkill(User.Id)), 1)}```");
                }

                await Context.Channel.SendMessageAsync("", false, CharacterCreationEmbed.Build());
            }