Data structures and functions related to the handling of Skip Tags. More...
#include "game/common_ui.h"#include "graphic_utils.h"#include "joker.h"#include "sprite.h"#include <tonc.h>Go to the source code of this file.
Data Structures | |
| struct | SkipTag |
| struct | SkipTagInfo |
| Data structure containing the info about a Skip Tag, namely: More... | |
Macros | |
| #define | SKIP_TAG_TID (SKIP_TAG_STARTING_LAYER * SKIP_TAG_SPRITE_SIZE) |
| #define | INVESTMENT_TAG_REWARD 25 |
Typedefs | |
| typedef struct SkipTag | SkipTag |
| typedef bool(* | SkipTagCondition) (void) |
| typedef void(* | SkipTagCallback) (void) |
Enumerations | |
| enum | SkipTagLayers { SMALL_BLIND_SKIP_TAG_LAYER , BIG_BLIND_SKIP_TAG_LAYER , OWNED_SKIP_TAG_STARTING_LAYER } |
| Sprite IDs of the Skip Tags, as an offset relative to SKIP_TAG_STARTING_LAYER. More... | |
| enum | SkipTagTypes { SKIP_TAG_TYPE_UNCOMMON , SKIP_TAG_TYPE_RARE , SKIP_TAG_TYPE_INVESTMENT , SKIP_TAG_TYPE_VOUCHER , SKIP_TAG_TYPE_BOSS , SKIP_TAG_TYPE_STANDARD , SKIP_TAG_TYPE_CHARM , SKIP_TAG_TYPE_METEOR , SKIP_TAG_TYPE_BUFFOON , SKIP_TAG_TYPE_HANDY , SKIP_TAG_TYPE_GARBAGE , SKIP_TAG_TYPE_ETHEREAL , SKIP_TAG_TYPE_COUPON , SKIP_TAG_TYPE_DOUBLE , SKIP_TAG_TYPE_JUGGLE , SKIP_TAG_TYPE_D6 , SKIP_TAG_TYPE_TOP_UP , SKIP_TAG_TYPE_SPEED , SKIP_TAG_TYPE_ORBITAL , SKIP_TAG_TYPE_ECONOMY , MAX_SKIP_TAG_TYPES } |
| List of all Skip Tags, in the order they are in on their spritesheet. Not all of them are implemented (or will be) but at least they are in order. More... | |
| enum | SkipTagEvent { SKIP_TAG_EVENT_NONE , SKIP_TAG_EVENT_IMMEDIATE , SKIP_TAG_EVENT_ON_ROUND_START , SKIP_TAG_EVENT_ON_ROUND_END , SKIP_TAG_EVENT_ON_SHOP_INIT } |
| enum | SkipTagProcStage { SKIP_TAG_PROCESS_STAGE_NONE , SKIP_TAG_PROCESS_STAGE_TRIGGER , SKIP_TAG_PROCESS_STAGE_END } |
Functions | |
| const SkipTagInfo * | get_skip_tag_registry_entry (enum SkipTagTypes tag_type) |
| Get the registry entry info for the given Skip Tag type. | |
| List * | get_owned_skip_tags (void) |
| Get the owned skip tags list. | |
| SkipTag * | skip_tag_new (enum SkipTagTypes tag_type) |
| Create a new Skip Tag object for the given Tag ID and allocates space for it in the corresponding memory pool. | |
| void | skip_tag_set_sprite (SkipTag *tag, s16 layer) |
| Set the sprite for the given SkipTag, according to its internal ID. | |
| void | skip_tag_destroy (SkipTag **tag) |
| Destroy the given SkipTag, invalidate it in the corresponding memory pool and set the pointer provided to NULL. | |
| void | set_owned_skip_tags_moved_offscreen (bool move_offscreen) |
| Show or hide the owned SkipTag sprites by moving them offscreen to the right. | |
| SkipTag * | roll_skip_tag (void) |
| Create a new SkipTag with a random ID, picked by taking the Ante into account, as some Tags only appear from Ante 2 onwards. | |
| bool | skip_tag_is_owned (enum SkipTagTypes tag_type) |
| Checks if the given tag type is present in owned Tags list. | |
| int | skip_tag_count (enum SkipTagTypes tag_type) |
| Counts how many tags of a certain type we own. | |
| void | add_skip_tag (SkipTag **blind_tag) |
| Adds the SkipTag to the owned list, snaps it into position and sets the original pointer to NULL. | |
| void | remove_skip_tag (int tag_idx) |
| Pops the Tag at index in owned list, destroys it and rearranges the remaining Tags' sprites. | |
| void | remove_all_skip_tags (void) |
| Delete all owned Skip Tags. | |
| enum SkipTagProcStage | skip_tag_process_get_proc_stage (void) |
| Recover the current stage of the Tag processing. | |
| void | skip_tag_process_start (enum SkipTagEvent checked_tag_event) |
| Start Skip Tag processing for the specified event. | |
| void | skip_tag_process_pause (void) |
| Suspend the processing of Skip Tags. | |
| void | skip_tag_process_resume (void) |
| Resume the processing of Skip Tags. | |
Data structures and functions related to the handling of Skip Tags.
Definition in file skip_tag.h.
| #define INVESTMENT_TAG_REWARD 25 |
Definition at line 30 of file skip_tag.h.
| #define SKIP_TAG_TID (SKIP_TAG_STARTING_LAYER * SKIP_TAG_SPRITE_SIZE) |
Definition at line 28 of file skip_tag.h.
| typedef void(* SkipTagCallback) (void) |
Definition at line 96 of file skip_tag.h.
| typedef bool(* SkipTagCondition) (void) |
Definition at line 95 of file skip_tag.h.
| enum SkipTagEvent |
Definition at line 77 of file skip_tag.h.
| enum SkipTagLayers |
Sprite IDs of the Skip Tags, as an offset relative to SKIP_TAG_STARTING_LAYER.
Definition at line 20 of file skip_tag.h.
| enum SkipTagProcStage |
Definition at line 87 of file skip_tag.h.
| enum SkipTagTypes |
List of all Skip Tags, in the order they are in on their spritesheet. Not all of them are implemented (or will be) but at least they are in order.
The Negative, Foil, Holographic and Polychrome Tags are not planned and thus absent from both this enum, and the Tags spritesheet, but the sprites for them are available in the relevant description should we ever need them: https://github.com/GBALATRO/balatro-gba/discussions/131
Definition at line 44 of file skip_tag.h.
| void add_skip_tag | ( | SkipTag ** | blind_tag | ) |
Adds the SkipTag to the owned list, snaps it into position and sets the original pointer to NULL.
| blind_tag |
Definition at line 230 of file skip_tag.c.
| List * get_owned_skip_tags | ( | void | ) |
| const SkipTagInfo * get_skip_tag_registry_entry | ( | enum SkipTagTypes | tag_type | ) |
Get the registry entry info for the given Skip Tag type.
| tag_type | type of the Skip Tag we need the info of |
Definition at line 56 of file skip_tag_effects.c.
| void remove_all_skip_tags | ( | void | ) |
Delete all owned Skip Tags.
Definition at line 289 of file skip_tag.c.
| void remove_skip_tag | ( | int | tag_idx | ) |
Pops the Tag at index in owned list, destroys it and rearranges the remaining Tags' sprites.
| tag_idx | index of the Tag to remove in owned list |
Definition at line 279 of file skip_tag.c.
| SkipTag * roll_skip_tag | ( | void | ) |
Create a new SkipTag with a random ID, picked by taking the Ante into account, as some Tags only appear from Ante 2 onwards.
Definition at line 154 of file skip_tag.c.
| void set_owned_skip_tags_moved_offscreen | ( | bool | move_offscreen | ) |
Show or hide the owned SkipTag sprites by moving them offscreen to the right.
| move_offscreen | true to move the sprites offscreen, false to return them onscreen |
Definition at line 141 of file skip_tag.c.
| int skip_tag_count | ( | enum SkipTagTypes | tag_type | ) |
Counts how many tags of a certain type we own.
| tag_type | SkipTagType to count |
Definition at line 213 of file skip_tag.c.
| void skip_tag_destroy | ( | SkipTag ** | tag | ) |
Destroy the given SkipTag, invalidate it in the corresponding memory pool and set the pointer provided to NULL.
| tag | pointer of pointer to the SkipTag we want to destroy |
Definition at line 128 of file skip_tag.c.
| bool skip_tag_is_owned | ( | enum SkipTagTypes | tag_type | ) |
Checks if the given tag type is present in owned Tags list.
| tag_type | SkipTagType to check |
Definition at line 197 of file skip_tag.c.
| SkipTag * skip_tag_new | ( | enum SkipTagTypes | tag_type | ) |
Create a new Skip Tag object for the given Tag ID and allocates space for it in the corresponding memory pool.
| tag_type | the ID of the Tag we want |
Definition at line 83 of file skip_tag.c.
| enum SkipTagProcStage skip_tag_process_get_proc_stage | ( | void | ) |
Recover the current stage of the Tag processing.
Definition at line 339 of file skip_tag.c.
| void skip_tag_process_pause | ( | void | ) |
Suspend the processing of Skip Tags.
This is called automatically when Tags have finished processing for the current SkipTagEvent, but it can be invoked by a game state to temporarily pause the processing while doing some other thing, like showing an animation. Call skip_tag_process_resume to pick up processing where it was left.
Definition at line 357 of file skip_tag.c.
| void skip_tag_process_resume | ( | void | ) |
Resume the processing of Skip Tags.
After skip_tag_process_pause was called, use this function to resume Tag processing.
Definition at line 366 of file skip_tag.c.
| void skip_tag_process_start | ( | enum SkipTagEvent | checked_tag_event | ) |
Start Skip Tag processing for the specified event.
The "processing" of a Tag refers to the selection of the triggered Tag, the triggering of the associated effect itself, the little bounce animation that comes with it and finally the removal of the Tag.
Processing will occur in its own state machine and will run independently until it either completes, or is paused/resumed with the associated functions.
During this time, skip_tag_process_get_proc_stage may be called on every frame so that the calling state machine can stay up to date with the Tags processing stage and wait for it to finish or perform relevant actions.
| checked_tag_event | the event for which the owned Tags will be evaluated |
Definition at line 344 of file skip_tag.c.
| void skip_tag_set_sprite | ( | SkipTag * | tag, |
| s16 | layer | ||
| ) |
Set the sprite for the given SkipTag, according to its internal ID.
| tag | pointer to the SkipTag object |
| layer | sprite layer for the new Sprite, as an offset to the starting layer for the SKIP_TAG sprite type |
Definition at line 94 of file skip_tag.c.