Refactor blind into a map
This commit is contained in:
+28
-14
@@ -5,15 +5,6 @@
|
||||
|
||||
#define MAX_ANTE 8 // The GBA's max uint value is around 4 billion, so we're going to not add endless mode for simplicity's sake
|
||||
|
||||
// +1 is added because we'll actually be indexing at 1, but if something causes you to go to ante 0, there will still be a value there.
|
||||
static const int ante_lut[MAX_ANTE + 1] = {100, 300, 800, 2000, 5000, 11000, 20000, 35000, 50000};
|
||||
|
||||
#define MAX_BLINDS 3
|
||||
|
||||
#define SMALL_BLIND 0
|
||||
#define BIG_BLIND 1
|
||||
#define BOSS_BLIND 2
|
||||
|
||||
#define SMALL_BLIND_PB 1
|
||||
#define BIG_BLIND_PB 2
|
||||
#define BOSS_BLIND_PB 3
|
||||
@@ -31,6 +22,14 @@ static const int ante_lut[MAX_ANTE + 1] = {100, 300, 800, 2000, 5000, 11000, 200
|
||||
#define BLIND_BACKGROUND_SECONDARY_COLOR_INDEX 6
|
||||
#define BLIND_BACKGROUND_SHADOW_COLOR_INDEX 7
|
||||
|
||||
enum BlindType
|
||||
{
|
||||
SMALL_BLIND,
|
||||
BIG_BLIND,
|
||||
BOSS_BLIND,
|
||||
MAX_BLINDS
|
||||
};
|
||||
|
||||
enum BlindState
|
||||
{
|
||||
BLIND_CURRENT,
|
||||
@@ -39,12 +38,27 @@ enum BlindState
|
||||
BLIND_SKIPPED
|
||||
};
|
||||
|
||||
// TODO: Move this to a common interface for other palettes
|
||||
typedef struct {
|
||||
const u16* palette;
|
||||
u32 tid;
|
||||
u32 pb;
|
||||
} PaletteInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
enum BlindType type;
|
||||
PaletteInfo pal_info;
|
||||
FIXED multiplier;
|
||||
s32 reward;
|
||||
} Blind;
|
||||
|
||||
void blind_init();
|
||||
|
||||
int blind_get_requirement(int type, int ante);
|
||||
int blind_get_reward(int type);
|
||||
u16 blind_get_color(int type, int index);
|
||||
int blind_get_requirement(enum BlindType type, int ante);
|
||||
int blind_get_reward(enum BlindType type);
|
||||
u16 blind_get_color(enum BlindType type, int index);
|
||||
|
||||
Sprite *blind_token_new(int type, int x, int y, int sprite_index);
|
||||
Sprite *blind_token_new(enum BlindType type, int x, int y, int sprite_index);
|
||||
|
||||
#endif // BLIND_H
|
||||
#endif // BLIND_H
|
||||
|
||||
Reference in New Issue
Block a user