Ejemplo n.º 1
0
 public void OnQuestUpdated()
 {
     QuestUpdated?.Invoke(this, new QuestEventArgs()
     {
         quest = actualQuest
     });
 }
Ejemplo n.º 2
0
 public void ExecuteAnyButtonClickedOperations()
 {
     if (CurrentQuest == null || CurrentQuest.IsCompleted())
     {
         CurrentQuest = null;
         QuestUpdated?.Invoke(null);
     }
 }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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();
        }