void NextPlayerTurn() { PlayerInteractions PI = players[actualPlayerTurn].GetComponent <PlayerInteractions>(); if (PI == null) { NextPlayerTrigger(); } else { CheckTurnVar(PI); } if (nextPlayerTrigger) { PI.turn = false; PI.SpawnChipsObjects(); if (PI.actualBid > highestBid) { highestBid = PI.actualBid; } if (PlayersReadyThisRound()) { NextRound(); } NextPlayerTrigger(); } }
void NextRound() { round++; for (int i = 0; i < players.Count; i++) { if (players[i] != null) { PlayerInteractions PI = players[i].GetComponent <PlayerInteractions>(); if (!PI.gameEnded) { moneyToWin += PI.actualBid; PI.actualBidFloat = 1; PI.actualBid = 0; PI.highestBid = 0; PI.movesThisRound = 0; PI.SpawnChipsObjects(); PI.turn = false; } } } if (round == 1) { AddCardsOnTable(3); players[actualSmallBlind].GetComponent <PlayerInteractions>().turn = true; } else if (round == 2 || round == 3) { AddCardsOnTable(1); players[actualSmallBlind].GetComponent <PlayerInteractions>().turn = true; } else if (round == 4) { playerTurn = false; for (int i = 0; i < players.Count; i++) { players[i].GetComponent <PlayerInteractions>().cardsDealed = false; } EndDeal(); } highestBid = 0; }
void SetBlinds() { PlayerInteractions smallBlind = players[actualSmallBlind].GetComponent <PlayerInteractions>(); smallBlind.actualBid = 25; smallBlind.actualMoney -= 25; PlayerInteractions bigBlind = players[actualBigBlind].GetComponent <PlayerInteractions>(); bigBlind.actualBid = 50; bigBlind.actualMoney -= 50; highestBid = 50; for (int i = 0; i < players.Count; i++) { PlayerInteractions PI = players[i].GetComponent <PlayerInteractions>(); PI.SpawnChipsObjects(); PI.highestBid = highestBid; } }