Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
inventory.c File Reference

Go to the source code of this file.

Macros

#define FULLY_EXTENDED_Y   18
 
#define FULLY_RETRACTED_Y   -100
 

Enumerations

enum  BlinkModes { BLINK_OFF = 0 , BLINK_ON = 1 }
 

Functions

void status_bar_start_blinking_coins (void)
 
void status_bar_stop_blinking_coins (void)
 
void clear_player_data (void)
 
s32 add_item (s32 itemID)
 Add itemID to player inventory and return inventory slot in which it was placed.
 
s32 remove_item (s32 itemID)
 Remove first instance of itemID found in player inventory.
 
s32 find_item (s32 itemID)
 Search player inventory for itemID and return first matching array index.
 
s32 count_item (s32 itemID)
 Search player inventory for itemID and count the number matches.
 
b32 has_item (s32 itemID)
 Check whether player has itemID in their inventory.
 
s32 store_item (s32 itemID)
 Add itemID to player storage and return slot in which it was placed.
 
b32 is_badge_equipped (s32 itemID)
 
void sort_consumables (void)
 Bubbles up player inventory items such that all ITEM_NONE values are at the bottom.
 
s32 get_consumables_count (void)
 
s32 get_consumables_empty (void)
 
s32 get_stored_count (void)
 
s32 get_stored_empty (void)
 
void enforce_hpfp_limits (void)
 
void initialize_status_bar (void)
 
void status_bar_draw_number (s32 iconID, s32 startX, s32 startY, s32 value, s32 numDigits)
 
void status_bar_draw_stat (s32 id, s32 startX, s32 startY, s32 currentValue, s32 maxValue)
 
void update_status_bar (void)
 
void coin_counter_draw_content (UNK_TYPE arg0, s32 posX, s32 posY)
 
void update_coin_counter (void)
 
void show_coin_counter (void)
 
void hide_coin_counter (void)
 
void hide_coin_counter_immediately (void)
 
void draw_status_ui (void)
 
void open_status_bar_slowly (void)
 
void open_status_bar_quickly (void)
 
void close_status_bar (void)
 
void setup_status_bar_for_world (void)
 
void setup_status_bar_for_battle (void)
 
void enable_status_bar_input (void)
 
void disable_status_bar_input (void)
 
b32 can_control_status_bar (void)
 
void status_bar_ignore_changes (void)
 
void status_bar_show_and_ignore_changes (void)
 
void status_bar_respond_to_changes (void)
 
s32 status_bar_is_ignoring_changes (void)
 
void status_bar_always_show_on (void)
 
void status_bar_always_show_off (void)
 
s32 is_status_bar_visible (void)
 
void status_bar_start_blinking_hp (void)
 
void status_bar_stop_blinking_hp (void)
 
void status_bar_start_blinking_fp (void)
 
void status_bar_stop_blinking_fp (void)
 
void status_bar_start_blinking_sp (void)
 
void status_bar_stop_blinking_sp (void)
 
void status_bar_start_blinking_sp_bars (s32 numBarsToBlink)
 
void status_bar_start_blinking_starpoints (void)
 
void status_bar_stop_blinking_starpoints (void)
 
void decrement_status_bar_disabled (void)
 
void increment_status_bar_disabled (void)
 
void sync_status_bar (void)
 
void reset_status_bar (void)
 
s32 is_ability_active (s32 ability)
 
s32 is_partner_ability_active (s32 ability)
 
s32 add_coins (s32 amt)
 
s32 add_star_points (s32 amt)
 
s32 add_star_pieces (s32 amt)
 
void increment_max_star_power (void)
 
void set_max_star_power (s8 newMax)
 
void add_star_power (s32 amt)
 
s32 recover_fp (s32 amt)
 Recover player FP.
 
s32 recover_hp (s32 amt)
 Recover player HP.
 
void subtract_hp (s32 amt)
 
s8 has_full_hp (void)
 
s8 has_full_fp (void)
 

Variables

BSS b16 D_8010CD10
 
BSS b16 D_8010CD12
 
StatusBar gStatusBar
 
HudScriptTimesHudScript
 
HudScriptSPIncrementHudScripts []
 
HudScriptSPStarHudScripts []
 
s32 StatusBarSPIncrementOffsets []
 
HudScriptDigitHudScripts [10]
 
HudScript HES_StatusCoinSparkle
 
HudScript HES_StatusHP
 
HudScript HES_StatusHP_de
 
HudScript HES_StatusHP_fr
 
HudScript HES_StatusHP_es
 
HudScript HES_StatusHeart
 
HudScript HES_StatusFP
 
HudScript HES_StatusFP_de
 
HudScript HES_StatusFP_fr
 
HudScript HES_StatusFP_es
 
HudScript HES_StatusFlower
 
HudScript HES_StatusStarPoint
 
HudScript HES_StatusStar1
 
HudScript HES_StatusTimes
 
HudScript HES_StatusSPShine
 
HudScript HES_StatusSPEmptyIncrement
 
HudScript HES_StatusStarEmpty
 
HudScriptSlashHudScript
 

Macro Definition Documentation

◆ FULLY_EXTENDED_Y

#define FULLY_EXTENDED_Y   18

Definition at line 6 of file inventory.c.

Referenced by status_bar_show_and_ignore_changes(), and update_status_bar().

◆ FULLY_RETRACTED_Y

#define FULLY_RETRACTED_Y   -100

Enumeration Type Documentation

◆ BlinkModes

enum BlinkModes
Enumerator
BLINK_OFF 
BLINK_ON 

Definition at line 9 of file inventory.c.

9 {
10 BLINK_OFF = 0,
11 BLINK_ON = 1,
12};
@ BLINK_ON
Definition inventory.c:11
@ BLINK_OFF
Definition inventory.c:10

Function Documentation

◆ status_bar_start_blinking_coins()

void status_bar_start_blinking_coins ( void )

Definition at line 1575 of file inventory.c.

1575 {
1576 StatusBar* statusBar = &gStatusBar;
1577
1579 statusBar->coinsBlinkTimer = 120;
1580 }
1581
1582 if (statusBar->coinsBlinking != BLINK_ON) {
1583 statusBar->coinsBlinking = BLINK_ON;
1584 statusBar->coinsBlinkCounter = 0;
1585 }
1586}
@ CONTEXT_WORLD
Definition enums.h:3529
StatusBar gStatusBar
Definition inventory.c:17
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by update_status_bar().

◆ status_bar_stop_blinking_coins()

void status_bar_stop_blinking_coins ( void )

Definition at line 1588 of file inventory.c.

1588 {
1589 StatusBar* statusBar = &gStatusBar;
1590
1591 if (statusBar->coinsBlinking != BLINK_OFF) {
1592 statusBar->coinsBlinking = BLINK_OFF;
1593 statusBar->coinsBlinkCounter = 0;
1594 statusBar->coinsBlinkTimer = 0;
1595 }
1596}

Referenced by update_status_bar().

◆ clear_player_data()

void clear_player_data ( void )

Definition at line 49 of file inventory.c.

49 {
50 PlayerData* playerData = &gPlayerData;
51 s32 i;
52
53 D_8010CD10 = FALSE;
54 D_8010CD12 = FALSE;
55
56 playerData->curHP = 10;
57 playerData->curMaxHP = 10;
58 playerData->hardMaxHP = 10;
59 playerData->curFP = 5;
60 playerData->curMaxFP = 5;
61 playerData->hardMaxFP = 5;
62 playerData->maxBP = 3;
63 playerData->level = 1;
64 playerData->bootsLevel = 0;
65 playerData->hammerLevel = -1;
66 playerData->hasActionCommands = FALSE;
67 playerData->coins = 0;
68 playerData->starPieces = 0;
69 playerData->starPoints = 0;
70 playerData->unused_011 = 0;
71 playerData->unused_288 = 0;
72
74 playerData->merleeCastsLeft = 0;
75 playerData->merleeTurnCount = -1;
76
77 playerData->maxStarPower = 0;
78 playerData->starPower = 0;
79 playerData->starBeamLevel = 0;
80
81 playerData->curPartner = PARTNER_NONE;
82
83 for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) {
84 playerData->partners[i].enabled = FALSE;
85 playerData->partners[i].level = PARTNER_RANK_NORMAL;
86 playerData->partners[i].unk_02[0] = 0;
87 playerData->partners[i].unk_02[1] = 0;
88 playerData->partners[i].unk_02[2] = 0;
89 }
90
91 for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
92 playerData->keyItems[i] = ITEM_NONE;
93 }
94
95 for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) {
96 playerData->badges[i] = ITEM_NONE;
97 }
98
99 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
100 playerData->invItems[i] = ITEM_NONE;
101 }
102
103 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
104 playerData->equippedBadges[i] = ITEM_NONE;
105 }
106
107 for (i = 0; i < ARRAY_COUNT(playerData->storedItems); i++) {
108 playerData->storedItems[i] = ITEM_NONE;
109 }
110
111 playerData->actionCommandAttempts = 0;
112 playerData->actionCommandSuccesses = 0;
113 playerData->hitsTaken = 0;
114 playerData->hitsBlocked = 0;
115 playerData->playerFirstStrikes = 0;
116 playerData->enemyFirstStrikes = 0;
117 playerData->powerBounces = 0;
118 playerData->battlesCount = 0;
119 playerData->battlesWon = 0;
120 playerData->fleeAttempts = 0;
121 playerData->battlesFled = 0;
122 playerData->trainingsDone = 0;
123 playerData->walkingStepsTaken = 0;
124 playerData->runningStepsTaken = 0;
125 playerData->idleFrameCounter = 0;
126 playerData->totalCoinsEarned = 0;
127 playerData->frameCounter = 0;
128 playerData->quizzesAnswered = 0;
129 playerData->quizzesCorrect = 0;
130
131 for (i = 0; i < ARRAY_COUNT(playerData->partnerUnlockedTime); i++) {
132 playerData->partnerUnlockedTime[i] = 0;
133 playerData->partnerUsedTime[i] = 0;
134 }
135
136 playerData->droTreeHintTime = 0;
137 playerData->starPiecesCollected = 0;
138 playerData->jumpGamePlays = 0;
139 playerData->jumpGameTotal = 0;
140 playerData->jumpGameRecord = 0;
141 playerData->smashGamePlays = 0;
142 playerData->smashGameTotal = 0;
143 playerData->smashGameRecord = 0;
144}
s16 equippedBadges[64]
s16 badges[128]
s16 storedItems[32]
PartnerData partners[12]
s32 partnerUsedTime[12]
u16 actionCommandSuccesses
u16 starPiecesCollected
s32 partnerUnlockedTime[12]
u16 actionCommandAttempts
s16 keyItems[32]
s16 invItems[10]
@ MERLEE_SPELL_NONE
Definition enums.h:1910
@ PARTNER_RANK_NORMAL
Definition enums.h:2018
@ PARTNER_NONE
Definition enums.h:2885
BSS b16 D_8010CD10
Definition inventory.c:14
BSS b16 D_8010CD12
Definition inventory.c:15
#define ARRAY_COUNT(arr)
Definition macros.h:40
PlayerData gPlayerData
Definition 77480.c:40

Referenced by filemenu_yesno_handle_input(), load_demo_battle(), load_engine_data(), state_init_title_screen(), state_step_demo(), state_step_intro(), and state_step_startup().

◆ add_item()

s32 add_item ( s32 itemID)

Add itemID to player inventory and return inventory slot in which it was placed.

Returns
the index of the new item in the player's inventory, or -1 if there was no room

Definition at line 146 of file inventory.c.

146 {
147 s32 idx;
148
149 // handle key items
150 if (item_is_key(itemID)) {
151 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.keyItems); idx++) {
152 if (gPlayerData.keyItems[idx] == ITEM_NONE) {
153 break;
154 }
155 }
156
157 if (idx >= ARRAY_COUNT(gPlayerData.keyItems)) {
158 return -1;
159 }
160
161 gPlayerData.keyItems[idx] = itemID;
162 return idx;
163 }
164
165 // handle badges
166 if (item_is_badge(itemID)) {
167 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.badges); idx++) {
168 if (gPlayerData.badges[idx] == ITEM_NONE) {
169 break;
170 }
171 }
172
173 if (idx >= ARRAY_COUNT(gPlayerData.badges)) {
174 return -1;
175 }
176
177 gPlayerData.badges[idx] = itemID;
178 return idx;
179 }
180
181 // handle consumables
183
184 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.invItems); idx++) {
185 if (gPlayerData.invItems[idx] == ITEM_NONE) {
186 break;
187 }
188 }
189
190 if (idx == ARRAY_COUNT(gPlayerData.invItems)) {
191 return -1;
192 }
193
194 gPlayerData.invItems[idx] = itemID;
195 return idx;
196}
void sort_consumables(void)
Bubbles up player inventory items such that all ITEM_NONE values are at the bottom.
Definition inventory.c:404

Referenced by update_item_entity_pickup().

◆ remove_item()

s32 remove_item ( s32 itemID)

Remove first instance of itemID found in player inventory.

Returns
the index of the removed item in the player's inventory, or -1 none was found

Definition at line 198 of file inventory.c.

198 {
199 s32 idx;
200
201 // handle key items
202 if (item_is_key(itemID)) {
203 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.keyItems); idx++) {
204 if (gPlayerData.keyItems[idx] == itemID) {
205 break;
206 }
207 }
208
209 if (idx >= ARRAY_COUNT(gPlayerData.keyItems)) {
210 return -1;
211 }
212
213 gPlayerData.keyItems[idx] = ITEM_NONE;
214 return idx;
215 }
216
217 // handle badges
218 if (item_is_badge(itemID)) {
219 // unequip
220 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.equippedBadges); idx++) {
221 if (gPlayerData.equippedBadges[idx] == itemID) {
222 gPlayerData.equippedBadges[idx] = ITEM_NONE;
223 }
224 }
225
226 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.badges); idx++) {
227 if (gPlayerData.badges[idx] == itemID) {
228 break;
229 }
230 }
231
232 if (idx >= ARRAY_COUNT(gPlayerData.badges)) {
233 return -1;
234 }
235
236 gPlayerData.badges[idx] = ITEM_NONE;
237 return idx;
238 }
239
240 // handle consumables
241 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.invItems); idx++) {
242 if (gPlayerData.invItems[idx] == itemID) {
243 break;
244 }
245 }
246
247 if (idx == ARRAY_COUNT(gPlayerData.invItems)) {
248 return -1;
249 }
250
251 gPlayerData.invItems[idx] = ITEM_NONE;
253 return idx;
254}

◆ find_item()

s32 find_item ( s32 itemID)

Search player inventory for itemID and return first matching array index.

Returns
the index of the given item in the player's inventory, or -1 if not found

Definition at line 258 of file inventory.c.

258 {
259 s32 idx;
260
261 // handle key items
262 if (item_is_key(itemID)) {
263 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.keyItems); idx++) {
264 if (gPlayerData.keyItems[idx] == itemID) {
265 break;
266 }
267 }
268
269 if (idx >= ARRAY_COUNT(gPlayerData.keyItems)) {
270 return -1;
271 }
272 return idx;
273 }
274
275 // handle badges
276 if (item_is_badge(itemID)) {
277 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.badges); idx++) {
278 if (gPlayerData.badges[idx] == itemID) {
279 break;
280 }
281 }
282
283 if (idx >= ARRAY_COUNT(gPlayerData.badges)) {
284 return -1;
285 }
286 return idx;
287 }
288
289 // handle consumables
290 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.invItems); idx++) {
291 if (gPlayerData.invItems[idx] == itemID) {
292 break;
293 }
294 }
295
296 if (idx == ARRAY_COUNT(gPlayerData.invItems)) {
297 return -1;
298 }
299 return idx;
300}

Referenced by btl_state_update_defeat().

◆ count_item()

s32 count_item ( s32 itemID)

Search player inventory for itemID and count the number matches.

Returns
the number of items matching itemID

Definition at line 304 of file inventory.c.

304 {
305 s32 idx;
306 s32 sum = 0;
307
308 // handle key items
309 if (item_is_key(itemID)) {
310 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.keyItems); idx++) {
311 if (gPlayerData.keyItems[idx] == itemID) {
312 sum++;
313 }
314 }
315 return sum;
316 }
317
318 // handle badges
319 if (item_is_badge(itemID)) {
320 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.badges); idx++) {
321 if (gPlayerData.badges[idx] == itemID) {
322 sum++;
323 }
324 }
325 return sum;
326 }
327
328 // handle consumables
329 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.invItems); idx++) {
330 if (gPlayerData.invItems[idx] == itemID) {
331 sum++;
332 }
333 }
334 return sum;
335}

◆ has_item()

b32 has_item ( s32 itemID)

Check whether player has itemID in their inventory.

Returns
boolean 'does player have item?'

Definition at line 337 of file inventory.c.

337 {
338 s32 idx;
339
340 // handle key items
341 if (item_is_key(itemID)) {
342 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.keyItems); idx++) {
343 if (gPlayerData.keyItems[idx] == itemID) {
344 return TRUE;
345 }
346 }
347 return FALSE;
348 }
349
350 // handle badges
351 if (item_is_badge(itemID)) {
352 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.badges); idx++) {
353 if (gPlayerData.badges[idx] == itemID) {
354 return TRUE;
355 }
356 }
357 return FALSE;
358 }
359
360 // handle consumables
361 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.invItems); idx++) {
362 if (gPlayerData.invItems[idx] == itemID) {
363 return TRUE;
364 }
365 }
366 return FALSE;
367}

◆ store_item()

s32 store_item ( s32 itemID)

Add itemID to player storage and return slot in which it was placed.

Returns
the index of the new item in player storage, or -1 if there was no room

Definition at line 369 of file inventory.c.

369 {
370 s32 idx;
371
372 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.storedItems); idx++) {
373 if (gPlayerData.storedItems[idx] == ITEM_NONE) {
374 break;
375 }
376 }
377
378 if (idx == ARRAY_COUNT(gPlayerData.storedItems)) {
379 return -1;
380 } else {
381 gPlayerData.storedItems[idx] = itemID;
382 }
383
384 return idx;
385}

◆ is_badge_equipped()

b32 is_badge_equipped ( s32 itemID)
Returns
whether the player has itemID as an equipped badge

Definition at line 387 of file inventory.c.

387 {
388 s32 idx;
389
390 if (!item_is_badge(itemID)) {
391 return FALSE;
392 }
393
394 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.equippedBadges); idx++) {
395 if (gPlayerData.equippedBadges[idx] == itemID) {
396 return TRUE;
397 }
398 }
399
400 return FALSE;
401}

◆ sort_consumables()

void sort_consumables ( void )

Bubbles up player inventory items such that all ITEM_NONE values are at the bottom.

Definition at line 404 of file inventory.c.

404 {
405 s32 i, j;
406
407 for (i = ARRAY_COUNT(gPlayerData.invItems) - 2; i >= 0; i--) {
408 // leave ITEM_NONE at the end of the list alone
409 if (gPlayerData.invItems[i] == ITEM_NONE) {
410 continue;
411 }
412 // swap any other ITEM_NONE to the end of the list
413 for (j = ARRAY_COUNT(gPlayerData.invItems) - 1; i < j; j--) {
414 if (gPlayerData.invItems[j] == ITEM_NONE) {
416 gPlayerData.invItems[i] = ITEM_NONE;
417 break;
418 }
419 }
420 }
421}

Referenced by add_item(), remove_consumable(), remove_item(), and update_item_entity_pickup().

◆ get_consumables_count()

s32 get_consumables_count ( void )
Returns
the number of consumables in player inventory

Definition at line 423 of file inventory.c.

423 {
424 s32 idx;
425 s32 sum = 0;
426
427 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.invItems); idx++) {
428 if (gPlayerData.invItems[idx] != ITEM_NONE) {
429 sum++;
430 }
431 }
432
433 return sum;
434}

Referenced by get_consumables_empty().

◆ get_consumables_empty()

s32 get_consumables_empty ( void )
Returns
the available room for consumables in player inventory

Definition at line 436 of file inventory.c.

436 {
438}
s32 get_consumables_count(void)
Definition inventory.c:423

◆ get_stored_count()

s32 get_stored_count ( void )
Returns
the number of consumables in player storage

Definition at line 440 of file inventory.c.

440 {
441 s32 idx;
442 s32 sum = 0;
443
444 for (idx = 0; idx < ARRAY_COUNT(gPlayerData.storedItems); idx++) {
445 if (gPlayerData.storedItems[idx] != ITEM_NONE) {
446 sum++;
447 }
448 }
449
450 return sum;
451}

Referenced by get_stored_empty().

◆ get_stored_empty()

s32 get_stored_empty ( void )
Returns
the available room in player storage

Definition at line 453 of file inventory.c.

453 {
455}
s32 get_stored_count(void)
Definition inventory.c:440

◆ enforce_hpfp_limits()

void enforce_hpfp_limits ( void )

Definition at line 457 of file inventory.c.

457 {
458 PlayerData* playerData = &gPlayerData;
459
460 playerData->curMaxHP = playerData->hardMaxHP + (is_ability_active(ABILITY_HP_PLUS) * 5);
461 if (playerData->curMaxHP > 75) {
462 playerData->curMaxHP = 75;
463 }
464 if (playerData->curHP > playerData->curMaxHP) {
465 playerData->curHP = playerData->curMaxHP;
466 }
467
468 playerData->curMaxFP = playerData->hardMaxFP + (is_ability_active(ABILITY_FP_PLUS) * 5);
469 if (playerData->curMaxFP > 75) {
470 playerData->curMaxFP = 75;
471 }
472 if (playerData->curFP > playerData->curMaxFP) {
473 playerData->curFP = playerData->curMaxFP;
474 }
475}
@ ABILITY_FP_PLUS
Definition enums.h:448
@ ABILITY_HP_PLUS
Definition enums.h:440
s32 is_ability_active(s32 ability)
Definition inventory.c:1725

Referenced by pause_badges_handle_input(), and pause_handle_input().

◆ initialize_status_bar()

void initialize_status_bar ( void )

Definition at line 477 of file inventory.c.

477 {
478 StatusBar* statusBar = &gStatusBar;
479 PlayerData* playerData = &gPlayerData;
480 s32 iconIndex;
481
482 statusBar->drawPosX = 12;
483 D_8010CD10 = FALSE;
484 D_8010CD12 = FALSE;
485 statusBar->drawPosY = FULLY_RETRACTED_Y;
486 statusBar->hidden = FALSE;
487 statusBar->showTimer = 210;
488 statusBar->unk_3B = FALSE;
489 statusBar->ignoreChanges = FALSE;
490 statusBar->openInputDisabled = FALSE;
491 statusBar->alwaysShown = FALSE;
492 statusBar->hpBlinking = BLINK_OFF;
493 statusBar->hpBlinkCounter = 0;
494 statusBar->hpBlinkTimer = 0;
495 statusBar->fpBlinking = BLINK_OFF;
496 statusBar->fpBlinkCounter = 0;
497 statusBar->fpBlinkTimer = 0;
498 statusBar->spBlinking = BLINK_OFF;
499 statusBar->spBlinkCounter = 0;
500 statusBar->coinsBlinking = BLINK_OFF;
501 statusBar->coinsBlinkCounter = 0;
502 statusBar->coinsBlinkTimer = 0;
503 statusBar->disabled = 0;
504 statusBar->starpointsBlinking = BLINK_OFF;
505 statusBar->displayHP = playerData->curHP;
506 statusBar->displayFP = playerData->curFP;
507 statusBar->displayCoins = playerData->coins;
508 statusBar->displayStarpoints = playerData->starPoints;
509 statusBar->displayStarPower = playerData->starPower;
510 statusBar->starpointsBlinkCounter = 0;
511 statusBar->unk_6E = -1;
512 statusBar->unk_3C = FALSE;
513 statusBar->unk_57 = 0;
514 statusBar->unk_58 = 0;
515 statusBar->unk_59 = 0;
516 statusBar->spBarsToBlink = 0;
517 statusBar->coinCounterHideTime = 0;
518 statusBar->unk_6D = 0;
519 statusBar->iconIndex12 = -1;
520
522
523#if VERSION_PAL
524 switch (gCurrentLanguage) {
525 case LANGUAGE_EN:
526 iconIndex = statusBar->hpIconHIDs[0] = hud_element_create(&HES_StatusHP);
527 break;
528 case LANGUAGE_DE:
529 iconIndex = statusBar->hpIconHIDs[0] = hud_element_create(&HES_StatusHP_de);
530 break;
531 case LANGUAGE_FR:
532 iconIndex = statusBar->hpIconHIDs[0] = hud_element_create(&HES_StatusHP_fr);
533 break;
534 case LANGUAGE_ES:
535 iconIndex = statusBar->hpIconHIDs[0] = hud_element_create(&HES_StatusHP_es);
536 break;
537 }
538
541#else
542 statusBar->hpIconHIDs[0] = iconIndex = hud_element_create(&HES_StatusHP);
545#endif
546
547 statusBar->hpIconHIDs[1] = iconIndex = hud_element_create(&HES_StatusHeart);
550
551#if VERSION_PAL
552 switch (gCurrentLanguage) {
553 case LANGUAGE_EN:
554 iconIndex = statusBar->fpIconHIDs[0] = hud_element_create(&HES_StatusFP);
555 break;
556 case LANGUAGE_DE:
557 iconIndex = statusBar->fpIconHIDs[0] = hud_element_create(&HES_StatusFP_de);
558 break;
559 case LANGUAGE_FR:
560 iconIndex = statusBar->fpIconHIDs[0] = hud_element_create(&HES_StatusFP_fr);
561 break;
562 case LANGUAGE_ES:
563 iconIndex = statusBar->fpIconHIDs[0] = hud_element_create(&HES_StatusFP_es);
564 break;
565 }
566
569#else
570 statusBar->fpIconHIDs[0] = iconIndex = hud_element_create(&HES_StatusFP);
573#endif
574
575 statusBar->fpIconHIDs[1] = iconIndex = hud_element_create(&HES_StatusFlower);
578
579 statusBar->coinIconHID = iconIndex = hud_element_create(&HES_StatusCoin);
582
586
587 statusBar->spIconHID = iconIndex = hud_element_create(&HES_StatusStarPoint);
590
591 statusBar->spShineHID = iconIndex = hud_element_create(&HES_StatusSPShine);
594
595 statusBar->hpTimesHID = iconIndex = hud_element_create(&HES_StatusTimes);
598
599 statusBar->fpTimesHID = iconIndex = hud_element_create(&HES_StatusTimes);
602
603 statusBar->spTimesHID = iconIndex = hud_element_create(&HES_StatusTimes);
606
607 statusBar->coinTimesHID = iconIndex = hud_element_create(&HES_StatusTimes);
610
611 statusBar->starIconHID = iconIndex = hud_element_create(&HES_StatusStar1);
614
616}
s16 displayStarpoints
s8 starpointsBlinkCounter
s32 hpIconHIDs[2]
s32 fpIconHIDs[2]
@ LANGUAGE_DE
Definition enums.h:6401
@ LANGUAGE_ES
Definition enums.h:6403
@ LANGUAGE_EN
Definition enums.h:6400
@ LANGUAGE_FR
Definition enums.h:6402
void func_800F0D5C(void)
HudScript HES_StatusCoin
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.
@ HUD_ELEMENT_FLAG_DISABLED
Definition hud_element.h:74
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:88
#define FULLY_RETRACTED_Y
Definition inventory.c:7
HudScript HES_StatusHP_de
HudScript HES_StatusHP
HudScript HES_StatusFP_de
HudScript HES_StatusStar1
HudScript HES_StatusFP
HudScript HES_StatusSPShine
void close_status_bar(void)
Definition inventory.c:1440
HudScript HES_StatusStarPoint
HudScript HES_StatusHP_es
HudScript HES_StatusCoinSparkle
HudScript HES_StatusFP_fr
HudScript HES_StatusTimes
HudScript HES_StatusHP_fr
HudScript HES_StatusFP_es
HudScript HES_StatusHeart
HudScript HES_StatusFlower
#define gCurrentLanguage
Definition variables.h:115

Referenced by load_demo_battle(), and load_map_by_IDs().

◆ status_bar_draw_number()

void status_bar_draw_number ( s32 iconID,
s32 startX,
s32 startY,
s32 value,
s32 numDigits )

Definition at line 618 of file inventory.c.

618 {
619 s8 digits[4];
620 s32 drawX, drawY;
621 b32 keepDrawing;
622 s32 digit;
623 s32 i;
624
626 drawX = startX + 8;
627 drawY = startY + 8;
628 hud_element_set_render_pos(iconID, drawX, drawY - 1);
630 hud_element_draw_next(iconID);
631
632 // Write each digit of the input number into the digits array
633 for (i = 0; i < numDigits; i++) {
634 digit = value % 10;
635 digits[(numDigits - i) - 1] = digit;
636 value /= 10;
637 }
638
639 drawX += 13;
640 keepDrawing = FALSE;
641
642 for (i = 0; i < numDigits; i++, drawX += 8) {
643 digit = digits[i];
644
645 // Once we have encountered our first non-zero digit, we need to keep drawing the remaining digits
646 if (digit != 0 || keepDrawing || (i == numDigits - 1)) {
647 keepDrawing = TRUE;
649 hud_element_set_render_pos(iconID, drawX, drawY);
651 hud_element_draw_next(iconID);
652 }
653 }
654}
s32 b32
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_draw_next(s32 id)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
HudScript * TimesHudScript
Definition partners.c:146
HudScript * DigitHudScripts[10]
Definition partners.c:142

Referenced by update_status_bar().

◆ status_bar_draw_stat()

void status_bar_draw_stat ( s32 id,
s32 startX,
s32 startY,
s32 currentValue,
s32 maxValue )

Definition at line 656 of file inventory.c.

656 {
657 s8 digits[4];
658 b32 keepDrawing;
659 s32 digit;
660 s32 numDigits = 2;
661 s32 drawX;
662 s32 drawY;
663 s32 i = 0;
664 s32 baseX = startX + 8;
665 s32 baseY = startY + 8;
666
668 hud_element_set_render_pos(id, baseX + 14, baseY + 1);
671
672 for (i = 0; i < numDigits; i++) {
673 s32 num = currentValue % 10;
674 digits[numDigits - i - 1] = num;
675 currentValue /= 10;
676 }
677
678 drawX = baseX;
679 drawY = baseY;
680 keepDrawing = FALSE;
681 for (i = 0; i < numDigits; i++, drawX += 8) {
682 digit = digits[i];
683 if (digit != 0 || keepDrawing || i == numDigits - 1) {
684 keepDrawing = TRUE;
686 hud_element_set_render_pos(id, drawX, drawY);
689 }
690 }
691
692 for (i = 0; i < numDigits; i++) {
693 digits[numDigits - i - 1] = maxValue % 10;
694 maxValue /= 10;
695 }
696
697 drawX = baseX + 26;
698 drawY = baseY;
699 keepDrawing = FALSE;
700 for (i = 0; i < numDigits; i++, drawX += 8) {
701 digit = digits[i];
702 if (digit != 0 || keepDrawing || i == numDigits - 1) {
703 keepDrawing = TRUE;
705 hud_element_set_render_pos(id, drawX, drawY);
708 }
709 }
710}
HudScript * SlashHudScript
Definition partners.c:147

Referenced by update_status_bar().

◆ update_status_bar()

void update_status_bar ( void )

Definition at line 712 of file inventory.c.

712 {
713 StatusBar* statusBar = &gStatusBar;
714 PlayerData* playerData = &gPlayerData;
715 PlayerStatus* playerStatus = &gPlayerStatus;
716 s32 sp50;
717 s32 sp54;
718 s32 i;
719 s32 x;
720 s32 y;
721 s32 showStat;
722 s32 id;
723 s32 limit;
724 s32 s7;
725 s32 s1;
726 s32 spBars;
727 s32 maxStarPower;
728
733 ) {
734 return;
735 }
736
737 if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->coins != statusBar->displayCoins) {
739 }
740
741 // update coin counter (+1 coin per frame for each 5-coin delta)
742 i = playerData->coins - statusBar->displayCoins;
743 if (i < 0) {
744 i = (i - 4) / 5;
745 } else {
746 i = (i + 4) / 5;
747 }
748 statusBar->displayCoins += i;
749
750 // show the status bar if HP has changed
751 if (statusBar->displayHP != playerData->curHP && !statusBar->ignoreChanges) {
752 if (statusBar->hidden) {
753 statusBar->showTimer = 70;
754 statusBar->hidden = FALSE;
755 statusBar->unk_3B = FALSE;
756 } else {
757 statusBar->showTimer = 70;
758 }
759 }
760
761 // show the status bar if FP has changed
762 if (statusBar->displayFP != playerData->curFP && !statusBar->ignoreChanges) {
763 if (statusBar->hidden) {
764 statusBar->showTimer = 70;
765 statusBar->hidden = FALSE;
766 statusBar->unk_3B = FALSE;
767 } else {
768 statusBar->showTimer = 70;
769 }
770 }
771
772 // show the status bar if star power has changed
773 if (statusBar->displayStarPower != playerData->starPower && !statusBar->ignoreChanges) {
774 if (statusBar->hidden) {
775 statusBar->showTimer = 70;
776 statusBar->hidden = FALSE;
777 statusBar->unk_3B = FALSE;
778 } else {
779 statusBar->showTimer = 70;
780 }
781 }
782
783 // sync displayed HP toward true HP
784 if (statusBar->displayHP != playerData->curHP) {
785 if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->curHP < statusBar->displayHP) {
787 }
788 if (statusBar->displayHP < playerData->curHP) {
789 if (statusBar->drawPosY >= FULLY_EXTENDED_Y) {
790 if (gGameStatusPtr->frameCounter % 4 == 0) {
791 statusBar->displayHP++;
793 }
794 } else if (gGameStatusPtr->frameCounter % 4 == 0) {
795 statusBar->displayHP++;
796 }
797 } else if (gGameStatusPtr->frameCounter % 4 == 0) {
798 statusBar->displayHP--;
799 }
800 }
801
802 // sync displayed FP toward true FP
803 if (statusBar->displayFP != playerData->curFP) {
804 if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->curFP < statusBar->displayFP) {
806 }
807 if (statusBar->displayFP < playerData->curFP) {
808 if (statusBar->drawPosY >= FULLY_EXTENDED_Y) {
809 if (gGameStatusPtr->frameCounter % 4 == 0) {
810 statusBar->displayFP++;
812 }
813 } else if (gGameStatusPtr->frameCounter % 4 == 0) {
814 statusBar->displayFP++;
815 }
816 } else if (gGameStatusPtr->frameCounter % 4 == 0) {
817 statusBar->displayFP--;
818 }
819 }
820
821 // sync displayed star power toward true star power
822 if (statusBar->displayStarPower != playerData->starPower) {
823 if (statusBar->displayStarPower < playerData->starPower) {
824 statusBar->displayStarPower += 10;
825 if (statusBar->displayStarPower > playerData->starPower) {
826 statusBar->displayStarPower = playerData->starPower;
827 }
828 } else {
829 statusBar->displayStarPower -= 10;
830 if (statusBar->displayStarPower < playerData->starPower) {
831 statusBar->displayStarPower = playerData->starPower;
832 }
833 }
834 }
835
836 if (statusBar->disabled) {
837 return;
838 }
839
840 if (statusBar->alwaysShown && statusBar->hidden && playerStatus->inputDisabledCount == 0) {
841 statusBar->showTimer = 42;
842 statusBar->hidden = FALSE;
843 statusBar->unk_3B = FALSE;
844 }
845
846 switch (statusBar->hidden) {
847 case FALSE:
848 statusBar->drawPosY += 10;
849 if (statusBar->drawPosY >= FULLY_EXTENDED_Y) {
850 statusBar->drawPosY = FULLY_EXTENDED_Y;
851 if (statusBar->unk_3C && statusBar->unk_3B && playerStatus->actionState != ACTION_STATE_IDLE) {
852 statusBar->showTimer = 0;
853 }
854 if (statusBar->showTimer != 0) {
855 statusBar->showTimer--;
856 } else {
857 if (!statusBar->ignoreChanges) {
858 if (!statusBar->unk_3B || playerStatus->actionState != ACTION_STATE_IDLE) {
860 statusBar->hidden = TRUE;
861 statusBar->showTimer = 0;
862 statusBar->unk_3C = FALSE;
863 }
864 }
865 }
866 }
867 }
868 break;
869 case TRUE:
870 statusBar->drawPosY -= 5;
871 if (statusBar->drawPosY < FULLY_RETRACTED_Y) {
872 statusBar->drawPosY = FULLY_RETRACTED_Y;
873 if (!statusBar->ignoreChanges) {
874 if (playerStatus->actionState != ACTION_STATE_IDLE) {
875 statusBar->showTimer = 0;
876 } else if (playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_INPUT_DISABLED)) {
877 statusBar->showTimer = 0;
878 } else {
879 statusBar->showTimer++;
880 }
881
882 if (statusBar->showTimer >= 240 && gGameStatusPtr->context == CONTEXT_WORLD) {
883 statusBar->showTimer = 210;
884 statusBar->hidden = FALSE;
885 statusBar->unk_3B = TRUE;
886 statusBar->unk_3C = TRUE;
887 }
888 }
889 }
890 break;
891 }
892
893 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 12, 20, SCREEN_WIDTH - 12, SCREEN_HEIGHT - 20);
894 x = statusBar->drawPosX;
895 y = statusBar->drawPosY;
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);
898
899 if (statusBar->hpBlinkTimer > 0) {
900 statusBar->hpBlinkTimer--;
901 if (statusBar->hpBlinkTimer == 0) {
903 }
904 }
905
906 showStat = TRUE;
907 if (statusBar->hpBlinking != BLINK_OFF) {
908 if (statusBar->hpBlinkCounter > 8) {
909 showStat = FALSE;
910 if (statusBar->hpBlinkCounter > 12) {
911 statusBar->hpBlinkCounter = 0;
912 showStat = TRUE;
913 }
914 }
915 statusBar->hpBlinkCounter++;
916 }
917
918 if (showStat) {
919 id = statusBar->hpIconHIDs[0];
920 x = statusBar->drawPosX + 22;
921 y = statusBar->drawPosY + 13;
924
925 id = statusBar->hpIconHIDs[1];
926 x = statusBar->drawPosX + 37;
927 y = statusBar->drawPosY + 13;
930
931 x = statusBar->drawPosX + 48;
932 y = statusBar->drawPosY + 8;
933 status_bar_draw_stat(statusBar->hpTimesHID, x, y, statusBar->displayHP, playerData->curMaxHP);
934 }
935
936 if (statusBar->fpBlinkTimer > 0) {
937 statusBar->fpBlinkTimer--;
938 if (statusBar->fpBlinkTimer == 0) {
940 }
941 }
942
943 showStat = TRUE;
944 if (statusBar->fpBlinking != BLINK_OFF) {
945 if (statusBar->fpBlinkCounter > 8) {
946 showStat = FALSE;
947 if (statusBar->fpBlinkCounter > 12) {
948 statusBar->fpBlinkCounter = 0;
949 showStat = TRUE;
950 }
951 }
952 statusBar->fpBlinkCounter++;
953 }
954
955 if (showStat) {
956 id = statusBar->fpIconHIDs[0];
957 x = statusBar->drawPosX + 110;
958 y = statusBar->drawPosY + 13;
961
962 id = statusBar->fpIconHIDs[1];
963 x = statusBar->drawPosX + 125;
964 y = statusBar->drawPosY + 13;
967
968 x = statusBar->drawPosX + 136;
969 y = statusBar->drawPosY + 8;
970 status_bar_draw_stat(statusBar->fpTimesHID, x, y, statusBar->displayFP, playerData->curMaxFP);
971 }
972
973 if (playerData->level >= 27) {
974 playerData->starPoints = 0;
975 }
976
977 showStat = TRUE;
978 if (statusBar->starpointsBlinking != BLINK_OFF) {
979 if (statusBar->starpointsBlinkCounter > 8) {
980 if (statusBar->starpointsBlinkCounter <= 12) {
981 showStat = FALSE;
982 } else {
983 statusBar->starpointsBlinkCounter = 0;
984 }
985 }
986 statusBar->starpointsBlinkCounter++;
987 }
988
989 if (showStat) {
990 id = statusBar->spIconHID;
991 x = statusBar->drawPosX + 195;
992 y = statusBar->drawPosY + 14;
995
996 id = statusBar->spShineHID;
997 x = statusBar->drawPosX + 195;
998 y = statusBar->drawPosY + 9;
1001
1002 x = statusBar->drawPosX + 200;
1003 y = statusBar->drawPosY + 8;
1004 status_bar_draw_number(statusBar->spTimesHID, x, y, playerData->starPoints, 2);
1005 }
1006
1007 if (statusBar->coinsBlinkTimer > 0) {
1008 statusBar->coinsBlinkTimer--;
1009 if (statusBar->coinsBlinkTimer == 0) {
1011 }
1012 }
1013
1014 showStat = TRUE;
1015 if (statusBar->coinsBlinking != BLINK_OFF) {
1016 if (statusBar->coinsBlinkCounter > 8) {
1017 showStat = FALSE;
1018 if (statusBar->coinsBlinkCounter > 12) {
1019 statusBar->coinsBlinkCounter = 0;
1020 showStat = TRUE;
1021 }
1022 }
1023 statusBar->coinsBlinkCounter++;
1024 }
1025
1026 if (showStat) {
1027 id = statusBar->coinIconHID;
1028 x = statusBar->drawPosX + 244;
1029 y = statusBar->drawPosY + 14;
1032
1033 id = statusBar->coinSparkleHID;
1034 x = statusBar->drawPosX + 244;
1035 y = statusBar->drawPosY + 14;
1038
1039 x = statusBar->drawPosX + 247;
1040 y = statusBar->drawPosY + 8;
1041 status_bar_draw_number(statusBar->coinTimesHID, x, y, statusBar->displayCoins, 3);
1042 }
1043
1044 id = statusBar->starIconHID;
1045 showStat = TRUE;
1046 if (statusBar->spBlinking != BLINK_OFF) {
1047 if (statusBar->spBlinkCounter > 5) {
1048 if (statusBar->spBlinkCounter <= 8) {
1049 showStat = FALSE;
1050 } else {
1051 statusBar->spBlinkCounter = 0;
1052 showStat = TRUE;
1053 }
1054 }
1055 statusBar->spBlinkCounter++;
1056 }
1057
1058 x = statusBar->drawPosX + 20;
1059 y = statusBar->drawPosY + 28;
1060
1061 spBars = statusBar->displayStarPower / SP_PER_BAR;
1062 limit = statusBar->displayStarPower % SP_PER_BAR;
1063 limit /= 32;
1064 limit += spBars * 8;
1065 if (statusBar->unk_57 == 1) {
1066 spBars = playerData->starPower / SP_PER_BAR;
1067 limit = playerData->starPower % SP_PER_BAR;
1068 limit = limit / 32;
1069 limit += spBars * 8;
1070 func_800F0CB0(0, x + limit * 25 / 10, y, 1.0f);
1071 statusBar->unk_57 = 2;
1072 }
1073
1074 sp54 = FALSE;
1075 if (statusBar->unk_57 != 0) {
1076 if (statusBar->unk_58 != 0) {
1077 statusBar->unk_58--;
1078 } else {
1079 statusBar->unk_57 = 0;
1080 }
1081 if ((statusBar->unk_58 / 5) & 1) {
1082 sp54 = TRUE;
1083 }
1084 maxStarPower = statusBar->unk_59; // required to match
1085 s7 = statusBar->unk_59 % 8;
1086 s7 += statusBar->unk_59 / 8 * 8;
1087 } else {
1088 s7 = limit;
1089 }
1090
1091 i = 0;
1092 sp50 = 0;
1093 s1 = 0;
1094
1095 if (statusBar->spBlinking != BLINK_OFF) {
1096 if (!showStat) {
1097 s32 limit = statusBar->spBarsToBlink * 8;
1098 if (sp50 < limit) {
1099 while (TRUE) {
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; }
1107 i++;
1108 s1 = 0;
1109 sp50++;
1110 if (i >= limit) {
1111 break;
1112 }
1113 }
1114 }
1115 }
1116 }
1117
1118 while (TRUE) {
1119 if (i >= limit || i >= s7 && !sp54) {
1120 break;
1121 }
1122 i++;
1123
1125 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[0], y - 2);
1127
1128 s1++;
1129 if (i >= limit || i >= s7 && !sp54) {
1130 break;
1131 }
1132 i++;
1134
1135 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[1], y - 2);
1137 s1++;
1138 if (i >= limit || i >= s7 && !sp54) {
1139 break;
1140 }
1141 i++;
1143 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[2], y - 2);
1145 s1++;
1146 if (i >= limit || i >= s7 && !sp54) {
1147 break;
1148 }
1149 i++;
1151 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[3], y - 2);
1153 s1++;
1154 if (i >= limit || i >= s7 && !sp54) {
1155 break;
1156 }
1157 i++;
1159 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[4], y - 2);
1161 s1++;
1162
1163 if (i >= limit || i >= s7 && !sp54) {
1164 break;
1165 }
1166 i++;
1168 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[5], y - 2);
1170 s1++;
1171
1172 if (i >= limit || i >= s7 && !sp54) {
1173 break;
1174 }
1175 i++;
1177 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[6], y - 2);
1179 s1++;
1180
1181 if (i >= limit || i >= s7 && !sp54) {
1182 break;
1183 }
1184 i++;
1186 hud_element_set_render_pos(id, x + 12 + sp50 * 20, y);
1188
1189 s1 = 0;
1190 sp50++;
1191 if (i >= limit || i >= s7 && !sp54) {
1192 break;
1193 }
1194 }
1195
1196 maxStarPower = playerData->maxStarPower;
1197 limit = maxStarPower * 8;
1198 while (TRUE) {
1199 if (i >= limit) {
1200 break;
1201 }
1202 if (s1 == 0) {
1203 i++;
1205 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1207 if (i >= limit) {
1208 break;
1209 }
1210 s1 = 1;
1211 }
1212 if (s1 == 1) {
1213 i++;
1215 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1217 if (i >= limit) {
1218 break;
1219 }
1220 s1 = 2;
1221 }
1222 if (s1 == 2) {
1223 i++;
1225 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1227 if (i >= limit) {
1228 break;
1229 }
1230 s1 = 3;
1231 }
1232 if (s1 == 3) {
1233 i++;
1235 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1237 if (i >= limit) {
1238 break;
1239 }
1240 s1 = 4;
1241 }
1242 if (s1 == 4) {
1243 i++;
1245 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1247 if (i >= limit) {
1248 break;
1249 }
1250 s1 = 5;
1251 }
1252 if (s1 == 5) {
1253 i++;
1255 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1257 if (i >= limit) {
1258 break;
1259 }
1260 s1 = 6;
1261 }
1262 if (s1 == 6) {
1263 i++;
1265 hud_element_set_render_pos(id, x + sp50 * 20 + StatusBarSPIncrementOffsets[s1], y - 2);
1267 if (i >= limit) {
1268 break;
1269 }
1270 s1 = 7;
1271 }
1272
1273 if (s1 == 7) {
1274 i++;
1276 hud_element_set_render_pos(id, x + 12 + sp50 * 20, y);
1278 if (i >= limit) {
1279 break;
1280 }
1281 }
1282 s1 = 0;
1283 sp50++;
1284 }
1285
1286 func_800F0D80();
1287 func_800F102C();
1288}
#define draw_box
@ WINDOW_STYLE_5
Definition enums.h:6375
@ WINDOW_STYLE_6
Definition enums.h:6376
@ PEACH_FLAG_IS_PEACH
Definition enums.h:2488
@ STORY_EPILOGUE
Definition enums.h:234
@ PS_FLAG_NO_STATIC_COLLISION
Definition enums.h:3051
@ PS_FLAG_INPUT_DISABLED
Definition enums.h:3052
@ INTRO_PART_0
Definition enums.h:3552
@ SOUND_FLOWER_PICKUP
Definition enums.h:927
@ SOUND_HEART_PICKUP
Definition enums.h:924
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ DEMO_STATE_NONE
Definition enums.h:3535
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
void func_800F0CB0(s32, f32, f32, f32)
void func_800F102C(void)
void func_800F0D80(void)
void status_bar_start_blinking_hp(void)
Definition inventory.c:1530
void status_bar_start_blinking_fp(void)
Definition inventory.c:1553
void status_bar_stop_blinking_hp(void)
Definition inventory.c:1543
HudScript * SPStarHudScripts[]
Definition partners.c:152
HudScript HES_StatusStarEmpty
HudScript * SPIncrementHudScripts[]
Definition partners.c:148
s32 StatusBarSPIncrementOffsets[]
Definition partners.c:156
void status_bar_stop_blinking_fp(void)
Definition inventory.c:1566
void status_bar_draw_number(s32 iconID, s32 startX, s32 startY, s32 value, s32 numDigits)
Definition inventory.c:618
void status_bar_stop_blinking_coins(void)
Definition inventory.c:1588
void status_bar_draw_stat(s32 id, s32 startX, s32 startY, s32 currentValue, s32 maxValue)
Definition inventory.c:656
HudScript HES_StatusSPEmptyIncrement
void status_bar_start_blinking_coins(void)
Definition inventory.c:1575
#define FULLY_EXTENDED_Y
Definition inventory.c:6
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
@ GB_StoryProgress
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106
#define SP_PER_BAR
Definition macros.h:102
Gfx * gMainGfxPos
Definition cam_main.c:15
PlayerStatus gPlayerStatus
Definition 77480.c:39

Referenced by draw_status_ui().

◆ coin_counter_draw_content()

void coin_counter_draw_content ( UNK_TYPE arg0,
s32 posX,
s32 posY )

Definition at line 1290 of file inventory.c.

1290 {
1291 StatusBar* statusBar = &gStatusBar;
1292 s32 iconIndex;
1293
1294 if ((gPlayerData.coins != statusBar->displayCoins) && ((gGameStatusPtr->frameCounter % 3) == 0)) {
1296 }
1297
1298 iconIndex = statusBar->coinCountTimesHID;
1299 hud_element_set_render_pos(iconIndex, posX + 27, posY + 11);
1300 hud_element_draw_clipped(iconIndex);
1301
1302 iconIndex = statusBar->coinCountIconHID;
1303 hud_element_set_render_pos(iconIndex, posX + 15, posY + 11);
1304 hud_element_draw_clipped(iconIndex);
1305
1307}
s32 coinCountTimesHID
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
Definition enums.h:5393
@ DRAW_NUMBER_STYLE_MONOSPACE
Definition enums.h:5394
@ MSG_PAL_STANDARD
Definition enums.h:5415
@ DRAW_NUMBER_CHARSET_THIN
Definition enums.h:5401
@ SOUND_COIN_PICKUP
Definition enums.h:922
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
void hud_element_draw_clipped(s32 id)

Referenced by show_coin_counter().

◆ update_coin_counter()

void update_coin_counter ( void )

Definition at line 1309 of file inventory.c.

1309 {
1310 StatusBar* statusBar = &gStatusBar;
1311
1312 if (statusBar->unk_6D != 0) {
1313 statusBar->unk_6D--;
1314 if ((statusBar->unk_6D == 0) && (statusBar->iconIndex12 > -1)) {
1315 hud_element_free(statusBar->iconIndex12);
1316 hud_element_free(statusBar->iconIndex13);
1317 statusBar->iconIndex12 = -1;
1318 }
1319 D_8010CD12 = FALSE;
1320 }
1321
1322 if (statusBar->coinCounterHideTime == 0) {
1323 return;
1324 }
1325
1326 if ((statusBar->displayCoins == gPlayerData.coins) && (statusBar->coinCounterHideTime > 30)) {
1327 statusBar->coinCounterHideTime = 30;
1328 }
1329
1330 if ((statusBar->displayCoins == gPlayerData.coins) || (statusBar->coinCounterHideTime <= 30)) {
1331 statusBar->coinCounterHideTime--;
1332 if (statusBar->coinCounterHideTime == 0) {
1334 statusBar->unk_6D = 15;
1335 D_8010CD10 = FALSE;
1336 D_8010CD12 = TRUE;
1337 statusBar->iconIndex12 = statusBar->coinCountTimesHID;
1338 statusBar->iconIndex13 = statusBar->coinCountIconHID;
1339 statusBar->displayCoins = gPlayerData.coins;
1340 if (statusBar->unk_6E > -1) {
1341 statusBar->ignoreChanges = statusBar->unk_6E;
1342 statusBar->unk_6E = -1;
1343 }
1344 }
1345 }
1346}
@ WIN_CURRENCY_COUNTER
Definition enums.h:5261
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 set_window_update(s32 panelID, s32)
Definition windows.c:434
void hud_element_free(s32 id)

Referenced by draw_status_ui().

◆ show_coin_counter()

void show_coin_counter ( void )

Definition at line 1348 of file inventory.c.

1348 {
1349 StatusBar* statusBar = &gStatusBar;
1350 s32 index;
1351
1352 if (D_8010CD10 || D_8010CD12) {
1354 if (statusBar->iconIndex12 > -1) {
1357 statusBar->iconIndex12 = -1;
1358 }
1359 statusBar->coinCounterHideTime = 0;
1360 statusBar->unk_6D = 0;
1361 D_8010CD10 = FALSE;
1362 D_8010CD12 = FALSE;
1363 }
1364
1365 if (statusBar->coinCounterHideTime == 0) {
1368 statusBar->coinCountTimesHID = index = hud_element_create(&HES_MenuTimes);
1370 hud_element_set_tint(index, 255, 255, 255);
1371 statusBar->coinCountIconHID = index = hud_element_create(&HES_StatusCoin);
1373 hud_element_set_tint(index, 255, 255, 255);
1374 statusBar->coinCounterHideTime = 0;
1375
1376 if (statusBar->unk_6E < 0) {
1377 statusBar->unk_6E = statusBar->ignoreChanges;
1378 }
1379
1380 statusBar->ignoreChanges = TRUE;
1381 D_8010CD10 = TRUE;
1382 }
1383}
@ WINDOW_PRIORITY_21
Definition enums.h:3187
@ WINDOW_UPDATE_HIDE
Definition enums.h:5312
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
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
HudScript HES_MenuTimes
void hud_element_set_tint(s32 id, s32 r, s32 g, s32 b)
void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY)
Definition inventory.c:1290

◆ hide_coin_counter()

void hide_coin_counter ( void )

Definition at line 1385 of file inventory.c.

1385 {
1386 StatusBar* statusBar = &gStatusBar;
1387
1388 if (D_8010CD10 && (statusBar->coinCounterHideTime == 0)) {
1389 statusBar->coinCounterHideTime = 60;
1390 }
1391}

◆ hide_coin_counter_immediately()

void hide_coin_counter_immediately ( void )

Definition at line 1393 of file inventory.c.

1393 {
1394 StatusBar* statusBar = &gStatusBar;
1395
1396 if (D_8010CD10 && (statusBar->coinCounterHideTime == 0)) {
1397 statusBar->coinCounterHideTime = 1;
1398 }
1399}

◆ draw_status_ui()

void draw_status_ui ( void )

Definition at line 1411 of file inventory.c.

1411 {
1414
1415 #if DX_DEBUG_MENU
1416 dx_debug_menu_main();
1417 #endif
1418}
void update_coin_counter(void)
Definition inventory.c:1309
void update_status_bar(void)
Definition inventory.c:712

Referenced by btl_draw_ui(), state_drawUI_change_map(), state_drawUI_enter_world(), and state_drawUI_world().

◆ open_status_bar_slowly()

void open_status_bar_slowly ( void )

Definition at line 1420 of file inventory.c.

1420 {
1421 StatusBar* statusBar = &gStatusBar;
1422
1423 if (statusBar->hidden) {
1424 statusBar->showTimer = 210;
1425 statusBar->hidden = FALSE;
1426 statusBar->unk_3B = TRUE;
1427 }
1428}

Referenced by action_update_hit_fire(), action_update_hit_lava(), and check_input_status_bar().

◆ open_status_bar_quickly()

void open_status_bar_quickly ( void )

Definition at line 1430 of file inventory.c.

1430 {
1431 StatusBar* statusBar = &gStatusBar;
1432
1433 if (statusBar->hidden) {
1434 statusBar->showTimer = 105;
1435 statusBar->hidden = FALSE;
1436 statusBar->unk_3B = TRUE;
1437 }
1438}

Referenced by create_standard_popup_menu(), and shop_open_item_select_popup().

◆ close_status_bar()

void close_status_bar ( void )

Definition at line 1440 of file inventory.c.

1440 {
1441 StatusBar* statusBar = &gStatusBar;
1442
1443 if (statusBar->hidden != TRUE) {
1444 statusBar->hidden = TRUE;
1445 statusBar->showTimer = 0;
1446 statusBar->unk_3B = TRUE;
1447 }
1448}

Referenced by check_conversation_trigger(), check_input_status_bar(), destroy_popup_menu(), initialize_status_bar(), and shop_close_item_select_popup().

◆ setup_status_bar_for_world()

void setup_status_bar_for_world ( void )

Definition at line 1450 of file inventory.c.

1450 {
1451 StatusBar* statusBar = &gStatusBar;
1452
1453 statusBar->drawPosY = FULLY_RETRACTED_Y;
1454 statusBar->ignoreChanges = FALSE;
1455 statusBar->showTimer = 0;
1456 statusBar->hidden = TRUE;
1457 statusBar->unk_3B = FALSE;
1458 statusBar->unk_3C = FALSE;
1459}

Referenced by update_encounters_post_battle().

◆ setup_status_bar_for_battle()

void setup_status_bar_for_battle ( void )

Definition at line 1461 of file inventory.c.

1461 {
1462 StatusBar* statusBar = &gStatusBar;
1463
1464 statusBar->drawPosY = 0;
1465 statusBar->ignoreChanges = FALSE;
1466 statusBar->showTimer = 210;
1467 statusBar->hidden = FALSE;
1468 statusBar->unk_3B = TRUE;
1469 statusBar->unk_3C = FALSE;
1470}

Referenced by btl_state_update_normal_start().

◆ enable_status_bar_input()

void enable_status_bar_input ( void )

Definition at line 1472 of file inventory.c.

1472 {
1474}

◆ disable_status_bar_input()

void disable_status_bar_input ( void )

Definition at line 1476 of file inventory.c.

1476 {
1478}

◆ can_control_status_bar()

b32 can_control_status_bar ( void )

Definition at line 1481 of file inventory.c.

1481 {
1483 return FALSE;
1484 }
1485
1486 if (gStatusBar.alwaysShown) {
1487 return FALSE;
1488 }
1489
1491 return FALSE;
1492 }
1493
1494 return TRUE;
1495}

Referenced by check_input_status_bar().

◆ status_bar_ignore_changes()

void status_bar_ignore_changes ( void )

Definition at line 1497 of file inventory.c.

1497 {
1499}

Referenced by create_standard_popup_menu(), and shop_open_item_select_popup().

◆ status_bar_show_and_ignore_changes()

void status_bar_show_and_ignore_changes ( void )

Definition at line 1501 of file inventory.c.

1501 {
1502 StatusBar* statusBar = &gStatusBar;
1503
1504 statusBar->ignoreChanges = TRUE;
1505 statusBar->drawPosY = FULLY_EXTENDED_Y;
1506}

◆ status_bar_respond_to_changes()

void status_bar_respond_to_changes ( void )

Definition at line 1508 of file inventory.c.

1508 {
1509 gStatusBar.ignoreChanges = FALSE;
1510}

Referenced by destroy_popup_menu(), shop_close_item_select_popup(), and state_step_unpause().

◆ status_bar_is_ignoring_changes()

s32 status_bar_is_ignoring_changes ( void )

Definition at line 1512 of file inventory.c.

1512 {
1513 StatusBar* statusBar = &gStatusBar;
1514
1515 return statusBar->alwaysShown + statusBar->ignoreChanges;
1516}

Referenced by create_battle_popup_menu(), create_shop_popup_menu(), and create_standard_popup_menu().

◆ status_bar_always_show_on()

void status_bar_always_show_on ( void )

Definition at line 1518 of file inventory.c.

1518 {
1519 gStatusBar.alwaysShown = TRUE;
1520}

Referenced by shop_open_item_select_popup().

◆ status_bar_always_show_off()

void status_bar_always_show_off ( void )

Definition at line 1522 of file inventory.c.

1522 {
1523 gStatusBar.alwaysShown = FALSE;
1524}

Referenced by draw_shop_items(), and shop_close_item_select_popup().

◆ is_status_bar_visible()

s32 is_status_bar_visible ( void )

Definition at line 1526 of file inventory.c.

1526 {
1527 return !gStatusBar.hidden;
1528}

Referenced by check_input_status_bar().

◆ status_bar_start_blinking_hp()

void status_bar_start_blinking_hp ( void )

Definition at line 1530 of file inventory.c.

1530 {
1531 StatusBar* statusBar = &gStatusBar;
1532
1534 statusBar->hpBlinkTimer = 120;
1535 }
1536
1537 if (statusBar->hpBlinking != BLINK_ON) {
1538 statusBar->hpBlinking = BLINK_ON;
1539 statusBar->hpBlinkCounter = 0;
1540 }
1541}

Referenced by update_status_bar().

◆ status_bar_stop_blinking_hp()

void status_bar_stop_blinking_hp ( void )

Definition at line 1543 of file inventory.c.

1543 {
1544 StatusBar* statusBar = &gStatusBar;
1545
1546 if (statusBar->hpBlinking != BLINK_OFF) {
1547 statusBar->hpBlinking = BLINK_OFF;
1548 statusBar->hpBlinkCounter = 0;
1549 statusBar->hpBlinkTimer = 0;
1550 }
1551}

Referenced by update_status_bar().

◆ status_bar_start_blinking_fp()

void status_bar_start_blinking_fp ( void )

Definition at line 1553 of file inventory.c.

1553 {
1554 StatusBar* statusBar = &gStatusBar;
1555
1557 statusBar->fpBlinkTimer = 120;
1558 }
1559
1560 if (statusBar->fpBlinking != BLINK_ON) {
1561 statusBar->fpBlinking = BLINK_ON;
1562 statusBar->fpBlinkCounter = 0;
1563 }
1564}

Referenced by btl_menu_moves_draw_content(), and update_status_bar().

◆ status_bar_stop_blinking_fp()

void status_bar_stop_blinking_fp ( void )

Definition at line 1566 of file inventory.c.

1566 {
1567 StatusBar* statusBar = &gStatusBar;
1568
1569 if (statusBar->fpBlinking != BLINK_OFF) {
1570 statusBar->fpBlinking = BLINK_OFF;
1571 statusBar->fpBlinkCounter = 0;
1572 }
1573}

Referenced by btl_menu_moves_draw_content(), btl_submenu_moves_update(), and update_status_bar().

◆ status_bar_start_blinking_sp()

void status_bar_start_blinking_sp ( void )

Definition at line 1598 of file inventory.c.

1598 {
1599 PlayerData* playerData = &gPlayerData;
1600 StatusBar* statusBar = &gStatusBar;
1601
1602 statusBar->spBarsToBlink = playerData->maxStarPower;
1603 if (statusBar->spBlinking != BLINK_ON) {
1604 statusBar->spBlinking = BLINK_ON;
1605 statusBar->spBlinkCounter = 0;
1606 }
1607}

◆ status_bar_stop_blinking_sp()

void status_bar_stop_blinking_sp ( void )

Definition at line 1609 of file inventory.c.

1609 {
1610 StatusBar* statusBar = &gStatusBar;
1611
1612 if (statusBar->spBlinking != BLINK_OFF) {
1613 statusBar->spBlinking = BLINK_OFF;
1614 statusBar->spBlinkCounter = 0;
1615 }
1616}

Referenced by btl_menu_moves_draw_content(), and btl_submenu_moves_update().

◆ status_bar_start_blinking_sp_bars()

void status_bar_start_blinking_sp_bars ( s32 numBarsToBlink)

Definition at line 1618 of file inventory.c.

1618 {
1619 StatusBar* statusBar = &gStatusBar;
1620
1621 statusBar->spBarsToBlink = numBarsToBlink;
1622 if (statusBar->spBlinking != BLINK_ON) {
1623 statusBar->spBlinking = BLINK_ON;
1624 statusBar->spBlinkCounter = 0;
1625 }
1626}

Referenced by btl_menu_moves_draw_content().

◆ status_bar_start_blinking_starpoints()

void status_bar_start_blinking_starpoints ( void )

Definition at line 1628 of file inventory.c.

1628 {
1629 StatusBar* statusBar = &gStatusBar;
1630
1631 if (statusBar->starpointsBlinking != BLINK_ON) {
1632 statusBar->starpointsBlinking = BLINK_ON;
1633 statusBar->starpointsBlinkCounter = 0;
1634 }
1635}

Referenced by btl_state_update_run_away().

◆ status_bar_stop_blinking_starpoints()

void status_bar_stop_blinking_starpoints ( void )

Definition at line 1637 of file inventory.c.

1637 {
1638 StatusBar* statusBar = &gStatusBar;
1639
1640 if (statusBar->starpointsBlinking != BLINK_OFF) {
1641 statusBar->starpointsBlinking = BLINK_OFF;
1642 statusBar->starpointsBlinkCounter = 0;
1643 }
1644}

Referenced by btl_state_update_run_away().

◆ decrement_status_bar_disabled()

void decrement_status_bar_disabled ( void )

◆ increment_status_bar_disabled()

void increment_status_bar_disabled ( void )

◆ sync_status_bar()

void sync_status_bar ( void )

Definition at line 1660 of file inventory.c.

1660 {
1661 PlayerData* playerData = &gPlayerData;
1662 StatusBar* statusBar = &gStatusBar;
1663
1664 statusBar->displayHP = playerData->curHP;
1665 statusBar->displayFP = playerData->curFP;
1666 statusBar->displayStarPower = playerData->starPower;
1667 statusBar->displayCoins = playerData->coins;
1668 statusBar->displayStarpoints = playerData->starPoints;
1669}

◆ reset_status_bar()

void reset_status_bar ( void )

Definition at line 1671 of file inventory.c.

1671 {
1672 PlayerData* playerData = &gPlayerData;
1673 StatusBar* statusBar = &gStatusBar;
1674 s32 i;
1675
1676 statusBar->drawPosX = 12;
1677 statusBar->drawPosY = FULLY_RETRACTED_Y;
1678 statusBar->hidden = 0;
1679 statusBar->showTimer = 210;
1680 statusBar->unk_3B = FALSE;
1681 statusBar->ignoreChanges = FALSE;
1682 statusBar->openInputDisabled = FALSE;
1683 statusBar->alwaysShown = FALSE;
1684 statusBar->hpBlinking = BLINK_OFF;
1685 statusBar->hpBlinkCounter = 0;
1686 statusBar->hpBlinkTimer = 0;
1687 statusBar->fpBlinking = BLINK_OFF;
1688 statusBar->fpBlinkCounter = 0;
1689 statusBar->fpBlinkTimer = 0;
1690 statusBar->coinsBlinking = BLINK_OFF;
1691 statusBar->coinsBlinkCounter = 0;
1692 statusBar->coinsBlinkTimer = 0;
1693 statusBar->spBlinking = BLINK_OFF;
1694 statusBar->spBlinkCounter = 0;
1695 statusBar->disabled = 0;
1696 statusBar->starpointsBlinking = BLINK_OFF;
1697 statusBar->starpointsBlinkCounter = 0;
1698 statusBar->unk_6E = -1;
1699 statusBar->displayHP = playerData->curHP;
1700 statusBar->displayFP = playerData->curFP;
1701 statusBar->displayCoins = playerData->coins;
1702 statusBar->displayStarpoints = playerData->starPoints;
1703 statusBar->displayStarPower = playerData->starPower;
1704 statusBar->unk_3C = FALSE;
1705
1706 for (i = 0; i < ARRAY_COUNT(statusBar->hpIconHIDs); i++) {
1707 copy_world_hud_element_ref_to_battle(statusBar->hpIconHIDs[i], statusBar->hpIconHIDs[i]);
1708 }
1709
1710 for (i = 0; i < ARRAY_COUNT(statusBar->fpIconHIDs); i++) {
1711 copy_world_hud_element_ref_to_battle(statusBar->fpIconHIDs[i], statusBar->fpIconHIDs[i]);
1712 }
1713
1723}
void copy_world_hud_element_ref_to_battle(s32 worldID, s32 battleID)

Referenced by state_step_battle(), and state_step_pause().

◆ is_ability_active()

s32 is_ability_active ( s32 ability)

Definition at line 1725 of file inventory.c.

1725 {
1726 PlayerData* playerData = &gPlayerData;
1727 s32 attackFXArray[6];
1728 s32 attackFXIndex;
1729 s32 badgeItemID;
1730 s32 badgeMoveID;
1731 s32 ret;
1732 s32 i;
1733
1734 ret = 0;
1735 attackFXIndex = 0;
1736
1737 for (i = 0; i < ARRAY_COUNT(attackFXArray); i++) {
1738 attackFXArray[i] = 0;
1739 }
1740
1742 return 0;
1743 }
1744
1745 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
1746 badgeItemID = playerData->equippedBadges[i];
1747 if (badgeItemID == ITEM_NONE)
1748 continue;
1749
1750 badgeMoveID = gItemTable[badgeItemID].moveID;
1751
1752 switch (ability) {
1754 if (badgeMoveID == MOVE_DODGE_MASTER) {
1755 ret++;
1756 }
1757 break;
1759 if (badgeMoveID == MOVE_SPIKE_SHIELD) {
1760 ret++;
1761 }
1762 break;
1764 if (badgeMoveID == MOVE_FIRST_ATTACK) {
1765 ret++;
1766 }
1767 break;
1768 case ABILITY_HP_PLUS:
1769 if (badgeMoveID == MOVE_HP_PLUS) {
1770 ret++;
1771 }
1772 break;
1773 case ABILITY_DOUBLE_DIP:
1774 if (badgeMoveID == MOVE_DOUBLE_DIP) {
1775 ret++;
1776 }
1777 break;
1779 if (badgeMoveID == MOVE_MYSTERY_SCROLL) {
1780 ret++;
1781 }
1782 if (playerData->hasActionCommands) {
1783 ret++;
1784 }
1785 break;
1787 if (badgeMoveID == MOVE_FIRE_SHIELD) {
1788 ret++;
1789 }
1790 break;
1792 if (badgeMoveID == MOVE_PRETTY_LUCKY) {
1793 ret++;
1794 }
1795 break;
1796 case ABILITY_HP_DRAIN:
1797 if (badgeMoveID == MOVE_HP_DRAIN) {
1798 ret++;
1799 }
1800 break;
1802 if (badgeMoveID == MOVE_ALLOR_NOTHING) {
1803 ret++;
1804 }
1805 break;
1806 case ABILITY_SLOW_GO:
1807 if (badgeMoveID == MOVE_SLOW_GO) {
1808 ret++;
1809 }
1810 break;
1811 case ABILITY_FP_PLUS:
1812 if (badgeMoveID == MOVE_FP_PLUS) {
1813 ret++;
1814 }
1815 break;
1816 case ABILITY_ICE_POWER:
1817 if (badgeMoveID == MOVE_ICE_POWER) {
1818 ret++;
1819 }
1820 break;
1822 if (badgeMoveID == MOVE_FEELING_FINE) {
1823 ret++;
1824 }
1825 break;
1826 case ABILITY_ATTACK_FX:
1827 if (badgeMoveID == MOVE_ATTACK_FX_A) {
1828 attackFXArray[attackFXIndex++] = 1;
1829 ret = -1;
1830 }
1831 if (badgeMoveID == MOVE_ATTACK_FX_D) {
1832 attackFXArray[attackFXIndex++] = 2;
1833 ret = -1;
1834 }
1835 if (badgeMoveID == MOVE_ATTACK_FX_B) {
1836 attackFXArray[attackFXIndex++] = 3;
1837 ret = -1;
1838 }
1839 if (badgeMoveID == MOVE_ATTACK_FX_E) {
1840 attackFXArray[attackFXIndex++] = 4;
1841 ret = -1;
1842 }
1843 if (badgeMoveID == MOVE_ATTACK_FX_C) {
1844 attackFXArray[attackFXIndex++] = 5;
1845 ret = -1;
1846 }
1847 if (badgeMoveID == MOVE_ATTACK_FX_F) {
1848 attackFXArray[attackFXIndex++] = 6;
1849 ret = -1;
1850 }
1851 break;
1853 if (badgeMoveID == MOVE_MONEY_MONEY) {
1854 ret++;
1855 }
1856 break;
1857 case ABILITY_CHILL_OUT:
1858 if (badgeMoveID == MOVE_CHILL_OUT_BADGE) {
1859 ret++;
1860 }
1861 break;
1863 if (badgeMoveID == MOVE_HAPPY_HEART) {
1864 ret++;
1865 }
1866 break;
1867 case ABILITY_ZAP_TAP:
1868 if (badgeMoveID == MOVE_ZAP_TAP) {
1869 ret++;
1870 }
1871 break;
1872 case ABILITY_MEGA_RUSH:
1873 if (badgeMoveID == MOVE_MEGA_RUSH) {
1874 ret++;
1875 }
1876 break;
1877 case ABILITY_BERSERKER:
1878 if (badgeMoveID == MOVE_BERSERKER) {
1879 ret++;
1880 }
1881 break;
1882 case ABILITY_RIGHT_ON:
1883 if (badgeMoveID == MOVE_RIGHT_ON) {
1884 ret++;
1885 }
1886 break;
1888 if (badgeMoveID == MOVE_RUNAWAY_PAY) {
1889 ret++;
1890 }
1891 break;
1893 if (badgeMoveID == MOVE_FLOWER_SAVER) {
1894 ret++;
1895 }
1896 break;
1897 case ABILITY_PAY_OFF:
1898 if (badgeMoveID == MOVE_PAY_OFF) {
1899 ret++;
1900 }
1901 break;
1903 if (badgeMoveID == MOVE_DEFEND_PLUS) {
1904 ret++;
1905 }
1906 break;
1907 case ABILITY_POWER_PLUS:
1908 if (badgeMoveID == MOVE_POWER_PLUS) {
1909 ret++;
1910 }
1911 break;
1912 case ABILITY_REFUND:
1913 if (badgeMoveID == MOVE_REFUND) {
1914 ret++;
1915 }
1916 break;
1917 case ABILITY_POWER_RUSH:
1918 if (badgeMoveID == MOVE_POWER_RUSH) {
1919 ret++;
1920 }
1921 break;
1923 if (badgeMoveID == MOVE_CRAZY_HEART) {
1924 ret++;
1925 }
1926 break;
1927 case ABILITY_LAST_STAND:
1928 if (badgeMoveID == MOVE_LAST_STAND) {
1929 ret++;
1930 }
1931 break;
1932 case ABILITY_CLOSE_CALL:
1933 if (badgeMoveID == MOVE_CLOSE_CALL) {
1934 ret++;
1935 }
1936 break;
1938 if (badgeMoveID == MOVE_P_UP_D_DOWN) {
1939 ret++;
1940 }
1941 break;
1942 case ABILITY_LUCKY_DAY:
1943 if (badgeMoveID == MOVE_LUCKY_DAY) {
1944 ret++;
1945 }
1946 break;
1948 if (badgeMoveID == MOVE_MEGA_HP_DRAIN) {
1949 ret++;
1950 }
1951 break;
1953 if (badgeMoveID == MOVE_P_DOWN_D_UP) {
1954 ret++;
1955 }
1956 break;
1958 if (badgeMoveID == MOVE_FLOWER_FANATIC) {
1959 ret++;
1960 }
1961 break;
1963 if (badgeMoveID == MOVE_SPEEDY_SPIN) {
1964 ret++;
1965 }
1966 break;
1968 if (badgeMoveID == MOVE_SPIN_ATTACK) {
1969 ret++;
1970 }
1971 break;
1972 case ABILITY_I_SPY:
1973 if (badgeMoveID == MOVE_I_SPY) {
1974 ret++;
1975 }
1976 break;
1978 if (badgeMoveID == MOVE_BUMP_ATTACK) {
1979 ret++;
1980 }
1981 break;
1983 if (badgeMoveID == MOVE_QUICK_CHANGE) {
1984 ret++;
1985 }
1986 break;
1988 if (badgeMoveID == MOVE_HEART_FINDER) {
1989 ret++;
1990 }
1991 break;
1993 if (badgeMoveID == MOVE_FLOWER_FINDER) {
1994 ret++;
1995 }
1996 break;
1998 if (badgeMoveID == MOVE_DIZZY_ATTACK) {
1999 ret++;
2000 }
2001 break;
2003 if (badgeMoveID == MOVE_UNUSED_FINAL_GOOMPA) {
2004 ret++;
2005 }
2006 break;
2008 if (badgeMoveID == MOVE_UNUSED_FINAL_BOBOMB) {
2009 ret++;
2010 }
2011 break;
2012 case ABILITY_DEEP_FOCUS:
2013 if (badgeMoveID == MOVE_DEEP_FOCUS) {
2014 ret++;
2015 }
2016 break;
2018 if (badgeMoveID == MOVE_SUPER_FOCUS) {
2019 ret++;
2020 }
2021 break;
2022 case ABILITY_KAIDEN:
2023 if (badgeMoveID == MOVE_KAIDEN) {
2024 ret++;
2025 }
2026 break;
2028 if (badgeMoveID == MOVE_DAMAGE_DODGE) {
2029 ret++;
2030 }
2031 break;
2033 if (badgeMoveID == MOVE_HAPPY_FLOWER) {
2034 ret++;
2035 }
2036 break;
2038 if (badgeMoveID == MOVE_GROUP_FOCUS) {
2039 ret++;
2040 }
2041 break;
2042 case ABILITY_PEEKABOO:
2043 if (badgeMoveID == MOVE_PEEKABOO) {
2044 ret++;
2045 }
2046 break;
2048 if (badgeMoveID == MOVE_HEALTHY_HEALTHY) {
2049 ret++;
2050 }
2051 break;
2052 }
2053 }
2054
2055 if (ret < 0) {
2056 ret = attackFXArray[rand_int(attackFXIndex - 1)];
2057 }
2058 return ret;
2059}
#define rand_int
@ ABILITY_BERSERKER
Definition enums.h:457
@ ABILITY_FLOWER_SAVER
Definition enums.h:460
@ ABILITY_QUICK_CHANGE
Definition enums.h:462
@ ABILITY_DEEP_FOCUS
Definition enums.h:484
@ ABILITY_BUMP_ATTACK
Definition enums.h:478
@ ABILITY_FEELING_FINE
Definition enums.h:450
@ ABILITY_ATTACK_FX
Definition enums.h:451
@ ABILITY_FLOWER_FINDER
Definition enums.h:480
@ ABILITY_P_DOWN_D_UP
Definition enums.h:473
@ ABILITY_MEGA_HP_DRAIN
Definition enums.h:472
@ ABILITY_DOUBLE_DIP
Definition enums.h:441
@ ABILITY_PAY_OFF
Definition enums.h:461
@ ABILITY_POWER_RUSH
Definition enums.h:466
@ ABILITY_SPIN_ATTACK
Definition enums.h:476
@ ABILITY_CHILL_OUT
Definition enums.h:453
@ ABILITY_MONEY_MONEY
Definition enums.h:452
@ ABILITY_FLOWER_FANATIC
Definition enums.h:474
@ ABILITY_REFUND
Definition enums.h:465
@ ABILITY_PEEKABOO
Definition enums.h:490
@ ABILITY_POWER_PLUS
Definition enums.h:464
@ ABILITY_CLOSE_CALL
Definition enums.h:469
@ ABILITY_HEALTHY_HEALTHY
Definition enums.h:491
@ ABILITY_MEGA_RUSH
Definition enums.h:456
@ ABILITY_HEART_FINDER
Definition enums.h:479
@ ABILITY_DIZZY_ATTACK
Definition enums.h:481
@ ABILITY_DEFEND_PLUS
Definition enums.h:463
@ ABILITY_FINAL_GOOMPA
Definition enums.h:482
@ ABILITY_I_SPY
Definition enums.h:477
@ ABILITY_DAMAGE_DODGE
Definition enums.h:487
@ ABILITY_SPIKE_SHIELD
Definition enums.h:438
@ ABILITY_KAIDEN
Definition enums.h:486
@ ABILITY_ZAP_TAP
Definition enums.h:455
@ ABILITY_LAST_STAND
Definition enums.h:468
@ ABILITY_P_UP_D_DOWN
Definition enums.h:470
@ ABILITY_HAPPY_HEART
Definition enums.h:454
@ ABILITY_FIRE_SHIELD
Definition enums.h:443
@ ABILITY_DODGE_MASTER
Definition enums.h:436
@ ABILITY_FINAL_BOBOMB
Definition enums.h:483
@ ABILITY_ICE_POWER
Definition enums.h:449
@ ABILITY_LUCKY_DAY
Definition enums.h:471
@ ABILITY_CRAZY_HEART
Definition enums.h:467
@ ABILITY_SUPER_FOCUS
Definition enums.h:485
@ ABILITY_ALL_OR_NOTHING
Definition enums.h:446
@ ABILITY_HAPPY_FLOWER
Definition enums.h:488
@ ABILITY_RUNAWAY_PAY
Definition enums.h:459
@ ABILITY_PRETTY_LUCKY
Definition enums.h:444
@ ABILITY_RIGHT_ON
Definition enums.h:458
@ ABILITY_HP_DRAIN
Definition enums.h:445
@ ABILITY_MYSTERY_SCROLL
Definition enums.h:442
@ ABILITY_FIRST_ATTACK
Definition enums.h:439
@ ABILITY_GROUP_FOCUS
Definition enums.h:489
@ ABILITY_SLOW_GO
Definition enums.h:447
@ ABILITY_SPEEDY_SPIN
Definition enums.h:475
ItemData gItemTable[]

Referenced by action_command_init_status(), action_hammer_play_hit_fx(), action_update_run(), action_update_spin(), action_update_walk(), adjust_action_command_difficulty(), appendGfx_player_actor(), btl_menu_strats_draw_content(), btl_state_update_begin_player_turn(), btl_state_update_begin_turn(), btl_state_update_celebration(), btl_state_update_end_player_turn(), btl_state_update_first_strike(), btl_state_update_normal_start(), btl_state_update_partner_menu(), btl_state_update_player_move(), btl_state_update_run_away(), btl_state_update_select_target(), calc_enemy_damage_target(), calc_player_damage_enemy(), check_block_input(), check_input_spin(), enforce_hpfp_limits(), entity_HiddenPanel_set_ispy_notification(), get_coin_drop_amount(), inflict_status(), is_actor_health_bar_visible(), is_actortype_health_bar_visible(), load_player_actor(), player_team_is_ability_active(), show_first_strike_message(), spawn_drops(), update_encounters_neutral(), update_encounters_pre_battle(), and update_locomotion_state().

◆ is_partner_ability_active()

s32 is_partner_ability_active ( s32 ability)

Definition at line 2061 of file inventory.c.

2061 {
2062 return 0;
2063}

Referenced by player_team_is_ability_active().

◆ add_coins()

s32 add_coins ( s32 amt)

Definition at line 2065 of file inventory.c.

2065 {
2066 PlayerData* playerData = &gPlayerData;
2067 s16 newCoins = playerData->coins + amt;
2068
2069 playerData->coins = newCoins;
2070 if (newCoins > 999) {
2071 playerData->coins = 999;
2072 }
2073 if (playerData->coins < 0) {
2074 playerData->coins = 0;
2075 }
2076
2077 if (amt > 0) {
2078 playerData->totalCoinsEarned += amt;
2079 if (playerData->totalCoinsEarned > 99999) {
2080 playerData->totalCoinsEarned = 99999;
2081 }
2082 }
2083 return playerData->coins;
2084}

◆ add_star_points()

s32 add_star_points ( s32 amt)

Definition at line 2086 of file inventory.c.

2086 {
2087 PlayerData* playerData = &gPlayerData;
2088 s8 newSP = playerData->starPoints + amt;
2089
2090 // TODO: probably a macro!
2091 playerData->starPoints = newSP;
2092 if (newSP > 100) {
2093 playerData->starPoints = 100;
2094 }
2095
2096 // TODO: probably a macro!
2097 newSP = playerData->starPoints;
2098 if (newSP < 0) {
2099 playerData->starPoints = 0;
2100 }
2101 return gPlayerData.starPoints;
2102}

◆ add_star_pieces()

s32 add_star_pieces ( s32 amt)

Definition at line 2104 of file inventory.c.

2104 {
2105 PlayerData* playerData = &gPlayerData;
2106 s32 newSP = playerData->starPieces;
2107
2108 newSP += amt;
2109 if (newSP > MAX_STAR_PIECES) {
2110 newSP = MAX_STAR_PIECES;
2111 }
2112 if (newSP < 0) {
2113 newSP = 0;
2114 }
2115 playerData->starPieces = newSP;
2116
2117 if (amt > 0) {
2118 playerData->starPiecesCollected += amt;
2119 }
2120
2121 return playerData->starPieces;
2122}
#define MAX_STAR_PIECES
Definition macros.h:100

◆ increment_max_star_power()

void increment_max_star_power ( void )

Definition at line 2124 of file inventory.c.

◆ set_max_star_power()

void set_max_star_power ( s8 newMax)

Definition at line 2129 of file inventory.c.

2129 {
2130 gPlayerData.maxStarPower = newMax;
2131 gPlayerData.starPower = newMax * SP_PER_BAR;
2132}

◆ add_star_power()

void add_star_power ( s32 amt)

Definition at line 2134 of file inventory.c.

2134 {
2135 PlayerData* playerData = &gPlayerData;
2136 StatusBar* statusBar = &gStatusBar;
2137 s32 maxPower;
2138
2139 statusBar->unk_57 = 1;
2140 statusBar->unk_58 = 60;
2141
2142 if (playerData->starPower < 0) {
2143 statusBar->unk_59 = (playerData->starPower + 31) / SP_PER_SEG;
2144 } else {
2145 statusBar->unk_59 = playerData->starPower / SP_PER_SEG;
2146 }
2147
2148 playerData->starPower += amt;
2149
2150 maxPower = playerData->maxStarPower * SP_PER_BAR;
2151 if (playerData->starPower > maxPower) {
2152 playerData->starPower = maxPower;
2153 }
2154
2156}
#define SP_PER_SEG
Definition macros.h:103

◆ recover_fp()

s32 recover_fp ( s32 amt)

Recover player FP.

Parameters
amtthe amount to recover, -1 for full, -2 for full and increase max by 1 (unused)
Returns
the new FP value, after recovery has been applied

Definition at line 2158 of file inventory.c.

2158 {
2159 if (amt == -2) {
2162 } else if (amt == -1) {
2164 } else {
2165 if (amt > 0) {
2166 gPlayerData.curFP += amt;
2167 }
2170 }
2171 }
2172 return gPlayerData.curFP;
2173}

Referenced by entity_HeartBlockContent__anim_heal().

◆ recover_hp()

s32 recover_hp ( s32 amt)

Recover player HP.

Parameters
amtthe amount to recover, -1 for full, -2 for full and increase max by 1 (unused)
Returns
the new HP value, after recovery has been applied

Definition at line 2175 of file inventory.c.

2175 {
2176 if (amt == -2) {
2179 } else if (amt == -1) {
2181 } else {
2182 if (amt > 0) {
2183 gPlayerData.curHP += amt;
2184 }
2187 }
2188 }
2189 return gPlayerData.curHP;
2190}

Referenced by entity_HeartBlockContent__anim_heal().

◆ subtract_hp()

void subtract_hp ( s32 amt)

Definition at line 2192 of file inventory.c.

2192 {
2193 PlayerData* playerData = &gPlayerData;
2194 s32 newHP = playerData->curHP;
2195
2196 if (amt > 0) {
2197 newHP -= amt;
2198 }
2199 if (amt < 0 || newHP < 1) {
2200 newHP = 1;
2201 }
2202 playerData->curHP = newHP;
2203}

Referenced by action_update_hit_fire(), action_update_hit_lava(), and func_802BC274_E2EBA4().

◆ has_full_hp()

s8 has_full_hp ( void )

Definition at line 2205 of file inventory.c.

2205 {
2207}

◆ has_full_fp()

s8 has_full_fp ( void )

Definition at line 2209 of file inventory.c.

2209 {
2211}

Variable Documentation

◆ D_8010CD10

◆ D_8010CD12

BSS b16 D_8010CD12

◆ gStatusBar

◆ TimesHudScript

HudScript* TimesHudScript
extern

Definition at line 146 of file partners.c.

Referenced by status_bar_draw_number().

◆ SPIncrementHudScripts

HudScript* SPIncrementHudScripts[]
extern

Definition at line 148 of file partners.c.

148 {
151};
HudScript HES_StatusSPIncrement6
HudScript HES_StatusSPIncrement4
HudScript HES_StatusSPIncrement3
HudScript HES_StatusSPIncrement7
HudScript HES_StatusSPIncrement5
HudScript HES_StatusSPIncrement2
HudScript HES_StatusSPIncrement1

Referenced by update_status_bar().

◆ SPStarHudScripts

HudScript* SPStarHudScripts[]
extern

Definition at line 152 of file partners.c.

154};
HudScript HES_StatusStar1
HudScript HES_StatusStar2
HudScript HES_StatusStar3
HudScript HES_StatusStar7
HudScript HES_StatusStar5
HudScript HES_StatusStar6
HudScript HES_StatusStar4

Referenced by update_status_bar().

◆ StatusBarSPIncrementOffsets

s32 StatusBarSPIncrementOffsets[]
extern

Definition at line 156 of file partners.c.

156{ -1, 1, 2, 4, 5, 7, 8, 0, 0, 0 };

Referenced by update_status_bar().

◆ DigitHudScripts

HudScript* DigitHudScripts[10]
extern

Definition at line 142 of file partners.c.

142 {
145};
HudScript HES_StatusDigit6
HudScript HES_StatusDigit1
HudScript HES_StatusDigit8
HudScript HES_StatusDigit3
HudScript HES_StatusDigit5
HudScript HES_StatusDigit2
HudScript HES_StatusDigit7
HudScript HES_StatusDigit9
HudScript HES_StatusDigit0
HudScript HES_StatusDigit4

Referenced by status_bar_draw_number(), and status_bar_draw_stat().

◆ HES_StatusCoinSparkle

HudScript HES_StatusCoinSparkle
extern

Definition at line 2112 of file global_hud_scripts.c.

2112 {
2121 hs_End
2122};
HudScript HES_CoinSparkleB
HudScript HES_CoinSparkleA
HudScript HES_CoinSparkleC
HudScript HES_CoinSparkleE
HudScript HES_CoinSparkleD
#define hs_RandomBranch(args...)
#define hs_SetTileSize(size)
#define hs_SetVisible
#define hs_End
#define HS_PTR(sym)
@ HUD_ELEMENT_SIZE_8x8
Definition hud_element.h:45

Referenced by initialize_status_bar().

◆ HES_StatusHP

HudScript HES_StatusHP
extern

Definition at line 2014 of file global_hud_scripts.c.

Referenced by initialize_status_bar().

◆ HES_StatusHP_de

HudScript HES_StatusHP_de
extern

Referenced by initialize_status_bar().

◆ HES_StatusHP_fr

HudScript HES_StatusHP_fr
extern

Referenced by initialize_status_bar().

◆ HES_StatusHP_es

HudScript HES_StatusHP_es
extern

Referenced by initialize_status_bar().

◆ HES_StatusHeart

HudScript HES_StatusHeart
extern

Definition at line 2061 of file global_hud_scripts.c.

2061 {
2063 hs_Loop
2064 hs_SetRGBA(60, ui_stat_heart_png)
2066 hs_End
2067};
#define hs_SetRGBA(time, image)
#define hs_Restart
#define hs_Loop
@ HUD_ELEMENT_SIZE_16x16
Definition hud_element.h:46

Referenced by initialize_status_bar().

◆ HES_StatusFP

HudScript HES_StatusFP
extern

Definition at line 2016 of file global_hud_scripts.c.

Referenced by initialize_status_bar().

◆ HES_StatusFP_de

HudScript HES_StatusFP_de
extern

Referenced by initialize_status_bar().

◆ HES_StatusFP_fr

HudScript HES_StatusFP_fr
extern

Referenced by initialize_status_bar().

◆ HES_StatusFP_es

HudScript HES_StatusFP_es
extern

Referenced by initialize_status_bar().

◆ HES_StatusFlower

HudScript HES_StatusFlower
extern

Definition at line 2069 of file global_hud_scripts.c.

2069 {
2071 hs_Loop
2072 hs_SetRGBA(60, ui_stat_flower_png)
2074 hs_End
2075};

Referenced by initialize_status_bar().

◆ HES_StatusStarPoint

HudScript HES_StatusStarPoint
extern

Definition at line 2124 of file global_hud_scripts.c.

2124 {
2127 hs_Loop
2128 hs_SetCI(2, ui_status_star_point_0)
2129 hs_SetCI(2, ui_status_star_point_1)
2130 hs_SetCI(2, ui_status_star_point_2)
2131 hs_SetCI(2, ui_status_star_point_3)
2132 hs_SetCI(2, ui_status_star_point_4)
2133 hs_SetCI(2, ui_status_star_point_5)
2134 hs_SetCI(2, ui_status_star_point_6)
2135 hs_SetCI(2, ui_status_star_point_7)
2137 hs_End
2138};
#define hs_SetCI(time, name)

Referenced by initialize_status_bar().

◆ HES_StatusStar1

HudScript HES_StatusStar1
extern

Definition at line 2045 of file global_hud_scripts.c.

Referenced by initialize_status_bar().

◆ HES_StatusTimes

HudScript HES_StatusTimes
extern

Definition at line 1990 of file global_hud_scripts.c.

Referenced by initialize_status_bar().

◆ HES_StatusSPShine

HudScript HES_StatusSPShine
extern

Definition at line 762 of file global_hud_scripts.c.

762 {
765 hs_Loop
766 hs_SetRGBA(60, ui_status_star_point_shine_png)
768 hs_End
769};
#define hs_UseIA8
@ HUD_ELEMENT_SIZE_24x24
Definition hud_element.h:47

Referenced by initialize_status_bar().

◆ HES_StatusSPEmptyIncrement

HudScript HES_StatusSPEmptyIncrement
extern

Definition at line 2043 of file global_hud_scripts.c.

Referenced by update_status_bar().

◆ HES_StatusStarEmpty

HudScript HES_StatusStarEmpty
extern

Definition at line 2059 of file global_hud_scripts.c.

Referenced by update_status_bar().

◆ SlashHudScript

HudScript* SlashHudScript
extern

Definition at line 147 of file partners.c.

Referenced by status_bar_draw_stat().