Example #1
0
 private void GenerateTwoPlayerQuest()
 {
     Debug.Log("Genereating two player quest");
     Debug.Log(questPointer);
     QuestPointer.Pointer pointer = questPointer.CreatePointer(twoPlayerQuestObject.transform.position, Utils.twoPlayerQuestIndex);
     currentQuests.Add(new TwoPlayerQuest(this, twoPlayerQuestObject, pointer, chickens));
     twoPlayerQuestObject.SetActive(true);
 }
Example #2
0
    private void GenerateTreeQuest()
    {
        Debug.Log("Genereating tree quest");

        GameObject selectedTree = flamableTrees[UnityEngine.Random.Range(0, flamableTrees.Count)];
        Vector3    position     = selectedTree.GetComponent <Transform>().position;

        QuestPointer.Pointer pointer = questPointer.CreatePointer(position, Utils.treeQuestIndex);
        currentQuests.Add(new TreeQuest(position, flamableTreeQuestPrefab, this, selectedTree, pointer));
    }
Example #3
0
    private void GenerateSaveAnimalQuest()
    {
        Debug.Log("Genereating save animal quest");

        GameObject selectedAnimal = animalsToSave[UnityEngine.Random.Range(0, animalsToSave.Count)];
        Vector3    position       = selectedAnimal.GetComponent <Transform>().position;

        QuestPointer.Pointer pointer = questPointer.CreatePointer(position, Utils.saveAnimalQuestIndex);
        currentQuests.Add(new AnimalSaveQuest(position, animalSavePrefab, selectedAnimal, this, pointer));
    }
Example #4
0
        public BearFeedQuest(QuestManager questManager, GameObject bearEvent, QuestPointer.Pointer pointer)
        {
            this.questManager   = questManager;
            this.bearEvent      = bearEvent;
            this.pointer        = pointer;
            this.readyToDestroy = true;

            this.points  = 20;
            this.timeCap = float.MaxValue;

            Debug.Log("SET");
            bearEvent.GetComponent <BearEventScript>().SetBearFeedQuest(this);
            bearEvent.GetComponent <BearEventScript>().Run();
        }
Example #5
0
 public TwoPlayerQuest(QuestManager questManager, GameObject quest, QuestPointer.Pointer pointer, AiChickenController[] chickens)
 {
     this.questManager   = questManager;
     this.questObject    = quest;
     this.pointer        = pointer;
     this.finishedByUser = false;
     this.timeCap        = 10f;
     this.points         = 25;
     this.chickens       = chickens;
     questManager.activeQuests.Remove(Utils.twoPlayerQuestIndex);
     questObject.SetActive(true);
     questObject.GetComponent <TwoPlayerQuestScript>().SetTwoPlayerQuest(this);
     questObject.GetComponent <TwoPlayerQuestScript>().Init();
 }
Example #6
0
    private void GenerateRockDestroyQuest()
    {
        Debug.Log("Genereating rock destroy quest");

        Vector3 position        = new Vector3(-6.775665f, 7.74f, 28.46386f);
        Vector3 pointerPosition = GameObject.Find("FallingRockEvent").gameObject.transform.position;

        // TODO: ADD ICON FOR ROCK
        QuestPointer.Pointer pointer = questPointer.CreatePointer(pointerPosition, Utils.rockDestroyQuestIndex);
        currentQuests.Add(new RockDestroyQuest(position, fallingRock, fallingRockDestroyed, fallingRockObject, this, pointer));

        activeQuests.Remove(Utils.bearFeedQuestIndex);
        activeQuests.Remove(Utils.rockDestroyQuestIndex);
    }
Example #7
0
    private void GenerateBearFeedQuest()
    {
        Debug.Log("Genereating bear feed quest");

        RegrowBerries();
        ResetBushes();

        Vector3 position = bearFeedQbject.GetComponent <Transform>().position;

        // TODO: ADD ICON FOR BEAR
        QuestPointer.Pointer pointer = questPointer.CreatePointer(position, Utils.bearFeedQuestIndex);
        currentQuests.Add(new BearFeedQuest(this, bearFeedQbject, pointer));

        activeQuests.Remove(Utils.bearFeedQuestIndex);
        activeQuests.Remove(Utils.rockDestroyQuestIndex);
    }
Example #8
0
        public RockDestroyQuest(Vector3 startPosition, GameObject fallingRock, GameObject fallingRockDestroyed, GameObject questObject, QuestManager questManager, QuestPointer.Pointer pointer)
        {
            this.startPosition       = startPosition;
            this.rockObject          = fallingRock;
            this.destroyedRockObject = fallingRockDestroyed;
            this.questObject         = questObject;
            this.questObject.GetComponent <FillSliderScript>().SetRunning(true);
            this.questManager = questManager;
            this.pointer      = pointer;
            timeCap           = float.MaxValue;
            this.points       = 10;

            InitPrefab();
        }
Example #9
0
 public AnimalSaveQuest(Vector3 position, GameObject smashSlider, GameObject animalToSave, QuestManager questManager, QuestPointer.Pointer pointer)
 {
     this.position     = position;
     this.smashSlider  = smashSlider;
     this.animalToSave = animalToSave;
     this.questManager = questManager;
     this.pointer      = pointer;
     this.timeCap      = 15f;
     this.points       = 10;
     questManager.RemoveAnimalToSave(animalToSave);
     InitPrefab();
 }
Example #10
0
        public TreeQuest(Vector3 position, GameObject accuracySlider, QuestManager questManager, GameObject tree, QuestPointer.Pointer pointer)
        {
            this.position       = position;
            this.accuracySlider = accuracySlider;
            this.questManager   = questManager;
            this.treeToBeBurnt  = tree;
            this.pointer        = pointer;
            this.finishedByUser = false;
            this.timeCap        = 15f;
            this.points         = 10;
            this.flames         = new List <GameObject>();

            AudioSource[] audios = treeToBeBurnt.GetComponents <AudioSource>();
            foreach (AudioSource audio in audios)
            {
                if (audio.clip == this.questManager.flameSound)
                {
                    this.flameSound = audio;
                }
                else
                {
                    this.extinguishSound = audio;
                }
            }

            questManager.RemoveFlamableTree(treeToBeBurnt);
            InitPrefab();
        }