This commit is contained in:
louist103 2023-11-03 22:45:13 -04:00 committed by GitHub
parent 729484d51e
commit 93569d5c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 248 additions and 2 deletions

View File

@ -329,8 +329,254 @@ void func_80A778D8(EnJso2* this) {
this->unk36C = 2;
this->actionFunc = func_80A778F8;
}
//#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jso2/func_80A778F8.s")
extern Vec3s D_80A7B6F4;
#if 1
void func_80A778F8(EnJso2* this, PlayState* play) {
s32 i;
f32 curFrame;
Vec3f spawnPos;
Player* player;
player = GET_PLAYER(play);
curFrame = this->skelAnime.curFrame;
switch (this->unk1046) {
case 0:
if (this->actor.xzDistToPlayer < 400.0f) {
Audio_SetMainBgmVolume(0U, 0xAU);
this->unk1046 += 1;
this->actor.gravity = 0.0f;
}
break;
case 1:
if (CutsceneManager_IsNext((s16) this->actor.csId) == 0) {
CutsceneManager_Queue((s16) this->actor.csId);
} else {
f32 temp;
CutsceneManager_StartWithPlayerCs((s16) this->actor.csId, &this->actor);
this->unk1048 = CutsceneManager_GetCurrentSubCamId((s16) this->actor.csId);
this->unk294 = 0.4f;
this->unk298 = 40.0f;
player->actor.world.pos.x = 420.0f;
player->actor.world.pos.z = -3430.0f;
this->actor.draw = EnJso2_Draw;
func_80A776E0(this, 0x11);
spawnPos.x = D_80A7B6F4.x;
spawnPos.y = D_80A7B6F4.y;
spawnPos.z = D_80A7B6F4.z;
this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &spawnPos);
this->unk1050 = 60.0f;
this->unk104C = 60.0f;
this->actor.world.pos.x = -285.0f;
this->actor.world.pos.y = 535.0f;
this->actor.world.pos.z = -3425.0f;
this->unk1078.x = 82.0f;
this->unk1078.z = 780.0f;
temp = -586.0f;
this->unk1084.y = this->unk1078.y = temp + 500.0f;Math_Vec3f_Copy(&spawnPos, &this->unk1078);
OLib_Vec3fAdd(&this->actor.world, &spawnPos, &this->unk1078, 1);
this->unk1084.x = this->actor.world.pos.x - 90.0f;
this->unk1084.z = this->actor.world.pos.z + 100.0f;
Math_Vec3f_Copy(&this->unk1054, &this->unk1078);
Math_Vec3f_Copy(&this->unk1060, &this->unk1084);
func_800B7298(play, &this->actor, 6U);
func_80122744(play, &this->unk_27C, 1U, &D_80A7B6F4);
this->unk1046 += 1;
break;
}
break;
case 2:
this->actor.world.pos.x = -285.0f;
this->actor.world.pos.y = 535.0f;
this->actor.world.pos.z = -3425.0f;
this->unk1078.x = 82.0f;
this->unk1078.y = -516.0f;
this->unk1078.z = 800.0f;
Math_Vec3f_Copy(&spawnPos, &this->unk1078);
OLib_Vec3fAdd(&this->actor.world, &spawnPos, &this->unk1078, 1);
this->unk1084.x = this->actor.world.pos.x - 90.0f;
this->unk1084.y = this->actor.world.pos.y - 591.0f;
this->unk1084.z = this->actor.world.pos.z + 100.0f;
Math_Vec3f_Copy(&this->unk1054, &this->unk1078);
Math_Vec3f_Copy(&this->unk1060, &this->unk1084);
if (func_80122760(play, &this->unk_27C, 60.0f) != 0) {
func_800B7298(play, NULL, 0x13U);
this->unk1044 = 0xA;
this->unk1046 += 1;
}
break;
case 3: {
Vec3f unk1078Copy;
s32 i = 0;
if (this->unk1044 == 1) {
for (i = 0; i < 2; i++) {
Math_Vec3f_Copy(&unk1078Copy, &this->actor.home.pos);
unk1078Copy.x += Rand_CenteredFloat(80.0f);
unk1078Copy.y = this->actor.world.pos.y + (i * 120.0f);
unk1078Copy.z += Rand_CenteredFloat(80.0f);
Actor_Spawn(&play->actorCtx, play, 0x1D9, unk1078Copy.x, unk1078Copy.y, unk1078Copy.z, 0, this->actor.world.rot.y, 0, 2);
}
this->unk1044 = 0x19;
this->unk1046 += 1;
}
}
break;
case 4:
if (this->unk1044 == 0) {
func_800B7298(play, NULL, 4U);
this->unk1044 = 0x14;
this->unk1046 += 1;
}
break;
case 5:
if (this->unk1044 == 0) {
this->unk1044 = 0x14;
this->unk1046++;
}
break;
case 6:
this->unk1078.x = 82.0f;
this->unk1078.y = -533.0f;
this->unk1078.z = 800.0f;
Math_Vec3f_Copy(&spawnPos, &this->unk1078); // Try new variable and scoping
OLib_Vec3fAdd(&this->actor.world, &spawnPos, &this->unk1078, 1);
this->unk1084.x = this->actor.focus.pos.x - 80.0f;
this->unk1084.y = this->actor.focus.pos.y - 360.0f;
this->unk1084.z = this->actor.focus.pos.z + 100.0f;
if (this->unk1044 == 0) {
this->unk1044 = 5;
this->unk1046 += 1;
}
break;
case 7:
if (this->unk1044 == 0) {
Actor_PlaySfx(&this->actor, 0x3AC6U);
this->unk1044 = 0x2D;
this->unk1046 += 1;
}
break;
case 8:
if (this->unk1044 == 0) {
this->actor.speed = 3.0f;
this->actor.velocity.y = 10.0f;
this->actor.gravity = -1.0f;
func_80A776E0(this, 0x10);
this->unk294 = 0.4f;
this->unk298 = 40.0f;
Actor_PlaySfx(&this->actor, 0x38EEU);
Math_Vec3f_Copy(&this->unk_2B8, &this->unk1054);
this->unk1044 = 0x19;
this->unk1046 += 1;
}
break;
case 9:{
//s32 i2;
this->unk_38C += 1;
if (this->unk_38C >= 0x14) {
this->unk_38C = 0;
}
if (this->unk_388 < 0x13) {
this->unk_388++;
}
Math_Vec3f_Copy(&this->unk_390[this->unk_38C], &this->actor.world.pos);
Math_Vec3s_Copy(&this->unk_480[this->unk_38C], &this->actor.world.rot);
this->unk_390[this->unk_38C].y += 40.0f;
for (i = 0; i < 20; i++) {
this->unk_4F8[this->unk_38C][i] = this->jointTable[i];
}
Math_ApproachF(&this->actor.shape.shadowScale, 17.0f, 0.4f, 4.0f);
if (this->unk1044 == 0) {
this->unk1078.x = this->unk_2B8.x - 490.0f;
this->unk1078.y = this->unk_2B8.y;
this->unk1078.z = this->unk_2B8.z + 100.0f;
}
this->unk1084.x = this->actor.focus.pos.x - 80.0f;
this->unk1084.y = this->actor.focus.pos.y - 130.0f;
this->unk1084.z = this->actor.focus.pos.z;
if (this->actor.bgCheckFlags & 1) {
Actor_PlaySfx(&this->actor, 0x3AD9U);
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.speed = 0.0f;
func_80A776E0(this, 0xF);
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 0xA, 4.0f, (s16) 0x1F4, (s16) 0x32, (u8) 1);
this->unk1044 = 1;
Actor_PlaySfx(&this->actor, 0x387BU);
this->unk1046++;
}
}
break;
case 10:
this->unk_38C++;
if (this->unk_38C >= 0x14) {
this->unk_38C = 0;
}
if (this->unk_388 < 0x13) {
this->unk_388++;
}
Math_Vec3f_Copy(&this->unk_390[this->unk_38C], &this->actor.world.pos);
Math_Vec3s_Copy(&this->unk_480[this->unk_38C], &this->actor.world.rot);
this->unk_390[this->unk_38C].y += 40.0f;
for (i = 0; i < 20; i++) {
this->unk_4F8[this->unk_38C][i] = this->jointTable[i];
}
if (this->unk1044 == 0) {
this->unk1078.x = this->unk_2B8.x - 518.0f;
this->unk1078.y = this->unk_2B8.y - 11.0f;
this->unk1078.z = this->unk_2B8.z + 100.0f;
}
this->unk1084.x = this->actor.focus.pos.x + 20.0f;
this->unk1084.y = this->actor.focus.pos.y - 50.0f;
this->unk1084.z = this->actor.focus.pos.z;
if (this->unk374 <= curFrame) {
this->unk_388 = 0;
this->unk_38C = 0;
this->unk1044 = 0x14;
func_80A776E0(this, 0x12);
this->unk1046++;
}
break;
case 11:
if (Animation_OnFrame(&this->skelAnime, 17.0f) != 0) {
Actor_PlaySfx(&this->actor, 0x39C7U);
Actor_PlaySfx(&this->actor, 0x2822U);
this->unk36C = 0;
Audio_SetMainBgmVolume(0x7FU, 0U);
Audio_PlayBgm_StorePrevBgm(0x38U);
}
if (this->unk1044 == 0) {
//s32 i;
this->unk1078.x = this->unk_2B8.x - 470.0f;
this->unk1078.y = this->unk_2B8.y - 10.0f;
this->unk1078.z = this->unk_2B8.z + 100.0f;
this->unk1084.x = this->actor.focus.pos.x - 80.0f;
this->unk1084.y = this->actor.focus.pos.y - 30.0f;
this->unk1084.z = this->actor.focus.pos.z;
if (this->unk36C == 0) {
for (i = 0; i < ARRAY_COUNT(D_80A7B510); i++) {
Math_ApproachF(&this->unk_EAC[i].x, D_80A7B510[i].x, 0.3f, 0.0005f);
this->unk_EAC[i].y = this->unk_EAC[i].x;
this->unk_EAC[i].z = this->unk_EAC[i].x;
}
}
}
if (this->unk374 <= curFrame) {
CutsceneManager_Stop(this->actor.csId);
this->unk1048 = 0;
this->actor.flags &= ~ACTOR_FLAG_100000;
this->actor.gravity = -3.0f;
this->actor.flags &= ~ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags |= ACTOR_FLAG_TARGETABLE;
func_80A787FC(this, play);
}
break;
}
this->actor.shape.yOffset = 960.0f;
func_80A77790(this, play);
}
#endif
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jso2/func_80A778F8.s")
void func_80A78588(EnJso2* this) {
this->unk36C = 2;

View File

@ -33,7 +33,7 @@ typedef struct EnJso2 {
/* 0x02B0 */ s16 unk_2B0;
/* 0x02B2 */ char pad_2B2[0x2];
/* 0x02B4 */ s32 unk2B4;
/* 0x02B6 */ char unk_2B8[0xC];
/* 0x02B6 */ Vec3f unk_2B8;
/* 0x02C4 */ Vec3f unk2C4;
/* 0x02D0 */ Actor* unk2D0;
/* 0x02D4 */ Vec3f unk2D4[12];