1#ifndef _COMMON_CONSUMABLE_CHOICE_
2#define _COMMON_CONSUMABLE_CHOICE_
5#include "sprite/player.h"
8static s32 N(ItemChoice_List)[ITEM_NUM_CONSUMABLES + 1];
10#ifndef _CHOICE_SUPPORT_
11#define _CHOICE_SUPPORT_
13s32 N(ItemChoice_HasSelectedItem) = 0;
14s32 N(ItemChoice_SelectedItemID) = 0;
19API_CALLABLE(N(ItemChoice_WaitForSelection)) {
23 N(ItemChoice_HasSelectedItem) = FALSE;
26 if (N(ItemChoice_HasSelectedItem)) {
27 N(ItemChoice_HasSelectedItem) = FALSE;
35API_CALLABLE(N(ItemChoice_SaveSelected)) {
39 N(ItemChoice_HasSelectedItem) = TRUE;
45API_CALLABLE(N(BuildItemChoiceList)) {
50 if (allowedItemList != NULL) {
51 for (i = 0; allowedItemList[i] != ITEM_NONE; i++) {
52 N(ItemChoice_List)[i] = allowedItemList[i];
54 N(ItemChoice_List)[i] = ITEM_NONE;
57 for (i = 0; i < NUM_ITEMS; i++) {
59 N(ItemChoice_List)[
pos++] = i;
62 N(ItemChoice_List)[
pos] = ITEM_NONE;
94 Call(N(ItemChoice_WaitForSelection),
LVar0)
99#define EVT_CHOOSE_ANY_CONSUMABLE(unkMode) \
101 Set(LVar1, unkMode) \
102 ExecWait(N(EVS_ChooseItem))
104#define EVT_CHOOSE_CONSUMABLE_FROM(itemList, unkMode) \
105 Set(LVar0, Ref(itemList)) \
106 Set(LVar1, unkMode) \
107 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.