/// <summary> /// Generate a quest based on character level /// </summary> /// <param name="character"></param> /// <returns>A randomly generated quest</returns> public Quest GenerateQuest(Character player, string questDifficulty) { int questTextIndex = random.Next(0, questNames.Length); int timeAndEnergyCost; if ((questDifficulty == "medium" && player.Energy > 3 && player.Energy < 7) || player.Energy < 4) { timeAndEnergyCost = player.Energy; } else { timeAndEnergyCost = GenerateTimeAndEnergyCost(questDifficulty); } Quest quest = new Quest { Name = questNames[questTextIndex], Description = questDescriptions[questTextIndex], QuestTime = timeAndEnergyCost, EnergyCost = timeAndEnergyCost, RewardCoin = GenerateCoinReward(player.CharacterLevel, questDifficulty, HasItemReward()), RewardXP = GenerateXPReward(player.CharacterLevel, questDifficulty, HasItemReward()), RewardItem = _itemGeneratorService.GenerateItem(player.CharacterLevel) }; return(quest); }
public Item ItemGenerator(Character player) { return(_itemGenerator.GenerateItem(player.CharacterLevel)); }