public async Task IncomingPlayerRuffFishingRequest() { if (CharactersData.GetCharacterFishingSkill(Context.User.Id) >= 5) { if ((DateTime.Now - CharactersData.GetCharacterFishingCooldown(Context.User.Id)).TotalSeconds >= 120) // checks if more than 120 seconds have passed between the last requests send by the player { //In future update add a fishing rod durability check //Execution of command FishingEmbed.WithColor(Color.Blue); FishingEmbed.AddField("<:FishingRod:603598075239596042>```Success!```", $"```You caught a ruff fish!```"); await Context.Channel.SendMessageAsync("", false, FishingEmbed.Build()); //Save data await CharactersData.SavePlayerFishingCooldown(Context.User.Id, DateTime.Now); //Refresh cooldown for mining await CharactersData.SaveCharacterCarp(Context.User.Id, 1, 0.3f / CharactersData.GetCharacterFishingSkill(Context.User.Id)); } else { //Send message about cooldown FishingEmbed.WithColor(Color.Blue); if (120 - (DateTime.Now - CharactersData.GetCharacterFishingCooldown(Context.User.Id)).TotalSeconds > 60) { FishingEmbed.AddField($"<:FishingRod:603598075239596042>```{CharactersData.GetCharacterName(Context.User.Id)}, you're too exhausted to go fishing```", $"```Try again in 1m {Math.Round(Convert.ToDecimal(120 - (DateTime.Now - CharactersData.GetCharacterFishingCooldown(Context.User.Id)).TotalSeconds - 60))}s```"); } else { FishingEmbed.AddField($"<:FishingRod:603598075239596042>```{CharactersData.GetCharacterName(Context.User.Id)}, you're too exhausted to go fishing```", $"```Try again in {Math.Round(Convert.ToDecimal(120 - (DateTime.Now - CharactersData.GetCharacterFishingCooldown(Context.User.Id)).TotalSeconds))}s```"); } await Context.Channel.SendMessageAsync("", false, FishingEmbed.Build()); return; } } else { FishingEmbed.WithColor(Color.Blue); FishingEmbed.AddField($"<:FishingRod:603598075239596042>```Fishing skill comes with time, {CharactersData.GetCharacterName(Context.User.Id)}```", "```Required level of skill is: [5]\n" + $"Your current skill level is: [{CharactersData.GetCharacterFishingSkill(Context.User.Id)}]```"); await Context.Channel.SendMessageAsync("", false, FishingEmbed.Build()); return; } }
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()); }