6#define FULLY_EXTENDED_Y 18
7#define FULLY_RETRACTED_Y -100
56 playerData->
curHP = 10;
59 playerData->
curFP = 5;
62 playerData->
maxBP = 3;
63 playerData->
level = 1;
67 playerData->
coins = 0;
96 playerData->
badges[i] = ITEM_NONE;
100 playerData->
invItems[i] = ITEM_NONE;
150 if (item_is_key(itemID)) {
166 if (item_is_badge(itemID)) {
202 if (item_is_key(itemID)) {
218 if (item_is_badge(itemID)) {
262 if (item_is_key(itemID)) {
276 if (item_is_badge(itemID)) {
309 if (item_is_key(itemID)) {
319 if (item_is_badge(itemID)) {
341 if (item_is_key(itemID)) {
351 if (item_is_badge(itemID)) {
390 if (!item_is_badge(itemID)) {
486 statusBar->
hidden = FALSE;
488 statusBar->
unk_3B = FALSE;
512 statusBar->
unk_3C = FALSE;
633 for (i = 0; i < numDigits; i++) {
635 digits[(numDigits - i) - 1] = digit;
642 for (i = 0; i < numDigits; i++, drawX += 8) {
646 if (digit != 0 || keepDrawing || (i == numDigits - 1)) {
664 s32 baseX = startX + 8;
665 s32 baseY = startY + 8;
672 for (i = 0; i < numDigits; i++) {
673 s32 num = currentValue % 10;
674 digits[numDigits - i - 1] = num;
681 for (i = 0; i < numDigits; i++, drawX += 8) {
683 if (digit != 0 || keepDrawing || i == numDigits - 1) {
692 for (i = 0; i < numDigits; i++) {
693 digits[numDigits - i - 1] = maxValue % 10;
700 for (i = 0; i < numDigits; i++, drawX += 8) {
702 if (digit != 0 || keepDrawing || i == numDigits - 1) {
754 statusBar->
hidden = FALSE;
755 statusBar->
unk_3B = FALSE;
765 statusBar->
hidden = FALSE;
766 statusBar->
unk_3B = FALSE;
776 statusBar->
hidden = FALSE;
777 statusBar->
unk_3B = FALSE;
842 statusBar->
hidden = FALSE;
843 statusBar->
unk_3B = FALSE;
846 switch (statusBar->
hidden) {
862 statusBar->
unk_3C = FALSE;
884 statusBar->
hidden = FALSE;
896 draw_box(0,
WINDOW_STYLE_5, x, y, 0, 174, 35, 255, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL,
SCREEN_WIDTH,
SCREEN_HEIGHT, NULL);
897 draw_box(0,
WINDOW_STYLE_6, x + 174, y, 0, 122, 25, 255, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL,
SCREEN_WIDTH,
SCREEN_HEIGHT, NULL);
973 if (playerData->
level >= 27) {
1064 limit += spBars * 8;
1065 if (statusBar->
unk_57 == 1) {
1069 limit += spBars * 8;
1075 if (statusBar->
unk_57 != 0) {
1076 if (statusBar->
unk_58 != 0) {
1081 if ((statusBar->
unk_58 / 5) & 1) {
1084 maxStarPower = statusBar->
unk_59;
1085 s7 = statusBar->
unk_59 % 8;
1086 s7 += statusBar->
unk_59 / 8 * 8;
1100 i++; s1++;
if (i >= limit) {
break; }
1101 i++; s1++;
if (i >= limit) {
break; }
1102 i++; s1++;
if (i >= limit) {
break; }
1103 i++; s1++;
if (i >= limit) {
break; }
1104 i++; s1++;
if (i >= limit) {
break; }
1105 i++; s1++;
if (i >= limit) {
break; }
1106 i++; s1++;
if (i >= limit) {
break; }
1119 if (i >= limit || i >= s7 && !sp54) {
1129 if (i >= limit || i >= s7 && !sp54) {
1138 if (i >= limit || i >= s7 && !sp54) {
1146 if (i >= limit || i >= s7 && !sp54) {
1154 if (i >= limit || i >= s7 && !sp54) {
1163 if (i >= limit || i >= s7 && !sp54) {
1172 if (i >= limit || i >= s7 && !sp54) {
1181 if (i >= limit || i >= s7 && !sp54) {
1191 if (i >= limit || i >= s7 && !sp54) {
1197 limit = maxStarPower * 8;
1312 if (statusBar->
unk_6D != 0) {
1340 if (statusBar->
unk_6E > -1) {
1376 if (statusBar->
unk_6E < 0) {
1416 dx_debug_menu_main();
1425 statusBar->
hidden = FALSE;
1426 statusBar->
unk_3B = TRUE;
1435 statusBar->
hidden = FALSE;
1436 statusBar->
unk_3B = TRUE;
1443 if (statusBar->
hidden != TRUE) {
1444 statusBar->
hidden = TRUE;
1446 statusBar->
unk_3B = TRUE;
1456 statusBar->
hidden = TRUE;
1457 statusBar->
unk_3B = FALSE;
1458 statusBar->
unk_3C = FALSE;
1467 statusBar->
hidden = FALSE;
1468 statusBar->
unk_3B = TRUE;
1469 statusBar->
unk_3C = FALSE;
1680 statusBar->
unk_3B = FALSE;
1704 statusBar->
unk_3C = FALSE;
1727 s32 attackFXArray[6];
1737 for (i = 0; i <
ARRAY_COUNT(attackFXArray); i++) {
1738 attackFXArray[i] = 0;
1747 if (badgeItemID == ITEM_NONE)
1754 if (badgeMoveID == MOVE_DODGE_MASTER) {
1759 if (badgeMoveID == MOVE_SPIKE_SHIELD) {
1764 if (badgeMoveID == MOVE_FIRST_ATTACK) {
1769 if (badgeMoveID == MOVE_HP_PLUS) {
1774 if (badgeMoveID == MOVE_DOUBLE_DIP) {
1779 if (badgeMoveID == MOVE_MYSTERY_SCROLL) {
1787 if (badgeMoveID == MOVE_FIRE_SHIELD) {
1792 if (badgeMoveID == MOVE_PRETTY_LUCKY) {
1797 if (badgeMoveID == MOVE_HP_DRAIN) {
1802 if (badgeMoveID == MOVE_ALLOR_NOTHING) {
1807 if (badgeMoveID == MOVE_SLOW_GO) {
1812 if (badgeMoveID == MOVE_FP_PLUS) {
1817 if (badgeMoveID == MOVE_ICE_POWER) {
1822 if (badgeMoveID == MOVE_FEELING_FINE) {
1827 if (badgeMoveID == MOVE_ATTACK_FX_A) {
1828 attackFXArray[attackFXIndex++] = 1;
1831 if (badgeMoveID == MOVE_ATTACK_FX_D) {
1832 attackFXArray[attackFXIndex++] = 2;
1835 if (badgeMoveID == MOVE_ATTACK_FX_B) {
1836 attackFXArray[attackFXIndex++] = 3;
1839 if (badgeMoveID == MOVE_ATTACK_FX_E) {
1840 attackFXArray[attackFXIndex++] = 4;
1843 if (badgeMoveID == MOVE_ATTACK_FX_C) {
1844 attackFXArray[attackFXIndex++] = 5;
1847 if (badgeMoveID == MOVE_ATTACK_FX_F) {
1848 attackFXArray[attackFXIndex++] = 6;
1853 if (badgeMoveID == MOVE_MONEY_MONEY) {
1858 if (badgeMoveID == MOVE_CHILL_OUT_BADGE) {
1863 if (badgeMoveID == MOVE_HAPPY_HEART) {
1868 if (badgeMoveID == MOVE_ZAP_TAP) {
1873 if (badgeMoveID == MOVE_MEGA_RUSH) {
1878 if (badgeMoveID == MOVE_BERSERKER) {
1883 if (badgeMoveID == MOVE_RIGHT_ON) {
1888 if (badgeMoveID == MOVE_RUNAWAY_PAY) {
1893 if (badgeMoveID == MOVE_FLOWER_SAVER) {
1898 if (badgeMoveID == MOVE_PAY_OFF) {
1903 if (badgeMoveID == MOVE_DEFEND_PLUS) {
1908 if (badgeMoveID == MOVE_POWER_PLUS) {
1913 if (badgeMoveID == MOVE_REFUND) {
1918 if (badgeMoveID == MOVE_POWER_RUSH) {
1923 if (badgeMoveID == MOVE_CRAZY_HEART) {
1928 if (badgeMoveID == MOVE_LAST_STAND) {
1933 if (badgeMoveID == MOVE_CLOSE_CALL) {
1938 if (badgeMoveID == MOVE_P_UP_D_DOWN) {
1943 if (badgeMoveID == MOVE_LUCKY_DAY) {
1948 if (badgeMoveID == MOVE_MEGA_HP_DRAIN) {
1953 if (badgeMoveID == MOVE_P_DOWN_D_UP) {
1958 if (badgeMoveID == MOVE_FLOWER_FANATIC) {
1963 if (badgeMoveID == MOVE_SPEEDY_SPIN) {
1968 if (badgeMoveID == MOVE_SPIN_ATTACK) {
1973 if (badgeMoveID == MOVE_I_SPY) {
1978 if (badgeMoveID == MOVE_BUMP_ATTACK) {
1983 if (badgeMoveID == MOVE_QUICK_CHANGE) {
1988 if (badgeMoveID == MOVE_HEART_FINDER) {
1993 if (badgeMoveID == MOVE_FLOWER_FINDER) {
1998 if (badgeMoveID == MOVE_DIZZY_ATTACK) {
2003 if (badgeMoveID == MOVE_UNUSED_FINAL_GOOMPA) {
2008 if (badgeMoveID == MOVE_UNUSED_FINAL_BOBOMB) {
2013 if (badgeMoveID == MOVE_DEEP_FOCUS) {
2018 if (badgeMoveID == MOVE_SUPER_FOCUS) {
2023 if (badgeMoveID == MOVE_KAIDEN) {
2028 if (badgeMoveID == MOVE_DAMAGE_DODGE) {
2033 if (badgeMoveID == MOVE_HAPPY_FLOWER) {
2038 if (badgeMoveID == MOVE_GROUP_FOCUS) {
2043 if (badgeMoveID == MOVE_PEEKABOO) {
2048 if (badgeMoveID == MOVE_HEALTHY_HEALTHY) {
2056 ret = attackFXArray[
rand_int(attackFXIndex - 1)];
2067 s16 newCoins = playerData->
coins + amt;
2069 playerData->
coins = newCoins;
2070 if (newCoins > 999) {
2071 playerData->
coins = 999;
2073 if (playerData->
coins < 0) {
2074 playerData->
coins = 0;
2083 return playerData->
coins;
2162 }
else if (amt == -1) {
2179 }
else if (amt == -1) {
2194 s32 newHP = playerData->
curHP;
2199 if (amt < 0 || newHP < 1) {
2202 playerData->
curHP = newHP;
s8 starpointsBlinkCounter
u16 actionCommandSuccesses
s32 partnerUnlockedTime[12]
u16 actionCommandAttempts
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
@ DRAW_NUMBER_STYLE_MONOSPACE
@ PS_FLAG_NO_STATIC_COLLISION
@ DRAW_NUMBER_CHARSET_THIN
@ ABILITY_HEALTHY_HEALTHY
s32 evt_get_variable(Evt *script, Bytecode var)
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 func_800F0CB0(s32, f32, f32, f32)
void set_window_update(s32 panelID, s32)
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)
void set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void *drawContents, void *drawContentsArg, s8 parent)
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_draw_next(s32 id)
void hud_element_set_tint(s32 id, s32 r, s32 g, s32 b)
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)
void hud_element_free(s32 id)
void copy_world_hud_element_ref_to_battle(s32 worldID, s32 battleID)
@ HUD_ELEMENT_FLAG_DISABLED
@ HUD_ELEMENT_FLAG_FILTER_TEX
b32 can_control_status_bar(void)
void setup_status_bar_for_world(void)
void show_coin_counter(void)
s32 find_item(s32 itemID)
Search player inventory for itemID and return first matching array index.
#define FULLY_RETRACTED_Y
void status_bar_start_blinking_hp(void)
s32 recover_hp(s32 amt)
Recover player HP.
HudScript * TimesHudScript
HudScript HES_StatusHP_de
s32 add_star_pieces(s32 amt)
HudScript * SlashHudScript
HudScript HES_StatusFP_de
HudScript * DigitHudScripts[10]
void status_bar_ignore_changes(void)
void reset_status_bar(void)
s32 store_item(s32 itemID)
Add itemID to player storage and return slot in which it was placed.
void setup_status_bar_for_battle(void)
void enable_status_bar_input(void)
void status_bar_start_blinking_fp(void)
HudScript HES_StatusStar1
s32 recover_fp(s32 amt)
Recover player FP.
s32 is_partner_ability_active(s32 ability)
void sort_consumables(void)
Bubbles up player inventory items such that all ITEM_NONE values are at the bottom.
void decrement_status_bar_disabled(void)
void update_coin_counter(void)
void hide_coin_counter(void)
void sync_status_bar(void)
void status_bar_stop_blinking_hp(void)
void open_status_bar_quickly(void)
s32 get_consumables_empty(void)
HudScript * SPStarHudScripts[]
HudScript HES_StatusStarEmpty
s32 count_item(s32 itemID)
Search player inventory for itemID and count the number matches.
HudScript * SPIncrementHudScripts[]
HudScript HES_StatusSPShine
void close_status_bar(void)
HudScript HES_StatusStarPoint
HudScript HES_StatusHP_es
void status_bar_stop_blinking_sp(void)
void update_status_bar(void)
void increment_max_star_power(void)
b32 is_badge_equipped(s32 itemID)
void status_bar_show_and_ignore_changes(void)
void status_bar_stop_blinking_starpoints(void)
s32 StatusBarSPIncrementOffsets[]
s32 add_star_points(s32 amt)
HudScript HES_StatusCoinSparkle
void disable_status_bar_input(void)
s32 remove_item(s32 itemID)
Remove first instance of itemID found in player inventory.
void status_bar_start_blinking_starpoints(void)
void status_bar_stop_blinking_fp(void)
void status_bar_draw_number(s32 iconID, s32 startX, s32 startY, s32 value, s32 numDigits)
void status_bar_stop_blinking_coins(void)
HudScript HES_StatusFP_fr
s32 get_stored_empty(void)
s32 get_stored_count(void)
HudScript HES_StatusTimes
void status_bar_start_blinking_sp(void)
void set_max_star_power(s8 newMax)
void subtract_hp(s32 amt)
void status_bar_always_show_off(void)
s32 get_consumables_count(void)
void clear_player_data(void)
void hide_coin_counter_immediately(void)
s32 status_bar_is_ignoring_changes(void)
HudScript HES_StatusHP_fr
void status_bar_draw_stat(s32 id, s32 startX, s32 startY, s32 currentValue, s32 maxValue)
HudScript HES_StatusFP_es
void enforce_hpfp_limits(void)
s32 is_status_bar_visible(void)
void open_status_bar_slowly(void)
void initialize_status_bar(void)
void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY)
b32 has_item(s32 itemID)
Check whether player has itemID in their inventory.
HudScript HES_StatusHeart
HudScript HES_StatusSPEmptyIncrement
HudScript HES_StatusFlower
void status_bar_start_blinking_coins(void)
s32 is_ability_active(s32 ability)
void status_bar_respond_to_changes(void)
void status_bar_always_show_on(void)
void increment_status_bar_disabled(void)
void draw_status_ui(void)
void status_bar_start_blinking_sp_bars(s32 numBarsToBlink)
void add_star_power(s32 amt)
s32 add_item(s32 itemID)
Add itemID to player inventory and return inventory slot in which it was placed.
void sfx_play_sound(s32 soundID)
ApiStatus ShowCoinCounter(Evt *script, b32 isInitialCall)
GameStatus * gGameStatusPtr
PlayerStatus gPlayerStatus