Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
popup_messages.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "entity.h"
4#include "battle/battle.h"
5#include "battle/action_cmd.h"
6#include <stdlib.h>
7
8typedef struct BonkData {
9 /* 0x00 */ b32 alive;
11 /* 0x08 */ Vec3f accel;
12 /* 0x14 */ Vec3f vel;
13 /* 0x20 */ s32 moveTime;
14 /* 0x24 */ s32 startupTime;
15 /* 0x28 */ f32 rotZ;
16 /* 0x2C */ f32 rotVelZ;
17 /* 0x30 */ f32 rotY;
18 /* 0x34 */ f32 scale;
19 /* 0x38 */ Vec3f pos;
20 /* 0x44 */ s32 holdTime;
21 /* 0x48 */ f32 alpha; // unused
22} BonkData; // size = 0x4C
23
24#if VERSION_JP
25s8 D_8028374C_1BA13C[][4] = {
26 { 236, 0, 0, 0 }, { 204, 0, 0, 0 }, { 238, 0, 0, 0 }, { 248, 0, 0, 0 }, { 252, 0, 0, 0 },
27 { 252, 0, 0, 0 }, { 252, 0, 0, 0 }, { 252, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
28 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
29 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
30 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
31 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
32 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
33 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
34 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
35 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
36 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
37 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
38 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
39 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
40 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
41 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
42 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
43};
44#else
45 // all keyed by number of lines in the message (1 or 2)
49#endif
50
52 { 0.0f, 4.5f, 0.0f },
53 { 1.0f, 4.0f, 0.0f },
54 { 2.0f, 3.0f, 0.0f },
55 { 3.0f, 2.0f, 0.0f },
56 { 3.5f, 1.0f, 0.0f },
57 { 4.0f, 0.0f, 0.0f },
58 { 4.5f, 0.0f, 0.0f },
59 { 5.0f, 0.0f, 0.0f },
60 { 4.5f, 0.0f, 0.0f },
61 { 4.0f, 0.0f, 0.0f },
62 { 3.5f, -1.0f, 0.0f },
63 { 3.0f, -2.0f, 0.0f },
64 { 2.0f, -3.0f, 0.0f },
65 { 1.0f, -4.0f, 0.0f },
66 { 0.0f, -4.5f, 0.0f },
67};
68
70 { 1.0f, 1.0f, 1.0f },
71 { 0.8f, 0.8f, 0.8f },
72 { 0.9f, 0.9f, 0.9f },
73 { 1.1f, 1.1f, 1.1f },
74 { 1.0f, 1.0f, 1.0f },
75 { 0.8f, 0.8f, 0.8f },
76 { 0.9f, 0.9f, 0.9f },
77 { 1.1f, 1.1f, 1.1f },
78 { 1.0f, 1.0f, 1.0f },
79 { 0.8f, 0.8f, 0.8f },
80 { 0.9f, 0.9f, 0.9f },
81 { 1.1f, 1.1f, 1.1f },
82 { 1.0f, 1.0f, 1.0f },
83 { 0.8f, 0.8f, 0.8f },
84 { 0.9f, 0.9f, 0.9f },
85};
86
88
94
106
107 // player status effects
116
117 // enemy status effects
126
134
148
149 // move action command tips
171
172 // no targets available
176#if VERSION_JP
179#else
182#endif
183
184 // errors and warnings
198};
199
200#if VERSION_JP
201s32 D_80283B88_1BA578[] = { 1, 1, 1, 1, 1, 1, 1, 1 };
202s32 D_80283BA8_1BA598[] = { 0, 0, 0, 0, 1, 0, 0, 0 };
203#endif
204
220
222
232#if !VERSION_JP
234#endif
235
259
260void btl_bonk_update(void* data);
261void btl_bonk_render(void* data);
262void btl_bonk_setup_gfx(void* data);
264void btl_show_message_popup(void* popup);
265
267 s32 i;
268
269 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
271 popup->active = FALSE;
272 popup->data.bonk = NULL;
273 }
274}
275
277 s32 i;
278
279 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
281 if (popup->data.bonk != NULL) {
282 heap_free(popup->data.bonk);
283 popup->data.bonk = NULL;
284 }
285 popup->active = FALSE;
286 }
287}
288
290 s32 i;
291
292 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
294 if (popup->active && popup->updateFunc != NULL) {
296 }
297 }
298}
299
301 s32 i;
302
303 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
305 if (popup->active && popup->renderWorldFunc != NULL) {
307 }
308 }
309}
310
312 s32 i;
313
314 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
316 if (popup->active && popup->renderUIFunc != NULL) {
318 }
319 }
320}
321
323 s32 i;
324
325 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
327 if (!popup->active) {
328 popup->active = TRUE;
329 return popup;
330 }
331 }
332
333 return NULL;
334}
335
337 if (popup->data.bonk != NULL) {
338 heap_free(popup->data.bonk);
339 popup->data.bonk = NULL;
340 }
341 popup->active = FALSE;
342}
343
344void show_immune_bonk(f32 x, f32 y, f32 z, s32 numStars, s32 startupTime, s32 animDir) {
349 f32 baseScale;
352 s32 sign;
353 s32 i;
354
356 if (popup == NULL) {
357 // unable to create popup
358 return;
359 }
360
361 if (numStars < 1) {
362 numStars = 1;
363 baseScale = 0.4f;
364 timescale = 0.7f;
366 } else {
367 baseScale = 1.0f;
368 timescale = 1.0f;
370 }
371
373 baseScale *= 2.0;
374 }
375
376 if (animDir < 0) {
377 sign = -1;
378 } else {
379 sign = 1;
380 }
381
382 animDir = abs(animDir) % 5;
383
384 battleStatus->unk_90 = 0;
385 popup->updateFunc = btl_bonk_update;
386 popup->renderWorldFunc = btl_bonk_render;
387 popup->unk_00 = FALSE;
388 popup->renderUIFunc = NULL;
389 popup->messageIndex = 1;
390 popup->active |= 0x10;
391 bonkData = popup->data.bonk = heap_malloc(numStars * sizeof(*popup->data.bonk));
392 ASSERT (popup->data.bonk != NULL);
393
394 for (i = 0; i < numStars; i++) {
395 bonkData->alive = TRUE;
399 bonkData->pos.x = x;
400 bonkData->pos.y = y;
401 bonkData->pos.z = z;
402 bonkPosIdx = animDir % 8;
403 animDir++;
404
408 bonkData->vel.x = 2.0 * bonkData->accel.x;
409 bonkData->vel.y = 2.0 * bonkData->accel.y;
410 bonkData->vel.z = 2.0 * bonkData->accel.z;
411
412 bonkData->scale = BonkAnimScale[i % 8].x * baseScale;
413 bonkData->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].curYaw);
414 bonkData->rotZ = 0;
415 bonkData->rotVelZ = sign * 107;
416
417 bonkData->startupTime = startupTime;
418 bonkData->moveTime = 14;
419 bonkData->holdTime = 240;
420 if (hasShortLifetime) {
421 bonkData->holdTime = 10;
422 }
423
424 bonkData->alpha = 255.0f;
425 bonkData++;
426 }
427}
428
429void btl_bonk_update(void* data) {
430 PopupMessage* popup = data;
431 BonkData* bonkData = popup->data.bonk;
432 s32 allDone = TRUE;
433 s32 i;
434
435 for (i = 0; i < popup->messageIndex; i++, bonkData++) {
436 if (bonkData->alive) {
438
439 allDone = FALSE;
440 if (bonkData->startupTime != 0) {
441 bonkData->startupTime--;
442 if (bonkData->startupTime == 0) {
444 }
446 break;
447 }
448
450 if (bonkData->moveTime >= 0) {
451 bonkData->pos.x += bonkData->vel.x;
452 bonkData->pos.y += bonkData->vel.y;
453 bonkData->pos.z += bonkData->vel.z;
454 }
455 bonkData->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].curYaw);
456 bonkData->rotZ += bonkData->rotVelZ;
457 bonkData->rotZ = clamp_angle(bonkData->rotZ);
458 bonkData->rotVelZ *= 0.8;
459 if (bonkData->moveTime < 10) {
460 bonkData->accel.x *= 0.5;
461 bonkData->accel.y *= 0.5;
462 bonkData->accel.z *= 0.5;
463 bonkData->vel.x = bonkData->accel.x;
464 bonkData->vel.y = bonkData->accel.y;
465 bonkData->vel.z = bonkData->accel.z;
466 }
467
468 bonkData->moveTime--;
469 if (bonkData->moveTime < 0) {
470 bonkData->holdTime--;
471 if (bonkData->holdTime < 0) {
473 bonkData->alive = FALSE;
474 }
475 }
476 }
477 }
478
479 if (allDone) {
480 heap_free(popup->data.bonk);
481 popup->data.bonk = NULL;
483 }
484}
485
486void btl_bonk_render(void* data) {
487 PopupMessage* popup = data;
488 BonkData* bonkData = popup->data.bonk;
497 Mtx sp218;
498 s32 i;
499
500 for (i = 0; i < popup->messageIndex; i++, bonkData++) {
501 if (bonkData->alive) {
502 if (bonkData->startupTime != 0) {
503 break;
504 } else {
505 guTranslateF(sp18, bonkData->pos.x, bonkData->pos.y, bonkData->pos.z);
506 guRotateF(mtxRotX, 0.0f, 1.0f, 0.0f, 0.0f);
507 guRotateF(mtxRotY, bonkData->rotY, 0.0f, 1.0f, 0.0f);
508 guRotateF(mtxRotZ, bonkData->rotZ, 0.0f, 0.0f, 1.0f);
509 guScaleF(mtxScale, bonkData->scale, bonkData->scale, bonkData->scale);
515 draw_entity_model_A(bonkData->entityModelIndex, &sp218);
516 }
517 }
518 }
519}
520
521void btl_bonk_setup_gfx(void* data) {
522 BonkData* bonkData = data;
523 s32 alphaAmt = bonkData->holdTime;
524
525 if (alphaAmt > 10) {
526 alphaAmt = 10;
527 }
528 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, (alphaAmt * 255) / 10);
529}
530
532 s32 i;
533
534 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
536
537 if (popup->active != 0 && (popup->active & 0x10)) {
538 BonkData* bonkData = popup->data.bonk;
539 s32 j;
540
541 for (j = 0; j < popup->messageIndex; j++, bonkData++) {
542 if (bonkData->alive) {
544 bonkData->moveTime = 1;
545 bonkData->holdTime = 20;
546 }
547 }
548 }
549 }
550}
551
552API_CALLABLE(ShowImmuneBonk) {
553 Bytecode* args = script->ptrReadPos;
554 s32 x = evt_get_variable(script, *args++);
555 s32 y = evt_get_variable(script, *args++);
556 s32 z = evt_get_variable(script, *args++);
558 s32 startupTime = evt_get_variable(script, *args++);
559 s32 arg6 = evt_get_variable(script, *args++);
560
561 show_immune_bonk(x, y, z, numStars, startupTime, arg6);
562 return ApiStatus_DONE2;
563}
564
565API_CALLABLE(ForceImmuneBonkCleanup) {
567 return ApiStatus_DONE2;
568}
569
570// show a popup message bubble with a message selected from BattleMessages
571void btl_show_battle_message(s32 messageIndex, s32 duration) {
573
574 if (popup != NULL) {
575 popup->updateFunc = btl_update_message_popup;
576 popup->renderUIFunc = btl_show_message_popup;
577 popup->unk_00 = FALSE;
578 popup->renderWorldFunc = NULL;
579 popup->messageIndex = messageIndex;
580 popup->duration = duration;
581 popup->showMsgState = BTL_MSG_STATE_INIT;
582 popup->needsInit = TRUE;
583 popup->data.bonk = NULL;
589#if !VERSION_JP
591#endif
592 }
593}
594
595// show a popup message bubble with a message selected from BattleMessages
596void btl_show_variable_battle_message(s32 messageIndex, s32 duration, s32 varValue) {
598
599 if (popup != NULL) {
600 popup->updateFunc = btl_update_message_popup;
601 popup->renderUIFunc = btl_show_message_popup;
602 popup->unk_00 = FALSE;
603 popup->renderWorldFunc = NULL;
604 popup->messageIndex = messageIndex;
605 popup->duration = duration;
606 popup->showMsgState = BTL_MSG_STATE_INIT;
607 popup->needsInit = TRUE;
608 popup->data.bonk = NULL;
614#if !VERSION_JP
616#endif
617 }
618}
619
621 return bPopupMessage != NULL;
622}
623
626
628 popup->duration = duration;
629 }
630}
631
635
639
642
643 if (popup != NULL
644 && popup->messageIndex <= BTL_MSG_LAST_ACTION_TIP
645 && popup->messageIndex >= BTL_MSG_FIRST_ACTION_TIP
646 ) {
647 popup->duration = 0;
648 }
649}
650
651void btl_update_message_popup(void* data) {
652 PopupMessage* popup = data;
655
656 s32 actionCommandMode;
657
658 switch (popup->messageIndex) {
690 case BTL_MSG_HEAL_ONE:
691 case BTL_MSG_HEAL_ALL:
710 switch (popup->showMsgState) {
711 default:
712 break;
714 popup->showMsgState = BTL_MSG_STATE_POPUP_PRE_DELAY;
715 break;
717 popup->showMsgState = BTL_MSG_STATE_POPUP_DELAY;
718 break;
720 if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) {
721 popup->duration = 0;
722 }
723
724 if (popup->duration != 0) {
725 popup->duration--;
726 } else {
728 }
729 break;
731 popup->showMsgState = BTL_MSG_STATE_POPUP_DISPOSE;
732 break;
735 break;
736 }
737 break;
738 // move action command tips
760 actionCommandMode = battleStatus->actionCommandMode;
762 if (actionCommandMode == AC_MODE_NOT_LEARNED) {
765 break;
766 }
767
768 switch (popup->showMsgState) {
772 switch (popup->messageIndex) {
777 break;
782
786 break;
791
796 break;
801
805
809
813 break;
818 break;
823
827
831 break;
836 break;
841
845 break;
853 break;
858
862 break;
867
871 break;
876
881
886 break;
892 // fallthrough
903 break;
904 }
906 break;
911 popup->duration = 0;
913 break;
914 }
915
917 && (actionCommandMode != AC_MODE_TUTORIAL)
918 ) {
920 switch (popup->messageIndex) {
923 break;
926 break;
930 break;
934 break;
940 break;
943 break;
948 break;
951 break;
955 break;
959 break;
963 break;
966 break;
970 break;
973 break;
976 break;
980 // fallthrough
986 break;
987 }
988 if (popup->duration != -1) {
989 popup->duration = 30;
990 }
992 break;
993 }
994 break;
996 if ((actionCommandMode != AC_MODE_TUTORIAL)
998 ) {
999 if (BattleMessage_CurBoxPosY < 192) {
1002 if (BattleMessage_CurBoxPosY > 192) {
1004 }
1005 } else {
1006 break;
1007 }
1008 }
1009
1010#if VERSION_JP
1012#else
1014#endif
1015
1016 if (popup->duration == -1) {
1017 break;
1018 }
1019
1020 if (popup->duration != 0) {
1021 popup->duration--;
1022 break;
1023 }
1024
1025 switch (popup->messageIndex) {
1039 break;
1048 break;
1054 break;
1060 break;
1061 }
1064 }
1065 break;
1066 }
1067 break;
1071 case BTL_MSG_46:
1072 case BTL_MSG_47:
1074 switch (popup->showMsgState) {
1075 default:
1076 break;
1077 case BTL_MSG_STATE_INIT:
1078 popup->showMsgState = BTL_MSG_STATE_ERROR_PRE_DELAY;
1079 break;
1081 popup->showMsgState = BTL_MSG_STATE_ERROR_DELAY;
1082 break;
1084 if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) {
1085 popup->duration = 0;
1086 }
1087
1088 if (popup->duration != 0) {
1089 popup->duration--;
1090 } else {
1091 popup->showMsgState = BTL_MSG_STATE_ERROR_POST_DELAY;
1092 }
1093 break;
1095 popup->showMsgState = BTL_MSG_STATE_ERROR_DISPOSE;
1096 break;
1099 break;
1100 }
1101 break;
1109 switch (popup->showMsgState) {
1110 case BTL_MSG_STATE_INIT:
1111 switch (popup->messageIndex) {
1116 break;
1121 break;
1126 break;
1131 break;
1136 break;
1141 break;
1146 break;
1147 }
1148 popup->showMsgState = BTL_MSG_STATE_DISABLED_DELAY;
1149 break;
1151 if (popup->duration != 0) {
1152 popup->duration--;
1153 break;
1154 }
1157 break;
1158 }
1159 break;
1160 }
1161 if (shouldDisposeWindow) {
1165 }
1166}
1167
1168#if VERSION_IQUE
1169#define TIP_X_PRL 83
1170#define TIP_X_HLT1 44
1171#define TIP_X_HLT2 67
1172#define TIP_X_PBST 124
1173#define TIP_X_MB 70
1174#define TIP_X_ML 69
1175#define TIP_X_HLA1 43
1176#define TIP_X_HLA2 177
1177#define TIP_X_PBS1 105
1178#define TIP_X_PBS2 83
1179#define TIP_X_PBS3 127
1180#define TIP_X_PWT1 40
1181#define TIP_X_PWT2 106
1182#define TIP_X_MB1 95
1183#define TIP_X_MB2 116
1184#define TIP_X_HTT 58
1185#define TIP_X_HTR1 39
1186#define TIP_X_HTR2 55
1187#define TIP_X_MTA1 53
1188#define TIP_X_MTA2 55
1189#define TIP_X_MTA3 108
1190#define TIP_X_BF_RD 66
1191#define TIP_Y_HLT2 31
1192#define TIP_Y_HLA2 17
1193#define TIP_Y_PBS1 14
1194#define TIP_Y_PBS2 14
1195#define TIP_Y_PBS3 14
1196#define TIP_Y_PWT1 14
1197#define TIP_Y_HTR1 31
1198#define TIP_Y_MTA1 14
1199#define TIP_Y_MTA2 32
1200#define TIP_Y_BF_RD 14
1201#define TIP_SCALE1 0.6f
1202#define TIP_SCALE2 0.7f
1203#elif VERSION_JP
1204#define TIP_X_PRL 115
1205#define TIP_X_HLT1 29
1206#define TIP_X_HLT2 129
1207#define TIP_X_PBST 126
1208#define TIP_X_MB 28
1209#define TIP_X_ML 28
1210#define TIP_X_HLA1 29
1211#define TIP_X_HLA2 128
1212#define TIP_X_PBS1 111
1213#define TIP_X_PBS2 88
1214#define TIP_X_PBS3 134
1215#define TIP_X_PWT1 28
1216#define TIP_X_PWT2 160
1217#define TIP_X_MB1 20
1218#define TIP_X_MB2 43
1219#define TIP_X_HTT 29
1220#define TIP_X_HTR1 126
1221#define TIP_X_HTR2 28
1222#define TIP_X_MTA1 29
1223#define TIP_X_MTA2 153
1224#define TIP_X_MTA3 68
1225#define TIP_X_BF_RD 29
1226#define TIP_Y_HLT2 13
1227#define TIP_Y_HLA2 15
1228#define TIP_Y_PBS1 13
1229#define TIP_Y_PBS2 13
1230#define TIP_Y_PBS3 13
1231#define TIP_Y_PWT1 13
1232#define TIP_Y_HTR1 13
1233#define TIP_Y_MTA1 13
1234#define TIP_Y_MTA2 15
1235#define TIP_Y_BF_RD 13
1236#define TIP_SCALE1 0.8f
1237#define TIP_SCALE2 0.8f
1238#else
1239#define TIP_X_PRL 65
1240#define TIP_X_HLT1 55
1241#define TIP_X_HLT2 73
1242#define TIP_X_PBST 64
1243#define TIP_X_MB 67
1244#define TIP_X_ML 56
1245#define TIP_X_HLA1 65
1246#define TIP_X_HLA2 146
1247#define TIP_X_PBS1 86
1248#define TIP_X_PBS2 64
1249#define TIP_X_PBS3 108
1250#define TIP_X_PWT1 105
1251#define TIP_X_PWT2 65
1252#define TIP_X_MB1 63
1253#define TIP_X_MB2 84
1254#define TIP_X_HTT 124
1255#define TIP_X_HTR1 56
1256#define TIP_X_HTR2 53
1257#define TIP_X_MTA1 107
1258#define TIP_X_MTA2 210
1259#define TIP_X_MTA3 56
1260#define TIP_X_BF_RD 64
1261#define TIP_Y_HLT2 31
1262#define TIP_Y_HLA2 32
1263#define TIP_Y_PBS1 13
1264#define TIP_Y_PBS2 13
1265#define TIP_Y_PBS3 13
1266#define TIP_Y_PWT1 13
1267#define TIP_Y_HTR1 31
1268#define TIP_Y_MTA1 13
1269#define TIP_Y_MTA2 15
1270#define TIP_Y_BF_RD 13
1271#define TIP_SCALE1 0.8f
1272#define TIP_SCALE2 0.8f
1273#endif
1274
1276 PopupMessage* popup = data;
1277 s32 messageID;
1279 s32 opacity;
1280
1281#if VERSION_JP
1282 x += 11 + D_8028374C_1BA13C[popup->messageIndex][2];
1283 y += 6 + D_8028374C_1BA13C[popup->messageIndex][3];
1284#else
1285 x += 15;
1286 y += 6;
1287#endif
1288
1289 switch (popup->messageIndex) {
1329 case BTL_MSG_46:
1330 case BTL_MSG_47:
1333#if VERSION_JP
1334 case BTL_MSG_CANT_MOVE:
1335#endif
1339 messageID = BattleMessages[popup->messageIndex];
1340#if !VERSION_JP
1343#endif
1344 draw_msg(messageID, x, y, 255, MSG_PAL_0F, 0);
1345 break;
1350 case BTL_MSG_ATTACK_UP:
1351 case BTL_MSG_DEFENCE_UP:
1352 case BTL_MSG_HEAL_ONE:
1353 case BTL_MSG_HEAL_ALL:
1356 messageID = BattleMessages[popup->messageIndex];
1357#if !VERSION_JP
1360#endif
1362 draw_msg(messageID, x, y, 255, MSG_PAL_0F, 0);
1363 break;
1364#if !VERSION_JP
1365 case BTL_MSG_CANT_MOVE:
1366 messageID = BattleMessages[popup->messageIndex];
1370 draw_msg(messageID, x, y, 255, MSG_PAL_0F, 0);
1371 break;
1372#endif
1380 messageID = BattleMessages[popup->messageIndex];
1381 draw_msg(messageID, x + 29, y + 6, 255, MSG_PAL_0F, 0);
1384 break;
1406 opacity = 255;
1407 if (popup->showMsgState < BTL_MSG_STATE_ACTION_TIP_DISPOSE) {
1408 opacity = 160;
1409 }
1410 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1411 opacity = 255;
1412 }
1413
1414 x -= 11;
1415 y -= 6;
1416 messageID = BattleMessages[popup->messageIndex];
1417#if !VERSION_JP
1420#endif
1421 draw_msg(messageID, x + 11, y + 6, opacity, MSG_PAL_0F, 0);
1422
1423 switch (popup->messageIndex) {
1429 break;
1435
1439 break;
1445 break;
1451 break;
1457 break;
1463
1468 break;
1469#if VERSION_JP
1475
1480
1485
1490 break;
1496 break;
1497#endif
1503
1508
1513 break;
1514#if VERSION_JP
1520 break;
1521#endif
1526
1531 break;
1532#if VERSION_JP
1538
1543 break;
1544#endif
1550
1555 break;
1556#if VERSION_JP
1562 break;
1563#endif
1569 break;
1574
1579 break;
1585
1590
1595 break;
1596#if VERSION_JP
1602 break;
1603#endif
1610 break;
1611#if VERSION_JP
1617 break;
1618#endif
1619 }
1620 break;
1621 }
1622}
1623
1624void btl_show_message_popup(void* data) {
1625 PopupMessage* popup = data;
1626 s32 numLines;
1627 s32 posX;
1628 s32 posY = 80;
1629 s32 width;
1630 s32 msgWidth;
1631 s32 height;
1632
1633#if VERSION_JP
1634 switch (popup->messageIndex) {
1655 case BTL_MSG_46:
1656 case BTL_MSG_47:
1661 if (popup->needsInit) {
1663 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1664 posX = 160 - (msgWidth / 2);
1665 width = msgWidth;
1666 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1669 }
1670 break;
1675 if (popup->needsInit) {
1676 popup->needsInit = FALSE;
1677 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1678 posX = 160 - (msgWidth / 2);
1679 width = msgWidth;
1680 height = 45 + D_8028374C_1BA13C[popup->messageIndex][1];
1683 }
1684 break;
1706 if (popup->needsInit) {
1707 popup->needsInit = FALSE;
1708 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1709 posX = 160 - (msgWidth / 2);
1710 width = msgWidth;
1711 posY = 192;
1712 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1713 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1714 posY = 120;
1716 }
1718
1720 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1722 } else {
1724 }
1725 }
1726 break;
1734 if (popup->needsInit) {
1735 popup->needsInit = FALSE;
1736 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (55 + D_8028374C_1BA13C[popup->messageIndex][0]);
1737 posX = 160 - (msgWidth / 2);
1738 width = msgWidth;
1739 height = 40 + D_8028374C_1BA13C[popup->messageIndex][1];
1742 }
1743 break;
1752 if (popup->needsInit) {
1753 popup->needsInit = FALSE;
1754 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1755 posX = 160 - (msgWidth / 2);
1756 width = msgWidth;
1757 if (D_80283B88_1BA578[popup->messageIndex - 10] != 0) {
1758 height = 45 + D_8028374C_1BA13C[popup->messageIndex][1];
1759 } else {
1760 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1761 }
1762
1765 }
1766 break;
1775 if (popup->needsInit) {
1776 popup->needsInit = FALSE;
1777 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1778 posX = 160 - (msgWidth / 2);
1779 width = msgWidth;
1780 if (D_80283BA8_1BA598[popup->messageIndex - 18] != 0) {
1781 height = 45 + D_8028374C_1BA13C[popup->messageIndex][1];
1782 } else {
1783 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1784 }
1785
1788 }
1789 break;
1794 case BTL_MSG_ATTACK_UP:
1795 case BTL_MSG_DEFENCE_UP:
1796 case BTL_MSG_HEAL_ONE:
1797 case BTL_MSG_HEAL_ALL:
1800 if (popup->needsInit) {
1801 s32 messageID;
1802
1803 popup->needsInit = FALSE;
1804 messageID = BattleMessages[popup->messageIndex];
1806 msgWidth = get_msg_width(messageID, 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1807 posX = 160 - (msgWidth / 2);
1808 width = msgWidth;
1809 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1812 }
1813 break;
1814 case BTL_MSG_CANT_MOVE:
1815 if (popup->needsInit) {
1816 s32 messageID;
1817
1818 popup->needsInit = FALSE;
1819 messageID = BattleMessages[popup->messageIndex];
1821 msgWidth = get_msg_width(messageID, 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1822 posX = 160 - (msgWidth / 2);
1823 width = msgWidth;
1824 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1827 }
1828 break;
1829 }
1830#else
1831 switch (popup->messageIndex) {
1871 case BTL_MSG_46:
1872 case BTL_MSG_47:
1878 if (popup->needsInit) {
1879 s32 messageID;
1880
1881 popup->needsInit = FALSE;
1882 messageID = BattleMessages[popup->messageIndex];
1883 msgWidth = get_msg_width(messageID, 0) + 30;
1884 posX = 160 - (msgWidth / 2);
1885 width = msgWidth;
1886 numLines = get_msg_lines(messageID) - 1;
1887 height = BattleMessage_BoxSizesY[numLines];
1890 }
1891 break;
1899 if (popup->needsInit) {
1900 popup->needsInit = FALSE;
1901 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + 55;
1902 posX = 160 - (msgWidth / 2);
1903 width = msgWidth;
1904 height = 40;
1907 }
1908 break;
1913 case BTL_MSG_ATTACK_UP:
1914 case BTL_MSG_DEFENCE_UP:
1915 case BTL_MSG_HEAL_ONE:
1916 case BTL_MSG_HEAL_ALL:
1919 if (popup->needsInit) {
1920 s32 messageID;
1921
1922 popup->needsInit = FALSE;
1923 messageID = BattleMessages[popup->messageIndex];
1925 msgWidth = get_msg_width(messageID, 0) + 31;
1926 posX = 160 - (msgWidth / 2);
1927 width = msgWidth;
1928 numLines = get_msg_lines(messageID) - 1;
1929 height = BattleMessage_BoxSizesY[numLines];
1932 }
1933 break;
1934 case BTL_MSG_CANT_MOVE:
1935 if (popup->needsInit) {
1936 s32 messageID;
1937
1938 popup->needsInit = FALSE;
1939 messageID = BattleMessages[popup->messageIndex];
1941 msgWidth = get_msg_width(messageID, 0) + 31;
1942 posX = 160 - (msgWidth / 2);
1943 width = msgWidth;
1944 numLines = get_msg_lines(messageID) - 1;
1945 height = BattleMessage_BoxSizesY[numLines];
1948 }
1949 break;
1971 if (popup->needsInit) {
1972 s32 messageID;
1973
1974 popup->needsInit = FALSE;
1975 messageID = BattleMessages[popup->messageIndex];
1976 msgWidth = get_msg_width(messageID, 0) + 31;
1977 posX = 160 - (msgWidth / 2);
1978 posY = 192;
1979 width = msgWidth;
1980 numLines = get_msg_lines(messageID) - 1;
1981 height = BattleMessage_BoxSizesY[numLines];
1982 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1983 posY = 120;
1985 }
1988
1991 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1993 } else {
1995 }
1996 }
1997 break;
1998 }
1999#endif
2000}
2001
2002API_CALLABLE(ShowMessageBox) {
2003 Bytecode* args = script->ptrReadPos;
2004 s32 messageIndex = evt_get_variable(script, *args++);
2005 s32 duration = evt_get_variable(script, *args++);
2006
2007 btl_show_battle_message(messageIndex, duration);
2008 return ApiStatus_DONE2;
2009}
2010
2011API_CALLABLE(ShowVariableMessageBox) {
2012 Bytecode* args = script->ptrReadPos;
2013 s32 messageIndex = evt_get_variable(script, *args++);
2014 s32 duration = evt_get_variable(script, *args++);
2015 s32 varValue = evt_get_variable(script, *args++);
2016
2017 btl_show_variable_battle_message(messageIndex, duration, varValue);
2018 return ApiStatus_DONE2;
2019}
2020
2021API_CALLABLE(IsMessageBoxDisplayed) {
2022 Bytecode* args = script->ptrReadPos;
2023 s32 outVar = *args++;
2024
2026 return ApiStatus_DONE2;
2027}
2028
2029API_CALLABLE(WaitForMessageBoxDone) {
2031}
2032
2033API_CALLABLE(ForceCloseMessageBox) {
2034 if (bPopupMessage != NULL) {
2036 }
2037 return ApiStatus_DONE2;
2038}
2039
2040API_CALLABLE(SetMessageBoxDuration) {
2042 return ApiStatus_DONE2;
2043}
2044
2045API_CALLABLE(LockMessageBoxPosition) {
2047 return ApiStatus_DONE2;
2048}
2049
2050API_CALLABLE(UnlockMessageBoxPosition) {
2052 return ApiStatus_DONE2;
2053}
2054
2056 ActorPart* part = actor->partsTable;
2057
2058 while (part != NULL) {
2059 if (!(part->flags & ACTOR_PART_FLAG_INVISIBLE)
2060 && part->idleAnimations != NULL
2062 ) {
2063 f32 x = part->curPos.x;
2064 f32 y = part->curPos.y + (actor->size.y / 10);
2065 f32 z = part->curPos.z;
2066 s32 f1 = (part->size.x + (part->size.x / 4)) * actor->scalingFactor;
2067 s32 f2 = (part->size.y - 2) * actor->scalingFactor;
2068
2069 if (actor->flags & ACTOR_FLAG_HALF_HEIGHT) {
2070 y -= actor->size.y / 2;
2071 }
2072
2073 fx_flashing_box_shockwave(0, x, y, z, f1, f2);
2074 }
2075 part = part->nextPart;
2076 }
2077}
BSS s32 PopupMenu_SelectedIndex
HudScript HES_MashBButton1
HudScript HES_BButton
HudScript HES_AButton
HudScript HES_TimingReady
HudScript HES_StickNeutral
HudScript HES_MashAButton
HudScript HES_PressAButton
HudScript HES_StickMashLeft
HudScript HES_AButtonDown
HudScript HES_PressBButton
@ AC_MODE_TUTORIAL
Definition action_cmd.h:62
@ AC_MODE_NOT_LEARNED
Definition action_cmd.h:60
HudScript HES_PressCDownButton
PopupMessageCallback updateFunc
f32 scalingFactor
PopupMessageCallback renderUIFunc
struct ActorPart * partsTable
s32 b32
Vec2bu size
f32 Matrix4f[4][4]
s16 b16
PopupMessageCallback renderWorldFunc
#define guRotateF
#define get_msg_width
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define clamp_angle
#define draw_msg
#define guScaleF
#define ASSERT(condition)
s32 EntityModelScript[]
Definition entity.h:7
s32 load_entity_model(EntityModelScript *cmdList)
@ ENTITY_MODEL_FLAG_HIDDEN
Definition enums.h:4600
@ BTL_MSG_STATE_POPUP_DISPOSE
Definition enums.h:3797
@ BTL_MSG_STATE_POPUP_POST_DELAY
Definition enums.h:3796
@ BTL_MSG_STATE_ERROR_PRE_DELAY
Definition enums.h:3802
@ BTL_MSG_STATE_DISABLED_DELAY
Definition enums.h:3807
@ BTL_MSG_STATE_INIT
Definition enums.h:3792
@ BTL_MSG_STATE_ACTION_TIP_DELAY
Definition enums.h:3799
@ BTL_MSG_STATE_ERROR_POST_DELAY
Definition enums.h:3804
@ BTL_MSG_STATE_ERROR_DISPOSE
Definition enums.h:3805
@ BTL_MSG_STATE_POPUP_PRE_DELAY
Definition enums.h:3794
@ BTL_MSG_STATE_ERROR_DELAY
Definition enums.h:3803
@ BTL_MSG_STATE_POPUP_DELAY
Definition enums.h:3795
@ BTL_MSG_STATE_ACTION_TIP_DISPOSE
Definition enums.h:3800
@ BUTTON_A
Definition enums.h:2776
@ BUTTON_B
Definition enums.h:2775
@ BS_FLAGS1_10000
Definition enums.h:3618
@ BS_FLAGS1_SUPER_HIT
Definition enums.h:3612
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3609
@ BS_FLAGS1_4000
Definition enums.h:3616
BattleMessages
Definition enums.h:3699
@ BTL_MSG_JUMP_DISABLED_1
Definition enums.h:3778
@ BTL_MSG_ACTION_TIP_HOLD_THEN_TAP
Definition enums.h:3761
@ BTL_MSG_ENEMY_MISSED
Definition enums.h:3709
@ BTL_MSG_CANT_SWITCH
Definition enums.h:3782
@ BTL_MSG_MERLEE_ATK_UP
Definition enums.h:3700
@ BTL_MSG_ITEMS_DISABLED
Definition enums.h:3781
@ BTL_MSG_ACTION_TIP_UNUSED_2
Definition enums.h:3754
@ BTL_MSG_PLAYER_FROZEN
Definition enums.h:3712
@ BTL_MSG_ACTION_TIP_MOVE_TO_AIM
Definition enums.h:3763
@ BTL_MSG_STAR_POWER_MAXED
Definition enums.h:3727
@ BTL_MSG_ACTION_TIP_UNUSED_3
Definition enums.h:3760
@ BTL_MSG_CANT_MOVE
Definition enums.h:3783
@ BTL_MSG_CHARGE_HAMMER_MORE
Definition enums.h:3705
@ BTL_MSG_ACTION_TIP_PRESS_BUTTONS_SHOWN
Definition enums.h:3755
@ BTL_MSG_PLAYER_POISONED
Definition enums.h:3713
@ BTL_MSG_MERLEE_EXP_UP
Definition enums.h:3702
@ BTL_MSG_TURBO_CHARGE_BEGIN
Definition enums.h:3742
@ BTL_MSG_TURBO_CHARGE_END
Definition enums.h:3743
@ BTL_MSG_ACTION_TIP_MASH_BUTTON
Definition enums.h:3750
@ BTL_MSG_PLAYER_PARALYZED
Definition enums.h:3715
@ BTL_MSG_ACTION_TIP_NOT_USED_3
Definition enums.h:3767
@ BTL_MSG_HEAL_ONE
Definition enums.h:3731
@ BTL_MSG_ENEMY_ASLEEP
Definition enums.h:3719
@ BTL_MSG_PLAYER_CHARGED
Definition enums.h:3716
@ BTL_MSG_ACTION_TIP_HOLD_LEFT_TIMED
Definition enums.h:3748
@ BTL_MSG_HAMMER_DISABLED_3
Definition enums.h:3777
@ BTL_MSG_CANT_SWITCH_UNUSED
Definition enums.h:3784
@ BTL_MSG_ACTION_TIP_NOT_USED_1
Definition enums.h:3756
@ BTL_MSG_PLAYER_ASLEEP
Definition enums.h:3711
@ BTL_MSG_ENEMY_POISONED
Definition enums.h:3721
@ BTL_MSG_PLAYER_SHRUNK
Definition enums.h:3714
@ BTL_MSG_ENEMY_CANT_MOVE
Definition enums.h:3725
@ BTL_MSG_WATER_BLOCK_BEGIN
Definition enums.h:3738
@ BTL_MSG_47
Definition enums.h:3773
@ BTL_MSG_CANT_MOVE_UNUSED
Definition enums.h:3785
@ BTL_MSG_ACTION_TIP_UNUSED_4
Definition enums.h:3764
@ BTL_MSG_ENEMY_PARALYZED
Definition enums.h:3723
@ BTL_MSG_ACTION_TIP_HOLD_THEN_RELEASE
Definition enums.h:3762
@ BTL_MSG_UNUSED_CLOUD_NINE
Definition enums.h:3745
@ BTL_MSG_NO_JUMP_TARGET
Definition enums.h:3769
@ BTL_MSG_MERLEE_DONE
Definition enums.h:3703
@ BTL_MSG_ACTION_TIP_NOT_USED_2
Definition enums.h:3758
@ BTL_MSG_ACTION_TIP_BREAK_FREE
Definition enums.h:3765
@ BTL_MSG_ACTION_TIP_UNUSED_1
Definition enums.h:3753
@ BTL_MSG_LAST_ACTION_TIP
Definition enums.h:3768
@ BTL_MSG_CLOUD_NINE_END
Definition enums.h:3741
@ BTL_MSG_ACTION_TIP_HOLD_LEFT_AIM
Definition enums.h:3752
@ BTL_MSG_JUMP_DISABLED_3
Definition enums.h:3780
@ BTL_MSG_ENEMY_FROZEN
Definition enums.h:3720
@ BTL_MSG_NO_ITEM_TARGET
Definition enums.h:3771
@ BTL_MSG_ENEMY_DAZED
Definition enums.h:3718
@ BTL_MSG_HEAL_ALL
Definition enums.h:3732
@ BTL_MSG_CHILL_OUT_BEGIN
Definition enums.h:3744
@ BTL_MSG_WATER_BLOCK_END
Definition enums.h:3739
@ BTL_MSG_ACTION_TIP_PRESS_BEFORE_STRIKE
Definition enums.h:3749
@ BTL_MSG_CANT_SELECT_NOW
Definition enums.h:3774
@ BTL_MSG_ACTION_TIP_MASH_BOTH
Definition enums.h:3759
@ BTL_MSG_FIRST_ACTION_TIP
Definition enums.h:3746
@ BTL_MSG_MERLEE_DEF_UP
Definition enums.h:3701
@ BTL_MSG_46
Definition enums.h:3772
@ BTL_MSG_CHARGE_JUMP_MORE
Definition enums.h:3707
@ BTL_MSG_JUMP_DISABLED_2
Definition enums.h:3779
@ BTL_MSG_PARTNER_INJURED
Definition enums.h:3735
@ BTL_MSG_CHARGE_GOOMBARIO_MORE
Definition enums.h:3737
@ BTL_MSG_CANT_SELECT_NOW_ALT
Definition enums.h:3786
@ BTL_MSG_STAR_POWER_RECHARGED
Definition enums.h:3726
@ BTL_MSG_NO_HAMMER_TARGET
Definition enums.h:3770
@ BTL_MSG_DEFENCE_UP
Definition enums.h:3730
@ BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING
Definition enums.h:3747
@ BTL_MSG_ACTION_TIP_PRESS_WITH_TIMING
Definition enums.h:3757
@ BTL_MSG_CANT_CHARGE
Definition enums.h:3708
@ BTL_MSG_CHARGE_HAMMER
Definition enums.h:3704
@ BTL_MSG_CHARGE_GOOMBARIO
Definition enums.h:3736
@ BTL_MSG_CLOUD_NINE_BEGIN
Definition enums.h:3740
@ BTL_MSG_ENEMY_ELECTRIFIED
Definition enums.h:3724
@ BTL_MSG_ATTACK_UP
Definition enums.h:3729
@ BTL_MSG_ACTION_TIP_REDUCE_DAMAGE
Definition enums.h:3766
@ BTL_MSG_CHARGE_JUMP
Definition enums.h:3706
@ BTL_MSG_ENEMY_TRANSPARENT
Definition enums.h:3733
@ BTL_MSG_ACTION_TIP_MASH_LEFT
Definition enums.h:3751
@ BTL_MSG_HAMMER_DISABLED_1
Definition enums.h:3775
@ BTL_MSG_ENEMY_SHRUNK
Definition enums.h:3722
@ BTL_MSG_PLAYER_DAZED
Definition enums.h:3710
@ BTL_MSG_PLAYER_TRANSPARENT
Definition enums.h:3717
@ BTL_MSG_HAMMER_DISABLED_2
Definition enums.h:3776
@ BTL_MSG_STAR_POWER_FILLED
Definition enums.h:3728
@ BTL_MSG_ENEMY_CHARGED
Definition enums.h:3734
@ WINDOW_PRIORITY_0
Definition enums.h:3216
@ MSG_PAL_0F
Definition enums.h:5005
@ WINDOW_UPDATE_SHOW
Definition enums.h:4896
@ WINDOW_UPDATE_SHOW_DARKENED
Definition enums.h:4903
@ WINDOW_UPDATE_HIDE
Definition enums.h:4897
@ WINDOW_UPDATE_SHOW_TRANSPARENT
Definition enums.h:4902
@ ACTOR_FLAG_HALF_HEIGHT
Definition enums.h:3369
@ ACTOR_PART_FLAG_SKIP_SHOCK_EFFECT
Definition enums.h:3399
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3384
@ CAM_BATTLE
Definition enums.h:1827
@ WIN_BTL_POPUP
Definition enums.h:4835
#define ApiStatus_DONE2
Definition evt.h:119
s32 Bytecode
Definition evt.h:7
s32 sign(s32 value)
Definition 43F0.c:374
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1725
void draw_entity_model_A(s32, Mtx *)
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void clear_entity_model_flags(s32 idx, s32 newFlags)
void set_entity_model_flags(s32 idx, s32 newFlags)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1882
void exec_entity_model_commandlist(s32 idx)
s32 heap_free(void *ptr)
Definition heap.c:42
void set_message_int_var(s32 value, s32 index)
Definition msg.c:1556
void set_message_text_var(s32 msgID, s32 index)
Definition msg.c:1526
void bind_entity_model_setupGfx(s32 idx, void *setupGfxCallbackArg0, void(*fpSetupGfxCallback)(void *))
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
void free_entity_model_by_index(s32 idx)
void * heap_malloc(s32 size)
Definition heap.c:34
s32 get_msg_lines(s32 messageID)
Definition msg.c:1985
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_create_transform_B(s32 id)
void hud_element_draw_complex_hud_first(s32 hid)
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_draw_clipped(s32 id)
void hud_element_free(s32 id)
@ HUD_ELEMENT_FLAG_MANUAL_RENDER
Definition hud_element.h:78
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:86
s32 HudScript[]
Definition hud_element.h:9
void btl_set_popup_duration(s32 duration)
BSS PopupMessage popupMessages[32]
#define TIP_Y_PWT1
s32 bActorMessages[]
#define TIP_X_BF_RD
#define TIP_X_PWT1
#define TIP_SCALE1
s16 BattleMessage_TextOffsetsY[]
s16 BattleMessage_BoxOffsetsY[]
#define TIP_X_PBS2
void btl_popup_messages_draw_ui(void)
Vec3f BonkAnimScale[]
#define TIP_Y_MTA2
HudScript HES_Item_MenuItems
#define TIP_X_HTT
#define TIP_Y_PBS2
#define TIP_X_MTA3
PopupMessage * bPopupMessage
#define TIP_X_MTA1
void btl_bonk_setup_gfx(void *data)
void btl_show_variable_battle_message(s32 messageIndex, s32 duration, s32 varValue)
void btl_popup_messages_draw_world_geometry(void)
#define TIP_X_HLT2
void show_immune_bonk(f32 x, f32 y, f32 z, s32 numStars, s32 startupTime, s32 animDir)
HudScript HES_TimingBlink
BSS s16 BattleMessage_CurBoxOffsetY
BSS s16 BattleMessage_CurBoxPosY
#define TIP_Y_HTR1
#define TIP_X_HLA2
PopupMessage * btl_create_popup(void)
void close_action_command_instruction_popup(void)
#define TIP_X_PWT2
void btl_bonk_cleanup(void)
HudScript HES_MashCDownButton1
HudScript HES_Item_MenuBoots3
HudScript HES_Item_MenuHammer2
#define TIP_Y_PBS3
#define TIP_SCALE2
HudScript HES_CDownButton
HudScript HES_Item_MenuBoots1
#define TIP_X_HLT1
#define TIP_X_PBST
HudScript HES_Item_MenuBoots2
void btl_message_popup_draw_content(void *data, s32 x, s32 y)
#define TIP_X_HLA1
#define TIP_X_PBS3
HudScript HES_MashCLeftButton
BSS s16 HID_BattleMessage4
#define TIP_Y_MTA1
HudScript HES_StickTapRight
#define TIP_X_PBS1
HudScript HES_MashCRightButton1
BSS b16 BattleMessage_BoxPosLocked
void btl_update_message_popup(void *popup)
void btl_message_unlock_box_pos(void)
EntityModelScript EMS_BonkIcon
#define TIP_Y_PBS1
#define TIP_X_MTA2
#define TIP_X_MB1
void btl_show_battle_message(s32 messageIndex, s32 duration)
#define TIP_X_PRL
HudScript HES_StickBackAndForth
HudScript HES_CRightButton
BSS s16 HID_BattleMessage1
BSS s16 BattlePopupMessageVar
void btl_bonk_update(void *data)
#define TIP_Y_HLA2
#define TIP_Y_HLT2
#define TIP_X_ML
void btl_message_lock_box_pos(void)
#define TIP_Y_BF_RD
void btl_popup_messages_update(void)
void btl_popup_messages_init(void)
BSS s16 HID_BattleMessage2
#define TIP_X_HTR1
#define TIP_X_HTR2
HudScript HES_Item_MenuHammer3
#define TIP_X_MB
BSS b16 ActionCommandTipVisible
s16 BattleMessage_BoxSizesY[]
s32 entityModelIndex
HudScript HES_StickTapLeft
s32 btl_is_popup_displayed(void)
HudScript HES_Item_MenuHammer1
void apply_shock_effect(Actor *actor)
HudScript HES_MashBButton2
void btl_show_message_popup(void *popup)
void free_popup(PopupMessage *popup)
HudScript HES_AimTarget
HudScript HES_CLeftButton
Vec3f BonkAnimAccel[]
HudScript HES_MashCUpButton
void btl_popup_messages_delete(void)
BSS s16 HID_BattleMessage3
EntityModelScript * BonkModelScripts[]
HudScript HES_CUpButton
void btl_bonk_render(void *data)
#define TIP_X_MB2
HudScript HES_RotateStickCW
HudScript HES_AimReticle
#define BSS
Definition macros.h:7
#define ARRAY_COUNT(arr)
Definition macros.h:40
Camera gCameras[4]
Definition cam_main.c:16
Gfx * gMainGfxPos
Definition cam_main.c:14
BattleStatus gBattleStatus
Definition battle.cpp:14
Window gWindows[64]
Definition windows.c:23