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;
10 /* 0x04 */ s32 entityModelIndex;
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
25extern s32* D_8028358C[];
26
27s32* D_8028358C_2[] = {
28 (s32*)D_8028358C, (s32*)D_8028358C, (s32*)D_8028358C
29};
30
31s8 D_8028374C_1BA13C[][4] = {
32 { 236, 0, 0, 0 }, { 204, 0, 0, 0 }, { 238, 0, 0, 0 }, { 248, 0, 0, 0 }, { 252, 0, 0, 0 },
33 { 252, 0, 0, 0 }, { 252, 0, 0, 0 }, { 252, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 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 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
44 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
45 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
46 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
47 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
48 { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 }, { 248, 0, 0, 0 },
49};
50#else
51 // all keyed by number of lines in the message (1 or 2)
55#endif
56
58 { 0.0f, 4.5f, 0.0f },
59 { 1.0f, 4.0f, 0.0f },
60 { 2.0f, 3.0f, 0.0f },
61 { 3.0f, 2.0f, 0.0f },
62 { 3.5f, 1.0f, 0.0f },
63 { 4.0f, 0.0f, 0.0f },
64 { 4.5f, 0.0f, 0.0f },
65 { 5.0f, 0.0f, 0.0f },
66 { 4.5f, 0.0f, 0.0f },
67 { 4.0f, 0.0f, 0.0f },
68 { 3.5f, -1.0f, 0.0f },
69 { 3.0f, -2.0f, 0.0f },
70 { 2.0f, -3.0f, 0.0f },
71 { 1.0f, -4.0f, 0.0f },
72 { 0.0f, -4.5f, 0.0f },
73};
74
76 { 1.0f, 1.0f, 1.0f },
77 { 0.8f, 0.8f, 0.8f },
78 { 0.9f, 0.9f, 0.9f },
79 { 1.1f, 1.1f, 1.1f },
80 { 1.0f, 1.0f, 1.0f },
81 { 0.8f, 0.8f, 0.8f },
82 { 0.9f, 0.9f, 0.9f },
83 { 1.1f, 1.1f, 1.1f },
84 { 1.0f, 1.0f, 1.0f },
85 { 0.8f, 0.8f, 0.8f },
86 { 0.9f, 0.9f, 0.9f },
87 { 1.1f, 1.1f, 1.1f },
88 { 1.0f, 1.0f, 1.0f },
89 { 0.8f, 0.8f, 0.8f },
90 { 0.9f, 0.9f, 0.9f },
91};
92
94
100
112
113 // player status effects
122
123 // enemy status effects
132
140
154
155 // move action command tips
177
178 // no targets available
182#if VERSION_JP
185#else
188#endif
189
190 // errors and warnings
204};
205
206#if VERSION_JP
207s32 D_80283B88_1BA578[] = { 1, 1, 1, 1, 1, 1, 1, 1 };
208s32 D_80283BA8_1BA598[] = { 0, 0, 0, 0, 1, 0, 0, 0 };
209#endif
210
226
228
238#if !VERSION_JP
240#endif
241
265
266void btl_bonk_update(void* data);
267void btl_bonk_render(void* data);
268void btl_bonk_setup_gfx(void* data);
270void btl_show_message_popup(void* popup);
271
273 s32 i;
274
275 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
277 popup->active = FALSE;
278 popup->data.bonk = NULL;
279 }
280}
281
283 s32 i;
284
285 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
287 if (popup->data.bonk != NULL) {
288 heap_free(popup->data.bonk);
289 popup->data.bonk = NULL;
290 }
291 popup->active = FALSE;
292 }
293}
294
296 s32 i;
297
298 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
300 if (popup->active && popup->updateFunc != NULL) {
302 }
303 }
304}
305
307 s32 i;
308
309 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
311 if (popup->active && popup->renderWorldFunc != NULL) {
313 }
314 }
315}
316
318 s32 i;
319
320 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
322 if (popup->active && popup->renderUIFunc != NULL) {
324 }
325 }
326}
327
329 s32 i;
330
331 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
333 if (!popup->active) {
334 popup->active = TRUE;
335 return popup;
336 }
337 }
338
339 return NULL;
340}
341
343 if (popup->data.bonk != NULL) {
344 heap_free(popup->data.bonk);
345 popup->data.bonk = NULL;
346 }
347 popup->active = FALSE;
348}
349
350void show_immune_bonk(f32 x, f32 y, f32 z, s32 numStars, s32 startupTime, s32 animDir) {
355 f32 baseScale;
356 s32 bonkPosIdx;
358 s32 sign;
359 s32 i;
360
362 if (popup == NULL) {
363 // unable to create popup
364 return;
365 }
366
367 if (numStars < 1) {
368 numStars = 1;
369 baseScale = 0.4f;
370 timescale = 0.7f;
372 } else {
373 baseScale = 1.0f;
374 timescale = 1.0f;
376 }
377
379 baseScale *= 2.0;
380 }
381
382 if (animDir < 0) {
383 sign = -1;
384 } else {
385 sign = 1;
386 }
387
388 animDir = abs(animDir) % 5;
389
390 battleStatus->unk_90 = 0;
391 popup->updateFunc = btl_bonk_update;
392 popup->renderWorldFunc = btl_bonk_render;
393 popup->unk_00 = FALSE;
394 popup->renderUIFunc = NULL;
395 popup->messageIndex = 1;
396 popup->active |= 0x10;
397 bonkData = popup->data.bonk = heap_malloc(numStars * sizeof(*popup->data.bonk));
398 ASSERT (popup->data.bonk != NULL);
399
400 for (i = 0; i < numStars; i++) {
401 bonkData->alive = TRUE;
405 bonkData->pos.x = x;
406 bonkData->pos.y = y;
407 bonkData->pos.z = z;
408 bonkPosIdx = animDir % 8;
409 animDir++;
410
414 bonkData->vel.x = 2.0 * bonkData->accel.x;
415 bonkData->vel.y = 2.0 * bonkData->accel.y;
416 bonkData->vel.z = 2.0 * bonkData->accel.z;
417
418 bonkData->scale = BonkAnimScale[i % 8].x * baseScale;
419 bonkData->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].curYaw);
420 bonkData->rotZ = 0;
421 bonkData->rotVelZ = sign * 107;
422
423 bonkData->startupTime = startupTime;
424 bonkData->moveTime = 14;
425 bonkData->holdTime = 240;
426 if (hasShortLifetime) {
427 bonkData->holdTime = 10;
428 }
429
430 bonkData->alpha = 255.0f;
431 bonkData++;
432 }
433}
434
435void btl_bonk_update(void* data) {
436 PopupMessage* popup = data;
437 BonkData* bonkData = popup->data.bonk;
438 s32 allDone = TRUE;
439 s32 i;
440
441 for (i = 0; i < popup->messageIndex; i++, bonkData++) {
442 if (bonkData->alive) {
444
445 allDone = FALSE;
446 if (bonkData->startupTime != 0) {
447 bonkData->startupTime--;
448 if (bonkData->startupTime == 0) {
450 }
452 break;
453 }
454
456 if (bonkData->moveTime >= 0) {
457 bonkData->pos.x += bonkData->vel.x;
458 bonkData->pos.y += bonkData->vel.y;
459 bonkData->pos.z += bonkData->vel.z;
460 }
461 bonkData->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].curYaw);
462 bonkData->rotZ += bonkData->rotVelZ;
463 bonkData->rotZ = clamp_angle(bonkData->rotZ);
464 bonkData->rotVelZ *= 0.8;
465 if (bonkData->moveTime < 10) {
466 bonkData->accel.x *= 0.5;
467 bonkData->accel.y *= 0.5;
468 bonkData->accel.z *= 0.5;
469 bonkData->vel.x = bonkData->accel.x;
470 bonkData->vel.y = bonkData->accel.y;
471 bonkData->vel.z = bonkData->accel.z;
472 }
473
474 bonkData->moveTime--;
475 if (bonkData->moveTime < 0) {
476 bonkData->holdTime--;
477 if (bonkData->holdTime < 0) {
479 bonkData->alive = FALSE;
480 }
481 }
482 }
483 }
484
485 if (allDone) {
486 heap_free(popup->data.bonk);
487 popup->data.bonk = NULL;
489 }
490}
491
492void btl_bonk_render(void* data) {
493 PopupMessage* popup = data;
494 BonkData* bonkData = popup->data.bonk;
503 Mtx sp218;
504 s32 i;
505
506 for (i = 0; i < popup->messageIndex; i++, bonkData++) {
507 if (bonkData->alive) {
508 if (bonkData->startupTime != 0) {
509 break;
510 } else {
511 guTranslateF(sp18, bonkData->pos.x, bonkData->pos.y, bonkData->pos.z);
512 guRotateF(mtxRotX, 0.0f, 1.0f, 0.0f, 0.0f);
513 guRotateF(mtxRotY, bonkData->rotY, 0.0f, 1.0f, 0.0f);
514 guRotateF(mtxRotZ, bonkData->rotZ, 0.0f, 0.0f, 1.0f);
515 guScaleF(mtxScale, bonkData->scale, bonkData->scale, bonkData->scale);
521 draw_entity_model_A(bonkData->entityModelIndex, &sp218);
522 }
523 }
524 }
525}
526
527void btl_bonk_setup_gfx(void* data) {
528 BonkData* bonkData = data;
529 s32 alphaAmt = bonkData->holdTime;
530
531 if (alphaAmt > 10) {
532 alphaAmt = 10;
533 }
534 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, (alphaAmt * 255) / 10);
535}
536
538 s32 i;
539
540 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
542
543 if (popup->active != 0 && (popup->active & 0x10)) {
544 BonkData* bonkData = popup->data.bonk;
545 s32 j;
546
547 for (j = 0; j < popup->messageIndex; j++, bonkData++) {
548 if (bonkData->alive) {
550 bonkData->moveTime = 1;
551 bonkData->holdTime = 20;
552 }
553 }
554 }
555 }
556}
557
558API_CALLABLE(ShowImmuneBonk) {
559 Bytecode* args = script->ptrReadPos;
560 s32 x = evt_get_variable(script, *args++);
561 s32 y = evt_get_variable(script, *args++);
562 s32 z = evt_get_variable(script, *args++);
563 s32 numStars = evt_get_variable(script, *args++);
564 s32 startupTime = evt_get_variable(script, *args++);
565 s32 arg6 = evt_get_variable(script, *args++);
566
567 show_immune_bonk(x, y, z, numStars, startupTime, arg6);
568 return ApiStatus_DONE2;
569}
570
571API_CALLABLE(ForceImmuneBonkCleanup) {
573 return ApiStatus_DONE2;
574}
575
576// show a popup message bubble with a message selected from BattleMessages
577void btl_show_battle_message(s32 messageIndex, s32 duration) {
579
580 if (popup != NULL) {
581 popup->updateFunc = btl_update_message_popup;
582 popup->renderUIFunc = btl_show_message_popup;
583 popup->unk_00 = FALSE;
584 popup->renderWorldFunc = NULL;
585 popup->messageIndex = messageIndex;
586 popup->duration = duration;
587 popup->showMsgState = BTL_MSG_STATE_INIT;
588 popup->needsInit = TRUE;
589 popup->data.bonk = NULL;
595#if !VERSION_JP
597#endif
598 }
599}
600
601// show a popup message bubble with a message selected from BattleMessages
602void btl_show_variable_battle_message(s32 messageIndex, s32 duration, s32 varValue) {
604
605 if (popup != NULL) {
606 popup->updateFunc = btl_update_message_popup;
607 popup->renderUIFunc = btl_show_message_popup;
608 popup->unk_00 = FALSE;
609 popup->renderWorldFunc = NULL;
610 popup->messageIndex = messageIndex;
611 popup->duration = duration;
612 popup->showMsgState = BTL_MSG_STATE_INIT;
613 popup->needsInit = TRUE;
614 popup->data.bonk = NULL;
620#if !VERSION_JP
622#endif
623 }
624}
625
627 return bPopupMessage != NULL;
628}
629
630void btl_set_popup_duration(s32 duration) {
632
634 popup->duration = duration;
635 }
636}
637
641
645
648
649 if (popup != NULL
650 && popup->messageIndex <= BTL_MSG_LAST_ACTION_TIP
651 && popup->messageIndex >= BTL_MSG_FIRST_ACTION_TIP
652 ) {
653 popup->duration = 0;
654 }
655}
656
657void btl_update_message_popup(void* data) {
658 PopupMessage* popup = data;
661
662 s32 actionCommandMode;
663
664 switch (popup->messageIndex) {
696 case BTL_MSG_HEAL_ONE:
697 case BTL_MSG_HEAL_ALL:
716 switch (popup->showMsgState) {
717 default:
718 break;
720 popup->showMsgState = BTL_MSG_STATE_POPUP_PRE_DELAY;
721 break;
723 popup->showMsgState = BTL_MSG_STATE_POPUP_DELAY;
724 break;
726 if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) {
727 popup->duration = 0;
728 }
729
730 if (popup->duration != 0) {
731 popup->duration--;
732 } else {
734 }
735 break;
737 popup->showMsgState = BTL_MSG_STATE_POPUP_DISPOSE;
738 break;
741 break;
742 }
743 break;
744 // move action command tips
766 actionCommandMode = battleStatus->actionCommandMode;
768 if (actionCommandMode == AC_MODE_NOT_LEARNED) {
771 break;
772 }
773
774 switch (popup->showMsgState) {
778 switch (popup->messageIndex) {
783 break;
788
792 break;
797
802 break;
807
811
815
819 break;
824 break;
829
833
837 break;
842 break;
847
851 break;
859 break;
864
868 break;
873
877 break;
882
887
892 break;
898 // fallthrough
909 break;
910 }
912 break;
917 popup->duration = 0;
919 break;
920 }
921
923 && (actionCommandMode != AC_MODE_TUTORIAL)
924 ) {
926 switch (popup->messageIndex) {
929 break;
932 break;
936 break;
940 break;
946 break;
949 break;
954 break;
957 break;
961 break;
965 break;
969 break;
972 break;
976 break;
979 break;
982 break;
986 // fallthrough
992 break;
993 }
994 if (popup->duration != -1) {
995 popup->duration = 30;
996 }
998 break;
999 }
1000 break;
1002 if ((actionCommandMode != AC_MODE_TUTORIAL)
1004 ) {
1005 if (BattleMessage_CurBoxPosY < 192) {
1008 if (BattleMessage_CurBoxPosY > 192) {
1010 }
1011 } else {
1012 break;
1013 }
1014 }
1015
1016#if VERSION_JP
1018#else
1020#endif
1021
1022 if (popup->duration == -1) {
1023 break;
1024 }
1025
1026 if (popup->duration != 0) {
1027 popup->duration--;
1028 break;
1029 }
1030
1031 switch (popup->messageIndex) {
1045 break;
1054 break;
1060 break;
1066 break;
1067 }
1070 }
1071 break;
1072 }
1073 break;
1077 case BTL_MSG_46:
1078 case BTL_MSG_47:
1080 switch (popup->showMsgState) {
1081 default:
1082 break;
1083 case BTL_MSG_STATE_INIT:
1084 popup->showMsgState = BTL_MSG_STATE_ERROR_PRE_DELAY;
1085 break;
1087 popup->showMsgState = BTL_MSG_STATE_ERROR_DELAY;
1088 break;
1090 if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) {
1091 popup->duration = 0;
1092 }
1093
1094 if (popup->duration != 0) {
1095 popup->duration--;
1096 } else {
1097 popup->showMsgState = BTL_MSG_STATE_ERROR_POST_DELAY;
1098 }
1099 break;
1101 popup->showMsgState = BTL_MSG_STATE_ERROR_DISPOSE;
1102 break;
1105 break;
1106 }
1107 break;
1115 switch (popup->showMsgState) {
1116 case BTL_MSG_STATE_INIT:
1117 switch (popup->messageIndex) {
1122 break;
1127 break;
1132 break;
1137 break;
1142 break;
1147 break;
1152 break;
1153 }
1154 popup->showMsgState = BTL_MSG_STATE_DISABLED_DELAY;
1155 break;
1157 if (popup->duration != 0) {
1158 popup->duration--;
1159 break;
1160 }
1163 break;
1164 }
1165 break;
1166 }
1167 if (shouldDisposeWindow) {
1171 }
1172}
1173
1174#if VERSION_IQUE
1175#define TIP_X_PRL 83
1176#define TIP_X_HLT1 44
1177#define TIP_X_HLT2 67
1178#define TIP_X_PBST 124
1179#define TIP_X_MB 70
1180#define TIP_X_ML 69
1181#define TIP_X_HLA1 43
1182#define TIP_X_HLA2 177
1183#define TIP_X_PBS1 105
1184#define TIP_X_PBS2 83
1185#define TIP_X_PBS3 127
1186#define TIP_X_PWT1 40
1187#define TIP_X_PWT2 106
1188#define TIP_X_MB1 95
1189#define TIP_X_MB2 116
1190#define TIP_X_HTT 58
1191#define TIP_X_HTR1 39
1192#define TIP_X_HTR2 55
1193#define TIP_X_MTA1 53
1194#define TIP_X_MTA2 55
1195#define TIP_X_MTA3 108
1196#define TIP_X_BF_RD 66
1197#define TIP_Y_HLT2 31
1198#define TIP_Y_HLA2 17
1199#define TIP_Y_PBS1 14
1200#define TIP_Y_PBS2 14
1201#define TIP_Y_PBS3 14
1202#define TIP_Y_PWT1 14
1203#define TIP_Y_HTR1 31
1204#define TIP_Y_MTA1 14
1205#define TIP_Y_MTA2 32
1206#define TIP_Y_BF_RD 14
1207#define TIP_SCALE1 0.6f
1208#define TIP_SCALE2 0.7f
1209#elif VERSION_JP
1210#define TIP_X_PRL 115
1211#define TIP_X_HLT1 29
1212#define TIP_X_HLT2 129
1213#define TIP_X_PBST 126
1214#define TIP_X_MB 28
1215#define TIP_X_ML 28
1216#define TIP_X_HLA1 29
1217#define TIP_X_HLA2 128
1218#define TIP_X_PBS1 111
1219#define TIP_X_PBS2 88
1220#define TIP_X_PBS3 134
1221#define TIP_X_PWT1 28
1222#define TIP_X_PWT2 160
1223#define TIP_X_MB1 20
1224#define TIP_X_MB2 43
1225#define TIP_X_HTT 29
1226#define TIP_X_HTR1 126
1227#define TIP_X_HTR2 28
1228#define TIP_X_MTA1 29
1229#define TIP_X_MTA2 153
1230#define TIP_X_MTA3 68
1231#define TIP_X_BF_RD 29
1232#define TIP_Y_HLT2 13
1233#define TIP_Y_HLA2 15
1234#define TIP_Y_PBS1 13
1235#define TIP_Y_PBS2 13
1236#define TIP_Y_PBS3 13
1237#define TIP_Y_PWT1 13
1238#define TIP_Y_HTR1 13
1239#define TIP_Y_MTA1 13
1240#define TIP_Y_MTA2 15
1241#define TIP_Y_BF_RD 13
1242#define TIP_SCALE1 0.8f
1243#define TIP_SCALE2 0.8f
1244#else
1245#define TIP_X_PRL 65
1246#define TIP_X_HLT1 55
1247#define TIP_X_HLT2 73
1248#define TIP_X_PBST 64
1249#define TIP_X_MB 67
1250#define TIP_X_ML 56
1251#define TIP_X_HLA1 65
1252#define TIP_X_HLA2 146
1253#define TIP_X_PBS1 86
1254#define TIP_X_PBS2 64
1255#define TIP_X_PBS3 108
1256#define TIP_X_PWT1 105
1257#define TIP_X_PWT2 65
1258#define TIP_X_MB1 63
1259#define TIP_X_MB2 84
1260#define TIP_X_HTT 124
1261#define TIP_X_HTR1 56
1262#define TIP_X_HTR2 53
1263#define TIP_X_MTA1 107
1264#define TIP_X_MTA2 210
1265#define TIP_X_MTA3 56
1266#define TIP_X_BF_RD 64
1267#define TIP_Y_HLT2 31
1268#define TIP_Y_HLA2 32
1269#define TIP_Y_PBS1 13
1270#define TIP_Y_PBS2 13
1271#define TIP_Y_PBS3 13
1272#define TIP_Y_PWT1 13
1273#define TIP_Y_HTR1 31
1274#define TIP_Y_MTA1 13
1275#define TIP_Y_MTA2 15
1276#define TIP_Y_BF_RD 13
1277#define TIP_SCALE1 0.8f
1278#define TIP_SCALE2 0.8f
1279#endif
1280
1281void btl_message_popup_draw_content(void* data, s32 x, s32 y) {
1282 PopupMessage* popup = data;
1283 s32 messageID;
1284 s32 msgLinesIdx;
1285 s32 opacity;
1286
1287#if VERSION_JP
1288 x += 11 + D_8028374C_1BA13C[popup->messageIndex][2];
1289 y += 6 + D_8028374C_1BA13C[popup->messageIndex][3];
1290#else
1291 x += 15;
1292 y += 6;
1293#endif
1294
1295 switch (popup->messageIndex) {
1335 case BTL_MSG_46:
1336 case BTL_MSG_47:
1339#if VERSION_JP
1340 case BTL_MSG_CANT_MOVE:
1341#endif
1345 messageID = BattleMessages[popup->messageIndex];
1346#if !VERSION_JP
1349#endif
1350 draw_msg(messageID, x, y, 255, MSG_PAL_0F, 0);
1351 break;
1356 case BTL_MSG_ATTACK_UP:
1357 case BTL_MSG_DEFENCE_UP:
1358 case BTL_MSG_HEAL_ONE:
1359 case BTL_MSG_HEAL_ALL:
1362 messageID = BattleMessages[popup->messageIndex];
1363#if !VERSION_JP
1366#endif
1368 draw_msg(messageID, x, y, 255, MSG_PAL_0F, 0);
1369 break;
1370#if !VERSION_JP
1371 case BTL_MSG_CANT_MOVE:
1372 messageID = BattleMessages[popup->messageIndex];
1376 draw_msg(messageID, x, y, 255, MSG_PAL_0F, 0);
1377 break;
1378#endif
1386 messageID = BattleMessages[popup->messageIndex];
1387 draw_msg(messageID, x + 29, y + 6, 255, MSG_PAL_0F, 0);
1390 break;
1412 opacity = 255;
1413 if (popup->showMsgState < BTL_MSG_STATE_ACTION_TIP_DISPOSE) {
1414 opacity = 160;
1415 }
1416 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1417 opacity = 255;
1418 }
1419
1420 x -= 11;
1421 y -= 6;
1422 messageID = BattleMessages[popup->messageIndex];
1423#if !VERSION_JP
1426#endif
1427 draw_msg(messageID, x + 11, y + 6, opacity, MSG_PAL_0F, 0);
1428
1429 switch (popup->messageIndex) {
1435 break;
1441
1445 break;
1451 break;
1457 break;
1463 break;
1469
1474 break;
1475#if VERSION_JP
1481
1486
1491
1496 break;
1502 break;
1503#endif
1509
1514
1519 break;
1520#if VERSION_JP
1526 break;
1527#endif
1532
1537 break;
1538#if VERSION_JP
1544
1549 break;
1550#endif
1556
1561 break;
1562#if VERSION_JP
1568 break;
1569#endif
1575 break;
1580
1585 break;
1591
1596
1601 break;
1602#if VERSION_JP
1608 break;
1609#endif
1616 break;
1617#if VERSION_JP
1623 break;
1624#endif
1625 }
1626 break;
1627 }
1628}
1629
1630void btl_show_message_popup(void* data) {
1631 PopupMessage* popup = data;
1632 s32 numLines;
1633 s32 posX;
1634 s32 posY = 80;
1635 s32 width;
1636 s32 msgWidth;
1637 s32 height;
1638
1639#if VERSION_JP
1640 switch (popup->messageIndex) {
1661 case BTL_MSG_46:
1662 case BTL_MSG_47:
1667 if (popup->needsInit) {
1669 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1670 posX = 160 - (msgWidth / 2);
1671 width = msgWidth;
1672 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1675 }
1676 break;
1681 if (popup->needsInit) {
1682 popup->needsInit = FALSE;
1683 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1684 posX = 160 - (msgWidth / 2);
1685 width = msgWidth;
1686 height = 45 + D_8028374C_1BA13C[popup->messageIndex][1];
1689 }
1690 break;
1712 if (popup->needsInit) {
1713 popup->needsInit = FALSE;
1714 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1715 posX = 160 - (msgWidth / 2);
1716 width = msgWidth;
1717 posY = 192;
1718 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1719 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1720 posY = 120;
1722 }
1724
1726 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1728 } else {
1730 }
1731 }
1732 break;
1740 if (popup->needsInit) {
1741 popup->needsInit = FALSE;
1742 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (55 + D_8028374C_1BA13C[popup->messageIndex][0]);
1743 posX = 160 - (msgWidth / 2);
1744 width = msgWidth;
1745 height = 40 + D_8028374C_1BA13C[popup->messageIndex][1];
1748 }
1749 break;
1758 if (popup->needsInit) {
1759 popup->needsInit = FALSE;
1760 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1761 posX = 160 - (msgWidth / 2);
1762 width = msgWidth;
1763 if (D_80283B88_1BA578[popup->messageIndex - 10] != 0) {
1764 height = 45 + D_8028374C_1BA13C[popup->messageIndex][1];
1765 } else {
1766 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1767 }
1768
1771 }
1772 break;
1781 if (popup->needsInit) {
1782 popup->needsInit = FALSE;
1783 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1784 posX = 160 - (msgWidth / 2);
1785 width = msgWidth;
1786 if (D_80283BA8_1BA598[popup->messageIndex - 18] != 0) {
1787 height = 45 + D_8028374C_1BA13C[popup->messageIndex][1];
1788 } else {
1789 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1790 }
1791
1794 }
1795 break;
1800 case BTL_MSG_ATTACK_UP:
1801 case BTL_MSG_DEFENCE_UP:
1802 case BTL_MSG_HEAL_ONE:
1803 case BTL_MSG_HEAL_ALL:
1806 if (popup->needsInit) {
1807 s32 messageID;
1808
1809 popup->needsInit = FALSE;
1810 messageID = BattleMessages[popup->messageIndex];
1812 msgWidth = get_msg_width(messageID, 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1813 posX = 160 - (msgWidth / 2);
1814 width = msgWidth;
1815 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1818 }
1819 break;
1820 case BTL_MSG_CANT_MOVE:
1821 if (popup->needsInit) {
1822 s32 messageID;
1823
1824 popup->needsInit = FALSE;
1825 messageID = BattleMessages[popup->messageIndex];
1827 msgWidth = get_msg_width(messageID, 0) + (31 + D_8028374C_1BA13C[popup->messageIndex][0]);
1828 posX = 160 - (msgWidth / 2);
1829 width = msgWidth;
1830 height = 28 + D_8028374C_1BA13C[popup->messageIndex][1];
1833 }
1834 break;
1835 }
1836#else
1837 switch (popup->messageIndex) {
1877 case BTL_MSG_46:
1878 case BTL_MSG_47:
1884 if (popup->needsInit) {
1885 s32 messageID;
1886
1887 popup->needsInit = FALSE;
1888 messageID = BattleMessages[popup->messageIndex];
1889 msgWidth = get_msg_width(messageID, 0) + 30;
1890 posX = 160 - (msgWidth / 2);
1891 width = msgWidth;
1892 numLines = get_msg_lines(messageID) - 1;
1893 height = BattleMessage_BoxSizesY[numLines];
1896 }
1897 break;
1905 if (popup->needsInit) {
1906 popup->needsInit = FALSE;
1907 msgWidth = get_msg_width(BattleMessages[popup->messageIndex], 0) + 55;
1908 posX = 160 - (msgWidth / 2);
1909 width = msgWidth;
1910 height = 40;
1913 }
1914 break;
1919 case BTL_MSG_ATTACK_UP:
1920 case BTL_MSG_DEFENCE_UP:
1921 case BTL_MSG_HEAL_ONE:
1922 case BTL_MSG_HEAL_ALL:
1925 if (popup->needsInit) {
1926 s32 messageID;
1927
1928 popup->needsInit = FALSE;
1929 messageID = BattleMessages[popup->messageIndex];
1931 msgWidth = get_msg_width(messageID, 0) + 31;
1932 posX = 160 - (msgWidth / 2);
1933 width = msgWidth;
1934 numLines = get_msg_lines(messageID) - 1;
1935 height = BattleMessage_BoxSizesY[numLines];
1938 }
1939 break;
1940 case BTL_MSG_CANT_MOVE:
1941 if (popup->needsInit) {
1942 s32 messageID;
1943
1944 popup->needsInit = FALSE;
1945 messageID = BattleMessages[popup->messageIndex];
1947 msgWidth = get_msg_width(messageID, 0) + 31;
1948 posX = 160 - (msgWidth / 2);
1949 width = msgWidth;
1950 numLines = get_msg_lines(messageID) - 1;
1951 height = BattleMessage_BoxSizesY[numLines];
1954 }
1955 break;
1977 if (popup->needsInit) {
1978 s32 messageID;
1979
1980 popup->needsInit = FALSE;
1981 messageID = BattleMessages[popup->messageIndex];
1982 msgWidth = get_msg_width(messageID, 0) + 31;
1983 posX = 160 - (msgWidth / 2);
1984 posY = 192;
1985 width = msgWidth;
1986 numLines = get_msg_lines(messageID) - 1;
1987 height = BattleMessage_BoxSizesY[numLines];
1988 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1989 posY = 120;
1991 }
1994
1997 if (popup->messageIndex == BTL_MSG_ACTION_TIP_UNUSED_3) {
1999 } else {
2001 }
2002 }
2003 break;
2004 }
2005#endif
2006}
2007
2008API_CALLABLE(ShowMessageBox) {
2009 Bytecode* args = script->ptrReadPos;
2010 s32 messageIndex = evt_get_variable(script, *args++);
2011 s32 duration = evt_get_variable(script, *args++);
2012
2013 btl_show_battle_message(messageIndex, duration);
2014 return ApiStatus_DONE2;
2015}
2016
2017API_CALLABLE(ShowVariableMessageBox) {
2018 Bytecode* args = script->ptrReadPos;
2019 s32 messageIndex = evt_get_variable(script, *args++);
2020 s32 duration = evt_get_variable(script, *args++);
2021 s32 varValue = evt_get_variable(script, *args++);
2022
2023 btl_show_variable_battle_message(messageIndex, duration, varValue);
2024 return ApiStatus_DONE2;
2025}
2026
2027API_CALLABLE(IsMessageBoxDisplayed) {
2028 Bytecode* args = script->ptrReadPos;
2029 s32 outVar = *args++;
2030
2032 return ApiStatus_DONE2;
2033}
2034
2035API_CALLABLE(WaitForMessageBoxDone) {
2037}
2038
2039API_CALLABLE(ForceCloseMessageBox) {
2040 if (bPopupMessage != NULL) {
2042 }
2043 return ApiStatus_DONE2;
2044}
2045
2046API_CALLABLE(SetMessageBoxDuration) {
2048 return ApiStatus_DONE2;
2049}
2050
2051API_CALLABLE(LockMessageBoxPosition) {
2053 return ApiStatus_DONE2;
2054}
2055
2056API_CALLABLE(UnlockMessageBoxPosition) {
2058 return ApiStatus_DONE2;
2059}
2060
2062 ActorPart* part = actor->partsTable;
2063
2064 while (part != NULL) {
2065 if (!(part->flags & ACTOR_PART_FLAG_INVISIBLE)
2066 && part->idleAnimations != NULL
2068 ) {
2069 f32 x = part->curPos.x;
2070 f32 y = part->curPos.y + (actor->size.y / 10);
2071 f32 z = part->curPos.z;
2072 s32 f1 = (part->size.x + (part->size.x / 4)) * actor->scalingFactor;
2073 s32 f2 = (part->size.y - 2) * actor->scalingFactor;
2074
2075 if (actor->flags & ACTOR_FLAG_HALF_HEIGHT) {
2076 y -= actor->size.y / 2;
2077 }
2078
2079 fx_flashing_box_shockwave(0, x, y, z, f1, f2);
2080 }
2081 part = part->nextPart;
2082 }
2083}
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
s32 * D_8028358C[]
Definition actors.c:210
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:5014
@ BTL_MSG_STATE_POPUP_DISPOSE
Definition enums.h:4154
@ BTL_MSG_STATE_POPUP_POST_DELAY
Definition enums.h:4153
@ BTL_MSG_STATE_ERROR_PRE_DELAY
Definition enums.h:4159
@ BTL_MSG_STATE_DISABLED_DELAY
Definition enums.h:4164
@ BTL_MSG_STATE_INIT
Definition enums.h:4149
@ BTL_MSG_STATE_ACTION_TIP_DELAY
Definition enums.h:4156
@ BTL_MSG_STATE_ERROR_POST_DELAY
Definition enums.h:4161
@ BTL_MSG_STATE_ERROR_DISPOSE
Definition enums.h:4162
@ BTL_MSG_STATE_POPUP_PRE_DELAY
Definition enums.h:4151
@ BTL_MSG_STATE_ERROR_DELAY
Definition enums.h:4160
@ BTL_MSG_STATE_POPUP_DELAY
Definition enums.h:4152
@ BTL_MSG_STATE_ACTION_TIP_DISPOSE
Definition enums.h:4157
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_B
Definition enums.h:2789
@ BS_FLAGS1_10000
Definition enums.h:3584
@ BS_FLAGS1_SUPER_HIT
Definition enums.h:3578
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3575
@ BS_FLAGS1_4000
Definition enums.h:3582
BattleMessages
Definition enums.h:4056
@ BTL_MSG_JUMP_DISABLED_1
Definition enums.h:4135
@ BTL_MSG_ACTION_TIP_HOLD_THEN_TAP
Definition enums.h:4118
@ BTL_MSG_ENEMY_MISSED
Definition enums.h:4066
@ BTL_MSG_CANT_SWITCH
Definition enums.h:4139
@ BTL_MSG_MERLEE_ATK_UP
Definition enums.h:4057
@ BTL_MSG_ITEMS_DISABLED
Definition enums.h:4138
@ BTL_MSG_ACTION_TIP_UNUSED_2
Definition enums.h:4111
@ BTL_MSG_PLAYER_FROZEN
Definition enums.h:4069
@ BTL_MSG_ACTION_TIP_MOVE_TO_AIM
Definition enums.h:4120
@ BTL_MSG_STAR_POWER_MAXED
Definition enums.h:4084
@ BTL_MSG_ACTION_TIP_UNUSED_3
Definition enums.h:4117
@ BTL_MSG_CANT_MOVE
Definition enums.h:4140
@ BTL_MSG_CHARGE_HAMMER_MORE
Definition enums.h:4062
@ BTL_MSG_ACTION_TIP_PRESS_BUTTONS_SHOWN
Definition enums.h:4112
@ BTL_MSG_PLAYER_POISONED
Definition enums.h:4070
@ BTL_MSG_MERLEE_EXP_UP
Definition enums.h:4059
@ BTL_MSG_TURBO_CHARGE_BEGIN
Definition enums.h:4099
@ BTL_MSG_TURBO_CHARGE_END
Definition enums.h:4100
@ BTL_MSG_ACTION_TIP_MASH_BUTTON
Definition enums.h:4107
@ BTL_MSG_PLAYER_PARALYZED
Definition enums.h:4072
@ BTL_MSG_ACTION_TIP_NOT_USED_3
Definition enums.h:4124
@ BTL_MSG_HEAL_ONE
Definition enums.h:4088
@ BTL_MSG_ENEMY_ASLEEP
Definition enums.h:4076
@ BTL_MSG_PLAYER_CHARGED
Definition enums.h:4073
@ BTL_MSG_ACTION_TIP_HOLD_LEFT_TIMED
Definition enums.h:4105
@ BTL_MSG_HAMMER_DISABLED_3
Definition enums.h:4134
@ BTL_MSG_CANT_SWITCH_UNUSED
Definition enums.h:4141
@ BTL_MSG_ACTION_TIP_NOT_USED_1
Definition enums.h:4113
@ BTL_MSG_PLAYER_ASLEEP
Definition enums.h:4068
@ BTL_MSG_ENEMY_POISONED
Definition enums.h:4078
@ BTL_MSG_PLAYER_SHRUNK
Definition enums.h:4071
@ BTL_MSG_ENEMY_CANT_MOVE
Definition enums.h:4082
@ BTL_MSG_WATER_BLOCK_BEGIN
Definition enums.h:4095
@ BTL_MSG_47
Definition enums.h:4130
@ BTL_MSG_CANT_MOVE_UNUSED
Definition enums.h:4142
@ BTL_MSG_ACTION_TIP_UNUSED_4
Definition enums.h:4121
@ BTL_MSG_ENEMY_PARALYZED
Definition enums.h:4080
@ BTL_MSG_ACTION_TIP_HOLD_THEN_RELEASE
Definition enums.h:4119
@ BTL_MSG_UNUSED_CLOUD_NINE
Definition enums.h:4102
@ BTL_MSG_NO_JUMP_TARGET
Definition enums.h:4126
@ BTL_MSG_MERLEE_DONE
Definition enums.h:4060
@ BTL_MSG_ACTION_TIP_NOT_USED_2
Definition enums.h:4115
@ BTL_MSG_ACTION_TIP_BREAK_FREE
Definition enums.h:4122
@ BTL_MSG_ACTION_TIP_UNUSED_1
Definition enums.h:4110
@ BTL_MSG_LAST_ACTION_TIP
Definition enums.h:4125
@ BTL_MSG_CLOUD_NINE_END
Definition enums.h:4098
@ BTL_MSG_ACTION_TIP_HOLD_LEFT_AIM
Definition enums.h:4109
@ BTL_MSG_JUMP_DISABLED_3
Definition enums.h:4137
@ BTL_MSG_ENEMY_FROZEN
Definition enums.h:4077
@ BTL_MSG_NO_ITEM_TARGET
Definition enums.h:4128
@ BTL_MSG_ENEMY_DAZED
Definition enums.h:4075
@ BTL_MSG_HEAL_ALL
Definition enums.h:4089
@ BTL_MSG_CHILL_OUT_BEGIN
Definition enums.h:4101
@ BTL_MSG_WATER_BLOCK_END
Definition enums.h:4096
@ BTL_MSG_ACTION_TIP_PRESS_BEFORE_STRIKE
Definition enums.h:4106
@ BTL_MSG_CANT_SELECT_NOW
Definition enums.h:4131
@ BTL_MSG_ACTION_TIP_MASH_BOTH
Definition enums.h:4116
@ BTL_MSG_FIRST_ACTION_TIP
Definition enums.h:4103
@ BTL_MSG_MERLEE_DEF_UP
Definition enums.h:4058
@ BTL_MSG_46
Definition enums.h:4129
@ BTL_MSG_CHARGE_JUMP_MORE
Definition enums.h:4064
@ BTL_MSG_JUMP_DISABLED_2
Definition enums.h:4136
@ BTL_MSG_PARTNER_INJURED
Definition enums.h:4092
@ BTL_MSG_CHARGE_GOOMBARIO_MORE
Definition enums.h:4094
@ BTL_MSG_CANT_SELECT_NOW_ALT
Definition enums.h:4143
@ BTL_MSG_STAR_POWER_RECHARGED
Definition enums.h:4083
@ BTL_MSG_NO_HAMMER_TARGET
Definition enums.h:4127
@ BTL_MSG_DEFENCE_UP
Definition enums.h:4087
@ BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING
Definition enums.h:4104
@ BTL_MSG_ACTION_TIP_PRESS_WITH_TIMING
Definition enums.h:4114
@ BTL_MSG_CANT_CHARGE
Definition enums.h:4065
@ BTL_MSG_CHARGE_HAMMER
Definition enums.h:4061
@ BTL_MSG_CHARGE_GOOMBARIO
Definition enums.h:4093
@ BTL_MSG_CLOUD_NINE_BEGIN
Definition enums.h:4097
@ BTL_MSG_ENEMY_ELECTRIFIED
Definition enums.h:4081
@ BTL_MSG_ATTACK_UP
Definition enums.h:4086
@ BTL_MSG_ACTION_TIP_REDUCE_DAMAGE
Definition enums.h:4123
@ BTL_MSG_CHARGE_JUMP
Definition enums.h:4063
@ BTL_MSG_ENEMY_TRANSPARENT
Definition enums.h:4090
@ BTL_MSG_ACTION_TIP_MASH_LEFT
Definition enums.h:4108
@ BTL_MSG_HAMMER_DISABLED_1
Definition enums.h:4132
@ BTL_MSG_ENEMY_SHRUNK
Definition enums.h:4079
@ BTL_MSG_PLAYER_DAZED
Definition enums.h:4067
@ BTL_MSG_PLAYER_TRANSPARENT
Definition enums.h:4074
@ BTL_MSG_HAMMER_DISABLED_2
Definition enums.h:4133
@ BTL_MSG_STAR_POWER_FILLED
Definition enums.h:4085
@ BTL_MSG_ENEMY_CHARGED
Definition enums.h:4091
@ WINDOW_PRIORITY_0
Definition enums.h:3182
@ MSG_PAL_0F
Definition enums.h:5419
@ WINDOW_UPDATE_SHOW
Definition enums.h:5310
@ WINDOW_UPDATE_SHOW_DARKENED
Definition enums.h:5317
@ WINDOW_UPDATE_HIDE
Definition enums.h:5311
@ WINDOW_UPDATE_SHOW_TRANSPARENT
Definition enums.h:5316
@ ACTOR_FLAG_HALF_HEIGHT
Definition enums.h:3335
@ ACTOR_PART_FLAG_SKIP_SHOCK_EFFECT
Definition enums.h:3365
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3350
@ CAM_BATTLE
Definition enums.h:1801
@ WIN_BTL_POPUP
Definition enums.h:5249
#define ApiStatus_DONE2
Definition evt.h:118
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:1689
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:1846
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_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)
void func_80144218(s32 id)
@ HUD_ELEMENT_FLAG_80
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:13
Window gWindows[64]
Definition windows.c:23