12 Trigger* trigger = script->owner2.trigger;
17 script->functionTemp[0] = 0;
20 switch (script->functionTemp[0]) {
31 s16 invItem = playerData->
keyItems[i];
33 if (invItem != ITEM_NONE) {
38 if (invItem == *itemIt) {
50 menu->
enabled[numEntries] = TRUE;
58 if (numEntries == 0) {
59 script->varTable[0] = 0;
66 script->functionTemp[1] = 0;
67 script->functionTemp[0] = 1;
70 if (script->functionTemp[1] == 0) {
71 script->functionTemp[2] = menu->
result;
72 if (script->functionTemp[2] == 0) {
78 script->functionTemp[1]++;
79 if (script->functionTemp[1] >= 15) {
82 if (script->functionTemp[2] == 0xFF) {
83 script->varTable[0] = -1;
85 s32 invIndex = menu->
userIndex[script->functionTemp[2] - 1];
86 script->varTable[1] = invIndex;
87 script->varTable[0] = playerData->
keyItems[invIndex];
99 Trigger* trigger = script->owner2.trigger;
104 script->functionTemp[0] = 0;
107 switch (script->functionTemp[0]) {
118 s16 invItem = playerData->
invItems[i];
120 if (invItem != ITEM_NONE) {
124 while (*itemIt > 0) {
125 if (invItem == *itemIt) {
137 menu->
enabled[numEntries] = TRUE;
145 if (numEntries == 0) {
146 script->varTable[0] = 0;
153 script->functionTemp[1] = 0;
154 script->functionTemp[0] = 1;
157 if (script->functionTemp[1] == 0) {
158 script->functionTemp[2] = menu->
result;
159 if (script->functionTemp[2] == 0) {
165 script->functionTemp[1]++;
166 if (script->functionTemp[1] >= 15) {
169 if (script->functionTemp[2] == 0xFF) {
170 script->varTable[0] = -1;
172 s32 invIdx = menu->
userIndex[script->functionTemp[2] - 1];
173 script->varTable[1] = invIdx;
174 script->varTable[0] = playerData->
invItems[invIdx];
184 Bytecode* args = script->ptrReadPos;
193 Bytecode* args = script->ptrReadPos;
209 Bytecode* args = script->ptrReadPos;
220 Bytecode* args = script->ptrReadPos;
231 Bytecode* args = script->ptrReadPos;
241API_CALLABLE(CountItem) {
242 Bytecode* args = script->ptrReadPos;
253 Bytecode* args = script->ptrReadPos;
264 Bytecode* args = script->ptrReadPos;
277 Bytecode* args = script->ptrReadPos;
290 Bytecode* args = script->ptrReadPos;
304 Bytecode* args = script->ptrReadPos;
312 Bytecode* args = script->ptrReadPos;
323 ptrItemEntity->
pos.
x = x;
324 ptrItemEntity->
pos.
y = y;
325 ptrItemEntity->
pos.
z = z;
330 Bytecode* args = script->ptrReadPos;
332 s32 flagBits = *args++;
337 itemEntity->
flags |= flagBits;
339 itemEntity->
flags &= ~flagBits;
345 Bytecode* args = script->ptrReadPos;
350 itemEntity->
alpha = alpha;
370 Bytecode* args = script->ptrReadPos;
381 Bytecode* args = script->ptrReadPos;
382 s32 itemID, unkCond, pickupMsgFlags;
385 script->functionTemp[0] = FALSE;
388 if (script->functionTemp[0]) {
395 pickupMsgFlags = *args++;
397 script->functionTemp[0] = TRUE;
void create_standard_popup_menu(PopupMenu *popup)
s32 evt_get_variable_index(Evt *script, s32 var)
s32 evt_get_variable(Evt *script, Bytecode var)
s32 add_star_pieces(s32 amt)
void hide_popup_menu(void)
void partner_disable_input(void)
void sort_consumables(void)
Bubbles up player inventory items such that all ITEM_NONE values are at the bottom.
s32 disable_player_input(void)
ItemEntity * get_item_entity(s32 itemEntityIndex)
s32 make_item_entity_at_player(s32 itemID, s32 arg1, s32 pickupMsgFlags)
s32 disable_player_static_collisions(void)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
void close_status_bar(void)
s32 make_item_entity_nodelay(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupVar)
s32 enable_player_input(void)
void destroy_popup_menu(void)
s32 add_star_points(s32 amt)
s32 find_item(s32)
Search player inventory for itemID and return first matching array index.
void remove_item_entity_by_index(s32 index)
s32 enable_player_static_collisions(void)
void set_item_entity_flags(s32 itemEntityIndex, s32 flag)
s32 count_item(s32 itemID)
Search player inventory for itemID and count the number matches.
s32 remove_item(s32 itemID)
Remove first instance of itemID found in player inventory.
b32 has_item(s32 itemID)
Check whether player has itemID in their inventory.
s32 add_item(s32 itemID)
Add itemID to player inventory and return inventory slot in which it was placed.
PopupMenu gItemChoicePopupMenu
void partner_enable_input(void)
ApiStatus CloseChoicePopup(Evt *script, b32 isInitialCall)
ApiStatus AddItem(Evt *script, b32 isInitialCall)
ApiStatus RemoveItemEntity(Evt *script, b32 isInitialCall)
ApiStatus ShowConsumableChoicePopup(Evt *script, b32 isInitialCall)
ApiStatus AddStarPieces(Evt *script, b32 isInitialCall)
ApiStatus RemoveItem(Evt *script, b32 isInitialCall)
ApiStatus SetItemAlpha(Evt *script, b32 isInitialCall)
ApiStatus SetItemPos(Evt *script, b32 isInitialCall)
ApiStatus SetItemFlags(Evt *script, b32 isInitialCall)
ApiStatus DropItemEntity(Evt *script, b32 isInitialCall)
ApiStatus HasItem(Evt *script, b32 isInitialCall)
ApiStatus MakeItemEntity(Evt *script, b32 isInitialCall)
ApiStatus AddStarPoints(Evt *script, b32 isInitialCall)
ApiStatus ShowGotItem(Evt *script, b32 isInitialCall)
ApiStatus AddCoin(Evt *script, b32 isInitialCall)
ApiStatus DropResizableItemEntity(Evt *script, b32 isInitialCall)
ApiStatus GetItemPower(Evt *script, b32 isInitialCall)
ApiStatus RemoveItemAt(Evt *script, b32 isInitialCall)
ApiStatus RemoveKeyItemAt(Evt *script, b32 isInitialCall)
ApiStatus FindItem(Evt *script, b32 isInitialCall)
ApiStatus ShowKeyChoicePopup(Evt *script, b32 isInitialCall)