Пример #1
0
 private void btnNewQuest_Click(object sender, EventArgs e)
 {
     Quest q = new Quest();
     q.Name = "Nova missão";
     Quests.Add(q);
     LoadQuestList();
     selectedQuest = Quests.Count - 1;
 }
 private void AddQuestAwards(Quest quest)
 {
     if (quest.Prize.Experience > 0)
     {
         Player.AddExperience(quest.Prize.Experience);
     }
     if (quest.Prize.Gold > 0)
     {
         Player.Money += quest.Prize.Gold;
     }
     if (quest.Prize.Items.Count > 0)
     {
         foreach (var item in quest.Prize.Items)
         {
             Player.Inventory.Add(Item.AllItems.Find(x => x.Id == item));
         }
     }
     if (quest.Prize.FinishGame)
     {
         //FinishGame();
     }
 }
Пример #3
0
 public Event(EventAction eventAction, Quest quest)
 {
     Action = eventAction;
     Quest = quest;
 }
 private bool CheckQuestStatus(Quest quest)
 {
     switch (quest.Goal.Type)
     {
         case QuestGoalType.GetItem:
             return Player.Inventory.Find(x => x.Id == quest.Goal.GoalObjectId) != null;
         case QuestGoalType.KillCreatures:
             return quest.Goal.CurrentCount >= quest.Goal.GoalAmount;
         default:
             return false;
     }
 }