1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-02 22:14:33 +00:00

Fix misc 8 (#1150)

* Use `s32` as type instead of `StackStatus` enum type

* `bossLimbDl` -> `bossLimbDL`

* Fixup comment refering to `Actor.velocity` by struct offset

* Fixup `feetFloorFlags` doc and -> `feetFloorFlag`

* Fixup `xyzDistToPlayerSq` comment

* Make `SkelAnime.mode` comment refer to `AnimationMode` (<- `AnimationModes`)

* Use enum names to refer to anim modes and break long lines in z64animation.h

* `EnDha_OverridePostDraw` -> `EnDha_PostLimbDraw`

* ichains cleanup

* Scene command ids usage cleanup

* Properly name unkXXX members as unk_XXX

* change `gSceneCmdHandlers` length in variables.h too

* Revert Unknown flags to unk0 & unk1

* Remove "current scene" mention from `Flags_*Unknown` as they aren't saved or loaded so not scene-specific

* `Struct_8011FAF0`: unk_00, unk_04

* Run formatter

* Do not break long lines in headers

* Revert "Fixup `feetFloorFlags` doc and -> `feetFloorFlag`"

This reverts commit c45b3611e7.
This commit is contained in:
Dragorn421 2022-03-16 22:14:56 +01:00 committed by GitHub
parent 93096a45b6
commit b2a3fb2f7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 328 additions and 327 deletions

View file

@ -97,10 +97,10 @@ void EnBa_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
this->actor.world.pos.y = this->actor.home.pos.y + 100.0f;
for (i = 13; i >= 0; i--) {
this->unk200[i] = sp38;
this->unk2A8[i].x = -0x4000;
this->unk158[i] = this->actor.world.pos;
this->unk158[i].y = this->actor.world.pos.y - (i + 1) * 32.0f;
this->unk_200[i] = sp38;
this->unk_2A8[i].x = -0x4000;
this->unk_158[i] = this->actor.world.pos;
this->unk_158[i].y = this->actor.world.pos.y - (i + 1) * 32.0f;
}
this->actor.targetMode = 4;
@ -131,8 +131,8 @@ void EnBa_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnBa_SetupIdle(EnBa* this) {
this->unk14C = 2;
this->unk31C = 1500;
this->unk_14C = 2;
this->unk_31C = 1500;
this->actor.speedXZ = 10.0f;
EnBa_SetupAction(this, EnBa_Idle);
}
@ -149,41 +149,41 @@ void EnBa_Idle(EnBa* this, GlobalContext* globalCtx) {
this->actor.flags |= ACTOR_FLAG_0;
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 100.0f, 1.0f, 10.0f, 0.0f);
}
this->unk2FC = this->actor.world.pos;
this->unk_2FC = this->actor.world.pos;
if (globalCtx->gameplayFrames % 16 == 0) {
this->unk308.z += Rand_CenteredFloat(180.0f);
this->unk314 += Rand_CenteredFloat(180.0f);
this->unk308.x = Math_SinF(this->unk308.z) * 80.0f;
this->unk308.y = Math_CosF(this->unk314) * 80.0f;
this->unk_308.z += Rand_CenteredFloat(180.0f);
this->unk_314 += Rand_CenteredFloat(180.0f);
this->unk_308.x = Math_SinF(this->unk_308.z) * 80.0f;
this->unk_308.y = Math_CosF(this->unk_314) * 80.0f;
}
this->unk2FC.y -= 448.0f;
this->unk2FC.x += this->unk308.x;
this->unk2FC.z += this->unk308.y;
func_80033AEC(&this->unk2FC, &this->unk158[13], 1.0f, this->actor.speedXZ, 0.0f, 0.0f);
this->unk_2FC.y -= 448.0f;
this->unk_2FC.x += this->unk_308.x;
this->unk_2FC.z += this->unk_308.y;
func_80033AEC(&this->unk_2FC, &this->unk_158[13], 1.0f, this->actor.speedXZ, 0.0f, 0.0f);
for (i = 12; i >= 0; i--) {
func_80035844(&this->unk158[i + 1], &this->unk158[i], &sp5C, 0);
Matrix_Translate(this->unk158[i + 1].x, this->unk158[i + 1].y, this->unk158[i + 1].z, MTXMODE_NEW);
func_80035844(&this->unk_158[i + 1], &this->unk_158[i], &sp5C, 0);
Matrix_Translate(this->unk_158[i + 1].x, this->unk_158[i + 1].y, this->unk_158[i + 1].z, MTXMODE_NEW);
Matrix_RotateZYX(sp5C.x, sp5C.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i]);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i]);
}
func_80035844(&this->unk158[0], &this->unk2FC, &sp5C, 0);
func_80035844(&this->unk_158[0], &this->unk_2FC, &sp5C, 0);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk2A8[0].y, 3, this->unk31C, 182);
Math_SmoothStepToS(&this->actor.shape.rot.x, this->unk2A8[0].x, 3, this->unk31C, 182);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_2A8[0].y, 3, this->unk_31C, 182);
Math_SmoothStepToS(&this->actor.shape.rot.x, this->unk_2A8[0].x, 3, this->unk_31C, 182);
Matrix_RotateZYX(this->actor.shape.rot.x - 0x8000, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[0]);
this->unk2A8[13].y = sp5C.y;
this->unk2A8[13].x = sp5C.x + 0x8000;
Matrix_MultVec3f(&D_809B8080, &this->unk_158[0]);
this->unk_2A8[13].y = sp5C.y;
this->unk_2A8[13].x = sp5C.x + 0x8000;
for (i = 0; i < 13; i++) {
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Math_SmoothStepToS(&this->unk2A8[i].y, this->unk2A8[i + 1].y, 3, this->unk31C, 182);
Math_SmoothStepToS(&this->unk2A8[i].x, this->unk2A8[i + 1].x, 3, this->unk31C, 182);
Matrix_RotateZYX(this->unk2A8[i].x - 0x8000, this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i + 1]);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Math_SmoothStepToS(&this->unk_2A8[i].y, this->unk_2A8[i + 1].y, 3, this->unk_31C, 182);
Math_SmoothStepToS(&this->unk_2A8[i].x, this->unk_2A8[i + 1].x, 3, this->unk_31C, 182);
Matrix_RotateZYX(this->unk_2A8[i].x - 0x8000, this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i + 1]);
}
this->unk2A8[13].x = this->unk2A8[12].x;
this->unk2A8[13].y = this->unk2A8[12].y;
this->unk_2A8[13].x = this->unk_2A8[12].x;
this->unk_2A8[13].y = this->unk_2A8[12].y;
if (!(player->stateFlags1 & PLAYER_STATE1_26) && (this->actor.xzDistToPlayer <= 175.0f) &&
(this->actor.world.pos.y == this->actor.home.pos.y + 100.0f)) {
EnBa_SetupSwingAtPlayer(this);
@ -191,10 +191,10 @@ void EnBa_Idle(EnBa* this, GlobalContext* globalCtx) {
}
void EnBa_SetupFallAsBlob(EnBa* this) {
this->unk14C = 0;
this->unk_14C = 0;
this->actor.speedXZ = Rand_CenteredFloat(8.0f);
this->actor.world.rot.y = Rand_CenteredFloat(65535.0f);
this->unk318 = 20;
this->unk_318 = 20;
this->actor.gravity = -2.0f;
EnBa_SetupAction(this, EnBa_FallAsBlob);
}
@ -207,8 +207,8 @@ void EnBa_FallAsBlob(EnBa* this, GlobalContext* globalCtx) {
this->actor.scale.y -= 0.001f;
this->actor.scale.x += 0.0005f;
this->actor.scale.z += 0.0005f;
this->unk318--;
if (this->unk318 == 0) {
this->unk_318--;
if (this->unk_318 == 0) {
Actor_Kill(&this->actor);
}
} else {
@ -219,10 +219,10 @@ void EnBa_FallAsBlob(EnBa* this, GlobalContext* globalCtx) {
}
void EnBa_SetupSwingAtPlayer(EnBa* this) {
this->unk14C = 3;
this->unk318 = 20;
this->unk31A = 0;
this->unk31C = 1500;
this->unk_14C = 3;
this->unk_318 = 20;
this->unk_31A = 0;
this->unk_31C = 1500;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.speedXZ = 20.0f;
EnBa_SetupAction(this, EnBa_SwingAtPlayer);
@ -236,71 +236,71 @@ void EnBa_SwingAtPlayer(EnBa* this, GlobalContext* globalCtx) {
s16 phi_fp;
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 1.0f, 10.0f, 0.0f);
if ((this->actor.xzDistToPlayer <= 175.0f) || (this->unk31A != 0)) {
if (this->unk318 == 20) {
if ((this->actor.xzDistToPlayer <= 175.0f) || (this->unk_31A != 0)) {
if (this->unk_318 == 20) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BALINADE_HAND_UP);
this->unk31C = 1500;
this->unk_31C = 1500;
}
if (this->unk318 != 0) {
this->unk31A = 10;
this->unk318--;
if (this->unk318 >= 11) {
this->unk2FC = player->actor.world.pos;
this->unk2FC.y += 30.0f;
if (this->unk_318 != 0) {
this->unk_31A = 10;
this->unk_318--;
if (this->unk_318 >= 11) {
this->unk_2FC = player->actor.world.pos;
this->unk_2FC.y += 30.0f;
phi_fp = this->actor.yawTowardsPlayer;
} else {
phi_fp = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk2FC);
phi_fp = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2FC);
}
Math_SmoothStepToS(&this->unk31C, 1500, 1, 30, 0);
func_80035844(&this->actor.world.pos, &this->unk158[0], &sp58, 0);
Math_SmoothStepToS(&this->actor.shape.rot.y, sp58.y, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, (sp58.x + 0x8000), 1, this->unk31C, 0);
Math_SmoothStepToS(&this->unk_31C, 1500, 1, 30, 0);
func_80035844(&this->actor.world.pos, &this->unk_158[0], &sp58, 0);
Math_SmoothStepToS(&this->actor.shape.rot.y, sp58.y, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, (sp58.x + 0x8000), 1, this->unk_31C, 0);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Matrix_RotateZYX((this->actor.shape.rot.x - 0x8000), this->actor.shape.rot.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[0]);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[0]);
for (i = 0; i < 13; i++) {
Math_SmoothStepToS(&this->unk2A8[i].x, (i * 1200) - 0x4000, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->unk2A8[i].y, phi_fp, 1, this->unk31C, 0);
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Matrix_RotateZYX((this->unk2A8[i].x - 0x8000), this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i + 1]);
Math_SmoothStepToS(&this->unk_2A8[i].x, (i * 1200) - 0x4000, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->unk_2A8[i].y, phi_fp, 1, this->unk_31C, 0);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Matrix_RotateZYX((this->unk_2A8[i].x - 0x8000), this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i + 1]);
}
} else {
if (this->unk31A == 10) {
if (this->unk_31A == 10) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BALINADE_HAND_DOWN);
}
if (this->unk31A != 0) {
this->unk31C = 8000;
if (this->unk_31A != 0) {
this->unk_31C = 8000;
this->actor.speedXZ = 30.0f;
phi_fp = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk2FC);
temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, phi_fp, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, temp, 1, this->unk31C, 0);
phi_fp = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2FC);
temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, phi_fp, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, temp, 1, this->unk_31C, 0);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
MTXMODE_NEW);
Matrix_RotateZYX(this->actor.shape.rot.x - 0x8000, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, this->unk158);
Matrix_MultVec3f(&D_809B8080, this->unk_158);
for (i = 0; i < 13; i++) {
temp = -Math_CosS(this->unk31A * 0xCCC) * (i * 1200);
Math_SmoothStepToS(&this->unk2A8[i].x, temp - 0x4000, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->unk2A8[i].y, phi_fp, 1, this->unk31C, 0);
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk2A8[i].x - 0x8000, this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i + 1]);
temp = -Math_CosS(this->unk_31A * 0xCCC) * (i * 1200);
Math_SmoothStepToS(&this->unk_2A8[i].x, temp - 0x4000, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->unk_2A8[i].y, phi_fp, 1, this->unk_31C, 0);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk_2A8[i].x - 0x8000, this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i + 1]);
}
this->unk31A--;
this->unk_31A--;
} else if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & PLAYER_STATE1_26)) {
EnBa_SetupIdle(this);
} else {
EnBa_SetupSwingAtPlayer(this);
this->unk318 = 27;
this->unk31C = 750;
this->unk_318 = 27;
this->unk_31C = 750;
}
}
this->unk2A8[13].x = this->unk2A8[12].x;
this->unk2A8[13].y = this->unk2A8[12].y;
this->unk_2A8[13].x = this->unk_2A8[12].x;
this->unk_2A8[13].y = this->unk_2A8[12].y;
if (this->collider.base.atFlags & 2) {
this->collider.base.atFlags &= ~2;
if (this->collider.base.at == &player->actor) {
@ -314,15 +314,15 @@ void EnBa_SwingAtPlayer(EnBa* this, GlobalContext* globalCtx) {
EnBa_SetupIdle(this);
} else {
EnBa_SetupSwingAtPlayer(this);
this->unk318 = 27;
this->unk31C = 750;
this->unk_318 = 27;
this->unk_31C = 750;
}
}
void func_809B7174(EnBa* this) {
this->unk14C = 1;
this->unk31C = 1500;
this->unk318 = 20;
this->unk_14C = 1;
this->unk_31C = 1500;
this->unk_318 = 20;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.speedXZ = 10.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BALINADE_HAND_DAMAGE);
@ -335,43 +335,43 @@ void EnBa_RecoilFromDamage(EnBa* this, GlobalContext* globalCtx) {
Vec3s sp6C;
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 330.0f, 1.0f, 30.0f, 0.0f);
this->unk2FC = this->actor.world.pos;
this->unk_2FC = this->actor.world.pos;
if (globalCtx->gameplayFrames % 16 == 0) {
this->unk308.z += Rand_CenteredFloat(180.0f);
this->unk314 += Rand_CenteredFloat(180.0f);
this->unk308.x = Math_SinF(this->unk308.z) * 80.0f;
this->unk308.y = Math_CosF(this->unk314) * 80.0f;
this->unk_308.z += Rand_CenteredFloat(180.0f);
this->unk_314 += Rand_CenteredFloat(180.0f);
this->unk_308.x = Math_SinF(this->unk_308.z) * 80.0f;
this->unk_308.y = Math_CosF(this->unk_314) * 80.0f;
}
this->unk2FC.y -= 448.0f;
this->unk2FC.x += this->unk308.x;
this->unk2FC.z += this->unk308.y;
func_80033AEC(&this->unk2FC, &this->unk158[13], 1.0f, this->actor.speedXZ, 0.0f, 0.0f);
this->unk_2FC.y -= 448.0f;
this->unk_2FC.x += this->unk_308.x;
this->unk_2FC.z += this->unk_308.y;
func_80033AEC(&this->unk_2FC, &this->unk_158[13], 1.0f, this->actor.speedXZ, 0.0f, 0.0f);
for (i = 12; i >= 0; i--) {
func_80035844(&this->unk158[i + 1], &this->unk158[i], &sp6C, 0);
Matrix_Translate(this->unk158[i + 1].x, this->unk158[i + 1].y, this->unk158[i + 1].z, MTXMODE_NEW);
func_80035844(&this->unk_158[i + 1], &this->unk_158[i], &sp6C, 0);
Matrix_Translate(this->unk_158[i + 1].x, this->unk_158[i + 1].y, this->unk_158[i + 1].z, MTXMODE_NEW);
Matrix_RotateZYX(sp6C.x, sp6C.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i]);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i]);
}
func_80035844(&this->actor.world.pos, &this->unk158[0], &sp6C, 0);
func_80035844(&this->actor.world.pos, &this->unk_158[0], &sp6C, 0);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Math_SmoothStepToS(&this->actor.shape.rot.y, sp6C.y, 3, this->unk31C, 182);
Math_SmoothStepToS(&this->actor.shape.rot.x, sp6C.x + 0x8000, 3, this->unk31C, 182);
Math_SmoothStepToS(&this->actor.shape.rot.y, sp6C.y, 3, this->unk_31C, 182);
Math_SmoothStepToS(&this->actor.shape.rot.x, sp6C.x + 0x8000, 3, this->unk_31C, 182);
Matrix_RotateZYX(this->actor.shape.rot.x - 0x8000, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[0]);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[0]);
for (i = 0; i < 13; i++) {
func_80035844(&this->unk158[i], &this->unk158[i + 1], &sp6C, 0);
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Math_SmoothStepToS(&this->unk2A8[i].y, sp6C.y, 3, this->unk31C, 182);
Math_SmoothStepToS(&this->unk2A8[i].x, sp6C.x + 0x8000, 3, this->unk31C, 182);
Matrix_RotateZYX(this->unk2A8[i].x - 0x8000, this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i + 1]);
func_80035844(&this->unk_158[i], &this->unk_158[i + 1], &sp6C, 0);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Math_SmoothStepToS(&this->unk_2A8[i].y, sp6C.y, 3, this->unk_31C, 182);
Math_SmoothStepToS(&this->unk_2A8[i].x, sp6C.x + 0x8000, 3, this->unk_31C, 182);
Matrix_RotateZYX(this->unk_2A8[i].x - 0x8000, this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i + 1]);
}
this->unk2A8[13].x = this->unk2A8[12].x;
this->unk2A8[13].y = this->unk2A8[12].y;
this->unk318--;
if (this->unk318 == 0) {
this->unk_2A8[13].x = this->unk_2A8[12].x;
this->unk_2A8[13].y = this->unk_2A8[12].y;
this->unk_318--;
if (this->unk_318 == 0) {
EnBa_SetupIdle(this);
}
}
@ -382,29 +382,29 @@ void func_809B75A0(EnBa* this, GlobalContext* globalCtx2) {
Vec3f sp74 = { 0.0f, 0.0f, 0.0f };
GlobalContext* globalCtx = globalCtx2;
this->unk31C = 2500;
this->unk_31C = 2500;
EffectSsDeadSound_SpawnStationary(globalCtx, &this->actor.projectedPos, NA_SE_EN_BALINADE_HAND_DEAD, 1, 1, 40);
this->unk14C = 0;
this->unk_14C = 0;
for (i = 7; i < 14; i++) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BA, this->unk158[i].x, this->unk158[i].y,
this->unk158[i].z, 0, 0, 0, EN_BA_DEAD_BLOB);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BA, this->unk_158[i].x, this->unk_158[i].y,
this->unk_158[i].z, 0, 0, 0, EN_BA_DEAD_BLOB);
}
unk_temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, unk_temp, 1, this->unk31C, 0);
unk_temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, unk_temp, 1, this->unk_31C, 0);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Matrix_RotateZYX(this->actor.shape.rot.x - 0x8000, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[0]);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[0]);
this->actor.flags &= ~ACTOR_FLAG_0;
for (i = 5; i < 13; i++) {
Math_SmoothStepToS(&this->unk2A8[i].x, this->unk2A8[5].x, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->unk2A8[i].y, this->unk2A8[5].y, 1, this->unk31C, 0);
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk2A8[i].x - 0x8000, this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&sp74, &this->unk158[i + 1]);
Math_SmoothStepToS(&this->unk_2A8[i].x, this->unk_2A8[5].x, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->unk_2A8[i].y, this->unk_2A8[5].y, 1, this->unk_31C, 0);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk_2A8[i].x - 0x8000, this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&sp74, &this->unk_158[i + 1]);
}
this->unk31A = 15;
this->unk_31A = 15;
EnBa_SetupAction(this, EnBa_Die);
}
@ -413,32 +413,32 @@ void EnBa_Die(EnBa* this, GlobalContext* globalCtx) {
s16 temp;
s32 i;
if (this->unk31A != 0) {
if (this->unk_31A != 0) {
this->actor.speedXZ = 30.0f;
this->unk31C = 8000;
this->unk_31C = 8000;
this->actor.world.pos.y += 8.0f;
temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, temp, 1, this->unk31C, 0);
temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, temp, 1, this->unk_31C, 0);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Matrix_RotateZYX(this->actor.shape.rot.x - 0x8000, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[0]);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[0]);
for (i = 0; i < 5; i++) {
temp = -Math_CosS(this->unk31A * 0x444) * (i * 400);
Math_SmoothStepToS(&this->unk2A8[i].x, temp - 0x4000, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->unk2A8[i].y, this->actor.yawTowardsPlayer, 1, this->unk31C, 0);
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk2A8[i].x - 0x8000, this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk158[i + 1]);
temp = -Math_CosS(this->unk_31A * 0x444) * (i * 400);
Math_SmoothStepToS(&this->unk_2A8[i].x, temp - 0x4000, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->unk_2A8[i].y, this->actor.yawTowardsPlayer, 1, this->unk_31C, 0);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk_2A8[i].x - 0x8000, this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&D_809B8080, &this->unk_158[i + 1]);
}
for (i = 5; i < 13; i++) {
Math_SmoothStepToS(&this->unk2A8[i].x, this->unk2A8[5].x, 1, this->unk31C, 0);
Math_SmoothStepToS(&this->unk2A8[i].y, this->unk2A8[5].y, 1, this->unk31C, 0);
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk2A8[i].x - 0x8000, this->unk2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&sp6C, &this->unk158[i + 1]);
Math_SmoothStepToS(&this->unk_2A8[i].x, this->unk_2A8[5].x, 1, this->unk_31C, 0);
Math_SmoothStepToS(&this->unk_2A8[i].y, this->unk_2A8[5].y, 1, this->unk_31C, 0);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk_2A8[i].x - 0x8000, this->unk_2A8[i].y, 0, MTXMODE_APPLY);
Matrix_MultVec3f(&sp6C, &this->unk_158[i + 1]);
}
this->unk31A--;
this->unk_31A--;
} else {
Flags_SetSwitch(globalCtx, this->upperParams);
Actor_Kill(&this->actor);
@ -459,9 +459,9 @@ void EnBa_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->actionFunc(this, globalCtx);
if (this->actor.params < EN_BA_DEAD_BLOB) {
this->actor.focus.pos = this->unk158[6];
this->actor.focus.pos = this->unk_158[6];
}
if (this->unk14C >= 2) {
if (this->unk_14C >= 2) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@ -489,9 +489,9 @@ void EnBa_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 16, 16, 1, 0,
(globalCtx->gameplayFrames * -10) % 128, 32, 32));
for (i = 0; i < 14; i++, mtx++) {
Matrix_Translate(this->unk158[i].x, this->unk158[i].y, this->unk158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk2A8[i].x, this->unk2A8[i].y, this->unk2A8[i].z, MTXMODE_APPLY);
Matrix_Scale(this->unk200[i].x, this->unk200[i].y, this->unk200[i].z, MTXMODE_APPLY);
Matrix_Translate(this->unk_158[i].x, this->unk_158[i].y, this->unk_158[i].z, MTXMODE_NEW);
Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY);
Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY);
if ((i == 6) || (i == 13)) {
switch (i) {
case 13:

View file

@ -17,19 +17,19 @@ typedef enum {
typedef struct EnBa {
/* 0x0000 */ Actor actor;
/* 0x014C */ s32 unk14C;
/* 0x014C */ s32 unk_14C;
/* 0x0150 */ EnBaActionFunc actionFunc;
/* 0x0154 */ s16 upperParams;
/* 0x0156 */ s16 unk156;
/* 0x0158 */ Vec3f unk158[14];
/* 0x0200 */ Vec3f unk200[14];
/* 0x02A8 */ Vec3s unk2A8[14];
/* 0x02FC */ Vec3f unk2FC;
/* 0x0308 */ Vec3f unk308;
/* 0x0314 */ f32 unk314;
/* 0x0318 */ s16 unk318;
/* 0x031A */ s16 unk31A;
/* 0x031C */ s16 unk31C;
/* 0x0156 */ s16 unk_156;
/* 0x0158 */ Vec3f unk_158[14];
/* 0x0200 */ Vec3f unk_200[14];
/* 0x02A8 */ Vec3s unk_2A8[14];
/* 0x02FC */ Vec3f unk_2FC;
/* 0x0308 */ Vec3f unk_308;
/* 0x0314 */ f32 unk_314;
/* 0x0318 */ s16 unk_318;
/* 0x031A */ s16 unk_31A;
/* 0x031C */ s16 unk_31C;
/* 0x0320 */ ColliderJntSph collider;
/* 0x0340 */ ColliderJntSphElement colliderItems[2];
} EnBa; // size = 0x03C0