public void UseCard(int i)
    {
        if (pHand[i].activeInHierarchy == true)
        {
            CardProperties cp = pHand[i].GetComponent <CardTemplate>().card.cardProperties;

            pHand[i].SetActive(false);
            discardPile.Add(pHand[i].GetComponent <CardTemplate>().card);
            pHand[i].GetComponent <CardTemplate>().card = null;
            switch (cp.title)
            {
            case "Slash":
                player.attacked = true;
                player.Slash();
                incToken();
                StartCoroutine(player.AttackRelease(0.8f));
                break;

            case "Dash":
                player.attacked = true;
                player.Dash();
                incToken();
                StartCoroutine(player.AttackRelease(.8f));
                break;

            case "Beam":
                player.attacked = true;
                player.Beam();
                incToken();
                StartCoroutine(player.AttackRelease(0.8f));
                break;

            case "Boomerang Dash":
                player.attacked = true;
                player.BoomerangDash();
                incToken();
                StartCoroutine(player.AttackRelease(0.8f));
                break;

            case "SpinSlash":
                player.attacked = true;
                player.SpinSlash();
                incToken();
                StartCoroutine(player.AttackRelease(0.8f));
                break;

            case "SuperBeam":
                player.attacked = true;
                player.SuperBeam();
                incToken();
                StartCoroutine(player.AttackRelease(0.8f));
                break;

            default:
                break;
            }
        }
    }
    public void UseCard(int i)
    {
        GameObject o = pHand[i];

        if (o.activeInHierarchy == true && forgeable == false)
        {
            //gm.TokenUpdate(1);
            Card           c  = o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card;
            CardProperties cp = c.cardProperties;

            pHand[i].SetActive(false);
            discardPile.Add(c);
            o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card = null;
            switch (cp.title)
            {
            case "Slash":
                // gm.actionText.text = cp.title;
                player.Slash();
                incToken();
                break;

            case "Dash":
                // gm.actionText.text = cp.title;
                player.Dash();
                incToken();
                break;

            case "Beam":
                //gm.actionText.text = cp.title;
                player.Beam();
                incToken();
                break;

            case "DashBeam":
                // gm.actionText.text = cp.title;

                break;

            default:
                break;
            }
        }
    }
Exemple #3
0
    public void UseCard(int i)
    {
        if (pHand[i].activeInHierarchy == true)
        {
            CardProperties cp = pHand[i].GetComponent <CardTemplate>().card.cardProperties;

            pHand[i].SetActive(false);
            discardPile.Add(pHand[i].GetComponent <CardTemplate>().card);
            pHand[i].GetComponent <CardTemplate>().card = null;
            switch (cp.title)
            {
            case "Slash":

                player.Slash();
                incToken();
                break;

            case "Dash":

                player.Dash();
                incToken();
                break;

            case "Beam":

                player.Beam();
                incToken();
                break;

            case "DashBeam":


                break;

            default:
                break;
            }
        }
    }