Пример #1
0
 //Phase 2: Card Battle
 void SummonCard(CardModel card)
 {
     if (gamePhase != 2)
     {
         return;
     }
     else
     {
         //At the beginning, bot will play the card, the switch turn to the player
         if (playerCardOnPlate == null && botCardOnPlate == null)
         {
             card.MoveCard(versusCardPos[1].position, versusCardPos[1].localScale);
             card.ToFaceUp();
             currentTurn = 1;
             botCards.Remove(card);
             botCardOnPlate = card;
             LockTheCardTrigger(false);
             view.UpdateNotification("Your turn.");
             Debug.Log("Bot Play first card");
         }
         else
         {
             //Player Turn
             if (currentTurn == 1)
             {
                 card.MoveCard(versusCardPos[0].position, versusCardPos[0].localScale);
                 card.ToFaceUp();
                 playerCardOnPlate = card;
                 playerCards.Remove(card);
                 LockTheCardTrigger(true);
                 Debug.Log("Player play card");
                 StartCoroutine(BriefDelayBeforeCardBattle(1));
             }
             //Bot Turn
             if (currentTurn == -1)
             {
                 card.MoveCard(versusCardPos[1].position, versusCardPos[1].localScale);
                 card.ToFaceUp();
                 botCards.Remove(card);
                 botCardOnPlate = card;
                 Debug.Log("Bot play card");
                 StartCoroutine(BriefDelayBeforeCardBattle(-1));
             }
         }
     }
 }
Пример #2
0
    //Phase 1: picking up card
    void AddToPlayerHand(CardModel card)
    {
        if (playerCardsNb < 5)
        {
            card.MoveCard(playerCardPos[playerCardsNb].position, playerCardPos[playerCardsNb].localScale);
            card.onLockCard = true;
            card.teamID     = 1;
            playerCards.Add(card);
            card.ToFaceUp();
            allCard.Remove(card);

            //The player already pickup all cards-> all the reaminng card belong to bot
            if (playerCardsNb == 4)
            {
                onCardClicked = null;
                StartCoroutine(BotPickingCard());
            }
            else
            {
                playerCardsNb++;
            }
        }
    }