Beispiel #1
0
    private void OnMouseDown()
    {
        if (deckOfCards.Count != 0)
        {
            checkHandToDraw(userHandRef);

            if (ableToDraw == true)
            {
                userHandRef.SetHandState(UserHand.HandState.DrawCard);
            }

            if (userHandRef.GetHandState() == UserHand.HandState.DrawCard)
            {
                userHandRef.DrawCardInHand(userHandRef.GetCardHand().Count);

                checkHandToDraw(userHandRef);

                if (ableToDraw == true)
                {
                    StartCoroutine(gMRef.AITurn());
                }
                else
                {
                    if (userHandRef.GetCardHand().Count == 2)
                    {
                        gMRef.checkInteractiveButton(true);
                    }
                    userHandRef.SetHandState(UserHand.HandState.PlayCard);
                }
            }
        }
    }
Beispiel #2
0
    private bool checkHandToDraw(UserHand userRef)
    {
        int cardHandCounter = 0;

        bool checkDraw = false;

        for (int i = 0; i < userRef.GetCardHand().Count; i++)
        {
            if (userRef.GetCardHand()[i].GetComponent <CardBehaviour>().GetUniqueCardIDNumber() != pileOfCardsRef.GetCardRef().GetComponent <CardBehaviour>().GetUniqueCardIDNumber() && userRef.GetCardHand()[i].GetComponent <CardBehaviour>().GetUniqueCardIDColor() != pileOfCardsRef.GetCardRef().GetComponent <CardBehaviour>().GetUniqueCardIDColor())
            {
                cardHandCounter++;
            }
        }

        if (cardHandCounter == userRef.GetCardHand().Count&& userRef.GetHandState() != UserHand.HandState.WaitForTurn)
        {
            checkDraw = true;
        }
        else
        {
            checkDraw = false;
        }

        ableToDraw = checkDraw;
        return(ableToDraw);
    }
Beispiel #3
0
    public void EndOfTurn(UserHand handOfUser)
    {
        //Debug.Log("ENDOFTURN!");

        if (handOfUser.GetCardHand().Count == 1)
        {
            if (unoCall == false)
            {
                handOfUser.DrawCardInHand(handOfUser.GetCardHand().Count);
                handOfUser.DrawCardInHand(handOfUser.GetCardHand().Count);
            }
        }
    }
Beispiel #4
0
    private void OnMouseEnter()
    {
        if (cardStateReference != CardState.AICard)
        {
            if (userCardHand != null && userCardHand.GetHandMovement() == false)
            {
                if (cardStateReference == CardState.CardInHand)
                {
                    SwitchColliders();
                    userCardHand.SetCardSelected(true);

                    if (this.transform.position == originalCardPos && userCardHand.GetCardHand().Count != 1)
                    {
                        this.transform.position += cardOverOffset;
                    }
                }
            }
        }
    }
Beispiel #5
0
    public void StartOfTurn(UserHand handOfUser)
    {
        //Debug.Log("STARTOFTURN!");

        if (handOfUser.GetCardHand().Count <= 2)
        {
            checkInteractiveButton(true);
        }
        else
        {
            checkInteractiveButton(false);
        }
    }