61 Call(EnablePartnerBlur)
72 Call(DisablePartnerBlur)
118 f32 maxMagnitude = 60.0f;
119 f32 stickX = battleStatus->
stickX;
120 f32 stickY = battleStatus->
stickY;
128 stickY = maxMagnitude;
131 stickY = -maxMagnitude;
134 stickX = -maxMagnitude;
137 stickX = maxMagnitude;
141 mag =
dist2D(0.0f, 0.0f, stickX, -stickY);
142 if (mag >= maxMagnitude) {
146 *angle =
atan2(0.0f, 0.0f, stickX, -stickY);
411 if (battleStatus->
unk_90 == 40) {
429 if (partner == NULL) {
432 paramAmount -= 10.0f;
433 if (paramAmount < 0.0f) {
438 paramAmount += 10.0f;
439 if (paramAmount > 215.0f) {
440 paramAmount = 215.0f;
445 paramAmount -= 10.0f;
446 if (paramAmount < 0.0f) {
719 return a + (b - a) * alpha / 256;
724 s32 fogEnabled = FALSE;
726 s32 fogR, fogG, fogB, fogA;
731 s32 bgWidth, bgHeight;
764 gDPSetCombineMode(
gMainGfxPos++, G_CC_DECALRGB, G_CC_DECALRGB);
765 gDPSetRenderMode(
gMainGfxPos++, G_RM_NOOP, G_RM_NOOP2);
777 lineHeight = 2048 / bgWidth;
782 for (i = 0; i < numLines; i++) {
788 G_IM_FMT_CI, G_IM_SIZ_8b, bgWidth, 6,
790 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
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);
799 if (extraHeight != 0) {
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);
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);
829 gDPSetCombineMode(
gMainGfxPos++, G_CC_SHADE, G_CC_SHADE);
832 gDPSetRenderMode(
gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
877 currentHP = enemy->
curHP;
878 temp = (currentHP * 25) / enemy->
maxHP;
880 if (temp < enemy->healthFraction) {
903 s32 screenX, screenY, screenZ;
905 s32 nextDigitXOffset;
915 #define DIGIT_WIDTH 6
920 s32 digit = currentHP % 10;
928 if (currentHP < 10) {
990 s32 pendingStarPoints;
1001 if (pendingStarPoints < 1) {
1002 pendingStarPoints = 1;
1019 for (i = 0; i < tens; i++) {
1035 posX -= (one * 20.0f);
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,
1052 for (i = 0; i < ones; i++) {
1060 posX -= one * 10.0f;
1118 for (i = 0; i < 2; i++) {
1134 while (part != NULL) {
1154 part = actorPartTemp;
1182 for (i = 0; i < 2; i++) {
BSS f32 SavedWorldPlayerPosX
HudScript HES_ItemStarPoint
BSS f32 SavedWorldPlayerPosY
BSS s32 StarPointsMoveInterpAmt
BSS s32 BtlStarPointShinesHIDs[10]
BSS s32 bSavedOverrideFlags
void update_nonplayer_actor_shadows(void)
EvtScript BtlPutPartnerAway
void tattle_cam_pre_render(Camera *)
void btl_update_starpoints_display(void)
void get_stick_input_radial(f32 *angle, f32 *magnitude)
BSS s32 BtlStarPointOnesHIDs[10]
HudScript HES_StatusSPShine
void btl_render_actors(void)
EvtScript BtlBringPartnerOut
BSS s32 StarPointsBasePosX
u16 blend_tattle_background_channel(u16 a, s32 b, s32 alpha)
BSS f32 SavedWorldPlayerPosZ
void btl_draw_enemy_health_bars(void)
void btl_delete_player_actor(Actor *player)
void tattle_cam_post_render(Camera *)
HudScript HES_SmallStarPoint
BSS Camera SavedWorldCameras[ARRAY_COUNT(gCameras)]
void btl_delete_actor(Actor *actor)
void btl_save_world_cameras(void)
BSS s32 BtlStarPointTensHIDs[10]
BSS PAL_BIN gTattleBgPalette[0x100]
HudScript * bHPDigitHudScripts[]
void initialize_battle(void)
void btl_restore_world_cameras(void)
BSS s32 StarPointsBasePosY
u16 gTattleBgTextureYOffset
struct EffectInstance * disableEffect
struct EffectInstance * attackResultEffect
struct Evt * takeTurnScript
struct ActorPartMovement * movement
struct Evt * handleEventScript
struct ActorPart * partsTable
struct ActorPart * nextPart
struct DecorationTable * decorationTable
#define queue_render_task
#define mdl_get_shroud_tint_params
struct AttackResultTextFXData * attackResultText
#define ASSERT(condition)
@ BACKGROUND_FLAG_TEXTURE
@ BS_FLAGS1_PARTNER_ACTING
@ BS_FLAGS1_ACTORS_VISIBLE
@ BS_FLAGS2_AWARDING_STAR_POINTS
@ BATTLE_STATE_BEGIN_PARTNER_TURN
@ BATTLE_STATE_ENEMY_MOVE
@ BATTLE_STATE_NEXT_ENEMY
@ BATTLE_STATE_ENEMY_FIRST_STRIKE
@ BATTLE_STATE_FIRST_STRIKE
@ BATTLE_STATE_PREPARE_MENU
@ BATTLE_STATE_SWITCH_TO_PARTNER
@ BATTLE_STATE_PLAYER_MENU
@ BATTLE_STATE_END_TRAINING_BATTLE
@ BATTLE_STATE_PLAYER_MOVE
@ BATTLE_STATE_END_DEMO_BATTLE
@ BATTLE_STATE_CELEBRATION
@ BATTLE_STATE_SWITCH_TO_PLAYER
@ BATTLE_STATE_BEGIN_TURN
@ BATTLE_STATE_PARTNER_FIRST_STRIKE
@ BATTLE_STATE_END_PARTNER_TURN
@ BATTLE_STATE_END_PLAYER_TURN
@ BATTLE_STATE_PARTNER_MOVE
@ BATTLE_STATE_PEACH_MENU
@ BATTLE_STATE_PARTNER_MENU
@ BATTLE_STATE_NORMAL_START
@ BATTLE_STATE_NEGATIVE_1
@ BATTLE_STATE_BEGIN_PLAYER_TURN
@ BATTLE_STATE_SELECT_TARGET
@ BATTLE_STATE_TWINK_MENU
@ BATTLE_STATE_CHANGE_PARTNER
@ BATTLE_STATE_END_BATTLE
@ RENDER_MODE_SURFACE_XLU_LAYER3
@ ACTOR_FLAG_INVISIBLE
Actor is not rendered.
@ ACTOR_FLAG_BLUR_ENABLED
@ ACTOR_FLAG_HEALTH_BAR_HIDDEN
@ ACTOR_FLAG_TARGET_ONLY
Battle ends even if undefeated. No turn.
@ ACTOR_FLAG_NO_HEALTH_BAR
@ GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION
@ ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC
@ ACTOR_PART_FLAG_NO_SHADOW
@ ACTOR_PART_FLAG_NO_DECORATIONS
@ BTL_DARKNESS_STATE_NONE
@ BTL_DARKNESS_STATE_LOCKED
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)
void btl_state_update_prepare_menu(void)
void update_hero_shadows(void)
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
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)
void btl_state_draw_1C(void)
void btl_state_update_22(void)
void btl_state_update_normal_start(void)
void update_damage_popups(void)
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)
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)
void hide_foreground_models_unchecked(void)
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)
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)
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)
void update_health_bars(void)
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)
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)
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)
void update_action_ratings(void)
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 *)
void btl_state_draw_end_training_battle(void)
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)
void draw_status_ui(void)
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
#define NPC_DISPOSE_POS_Z
#define UNPACK_PAL_B(color)
#define Else
Marks the end of an if statement and the start of the else block.
#define UNPACK_PAL_R(color)
#define AddF(VAR, FLOAT_VALUE)
#define EndChildThread
Marks the end of a child thread block.
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Add(VAR, INT_VALUE)
#define EndLoop
Marks the end of a loop.
#define NPC_DISPOSE_POS_X
#define NPC_DISPOSE_POS_Y
#define UNPACK_PAL_G(color)
#define EndIf
Marks the end of an if statement or an else block.
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
#define PACK_FILL_DEPTH(z, dz)
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define PACK_FILL_COLOR(r, g, b, a)
#define SubF(VAR, FLOAT_VALUE)
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define ChildThread
Marks the start of a child thread block.
#define Loop(TIMES)
Marks the beginning of a loop.
#define Return
Kills the current EVT thread.
s32 spr_free_sprite(s32 spriteInstanceID)
void set_npc_imgfx_all(s32 spriteIdx, ImgFXType imgfxType, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
void(* initBattleCallback)(void)
s8 incrementStarPointDelay
s8 lastPlayerMenuSelection[16]
void(* preUpdateCallback)(void)
struct Actor * partnerActor
struct Actor * playerActor
s8 lastPartnerMenuSelection[16]
struct Actor * enemyActors[24]
void(* fpDoPreRender)(struct Camera *)
void(* fpDoPostRender)(struct Camera *)
void(* appendGfx)(void *)
GameStatus * gGameStatusPtr
BattleStatus gBattleStatus
PlayerStatus gPlayerStatus
DisplayContext * gDisplayContext