progress
This commit is contained in:
@@ -48,7 +48,6 @@ void conversationQueueBeginBetting() {
|
||||
// This is an AI player, get their turn.
|
||||
BGB_MESSAGE("AI turn to bet");
|
||||
pokerAi(POKER_PLAYER_BETTER, &turn);
|
||||
|
||||
BGB_printf("AI Decided to %u, with %u chips and %u confidence, bluffin: %u", turn.type, turn.chips, turn.confidence, turn.bluff);
|
||||
|
||||
switch(turn.type) {
|
||||
@@ -121,7 +120,10 @@ void conversationQueueNextBetter() {
|
||||
|
||||
// If we reach this point then we either need to begin the betting round, or
|
||||
// we are going to move to the winning decider.
|
||||
if(POKER_COMMUNITY_SIZE_MAX == POKER_COMMUNITY_SIZE) {
|
||||
if(
|
||||
POKER_COMMUNITY_SIZE_MAX == POKER_COMMUNITY_SIZE ||
|
||||
pokerGetRemainingBetterCount() <= 1
|
||||
) {
|
||||
QUEUE_ITEM = QUEUE_WINNER_DECIDE;
|
||||
conversationQueueNext();
|
||||
return;
|
||||
@@ -133,6 +135,7 @@ void conversationQueueNextBetter() {
|
||||
|
||||
void conversationQueueFlopTurnRiver() {
|
||||
uint8_t i, count;
|
||||
pokerplayer_t *player;
|
||||
|
||||
QUEUE_ITEM = QUEUE_BEGIN_BETTING;
|
||||
|
||||
@@ -154,15 +157,16 @@ void conversationQueueFlopTurnRiver() {
|
||||
}
|
||||
|
||||
// Reset each players required to bet state
|
||||
for(i = 0; i < POKER_PLAYER_COUNT_MAX; i++) {
|
||||
POKER_PLAYERS[i].state &= ~POKER_PLAYER_STATE_HAS_BET_THIS_ROUND;
|
||||
POKER_PLAYERS[i].timesRaised = 0;
|
||||
}
|
||||
do {
|
||||
player = POKER_PLAYERS + i;
|
||||
player->state &= ~POKER_PLAYER_STATE_HAS_BET_THIS_ROUND;
|
||||
player->timesRaised = 0;
|
||||
} while(++i < POKER_PLAYER_COUNT_MAX);
|
||||
|
||||
// In reality we'd burn the top card but that would waste some CPU I need.
|
||||
// Deal the top cards.
|
||||
for(i = 0; i < count; i++) {
|
||||
POKER_COMMUNITY[POKER_COMMUNITY_SIZE++] = POKER_DECK[POKER_DECK_SIZE--];
|
||||
POKER_COMMUNITY[POKER_COMMUNITY_SIZE++] = POKER_DECK[--POKER_DECK_SIZE];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,8 +23,8 @@
|
||||
#define BORDER_TILE_BOTTOM_CENTER BORDER_TILE_BOTTOM_LEFT + 1
|
||||
#define BORDER_TILE_BOTTOM_RIGHT BORDER_TILE_BOTTOM_CENTER + 1
|
||||
|
||||
#define TEXTBOX_STATE_VISIBLE 1 << 0
|
||||
#define TEXTBOX_STATE_SCROLLED 1 << 1
|
||||
#define TEXTBOX_STATE_VISIBLE (1 << 0)
|
||||
#define TEXTBOX_STATE_SCROLLED (1 << 1)
|
||||
|
||||
#define TEXTBOX_WIDTH_IN_TILES 20
|
||||
#define TEXTBOX_HEIGHT_IN_TILES 5
|
||||
|
@@ -12,9 +12,9 @@
|
||||
#define POKER_PLAYER_COUNT_MAX 5
|
||||
#define POKER_PLAYER_HAND_SIZE_MAX 2
|
||||
|
||||
#define POKER_PLAYER_STATE_FOLDED 1 << 0
|
||||
#define POKER_PLAYER_STATE_OUT 1 << 1
|
||||
#define POKER_PLAYER_STATE_HAS_BET_THIS_ROUND 1 << 2
|
||||
#define POKER_PLAYER_STATE_FOLDED (1 << 0)
|
||||
#define POKER_PLAYER_STATE_OUT (1 << 1)
|
||||
#define POKER_PLAYER_STATE_HAS_BET_THIS_ROUND (1 << 2)
|
||||
// #define POKER_PLAYER_STATE_SHOWING 1 << 3
|
||||
|
||||
typedef struct {
|
||||
|
@@ -294,11 +294,11 @@ void pokerAi(uint8_t player, pokerturn_t *turn) {
|
||||
turn->confidence = confidence;
|
||||
|
||||
if(amount == plyr->chips) {
|
||||
turn->type == POKER_TURN_TYPE_ALL_IN;
|
||||
turn->type = POKER_TURN_TYPE_ALL_IN;
|
||||
} else if(amount == callBet) {
|
||||
turn->type = POKER_TURN_TYPE_CALL;
|
||||
} else {
|
||||
turn->type == POKER_TURN_TYPE_BET;
|
||||
turn->type = POKER_TURN_TYPE_BET;
|
||||
}
|
||||
|
||||
} else if(pokerCanPlayerCheck(player)) {
|
||||
|
Reference in New Issue
Block a user