Esempio n. 1
0
    protected void tryQuest()
    {
        if (myQuests.checkQuest())
        {
            if (MetaScript.getRes().roomForResource(ResourceTypes.POPULATION, 1))
            {
                Debug.Log("QUEST COMPLETED");
                GetComponentInChildren <SpeechBubble>().setText("Quest Completed");

                MetaScript.Poof(transform.position);
                TakeSoul();
            }
            else
            {
                Debug.Log("Not enough population");
                GetComponentInChildren <SpeechBubble>().setText("You require additional Pylons... I mean houses");
            }
        }
        else
        {
            Debug.Log("Attempted quest but failed. Need " +
                      myQuests.GetQuestGoal().getThreshold() + " of " +
                      GetQuestType().Name
                      );


            gameObject.GetComponentInChildren <SpeechBubble>().setText("Need " +
                                                                       myQuests.GetQuestGoal().getThreshold() + " " +
                                                                       GetQuestType().Name);
        }
    }