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

Go to the source code of this file.

Data Structures

struct  BonkData
 

Macros

#define TIP_X_PRL   65
 
#define TIP_X_HLT1   55
 
#define TIP_X_HLT2   73
 
#define TIP_X_PBST   64
 
#define TIP_X_MB   67
 
#define TIP_X_ML   56
 
#define TIP_X_HLA1   65
 
#define TIP_X_HLA2   146
 
#define TIP_X_PBS1   86
 
#define TIP_X_PBS2   64
 
#define TIP_X_PBS3   108
 
#define TIP_X_PWT1   105
 
#define TIP_X_PWT2   65
 
#define TIP_X_MB1   63
 
#define TIP_X_MB2   84
 
#define TIP_X_HTT   124
 
#define TIP_X_HTR1   56
 
#define TIP_X_HTR2   53
 
#define TIP_X_MTA1   107
 
#define TIP_X_MTA2   210
 
#define TIP_X_MTA3   56
 
#define TIP_X_BF_RD   64
 
#define TIP_Y_HLT2   31
 
#define TIP_Y_HLA2   32
 
#define TIP_Y_PBS1   13
 
#define TIP_Y_PBS2   13
 
#define TIP_Y_PBS3   13
 
#define TIP_Y_PWT1   13
 
#define TIP_Y_HTR1   31
 
#define TIP_Y_MTA1   13
 
#define TIP_Y_MTA2   15
 
#define TIP_Y_BF_RD   13
 
#define TIP_SCALE1   0.8f
 
#define TIP_SCALE2   0.8f
 

Functions

void btl_bonk_update (void *data)
 
void btl_bonk_render (void *data)
 
void btl_bonk_setup_gfx (void *data)
 
void btl_update_message_popup (void *popup)
 
void btl_show_message_popup (void *popup)
 
void btl_popup_messages_init (void)
 
void btl_popup_messages_delete (void)
 
void btl_popup_messages_update (void)
 
void btl_popup_messages_draw_world_geometry (void)
 
void btl_popup_messages_draw_ui (void)
 
PopupMessagebtl_create_popup (void)
 
void free_popup (PopupMessage *popup)
 
void show_immune_bonk (f32 x, f32 y, f32 z, s32 numStars, s32 startupTime, s32 animDir)
 
void btl_bonk_cleanup (void)
 
void btl_show_battle_message (s32 messageIndex, s32 duration)
 
void btl_show_variable_battle_message (s32 messageIndex, s32 duration, s32 varValue)
 
s32 btl_is_popup_displayed (void)
 
void btl_set_popup_duration (s32 duration)
 
void btl_message_lock_box_pos (void)
 
void btl_message_unlock_box_pos (void)
 
void close_action_command_instruction_popup (void)
 
void btl_message_popup_draw_content (void *data, s32 x, s32 y)
 
void apply_shock_effect (Actor *actor)
 

Variables

s16 BattleMessage_BoxSizesY [] = { 28, 40 }
 
s16 BattleMessage_TextOffsetsY [] = { 0, -2 }
 
s16 BattleMessage_BoxOffsetsY [] = { 0, -12 }
 
Vec3f BonkAnimAccel []
 
Vec3f BonkAnimScale []
 
EntityModelScript EMS_BonkIcon
 
EntityModelScriptBonkModelScripts []
 
s32 BattleMessages []
 
s32 bActorMessages []
 
PopupMessagebPopupMessage = NULL
 
BSS PopupMessage popupMessages [32]
 
BSS s16 BattlePopupMessageVar
 
BSS s16 HID_BattleMessage1
 
BSS s16 HID_BattleMessage2
 
BSS s16 HID_BattleMessage3
 
BSS s16 HID_BattleMessage4
 
BSS b16 ActionCommandTipVisible
 
BSS b16 BattleMessage_BoxPosLocked
 
BSS s16 BattleMessage_CurBoxPosY
 
BSS s16 BattleMessage_CurBoxOffsetY
 
HudScript HES_AimReticle
 
HudScript HES_AimTarget
 
HudScript HES_CDownButton
 
HudScript HES_CLeftButton
 
HudScript HES_CRightButton
 
HudScript HES_CUpButton
 
HudScript HES_Item_MenuBoots1
 
HudScript HES_Item_MenuBoots2
 
HudScript HES_Item_MenuBoots3
 
HudScript HES_Item_MenuHammer1
 
HudScript HES_Item_MenuHammer2
 
HudScript HES_Item_MenuHammer3
 
HudScript HES_Item_MenuItems
 
HudScript HES_MashBButton2
 
HudScript HES_MashCDownButton1
 
HudScript HES_MashCLeftButton
 
HudScript HES_MashCRightButton1
 
HudScript HES_MashCUpButton
 
HudScript HES_RotateStickCW
 
HudScript HES_StickBackAndForth
 
HudScript HES_StickTapLeft
 
HudScript HES_StickTapRight
 
HudScript HES_TimingBlink
 

Data Structure Documentation

◆ BonkData

struct BonkData
Data Fields
b32 alive
s32 entityModelIndex
Vec3f accel
Vec3f vel
s32 moveTime
s32 startupTime
f32 rotZ
f32 rotVelZ
f32 rotY
f32 scale
Vec3f pos
s32 holdTime
f32 alpha

Macro Definition Documentation

◆ TIP_X_PRL

#define TIP_X_PRL   65

Definition at line 1245 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HLT1

#define TIP_X_HLT1   55

Definition at line 1246 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HLT2

#define TIP_X_HLT2   73

Definition at line 1247 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_PBST

#define TIP_X_PBST   64

Definition at line 1248 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_MB

#define TIP_X_MB   67

Definition at line 1249 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_ML

#define TIP_X_ML   56

Definition at line 1250 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HLA1

#define TIP_X_HLA1   65

Definition at line 1251 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HLA2

#define TIP_X_HLA2   146

Definition at line 1252 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_PBS1

#define TIP_X_PBS1   86

Definition at line 1253 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_PBS2

#define TIP_X_PBS2   64

Definition at line 1254 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_PBS3

#define TIP_X_PBS3   108

Definition at line 1255 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_PWT1

#define TIP_X_PWT1   105

Definition at line 1256 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_PWT2

#define TIP_X_PWT2   65

Definition at line 1257 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_MB1

#define TIP_X_MB1   63

Definition at line 1258 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_MB2

#define TIP_X_MB2   84

Definition at line 1259 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HTT

#define TIP_X_HTT   124

Definition at line 1260 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HTR1

#define TIP_X_HTR1   56

Definition at line 1261 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_HTR2

#define TIP_X_HTR2   53

Definition at line 1262 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_MTA1

#define TIP_X_MTA1   107

Definition at line 1263 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_MTA2

#define TIP_X_MTA2   210

Definition at line 1264 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_MTA3

#define TIP_X_MTA3   56

Definition at line 1265 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_X_BF_RD

#define TIP_X_BF_RD   64

Definition at line 1266 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_HLT2

#define TIP_Y_HLT2   31

Definition at line 1267 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_HLA2

#define TIP_Y_HLA2   32

Definition at line 1268 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_PBS1

#define TIP_Y_PBS1   13

Definition at line 1269 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_PBS2

#define TIP_Y_PBS2   13

Definition at line 1270 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_PBS3

#define TIP_Y_PBS3   13

Definition at line 1271 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_PWT1

#define TIP_Y_PWT1   13

Definition at line 1272 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_HTR1

#define TIP_Y_HTR1   31

Definition at line 1273 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_MTA1

#define TIP_Y_MTA1   13

Definition at line 1274 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_MTA2

#define TIP_Y_MTA2   15

Definition at line 1275 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_Y_BF_RD

#define TIP_Y_BF_RD   13

Definition at line 1276 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_SCALE1

#define TIP_SCALE1   0.8f

Definition at line 1277 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

◆ TIP_SCALE2

#define TIP_SCALE2   0.8f

Definition at line 1278 of file popup_messages.c.

Referenced by btl_message_popup_draw_content().

Function Documentation

◆ btl_bonk_update()

void btl_bonk_update ( void * data)

Definition at line 435 of file popup_messages.c.

435 {
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}
BSS s32 PopupMenu_SelectedIndex
#define clamp_angle
@ ENTITY_MODEL_FLAG_HIDDEN
Definition enums.h:5014
@ CAM_BATTLE
Definition enums.h:1801
void clear_entity_model_flags(s32 idx, s32 newFlags)
void exec_entity_model_commandlist(s32 idx)
s32 heap_free(void *ptr)
Definition heap.c:42
void free_entity_model_by_index(s32 idx)
s32 entityModelIndex
void free_popup(PopupMessage *popup)
Camera gCameras[4]
Definition cam_main.c:16

Referenced by show_immune_bonk().

◆ btl_bonk_render()

void btl_bonk_render ( void * data)

Definition at line 492 of file popup_messages.c.

492 {
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}
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
void draw_entity_model_A(s32, Mtx *)

Referenced by show_immune_bonk().

◆ btl_bonk_setup_gfx()

void btl_bonk_setup_gfx ( void * data)

Definition at line 527 of file popup_messages.c.

527 {
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}
Gfx * gMainGfxPos
Definition cam_main.c:14

Referenced by show_immune_bonk().

◆ btl_update_message_popup()

void btl_update_message_popup ( void * popup)

Definition at line 657 of file popup_messages.c.

657 {
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}
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
@ 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_4000
Definition enums.h:3582
@ 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_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_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_UPDATE_HIDE
Definition enums.h:5311
@ WINDOW_UPDATE_SHOW_TRANSPARENT
Definition enums.h:5316
@ WIN_BTL_POPUP
Definition enums.h:5249
void set_window_update(s32 panelID, s32)
Definition windows.c:434
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_free(s32 id)
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:78
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:86
HudScript HES_Item_MenuItems
PopupMessage * bPopupMessage
HudScript HES_TimingBlink
BSS s16 BattleMessage_CurBoxOffsetY
BSS s16 BattleMessage_CurBoxPosY
HudScript HES_MashCDownButton1
HudScript HES_Item_MenuBoots3
HudScript HES_Item_MenuHammer2
HudScript HES_CDownButton
HudScript HES_Item_MenuBoots1
HudScript HES_Item_MenuBoots2
HudScript HES_MashCLeftButton
BSS s16 HID_BattleMessage4
HudScript HES_StickTapRight
HudScript HES_MashCRightButton1
BSS b16 BattleMessage_BoxPosLocked
HudScript HES_StickBackAndForth
HudScript HES_CRightButton
BSS s16 HID_BattleMessage1
BSS s16 HID_BattleMessage2
HudScript HES_Item_MenuHammer3
BSS b16 ActionCommandTipVisible
HudScript HES_StickTapLeft
HudScript HES_Item_MenuHammer1
HudScript HES_MashBButton2
HudScript HES_AimTarget
HudScript HES_CLeftButton
HudScript HES_MashCUpButton
BSS s16 HID_BattleMessage3
HudScript HES_CUpButton
HudScript HES_RotateStickCW
HudScript HES_AimReticle
BattleStatus gBattleStatus
Definition battle.cpp:13
Window gWindows[64]
Definition windows.c:23

Referenced by btl_show_battle_message(), and btl_show_variable_battle_message().

◆ btl_show_message_popup()

void btl_show_message_popup ( void * popup)

Definition at line 1630 of file popup_messages.c.

1630 {
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}
#define get_msg_width
BattleMessages
Definition enums.h:4056
@ WINDOW_PRIORITY_0
Definition enums.h:3182
@ WINDOW_UPDATE_SHOW
Definition enums.h:5310
@ WINDOW_UPDATE_SHOW_DARKENED
Definition enums.h:5317
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 set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void *drawContents, void *drawContentsArg, s8 parent)
Definition windows.c:373
s32 get_msg_lines(s32 messageID)
Definition msg.c:1985
s32 bActorMessages[]
s16 BattleMessage_BoxOffsetsY[]
void btl_message_popup_draw_content(void *data, s32 x, s32 y)
BSS s16 BattlePopupMessageVar
s16 BattleMessage_BoxSizesY[]

Referenced by btl_show_battle_message(), and btl_show_variable_battle_message().

◆ btl_popup_messages_init()

void btl_popup_messages_init ( void )

Definition at line 272 of file popup_messages.c.

272 {
273 s32 i;
274
275 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
277 popup->active = FALSE;
278 popup->data.bonk = NULL;
279 }
280}
BSS PopupMessage popupMessages[32]
#define ARRAY_COUNT(arr)
Definition macros.h:40

Referenced by initialize_battle().

◆ btl_popup_messages_delete()

void btl_popup_messages_delete ( void )

Definition at line 282 of file popup_messages.c.

282 {
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}

◆ btl_popup_messages_update()

void btl_popup_messages_update ( void )

Definition at line 295 of file popup_messages.c.

295 {
296 s32 i;
297
298 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
300 if (popup->active && popup->updateFunc != NULL) {
302 }
303 }
304}
PopupMessageCallback updateFunc

Referenced by btl_update().

◆ btl_popup_messages_draw_world_geometry()

void btl_popup_messages_draw_world_geometry ( void )

Definition at line 306 of file popup_messages.c.

306 {
307 s32 i;
308
309 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
311 if (popup->active && popup->renderWorldFunc != NULL) {
313 }
314 }
315}
PopupMessageCallback renderWorldFunc

Referenced by btl_render_actors().

◆ btl_popup_messages_draw_ui()

void btl_popup_messages_draw_ui ( void )

Definition at line 317 of file popup_messages.c.

317 {
318 s32 i;
319
320 for (i = 0; i < ARRAY_COUNT(popupMessages); i++) {
322 if (popup->active && popup->renderUIFunc != NULL) {
324 }
325 }
326}
PopupMessageCallback renderUIFunc

Referenced by btl_draw_ui().

◆ btl_create_popup()

PopupMessage * btl_create_popup ( void )

Definition at line 328 of file popup_messages.c.

328 {
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}

Referenced by btl_show_battle_message(), btl_show_variable_battle_message(), and show_immune_bonk().

◆ free_popup()

void free_popup ( PopupMessage * popup)

Definition at line 342 of file popup_messages.c.

342 {
343 if (popup->data.bonk != NULL) {
344 heap_free(popup->data.bonk);
345 popup->data.bonk = NULL;
346 }
347 popup->active = FALSE;
348}

Referenced by btl_bonk_update(), and btl_update_message_popup().

◆ show_immune_bonk()

void show_immune_bonk ( f32 x,
f32 y,
f32 z,
s32 numStars,
s32 startupTime,
s32 animDir )

Definition at line 350 of file popup_messages.c.

350 {
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}
s32 b32
#define ASSERT(condition)
s32 load_entity_model(EntityModelScript *cmdList)
@ BS_FLAGS1_SUPER_HIT
Definition enums.h:3578
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3575
s32 sign(s32 value)
Definition 43F0.c:374
void set_entity_model_flags(s32 idx, s32 newFlags)
void bind_entity_model_setupGfx(s32 idx, void *setupGfxCallbackArg0, void(*fpSetupGfxCallback)(void *))
void * heap_malloc(s32 size)
Definition heap.c:34
Vec3f BonkAnimScale[]
void btl_bonk_setup_gfx(void *data)
PopupMessage * btl_create_popup(void)
void btl_bonk_update(void *data)
Vec3f BonkAnimAccel[]
EntityModelScript * BonkModelScripts[]
void btl_bonk_render(void *data)

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ btl_bonk_cleanup()

void btl_bonk_cleanup ( void )

Definition at line 537 of file popup_messages.c.

537 {
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}

Referenced by btl_update().

◆ btl_show_battle_message()

void btl_show_battle_message ( s32 messageIndex,
s32 duration )

Definition at line 577 of file popup_messages.c.

577 {
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}
void btl_update_message_popup(void *popup)
void btl_show_message_popup(void *popup)

Referenced by btl_main_menu_update(), btl_state_update_begin_player_turn(), btl_state_update_enemy_move(), btl_state_update_partner_move(), btl_state_update_player_move(), and btl_state_update_select_target().

◆ btl_show_variable_battle_message()

void btl_show_variable_battle_message ( s32 messageIndex,
s32 duration,
s32 varValue )

Definition at line 602 of file popup_messages.c.

602 {
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}

Referenced by btl_state_update_partner_menu(), btl_state_update_peach_menu(), btl_state_update_player_menu(), and btl_state_update_twink_menu().

◆ btl_is_popup_displayed()

◆ btl_set_popup_duration()

void btl_set_popup_duration ( s32 duration)

Definition at line 630 of file popup_messages.c.

630 {
632
634 popup->duration = duration;
635 }
636}

Referenced by action_command_free(), and update().

◆ btl_message_lock_box_pos()

void btl_message_lock_box_pos ( void )

Definition at line 638 of file popup_messages.c.

638 {
640}

◆ btl_message_unlock_box_pos()

void btl_message_unlock_box_pos ( void )

Definition at line 642 of file popup_messages.c.

642 {
644}

◆ close_action_command_instruction_popup()

void close_action_command_instruction_popup ( void )

Definition at line 646 of file popup_messages.c.

646 {
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}
@ BTL_MSG_LAST_ACTION_TIP
Definition enums.h:4125
@ BTL_MSG_FIRST_ACTION_TIP
Definition enums.h:4103

Referenced by action_command_free(), and btl_state_update_player_move().

◆ btl_message_popup_draw_content()

void btl_message_popup_draw_content ( void * data,
s32 x,
s32 y )

Definition at line 1281 of file popup_messages.c.

1281 {
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}
#define draw_msg
@ MSG_PAL_0F
Definition enums.h:5419
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_draw_clipped(s32 id)
void func_80144218(s32 id)
#define TIP_Y_PWT1
#define TIP_X_BF_RD
#define TIP_X_PWT1
#define TIP_SCALE1
s16 BattleMessage_TextOffsetsY[]
#define TIP_X_PBS2
#define TIP_Y_MTA2
#define TIP_X_HTT
#define TIP_Y_PBS2
#define TIP_X_MTA3
#define TIP_X_MTA1
#define TIP_X_HLT2
#define TIP_Y_HTR1
#define TIP_X_HLA2
#define TIP_X_PWT2
#define TIP_Y_PBS3
#define TIP_SCALE2
#define TIP_X_HLT1
#define TIP_X_PBST
#define TIP_X_HLA1
#define TIP_X_PBS3
#define TIP_Y_MTA1
#define TIP_X_PBS1
#define TIP_Y_PBS1
#define TIP_X_MTA2
#define TIP_X_MB1
#define TIP_X_PRL
#define TIP_Y_HLA2
#define TIP_Y_HLT2
#define TIP_X_ML
#define TIP_Y_BF_RD
#define TIP_X_HTR1
#define TIP_X_HTR2
#define TIP_X_MB
#define TIP_X_MB2

Referenced by btl_show_message_popup().

◆ apply_shock_effect()

void apply_shock_effect ( Actor * actor)

Definition at line 2061 of file popup_messages.c.

2061 {
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}
f32 scalingFactor
struct ActorPart * partsTable
Vec2bu size
@ 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

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), calc_partner_test_enemy(), calc_player_damage_enemy(), and show_damage_fx().

Variable Documentation

◆ BattleMessage_BoxSizesY

s16 BattleMessage_BoxSizesY[] = { 28, 40 }

Definition at line 52 of file popup_messages.c.

52{ 28, 40 };

Referenced by btl_show_message_popup().

◆ BattleMessage_TextOffsetsY

s16 BattleMessage_TextOffsetsY[] = { 0, -2 }

Definition at line 53 of file popup_messages.c.

53{ 0, -2 };

Referenced by btl_message_popup_draw_content().

◆ BattleMessage_BoxOffsetsY

s16 BattleMessage_BoxOffsetsY[] = { 0, -12 }

Definition at line 54 of file popup_messages.c.

54{ 0, -12 };

Referenced by btl_show_message_popup().

◆ BonkAnimAccel

Vec3f BonkAnimAccel[]
Initial value:
= {
{ 0.0f, 4.5f, 0.0f },
{ 1.0f, 4.0f, 0.0f },
{ 2.0f, 3.0f, 0.0f },
{ 3.0f, 2.0f, 0.0f },
{ 3.5f, 1.0f, 0.0f },
{ 4.0f, 0.0f, 0.0f },
{ 4.5f, 0.0f, 0.0f },
{ 5.0f, 0.0f, 0.0f },
{ 4.5f, 0.0f, 0.0f },
{ 4.0f, 0.0f, 0.0f },
{ 3.5f, -1.0f, 0.0f },
{ 3.0f, -2.0f, 0.0f },
{ 2.0f, -3.0f, 0.0f },
{ 1.0f, -4.0f, 0.0f },
{ 0.0f, -4.5f, 0.0f },
}

Definition at line 57 of file popup_messages.c.

57 {
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};

Referenced by show_immune_bonk().

◆ BonkAnimScale

Vec3f BonkAnimScale[]
Initial value:
= {
{ 1.0f, 1.0f, 1.0f },
{ 0.8f, 0.8f, 0.8f },
{ 0.9f, 0.9f, 0.9f },
{ 1.1f, 1.1f, 1.1f },
{ 1.0f, 1.0f, 1.0f },
{ 0.8f, 0.8f, 0.8f },
{ 0.9f, 0.9f, 0.9f },
{ 1.1f, 1.1f, 1.1f },
{ 1.0f, 1.0f, 1.0f },
{ 0.8f, 0.8f, 0.8f },
{ 0.9f, 0.9f, 0.9f },
{ 1.1f, 1.1f, 1.1f },
{ 1.0f, 1.0f, 1.0f },
{ 0.8f, 0.8f, 0.8f },
{ 0.9f, 0.9f, 0.9f },
}

Definition at line 75 of file popup_messages.c.

75 {
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};

Referenced by show_immune_bonk().

◆ EMS_BonkIcon

EntityModelScript EMS_BonkIcon
extern

Definition at line 72 of file entity_model_icons.c.

◆ BonkModelScripts

◆ BattleMessages

Definition at line 101 of file popup_messages.c.

101 {
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};

◆ bActorMessages

◆ bPopupMessage

◆ popupMessages

◆ BattlePopupMessageVar

◆ HID_BattleMessage1

BSS s16 HID_BattleMessage1

Definition at line 231 of file popup_messages.c.

Referenced by btl_message_popup_draw_content(), and btl_update_message_popup().

◆ HID_BattleMessage2

BSS s16 HID_BattleMessage2

Definition at line 232 of file popup_messages.c.

Referenced by btl_message_popup_draw_content(), and btl_update_message_popup().

◆ HID_BattleMessage3

BSS s16 HID_BattleMessage3

Definition at line 233 of file popup_messages.c.

Referenced by btl_message_popup_draw_content(), and btl_update_message_popup().

◆ HID_BattleMessage4

BSS s16 HID_BattleMessage4

Definition at line 234 of file popup_messages.c.

Referenced by btl_message_popup_draw_content(), and btl_update_message_popup().

◆ ActionCommandTipVisible

◆ BattleMessage_BoxPosLocked

◆ BattleMessage_CurBoxPosY

◆ BattleMessage_CurBoxOffsetY

◆ HES_AimReticle

HudScript HES_AimReticle
extern

Definition at line 828 of file battle_ui_gfx.c.

828 {
831 hs_Loop
835 hs_End
836};
#define hs_SetTileSize(size)
#define hs_SetVisible
#define hs_End
#define hs_Restart
#define hs_Loop
#define hs_SetCI(time, name)
@ HUD_ELEMENT_SIZE_32x32
Definition hud_element.h:46

Referenced by btl_update_message_popup().

◆ HES_AimTarget

HudScript HES_AimTarget
extern

◆ HES_CDownButton

HudScript HES_CDownButton
extern

Definition at line 384 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_CLeftButton

HudScript HES_CLeftButton
extern

Definition at line 332 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_CRightButton

HudScript HES_CRightButton
extern

Definition at line 346 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_CUpButton

HudScript HES_CUpButton
extern

Definition at line 370 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_Item_MenuBoots1

HudScript HES_Item_MenuBoots1
extern

◆ HES_Item_MenuBoots2

HudScript HES_Item_MenuBoots2
extern

◆ HES_Item_MenuBoots3

HudScript HES_Item_MenuBoots3
extern

◆ HES_Item_MenuHammer1

HudScript HES_Item_MenuHammer1
extern

◆ HES_Item_MenuHammer2

HudScript HES_Item_MenuHammer2
extern

◆ HES_Item_MenuHammer3

HudScript HES_Item_MenuHammer3
extern

◆ HES_Item_MenuItems

HudScript HES_Item_MenuItems
extern

◆ HES_MashBButton2

HudScript HES_MashBButton2
extern

Definition at line 322 of file battle_ui_gfx.c.

322 {
324 hs_SetCustomSize(48, 40)
325 hs_Loop
329 hs_End
330};
#define hs_SetCustomSize(arg0, arg1)

Referenced by btl_update_message_popup().

◆ HES_MashCDownButton1

HudScript HES_MashCDownButton1
extern

Definition at line 388 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_MashCLeftButton

HudScript HES_MashCLeftButton
extern

Definition at line 336 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_MashCRightButton1

HudScript HES_MashCRightButton1
extern

Definition at line 350 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_MashCUpButton

HudScript HES_MashCUpButton
extern

Definition at line 374 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().

◆ HES_RotateStickCW

HudScript HES_RotateStickCW
extern

Definition at line 2417 of file global_hud_scripts.c.

2417 {
2419 hs_Loop
2420 hs_SetCustomSize(32, 32)
2421 hs_SetTexelOffset(0, 0)
2423 hs_SetCustomSize(40, 32)
2424 hs_SetTexelOffset(5, 0)
2426 hs_SetCustomSize(32, 32)
2427 hs_SetTexelOffset(0, 0)
2429 hs_SetCustomSize(40, 32)
2430 hs_SetTexelOffset(-4, 0)
2433 hs_End
2434};
#define hs_SetTexelOffset(x, y)

Referenced by btl_update_message_popup().

◆ HES_StickBackAndForth

HudScript HES_StickBackAndForth
extern

Definition at line 2448 of file global_hud_scripts.c.

Referenced by btl_update_message_popup().

◆ HES_StickTapLeft

HudScript HES_StickTapLeft
extern

Definition at line 2480 of file global_hud_scripts.c.

2480 {
2482 hs_Loop
2483 hs_SetCustomSize(40, 32)
2484 hs_SetTexelOffset(-4, 0)
2486 hs_SetCustomSize(32, 32)
2487 hs_SetTexelOffset(0, 0)
2490 hs_End
2491};

Referenced by btl_update_message_popup().

◆ HES_StickTapRight

HudScript HES_StickTapRight
extern

Definition at line 2559 of file global_hud_scripts.c.

2559 {
2561 hs_Loop
2562 hs_SetCustomSize(32, 32)
2563 hs_SetTexelOffset(0, 0)
2565 hs_SetCustomSize(40, 32)
2566 hs_SetTexelOffset(5, 0)
2569 hs_End
2570};

Referenced by btl_update_message_popup().

◆ HES_TimingBlink

HudScript HES_TimingBlink
extern

Definition at line 424 of file battle_ui_gfx.c.

Referenced by btl_update_message_popup().