GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
blind.h
Go to the documentation of this file.
1
6#ifndef BLIND_H
7#define BLIND_H
8
9#include "sprite.h"
10
11// The GBA's max uint value is around 4 billion, so we're going to not add endless mode for
12// simplicity's sake
13#define MAX_ANTE 8
14
21{
22 SMALL_BLIND,
23 BIG_BLIND,
24 BOSS_BLIND,
25 NUM_BLINDS_PER_ANTE
26};
27
36{
37 PLAYING_BLIND_TOKEN_LAYER,
38 ROUND_END_BLIND_TOKEN_LAYER,
39 SMALL_BLIND_TOKEN_LAYER,
40 BIG_BLIND_TOKEN_LAYER,
41 BOSS_BLIND_TOKEN_LAYER
42};
43
49{
50 BLIND_TEXT_COLOR_INDEX = 1,
51 BLIND_SHADOW_COLOR_INDEX,
52 BLIND_HIGHLIGHT_COLOR_INDEX,
53 BLIND_MAIN_COLOR_INDEX,
54 BLIND_BACKGROUND_MAIN_COLOR_INDEX,
55 BLIND_BACKGROUND_SECONDARY_COLOR_INDEX,
56 BLIND_BACKGROUND_SHADOW_COLOR_INDEX,
57};
58
59// clang-format off
69{
70 // Normal Blinds
71 BLIND_TYPE_SMALL,
72 BLIND_TYPE_BIG,
73
74 // Boss Blinds
75 BLIND_TYPE_BOSS,
76
77 BLIND_TYPE_HOOK = BLIND_TYPE_BOSS,
78 BLIND_TYPE_OX,
79 BLIND_TYPE_HOUSE,
80 BLIND_TYPE_WALL,
81 BLIND_TYPE_WHEEL,
82 BLIND_TYPE_ARM,
83 BLIND_TYPE_CLUB,
84 BLIND_TYPE_FISH,
85 BLIND_TYPE_PSYCHIC,
86 BLIND_TYPE_GOAD,
87 BLIND_TYPE_WATER,
88 BLIND_TYPE_WINDOW,
89 BLIND_TYPE_MANACLE,
90 BLIND_TYPE_EYE,
91 BLIND_TYPE_MOUTH,
92 BLIND_TYPE_PLANT,
93 BLIND_TYPE_SERPENT,
94 BLIND_TYPE_PILLAR,
95 BLIND_TYPE_NEEDLE,
96 BLIND_TYPE_HEAD,
97 BLIND_TYPE_TOOTH,
98 BLIND_TYPE_FLINT,
99 BLIND_TYPE_MARK,
100
101 // Showdown Blinds
102 BLIND_TYPE_SHOWDOWN,
103
104 BLIND_TYPE_ACORN = BLIND_TYPE_SHOWDOWN,
105 BLIND_TYPE_LEAF,
106 BLIND_TYPE_VESSEL,
107 BLIND_TYPE_HEART,
108 BLIND_TYPE_BELL,
109
110 // End of Blinds' list
111 BLIND_TYPE_MAX
112};
113// clang-format on
114
121{
122 BLIND_STATE_CURRENT,
123 BLIND_STATE_UPCOMING,
124 BLIND_STATE_DEFEATED,
125 BLIND_STATE_SKIPPED,
126 BLIND_STATE_MAX,
127};
128
136typedef struct
137{
138 u8 type;
139 FIXED score_req_multiplier;
140} Blind;
141
142void blind_init();
143
153u32 blind_get_requirement(enum BlindType type, int ante);
154
162int blind_get_reward(enum BlindType type);
163
172u16 blind_get_color(enum BlindType type, enum BlindColorIndex index);
173
181enum BlindType roll_blind_type(bool showdown);
182
187
194void set_blind_beaten(enum BlindType type);
195
202void apply_blind_colors(enum BlindType type);
203
212void apply_blind_tiles(enum BlindType type, enum BlindTokenLayers layer);
213
224Sprite* blind_token_new(enum BlindType type, int x, int y, enum BlindTokenLayers sprite_index);
225
226#endif // BLIND_H
void apply_blind_tiles(enum BlindType type, enum BlindTokenLayers layer)
Change the tiles of the BlindToken Sprite at a given layer to that of the given BlindType.
Definition blind.c:268
enum BlindType roll_blind_type(bool showdown)
Choose a random Blind among the ones that haven't been beaten yet.
Definition blind.c:162
void apply_blind_colors(enum BlindType type)
Copy the palette associated with the given Blind and copy it in the right spot in the palette memory.
Definition blind.c:232
BlindType
All Blind types in the game are listed here.
Definition blind.h:69
BlindState
All the possible states an Ante's Blinds can be in when viewed in the "Blind Select" screen.
Definition blind.h:121
u16 blind_get_color(enum BlindType type, enum BlindColorIndex index)
Get the color associated with a given Blind.
Definition blind.c:218
BlindTokenLayers
Sprite IDs of the various Blind Tokens used in the game, expressed as an offset relative to BLIND_BAS...
Definition blind.h:36
u32 blind_get_requirement(enum BlindType type, int ante)
Get the score required to beat a certain blind (either the Small, Big, or any Boss/Showdown blind) at...
Definition blind.c:106
BlindColorIndex
Indices of the Blind sprites' colors as encoded in the files' palettes with Aseprite.
Definition blind.h:49
BlindTokens
The sprites that display the blinds when in "GAME_BLIND_SELECT" state. There are only 3 blinds per An...
Definition blind.h:21
Sprite * blind_token_new(enum BlindType type, int x, int y, enum BlindTokenLayers sprite_index)
Create a new BlindToken sprite.
Definition blind.c:281
void set_blind_beaten(enum BlindType type)
Remove the given Blind from the corresponding List so that we don't roll it again in the future.
Definition blind.c:180
void init_unbeaten_blinds_lists(void)
Initialize Boss and Showdown Blinds lists to roll from.
Definition blind.c:156
int blind_get_reward(enum BlindType type)
Get the amount of money gained from beating a certain Blind.
Definition blind.c:115
Sprite system for Gbalatro.
Data structure containing data about a BlindType.
Definition blind.h:137
Sprite struct for GBA hardware specifics.
Definition sprite.h:29