public void RemoveTargetPokemon()
 {
     gameObject.SetActive(false);
     enemyPokemon = null;
     enemyHPPP    = null;
     enabled      = false;
 }
 public void SetTargetPokemon(GameObject pokemon)
 {
     enemyPokemon = pokemon.GetComponent <Pokemon>();
     enemyHPPP    = pokemon.GetComponent <PokemonHPPP>();
     gameObject.SetActive(true);
     enabled = true;
 }
 public void RemoveActivePokemon()
 {
     enabled = false;
     gameObject.SetActive(false);
     movePanelScript.Clear();
     movePanelScript.pokemon = null;
     movePanel.SetActive(false);
     pokemon = null;
     hpPP    = null;
 }
 public void SetActivePokemon(Pokemon pokemon)
 {
     this.pokemon = pokemon;
     hpPP         = pokemon.components.hpPP;
     gameObject.SetActive(true);
     enabled = true;
     movePanel.SetActive(true);
     movePanelScript.pokemon = this.pokemon;
     movePanelScript.Setup();
 }
Ejemplo n.º 5
0
    //[Command] public void CmdRequestTrainerBattle(NetworkInstanceId otherTrainerNetId)
    //{
    //    NetworkServer.FindLocalObject(otherTrainerNetId).GetComponent<Trainer>().RpcIncomingBattleRequest(TrainersName, netId);
    //}
    //[Command] public void CmdAcceptBattleRequest(NetworkInstanceId otherTrainerNetId)
    //{
    //    NetworkServer.FindLocalObject(otherTrainerNetId).GetComponent<Trainer>().RpcRequestAcceted(TrainersName);
    //    NetworkServer.FindLocalObject(otherTrainerNetId).GetComponent<Trainer>().RpcInitTrainerBattle(netId);
    //    RpcInitTrainerBattle(otherTrainerNetId);
    //}
    //[Command] public void CmdDeclineBattleRequest(NetworkInstanceId otherTrainerNetId)
    //{
    //    NetworkServer.FindLocalObject(otherTrainerNetId).GetComponent<Trainer>().RpcRequestDenied(TrainersName);
    //}
    //[Command] public void CmdInitWildPokemonBattle(NetworkInstanceId netId)
    //{
    //    GameObject wildPokemon = NetworkServer.FindLocalObject(netId);

    //    pokemon.enemy = NetworkServer.FindLocalObject(netId);
    //    pokemon.inBattle = true;
    //    pokemon.RpcSetEnemy(netId);

    //    //wildPokemon.GetComponent<Pokemon_AI>().target = activePokemon.gameObject;
    //    wildPokemon.GetComponent<Pokemon>().inBattle = true;
    //    wildPokemon.GetComponent<Pokemon>().enemy = pokemon.gameObject;
    //    //wildPokemon.GetComponent<Pokemon_AI>().worldState = Pokemon_AI.WorldStates.Battle;
    //}
    //#endregion

    private void GetStatsBack()
    {
        PokemonHPPP  hpPP  = pokemon.components.hpPP;
        PokemonStats stats = pokemon.components.stats;

        PokemonData data = new PokemonData(pokemon.pokemonName, pokemon.nickname, pokemon.equippedItem, (int)pokemon.gender, (int)pokemon.nature, pokemon.level, hpPP.curMaxHP, hpPP.curMaxPP,
                                           stats.curMaxATK, stats.curMaxDEF, stats.curMaxSPATK, stats.curMaxSPDEF, stats.curMaxSPD, hpPP.curHP, hpPP.curPP, stats.curATK, stats.curDEF, stats.curSPATK, stats.curSPDEF, stats.curSPD,
                                           hpPP.hpEV, hpPP.ppEV, stats.atkEV, stats.defEV, stats.spatkEV, stats.spdefEV, stats.spdEV, hpPP.hpIV, hpPP.ppIV, stats.atkIV, stats.defIV, stats.spatkIV, stats.spdefIV, stats.spdIV,
                                           pokemon.curEXP, pokemon.id, pokemon.fromTrade);

        int index = PokemonRoster.FindIndex(x => x.id == data.id);

        PokemonRoster[index] = data;
    }