1#ifndef _COMMON_CONSUMABLE_CHOICE_
2#define _COMMON_CONSUMABLE_CHOICE_
5#include "sprite/player.h"
7static s32 N(ItemChoice_List)[ITEM_NUM_CONSUMABLES + 1];
9#ifndef _CHOICE_SUPPORT_
10#define _CHOICE_SUPPORT_
12s32 N(ItemChoice_HasSelectedItem) = 0;
13s32 N(ItemChoice_SelectedItemID) = 0;
18API_CALLABLE(N(ItemChoice_WaitForSelection)) {
22 N(ItemChoice_HasSelectedItem) = FALSE;
25 if (N(ItemChoice_HasSelectedItem)) {
26 N(ItemChoice_HasSelectedItem) = FALSE;
34API_CALLABLE(N(ItemChoice_SaveSelected)) {
38 N(ItemChoice_HasSelectedItem) = TRUE;
44API_CALLABLE(N(BuildItemChoiceList)) {
49 if (allowedItemList != NULL) {
50 for (i = 0; allowedItemList[i] != ITEM_NONE; i++) {
51 N(ItemChoice_List)[i] = allowedItemList[i];
53 N(ItemChoice_List)[i] = ITEM_NONE;
55 for (i = 0; i < ITEM_NUM_CONSUMABLES; i++) {
56 N(ItemChoice_List)[i] = ITEM_FIRST_CONSUMABLE + i;
57 N(ItemChoice_List)[ITEM_NUM_CONSUMABLES] = ITEM_NONE;
90 Call(N(ItemChoice_WaitForSelection),
LVar0)
95#define EVT_CHOOSE_ANY_CONSUMABLE(unkMode) \
98 ExecWait(N(EVS_ChooseItem))
100#define EVT_CHOOSE_CONSUMABLE_FROM(itemList, unkMode) \
101 Set(LVar0, Ref(itemList)) \
102 Set(LVar1, unkMode) \
103 ExecWait(N(EVS_ChooseItem))
@ ITEM_SPAWN_MODE_DECORATION
s32 evt_get_variable(Evt *script, Bytecode var)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
ApiStatus CloseChoicePopup(Evt *script, b32 isInitialCall)
ApiStatus RemoveItemEntity(Evt *script, b32 isInitialCall)
ApiStatus ShowConsumableChoicePopup(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus MakeItemEntity(Evt *script, b32 isInitialCall)
ApiStatus RemoveItemAt(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
#define Ref(sym)
Address/pointer constant.
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Unbind
Unbinds the current thread from the trigger it was bound to, if any.
#define BindPadlock(EVT_SOURCE, TRIGGER, COLLIDER_ID, ITEM_LIST, UNK_A3, TRIGGER_PTR_OUTVAR)
Similar to BindTrigger, but also takes arguments for the item list to show.
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define EndSwitch
Marks the end of a switch statement and any case.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define Return
Kills the current EVT thread.