Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
shops.c
Go to the documentation of this file.
1#include "common.h"
2#include "message_ids.h"
3#include "hud_element.h"
4#include "model.h"
6#include "inventory.h"
7
8#if !VERSION_JP
9extern u8 MessagePlural[];
10extern u8 MessageSingular[];
11#endif
12
15
16s32 shop_get_sell_price(s32 itemID);
17
18API_CALLABLE(CanInteractWithShopItem);
19API_CALLABLE(BeginShopItemInteraction);
20API_CALLABLE(ShowShopPurchaseDialog);
21API_CALLABLE(ShowShopOwnerDialog);
22
28
34
41
47
51 Goto(10)
52 EndIf
54 Goto(10)
55 EndIf
57 Goto(10)
58 EndIf
59 Return
60 Label(10)
61 Call(CanInteractWithShopItem)
63 Return
64 EndIf
65 Call(BeginShopItemInteraction, LVar0)
66 Return
67 End
68};
69
71 Call(ShowShopPurchaseDialog, LVar0)
72 Return
73 End
74};
75
77 Call(ShowShopOwnerDialog)
78 Return
79 End
80};
81
82s32 shop_owner_begin_speech(s32 messageIndex) {
84 s32 shopMsgID = shop->owner->shopMsgIDs[messageIndex];
86
87 script->varTable[0] = shopMsgID;
88 script->varTable[1] = shop->owner->npcID;
89 script->varTable[2] = shop->owner->talkAnim;
90 script->varTable[3] = shop->owner->idleAnim;
91
92 return script->id;
93}
94
95s32 shop_owner_buy_dialog(s32 messageIndex, s32 itemName, s32 coinCost, s32 bpCost) {
97 s32 shopMsgID = shop->owner->shopMsgIDs[messageIndex];
98 Evt* script;
99 u8* suffix;
100
101 set_message_text_var(itemName, 0);
102 set_message_int_var(coinCost, 1);
103
104 if (bpCost > 0) {
105 set_message_int_var(bpCost, 2);
106#if !VERSION_JP
107 } else {
108 if (coinCost == 1) {
109 suffix = MessageSingular;
110 } else {
111 suffix = MessagePlural;
112 }
113 set_message_text_var((s32) suffix, 2);
114#endif
115 }
116
118 script->varTable[0] = shopMsgID;
119 script->varTable[1] = shop->owner->npcID;
120 script->varTable[2] = shop->owner->talkAnim;
121 script->varTable[3] = shop->owner->idleAnim;
122
123 return script->id;
124}
125
126s32 shop_owner_continue_speech(s32 messageIndex) {
127 Shop* shop = gGameStatusPtr->mapShop;
128 s32 shopMsgID = shop->owner->shopMsgIDs[messageIndex];
130
131 script->varTable[0] = shopMsgID;
132 script->varTable[1] = shop->owner->npcID;
133 script->varTable[2] = shop->owner->talkAnim;
134 script->functionTemp[3] = script->varTable[3] = shop->owner->idleAnim;
135
136 return script->id;
137}
138
139s32 shop_owner_continue_speech_with_quantity(s32 messageIndex, s32 amount) {
140 Shop* shop = gGameStatusPtr->mapShop;
141 s32 shopMsgID = shop->owner->shopMsgIDs[messageIndex];
142 u8* suffixMsg;
143 Evt* script;
144
145 set_message_int_var(amount, 0);
146
147#if !VERSION_JP
148 if (amount == 1) {
149 suffixMsg = MessageSingular;
150 } else {
151 suffixMsg = MessagePlural;
152 }
153
154 set_message_text_var((s32) suffixMsg, 1);
155#endif
156
158 script->varTable[0] = shopMsgID;
159 script->varTable[1] = shop->owner->npcID;
160 script->varTable[2] = shop->owner->talkAnim;
161 script->functionTemp[3] = script->varTable[3] = shop->owner->idleAnim;
162
163 return script->id;
164}
165
166s32 shop_owner_reset_speech(s32 messageIndex) {
167 Shop* shop = gGameStatusPtr->mapShop;
168 s32 shopMsgID = shop->owner->shopMsgIDs[messageIndex];
170
171 script->varTable[0] = shopMsgID;
172 script->varTable[1] = shop->owner->npcID;
173 script->varTable[2] = shop->owner->talkAnim;
174 script->functionTemp[3] = script->varTable[3] = shop->owner->idleAnim;
175
176 return script->id;
177}
178
180 Shop* shop = gGameStatusPtr->mapShop;
182
183 script->varTable[0] = shop->owner->npcID;
184 script->varTable[1] = shop->owner->talkAnim;
185 script->functionTemp[3] = script->varTable[2] = shop->owner->idleAnim;
186
187 return script->id;
188}
189
190API_CALLABLE(CanInteractWithShopItem) {
191 PlayerStatus* playerStatus = &gPlayerStatus;
192
193 script->varTable[2] = FALSE;
194
195 if (playerStatus->actionState == ACTION_STATE_BOUNCE ||
196 playerStatus->actionState == ACTION_STATE_FALLING) {
197 return ApiStatus_DONE2;
198 }
199
200 if ((playerStatus->flags & PS_FLAG_PAUSE_DISABLED)) {
201 return ApiStatus_DONE2;
202 }
203
204 script->varTable[2] = TRUE;
205 return ApiStatus_DONE2;
206}
207
208API_CALLABLE(BeginShopItemInteraction) {
209 static Evt* ShopInteractScript;
210 static s32 ShopInteractScriptID;
211
212 Shop* shop = gGameStatusPtr->mapShop;
213 s32 currentItemSlot = evt_get_variable(script, *script->ptrReadPos);
214
216 shop->curItemSlot = currentItemSlot;
219 shop->unk_358 = 5;
220
222 Evt* childScript;
223
226
228 childScript->varTable[0] = currentItemSlot;
229 ShopInteractScript = childScript;
230 ShopInteractScriptID = childScript->id;
232 return ApiStatus_BLOCK;
233 } else {
234 return ApiStatus_DONE2;
235 }
236 } else if (does_script_exist(ShopInteractScriptID)) {
237 return ApiStatus_BLOCK;
238 }
239
240 shop->flags &= ~SHOP_FLAG_INTERACT_SCRIPT_RUNNING;
243 return ApiStatus_DONE2;
244}
245
256
257API_CALLABLE(ShowShopPurchaseDialog) {
258 PlayerData* playerData = &gPlayerData;
259 s32 shopItemSlot = script->varTable[0];
260 Shop* shop = gGameStatusPtr->mapShop;
261 ShopItemData* shopInventory = &shop->staticInventory[shopItemSlot];
262 ItemData* shopItem = &gItemTable[shopInventory->itemID];
263 s32 bpCost;
264
265 static MessagePrintState* D_80286528;
266 static Evt* wShopBuyCallbackScript;
267 static s32 wShopSelectedItem;
268 static s32 wShopBuyResult;
269
270 // functionTemp[0] is PurchaseDialogState
271 // functionTemp[1] is speech script ID
272 // functionTemp[2] is speech printer isClosed writeback
273
274 shop->flags &= ~SHOP_FLAG_SHOWING_ITEM_INFO;
276
277 if (isInitialCall) {
278 wShopSelectedItem = ITEM_NONE;
279 wShopBuyResult = SHOP_BUY_RESULT_NOT_ENOUGH_COINS;
280 bpCost = -1;
281 if (shopItem->typeFlags & ITEM_TYPE_FLAG_BADGE) {
282 bpCost = gMoveTable[shopItem->moveID].costBP;
283 }
284 script->functionTemp[1] = shop_owner_buy_dialog(SHOP_MSG_BUY_CONFIRM, shopItem->nameMsg, shopInventory->price, bpCost);
285 script->functionTemp[0] = PURCHASE_DIALOG_STATE_INIT;
289 }
290
291 switch (script->functionTemp[0]) {
293 if (!does_script_exist(script->functionTemp[1])) {
294 script->functionTemp[0] = PURCHASE_DIALOG_STATE_WAIT_FOR_SPEECH;
295 script->functionTemp[2] = FALSE;
296 D_80286528 = msg_get_printer_for_msg(MSG_Choice_0001, &script->functionTemp[2]);
297 }
298 break;
300 if (script->functionTemp[2] == TRUE) {
301 if (D_80286528->curOption == 0) {
302 if (gPlayerData.coins < shopInventory->price) {
303 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOT_ENOUGH_COINS);
304 script->functionTemp[0] = PURCHASE_DIALOG_STATE_NOT_ENOUGH_COINS;
305 } else if (!item_is_badge(shopInventory->itemID) && get_consumables_empty() < 1) {
306 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOT_ENOUGH_ROOM);
307 script->functionTemp[0] = PURCHASE_DIALOG_STATE_NOT_ENOUGH_ROOM;
308 } else {
309 gPlayerData.coins -= shopInventory->price;
310 if (item_is_badge(shopInventory->itemID)) {
311 add_item(shopInventory->itemID);
313 } else {
314 add_item(shopInventory->itemID);
315 }
316 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_BUY_THANK_YOU);
317 script->functionTemp[0] = PURCHASE_DIALOG_STATE_ACCEPTED;
318 }
319 } else {
320 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_FAREWELL);
321 script->functionTemp[0] = PURCHASE_DIALOG_STATE_CANCEL;
322 }
323 }
324 break;
326 if (!does_script_exist(script->functionTemp[1])) {
327 wShopBuyResult = SHOP_BUY_RESULT_NOT_ENOUGH_COINS;
328 wShopSelectedItem = shopInventory->itemID;
329 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
330 }
331 break;
333 if (!does_script_exist(script->functionTemp[1])) {
334 wShopBuyResult = SHOP_BUY_RESULT_NOT_ENOUGH_ROOM;
335 wShopSelectedItem = shopInventory->itemID;
336 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
337 }
338 break;
340 if (!does_script_exist(script->functionTemp[1])) {
341 wShopBuyResult = SHOP_BUY_RESULT_OK;
342 wShopSelectedItem = shopInventory->itemID;
343 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
344 }
345 break;
347 if (!does_script_exist(script->functionTemp[1])) {
348 wShopBuyResult = SHOP_BUY_RESULT_CANCEL;
349 wShopSelectedItem = shopInventory->itemID;
350 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
351 }
352 break;
354 wShopBuyCallbackScript = NULL;
355 if (shop->owner != NULL) {
356 if (shop->owner->onBuyEvt != NULL) {
357 wShopBuyCallbackScript = start_script(shop->owner->onBuyEvt, EVT_PRIORITY_1, 0);
358 wShopBuyCallbackScript->varTable[0] = wShopBuyResult;
359 wShopBuyCallbackScript->varTable[1] = wShopSelectedItem;
360 wShopBuyCallbackScript->varTable[2] = shopItemSlot;
361 }
362 }
363 script->functionTemp[0] = PURCHASE_DIALOG_STATE_AWAIT_CALLBACK;
364 break;
366 if (wShopBuyCallbackScript != NULL && does_script_exist(wShopBuyCallbackScript->id)) {
367 break;
368 }
371 return ApiStatus_DONE1;
372 }
373 return ApiStatus_BLOCK;
374}
375
376enum {
380};
381
384 s16* itemArray;
385 s32 numItemSlots;
386 s32 popupType;
387 s32 numEntries;
388 s32 i;
389
390 switch (mode) {
391 case ITEM_POPUP_SELL:
392 popupType = POPUP_MENU_SELL_ITEM;
393 numItemSlots = ARRAY_COUNT(gPlayerData.invItems);
394 itemArray = gPlayerData.invItems;
395 break;
396 case ITEM_POPUP_CHECK:
397 popupType = POPUP_MENU_CHECK_ITEM;
398 numItemSlots = ARRAY_COUNT(gPlayerData.invItems);
399 itemArray = gPlayerData.invItems;
400 break;
401 case ITEM_POPUP_CLAIM:
402 default:
403 popupType = POPUP_MENU_CLAIM_ITEM;
404 numItemSlots = ARRAY_COUNT(gPlayerData.storedItems);
405 itemArray = gPlayerData.storedItems;
406 break;
407 }
408
409 numEntries = 0;
410
411 for (i = 0; i < numItemSlots; i++) {
412 s32 itemID = itemArray[i];
413 if (itemID == ITEM_NONE) {
414 continue;
415 }
416 ItemData* itemData = &gItemTable[itemID];
417
418 menu->ptrIcon[numEntries] = gItemHudScripts[itemData->hudElemID].enabled;
419 menu->userIndex[numEntries] = i;
420 menu->enabled[numEntries] = TRUE;
421 menu->nameMsg[numEntries] = itemData->nameMsg;
422 menu->descMsg[numEntries] = itemData->shortDescMsg;
423 menu->value[numEntries] = shop_get_sell_price(itemID);
424 numEntries++;
425 }
426
427 menu->popupType = popupType;
428 menu->numEntries = numEntries;
429 menu->initialPos = 0;
434}
435
436s32 shop_update_item_select_popup(s32* selectedIndex) {
437 Shop* shop = gGameStatusPtr->mapShop;
438 PopupMenu* menu = &shop->itemSelectMenu;
439 s16 menuResult = shop->itemSelectMenu.result;
440
441 if (menuResult == POPUP_RESULT_CHOOSING) {
442 return 0;
443 }
444
446
447 if (menuResult == POPUP_RESULT_CANCEL) {
448 *selectedIndex = -1;
449 } else {
450 *selectedIndex = menu->userIndex[menuResult - 1];
451 }
452
453 return 1;
454}
455
462
463s32 shop_get_sell_price(s32 itemID) {
464 Shop* shop = gGameStatusPtr->mapShop;
465 s32 numItems = shop->numSpecialPrices;
466 ShopSellPriceData* items = shop->staticPriceList;
467 s32 i;
468
469 for (i = 0; i < numItems; i++) {
470 if (items[i].itemID == itemID) {
471 return items[i].sellPrice;
472 }
473 }
474
475 return gItemTable[itemID].sellValue;
476}
477
478API_CALLABLE(ShowShopOwnerDialog) {
479 Shop* shop = gGameStatus.mapShop;
480
481 static MessagePrintState* ShopOwnerPrintState;
482
483 enum {
484 DIALOG_STATE_DONE_INSTRUCTIONS = 0,
485 DIALOG_STATE_AWAIT_GREETING = 4,
486 DIALOG_STATE_AWAIT_MAIN_MENU = 41,
487 DIALOG_STATE_CLOSED_MAIN_MENU = 42,
488 DIALOG_STATE_CLOSED_SUBMENU = 9,
489 DIALOG_STATE_DONE = 10,
490 // selling
491 DIALOG_STATE_INIT_SELL_CHOICE = 201,
492 DIALOG_STATE_AWAIT_SELL_CHOICE = 2,
493 DIALOG_STATE_INIT_SELL_CONFIRM = 21,
494 DIALOG_STATE_AWAIT_SELL_CONFIRM = 3,
495 DIALOG_STATE_HANDLE_SELL_CHOICE = 31,
496 DIALOG_STATE_INIT_SELL_MORE_CHOICE = 32,
497 DIALOG_STATE_AWAIT_SELL_MORE_CHOICE = 12,
498 // checking
499 DIALOG_STATE_INIT_CHECK_CHOICE = 501,
500 DIALOG_STATE_AWAIT_CHECK_CHOICE = 5,
501 DIALOG_STATE_HANDLE_CHECK_CHOICE = 51,
502 DIALOG_STATE_INIT_CHECK_MORE_CHOICE = 52,
503 DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE = 53,
504 // claiming
505 DIALOG_STATE_INIT_CLAIM_CHOICE = 701,
506 DIALOG_STATE_AWAIT_CLAIM_CHOICE = 7,
507 DIALOG_STATE_HANDLE_CLAIM_CHOICE = 71,
508 DIALOG_STATE_INIT_CLAIM_MORE_CHOICE = 72,
509 DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE = 73,
510 };
511
512 if (isInitialCall) {
513 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_GREETING);
514 script->functionTemp[0] = DIALOG_STATE_AWAIT_GREETING;
515 }
516
517 switch (script->functionTemp[0]) {
518 case DIALOG_STATE_AWAIT_GREETING:
519 if (!does_script_exist(script->functionTemp[1])) {
520 script->functionTemp[0] = DIALOG_STATE_AWAIT_MAIN_MENU;
521 script->functionTemp[2] = 0;
522 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0003, &script->functionTemp[2]);
523 }
524 break;
525 case DIALOG_STATE_AWAIT_MAIN_MENU:
526 if (script->functionTemp[2] == 1) {
527 switch (ShopOwnerPrintState->curOption) {
528 case 0:
529 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_INSTRUCTIONS);
530 script->functionTemp[0] = DIALOG_STATE_DONE_INSTRUCTIONS;
531 break;
532 case 1:
533 if (get_consumables_count() == 0) {
534 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOTHING_TO_SELL);
535 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
536 } else {
537 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_SELL_WHICH);
538 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CHOICE;
539 }
540 break;
541 case 2:
542 if (get_consumables_count() == 0) {
543 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOTHING_TO_CHECK);
544 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
545 break;
546 }
547 if (get_stored_empty() == 0) {
548 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NO_CHECK_ROOM);
549 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
550 break;
551 }
553 script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_CHOICE;
554 break;
555 case 3:
556 if (get_stored_count() == 0) {
557 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOTHING_TO_CLAIM);
558 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
559 break;
560 }
561 if (get_consumables_empty() == 0) {
562 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NO_CLAIM_ROOM);
563 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
564 break;
565 }
566 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_CLAIM_WHICH);
567 script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_CHOICE;
568 break;
569 default:
570 script->functionTemp[1] = shop_owner_end_speech();
571 script->functionTemp[0] = DIALOG_STATE_CLOSED_MAIN_MENU;
572 break;
573 }
574 }
575 break;
576 case DIALOG_STATE_INIT_SELL_CHOICE:
577 if (!does_script_exist(script->functionTemp[1])) {
579 script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_CHOICE;
580 }
581 break;
582 case DIALOG_STATE_AWAIT_SELL_CHOICE:
584 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CONFIRM;
585 script->functionTemp[1] = 15;
586 }
587 break;
588 case DIALOG_STATE_INIT_SELL_CONFIRM:
589 if (script->functionTemp[1] > 0) {
590 script->functionTemp[1]--;
591 break;
592 }
594 if (shop->selectedStoreItemSlot >= 0) {
598 script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_CONFIRM;
599 } else {
600 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_FAREWELL);
601 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
602 }
603 break;
604 case DIALOG_STATE_AWAIT_SELL_CONFIRM:
605 if (!does_script_exist(script->functionTemp[1])) {
606 script->functionTemp[0] = DIALOG_STATE_HANDLE_SELL_CHOICE;
607 script->functionTemp[2] = 0;
608 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0002, &script->functionTemp[2]);
609 }
610 break;
611 case DIALOG_STATE_HANDLE_SELL_CHOICE:
612 if (script->functionTemp[2] == 1) {
613 if (ShopOwnerPrintState->curOption == 0) {
615 gPlayerData.invItems[shop->selectedStoreItemSlot] = ITEM_NONE;
616 if (get_consumables_count() == 0) {
617 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_SELL_THANKS);
618 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
620 } else {
621 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_SELL_MORE);
622 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_MORE_CHOICE;
623 }
624 } else {
625 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_SELL_CANCEL);
626 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_MORE_CHOICE;
628 }
629 }
630 break;
631 case DIALOG_STATE_INIT_SELL_MORE_CHOICE:
632 if (!does_script_exist(script->functionTemp[1])) {
633 script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_MORE_CHOICE;
634 script->functionTemp[2] = 0;
635 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0004, &script->functionTemp[2]);
636 }
637 break;
638 case DIALOG_STATE_AWAIT_SELL_MORE_CHOICE:
639 if (script->functionTemp[2] == 1) {
640 if (ShopOwnerPrintState->curOption == 0) {
641 script->functionTemp[1] = shop_owner_end_speech();
642 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CHOICE;
644 } else {
646 script->functionTemp[1] = shop_owner_reset_speech(22);
647 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
648 }
649 }
650 break;
651 case DIALOG_STATE_INIT_CHECK_CHOICE:
652 if (does_script_exist(script->functionTemp[1]) == 0) {
654 script->functionTemp[0] = DIALOG_STATE_AWAIT_CHECK_CHOICE;
655 }
656 break;
657 case DIALOG_STATE_AWAIT_CHECK_CHOICE:
659 script->functionTemp[0] = DIALOG_STATE_HANDLE_CHECK_CHOICE;
660 script->functionTemp[1] = 15;
661 }
662 break;
663 case DIALOG_STATE_HANDLE_CHECK_CHOICE:
664 if (script->functionTemp[1] > 0) {
665 script->functionTemp[1]--;
666 break;
667 }
669 if (shop->selectedStoreItemSlot >= 0) {
671 gPlayerData.invItems[shop->selectedStoreItemSlot] = ITEM_NONE;
672 }
673
674 if ((get_consumables_count() == 0) || (get_stored_empty() == 0)) {
675 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CHECK_ACCEPTED);
676 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
677 } else {
678 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CHECK_MORE);
679 script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_MORE_CHOICE;
680 }
681 } else {
682 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_FAREWELL);
683 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
684 }
685 break;
686 case DIALOG_STATE_INIT_CHECK_MORE_CHOICE:
687 if (!does_script_exist(script->functionTemp[1])) {
688 script->functionTemp[0] = DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE;
689 script->functionTemp[2] = 0;
690 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0005, &script->functionTemp[2]);
691 }
692 break;
693 case DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE:
694 if (script->functionTemp[2] == 1) {
695 if (ShopOwnerPrintState->curOption == 0) {
696 script->functionTemp[1] = shop_owner_end_speech();
697 script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_CHOICE;
698 } else {
699 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_FAREWELL);
700 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
701 }
702 }
703 break;
704 case DIALOG_STATE_INIT_CLAIM_CHOICE:
705 if (!does_script_exist(script->functionTemp[1])) {
707 script->functionTemp[0] = DIALOG_STATE_AWAIT_CLAIM_CHOICE;
708 }
709 break;
710 case DIALOG_STATE_AWAIT_CLAIM_CHOICE:
712 script->functionTemp[0] = DIALOG_STATE_HANDLE_CLAIM_CHOICE;
713 script->functionTemp[1] = 15;
714 }
715 break;
716 case DIALOG_STATE_HANDLE_CLAIM_CHOICE:
717 if (script->functionTemp[1] > 0) {
718 script->functionTemp[1]--;
719 break;
720 }
722 if (shop->selectedStoreItemSlot >= 0) {
725 }
726
727 if (get_consumables_empty() == 0 || get_stored_count() == 0) {
728 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CLAIM_ACCEPTED);
729 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
730 } else {
731 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CLAIM_MORE);
732 script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_MORE_CHOICE;
733 }
734 } else {
735 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_FAREWELL);
736 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
737 }
738 break;
739 case DIALOG_STATE_INIT_CLAIM_MORE_CHOICE:
740 if (!does_script_exist(script->functionTemp[1])) {
741 script->functionTemp[0] = DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE;
742 script->functionTemp[2] = 0;
743 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0005, &script->functionTemp[2]);
744 }
745 break;
746 case DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE:
747 if (script->functionTemp[2] == 1) {
748 if (ShopOwnerPrintState->curOption == 0) {
749 script->functionTemp[1] = shop_owner_end_speech();
750 script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_CHOICE;
751 } else {
752 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_FAREWELL);
753 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
754 }
755 }
756 break;
757 case DIALOG_STATE_DONE_INSTRUCTIONS:
758 case DIALOG_STATE_CLOSED_SUBMENU:
759 case DIALOG_STATE_CLOSED_MAIN_MENU:
760 if (!does_script_exist(script->functionTemp[1])) {
761 script->functionTemp[0] = DIALOG_STATE_DONE;
762 }
763 break;
764 case DIALOG_STATE_DONE:
765 if (shop->owner != NULL) {
766 if (shop->owner->onTalkEvt != 0) {
768 }
769 }
771 return ApiStatus_DONE1;
772 }
773 return ApiStatus_BLOCK;
774}
775
776void shop_draw_item_name(s32 arg0, s32 posX, s32 posY) {
777 Shop* shop = gGameStatusPtr->mapShop;
778 ShopItemData* siItem = &shop->staticInventory[shop->curItemSlot];
779 ItemData* shopItem = &gItemTable[siItem->itemID];
780
781 draw_msg(shopItem->nameMsg, posX + 60 - (get_msg_width(shopItem->nameMsg, 0) >> 1), posY + 6, 255, MSG_PAL_WHITE, 0);
782}
783
784void shop_draw_item_desc(s32 arg0, s32 posX, s32 posY) {
785 Shop* shop = gGameStatusPtr->mapShop;
786 ShopItemData* shopItem = &shop->staticInventory[shop->curItemSlot];
787
788 draw_msg(shopItem->descMsg, posX + 8, posY, 255, MSG_PAL_STANDARD, 0);
789}
790
791void draw_shop_items(void) {
792 Shop* shop = gGameStatusPtr->mapShop;
793 ShopItemData* itemData;
794 Camera* camera;
795 s32 i;
796 s32 xTemp;
797 s32 yTemp;
798 s32 xOffset;
799 f32 x, y, z, s;
800 f32 inX, inY, inZ;
801 ShopItemEntity* shopItemEntities;
802
806 } else {
809 }
810
812 camera = &gCameras[gCurrentCameraID];
813 itemData = shop->staticInventory;
814 shopItemEntities = gGameStatusPtr->shopItemEntities;
815
816 for (i = 0; i < shop->numItems; i++, itemData++, shopItemEntities++) {
817 inX = shopItemEntities->pos.x;
818 inY = shopItemEntities->pos.y + 30.0f;
819 inZ = shopItemEntities->pos.z;
820
821 transform_point(camera->mtxPerspective, inX, inY, inZ, 1.0f, &x, &y, &z, &s);
822
823 s = 1.0f / s;
824
825 x *= s;
826 y *= -s;
827 z = (z * s + 1.0f) * 0.5;
828
829 if (z > 0.0f && z < 1.0f) {
830 xTemp = (((x * camera->viewportW) + camera->viewportW) * 0.5) + camera->viewportStartX;
831 yTemp = (((y * camera->viewportH) + camera->viewportH) * 0.5) + camera->viewportStartY;
832
833 if (itemData->price < 100) {
834 xOffset = -4;
835 } else {
836 xOffset = 0;
837 }
838
839 if (!(get_item_entity(shopItemEntities->index)->flags & ITEM_ENTITY_FLAG_HIDDEN)) {
840 draw_number(itemData->price, xTemp + xOffset, yTemp, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_WHITE, 255, 0);
841 }
842
843 if (i == shop->curItemSlot) {
844 hud_element_set_render_pos(shop->costIconID, (xTemp + xOffset) - 6, yTemp + 5);
847 }
848 }
849 }
850 }
851
852 if (shop->unk_358 > 0) {
853 shop->unk_358--;
854 } else {
855 shop->flags &= ~SHOP_FLAG_SHOWING_ITEM_INFO;
857 }
858}
859
860API_CALLABLE(MakeShop) {
861 Bytecode* args = script->ptrReadPos;
862 ShopItemLocation* itemDataPositions;
863 ShopItemData* inventory;
864 ShopSellPriceData* prices;
865 s32 inventoryItemFlags;
866 Shop* shop;
867 Model* model;
868 s32 numShopItems;
869 f32 centerX;
870 f32 centerY;
871 f32 centerZ;
872 s32 var1;
873 s32 var2;
874 s32 var3;
875 s32 var4;
876 f32 sizeX;
877 f32 sizeY;
878 f32 sizeZ;
879
880 var1 = evt_get_variable(script, *args++);
881 var2 = evt_get_variable(script, *args++);
882 var3 = evt_get_variable(script, *args++);
883 var4 = evt_get_variable(script, *args++);
884
885 itemDataPositions = (ShopItemLocation*) var1;
886 inventory = (ShopItemData*) var2;
887 prices = (ShopSellPriceData*) var3;
888 inventoryItemFlags = var4;
889
890 shop = heap_malloc(sizeof(*shop));
891
892 gGameStatusPtr->mapShop = shop;
893 shop->itemDataPositions = itemDataPositions;
894 shop->staticInventory = inventory;
895 shop->staticPriceList = prices;
896 shop->inventoryItemFlags = inventoryItemFlags;
897
898 numShopItems = 0;
899 while (inventory->itemID != ITEM_NONE) {
900 numShopItems++;
901 inventory++;
902 }
903 shop->numItems = numShopItems;
904
905 numShopItems = 0;
906 if (prices != NULL) {
907 while (prices->itemID != ITEM_NONE) {
908 numShopItems++;
909 prices++;
910 }
911 }
912 shop->numSpecialPrices = numShopItems;
913
914 if (shop->numItems > 0) {
916 }
917
918 inventory = shop->staticInventory;
919 itemDataPositions = shop->itemDataPositions;
920 numShopItems = 0;
921 while (inventory->itemID != ITEM_NONE) {
922 get_model_center_and_size(itemDataPositions->posModelID, &centerX, &centerY, &centerZ, &sizeX, &sizeY, &sizeZ);
923 centerY += 6;
924 gGameStatusPtr->shopItemEntities[numShopItems].pos.x = centerX;
925 gGameStatusPtr->shopItemEntities[numShopItems].pos.y = centerY;
926 gGameStatusPtr->shopItemEntities[numShopItems].pos.z = centerZ;
928 model->flags |= MODEL_FLAG_INACTIVE;
929 gGameStatusPtr->shopItemEntities[numShopItems].index =
930 make_item_entity_nodelay(inventory->itemID | shop->inventoryItemFlags, centerX, centerY, centerZ, 1, 0);
932 bind_trigger_1(&EVS_ShopItemInteract, TRIGGER_FLOOR_TOUCH, itemDataPositions->triggerColliderID, numShopItems, 0, 3);
933 bind_trigger_1(&EVS_ShopItemInteract, TRIGGER_FLOOR_PRESS_A, itemDataPositions->triggerColliderID, numShopItems, 0, 3);
934 itemDataPositions++;
935 inventory++;
936 numShopItems++;
937 }
938
944#if VERSION_JP
946#else
948#endif
951 shop->curItemSlot = 0;
952 shop->selectedStoreItemSlot = 0;
953 shop->flags = 0;
954 shop->owner = NULL;
955
956 return ApiStatus_DONE2;
957}
958
959API_CALLABLE(MakeShopOwner) {
960 Shop* mapShop = gGameStatusPtr->mapShop;
961
962 mapShop->owner = (ShopOwner*) evt_get_variable(script, *script->ptrReadPos);
963 return ApiStatus_DONE2;
964}
IconHudScriptPair gItemHudScripts[]
u32 pressedButtons[4]
EvtScript * onBuyEvt
struct Shop * mapShop
s16 storedItems[32]
ShopItemEntity * shopItemEntities
EvtScript * onTalkEvt
Bytecode EvtScript[]
s16 invItems[10]
#define transform_point
#define get_msg_width
#define draw_msg
@ WINDOW_STYLE_9
Definition enums.h:6379
@ WINDOW_STYLE_3
Definition enums.h:6373
@ BUTTON_A
Definition enums.h:2790
@ ITEM_ENTITY_RESIZABLE
Definition enums.h:2708
@ ITEM_ENTITY_FLAG_HIDDEN
Definition enums.h:2700
@ POPUP_MENU_SELL_ITEM
Definition enums.h:3136
@ POPUP_MENU_CHECK_ITEM
Definition enums.h:3137
@ POPUP_MENU_CLAIM_ITEM
Definition enums.h:3138
@ WINDOW_PRIORITY_1
Definition enums.h:3183
@ WINDOW_PRIORITY_0
Definition enums.h:3182
@ MSG_PAL_WHITE
Definition enums.h:5405
@ MSG_PAL_STANDARD
Definition enums.h:5415
@ PS_FLAG_PAUSE_DISABLED
Definition enums.h:3044
@ DRAW_NUMBER_CHARSET_THIN
Definition enums.h:5401
@ ITEM_TYPE_FLAG_BADGE
Definition enums.h:1839
@ MODEL_FLAG_INACTIVE
Definition enums.h:4359
@ POPUP_RESULT_CANCEL
Definition enums.h:3178
@ POPUP_RESULT_CHOOSING
Definition enums.h:3177
@ SHOP_FLAG_SHOWING_ITEM_INFO
Definition enums.h:4946
@ SHOP_FLAG_INTERACT_SCRIPT_RUNNING
Definition enums.h:4947
@ PARTNER_NONE
Definition enums.h:2885
@ PARTNER_BOMBETTE
Definition enums.h:2888
@ PARTNER_KOOPER
Definition enums.h:2887
@ ACTION_STATE_FALLING
Definition enums.h:2435
@ ACTION_STATE_BOUNCE
Used with Kooper.
Definition enums.h:2431
@ TRIGGER_FLOOR_PRESS_A
Definition enums.h:2681
@ TRIGGER_FLOOR_TOUCH
Definition enums.h:2677
@ SHOP_MSG_BUY_THANK_YOU
Definition enums.h:4954
@ SHOP_MSG_NOT_ENOUGH_COINS
Definition enums.h:4952
@ SHOP_MSG_FAREWELL
Definition enums.h:4973
@ SHOP_MSG_SELL_THANKS
Definition enums.h:4962
@ SHOP_MSG_SELL_MORE
Definition enums.h:4961
@ SHOP_MSG_NOTHING_TO_CLAIM
Definition enums.h:4968
@ SHOP_MSG_CLAIM_MORE
Definition enums.h:4972
@ SHOP_MSG_BUY_CONFIRM
Definition enums.h:4951
@ SHOP_MSG_GREETING
Definition enums.h:4955
@ SHOP_MSG_CHECK_ACCEPTED
Definition enums.h:4966
@ SHOP_MSG_CHECK_WHICH
Definition enums.h:4965
@ SHOP_MSG_SELL_WHICH
Definition enums.h:4958
@ SHOP_MSG_CLAIM_ACCEPTED
Definition enums.h:4971
@ SHOP_MSG_NOTHING_TO_CHECK
Definition enums.h:4963
@ SHOP_MSG_SELL_CONFIRM
Definition enums.h:4959
@ SHOP_MSG_NOTHING_TO_SELL
Definition enums.h:4957
@ SHOP_MSG_SELL_CANCEL
Definition enums.h:4960
@ SHOP_MSG_CHECK_MORE
Definition enums.h:4967
@ SHOP_MSG_INSTRUCTIONS
Definition enums.h:4956
@ SHOP_MSG_NO_CHECK_ROOM
Definition enums.h:4964
@ SHOP_MSG_NOT_ENOUGH_ROOM
Definition enums.h:4953
@ SHOP_MSG_NO_CLAIM_ROOM
Definition enums.h:4969
@ SHOP_MSG_CLAIM_WHICH
Definition enums.h:4970
@ SHOP_BUY_RESULT_OK
Definition enums.h:4978
@ SHOP_BUY_RESULT_NOT_ENOUGH_COINS
Definition enums.h:4977
@ SHOP_BUY_RESULT_CANCEL
Definition enums.h:4980
@ SHOP_BUY_RESULT_NOT_ENOUGH_ROOM
Definition enums.h:4982
@ WIN_SHOP_ITEM_DESC
Definition enums.h:5252
@ WIN_SHOP_ITEM_NAME
Definition enums.h:5251
@ EVT_PRIORITY_1
Definition evt.h:152
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
Worker * get_worker(s32 idx)
Definition worker.c:186
void show_coin_counter(void)
Definition inventory.c:1348
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
s32 get_model_list_index_from_tree_index(s32 treeIndex)
Definition model.c:3397
void hide_popup_menu(void)
void basic_hidden_window_update(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
Definition windows.c:184
void status_bar_ignore_changes(void)
Definition inventory.c:1497
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void decrement_status_bar_disabled(void)
Definition inventory.c:1646
void hide_coin_counter(void)
Definition inventory.c:1385
s32 disable_player_input(void)
Definition 77480.c:990
ItemEntity * get_item_entity(s32 itemEntityIndex)
void open_status_bar_quickly(void)
Definition inventory.c:1430
void basic_window_update(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
Definition windows.c:161
s32 disable_player_static_collisions(void)
Definition 77480.c:972
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
void close_status_bar(void)
Definition inventory.c:1440
s32 make_item_entity_nodelay(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupVar)
s32 enable_player_input(void)
Definition 77480.c:998
void destroy_popup_menu(void)
struct Model * get_model_from_list_index(s32 listIndex)
Definition model.c:3315
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
MessagePrintState * msg_get_printer_for_msg(s32 msgID, s32 *a1)
Definition msg.c:1424
void set_message_int_var(s32 value, s32 index)
Definition msg.c:1550
void status_bar_always_show_off(void)
Definition inventory.c:1522
void set_message_text_var(s32 msgID, s32 index)
Definition msg.c:1520
void hide_coin_counter_immediately(void)
Definition inventory.c:1393
void set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void *drawContents, void *drawContentsArg, s8 parent)
Definition windows.c:373
s32 does_script_exist(s32 id)
s32 create_worker_frontUI(void(*updateFunc)(void), void(*drawFunc)(void))
Definition worker.c:63
s32 enable_player_static_collisions(void)
Definition 77480.c:980
void set_item_entity_flags(s32 itemEntityIndex, s32 flag)
s32 add_coins(s32 amt)
Definition inventory.c:2065
Trigger * bind_trigger_1(EvtScript *script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority)
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
void * heap_malloc(s32 size)
Definition heap.c:34
void status_bar_respond_to_changes(void)
Definition inventory.c:1508
void status_bar_always_show_on(void)
Definition inventory.c:1518
void get_model_center_and_size(u16 modelID, f32 *centerX, f32 *centerY, f32 *centerZ, f32 *sizeX, f32 *sizeY, f32 *sizeZ)
Definition model.c:3433
void increment_status_bar_disabled(void)
Definition inventory.c:1654
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
void hud_element_draw_clipped(s32 id)
s32 userIndex[32]
s32 inventoryItemFlags
PopupMenu itemSelectMenu
s32 nameMsg[32]
ShopSellPriceData * staticPriceList
ShopItemLocation * itemDataPositions
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:88
s16 numSpecialPrices
s16 numItems
ShopOwner * owner
s32 curItemSlot
HudScript * ptrIcon[32]
s32 costIconID
s32 value[32]
s32 enabled[32]
s32 unk_358
s16 flags
s32 selectedStoreItemSlot
ShopItemData * staticInventory
s32 HudScript[]
Definition hud_element.h:9
HudScript * enabled
s32 descMsg[32]
s32 store_item(s32 itemID)
Add itemID to player storage and return slot in which it was placed.
Definition inventory.c:369
s32 get_consumables_empty(void)
Definition inventory.c:436
s32 get_stored_empty(void)
Definition inventory.c:453
s32 get_stored_count(void)
Definition inventory.c:440
s32 get_consumables_count(void)
Definition inventory.c:423
s32 add_item(s32 itemID)
Add itemID to player inventory and return inventory slot in which it was placed.
Definition inventory.c:146
u16 flags
Definition model.h:60
Definition model.h:59
#define EndSpeech(ARGS...)
Definition msg_api.h:10
#define ContinueSpeech(ARGS...)
Definition msg_api.h:14
#define SpeakToPlayer(ARGS...)
Definition msg_api.h:6
@ GF_MAC01_BoughtBadgeFromRowf
ApiStatus GetPartnerInUse(Evt *script, b32 isInitialCall)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define IfFalse(b)
Definition macros.h:646
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217
@ ITEM_POPUP_CLAIM
Definition shops.c:379
@ ITEM_POPUP_CHECK
Definition shops.c:378
@ ITEM_POPUP_SELL
Definition shops.c:377
void shop_draw_item_desc(s32 arg0, s32 posX, s32 posY)
Definition shops.c:784
EvtScript EVS_ShopItemInteract
Definition shops.c:48
s32 shop_get_sell_price(s32 itemID)
Definition shops.c:463
HudScript HES_ItemCoin
EvtScript EVS_ShopResetSpeech
Definition shops.c:35
void draw_shop_items(void)
Definition shops.c:791
EvtScript EVS_ShopContinueSpeech
Definition shops.c:29
u8 MessageSingular[]
Definition msg.c:48
s32 shop_update_item_select_popup(s32 *selectedIndex)
Definition shops.c:436
s32 shop_owner_begin_speech(s32 messageIndex)
Definition shops.c:82
s32 shop_owner_end_speech(void)
Definition shops.c:179
s32 shop_owner_buy_dialog(s32 messageIndex, s32 itemName, s32 coinCost, s32 bpCost)
Definition shops.c:95
void shop_close_item_select_popup(void)
Definition shops.c:456
EvtScript EVS_ShopPurchaseDialog
Definition shops.c:70
u8 MessagePlural[]
Definition msg.c:42
PurchaseDialogState
Definition shops.c:246
@ PURCHASE_DIALOG_STATE_CANCEL
Definition shops.c:251
@ PURCHASE_DIALOG_STATE_ACCEPTED
Definition shops.c:250
@ PURCHASE_DIALOG_STATE_NOT_ENOUGH_ROOM
Definition shops.c:249
@ PURCHASE_DIALOG_STATE_INIT
Definition shops.c:247
@ PURCHASE_DIALOG_STATE_AWAIT_CALLBACK
Definition shops.c:253
@ PURCHASE_DIALOG_STATE_EXEC_CALLBACK
Definition shops.c:252
@ PURCHASE_DIALOG_STATE_WAIT_FOR_SPEECH
Definition shops.c:254
@ PURCHASE_DIALOG_STATE_NOT_ENOUGH_COINS
Definition shops.c:248
EvtScript EVS_ShopBeginSpeech
Definition shops.c:23
EvtScript EVS_ShopOwnerDialog
Definition shops.c:76
EvtScript EVS_ShopEndSpeech
Definition shops.c:42
void shop_open_item_select_popup(s32 mode)
Definition shops.c:382
void create_shop_popup_menu(PopupMenu *popup)
void shop_draw_item_name(s32 arg0, s32 posX, s32 posY)
Definition shops.c:776
s32 shop_owner_continue_speech_with_quantity(s32 messageIndex, s32 amount)
Definition shops.c:139
s32 shop_owner_reset_speech(s32 messageIndex)
Definition shops.c:166
s32 shop_owner_continue_speech(s32 messageIndex)
Definition shops.c:126
s16 viewportStartX
s16 viewportStartY
Matrix4f mtxPerspective
ItemData gItemTable[]
GameStatus gGameStatus
Definition main_loop.c:21
GameStatus * gGameStatusPtr
Definition main_loop.c:32
WindowStyle gWindowStyles[]
Definition windows.c:25
Camera gCameras[4]
Definition cam_main.c:17
PlayerData gPlayerData
Definition 77480.c:40
PlayerStatus gPlayerStatus
Definition 77480.c:39
s32 gCurrentCameraID
Definition cam_math.c:4
MoveData gMoveTable[]