Ejemplo n.º 1
0
    public void Init(Battle battle, PokemonCharacter source, ActiveMoveData activeData, Pokemon.TargetLocation targetLocation)
    {
        this.battle = battle;
        this.battle.AddNewMove(this);
        targetScript = GetComponent <TargetableElement>();
        targetScript.sourceElement = this;
        this.source         = source;
        this.activeData     = activeData;
        this.targetLocation = targetLocation;

        PrepareDamageData();
        OnCreatedMove();
    }
Ejemplo n.º 2
0
    //Check Input of actions here (move, megaevo, Switch pokemon, use item FROM BAG, ultraburst? zmove?)
    void RunAction(Globals.ActionType action, int moveSlotId, bool zMove = false)
    {
        //Here start cooldown if needed



        //Move
        if (action == Globals.ActionType.Move)
        {
            //set cooldown
            pokemonData.StartActionCoolDown();
            Transform myTarget = camPokemon.GetTargetedPokemon();
            Pokemon.TargetLocation targetto;
            if (myTarget == null)
            {
                targetto = new Pokemon.TargetLocation(transform.forward);
            }
            else
            {
                targetto = new Pokemon.TargetLocation(Vector3.zero, myTarget);
            }

            pokemonData.RunMove(moveSlotId, 0, zMove, false, targetto);
        }


        //Switch
        else if (action == Globals.ActionType.Switch)
        {
            //set cooldown
            pokemonData.StartActionCoolDown();
            //SwitchIn(Pokemon)
        }


        //MegaEvolution or Ultra burst
        else if (action == Globals.ActionType.MegaEvolution || action == Globals.ActionType.UltraBurst)
        {
            //RunMegaEvo
            //Callback.OnSetCooldown
        }
    }