Added in all the other characters (testing)

This commit is contained in:
2021-11-02 08:33:58 -07:00
parent 72dbf6b5f3
commit d9f29cd640
28 changed files with 522 additions and 274 deletions

View File

@ -0,0 +1,45 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "characters.h"
pokercharacterdefinition_t POKER_CHARACTER_DEFINITIONS[] = {
{
"Lucy",
POKER_CHARACTER_LUCY_TEXTURE,
&pokerCharacterLucyInit
},
{
"Julie",
POKER_CHARACTER_JULIE_TEXTURE,
&pokerCharacterJulieInit
},
{
"Penny",
POKER_CHARACTER_PENNY_TEXTURE,
&pokerCharacterPennyInit
},
{
"Sammy",
POKER_CHARACTER_SAMMY_TEXTURE,
&pokerCharacterSammyInit
},
{
"Jenny",
POKER_CHARACTER_JENNY_TEXTURE,
&pokerCharacterJennyInit
}
};
void pokerCharacterInit(vncharacter_t *crctr, texture_t *txtr, uint8_t i) {
vnCharacterInit(crctr, txtr);
POKER_CHARACTER_DEFINITIONS[i].init(crctr);
}

View File

@ -0,0 +1,28 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../../libs.h"
#include "../../../vn/vncharacter.h"
#include "../../../display/texture.h"
#include "jenny.h"
#include "julie.h"
#include "lucy.h"
#include "penny.h"
#include "sammy.h"
typedef void pokercharacterinitmethod_t(vncharacter_t *c);
typedef struct {
char *name;
char *fileTexture;
pokercharacterinitmethod_t *init;
} pokercharacterdefinition_t;
extern pokercharacterdefinition_t POKER_CHARACTER_DEFINITIONS[];
void pokerCharacterInit(vncharacter_t *crctr, texture_t *txtr, uint8_t i);

View File

@ -0,0 +1,26 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "jenny.h"
void pokerCharacterJennyInit(vncharacter_t *vnc) {
// Base Layer
vnCharacterLayerAdd(vnc, 1, 0, 0, 0, 0, 1095, 2029);
// Layers
vnCharacterLayerAdd(vnc, 3,
1095, 0,
608, 250,
280, 123
);
vnCharacterLayerAdd(vnc, 3,
1095, 123,
608, 250,
280, 123
);
}

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../../libs.h"
#include "../../../vn/vncharacter.h"
#include "../../../display/texture.h"
#include "../../../file/asset.h"
#define POKER_CHARACTER_JENNY_TEXTURE "poker/characters/jenny.png"
void pokerCharacterJennyInit(vncharacter_t *vnc);

View File

@ -0,0 +1,38 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "julie.h"
void pokerCharacterJulieInit(vncharacter_t *vnc) {
// Base Layer
vnCharacterLayerAdd(vnc, 1, 0, 0, 0, 0, 1053, 1961);
// Layers
vnCharacterLayerAdd(vnc, 4,
1053, 0,
353, 119,
344, 351
);
vnCharacterLayerAdd(vnc, 12,
1053, 351,
353, 119,
344, 351
);
vnCharacterLayerAdd(vnc, 4,
1053, 702,
353, 119,
344, 351
);
vnCharacterLayerAdd(vnc, 2,
1053, 1053,
353, 119,
344, 351
);
}

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../../libs.h"
#include "../../../vn/vncharacter.h"
#include "../../../display/texture.h"
#include "../../../file/asset.h"
#define POKER_CHARACTER_JULIE_TEXTURE "poker/characters/julie.png"
void pokerCharacterJulieInit(vncharacter_t *vnc);

View File

@ -0,0 +1,34 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "lucy.h"
void pokerCharacterLucyInit(vncharacter_t *vnc) {
// Base Layer
vnCharacterLayerAdd(vnc, 1, 0, 0, 0, 0, 1440, 2240);
// Layers
vnCharacterLayerAdd(vnc, 5,
1440, 0,
675, 327,
295, 235
);
vnCharacterLayerAdd(vnc, 12,
1440, 235,
675, 327,
295, 235
);
vnCharacterLayerAdd(vnc, 5,
1440, 470,
675, 327,
295, 235
);
}

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../../libs.h"
#include "../../../vn/vncharacter.h"
#include "../../../display/texture.h"
#include "../../../file/asset.h"
#define POKER_CHARACTER_LUCY_TEXTURE "poker/characters/lucy.png"
void pokerCharacterLucyInit(vncharacter_t *vnc);

View File

@ -0,0 +1,32 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "penny.h"
void pokerCharacterPennyInit(vncharacter_t *vnc) {
// Base Layer
vnCharacterLayerAdd(vnc, 1, 0, 0, 0, 0, 1000, 1920);
// Layers
vnCharacterLayerAdd(vnc, 5,
1000, 0,
367, 256,
280, 280
);
vnCharacterLayerAdd(vnc, 4,
1000, 280,
367, 256,
280, 280
);
vnCharacterLayerAdd(vnc, 12,
1000, 560,
367, 256,
280, 280
);
}

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../../libs.h"
#include "../../../vn/vncharacter.h"
#include "../../../display/texture.h"
#include "../../../file/asset.h"
#define POKER_CHARACTER_PENNY_TEXTURE "poker/characters/penny.png"
void pokerCharacterPennyInit(vncharacter_t *vnc);

View File

@ -0,0 +1,32 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "sammy.h"
void pokerCharacterSammyInit(vncharacter_t *vnc) {
// Base Layer
vnCharacterLayerAdd(vnc, 1, 0, 0, 0, 0, 731, 2122);
// Layers
vnCharacterLayerAdd(vnc, 4,
731, 0,
215, 264,
307, 213
);
vnCharacterLayerAdd(vnc, 12,
731, 213,
215, 264,
307, 213
);
vnCharacterLayerAdd(vnc, 5,
731, 426,
215, 264,
307, 213
);
}

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../../libs.h"
#include "../../../vn/vncharacter.h"
#include "../../../display/texture.h"
#include "../../../file/asset.h"
#define POKER_CHARACTER_SAMMY_TEXTURE "poker/characters/sammy.png"
void pokerCharacterSammyInit(vncharacter_t *vnc);

View File

@ -21,7 +21,6 @@ void pokerDiscussionGet(
discussion->count++;
discussion->messages[0] = "Match Start";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
break;
// Round Start Conversations
@ -29,7 +28,6 @@ void pokerDiscussionGet(
discussion->count++;
discussion->messages[0] = "Round Start";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
break;
// Round Start Conversations
@ -37,7 +35,6 @@ void pokerDiscussionGet(
discussion->count++;
discussion->messages[0] = "Blinds\nhave been taken.";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
break;
// Deal
@ -45,7 +42,6 @@ void pokerDiscussionGet(
discussion->count++;
discussion->messages[0] = "Cards dealt.";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
break;
// Betting conversations
@ -53,35 +49,30 @@ void pokerDiscussionGet(
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;
case POKER_DISCUSSION_REASON_PLAYER_ALL_IN:
discussion->count++;
discussion->messages[0] = "All in.";
discussion->players[0] = data->playerCause;
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANGRY_PROUD;
break;
// Flops
@ -89,14 +80,12 @@ void pokerDiscussionGet(
discussion->count++;
discussion->messages[0] = "Doing the flop.";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_ANIME_MOM;
break;
case POKER_DISCUSSION_REASON_BETTING_DONE:
discussion->count++;
discussion->messages[0] = "Winner Winner Chicken Dinner";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_SMUG_VERY;
break;
// Fallback
@ -104,7 +93,6 @@ void pokerDiscussionGet(
discussion->count++;
discussion->messages[0] = "Hmm, this seems to be an error message.";
discussion->players[0] = POKER_WORLD_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_CONCERNED_WORRIED;
break;
}
}
@ -146,8 +134,7 @@ void pokerDiscussionQueue(pokerdiscussiondata_t *data) {
pokerGameActionLookAdd(data->poker, player);
vnConversationTalk(&data->poker->scene.conversation,
discussion.messages[i],
data->poker->scene.characters + player,
discussion.emotions[i]
data->poker->scene.characters + player
);
}
}

View File

@ -38,7 +38,6 @@ typedef struct {
typedef struct {
char *messages[POKER_DISCUSSION_MESSAGE_COUNT_MAX];
uint8_t players[POKER_DISCUSSION_MESSAGE_COUNT_MAX];
uint8_t emotions[POKER_DISCUSSION_MESSAGE_COUNT_MAX];
uint8_t count;
} pokerdiscussion_t;

View File

@ -20,11 +20,8 @@ bool pokerGameAssetsInit(pokergameassets_t *assets) {
// Load the world textures.
assetTextureLoad(&assets->testTexture, "textures/test_texture.png");
assetTextureLoad(&assets->cardTexture, "poker/cards_normal.png");
assetTextureLoad(&assets->roomTexture, "poker/world/pub/pub_skywall.png");
// Load the character textures.
assetTextureLoad(&assets->pennyTexture, "poker/characters/penny/sprites/sheet.png");
assetTextureLoad(&assets->cardTexture, "poker/cards.png");
assetTextureLoad(&assets->roomTexture, "poker/pub_skywall.png");
return true;
}

View File

@ -10,6 +10,9 @@
#include "../../file/asset.h"
#include "../../locale/language.h"
#include "../../display/texture.h"
#include "../../vn/vncharacter.h"
#include "../../poker/common.h"
#include "characters/characters.h"
typedef struct {
font_t font;
@ -20,7 +23,7 @@ typedef struct {
texture_t roomTexture;
texture_t cardTexture;
texture_t pennyTexture;
texture_t characterTextures[POKER_PLAYER_COUNT_MAX];
} pokergameassets_t;
/**

View File

@ -13,6 +13,7 @@ void pokerWorldInit(
pokergameassets_t *assets
) {
vncharacter_t *character;
texture_t *texture;
uint8_t i;
world->seat = POKER_WORLD_SEAT_DEALER;
@ -24,19 +25,21 @@ void pokerWorldInit(
// Initialize the players
for(i = 0x00; i < POKER_PLAYER_COUNT_MAX; i++) {
character = scene->characters + scene->characterCount;
vnCharacterInit(character, &assets->pennyTexture,
POKER_WORLD_PENNY_BASE_WIDTH, POKER_WORLD_PENNY_BASE_HEIGHT,
POKER_WORLD_PENNY_FACE_X, POKER_WORLD_PENNY_FACE_Y,
POKER_WORLD_PENNY_FACE_WIDTH, POKER_WORLD_PENNY_FACE_HEIGHT
);
character->x = POKER_WORLD_SEAT_POSITION_X(POKER_WORLD_SEAT_FOR_PLAYER(i));
character->y = POKER_WORLD_SEAT_POSITION_Y;
character->z = POKER_WORLD_SEAT_POSITION_Z(POKER_WORLD_SEAT_FOR_PLAYER(i));
character->yaw = POKER_WORLD_SEAT_ROTATION(POKER_WORLD_SEAT_FOR_PLAYER(i));
texture = assets->characterTextures + i;
assetTextureLoad(texture, POKER_CHARACTER_DEFINITIONS[i].fileTexture);
pokerCharacterInit(character, texture, i);
pokerWorldSitCharacter(character, POKER_WORLD_SEAT_FOR_PLAYER(i));
scene->characterCount++;
}
}
void pokerWorldSitCharacter(vncharacter_t *character, uint8_t seat) {
character->x = POKER_WORLD_SEAT_POSITION_X(seat);
character->y = POKER_WORLD_SEAT_POSITION_Y;
character->z = POKER_WORLD_SEAT_POSITION_Z(seat);
character->yaw = POKER_WORLD_SEAT_ROTATION(seat);
}
void pokerWorldLookAtPlayer(
vnscene_t *scene, uint8_t playerIndex
) {

View File

@ -18,7 +18,7 @@
#include "pokergameassets.h"
/** How far away from the camera are the characters distanced */
#define POKER_WORLD_SEAT_DISTANCE -0.75f
#define POKER_WORLD_SEAT_DISTANCE -1.25f
/** How rotated is the player at a given seat */
#define POKER_WORLD_SEAT_ROTATION(n) (n * mathDeg2Rad(45.0f))
@ -81,6 +81,14 @@ void pokerWorldInit(
pokergameassets_t *assets
);
/**
* Adjusts a specific VN player to sit at the given index
*
* @param character Character to place in the seat.
* @param seat Seat to put the character in.
*/
void pokerWorldSitCharacter(vncharacter_t *character, uint8_t seat);
/**
* Adjusts the camera to look at a specific player. You can use this to look at
* the dealer by referencing the POKER_PLAYER_HUMAN_INDEX as the index.