Exemplo n.º 1
0
    public void DrawCards(int amount, bool discardHand)
    {
        handAnimator.SetBool("Hidden", false);
        if (discardHand)
        {
            discarded.AddRange(hand);
            hand.Clear();
        }

        for (int i = 0; i < amount; i++)
        {
            if (hand.Count >= MAX_HAND_SIZE)
            {
                break;
            }
            if (deck.Count <= 0)
            {
                ReshuffleDeck();
            }
            int selectedIndex = Random.Range(0, deck.Count - 1);

            hand.Add(deck[selectedIndex]);
            deck.Remove(deck[selectedIndex]);
        }

        handUI.UpdateHandUI(hand);
    }
Exemplo n.º 2
0
    void Start()
    {
        handTierOne   = new Vector2[] { bOrb, rOrb, gOrb, pOrb };
        handTierTwo   = new Vector2[] { bTalisman, rTalisman, gTalisman, pTalisman };
        handTierThree = new Vector2[] { bCharm, rCharm, gCharm, pCharm };

        TurnManager.onNewTurn += CheckNewTurn;

        handUI.UpdateHandUI(false);
    }
Exemplo n.º 3
0
    public void StartGame()
    {
        if (validSeed)
        {
            uiManager.SetPlayerNames();

            Shuffler.seed = inputField.text;

            tierOne.InitializeDeck();
            tierTwo.InitializeDeck();
            tierThree.InitializeDeck();

            StateMachine.gameStarted = true;
            TurnManager.NextTurn();

            p1.UpdateHandUI(true);
            p2.UpdateHandUI(true);
            p3.UpdateHandUI(true);
            p4.UpdateHandUI(true);

            gameObject.SetActive(false);
        }
    }