Adding some more discussion queues.
This commit is contained in:
@ -17,6 +17,10 @@
|
||||
#define POKER_DISCUSSION_REASON_MATCH_START 0x01
|
||||
#define POKER_DISCUSSION_REASON_ROUND_START 0x02
|
||||
#define POKER_DISCUSSION_REASON_BLINDS_TAKEN 0x03
|
||||
#define POKER_DISCUSSION_REASON_PLAYER_FOLDING 0x04
|
||||
#define POKER_DISCUSSION_REASON_PLAYER_CHECKING 0x05
|
||||
#define POKER_DISCUSSION_REASON_PLAYER_CALLING 0x06
|
||||
#define POKER_DISCUSSION_REASON_PLAYER_RAISING 0x07
|
||||
|
||||
typedef struct {
|
||||
pokergame_t *poker;
|
||||
|
@ -16,7 +16,7 @@ void _pokerGameActionBetOnUpdate(
|
||||
pokerturn_t turn;
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
pokerplayer_t *player;
|
||||
|
||||
pokerdiscussiondata_t discussion;
|
||||
|
||||
// Are they human?
|
||||
player = game->poker.players + game->poker.bet.better;
|
||||
@ -40,26 +40,37 @@ void _pokerGameActionBetOnUpdate(
|
||||
// Player bets
|
||||
case POKER_TURN_TYPE_BET:
|
||||
debugAction = "betting";
|
||||
//TODO: Is it a BET or a CALL?
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_RAISING;
|
||||
pokerBetPlayer(&game->poker, player, turn.chips);
|
||||
break;
|
||||
|
||||
// Player folds
|
||||
case POKER_TURN_TYPE_FOLD:
|
||||
debugAction = "folding";
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_FOLDING;
|
||||
player->state |= POKER_PLAYER_STATE_FOLDED;
|
||||
break;
|
||||
|
||||
// Player checks
|
||||
case POKER_TURN_TYPE_CHECK:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CHECKING;
|
||||
debugAction = "checking";
|
||||
break;
|
||||
|
||||
// Player may be out
|
||||
default:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_TEST;
|
||||
debugAction = "doing nothing";
|
||||
break;
|
||||
}
|
||||
|
||||
// Speak
|
||||
discussion.poker = game;
|
||||
discussion.playerCause = game->poker.bet.better;
|
||||
pokerDiscussionQueue(&discussion);
|
||||
|
||||
// Next.
|
||||
printf("Player %i is %s.\n", game->poker.bet.better, debugAction);
|
||||
queueNext(queue);
|
||||
}
|
||||
@ -95,12 +106,12 @@ void _pokerGameActionBetOnEnd(
|
||||
|
||||
// Not waiting, restack and do next action.
|
||||
printf("Not waiting on anything!\n");
|
||||
pokerGameActionRestackAdd(game);
|
||||
|
||||
// No! Begin the next flop.
|
||||
next = pokerActionNextFlopAdd(queue, &game->poker);
|
||||
if(next != NULL) {
|
||||
pokerBetResetBetter(&game->poker);
|
||||
pokerGameActionRestackAdd(game);
|
||||
pokerGameActionBetAdd(game);
|
||||
return;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ void _pokerGameActionRestackOnStart(
|
||||
) {
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
printf("Restacking\n");
|
||||
pokerGameQueueRestack(game);
|
||||
// pokerGameQueueRestack(game);
|
||||
queueNext(queue);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "action.h"
|
||||
#include "../../../display/animation/queue.h"
|
||||
#include "../pokergame.h"
|
||||
#include "../../../poker/turn.h"
|
||||
#include "../../../poker/bet.h"
|
||||
|
@ -20,23 +20,60 @@ void pokerDiscussionGet(
|
||||
case POKER_DISCUSSION_REASON_MATCH_START:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "Match Start";
|
||||
discussion->players[0] = 0;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANGRY;
|
||||
discussion->players[0] = POKER_DEALER_INDEX;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
|
||||
break;
|
||||
|
||||
// Round Start Conversations
|
||||
case POKER_DISCUSSION_REASON_ROUND_START:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "Round Start";
|
||||
discussion->players[0] = 1;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANIME_MOM;
|
||||
discussion->players[0] = POKER_DEALER_INDEX;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
|
||||
break;
|
||||
|
||||
// Round Start Conversations
|
||||
case POKER_DISCUSSION_REASON_BLINDS_TAKEN:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "Blinds have been taken.";
|
||||
discussion->players[0] = POKER_DEALER_INDEX;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
|
||||
break;
|
||||
|
||||
// Betting conversations
|
||||
case POKER_DISCUSSION_REASON_PLAYER_FOLDING:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "I fold.";
|
||||
discussion->players[0] = data->playerCause;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANGRY;
|
||||
break;
|
||||
|
||||
case POKER_DISCUSSION_REASON_PLAYER_CHECKING:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "I check.";
|
||||
discussion->players[0] = data->playerCause;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANGRY;
|
||||
break;
|
||||
|
||||
case POKER_DISCUSSION_REASON_PLAYER_CALLING:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "I call.";
|
||||
discussion->players[0] = data->playerCause;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_SMUG;
|
||||
break;
|
||||
|
||||
case POKER_DISCUSSION_REASON_PLAYER_RAISING:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "I raise.";
|
||||
discussion->players[0] = data->playerCause;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_BOASTFUL;
|
||||
break;
|
||||
|
||||
// Fallback
|
||||
default:
|
||||
discussion->count++;
|
||||
discussion->messages[0] = "Hmm, this seems to be an error message.";
|
||||
discussion->players[0] = 3;
|
||||
discussion->players[0] = POKER_DEALER_INDEX;
|
||||
discussion->emotions[0] = VN_CHARACTER_EMOTION_CONCERNED_WORRIED;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user