/// <summary> /// Updates the quests status in regard of enemies /// </summary> /// <param name="enemyList">List of enemy objects</param> /// <param name="objective">Current objective</param> private void UpdateEnemyStatus(List <Enemy> enemyList, Reader.Objective objective) { foreach (Enemy enemy in enemyList) { if (enemy.CanAddToQuest && enemy.Type == objective.ObjType) //Om fienden är av rätt typ så läggs den till i questets progress { objective.Amount++; enemy.CanAddToQuest = false; } } }
/// <summary> /// Updates the quests status in regard of npcs /// </summary> /// <param name="npcList">List of npc objects</param> /// <param name="objective">Current objective</param> private void UpdateNPCStatus(List <NonPlayerCharacter> npcList, Reader.Objective objective) { NonPlayerCharacter questNPC = npcList.Find(Friend => Friend.UnitId == objective.ObjType && Friend.CanAddToQuest); //If the npc is locaded within the players screen yhe progress is changed if (questNPC != null) { objective.Amount = 1; } else { objective.Amount = 0; } }
/// <summary> /// Updates the objectives Item status /// </summary> /// <param name="inventoryList">Current inventory</param> /// <param name="objective">Current objective</param> /// <param name="itemObjType">Type of item object</param> private void UpdateItemStatus(List <Item> inventoryList, Reader.Objective objective, Type itemObjType) { objective.Amount = inventoryList.Count(Item => Item.GetType() == itemObjType && Item.Type == objective.ObjType); }