Dawn/src/game/poker/discussion/pokerdiscussion.c

61 lines
1.7 KiB
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "pokerdiscussion.h"
void pokerDiscussionGet(
pokerdiscussion_t *discussion, pokerdiscussiondata_t *data
) {
discussion->count = 0;
memset(discussion->players, 0xFF,
sizeof(uint8_t) * POKER_DISCUSSION_MESSAGE_COUNT_MAX
);
switch(data->reason) {
// Match Start Conversations
case POKER_DISCUSSION_REASON_MATCH_START:
discussion->count++;
discussion->messages[0] = "Match Start";
discussion->players[0] = 0;
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANGRY;
break;
// Round Start Conversations
case POKER_DISCUSSION_REASON_ROUND_START:
discussion->count++;
discussion->messages[0] = "Round Start";
discussion->players[0] = 0;
discussion->emotions[0] = VN_CHARACTER_EMOTION_XXXX_THINKING10;
break;
// Fallback
default:
discussion->count++;
discussion->messages[0] = "Hmm, this seems to be an error message.";
discussion->players[0] = 0;
discussion->emotions[0] = VN_CHARACTER_EMOTION_CONCERNED_WORRIED;
break;
}
}
void pokerDiscussionQueue(pokerdiscussiondata_t *data) {
pokerdiscussion_t discussion;
uint8_t i, player;
pokerDiscussionGet(&discussion, data);
for(i = 0; i < discussion.count; i++) {
player = discussion.players[i];
if(player != 0xFF) pokerGameActionLookAdd(data->poker, player);
vnConversationTalk(&data->poker->scene.conversation,
discussion.messages[i],
player == 0xFF ? NULL : data->poker->scene.characters + player,
discussion.emotions[i]
);
}
}