public void configurateLevel() { _difficultyLevel = GameManager.GetInstance().getGameDifficulty(); switch (_difficultyLevel) { case 1: _controlShifts.Invoke("playerEnemy", 5); _characterBuilder.NumberCharacters = 2; _characterBuilder.NUMBER_ATTACKS_DEFINITIVE1 = 0; _characterBuilder.NUMBER_ATTACKS_USEFUL1 = 4; _characterBuilder.NUMBER_ATTACKS_USELESS1 = 1; _characterBuilder.NUMBER_HEALING_OBJECTS1 = 1; _characterBuilder.SPLIT_ATTACKS1 = 2; _lamiaController.Life = 4; break; case 2: _controlShifts.Invoke("playerTurn", 5); _characterBuilder.NumberCharacters = 2; _characterBuilder.NUMBER_ATTACKS_DEFINITIVE1 = 1; _characterBuilder.NUMBER_ATTACKS_USEFUL1 = 2; _characterBuilder.NUMBER_ATTACKS_USELESS1 = 2; _characterBuilder.NUMBER_HEALING_OBJECTS1 = 1; _characterBuilder.SPLIT_ATTACKS1 = 0; _lamiaController.Life = 5; break; case 3: _controlShifts.Invoke("playerEnemy", 5); _characterBuilder.NumberCharacters = 2; _characterBuilder.NUMBER_ATTACKS_DEFINITIVE1 = 0; _characterBuilder.NUMBER_ATTACKS_USEFUL1 = 4; _characterBuilder.NUMBER_ATTACKS_USELESS1 = 1; _characterBuilder.NUMBER_HEALING_OBJECTS1 = 1; _characterBuilder.SPLIT_ATTACKS1 = 2; _lamiaController.Life = 4; break; case 4: _characterBuilder.NumberCharacters = 2; _lamiaController.Life = 5; break; default: Debug.Log("no cuadran los niveles de dificultad"); break; } }
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); } }