star beam and few others (#857)

* peach/star beam

* 3 more

* func_802A5290 wip

* PR comments
This commit is contained in:
Unnunu 2022-11-14 14:00:29 +03:00 committed by GitHub
parent 397cb10bc9
commit 17e4bff020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 1176 additions and 4086 deletions

View File

@ -2303,11 +2303,11 @@ typedef struct FireworkRocketFXData {
/* 0xA0 */ f32 unk_A0[4]; /* 0xA0 */ f32 unk_A0[4];
} FireworkRocketFXData; // size = 0xB0 } FireworkRocketFXData; // size = 0xB0
typedef struct PeachStarBeamInner { typedef struct PeachStarBeamSpirit {
/* 0x00 */ s32 flags; /* 0x00 */ s32 flags;
/* 0x04 */ Vec3f unk_04; /* 0x04 */ Vec3f pos;
/* 0x10 */ Vec3f unk_10; /* 0x10 */ Vec3f lockedPos;
} PeachStarBeamInner; // size = 0x1C } PeachStarBeamSpirit; // size = 0x1C
typedef struct PeachStarBeamFXData { typedef struct PeachStarBeamFXData {
/* 0x00 */ s32 type; /* 0x00 */ s32 type;
@ -2317,21 +2317,19 @@ typedef struct PeachStarBeamFXData {
/* 0x18 */ s32 primR; /* 0x18 */ s32 primR;
/* 0x1C */ s32 primG; /* 0x1C */ s32 primG;
/* 0x20 */ s32 primB; /* 0x20 */ s32 primB;
/* 0x24 */ s32 alpha; /* 0x24 */ s32 beamAlpha;
/* 0x28 */ s32 envR; /* 0x28 */ s32 envR;
/* 0x2C */ s32 envG; /* 0x2C */ s32 envG;
/* 0x30 */ s32 envB; /* 0x30 */ s32 envB;
/* 0x34 */ s32 envA; /* 0x34 */ s32 envA;
/* 0x38 */ f32 unk_38; /* 0x38 */ f32 beamScale;
/* 0x3C */ s32 unk_3C; /* 0x3C */ s32 unk_3C;
/* 0x40 */ f32 unk_40; /* 0x40 */ f32 rotationSpeed;
/* 0x44 */ f32 unk_44; /* 0x44 */ f32 rotationAngle;
/* 0x48 */ f32 unk_48; /* 0x48 */ f32 circleRadius;
/* 0x4C */ f32 unk_4C; /* 0x4C */ Vec3f circleCenter;
/* 0x50 */ f32 unk_50; /* 0x58 */ f32 twinkYOffset;
/* 0x54 */ f32 unk_54; /* 0x5C */ PeachStarBeamSpirit spirits[8];
/* 0x58 */ f32 unk_58;
/* 0x5C */ PeachStarBeamInner parts[8];
} PeachStarBeamFXData; // size = 0x13C } PeachStarBeamFXData; // size = 0x13C
typedef struct ChapterChangeFXData { typedef struct ChapterChangeFXData {

View File

@ -826,7 +826,11 @@ enum SoundIDs {
SOUND_233 = 0x00000233, SOUND_233 = 0x00000233,
SOUND_234 = 0x00000234, SOUND_234 = 0x00000234,
SOUND_23D = 0x0000023D, SOUND_23D = 0x0000023D,
SOUND_241 = 0x00000241,
SOUND_246 = 0x00000246, SOUND_246 = 0x00000246,
SOUND_248 = 0x00000248,
SOUND_249 = 0x00000249,
SOUND_24A = 0x0000024A,
SOUND_24B = 0x0000024B, SOUND_24B = 0x0000024B,
SOUND_259 = 0x00000259, SOUND_259 = 0x00000259,
SOUND_25A = 0x0000025A, SOUND_25A = 0x0000025A,
@ -1121,6 +1125,8 @@ enum SoundIDs {
SOUND_607 = 0x00000607, SOUND_607 = 0x00000607,
SOUND_62A = 0x0000062A, SOUND_62A = 0x0000062A,
SOUND_62B = 0x0000062B, SOUND_62B = 0x0000062B,
SOUND_648 = 0x00000648,
SOUND_649 = 0x00000649,
SOUND_6A2 = 0x000006A2, SOUND_6A2 = 0x000006A2,
SOUND_749 = 0x00000749, SOUND_749 = 0x00000749,
SOUND_759 = 0x00000759, SOUND_759 = 0x00000759,
@ -1183,6 +1189,7 @@ enum SoundIDs {
SOUND_2043 = 0x00002043, SOUND_2043 = 0x00002043,
SOUND_2045 = 0x00002045, SOUND_2045 = 0x00002045,
SOUND_2046 = 0x00002046, SOUND_2046 = 0x00002046,
SOUND_2047 = 0x00002047,
SOUND_2049 = 0x00002049, SOUND_2049 = 0x00002049,
SOUND_204A = 0x0000204A, SOUND_204A = 0x0000204A,
SOUND_204B = 0x0000204B, SOUND_204B = 0x0000204B,
@ -1449,6 +1456,8 @@ enum SoundIDs {
SOUND_80000065 = 0x80000065, SOUND_80000065 = 0x80000065,
SOUND_80000066 = 0x80000066, SOUND_80000066 = 0x80000066,
SOUND_80000067 = 0x80000067, SOUND_80000067 = 0x80000067,
SOUND_80000068 = 0x80000068,
SOUND_80000069 = 0x80000069,
SOUND_8000006A = 0x8000006A, SOUND_8000006A = 0x8000006A,
SOUND_8000006B = 0x8000006B, SOUND_8000006B = 0x8000006B,
SOUND_8000006C = 0x8000006C, SOUND_8000006C = 0x8000006C,

View File

@ -385,7 +385,7 @@ void func_802A4534(s32 arg0, s32 x, s32 y);
void func_802A5290(s32 arg0, s32 x, s32 y); void func_802A5290(s32 arg0, s32 x, s32 y);
void func_802A56F8(s32 arg0, s32 x, s32 y); void func_802A56F8(s32 arg0, s32 x, s32 y);
void func_802A5738(s32 arg0, s32 x, s32 y); void func_802A5738(s32 arg0, s32 x, s32 y);
void func_802A57C8(s32 arg0, s32 x, s32 y); void func_802A57C8(s32* userData, s32 x, s32 y, s32 width, s32 height, s32 opacity, s32 darkening);
void func_802A1000(void) { void func_802A1000(void) {
D_802AD006 = 255; D_802AD006 = 255;
@ -1750,13 +1750,10 @@ void func_802A4A10(void) {
D_802AD604 = 30; D_802AD604 = 30;
} }
// v0/v1 dumb
#ifdef NON_MATCHING
s32 func_802A4A54(void) { s32 func_802A4A54(void) {
BattleStatus* battleStatus = &gBattleStatus; BattleStatus* battleStatus = &gBattleStatus;
s32 id; s32 id;
s32 x; s32 x, y;
s32 y;
s32 width; s32 width;
s32 msgID; s32 msgID;
s32 i; s32 i;
@ -1774,29 +1771,29 @@ s32 func_802A4A54(void) {
hud_element_set_flags(id, HUD_ELEMENT_FLAGS_FILTER_TEX | HUD_ELEMENT_FLAGS_80); hud_element_set_flags(id, HUD_ELEMENT_FLAGS_FILTER_TEX | HUD_ELEMENT_FLAGS_80);
} }
D_802AD618 = id = hud_element_create(HES_AnimatedHandPointer); D_802AD618 = id = hud_element_create(&HES_AnimatedHandPointer);
hud_element_set_flags(id, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80); hud_element_set_flags(id, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
hud_element_set_render_pos(id, D_802AD63C, D_802AD63E); hud_element_set_render_pos(id, D_802AD63C, D_802AD63E);
D_802AD61C = id = hud_element_create(HES_GreenArrowUp); D_802AD61C = id = hud_element_create(&HES_GreenArrowUp);
hud_element_set_flags(id, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80); hud_element_set_flags(id, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
hud_element_set_render_pos(id, D_802AD63C + 39, D_802AD63E - 7); hud_element_set_render_pos(id, D_802AD63C + 39, D_802AD63E - 7);
D_802AD620 = id = hud_element_create(HES_GreenArrowDown); D_802AD620 = id = hud_element_create(&HES_GreenArrowDown);
hud_element_set_flags(id, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80); hud_element_set_flags(id, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
hud_element_set_render_pos(id, D_802AD63C + 39, D_802AD63E + 78); hud_element_set_render_pos(id, D_802AD63C + 39, D_802AD63E + 78);
D_802AD614 = MSG_PAL_STANDARD; D_802AD614 = MSG_PAL_STANDARD;
x = D_802AD63C; x = D_802AD63C;
y = D_802AD63E; y = D_802AD63E;
set_window_properties(6, x, y, 144, (D_802AD60A * 13) + 26, 0, func_802A5290, NULL, -1); set_window_properties(WINDOW_ID_6, x, y, 144, (D_802AD60A * 13) + 26, 0, func_802A5290, NULL, -1);
set_window_properties(7, x + 18, y - 6, 108, 16, 1, func_802A56F8, NULL, -1); set_window_properties(WINDOW_ID_7, x + 18, y - 6, 108, 16, 1, func_802A56F8, NULL, -1);
x = 20; x = 20;
y = 186; y = 186;
set_window_properties(8, x, y, 280, 32, 0x14, func_802A5738, NULL, -1); set_window_properties(WINDOW_ID_8, x, y, 280, 32, 20, func_802A5738, NULL, -1);
set_window_update(6, 1); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW);
set_window_update(7, 1); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW);
set_window_update(8, 1); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW);
D_802AD604 = 1; D_802AD604 = 1;
break; break;
case 1: case 1:
@ -1834,7 +1831,7 @@ s32 func_802A4A54(void) {
D_802AD608 = D_802AD605; D_802AD608 = D_802AD605;
} }
if (D_802AD605 >= D_802AD609) { if (D_802AD605 >= D_802AD609) {
D_802AD608 = D_802AD605 - (D_802AD60A - 1); D_802AD608 = D_802AD605 + 1 - D_802AD60A;
} }
D_802AD609 = D_802AD608 + 6; D_802AD609 = D_802AD608 + 6;
if (D_802AD609 > D_802AD66C) { if (D_802AD609 > D_802AD66C) {
@ -1867,32 +1864,32 @@ s32 func_802A4A54(void) {
hud_element_set_tint(D_802AD618, 160, 160, 160); hud_element_set_tint(D_802AD618, 160, 160, 160);
hud_element_set_tint(D_802AD61C, 160, 160, 160); hud_element_set_tint(D_802AD61C, 160, 160, 160);
hud_element_set_tint(D_802AD620, 160, 160, 160); hud_element_set_tint(D_802AD620, 160, 160, 160);
hud_element_set_script(D_802AD618, HES_HandPointer); hud_element_set_script(D_802AD618, &HES_HandPointer);
D_802AD614 = MSG_PAL_0D; D_802AD614 = MSG_PAL_0D;
set_window_update(6, 4); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_DARKENED);
set_window_update(7, 4); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_DARKENED);
set_window_update(8, 2); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE);
return D_802AD605 + 1; return D_802AD605 + 1;
case -2: case -2:
return 0xFF; return 255;
case 10: case 10:
set_window_update(6, 2); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE);
set_window_update(7, 2); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_HIDE);
set_window_update(8, 2); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE);
D_802AD604 = 11; D_802AD604 = 11;
return D_802AD605 + 1; return D_802AD605 + 1;
case 11: case 11:
return D_802AD605 + 1; return D_802AD605 + 1;
case 20: case 20:
set_window_update(6, 1); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW);
set_window_update(7, 1); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW);
set_window_update(8, 1); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW);
D_802AD604 = 1; D_802AD604 = 1;
return D_802AD605 + 1; return D_802AD605 + 1;
case 30: case 30:
set_window_update(6, 1); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW);
set_window_update(7, 1); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW);
set_window_update(8, 1); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW);
D_802AD604 = -1; D_802AD604 = -1;
break; break;
case 40: case 40:
@ -1900,19 +1897,23 @@ s32 func_802A4A54(void) {
D_802AD604 = 41; D_802AD604 = 41;
return -1; return -1;
case 41: case 41:
set_window_update(6, 2); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE);
set_window_update(7, 2); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_HIDE);
set_window_update(8, 2); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE);
if (D_802AD610 == 0) { switch (D_802AD610) {
msgID = 0x1D0000; case 0:
msgID |= 0xCB; msgID = MSG_Menus_00CB;
} else { break;
msgID = 0x1D0000; case 1:
msgID |= 0xCC; msgID = MSG_Menus_00CC;
break;
default:
msgID = MSG_Menus_00CC;
break;
} }
width = get_msg_width(msgID, 0) + 23; width = get_msg_width(msgID, 0) + 23;
set_window_properties(9, (SCREEN_WIDTH / 2) - ((width) / 2), 80, width, 28, 0x14, func_802A57C8, NULL, -1); set_window_properties(WINDOW_ID_9, (SCREEN_WIDTH / 2) - (width / 2), 80, width, 28, 20, func_802A57C8, NULL, -1);
set_window_update(9, 1); set_window_update(WINDOW_ID_9, 1);
D_802AD612 = 60; D_802AD612 = 60;
D_802AD604 = 42; D_802AD604 = 42;
return -1; return -1;
@ -1924,18 +1925,17 @@ s32 func_802A4A54(void) {
D_802AD612--; D_802AD612--;
return -1; return -1;
} }
set_window_update(9, 2); set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE);
set_window_update(6, 1); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW);
set_window_update(7, 1); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW);
set_window_update(8, 1); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW);
D_802AD604 = 1; D_802AD604 = 1;
break; break;
} }
return 0; return 0;
} }
#else
INCLUDE_ASM(s32, "415D90", func_802A4A54); static const f32 padding4 = 0.0f;
#endif
// getting there but needs work // getting there but needs work
#ifdef NON_EQUIVALENT #ifdef NON_EQUIVALENT
@ -1953,8 +1953,9 @@ void func_802A5290(s32 arg0, s32 x, s32 y) {
s32 yOffset; s32 yOffset;
s32 uly; s32 uly;
s32 xTemp; s32 xTemp;
s32 iconIndex; s32 id;
s32 i; s32 i;
s32 j;
switch (D_802AD604) { switch (D_802AD604) {
case -1: case -1:
@ -1980,26 +1981,25 @@ void func_802A5290(s32 arg0, s32 x, s32 y) {
xTemp = x + 33; xTemp = x + 33;
phi_s1 = y + (D_802AD60C + 19); phi_s1 = y + (D_802AD60C + 19);
for (i = 0; i < D_802AD66C; i++, phi_s1 += 13) { for (j = 0; j < D_802AD66C; phi_s1 += 13, j++) {
s32 palette = D_802AD614; s32 palette = D_802AD614;
if (D_802AD678[i] == 5 && is_ability_active(ABILITY_QUICK_CHANGE)) { if (D_802AD678[j] == 5 && is_ability_active(ABILITY_QUICK_CHANGE)) {
palette = MSG_PAL_37; palette = MSG_PAL_37;
} }
if (D_802AD690[i] == 0) { if (D_802AD690[j] == 0) {
palette = MSG_PAL_0B; palette = MSG_PAL_0B;
} }
draw_msg(D_802AD658[i], xTemp, phi_s1, D_802AD624, palette, DRAW_MSG_STYLE_MENU); draw_msg(D_802AD658[j], xTemp, phi_s1, D_802AD624, palette, DRAW_MSG_STYLE_MENU);
} }
xTemp = x + 24; xTemp = x + 24;
phi_s1_2 = D_802AD60C + y + 24; phi_s1 = D_802AD60C + y + 24;
for (i = 0; i < D_802AD66C; i++, phi_s1_2 += 13) { for (i = 0; i < D_802AD66C; phi_s1 += 13, i++) {
iconIndex = D_802AD628[i]; id = D_802AD628[i];
hud_element_set_render_pos(id, xTemp, phi_s1);
hud_element_set_render_pos(iconIndex, xTemp, phi_s1_2); hud_element_set_alpha(id, D_802AD624);
hud_element_set_alpha(iconIndex, D_802AD624); hud_element_draw_without_clipping(id);
hud_element_draw_without_clipping(iconIndex);
} }
temp_s1_3 = (D_802AD605 - D_802AD608) * 13; temp_s1_3 = (D_802AD605 - D_802AD608) * 13;
@ -2010,23 +2010,23 @@ void func_802A5290(s32 arg0, s32 x, s32 y) {
D_802AD60E = temp_s1_3; D_802AD60E = temp_s1_3;
} }
iconIndex = D_802AD618; id = D_802AD618;
hud_element_set_render_pos(iconIndex, x + 10, y + (D_802AD60E + 26)); hud_element_set_render_pos(id, x + 10, y + (D_802AD60E + 26));
hud_element_set_alpha(iconIndex, D_802AD624); hud_element_set_alpha(id, D_802AD624);
hud_element_draw_clipped(iconIndex); hud_element_draw_clipped(id);
if (D_802AD608 > 0) { if (D_802AD608 > 0) {
iconIndex = D_802AD61C; id = D_802AD61C;
hud_element_set_render_pos(iconIndex, x + 67, y + 16); hud_element_set_render_pos(id, x + 67, y + 16);
hud_element_set_alpha(iconIndex, D_802AD624); hud_element_set_alpha(id, D_802AD624);
hud_element_draw_clipped(iconIndex); hud_element_draw_clipped(id);
} }
if (D_802AD609 < D_802AD66C) { if (D_802AD609 < D_802AD66C) {
iconIndex = D_802AD620; id = D_802AD620;
hud_element_set_render_pos(iconIndex, x + 67, y + 100); hud_element_set_render_pos(id, x + 67, y + 100);
hud_element_set_alpha(iconIndex, D_802AD624); hud_element_set_alpha(id, D_802AD624);
hud_element_draw_clipped(iconIndex); hud_element_draw_clipped(id);
} }
break; break;
@ -2037,7 +2037,7 @@ INCLUDE_ASM(s32, "415D90", func_802A5290);
#endif #endif
void func_802A56F8(s32 arg0, s32 x, s32 y) { void func_802A56F8(s32 arg0, s32 x, s32 y) {
draw_msg(0x1D0043, x + 15, y + 2, D_802AD624, MSG_PAL_33, DRAW_MSG_STYLE_MENU); draw_msg(MSG_Menus_0043, x + 15, y + 2, D_802AD624, MSG_PAL_33, DRAW_MSG_STYLE_MENU);
} }
void func_802A5738(s32 arg0, s32 x, s32 y) { void func_802A5738(s32 arg0, s32 x, s32 y) {
@ -2054,29 +2054,24 @@ void func_802A5738(s32 arg0, s32 x, s32 y) {
} }
} }
// regalloc, arg setting order dumbness void func_802A57C8(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
#ifdef NON_EQUIVALENT s32 x = baseX + 11;
void func_802A57C8(s32 arg0, s32 x, s32 y) { s32 y = baseY + 6;
s32 a0; s32 msgID;
s32 x2; switch (D_802AD610) {
s32 y2; case 0:
msgID = MSG_Menus_00CB;
x2 = x + 11; break;
y2 = y + 6; case 1:
msgID = MSG_Menus_00CC;
if (D_802AD610 == 0) { break;
a0 = 0x1D0000; default:
a0 |= 0xCB; msgID = MSG_Menus_00CC;
} else { break;
a0 = 0x1D0000;
a0 |= 0xCC;
} }
draw_msg(a0, x2, y2, 255, MSG_PAL_0F, 0); draw_msg(msgID, x, y, 255, MSG_PAL_0F, 0);
} }
#else
INCLUDE_ASM(s32, "415D90", func_802A57C8);
#endif
s32 can_btl_state_update_switch_to_player(void) { s32 can_btl_state_update_switch_to_player(void) {
BattleStatus* battleStatus = &gBattleStatus; BattleStatus* battleStatus = &gBattleStatus;

View File

@ -0,0 +1,768 @@
#include "common.h"
#include "script_api/battle.h"
#include "common/StarPower.inc.c"
ApiStatus N(GetStage)(Evt* script, s32 isInitialCall);
ApiStatus N(starBeam2)(Evt* script, s32 isInitialCall);
EvtScript N(802A24F0) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_GotItem)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(PlayerRunToGoal, 0)
EVT_WAIT(8)
EVT_CALL(PlaySound, SOUND_241)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(FadeBackgroundToBlack))
EVT_WAIT(20)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_AnimPray)
EVT_WAIT(10)
EVT_CALL(PlaySound, SOUND_2051)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(N(UnkStarFunc), 0)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0, FALSE)
EVT_CALL(N(UnkStarFunc), 4)
EVT_WAIT(8)
EVT_CALL(PlaySound, SOUND_241)
EVT_CALL(N(UnkStarFunc), 1)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(FadeBackgroundToBlack))
EVT_WAIT(20)
EVT_CALL(PlaySound, SOUND_2051)
EVT_CALL(N(UnkStarFunc), 1)
EVT_WAIT(10)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(beforeUsePower) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_GotItem)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(PlayerRunToGoal, 0)
EVT_WAIT(8)
EVT_CALL(PlaySound, SOUND_241)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(UnkBackgroundFunc2))
EVT_WAIT(20)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_AnimPray)
EVT_WAIT(10)
EVT_CALL(PlaySound, SOUND_2051)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(N(UnkStarFunc), 0)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0, FALSE)
EVT_CALL(N(UnkStarFunc), 4)
EVT_WAIT(8)
EVT_CALL(PlaySound, SOUND_241)
EVT_CALL(N(UnkStarFunc), 1)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(UnkBackgroundFunc2))
EVT_WAIT(20)
EVT_CALL(PlaySound, SOUND_2051)
EVT_CALL(N(UnkStarFunc), 1)
EVT_WAIT(10)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A2C20) = {
EVT_WAIT(8)
EVT_CALL(SetForegroundModelsVisible, 0)
EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_73)
EVT_CALL(MoveBattleCamOver, 1)
EVT_CALL(PlaySound, SOUND_2041)
EVT_CALL(CreateNpc, 100, LVar0)
EVT_CALL(N(SetNpcCollision32))
EVT_CALL(SetNpcFlagBits, 100, NPC_FLAG_40000, TRUE)
EVT_CALL(SetNpcPos, 100, -75, 150, 0)
EVT_CALL(SetNpcDecoration, 100, 0, 5)
EVT_CALL(N(UnkStarFunc3), -75, 167, 0)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_SET(LVar0, 0)
EVT_LOOP(8)
EVT_ADD(LVar0, 67)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_THREAD
EVT_WAIT(10)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_END_THREAD
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 50)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 30, 0, 10)
EVT_CALL(SetForegroundModelsVisible, 1)
EVT_RETURN
EVT_END
};
EvtScript N(802A2E2C) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(PlaySound, SOUND_2047)
EVT_THREAD
EVT_LOOP(5)
EVT_WAIT(6)
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc4), LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 720)
EVT_CALL(MakeLerp, LVar2, LVar3, 30, 2)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 60)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_ADD(LVar1, 140)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_CALL(DeleteNpc, 100)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(PlaySound, SOUND_2045)
EVT_THREAD
EVT_LOOP(5)
EVT_WAIT(6)
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc4), LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 720)
EVT_CALL(MakeLerp, LVar2, LVar3, 30, 2)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 60)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_ADD(LVar1, 140)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_CALL(DeleteNpc, 100)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(afterUsePower) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, ACTOR_PLAYER)
EVT_CALL(N(UnkBackgroundFunc))
EVT_WAIT(15)
EVT_CALL(SetGoalToHome, ACTOR_PLAYER)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_Running)
EVT_CALL(PlayerRunToGoal, 0)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_10002)
EVT_ELSE
EVT_CALL(N(UnkBackgroundFunc))
EVT_WAIT(15)
EVT_CALL(SetGoalToHome, ACTOR_PARTNER)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(8.0))
EVT_CALL(N(UnkStarFunc), 3)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A33A8) = {
EVT_THREAD
EVT_CALL(PlayEffect, EFFECT_SHIMMER_BURST, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(5)
EVT_CALL(PlayEffect, EFFECT_SHIMMER_BURST, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_IF_EQ(LVarA, 1)
EVT_WAIT(5)
EVT_CALL(PlayEffect, EFFECT_SHIMMER_BURST, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_END_IF
EVT_END_THREAD
EVT_WAIT(20)
EVT_CALL(PlayEffect, EFFECT_ENERGY_ORB_WAVE, 4, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 30, 0, 0, 0, 0, 0, 0, 0)
EVT_RETURN
EVT_END
};
s32 N(spiritsFlyDelay)[] = { 35, 0, 5, 10, 15, 20, 25, 30 };
s32 N(spiritsFlyAwayDelay)[] = { 35, 0, 5, 10, 15, 20, 25, 30 };
f32 N(spiritsScatterPos)[] = {
89.0f, 180.0f, 0.0f,
-36.0f, 180.0f, 0.0f,
204.0f, 180.0f, 0.0f,
30.0f, 97.0f, 477.0f,
230.0f, 81.0f, 0.0f,
129.0f, 180.0f, 0.0f,
-60.0f, 180.0f, 0.0f,
-234.0f, 39.0f, 0.0f,
};
enum {
PEACH_STAR_BEAM_CREATE_EFFECT = 0,
PEACH_STAR_BEAM_SPIRITS_APPEAR = 1,
PEACH_STAR_BEAM_ZOOM_OUT = 2,
PEACH_STAR_BEAM_SHRINK_CIRCLE = 3,
PEACH_STAR_BEAM_FLY_TO_TARGET = 4,
PEACH_STAR_BEAM_MAKE_ADDITIONAL_EFFECTS = 5,
PEACH_STAR_BEAM_MAKE_BEAM = 6,
PEACH_STAR_BEAM_WAIT = 7,
PEACH_STAR_BEAM_FADE_OUT_BEAM = 8,
PEACH_STAR_BEAM_START_FLY_AWAY = 9,
PEACH_STAR_BEAM_SPIRITS_FLY_AWAY = 10,
PEACH_STAR_BEAM_IMMUNE = 20,
PEACH_STAR_BEAM_SPIRITS_SCATTER = 21,
};
static EffectInstance* N(effect);
static char N(padding)[4];
static s32 N(miscParticlesTimeLeft)[8];
static s32 N(spiritsMoveTime)[8];
static s32 N(starBeamStage);
ApiStatus N(ProcessPeachStarBeam)(Evt* script, s32 isInitialCall) {
PeachStarBeamFXData* effectData;
PeachStarBeamSpirit* spirit;
Bytecode* args = script->ptrReadPos;
Actor* player = gBattleStatus.playerActor;
ActorState* playerState = &player->state;
s32 i;
f32 currentPosX, currentPosY, currentPosZ;
f32 targetPosX, targetPosY, targetPosZ;
f32 goalPosX, goalPosY, goalPosZ;
s32 cond;
Evt* newScript;
f32 dist;
if (isInitialCall) {
N(starBeamStage) = 0;
script->functionTemp[2] = evt_get_variable(script, *args++);
script->functionTemp[0] = PEACH_STAR_BEAM_CREATE_EFFECT;
}
if (player->targetListLength == 1) {
Actor* target = get_actor(player->targetActorID);
if (target == NULL) {
return ApiStatus_DONE2;
}
get_actor_part(target, player->targetPartIndex);
targetPosX = target->currentPos.x + target->headOffset.x;
if (target->flags & ACTOR_FLAG_HP_OFFSET_BELOW) {
targetPosY = target->currentPos.y + target->headOffset.y - target->size.y;
} else if (!(target->flags & ACTOR_FLAG_8000)) {
targetPosY = target->currentPos.y + target->headOffset.y + target->size.y;
} else {
targetPosY = target->currentPos.y + target->headOffset.y + target->size.y * 2;
}
targetPosZ = target->currentPos.z + target->headOffset.z;
} else {
targetPosX = 64.0f;
targetPosY = 80.0f;
targetPosZ = 0.0f;
}
switch (script->functionTemp[0]) {
case PEACH_STAR_BEAM_SPIRITS_APPEAR:
case PEACH_STAR_BEAM_ZOOM_OUT:
case PEACH_STAR_BEAM_SHRINK_CIRCLE:
case PEACH_STAR_BEAM_FLY_TO_TARGET:
case PEACH_STAR_BEAM_MAKE_ADDITIONAL_EFFECTS:
case PEACH_STAR_BEAM_MAKE_BEAM:
case PEACH_STAR_BEAM_WAIT:
case PEACH_STAR_BEAM_FADE_OUT_BEAM:
case PEACH_STAR_BEAM_START_FLY_AWAY:
effectData = N(effect)->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(effectData->spirits); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
spirit = &effectData->spirits[i];
if (N(miscParticlesTimeLeft)[i] != 0) {
N(miscParticlesTimeLeft)[i]--;
} else {
N(miscParticlesTimeLeft)[i] = 20;
if (N(spiritsFlyDelay)[i] <= 0) {
fx_misc_particles(4, spirit->lockedPos.x, spirit->lockedPos.y, spirit->lockedPos.z, 20.0f, 20.0f, 1.0f, 10, 20);
} else {
fx_misc_particles(4, spirit->pos.x, spirit->pos.y, spirit->pos.z, 20.0f, 20.0f, 1.0f, 10, 20);
}
}
}
}
break;
case PEACH_STAR_BEAM_SPIRITS_FLY_AWAY:
effectData = N(effect)->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(effectData->spirits); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
spirit = &effectData->spirits[i];
if (N(miscParticlesTimeLeft)[i] != 0) {
N(miscParticlesTimeLeft)[i]--;
} else {
N(miscParticlesTimeLeft)[i] = 20;
if (N(spiritsFlyAwayDelay)[i] <= 0) {
fx_misc_particles(4, spirit->lockedPos.x, spirit->lockedPos.y, spirit->lockedPos.z, 20.0f, 20.0f, 1.0f, 10, 20);
} else {
fx_misc_particles(4, spirit->pos.x, spirit->pos.y, spirit->pos.z, 20.0f, 20.0f, 1.0f, 10, 20);
}
}
}
}
break;
}
switch (script->functionTemp[0]) {
case PEACH_STAR_BEAM_CREATE_EFFECT:
currentPosX = player->currentPos.x;
currentPosY = player->currentPos.y + player->size.y + 30.0f;
currentPosZ = player->currentPos.z;
playerState->currentPos.x = currentPosX;
playerState->currentPos.y = currentPosY + 150.0f;
playerState->currentPos.z = currentPosZ;
playerState->goalPos.x = currentPosX;
playerState->goalPos.y = currentPosY;
playerState->goalPos.z = currentPosZ;
if (script->functionTemp[2] == 0) {
N(effect) = fx_peach_star_beam(0, currentPosX, currentPosY, currentPosZ, 1.0f, 0);
} else {
N(effect) = fx_peach_star_beam(1, currentPosX, currentPosY, currentPosZ, 1.0f, 0);
}
playerState->distance = 48.0f;
N(effect)->data.peachStarBeam->unk_3C = 0;
N(effect)->data.peachStarBeam->circleRadius = playerState->distance;
N(effect)->data.peachStarBeam->beamAlpha = 0;
N(effect)->data.peachStarBeam->twinkYOffset = 30.0f;
N(effect)->data.peachStarBeam->rotationSpeed = 5.0f;
for (i = 0; i < ARRAY_COUNT(N(miscParticlesTimeLeft)); i++) {
N(miscParticlesTimeLeft)[i] = rand_int(20);
}
script->functionTemp[1] = 40;
if (script->functionTemp[2] == 0) {
sfx_play_sound(SOUND_80000068);
} else {
sfx_play_sound(SOUND_80000069);
}
script->functionTemp[0] = PEACH_STAR_BEAM_SPIRITS_APPEAR;
break;
case PEACH_STAR_BEAM_SPIRITS_APPEAR:
playerState->currentPos.y += (playerState->goalPos.y - playerState->currentPos.y) / 10.0f;
N(effect)->data.peachStarBeam->circleCenter.x = playerState->currentPos.x;
N(effect)->data.peachStarBeam->circleCenter.y = playerState->currentPos.y;
N(effect)->data.peachStarBeam->circleCenter.z = playerState->currentPos.z;
N(effect)->data.peachStarBeam->unk_3C = 0;
N(effect)->data.peachStarBeam->circleRadius = playerState->distance;
N(effect)->data.peachStarBeam->beamAlpha = 0;
if (script->functionTemp[1] == 0) {
script->functionTemp[1] = 20;
script->functionTemp[0] = PEACH_STAR_BEAM_ZOOM_OUT;
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_ZOOM_OUT:
if (script->functionTemp[1] == 0) {
btl_cam_use_preset(BTL_CAM_PRESET_C);
btl_cam_move(10);
script->functionTemp[1] = 15;
script->functionTemp[0] = PEACH_STAR_BEAM_SHRINK_CIRCLE;
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_SHRINK_CIRCLE:
playerState->distance += (24.0f - playerState->distance) * 0.125f;
N(effect)->data.peachStarBeam->circleRadius = playerState->distance;
if (script->functionTemp[1] == 0) {
playerState->goalPos.x = targetPosX;
playerState->goalPos.y = targetPosY;
playerState->goalPos.z = targetPosZ;
for (i = 0; i < ARRAY_COUNT(N(spiritsMoveTime)); i++) {
N(spiritsMoveTime)[i] = 30;
}
if (script->functionTemp[2] == 0) {
sfx_play_sound(SOUND_648);
} else {
sfx_play_sound(SOUND_649);
}
script->functionTemp[0] = PEACH_STAR_BEAM_FLY_TO_TARGET;
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_FLY_TO_TARGET:
cond = FALSE;
playerState->distance += (48.0f - playerState->distance) * 0.25f;
N(effect)->data.peachStarBeam->circleRadius = playerState->distance;
for (i = 0; i < 2; i++) {
if (i != 0) {
spirit = &effectData->spirits[i];
if (N(spiritsFlyDelay)[i] < 0) {
currentPosX = playerState->currentPos.x;
currentPosY = playerState->currentPos.y;
currentPosZ = playerState->currentPos.z;
goalPosX = playerState->goalPos.x;
goalPosY = playerState->goalPos.y;
goalPosZ = playerState->goalPos.z;
playerState->currentPos.x += goalPosX - currentPosX;
playerState->currentPos.y += goalPosY - currentPosY;
playerState->currentPos.z += goalPosZ - currentPosZ;
} else {
cond = TRUE;
if (N(spiritsFlyDelay)[i] != 0) {
N(spiritsFlyDelay)[i]--;
} else {
currentPosX = playerState->currentPos.x;
currentPosY = playerState->currentPos.y;
currentPosZ = playerState->currentPos.z;
goalPosX = playerState->goalPos.x;
goalPosY = playerState->goalPos.y;
goalPosZ = playerState->goalPos.z;
dist = dist2D(currentPosX, currentPosZ, goalPosX, goalPosZ);
playerState->currentPos.x += (goalPosX - currentPosX) / N(spiritsMoveTime)[i];
playerState->currentPos.y += (goalPosY - currentPosY) / N(spiritsMoveTime)[i];
playerState->currentPos.z += (goalPosZ - currentPosZ) / N(spiritsMoveTime)[i];
if (N(spiritsMoveTime)[i] == 1) {
N(spiritsFlyDelay)[i] = -1;
playerState->currentPos.x = goalPosX;
playerState->currentPos.y = goalPosY;
playerState->currentPos.z = goalPosZ;
} else {
playerState->currentPos.y += dist / 60.0f;
}
N(spiritsMoveTime)[i]--;
}
}
}
}
N(effect)->data.peachStarBeam->circleCenter.x = playerState->currentPos.x;
N(effect)->data.peachStarBeam->circleCenter.y = playerState->currentPos.y;
N(effect)->data.peachStarBeam->circleCenter.z = playerState->currentPos.z;
N(effect)->data.peachStarBeam->pos.x = playerState->currentPos.x;
N(effect)->data.peachStarBeam->pos.y = 0.0f;
N(effect)->data.peachStarBeam->pos.z = playerState->currentPos.z;
if (!cond) {
playerState->currentPos.x = playerState->goalPos.x;
playerState->currentPos.y = playerState->goalPos.y;
playerState->currentPos.z = playerState->goalPos.z;
N(effect)->data.peachStarBeam->circleCenter.x = playerState->currentPos.x;
N(effect)->data.peachStarBeam->circleCenter.y = playerState->currentPos.y;
N(effect)->data.peachStarBeam->circleCenter.z = playerState->currentPos.z;
N(effect)->data.peachStarBeam->pos.x = playerState->currentPos.x;
N(effect)->data.peachStarBeam->pos.y = 0.0f;
N(effect)->data.peachStarBeam->pos.z = playerState->currentPos.z;
effectData = N(effect)->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(effectData->spirits); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
spirit = &effectData->spirits[i];
N(spiritsFlyDelay)[i] = 1;
spirit->flags &= ~2;
}
}
btl_cam_use_preset(BTL_CAM_PRESET_D);
btl_cam_move(30);
script->functionTemp[1] = 15;
script->functionTemp[0] = PEACH_STAR_BEAM_MAKE_ADDITIONAL_EFFECTS;
}
break;
case PEACH_STAR_BEAM_MAKE_ADDITIONAL_EFFECTS:
if (script->functionTemp[1] == 0) {
playerState->moveTime = 0;
N(effect)->data.peachStarBeam->unk_3C = 0;
N(effect)->data.peachStarBeam->beamAlpha = 0;
if (script->functionTemp[2] != 0) {
N(effect)->data.peachStarBeam->primR = 240;
N(effect)->data.peachStarBeam->primG = 80;
N(effect)->data.peachStarBeam->primB = 200;
N(effect)->data.peachStarBeam->envR = 240;
N(effect)->data.peachStarBeam->envG = 240;
N(effect)->data.peachStarBeam->envB = 240;
}
newScript = start_script(&N(802A33A8), EVT_PRIORITY_A, 0);
newScript->varTable[0] = playerState->currentPos.x;
newScript->varTable[1] = playerState->currentPos.y * 0.5f;
newScript->varTable[2] = playerState->currentPos.z;
newScript->varTable[10] = script->functionTemp[2];
do {} while (0); // required to match
sfx_play_sound(SOUND_24A);
script->functionTemp[1] = 45;
script->functionTemp[0] = PEACH_STAR_BEAM_MAKE_BEAM;
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_MAKE_BEAM:
playerState->moveTime += 30;
if (playerState->moveTime > 255) {
playerState->moveTime = 255;
}
N(effect)->data.peachStarBeam->unk_3C = playerState->moveTime;
N(effect)->data.peachStarBeam->beamAlpha = playerState->moveTime;
if (script->functionTemp[1] == 0) {
N(starBeamStage) = 1;
if (script->functionTemp[2] == 0 && player->targetListLength == 1) {
if (get_actor_part(get_actor(player->targetActorID), player->targetPartIndex)->eventFlags & ACTOR_EVENT_FLAG_80000) {
script->functionTemp[0] = PEACH_STAR_BEAM_IMMUNE;
} else {
script->functionTemp[1] = 15;
script->functionTemp[0] = PEACH_STAR_BEAM_WAIT;
}
} else {
script->functionTemp[1] = 15;
script->functionTemp[0] = PEACH_STAR_BEAM_WAIT;
}
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_WAIT:
if (script->functionTemp[1] == 0) {
script->functionTemp[1] = 10;
script->functionTemp[0] = PEACH_STAR_BEAM_FADE_OUT_BEAM;
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_FADE_OUT_BEAM:
playerState->moveTime -= 30;
if (playerState->moveTime < 0) {
playerState->moveTime = 0;
}
N(effect)->data.peachStarBeam->unk_3C = playerState->moveTime;
N(effect)->data.peachStarBeam->beamAlpha = playerState->moveTime;
if (script->functionTemp[1] == 0) {
script->functionTemp[1] = 10;
script->functionTemp[0] = PEACH_STAR_BEAM_START_FLY_AWAY;
} else {
script->functionTemp[1]--;
}
break;
case PEACH_STAR_BEAM_START_FLY_AWAY:
if (script->functionTemp[1] != 0) {
script->functionTemp[1]--;
break;
}
playerState->goalPos.x = targetPosX;
playerState->goalPos.y = targetPosY + 170.0f;
playerState->goalPos.z = targetPosZ;
script->functionTemp[1] = 20;
script->functionTemp[0] = PEACH_STAR_BEAM_SPIRITS_FLY_AWAY;
break;
case PEACH_STAR_BEAM_SPIRITS_FLY_AWAY:
if (script->functionTemp[1] != 0) {
script->functionTemp[1]--;
if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] == 0) {
func_80149A6C(SOUND_248, TRUE);
sfx_play_sound(SOUND_648);
} else {
func_80149A6C(SOUND_249, TRUE);
sfx_play_sound(SOUND_649);
}
}
}
cond = FALSE;
effectData = N(effect)->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(effectData->spirits); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
spirit = &effectData->spirits[i];
if (N(spiritsFlyAwayDelay)[i] >= 0) {
cond = TRUE;
if (N(spiritsFlyAwayDelay)[i] != 0) {
N(spiritsFlyAwayDelay)[i]--;
} else {
spirit->flags |= 2;
currentPosY = spirit->lockedPos.y;
spirit->lockedPos.y += (playerState->goalPos.y - currentPosY) / 10.0f;
if (fabsf(spirit->lockedPos.y - playerState->goalPos.y) < 1.0) {
N(spiritsFlyAwayDelay)[i] = -1;
}
}
}
}
}
if (!cond) {
N(starBeamStage) = 2;
N(effect)->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE2;
}
break;
case PEACH_STAR_BEAM_IMMUNE:
N(effect)->data.peachStarBeam->unk_3C = 0;
N(effect)->data.peachStarBeam->beamAlpha = 0;
for (i = 0; i < ARRAY_COUNT(N(spiritsMoveTime)); i++) {
N(spiritsMoveTime)[i] = 15;
}
if (script->functionTemp[2] == 0) {
func_80149A6C(SOUND_248, FALSE);
} else {
func_80149A6C(SOUND_249, FALSE);
}
script->functionTemp[0] = PEACH_STAR_BEAM_SPIRITS_SCATTER;
break;
case PEACH_STAR_BEAM_SPIRITS_SCATTER:
cond = FALSE;
effectData = N(effect)->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(effectData->spirits); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
spirit = &effectData->spirits[i];
if (N(spiritsFlyDelay)[i] < 0) {
currentPosX = spirit->lockedPos.x;
currentPosY = spirit->lockedPos.y;
currentPosZ = spirit->lockedPos.z;
goalPosX = N(spiritsScatterPos)[3 * i + 0];
goalPosY = N(spiritsScatterPos)[3 * i + 1];
goalPosZ = N(spiritsScatterPos)[3 * i + 2];
spirit->lockedPos.x += goalPosX - currentPosX;
spirit->lockedPos.y += goalPosY - currentPosY;
spirit->lockedPos.z += goalPosZ - currentPosZ;
} else {
cond = TRUE;
if (N(spiritsFlyDelay)[i] != 0) {
N(spiritsFlyDelay)[i]--;
} else {
currentPosX = spirit->lockedPos.x;
currentPosY = spirit->lockedPos.y;
currentPosZ = spirit->lockedPos.z;
spirit->flags |= 2;
goalPosX = N(spiritsScatterPos)[3 * i + 0];
goalPosY = N(spiritsScatterPos)[3 * i + 1];
goalPosZ = N(spiritsScatterPos)[3 * i + 2];
dist = dist2D(currentPosX, currentPosZ, goalPosX, goalPosZ);
spirit->lockedPos.x += (goalPosX - currentPosX) / N(spiritsMoveTime)[i];
spirit->lockedPos.y += (goalPosY - currentPosY) / N(spiritsMoveTime)[i];
spirit->lockedPos.z += (goalPosZ - currentPosZ) / N(spiritsMoveTime)[i];
if (N(spiritsMoveTime)[i] == 1) {
N(spiritsFlyDelay)[i] = -1;
spirit->lockedPos.x = goalPosX;
spirit->lockedPos.y = goalPosY;
spirit->lockedPos.z = goalPosZ;
} else {
spirit->lockedPos.y += dist / 60.0f;
}
N(spiritsMoveTime)[i]--;
}
}
}
}
if (!cond) {
N(starBeamStage) = 2;
N(effect)->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE2;
}
break;
}
return ApiStatus_BLOCK;
}
ApiStatus N(GetStage)(Evt* script, s32 isInitialCall) {
script->varTable[0] = N(starBeamStage);
return ApiStatus_DONE2;
}
ApiStatus N(unkStarBeamBgFunc)(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[0] = 230;
}
set_background_color_blend(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] -= 5;
if (script->functionTemp[0] <= 200) {
set_background_color_blend(0, 0, 0, 200);
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}

View File

@ -4,316 +4,21 @@
#define NAMESPACE battle_star_peach_beam #define NAMESPACE battle_star_peach_beam
#include "common/StarPower.inc.c" #include "../common/peach_star_beam.inc.c"
ApiStatus func_802A1518_799CC8(Evt* script, s32 isInitialCall);
INCLUDE_ASM(s32, "battle/star/peach_beam/7997B0", func_802A1518_799CC8);
ApiStatus func_802A2468_79AC18(Evt* script, s32 isInitialCall) {
script->varTable[0] = D_802A3838;
return ApiStatus_DONE2;
}
ApiStatus func_802A247C_79AC2C(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[0] = 230;
}
set_background_color_blend(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] -= 5;
if (script->functionTemp[0] <= 200) {
set_background_color_blend(0, 0, 0, 200);
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
// this file is identical in c code to star beam
// TODO: consider .inc.c?
EvtScript N(802A24F0) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_GotItem)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(PlayerRunToGoal, 0)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(FadeBackgroundToBlack))
EVT_WAIT(20)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_AnimPray)
EVT_WAIT(10)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(N(UnkStarFunc), 0)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0, FALSE)
EVT_CALL(N(UnkStarFunc), 4)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(N(UnkStarFunc), 1)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(FadeBackgroundToBlack))
EVT_WAIT(20)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(N(UnkStarFunc), 1)
EVT_WAIT(10)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A2888) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_GotItem)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(PlayerRunToGoal, 0)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(UnkBackgroundFunc2))
EVT_WAIT(20)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_AnimPray)
EVT_WAIT(10)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(N(UnkStarFunc), 0)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0, FALSE)
EVT_CALL(N(UnkStarFunc), 4)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(N(UnkStarFunc), 1)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(UnkBackgroundFunc2))
EVT_WAIT(20)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(N(UnkStarFunc), 1)
EVT_WAIT(10)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A2C20) = {
EVT_WAIT(8)
EVT_CALL(SetForegroundModelsVisible, 0)
EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_73)
EVT_CALL(MoveBattleCamOver, 1)
EVT_CALL(PlaySound, 0x2041)
EVT_CALL(CreateNpc, 100, LVar0)
EVT_CALL(N(SetNpcCollision32))
EVT_CALL(SetNpcFlagBits, 100, ((NPC_FLAG_40000)), TRUE)
EVT_CALL(SetNpcPos, 100, -75, 150, 0)
EVT_CALL(SetNpcDecoration, 100, 0, 5)
EVT_CALL(N(UnkStarFunc3), -75, 167, 0)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_SET(LVar0, 0)
EVT_LOOP(8)
EVT_ADD(LVar0, 67)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_THREAD
EVT_WAIT(10)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_END_THREAD
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 50)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 30, 0, 10)
EVT_CALL(SetForegroundModelsVisible, 1)
EVT_RETURN
EVT_END
};
EvtScript N(802A2E2C) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(PlaySound, 0x2047)
EVT_THREAD
EVT_LOOP(5)
EVT_WAIT(6)
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc4), LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 720)
EVT_CALL(MakeLerp, LVar2, LVar3, 30, 2)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 60)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_ADD(LVar1, 140)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_CALL(DeleteNpc, 100)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(PlaySound, 0x2045)
EVT_THREAD
EVT_LOOP(5)
EVT_WAIT(6)
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc4), LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 720)
EVT_CALL(MakeLerp, LVar2, LVar3, 30, 2)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 60)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_ADD(LVar1, 140)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_CALL(DeleteNpc, 100)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A327C) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(N(UnkBackgroundFunc))
EVT_WAIT(15)
EVT_CALL(SetGoalToHome, ACTOR_PLAYER)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_Running)
EVT_CALL(PlayerRunToGoal, 0)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_10002)
EVT_ELSE
EVT_CALL(N(UnkBackgroundFunc))
EVT_WAIT(15)
EVT_CALL(SetGoalToHome, ACTOR_PARTNER)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(8.0))
EVT_CALL(N(UnkStarFunc), 3)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A33A8) = {
EVT_THREAD
EVT_CALL(PlayEffect, 0x38, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(5)
EVT_CALL(PlayEffect, 0x38, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_IF_EQ(LVarA, 1)
EVT_WAIT(5)
EVT_CALL(PlayEffect, 0x38, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_END_IF
EVT_END_THREAD
EVT_WAIT(20)
EVT_CALL(PlayEffect, 0x52, 4, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 30, 0, 0, 0, 0, 0, 0, 0)
EVT_RETURN
EVT_END
};
s32 N(D_802A3514_7FCCC4)[] = {
0x00000023, 0x00000000, 0x00000005, 0x0000000A, 0x0000000F, 0x00000014, 0x00000019, 0x0000001E,
};
s32 N(D_802A3534_7FCCE4)[] = {
0x00000023, 0x00000000, 0x00000005, 0x0000000A, 0x0000000F, 0x00000014, 0x00000019, 0x0000001E,
};
s32 N(D_802A3554_7FCD04)[] = {
0x42B20000, 0x43340000, 0x00000000, 0xC2100000, 0x43340000, 0x00000000, 0x434C0000, 0x43340000,
0x00000000, 0x41F00000, 0x42C20000, 0x43EE8000, 0x43660000, 0x42A20000, 0x00000000, 0x43010000,
0x43340000, 0x00000000, 0xC2700000, 0x43340000, 0x00000000, 0xC36A0000, 0x421C0000, 0x00000000,
};
EvtScript N(usePower) = { EvtScript N(usePower) = {
EVT_EXEC_WAIT(N(802A2888)) EVT_EXEC_WAIT(N(beforeUsePower))
EVT_CALL(AddBattleCamZoom, 100) EVT_CALL(AddBattleCamZoom, 100)
EVT_CALL(MoveBattleCamOver, 20) EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(InitTargetIterator) EVT_CALL(InitTargetIterator)
EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_THREAD EVT_THREAD
EVT_CALL(func_802A1518_799CC8, 1) EVT_CALL(N(ProcessPeachStarBeam), 1)
EVT_END_THREAD EVT_END_THREAD
EVT_WAIT(10) EVT_WAIT(10)
EVT_LOOP(0) EVT_LOOP(0)
EVT_WAIT(1) EVT_WAIT(1)
EVT_CALL(func_802A2468_79AC18) EVT_CALL(N(GetStage))
EVT_IF_EQ(LVar0, 1) EVT_IF_EQ(LVar0, 1)
EVT_BREAK_LOOP EVT_BREAK_LOOP
EVT_END_IF EVT_END_IF
@ -328,15 +33,15 @@ EvtScript N(usePower) = {
EVT_END_IF EVT_END_IF
EVT_LOOP(0) EVT_LOOP(0)
EVT_WAIT(1) EVT_WAIT(1)
EVT_CALL(func_802A2468_79AC18) EVT_CALL(N(GetStage))
EVT_IF_EQ(LVar0, 2) EVT_IF_EQ(LVar0, 2)
EVT_BREAK_LOOP EVT_BREAK_LOOP
EVT_END_IF EVT_END_IF
EVT_END_LOOP EVT_END_LOOP
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(func_802A247C_79AC2C) EVT_CALL(N(unkStarBeamBgFunc))
EVT_CALL(func_80276EFC) EVT_CALL(func_80276EFC)
EVT_EXEC_WAIT(N(802A327C)) EVT_EXEC_WAIT(N(afterUsePower))
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };

View File

@ -5,293 +5,21 @@
#define NAMESPACE battle_star_star_beam #define NAMESPACE battle_star_star_beam
#include "common/StarPower.inc.c" #include "../common/peach_star_beam.inc.c"
ApiStatus func_802A1518_7974D8(Evt* script, s32 isInitialCall);
ApiStatus func_802A2468_798428(Evt* script, s32 isInitialCall);
ApiStatus func_802A247C_79843C(Evt* script, s32 isInitialCall);
EvtScript N(802A24F0) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_GotItem)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(PlayerRunToGoal, 0)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(FadeBackgroundToBlack))
EVT_WAIT(20)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_AnimPray)
EVT_WAIT(10)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(N(UnkStarFunc), 0)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0, FALSE)
EVT_CALL(N(UnkStarFunc), 4)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(N(UnkStarFunc), 1)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(FadeBackgroundToBlack))
EVT_WAIT(20)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(N(UnkStarFunc), 1)
EVT_WAIT(10)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A2888) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_GotItem)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(PlayerRunToGoal, 0)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(UnkBackgroundFunc2))
EVT_WAIT(20)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_AnimPray)
EVT_WAIT(10)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_WAIT(10)
EVT_CALL(N(UnkStarFunc), 0)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 16)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(4.0))
EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0, FALSE)
EVT_CALL(N(UnkStarFunc), 4)
EVT_WAIT(8)
EVT_CALL(PlaySound, 0x241)
EVT_CALL(N(UnkStarFunc), 1)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(UnkStarFunc1), LVar0, LVar1, LVar2)
EVT_CALL(N(UnkBackgroundFunc2))
EVT_WAIT(20)
EVT_CALL(PlaySound, 0x2051)
EVT_CALL(N(UnkStarFunc), 1)
EVT_WAIT(10)
EVT_CALL(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc2), LVar0, LVar1, LVar2)
EVT_WAIT(30)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A2C20) = {
EVT_WAIT(8)
EVT_CALL(SetForegroundModelsVisible, 0)
EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_73)
EVT_CALL(MoveBattleCamOver, 1)
EVT_CALL(PlaySound, 0x2041)
EVT_CALL(CreateNpc, 100, LVar0)
EVT_CALL(N(SetNpcCollision32))
EVT_CALL(SetNpcFlagBits, 100, ((NPC_FLAG_40000)), TRUE)
EVT_CALL(SetNpcPos, 100, -75, 150, 0)
EVT_CALL(SetNpcDecoration, 100, 0, 5)
EVT_CALL(N(UnkStarFunc3), -75, 167, 0)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_SET(LVar0, 0)
EVT_LOOP(8)
EVT_ADD(LVar0, 67)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_THREAD
EVT_WAIT(10)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_69)
EVT_END_THREAD
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 50)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 30, 0, 10)
EVT_CALL(SetForegroundModelsVisible, 1)
EVT_RETURN
EVT_END
};
EvtScript N(802A2E2C) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(PlaySound, 0x2047)
EVT_THREAD
EVT_LOOP(5)
EVT_WAIT(6)
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc4), LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 720)
EVT_CALL(MakeLerp, LVar2, LVar3, 30, 2)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 60)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_ADD(LVar1, 140)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_CALL(DeleteNpc, 100)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(PlaySound, 0x2045)
EVT_THREAD
EVT_LOOP(5)
EVT_WAIT(6)
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkStarFunc4), LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(EnableNpcBlur, 100, 1)
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 720)
EVT_CALL(MakeLerp, LVar2, LVar3, 30, 2)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, 100, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(GetNpcPos, 100, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 60)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_ADD(LVar1, 140)
EVT_CALL(NpcFlyTo, 100, LVar0, LVar1, LVar2, 15, 0, 10)
EVT_WAIT(10)
EVT_CALL(EnableNpcBlur, 100, 0)
EVT_CALL(DeleteNpc, 100)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A327C) = {
EVT_CALL(GetOwnerID, LVarA)
EVT_IF_EQ(LVarA, 0)
EVT_CALL(N(UnkBackgroundFunc))
EVT_WAIT(15)
EVT_CALL(SetGoalToHome, ACTOR_PLAYER)
EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_Running)
EVT_CALL(PlayerRunToGoal, 0)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_10002)
EVT_ELSE
EVT_CALL(N(UnkBackgroundFunc))
EVT_WAIT(15)
EVT_CALL(SetGoalToHome, ACTOR_PARTNER)
EVT_CALL(SetActorSpeed, ACTOR_PARTNER, EVT_FLOAT(8.0))
EVT_CALL(N(UnkStarFunc), 3)
EVT_CALL(RunToGoal, ACTOR_PARTNER, 0)
EVT_CALL(N(UnkStarFunc), 4)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802A33A8) = {
EVT_THREAD
EVT_CALL(PlayEffect, 0x38, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(5)
EVT_CALL(PlayEffect, 0x38, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_IF_EQ(LVarA, 1)
EVT_WAIT(5)
EVT_CALL(PlayEffect, 0x38, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100, 0, 0, 0, 0, 0, 0, 0)
EVT_END_IF
EVT_END_THREAD
EVT_WAIT(20)
EVT_CALL(PlayEffect, 0x52, 4, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 30, 0, 0, 0, 0, 0, 0, 0)
EVT_RETURN
EVT_END
};
s32 D_802A3514_7994D4[] = { 35, 0, 5, 10, 15, 20, 25, 30 };
s32 D_802A3534_7994F4[] = { 35, 0, 5, 10, 15, 20, 25, 30 };
Vec3f D_802A3554_799514[] = {
{ 89.0f, 180.0f, 0.0f },
{ -36.0f, 180.0f, 0.0f },
{ 204.0f, 180.0f, 0.0f },
{ 30.0f, 97.0f, 477.0f },
{ 230.0f, 81.0f, 0.0f },
{ 129.0f, 180.0f, 0.0f },
{ -60.0f, 180.0f, 0.0f },
{ -234.0f, 39.0f, 0.0f },
};
EvtScript N(usePower) = { EvtScript N(usePower) = {
EVT_EXEC_WAIT(N(802A2888)) EVT_EXEC_WAIT(N(beforeUsePower))
EVT_CALL(AddBattleCamZoom, 100) EVT_CALL(AddBattleCamZoom, 100)
EVT_CALL(MoveBattleCamOver, 20) EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(InitTargetIterator) EVT_CALL(InitTargetIterator)
EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_THREAD EVT_THREAD
EVT_CALL(func_802A1518_7974D8, 0) EVT_CALL(N(ProcessPeachStarBeam), 0)
EVT_END_THREAD EVT_END_THREAD
EVT_WAIT(10) EVT_WAIT(10)
EVT_LOOP(0) EVT_LOOP(0)
EVT_WAIT(1) EVT_WAIT(1)
EVT_CALL(func_802A2468_798428) EVT_CALL(N(GetStage))
EVT_IF_EQ(LVar0, 1) EVT_IF_EQ(LVar0, 1)
EVT_BREAK_LOOP EVT_BREAK_LOOP
EVT_END_IF EVT_END_IF
@ -306,504 +34,15 @@ EvtScript N(usePower) = {
EVT_END_IF EVT_END_IF
EVT_LOOP(0) EVT_LOOP(0)
EVT_WAIT(1) EVT_WAIT(1)
EVT_CALL(func_802A2468_798428) EVT_CALL(N(GetStage))
EVT_IF_EQ(LVar0, 2) EVT_IF_EQ(LVar0, 2)
EVT_BREAK_LOOP EVT_BREAK_LOOP
EVT_END_IF EVT_END_IF
EVT_END_LOOP EVT_END_LOOP
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)
EVT_CALL(func_802A247C_79843C) EVT_CALL(N(unkStarBeamBgFunc))
EVT_CALL(func_80276EFC) EVT_CALL(func_80276EFC)
EVT_EXEC_WAIT(N(802A327C)) EVT_EXEC_WAIT(N(afterUsePower))
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
BSS EffectInstance* D_802A37F0;
BSS char D_802A37F4[4];
BSS s32 D_802A37F8[8];
BSS s32 D_802A3818[8];
BSS s32 D_802A3834[8];
// flots
#ifdef NON_MATCHING
ApiStatus func_802A1518_7974D8(Evt* script, s32 isInitialCall) {
PeachStarBeamFXData* sp28;
PeachStarBeamInner* part;
Bytecode* args = script->ptrReadPos;
Actor* player = gBattleStatus.playerActor;
ActorState* playerState = &player->state;
s32 i;
f32 playerX, playerY, playerZ;
f32 playerGoalX, playerGoalY, playerGoalZ;
f32 goalX, goalY, goalZ;
f32 tx, ty, tz;
s32 cond;
Actor* target;
Evt* script;
f32 dist;
f32 dist2;
f32 temp_f20;
f32 temp_f22;
f32 temp_f30;
s32 var_a0;
if (isInitialCall) {
D_802A3838 = 0;
script->functionTemp[2] = evt_get_variable(script, *args++);
script->functionTemp[0] = 0;
}
if (player->targetListLength == 1) {
target = get_actor(player->targetActorID);
if (target == NULL) {
return ApiStatus_DONE2;
}
get_actor_part(target, player->targetPartIndex);
goalX = target->currentPos.x + target->headOffset.x;
if (target->flags & 0x800) {
goalY = (target->currentPos.y + target->headOffset.y) - target->size.y;
} else if (!(target->flags & 0x8000)) {
goalY = target->size.y + (target->currentPos.y + target->headOffset.y);
} else {
goalY = target->currentPos.y + target->headOffset.y + (target->size.y * 2);
}
goalZ = target->currentPos.z + target->headOffset.z;
} else {
goalX = 64.0f;
goalY = 80.0f;
goalZ = 0.0f;
}
switch (script->functionTemp[0]) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
sp28 = D_802A37F0->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(sp28->parts); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
part = &sp28->parts[i];
if (D_802A37F8[i] != 0) {
D_802A37F8[i]--;
} else {
D_802A37F8[i] = 20;
if (D_802A3514_7994D4[i] <= 0) {
fx_misc_particles(4, part->unk_10.x, part->unk_10.y, part->unk_10.z, 20.0f, 20.0f, 1.0f, 10, 20);
} else {
fx_misc_particles(4, part->unk_04.x, part->unk_04.y, part->unk_04.z, 20.0f, 20.0f, 1.0f, 10, 20);
}
}
}
}
break;
case 10:
sp28 = D_802A37F0->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(sp28->parts); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
part = &sp28->parts[i];
if (D_802A37F8[i] != 0) {
D_802A37F8[i]--;
} else {
D_802A37F8[i] = 20;
if (D_802A3534_7994F4[i] <= 0) {
fx_misc_particles(4, part->unk_10.x, part->unk_10.y, part->unk_10.z, 20.0f, 20.0f, 1.0f, 10, 20);
} else {
fx_misc_particles(4, part->unk_04.x, part->unk_04.y, part->unk_04.z, 20.0f, 20.0f, 1.0f, 10, 20);
}
}
}
}
break;
}
switch (script->functionTemp[0]) {
case 0:
temp_f20 = player->currentPos.x;
temp_f30 = player->currentPos.z;
playerState->currentPos.x = temp_f20;
temp_f22 = player->currentPos.y + player->size.y + 30.0f;
playerState->currentPos.z = temp_f30;
playerState->goalPos.x = temp_f20;
playerState->goalPos.z = temp_f30;
playerState->goalPos.y = temp_f22;
playerState->currentPos.y = playerState->goalPos.y + 150.0f;
if (script->functionTemp[2] == 0) {
D_802A37F0 = fx_peach_star_beam(0, temp_f20, temp_f22, temp_f30, 1.0f, 0);
} else {
D_802A37F0 = fx_peach_star_beam(1, temp_f20, temp_f22, temp_f30, 1.0f, 0);
}
playerState->distance = 48.0f;
D_802A37F0->data.peachStarBeam->unk_3C = 0;
D_802A37F0->data.peachStarBeam->unk_48 = playerState->distance;
D_802A37F0->data.peachStarBeam->alpha = 0;
D_802A37F0->data.peachStarBeam->unk_58 = 30.0f;
D_802A37F0->data.peachStarBeam->unk_40 = 5.0f;
for (i = 0; i < ARRAY_COUNT(D_802A37F8); i++) {
D_802A37F8[i] = rand_int(20);
}
script->functionTemp[1] = 40;
if (script->functionTemp[2] == 0) {
sfx_play_sound(0x80000068);
} else {
sfx_play_sound(0x80000069);
}
script->functionTemp[0] = 1;
break;
case 1:
playerState->currentPos.y += (playerState->goalPos.y - playerState->currentPos.y) / 10.0f;
D_802A37F0->data.peachStarBeam->unk_4C = playerState->currentPos.x;
D_802A37F0->data.peachStarBeam->unk_50 = playerState->currentPos.y;
D_802A37F0->data.peachStarBeam->unk_54 = playerState->currentPos.z;
D_802A37F0->data.peachStarBeam->unk_3C = 0;
D_802A37F0->data.peachStarBeam->unk_48 = playerState->distance;
D_802A37F0->data.peachStarBeam->alpha = 0;
if (script->functionTemp[1] == 0) {
script->functionTemp[1] = 20;
script->functionTemp[0] = 2;
} else {
script->functionTemp[1]--;
}
break;
case 2:
if (script->functionTemp[1] == 0) {
btl_cam_use_preset(2);
btl_cam_move(10);
script->functionTemp[1] = 15;
script->functionTemp[0] = 3;
} else {
script->functionTemp[1]--;
}
break;
case 3:
playerState->distance += (24.0f - playerState->distance) * 0.125f;
D_802A37F0->data.peachStarBeam->unk_48 = playerState->distance;
if (script->functionTemp[1] == 0) {
playerState->goalPos.x = goalX;
playerState->goalPos.y = goalY;
playerState->goalPos.z = goalZ;
for (i = 0; i < ARRAY_COUNT(D_802A3834); i++) {
D_802A3834[i] = 30;
}
if (script->functionTemp[2] == 0) {
sfx_play_sound(0x648);
} else {
sfx_play_sound(0x649);
}
script->functionTemp[0] = 4;
} else {
script->functionTemp[1]--;
}
break;
case 4:
cond = FALSE;
playerState->distance += (48.0f - playerState->distance) * 0.25f;
D_802A37F0->data.peachStarBeam->unk_48 = playerState->distance;
for (i = 0; i < 2; i++) {
if (i != 0) {
if (D_802A3514_7994D4[i] < 0) {
playerState->currentPos.x += playerState->goalPos.x - playerState->currentPos.x;
playerState->currentPos.y += playerState->goalPos.y - playerState->currentPos.y;
playerState->currentPos.z += playerState->goalPos.z - playerState->currentPos.z;
} else {
cond = TRUE;
if (D_802A3514_7994D4[i] != 0) {
D_802A3514_7994D4[i]--;
} else {
playerX = playerState->currentPos.x;
playerY = playerState->currentPos.y;
playerZ = playerState->currentPos.z;
playerGoalX = playerState->goalPos.x;
playerGoalY = playerState->goalPos.y;
playerGoalZ = playerState->goalPos.z;
dist = dist2D(playerX, playerZ, playerGoalX, playerGoalZ);
playerState->currentPos.x += (playerGoalX - playerX) / D_802A3818[i];
playerState->currentPos.y += (playerGoalY - playerY) / D_802A3818[i];
playerState->currentPos.z += (playerGoalZ - playerZ) / D_802A3818[i];
if (D_802A3818[i] == 1) {
D_802A3514_7994D4[i] = -1;
playerState->currentPos.x = playerGoalX;
playerState->currentPos.y = playerGoalY;
playerState->currentPos.z = playerGoalZ;
} else {
playerState->currentPos.y += dist / 60.0f;
}
D_802A3818[i]--;
}
}
}
}
D_802A37F0->data.peachStarBeam->unk_4C = playerState->currentPos.x;
D_802A37F0->data.peachStarBeam->unk_50 = playerState->currentPos.y;
D_802A37F0->data.peachStarBeam->unk_54 = playerState->currentPos.z;
D_802A37F0->data.peachStarBeam->pos.x = playerState->currentPos.x;
D_802A37F0->data.peachStarBeam->pos.y = 0.0f;
D_802A37F0->data.peachStarBeam->pos.z = playerState->currentPos.z;
if (!cond) {
playerState->currentPos.x = playerState->goalPos.x;
playerState->currentPos.y = playerState->goalPos.y;
playerState->currentPos.z = playerState->goalPos.z;
D_802A37F0->data.peachStarBeam->unk_4C = playerState->currentPos.x;
D_802A37F0->data.peachStarBeam->unk_50 = playerState->currentPos.y;
D_802A37F0->data.peachStarBeam->unk_54 = playerState->currentPos.z;
D_802A37F0->data.peachStarBeam->pos.x = playerState->currentPos.x;
D_802A37F0->data.peachStarBeam->pos.y = 0.0f;
D_802A37F0->data.peachStarBeam->pos.z = playerState->currentPos.z;
sp28 = D_802A37F0->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(sp28->parts); i++) {
if ((script->functionTemp[2] != 0) || (i != 0)) {
part = &sp28->parts[i];
D_802A3514_7994D4[i] = 1;
part->flags &= ~2;
}
}
btl_cam_use_preset(3);
btl_cam_move(30);
script->functionTemp[1] = 15;
script->functionTemp[0] = 5;
}
break;
case 5:
if (script->functionTemp[1] == 0) {
playerState->moveTime = 0;
D_802A37F0->data.peachStarBeam->unk_3C = 0;
D_802A37F0->data.peachStarBeam->alpha = 0;
if (script->functionTemp[2] != 0) {
D_802A37F0->data.peachStarBeam->primR = 240;
D_802A37F0->data.peachStarBeam->primG = 80;
D_802A37F0->data.peachStarBeam->primB = 200;
D_802A37F0->data.peachStarBeam->envR = 240;
D_802A37F0->data.peachStarBeam->envG = 240;
D_802A37F0->data.peachStarBeam->envB = 240;
}
script = start_script(battle_star_star_beam_802A33A8, 0xA, 0);
script->varTable[0] = playerState->currentPos.x;
script->varTable[1] = playerState->currentPos.y * 0.5f;
script->varTable[2] = playerState->currentPos.z;
script->varTable[10] = script->functionTemp[2];
sfx_play_sound(0x24A);
script->functionTemp[1] = 45;
script->functionTemp[0] = 6;
} else {
script->functionTemp[1]--;
}
break;
case 6:
playerState->moveTime += 30;
if (playerState->moveTime > 255) {
playerState->moveTime = 255;
}
D_802A37F0->data.peachStarBeam->unk_3C = playerState->moveTime;
D_802A37F0->data.peachStarBeam->alpha = playerState->moveTime;
if (script->functionTemp[1] == 0) {
D_802A3838 = 1;
if (script->functionTemp[2] == 0 && player->targetListLength == 1) {
if (get_actor_part(get_actor(player->targetActorID), player->targetPartIndex)->eventFlags & 0x80000) {
script->functionTemp[0] = 20;
} else {
script->functionTemp[1] = 15;
script->functionTemp[0] = 7;
}
} else {
script->functionTemp[1] = 15;
script->functionTemp[0] = 7;
}
} else {
script->functionTemp[1]--;
}
break;
case 7:
if (script->functionTemp[1] == 0) {
script->functionTemp[1] = 10;
script->functionTemp[0] = 8;
} else {
script->functionTemp[1]--;
}
break;
case 8:
playerState->moveTime -= 30;
if (playerState->moveTime < 0) {
playerState->moveTime = 0;
}
D_802A37F0->data.peachStarBeam->unk_3C = playerState->moveTime;
D_802A37F0->data.peachStarBeam->alpha = playerState->moveTime;
if (script->functionTemp[1] == 0) {
script->functionTemp[1] = 10;
script->functionTemp[0] = 9;
} else {
script->functionTemp[1]--;
}
break;
case 9:
if (script->functionTemp[1] != 0) {
script->functionTemp[1]--;
break;
}
playerState->goalPos.x = goalX;
playerState->goalPos.y = goalY + 170.0f;
playerState->goalPos.z = goalZ;
script->functionTemp[1] = 20;
script->functionTemp[0] = 10;
break;
case 10:
if (script->functionTemp[1] != 0) {
script->functionTemp[1]--;
if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] == 0) {
func_80149A6C(0x248, 1);
sfx_play_sound(0x648);
} else {
func_80149A6C(0x249, 1);
sfx_play_sound(0x649);
}
}
}
cond = FALSE;
for (i = 0; i < ARRAY_COUNT(sp28->parts); i++) {
if (script->functionTemp[2] != 0 || i != 0) {
part = &sp28->parts[i];
if (D_802A3534_7994F4[i] >= 0) {
cond = TRUE;
if (D_802A3534_7994F4[i] != 0) {
D_802A3534_7994F4[i]--;
} else {
part->flags |= 2;
part->unk_10.y += (playerState->goalPos.y - part->unk_10.y) / 10.0f;
if (fabsf(part->unk_10.y - playerState->goalPos.y) < 1.0) {
D_802A3534_7994F4[i] = -1;
}
}
}
}
}
if (!cond) {
D_802A3838 = 2;
D_802A37F0->flags |= 0x10;
return ApiStatus_DONE2;
}
break;
case 20:
D_802A37F0->data.peachStarBeam->unk_3C = 0;
D_802A37F0->data.peachStarBeam->alpha = 0;
for (i = 0; i < ARRAY_COUNT(D_802A3834); i++) {
D_802A3834[i] = 15;
}
if (script->functionTemp[2] == 0) {
func_80149A6C(0x248, 0);
} else {
func_80149A6C(0x249, 0);
}
script->functionTemp[0] = 0x15;
break;
case 21:
cond = FALSE;
sp28 = D_802A37F0->data.peachStarBeam;
for (i = 0; i < ARRAY_COUNT(sp28->parts); i++) {
if ((script->functionTemp[2] != 0) || (i != 0)) {
part = &sp28->parts[i];
if (D_802A3514_7994D4[i] < 0) {
part->unk_10.x += D_802A3554_799514[i].x - part->unk_10.x;
part->unk_10.y += D_802A3554_799514[i].y - part->unk_10.y;
part->unk_10.z += D_802A3554_799514[i].z - part->unk_10.z;
} else {
cond = TRUE;
if (D_802A3514_7994D4[i] != 0) {
D_802A3514_7994D4[i]--;
} else {
part->flags |= 2;
tx = D_802A3554_799514[i].x;
ty = D_802A3554_799514[i].y;
tz = D_802A3554_799514[i].z;
dist2 = dist2D(part->unk_10.x, part->unk_10.z, tx, tz);
part->unk_10.x += (tx - part->unk_10.x) / D_802A3818[i];
part->unk_10.y += (ty - part->unk_10.y) / D_802A3818[i];
part->unk_10.z += (tz - part->unk_10.z) / D_802A3818[i];
if (D_802A3818[i] == 1) {
D_802A3514_7994D4[i] = -1;
part->unk_10.x = tx;
part->unk_10.y = ty;
part->unk_10.z = tz;
} else {
part->unk_10.y = (part->unk_10.y + (dist2 / 60.0f));
}
D_802A3818[i]--;
}
}
}
}
if (!cond) {
D_802A3838 = 2;
D_802A37F0->flags |= 0x10;
return ApiStatus_DONE2;
}
break;
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
break;
}
return ApiStatus_BLOCK;
}
#else
INCLUDE_ASM(s32, "battle/star/star_beam/796FC0", func_802A1518_7974D8);
#endif
ApiStatus func_802A2468_798428(Evt* script, s32 isInitialCall) {
script->varTable[0] = D_802A3838;
return ApiStatus_DONE2;
}
ApiStatus func_802A247C_79843C(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[0] = 230;
}
set_background_color_blend(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] -= 5;
if (script->functionTemp[0] <= 200) {
set_background_color_blend(0, 0, 0, 200);
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}

View File

@ -34,7 +34,7 @@ void peach_star_beam_update(EffectInstance* effect);
void peach_star_beam_render(EffectInstance* effect); void peach_star_beam_render(EffectInstance* effect);
void peach_star_beam_appendGfx(void* effect); void peach_star_beam_appendGfx(void* effect);
EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s32 arg5) { EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s32 duration) {
EffectBlueprint bp; EffectBlueprint bp;
EffectInstance* effect; EffectInstance* effect;
PeachStarBeamFXData* data; PeachStarBeamFXData* data;
@ -55,19 +55,19 @@ EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s3
data->type = type; data->type = type;
data->lifetime = 0; data->lifetime = 0;
if (arg5 <= 0) { if (duration <= 0) {
data->timeLeft = 1000; data->timeLeft = 1000;
} else { } else {
data->timeLeft = arg5; data->timeLeft = duration;
} }
data->alpha = 224; data->beamAlpha = 224;
data->pos.x = x; data->pos.x = x;
data->pos.y = y; data->pos.y = y;
data->pos.z = z; data->pos.z = z;
data->unk_3C = 255; data->unk_3C = 255;
data->unk_38 = arg4; data->beamScale = arg4;
data->unk_48 = 80.0f; data->circleRadius = 80.0f;
data->unk_58 = 50.0f; data->twinkYOffset = 50.0f;
data->primR = 255; data->primR = 255;
data->primG = 255; data->primG = 255;
data->primB = 120; data->primB = 120;
@ -75,14 +75,14 @@ EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s3
data->envG = 255; data->envG = 255;
data->envB = 255; data->envB = 255;
data->envA = 255; data->envA = 255;
data->unk_40 = 5.0f; data->rotationSpeed = 5.0f;
data->unk_44 = 0; data->rotationAngle = 0;
data->unk_4C = x; data->circleCenter.x = x;
data->unk_50 = y + 50.0f; data->circleCenter.y = y + 50.0f;
data->unk_54 = z; data->circleCenter.z = z;
for (i = 0; i < ARRAY_COUNT(data->parts); i++) { for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
PeachStarBeamInner* part = &data->parts[i]; PeachStarBeamSpirit* part = &data->spirits[i];
if (type == 0 && i == 0) { if (type == 0 && i == 0) {
part->flags = 0; part->flags = 0;
@ -98,12 +98,12 @@ void peach_star_beam_init(EffectInstance* effect) {
void peach_star_beam_update(EffectInstance* effect) { void peach_star_beam_update(EffectInstance* effect) {
PeachStarBeamFXData* data = effect->data.peachStarBeam; PeachStarBeamFXData* data = effect->data.peachStarBeam;
f32 unk_44; f32 rotationAngle;
f32 unk_48; f32 radius;
f32 unk_4C; f32 centerX;
f32 unk_50; f32 centerY;
f32 unk_54; f32 centerZ;
f32 angle; f32 spiritAngle;
s32 i; s32 i;
if (effect->flags & 0x10) { if (effect->flags & 0x10) {
@ -121,30 +121,30 @@ void peach_star_beam_update(EffectInstance* effect) {
return; return;
} }
data->unk_44 += data->unk_40; data->rotationAngle += data->rotationSpeed;
unk_44 = data->unk_44; rotationAngle = data->rotationAngle;
unk_48 = data->unk_48; radius = data->circleRadius;
unk_4C = data->unk_4C; centerX = data->circleCenter.x;
unk_50 = data->unk_50; centerY = data->circleCenter.y;
unk_54 = data->unk_54; centerZ = data->circleCenter.z;
for (i = 0; i < ARRAY_COUNT(data->parts); i++) { for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
PeachStarBeamInner* part = &data->parts[i]; PeachStarBeamSpirit* part = &data->spirits[i];
if (i == 0) { if (i == 0) {
part->unk_04.x = unk_4C; part->pos.x = centerX;
part->unk_04.y = unk_50 + data->unk_58; part->pos.y = centerY + data->twinkYOffset;
part->unk_04.z = unk_54; part->pos.z = centerZ;
} else { } else {
angle = unk_44 + ((-360 + (360 * i)) / 7); spiritAngle = rotationAngle + ((-360 + (360 * i)) / 7);
part->unk_04.x = unk_4C + (unk_48 * shim_sin_deg(angle)); part->pos.x = centerX + radius * shim_sin_deg(spiritAngle);
part->unk_04.y = unk_50; part->pos.y = centerY;
part->unk_04.z = unk_54 + (unk_48 * shim_cos_deg(angle)); part->pos.z = centerZ + radius * shim_cos_deg(spiritAngle);
} }
if (!(part->flags & 2)) { if (!(part->flags & 2)) {
part->unk_10.x = part->unk_04.x; part->lockedPos.x = part->pos.x;
part->unk_10.y = part->unk_04.y; part->lockedPos.y = part->pos.y;
part->unk_10.z = part->unk_04.z; part->lockedPos.z = part->pos.z;
} }
} }
} }
@ -166,8 +166,8 @@ void peach_star_beam_appendGfx(void* effect) {
Matrix4f sp20, sp60; Matrix4f sp20, sp60;
Camera* camera = &gCameras[gCurrentCameraID]; Camera* camera = &gCameras[gCurrentCameraID];
PeachStarBeamFXData* data = ((EffectInstance*)effect)->data.peachStarBeam; PeachStarBeamFXData* data = ((EffectInstance*)effect)->data.peachStarBeam;
PeachStarBeamInner* part; PeachStarBeamSpirit* part;
s32 alpha = data->alpha; s32 alpha = data->beamAlpha;
f32 partX, partY, partZ; f32 partX, partY, partZ;
s32 i; s32 i;
@ -175,17 +175,17 @@ void peach_star_beam_appendGfx(void* effect) {
gSPSegment(gMasterGfxPos++, 0x9, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMasterGfxPos++, 0x9, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMasterGfxPos++, D_09005090_3EAFC0); gSPDisplayList(gMasterGfxPos++, D_09005090_3EAFC0);
for (i = 0; i < ARRAY_COUNT(data->parts); i++) { for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
part = &data->parts[i]; part = &data->spirits[i];
if (part->flags & 1) { if (part->flags & 1) {
if (part->flags & 2) { if (part->flags & 2) {
partX = part->unk_10.x; partX = part->lockedPos.x;
partY = part->unk_10.y; partY = part->lockedPos.y;
partZ = part->unk_10.z; partZ = part->lockedPos.z;
} else { } else {
partX = part->unk_04.x; partX = part->pos.x;
partY = part->unk_04.y; partY = part->pos.y;
partZ = part->unk_04.z; partZ = part->pos.z;
} }
if (!(data->pos.z < partZ)) { if (!(data->pos.z < partZ)) {
@ -204,7 +204,7 @@ void peach_star_beam_appendGfx(void* effect) {
} }
shim_guTranslateF(sp20, data->pos.x, data->pos.y - (((f32) (255 - data->unk_3C) * 400.0) / 255.0), data->pos.z); shim_guTranslateF(sp20, data->pos.x, data->pos.y - (((f32) (255 - data->unk_3C) * 400.0) / 255.0), data->pos.z);
shim_guScaleF(sp60, data->unk_38 * 0.4, data->unk_38 * 0.4, data->unk_38 * 0.4); shim_guScaleF(sp60, data->beamScale * 0.4, data->beamScale * 0.4, data->beamScale * 0.4);
shim_guMtxCatF(sp60, sp20, sp20); shim_guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
@ -218,18 +218,18 @@ void peach_star_beam_appendGfx(void* effect) {
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_09005090_3EAFC0); gSPDisplayList(gMasterGfxPos++, D_09005090_3EAFC0);
for (i = 0; i < ARRAY_COUNT(data->parts); i++) { for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
part = &data->parts[i]; part = &data->spirits[i];
if (part->flags & 1) { if (part->flags & 1) {
if (part->flags & 2) { if (part->flags & 2) {
partX = part->unk_10.x; partX = part->lockedPos.x;
partY = part->unk_10.y; partY = part->lockedPos.y;
partZ = part->unk_10.z; partZ = part->lockedPos.z;
} else { } else {
partX = part->unk_04.x; partX = part->pos.x;
partY = part->unk_04.y; partY = part->pos.y;
partZ = part->unk_04.z; partZ = part->pos.z;
} }
if (!(partZ <= data->pos.z)) { if (!(partZ <= data->pos.z)) {

View File

@ -133,33 +133,27 @@ void func_802BD4FC_323E4C(Npc* bow) {
} }
} }
#ifdef NON_MATCHING
s32 func_802BD540_323E90(void) { s32 func_802BD540_323E90(void) {
f32 sp20, sp24, sp28; f32 x, y, z;
f32 temp_f12, temp_f22; f32 yaw;
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
f32 tempX, tempZ;
if (gGameStatusPtr->areaID != AREA_OMO) { if (gGameStatusPtr->areaID != AREA_OMO) {
return -1; return -1;
} else { }
if (gPlayerStatus.pushVelocity.x != 0.0f || gPlayerStatus.pushVelocity.z != 0.0f) {
temp_f22 = atan2(0.0f, 0.0f, gPlayerStatus.pushVelocity.x, gPlayerStatus.pushVelocity.z);
temp_f12 = temp_f22 + 180.0f;
sp20 = gPlayerStatus.position.x;
sp24 = gPlayerStatus.position.z;
sp28 = gPlayerStatus.position.y + (gPlayerStatus.colliderHeight * 0.5f);
add_vec2D_polar(&sp20, &sp24, gPlayerStatus.colliderDiameter * 0.5f, clamp_angle(temp_f12));
return player_test_lateral_overlap(0, &gPlayerStatus, &sp20, &sp28, &sp24,
gPlayerStatus.colliderDiameter, temp_f22);
}
if (playerStatus->pushVelocity.x == 0.0f && playerStatus->pushVelocity.z == 0.0f) {
return -1; return -1;
} }
yaw = atan2(0.0f, 0.0f, playerStatus->pushVelocity.x, playerStatus->pushVelocity.z);
x = playerStatus->position.x;
y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f);
z = playerStatus->position.z;
add_vec2D_polar(&x, &z, playerStatus->colliderDiameter * 0.5f, clamp_angle(yaw + 180.0f));
return player_test_lateral_overlap(0, playerStatus, &x, &y, &z, playerStatus->colliderDiameter, yaw);
} }
#else
INCLUDE_ASM(s32, "world/partner/bow", func_802BD540_323E90);
#endif
ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;

View File

@ -3,8 +3,22 @@
#include "goombario.h" #include "goombario.h"
#include "../src/world/partners.h" #include "../src/world/partners.h"
#include "message_ids.h" #include "message_ids.h"
#include "entity.h"
extern s32* D_802B79A8_E21858; typedef struct UnkE20EB0 {
/* 0x00 */ Npc* unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 scale;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ char unk_24[6];
/* 0x2A */ u8 unk_2A;
/* 0x2B */ u8 unk_2B;
} UnkE20EB0; /* size = 0x2C */
extern UnkE20EB0* D_802B79A8_E21858;
BSS s32 D_802BDF30; BSS s32 D_802BDF30;
BSS s32 D_802BDF34; BSS s32 D_802BDF34;
@ -208,8 +222,210 @@ s32 world_goombario_can_pause(Npc* goombario) {
} }
// get message for tattle routine // get message for tattle routine
#ifdef NON_MATCHING
ApiStatus func_802BD5D8_3174F8(Evt* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc* goombario = script->owner2.npc;
s32 msgID;
s32 entityType;
s32 triggerSomething;
s32 v1;
s32 i;
s32 v0;
if (isInitialCall) {
func_802BD564_317484(goombario);
D_802BDF64 = 0;
D_802BDF30 = 0;
D_802BDF34 = 0;
if (playerStatus->animFlags & 0x20) {
D_802BDF30 = 1;
D_802BDF38 = D_802B79A8_E21858->unk_00;
}
if (playerStatus->animFlags & 0x10) {
D_802BDF34 = 1;
}
script->functionTemp[0] = 40;
}
switch (script->functionTemp[0]) {
case 40:
if (!(goombario->flags & 0x1000) || playerStatus->inputEnabledCounter != 0) {
script->varTable[0] = -1;
return ApiStatus_DONE2;
}
script->functionTemp[1] = 3;
disable_player_input();
D_802BDF64 = 1;
script->functionTemp[2] = playerStatus->inputEnabledCounter;
script->functionTemp[0]++;
break;
case 41:
if (script->functionTemp[1] != 0) {
script->functionTemp[1]--;
} else {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) {
script->varTable[0] = -1;
enable_player_input();
D_802BDF64 = 0;
return ApiStatus_DONE2;
}
script->functionTemp[0] = 0;
}
break;
case 0:
set_time_freeze_mode(1);
playerStatus->flags &= ~0x2000000;
goombario->currentAnim = 0x010001;
goombario->yaw = clamp_angle(gCameras[CAM_DEFAULT].currentYaw + playerStatus->spriteFacingAngle - 90.0f);
gPartnerActionStatus.partnerActionState = 1;
close_status_menu();
if (D_802BDF30 != 0) {
script->varTable[0] = 0;
script->functionTemp[0] = 20;
break;
}
script->functionTemp[0] = 1;
/* fallthrough */
case 1:
if (GoombarioGetTattleID >= 0 && (GoombarioGetTattleID & 0x4000)) {
entityType = get_entity_type(GoombarioGetTattleID);
msgID = -1;
do {} while (0);
for (i = 0; EntityTattles[2 * i] != -1; i++) {
if (EntityTattles[2 * i] != entityType) {
continue;
}
switch (entityType) {
case 22:
case 25:
if (gPlayerData.hammerLevel >= 1) {
msgID = 0x1B0002;
}
break;
case 23:
case 26:
if (gPlayerData.hammerLevel >= 2) {
msgID = 0x1B0004;
}
break;
case 36:
if (gPlayerData.bootsLevel == 1) {
msgID = 0x1B0018;
} else if (gPlayerData.bootsLevel == 2) {
msgID = 0x1B0019;
}
break;
case 37:
if (gPlayerData.bootsLevel == 1) {
msgID = 0x1B001B;
} else if (gPlayerData.bootsLevel == 2) {
msgID = 0x1B001C;
}
break;
case 9:
if (gPlayerData.bootsLevel >= 2) {
msgID = 0x1B000D;
}
break;
case 10:
if (gPlayerData.bootsLevel >= 2) {
msgID = 0x1B000F;
}
break;
case 49:
if (gPlayerData.bootsLevel >= 2) {
msgID = 0x1B001E;
}
break;
case 50:
if (get_entity_by_index(GoombarioGetTattleID & 0x3FFF)->dataBuf.chest->itemID == -1) {
msgID = 0x1B0016;
}
break;
}
if (msgID != -1) {
script->varTable[0] = msgID;
} else {
script->varTable[0] = EntityTattles[2 * i + 1];
}
script->varTable[1] = 0;
return ApiStatus_DONE2;
}
}
if (GoombarioGetTattleID >= 0 && (GoombarioGetTattleID & 0x2000)) {
D_802BDF38 = get_npc_unsafe(GoombarioGetTattleID & 0x1FFF);
v0 = get_enemy(D_802BDF38->npcID)->tattleMsg;
if (v0 != 0) {
msgID = v0;
if (msgID < -270000000) {
script->varTable[0] = ((s32(*)(void))msgID)();
} else {
script->varTable[0] = msgID;
script->varTable[1] = 0;
}
}
return ApiStatus_DONE2;
}
if (D_802BDF34 != 0) {
script->varTable[0] = 0x1B0025;
script->varTable[1] = 0;
return ApiStatus_DONE2;
}
if (GoombarioGetTattleID >= 0) {
v1 = func_802BD100_317020(GoombarioGetTattleID);
} else {
v1 = 0;
}
if (v1 == 0) {
msgID = get_current_map_settings()->tattle.msgID;
if (msgID != 0) {
if (msgID < -270000000) {
script->varTable[0] = ((s32(*)(void))msgID)();
} else {
script->varTable[0] = msgID;
script->varTable[1] = 0;
}
}
} else {
script->varTable[0] = v1;
script->varTable[1] = 1;
}
return ApiStatus_DONE2;
}
switch (script->functionTemp[0]) {
case 10:
msgID = get_current_map_settings()->tattle.msgID;
if (msgID != 0) {
if (msgID < -270000000) {
script->varTable[0] = ((s32(*)(void))msgID)();
} else {
script->varTable[0] = msgID;
script->varTable[1] = 0;
}
return ApiStatus_DONE2;
}
break;
case 20:
v1 = get_enemy(D_802BDF38->npcID)->tattleMsg;
if (v1 != 0) {
script->varTable[0] = v1;
script->varTable[1] = 0;
return ApiStatus_DONE2;
}
break;
}
return ApiStatus_BLOCK;
}
#else
ApiStatus func_802BD5D8_3174F8(Evt* script, s32 isInitialCall); ApiStatus func_802BD5D8_3174F8(Evt* script, s32 isInitialCall);
INCLUDE_ASM(ApiStatus, "world/partner/goombario", func_802BD5D8_3174F8, Evt* script, s32 isInitialCall); INCLUDE_ASM(ApiStatus, "world/partner/goombario", func_802BD5D8_3174F8, Evt* script, s32 isInitialCall);
#endif
ApiStatus func_802BDB30_317A50(Evt* script, s32 isInitialCall) { ApiStatus func_802BDB30_317A50(Evt* script, s32 isInitialCall) {
PartnerActionStatus* goombarioActionStatus = &gPartnerActionStatus; PartnerActionStatus* goombarioActionStatus = &gPartnerActionStatus;

View File

@ -1,573 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
dlabel jtbl_802AB9F0
.word .L802A5054_419DE4, .L802A4F74_419D04, .L802A4AA8_419838, .L802A4D4C_419ADC, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A505C_419DEC, .L802A5090_419E20, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A50A0_419E30, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A50E0_419E70, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A5270_41A000, .L802A510C_419E9C, .L802A5130_419EC0, .L802A51F0_419F80, 0
.section .text
glabel func_802A4A54
/* 4197E4 802A4A54 3C02802B */ lui $v0, %hi(D_802AD604)
/* 4197E8 802A4A58 9042D604 */ lbu $v0, %lo(D_802AD604)($v0)
/* 4197EC 802A4A5C 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 4197F0 802A4A60 AFB20030 */ sw $s2, 0x30($sp)
/* 4197F4 802A4A64 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 4197F8 802A4A68 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 4197FC 802A4A6C AFBF0038 */ sw $ra, 0x38($sp)
/* 419800 802A4A70 AFB30034 */ sw $s3, 0x34($sp)
/* 419804 802A4A74 AFB1002C */ sw $s1, 0x2c($sp)
/* 419808 802A4A78 24420002 */ addiu $v0, $v0, 2
/* 41980C 802A4A7C 00021600 */ sll $v0, $v0, 0x18
/* 419810 802A4A80 00021E03 */ sra $v1, $v0, 0x18
/* 419814 802A4A84 2C62002D */ sltiu $v0, $v1, 0x2d
/* 419818 802A4A88 104001F9 */ beqz $v0, .L802A5270_41A000
/* 41981C 802A4A8C AFB00028 */ sw $s0, 0x28($sp)
/* 419820 802A4A90 00031080 */ sll $v0, $v1, 2
/* 419824 802A4A94 3C01802B */ lui $at, %hi(jtbl_802AB9F0)
/* 419828 802A4A98 00220821 */ addu $at, $at, $v0
/* 41982C 802A4A9C 8C22B9F0 */ lw $v0, %lo(jtbl_802AB9F0)($at)
/* 419830 802A4AA0 00400008 */ jr $v0
/* 419834 802A4AA4 00000000 */ nop
.L802A4AA8_419838:
/* 419838 802A4AA8 3C05802B */ lui $a1, %hi(D_802AD608)
/* 41983C 802A4AAC 80A5D608 */ lb $a1, %lo(D_802AD608)($a1)
/* 419840 802A4AB0 3C04802B */ lui $a0, %hi(D_802AD605)
/* 419844 802A4AB4 8084D605 */ lb $a0, %lo(D_802AD605)($a0)
/* 419848 802A4AB8 24020014 */ addiu $v0, $zero, 0x14
/* 41984C 802A4ABC 3C01802B */ lui $at, %hi(D_802AD63C)
/* 419850 802A4AC0 A422D63C */ sh $v0, %lo(D_802AD63C)($at)
/* 419854 802A4AC4 24020044 */ addiu $v0, $zero, 0x44
/* 419858 802A4AC8 3C01802B */ lui $at, %hi(D_802AD63E)
/* 41985C 802A4ACC A422D63E */ sh $v0, %lo(D_802AD63E)($at)
/* 419860 802A4AD0 00051823 */ negu $v1, $a1
/* 419864 802A4AD4 00031040 */ sll $v0, $v1, 1
/* 419868 802A4AD8 00431021 */ addu $v0, $v0, $v1
/* 41986C 802A4ADC 00021080 */ sll $v0, $v0, 2
/* 419870 802A4AE0 00431021 */ addu $v0, $v0, $v1
/* 419874 802A4AE4 00852023 */ subu $a0, $a0, $a1
/* 419878 802A4AE8 3C01802B */ lui $at, %hi(D_802AD60C)
/* 41987C 802A4AEC A422D60C */ sh $v0, %lo(D_802AD60C)($at)
/* 419880 802A4AF0 00041040 */ sll $v0, $a0, 1
/* 419884 802A4AF4 00441021 */ addu $v0, $v0, $a0
/* 419888 802A4AF8 00021080 */ sll $v0, $v0, 2
/* 41988C 802A4AFC 3C03802B */ lui $v1, %hi(D_802AD66C)
/* 419890 802A4B00 8C63D66C */ lw $v1, %lo(D_802AD66C)($v1)
/* 419894 802A4B04 00441021 */ addu $v0, $v0, $a0
/* 419898 802A4B08 3C01802B */ lui $at, %hi(D_802AD60E)
/* 41989C 802A4B0C A422D60E */ sh $v0, %lo(D_802AD60E)($at)
/* 4198A0 802A4B10 18600017 */ blez $v1, .L802A4B70
/* 4198A4 802A4B14 0000882D */ daddu $s1, $zero, $zero
/* 4198A8 802A4B18 3C13802B */ lui $s3, %hi(D_802AD628)
/* 4198AC 802A4B1C 2673D628 */ addiu $s3, $s3, %lo(D_802AD628)
/* 4198B0 802A4B20 3C10802B */ lui $s0, %hi(D_802AD640)
/* 4198B4 802A4B24 2610D640 */ addiu $s0, $s0, %lo(D_802AD640)
.L802A4B28:
/* 4198B8 802A4B28 8E040000 */ lw $a0, ($s0)
/* 4198BC 802A4B2C 26100004 */ addiu $s0, $s0, 4
/* 4198C0 802A4B30 0C050529 */ jal hud_element_create
/* 4198C4 802A4B34 26310001 */ addiu $s1, $s1, 1
/* 4198C8 802A4B38 0040902D */ daddu $s2, $v0, $zero
/* 4198CC 802A4B3C 3C053EE6 */ lui $a1, 0x3ee6
/* 4198D0 802A4B40 34A56666 */ ori $a1, $a1, 0x6666
/* 4198D4 802A4B44 0240202D */ daddu $a0, $s2, $zero
/* 4198D8 802A4B48 0C051308 */ jal hud_element_set_scale
/* 4198DC 802A4B4C AE720000 */ sw $s2, ($s3)
/* 4198E0 802A4B50 0240202D */ daddu $a0, $s2, $zero
/* 4198E4 802A4B54 0C051280 */ jal hud_element_set_flags
/* 4198E8 802A4B58 34058080 */ ori $a1, $zero, 0x8080
/* 4198EC 802A4B5C 3C02802B */ lui $v0, %hi(D_802AD66C)
/* 4198F0 802A4B60 8C42D66C */ lw $v0, %lo(D_802AD66C)($v0)
/* 4198F4 802A4B64 0222102A */ slt $v0, $s1, $v0
/* 4198F8 802A4B68 1440FFEF */ bnez $v0, .L802A4B28
/* 4198FC 802A4B6C 26730004 */ addiu $s3, $s3, 4
.L802A4B70:
/* 419900 802A4B70 3C048010 */ lui $a0, %hi(HES_AnimatedHandPointer)
/* 419904 802A4B74 24844A28 */ addiu $a0, $a0, %lo(HES_AnimatedHandPointer)
/* 419908 802A4B78 0C050529 */ jal hud_element_create
/* 41990C 802A4B7C 00000000 */ nop
/* 419910 802A4B80 0040902D */ daddu $s2, $v0, $zero
/* 419914 802A4B84 0240202D */ daddu $a0, $s2, $zero
/* 419918 802A4B88 3C052000 */ lui $a1, 0x2000
/* 41991C 802A4B8C 3C01802B */ lui $at, %hi(D_802AD618)
/* 419920 802A4B90 AC32D618 */ sw $s2, %lo(D_802AD618)($at)
/* 419924 802A4B94 0C051280 */ jal hud_element_set_flags
/* 419928 802A4B98 34A50080 */ ori $a1, $a1, 0x80
/* 41992C 802A4B9C 3C10802B */ lui $s0, %hi(D_802AD63C)
/* 419930 802A4BA0 2610D63C */ addiu $s0, $s0, %lo(D_802AD63C)
/* 419934 802A4BA4 3C11802B */ lui $s1, %hi(D_802AD63E)
/* 419938 802A4BA8 2631D63E */ addiu $s1, $s1, %lo(D_802AD63E)
/* 41993C 802A4BAC 86050000 */ lh $a1, ($s0)
/* 419940 802A4BB0 86260000 */ lh $a2, ($s1)
/* 419944 802A4BB4 0C051261 */ jal hud_element_set_render_pos
/* 419948 802A4BB8 0240202D */ daddu $a0, $s2, $zero
/* 41994C 802A4BBC 3C048010 */ lui $a0, %hi(HES_GreenArrowUp)
/* 419950 802A4BC0 248477E4 */ addiu $a0, $a0, %lo(HES_GreenArrowUp)
/* 419954 802A4BC4 0C050529 */ jal hud_element_create
/* 419958 802A4BC8 00000000 */ nop
/* 41995C 802A4BCC 0040902D */ daddu $s2, $v0, $zero
/* 419960 802A4BD0 0240202D */ daddu $a0, $s2, $zero
/* 419964 802A4BD4 3C052000 */ lui $a1, 0x2000
/* 419968 802A4BD8 3C01802B */ lui $at, %hi(D_802AD61C)
/* 41996C 802A4BDC AC32D61C */ sw $s2, %lo(D_802AD61C)($at)
/* 419970 802A4BE0 0C051280 */ jal hud_element_set_flags
/* 419974 802A4BE4 34A50080 */ ori $a1, $a1, 0x80
/* 419978 802A4BE8 0240202D */ daddu $a0, $s2, $zero
/* 41997C 802A4BEC 86050000 */ lh $a1, ($s0)
/* 419980 802A4BF0 86260000 */ lh $a2, ($s1)
/* 419984 802A4BF4 24A50027 */ addiu $a1, $a1, 0x27
/* 419988 802A4BF8 0C051261 */ jal hud_element_set_render_pos
/* 41998C 802A4BFC 24C6FFF9 */ addiu $a2, $a2, -7
/* 419990 802A4C00 3C048010 */ lui $a0, %hi(HES_GreenArrowDown)
/* 419994 802A4C04 24847798 */ addiu $a0, $a0, %lo(HES_GreenArrowDown)
/* 419998 802A4C08 0C050529 */ jal hud_element_create
/* 41999C 802A4C0C 00000000 */ nop
/* 4199A0 802A4C10 0040902D */ daddu $s2, $v0, $zero
/* 4199A4 802A4C14 0240202D */ daddu $a0, $s2, $zero
/* 4199A8 802A4C18 3C052000 */ lui $a1, 0x2000
/* 4199AC 802A4C1C 3C01802B */ lui $at, %hi(D_802AD620)
/* 4199B0 802A4C20 AC32D620 */ sw $s2, %lo(D_802AD620)($at)
/* 4199B4 802A4C24 0C051280 */ jal hud_element_set_flags
/* 4199B8 802A4C28 34A50080 */ ori $a1, $a1, 0x80
/* 4199BC 802A4C2C 0240202D */ daddu $a0, $s2, $zero
/* 4199C0 802A4C30 86050000 */ lh $a1, ($s0)
/* 4199C4 802A4C34 86260000 */ lh $a2, ($s1)
/* 4199C8 802A4C38 24A50027 */ addiu $a1, $a1, 0x27
/* 4199CC 802A4C3C 0C051261 */ jal hud_element_set_render_pos
/* 4199D0 802A4C40 24C6004E */ addiu $a2, $a2, 0x4e
/* 4199D4 802A4C44 24040006 */ addiu $a0, $zero, 6
/* 4199D8 802A4C48 24070090 */ addiu $a3, $zero, 0x90
/* 4199DC 802A4C4C 86130000 */ lh $s3, ($s0)
/* 4199E0 802A4C50 2402000A */ addiu $v0, $zero, 0xa
/* 4199E4 802A4C54 3C01802B */ lui $at, %hi(D_802AD614)
/* 4199E8 802A4C58 A022D614 */ sb $v0, %lo(D_802AD614)($at)
/* 4199EC 802A4C5C 3C02802A */ lui $v0, %hi(func_802A5290)
/* 4199F0 802A4C60 24425290 */ addiu $v0, $v0, %lo(func_802A5290)
/* 4199F4 802A4C64 2412FFFF */ addiu $s2, $zero, -1
/* 4199F8 802A4C68 AFA00014 */ sw $zero, 0x14($sp)
/* 4199FC 802A4C6C AFA20018 */ sw $v0, 0x18($sp)
/* 419A00 802A4C70 AFA0001C */ sw $zero, 0x1c($sp)
/* 419A04 802A4C74 AFB20020 */ sw $s2, 0x20($sp)
/* 419A08 802A4C78 86300000 */ lh $s0, ($s1)
/* 419A0C 802A4C7C 3C03802B */ lui $v1, %hi(D_802AD60A)
/* 419A10 802A4C80 8063D60A */ lb $v1, %lo(D_802AD60A)($v1)
/* 419A14 802A4C84 0260282D */ daddu $a1, $s3, $zero
/* 419A18 802A4C88 0200302D */ daddu $a2, $s0, $zero
/* 419A1C 802A4C8C 00031040 */ sll $v0, $v1, 1
/* 419A20 802A4C90 00431021 */ addu $v0, $v0, $v1
/* 419A24 802A4C94 00021080 */ sll $v0, $v0, 2
/* 419A28 802A4C98 00431021 */ addu $v0, $v0, $v1
/* 419A2C 802A4C9C 2442001A */ addiu $v0, $v0, 0x1a
/* 419A30 802A4CA0 0C051F32 */ jal set_window_properties
/* 419A34 802A4CA4 AFA20010 */ sw $v0, 0x10($sp)
/* 419A38 802A4CA8 24040007 */ addiu $a0, $zero, 7
/* 419A3C 802A4CAC 26650012 */ addiu $a1, $s3, 0x12
/* 419A40 802A4CB0 2606FFFA */ addiu $a2, $s0, -6
/* 419A44 802A4CB4 2407006C */ addiu $a3, $zero, 0x6c
/* 419A48 802A4CB8 24020010 */ addiu $v0, $zero, 0x10
/* 419A4C 802A4CBC 24100001 */ addiu $s0, $zero, 1
/* 419A50 802A4CC0 AFA20010 */ sw $v0, 0x10($sp)
/* 419A54 802A4CC4 3C02802A */ lui $v0, %hi(func_802A56F8)
/* 419A58 802A4CC8 244256F8 */ addiu $v0, $v0, %lo(func_802A56F8)
/* 419A5C 802A4CCC AFB00014 */ sw $s0, 0x14($sp)
/* 419A60 802A4CD0 AFA20018 */ sw $v0, 0x18($sp)
/* 419A64 802A4CD4 AFA0001C */ sw $zero, 0x1c($sp)
/* 419A68 802A4CD8 0C051F32 */ jal set_window_properties
/* 419A6C 802A4CDC AFB20020 */ sw $s2, 0x20($sp)
/* 419A70 802A4CE0 24130014 */ addiu $s3, $zero, 0x14
/* 419A74 802A4CE4 24040008 */ addiu $a0, $zero, 8
/* 419A78 802A4CE8 0260282D */ daddu $a1, $s3, $zero
/* 419A7C 802A4CEC 240600BA */ addiu $a2, $zero, 0xba
/* 419A80 802A4CF0 24070118 */ addiu $a3, $zero, 0x118
/* 419A84 802A4CF4 24020020 */ addiu $v0, $zero, 0x20
/* 419A88 802A4CF8 AFA20010 */ sw $v0, 0x10($sp)
/* 419A8C 802A4CFC 3C02802A */ lui $v0, %hi(func_802A5738)
/* 419A90 802A4D00 24425738 */ addiu $v0, $v0, %lo(func_802A5738)
/* 419A94 802A4D04 AFB30014 */ sw $s3, 0x14($sp)
/* 419A98 802A4D08 AFA20018 */ sw $v0, 0x18($sp)
/* 419A9C 802A4D0C AFA0001C */ sw $zero, 0x1c($sp)
/* 419AA0 802A4D10 0C051F32 */ jal set_window_properties
/* 419AA4 802A4D14 AFB20020 */ sw $s2, 0x20($sp)
/* 419AA8 802A4D18 24040006 */ addiu $a0, $zero, 6
/* 419AAC 802A4D1C 0C051F9F */ jal set_window_update
/* 419AB0 802A4D20 0200282D */ daddu $a1, $s0, $zero
/* 419AB4 802A4D24 24040007 */ addiu $a0, $zero, 7
/* 419AB8 802A4D28 0C051F9F */ jal set_window_update
/* 419ABC 802A4D2C 0200282D */ daddu $a1, $s0, $zero
/* 419AC0 802A4D30 24040008 */ addiu $a0, $zero, 8
/* 419AC4 802A4D34 0C051F9F */ jal set_window_update
/* 419AC8 802A4D38 0200282D */ daddu $a1, $s0, $zero
/* 419ACC 802A4D3C 3C01802B */ lui $at, %hi(D_802AD604)
/* 419AD0 802A4D40 A030D604 */ sb $s0, %lo(D_802AD604)($at)
/* 419AD4 802A4D44 080A949D */ j .L802A5274
/* 419AD8 802A4D48 0000102D */ daddu $v0, $zero, $zero
.L802A4D4C_419ADC:
/* 419ADC 802A4D4C 3C02802B */ lui $v0, %hi(D_802AD607)
/* 419AE0 802A4D50 8042D607 */ lb $v0, %lo(D_802AD607)($v0)
/* 419AE4 802A4D54 14400147 */ bnez $v0, .L802A5274
/* 419AE8 802A4D58 0000102D */ daddu $v0, $zero, $zero
/* 419AEC 802A4D5C 3C04802B */ lui $a0, %hi(D_802AD605)
/* 419AF0 802A4D60 2484D605 */ addiu $a0, $a0, %lo(D_802AD605)
/* 419AF4 802A4D64 3C050001 */ lui $a1, 1
/* 419AF8 802A4D68 8E420218 */ lw $v0, 0x218($s2)
/* 419AFC 802A4D6C 90830000 */ lbu $v1, ($a0)
/* 419B00 802A4D70 00451024 */ and $v0, $v0, $a1
/* 419B04 802A4D74 3C01802B */ lui $at, %hi(D_802AD606)
/* 419B08 802A4D78 A023D606 */ sb $v1, %lo(D_802AD606)($at)
/* 419B0C 802A4D7C 10400008 */ beqz $v0, .L802A4DA0
/* 419B10 802A4D80 00031600 */ sll $v0, $v1, 0x18
/* 419B14 802A4D84 1C400005 */ bgtz $v0, .L802A4D9C
/* 419B18 802A4D88 2462FFFF */ addiu $v0, $v1, -1
/* 419B1C 802A4D8C 8E420214 */ lw $v0, 0x214($s2)
/* 419B20 802A4D90 00451024 */ and $v0, $v0, $a1
/* 419B24 802A4D94 10400002 */ beqz $v0, .L802A4DA0
/* 419B28 802A4D98 2462FFFF */ addiu $v0, $v1, -1
.L802A4D9C:
/* 419B2C 802A4D9C A0820000 */ sb $v0, ($a0)
.L802A4DA0:
/* 419B30 802A4DA0 8E420218 */ lw $v0, 0x218($s2)
/* 419B34 802A4DA4 3C060002 */ lui $a2, 2
/* 419B38 802A4DA8 00461024 */ and $v0, $v0, $a2
/* 419B3C 802A4DAC 10400010 */ beqz $v0, .L802A4DF0
/* 419B40 802A4DB0 00000000 */ nop
/* 419B44 802A4DB4 3C05802B */ lui $a1, %hi(D_802AD605)
/* 419B48 802A4DB8 24A5D605 */ addiu $a1, $a1, %lo(D_802AD605)
/* 419B4C 802A4DBC 3C02802B */ lui $v0, %hi(D_802AD66C)
/* 419B50 802A4DC0 8C42D66C */ lw $v0, %lo(D_802AD66C)($v0)
/* 419B54 802A4DC4 80A30000 */ lb $v1, ($a1)
/* 419B58 802A4DC8 90A40000 */ lbu $a0, ($a1)
/* 419B5C 802A4DCC 2442FFFF */ addiu $v0, $v0, -1
/* 419B60 802A4DD0 0062182A */ slt $v1, $v1, $v0
/* 419B64 802A4DD4 14600005 */ bnez $v1, .L802A4DEC
/* 419B68 802A4DD8 24820001 */ addiu $v0, $a0, 1
/* 419B6C 802A4DDC 8E420214 */ lw $v0, 0x214($s2)
/* 419B70 802A4DE0 00461024 */ and $v0, $v0, $a2
/* 419B74 802A4DE4 10400002 */ beqz $v0, .L802A4DF0
/* 419B78 802A4DE8 24820001 */ addiu $v0, $a0, 1
.L802A4DEC:
/* 419B7C 802A4DEC A0A20000 */ sb $v0, ($a1)
.L802A4DF0:
/* 419B80 802A4DF0 3C10802B */ lui $s0, %hi(D_802AD605)
/* 419B84 802A4DF4 2610D605 */ addiu $s0, $s0, %lo(D_802AD605)
/* 419B88 802A4DF8 82020000 */ lb $v0, ($s0)
/* 419B8C 802A4DFC 04410005 */ bgez $v0, .L802A4E14
/* 419B90 802A4E00 00000000 */ nop
/* 419B94 802A4E04 3C02802B */ lui $v0, %hi(D_802AD66C + 0x3)
/* 419B98 802A4E08 9042D66F */ lbu $v0, %lo(D_802AD66C + 0x3)($v0)
/* 419B9C 802A4E0C 2442FFFF */ addiu $v0, $v0, -1
/* 419BA0 802A4E10 A2020000 */ sb $v0, ($s0)
.L802A4E14:
/* 419BA4 802A4E14 3C11802B */ lui $s1, %hi(D_802AD66C)
/* 419BA8 802A4E18 2631D66C */ addiu $s1, $s1, %lo(D_802AD66C)
/* 419BAC 802A4E1C 8E220000 */ lw $v0, ($s1)
/* 419BB0 802A4E20 82030000 */ lb $v1, ($s0)
/* 419BB4 802A4E24 2442FFFF */ addiu $v0, $v0, -1
/* 419BB8 802A4E28 0043102A */ slt $v0, $v0, $v1
/* 419BBC 802A4E2C 54400001 */ bnel $v0, $zero, .L802A4E34
/* 419BC0 802A4E30 A2000000 */ sb $zero, ($s0)
.L802A4E34:
/* 419BC4 802A4E34 3C03802B */ lui $v1, %hi(D_802AD606)
/* 419BC8 802A4E38 8063D606 */ lb $v1, %lo(D_802AD606)($v1)
/* 419BCC 802A4E3C 82020000 */ lb $v0, ($s0)
/* 419BD0 802A4E40 10620009 */ beq $v1, $v0, .L802A4E68
/* 419BD4 802A4E44 00031080 */ sll $v0, $v1, 2
/* 419BD8 802A4E48 3C04802B */ lui $a0, %hi(D_802AD628)
/* 419BDC 802A4E4C 00822021 */ addu $a0, $a0, $v0
/* 419BE0 802A4E50 8C84D628 */ lw $a0, %lo(D_802AD628)($a0)
/* 419BE4 802A4E54 3C053EE6 */ lui $a1, 0x3ee6
/* 419BE8 802A4E58 0C051308 */ jal hud_element_set_scale
/* 419BEC 802A4E5C 34A56666 */ ori $a1, $a1, 0x6666
/* 419BF0 802A4E60 0C05272D */ jal sfx_play_sound
/* 419BF4 802A4E64 240400C7 */ addiu $a0, $zero, 0xc7
.L802A4E68:
/* 419BF8 802A4E68 3C04802B */ lui $a0, %hi(D_802AD608)
/* 419BFC 802A4E6C 2484D608 */ addiu $a0, $a0, %lo(D_802AD608)
/* 419C00 802A4E70 82050000 */ lb $a1, ($s0)
/* 419C04 802A4E74 80820000 */ lb $v0, ($a0)
/* 419C08 802A4E78 92030000 */ lbu $v1, ($s0)
/* 419C0C 802A4E7C 00A2102A */ slt $v0, $a1, $v0
/* 419C10 802A4E80 54400001 */ bnel $v0, $zero, .L802A4E88
/* 419C14 802A4E84 A0830000 */ sb $v1, ($a0)
.L802A4E88:
/* 419C18 802A4E88 3C06802B */ lui $a2, %hi(D_802AD609)
/* 419C1C 802A4E8C 24C6D609 */ addiu $a2, $a2, %lo(D_802AD609)
/* 419C20 802A4E90 80C20000 */ lb $v0, ($a2)
/* 419C24 802A4E94 00A2102A */ slt $v0, $a1, $v0
/* 419C28 802A4E98 14400006 */ bnez $v0, .L802A4EB4
/* 419C2C 802A4E9C 00000000 */ nop
/* 419C30 802A4EA0 3C02802B */ lui $v0, %hi(D_802AD60A)
/* 419C34 802A4EA4 9042D60A */ lbu $v0, %lo(D_802AD60A)($v0)
/* 419C38 802A4EA8 2442FFFF */ addiu $v0, $v0, -1
/* 419C3C 802A4EAC 00621023 */ subu $v0, $v1, $v0
/* 419C40 802A4EB0 A0820000 */ sb $v0, ($a0)
.L802A4EB4:
/* 419C44 802A4EB4 90820000 */ lbu $v0, ($a0)
/* 419C48 802A4EB8 24420006 */ addiu $v0, $v0, 6
/* 419C4C 802A4EBC A0C20000 */ sb $v0, ($a2)
/* 419C50 802A4EC0 00021600 */ sll $v0, $v0, 0x18
/* 419C54 802A4EC4 8E230000 */ lw $v1, ($s1)
/* 419C58 802A4EC8 00021603 */ sra $v0, $v0, 0x18
/* 419C5C 802A4ECC 0062182A */ slt $v1, $v1, $v0
/* 419C60 802A4ED0 10600003 */ beqz $v1, .L802A4EE0
/* 419C64 802A4ED4 00000000 */ nop
/* 419C68 802A4ED8 92220003 */ lbu $v0, 3($s1)
/* 419C6C 802A4EDC A0C20000 */ sb $v0, ($a2)
.L802A4EE0:
/* 419C70 802A4EE0 8E430214 */ lw $v1, 0x214($s2)
/* 419C74 802A4EE4 30628000 */ andi $v0, $v1, 0x8000
/* 419C78 802A4EE8 10400019 */ beqz $v0, .L802A4F50
/* 419C7C 802A4EEC 00051080 */ sll $v0, $a1, 2
/* 419C80 802A4EF0 3C03802B */ lui $v1, %hi(D_802AD690)
/* 419C84 802A4EF4 00621821 */ addu $v1, $v1, $v0
/* 419C88 802A4EF8 8C63D690 */ lw $v1, %lo(D_802AD690)($v1)
/* 419C8C 802A4EFC 24020001 */ addiu $v0, $zero, 1
/* 419C90 802A4F00 14620005 */ bne $v1, $v0, .L802A4F18
/* 419C94 802A4F04 00000000 */ nop
/* 419C98 802A4F08 0C05272D */ jal sfx_play_sound
/* 419C9C 802A4F0C 240400C9 */ addiu $a0, $zero, 0xc9
/* 419CA0 802A4F10 080A949A */ j .L802A5268
/* 419CA4 802A4F14 2402FFFF */ addiu $v0, $zero, -1
.L802A4F18:
/* 419CA8 802A4F18 0C05272D */ jal sfx_play_sound
/* 419CAC 802A4F1C 2404021D */ addiu $a0, $zero, 0x21d
/* 419CB0 802A4F20 82020000 */ lb $v0, ($s0)
/* 419CB4 802A4F24 00021080 */ sll $v0, $v0, 2
/* 419CB8 802A4F28 3C03802B */ lui $v1, %hi(D_802AD6A8 + 0x2)
/* 419CBC 802A4F2C 00621821 */ addu $v1, $v1, $v0
/* 419CC0 802A4F30 9463D6AA */ lhu $v1, %lo(D_802AD6A8 + 0x2)($v1)
/* 419CC4 802A4F34 24020028 */ addiu $v0, $zero, 0x28
/* 419CC8 802A4F38 3C01802B */ lui $at, %hi(D_802AD604)
/* 419CCC 802A4F3C A022D604 */ sb $v0, %lo(D_802AD604)($at)
/* 419CD0 802A4F40 3C01802B */ lui $at, %hi(D_802AD610)
/* 419CD4 802A4F44 A423D610 */ sh $v1, %lo(D_802AD610)($at)
/* 419CD8 802A4F48 080A949D */ j .L802A5274
/* 419CDC 802A4F4C 0000102D */ daddu $v0, $zero, $zero
.L802A4F50:
/* 419CE0 802A4F50 30624000 */ andi $v0, $v1, 0x4000
/* 419CE4 802A4F54 104000C7 */ beqz $v0, .L802A5274
/* 419CE8 802A4F58 0000102D */ daddu $v0, $zero, $zero
/* 419CEC 802A4F5C 0C05272D */ jal sfx_play_sound
/* 419CF0 802A4F60 240400CA */ addiu $a0, $zero, 0xca
/* 419CF4 802A4F64 0C0A91CB */ jal func_802A472C
/* 419CF8 802A4F68 00000000 */ nop
/* 419CFC 802A4F6C 080A949A */ j .L802A5268
/* 419D00 802A4F70 2402FFFE */ addiu $v0, $zero, -2
.L802A4F74_419D04:
/* 419D04 802A4F74 3C02802B */ lui $v0, %hi(D_802AD66C)
/* 419D08 802A4F78 8C42D66C */ lw $v0, %lo(D_802AD66C)($v0)
/* 419D0C 802A4F7C 1840000F */ blez $v0, .L802A4FBC
/* 419D10 802A4F80 0000882D */ daddu $s1, $zero, $zero
/* 419D14 802A4F84 3C10802B */ lui $s0, %hi(D_802AD628)
/* 419D18 802A4F88 2610D628 */ addiu $s0, $s0, %lo(D_802AD628)
/* 419D1C 802A4F8C 240500A0 */ addiu $a1, $zero, 0xa0
.L802A4F90:
/* 419D20 802A4F90 00A0302D */ daddu $a2, $a1, $zero
/* 419D24 802A4F94 00A0382D */ daddu $a3, $a1, $zero
/* 419D28 802A4F98 8E040000 */ lw $a0, ($s0)
/* 419D2C 802A4F9C 0C0513BF */ jal hud_element_set_tint
/* 419D30 802A4FA0 26100004 */ addiu $s0, $s0, 4
/* 419D34 802A4FA4 3C02802B */ lui $v0, %hi(D_802AD66C)
/* 419D38 802A4FA8 8C42D66C */ lw $v0, %lo(D_802AD66C)($v0)
/* 419D3C 802A4FAC 26310001 */ addiu $s1, $s1, 1
/* 419D40 802A4FB0 0222102A */ slt $v0, $s1, $v0
/* 419D44 802A4FB4 1440FFF6 */ bnez $v0, .L802A4F90
/* 419D48 802A4FB8 240500A0 */ addiu $a1, $zero, 0xa0
.L802A4FBC:
/* 419D4C 802A4FBC 240500A0 */ addiu $a1, $zero, 0xa0
/* 419D50 802A4FC0 00A0302D */ daddu $a2, $a1, $zero
/* 419D54 802A4FC4 3C10802B */ lui $s0, %hi(D_802AD618)
/* 419D58 802A4FC8 2610D618 */ addiu $s0, $s0, %lo(D_802AD618)
/* 419D5C 802A4FCC 8E040000 */ lw $a0, ($s0)
/* 419D60 802A4FD0 0C0513BF */ jal hud_element_set_tint
/* 419D64 802A4FD4 00A0382D */ daddu $a3, $a1, $zero
/* 419D68 802A4FD8 240500A0 */ addiu $a1, $zero, 0xa0
/* 419D6C 802A4FDC 00A0302D */ daddu $a2, $a1, $zero
/* 419D70 802A4FE0 3C04802B */ lui $a0, %hi(D_802AD61C)
/* 419D74 802A4FE4 8C84D61C */ lw $a0, %lo(D_802AD61C)($a0)
/* 419D78 802A4FE8 0C0513BF */ jal hud_element_set_tint
/* 419D7C 802A4FEC 00A0382D */ daddu $a3, $a1, $zero
/* 419D80 802A4FF0 240500A0 */ addiu $a1, $zero, 0xa0
/* 419D84 802A4FF4 00A0302D */ daddu $a2, $a1, $zero
/* 419D88 802A4FF8 3C04802B */ lui $a0, %hi(D_802AD620)
/* 419D8C 802A4FFC 8C84D620 */ lw $a0, %lo(D_802AD620)($a0)
/* 419D90 802A5000 0C0513BF */ jal hud_element_set_tint
/* 419D94 802A5004 00A0382D */ daddu $a3, $a1, $zero
/* 419D98 802A5008 8E040000 */ lw $a0, ($s0)
/* 419D9C 802A500C 3C058010 */ lui $a1, %hi(HES_HandPointer)
/* 419DA0 802A5010 24A54A00 */ addiu $a1, $a1, %lo(HES_HandPointer)
/* 419DA4 802A5014 0C0511FF */ jal hud_element_set_script
/* 419DA8 802A5018 00000000 */ nop
/* 419DAC 802A501C 24040006 */ addiu $a0, $zero, 6
/* 419DB0 802A5020 2402000D */ addiu $v0, $zero, 0xd
/* 419DB4 802A5024 3C01802B */ lui $at, %hi(D_802AD614)
/* 419DB8 802A5028 A022D614 */ sb $v0, %lo(D_802AD614)($at)
/* 419DBC 802A502C 0C051F9F */ jal set_window_update
/* 419DC0 802A5030 24050004 */ addiu $a1, $zero, 4
/* 419DC4 802A5034 24040007 */ addiu $a0, $zero, 7
/* 419DC8 802A5038 0C051F9F */ jal set_window_update
/* 419DCC 802A503C 24050004 */ addiu $a1, $zero, 4
/* 419DD0 802A5040 24040008 */ addiu $a0, $zero, 8
/* 419DD4 802A5044 0C051F9F */ jal set_window_update
/* 419DD8 802A5048 24050002 */ addiu $a1, $zero, 2
/* 419DDC 802A504C 080A9424 */ j .L802A5090_419E20
/* 419DE0 802A5050 00000000 */ nop
.L802A5054_419DE4:
/* 419DE4 802A5054 080A949D */ j .L802A5274
/* 419DE8 802A5058 240200FF */ addiu $v0, $zero, 0xff
.L802A505C_419DEC:
/* 419DEC 802A505C 24040006 */ addiu $a0, $zero, 6
/* 419DF0 802A5060 0C051F9F */ jal set_window_update
/* 419DF4 802A5064 24050002 */ addiu $a1, $zero, 2
/* 419DF8 802A5068 24040007 */ addiu $a0, $zero, 7
/* 419DFC 802A506C 0C051F9F */ jal set_window_update
/* 419E00 802A5070 24050002 */ addiu $a1, $zero, 2
/* 419E04 802A5074 24040008 */ addiu $a0, $zero, 8
/* 419E08 802A5078 0C051F9F */ jal set_window_update
/* 419E0C 802A507C 24050002 */ addiu $a1, $zero, 2
/* 419E10 802A5080 3C02802B */ lui $v0, %hi(D_802AD605)
/* 419E14 802A5084 8042D605 */ lb $v0, %lo(D_802AD605)($v0)
/* 419E18 802A5088 080A9434 */ j .L802A50D0
/* 419E1C 802A508C 2403000B */ addiu $v1, $zero, 0xb
.L802A5090_419E20:
/* 419E20 802A5090 3C02802B */ lui $v0, %hi(D_802AD605)
/* 419E24 802A5094 8042D605 */ lb $v0, %lo(D_802AD605)($v0)
/* 419E28 802A5098 080A949D */ j .L802A5274
/* 419E2C 802A509C 24420001 */ addiu $v0, $v0, 1
.L802A50A0_419E30:
/* 419E30 802A50A0 24040006 */ addiu $a0, $zero, 6
/* 419E34 802A50A4 0C051F9F */ jal set_window_update
/* 419E38 802A50A8 24050001 */ addiu $a1, $zero, 1
/* 419E3C 802A50AC 24040007 */ addiu $a0, $zero, 7
/* 419E40 802A50B0 0C051F9F */ jal set_window_update
/* 419E44 802A50B4 24050001 */ addiu $a1, $zero, 1
/* 419E48 802A50B8 24040008 */ addiu $a0, $zero, 8
/* 419E4C 802A50BC 0C051F9F */ jal set_window_update
/* 419E50 802A50C0 24050001 */ addiu $a1, $zero, 1
/* 419E54 802A50C4 3C02802B */ lui $v0, %hi(D_802AD605)
/* 419E58 802A50C8 8042D605 */ lb $v0, %lo(D_802AD605)($v0)
/* 419E5C 802A50CC 24030001 */ addiu $v1, $zero, 1
.L802A50D0:
/* 419E60 802A50D0 3C01802B */ lui $at, %hi(D_802AD604)
/* 419E64 802A50D4 A023D604 */ sb $v1, %lo(D_802AD604)($at)
/* 419E68 802A50D8 080A949D */ j .L802A5274
/* 419E6C 802A50DC 24420001 */ addiu $v0, $v0, 1
.L802A50E0_419E70:
/* 419E70 802A50E0 24040006 */ addiu $a0, $zero, 6
/* 419E74 802A50E4 0C051F9F */ jal set_window_update
/* 419E78 802A50E8 24050001 */ addiu $a1, $zero, 1
/* 419E7C 802A50EC 24040007 */ addiu $a0, $zero, 7
/* 419E80 802A50F0 0C051F9F */ jal set_window_update
/* 419E84 802A50F4 24050001 */ addiu $a1, $zero, 1
/* 419E88 802A50F8 24040008 */ addiu $a0, $zero, 8
/* 419E8C 802A50FC 0C051F9F */ jal set_window_update
/* 419E90 802A5100 24050001 */ addiu $a1, $zero, 1
/* 419E94 802A5104 080A949A */ j .L802A5268
/* 419E98 802A5108 2402FFFF */ addiu $v0, $zero, -1
.L802A510C_419E9C:
/* 419E9C 802A510C 2402FFFF */ addiu $v0, $zero, -1
/* 419EA0 802A5110 0040182D */ daddu $v1, $v0, $zero
/* 419EA4 802A5114 3C01802B */ lui $at, %hi(D_802AD6D4)
/* 419EA8 802A5118 AC23D6D4 */ sw $v1, %lo(D_802AD6D4)($at)
/* 419EAC 802A511C 24030029 */ addiu $v1, $zero, 0x29
/* 419EB0 802A5120 3C01802B */ lui $at, %hi(D_802AD604)
/* 419EB4 802A5124 A023D604 */ sb $v1, %lo(D_802AD604)($at)
/* 419EB8 802A5128 080A949D */ j .L802A5274
/* 419EBC 802A512C 00000000 */ nop
.L802A5130_419EC0:
/* 419EC0 802A5130 24040006 */ addiu $a0, $zero, 6
/* 419EC4 802A5134 0C051F9F */ jal set_window_update
/* 419EC8 802A5138 24050002 */ addiu $a1, $zero, 2
/* 419ECC 802A513C 24040007 */ addiu $a0, $zero, 7
/* 419ED0 802A5140 0C051F9F */ jal set_window_update
/* 419ED4 802A5144 24050002 */ addiu $a1, $zero, 2
/* 419ED8 802A5148 24040008 */ addiu $a0, $zero, 8
/* 419EDC 802A514C 0C051F9F */ jal set_window_update
/* 419EE0 802A5150 24050002 */ addiu $a1, $zero, 2
/* 419EE4 802A5154 3C03802B */ lui $v1, %hi(D_802AD610)
/* 419EE8 802A5158 8463D610 */ lh $v1, %lo(D_802AD610)($v1)
/* 419EEC 802A515C 14600003 */ bnez $v1, .L802A516C
/* 419EF0 802A5160 3C04001D */ lui $a0, 0x1d
/* 419EF4 802A5164 080A945C */ j .L802A5170
/* 419EF8 802A5168 348400CB */ ori $a0, $a0, 0xcb
.L802A516C:
/* 419EFC 802A516C 348400CC */ ori $a0, $a0, 0xcc
.L802A5170:
/* 419F00 802A5170 0C04991D */ jal get_msg_width
/* 419F04 802A5174 0000282D */ daddu $a1, $zero, $zero
/* 419F08 802A5178 24040009 */ addiu $a0, $zero, 9
/* 419F0C 802A517C 24470017 */ addiu $a3, $v0, 0x17
/* 419F10 802A5180 00072FC2 */ srl $a1, $a3, 0x1f
/* 419F14 802A5184 00E52821 */ addu $a1, $a3, $a1
/* 419F18 802A5188 00052843 */ sra $a1, $a1, 1
/* 419F1C 802A518C 240200A0 */ addiu $v0, $zero, 0xa0
/* 419F20 802A5190 00452823 */ subu $a1, $v0, $a1
/* 419F24 802A5194 24060050 */ addiu $a2, $zero, 0x50
/* 419F28 802A5198 2402001C */ addiu $v0, $zero, 0x1c
/* 419F2C 802A519C AFA20010 */ sw $v0, 0x10($sp)
/* 419F30 802A51A0 24020014 */ addiu $v0, $zero, 0x14
/* 419F34 802A51A4 AFA20014 */ sw $v0, 0x14($sp)
/* 419F38 802A51A8 3C02802A */ lui $v0, %hi(func_802A57C8)
/* 419F3C 802A51AC 244257C8 */ addiu $v0, $v0, %lo(func_802A57C8)
/* 419F40 802A51B0 AFA20018 */ sw $v0, 0x18($sp)
/* 419F44 802A51B4 2402FFFF */ addiu $v0, $zero, -1
/* 419F48 802A51B8 AFA0001C */ sw $zero, 0x1c($sp)
/* 419F4C 802A51BC 0C051F32 */ jal set_window_properties
/* 419F50 802A51C0 AFA20020 */ sw $v0, 0x20($sp)
/* 419F54 802A51C4 24040009 */ addiu $a0, $zero, 9
/* 419F58 802A51C8 0C051F9F */ jal set_window_update
/* 419F5C 802A51CC 24050001 */ addiu $a1, $zero, 1
/* 419F60 802A51D0 2403003C */ addiu $v1, $zero, 0x3c
/* 419F64 802A51D4 3C01802B */ lui $at, %hi(D_802AD612)
/* 419F68 802A51D8 A423D612 */ sh $v1, %lo(D_802AD612)($at)
/* 419F6C 802A51DC 2403002A */ addiu $v1, $zero, 0x2a
/* 419F70 802A51E0 3C01802B */ lui $at, %hi(D_802AD604)
/* 419F74 802A51E4 A023D604 */ sb $v1, %lo(D_802AD604)($at)
/* 419F78 802A51E8 080A949D */ j .L802A5274
/* 419F7C 802A51EC 2402FFFF */ addiu $v0, $zero, -1
.L802A51F0_419F80:
/* 419F80 802A51F0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 419F84 802A51F4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 419F88 802A51F8 8C420010 */ lw $v0, 0x10($v0)
/* 419F8C 802A51FC 3042C000 */ andi $v0, $v0, 0xc000
/* 419F90 802A5200 10400003 */ beqz $v0, .L802A5210
/* 419F94 802A5204 00000000 */ nop
/* 419F98 802A5208 3C01802B */ lui $at, %hi(D_802AD612)
/* 419F9C 802A520C A420D612 */ sh $zero, %lo(D_802AD612)($at)
.L802A5210:
/* 419FA0 802A5210 3C04802B */ lui $a0, %hi(D_802AD612)
/* 419FA4 802A5214 2484D612 */ addiu $a0, $a0, %lo(D_802AD612)
/* 419FA8 802A5218 84820000 */ lh $v0, ($a0)
/* 419FAC 802A521C 94830000 */ lhu $v1, ($a0)
/* 419FB0 802A5220 10400004 */ beqz $v0, .L802A5234
/* 419FB4 802A5224 2462FFFF */ addiu $v0, $v1, -1
/* 419FB8 802A5228 A4820000 */ sh $v0, ($a0)
/* 419FBC 802A522C 080A949D */ j .L802A5274
/* 419FC0 802A5230 2402FFFF */ addiu $v0, $zero, -1
.L802A5234:
/* 419FC4 802A5234 24040009 */ addiu $a0, $zero, 9
/* 419FC8 802A5238 0C051F9F */ jal set_window_update
/* 419FCC 802A523C 24050002 */ addiu $a1, $zero, 2
/* 419FD0 802A5240 24040006 */ addiu $a0, $zero, 6
/* 419FD4 802A5244 0C051F9F */ jal set_window_update
/* 419FD8 802A5248 24050001 */ addiu $a1, $zero, 1
/* 419FDC 802A524C 24040007 */ addiu $a0, $zero, 7
/* 419FE0 802A5250 0C051F9F */ jal set_window_update
/* 419FE4 802A5254 24050001 */ addiu $a1, $zero, 1
/* 419FE8 802A5258 24040008 */ addiu $a0, $zero, 8
/* 419FEC 802A525C 0C051F9F */ jal set_window_update
/* 419FF0 802A5260 24050001 */ addiu $a1, $zero, 1
/* 419FF4 802A5264 24020001 */ addiu $v0, $zero, 1
.L802A5268:
/* 419FF8 802A5268 3C01802B */ lui $at, %hi(D_802AD604)
/* 419FFC 802A526C A022D604 */ sb $v0, %lo(D_802AD604)($at)
.L802A5270_41A000:
/* 41A000 802A5270 0000102D */ daddu $v0, $zero, $zero
.L802A5274:
/* 41A004 802A5274 8FBF0038 */ lw $ra, 0x38($sp)
/* 41A008 802A5278 8FB30034 */ lw $s3, 0x34($sp)
/* 41A00C 802A527C 8FB20030 */ lw $s2, 0x30($sp)
/* 41A010 802A5280 8FB1002C */ lw $s1, 0x2c($sp)
/* 41A014 802A5284 8FB00028 */ lw $s0, 0x28($sp)
/* 41A018 802A5288 03E00008 */ jr $ra
/* 41A01C 802A528C 27BD0040 */ addiu $sp, $sp, 0x40

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A57C8
/* 41A558 802A57C8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 41A55C 802A57CC 24A5000B */ addiu $a1, $a1, 0xb
/* 41A560 802A57D0 3C03802B */ lui $v1, %hi(D_802AD610)
/* 41A564 802A57D4 8463D610 */ lh $v1, %lo(D_802AD610)($v1)
/* 41A568 802A57D8 24C60006 */ addiu $a2, $a2, 6
/* 41A56C 802A57DC 14600004 */ bnez $v1, .L802A57F0
/* 41A570 802A57E0 AFBF0018 */ sw $ra, 0x18($sp)
/* 41A574 802A57E4 3C04001D */ lui $a0, 0x1d
/* 41A578 802A57E8 080A95FE */ j .L802A57F8
/* 41A57C 802A57EC 348400CB */ ori $a0, $a0, 0xcb
.L802A57F0:
/* 41A580 802A57F0 3C04001D */ lui $a0, 0x1d
/* 41A584 802A57F4 348400CC */ ori $a0, $a0, 0xcc
.L802A57F8:
/* 41A588 802A57F8 2402000F */ addiu $v0, $zero, 0xf
/* 41A58C 802A57FC 240700FF */ addiu $a3, $zero, 0xff
/* 41A590 802A5800 AFA20010 */ sw $v0, 0x10($sp)
/* 41A594 802A5804 0C04993B */ jal draw_msg
/* 41A598 802A5808 AFA00014 */ sw $zero, 0x14($sp)
/* 41A59C 802A580C 8FBF0018 */ lw $ra, 0x18($sp)
/* 41A5A0 802A5810 03E00008 */ jr $ra
/* 41A5A4 802A5814 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,91 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802BD540_323E90
/* 323E90 802BD540 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 323E94 802BD544 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 323E98 802BD548 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 323E9C 802BD54C AFB20038 */ sw $s2, 0x38($sp)
/* 323EA0 802BD550 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* 323EA4 802BD554 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* 323EA8 802BD558 AFBF003C */ sw $ra, 0x3c($sp)
/* 323EAC 802BD55C AFB10034 */ sw $s1, 0x34($sp)
/* 323EB0 802BD560 AFB00030 */ sw $s0, 0x30($sp)
/* 323EB4 802BD564 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 323EB8 802BD568 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 323EBC 802BD56C 84430086 */ lh $v1, 0x86($v0)
/* 323EC0 802BD570 24020010 */ addiu $v0, $zero, 0x10
/* 323EC4 802BD574 5462003F */ bnel $v1, $v0, .L802BD674
/* 323EC8 802BD578 2402FFFF */ addiu $v0, $zero, -1
/* 323ECC 802BD57C C640001C */ lwc1 $f0, 0x1c($s2)
/* 323ED0 802BD580 44801000 */ mtc1 $zero, $f2
/* 323ED4 802BD584 00000000 */ nop
/* 323ED8 802BD588 46020032 */ c.eq.s $f0, $f2
/* 323EDC 802BD58C 00000000 */ nop
/* 323EE0 802BD590 45000006 */ bc1f .L802BD5AC
/* 323EE4 802BD594 00000000 */ nop
/* 323EE8 802BD598 C6400024 */ lwc1 $f0, 0x24($s2)
/* 323EEC 802BD59C 46020032 */ c.eq.s $f0, $f2
/* 323EF0 802BD5A0 00000000 */ nop
/* 323EF4 802BD5A4 45010033 */ bc1t .L802BD674
/* 323EF8 802BD5A8 2402FFFF */ addiu $v0, $zero, -1
.L802BD5AC:
/* 323EFC 802BD5AC 8E46001C */ lw $a2, 0x1c($s2)
/* 323F00 802BD5B0 44806000 */ mtc1 $zero, $f12
/* 323F04 802BD5B4 8E470024 */ lw $a3, 0x24($s2)
/* 323F08 802BD5B8 0C00A720 */ jal atan2
/* 323F0C 802BD5BC 46006386 */ mov.s $f14, $f12
/* 323F10 802BD5C0 864200B0 */ lh $v0, 0xb0($s2)
/* 323F14 802BD5C4 3C013F00 */ lui $at, 0x3f00
/* 323F18 802BD5C8 4481A000 */ mtc1 $at, $f20
/* 323F1C 802BD5CC 44821000 */ mtc1 $v0, $f2
/* 323F20 802BD5D0 00000000 */ nop
/* 323F24 802BD5D4 468010A0 */ cvt.s.w $f2, $f2
/* 323F28 802BD5D8 46141082 */ mul.s $f2, $f2, $f20
/* 323F2C 802BD5DC 00000000 */ nop
/* 323F30 802BD5E0 46000586 */ mov.s $f22, $f0
/* 323F34 802BD5E4 3C014334 */ lui $at, 0x4334
/* 323F38 802BD5E8 44816000 */ mtc1 $at, $f12
/* 323F3C 802BD5EC C6460028 */ lwc1 $f6, 0x28($s2)
/* 323F40 802BD5F0 460CB300 */ add.s $f12, $f22, $f12
/* 323F44 802BD5F4 C640002C */ lwc1 $f0, 0x2c($s2)
/* 323F48 802BD5F8 C6440030 */ lwc1 $f4, 0x30($s2)
/* 323F4C 802BD5FC 46020000 */ add.s $f0, $f0, $f2
/* 323F50 802BD600 E7A60020 */ swc1 $f6, 0x20($sp)
/* 323F54 802BD604 E7A40024 */ swc1 $f4, 0x24($sp)
/* 323F58 802BD608 0C00A6C9 */ jal clamp_angle
/* 323F5C 802BD60C E7A00028 */ swc1 $f0, 0x28($sp)
/* 323F60 802BD610 864200B2 */ lh $v0, 0xb2($s2)
/* 323F64 802BD614 44821000 */ mtc1 $v0, $f2
/* 323F68 802BD618 00000000 */ nop
/* 323F6C 802BD61C 468010A0 */ cvt.s.w $f2, $f2
/* 323F70 802BD620 46141082 */ mul.s $f2, $f2, $f20
/* 323F74 802BD624 00000000 */ nop
/* 323F78 802BD628 27B00020 */ addiu $s0, $sp, 0x20
/* 323F7C 802BD62C 0200202D */ daddu $a0, $s0, $zero
/* 323F80 802BD630 27B10024 */ addiu $s1, $sp, 0x24
/* 323F84 802BD634 44070000 */ mfc1 $a3, $f0
/* 323F88 802BD638 44061000 */ mfc1 $a2, $f2
/* 323F8C 802BD63C 0C00A7E7 */ jal add_vec2D_polar
/* 323F90 802BD640 0220282D */ daddu $a1, $s1, $zero
/* 323F94 802BD644 0000202D */ daddu $a0, $zero, $zero
/* 323F98 802BD648 0240282D */ daddu $a1, $s2, $zero
/* 323F9C 802BD64C 0200302D */ daddu $a2, $s0, $zero
/* 323FA0 802BD650 84A200B2 */ lh $v0, 0xb2($a1)
/* 323FA4 802BD654 27A70028 */ addiu $a3, $sp, 0x28
/* 323FA8 802BD658 AFB10010 */ sw $s1, 0x10($sp)
/* 323FAC 802BD65C E7B60018 */ swc1 $f22, 0x18($sp)
/* 323FB0 802BD660 44820000 */ mtc1 $v0, $f0
/* 323FB4 802BD664 00000000 */ nop
/* 323FB8 802BD668 46800020 */ cvt.s.w $f0, $f0
/* 323FBC 802BD66C 0C037B01 */ jal player_test_lateral_overlap
/* 323FC0 802BD670 E7A00014 */ swc1 $f0, 0x14($sp)
.L802BD674:
/* 323FC4 802BD674 8FBF003C */ lw $ra, 0x3c($sp)
/* 323FC8 802BD678 8FB20038 */ lw $s2, 0x38($sp)
/* 323FCC 802BD67C 8FB10034 */ lw $s1, 0x34($sp)
/* 323FD0 802BD680 8FB00030 */ lw $s0, 0x30($sp)
/* 323FD4 802BD684 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 323FD8 802BD688 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 323FDC 802BD68C 03E00008 */ jr $ra
/* 323FE0 802BD690 27BD0050 */ addiu $sp, $sp, 0x50