2#include "message_ids.h"
291 switch (
script->functionTemp[0]) {
356 if (
shop->owner->onBuyEvt !=
NULL) {
419 menu->userIndex[numEntries] = i;
427 menu->popupType = popupType;
428 menu->numEntries = numEntries;
429 menu->initialPos = 0;
469 for (i = 0; i < numItems; i++) {
470 if (
items[i].itemID == itemID) {
517 switch (
script->functionTemp[0]) {
521 script->functionTemp[2] = 0;
526 if (
script->functionTemp[2] == 1) {
585 script->functionTemp[1] = 15;
589 if (
script->functionTemp[1] > 0) {
590 script->functionTemp[1]--;
594 if (
shop->selectedStoreItemSlot >= 0) {
607 script->functionTemp[2] = 0;
612 if (
script->functionTemp[2] == 1) {
634 script->functionTemp[2] = 0;
639 if (
script->functionTemp[2] == 1) {
660 script->functionTemp[1] = 15;
664 if (
script->functionTemp[1] > 0) {
665 script->functionTemp[1]--;
669 if (
shop->selectedStoreItemSlot >= 0) {
689 script->functionTemp[2] = 0;
694 if (
script->functionTemp[2] == 1) {
713 script->functionTemp[1] = 15;
717 if (
script->functionTemp[1] > 0) {
718 script->functionTemp[1]--;
722 if (
shop->selectedStoreItemSlot >= 0) {
742 script->functionTemp[2] = 0;
747 if (
script->functionTemp[2] == 1) {
766 if (
shop->owner->onTalkEvt != 0) {
816 for (i = 0; i <
shop->numItems; i++,
itemData++, shopItemEntities++) {
818 inY = shopItemEntities->
pos.
y + 30.0f;
827 z = (z * s + 1.0f) * 0.5;
829 if (z > 0.0f && z < 1.0f) {
843 if (i ==
shop->curItemSlot) {
852 if (
shop->unk_358 > 0) {
865 s32 inventoryItemFlags;
888 inventoryItemFlags =
var4;
896 shop->inventoryItemFlags = inventoryItemFlags;
914 if (
shop->numItems > 0) {
919 itemDataPositions =
shop->itemDataPositions;
951 shop->curItemSlot = 0;
952 shop->selectedStoreItemSlot = 0;
BSS s32 PopupMenu_SelectedIndex
ShopItemEntity * shopItemEntities
@ ITEM_ENTITY_FLAG_HIDDEN
@ DRAW_NUMBER_CHARSET_THIN
@ SHOP_FLAG_SHOWING_ITEM_INFO
@ SHOP_FLAG_INTERACT_SCRIPT_RUNNING
@ ACTION_STATE_BOUNCE
Used with Kooper.
@ SHOP_MSG_NOT_ENOUGH_COINS
@ SHOP_MSG_NOTHING_TO_CLAIM
@ SHOP_MSG_CHECK_ACCEPTED
@ SHOP_MSG_CLAIM_ACCEPTED
@ SHOP_MSG_NOTHING_TO_CHECK
@ SHOP_MSG_NOTHING_TO_SELL
@ SHOP_MSG_NOT_ENOUGH_ROOM
@ SHOP_BUY_RESULT_NOT_ENOUGH_COINS
@ SHOP_BUY_RESULT_NOT_ENOUGH_ROOM
Worker * get_worker(s32 idx)
void show_coin_counter(void)
s32 evt_get_variable(Evt *script, Bytecode var)
s32 get_model_list_index_from_tree_index(s32 treeIndex)
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)
void status_bar_ignore_changes(void)
void set_window_update(s32 panelID, s32)
void decrement_status_bar_disabled(void)
void hide_coin_counter(void)
s32 disable_player_input(void)
ItemEntity * get_item_entity(s32 itemEntityIndex)
void open_status_bar_quickly(void)
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)
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)
struct Model * get_model_from_list_index(s32 listIndex)
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
MessagePrintState * msg_get_printer_for_msg(s32 msgID, s32 *a1)
void set_message_int_var(s32 value, s32 index)
void status_bar_always_show_off(void)
void set_message_text_var(s32 msgID, s32 index)
void hide_coin_counter_immediately(void)
void set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void *drawContents, void *drawContentsArg, s8 parent)
s32 does_script_exist(s32 id)
s32 create_worker_frontUI(void(*updateFunc)(void), void(*drawFunc)(void))
s32 enable_player_static_collisions(void)
void set_item_entity_flags(s32 itemEntityIndex, s32 flag)
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)
void * heap_malloc(s32 size)
void status_bar_respond_to_changes(void)
void status_bar_always_show_on(void)
void get_model_center_and_size(u16 modelID, f32 *centerX, f32 *centerY, f32 *centerZ, f32 *sizeX, f32 *sizeY, f32 *sizeZ)
void increment_status_bar_disabled(void)
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)
ShopItemLocation * itemDataPositions
@ HUD_ELEMENT_FLAG_FILTER_TEX
s32 store_item(s32 itemID)
Add itemID to player storage and return slot in which it was placed.
s32 get_consumables_empty(void)
s32 get_stored_empty(void)
s32 get_stored_count(void)
s32 get_consumables_count(void)
s32 add_item(s32 itemID)
Add itemID to player inventory and return inventory slot in which it was placed.
#define EndSpeech(ARGS...)
#define ContinueSpeech(ARGS...)
#define SpeakToPlayer(ARGS...)
@ 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.
#define Goto(LABEL_ID)
Moves execution to the given label.
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
#define EndIf
Marks the end of an if statement or an else block.
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define Return
Kills the current EVT thread.
void shop_draw_item_desc(s32 arg0, s32 posX, s32 posY)
EvtScript EVS_ShopItemInteract
s32 shop_get_sell_price(s32 itemID)
EvtScript EVS_ShopResetSpeech
void draw_shop_items(void)
EvtScript EVS_ShopContinueSpeech
s32 shop_update_item_select_popup(s32 *selectedIndex)
s32 shop_owner_begin_speech(s32 messageIndex)
s32 shop_owner_end_speech(void)
s32 shop_owner_buy_dialog(s32 messageIndex, s32 itemName, s32 coinCost, s32 bpCost)
void shop_close_item_select_popup(void)
EvtScript EVS_ShopPurchaseDialog
@ PURCHASE_DIALOG_STATE_CANCEL
@ PURCHASE_DIALOG_STATE_ACCEPTED
@ PURCHASE_DIALOG_STATE_NOT_ENOUGH_ROOM
@ PURCHASE_DIALOG_STATE_INIT
@ PURCHASE_DIALOG_STATE_AWAIT_CALLBACK
@ PURCHASE_DIALOG_STATE_EXEC_CALLBACK
@ PURCHASE_DIALOG_STATE_WAIT_FOR_SPEECH
@ PURCHASE_DIALOG_STATE_NOT_ENOUGH_COINS
EvtScript EVS_ShopBeginSpeech
EvtScript EVS_ShopOwnerDialog
EvtScript EVS_ShopEndSpeech
void shop_open_item_select_popup(s32 mode)
void create_shop_popup_menu(PopupMenu *popup)
void shop_draw_item_name(s32 arg0, s32 posX, s32 posY)
s32 shop_owner_continue_speech_with_quantity(s32 messageIndex, s32 amount)
s32 shop_owner_reset_speech(s32 messageIndex)
s32 shop_owner_continue_speech(s32 messageIndex)
GameStatus * gGameStatusPtr
WindowStyle gWindowStyles[]
PlayerStatus gPlayerStatus