Esempio n. 1
0
    void OnClick()
    {
        PokemonOwnedDAO pkmOwned = new PokemonOwnedDAO();
        EggOwnedDAO     eggOwned = new EggOwnedDAO();

        switch (transform.parent.name)
        {
        case "Pokemon000":
            if (pkmOwned.GetEquippedPokemon().ToList().Count() > 0)
            {
                UIController.instance.MostrarPanelDatosPokemon(1);
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No tienes ningun pokemon equipado ahi");
            }
            break;

        case "Pokemon001":
            if (pkmOwned.GetEquippedPokemon().ToList().Count() > 1)
            {
                UIController.instance.MostrarPanelDatosPokemon(2);
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No tienes ningun pokemon equipado ahi");
            }
            break;

        case "Pokemon002":
            if (pkmOwned.GetEquippedPokemon().ToList().Count() > 2)
            {
                UIController.instance.MostrarPanelDatosPokemon(3);
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No tienes ningun pokemon equipado ahi");
            }
            break;

        case "Huevo":
            if (eggOwned.GetEquippedEgg() != null)
            {
                UIController.instance.MostrarPanelDatosPokemon(4);
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No tienes ningun huevo equipado");
            }
            break;
        }
    }
Esempio n. 2
0
    void Update()
    {
        PokemonOwnedDAO     pkmOwned = new PokemonOwnedDAO();
        List <PokemonOwned> lista    = pkmOwned.GetEquippedPokemon().ToList();

        if (lista.Count() == 1)
        {
            sprite1.GetComponent <UISprite>().spriteName = lista[0].IdBasic + "";
        }
        else if (lista.Count() == 2)
        {
            sprite1.GetComponent <UISprite>().spriteName = lista[0].IdBasic + "";
            sprite2.GetComponent <UISprite>().spriteName = lista[1].IdBasic + "";
        }
        else if (lista.Count() == 3)
        {
            sprite1.GetComponent <UISprite>().spriteName = lista[0].IdBasic + "";
            sprite2.GetComponent <UISprite>().spriteName = lista[1].IdBasic + "";
            sprite3.GetComponent <UISprite>().spriteName = lista[2].IdBasic + "";
        }
        else if (lista.Count() == 0)
        {
            sprite1.GetComponent <UISprite>().spriteName = "0";
            sprite2.GetComponent <UISprite>().spriteName = "0";
            sprite3.GetComponent <UISprite>().spriteName = "0";
        }
    }
    void FixedUpdate()
    {
        listPokemon = pkmowned.GetEquippedPokemon().ToList();

        if (listPokemon.Count() == 1)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
            pokemon2.GetComponent <UISprite> ().spriteName = "0";
            pokemon3.GetComponent <UISprite> ().spriteName = "0";
        }
        else if (listPokemon.Count() == 2)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
            pokemon2.GetComponent <UISprite> ().spriteName = (listPokemon [1].IdBasic) + "";
            pokemon3.GetComponent <UISprite> ().spriteName = "0";
        }
        else if (listPokemon.Count() == 3)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
            pokemon2.GetComponent <UISprite> ().spriteName = (listPokemon [1].IdBasic) + "";
            pokemon3.GetComponent <UISprite> ().spriteName = (listPokemon [2].IdBasic) + "";
        }
        else if (listPokemon.Count() == 0)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = "0";
            pokemon2.GetComponent <UISprite> ().spriteName = "0";
            pokemon3.GetComponent <UISprite> ().spriteName = "0";
        }
    }
    void OnClick()
    {
        PokemonOwnedDAO     pkmowned = new PokemonOwnedDAO();
        List <PokemonOwned> lista    = pkmowned.GetEquippedPokemon().ToList();

        if (lista.Count() > 1)
        {
            pkmowned.UnEquipPokemon(lista [1].Id);
        }
    }
Esempio n. 5
0
    public int CalcularPrecioHospital()
    {
        PokemonOwnedDAO     pokmowned = new PokemonOwnedDAO();
        List <PokemonOwned> lista     = pokmowned.GetEquippedPokemon().ToList();
        int hpACurar = 0;

        for (int i = 0; i < lista.Count(); i++)
        {
            int hpLeft = lista[i].HpTotal - lista[i].Hp;
            hpACurar += hpLeft;
        }
        return(Mathf.FloorToInt(hpACurar / 5));
    }
Esempio n. 6
0
    void Start()
    {
        PokemonOwnedDAO     pkmOwned    = new PokemonOwnedDAO();
        PokemonBasicDAO     pkmBasic    = new PokemonBasicDAO();
        EggOwnedDAO         eggOwned    = new EggOwnedDAO();
        List <PokemonOwned> listPokemon = pkmOwned.GetEquippedPokemon().ToList();

        if (listPokemon.Count() == 1)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
            PokemonBasic basico = pkmBasic.GetPokemon(listPokemon [0].Id);
            Debug.Log(basico);
            primerNombre.GetComponent <UILabel> ().text = basico.Name + " Nvl " + listPokemon [0].Level;
        }
        else if (listPokemon.Count() == 2)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
            PokemonBasic basico = pkmBasic.GetPokemon(listPokemon [0].IdBasic);
            primerNombre.GetComponent <UILabel> ().text = basico.Name + " Nvl: " + listPokemon [0].Level;

            pokemon2.GetComponent <UISprite> ().spriteName = (listPokemon [1].IdBasic) + "";
            PokemonBasic segundoBasico = pkmBasic.GetPokemon(listPokemon [1].IdBasic);
            segundoNombre.GetComponent <UILabel> ().text = segundoBasico.Name + " Nvl: " + listPokemon [1].Level;
        }
        else if (listPokemon.Count() == 3)
        {
            pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
            PokemonBasic basico = pkmBasic.GetPokemon(listPokemon [0].IdBasic);
            primerNombre.GetComponent <UILabel> ().text = basico.Name + " Nvl: " + listPokemon [0].Level;

            pokemon2.GetComponent <UISprite> ().spriteName = (listPokemon [1].IdBasic) + "";
            PokemonBasic segundoBasico = pkmBasic.GetPokemon(listPokemon [1].IdBasic);
            segundoNombre.GetComponent <UILabel> ().text = segundoBasico.Name + " Nvl: " + listPokemon [1].Level;

            pokemon3.GetComponent <UISprite> ().spriteName = (listPokemon [2].IdBasic) + "";
            PokemonBasic tercerBasico = pkmBasic.GetPokemon(listPokemon [2].IdBasic);
            tercerNombre.GetComponent <UILabel> ().text = tercerBasico.Name + " Nvl: " + listPokemon [2].Level;
        }

        if (eggOwned.GetEquippedEgg() != null)
        {
            huevo.GetComponent <UILabel> ().text                       = "Huevo " + eggOwned.GetEquippedEgg().Category;
            huevoSprite.GetComponent <UISprite>().spriteName           = "Egg";
            huevoSprite.GetComponent <UISprite>().transform.localScale = new Vector3(200, 200, 1);
        }
        else
        {
            huevoSprite.GetComponent <UISprite>().spriteName = "0";
        }
    }
Esempio n. 7
0
    void FixedUpdate()
    {
        curAcc = Mathf.Lerp(curAcc, Input.acceleration.magnitude, fHigh);
        avgAcc = Mathf.Lerp(avgAcc, Input.acceleration.magnitude, fLow);
        float delta = curAcc - avgAcc;

        if (delta > hiLim)
        {
            steps++;
        }

        if (steps > 10)
        {
            stepsEgg++;
            actualizarDatos = true;
            PokemonOwnedDAO     pkmOwned    = new PokemonOwnedDAO();
            List <PokemonOwned> listPokemon = pkmOwned.GetEquippedPokemon().ToList();
            PlayerDAO           playerDAO   = new PlayerDAO();
            EggOwnedDAO         eggOwned    = new EggOwnedDAO();
            for (int i = 0; i < listPokemon.Count(); i++)
            {
                if (listPokemon[i].CurrentHappyness > 1)
                {
                    listPokemon[i].CurrentHappyness  -= 1;
                    listPokemon[i].CurrentExperience += 2;
                    if (listPokemon[i].CurrentExperience > listPokemon[i].ExperienceNeeded)
                    {
                        listPokemon[i].LevelUp();
                        playerDAO.UpdateGold(playerDAO.GetPlayer().Gold + (listPokemon[i].Level * 5));
                    }
                    pkmOwned.UpdatePokemon(listPokemon[i].Id, listPokemon[i]);
                }
            }
            if (stepsEgg == 3)
            {
                if (eggOwned.GetEquippedEgg() != null)
                {
                    eggOwned.AumentarCiclo();
                }
                stepsEgg = 0;
            }
            steps = 0;
        }
    }
Esempio n. 8
0
    void OnClick()
    {
        PokemonOwnedDAO     pkmOwned = new PokemonOwnedDAO();
        List <PokemonOwned> lista    = pkmOwned.GetEquippedPokemon().ToList();

        switch (transform.name)
        {
        case "Pokemon000":
            if (lista.Count() > 0)
            {
                GameController.instance.UsarItem(lista[0].Id);
                UIController.instance.MostrarPanelDatosInventario();
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No hay ningun pokemon en esa posicion");
            }
            break;

        case "Pokemon001":
            if (lista.Count() > 1)
            {
                GameController.instance.UsarItem(lista[1].Id);
                UIController.instance.MostrarPanelDatosInventario();
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No hay ningun pokemon en esa posicion");
            }
            break;

        case "Pokemon002":
            if (lista.Count() > 2)
            {
                GameController.instance.UsarItem(lista[2].Id);
                UIController.instance.MostrarPanelDatosInventario();
            }
            else
            {
                UIController.instance.MostrarPanelMensaje("No hay ningun pokemon en esa posicion");
            }
            break;
        }
    }
Esempio n. 9
0
    void OnClick()
    {
        bool            pagado   = GameController.instance.PagarHospital();
        PokemonOwnedDAO pkmowned = new PokemonOwnedDAO();

        if (pagado)
        {
            PokemonOwnedDAO     pokmnowned  = new PokemonOwnedDAO();
            List <PokemonOwned> listPokemon = pokmnowned.GetEquippedPokemon().ToList();
            for (int i = 0; i < listPokemon.Count(); i++)
            {
                pkmowned.HealthPokemon(listPokemon[i].Id);
            }
            labelPrecio.GetComponent <UILabel> ().text = "Precio: " + GameController.instance.CalcularPrecioHospital();
            UIController.instance.MostrarPanelJuego();
        }
        else
        {
            UIController.instance.MostrarPanelMensaje("No dispones del dinero suficiente para curar a tus pokemon");
        }
    }
    void Update()
    {
        PokemonOwnedDAO     pkmOwned = new PokemonOwnedDAO();
        PokemonBasicDAO     pkmBasic = new PokemonBasicDAO();
        List <PokemonOwned> lista    = pkmOwned.GetEquippedPokemon().ToList();

        nombre.GetComponent <UILabel>().text      = pkmBasic.GetPokemon(lista[2].IdBasic).Name;
        descripcion.GetComponent <UILabel>().text = pkmBasic.GetPokemon(lista[2].IdBasic).Description;
        UILabel datos = stats.GetComponent <UILabel>();

        datos.text  = "";
        datos.text += "Nvl: " + lista[2].Level;
        datos.text += "\nHp: " + lista[2].Hp + "/" + lista[2].HpTotal;
        datos.text += "\nAtaque: " + lista[2].Attack;
        datos.text += "\nDefensa: " + lista[2].Defense;
        datos.text += "\nAtaque especial: " + lista[2].SpecialAttack;
        datos.text += "\nDefensa especial: " + lista[2].SpecialDefense;
        datos.text += "\nVelocidad: " + lista[2].Speed;
        datos.text += "\nAguante: " + lista[2].CurrentHappyness + "/" + lista[2].Happyness;
        datos.text += "\nExperiencia: " + lista[2].CurrentExperience + "/" + lista[2].ExperienceNeeded;
        sprite.GetComponent <UISprite> ().spriteName = lista[2].IdBasic + "";
    }
    void Update()
    {
        PokemonOwnedDAO     pkmowned    = new PokemonOwnedDAO();
        List <PokemonOwned> listPokemon = pkmowned.GetEquippedPokemon().ToList();

        if (listPokemon.Count() == 1)
        {
            float amountFirst = (listPokemon[0].Hp * 100) / listPokemon[0].HpTotal;
            pokemon1.GetComponent <UISprite>().spriteName = (listPokemon[0].IdBasic) + "";
            GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
            fore.GetComponent <UISprite>().fillAmount = (amountFirst / 100);

            GameObject fore2 = progressBar2.transform.FindChild("ForegroundBar001").gameObject;
            fore2.GetComponent <UISprite>().fillAmount = 0;

            GameObject fore3 = progressBar3.transform.FindChild("ForegroundBar002").gameObject;
            fore3.GetComponent <UISprite>().fillAmount = 0;
        }
        else if (listPokemon.Count() == 2)
        {
            float amountFirst = (listPokemon[0].Hp * 100) / listPokemon[0].HpTotal;
            pokemon1.GetComponent <UISprite>().spriteName = (listPokemon[0].IdBasic) + "";
            GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
            fore.GetComponent <UISprite>().fillAmount = (amountFirst / 100);

            float amountSecond = (listPokemon[1].Hp * 100) / listPokemon[1].HpTotal;
            pokemon2.GetComponent <UISprite>().spriteName = (listPokemon[1].IdBasic) + "";
            GameObject fore2 = progressBar2.transform.FindChild("ForegroundBar001").gameObject;
            fore2.GetComponent <UISprite>().fillAmount = (amountSecond / 100);

            GameObject fore3 = progressBar3.transform.FindChild("ForegroundBar002").gameObject;
            fore3.GetComponent <UISprite>().fillAmount = 0;
        }
        else if (listPokemon.Count() == 3)
        {
            float amountFirst = (listPokemon[0].Hp * 100) / listPokemon[0].HpTotal;
            pokemon1.GetComponent <UISprite>().spriteName = (listPokemon[0].IdBasic) + "";
            GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
            fore.GetComponent <UISprite>().fillAmount = (amountFirst / 100);

            float amountSecond = (listPokemon[1].Hp * 100) / listPokemon[1].HpTotal;
            pokemon2.GetComponent <UISprite>().spriteName = (listPokemon[1].IdBasic) + "";
            GameObject fore2 = progressBar2.transform.FindChild("ForegroundBar001").gameObject;
            fore2.GetComponent <UISprite>().fillAmount = (amountSecond / 100);

            float amountThird = ((listPokemon[2].Hp * 100) / listPokemon[2].HpTotal);
            pokemon3.GetComponent <UISprite>().spriteName = (listPokemon[2].IdBasic) + "";
            GameObject fore3 = progressBar3.transform.FindChild("ForegroundBar002").gameObject;
            fore3.GetComponent <UISprite>().fillAmount = (amountThird / 100);
        }
        else if (listPokemon.Count() == 0)
        {
            pokemon1.GetComponent <UISprite>().spriteName = "0";
            pokemon2.GetComponent <UISprite>().spriteName = "0";
            pokemon3.GetComponent <UISprite>().spriteName = "0";

            GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
            fore.GetComponent <UISprite>().fillAmount = 0;

            GameObject fore2 = progressBar2.transform.FindChild("ForegroundBar001").gameObject;
            fore2.GetComponent <UISprite>().fillAmount = 0;

            GameObject fore3 = progressBar3.transform.FindChild("ForegroundBar002").gameObject;
            fore3.GetComponent <UISprite>().fillAmount = 0;
        }
    }
Esempio n. 12
0
    void Update()
    {
        PokemonOwnedDAO     pkmOwned    = new PokemonOwnedDAO();
        List <PokemonOwned> listPokemon = pkmOwned.GetEquippedPokemon().ToList();
        PokemonBasicDAO     pkmBasic    = new PokemonBasicDAO();
        EggOwnedDAO         eggOwned    = new EggOwnedDAO();

        if (actualizarDatos)
        {
            if (listPokemon.Count() == 1)
            {
                float amountFirst = (listPokemon [0].CurrentHappyness * 100) / listPokemon [0].Happyness;
                nombre1.GetComponent <UILabel>().text          = pkmBasic.GetPokemon(listPokemon[0].IdBasic).Name + " Nvl: " + listPokemon[0].Level;
                pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";

                GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
                fore.GetComponent <UISprite> ().fillAmount = (amountFirst / 100);

                float      amountExp = (listPokemon[0].CurrentExperience * 100) / listPokemon[0].ExperienceNeeded;
                GameObject foreExp   = barraExperiencia1.transform.FindChild("ForeExp000").gameObject;
                foreExp.GetComponent <UISprite>().fillAmount = (amountExp / 100);
            }
            else if (listPokemon.Count() == 2)
            {
                float amountFirst = (listPokemon [0].CurrentHappyness * 100) / listPokemon [0].Happyness;
                nombre1.GetComponent <UILabel>().text          = pkmBasic.GetPokemon(listPokemon[0].IdBasic).Name + " Nvl: " + listPokemon[0].Level;
                pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
                GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
                fore.GetComponent <UISprite> ().fillAmount = (amountFirst / 100);

                float      amountExp = (listPokemon[0].CurrentExperience * 100) / listPokemon[0].ExperienceNeeded;
                GameObject foreExp   = barraExperiencia1.transform.FindChild("ForeExp000").gameObject;
                foreExp.GetComponent <UISprite>().fillAmount = (amountExp / 100);

                float amountSecond = ((listPokemon [1].CurrentHappyness * 100) / listPokemon [1].Happyness);
                nombre2.GetComponent <UILabel>().text          = pkmBasic.GetPokemon(listPokemon[1].IdBasic).Name + " Nvl: " + listPokemon[1].Level;
                pokemon2.GetComponent <UISprite> ().spriteName = (listPokemon [1].IdBasic) + "";
                GameObject fore2 = progressBar2.transform.FindChild("ForegroundBar001").gameObject;
                fore2.GetComponent <UISprite> ().fillAmount = (amountSecond / 100);

                float      amountExp2 = (listPokemon[1].CurrentExperience * 100) / listPokemon[1].ExperienceNeeded;
                GameObject foreExp2   = barraExperiencia2.transform.FindChild("ForeExp001").gameObject;
                foreExp2.GetComponent <UISprite>().fillAmount = amountExp2 / 100;
            }
            else if (listPokemon.Count() == 3)
            {
                float amountFirst = (listPokemon [0].CurrentHappyness * 100) / listPokemon [0].Happyness;
                nombre1.GetComponent <UILabel>().text          = pkmBasic.GetPokemon(listPokemon[0].IdBasic).Name + " Nvl: " + listPokemon[0].Level;
                pokemon1.GetComponent <UISprite> ().spriteName = (listPokemon [0].IdBasic) + "";
                GameObject fore = progressBar1.transform.FindChild("ForegroundBar000").gameObject;
                fore.GetComponent <UISprite> ().fillAmount = (amountFirst / 100);

                float      amountExp = (listPokemon[0].CurrentExperience * 100) / listPokemon[0].ExperienceNeeded;
                GameObject foreExp   = barraExperiencia1.transform.FindChild("ForeExp000").gameObject;
                foreExp.GetComponent <UISprite>().fillAmount = (amountExp / 100);

                float amountSecond = ((listPokemon [1].CurrentHappyness * 100) / listPokemon [1].Happyness);
                nombre2.GetComponent <UILabel>().text          = pkmBasic.GetPokemon(listPokemon[1].IdBasic).Name + " Nvl: " + listPokemon[1].Level;
                pokemon2.GetComponent <UISprite> ().spriteName = (listPokemon [1].IdBasic) + "";
                GameObject fore2 = progressBar2.transform.FindChild("ForegroundBar001").gameObject;
                fore2.GetComponent <UISprite> ().fillAmount = (amountSecond / 100);

                float      amountExp2 = (listPokemon[1].CurrentExperience * 100) / listPokemon[1].ExperienceNeeded;
                GameObject foreExp2   = barraExperiencia2.transform.FindChild("ForeExp001").gameObject;
                foreExp2.GetComponent <UISprite>().fillAmount = amountExp2 / 100;

                float amountThird = ((listPokemon [2].CurrentHappyness * 100) / listPokemon [2].Happyness);
                nombre3.GetComponent <UILabel>().text          = pkmBasic.GetPokemon(listPokemon[2].IdBasic).Name + " Nvl: " + listPokemon[2].Level;
                pokemon3.GetComponent <UISprite> ().spriteName = (listPokemon [2].IdBasic) + "";
                GameObject fore3 = progressBar3.transform.FindChild("ForegroundBar002").gameObject;
                fore3.GetComponent <UISprite> ().fillAmount = (amountThird / 100);

                float      amountExp3 = (listPokemon[2].CurrentExperience * 100) / listPokemon[2].ExperienceNeeded;
                GameObject foreExp3   = barraExperiencia3.transform.FindChild("ForeExp002").gameObject;
                foreExp3.GetComponent <UISprite>().fillAmount = amountExp3 / 100;
            }
            else if (listPokemon.Count() == 0)
            {
                pokemon1.GetComponent <UISprite> ().spriteName = "0";
                pokemon2.GetComponent <UISprite> ().spriteName = "0";
                pokemon3.GetComponent <UISprite> ().spriteName = "0";
            }
            actualizarDatos = false;
            if (eggOwned.GetEquippedEgg() != null)
            {
                EggOwned egg = eggOwned.GetEquippedEgg();
                nombreHuevo.GetComponent <UILabel>().text = "Huevo " + egg.Category;
                float      amountEgg = ((egg.CurrentCycles * 100) / egg.TotalCycles);
                GameObject fore      = barraHuevo.transform.FindChild("Foreground").gameObject;
                spriteHuevo.GetComponent <UISprite>().spriteName           = "Egg";
                fore.GetComponent <UISprite>().fillAmount                  = amountEgg / 100;
                spriteHuevo.GetComponent <UISprite>().transform.localScale = new Vector3(150, 150, 0);
            }
            else
            {
                spriteHuevo.GetComponent <UISprite>().spriteName = "0";
            }
        }
    }
Esempio n. 13
0
 void Start()
 {
     pkmowned = new PokemonOwnedDAO();
     List <PokemonOwned> listPokemon = pkmowned.GetEquippedPokemon().ToList();
 }
Esempio n. 14
0
    public void GenerarBatalla()
    {
        UILabel label = texto.GetComponent <UILabel> ();

        label.text = "";
        PokemonBasicDAO     pkmBasic = new PokemonBasicDAO();
        PokemonOwnedDAO     pkmOwned = new PokemonOwnedDAO();
        PlayerDAO           player   = new PlayerDAO();
        List <PokemonOwned> lista    = pkmOwned.GetEquippedPokemon().ToList();
        PokemonOwned        owned    = lista [0];
        PokemonOwned        enemy    = pkmOwned.GenerarAleatorio();

        while (enemy.Level != owned.Level)
        {
            enemy.LevelUp();
        }
        if (enemy.Speed >= owned.Speed)
        {
            miTurno = false;

            sprite1.GetComponent <UISprite> ().spriteName = owned.IdBasic + "";
            sprite2.GetComponent <UISprite> ().spriteName = enemy.IdBasic + "";

            datosPrimero.GetComponent <UILabel> ().text = pkmBasic.GetPokemon(owned.IdBasic).Name;
            datosSegundo.GetComponent <UILabel> ().text = pkmBasic.GetPokemon(enemy.IdBasic).Name;

            while (enemy.Hp > 0 && owned.Hp > 0)
            {
                if (miTurno)
                {
                    int dano = owned.Attack - enemy.Defense / 2;
                    if (dano < 0)
                    {
                        dano = 0;
                    }
                    enemy.Hp  -= dano;
                    miTurno    = false;
                    label.text = label.text + "\nMi turno. Aliado infringe " + dano + " puntos de daño. Hp actual del enemigo: " + enemy.Hp;
                }
                else
                {
                    int dano = enemy.Attack - owned.Defense / 2;
                    if (dano < 0)
                    {
                        dano = 0;
                    }
                    owned.Hp  -= dano;
                    miTurno    = true;
                    label.text = label.text + "\nTurno del enemigo. Enemigo infringe " + dano + " puntos de daño. Hp actual del aliado: " + owned.Hp;
                }
            }


            if (owned.Hp < 1)
            {
                pkmOwned.UpdatePokemonHealth(owned.Id, owned.Hp);
                label.text = label.text + "\n\nBatalla perdida, pierdes " + enemy.Hp + " de oro";
                player.UpdateGold(player.GetPlayer().Gold - enemy.Hp);
            }
            else
            {
                pkmOwned.UpdatePokemonHealth(owned.Id, owned.Hp);
                label.text = label.text + "\n\nBatalla ganada, ganas " + owned.Hp + " de oro";
                player.UpdateGold(player.GetPlayer().Gold + owned.Hp);
            }
        }
    }