예제 #1
0
    public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon)
    {
        this.playerParty = playerParty;
        this.wildPokemon = wildPokemon;

        StartCoroutine(SetupBattle());
    }
예제 #2
0
    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
    }
예제 #3
0
 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());
 }
예제 #4
0
    public void StartBattle(PokemonParty playerParty, PokemonLevel wildpokemon)
    {
        sounds           = GetComponents <AudioSource>();
        this.playerParty = playerParty;
        this.wildpokemon = wildpokemon;

        StartCoroutine(SetupBattle());
    }
예제 #5
0
    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());
    }
예제 #7
0
    //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
    }
예제 #8
0
    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());
    }
예제 #9
0
    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
    }
예제 #10
0
    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);
    }
예제 #12
0
    /*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());
    }
예제 #14
0
    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);
    }