GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
deck_types.c File Reference

Implementation of functions related to the different types of Decks. More...

#include "deck_types.h"
#include "game.h"
#include <tonc.h>

Go to the source code of this file.

Macros

#define TTE_COLOR_TEXT_FORMAT   "#{cx:0x%X000}%s"
 

Typedefs

typedef void(* PrintDescCallback) (BG_POINT)
 

Functions

static void print_desc_red_deck (BG_POINT pos)
 Print the decription of the Red Deck.
 
static void print_desc_blue_deck (BG_POINT pos)
 Print the decription of the Blue Deck.
 
static void print_desc_yellow_deck (BG_POINT pos)
 Print the decription of the Yellow Deck.
 
static void print_desc_green_deck (BG_POINT pos)
 Print the decription of the Green Deck.
 
static void print_desc_black_deck (BG_POINT pos)
 Print the decription of the Black Deck.
 
static void print_desc_painted_deck (BG_POINT pos)
 Print the decription of the Painted Deck.
 
void print_deck_name (enum DeckType deck, BG_POINT pos)
 Prints the Deck name string to the screen at the given position.
 
void print_deck_description (enum DeckType deck, BG_POINT pos)
 Prints the Deck description string to the screen at the given position.
 
static void print_empty_desc_line (int pos_x, int pos_y)
 Print an empty string of 13 characters long at given coordinates. Reduces boilerplate in deck descriptions functions.
 

Variables

static const char DECK_NAMES [DECK_TYPE_MAX][DECK_NAME_LENGTH]
 List of DeckType names, all formatted to be centered in a string of 13 characters.
 
static const PrintDescCallback deck_description_functions [DECK_TYPE_MAX]
 

Detailed Description

Implementation of functions related to the different types of Decks.

Definition in file deck_types.c.

Macro Definition Documentation

◆ TTE_COLOR_TEXT_FORMAT

#define TTE_COLOR_TEXT_FORMAT   "#{cx:0x%X000}%s"

Definition at line 12 of file deck_types.c.

Typedef Documentation

◆ PrintDescCallback

typedef void(* PrintDescCallback) (BG_POINT)

Definition at line 33 of file deck_types.c.

Function Documentation

◆ print_deck_description()

void print_deck_description ( enum DeckType  deck,
BG_POINT  pos 
)

Prints the Deck description string to the screen at the given position.

Parameters
deckDeckType we want the description of.
posscreen position in pixels of the top-left corner of the rectangle we'll print the Deck description into

Definition at line 48 of file deck_types.c.

◆ print_deck_name()

void print_deck_name ( enum DeckType  deck,
BG_POINT  pos 
)

Prints the Deck name string to the screen at the given position.

Parameters
deckDecktype we want the name of.
posscreen position in pixels to print the name at.

Definition at line 43 of file deck_types.c.

◆ print_desc_black_deck()

static void print_desc_black_deck ( BG_POINT  pos)
static

Print the decription of the Black Deck.

"+1 Joker slot"
" "
" -1 hand "
" every Round "
" "
Parameters
posposition of the rectagle to print the description to

Definition at line 235 of file deck_types.c.

◆ print_desc_blue_deck()

static void print_desc_blue_deck ( BG_POINT  pos)
static

Print the decription of the Blue Deck.

" "
" +1 hand "
" every Round "
" "
" "
Parameters
posposition of the rectagle to print the description to

Definition at line 113 of file deck_types.c.

◆ print_desc_green_deck()

static void print_desc_green_deck ( BG_POINT  pos)
static

Print the decription of the Green Deck.

"End of Round:"
" "
"-$2 per Hand "
"-$2 per Disc."
"-No Interest "
Parameters
posposition of the rectagle to print the description to

Definition at line 181 of file deck_types.c.

◆ print_desc_painted_deck()

static void print_desc_painted_deck ( BG_POINT  pos)
static

Print the decription of the Painted Deck.

" "
"+2 Hand size "
"-1 Joker slot"
" "
" "
Parameters
posposition of the rectagle to print the description to

Definition at line 277 of file deck_types.c.

◆ print_desc_red_deck()

static void print_desc_red_deck ( BG_POINT  pos)
static

Print the decription of the Red Deck.

" "
" +1 discard "
" every Round "
" "
" "
Parameters
posposition of the rectagle to print the description to

Definition at line 79 of file deck_types.c.

◆ print_desc_yellow_deck()

static void print_desc_yellow_deck ( BG_POINT  pos)
static

Print the decription of the Yellow Deck.

" "
" Start with "
"an extra $10 "
" "
" "
Parameters
posposition of the rectagle to print the description to

Definition at line 147 of file deck_types.c.

◆ print_empty_desc_line()

static void print_empty_desc_line ( int  pos_x,
int  pos_y 
)
inlinestatic

Print an empty string of 13 characters long at given coordinates. Reduces boilerplate in deck descriptions functions.

Parameters
pos_x
pos_y

Definition at line 63 of file deck_types.c.

Variable Documentation

◆ deck_description_functions

const PrintDescCallback deck_description_functions[DECK_TYPE_MAX]
static
Initial value:
= {
}
static void print_desc_yellow_deck(BG_POINT pos)
Print the decription of the Yellow Deck.
Definition deck_types.c:147
static void print_desc_black_deck(BG_POINT pos)
Print the decription of the Black Deck.
Definition deck_types.c:235
static void print_desc_painted_deck(BG_POINT pos)
Print the decription of the Painted Deck.
Definition deck_types.c:277
static void print_desc_blue_deck(BG_POINT pos)
Print the decription of the Blue Deck.
Definition deck_types.c:113
static void print_desc_green_deck(BG_POINT pos)
Print the decription of the Green Deck.
Definition deck_types.c:181
static void print_desc_red_deck(BG_POINT pos)
Print the decription of the Red Deck.
Definition deck_types.c:79

Definition at line 34 of file deck_types.c.

◆ DECK_NAMES

const char DECK_NAMES[DECK_TYPE_MAX][DECK_NAME_LENGTH]
static
Initial value:
= {
" Red Deck ",
" Blue Deck ",
" Yellow Deck ",
" Green Deck ",
" Black Deck ",
"Painted Deck "
}

List of DeckType names, all formatted to be centered in a string of 13 characters.

Definition at line 17 of file deck_types.c.