From 5ff94a329ed276616c01e1350f5a264f5398e694 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Fri, 3 Nov 2023 23:59:03 -0300 Subject: [PATCH 01/11] refactor --- src/overlays/actors/ovl_En_Jso2/z_en_jso2.c | 520 +++++++++++--------- 1 file changed, 284 insertions(+), 236 deletions(-) diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c index c854fb61c..01c0d8d9c 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c @@ -176,18 +176,21 @@ static AnimationHeader* D_80A7B684[0x16] = { &gGaroTrembleAnim, &gGaroTakeOutBombAnim, }; -static u8 D_80A7B6DC[] = { 2, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, 0, 2, 2, 0, 2, 2, 0, 2, 0, 0 }; +static u8 D_80A7B6DC[] = { 2, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, 0, 2, 2, 0, 2, 2, 0, 2 }; static Vec3s D_80A7B6F4 = { 350, -20, -3430 }; static Vec3f D_80A7B6FC = { 0.0f, 0.0f, 0.0f }; static Vec3f D_80A7B708 = { 1600.0f, 0.0f, 0.0f }; + static Vec3f D_80A7B714 = { 0.0f, 0.0f, 0.0f }; + static Vec3f D_80A7B720 = { 1700.0f, 0.0f, 0.0f }; + static Vec3f D_80A7B72C = { 0.0f, 0.0f, 0.0f }; -static s16 D_80A7B738[] = { 128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 128, 0, 0, 0, 0 }; +static s16 D_80A7B738[] = { 128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 128 }; #ifdef NON_MATCHING void EnJso2_Init(Actor* thisx, PlayState* play) { @@ -329,254 +332,299 @@ 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; +void func_80A778F8(EnJso2* this, PlayState* play) { + Player* player = GET_PLAYER(play); + f32 curFrame = this->skelAnime.curFrame; + Vec3f spawnPos; + s32 i; + 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; + case 0: + if (this->actor.xzDistToPlayer < 400.0f) { + Audio_SetMainBgmVolume(0, 10); + this->unk1046++; + this->actor.gravity = 0.0f; + } + break; + + case 1: + if (CutsceneManager_IsNext(this->actor.csId) == 0) { + CutsceneManager_Queue(this->actor.csId); + } else { + f32 temp; + + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); + + this->unk1048 = CutsceneManager_GetCurrentSubCamId(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, 17); + + 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, 6); + func_80122744(play, &this->unk_27C, 1, &D_80A7B6F4); + + this->unk1046++; + 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.z = 780.0f; - temp = -586.0f; - this->unk1084.y = this->unk1078.y = temp + 500.0f;Math_Vec3f_Copy(&spawnPos, &this->unk1078); + 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); - 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); + + if (func_80122760(play, &this->unk_27C, 60.0f) != 0) { + func_800B7298(play, NULL, 19); + this->unk1044 = 10; + this->unk1046++; } - 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; + break; + + case 3: { + Vec3f unk1078Copy; + s32 i; + + 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, ACTOR_EN_COL_MAN, unk1078Copy.x, unk1078Copy.y, unk1078Copy.z, 0, + this->actor.world.rot.y, 0, 2); + } + this->unk1044 = 25; + this->unk1046++; + } + } break; + case 4: + if (this->unk1044 == 0) { + func_800B7298(play, NULL, 4); + this->unk1044 = 20; + this->unk1046++; + } + break; + case 5: + if (this->unk1044 == 0) { + this->unk1044 = 20; + 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); + 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 - 30.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++; + } + break; + + case 7: + if (this->unk1044 == 0) { + Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_LAUGH); + this->unk1044 = 0x2D; + this->unk1046++; + } + 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, 16); + + this->unk294 = 0.4f; + this->unk298 = 40.0f; + + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); + Math_Vec3f_Copy(&this->unk_2B8, &this->unk1054); + + this->unk1044 = 25; + this->unk1046++; + } + break; + + case 9: { + this->unk_38C++; + + if (this->unk_38C >= 20) { + this->unk_38C = 0; + } + if (this->unk_388 < 19) { + 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->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->actor.bgCheckFlags & 1) { + Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_ONGND); + this->actor.gravity = 0.0f; + this->actor.velocity.y = 0.0f; + this->actor.speed = 0.0f; + func_80A776E0(this, 15); + Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 0xA, + 4.0f, 500, 50, 1); + this->unk1044 = 1; + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + 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, NA_SE_EN_ANSATSUSYA_SWORD); + Actor_PlaySfx(&this->actor, NA_SE_EV_FLAME_IGNITION); + this->unk36C = 0; + Audio_SetMainBgmVolume(127, 0); + Audio_PlayBgm_StorePrevBgm(0x38); + } + if (this->unk1044 == 0) { + 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; + + 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 - void func_80A78588(EnJso2* this) { this->unk36C = 2; @@ -595,7 +643,7 @@ void func_80A785E4(EnJso2* this, PlayState* play) { switch (this->unk1046) { case 0: Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, - 0x1F4, 0xA, 1); + 500, 10, 1); Audio_SetMainBgmVolume(0, 10); Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_ENTRY); this->unk1046++; @@ -721,7 +769,7 @@ void func_80A78B04(EnJso2* this) { void func_80A78B70(EnJso2* this, PlayState* play) { this->actor.world.rot.x += 0x1770; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xFA0, (s16)0x14); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 4000, 20); if (!(this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 1)) { this->actor.world.rot.x = 0; this->actor.velocity.y = 0.0f; @@ -733,7 +781,7 @@ void func_80A78B70(EnJso2* this, PlayState* play) { } void func_80A78C08(EnJso2* this) { - this->unk28A = 0x28; + this->unk28A = 40; this->unkEF4.base.acFlags |= AC_HARD; this->actor.speed = 15.0f; this->actor.velocity.y = 13.0f; @@ -788,7 +836,7 @@ void func_80A78C7C(EnJso2* this, PlayState* play) { void func_80A78E8C(EnJso2* this) { func_80A776E0(this, 0); - this->unk28A = 0x14; + this->unk28A = 20; this->actor.speed = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 10.0f; @@ -815,7 +863,7 @@ void func_80A78F80(EnJso2* this, PlayState* play) { this->actor.velocity.y = 0.0f; this->actor.gravity = BREG(0x35) + -3.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_FALL); - this->unk284 = 0x10; + this->unk284 = 16; this->actionFunc = func_80A79038; } @@ -1227,7 +1275,7 @@ void func_80A7A124(EnJso2* this, PlayState* play) { } if ((this->unk1040 == 0x14) && (this->unk374 <= curFrame)) { - this->unk104A += 1; + this->unk104A++; if (this->unk104A >= 2) { this->unk104A = 0; func_80A776E0(this, 0x15); From c184e847f189c3c32db10c76fb6df134b7f3c48a Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 00:54:18 -0300 Subject: [PATCH 02/11] z_en_bsb IMPORT DATA --- spec | 3 +- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 160 +++++++++++++++------- 2 files changed, 112 insertions(+), 51 deletions(-) diff --git a/spec b/spec index a400ab4e6..43047f667 100644 --- a/spec +++ b/spec @@ -4714,8 +4714,7 @@ beginseg name "ovl_En_Bsb" compress include "build/src/overlays/actors/ovl_En_Bsb/z_en_bsb.o" - include "build/data/ovl_En_Bsb/ovl_En_Bsb.data.o" - include "build/data/ovl_En_Bsb/ovl_En_Bsb.reloc.o" + include "build/src/overlays/actors//ovl_En_Bsb/ovl_En_Bsb_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 29851665e..d91ee8181 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -6,6 +6,7 @@ #include "z_en_bsb.h" #include "objects/object_bsb/object_bsb.h" +#include "objects/gameplay_keep/gameplay_keep.h" #include "z64rumble.h" #include "z64shrink_window.h" @@ -63,47 +64,102 @@ void func_80C0F544(EnBsb* this, Vec3f* pos, Vec3f* unk_02, Vec3f* unk3, f32 unk4 void func_80C0F640(EnBsb* this, PlayState* play); void func_80C0F758(EnBsb* this, PlayState* play); -#if 0 -// static ColliderJntSphElementInit sJntSphElementsInit[7] = { -static ColliderJntSphElementInit D_80C0F8D4[7] = { +f32 D_80C0F8D0 = 0.0f; + +static ColliderJntSphElementInit sJntSphElementsInit[7] = { { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 10, { { 1000, 400, 0 }, 40 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x04, 0x08 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x04, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 9, { { 0, 700, 200 }, 35 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 6, { { 100, 600, 0 }, 35 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 3, { { 400, 200, 0 }, 40 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 13, { { 700, -100, 0 }, 35 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 16, { { 200, 300, 0 }, 30 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 19, { { 200, 300, 0 }, 30 }, 100 }, }, }; -// static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_80C0F9D0 = { - { COLTYPE_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - ARRAY_COUNT(sJntSphElementsInit), D_80C0F8D4, // sJntSphElementsInit, +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(sJntSphElementsInit), + sJntSphElementsInit, }; -// static DamageTable sDamageTable = { -static DamageTable D_80C0F9E0 = { +static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(0, 0x1), /* Deku Stick */ DMG_ENTRY(1, 0xD), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -150,26 +206,31 @@ ActorInit En_Bsb_InitVars = { /**/ EnBsb_Draw, }; -#endif +AnimationHeader* D_80C0FA20[0x19] = { + (AnimationHeader*)0x060086BC, (AnimationHeader*)0x0600CD88, (AnimationHeader*)0x06000400, + (AnimationHeader*)0x060065D8, (AnimationHeader*)0x06000FF0, (AnimationHeader*)0x06000C50, + (AnimationHeader*)0x06006C48, (AnimationHeader*)0x06001390, (AnimationHeader*)0x06002AF4, + (AnimationHeader*)0x06002590, (AnimationHeader*)0x06007120, (AnimationHeader*)0x060043A4, + (AnimationHeader*)0x06007B18, (AnimationHeader*)0x06001CD8, (AnimationHeader*)0x06003E1C, + (AnimationHeader*)0x06003238, (AnimationHeader*)0x0600606C, (AnimationHeader*)0x06005440, + (AnimationHeader*)0x06004E2C, (AnimationHeader*)0x06004894, (AnimationHeader*)0x06004208, + (AnimationHeader*)0x0600D3CC, (AnimationHeader*)0x06004510, (AnimationHeader*)0x06001F90, + (AnimationHeader*)0x0600C790, +}; -extern ColliderJntSphElementInit D_80C0F8D4[7]; -extern f32 D_80C0F8D0; -extern ColliderJntSphInit D_80C0F9D0; -extern DamageTable D_80C0F9E0; -extern Vec3f D_80C0FAA0; -extern Vec3f D_80C0FAAC; -extern Vec3s D_80C0FAB8; -extern Vec3s D_80C0FAC0; +u8 D_80C0FA84[0x1C] = { + 2, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, +}; -extern AnimationHeader D_06000C50[]; -extern UNK_TYPE D_06004894; -extern Mtx D_0406AB30; +Vec3f D_80C0FAA0 = { 0.0f, 8.0f, 0.0f }; -extern AnimationHeader* D_80C0FA20[]; -extern u8 D_80C0FA84[]; +Vec3f D_80C0FAAC = { 0.0f, -1.5f, 0.0f }; -extern AnimationHeader D_060086BC; -extern SkeletonHeader D_0600C3E0; +Vec3s D_80C0FAB8 = { 0x2EE0, -0x2710, 0xB5C8 }; + +Vec3s D_80C0FAC0 = { -0x2710, 0x2710, -0x2710 }; + +Vec3f D_80C0FAC8[2] = { { -80.0f, 475.0f, -2330.0f }, { 0.0f, 0.0f, 0.0f } }; void func_80C0B290(EnBsb* this, s32 animIndex) { this->unk_02D8 = animIndex; @@ -233,17 +294,18 @@ void EnBsb_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = 0xFF; if (this->actor.params & 0x8000) { - SkelAnime_Init(play, &this->skelAnime, &D_0600C3E0, (AnimationHeader*)&D_06004894, this->unk_0188, + SkelAnime_Init(play, &this->skelAnime, &object_bsb_Skel_00C3E0, &object_bsb_Anim_004894, this->unk_0188, this->unk_0206, 0x15); this->unk_02B0 = this->actor.params & 0xFF; func_80C0E3B8(this); return; } - this->actor.colChkInfo.damageTable = &D_80C0F9E0; + this->actor.colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); - SkelAnime_Init(play, &this->skelAnime, &D_0600C3E0, &D_060086BC, this->unk_0188, this->unk_0206, 0x15); + SkelAnime_Init(play, &this->skelAnime, &object_bsb_Skel_00C3E0, &object_bsb_Anim_0086BC, this->unk_0188, + this->unk_0206, 0x15); this->unk_02B6 = (this->actor.params >> 7) & 0x1F; this->unk_02B8 = this->actor.params & 0x7F; @@ -252,7 +314,7 @@ void EnBsb_Init(Actor* thisx, PlayState* play) { this->actor.hintId = 0x21; this->actor.gravity = -2.0f; - Collider_InitAndSetJntSph(play, &this->unk_0F34, &this->actor, &D_80C0F9D0, this->unk_0F54); + Collider_InitAndSetJntSph(play, &this->unk_0F34, &this->actor, &sJntSphInit, this->unk_0F54); if (this->unk_02B6 == 0x1F) { Actor_Kill(&this->actor); @@ -803,7 +865,7 @@ void func_80C0CDE4(EnBsb* this, PlayState* play) { void func_80C0CF4C(EnBsb* this) { this->actor.speed = 0.0f; this->unk_02A4 = 0; - Animation_Change(&this->skelAnime, &D_06000C50[0], -1.0f, this->skelAnime.curFrame - 1.0f, 0.0f, 2, 0.0f); + Animation_Change(&this->skelAnime, &object_bsb_Anim_000C50, -1.0f, this->skelAnime.curFrame - 1.0f, 0.0f, 2, 0.0f); this->unk_0294 = 0xA; Actor_PlaySfx(&this->actor, NA_SE_EN_KTIA_PAUSE_K); this->unk_02B4 = 7; @@ -1032,7 +1094,7 @@ void func_80C0D9B4(EnBsb* this, PlayState* play) { } void func_80C0DA58(EnBsb* this) { - this->unk_1118 = (this->unk_111C = 0); + this->unk_1118 = this->unk_111C = 0; this->actor.speed = 0.0f; this->unk_1120 = 0.0f; this->unk_02A4 = 0; @@ -1114,7 +1176,7 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { case 1: if ((Animation_OnFrame(&this->skelAnime, 7.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 15.0f) != 0)) { - Actor_PlaySfx(&this->actor, 0x3AA3); + Actor_PlaySfx(&this->actor, NA_SE_EN_KTIA_PAUSE_K); } Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_02EC), 1, @@ -1135,8 +1197,8 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, sp52, 1, 0x7D0, 0); if (ABS_ALT((s16)(this->actor.world.rot.y - sp52)) < 0x100) { - Actor_PlaySfx(&this->actor, 0x3AA4); - func_80C0B290(this, 0x15); + Actor_PlaySfx(&this->actor, NA_SE_EN_KITA_LAUGH_K); + func_80C0B290(this, 21); this->unk_1118++; Message_StartTextbox(play, 0x1541, &this->actor); } @@ -1156,10 +1218,10 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, sp52, 1, 0x7D0, 0); if (ABS_ALT((s16)(this->actor.world.rot.y - sp52)) < 0x100) { - Actor_PlaySfx(&this->actor, 0x386CU); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.velocity.y = 20.0f; this->actor.speed = 3.0f; - func_80C0B290(this, 0xB); + func_80C0B290(this, 11); this->unk_1118++; } break; @@ -1167,10 +1229,10 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { case 5: if (this->actor.world.pos.y < (this->actor.home.pos.y + 30.0f)) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, - this->actor.shape.shadowScale - 20.0f, 0x14, 8.0f, 0x3E8, 0x64, 1); + this->actor.shape.shadowScale - 20.0f, 0x14, 8.0f, 1000, 100, 1); this->actor.speed = 0.0f; - Actor_PlaySfx(&this->actor, 0x380DU); - Actor_RequestQuakeAndRumble(&this->actor, play, 4, 0xA); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_DOWN); + Actor_RequestQuakeAndRumble(&this->actor, play, 4, 10); this->unk_1118++; } break; @@ -1265,8 +1327,8 @@ void func_80C0E3B8(EnBsb* this) { this->actor.flags |= 0x08000000; this->actor.flags &= ~1; - Animation_Change(&this->skelAnime, &object_bsb_Anim_004894, 1.0f, D_80C0F8D0, Animation_GetLastFrame(&D_06004894), - 2, 0.0f); + Animation_Change(&this->skelAnime, &object_bsb_Anim_004894, 1.0f, D_80C0F8D0, + Animation_GetLastFrame(&object_bsb_Anim_004894), 2, 0.0f); SkelAnime_Update(&this->skelAnime); this->unk_02B4 = 0xF; @@ -1743,7 +1805,7 @@ void func_80C0F758(EnBsb* this, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255); - gSPDisplayList(POLY_OPA_DISP++, &D_0406AB30); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_06AB30); Matrix_Pop(); } From ddd85cf2853f81103c7684bf35f5441407b3b5e9 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 00:58:12 -0300 Subject: [PATCH 03/11] animations --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index d91ee8181..51aead43e 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -206,20 +206,18 @@ ActorInit En_Bsb_InitVars = { /**/ EnBsb_Draw, }; -AnimationHeader* D_80C0FA20[0x19] = { - (AnimationHeader*)0x060086BC, (AnimationHeader*)0x0600CD88, (AnimationHeader*)0x06000400, - (AnimationHeader*)0x060065D8, (AnimationHeader*)0x06000FF0, (AnimationHeader*)0x06000C50, - (AnimationHeader*)0x06006C48, (AnimationHeader*)0x06001390, (AnimationHeader*)0x06002AF4, - (AnimationHeader*)0x06002590, (AnimationHeader*)0x06007120, (AnimationHeader*)0x060043A4, - (AnimationHeader*)0x06007B18, (AnimationHeader*)0x06001CD8, (AnimationHeader*)0x06003E1C, - (AnimationHeader*)0x06003238, (AnimationHeader*)0x0600606C, (AnimationHeader*)0x06005440, - (AnimationHeader*)0x06004E2C, (AnimationHeader*)0x06004894, (AnimationHeader*)0x06004208, - (AnimationHeader*)0x0600D3CC, (AnimationHeader*)0x06004510, (AnimationHeader*)0x06001F90, - (AnimationHeader*)0x0600C790, +AnimationHeader* D_80C0FA20[] = { + &object_bsb_Anim_0086BC, &object_bsb_Anim_00CD88, &object_bsb_Anim_000400, &object_bsb_Anim_0065D8, + &object_bsb_Anim_000FF0, &object_bsb_Anim_000C50, &object_bsb_Anim_006C48, &object_bsb_Anim_001390, + &object_bsb_Anim_002AF4, &object_bsb_Anim_002590, &object_bsb_Anim_007120, &object_bsb_Anim_0043A4, + &object_bsb_Anim_007B18, &object_bsb_Anim_001CD8, &object_bsb_Anim_003E1C, &object_bsb_Anim_003238, + &object_bsb_Anim_00606C, &object_bsb_Anim_005440, &object_bsb_Anim_004E2C, &object_bsb_Anim_004894, + &object_bsb_Anim_004208, &object_bsb_Anim_00D3CC, &object_bsb_Anim_004510, &object_bsb_Anim_001F90, + &object_bsb_Anim_00C790, }; -u8 D_80C0FA84[0x1C] = { - 2, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, +u8 D_80C0FA84[] = { + 2, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, }; Vec3f D_80C0FAA0 = { 0.0f, 8.0f, 0.0f }; @@ -230,7 +228,7 @@ Vec3s D_80C0FAB8 = { 0x2EE0, -0x2710, 0xB5C8 }; Vec3s D_80C0FAC0 = { -0x2710, 0x2710, -0x2710 }; -Vec3f D_80C0FAC8[2] = { { -80.0f, 475.0f, -2330.0f }, { 0.0f, 0.0f, 0.0f } }; +Vec3f D_80C0FAC8[] = { { -80.0f, 475.0f, -2330.0f }, { 0.0f, 0.0f, 0.0f } }; void func_80C0B290(EnBsb* this, s32 animIndex) { this->unk_02D8 = animIndex; From b8e4e19ae471545e9a0d283ca140fb36bb5e0a2d Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 01:08:24 -0300 Subject: [PATCH 04/11] final revision --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 57 ++++++++++++----------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 51aead43e..3acf3d4aa 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -257,7 +257,7 @@ void func_80C0B31C(PlayState* play, EnBsb* this, Vec3f* pos) { sp9C.z = Rand_CenteredFloat(1.0f) * 0.5f; spA8.y += (Rand_ZeroOne() - 0.5f) * 15.0f; - EffectSsHahen_Spawn(play, &spCC, &spA8, &sp9C, 0, ((Rand_ZeroOne() * 5.0f) + 10.0f), -1, 0xA, NULL); + EffectSsHahen_Spawn(play, &spCC, &spA8, &sp9C, 0, ((Rand_ZeroOne() * 5.0f) + 10.0f), -1, 10, NULL); func_800BBFB0(play, &spCC, 20.0f, 1, 300, 10, 5); if (this->unk_02AE == 0) { @@ -289,11 +289,11 @@ void EnBsb_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.04f); this->unk_02CA = 0xFF; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; if (this->actor.params & 0x8000) { SkelAnime_Init(play, &this->skelAnime, &object_bsb_Skel_00C3E0, &object_bsb_Anim_004894, this->unk_0188, - this->unk_0206, 0x15); + this->unk_0206, 21); this->unk_02B0 = this->actor.params & 0xFF; func_80C0E3B8(this); return; @@ -303,7 +303,7 @@ void EnBsb_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); SkelAnime_Init(play, &this->skelAnime, &object_bsb_Skel_00C3E0, &object_bsb_Anim_0086BC, this->unk_0188, - this->unk_0206, 0x15); + this->unk_0206, 21); this->unk_02B6 = (this->actor.params >> 7) & 0x1F; this->unk_02B8 = this->actor.params & 0x7F; @@ -499,9 +499,10 @@ void func_80C0BFE8(EnBsb* this, PlayState* play) { } else { this->unk_0290 = 0; } + if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.lastPlayedSong == 0)) { play->msgCtx.ocarinaMode = 4; - func_800BC154(play, &play->actorCtx, &this->actor, 9U); + func_800BC154(play, &play->actorCtx, &this->actor, 9); func_80C0C0F4(this, play); } } @@ -702,7 +703,7 @@ void func_80C0C6A8(EnBsb* this, PlayState* play) { } if (this->unk_02D8 == 3) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 2000, 0); if ((Animation_OnFrame(&this->skelAnime, 7.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 15.0f) != 0)) { Actor_PlaySfx(&this->actor, NA_SE_EN_KTIA_PAUSE_K); } @@ -721,7 +722,7 @@ void func_80C0C86C(EnBsb* this) { this->unk_02DC = 1; this->actor.speed = 2.0f; func_80C0B290(this, 4); - this->unk_0294 = Rand_S16Offset(0, 0x1E); + this->unk_0294 = Rand_S16Offset(0, 30); WEEKEVENTREG(0x55) |= 0x40; this->unk_02B4 = 4; this->actionFunc = func_80C0C8EC; @@ -784,7 +785,7 @@ void func_80C0CB3C(EnBsb* this, PlayState* play) { if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f) && (this->actor.xzDistToPlayer < 70.0f) && (player->invincibilityTimer == 0)) { - func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 5.0f, 0x10U); + func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 5.0f, 16); } if (this->actor.bgCheckFlags & 1) { @@ -797,7 +798,7 @@ void func_80C0CB3C(EnBsb* this, PlayState* play) { } void func_80C0CCCC(EnBsb* this) { - func_80C0B290(this, 0x17); + func_80C0B290(this, 23); this->actionFunc = func_80C0CD04; } @@ -807,9 +808,9 @@ void func_80C0CD04(EnBsb* this, PlayState* play) { if ((this->unk_02D8 == 0x18) && (var_0 >= this->unk_02C4)) { this->actor.flags &= 0xF7FFFFFF; this->actor.gravity = -2.0f; - this->unk_0294 = 0xA; + this->unk_0294 = 10; func_80C0C86C(this); - } else if (this->unk_02D8 == 0x17) { + } else if (this->unk_02D8 == 23) { func_80C0B290(this, 0x18); } } @@ -903,7 +904,7 @@ void func_80C0D00C(EnBsb* this) { void func_80C0D10C(EnBsb* this, PlayState* play) { f32 curFrame = this->skelAnime.curFrame; - if (((this->unk_0324 == 0xB) || (this->unk_0324 == 0xA)) && (this->unk_0322 != 0)) { + if (((this->unk_0324 == 11) || (this->unk_0324 == 10)) && (this->unk_0322 != 0)) { Actor_SpawnIceEffects(play, &this->actor, this->unk_0330, 0x11, 2, this->unk_032C, 0.4f); this->unk_0322 = 0; this->unk_0324 = 0; @@ -913,7 +914,7 @@ void func_80C0D10C(EnBsb* this, PlayState* play) { func_80C0B31C(play, this, &this->unk_02F8); if (this->unk_02C4 <= curFrame) { - if ((this->actor.world.pos.z > -1300.0f) || ((s32)this->actor.colChkInfo.health < 0xA)) { + if ((this->actor.world.pos.z > -1300.0f) || (this->actor.colChkInfo.health < 10)) { func_80C0CA28(this, play); return; } @@ -922,11 +923,11 @@ void func_80C0D10C(EnBsb* this, PlayState* play) { } void func_80C0D214(EnBsb* this) { - this->unk_0294 = 0x28; + this->unk_0294 = 40; this->actor.speed = 0.0f; Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); - this->unk_02B4 = 0xA; + this->unk_02B4 = 10; this->actionFunc = func_80C0D27C; } @@ -938,7 +939,7 @@ void func_80C0D27C(EnBsb* this, PlayState* play) { } if (((this->unk_0324 == 0xB) || (this->unk_0324 == 0xA)) && (this->unk_0322 != 0)) { - Actor_SpawnIceEffects(play, &this->actor, this->unk_0330, 0x11, 2, this->unk_032C, 0.4f); + Actor_SpawnIceEffects(play, &this->actor, this->unk_0330, 17, 2, this->unk_032C, 0.4f); this->unk_0322 = 0; this->unk_0324 = 0; } @@ -952,7 +953,7 @@ void func_80C0D334(EnBsb* this) { this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_KITA_LAUGH_K); func_80C0B290(this, 6); - this->unk_02B4 = 0xB; + this->unk_02B4 = 11; this->actionFunc = func_80C0D384; } @@ -1159,7 +1160,7 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { switch (this->unk_1118) { case 0: - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp64), 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp64), 1, 2000, 0); Math_ApproachF(&this->actor.world.pos.x, sp64.x, 0.5f, fabsf(Math_SinS(this->actor.world.rot.y) * 3.2f)); Math_ApproachF(&this->actor.world.pos.z, sp64.z, 0.5f, fabsf(Math_CosS(this->actor.world.rot.y) * 3.2f)); if (sqrtf(SQ(this->actor.world.pos.x - sp64.x) + SQ(this->actor.world.pos.z - sp64.z)) < 3.0f) { @@ -1192,7 +1193,7 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { case 2: sp52 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_1128); - Math_SmoothStepToS(&this->actor.world.rot.y, sp52, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp52, 1, 2000, 0); if (ABS_ALT((s16)(this->actor.world.rot.y - sp52)) < 0x100) { Actor_PlaySfx(&this->actor, NA_SE_EN_KITA_LAUGH_K); @@ -1213,7 +1214,7 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { case 4: sp64.x = -100.0f; sp52 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp64); - Math_SmoothStepToS(&this->actor.world.rot.y, sp52, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp52, 1, 2000, 0); if (ABS_ALT((s16)(this->actor.world.rot.y - sp52)) < 0x100) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); @@ -1243,7 +1244,7 @@ void func_80C0DB18(EnBsb* this, PlayState* play) { sp64.x += Rand_CenteredFloat(40.0f); sp64.z += Rand_CenteredFloat(40.0f); Actor_SpawnFloorDustRing(play, &this->actor, &sp64, Rand_ZeroFloat(10.0f) + 5.0f, Rand_S16Offset(1, 3), - 4.0f, 0x3E8, 0x64, 1); + 4.0f, 1000, 100, 1); } Math_ApproachF(&this->actor.shape.yOffset, -7000.0f, 0.5f, 200.0f); @@ -1261,7 +1262,7 @@ void func_80C0E178(EnBsb* this) { this->unk_02AE = 0; this->unk_02A4 = 0; this->actor.flags &= ~1; - this->unk_02B4 = 0xE; + this->unk_02B4 = 14; this->actionFunc = func_80C0E1C0; this->actor.speed = 0.0f; } @@ -1329,7 +1330,7 @@ void func_80C0E3B8(EnBsb* this) { Animation_GetLastFrame(&object_bsb_Anim_004894), 2, 0.0f); SkelAnime_Update(&this->skelAnime); - this->unk_02B4 = 0xF; + this->unk_02B4 = 15; this->actionFunc = func_80C0E480; } @@ -1552,8 +1553,10 @@ void EnBsb_Update(Actor* thisx, PlayState* play) { (this->unk_02B0 == 0)) { SkelAnime_Update(&this->skelAnime); } + this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); + if (this->unk_02B0 == 0) { func_80C0E618(this, play); if ((func_80C0E9CC(this, play) == 0) && (this->unk_02B4 != 0xE)) { @@ -1582,8 +1585,10 @@ void EnBsb_Update(Actor* thisx, PlayState* play) { func_80C0B290(this, 0x13); } } - Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 60.0f, 40.0f, 0x1DU); + + Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 60.0f, 40.0f, 0x1D); func_80C0F640(this, play); + if (func_80C0E9CC(this, play) == 0) { if ((this->unk_02B4 != 9) && (this->unk_02B4 != 0xE) && (this->unk_02B4 != 0xF)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_0F34.base); @@ -1720,7 +1725,7 @@ void EnBsb_Draw(Actor* thisx, PlayState* play) { this->unk_032C = 0.8f; } - Actor_DrawDamageEffects(play, &this->actor, this->unk_0330, 0x11, this->unk_0328, this->unk_032C, sp3C, + Actor_DrawDamageEffects(play, &this->actor, this->unk_0330, 17, this->unk_0328, this->unk_032C, sp3C, this->unk_0324); } } else { @@ -1728,7 +1733,7 @@ void EnBsb_Draw(Actor* thisx, PlayState* play) { Scene_SetRenderModeXlu(play, 1, 2); gDPPipeSync(POLY_XLU_DISP++); - gDPSetEnvColor(POLY_XLU_DISP++, 0xFF, 0xFF, 0xFF, this->unk_02CA); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->unk_02CA); POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, func_80C0F078, NULL, &this->actor, POLY_XLU_DISP++); From c68b45e41bed375b66a929f51382ac54164ceae7 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 01:08:58 -0300 Subject: [PATCH 05/11] format --- assets/xml/misc/skyboxes.xml | 2 +- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 4 +-- src/overlays/actors/ovl_En_Jso2/z_en_jso2.c | 36 ++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/assets/xml/misc/skyboxes.xml b/assets/xml/misc/skyboxes.xml index cc2260f0f..3e82f084f 100644 --- a/assets/xml/misc/skyboxes.xml +++ b/assets/xml/misc/skyboxes.xml @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 3acf3d4aa..2dafbe5da 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -52,7 +52,7 @@ void func_80C0E1C0(EnBsb* this, PlayState* play); void func_80C0E480(EnBsb* this, PlayState* play); void func_80C0E4FC(EnBsb* this, PlayState* play); s32 func_80C0E9CC(EnBsb* this, PlayState* play); -void func_80C0B290(EnBsb* this, s32 arg0); +void func_80C0B290(EnBsb* this, s32 animIndex); void func_80C0B31C(PlayState* play, EnBsb* this, Vec3f* pos); s32 func_80C0B888(EnBsb* this, PlayState* play); void func_80C0C32C(EnBsb* this); @@ -60,7 +60,7 @@ void func_80C0C430(EnBsb* this); void func_80C0D00C(EnBsb* this); void func_80C0E3B8(EnBsb* this); void func_80C0E618(EnBsb* this, PlayState* play); -void func_80C0F544(EnBsb* this, Vec3f* pos, Vec3f* unk_02, Vec3f* unk3, f32 unk4, s16 unk5); +void func_80C0F544(EnBsb* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 arg0, s16 arg1); void func_80C0F640(EnBsb* this, PlayState* play); void func_80C0F758(EnBsb* this, PlayState* play); diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c index 01c0d8d9c..1a94e1726 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c @@ -17,7 +17,7 @@ void EnJso2_Init(Actor* thisx, PlayState* play); void EnJso2_Destroy(Actor* thisx, PlayState* play); void EnJso2_Update(Actor* thisx, PlayState* play); -void EnJso2_Draw(Actor* thisx, PlayState* play); +void EnJso2_Draw(Actor* thisx, PlayState* play2); void func_80A776E0(EnJso2* this, s32 animIndex); void func_80A778D8(EnJso2* this); @@ -211,44 +211,44 @@ void EnJso2_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetQuad(play, &this->unkF40, &this->actor, &D_80A7B634); Collider_InitAndSetQuad(play, &this->unkFC0, &this->actor, &D_80A7B634); - rightSwordBlureInit.p2EndColor[2] = rightSwordBlureInit.p1EndColor[0] = 0xFF; // 0x360 // t7 + rightSwordBlureInit.p2EndColor[2] = rightSwordBlureInit.p1EndColor[0] = 0xFF; // 0x360 // t7 - rightSwordBlureInit.p2EndColor[0] = 0xFF; // 0x364 // t9 + rightSwordBlureInit.p2EndColor[0] = 0xFF; // 0x364 // t9 - leftSwordBlureInit.p2EndColor[2] = leftSwordBlureInit.p1EndColor[0] = 0xFF; // 0x1c0 // t6 -> t7 + leftSwordBlureInit.p2EndColor[2] = leftSwordBlureInit.p1EndColor[0] = 0xFF; // 0x1c0 // t6 -> t7 - leftSwordBlureInit.p2EndColor[0] = 0xFF; // 0x1c4 // t8 + leftSwordBlureInit.p2EndColor[0] = 0xFF; // 0x1c4 // t8 rightSwordBlureInit.p2StartColor[3] = leftSwordBlureInit.p2StartColor[3] = 0x40; // 0x1bf // t9 - leftSwordBlureInit.elemDuration = 8; // 0x1c8 // t6 + leftSwordBlureInit.elemDuration = 8; // 0x1c8 // t6 - rightSwordBlureInit.p1StartColor[0] = 0xFF; // 0x358 // t0 + rightSwordBlureInit.p1StartColor[0] = 0xFF; // 0x358 // t0 - leftSwordBlureInit.p1StartColor[0] = 0xFF; // 0x1b8 + leftSwordBlureInit.p1StartColor[0] = 0xFF; // 0x1b8 - rightSwordBlureInit.p1StartColor[2] = rightSwordBlureInit.p1StartColor[1] = 0; // 0x359 // zero + rightSwordBlureInit.p1StartColor[2] = rightSwordBlureInit.p1StartColor[1] = 0; // 0x359 // zero - rightSwordBlureInit.p1StartColor[3] = 0x80; // 0x35b // t3 + rightSwordBlureInit.p1StartColor[3] = 0x80; // 0x35b // t3 - rightSwordBlureInit.p2StartColor[0] = 0xFF; // 0x35c // t4 + rightSwordBlureInit.p2StartColor[0] = 0xFF; // 0x35c // t4 rightSwordBlureInit.p1EndColor[3] = leftSwordBlureInit.p1EndColor[3] = rightSwordBlureInit.p2EndColor[3] = leftSwordBlureInit.p2EndColor[3] = rightSwordBlureInit.p2EndColor[1] = leftSwordBlureInit.p2EndColor[1] = rightSwordBlureInit.p1EndColor[2] = leftSwordBlureInit.p1EndColor[2] = rightSwordBlureInit.p1EndColor[1] = leftSwordBlureInit.p1EndColor[1] = rightSwordBlureInit.p2StartColor[2] = - rightSwordBlureInit.p2StartColor[1] = 0; // 0x35d // zero + rightSwordBlureInit.p2StartColor[1] = 0; // 0x35d // zero - rightSwordBlureInit.elemDuration = 8; // 0x368 // t7 + rightSwordBlureInit.elemDuration = 8; // 0x368 // t7 rightSwordBlureInit.unkFlag = leftSwordBlureInit.unkFlag = 0; // 0x1cc // zero - leftSwordBlureInit.calcMode = 2; // 0x1d0 - rightSwordBlureInit.calcMode = 2; // 0x370 + leftSwordBlureInit.calcMode = 2; // 0x1d0 + rightSwordBlureInit.calcMode = 2; // 0x370 - leftSwordBlureInit.p2StartColor[0] = 0xFF; // 0x1bc + leftSwordBlureInit.p2StartColor[0] = 0xFF; // 0x1bc - leftSwordBlureInit.p1StartColor[3] = 0x80; // 0x1bb + leftSwordBlureInit.p1StartColor[3] = 0x80; // 0x1bb leftSwordBlureInit.p2StartColor[2] = leftSwordBlureInit.p2StartColor[1] = leftSwordBlureInit.p1StartColor[2] = leftSwordBlureInit.p1StartColor[1] = 0; // 0x1b9 // zero @@ -1669,4 +1669,4 @@ void EnJso2_Draw(Actor* thisx, PlayState* play2) { } CLOSE_DISPS(play->state.gfxCtx); -} \ No newline at end of file +} From c55dbf2389dbacf05762d6f6123d195cd6763034 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 01:17:55 -0300 Subject: [PATCH 06/11] final revision --- src/overlays/actors/ovl_En_Jso2/z_en_jso2.c | 89 ++++++++++++--------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c index 1a94e1726..353458473 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c @@ -211,44 +211,44 @@ void EnJso2_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetQuad(play, &this->unkF40, &this->actor, &D_80A7B634); Collider_InitAndSetQuad(play, &this->unkFC0, &this->actor, &D_80A7B634); - rightSwordBlureInit.p2EndColor[2] = rightSwordBlureInit.p1EndColor[0] = 0xFF; // 0x360 // t7 + rightSwordBlureInit.p2EndColor[2] = rightSwordBlureInit.p1EndColor[0] = 0xFF; // 0x360 // t7 - rightSwordBlureInit.p2EndColor[0] = 0xFF; // 0x364 // t9 + rightSwordBlureInit.p2EndColor[0] = 0xFF; // 0x364 // t9 - leftSwordBlureInit.p2EndColor[2] = leftSwordBlureInit.p1EndColor[0] = 0xFF; // 0x1c0 // t6 -> t7 + leftSwordBlureInit.p2EndColor[2] = leftSwordBlureInit.p1EndColor[0] = 0xFF; // 0x1c0 // t6 -> t7 - leftSwordBlureInit.p2EndColor[0] = 0xFF; // 0x1c4 // t8 + leftSwordBlureInit.p2EndColor[0] = 0xFF; // 0x1c4 // t8 rightSwordBlureInit.p2StartColor[3] = leftSwordBlureInit.p2StartColor[3] = 0x40; // 0x1bf // t9 - leftSwordBlureInit.elemDuration = 8; // 0x1c8 // t6 + leftSwordBlureInit.elemDuration = 8; // 0x1c8 // t6 - rightSwordBlureInit.p1StartColor[0] = 0xFF; // 0x358 // t0 + rightSwordBlureInit.p1StartColor[0] = 0xFF; // 0x358 // t0 - leftSwordBlureInit.p1StartColor[0] = 0xFF; // 0x1b8 + leftSwordBlureInit.p1StartColor[0] = 0xFF; // 0x1b8 - rightSwordBlureInit.p1StartColor[2] = rightSwordBlureInit.p1StartColor[1] = 0; // 0x359 // zero + rightSwordBlureInit.p1StartColor[2] = rightSwordBlureInit.p1StartColor[1] = 0; // 0x359 // zero - rightSwordBlureInit.p1StartColor[3] = 0x80; // 0x35b // t3 + rightSwordBlureInit.p1StartColor[3] = 0x80; // 0x35b // t3 - rightSwordBlureInit.p2StartColor[0] = 0xFF; // 0x35c // t4 + rightSwordBlureInit.p2StartColor[0] = 0xFF; // 0x35c // t4 rightSwordBlureInit.p1EndColor[3] = leftSwordBlureInit.p1EndColor[3] = rightSwordBlureInit.p2EndColor[3] = leftSwordBlureInit.p2EndColor[3] = rightSwordBlureInit.p2EndColor[1] = leftSwordBlureInit.p2EndColor[1] = rightSwordBlureInit.p1EndColor[2] = leftSwordBlureInit.p1EndColor[2] = rightSwordBlureInit.p1EndColor[1] = leftSwordBlureInit.p1EndColor[1] = rightSwordBlureInit.p2StartColor[2] = - rightSwordBlureInit.p2StartColor[1] = 0; // 0x35d // zero + rightSwordBlureInit.p2StartColor[1] = 0; // 0x35d // zero - rightSwordBlureInit.elemDuration = 8; // 0x368 // t7 + rightSwordBlureInit.elemDuration = 8; // 0x368 // t7 rightSwordBlureInit.unkFlag = leftSwordBlureInit.unkFlag = 0; // 0x1cc // zero - leftSwordBlureInit.calcMode = 2; // 0x1d0 - rightSwordBlureInit.calcMode = 2; // 0x370 + leftSwordBlureInit.calcMode = 2; // 0x1d0 + rightSwordBlureInit.calcMode = 2; // 0x370 - leftSwordBlureInit.p2StartColor[0] = 0xFF; // 0x1bc + leftSwordBlureInit.p2StartColor[0] = 0xFF; // 0x1bc - leftSwordBlureInit.p1StartColor[3] = 0x80; // 0x1bb + leftSwordBlureInit.p1StartColor[3] = 0x80; // 0x1bb leftSwordBlureInit.p2StartColor[2] = leftSwordBlureInit.p2StartColor[1] = leftSwordBlureInit.p1StartColor[2] = leftSwordBlureInit.p1StartColor[1] = 0; // 0x1b9 // zero @@ -403,6 +403,7 @@ void func_80A778F8(EnJso2* this, PlayState* play) { break; } break; + case 2: this->actor.world.pos.x = -285.0f; this->actor.world.pos.y = 535.0f; @@ -446,6 +447,7 @@ void func_80A778F8(EnJso2* this, PlayState* play) { this->unk1046++; } } break; + case 4: if (this->unk1044 == 0) { func_800B7298(play, NULL, 4); @@ -453,12 +455,14 @@ void func_80A778F8(EnJso2* this, PlayState* play) { this->unk1046++; } break; + case 5: if (this->unk1044 == 0) { this->unk1044 = 20; this->unk1046++; } break; + case 6: this->unk1078.x = 82.0f; this->unk1078.y = -533.0f; @@ -594,6 +598,7 @@ void func_80A778F8(EnJso2* this, PlayState* play) { Audio_SetMainBgmVolume(127, 0); Audio_PlayBgm_StorePrevBgm(0x38); } + if (this->unk1044 == 0) { this->unk1078.x = this->unk_2B8.x - 470.0f; this->unk1078.y = this->unk_2B8.y - 10.0f; @@ -652,7 +657,7 @@ void func_80A785E4(EnJso2* this, PlayState* play) { case 1: if (Animation_OnFrame(&this->skelAnime, 18.0f) != 0) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, - 8.0f, 0x1F4, 0xA, 1); + 8.0f, 500, 10, 1); } Math_ApproachF(&this->actor.shape.shadowScale, 17.0f, 0.4f, 4.0f); @@ -881,8 +886,8 @@ void func_80A79038(EnJso2* this, PlayState* play) { void func_80A790E4(EnJso2* this, PlayState* play) { func_80A776E0(this, 1); - Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 0x1F4, - 0xA, 1); + Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, + 10, 1); Math_ApproachZeroF(&this->actor.speed, 0.3f, 3.0f); this->unk371 = 0; Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_SWING_HARD); @@ -897,7 +902,7 @@ void func_80A7919C(EnJso2* this, PlayState* play) { Math_ApproachZeroF(&this->actor.speed, 0.5f, 5.0f); - if (!(play->gameplayFrames & 7)) { + if (!(play->gameplayFrames % 8)) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, 10, 1); } @@ -936,8 +941,8 @@ void func_80A79300(EnJso2* this) { void func_80A79364(EnJso2* this, PlayState* play) { this->actor.shape.rot.y -= 0x1770; - Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 4.0f, 0x12C, - 5, 1); + Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 4.0f, 300, 5, + 1); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 4000, 20); if ((this->unk28E == 0) || ((this->unkF40.base.atFlags & AT_HIT) != 0) || @@ -1029,7 +1034,7 @@ void func_80A796BC(EnJso2* this, PlayState* play) { Matrix_MultVecZ(-20.0f, &vec); Math_Vec3f_Copy(&this->unkE58, &vec); - if (((this->unk2A2 == 0xB) || (this->unk2A2 == 0xA)) && (this->unk2A0 != 0)) { + if (((this->unk2A2 == 11) || (this->unk2A2 == 10)) && (this->unk2A0 != 0)) { Actor_SpawnIceEffects(play, &this->actor, this->unk2D4, 0xC, 2, 0.7f, 0.4f); this->unk2A0 = 0; this->unk2A2 = 0; @@ -1108,7 +1113,7 @@ void func_80A7998C(EnJso2* this, PlayState* play) { } void func_80A79A84(EnJso2* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xFA0, 0x14); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 4000, 20); if ((this->unk2A2 == 0xB) || (this->unk2A2 == 0xA)) { if (this->unk2A0 != 0) { @@ -1260,7 +1265,7 @@ void func_80A7A0D0(EnJso2* this) { this->unk1044 = 0; Audio_SetMainBgmVolume(0, 10); func_80A776E0(this, 19); - this->unk284 = 0xE; + this->unk284 = 14; this->actionFunc = func_80A7A124; } @@ -1269,16 +1274,16 @@ void func_80A7A124(EnJso2* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xFA0, 0x14); - if ((this->unk1040 == 0x13) && (this->unk374 <= curFrame)) { + if ((this->unk1040 == 19) && (this->unk374 <= curFrame)) { this->unk104A = 0; func_80A776E0(this, 20); } - if ((this->unk1040 == 0x14) && (this->unk374 <= curFrame)) { + if ((this->unk1040 == 20) && (this->unk374 <= curFrame)) { this->unk104A++; if (this->unk104A >= 2) { this->unk104A = 0; - func_80A776E0(this, 0x15); + func_80A776E0(this, 21); } } @@ -1286,7 +1291,7 @@ void func_80A7A124(EnJso2* this, PlayState* play) { if (this->unk2D0 == NULL) { this->unk2D0 = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_COL_MAN, this->unk2C4.x, this->unk2C4.y, this->unk2C4.z, 0, 0, 0, 4); - } else if (this->unk104A >= 0xA) { + } else if (this->unk104A >= 10) { if (this->unk2D0 != NULL) { this->unk2D0->world.rot.z = 1; this->unk2B4 = 1; @@ -1317,7 +1322,7 @@ void func_80A7A2EC(EnJso2* this, PlayState* play) { void func_80A7A360(EnJso2* this, PlayState* play) { s32 var_a3 = false; - if ((this->unk284 != 0xB) && (this->unk284 != 0xC) && (this->unk284 != 0xD) && (this->unk284 != 0xE) && + if ((this->unk284 != 11) && (this->unk284 != 12) && (this->unk284 != 13) && (this->unk284 != 14) && this->unkEF4.base.acFlags & AT_HIT) { this->unkEF4.base.acFlags &= ~(AT_HIT); if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 5)) { @@ -1353,7 +1358,7 @@ void func_80A7A360(EnJso2* this, PlayState* play) { break; case 4: - if (((this->unk2A2 != 0xB) && (this->unk2A2 != 0xA)) || (this->unk2A0 == 0)) { + if (((this->unk2A2 != 11) && (this->unk2A2 != 10)) || (this->unk2A0 == 0)) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); this->unk2A0 = 20; @@ -1417,21 +1422,23 @@ void EnJso2_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_SetFocus(&this->actor, 80.0f); Actor_MoveWithGravity(&this->actor); + if (this->actor.bgCheckFlags & 1) { this->actor.world.pos.x += this->unkE58.x; this->actor.world.pos.z += this->unkE58.z; Math_ApproachZeroF(&this->unkE58.x, 1.0f, 2.0f); Math_ApproachZeroF(&this->unkE58.z, 1.0f, 2.0f); } + Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); - if ((this->unk284 == 5) || (this->unk284 == 6) || (this->unk284 == 0xF) || (this->unk284 == 0x10)) { + if ((this->unk284 == 5) || (this->unk284 == 6) || (this->unk284 == 15) || (this->unk284 == 16)) { this->unk_38C++; - if (this->unk_38C >= 0x14) { + if (this->unk_38C >= 20) { this->unk_38C = 0; } - if (this->unk_388 < 0x13) { + if (this->unk_388 < 19) { this->unk_388++; } Math_Vec3f_Copy(&this->unk_390[this->unk_38C], &this->actor.world.pos); @@ -1445,6 +1452,7 @@ void EnJso2_Update(Actor* thisx, PlayState* play) { } else if (this->unk284 != 0) { this->unk_388 = 0; } + if ((this->unk284 != 3) && (this->unk284 != 5) && (this->unk284 != 0xB) && (this->unk284 != 8) && (this->unk284 != 0xF) && (this->unk284 != 0xC)) { this->actor.shape.rot.y = this->actor.world.rot.y; @@ -1461,7 +1469,7 @@ void EnJso2_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->unkEF4.base); } } - if (((this->unk284 == 7) || (this->unk284 == 0x10) || (this->unk284 == 6) || (this->unk284 == 8)) && + if (((this->unk284 == 7) || (this->unk284 == 16) || (this->unk284 == 6) || (this->unk284 == 8)) && (this->unk371 == 0) && (this->unk36C == 0)) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->unkF40.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->unkFC0.base); @@ -1472,7 +1480,7 @@ s32 func_80A7AA48(PlayState* play, s32 arg1, Gfx** dList, Vec3f* pos, Vec3s* rot EnJso2* this = THIS; if (this->unk36C == 2) { - if ((arg1 == 4) && (this->unk284 != 0xE)) { + if ((arg1 == 4) && (this->unk284 != 14)) { *dList = NULL; } if (arg1 == 6) { @@ -1509,7 +1517,7 @@ void func_80A7AA9C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto Matrix_MultVec3f(&D_80A7B570, &this->unk_E64[2]); } - if (((this->unk284 == 7) || (this->unk284 == 8) || (this->unk284 == 6) || (this->unk284 == 0x10)) && + if (((this->unk284 == 7) || (this->unk284 == 8) || (this->unk284 == 6) || (this->unk284 == 16)) && (this->unk368 == 0)) { EffectBlure_AddVertex(Effect_GetByIndex(this->unk384), &sp68, &sp5C); } else if (this->unk368 == 1) { @@ -1554,9 +1562,9 @@ void func_80A7AA9C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto Matrix_MultVec3f(&sp50, &this->unk2C4); } - if ((this->unk284 != 0xE) && ((limbIndex == 4) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 8) || - (limbIndex == 9) || (limbIndex == 10) || (limbIndex == 11) || (limbIndex == 12) || - (limbIndex == 14) || (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 19))) { + if ((this->unk284 != 14) && ((limbIndex == 4) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 8) || + (limbIndex == 9) || (limbIndex == 10) || (limbIndex == 11) || (limbIndex == 12) || + (limbIndex == 14) || (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 19))) { Matrix_MultZero(&this->unk2D4[this->unk364]); @@ -1568,6 +1576,7 @@ void func_80A7AA9C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto if (limbIndex == 12) { Matrix_Push(); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); + OPEN_DISPS(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); From 27fd4a8d37cfa9f117c1ba0ee315b9d67a4a13a6 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 01:44:37 -0300 Subject: [PATCH 07/11] fix spec --- spec | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/spec b/spec index 43047f667..9fa5e2b28 100644 --- a/spec +++ b/spec @@ -1538,7 +1538,7 @@ beginseg name "ovl_Obj_Mure2" compress include "build/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.o" - include "build/data/ovl_Obj_Mure2/ovl_Obj_Mure2.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Mure2/ovl_Obj_Mure2_reloc.o" endseg beginseg @@ -2308,7 +2308,7 @@ beginseg name "ovl_Boss_05" compress include "build/src/overlays/actors/ovl_Boss_05/z_boss_05.o" - include "build/data/ovl_Boss_05/ovl_Boss_05.reloc.o" + include "build/src/overlays/actors/ovl_Boss_05/ovl_Boss_05_reloc.o" endseg beginseg @@ -2326,7 +2326,7 @@ beginseg name "ovl_Boss_07" compress include "build/src/overlays/actors/ovl_Boss_07/z_boss_07.o" - include "build/data/ovl_Boss_07/ovl_Boss_07.reloc.o" + include "build/src/overlays/actors/ovl_Boss_07/ovl_Boss_07_reloc.o" endseg beginseg @@ -2851,8 +2851,11 @@ beginseg name "ovl_En_Jso2" compress include "build/src/overlays/actors/ovl_En_Jso2/z_en_jso2.o" - //include "build/data/ovl_En_Jso2/ovl_En_Jso2.data.o" + #ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_En_Jso2/ovl_En_Jso2_reloc.o" + #else include "build/data/ovl_En_Jso2/ovl_En_Jso2.reloc.o" + #endif endseg beginseg @@ -3398,7 +3401,11 @@ beginseg name "ovl_En_Wdhand" compress include "build/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.o" + #ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_En_Wdhand/ovl_En_Wdhand_reloc.o" + #else include "build/data/ovl_En_Wdhand/ovl_En_Wdhand.reloc.o" + #endif endseg beginseg From c6f9cd72e04b9d0531e92e16bffee15b53bee815 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 05:37:06 -0300 Subject: [PATCH 08/11] curFrame --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 2dafbe5da..a68448e31 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -958,9 +958,9 @@ void func_80C0D334(EnBsb* this) { } void func_80C0D384(EnBsb* this, PlayState* play) { - f32 var_v0 = this->skelAnime.curFrame; + f32 curFrame = this->skelAnime.curFrame; - if (this->unk_02C4 <= var_v0) { + if (this->unk_02C4 <= curFrame) { func_80C0C86C(this); } } From e41140c9ea59c6d2f34158561ba5b52279c61f0c Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 05:42:11 -0300 Subject: [PATCH 09/11] move var to scope --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index a68448e31..4f4668b32 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -967,25 +967,22 @@ void func_80C0D384(EnBsb* this, PlayState* play) { void func_80C0D3C0(EnBsb* this, PlayState* play) { Player* player = GET_PLAYER(play); - void* sp2C; Audio_RestorePrevBgm(); + this->unk_02A4 = 0; this->unk_02A8 = 0; this->unk_02AC = 0x4000; this->actor.speed = 0.0f; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->unk_1128.x = this->unk_1140.x = (Math_SinS(this->actor.yawTowardsPlayer) * 300.0f) + this->unk_02E0.x; - this->unk_1128.y = this->unk_1140.y = this->unk_02E0.y - 30.0f; - this->unk_1128.z = this->unk_1140.z = (Math_CosS(this->actor.yawTowardsPlayer) * 300.0f) + this->unk_02E0.z; this->unk_1134.x = this->unk_114C.x = (Math_SinS(this->actor.yawTowardsPlayer) * 10.0f) + this->unk_02E0.x; - this->unk_1134.y = this->unk_114C.y = this->unk_02E0.y - 10.0f; - this->unk_1134.z = this->unk_114C.z = Math_CosS(this->actor.yawTowardsPlayer) * 10.0f + this->unk_02E0.z; this->unk_1124 = 60.0f; @@ -1268,9 +1265,8 @@ void func_80C0E178(EnBsb* this) { } void func_80C0E1C0(EnBsb* this, PlayState* play) { - EnBsb* newActor; - f32 curFrame = this->skelAnime.curFrame; s32 i; + f32 curFrame = this->skelAnime.curFrame; if (this->unk_02D8 == 16) { if (Animation_OnFrame(&this->skelAnime, 30.0f) != 0) { @@ -1286,6 +1282,7 @@ void func_80C0E1C0(EnBsb* this, PlayState* play) { if (this->unk_02A4 == 0) { if (WEEKEVENTREG(0x17) & 4) { + EnBsb* newActor; //! FAKE: if (1) {} From a2a8cbac9c7cf5da7b3af65cccc90b796594da1b Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 05:45:03 -0300 Subject: [PATCH 10/11] dec --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h index b610a3909..441abc299 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h @@ -62,7 +62,7 @@ typedef struct EnBsb { /* 0x0330 */ Vec3f unk_0330[17]; /* 0x03FC */ s32 unk_03FC[17]; /* 0x0440 */ s16 unk_0440; - /* 0x0444 */ EnBsbUnkStruct unk_0444[0x32]; + /* 0x0444 */ EnBsbUnkStruct unk_0444[50]; /* 0x0F34 */ ColliderJntSph unk_0F34; /* 0x0F54 */ ColliderJntSphElement unk_0F54[7]; /* 0x1114 */ u32 unk_1114; From 4ed5a97f43e20f64a465ce640a66bae647b55cec Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sat, 4 Nov 2023 05:50:57 -0300 Subject: [PATCH 11/11] unnecessary parenthesis --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 4f4668b32..eb688824c 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -1271,7 +1271,7 @@ void func_80C0E1C0(EnBsb* this, PlayState* play) { if (this->unk_02D8 == 16) { if (Animation_OnFrame(&this->skelAnime, 30.0f) != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_KITA_SALUTE); - } else if ((curFrame < 30.0f) && (((play->csCtx.curFrame == 472)) || (play->csCtx.curFrame == 487))) { + } else if ((curFrame < 30.0f) && ((play->csCtx.curFrame == 472) || (play->csCtx.curFrame == 487))) { Actor_PlaySfx(&this->actor, NA_SE_EN_KTIA_WALK); } }