25 ITEM_TYPE_PLAYING_CARD,
38#define ITEM_NAME_UNDEFINED "UNDEFINED"
44#define ITEM_SUBTYPE_INFO_DEFAULT {.main_color = 0, .shadow_color = 0, .name_str = ITEM_NAME_UNDEFINED}
113 int (*get_buy_price)(
Item* item);
114 const char* (*get_name)(
Item* item);
116 bool (*can_acquire)(
Item* item);
117 void (*acquire)(
Item* item);
118 void (*dispose)(
Item** item);
119 int (*print_description)(
Item* item, Rect dest_rect);
122 int (*get_sell_price)(
Item* item);
Graphic utility functions.
bool item_is_owned(Item *item)
Returns whether or not the given Item is in the player's possession.
int item_get_sell_price(Item *item)
Returns the sell price of the item.
void item_dispose(Item **item)
Destroys an item, freeing underlying resources, and manages rollable items sets if needed....
const char * item_get_name(Item *item)
Returns the name of the Item.
void item_print_buy_price_under(Item *item)
Prints the buy price under the item Relies on the fact item is a SpriteObject.
Item * item_roll_new(enum ItemType item_type, enum RngSequence key)
Rolls a random item of type item_type and returns a newly created one. Manages rollable items set if ...
bool item_can_acquire(Item *item)
Returns true if the item can be acquired, i.e. added to inventory. Does not check if the player has e...
ItemDescSubtypeInfo item_get_subtype_info(Item *item)
Returns the colors and name of the Item's subtype.
void item_acquire(Item *item)
Acquires the item, adding to inventory if applicable. Called when it is purchased from the shop,...
void item_sell(Item *item)
Performs the item sell transaction, gaining its sell value and discarding it.
int item_print_description(Item *item, Rect dest_rect)
Prints the item's description inside the given rectangle.
int item_get_buy_price(Item *item)
Returns the buy price of the item.
Interface to interact with the mgba logger.
Common functions to handle RNG manipulation. Using this interface has three goals:
RngSequence
Keys to different independent RNG sequences.
Sprite system for Gbalatro.
Structure containing the main and shadow colors, and the name string associated with an Item's subtyp...
The set of functions that each item type implements.
A generic interface for all items that can appear in the shop or be in the inventory....
SpriteObject
First member struct inheritance all items that can appear in the shop are SpriteObjects....
enum ItemType type
The item type - used to dispatch the function implementations for inheriting types.
bool is_owned
Whether the item is currently held - used in cases where a behaviour needs to be different for Items ...
Utilities relating around number string representation and protected arithmatic helper functions.