Пример #1
0
 public void OnQuestUpdated()
 {
     QuestUpdated?.Invoke(this, new QuestEventArgs()
     {
         quest = actualQuest
     });
 }
Пример #2
0
 public void ExecuteAnyButtonClickedOperations()
 {
     if (CurrentQuest == null || CurrentQuest.IsCompleted())
     {
         CurrentQuest = null;
         QuestUpdated?.Invoke(null);
     }
 }
Пример #3
0
        public void OnQuestItemInteracted(IInteractable questItem)
        {
            Quest CurrentQuest = Game.PlayerRef.CurrentQuest;

            if (CurrentQuest != null)
            {
                switch (CurrentQuest.Type)
                {
                case Quest.QuestType.CollectLives:
                    if (!(questItem is BonusLifeTile))
                    {
                        return;
                    }
                    CurrentQuest.Progress += 1;
                    QuestUpdated?.Invoke(CurrentQuest);
                    break;

                case Quest.QuestType.KillMonsters:
                    if (!(questItem is AbstractMonster))
                    {
                        return;
                    }
                    CurrentQuest.Progress += 1;
                    QuestUpdated?.Invoke(CurrentQuest);
                    break;

                case Quest.QuestType.FindTreasure:
                    if (!(questItem is TreasureChestTile))
                    {
                        return;
                    }
                    TreasureChestTile t = (TreasureChestTile)questItem;
                    if (t.IsTreasure)
                    {
                        CurrentQuest.Progress += 1;
                        QuestUpdated?.Invoke(CurrentQuest);
                    }
                    break;
                }


                if (CurrentQuest.IsCompleted())
                {
                    Game.PlayerRef.CompleteCurrentQuest();
                }
            }
        }
Пример #4
0
        private void OnQuestControlActivated(bool isAccepted)
        {
            Console.Write("\b");
            QuestGiver questGiver = QuestGiver.Quests.Find(q => q.IsTouched);

            if (questGiver == null)
            {
                return;
            }

            if (isAccepted)
            {
                GameMessage.SendMessage("ACCEPTED !");
                this.CurrentQuest = questGiver.OwnQuest;
                QuestUpdated?.Invoke(this.CurrentQuest);
            }
            else
            {
                GameMessage.SendMessage("DECLINED !");
            }
            NeedsRefresh?.Invoke();
        }