![]() |
dsekai
World engine for retrocomputers.
|
Definitions and callbacks pertaining to ITEM use in-world. More...
Macros | |
#define | ITEM_TABLE(f) f( none, 0 ) f( seed, 10 ) f( food, 10 ) f( shovel, 1 ) f( editor, 1 ) f( material, 10 ) f( watercan, 1 ) f( hoe, 1 ) |
List of possible ITEM_TYPE_MASK values and their maximum stack sizes. | |
#define | ITEM_USED_SUCCESSFUL -1 |
#define | ITEM_USED_FAILED 0 |
#define | ITEM_USED_SUCCESSFUL_SILENT 1 |
#define | ITEM_TABLE_USE_CB_PROTOS(type, max) int8_t item_use_ ## type( int16_t e_idx, MOBILE_GID owner_gid, struct DSEKAI_STATE* state ) SECTION_ITEM; |
Macro to define ITEM_USE_CB prototypes from ITEM_TABLE. | |
Typedefs | |
typedef int8_t(* | ITEM_USE_CB) (int16_t e_idx, MOBILE_GID owner_gid, struct DSEKAI_STATE *state) |
Definition for a callback to execute when an ITEM is used. | |
Variables | |
RES_CONST uint8_t | gc_items_max [] |
Lookup table of maximum of each item type permitted in inventory. | |
RES_CONST ITEM_USE_CB | gc_item_use_cbs [] |
Lookup table of callbacks to execute for item types. | |
RES_CONST char * | gc_items_types [] |
Lookup table of text names for item types. | |
Definitions and callbacks pertaining to ITEM use in-world.
An item's type, defined by the bits marked by ITEM_TYPE_MASK in its Item Flags, primarily decides what function that item will perform when used in-world.
typedef int8_t(* ITEM_USE_CB) (int16_t e_idx, MOBILE_GID owner_gid, struct DSEKAI_STATE *state) |
Definition for a callback to execute when an ITEM is used.
e_idx | Index of the ITEM to use in the current DSEKAI_STATE::items_handle. |
owner_gid | MOBILE_GID of the MOBILE to use the item. |
state | Locked MEMORY_PTR to the current engine DSEKAI_STATE. |