Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
16C8E0.c
Go to the documentation of this file.
1#include "common.h"
2#include "nu/nusys.h"
3#include "hud_element.h"
4#include "battle/battle.h"
5#include "script_api/battle.h"
6#include "sprite.h"
7#include "effects.h"
8
9f32 D_802809F0 = 0.0f;
12s16 D_802809F6 = -1;
15
31
42
48
50
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};
76
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};
104
105extern HudScript HES_HPBar;
109
110void btl_render_actors(void);
115
116void get_stick_input_radial(f32* angle, f32* magnitude) {
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}
149
150void func_8023E104(void) {
151 D_802809F4 = 1;
152 D_802809F5 = 0;
153}
154
155void func_8023E11C(void) {
156 D_802809F4 = 0;
157 D_802809F5 = 0;
158}
159
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}
243
244void func_8023E3FC(void) {
245}
246
253
254void btl_update(void) {
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}
485
486void btl_draw_ui(void) {
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}
619
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}
717
718u16 blend_tattle_background_channel(u16 a, s32 b, s32 alpha) {
719 return a + (b - a) * alpha / 256;
720}
721
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}
854
858
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}
947
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}
1069
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}
1085
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}
1110
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}
1175
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}
BSS f32 SavedWorldPlayerPosX
Definition 16C8E0.c:23
s32 BattleScreenFadeAmt
Definition 16C8E0.c:49
void btl_update(void)
Definition 16C8E0.c:254
HudScript HES_ItemStarPoint
HudScript HES_HPDigit0
BSS f32 SavedWorldPlayerPosY
Definition 16C8E0.c:24
BSS s32 StarPointsMoveInterpAmt
Definition 16C8E0.c:20
HudScript HES_HPDigit2
BSS s32 BtlStarPointShinesHIDs[10]
Definition 16C8E0.c:28
#define DIGIT_WIDTH
BSS s32 bSavedOverrideFlags
Definition 16C8E0.c:17
void update_nonplayer_actor_shadows(void)
Definition 16C8E0.c:247
HudScript HES_HPDigit3
EvtScript BtlPutPartnerAway
Definition 16C8E0.c:51
HudScript HES_HPDigit9
HudScript HES_HPDigit4
void tattle_cam_pre_render(Camera *)
Definition 16C8E0.c:722
void btl_update_starpoints_display(void)
Definition 16C8E0.c:948
void get_stick_input_radial(f32 *angle, f32 *magnitude)
Definition 16C8E0.c:116
void func_8023E104(void)
Definition 16C8E0.c:150
BSS s32 BtlStarPointOnesHIDs[10]
Definition 16C8E0.c:29
HudScript HES_StatusSPShine
BSS s32 bSavedPartner
Definition 16C8E0.c:16
HudScript HES_HPDigit8
void btl_render_actors(void)
Definition 16C8E0.c:620
void func_8023E3FC(void)
Definition 16C8E0.c:244
HudScript HES_HPBar
HudScript HES_HPDigit7
s16 DemoBattleBeginDelay
Definition 16C8E0.c:13
void btl_draw_ui(void)
Definition 16C8E0.c:486
s8 D_802809F4
Definition 16C8E0.c:10
EvtScript BtlBringPartnerOut
Definition 16C8E0.c:77
s8 D_802809F5
Definition 16C8E0.c:11
BSS s32 StarPointsBasePosX
Definition 16C8E0.c:18
u16 blend_tattle_background_channel(u16 a, s32 b, s32 alpha)
Definition 16C8E0.c:718
BSS f32 SavedWorldPlayerPosZ
Definition 16C8E0.c:25
void func_8023E11C(void)
Definition 16C8E0.c:155
HudScript HES_HPDigit5
void btl_draw_enemy_health_bars(void)
Definition 16C8E0.c:859
void btl_delete_player_actor(Actor *player)
Definition 16C8E0.c:1176
BSS s32 D_8029EFBC
Definition 16C8E0.c:26
void tattle_cam_post_render(Camera *)
Definition 16C8E0.c:855
HudScript HES_HPDigit6
f32 D_802809F0
Definition 16C8E0.c:9
HudScript HES_SmallStarPoint
s16 D_802809F6
Definition 16C8E0.c:12
BSS Camera SavedWorldCameras[ARRAY_COUNT(gCameras)]
Definition 16C8E0.c:22
void btl_delete_actor(Actor *actor)
Definition 16C8E0.c:1111
void btl_save_world_cameras(void)
Definition 16C8E0.c:1070
BSS s32 BtlStarPointTensHIDs[10]
Definition 16C8E0.c:27
BSS PAL_BIN gTattleBgPalette[0x100]
Definition 16C8E0.c:30
HudScript * bHPDigitHudScripts[]
Definition 16C8E0.c:43
void initialize_battle(void)
Definition 16C8E0.c:160
void btl_restore_world_cameras(void)
Definition 16C8E0.c:1086
HudScript HES_HPDigit1
BSS s32 StarPointsBasePosY
Definition 16C8E0.c:19
u16 gTattleBgTextureYOffset
Definition 16C8E0.c:14
BSS s32 D_8029DA4C
Definition 16C8E0.c:21
void func_80268E88(void)
Definition action_cmd.c:531
u16 * nuGfxCfb_ptr
Definition cam_main.c:14
struct EffectInstance * disableEffect
struct EffectInstance * attackResultEffect
struct Evt * takeTurnScript
s32 idleScriptID
u32 * idleAnimations
u32 pressedButtons[4]
struct ActorPartMovement * movement
s8 healthFraction
struct Evt * idleScript
union Actor::@38 shadow
struct Evt * handleEventScript
struct ActorPart * partsTable
s32 takeTurnScriptID
Vec3s healthBarPos
s32 handleEventScriptID
u16 * backgroundPalette
s16 hudElementDataIndex
#define PAL_BIN
Vec3f curPos
Bytecode EvtScript[]
struct ActorPart * nextPart
struct DecorationTable * decorationTable
#define queue_render_task
#define guMtxF2L
#define remove_effect
#define mdl_get_shroud_tint_params
#define atan2
#define draw_box
struct AttackResultTextFXData * attackResultText
Definition effects.h:2536
EffectData data
Definition effects.h:2605
#define ASSERT(condition)
@ WINDOW_STYLE_4
Definition enums.h:6374
@ OVERLAY_NONE
Definition enums.h:2387
@ OVERLAY_SCREEN_COLOR
Definition enums.h:2388
@ BACKGROUND_FLAG_TEXTURE
Definition enums.h:6285
@ 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
@ IMGFX_CLEAR
Definition enums.h:5117
@ PEACH_FLAG_IS_PEACH
Definition enums.h:2488
@ GLOW_PAL_OFF
Definition enums.h:2258
@ BS_FLAGS1_MENU_OPEN
Definition enums.h:3566
@ BS_FLAGS1_PARTNER_ACTING
Definition enums.h:3588
@ BS_FLAGS1_ACTORS_VISIBLE
Definition enums.h:3565
@ SCREEN_LAYER_FRONT
Definition enums.h:2382
@ SCREEN_LAYER_BACK
Definition enums.h:2383
@ BS_FLAGS2_AWARDING_STAR_POINTS
Definition enums.h:3604
@ BS_FLAGS2_PEACH_BATTLE
Definition enums.h:3610
@ BS_REFLECT_FLOOR
Definition enums.h:3626
@ 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_0
Definition enums.h:3631
@ 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
@ WINDOW_GROUP_BATTLE
Definition enums.h:5324
@ SOUND_PARTNER_GET_OUT
Definition enums.h:559
@ SOUND_PARTNER_PUT_AWAY
Definition enums.h:558
@ RENDER_MODE_SURFACE_XLU_LAYER3
Definition enums.h:3299
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_FLAG_INVISIBLE
Actor is not rendered.
Definition enums.h:3324
@ ACTOR_FLAG_BLUR_ENABLED
Definition enums.h:3344
@ 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
@ PARTNER_WATT
Definition enums.h:2891
@ PARTNER_TWINK
Definition enums.h:2896
@ DEMO_STATE_CHANGE_MAP
Definition enums.h:3537
@ GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION
Definition enums.h:4326
@ EVENT_PUT_PARTNER_AWAY
Definition enums.h:2177
@ 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
@ BTL_DARKNESS_STATE_NONE
Definition enums.h:6365
@ BTL_DARKNESS_STATE_LOCKED
Definition enums.h:6363
@ CAM_TATTLE
Definition enums.h:1802
@ CAM_DEFAULT
Definition enums.h:1800
@ CAM_BATTLE
Definition enums.h:1801
void btl_state_draw_switch_to_partner(void)
void btl_state_update_end_battle(void)
s32 create_worker_world(WorldArgs, WorldArgs)
void btl_state_draw_twink_menu(void)
void set_screen_overlay_params_back(u8, f32)
void btl_state_update_end_turn(void)
void btl_state_draw_9(void)
void btl_state_update_end_training_battle(void)
void btl_state_update_partner_menu(void)
void remove_actor_decoration(Actor *actor, s32 decorationIndex)
Definition 190B20.c:2754
void btl_state_update_prepare_menu(void)
void update_hero_shadows(void)
void func_80255FD8(void)
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_popup_messages_draw_ui(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_draw_partner_striking_first(void)
void btl_state_update_enemy_striking_first(void)
void btl_state_draw_prepare_menu(void)
void btl_state_draw_select_target(void)
void btl_popup_messages_draw_world_geometry(void)
void appendGfx_player_actor(void *)
void btl_state_update_celebration(void)
Definition level_up.c:488
void btl_state_draw_1C(void)
void btl_state_update_22(void)
void btl_state_update_normal_start(void)
void update_damage_popups(void)
Definition 190B20.c:2320
void appendGfx_player_actor_reflection(void *)
void btl_state_draw_begin_player_turn(void)
void appendGfx_partner_actor(void *)
void btl_state_update_begin_player_turn(void)
void appendGfx_player_actor_blur(Actor *)
void set_screen_overlay_params_front(u8, f32)
s32 is_world_fog_enabled(void)
Definition model.c:3796
void btl_state_draw_defend(void)
void btl_bonk_cleanup(void)
void btl_state_update_defeat(void)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:670
void hide_foreground_models_unchecked(void)
Definition 190B20.c:2963
void btl_state_update_next_enemy(void)
void btl_state_update_1C(void)
void btl_state_draw_end_player_turn(void)
void btl_state_draw_celebration(void)
Definition level_up.c:1274
s32 heap_free(void *ptr)
Definition heap.c:42
void btl_state_draw_victory(void)
void btl_state_update_victory(void)
void btl_state_draw_end_demo_battle(void)
void btl_state_update_9(void)
void btl_state_update_partner_striking_first(void)
void btl_state_draw_end_turn(void)
void btl_state_draw_partner_move(void)
void btl_state_update_change_partner(void)
void appendGfx_enemy_actor_blur(void *)
void set_actor_glow_pal(Actor *actor, s32 arg1)
Definition 190B20.c:2654
void btl_state_update_partner_move(void)
void btl_state_update_begin_partner_turn(void)
void kill_script_by_ID(s32 id)
void appendGfx_enemy_actor(void *)
void btl_state_update_player_menu(void)
void btl_state_draw_22(void)
void btl_state_draw_peach_menu(void)
void set_screen_overlay_color(s32, u8, u8, u8)
void btl_state_update_switch_to_player(void)
void show_foreground_models_unchecked(void)
Definition 190B20.c:2978
void update_health_bars(void)
Definition 190B20.c:2515
void appendGfx_partner_actor_blur(void *)
void appendGfx_partner_actor_reflection(void *)
void btl_state_update_begin_turn(void)
void btl_state_draw_begin_partner_turn(void)
void startup_set_fade_screen_color(s16 color)
void btl_state_draw_player_move(void)
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
void btl_popup_messages_update(void)
void btl_popup_messages_init(void)
void btl_state_draw_end_partner_turn(void)
void btl_state_draw_begin_turn(void)
void btl_state_update_defend(void)
void set_windows_visible(s32 groupIdx)
Definition windows.c:445
void get_screen_overlay_params(s32, u8 *type, f32 *zoom)
void btl_state_draw_enemy_move(void)
void btl_state_draw_player_menu(void)
void get_world_fog_color(s32 *r, s32 *g, s32 *b, s32 *a)
Definition model.c:3805
void update_action_ratings(void)
Definition 190B20.c:2443
void btl_state_draw_switch_to_player(void)
void update_enemy_shadows(void)
void btl_state_draw_next_enemy(void)
void btl_set_state(s32 battleState)
void btl_state_draw_normal_start(void)
void btl_state_draw_run_away(void)
void btl_state_update_end_partner_turn(void)
void btl_state_draw_partner_menu(void)
s32 is_actor_health_bar_visible(Actor *)
Definition 181810.c:503
void btl_state_draw_end_training_battle(void)
void delete_shadow(s32)
Definition entity.c:626
void btl_state_draw_defeat(void)
void btl_state_draw_end_battle(void)
void btl_state_update_end_demo_battle(void)
void remove_all_status_icons(s32)
void btl_state_update_player_move(void)
void btl_state_draw_change_partner(void)
void btl_state_draw_enemy_striking_first(void)
void btl_state_draw_first_stike(void)
void btl_state_update_select_target(void)
void btl_state_update_run_away(void)
void appendGfx_enemy_actor_reflection(void *)
void btl_state_update_twink_menu(void)
void increment_status_bar_disabled(void)
Definition inventory.c:1654
void draw_status_ui(void)
Definition inventory.c:1411
void btl_state_update_switch_to_partner(void)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_depth(s32 id, s32 z)
HudScript * hud_element_get_script(s32 id)
void hud_element_draw_next(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_clear_flags(s32 id, s32 flags)
Turns off the given flags.
void hud_element_draw_clipped(s32 id)
@ HUD_ELEMENT_FLAG_DISABLED
Definition hud_element.h:74
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
s32 HudScript[]
Definition hud_element.h:9
u16 * nuGfxZBuffer
Definition main.c:46
#define NPC_DISPOSE_POS_Z
Definition macros.h:161
#define UNPACK_PAL_B(color)
Definition macros.h:269
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define UNPACK_PAL_R(color)
Definition macros.h:267
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#define EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define SCREEN_WIDTH
Definition macros.h:105
#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 NPC_DISPOSE_POS_X
Definition macros.h:159
#define BSS
Definition macros.h:7
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define NPC_DISPOSE_POS_Y
Definition macros.h:160
#define Float(DOUBLE)
Definition macros.h:51
#define UNPACK_PAL_G(color)
Definition macros.h:268
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define SCREEN_HEIGHT
Definition macros.h:106
#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 PACK_FILL_DEPTH(z, dz)
Definition macros.h:164
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define PACK_FILL_COLOR(r, g, b, a)
Definition macros.h:163
#define SubF(VAR, FLOAT_VALUE)
Definition macros.h:384
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#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
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
void(* initBattleCallback)(void)
s32 holdInputBuffer[64]
s8 lastPlayerMenuSelection[16]
void(* preUpdateCallback)(void)
struct Actor * partnerActor
s32 pushInputBuffer[64]
struct Actor * playerActor
s8 lastPartnerMenuSelection[16]
struct Actor * enemyActors[24]
s16 bgColor[3]
s16 viewportStartX
void(* fpDoPreRender)(struct Camera *)
s16 viewportStartY
void(* fpDoPostRender)(struct Camera *)
Matrix4f mtxPerspective
void * appendGfxArg
void(* appendGfx)(void *)
s32 gBattleState
Definition battle.c:10
s32 gOverrideFlags
Definition main_loop.c:11
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Camera gCameras[4]
Definition cam_main.c:17
Gfx * gMainGfxPos
Definition cam_main.c:15
PlayerData gPlayerData
Definition 77480.c:40
BattleStatus gBattleStatus
Definition battle.c:11
PlayerStatus gPlayerStatus
Definition 77480.c:39
s32 gCurrentCameraID
Definition cam_math.c:4
s32 gLastDrawBattleState
Definition battle.c:12
DisplayContext * gDisplayContext
Definition cam_main.c:16
s16 gCurrentCamID
Definition cam_main.c:13