Ejemplo n.º 1
0
    // Clone
    public Trainer Clone()
    {
        List <Pokemon> partyPokemon = new List <Pokemon>();

        for (int i = 0; i < party.Count; i++)
        {
            partyPokemon.Add(Pokemon.Clone(party[i]));
        }

        List <Item> trainerItems = new List <Item>();

        for (int i = 0; i < items.Count; i++)
        {
            trainerItems.Add(items[i].Clone());
        }

        Trainer cloneTrainer = new Trainer(
            name: name,
            playerID: playerID, teamPos: teamID,
            isWildPokemon: isWildPokemon,
            party: partyPokemon,
            items: trainerItems,

            megaRing: megaRing,
            ZRing: ZRing,
            dynamaxBand: dynamaxBand
            );

        // battle
        cloneTrainer.teamID     = teamID;
        cloneTrainer.controlPos = controlPos;
        cloneTrainer.bProps     = bProps.Clone(cloneTrainer);
        return(cloneTrainer);
    }
Ejemplo n.º 2
0
    public void AddNewActivePokemon(string pokemon)
    {
        if (PanelConfirmationController.yesButtonPressed)
        {
            Pokemon p = null;
            for (int i = 0; i < GameObject.Find(panel.GetComponent <PanelController> ().enemyPlayer).GetComponent <PlayerScript> ().banc.Count; ++i)
            {
                Debug.Log(pokemon);
                Debug.Log(GameObject.Find(panel.GetComponent <PanelController> ().enemyPlayer).GetComponent <PlayerScript> ().banc [i].name);
                if (pokemon == GameObject.Find(panel.GetComponent <PanelController> ().enemyPlayer).GetComponent <PlayerScript> ().banc[i].name)
                {
                    p = GameObject.Find(panel.GetComponent <PanelController> ().enemyPlayer).GetComponent <PlayerScript> ().banc [i];
                }
            }

            GameObject.Find(panel.GetComponent <PanelController> ().enemyPlayer).GetComponent <PlayerScript> ().activePokemon = p.Clone();;
            GameObject.Find(panel.GetComponent <PanelController> ().enemyPlayer).GetComponent <PlayerScript> ().banc.Remove(p);
            PanelController.waitForNewActivePokemon = false;
            PanelController.activePokemonDead       = false;
            PanelController.askForNewActivePokemon  = true;
            panel.GetComponent <PanelController> ().changeText();
        }
        else if (PanelConfirmationController.noButtonPressed)
        {
            panel.GetComponent <PanelController> ().changeText();
        }
    }