Functions relative to the handling of Jokers. More...
#include "card.h"#include "game.h"#include "graphic_utils.h"#include "item.h"#include "random.h"#include <maxmod.h>Go to the source code of this file.
Data Structures | |
| struct | Joker |
| struct | JokerObject |
| struct | JokerEffect |
| struct | JokerInfo |
Macros | |
| #define | MAX_DEFINABLE_JOKERS 150 |
| #define | COMMON_JOKER_CHANCE 70 |
| #define | UNCOMMON_JOKER_CHANCE 25 |
| #define | RARE_JOKER_CHANCE 5 |
| #define | LEGENDARY_JOKER_CHANCE 0 |
| #define | JOKER_EFFECT_FLAG_NONE 0 |
| #define | JOKER_EFFECT_FLAG_CHIPS (1 << 0) |
| #define | JOKER_EFFECT_FLAG_MULT (1 << 1) |
| #define | JOKER_EFFECT_FLAG_XMULT (1 << 2) |
| #define | JOKER_EFFECT_FLAG_MONEY (1 << 3) |
| #define | JOKER_EFFECT_FLAG_RETRIGGER (1 << 4) |
| #define | JOKER_EFFECT_FLAG_EXPIRE (1 << 5) |
| #define | JOKER_EFFECT_FLAG_MESSAGE (1 << 6) |
| #define | MAX_JOKER_OBJECTS 32 |
| #define | STENCIL_JOKER_ID 15 |
| #define | SHORTCUT_JOKER_ID 48 |
| #define | BRAINSTORM_JOKER_ID 41 |
| #define | PAREIDOLIA_JOKER_ID 46 |
| #define | FOUR_FINGERS_JOKER_ID 50 |
| #define | BLUEPRINT_JOKER_ID 52 |
Typedefs | |
| typedef struct JokerObject | JokerObject |
| typedef u32(* | JokerEffectFunc) (Joker *joker, Card *scored_card, enum JokerEvent joker_event, JokerEffect **joker_effect) |
| typedef int(* | JokerDescFunc) (Joker *joker, Rect dest_rect) |
Functions | |
| const JokerInfo * | get_joker_registry_entry (int joker_id) |
| size_t | get_joker_registry_size (void) |
| void | joker_init () |
| Joker * | joker_new (u8 id) |
| void | joker_destroy (Joker **joker) |
| u32 | joker_get_score_effect (Joker *joker, Card *scored_card, enum JokerEvent joker_event, JokerEffect **joker_effect) |
| int | joker_get_sell_value (const Joker *joker) |
| Returns the sell value of the joker. | |
| int | joker_get_buy_price (const Joker *joker) |
| Returns the buy price of the joker. | |
| const char * | joker_object_get_name (Item *joker_object) |
| Get Joker name. | |
| ItemDescSubtypeInfo | joker_object_get_rarity_info (Item *joker_object) |
| Get Joker rarity name and associated panel color. | |
| JokerObject * | joker_object_new (Joker *joker) |
| void | joker_object_destroy (JokerObject **joker_object) |
| void | joker_object_shake (JokerObject *joker_object, mm_word sound_id) |
| int | joker_object_get_buy_price (Item *joker_object) |
| Returns the buy price of the joker object. | |
| int | joker_object_get_sell_price (Item *joker_object) |
| Returns the sell price of the joker object. | |
| void | joker_object_add_to_owned (Item *joker_object) |
| Add a Joker to the list of owned Jokers and place it in the joker row. | |
| void | joker_object_dispose (Item **joker_object) |
| Destroy a JokerObject item, free its resources, and make it available to be rolled. | |
| int | joker_object_print_description (Item *joker_object, Rect dest_rect) |
| Print the description of the requested Joker centered within the specified Rect. | |
| int | joker_roll_id_with_rarity (int joker_rarity) |
| Rolls a random Joker among the available ones of a certain rarity. | |
| int | joker_roll_id (enum JokerRarity joker_rarity, enum RngSequence key) |
| Rolls a random Joker among the available ones of a certain rarity. | |
| void | joker_set_rollable (int joker_id, bool rollable) |
| Set whether a Joker is available to be rolled for the shop, packs, etc. | |
| void | joker_reset_rollable_jokers (void) |
| Reset rollable jokers to include all jokers in the registry. | |
| Item * | joker_object_roll_new (enum RngSequence key) |
| Roll and create a new JokerObject item. | |
| Sprite * | joker_object_get_sprite (JokerObject *joker_object) |
Functions relative to the handling of Jokers.
Definition in file joker.h.
| typedef u32(* JokerEffectFunc) (Joker *joker, Card *scored_card, enum JokerEvent joker_event, JokerEffect **joker_effect) |
| const JokerInfo * get_joker_registry_entry | ( | int | joker_id | ) |
Definition at line 247 of file joker_effects.c.
| size_t get_joker_registry_size | ( | void | ) |
Definition at line 256 of file joker_effects.c.
| int joker_get_buy_price | ( | const Joker * | joker | ) |
| u32 joker_get_score_effect | ( | Joker * | joker, |
| Card * | scored_card, | ||
| enum JokerEvent | joker_event, | ||
| JokerEffect ** | joker_effect | ||
| ) |
| int joker_get_sell_value | ( | const Joker * | joker | ) |
| void joker_object_add_to_owned | ( | Item * | joker_object | ) |
Add a Joker to the list of owned Jokers and place it in the joker row.
| joker_object | The JokerObject to add cast to Item* |
| void joker_object_destroy | ( | JokerObject ** | joker_object | ) |
| void joker_object_dispose | ( | Item ** | joker_object | ) |
Destroy a JokerObject item, free its resources, and make it available to be rolled.
| joker_object | Pointer to the JokerObject Item* to destroy; set to NULL. |
| int joker_object_get_buy_price | ( | Item * | joker_object | ) |
| const char * joker_object_get_name | ( | Item * | joker_object | ) |
| ItemDescSubtypeInfo joker_object_get_rarity_info | ( | Item * | joker_object | ) |
Get Joker rarity name and associated panel color.
| joker_object | pointer to a JokerObject we need the rarity's info of |
| int joker_object_get_sell_price | ( | Item * | joker_object | ) |
| Sprite * joker_object_get_sprite | ( | JokerObject * | joker_object | ) |
| JokerObject * joker_object_new | ( | Joker * | joker | ) |
| int joker_object_print_description | ( | Item * | joker_object, |
| Rect | dest_rect | ||
| ) |
Print the description of the requested Joker centered within the specified Rect.
| joker_object | Joker to print the description of |
| dest_rect | Rectangular region the description must fit in. In case the text is too big, it will overflow downwards while still respecting left and right boundaries. |
| Item * joker_object_roll_new | ( | enum RngSequence | key | ) |
Roll and create a new JokerObject item.
| key | to the RNG sequence that will be used to roll the Joker ID. |
Item* (JokerObject) or NULL if none available. | void joker_object_shake | ( | JokerObject * | joker_object, |
| mm_word | sound_id | ||
| ) |
| void joker_reset_rollable_jokers | ( | void | ) |
| int joker_roll_id | ( | enum JokerRarity | joker_rarity, |
| enum RngSequence | key | ||
| ) |
| int joker_roll_id_with_rarity | ( | int | joker_rarity | ) |
Rolls a random Joker among the available ones of a certain rarity.
| joker_rarity | the rarity of the joker we want to roll |