Exemplo n.º 1
0
 public void Search(string info)
 {
     if (info == "Field1")
     {
         pesquisaEllgog.attInfo(inputField.text);
     }
     else if (info == "Field2")
     {
         pesquisaEllgog.attInfo(inputField2.text);
     }
     else if (info == "Relacionada1")
     {
         pesquisaEllgog.attInfo(pesquisaEllgog.pesquisaRelacionada1.text);
     }
     else if (info == "Relacionada2")
     {
         pesquisaEllgog.attInfo(pesquisaEllgog.pesquisaRelacionada2.text);
     }
     player.QuestAtt(inputField.text, true);
 }
Exemplo n.º 2
0
    private void OnEnable()
    {
        activeQuest = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerQuest>();

        StartCoroutine(LightsOut());
        fakeLoading.Fade();
        switch (mapaAnterior)
        {
        case "SaidaEsquerda":
            player.transform.position = chegadaDireita.position;
            robo.position             = chegadaDireita.position;
            break;

        case "SaidaDireita":
            player.transform.position = chegadaEsquerda.position;
            robo.position             = chegadaEsquerda.position;
            break;

        case "SaidaCima":
            player.transform.position = chegadaBaixo.position;
            robo.position             = chegadaBaixo.position;
            break;

        case "SaidaBaixo":
            player.transform.position = chegadaCima.position;
            robo.position             = chegadaCima.position;
            break;
        }

        if (mapaAtivo.tag == "MapaGelo")
        {
            criogenicasAudio.Play();
            activeQuest.QuestAtt("Criogenicas", true);
        }
        else
        {
            criogenicasAudio.Stop();
        }
    }
Exemplo n.º 3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (isShieldOn)
        {
            if (!collision.gameObject.GetComponent <Skill>().isProjectile)
            {
                if (this.name == "Player" && collision.tag == "EnemyAttack" && !damageCooldown)
                {
                    if (health > 0)
                    {
                        saidaDeSom.PlayOneShot(damageTaken);
                    }

                    damageCooldown = true;
                }
            }
        }
        else
        {
            if (this.name == "Player" && collision.tag == "EnemyAttack" && !damageCooldown)
            {
                if (health > 0)
                {
                    saidaDeSom.PlayOneShot(damageTaken);
                }

                damageCooldown = true;
            }
        }

        //if (this.name == "Player" && collision.tag == "EnemyAttack" && !damageCooldown && !isShieldOn)
        //{
        //    if(health > 0)
        //    {
        //        saidaDeSom.PlayOneShot(damageTaken);
        //    }

        //    damageCooldown = true;
        //}
        //else
        if (this.tag == "Enemy" && collision.tag == "Attack" && !damageCooldown)
        {
            //if (health <= 0)
            //{
            //    saidaDeSom.PlayOneShot(deadSound);
            //}
            //else if (health > 0)
            //{
            //    saidaDeSom.PlayOneShot(damageTaken);
            //}
            if (health <= 0)
            {
                damageCooldown = false;
                if (this.name != "Player")
                {
                    if (this.name == "Torfarios")
                    {
                        activeQuest.QuestAtt("Torfarios", true);
                        //spr.material = dissolveMaterial;
                        //StartCoroutine(DissolveEffect());
                    }
                    else if (this.name == "BossFogo")
                    {
                        activeQuest.QuestAtt("BossFogo", true);
                    }
                    else if (this.name == "BossGolemGelo")
                    {
                        activeQuest.QuestAtt("BossGolemGelo", true);
                    }
                    else if (this.name == "BossRobozao")
                    {
                        activeQuest.QuestAtt("BossRobozao", true);
                    }
                    else
                    {
                        if (activeQuest.quest.goal.goalType.ToString() == "ElementalKill")
                        {
                            activeQuest.QuestAtt(this.gameObject.GetComponent <EnemyController>().elementoInimigo.ToString(), true);
                        }
                        else
                        {
                            activeQuest.QuestAtt(this.gameObject.GetComponent <EnemyController>().enemyName, true);
                        }

                        //spr.material = dissolveMaterial;
                        //StartCoroutine(DissolveEffect());
                    }
                }
            }

            DamageEffect();
            damageCooldown = true;
        }
    }
Exemplo n.º 4
0
 public void nextPage()
 {
     activeQuest.QuestAtt("Anota", true);
 }
Exemplo n.º 5
0
    public void DoCraft()
    {
        if (craftingInvetory.Container.Items[0].item.Id >= 0 && craftingInvetory.Container.Items[1].item.Id >= 0)
        {
            if (item1.craftingItemType != CraftingItemType.Nenhum)
            {
                switch (item1.craftingItemType)
                {
                case CraftingItemType.Fruta:
                    switch (item2.craftingItemType)
                    {
                    case CraftingItemType.Fruta:
                        item3 = craftingInvetory.database.GetItem[12].CreateItem();
                        activeQuest.QuestAtt(item3.Id.ToString(), true);
                        craftingInvetory.AddItem(item3, 1);
                        diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                        clearCraftedItems();
                        break;

                    case CraftingItemType.Reagente:
                        switch (item1.craftingItemElement)
                        {
                        case CraftingItemElement.Fogo:
                            item3 = craftingInvetory.database.GetItem[21].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Gelo:
                            item3 = craftingInvetory.database.GetItem[22].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;
                    }
                    break;

                case CraftingItemType.Cogumelo:
                    switch (item2.craftingItemType)
                    {
                    case CraftingItemType.Cogumelo:
                        item3 = craftingInvetory.database.GetItem[11].CreateItem();
                        activeQuest.QuestAtt(item3.Id.ToString(), true);
                        craftingInvetory.AddItem(item3, 1);
                        diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                        clearCraftedItems();
                        break;

                    case CraftingItemType.Reagente:
                        switch (item1.craftingItemElement)
                        {
                        case CraftingItemElement.Veneno:
                            item3 = craftingInvetory.database.GetItem[23].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;
                    }
                    break;

                case CraftingItemType.Flor:
                    switch (item2.craftingItemType)
                    {
                    case CraftingItemType.Flor:
                        item3 = craftingInvetory.database.GetItem[10].CreateItem();
                        activeQuest.QuestAtt(item3.Id.ToString(), true);
                        craftingInvetory.AddItem(item3, 1);
                        diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                        clearCraftedItems();
                        break;

                    case CraftingItemType.Reagente:
                        switch (item1.craftingItemElement)
                        {
                        case CraftingItemElement.Eletrico:
                            item3 = craftingInvetory.database.GetItem[24].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }

                        break;
                    }
                    break;

                case CraftingItemType.Partes:
                    switch (item2.craftingItemType)
                    {
                    case CraftingItemType.Partes:
                        item3 = craftingInvetory.database.GetItem[28].CreateItem();
                        activeQuest.QuestAtt(item3.Id.ToString(), true);
                        craftingInvetory.AddItem(item3, 1);
                        diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                        clearCraftedItems();
                        break;
                    }
                    break;

                case CraftingItemType.Essencia:
                    switch (item2.craftingItemType)
                    {
                    case CraftingItemType.Reagente:
                        switch (item1.craftingItemElement)
                        {
                        case CraftingItemElement.Fogo:
                            item3 = craftingInvetory.database.GetItem[17].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Gelo:
                            item3 = craftingInvetory.database.GetItem[18].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Veneno:
                            item3 = craftingInvetory.database.GetItem[19].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Eletrico:
                            item3 = craftingInvetory.database.GetItem[20].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;
                    }
                    break;

                case CraftingItemType.Reagente:
                    switch (item2.craftingItemType)
                    {
                    case CraftingItemType.Essencia:
                        switch (item2.craftingItemElement)
                        {
                        case CraftingItemElement.Fogo:
                            item3 = craftingInvetory.database.GetItem[17].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Gelo:
                            item3 = craftingInvetory.database.GetItem[18].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Veneno:
                            item3 = craftingInvetory.database.GetItem[19].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Eletrico:
                            item3 = craftingInvetory.database.GetItem[20].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;

                    case CraftingItemType.Fruta:
                        switch (item2.craftingItemElement)
                        {
                        case CraftingItemElement.Fogo:
                            item3 = craftingInvetory.database.GetItem[21].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;

                        case CraftingItemElement.Gelo:
                            item3 = craftingInvetory.database.GetItem[22].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;

                    case CraftingItemType.Cogumelo:
                        switch (item2.craftingItemElement)
                        {
                        case CraftingItemElement.Veneno:
                            item3 = craftingInvetory.database.GetItem[23].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;

                    case CraftingItemType.Flor:
                        switch (item2.craftingItemElement)
                        {
                        case CraftingItemElement.Eletrico:
                            item3 = craftingInvetory.database.GetItem[24].CreateItem();
                            activeQuest.QuestAtt(item3.Id.ToString(), true);
                            craftingInvetory.AddItem(item3, 1);
                            diaryInfoController.SetInfo(item3.nome, item3.uiDisplay, item3.craftingDescription, "Dicas", "");
                            clearCraftedItems();
                            break;
                        }
                        break;
                    }
                    break;
                }
            }
        }
        if (craftingInvetory.Container.Items[2].item.Id >= 0)
        {
            feedBackCraftingText.text = item3.nome + " construida";
        }
        else
        {
            feedBackCraftingText.text = "Nada construido";
        }
    }
Exemplo n.º 6
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         //inventory.Save();
     }
     if (Input.GetKeyDown(KeyCode.Backspace))
     {
         //inventory.Load();
     }
     if (Input.GetKeyDown(KeyCode.E) && collidingWithItem && !playerScan.isScanning)
     {
         var item = itemCollided.GetComponent <GroundItem>().itemObject;
         if (item)
         {
             Item _item = new Item(item);
             if (inventory.AddItem(_item, 1))
             {
                 activeQuest.QuestAtt(_item.nome, true);
                 itemCollided.SetActive(false);
             }
         }
     }
     if (Input.GetKeyDown(KeyCode.E) && collidingWithCraftingTable)
     {
         if (craftingTableUI.activeSelf)
         {
             playerMovement.freezePlayer = false;
             craftingTableUI.SetActive(false);
             robotMiniUi.SetActive(false);
             robotUI.SetActive(false);
             merinhaRobo.SetActive(false);
         }
         else
         {
             playerMovement.freezePlayer = true;
             craftingTableUI.SetActive(true);
             robotUI.SetActive(true);
             robotMiniUi.SetActive(true);
             merinhaRobo.SetActive(true);
         }
     }
     else if (Input.GetKeyDown(KeyCode.E) && collidingWithMailBox)
     {
         mailboxUI.SetActive(true);
     }
     else if (Input.GetKeyDown(KeyCode.Tab) && collidingWithRobot)
     {
         if (robotUI.activeSelf)
         {
             roboAudioSource.PlayOneShot(audiosRobo[1]);
             robotUI.SetActive(false);
             robotMiniUi.SetActive(false);
             merinhaRobo.SetActive(false);
         }
         else
         {
             roboAudioSource.PlayOneShot(audiosRobo[0]);
             robotUI.SetActive(true);
             robotMiniUi.SetActive(true);
             merinhaRobo.SetActive(true);
         }
     }
     if (!collidingWithCraftingTable && !collidingWithRobot)
     {
         craftingTableUI.SetActive(false);
         robotUI.SetActive(false);
         robotMiniUi.SetActive(false);
         merinhaRobo.SetActive(false);
     }
     if (!collidingWithMailBox)
     {
         mailboxUI.SetActive(false);
     }
     if (!collidingWithRobot)
     {
         robotUI.SetActive(false);
         robotMiniUi.SetActive(false);
         merinhaRobo.SetActive(false);
     }
 }