public async Task IncomingPlayerFoxLeatherCollectingRequest() { if (CharactersData.GetCharacterHuntingSkill(Context.User.Id) >= 10) { //Checking commands if (CharactersData.GetCharacterFoxCarcass(Context.User.Id) < 1) { LeatherEmbed.WithColor(Color.Blue); LeatherEmbed.AddField("<:Knife:607575664987734026>```You don't have enough fox carcasses to collect leather from them!```", "```At least 1 fox carcass required```"); await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build()); return; } //Execution of command LeatherEmbed.WithColor(Color.Blue); int TotalLeatherToGive = 0, TotalCarcassesToTook = 0, ChanceToGetBonusLeather, LeatherToGive; for (int i = CharactersData.GetCharacterFoxCarcass(Context.User.Id); i >= 1; i -= 1) { ChanceToGetBonusLeather = random.Next(0, 10); if (ChanceToGetBonusLeather > (7 - CharactersData.GetCharacterHuntingSkill(Context.User.Id) / 14)) { LeatherToGive = random.Next(3, 4); } else { LeatherToGive = random.Next(1, 2); } TotalLeatherToGive += LeatherToGive; TotalCarcassesToTook += 1; } LeatherEmbed.AddField("<:Knife:607575664987734026>```Success!```", $"```You have received {TotalLeatherToGive} units of fox leather!```"); await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build()); //Save data await CharactersData.SaveCharacterFoxLeather(Context.User.Id, TotalLeatherToGive, 0.3f / CharactersData.GetCharacterHuntingSkill(Context.User.Id), TotalCarcassesToTook);; return; } else { LeatherEmbed.WithColor(Color.Blue); LeatherEmbed.AddField($"<:Knife:607575664987734026>```Hunting skill comes with time, {CharactersData.GetCharacterName(Context.User.Id)}```", "```Required level of skill is: [10]\n" + $"Your current skill level is: [{CharactersData.GetCharacterHuntingSkill(Context.User.Id)}]```"); await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build()); return; } }
public async Task IncomingPlayerFoxMeatCollectingRequest() { if (CharactersData.GetCharacterCookingSkill(Context.User.Id) >= 10) { //Checking commands if (CharactersData.GetCharacterFoxCarcass(Context.User.Id) < 1) { CookingEmbed.WithColor(Color.Blue); CookingEmbed.AddField("<:Meat:607579880569307146>```You don't have enough fox carcasses to collect meat from them!```", "```At least 1 fox 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.GetCharacterFoxCarcass(Context.User.Id); i >= 1; i -= 1) { ChanceToGetBonusMeat = random.Next(0, 10); if (ChanceToGetBonusMeat > (7 - CharactersData.GetCharacterCookingSkill(Context.User.Id) / 14)) { 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 fox meat!```"); await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build()); //Save data await CharactersData.SaveCharacterFoxMeat(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: [10]\n" + $"Your current skill level is: [{CharactersData.GetCharacterCookingSkill(Context.User.Id)}]```"); await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build()); return; } }