Esempio n. 1
0
    public override void SetJardim()
    {
        if (GameManager.instance.rpgTalk.isPlaying)
        {
            GameManager.instance.rpgTalk.EndTalk();
        }

        // LUZ DO AMBIENTE
        mainLight.transform.Rotate(new Vector3(30, mainLight.transform.rotation.y, mainLight.transform.rotation.z));
        //GameObject.Find("AreaLightHolder").gameObject.transform.Find("AreaLight").gameObject.SetActive(true); //utilizar AreaLight para cenas de dia, variar Z

        if (GameManager.instance.invertWorld)
        {
            invertLocal = true;
            mainLight.transform.Rotate(new Vector3(-40, mainLight.transform.rotation.y, mainLight.transform.rotation.z));
        }

        if (GameManager.previousSceneName.Equals("GameOver"))
        {
            gameOverSet = true;
            GameManager.instance.Invoke("InvokeMission", 2f);
        }

        // Pedra, caso não tenha
        if (!Inventory.HasItemType(Inventory.InventoryItems.PEDRA))
        {
            GameObject pedra1 = GameObject.Find("monte_pedra").gameObject;
            pedra1.tag = "ScenePickUpObject";
            ScenePickUpObject scenePickUpObject = pedra1.AddComponent <ScenePickUpObject>();
            scenePickUpObject.sprite1        = pedra1.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject.sprite2        = pedra1.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject.blockAfterPick = true;
            scenePickUpObject.item           = Inventory.InventoryItems.PEDRA;

            GameObject pedra2 = GameObject.Find("monte_pedra (1)").gameObject;
            pedra2.tag = "ScenePickUpObject";
            ScenePickUpObject scenePickUpObject2 = pedra2.AddComponent <ScenePickUpObject>();
            scenePickUpObject2.sprite1        = pedra2.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject2.sprite2        = pedra2.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject2.blockAfterPick = true;
            scenePickUpObject2.item           = Inventory.InventoryItems.PEDRA;

            GameObject pedra = GameManager.instance.AddObject("Objects/PickUp", "Sprites/Objects/Inventory/pedra", new Vector3((float)-3.59, (float)-0.45, 0), new Vector3(0.6f, 0.6f, 1f));
            pedra.GetComponent <PickUpObject>().item = Inventory.InventoryItems.PEDRA;
        }

        if (!Inventory.HasItemType(Inventory.InventoryItems.FACA) && !Inventory.HasItemType(Inventory.InventoryItems.PEDRA))
        {
            GameManager.instance.rpgTalk.NewTalk("M8PedraJardim", "M8PedraJardimEnd", GameManager.instance.rpgTalk.txtToParse, GameManager.instance, "", false);
        }

        if (secao == enumMission.FINAL_CAT)
        {
            EspecificaEnum((int)enumMission.FINAL);
        }
    }
Esempio n. 2
0
    public override void SetJardim()
    {
        if (GameManager.instance.rpgTalk.isPlaying)
        {
            GameManager.instance.rpgTalk.EndTalk();
        }

        GameManager.instance.scenerySounds.StopSound();
        GameManager.instance.scenerySounds.PlayWolf(1);

        // LUZ DO AMBIENTE
        mainLight.transform.Rotate(new Vector3(50, mainLight.transform.rotation.y, mainLight.transform.rotation.z));

        if (GameManager.instance.invertWorld)
        {
            invertLocal = true;
            mainLight.transform.Rotate(new Vector3(-40, mainLight.transform.rotation.y, mainLight.transform.rotation.z));
            if (Cat.instance)
            {
                Cat.instance.GetComponent <SpriteRenderer>().color = Color.black;
            }
        }

        if (!Inventory.HasItemType(Inventory.InventoryItems.PEDRA))
        {
            GameObject pedra1 = GameObject.Find("monte_pedra").gameObject;
            pedra1.tag = "ScenePickUpObject";
            ScenePickUpObject scenePickUpObject = pedra1.AddComponent <ScenePickUpObject>();
            scenePickUpObject.sprite1        = pedra1.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject.sprite2        = pedra1.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject.blockAfterPick = true;
            scenePickUpObject.item           = Inventory.InventoryItems.PEDRA;

            GameObject pedra2 = GameObject.Find("monte_pedra (1)").gameObject;
            pedra2.tag = "ScenePickUpObject";
            ScenePickUpObject scenePickUpObject2 = pedra2.AddComponent <ScenePickUpObject>();
            scenePickUpObject2.sprite1        = pedra2.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject2.sprite2        = pedra2.GetComponent <SpriteRenderer>().sprite;
            scenePickUpObject2.blockAfterPick = true;
            scenePickUpObject2.item           = Inventory.InventoryItems.PEDRA;

            GameObject pedra = GameManager.instance.AddObject("Objects/PickUp", "Sprites/Objects/Inventory/pedra", new Vector3((float)-3.59, (float)-0.45, 0), new Vector3(0.6f, 0.6f, 1f));
            pedra.GetComponent <PickUpObject>().item = Inventory.InventoryItems.PEDRA;
        }
    }
Esempio n. 3
0
        // CRIA SCENE OBJETO PICK UP A PARTIR DE UM SCENE OBJECT
        public void CreateScenePickUp(string nameObject, Inventory.InventoryItems item, int num = -1)
        {
            print("PICK UP CREATE: " + nameObject + " [" + item + "]");
            GameObject obj = GameObject.Find(nameObject).gameObject;

            obj.tag = "ScenePickUpObject";
            SceneObject sceneObject = obj.GetComponent <SceneObject>();

            sceneObject.enabled = false;
            ScenePickUpObject scenePickUpObject = obj.AddComponent <ScenePickUpObject>();

            scenePickUpObject.sprite1         = sceneObject.sprite1;
            scenePickUpObject.sprite2         = sceneObject.sprite2;
            scenePickUpObject.positionSprite  = sceneObject.positionSprite;
            scenePickUpObject.scale           = sceneObject.scale;
            scenePickUpObject.isUp            = sceneObject.isUp;
            scenePickUpObject.numRandomListed = num;
            scenePickUpObject.item            = item;
        }
Esempio n. 4
0
    public override void SetQuartoMae()
    {
        if (GameManager.instance.rpgTalk.isPlaying)
        {
            GameManager.instance.rpgTalk.EndTalk();
        }

        if (GameManager.previousSceneName.Equals("GameOver"))
        {
            GameManager.instance.rpgTalk.NewTalk("M4DicaQuartoMae", "M4DicaQuartoMaeEnd");

            if (Cat.instance == null)
            {
                // Gato
                GameObject cat = GameManager.instance.AddObject(
                    "NPCs/catFollower", "", new Vector3(player.transform.position.x + 0.6f, player.transform.position.y, 0), new Vector3(0.15f, 0.15f, 1));
                cat.GetComponent <Cat>().FollowPlayer();
            }
        }

        GameManager.instance.scenerySounds.StopSound();

        // LUZ DO AMBIENTE
        mainLight.transform.Rotate(new Vector3(50, mainLight.transform.rotation.y, mainLight.transform.rotation.z));

        if (GameManager.instance.invertWorld)
        {
            invertLocal = true;
            mainLight.transform.Rotate(new Vector3(-40, mainLight.transform.rotation.y, mainLight.transform.rotation.z));
            if (Cat.instance)
            {
                Cat.instance.GetComponent <SpriteRenderer>().color = Color.black;
            }
        }

        //livro no inventário
        GameObject armario = GameObject.Find("Armario").gameObject;

        armario.tag = "ScenePickUpObject";
        SceneObject sceneObject = armario.GetComponent <SceneObject>();

        sceneObject.enabled = false;
        ScenePickUpObject scenePickUpObject = armario.AddComponent <ScenePickUpObject>();

        scenePickUpObject.sprite1           = sceneObject.sprite1;
        scenePickUpObject.sprite2           = sceneObject.sprite2;
        scenePickUpObject.positionSprite    = sceneObject.positionSprite;
        scenePickUpObject.scale             = sceneObject.scale;
        scenePickUpObject.isUp              = sceneObject.isUp;
        scenePickUpObject.item              = Inventory.InventoryItems.LIVRO;
        scenePickUpObject.onlyInvertedWorld = true;

        GameManager.instance.AddObject("Scenery/Gloom", "", new Vector3(2.1f, 2.17f, -0.5f), new Vector3(1f, 1f, 1));

        if (secao < enumMission.QUEBRADO)
        {
            mom         = GameManager.instance.AddObject("NPCs/mom", "", new Vector3(2f, 1.5f, -0.5f), new Vector3(0.3f, 0.3f, 1));
            momRenderer = mom.GetComponent <SpriteRenderer>();
            if (GameManager.instance.invertWorld)
            {
                momRenderer.color = Color.black;
            }

            mom.GetComponent <Patroller>().isPatroller = true;
            mom.GetComponent <Patroller>().speed       = 0.5f;
            Vector3   target1    = new Vector3(3.2f, 1.5f, -0.5f);
            Vector3   target2    = new Vector3(2f, 0.5f, -0.5f);
            Vector3   target3    = new Vector3(2.75f, 0.15f, -0.5f);
            Vector3   target4    = new Vector3(2f, 1.5f, -0.5f);
            Vector3[] momTargets = { target1, target2, target3, target4 };
            mom.GetComponent <Patroller>().targets = momTargets;

            mom.GetComponent <Patroller>().hasActionPatroller = true;
            mom.GetComponent <CircleCollider2D>().radius      = 8;
        }

        if ((secao == enumMission.MI_ATIVADO || secao == enumMission.MI_DESATIVADO))
        {
            EspecificaEnum((int)enumMission.ARMARIO);
        }
    }