Beispiel #1
0
    IEnumerator selectAttackCoroutine(string word)
    {
        yield return(new WaitForEndOfFrame());

        SaveSystem.increaseMicrophonePressedTime(true, word, ChangeScene.EspikinglishMinigames.RPG);

        if (characterContainsAttack())
        {
            // crea el objeto que muestra cual es que uso

            /*
             * GameObject usedObject = Instantiate(_usedObject);
             * usedObject.GetComponent<SpriteRenderer>().sprite = _currentAttack._sprite;
             * usedObject.GetComponent<AudioSource>().clip = _currentAttack._soundEffect;
             * usedObject.GetComponent<AudioSource>().Play();
             */
            StartCoroutine(createUsedObjectCoroutine());

            if (_currentAttack._cure)
            {
                HeroProperties[]      aux    = FindObjectsOfType <HeroProperties>();
                List <HeroProperties> revive = new List <HeroProperties>();

                foreach (HeroProperties hero in aux)
                {
                    if (!hero.IsLive)
                    {
                        Lamia.addCharacter(hero);
                    }

                    hero.getCharacterStastic(1);
                }

                if (FindObjectOfType <FinalBoss>())
                {
                    FindObjectOfType <FinalBoss>().effectiveAttack(_currentAttack._attack, _hero.Counters);

                    if (FindObjectOfType <FinalBoss>().Counters.Count > 0)
                    {
                        _controlShifts.CurrentHero = _controlShifts.newChallenge();
                    }
                }
                //muestra que gano vida
                Invoke("feeckbackGotLife", 1);
                //para finalizar el turno
                _controlShifts.Invoke("playerEnemy", 4);
                //frase del ataque
                FindObjectOfType <LevelInformationPanel>().showDialogs(_currentAttack._sentenceToCompleteAttack, false);
                _hero.GetComponent <MoveHeroe>().Invoke("changeDirection", 1);
            }
            else
            {
                if (Lamia.effectiveAttack(_typeAttack, _hero.Counters))
                {
                    //aplcia el daño
                    if (Lamia.lostLife(_currentAttack._damage))
                    {
                        if (_controlShifts.CurrentHero.AssociatedObject)
                        {
                            _controlShifts.Invoke("playerEnemy", 6);
                            _controlShifts.CurrentHero.AssociatedObject = false;
                            _hero.GetComponent <MoveHeroe>().Invoke("changeDirection", 3);
                            _controlShifts.CurrentHero = _controlShifts.newChallenge();
                        }
                        else
                        {
                            _controlShifts.Invoke("playerEnemy", 3);
                            _hero.GetComponent <MoveHeroe>().Invoke("changeDirection", 1);
                        }
                    }

                    //frase del ataque
                    FindObjectOfType <LevelInformationPanel>().showDialogs(_currentAttack._sentenceToCompleteAttack, false);
                }
                else
                {
                    if (FindObjectOfType <FinalBoss>())
                    {
                        if (FindObjectOfType <FinalBoss>().Counters.Count > 0 || _controlShifts.CurrentHero.Life <= 1)
                        {
                            _controlShifts.CurrentHero = _controlShifts.newChallenge();
                        }
                    }

                    _controlShifts.Invoke("playerEnemy", 3);
                    FindObjectOfType <LevelInformationPanel>().showDialogs(_currentAttack._sentencesToNotUseAttack, false);
                    _hero.GetComponent <MoveHeroe>().Invoke("changeDirection", 1);
                }
            }
            _hero.GetComponent <HeroProperties>().Attacks.Remove(_currentAttack);
        }
    }
Beispiel #2
0
        public Character GetEnemy(int id)
        {
            Character nextChar;

            switch (id)
            {
            //Low level
            case 100:
                nextChar = new Bat();
                return(nextChar);

            case 101:
                nextChar = new Rat();
                return(nextChar);

            case 102:
                nextChar = new Kobold();
                return(nextChar);

            case 103:
                nextChar = new Slime();
                return(nextChar);

            case 104:
                nextChar = new Farmer();
                return(nextChar);

            case 105:
                nextChar = new Imp();
                return(nextChar);

            case 106:
                nextChar = new Zombie();
                return(nextChar);

            case 107:
                nextChar = new Phantom();
                return(nextChar);

            case 108:
                nextChar = new Goblin();
                return(nextChar);

            case 109:
                nextChar = new Witch();
                return(nextChar);

            //Mid level
            case 110:
                nextChar = new Harpy();
                return(nextChar);

            case 111:
                nextChar = new Elemental();
                return(nextChar);

            case 112:
                nextChar = new Nymph();
                return(nextChar);

            case 113:
                nextChar = new Vampire();
                return(nextChar);

            case 114:
                nextChar = new Lamia();
                return(nextChar);

            case 115:
                nextChar = new Qilin();
                return(nextChar);

            case 116:
                nextChar = new Unicorn();
                return(nextChar);

            case 117:
                nextChar = new Jinn();
                return(nextChar);

            case 118:
                nextChar = new Xorn();
                return(nextChar);

            case 119:
                nextChar = new Antlion();
                return(nextChar);

            //High level
            case 120:
                nextChar = new Yeti();
                return(nextChar);

            case 121:
                nextChar = new Orc();
                return(nextChar);

            case 122:
                nextChar = new Minotaur();
                return(nextChar);

            case 123:
                nextChar = new Troll();
                return(nextChar);

            case 124:
                nextChar = new Cyclop();
                return(nextChar);

            case 125:
                nextChar = new Drake();
                return(nextChar);

            default:
                nextChar = new Slime();
                return(nextChar);
            }
        }