public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon) { this.playerParty = playerParty; this.wildPokemon = wildPokemon; StartCoroutine(SetupBattle()); }
void StartBattle(bool isTrainerBattle) { state = GameState.Battle; battleSystem.gameObject.SetActive(true); mainMenu.SetActive(false); this.isTrainerBattle = isTrainerBattle; var playerParty = playerController.GetComponent <PokemonParty>(); PokemonParty enemyParty = null; //Aqui deberia diferenciar entre si es un entrenador o un pokemon salvaje if (isTrainerBattle) { enemyParty = enemyController.GetComponent <PokemonParty>(); } else { //De momento solo hay un pokemon salvaje por encuentro, pero dejamos que sea con una lista por si hubiera mas List <Pokemon> wildPokemonsAux = new List <Pokemon>(); wildPokemonsAux.Add(enemyController.GetComponent <MapArea>().GetRandomPokemon()); enemyParty = new PokemonParty(wildPokemonsAux); } battleSystem.StartBattle(playerParty, enemyParty); //playerController.gameObject.SetActive(false); //En caso de realmente pasar del juego a la pantalla de batalla habria que cambiar la camara, ya que no serían la misma, pero en este caso solo tenemos una }
public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon) { //Assigne les paramètres aux variables this.playerParty = playerParty; this.wildPokemon = wildPokemon; //Appelle la coroutine SetupBattle et démarre la battle StartCoroutine(SetupBattle()); }
public void StartBattle(PokemonParty playerParty, PokemonLevel wildpokemon) { sounds = GetComponents <AudioSource>(); this.playerParty = playerParty; this.wildpokemon = wildpokemon; StartCoroutine(SetupBattle()); }
public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon) { this.playerParty = playerParty; this.wildPokemon = wildPokemon; player = playerParty.GetComponent <PlayerController>(); isTrainerBattle = false; StartCoroutine(SetupBattle()); }
//end Joaquin system /* * Estos metodos se encargan de iniciar el battle system */ #region InitRegion /* * Primer metodo que es llamado al iniciar la clase, asigna los equipos al jugador y al enemigo, resetea los iteradores y llama al setup para que haga el resto */ public void StartBattle(PokemonParty playerParty, PokemonParty enemyParty) { this.playerParty = playerParty; this.enemyParty = enemyParty; currentAction = 0; dialogBox.UpdateActionSelection(currentAction); currentMove = 0; currentMember = 0; StartCoroutine(SetupBattle()); }
//We want to setup everything at the very first frame of the battle public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon) { isTrainerBattle = false; this.playerParty = playerParty; //this. is to use our variable and not the parameter this.wildPokemon = wildPokemon; player = playerParty.GetComponent <PlayerController>(); //Set a reference the player party StartCoroutine(SetupBattle()); //We call our SetupBattle function }
public void StartTrainerBattle(PokemonParty playerParty, PokemonParty trainerParty) { this.playerParty = playerParty; this.trainerParty = trainerParty; isTrainerBattle = true; player = playerParty.GetComponent <PlayerController>(); trainer = trainerParty.GetComponent <TrainerController>(); StartCoroutine(SetupBattle()); }
public void StartTrainerBattle(PokemonParty playerParty, PokemonParty trainerParty) //Beggin the trainer battle { this.playerParty = playerParty; //this. is to use the variable and not the parameter this.trainerParty = trainerParty; spriteRenderer = GetComponent <SpriteRenderer>(); isTrainerBattle = true; player = playerParty.GetComponent <PlayerController>(); //Set a reference the player party trainer = trainerParty.GetComponent <TrainerController>(); //Same with trainer StartCoroutine(SetupBattle()); //We call our SetupBattle function }
public void StartBattle(PokemonParty _playerParty, Pokemon _wildPokemon) { Debug.Log("Choosing pokemons ..."); this.playerParty = _playerParty; this.wildPokemon = _wildPokemon; currentCoroutine = null; if (currentCoroutine == null) { currentCoroutine = StartCoroutine(SetupBattle()); } }
public int getNumPokemonsAlive(PokemonParty player1Team) { int pokemonsAlive = 0; for (int i = 0; i < player1Team.Pokemons.Count; i++) { if (player1Team.Pokemons[i].CurrentHP > 0) { pokemonsAlive++; } } return(pokemonsAlive); }
/*public void Init() //Function to not use a SerializedField, but to assign pokemons automaticly * { * memberSlots = GetComponentsInChildren<PartyMemberUI>(true); //Will return every children components attached in the PartyScreen * }*/ public void HandleUpdate(PokemonParty playerParty) { this.pokemonParty = playerParty; this.gameObject.SetActive(true); SetPartyData(pokemonParty.Pokemons); Action <int> onChoiceSelected = (choiceIndex2) => { if (choiceIndex2 == 0) { MenuController.Instance.ReturnToMainMenu(); } }; HandleChoiceSelection(onChoiceSelected); }
public void Setup(PokemonParty player1Team, PokemonParty player2Team) { //Game this.player1Team = player1Team; this.player2Team = player2Team; //UI currentAction = 0; dialogBox.UpdateActionSelection(currentAction); currentMove = 0; currentMember = 0; //Start! StartCoroutine(ManageGame()); }
void StartBattleJoaquin() { //Actualizamos el estado del juego state = GameState.Battle; //Actualizamos la UI battleSystem.gameObject.SetActive(true); mainMenu.SetActive(false); //Indicamos los equipos de cada jugador PokemonParty playerParty = playerController.GetComponent <PokemonParty>(); PokemonParty enemyParty = enemyController.GetComponent <PokemonParty>(); //Llamamos al battle system battleSystem.Setup(playerParty, enemyParty); }