Exemple #1
0
    public void CardDraw()
    {
        csc.CardReloading();

        int b = Random.Range(0, deckcards - 1);

        if (BDeck[b].Cards != null)
        {
            for (int j = 0; j < 10; j++)
            {
                if (Hand[j].Cards == null)
                {
                    Cardsc csc = gameObject.GetComponent <Cardsc>();
                    Hand[j]           = BDeck[b];
                    csc.Costs[j].text = "" + Hand[j].CardsRCost;
                    csc.Power[j].text = "" + Hand[j].CardsRPower;
                    Text tx = csc.HPgo[j].GetComponent <Text>();
                    tx.text               = "" + Hand[j].CardsRHP;
                    BDeck[b].Cards        = null;
                    BDeck[b].CardsOGCost  = 0;
                    BDeck[b].CardsRCost   = 0;
                    BDeck[b].CardsOGPower = 0;
                    BDeck[b].CardsRPower  = 0;
                    BDeck[b].CardsOGHP    = 0;
                    BDeck[b].CardsRHP     = 0;
                    CardReload(b);
                    HandCount++;
                    ue.CardDrowEffect(j + 1);
                    HandCard();
                    deckcards--;
                    break;
                }
                else if (Hand[9].Cards != null)
                {
                    BDeck[b].Cards        = null;
                    BDeck[b].CardsOGCost  = 0;
                    BDeck[b].CardsRCost   = 0;
                    BDeck[b].CardsOGPower = 0;
                    BDeck[b].CardsRPower  = 0;
                    BDeck[b].CardsOGHP    = 0;
                    BDeck[b].CardsRHP     = 0;
                    Announce.text         = "카드를 더 이상 뽑을 수 없어 카드가 소멸됩니다.";
                    StopCoroutine("AnnounceAppear");
                    StopCoroutine("AnnounceDisappear");
                    AATC = 0;
                    StartCoroutine("AnnounceAppear");
                    CardReload(b);
                    deckcards--;
                    break;
                }
            }
        }
        else if (BDeck[0].Cards == null)
        {
            Announce.text = "덱에 카드가 없어 피해를 받습니다!";
            StopCoroutine("AnnounceAppear");
            StopCoroutine("AnnounceDisappear");
            AATC = 0;
            StartCoroutine("AnnounceAppear");
        }


        for (int i = 0; i < 10; i++)
        {
            if (Hand[i].Cards != null)
            {
                if (Hand[i].CardsRCost <= Energy)
                {
                    CarduseCant = false;
                    break;
                }
            }
            else
            {
                CarduseCant = true;
                break;
            }
        }
    }