Exemplo n.º 1
0
    public void ReplaceAThing()
    {
        thing.SetToNothing();
        board.thingInfoArea.text = "Replace a Thing";
        List <ActionCard> playerCards = player.hand.GetAllCards();

        if (playerCards.Count == 0)
        {
            return;
        }
        ActionCard card = playerCards[Random.Range(0, playerCards.Count)];

        playerCards.Remove(card);
        MoveCard(card.gameObject, "Graveyard", 3, 0.5f);
        GameObject      cardObj    = Instantiate(board.actionCardPrefab, board.deck.transform);
        Data_ActionCard cardData   = DeckManager.instance.DealActionCard();
        ActionCard      actionCard = cardObj.GetComponent <ActionCard>();

        actionCard.SetData(cardData);
        cardObj.SetActive(false);
        actionCard.interactable = true;
        MoveCard(cardObj, "PlayerHand", 2, 0.5f);
        Debug.Log("Player has " + enemy.hand.GetCardCount() + " cards");
        player.hand.AddCard(actionCard);
    }
Exemplo n.º 2
0
    public void GetAThing()
    {
        thing.SetToNothing();
        board.thingInfoArea.text = "Get a Thing";
        GameObject      cardObj    = Instantiate(board.actionCardPrefab, board.deck.transform);
        Data_ActionCard cardData   = DeckManager.instance.DealActionCard();
        ActionCard      actionCard = cardObj.GetComponent <ActionCard>();

        actionCard.SetData(cardData);
        cardObj.SetActive(false);
        actionCard.interactable = true;
        MoveCard(cardObj, "PlayerHand", 2, 0.5f);
        Debug.Log("Player has " + enemy.hand.GetCardCount() + " cards");
        player.hand.AddCard(actionCard);
    }
Exemplo n.º 3
0
    public void DealCard(int target)
    {
        int count = Mathf.Min(round, 4);

        if (target == 0)
        {
            count -= player.hand.GetCardCount();
            if (round < 5)
            {
                count--;
            }
            //Debug.Log("Player " + target + " has " + player.hand.GetCardCount() + "cards.");
        }
        else
        {
            count -= enemy.hand.GetCardCount();
            //Debug.Log("Player " + target + " has " + enemy.hand.GetCardCount() + "cards.");
        }
        Debug.Log("Deal " + count + " cards to Player " + target);
        for (int i = 0; i < count; i++)
        {
            GameObject      cardObj    = Instantiate(board.actionCardPrefab, board.deck.transform);
            Data_ActionCard cardData   = DeckManager.instance.DealActionCard();
            ActionCard      actionCard = cardObj.GetComponent <ActionCard>();
            actionCard.SetData(cardData);
            cardObj.SetActive(false);
            if (target == 0)
            {
                actionCard.interactable = true;
                MoveCard(cardObj, "PlayerHand", 2, 0.5f);
                Debug.Log("Player has " + enemy.hand.GetCardCount() + " cards");
                player.hand.AddCard(actionCard);
            }
            else
            {
                MoveCard(cardObj, "EnemyHand", 2, 0.5f);
                enemy.hand.AddCard(actionCard);
                Debug.Log("Enemy has " + enemy.hand.GetCardCount() + " cards");
            }
        }
    }