Exemple #1
0
    public void ClearAllType(Card.eCardType cardType)
    {
        /*
         * foreach(Card card in cardHand)
         * {
         *  if(card.type == cardType)
         *  {
         *      Debug.Log(card.ToString());
         *      //cardHand.Remove(card);
         *  }
         * }
         */

        for (int i = cardHand.Count - 1; i >= 0; i--)
        {
            if (cardHand[i].type == cardType)
            {
                Debug.Log("Removing " + cardHand[i].ToString() + " at index " + i);
                cardHand.RemoveAt(i);
            }
        }

        foreach (Card card in cardHand)
        {
            Debug.Log("Card " + card + "left in hand");
        }
    }
    public void AttackTrigger(Card attkInfo)
    {
        CheckEvade();
        storedAttkValue = attkInfo.powerLevel;
        attackType      = attkInfo.type;
        if (p1Hand.isAttacking)
        {
            p1_IsAttacking = true;
        }
        else
        {
            p1_IsAttacking = false;
        }

        if (attackType == Card.eCardType.Bomb)
        {
            if (p1_IsAttacking)
            {
                attkNmbrOfType = p1Hand.redInHand;
            }
            else
            {
                attkNmbrOfType = p2Hand.redInHand;
            }
        }
        if (attackType == Card.eCardType.Charge)
        {
            if (p1_IsAttacking)
            {
                attkNmbrOfType = p1Hand.blueInHand;
            }
            else
            {
                attkNmbrOfType = p2Hand.blueInHand;
            }
        }
        if (attackType == Card.eCardType.Laser)
        {
            if (p1_IsAttacking)
            {
                attkNmbrOfType = p1Hand.greenInHand;
            }
            else
            {
                attkNmbrOfType = p2Hand.greenInHand;
            }
        }
        //attkPowerStage == How many of card type are in attack hand? Set what power stage the attack will be at. 1 = One card, 2 = Two cards, 3 = Three cards
        //sDebug.Log("storedAttkValue = " + storedAttkValue + " at power stage " + testHandNmbrAttk);
    }