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 s32 shopItemSlot = script->varTable[0];
259 Shop* shop = gGameStatusPtr->mapShop;
260 ShopItemData* shopInventory = &shop->staticInventory[shopItemSlot];
261 ItemData* shopItem = &gItemTable[shopInventory->itemID];
262 s32 bpCost;
263
264 static MessagePrintState* D_80286528;
265 static Evt* wShopBuyCallbackScript;
266 static s32 wShopSelectedItem;
267 static s32 wShopBuyResult;
268
269 // functionTemp[0] is PurchaseDialogState
270 // functionTemp[1] is speech script ID
271 // functionTemp[2] is speech printer isClosed writeback
272
273 shop->flags &= ~SHOP_FLAG_SHOWING_ITEM_INFO;
275
276 if (isInitialCall) {
277 wShopSelectedItem = ITEM_NONE;
278 wShopBuyResult = SHOP_BUY_RESULT_NOT_ENOUGH_COINS;
279 bpCost = -1;
280 if (shopItem->typeFlags & ITEM_TYPE_FLAG_BADGE) {
281 bpCost = gMoveTable[shopItem->moveID].costBP;
282 }
283 script->functionTemp[1] = shop_owner_buy_dialog(SHOP_MSG_BUY_CONFIRM, shopItem->nameMsg, shopInventory->price, bpCost);
284 script->functionTemp[0] = PURCHASE_DIALOG_STATE_INIT;
288 }
289
290 switch (script->functionTemp[0]) {
292 if (!does_script_exist(script->functionTemp[1])) {
293 script->functionTemp[0] = PURCHASE_DIALOG_STATE_WAIT_FOR_SPEECH;
294 script->functionTemp[2] = false;
295 D_80286528 = msg_get_printer_for_msg(MSG_Choice_0001, &script->functionTemp[2]);
296 }
297 break;
299 if (script->functionTemp[2] == true) {
300 if (D_80286528->curOption == 0) {
301 if (gPlayerData.coins < shopInventory->price) {
302 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOT_ENOUGH_COINS);
303 script->functionTemp[0] = PURCHASE_DIALOG_STATE_NOT_ENOUGH_COINS;
304 } else if (!item_is_badge(shopInventory->itemID) && get_consumables_empty() < 1) {
305 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOT_ENOUGH_ROOM);
306 script->functionTemp[0] = PURCHASE_DIALOG_STATE_NOT_ENOUGH_ROOM;
307 } else {
308 gPlayerData.coins -= shopInventory->price;
309 if (item_is_badge(shopInventory->itemID)) {
310 add_item(shopInventory->itemID);
312 } else {
313 add_item(shopInventory->itemID);
314 }
315 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_BUY_THANK_YOU);
316 script->functionTemp[0] = PURCHASE_DIALOG_STATE_ACCEPTED;
317 }
318 } else {
319 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_FAREWELL);
320 script->functionTemp[0] = PURCHASE_DIALOG_STATE_CANCEL;
321 }
322 }
323 break;
325 if (!does_script_exist(script->functionTemp[1])) {
326 wShopBuyResult = SHOP_BUY_RESULT_NOT_ENOUGH_COINS;
327 wShopSelectedItem = shopInventory->itemID;
328 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
329 }
330 break;
332 if (!does_script_exist(script->functionTemp[1])) {
333 wShopBuyResult = SHOP_BUY_RESULT_NOT_ENOUGH_ROOM;
334 wShopSelectedItem = shopInventory->itemID;
335 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
336 }
337 break;
339 if (!does_script_exist(script->functionTemp[1])) {
340 wShopBuyResult = SHOP_BUY_RESULT_OK;
341 wShopSelectedItem = shopInventory->itemID;
342 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
343 }
344 break;
346 if (!does_script_exist(script->functionTemp[1])) {
347 wShopBuyResult = SHOP_BUY_RESULT_CANCEL;
348 wShopSelectedItem = shopInventory->itemID;
349 script->functionTemp[0] = PURCHASE_DIALOG_STATE_EXEC_CALLBACK;
350 }
351 break;
353 wShopBuyCallbackScript = nullptr;
354 if (shop->owner != nullptr) {
355 if (shop->owner->onBuyEvt != nullptr) {
356 wShopBuyCallbackScript = start_script(shop->owner->onBuyEvt, EVT_PRIORITY_1, 0);
357 wShopBuyCallbackScript->varTable[0] = wShopBuyResult;
358 wShopBuyCallbackScript->varTable[1] = wShopSelectedItem;
359 wShopBuyCallbackScript->varTable[2] = shopItemSlot;
360 }
361 }
362 script->functionTemp[0] = PURCHASE_DIALOG_STATE_AWAIT_CALLBACK;
363 break;
365 if (wShopBuyCallbackScript != nullptr && does_script_exist(wShopBuyCallbackScript->id)) {
366 break;
367 }
370 return ApiStatus_DONE1;
371 }
372 return ApiStatus_BLOCK;
373}
374
375enum {
379};
380
383 s16* itemArray;
384 s32 numItemSlots;
385 s32 popupType;
386 s32 numEntries;
387 s32 i;
388
389 switch (mode) {
390 case ITEM_POPUP_SELL:
391 popupType = POPUP_MENU_SELL_ITEM;
392 numItemSlots = ARRAY_COUNT(gPlayerData.invItems);
393 itemArray = gPlayerData.invItems;
394 break;
395 case ITEM_POPUP_CHECK:
396 popupType = POPUP_MENU_CHECK_ITEM;
397 numItemSlots = ARRAY_COUNT(gPlayerData.invItems);
398 itemArray = gPlayerData.invItems;
399 break;
400 case ITEM_POPUP_CLAIM:
401 default:
402 popupType = POPUP_MENU_CLAIM_ITEM;
403 numItemSlots = ARRAY_COUNT(gPlayerData.storedItems);
404 itemArray = gPlayerData.storedItems;
405 break;
406 }
407
408 numEntries = 0;
409
410 for (i = 0; i < numItemSlots; i++) {
411 s32 itemID = itemArray[i];
412 if (itemID == ITEM_NONE) {
413 continue;
414 }
415 ItemData* itemData = &gItemTable[itemID];
416
417 menu->ptrIcon[numEntries] = gItemHudScripts[itemData->hudElemID].enabled;
418 menu->userIndex[numEntries] = i;
419 menu->enabled[numEntries] = true;
420 menu->nameMsg[numEntries] = itemData->nameMsg;
421 menu->descMsg[numEntries] = itemData->shortDescMsg;
422 menu->value[numEntries] = shop_get_sell_price(itemID);
423 numEntries++;
424 }
425
426 menu->popupType = popupType;
427 menu->numEntries = numEntries;
428 menu->initialPos = 0;
433}
434
435s32 shop_update_item_select_popup(s32* selectedIndex) {
436 Shop* shop = gGameStatusPtr->mapShop;
437 PopupMenu* menu = &shop->itemSelectMenu;
438 s16 menuResult = shop->itemSelectMenu.result;
439
440 if (menuResult == POPUP_RESULT_CHOOSING) {
441 return 0;
442 }
443
445
446 if (menuResult == POPUP_RESULT_CANCEL) {
447 *selectedIndex = -1;
448 } else {
449 *selectedIndex = menu->userIndex[menuResult - 1];
450 }
451
452 return 1;
453}
454
461
462s32 shop_get_sell_price(s32 itemID) {
463 Shop* shop = gGameStatusPtr->mapShop;
464 s32 numItems = shop->numSpecialPrices;
465 ShopSellPriceData* items = shop->staticPriceList;
466 s32 i;
467
468 for (i = 0; i < numItems; i++) {
469 if (items[i].itemID == itemID) {
470 return items[i].sellPrice;
471 }
472 }
473
474 return gItemTable[itemID].sellValue;
475}
476
477API_CALLABLE(ShowShopOwnerDialog) {
478 Shop* shop = gGameStatus.mapShop;
479
480 static MessagePrintState* ShopOwnerPrintState;
481
482 enum {
483 DIALOG_STATE_DONE_INSTRUCTIONS = 0,
484 DIALOG_STATE_AWAIT_GREETING = 4,
485 DIALOG_STATE_AWAIT_MAIN_MENU = 41,
486 DIALOG_STATE_CLOSED_MAIN_MENU = 42,
487 DIALOG_STATE_CLOSED_SUBMENU = 9,
488 DIALOG_STATE_DONE = 10,
489 // selling
490 DIALOG_STATE_INIT_SELL_CHOICE = 201,
491 DIALOG_STATE_AWAIT_SELL_CHOICE = 2,
492 DIALOG_STATE_INIT_SELL_CONFIRM = 21,
493 DIALOG_STATE_AWAIT_SELL_CONFIRM = 3,
494 DIALOG_STATE_HANDLE_SELL_CHOICE = 31,
495 DIALOG_STATE_INIT_SELL_MORE_CHOICE = 32,
496 DIALOG_STATE_AWAIT_SELL_MORE_CHOICE = 12,
497 // checking
498 DIALOG_STATE_INIT_CHECK_CHOICE = 501,
499 DIALOG_STATE_AWAIT_CHECK_CHOICE = 5,
500 DIALOG_STATE_HANDLE_CHECK_CHOICE = 51,
501 DIALOG_STATE_INIT_CHECK_MORE_CHOICE = 52,
502 DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE = 53,
503 // claiming
504 DIALOG_STATE_INIT_CLAIM_CHOICE = 701,
505 DIALOG_STATE_AWAIT_CLAIM_CHOICE = 7,
506 DIALOG_STATE_HANDLE_CLAIM_CHOICE = 71,
507 DIALOG_STATE_INIT_CLAIM_MORE_CHOICE = 72,
508 DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE = 73,
509 };
510
511 if (isInitialCall) {
512 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_GREETING);
513 script->functionTemp[0] = DIALOG_STATE_AWAIT_GREETING;
514 }
515
516 switch (script->functionTemp[0]) {
517 case DIALOG_STATE_AWAIT_GREETING:
518 if (!does_script_exist(script->functionTemp[1])) {
519 script->functionTemp[0] = DIALOG_STATE_AWAIT_MAIN_MENU;
520 script->functionTemp[2] = 0;
521 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0003, &script->functionTemp[2]);
522 }
523 break;
524 case DIALOG_STATE_AWAIT_MAIN_MENU:
525 if (script->functionTemp[2] == 1) {
526 switch (ShopOwnerPrintState->curOption) {
527 case 0:
528 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_INSTRUCTIONS);
529 script->functionTemp[0] = DIALOG_STATE_DONE_INSTRUCTIONS;
530 break;
531 case 1:
532 if (get_consumables_count() == 0) {
533 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOTHING_TO_SELL);
534 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
535 } else {
536 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_SELL_WHICH);
537 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CHOICE;
538 }
539 break;
540 case 2:
541 if (get_consumables_count() == 0) {
542 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOTHING_TO_CHECK);
543 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
544 break;
545 }
546 if (get_stored_empty() == 0) {
547 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NO_CHECK_ROOM);
548 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
549 break;
550 }
552 script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_CHOICE;
553 break;
554 case 3:
555 if (get_stored_count() == 0) {
556 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOTHING_TO_CLAIM);
557 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
558 break;
559 }
560 if (get_consumables_empty() == 0) {
561 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NO_CLAIM_ROOM);
562 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
563 break;
564 }
565 script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_CLAIM_WHICH);
566 script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_CHOICE;
567 break;
568 default:
569 script->functionTemp[1] = shop_owner_end_speech();
570 script->functionTemp[0] = DIALOG_STATE_CLOSED_MAIN_MENU;
571 break;
572 }
573 }
574 break;
575 case DIALOG_STATE_INIT_SELL_CHOICE:
576 if (!does_script_exist(script->functionTemp[1])) {
578 script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_CHOICE;
579 }
580 break;
581 case DIALOG_STATE_AWAIT_SELL_CHOICE:
583 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CONFIRM;
584 script->functionTemp[1] = 15;
585 }
586 break;
587 case DIALOG_STATE_INIT_SELL_CONFIRM:
588 if (script->functionTemp[1] > 0) {
589 script->functionTemp[1]--;
590 break;
591 }
593 if (shop->selectedStoreItemSlot >= 0) {
597 script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_CONFIRM;
598 } else {
599 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_FAREWELL);
600 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
601 }
602 break;
603 case DIALOG_STATE_AWAIT_SELL_CONFIRM:
604 if (!does_script_exist(script->functionTemp[1])) {
605 script->functionTemp[0] = DIALOG_STATE_HANDLE_SELL_CHOICE;
606 script->functionTemp[2] = 0;
607 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0002, &script->functionTemp[2]);
608 }
609 break;
610 case DIALOG_STATE_HANDLE_SELL_CHOICE:
611 if (script->functionTemp[2] == 1) {
612 if (ShopOwnerPrintState->curOption == 0) {
614 gPlayerData.invItems[shop->selectedStoreItemSlot] = ITEM_NONE;
615 if (get_consumables_count() == 0) {
616 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_SELL_THANKS);
617 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
619 } else {
620 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_SELL_MORE);
621 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_MORE_CHOICE;
622 }
623 } else {
624 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_SELL_CANCEL);
625 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_MORE_CHOICE;
627 }
628 }
629 break;
630 case DIALOG_STATE_INIT_SELL_MORE_CHOICE:
631 if (!does_script_exist(script->functionTemp[1])) {
632 script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_MORE_CHOICE;
633 script->functionTemp[2] = 0;
634 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0004, &script->functionTemp[2]);
635 }
636 break;
637 case DIALOG_STATE_AWAIT_SELL_MORE_CHOICE:
638 if (script->functionTemp[2] == 1) {
639 if (ShopOwnerPrintState->curOption == 0) {
640 script->functionTemp[1] = shop_owner_end_speech();
641 script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CHOICE;
643 } else {
645 script->functionTemp[1] = shop_owner_reset_speech(22);
646 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
647 }
648 }
649 break;
650 case DIALOG_STATE_INIT_CHECK_CHOICE:
651 if (does_script_exist(script->functionTemp[1]) == 0) {
653 script->functionTemp[0] = DIALOG_STATE_AWAIT_CHECK_CHOICE;
654 }
655 break;
656 case DIALOG_STATE_AWAIT_CHECK_CHOICE:
658 script->functionTemp[0] = DIALOG_STATE_HANDLE_CHECK_CHOICE;
659 script->functionTemp[1] = 15;
660 }
661 break;
662 case DIALOG_STATE_HANDLE_CHECK_CHOICE:
663 if (script->functionTemp[1] > 0) {
664 script->functionTemp[1]--;
665 break;
666 }
668 if (shop->selectedStoreItemSlot >= 0) {
670 gPlayerData.invItems[shop->selectedStoreItemSlot] = ITEM_NONE;
671 }
672
673 if ((get_consumables_count() == 0) || (get_stored_empty() == 0)) {
674 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CHECK_ACCEPTED);
675 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
676 } else {
677 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CHECK_MORE);
678 script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_MORE_CHOICE;
679 }
680 } else {
681 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_FAREWELL);
682 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
683 }
684 break;
685 case DIALOG_STATE_INIT_CHECK_MORE_CHOICE:
686 if (!does_script_exist(script->functionTemp[1])) {
687 script->functionTemp[0] = DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE;
688 script->functionTemp[2] = 0;
689 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0005, &script->functionTemp[2]);
690 }
691 break;
692 case DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE:
693 if (script->functionTemp[2] == 1) {
694 if (ShopOwnerPrintState->curOption == 0) {
695 script->functionTemp[1] = shop_owner_end_speech();
696 script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_CHOICE;
697 } else {
698 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_FAREWELL);
699 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
700 }
701 }
702 break;
703 case DIALOG_STATE_INIT_CLAIM_CHOICE:
704 if (!does_script_exist(script->functionTemp[1])) {
706 script->functionTemp[0] = DIALOG_STATE_AWAIT_CLAIM_CHOICE;
707 }
708 break;
709 case DIALOG_STATE_AWAIT_CLAIM_CHOICE:
711 script->functionTemp[0] = DIALOG_STATE_HANDLE_CLAIM_CHOICE;
712 script->functionTemp[1] = 15;
713 }
714 break;
715 case DIALOG_STATE_HANDLE_CLAIM_CHOICE:
716 if (script->functionTemp[1] > 0) {
717 script->functionTemp[1]--;
718 break;
719 }
721 if (shop->selectedStoreItemSlot >= 0) {
724 }
725
726 if (get_consumables_empty() == 0 || get_stored_count() == 0) {
727 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CLAIM_ACCEPTED);
728 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
729 } else {
730 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_CLAIM_MORE);
731 script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_MORE_CHOICE;
732 }
733 } else {
734 script->functionTemp[1] = shop_owner_begin_speech(SHOP_MSG_FAREWELL);
735 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
736 }
737 break;
738 case DIALOG_STATE_INIT_CLAIM_MORE_CHOICE:
739 if (!does_script_exist(script->functionTemp[1])) {
740 script->functionTemp[0] = DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE;
741 script->functionTemp[2] = 0;
742 ShopOwnerPrintState = msg_get_printer_for_msg(MSG_Choice_0005, &script->functionTemp[2]);
743 }
744 break;
745 case DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE:
746 if (script->functionTemp[2] == 1) {
747 if (ShopOwnerPrintState->curOption == 0) {
748 script->functionTemp[1] = shop_owner_end_speech();
749 script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_CHOICE;
750 } else {
751 script->functionTemp[1] = shop_owner_reset_speech(SHOP_MSG_FAREWELL);
752 script->functionTemp[0] = DIALOG_STATE_CLOSED_SUBMENU;
753 }
754 }
755 break;
756 case DIALOG_STATE_DONE_INSTRUCTIONS:
757 case DIALOG_STATE_CLOSED_SUBMENU:
758 case DIALOG_STATE_CLOSED_MAIN_MENU:
759 if (!does_script_exist(script->functionTemp[1])) {
760 script->functionTemp[0] = DIALOG_STATE_DONE;
761 }
762 break;
763 case DIALOG_STATE_DONE:
764 if (shop->owner != nullptr) {
765 if (shop->owner->onTalkEvt != 0) {
767 }
768 }
770 return ApiStatus_DONE1;
771 }
772 return ApiStatus_BLOCK;
773}
774
775void shop_draw_item_name(s32 arg0, s32 posX, s32 posY) {
776 Shop* shop = gGameStatusPtr->mapShop;
777 ShopItemData* siItem = &shop->staticInventory[shop->curItemSlot];
778 ItemData* shopItem = &gItemTable[siItem->itemID];
779
780 draw_msg(shopItem->nameMsg, posX + 60 - (get_msg_width(shopItem->nameMsg, 0) >> 1), posY + 6, 255, MSG_PAL_WHITE, 0);
781}
782
783void shop_draw_item_desc(s32 arg0, s32 posX, s32 posY) {
784 Shop* shop = gGameStatusPtr->mapShop;
785 ShopItemData* shopItem = &shop->staticInventory[shop->curItemSlot];
786
787 draw_msg(shopItem->descMsg, posX + 8, posY, 255, MSG_PAL_STANDARD, 0);
788}
789
790void draw_shop_items(void) {
791 Shop* shop = gGameStatusPtr->mapShop;
792 ShopItemData* itemData;
793 Camera* camera;
794 s32 i;
795 s32 xTemp;
796 s32 yTemp;
797 s32 xOffset;
798 f32 x, y, z, s;
799 f32 inX, inY, inZ;
800 ShopItemEntity* shopItemEntities;
801
805 } else {
808 }
809
811 camera = &gCameras[gCurrentCameraID];
812 itemData = shop->staticInventory;
813 shopItemEntities = gGameStatusPtr->shopItemEntities;
814
815 for (i = 0; i < shop->numItems; i++, itemData++, shopItemEntities++) {
816 inX = shopItemEntities->pos.x;
817 inY = shopItemEntities->pos.y + 30.0f;
818 inZ = shopItemEntities->pos.z;
819
820 transform_point(camera->mtxPerspective, inX, inY, inZ, 1.0f, &x, &y, &z, &s);
821
822 s = 1.0f / s;
823
824 x *= s;
825 y *= -s;
826 z = (z * s + 1.0f) * 0.5;
827
828 if (z > 0.0f && z < 1.0f) {
829 xTemp = (((x * camera->viewportW) + camera->viewportW) * 0.5) + camera->viewportStartX;
830 yTemp = (((y * camera->viewportH) + camera->viewportH) * 0.5) + camera->viewportStartY;
831
832 if (itemData->price < 100) {
833 xOffset = -4;
834 } else {
835 xOffset = 0;
836 }
837
838 if (!(get_item_entity(shopItemEntities->index)->flags & ITEM_ENTITY_FLAG_HIDDEN)) {
839 draw_number(itemData->price, xTemp + xOffset, yTemp, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_WHITE, 255, 0);
840 }
841
842 if (i == shop->curItemSlot) {
843 hud_element_set_render_pos(shop->costHID, (xTemp + xOffset) - 6, yTemp + 5);
844 hud_element_set_scale(shop->costHID, 0.7f);
846 }
847 }
848 }
849 }
850
851 if (shop->unk_358 > 0) {
852 shop->unk_358--;
853 } else {
854 shop->flags &= ~SHOP_FLAG_SHOWING_ITEM_INFO;
856 }
857}
858
859API_CALLABLE(MakeShop) {
860 Bytecode* args = script->ptrReadPos;
861 ShopItemLocation* itemDataPositions;
862 ShopItemData* inventory;
863 ShopSellPriceData* prices;
864 s32 inventoryItemFlags;
865 Shop* shop;
866 Model* model;
867 s32 numShopItems;
868 f32 centerX;
869 f32 centerY;
870 f32 centerZ;
871 s32 var1;
872 s32 var2;
873 s32 var3;
874 s32 var4;
875 f32 sizeX;
876 f32 sizeY;
877 f32 sizeZ;
878
879 var1 = evt_get_variable(script, *args++);
880 var2 = evt_get_variable(script, *args++);
881 var3 = evt_get_variable(script, *args++);
882 var4 = evt_get_variable(script, *args++);
883
884 itemDataPositions = (ShopItemLocation*) var1;
885 inventory = (ShopItemData*) var2;
886 prices = (ShopSellPriceData*) var3;
887 inventoryItemFlags = var4;
888
889 shop = heap_malloc(sizeof(*shop));
890
891 gGameStatusPtr->mapShop = shop;
892 shop->itemDataPositions = itemDataPositions;
893 shop->staticInventory = inventory;
894 shop->staticPriceList = prices;
895 shop->inventoryItemFlags = inventoryItemFlags;
896
897 numShopItems = 0;
898 while (inventory->itemID != ITEM_NONE) {
899 numShopItems++;
900 inventory++;
901 }
902 shop->numItems = numShopItems;
903
904 numShopItems = 0;
905 if (prices != nullptr) {
906 while (prices->itemID != ITEM_NONE) {
907 numShopItems++;
908 prices++;
909 }
910 }
911 shop->numSpecialPrices = numShopItems;
912
913 if (shop->numItems > 0) {
915 }
916
917 inventory = shop->staticInventory;
918 itemDataPositions = shop->itemDataPositions;
919 numShopItems = 0;
920 while (inventory->itemID != ITEM_NONE) {
921 get_model_center_and_size(itemDataPositions->posModelID, &centerX, &centerY, &centerZ, &sizeX, &sizeY, &sizeZ);
922 centerY += 6;
923 gGameStatusPtr->shopItemEntities[numShopItems].pos.x = centerX;
924 gGameStatusPtr->shopItemEntities[numShopItems].pos.y = centerY;
925 gGameStatusPtr->shopItemEntities[numShopItems].pos.z = centerZ;
927 model->flags |= MODEL_FLAG_INACTIVE;
928 gGameStatusPtr->shopItemEntities[numShopItems].index =
929 make_item_entity_nodelay(inventory->itemID | shop->inventoryItemFlags, centerX, centerY, centerZ, 1, 0);
931 bind_trigger_1(&EVS_ShopItemInteract, TRIGGER_FLOOR_TOUCH, itemDataPositions->triggerColliderID, numShopItems, 0, 3);
932 bind_trigger_1(&EVS_ShopItemInteract, TRIGGER_FLOOR_PRESS_A, itemDataPositions->triggerColliderID, numShopItems, 0, 3);
933 itemDataPositions++;
934 inventory++;
935 numShopItems++;
936 }
937
943#if VERSION_JP
945#else
947#endif
950 shop->curItemSlot = 0;
951 shop->selectedStoreItemSlot = 0;
952 shop->flags = 0;
953 shop->owner = nullptr;
954
955 return ApiStatus_DONE2;
956}
957
958API_CALLABLE(MakeShopOwner) {
959 Shop* mapShop = gGameStatusPtr->mapShop;
960
961 mapShop->owner = (ShopOwner*) evt_get_variable(script, *script->ptrReadPos);
962 return ApiStatus_DONE2;
963}
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:5964
@ WINDOW_STYLE_3
Definition enums.h:5958
@ BUTTON_A
Definition enums.h:2776
@ ITEM_ENTITY_RESIZABLE
Definition enums.h:2694
@ ITEM_ENTITY_FLAG_HIDDEN
Definition enums.h:2686
@ POPUP_MENU_SELL_ITEM
Definition enums.h:3170
@ POPUP_MENU_CHECK_ITEM
Definition enums.h:3171
@ POPUP_MENU_CLAIM_ITEM
Definition enums.h:3172
@ WINDOW_PRIORITY_1
Definition enums.h:3217
@ WINDOW_PRIORITY_0
Definition enums.h:3216
@ MSG_PAL_WHITE
Definition enums.h:4990
@ MSG_PAL_STANDARD
Definition enums.h:5000
@ PS_FLAG_PAUSE_DISABLED
Definition enums.h:3078
@ DRAW_NUMBER_CHARSET_THIN
Definition enums.h:4986
@ ITEM_TYPE_FLAG_BADGE
Definition enums.h:1865
@ MODEL_FLAG_INACTIVE
Definition enums.h:3944
@ POPUP_RESULT_CANCEL
Definition enums.h:3212
@ POPUP_RESULT_CHOOSING
Definition enums.h:3211
@ SHOP_FLAG_SHOWING_ITEM_INFO
Definition enums.h:4531
@ SHOP_FLAG_INTERACT_SCRIPT_RUNNING
Definition enums.h:4532
@ PARTNER_NONE
Definition enums.h:2919
@ PARTNER_BOMBETTE
Definition enums.h:2922
@ PARTNER_KOOPER
Definition enums.h:2921
@ ACTION_STATE_FALLING
Definition enums.h:2421
@ ACTION_STATE_BOUNCE
Used with Kooper.
Definition enums.h:2417
@ TRIGGER_FLOOR_PRESS_A
Definition enums.h:2667
@ TRIGGER_FLOOR_TOUCH
Definition enums.h:2663
@ SHOP_MSG_BUY_THANK_YOU
Definition enums.h:4539
@ SHOP_MSG_NOT_ENOUGH_COINS
Definition enums.h:4537
@ SHOP_MSG_FAREWELL
Definition enums.h:4558
@ SHOP_MSG_SELL_THANKS
Definition enums.h:4547
@ SHOP_MSG_SELL_MORE
Definition enums.h:4546
@ SHOP_MSG_NOTHING_TO_CLAIM
Definition enums.h:4553
@ SHOP_MSG_CLAIM_MORE
Definition enums.h:4557
@ SHOP_MSG_BUY_CONFIRM
Definition enums.h:4536
@ SHOP_MSG_GREETING
Definition enums.h:4540
@ SHOP_MSG_CHECK_ACCEPTED
Definition enums.h:4551
@ SHOP_MSG_CHECK_WHICH
Definition enums.h:4550
@ SHOP_MSG_SELL_WHICH
Definition enums.h:4543
@ SHOP_MSG_CLAIM_ACCEPTED
Definition enums.h:4556
@ SHOP_MSG_NOTHING_TO_CHECK
Definition enums.h:4548
@ SHOP_MSG_SELL_CONFIRM
Definition enums.h:4544
@ SHOP_MSG_NOTHING_TO_SELL
Definition enums.h:4542
@ SHOP_MSG_SELL_CANCEL
Definition enums.h:4545
@ SHOP_MSG_CHECK_MORE
Definition enums.h:4552
@ SHOP_MSG_INSTRUCTIONS
Definition enums.h:4541
@ SHOP_MSG_NO_CHECK_ROOM
Definition enums.h:4549
@ SHOP_MSG_NOT_ENOUGH_ROOM
Definition enums.h:4538
@ SHOP_MSG_NO_CLAIM_ROOM
Definition enums.h:4554
@ SHOP_MSG_CLAIM_WHICH
Definition enums.h:4555
@ SHOP_BUY_RESULT_OK
Definition enums.h:4563
@ SHOP_BUY_RESULT_NOT_ENOUGH_COINS
Definition enums.h:4562
@ SHOP_BUY_RESULT_CANCEL
Definition enums.h:4565
@ SHOP_BUY_RESULT_NOT_ENOUGH_ROOM
Definition enums.h:4567
@ WIN_SHOP_ITEM_DESC
Definition enums.h:4837
@ WIN_SHOP_ITEM_NAME
Definition enums.h:4836
@ EVT_PRIORITY_1
Definition evt.h:153
#define ApiStatus_DONE2
Definition evt.h:119
s32 Bytecode
Definition evt.h:7
#define ApiStatus_DONE1
Definition evt.h:118
#define ApiStatus_BLOCK
Definition evt.h:117
Worker * get_worker(s32 idx)
Definition worker.c:186
void show_coin_counter(void)
Definition inventory.c:1357
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1730
s32 get_model_list_index_from_tree_index(s32 treeIndex)
Definition model.c:3393
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:1507
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void decrement_status_bar_disabled(void)
Definition inventory.c:1656
void hide_coin_counter(void)
Definition inventory.c:1395
s32 disable_player_input(void)
Definition 77480.c:989
ItemEntity * get_item_entity(s32 itemEntityIndex)
void open_status_bar_quickly(void)
Definition inventory.c:1440
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:971
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1887
void close_status_bar(void)
Definition inventory.c:1450
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:997
void destroy_popup_menu(void)
struct Model * get_model_from_list_index(s32 listIndex)
Definition model.c:3312
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
MessagePrintState * msg_get_printer_for_msg(s32 msgID, s32 *a1)
Definition msg.c:1426
void set_message_int_var(s32 value, s32 index)
Definition msg.c:1552
void status_bar_always_show_off(void)
Definition inventory.c:1532
void set_message_text_var(s32 msgID, s32 index)
Definition msg.c:1522
void hide_coin_counter_immediately(void)
Definition inventory.c:1403
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:979
void set_item_entity_flags(s32 itemEntityIndex, s32 flag)
s32 add_coins(s32 amt)
Definition inventory.c:2075
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:2225
void * heap_malloc(s32 size)
Definition heap.c:34
void status_bar_respond_to_changes(void)
Definition inventory.c:1518
void status_bar_always_show_on(void)
Definition inventory.c:1528
void get_model_center_and_size(u16 modelID, f32 *centerX, f32 *centerY, f32 *centerZ, f32 *sizeX, f32 *sizeY, f32 *sizeZ)
Definition model.c:3429
void increment_status_bar_disabled(void)
Definition inventory.c:1664
void hud_element_set_scale(s32 index, f32 scale)
HudElemID hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
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_MANUAL_RENDER
Definition hud_element.h:78
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:86
s16 numSpecialPrices
s16 numItems
ShopOwner * owner
s32 curItemSlot
HudElemID costHID
HudScript * ptrIcon[32]
b32 enabled[32]
s32 value[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:374
s32 get_consumables_empty(void)
Definition inventory.c:441
s32 get_stored_empty(void)
Definition inventory.c:458
s32 get_stored_count(void)
Definition inventory.c:445
s32 get_consumables_count(void)
Definition inventory.c:428
s32 add_item(s32 itemID)
Add itemID to player inventory and return inventory slot in which it was placed.
Definition inventory.c:151
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:214
#define IfFalse(b)
Definition macros.h:650
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:233
#define ARRAY_COUNT(arr)
Definition macros.h:39
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:228
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:299
#define LVar2
Definition macros.h:151
#define LVar1
Definition macros.h:150
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:270
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:577
#define LVar3
Definition macros.h:152
#define LVar0
Definition macros.h:149
#define Return
Kills the current EVT thread.
Definition macros.h:218
void shop_draw_item_desc(s32 arg0, s32 posX, s32 posY)
Definition shops.c:783
EvtScript EVS_ShopItemInteract
Definition shops.c:48
s32 shop_get_sell_price(s32 itemID)
Definition shops.c:462
HudScript HES_ItemCoin
EvtScript EVS_ShopResetSpeech
Definition shops.c:35
void draw_shop_items(void)
Definition shops.c:790
EvtScript EVS_ShopContinueSpeech
Definition shops.c:29
u8 MessageSingular[]
Definition msg.c:48
s32 shop_update_item_select_popup(s32 *selectedIndex)
Definition shops.c:435
s32 shop_owner_begin_speech(s32 messageIndex)
Definition shops.c:82
@ ITEM_POPUP_CLAIM
Definition shops.c:378
@ ITEM_POPUP_CHECK
Definition shops.c:377
@ ITEM_POPUP_SELL
Definition shops.c:376
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:455
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:381
void create_shop_popup_menu(PopupMenu *popup)
void shop_draw_item_name(s32 arg0, s32 posX, s32 posY)
Definition shops.c:775
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:20
GameStatus * gGameStatusPtr
Definition main_loop.c:31
WindowStyle gWindowStyles[]
Definition windows.c:25
Camera gCameras[4]
Definition cam_main.c:16
PlayerData gPlayerData
Definition 77480.c:39
PlayerStatus gPlayerStatus
Definition 77480.c:38
s32 gCurrentCameraID
Definition cam_math.c:5
MoveData gMoveTable[]