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

Go to the source code of this file.

Macros

#define DIGIT_WIDTH   6
 

Functions

void btl_render_actors (void)
 
void tattle_cam_pre_render (Camera *)
 
void tattle_cam_post_render (Camera *)
 
void btl_draw_enemy_health_bars (void)
 
void btl_update_starpoints_display (void)
 
void get_stick_input_radial (f32 *angle, f32 *magnitude)
 
void func_8023E104 (void)
 
void func_8023E11C (void)
 
void initialize_battle (void)
 
void func_8023E3FC (void)
 
void update_nonplayer_actor_shadows (void)
 
void btl_update (void)
 
void btl_draw_ui (void)
 
u16 blend_tattle_background_channel (u16 a, s32 b, s32 alpha)
 
void btl_save_world_cameras (void)
 
void btl_restore_world_cameras (void)
 
void btl_delete_actor (Actor *actor)
 
void btl_delete_player_actor (Actor *player)
 

Variables

f32 D_802809F0 = 0.0f
 
s8 D_802809F4 = 0
 
s8 D_802809F5 = 0
 
s16 D_802809F6 = -1
 
s16 DemoBattleBeginDelay = 0
 
u16 gTattleBgTextureYOffset = 0
 
BSS s32 bSavedPartner
 
BSS s32 bSavedOverrideFlags
 
BSS s32 StarPointsBasePosX
 
BSS s32 StarPointsBasePosY
 
BSS s32 StarPointsMoveInterpAmt
 
BSS s32 D_8029DA4C
 
BSS Camera SavedWorldCameras [ARRAY_COUNT(gCameras)]
 
BSS f32 SavedWorldPlayerPosX
 
BSS f32 SavedWorldPlayerPosY
 
BSS f32 SavedWorldPlayerPosZ
 
BSS s32 D_8029EFBC
 
BSS s32 BtlStarPointTensHIDs [10]
 
BSS s32 BtlStarPointShinesHIDs [10]
 
BSS s32 BtlStarPointOnesHIDs [10]
 
BSS PAL_BIN gTattleBgPalette [0x100]
 
HudScript HES_HPDigit0
 
HudScript HES_HPDigit1
 
HudScript HES_HPDigit2
 
HudScript HES_HPDigit3
 
HudScript HES_HPDigit4
 
HudScript HES_HPDigit5
 
HudScript HES_HPDigit6
 
HudScript HES_HPDigit7
 
HudScript HES_HPDigit8
 
HudScript HES_HPDigit9
 
HudScriptbHPDigitHudScripts []
 
s32 BattleScreenFadeAmt = 255
 
EvtScript BtlPutPartnerAway
 
EvtScript BtlBringPartnerOut
 
HudScript HES_HPBar
 
HudScript HES_SmallStarPoint
 
HudScript HES_ItemStarPoint
 
HudScript HES_StatusSPShine
 

Macro Definition Documentation

◆ DIGIT_WIDTH

#define DIGIT_WIDTH   6

Function Documentation

◆ btl_render_actors()

void btl_render_actors ( void )

Definition at line 620 of file 16C8E0.c.

620 {
621 BattleStatus* battleStatus = &gBattleStatus;
622 RenderTask renderTask;
623 RenderTask* renderTaskPtr = &renderTask;
624 Actor* actor;
625 s32 i;
626
629 if (battleStatus->initBattleCallback != NULL) {
630 battleStatus->initBattleCallback();
631 }
632 if (battleStatus->flags1 & BS_FLAGS1_ACTORS_VISIBLE) {
634
636 for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
637 actor = battleStatus->enemyActors[i];
638
639 if (actor != NULL && !(actor->flags & ACTOR_FLAG_INVISIBLE)) {
640 renderTaskPtr->appendGfxArg = (void*)i;
641 renderTaskPtr->appendGfx = appendGfx_enemy_actor;
642 renderTaskPtr->dist = actor->curPos.z;
643 renderTaskPtr->renderMode = actor->renderMode;
644 queue_render_task(renderTaskPtr);
645
646 if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
647 renderTaskPtr->appendGfxArg = actor;
648 renderTaskPtr->appendGfx = appendGfx_enemy_actor_blur;
649 renderTaskPtr->dist = actor->curPos.z;
651 queue_render_task(renderTaskPtr);
652 }
653
654 if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) {
655 renderTaskPtr->appendGfxArg = actor;
657 renderTaskPtr->dist = actor->curPos.z;
658 renderTaskPtr->renderMode = actor->renderMode;
659 queue_render_task(renderTaskPtr);
660 }
661 }
662 }
663
664 actor = battleStatus->partnerActor;
665 if (actor != NULL && !(actor->flags & ACTOR_FLAG_INVISIBLE)) {
666 renderTaskPtr->appendGfxArg = NULL;
667 renderTaskPtr->appendGfx = appendGfx_partner_actor;
668 renderTaskPtr->dist = actor->curPos.z;
669 renderTaskPtr->renderMode = actor->renderMode;
670 queue_render_task(renderTaskPtr);
671
672 if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
673 renderTaskPtr->appendGfxArg = actor;
675 renderTaskPtr->dist = actor->curPos.z;
677 queue_render_task(renderTaskPtr);
678 }
679
680 if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) {
681 renderTaskPtr->appendGfxArg = NULL;
683 renderTaskPtr->dist = actor->curPos.z;
684 renderTaskPtr->renderMode = actor->renderMode;
685 queue_render_task(renderTaskPtr);
686 }
687 }
688
689 actor = battleStatus->playerActor;
690 if (actor != NULL && !(actor->flags & ACTOR_FLAG_INVISIBLE)) {
691 renderTaskPtr->appendGfxArg = NULL;
692 renderTaskPtr->appendGfx = appendGfx_player_actor;
693 renderTaskPtr->dist = actor->curPos.z;
694 renderTaskPtr->renderMode = actor->renderMode;
695 queue_render_task(renderTaskPtr);
696
697 if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
698 renderTaskPtr->appendGfxArg = actor;
699 renderTaskPtr->appendGfx = (void (*) (void*)) appendGfx_player_actor_blur;
700 renderTaskPtr->dist = actor->curPos.z;
702 queue_render_task(renderTaskPtr);
703 }
704
705 if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) {
706 renderTaskPtr->appendGfxArg = NULL;
708 renderTaskPtr->dist = actor->curPos.z;
709 renderTaskPtr->renderMode = actor->renderMode;
710 queue_render_task(renderTaskPtr);
711 }
712 }
713 }
714 }
715 }
716}
Vec3f curPos
#define queue_render_task
@ BS_FLAGS1_ACTORS_VISIBLE
Definition enums.h:3565
@ BS_REFLECT_FLOOR
Definition enums.h:3626
@ BATTLE_STATE_0
Definition enums.h:3631
@ RENDER_MODE_SURFACE_XLU_LAYER3
Definition enums.h:3299
@ ACTOR_FLAG_INVISIBLE
Actor is not rendered.
Definition enums.h:3324
@ ACTOR_FLAG_BLUR_ENABLED
Definition enums.h:3344
@ CAM_TATTLE
Definition enums.h:1802
@ CAM_BATTLE
Definition enums.h:1801
void func_80255FD8(void)
void btl_popup_messages_draw_world_geometry(void)
void appendGfx_player_actor(void *)
void appendGfx_player_actor_reflection(void *)
void appendGfx_partner_actor(void *)
void appendGfx_player_actor_blur(Actor *)
void appendGfx_enemy_actor_blur(void *)
void appendGfx_enemy_actor(void *)
void appendGfx_partner_actor_blur(void *)
void appendGfx_partner_actor_reflection(void *)
void appendGfx_enemy_actor_reflection(void *)
#define ARRAY_COUNT(arr)
Definition macros.h:40
void(* initBattleCallback)(void)
struct Actor * partnerActor
struct Actor * playerActor
struct Actor * enemyActors[24]
void * appendGfxArg
void(* appendGfx)(void *)
s32 gBattleState
Definition battle.c:10
BattleStatus gBattleStatus
Definition battle.c:11
s16 gCurrentCamID
Definition cam_main.c:13

Referenced by initialize_battle().

◆ tattle_cam_pre_render()

void tattle_cam_pre_render ( Camera * camera)

Definition at line 722 of file 16C8E0.c.

722 {
724 s32 fogEnabled = FALSE;
725 u8 r1, g1, b1, a1;
726 s32 fogR, fogG, fogB, fogA;
727 s32 i;
728
729 s32 lineHeight;
730 s32 numLines;
731 s32 bgWidth, bgHeight;
732 s32 posX, posY;
733 s32 texOffsetX;
734 s32 extraHeight;
735 s16 texOffsetY;
736
738
739 if (is_world_fog_enabled()) {
740 fogEnabled = TRUE;
741 get_world_fog_color(&fogR, &fogG, &fogB, &fogA);
743 mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1);
744 if (fogA == 255) {
745 for (i = 0; i < ARRAY_COUNT(gTattleBgPalette); i++) {
746 gTattleBgPalette[i] = 1;
747 }
748 } else {
749 for (i = 0; i < ARRAY_COUNT(gTattleBgPalette); i++) {
750 u16 palColor = gGameStatusPtr->backgroundPalette[i];
751 u16 blendedB = blend_tattle_background_channel(UNPACK_PAL_B(palColor), fogB >> 3, fogA);
752 u16 blendedG = blend_tattle_background_channel(UNPACK_PAL_G(palColor), fogG >> 3, fogA);
753 u16 blendedR = blend_tattle_background_channel(UNPACK_PAL_R(palColor), fogR >> 3, fogA);
754 gTattleBgPalette[i] = blendedB << 1 | blendedG << 6 | blendedR << 11 | 1;
755 }
756 }
757 }
758
760 gDPPipeSync(gMainGfxPos++);
761 gDPSetCycleType(gMainGfxPos++, G_CYC_COPY);
762 gDPSetTexturePersp(gMainGfxPos++, G_TP_NONE);
763 gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16);
764 gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGB, G_CC_DECALRGB);
765 gDPSetRenderMode(gMainGfxPos++, G_RM_NOOP, G_RM_NOOP2);
766 gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT);
767 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, cam->viewportStartX, cam->viewportStartY, cam->viewportStartX + cam->viewportW - 1, cam->viewportStartY + cam->viewportH - 1);
768 gDPPipeSync(gMainGfxPos++);
769 if (!fogEnabled) {
770 gDPLoadTLUT_pal256(gMainGfxPos++, gGameStatusPtr->backgroundPalette);
771 } else {
772 gDPLoadTLUT_pal256(gMainGfxPos++, gTattleBgPalette);
773 }
775 bgHeight = gGameStatusPtr->backgroundMaxY;
776 texOffsetX = 0;
777 lineHeight = 2048 / bgWidth;
778 numLines = gGameStatusPtr->backgroundMaxY / lineHeight;
779 extraHeight = gGameStatusPtr->backgroundMaxY % lineHeight;
780 posX = cam->viewportStartX;
781 posY = cam->viewportStartY;
782 for (i = 0; i < numLines; i++) {
783 texOffsetY = gTattleBgTextureYOffset + lineHeight * i;
784 if (texOffsetY > gGameStatusPtr->backgroundMaxY) {
785 texOffsetY -= gGameStatusPtr->backgroundMaxY;
786 }
787 gDPLoadTextureTile(gMainGfxPos++, gGameStatusPtr->backgroundRaster + bgWidth * texOffsetY,
788 G_IM_FMT_CI, G_IM_SIZ_8b, bgWidth, 6,
789 0, 0, 295, 5, 0,
790 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
791
792 gSPTextureRectangle(gMainGfxPos++, posX * 4, (lineHeight * i + posY) * 4,
793 (texOffsetX + posX - 1) * 4, (lineHeight * i + lineHeight - 1 + posY) * 4,
794 G_TX_RENDERTILE, bgWidth * 32, 0, 4096, 1024);
795 gSPTextureRectangle(gMainGfxPos++, (texOffsetX + posX) * 4, (lineHeight * i + posY) * 4,
796 (bgWidth + posX - 1) * 4, (lineHeight * i + lineHeight - 1 + posY) * 4,
797 G_TX_RENDERTILE, 0, 0, 4096, 1024);
798 }
799 if (extraHeight != 0) {
800 texOffsetY = gTattleBgTextureYOffset + lineHeight * i;
801 if (texOffsetY > gGameStatusPtr->backgroundMaxY) {
802 texOffsetY -= gGameStatusPtr->backgroundMaxY;
803 }
804 gDPLoadTextureTile(gMainGfxPos++, gGameStatusPtr->backgroundRaster + bgWidth * texOffsetY,
805 G_IM_FMT_CI, G_IM_SIZ_8b, bgWidth, extraHeight,
806 0, 0, 295, extraHeight - 1, 0,
807 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
808 gSPTextureRectangle(gMainGfxPos++, posX * 4, (i * lineHeight + posY) * 4,
809 (texOffsetX + posX - 1) * 4, (bgHeight + - 1 + posY) * 4,
810 G_TX_RENDERTILE, bgWidth * 32, 0, 4096, 1024);
811 gSPTextureRectangle(gMainGfxPos++, (texOffsetX + posX) * 4, (i * lineHeight + posY) * 4,
812 (bgWidth + posX - 1) * 4, (bgHeight - 1 + posY) * 4,
813 G_TX_RENDERTILE, 0, 0, 4096, 1024);
814 }
815 }
816
817 gSPViewport(gMainGfxPos++, &cam->vp);
818 gSPClearGeometryMode(gMainGfxPos++, G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
819 gSPTexture(gMainGfxPos++, 0, 0, 0, G_TX_RENDERTILE, G_OFF);
820 gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
821 gDPPipelineMode(gMainGfxPos++, G_PM_NPRIMITIVE);
822 gDPSetScissorFrac(gMainGfxPos++, G_SC_NON_INTERLACE, cam->viewportStartX * 4.0f, cam->viewportStartY * 4.0f, (cam->viewportStartX + cam->viewportW) * 4.0f, (cam->viewportStartY + cam->viewportH) * 4.0f);
823 gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
824 gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
825 gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
826 gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
827 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
828 gDPSetTextureConvert(gMainGfxPos++, G_TC_FILT);
829 gDPSetCombineMode(gMainGfxPos++, G_CC_SHADE, G_CC_SHADE);
830 gDPSetCombineKey(gMainGfxPos++, G_CK_NONE);
831 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
832 gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
833 gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
834 gSPClipRatio(gMainGfxPos++, FRUSTRATIO_2);
835 gDPPipeSync(gMainGfxPos++);
836 gDPSetCycleType(gMainGfxPos++, G_CYC_FILL);
837 gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer));
838 gDPSetFillColor(gMainGfxPos++, PACK_FILL_DEPTH(G_MAXFBZ, 0));
839 gDPFillRectangle(gMainGfxPos++, cam->viewportStartX, cam->viewportStartY, cam->viewportStartX + cam->viewportW - 1, cam->viewportStartY + cam->viewportH - 1);
840 gDPPipeSync(gMainGfxPos++);
841 gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
842
844 gDPSetCycleType(gMainGfxPos++, G_CYC_FILL);
845 gDPSetFillColor(gMainGfxPos++, PACK_FILL_COLOR(cam->bgColor[0], cam->bgColor[1], cam->bgColor[2], 1));
846 gDPFillRectangle(gMainGfxPos++, cam->viewportStartX, cam->viewportStartY, cam->viewportStartX + cam->viewportW - 1, cam->viewportStartY + cam->viewportH - 1);
847 }
848
849 gDPPipeSync(gMainGfxPos++);
850 gSPPerspNormalize(gMainGfxPos++, cam->perspNorm);
852 gSPMatrix(gMainGfxPos++, &gDisplayContext->camPerspMatrix[gCurrentCamID], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
853}
u16 blend_tattle_background_channel(u16 a, s32 b, s32 alpha)
Definition 16C8E0.c:718
BSS PAL_BIN gTattleBgPalette[0x100]
Definition 16C8E0.c:30
u16 gTattleBgTextureYOffset
Definition 16C8E0.c:14
u16 * nuGfxCfb_ptr
Definition cam_main.c:14
u16 * backgroundPalette
#define guMtxF2L
#define mdl_get_shroud_tint_params
@ BACKGROUND_FLAG_TEXTURE
Definition enums.h:6285
s32 is_world_fog_enabled(void)
Definition model.c:3796
void hide_foreground_models_unchecked(void)
Definition 190B20.c:2963
void get_world_fog_color(s32 *r, s32 *g, s32 *b, s32 *a)
Definition model.c:3805
u16 * nuGfxZBuffer
Definition main.c:46
#define UNPACK_PAL_B(color)
Definition macros.h:269
#define UNPACK_PAL_R(color)
Definition macros.h:267
#define SCREEN_WIDTH
Definition macros.h:105
#define UNPACK_PAL_G(color)
Definition macros.h:268
#define PACK_FILL_DEPTH(z, dz)
Definition macros.h:164
#define PACK_FILL_COLOR(r, g, b, a)
Definition macros.h:163
s16 bgColor[3]
s16 viewportStartX
s16 viewportStartY
Matrix4f mtxPerspective
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Camera gCameras[4]
Definition cam_main.c:17
Gfx * gMainGfxPos
Definition cam_main.c:15
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by initialize_battle().

◆ tattle_cam_post_render()

void tattle_cam_post_render ( Camera * camera)

Definition at line 855 of file 16C8E0.c.

855 {
857}
void show_foreground_models_unchecked(void)
Definition 190B20.c:2978

Referenced by initialize_battle().

◆ btl_draw_enemy_health_bars()

void btl_draw_enemy_health_bars ( void )

Definition at line 859 of file 16C8E0.c.

859 {
860 BattleStatus* battleStatus = &gBattleStatus;
861
863 return;
864 }
865
867 s32 i;
868
869 for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
870 Actor* enemy = battleStatus->enemyActors[i];
871
872 if (enemy != NULL) {
873 s32 currentHP;
874 s32 temp;
875 s32 ones;
876
877 currentHP = enemy->curHP;
878 temp = (currentHP * 25) / enemy->maxHP;
879
880 if (temp < enemy->healthFraction) {
881 enemy->healthFraction -= 2;
882 if (enemy->healthFraction < temp) {
883 enemy->healthFraction = temp;
884 }
885 }
886
887 if (enemy->healthFraction < temp) {
888 enemy->healthFraction += 2;
889 if (enemy->healthFraction > temp) {
890 enemy->healthFraction = temp;
891 }
892 }
893
897 ) {
898 f32 x = enemy->healthBarPos.x;
899 f32 y = enemy->healthBarPos.y;
900 f32 z = enemy->healthBarPos.z;
901
902 if (enemy->healthBarPos.y >= -500) {
903 s32 screenX, screenY, screenZ;
904 s32 id;
905 s32 nextDigitXOffset;
906
907 get_screen_coords(CAM_BATTLE, x, y, z, &screenX, &screenY, &screenZ);
908 screenY += 16;
909 id = D_8029EFBC;
912 hud_element_set_render_pos(id, screenX, screenY);
914
915 #define DIGIT_WIDTH 6
916 nextDigitXOffset = DIGIT_WIDTH;
917 id = D_8029EFBC;
918 // draw all digits
919 while (TRUE) {
920 s32 digit = currentHP % 10;
921
924 btl_draw_prim_quad(0, 0, 0, 0, screenX + nextDigitXOffset, screenY + 2, 8, 8);
925 hud_element_set_render_pos(id, screenX + nextDigitXOffset + 4, screenY + 6);
927
928 if (currentHP < 10) {
929 break;
930 }
931
932 currentHP /= 10;
933 nextDigitXOffset -= DIGIT_WIDTH;
934 }
935 #undef DIGIT_WIDTH
936
937 temp = enemy->healthFraction;
938 temp = 25 - temp;
939 btl_draw_prim_quad(168, 0, 0, 255, screenX + 11 - temp, screenY - 7, temp, 1);
940 btl_draw_prim_quad(255, 0, 0, 255, screenX + 11 - temp, screenY - 6, temp, 4);
941 }
942 }
943 }
944 }
945 }
946}
#define DIGIT_WIDTH
HudScript HES_HPBar
BSS s32 D_8029EFBC
Definition 16C8E0.c:26
HudScript * bHPDigitHudScripts[]
Definition 16C8E0.c:43
s8 healthFraction
Vec3s healthBarPos
@ BS_FLAGS1_MENU_OPEN
Definition enums.h:3566
@ ACTOR_FLAG_HEALTH_BAR_HIDDEN
Definition enums.h:3338
@ ACTOR_FLAG_TARGET_ONLY
Battle ends even if undefeated. No turn.
Definition enums.h:3334
@ ACTOR_FLAG_NO_HEALTH_BAR
Definition enums.h:3337
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:410
void btl_draw_prim_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 arg6, u16 arg7)
Definition 190B20.c:2931
s32 is_actor_health_bar_visible(Actor *)
Definition 181810.c:503
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_depth(s32 id, s32 z)
void hud_element_draw_next(s32 id)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_draw_clipped(s32 id)

Referenced by btl_draw_ui().

◆ btl_update_starpoints_display()

void btl_update_starpoints_display ( void )

Definition at line 948 of file 16C8E0.c.

948 {
949 BattleStatus* battleStatus = &gBattleStatus;
950 s32 cond;
951 s32 i;
952
955 StarPointsBasePosX = 292;
956 StarPointsBasePosY = 196;
958 D_8029DA4C = battleStatus->totalStarPoints % 10;
959 } else {
963 if (StarPointsMoveInterpAmt < 1) {
965 }
966 }
967
968 cond = TRUE;
969 if (D_802809F4 != 0) {
970 if (D_802809F5 > 8) {
971 if (D_802809F5 <= 12) {
972 cond = FALSE;
973 } else {
974 D_802809F5 = 0;
975 }
976 }
977 D_802809F5++;
978 }
979
980
981 if (cond) {
982 s32 posX, posY;
983 s32 tens, ones;
984 s32 id;
985 f32 one = 1.0f;
986
987 battleStatus->incrementStarPointDelay--;
988 D_802809F0 -= 1.0;
989 if (D_802809F0 <= 0.0f) {
990 s32 pendingStarPoints;
991
992 if (battleStatus->pendingStarPoints > 0) {
993 battleStatus->totalStarPoints++;
994 if (battleStatus->totalStarPoints > 100) {
995 battleStatus->totalStarPoints = 100;
996 }
997 battleStatus->pendingStarPoints--;
998 }
999
1000 pendingStarPoints = battleStatus->pendingStarPoints;
1001 if (pendingStarPoints < 1) {
1002 pendingStarPoints = 1;
1003 }
1004
1005 D_802809F0 = (f32) battleStatus->incrementStarPointDelay / pendingStarPoints;
1006 if (D_802809F0 < 1.0) {
1007 D_802809F0 = 1.0f;
1008 }
1009 if (D_802809F0 > 6.0) {
1010 D_802809F0 = 6.0f;
1011 }
1012 }
1013
1014 posX = StarPointsBasePosX;
1015 posY = StarPointsBasePosY;
1016 tens = battleStatus->totalStarPoints / 10;
1017 ones = battleStatus->totalStarPoints % 10;
1018
1019 for (i = 0; i < tens; i++) {
1020 id = BtlStarPointTensHIDs[i];
1023 }
1025 hud_element_set_render_pos(id, posX, posY);
1027
1028 id = BtlStarPointShinesHIDs[i];
1031 }
1033 hud_element_set_render_pos(id, posX, posY - 5);
1035 posX -= (one * 20.0f);
1036 }
1037
1038 for (; i < ARRAY_COUNT(BtlStarPointTensHIDs); i++) {
1041 }
1042
1043 posX = StarPointsBasePosX;
1044 posY = StarPointsBasePosY + (one * 14.0f);
1046 if (ones != 0) {
1047 draw_box(0, WINDOW_STYLE_4, posX - 100, posY - 5, 0, 110, 12, 120, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL,
1048 NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
1049 }
1050 }
1051
1052 for (i = 0; i < ones; i++) {
1053 id = BtlStarPointOnesHIDs[i];
1056 }
1058 hud_element_set_render_pos(id, posX, posY);
1060 posX -= one * 10.0f;
1061 }
1062
1063 for (; i < ARRAY_COUNT(BtlStarPointOnesHIDs); i++) {
1065 }
1066 }
1067 }
1068}
HudScript HES_ItemStarPoint
BSS s32 StarPointsMoveInterpAmt
Definition 16C8E0.c:20
BSS s32 BtlStarPointShinesHIDs[10]
Definition 16C8E0.c:28
BSS s32 BtlStarPointOnesHIDs[10]
Definition 16C8E0.c:29
HudScript HES_StatusSPShine
s8 D_802809F4
Definition 16C8E0.c:10
s8 D_802809F5
Definition 16C8E0.c:11
BSS s32 StarPointsBasePosX
Definition 16C8E0.c:18
f32 D_802809F0
Definition 16C8E0.c:9
HudScript HES_SmallStarPoint
BSS s32 BtlStarPointTensHIDs[10]
Definition 16C8E0.c:27
BSS s32 StarPointsBasePosY
Definition 16C8E0.c:19
BSS s32 D_8029DA4C
Definition 16C8E0.c:21
#define draw_box
@ WINDOW_STYLE_4
Definition enums.h:6374
@ BS_FLAGS2_AWARDING_STAR_POINTS
Definition enums.h:3604
HudScript * hud_element_get_script(s32 id)
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
@ HUD_ELEMENT_FLAG_DISABLED
Definition hud_element.h:74
#define SCREEN_HEIGHT
Definition macros.h:106

Referenced by btl_draw_ui().

◆ get_stick_input_radial()

void get_stick_input_radial ( f32 * angle,
f32 * magnitude )

Definition at line 116 of file 16C8E0.c.

116 {
117 BattleStatus* battleStatus = &gBattleStatus;
118 f32 maxMagnitude = 60.0f;
119 f32 stickX = battleStatus->stickX;
120 f32 stickY = battleStatus->stickY;
121 u16 currentButtonsDown = battleStatus->curButtonsDown;
122 f32 mag;
123
124 if (currentButtonsDown & (BUTTON_D_UP | BUTTON_D_DOWN | BUTTON_D_LEFT | BUTTON_D_RIGHT)) {
125 stickY = 0.0f;
126 stickX = 0.0f;
127 if (currentButtonsDown & BUTTON_D_UP) {
128 stickY = maxMagnitude;
129 }
130 if (currentButtonsDown & BUTTON_D_DOWN) {
131 stickY = -maxMagnitude;
132 }
133 if (currentButtonsDown & BUTTON_D_LEFT) {
134 stickX = -maxMagnitude;
135 }
136 if (currentButtonsDown & BUTTON_D_RIGHT) {
137 stickX = maxMagnitude;
138 }
139 }
140
141 mag = dist2D(0.0f, 0.0f, stickX, -stickY);
142 if (mag >= maxMagnitude) {
143 mag = maxMagnitude;
144 }
145
146 *angle = atan2(0.0f, 0.0f, stickX, -stickY);
147 *magnitude = mag;
148}
#define atan2
@ BUTTON_D_RIGHT
Definition enums.h:2783
@ BUTTON_D_DOWN
Definition enums.h:2785
@ BUTTON_D_UP
Definition enums.h:2786
@ BUTTON_D_LEFT
Definition enums.h:2784
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:670

Referenced by btl_update().

◆ func_8023E104()

void func_8023E104 ( void )

Definition at line 150 of file 16C8E0.c.

150 {
151 D_802809F4 = 1;
152 D_802809F5 = 0;
153}

Referenced by btl_state_update_run_away().

◆ func_8023E11C()

void func_8023E11C ( void )

Definition at line 155 of file 16C8E0.c.

155 {
156 D_802809F4 = 0;
157 D_802809F5 = 0;
158}

Referenced by btl_state_update_run_away().

◆ initialize_battle()

void initialize_battle ( void )

Definition at line 160 of file 16C8E0.c.

160 {
161 PlayerData* playerData = &gPlayerData;
162 BattleStatus* battleStatus = &gBattleStatus;
163 Camera* tattleCam = &gCameras[CAM_TATTLE];
164 s32 hudElemID;
165 s32 i;
166
171 gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;
173 gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;
174
175 for (i = 0; i < ARRAY_COUNT(battleStatus->pushInputBuffer); i++) {
176 battleStatus->pushInputBuffer[i] = 0;
177 }
178
179 battleStatus->inputBufferPos = 0;
180 battleStatus->holdInputBufferPos = 0;
181 battleStatus->waitForState = BATTLE_STATE_0;
182
183 for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
184 battleStatus->enemyActors[i] = NULL;
185 }
186
187 battleStatus->playerActor = NULL;
188 battleStatus->partnerActor = NULL;
189
190 for (i = 0; i < ARRAY_COUNT(battleStatus->lastPlayerMenuSelection); i++) {
191 battleStatus->lastPlayerMenuSelection[i] = -1;
192 battleStatus->lastPartnerMenuSelection[i] = -1;
193 }
194
195 for (i = 0; i < ARRAY_COUNT(battleStatus->tattleFlags); i++) {
196 battleStatus->tattleFlags[i] = 0;
197 }
198
202 } else {
203 gBattleStatus.flags2 &= ~BS_FLAGS2_PEACH_BATTLE;
204 }
205
212
213 for (i = 0; i < ARRAY_COUNT(BtlStarPointTensHIDs); i++) {
216 hud_element_set_render_depth(hudElemID, 20);
217 }
218
219 for (i = 0; i < ARRAY_COUNT(BtlStarPointShinesHIDs); i++) {
222 hud_element_set_render_depth(hudElemID, 20);
223 }
224
225 for (i = 0; i < ARRAY_COUNT(BtlStarPointOnesHIDs); i++) {
228 hud_element_set_render_depth(hudElemID, 20);
229 }
230
233
234 if (playerData->battlesCount < 9999) {
235 playerData->battlesCount++;
236 }
237
238 bSavedPartner = playerData->curPartner;
240 playerData->curPartner = PARTNER_TWINK;
241 }
242}
BSS s32 bSavedOverrideFlags
Definition 16C8E0.c:17
void tattle_cam_pre_render(Camera *)
Definition 16C8E0.c:722
BSS s32 bSavedPartner
Definition 16C8E0.c:16
void btl_render_actors(void)
Definition 16C8E0.c:620
void tattle_cam_post_render(Camera *)
Definition 16C8E0.c:855
void func_80268E88(void)
Definition action_cmd.c:531
@ PEACH_FLAG_IS_PEACH
Definition enums.h:2488
@ BS_FLAGS2_PEACH_BATTLE
Definition enums.h:3610
@ WINDOW_GROUP_BATTLE
Definition enums.h:5324
@ PARTNER_TWINK
Definition enums.h:2896
s32 create_worker_world(WorldArgs, WorldArgs)
void btl_popup_messages_init(void)
void set_windows_visible(s32 groupIdx)
Definition windows.c:445
void increment_status_bar_disabled(void)
Definition inventory.c:1654
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
s8 lastPlayerMenuSelection[16]
s32 pushInputBuffer[64]
s8 lastPartnerMenuSelection[16]
void(* fpDoPreRender)(struct Camera *)
void(* fpDoPostRender)(struct Camera *)
s32 gOverrideFlags
Definition main_loop.c:11
PlayerData gPlayerData
Definition 77480.c:40

Referenced by state_step_battle().

◆ func_8023E3FC()

void func_8023E3FC ( void )

Definition at line 244 of file 16C8E0.c.

244 {
245}

◆ update_nonplayer_actor_shadows()

void update_nonplayer_actor_shadows ( void )

Definition at line 247 of file 16C8E0.c.

247 {
251 }
252}
void update_hero_shadows(void)
void update_enemy_shadows(void)

Referenced by btl_update().

◆ btl_update()

void btl_update ( void )

Definition at line 254 of file 16C8E0.c.

254 {
255 BattleStatus* battleStatus = &gBattleStatus;
256 PlayerData* playerData = &gPlayerData;
257 Actor* partner = battleStatus->partnerActor;
258 f32 outAngle;
259 f32 outMagnitude;
260 s32 cond;
261
262 if (battleStatus->inputBitmask != -1) {
264 s32 inputBitmask = battleStatus->inputBitmask;
265
266 battleStatus->curButtonsDown = gGameStatusPtr->curButtons[1] & inputBitmask;
267 battleStatus->curButtonsPressed = gGameStatusPtr->pressedButtons[1] & inputBitmask;
268 battleStatus->curButtonsHeld = gGameStatusPtr->heldButtons[1] & inputBitmask;
269 battleStatus->stickX = gGameStatusPtr->stickX[1];
270 battleStatus->stickY = gGameStatusPtr->stickY[1];
271 } else {
272 s32 inputBitmask2 = battleStatus->inputBitmask;
273
274 battleStatus->curButtonsDown = gGameStatusPtr->curButtons[0] & inputBitmask2;
275 battleStatus->curButtonsPressed = gGameStatusPtr->pressedButtons[0] & inputBitmask2;
276 battleStatus->curButtonsHeld = gGameStatusPtr->heldButtons[0] & inputBitmask2;
277 battleStatus->stickX = gGameStatusPtr->stickX[0];
278 battleStatus->stickY = gGameStatusPtr->stickY[0];
279 }
280 }
281
282 get_stick_input_radial(&outAngle, &outMagnitude);
283 battleStatus->stickAngle = outAngle;
284 battleStatus->stickMagnitude = outMagnitude;
285 battleStatus->pushInputBuffer[battleStatus->inputBufferPos] = battleStatus->curButtonsPressed;
286 battleStatus->holdInputBuffer[battleStatus->inputBufferPos] = battleStatus->curButtonsDown;
287
288 battleStatus->inputBufferPos++;
289 if (battleStatus->inputBufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
290 battleStatus->inputBufferPos = 0;
291 }
292
293 if (battleStatus->preUpdateCallback != NULL) {
294 battleStatus->preUpdateCallback();
295 }
296
297 cond = TRUE;
298 if (battleStatus->waitForState == BATTLE_STATE_0 || battleStatus->waitForState != gBattleState) {
299 switch (gBattleState) {
301 case BATTLE_STATE_0:
302 return;
305 cond = FALSE;
306 break;
309 break;
312 break;
313 case BATTLE_STATE_9:
315 break;
318 break;
321 break;
324 break;
327 break;
330 break;
333 break;
336 break;
339 break;
342 break;
345 break;
348 break;
351 break;
354 break;
357 break;
360 break;
363 break;
366 break;
369 break;
372 break;
375 break;
378 break;
381 break;
384 break;
387 break;
388 case BATTLE_STATE_28:
390 break;
393 break;
396 break;
397 case BATTLE_STATE_34:
399 break;
402 break;
405 cond = FALSE;
406 break;
407 }
408 }
409
410 battleStatus->unk_90++;
411 if (battleStatus->unk_90 == 40) {
413 }
414
420
421 if (battleStatus->darknessMode != BTL_DARKNESS_STATE_LOCKED) {
422 u8 paramType;
423 f32 paramAmount;
424
425 get_screen_overlay_params(SCREEN_LAYER_BACK, &paramType, &paramAmount);
426
427 if (battleStatus->darknessMode > BTL_DARKNESS_STATE_NONE) {
429 if (partner == NULL) {
431 } else if (playerData->curPartner == PARTNER_WATT) {
432 paramAmount -= 10.0f;
433 if (paramAmount < 0.0f) {
434 paramAmount = 0.0f;
435 }
437 } else {
438 paramAmount += 10.0f;
439 if (paramAmount > 215.0f) {
440 paramAmount = 215.0f;
441 }
443 }
444 } else if (battleStatus->darknessMode < BTL_DARKNESS_STATE_NONE) {
445 paramAmount -= 10.0f;
446 if (paramAmount < 0.0f) {
447 paramAmount = 0.0f;
450 } else {
452 }
453 }
454
455 if (cond || D_802809F6 != -1) {
456 if (D_802809F6 == -1) {
458 u8 paramType;
459 f32 paramAmount;
460
461 get_screen_overlay_params(SCREEN_LAYER_FRONT, &paramType, &paramAmount);
462 if (paramType == (u8) OVERLAY_NONE) {
463 D_802809F6 = 0;
465 }
466 }
467 } else if (D_802809F6 == 255) {
470 }
471 } else {
472 D_802809F6 += 10;
473 if (D_802809F6 > 255) {
474 D_802809F6 = 255;
475 }
476
481 }
482 }
483 }
484}
void update_nonplayer_actor_shadows(void)
Definition 16C8E0.c:247
void get_stick_input_radial(f32 *angle, f32 *magnitude)
Definition 16C8E0.c:116
s16 D_802809F6
Definition 16C8E0.c:12
u32 pressedButtons[4]
@ OVERLAY_NONE
Definition enums.h:2387
@ OVERLAY_SCREEN_COLOR
Definition enums.h:2388
@ BS_FLAGS1_PARTNER_ACTING
Definition enums.h:3588
@ SCREEN_LAYER_FRONT
Definition enums.h:2382
@ SCREEN_LAYER_BACK
Definition enums.h:2383
@ BATTLE_STATE_BEGIN_PARTNER_TURN
Definition enums.h:3639
@ BATTLE_STATE_ENEMY_MOVE
Definition enums.h:3652
@ BATTLE_STATE_NEXT_ENEMY
Definition enums.h:3651
@ BATTLE_STATE_ENEMY_FIRST_STRIKE
Definition enums.h:3635
@ BATTLE_STATE_RUN_AWAY
Definition enums.h:3655
@ BATTLE_STATE_FIRST_STRIKE
Definition enums.h:3633
@ BATTLE_STATE_PREPARE_MENU
Definition enums.h:3643
@ BATTLE_STATE_SWITCH_TO_PARTNER
Definition enums.h:3642
@ BATTLE_STATE_PLAYER_MENU
Definition enums.h:3644
@ BATTLE_STATE_DEFEND
Definition enums.h:3656
@ BATTLE_STATE_END_TRAINING_BATTLE
Definition enums.h:3661
@ BATTLE_STATE_PLAYER_MOVE
Definition enums.h:3649
@ BATTLE_STATE_END_DEMO_BATTLE
Definition enums.h:3666
@ BATTLE_STATE_CELEBRATION
Definition enums.h:3664
@ BATTLE_STATE_28
Definition enums.h:3659
@ BATTLE_STATE_SWITCH_TO_PLAYER
Definition enums.h:3641
@ BATTLE_STATE_BEGIN_TURN
Definition enums.h:3636
@ BATTLE_STATE_PARTNER_FIRST_STRIKE
Definition enums.h:3634
@ BATTLE_STATE_END_PARTNER_TURN
Definition enums.h:3654
@ BATTLE_STATE_END_PLAYER_TURN
Definition enums.h:3653
@ BATTLE_STATE_PARTNER_MOVE
Definition enums.h:3650
@ BATTLE_STATE_DEFEAT
Definition enums.h:3658
@ BATTLE_STATE_PEACH_MENU
Definition enums.h:3646
@ BATTLE_STATE_34
Definition enums.h:3665
@ BATTLE_STATE_PARTNER_MENU
Definition enums.h:3645
@ BATTLE_STATE_NORMAL_START
Definition enums.h:3632
@ BATTLE_STATE_NEGATIVE_1
Definition enums.h:3630
@ BATTLE_STATE_BEGIN_PLAYER_TURN
Definition enums.h:3638
@ BATTLE_STATE_9
Definition enums.h:3640
@ BATTLE_STATE_SELECT_TARGET
Definition enums.h:3648
@ BATTLE_STATE_TWINK_MENU
Definition enums.h:3647
@ BATTLE_STATE_CHANGE_PARTNER
Definition enums.h:3660
@ BATTLE_STATE_VICTORY
Definition enums.h:3657
@ BATTLE_STATE_END_BATTLE
Definition enums.h:3663
@ BATTLE_STATE_END_TURN
Definition enums.h:3637
@ PARTNER_WATT
Definition enums.h:2891
@ DEMO_STATE_CHANGE_MAP
Definition enums.h:3537
@ BTL_DARKNESS_STATE_NONE
Definition enums.h:6365
@ BTL_DARKNESS_STATE_LOCKED
Definition enums.h:6363
void btl_state_update_end_battle(void)
void set_screen_overlay_params_back(u8, f32)
void btl_state_update_end_turn(void)
void btl_state_update_end_training_battle(void)
void btl_state_update_partner_menu(void)
void btl_state_update_prepare_menu(void)
void btl_state_update_end_player_turn(void)
void btl_state_update_enemy_move(void)
void btl_state_update_peach_menu(void)
void btl_state_update_first_strike(void)
void startup_set_fade_screen_alpha(s16 alpha)
void btl_state_update_enemy_striking_first(void)
void btl_state_update_celebration(void)
Definition level_up.c:488
void btl_state_update_22(void)
void btl_state_update_normal_start(void)
void update_damage_popups(void)
Definition 190B20.c:2320
void btl_state_update_begin_player_turn(void)
void set_screen_overlay_params_front(u8, f32)
void btl_bonk_cleanup(void)
void btl_state_update_defeat(void)
void btl_state_update_next_enemy(void)
void btl_state_update_1C(void)
void btl_state_update_victory(void)
void btl_state_update_9(void)
void btl_state_update_partner_striking_first(void)
void btl_state_update_change_partner(void)
void btl_state_update_partner_move(void)
void btl_state_update_begin_partner_turn(void)
void btl_state_update_player_menu(void)
void set_screen_overlay_color(s32, u8, u8, u8)
void btl_state_update_switch_to_player(void)
void update_health_bars(void)
Definition 190B20.c:2515
void btl_state_update_begin_turn(void)
void startup_set_fade_screen_color(s16 color)
void btl_popup_messages_update(void)
void btl_state_update_defend(void)
void get_screen_overlay_params(s32, u8 *type, f32 *zoom)
void update_action_ratings(void)
Definition 190B20.c:2443
void btl_set_state(s32 battleState)
void btl_state_update_end_partner_turn(void)
void btl_state_update_end_demo_battle(void)
void btl_state_update_player_move(void)
void btl_state_update_select_target(void)
void btl_state_update_run_away(void)
void btl_state_update_twink_menu(void)
void btl_state_update_switch_to_partner(void)
s32 holdInputBuffer[64]
void(* preUpdateCallback)(void)

Referenced by state_step_battle().

◆ btl_draw_ui()

void btl_draw_ui ( void )

Definition at line 486 of file 16C8E0.c.

486 {
487 s32 changed = FALSE;
488 s32 state;
489
490 state = gBattleState;
492 state = gLastDrawBattleState;
494 changed = TRUE;
495 } else {
496 switch (state) {
501 return;
502 case BATTLE_STATE_0:
503 return;
504 }
505 }
506
509
510 if (!changed) {
511 switch (state) {
514 break;
517 break;
520 break;
521 case BATTLE_STATE_9:
523 break;
526 break;
529 break;
532 break;
535 break;
538 break;
541 break;
544 break;
547 break;
550 break;
553 break;
556 break;
559 break;
562 break;
565 break;
568 break;
571 break;
574 break;
577 break;
580 break;
583 break;
586 break;
589 break;
592 break;
595 break;
596 case BATTLE_STATE_28:
598 break;
601 break;
604 break;
605 case BATTLE_STATE_34:
607 break;
610 break;
613 break;
614 }
615 }
618}
void btl_update_starpoints_display(void)
Definition 16C8E0.c:948
void btl_draw_enemy_health_bars(void)
Definition 16C8E0.c:859
void btl_state_draw_switch_to_partner(void)
void btl_state_draw_twink_menu(void)
void btl_state_draw_9(void)
void btl_popup_messages_draw_ui(void)
void btl_state_draw_partner_striking_first(void)
void btl_state_draw_prepare_menu(void)
void btl_state_draw_select_target(void)
void btl_state_draw_1C(void)
void btl_state_draw_begin_player_turn(void)
void btl_state_draw_defend(void)
void btl_state_draw_end_player_turn(void)
void btl_state_draw_celebration(void)
Definition level_up.c:1274
void btl_state_draw_victory(void)
void btl_state_draw_end_demo_battle(void)
void btl_state_draw_end_turn(void)
void btl_state_draw_partner_move(void)
void btl_state_draw_22(void)
void btl_state_draw_peach_menu(void)
void btl_state_draw_begin_partner_turn(void)
void btl_state_draw_player_move(void)
void btl_state_draw_end_partner_turn(void)
void btl_state_draw_begin_turn(void)
void btl_state_draw_enemy_move(void)
void btl_state_draw_player_menu(void)
void btl_state_draw_switch_to_player(void)
void btl_state_draw_next_enemy(void)
void btl_state_draw_normal_start(void)
void btl_state_draw_run_away(void)
void btl_state_draw_partner_menu(void)
void btl_state_draw_end_training_battle(void)
void btl_state_draw_defeat(void)
void btl_state_draw_end_battle(void)
void btl_state_draw_change_partner(void)
void btl_state_draw_enemy_striking_first(void)
void btl_state_draw_first_stike(void)
void draw_status_ui(void)
Definition inventory.c:1411
s32 gLastDrawBattleState
Definition battle.c:12

Referenced by state_drawUI_battle().

◆ blend_tattle_background_channel()

u16 blend_tattle_background_channel ( u16 a,
s32 b,
s32 alpha )

Definition at line 718 of file 16C8E0.c.

718 {
719 return a + (b - a) * alpha / 256;
720}

Referenced by tattle_cam_pre_render().

◆ btl_save_world_cameras()

void btl_save_world_cameras ( void )

Definition at line 1070 of file 16C8E0.c.

1070 {
1071 PlayerStatus* playerStatus = &gPlayerStatus;
1072 s32 i;
1073
1074 for (i = 0; i < ARRAY_COUNT(gCameras); i++) {
1076 }
1077
1078 SavedWorldPlayerPosX = playerStatus->pos.x;
1079 SavedWorldPlayerPosY = playerStatus->pos.y;
1080 SavedWorldPlayerPosZ = playerStatus->pos.z;
1081 playerStatus->pos.x = NPC_DISPOSE_POS_X;
1082 playerStatus->pos.y = NPC_DISPOSE_POS_Y;
1083 playerStatus->pos.z = NPC_DISPOSE_POS_Z;
1084}
BSS f32 SavedWorldPlayerPosX
Definition 16C8E0.c:23
BSS f32 SavedWorldPlayerPosY
Definition 16C8E0.c:24
BSS f32 SavedWorldPlayerPosZ
Definition 16C8E0.c:25
BSS Camera SavedWorldCameras[ARRAY_COUNT(gCameras)]
Definition 16C8E0.c:22
#define NPC_DISPOSE_POS_Z
Definition macros.h:161
#define NPC_DISPOSE_POS_X
Definition macros.h:159
#define NPC_DISPOSE_POS_Y
Definition macros.h:160
PlayerStatus gPlayerStatus
Definition 77480.c:39

Referenced by state_step_battle().

◆ btl_restore_world_cameras()

void btl_restore_world_cameras ( void )

Definition at line 1086 of file 16C8E0.c.

1086 {
1087 PlayerStatus* playerStatus = &gPlayerStatus;
1088 PlayerData* playerData = &gPlayerData;
1089 s32 i;
1090
1091 for (i = 0; i < ARRAY_COUNT(gCameras); i++) {
1093 }
1094
1096 playerStatus->pos.x = SavedWorldPlayerPosX;
1097 playerStatus->pos.y = SavedWorldPlayerPosY;
1098 playerStatus->pos.z = SavedWorldPlayerPosZ;
1099
1102 } else {
1103 gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;
1104 }
1105
1107 playerData->curPartner = bSavedPartner;
1108 }
1109}
@ GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION
Definition enums.h:4326
@ CAM_DEFAULT
Definition enums.h:1800
s32 gCurrentCameraID
Definition cam_math.c:4

Referenced by state_step_end_battle().

◆ btl_delete_actor()

void btl_delete_actor ( Actor * actor)

Definition at line 1111 of file 16C8E0.c.

1111 {
1112 ActorPart* part;
1113 ActorPart* actorPartTemp;
1114 BattleStatus* battleStatus;
1115 s32 i;
1116
1117 // TODO hard-coded
1118 for (i = 0; i < 2; i++) {
1119 remove_actor_decoration(actor, i);
1120 }
1121 if (actor->idleScript != NULL) {
1123 }
1124 if (actor->handleEventScript != NULL) {
1126 }
1127 if (actor->takeTurnScript != NULL) {
1129 }
1131
1132 part = actor->partsTable;
1133
1134 while (part != NULL) {
1135 if (!(part->flags & ACTOR_PART_FLAG_NO_SHADOW)) {
1137 }
1138
1139 if (part->idleAnimations != NULL) {
1140 set_npc_imgfx_all(part->spriteInstanceID, IMGFX_CLEAR, 0, 0, 0, 0, 0);
1141
1143
1145 heap_free(part->movement);
1146 }
1147
1148 if (!(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS)) {
1150 }
1151 }
1152 actorPartTemp = part->nextPart;
1153 heap_free(part);
1154 part = actorPartTemp;
1155 }
1156
1157 delete_shadow(actor->shadow.id);
1160
1161 if (actor->attackResultEffect != NULL) {
1163 }
1164
1165 battleStatus = &gBattleStatus;
1166 for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
1167 if (battleStatus->enemyActors[i] == actor) {
1168 battleStatus->enemyActors[i] = NULL;
1169 break;
1170 }
1171 }
1172
1173 heap_free(actor);
1174}
struct EffectInstance * disableEffect
struct EffectInstance * attackResultEffect
struct Evt * takeTurnScript
s32 idleScriptID
u32 * idleAnimations
struct ActorPartMovement * movement
struct Evt * idleScript
union Actor::@38 shadow
struct Evt * handleEventScript
struct ActorPart * partsTable
s32 takeTurnScriptID
s32 handleEventScriptID
s16 hudElementDataIndex
struct ActorPart * nextPart
struct DecorationTable * decorationTable
#define remove_effect
struct AttackResultTextFXData * attackResultText
Definition effects.h:2536
EffectData data
Definition effects.h:2605
#define ASSERT(condition)
@ IMGFX_CLEAR
Definition enums.h:5117
@ GLOW_PAL_OFF
Definition enums.h:2258
@ ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC
Definition enums.h:3366
@ ACTOR_PART_FLAG_NO_SHADOW
Definition enums.h:3352
@ ACTOR_PART_FLAG_NO_DECORATIONS
Definition enums.h:3351
void remove_actor_decoration(Actor *actor, s32 decorationIndex)
Definition 190B20.c:2754
s32 heap_free(void *ptr)
Definition heap.c:42
void set_actor_glow_pal(Actor *actor, s32 arg1)
Definition 190B20.c:2654
void kill_script_by_ID(s32 id)
void delete_shadow(s32)
Definition entity.c:626
void remove_all_status_icons(s32)
s32 spr_free_sprite(s32 spriteInstanceID)
Definition sprite.c:1178
void set_npc_imgfx_all(s32 spriteIdx, ImgFXType imgfxType, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
Definition sprite.c:1254

Referenced by btl_state_update_change_partner(), btl_state_update_end_battle(), and btl_state_update_end_demo_battle().

◆ btl_delete_player_actor()

void btl_delete_player_actor ( Actor * player)

Definition at line 1176 of file 16C8E0.c.

1176 {
1177 ActorPart* partsTable;
1178 ActorPartMovement* movement;
1179 DecorationTable* decorations;
1180 s32 i;
1181
1182 for (i = 0; i < 2; i++) {
1183 remove_actor_decoration(player, i);
1184 }
1185
1186 if (player->idleScript != NULL) {
1188 }
1189 if (player->handleEventScript != NULL) {
1191 }
1192 if (player->takeTurnScript != NULL) {
1194 }
1195
1196 partsTable = player->partsTable;
1197 decorations = partsTable->decorationTable;
1198 movement = partsTable->movement;
1199
1200 delete_shadow(player->shadow.id);
1203
1204 if (player->attackResultEffect != NULL) {
1206 }
1207
1208 heap_free(movement);
1209 heap_free(decorations);
1210 heap_free(partsTable);
1211 heap_free(player);
1212}

Referenced by btl_state_update_end_battle(), and btl_state_update_end_demo_battle().

Variable Documentation

◆ D_802809F0

f32 D_802809F0 = 0.0f

Definition at line 9 of file 16C8E0.c.

Referenced by btl_update_starpoints_display().

◆ D_802809F4

s8 D_802809F4 = 0

Definition at line 10 of file 16C8E0.c.

Referenced by btl_update_starpoints_display(), func_8023E104(), and func_8023E11C().

◆ D_802809F5

s8 D_802809F5 = 0

Definition at line 11 of file 16C8E0.c.

Referenced by btl_update_starpoints_display(), func_8023E104(), and func_8023E11C().

◆ D_802809F6

◆ DemoBattleBeginDelay

s16 DemoBattleBeginDelay = 0

Definition at line 13 of file 16C8E0.c.

Referenced by btl_state_update_end_demo_battle().

◆ gTattleBgTextureYOffset

u16 gTattleBgTextureYOffset = 0

Definition at line 14 of file 16C8E0.c.

Referenced by tattle_cam_pre_render().

◆ bSavedPartner

BSS s32 bSavedPartner

Definition at line 16 of file 16C8E0.c.

Referenced by btl_restore_world_cameras(), and initialize_battle().

◆ bSavedOverrideFlags

BSS s32 bSavedOverrideFlags

Definition at line 17 of file 16C8E0.c.

Referenced by btl_restore_world_cameras(), and initialize_battle().

◆ StarPointsBasePosX

BSS s32 StarPointsBasePosX

Definition at line 18 of file 16C8E0.c.

Referenced by btl_update_starpoints_display().

◆ StarPointsBasePosY

BSS s32 StarPointsBasePosY

Definition at line 19 of file 16C8E0.c.

Referenced by btl_update_starpoints_display().

◆ StarPointsMoveInterpAmt

BSS s32 StarPointsMoveInterpAmt

Definition at line 20 of file 16C8E0.c.

Referenced by btl_update_starpoints_display().

◆ D_8029DA4C

BSS s32 D_8029DA4C

Definition at line 21 of file 16C8E0.c.

Referenced by btl_update_starpoints_display().

◆ SavedWorldCameras

BSS Camera SavedWorldCameras[ARRAY_COUNT(gCameras)]

Definition at line 22 of file 16C8E0.c.

Referenced by btl_restore_world_cameras(), and btl_save_world_cameras().

◆ SavedWorldPlayerPosX

BSS f32 SavedWorldPlayerPosX

Definition at line 23 of file 16C8E0.c.

Referenced by btl_restore_world_cameras(), and btl_save_world_cameras().

◆ SavedWorldPlayerPosY

BSS f32 SavedWorldPlayerPosY

Definition at line 24 of file 16C8E0.c.

Referenced by btl_restore_world_cameras(), and btl_save_world_cameras().

◆ SavedWorldPlayerPosZ

BSS f32 SavedWorldPlayerPosZ

Definition at line 25 of file 16C8E0.c.

Referenced by btl_restore_world_cameras(), and btl_save_world_cameras().

◆ D_8029EFBC

BSS s32 D_8029EFBC

Definition at line 26 of file 16C8E0.c.

Referenced by btl_draw_enemy_health_bars(), and initialize_battle().

◆ BtlStarPointTensHIDs

BSS s32 BtlStarPointTensHIDs[10]

Definition at line 27 of file 16C8E0.c.

Referenced by btl_update_starpoints_display(), and initialize_battle().

◆ BtlStarPointShinesHIDs

BSS s32 BtlStarPointShinesHIDs[10]

Definition at line 28 of file 16C8E0.c.

Referenced by btl_update_starpoints_display(), and initialize_battle().

◆ BtlStarPointOnesHIDs

BSS s32 BtlStarPointOnesHIDs[10]

Definition at line 29 of file 16C8E0.c.

Referenced by btl_update_starpoints_display(), and initialize_battle().

◆ gTattleBgPalette

BSS PAL_BIN gTattleBgPalette[0x100]

Definition at line 30 of file 16C8E0.c.

Referenced by tattle_cam_pre_render().

◆ HES_HPDigit0

HudScript HES_HPDigit0
extern

Definition at line 253 of file battle_ui_gfx.c.

300{
302 hs_SetCustomSize(48, 40)
303 hs_Loop
304 hs_SetCI(2, ui_battle_cont_b_up)
305 hs_SetCI(2, ui_battle_cont_b_down)
307 hs_End
308};
309
312 hs_SetCustomSize(48, 40)
313 hs_Loop
314 hs_SetCI(3, ui_battle_cont_b_down)
315 hs_SetCI(10, ui_battle_cont_b_up)
316 hs_SetCI(7, ui_battle_cont_b_down)
318 hs_End
319};
320
323 hs_SetCustomSize(48, 40)
324 hs_Loop
325 hs_SetCI(2, ui_battle_cont_b_down)
326 hs_SetCI(2, ui_battle_cont_b_up)
328 hs_End
329};
330
331HudScript HES_CLeftButton = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_left_up, 40, 34);
332
333HudScript HES_CLeftButtonHeld = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_left_down, 40, 34);
334
337 hs_SetCustomSize(40, 34)
338 hs_Loop
339 hs_SetCI(2, ui_battle_cont_c_left_up)
340 hs_SetCI(2, ui_battle_cont_c_left_down)
342 hs_End
343};
344
345HudScript HES_CRightButton = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_right_up, 40, 34);
346
347HudScript HES_CRightButtonHeld = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_right_down, 40, 34);
348
351 hs_SetCustomSize(40, 34)
352 hs_Loop
353 hs_SetCI(2, ui_battle_cont_c_right_up)
354 hs_SetCI(2, ui_battle_cont_c_right_down)
356 hs_End
357};
358
361 hs_SetCustomSize(40, 34)
362 hs_Loop
363 hs_SetCI(2, ui_battle_cont_c_right_down)
364 hs_SetCI(2, ui_battle_cont_c_right_up)
366 hs_End
367};
368
369HudScript HES_CUpButton = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_up_up, 40, 34);
370
371HudScript HES_CUpButtonHeld = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_up_down, 40, 34);
372
375 hs_SetCustomSize(40, 34)
376 hs_Loop
377 hs_SetCI(2, ui_battle_cont_c_up_up)
378 hs_SetCI(2, ui_battle_cont_c_up_down)
380 hs_End
381};
382
383HudScript HES_CDownButton = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_down_up, 40, 34);
384
385HudScript HES_CDownButtonHeld = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cont_c_down_down, 40, 34);
386
389 hs_SetCustomSize(40, 34)
390 hs_Loop
391 hs_SetCI(2, ui_battle_cont_c_down_up)
392 hs_SetCI(2, ui_battle_cont_c_down_down)
394 hs_End
395};
396
399 hs_SetCustomSize(40, 34)
400 hs_Loop
401 hs_SetCI(6, ui_battle_cont_c_down_down)
402 hs_SetCI(10, ui_battle_cont_c_down_up)
403 hs_SetCI(4, ui_battle_cont_c_down_down)
405 hs_End
406};
407
410 hs_SetCustomSize(40, 34)
411 hs_Loop
412 hs_SetCI(1, ui_battle_cont_c_down_up)
413 hs_SetCI(2, ui_battle_cont_c_down_down)
414 hs_SetCI(1, ui_battle_cont_c_down_up)
416 hs_End
417};
418
419HudScript HES_TimingWait = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_timing_wait, 16, 16);
420
421HudScript HES_TimingReady = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_timing_ready, 16, 16);
422
425 hs_SetCustomSize(16, 16)
426 hs_Loop
427 hs_SetCI(10, ui_battle_cmd_timing_ready)
428 hs_SetCI(6, ui_battle_cmd_timing_wait)
430 hs_End
431};
432
433HudScript HES_TimingCharge4a = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_charge_4, 8, 8);
434
435HudScript HES_TimingCharge1 = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_charge_1, 8, 8);
436
437HudScript HES_TimingCharge4b = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_charge_4, 8, 8);
438
439HudScript HES_TimingCharge2 = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_charge_2, 8, 8);
440
441HudScript HES_TimingCharge4c = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_charge_4, 8, 8);
442
443HudScript HES_TimingCharge3 = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_charge_3, 8, 8);
444
447 hs_Loop
448 hs_SetCustomSize(16, 24)
449 hs_SetCI(1, ui_battle_cmd_flee_0)
450 hs_SetCI(1, ui_battle_cmd_flee_1)
451 hs_SetCI(1, ui_battle_cmd_flee_2)
452 hs_SetCI(1, ui_battle_cmd_flee_0)
453 hs_SetCI(1, ui_battle_cmd_flee_2)
454 hs_SetCI(1, ui_battle_cmd_flee_1)
456 hs_End
457};
458
461 hs_SetCustomSize(64, 48)
462 hs_Loop
463 hs_SetTexelOffset(0, -16)
464 hs_SetScale(1.00)
465 hs_SetCI(1, ui_battle_cmd_100pct)
466 hs_SetScale(1.20)
467 hs_SetCI(1, ui_battle_cmd_100pct)
468 hs_SetScale(1.30)
469 hs_SetCI(1, ui_battle_cmd_100pct)
470 hs_SetScale(1.27)
471 hs_SetCI(1, ui_battle_cmd_100pct)
472 hs_SetScale(1.15)
473 hs_SetCI(1, ui_battle_cmd_100pct)
474 hs_SetScale(1.05)
475 hs_SetCI(1, ui_battle_cmd_100pct)
477 hs_End
478};
479
482 hs_SetCustomSize(56, 24)
483 hs_Loop
484 hs_SetTexelOffset(0, -16)
485 hs_SetScale(1.00)
486 hs_SetCI(1, ui_battle_cmd_right_on)
487 hs_SetScale(1.10)
488 hs_SetCI(1, ui_battle_cmd_right_on)
489 hs_SetScale(1.20)
490 hs_SetCI(1, ui_battle_cmd_right_on)
491 hs_SetScale(1.30)
492 hs_SetCI(2, ui_battle_cmd_right_on)
493 hs_SetScale(1.27)
494 hs_SetCI(2, ui_battle_cmd_right_on)
495 hs_SetScale(1.15)
496 hs_SetCI(2, ui_battle_cmd_right_on)
497 hs_SetScale(1.05)
498 hs_SetCI(2, ui_battle_cmd_right_on)
500 hs_End
501};
502
503HudScript HES_TimingBar3Chances = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_timing_3_chances, 96, 24);
504
505HudScript HES_TimingGaugeResult = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_gauge_result, 32, 24);
506
507HudScript HES_TimingOK = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_timing_ok, 24, 24);
508
509HudScript HES_TimingMiss = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_timing_miss, 24, 24);
510
511HudScript HES_FillGaugeResult = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_cmd_fill_result, 32, 24);
512
515 hs_SetCustomSize(64, 64)
516 hs_Loop
517 hs_SetRGBA(60, ui_battle_projector_reel_png)
519 hs_End
520};
521
524 hs_SetCustomSize(32, 32)
525 hs_Loop
526 hs_SetRGBA(60, ui_battle_projector_spot_png)
528 hs_End
529};
530
533 hs_SetCustomSize(64, 64)
534 hs_Loop
535 hs_SetRGBA(60, ui_battle_projector_beam_png)
537 hs_End
538};
539
540HudScript HES_SwapZ = HES_TEMPLATE_CI_CUSTOM_SIZE(ui_battle_swap_Z, 16, 16);
541
544 hs_SetCustomSize(8, 16)
545 hs_Loop
546 hs_SetCI(12, ui_battle_swap_arrow_left)
547 hs_SetCI(8, ui_battle_swap_arrow_left)
549 hs_End
550};
551
554 hs_SetCustomSize(8, 16)
555 hs_Loop
556 hs_SetCI(10, ui_battle_swap_arrow_right)
557 hs_SetCI(10, ui_battle_swap_arrow_right)
559 hs_End
560};
561
564 hs_SetCustomSize(48, 16)
565 hs_Loop
566 hs_SetRGBA(60, ui_battle_swap_background_png)
568 hs_End
569};
570
574 hs_Loop
575 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
576 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
577 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
578 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
579 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
580 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
581 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
582 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
584 hs_End
585};
586
590 hs_Loop
591 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
592 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
593 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
594 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
595 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
596 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
597 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
598 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
600 hs_End
601};
602
606 hs_Loop
607 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
608 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
609 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
610 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
611 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
612 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
613 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
614 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
616 hs_End
617};
618
622 hs_Loop
623 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
624 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
625 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
626 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
627 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
628 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
629 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
630 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
632 hs_End
633};
634
638 hs_Loop
639 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
640 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
641 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
642 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
643 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
644 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
645 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
646 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
648 hs_End
649};
650
654 hs_Loop
655 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
656 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
657 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
658 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
659 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
660 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
661 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
662 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
664 hs_End
665};
666
670 hs_Loop
671 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
672 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
673 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
674 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
675 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
676 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
677 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
678 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
680 hs_End
681};
682
686 hs_Loop
687 hs_SetCI(3, ui_battle_cmd_aim_marker_7)
688 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
689 hs_SetCI(3, ui_battle_cmd_aim_marker_1)
690 hs_SetCI(3, ui_battle_cmd_aim_marker_2)
691 hs_SetCI(3, ui_battle_cmd_aim_marker_3)
692 hs_SetCI(3, ui_battle_cmd_aim_marker_4)
693 hs_SetCI(3, ui_battle_cmd_aim_marker_5)
694 hs_SetCI(3, ui_battle_cmd_aim_marker_6)
696 hs_End
697};
698
702 hs_Loop
703 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
704 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
705 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
706 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
707 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
708 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
709 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
710 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
712 hs_End
713};
714
718 hs_Loop
719 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
720 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
721 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
722 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
723 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
724 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
725 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
726 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
728 hs_End
729};
730
734 hs_Loop
735 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
736 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
737 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
738 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
739 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
740 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
741 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
742 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
744 hs_End
745};
746
750 hs_Loop
751 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
752 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
753 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
754 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
755 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
756 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
757 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
758 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
760 hs_End
761};
762
766 hs_Loop
767 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
768 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
769 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
770 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
771 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
772 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
773 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
774 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
776 hs_End
777};
778
782 hs_Loop
783 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
784 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
785 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
786 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
787 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
788 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
789 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
790 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
792 hs_End
793};
794
798 hs_Loop
799 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
800 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
801 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
802 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
803 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
804 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
805 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
806 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
808 hs_End
809};
810
814 hs_Loop
815 hs_SetCI(3, ui_battle_cmd_aim_shimmer_7)
816 hs_SetCI(3, ui_battle_cmd_aim_shimmer_0)
817 hs_SetCI(3, ui_battle_cmd_aim_shimmer_1)
818 hs_SetCI(3, ui_battle_cmd_aim_shimmer_2)
819 hs_SetCI(3, ui_battle_cmd_aim_shimmer_3)
820 hs_SetCI(3, ui_battle_cmd_aim_shimmer_4)
821 hs_SetCI(3, ui_battle_cmd_aim_shimmer_5)
822 hs_SetCI(3, ui_battle_cmd_aim_shimmer_6)
824 hs_End
825};
826
830 hs_Loop
831 hs_SetCI(8, ui_battle_cmd_aim_reticle_0)
832 hs_SetCI(5, ui_battle_cmd_aim_reticle_1)
834 hs_End
835};
836
840 hs_Loop
841 hs_SetCI(2, ui_battle_cmd_aim_target_0)
842 hs_SetCI(2, ui_battle_cmd_aim_target_1)
844 hs_End
845};
846
850 hs_Loop
852 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
854 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
855 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
857 hs_End
858};
859
863 hs_Loop
865 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
867 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
869 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
871 hs_End
872};
873
877 hs_Loop
879 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
880 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
882 hs_SetCI(3, ui_battle_cmd_aim_marker_0)
884 hs_End
885};
HudScript HES_AimShimmerH
HudScript HES_TimingCharge3
HudScript HES_AimShimmerD
HudScript HES_AimBlinkC
HudScript HES_TimingReady
HudScript HES_TimingOK
HudScript HES_AimShimmerE
HudScript HES_AimMarkerE
HudScript HES_CUpButtonHeld
HudScript HES_AimBlinkA
HudScript HES_CDownButtonHeld
HudScript HES_SwapArrowRight
HudScript HES_ProjectorBeam
HudScript HES_TimingBlink
HudScript HES_TimingCharge4b
HudScript HES_CLeftButtonHeld
HudScript HES_SwapArrowLeft
HudScript HES_MashCRightButton2
HudScript HES_ProjectorReel
HudScript HES_TimingBar3Chances
HudScript HES_MashCDownButton1
HudScript HES_TimingWait
HudScript HES_TimingCharge4a
HudScript HES_CDownButton
HudScript HES_TimingCharge4c
HudScript HES_AimMarkerA
HudScript HES_MashCLeftButton
HudScript HES_MashCRightButton1
HudScript HES_MashCDownButton2
HudScript HES_SwapBackground
HudScript HES_RightOn
HudScript HES_ProjectorSpot
HudScript HES_SwapZ
HudScript HES_CRightButton
HudScript HES_AimMarkerG
HudScript HES_AimBlinkB
HudScript HES_AimMarkerD
HudScript HES_AimShimmerG
HudScript HES_AimMarkerB
HudScript HES_CRightButtonHeld
HudScript HES_AimMarkerF
HudScript HES_TimingGaugeResult
HudScript HES_AimMarkerH
HudScript HES_100pct
HudScript HES_AimMarkerC
HudScript HES_FillGaugeResult
HudScript HES_TimingMiss
HudScript HES_AimShimmerF
HudScript HES_AimShimmerA
HudScript HES_AimShimmerB
HudScript HES_AimShimmerC
HudScript HES_TimingCharge2
HudScript HES_MashBButton2
HudScript HES_AimTarget
HudScript HES_CLeftButton
HudScript HES_TimingCharge1
HudScript HES_PressBButton
HudScript HES_RunningAway
HudScript HES_MashCUpButton
HudScript HES_CUpButton
HudScript HES_PressCDownButton
HudScript HES_AimReticle
#define hs_SetTileSize(size)
#define hs_SetRGBA(time, image)
#define hs_SetCustomSize(arg0, arg1)
#define hs_SetVisible
#define hs_End
@ HUD_ELEMENT_FLAG_200000
Definition hud_element.h:94
#define hs_Restart
#define HES_TEMPLATE_CI_CUSTOM_SIZE(name, sizeX, sizeY)
Basic HudScript used for static CI images, setting size with hs_SetCustomSize.
#define hs_Loop
#define hs_SetCI(time, name)
#define hs_SetScale(scale)
#define hs_ClearFlags(arg0)
#define hs_SetTexelOffset(x, y)
#define hs_UseIA8
@ HUD_ELEMENT_SIZE_24x24
Definition hud_element.h:47
@ HUD_ELEMENT_SIZE_16x16
Definition hud_element.h:46
@ HUD_ELEMENT_SIZE_32x32
Definition hud_element.h:48
s32 HudScript[]
Definition hud_element.h:9
#define hs_SetFlags(arg0)

◆ HES_HPDigit1

HudScript HES_HPDigit1
extern

Definition at line 255 of file battle_ui_gfx.c.

◆ HES_HPDigit2

HudScript HES_HPDigit2
extern

Definition at line 257 of file battle_ui_gfx.c.

◆ HES_HPDigit3

HudScript HES_HPDigit3
extern

Definition at line 259 of file battle_ui_gfx.c.

◆ HES_HPDigit4

HudScript HES_HPDigit4
extern

Definition at line 261 of file battle_ui_gfx.c.

◆ HES_HPDigit5

HudScript HES_HPDigit5
extern

Definition at line 263 of file battle_ui_gfx.c.

◆ HES_HPDigit6

HudScript HES_HPDigit6
extern

Definition at line 265 of file battle_ui_gfx.c.

◆ HES_HPDigit7

HudScript HES_HPDigit7
extern

Definition at line 267 of file battle_ui_gfx.c.

◆ HES_HPDigit8

HudScript HES_HPDigit8
extern

Definition at line 269 of file battle_ui_gfx.c.

◆ HES_HPDigit9

HudScript HES_HPDigit9
extern

Definition at line 271 of file battle_ui_gfx.c.

◆ bHPDigitHudScripts

HudScript* bHPDigitHudScripts[]
Initial value:
= {
NULL, NULL, NULL,
}
HudScript HES_HPDigit0
HudScript HES_HPDigit2
HudScript HES_HPDigit3
HudScript HES_HPDigit9
HudScript HES_HPDigit4
HudScript HES_HPDigit8
HudScript HES_HPDigit7
HudScript HES_HPDigit5
HudScript HES_HPDigit6
HudScript HES_HPDigit1

Definition at line 43 of file 16C8E0.c.

Referenced by btl_draw_enemy_health_bars().

◆ BattleScreenFadeAmt

◆ BtlPutPartnerAway

EvtScript BtlPutPartnerAway
Initial value:
= {
SetF(LVar0, Float(1.0))
Loop(10)
Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, Float(1.0))
SubF(LVar0, Float(0.1))
Wait(1)
Call(EnablePartnerBlur)
Call(PlaySoundAtActor, 0, SOUND_PARTNER_GET_OUT)
Call(GetActorPos, 0, LVar0, LVar1, LVar2)
Add(LVar1, 25)
Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
Call(JumpToGoal, ACTOR_PARTNER, 10, 0, 0, 1)
Call(DisablePartnerBlur)
}
@ SOUND_PARTNER_GET_OUT
Definition enums.h:559
@ ACTOR_PARTNER
Definition enums.h:2086
@ EVENT_PUT_PARTNER_AWAY
Definition enums.h:2177
#define EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Float(DOUBLE)
Definition macros.h:51
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define SubF(VAR, FLOAT_VALUE)
Definition macros.h:384
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 51 of file 16C8E0.c.

51 {
54 SetF(LVar0, Float(1.0))
55 Loop(10)
56 Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, Float(1.0))
57 SubF(LVar0, Float(0.1))
58 Wait(1)
61 Call(EnablePartnerBlur)
62 Call(PlaySoundAtActor, 0, SOUND_PARTNER_GET_OUT)
63 Call(GetActorPos, 0, LVar0, LVar1, LVar2)
64 Add(LVar1, 25)
65 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
66 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
67#if VERSION_JP
68 Call(JumpToGoal, ACTOR_PARTNER, 10, 0, 1, 1)
69#else
70 Call(JumpToGoal, ACTOR_PARTNER, 10, 0, 0, 1)
71#endif
72 Call(DisablePartnerBlur)
73 Return
74 End
75};

Referenced by btl_state_update_change_partner().

◆ BtlBringPartnerOut

EvtScript BtlBringPartnerOut
Initial value:
= {
SetF(LVar0, Float(0.1))
Loop(20)
Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, Float(1.0))
AddF(LVar0, Float(0.05))
Wait(1)
Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
Call(PlaySoundAtActor, 0, SOUND_PARTNER_PUT_AWAY)
Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
IfEq(LVar1, 0)
Call(JumpToGoal, ACTOR_PARTNER, 20, 0, 0, 1)
Call(JumpToGoal, ACTOR_PARTNER, 20, 0, 0, 1)
Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
Call(ForceHomePos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
}
@ SOUND_PARTNER_PUT_AWAY
Definition enums.h:558
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269

Definition at line 77 of file 16C8E0.c.

77 {
79 SetF(LVar0, Float(0.1))
80 Loop(20)
81 Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, Float(1.0))
82 AddF(LVar0, Float(0.05))
83 Wait(1)
85 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
87 Call(PlaySoundAtActor, 0, SOUND_PARTNER_PUT_AWAY)
88 Call(GetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
89 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
90 IfEq(LVar1, 0)
91 Call(JumpToGoal, ACTOR_PARTNER, 20, 0, 0, 1)
92 Else
93#if VERSION_JP
94 Call(JumpToGoal, ACTOR_PARTNER, 20, 0, 1, 1)
95#else
96 Call(JumpToGoal, ACTOR_PARTNER, 20, 0, 0, 1)
97#endif
98 EndIf
99 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
100 Call(ForceHomePos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
101 Return
102 End
103};

Referenced by btl_state_update_change_partner().

◆ HES_HPBar

HudScript HES_HPBar
extern

Definition at line 251 of file battle_ui_gfx.c.

Referenced by btl_draw_enemy_health_bars(), and initialize_battle().

◆ HES_SmallStarPoint

HudScript HES_SmallStarPoint
extern

Definition at line 771 of file global_hud_scripts.c.

771 {
774 hs_Loop
775 hs_SetIcon(2, anim_sp_small_0)
776 hs_SetIcon(2, anim_sp_small_1)
777 hs_SetIcon(2, anim_sp_small_2)
778 hs_SetIcon(2, anim_sp_small_3)
779 hs_SetIcon(2, anim_sp_small_4)
780 hs_SetIcon(2, anim_sp_small_5)
781 hs_SetIcon(2, anim_sp_small_6)
782 hs_SetIcon(2, anim_sp_small_7)
784 hs_End
785};
#define hs_SetIcon(time, icon)
@ HUD_ELEMENT_SIZE_8x8
Definition hud_element.h:45

Referenced by btl_update_starpoints_display(), and initialize_battle().

◆ HES_ItemStarPoint

HudScript HES_ItemStarPoint
extern

◆ HES_StatusSPShine

HudScript HES_StatusSPShine
extern

Definition at line 762 of file global_hud_scripts.c.

762 {
765 hs_Loop
766 hs_SetRGBA(60, ui_status_star_point_shine_png)
768 hs_End
769};

Referenced by btl_update_starpoints_display(), and initialize_battle().