Implementation of functions relative to the behaviour and graphics of Blinds. More...
#include "blind.h"#include "blind_gfx.h"#include "game.h"#include "graphic_utils.h"#include "hand.h"#include "list.h"#include "random.h"#include "stdbool.h"#include "util.h"#include <stdlib.h>#include <tonc.h>#include "../include/def_blind_gfx_table.h"Go to the source code of this file.
Macros | |
| #define | NORMAL_BLIND_PB 2 |
| #define | BOSS_BLIND_PB 3 |
| #define | BLIND_BASE_LAYER (MAX_HAND_SIZE + MAX_SELECTION_SIZE) |
| #define | BLIND_SPRITE_OFFSET 16 |
| #define | BLIND_SPRITE_COPY_SIZE (BLIND_SPRITE_OFFSET * TILE_SIZE) |
| #define | BLIND_TOKENS_PER_SPRITESHEET 2 |
| #define | BLIND_TOKEN_PALETTE_SIZE 8 |
| #define | SMALL_BLIND_REWARD 3 |
| #define | BIG_BLIND_REWARD 4 |
| #define | BOSS_BLIND_REWARD 5 |
| #define | SHOWDOWN_BLIND_REWARD 8 |
| #define | DEF_BLIND_GFX(idx) blind_gfx##idx##Tiles, |
| #define | DEF_BLIND_GFX(idx) blind_gfx##idx##Pal, |
Functions | |
| void | blind_init () |
| 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 a certain Ante. | |
| int | blind_get_reward (enum BlindType type) |
| Get the amount of money gained from beating a certain Blind. | |
| static void | init_unbeaten_blinds_list (bool showdown) |
| Fill Lists of unbeaten Boss and Showdown Blinds. | |
| void | init_unbeaten_blinds_lists (void) |
| Initialize Boss and Showdown Blinds lists to roll from. | |
| enum BlindType | roll_blind_type (bool showdown) |
| Choose a random Blind among the ones that haven't been beaten yet. | |
| 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. | |
| static u32 | get_blind_pb (enum BlindType type) |
| static u32 | get_blind_spritesheet_idx (enum BlindType type) |
| u16 | blind_get_color (enum BlindType type, enum BlindColorIndex index) |
| Get the color associated with a given Blind. | |
| 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. | |
| static u32 | get_layer_tile_index (enum BlindTokenLayers layer) |
| Get the starting tile index in tiles memory for the given BlindToken sprite layer. | |
| 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. | |
| Sprite * | blind_token_new (enum BlindType type, int x, int y, enum BlindTokenLayers layer) |
| Create a new BlindToken sprite. | |
Variables | |
| static const unsigned int * | blind_gfxTiles [] |
| static const unsigned short * | blind_gfxPal [] |
| static List | s_unbeaten_boss_blinds = LIST_DEFAULT |
| static List | s_unbeaten_showdown_blinds = LIST_DEFAULT |
| static const u32 | ANTE_LUT [] = {100, 300, 800, 2000, 5000, 11000, 20000, 35000, 50000} |
| static Blind | s_blind_type_map [BLIND_TYPE_MAX] |
| Stores an instance of the Blind struct for each BlindType value, ordered in the same way. Acts the same way the Joker registry does, and may need to go in its own file depending on how Blind effects are implemented. | |
Implementation of functions relative to the behaviour and graphics of Blinds.
Definition in file blind.c.
| #define BLIND_BASE_LAYER (MAX_HAND_SIZE + MAX_SELECTION_SIZE) |
| #define BLIND_SPRITE_COPY_SIZE (BLIND_SPRITE_OFFSET * TILE_SIZE) |
| void apply_blind_colors | ( | enum BlindType | type | ) |
| void apply_blind_tiles | ( | enum BlindType | type, |
| enum BlindTokenLayers | layer | ||
| ) |
| u16 blind_get_color | ( | enum BlindType | type, |
| enum BlindColorIndex | index | ||
| ) |
| 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 a certain Ante.
| type | the BlindType value of the blind we need the score requirement of |
| ante | the Ante at which the blind type is encountered |
| int blind_get_reward | ( | enum BlindType | type | ) |
| Sprite * blind_token_new | ( | enum BlindType | type, |
| int | x, | ||
| int | y, | ||
| enum BlindTokenLayers | sprite_index | ||
| ) |
Create a new BlindToken sprite.
| type | of the Blind the token needs to represent |
| x | initial position of the new Sprite on the horizontal axis |
| y | initial position of the new Sprite on the vertical axis |
| sprite_index | layer of the new Sprite |
|
static |
|
static |
|
static |
Fill Lists of unbeaten Boss and Showdown Blinds.
By keeping track of what Blind we have beaten or not, we can ensure that until we've
beaten all the Blinds in a single Run, we won't encounter the same one twice.
This must be called at the beginning of a run.
| showdown | toggle between the List for Showdown and regular Boss Blinds |
| void init_unbeaten_blinds_lists | ( | void | ) |
| enum BlindType roll_blind_type | ( | bool | showdown | ) |
| void set_blind_beaten | ( | enum BlindType | type | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |