Exemplo n.º 1
0
    // Everything starts from root node
    void CheckAttack(int attackType)
    {
        int finalAttack = attackType;

        if (CurrentNode.CheckChildren(finalAttack))
        {
            //set the current node to be the valid child
            CurrentNode = CurrentNode.GetChild(finalAttack);

            //check if it's one of the finisher moves
            if (CurrentNode.isFinisher)
            {
                //add it to four to get the forceful versions
                finalAttack = 4 + attackType;
                CurrentNode = RootNode;
            }
            ExecuteAttack(finalAttack);
            print("Valid continuer");
        }
        else
        {
            CurrentNode = RootNode;
            print("Not a valid continuer");
        }
    }