예제 #1
0
    IEnumerator Howl()
    {
        // give random celestial in hand +2 damage
        Card[] cards   = hand.GetCards();
        bool   isValid = cards.Any(card => card.GetType() == CardType.Summon);

        if (!isValid)
        {
            yield break;
        }
        Card randomCard = null;

        while (randomCard == null)
        {
            Card pickedCard = cards[Random.Range(0, cards.Length)];
            if (pickedCard.GetType() == CardType.Summon)
            {
                randomCard = pickedCard;
                break;
            }
        }
        randomCard.AddAttack(HOWL_DAMAGE);
        howlRoutineRunning = false;
    }
예제 #2
0
파일: Regent.cs 프로젝트: ssimon419/BOTE
    // Method passes the board of the game in; place all cards being played under the board object?
    void addCounters(Board board)
    {
        string tag = gameObject.tag;

        if (tag.Equals("playerOne"))
        {
            for (int boardIndex = 0; boardIndex < board.GetCardsOnBoard(tag).getCardList().Count; boardIndex++)
            {
                Card target = board.GetCardsOnBoard(tag).getCardList()[boardIndex];
                target.AddHealth(2);
                target.AddAttack(2);
            }
        }

        if (tag.Equals("playerTwo"))
        {
            for (int boardIndex = 0; boardIndex < board.GetCardsOnBoard(tag).getCardList().Count; boardIndex++)
            {
                Card target = board.GetCardsOnBoard(tag).getCardList()[boardIndex];
                target.AddHealth(2);
                target.AddAttack(2);
            }
        }
    }