summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorblackgamma7 <blackgamma7@gmail.com>2023-08-23 16:50:09 -0400
committerGitHub <noreply@github.com>2023-08-23 22:50:09 +0200
commitb2787995f55065fbb427bcfa0c6f4ec9d44cbb87 (patch)
treef22e34e01070ed7de8aaf5417ee1db7f34b80bef /src
parentfc3e0f080bccb88112e512f5d20bbe32f4661d71 (diff)
`z_en_syateki_niw` doc (#1449)
* SyatekiNiw doc started id'ing funcs and fields for SyatekiNiw * `z_en_syateki_niw` doc * `z_en_syateki_niw1: (almost) all fields/funcs doc'd * `z_en_syateki_niw` update changes based on feedback. * `z_en_syateki_niw`: limb fields renamed * Update z_en_syateki_niw.h renamed fields as suggested. * Update src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h fix typo in comment. Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update z_en_bom_bowl_man.c add minigame enum to actor spawn param * `z_en_syateki_niw`: updated based on feedback renamed local vars for claritey, added more comments to struct. * Update z_en_syateki_niw.c renamed function and var based on feedback --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c6
-rw-r--r--src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c696
-rw-r--r--src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h99
3 files changed, 403 insertions, 398 deletions
diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c
index 45515d51b..2a5ee19bc 100644
--- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c
+++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c
@@ -69,10 +69,10 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) {
for (i = 0; i < 2; i++) {
cucco = (EnSyatekiNiw*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SYATEKI_NIW, cuccoSpawnPos[i].x,
- cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, 1);
-
+ cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0,
+ SYATEKI_MINIGAME_ALLEY);
if (cucco != NULL) {
- cucco->unk_2F4 = cuccoScales[i];
+ cucco->scale = cuccoScales[i];
cucco->collider.dim.radius = (s16)cuccoColliderDims[i][0];
cucco->collider.dim.height = (s16)cuccoColliderDims[i][1];
}
diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c
index af1e2aa19..ff0f5f324 100644
--- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c
+++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c
@@ -15,16 +15,16 @@ void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play);
void EnSyatekiNiw_Update(Actor* thisx, PlayState* play);
void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play);
-void func_80B11DEC(EnSyatekiNiw* this, PlayState* play);
+void EnSyatekiNiw_SetupDefault(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_UpdateEffects(EnSyatekiNiw* this, PlayState* play);
-void func_80B129EC(EnSyatekiNiw* this, PlayState* play);
+void EnSyatekiNiw_Remove(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_DrawEffects(EnSyatekiNiw* this, PlayState* play);
-void func_80B123A8(EnSyatekiNiw* this, PlayState* play);
-void func_80B11E78(EnSyatekiNiw* this, PlayState* play);
-void func_80B12460(EnSyatekiNiw* this, PlayState* play);
-void func_80B128D8(EnSyatekiNiw* this, PlayState* play);
+void EnSyatekiNiw_SetupArchery(EnSyatekiNiw* this, PlayState* play);
+void EnSyatekiNiw_Default(EnSyatekiNiw* this, PlayState* play);
+void EnSyatekiNiw_Archery(EnSyatekiNiw* this, PlayState* play);
+void EnSyatekiNiw_ExitArchery(EnSyatekiNiw* this, PlayState* play);
-void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4);
+void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale);
ActorInit En_Syateki_Niw_InitVars = {
ACTOR_EN_SYATEKI_NIW,
@@ -72,14 +72,14 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16);
- this->unk_29E = this->actor.params;
- if (this->unk_29E < 0) {
- this->unk_29E = 0;
+ this->minigameType = this->actor.params;
+ if (this->minigameType < 0) {
+ this->minigameType = SYATEKI_MINIGAME_ARCHERY;
}
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
- if (this->unk_29E == 0) {
+ if (this->minigameType == SYATEKI_MINIGAME_ARCHERY) {
osSyncPrintf("\n\n");
// "Archery range chicken"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 射的場鶏 ☆☆☆☆☆ \n" VT_RST);
@@ -92,9 +92,9 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.01f);
}
- this->unk_2DC = this->actor.world.pos;
- this->unk_2E8 = this->actor.world.pos;
- this->actionFunc = func_80B11DEC;
+ this->initPos = this->actor.world.pos;
+ this->targetPos = this->actor.world.pos;
+ this->actionFunc = EnSyatekiNiw_SetupDefault;
}
void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play) {
@@ -103,241 +103,240 @@ void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
-void func_80B11A94(EnSyatekiNiw* this, PlayState* play, s16 arg2) {
- if (this->unk_254 == 0) {
- if (arg2 == 0) {
- this->unk_264 = 0.0f;
+void EnSyatekiNiw_UpdateRotations(EnSyatekiNiw* this, PlayState* play, s16 animationType) {
+ if (this->peckTimer == 0) {
+ if (animationType == 0) {
+ this->headRotXTarget = 0.0f;
} else {
- this->unk_264 = -10000.0f;
+ this->headRotXTarget = -10000.0f;
}
- this->unk_28E++;
- this->unk_254 = 3;
- if (!(this->unk_28E & 1)) {
- this->unk_264 = 0.0f;
- if (arg2 == 0) {
- this->unk_254 = Rand_ZeroFloat(30.0f);
+ this->headRotXState++;
+ this->peckTimer = 3;
+ if (!(this->headRotXState & 1)) {
+ this->headRotXTarget = 0.0f;
+ if (animationType == 0) {
+ this->peckTimer = Rand_ZeroFloat(30.0f);
}
}
}
- if (this->unk_258 == 0) {
- this->unk_292++;
- this->unk_292 &= 1;
- switch (arg2) {
+ if (this->flapTimer == 0) {
+ this->wingsRotState++;
+ this->wingsRotState &= 1;
+ switch (animationType) {
case 0:
- this->unk_26C = 0.0f;
- this->unk_268 = 0.0f;
+ this->leftWingRotXTarget = 0.0f;
+ this->rightWingRotXTarget = 0.0f;
break;
case 1:
- this->unk_258 = 3;
- this->unk_26C = 7000.0f;
- this->unk_268 = 7000.0f;
- if (this->unk_292 == 0) {
- this->unk_26C = 0.0f;
- this->unk_268 = 0.0f;
+ this->flapTimer = 3;
+ this->leftWingRotXTarget = 7000.0f;
+ this->rightWingRotXTarget = 7000.0f;
+ if (this->wingsRotState == 0) {
+ this->leftWingRotXTarget = 0.0f;
+ this->rightWingRotXTarget = 0.0f;
}
break;
case 2:
- this->unk_258 = 2;
- this->unk_268 = this->unk_26C = -10000.0f;
- this->unk_280 = this->unk_278 = 25000.0f;
- this->unk_284 = this->unk_27C = 6000.0f;
- if (this->unk_292 == 0) {
- this->unk_278 = 8000.0f;
- this->unk_280 = 8000.0f;
+ this->flapTimer = 2;
+ this->rightWingRotXTarget = this->leftWingRotXTarget = -10000.0f;
+ this->leftWingRotYTarget = this->rightWingRotYTarget = 25000.0f;
+ this->leftWingRotZTarget = this->rightWingRotZTarget = 6000.0f;
+ if (this->wingsRotState == 0) {
+ this->rightWingRotYTarget = 8000.0f;
+ this->leftWingRotYTarget = 8000.0f;
}
break;
case 3:
- this->unk_258 = 2;
- this->unk_278 = 10000.0f;
- this->unk_280 = 10000.0f;
- if (this->unk_292 == 0) {
- this->unk_278 = 3000.0f;
- this->unk_280 = 3000.0f;
+ this->flapTimer = 2;
+ this->rightWingRotYTarget = 10000.0f;
+ this->leftWingRotYTarget = 10000.0f;
+ if (this->wingsRotState == 0) {
+ this->rightWingRotYTarget = 3000.0f;
+ this->leftWingRotYTarget = 3000.0f;
}
break;
case 4:
- this->unk_254 = this->unk_256 = 5;
+ this->peckTimer = this->timer1 = 5;
break;
case 5:
- this->unk_258 = 5;
- this->unk_278 = 14000.0f;
- this->unk_280 = 14000.0f;
- if (this->unk_292 == 0) {
- this->unk_278 = 10000.0f;
- this->unk_280 = 10000.0f;
+ this->flapTimer = 5;
+ this->rightWingRotYTarget = 14000.0f;
+ this->leftWingRotYTarget = 14000.0f;
+ if (this->wingsRotState == 0) {
+ this->rightWingRotYTarget = 10000.0f;
+ this->leftWingRotYTarget = 10000.0f;
}
break;
}
}
- if (this->unk_264 != this->unk_2BC.x) {
- Math_ApproachF(&this->unk_2BC.x, this->unk_264, 0.5f, 4000.0f);
+ if (this->headRotXTarget != this->headRot.x) {
+ Math_ApproachF(&this->headRot.x, this->headRotXTarget, 0.5f, 4000.0f);
}
- if (this->unk_26C != this->unk_2A4.x) {
- Math_ApproachF(&this->unk_2A4.x, this->unk_26C, 0.8f, 7000.0f);
+ if (this->leftWingRotXTarget != this->leftWingRot.x) {
+ Math_ApproachF(&this->leftWingRot.x, this->leftWingRotXTarget, 0.8f, 7000.0f);
}
- if (this->unk_280 != this->unk_2A4.y) {
- Math_ApproachF(&this->unk_2A4.y, this->unk_280, 0.8f, 7000.0f);
+ if (this->leftWingRotYTarget != this->leftWingRot.y) {
+ Math_ApproachF(&this->leftWingRot.y, this->leftWingRotYTarget, 0.8f, 7000.0f);
}
- if (this->unk_284 != this->unk_2A4.z) {
- Math_ApproachF(&this->unk_2A4.z, this->unk_284, 0.8f, 7000.0f);
+ if (this->leftWingRotZTarget != this->leftWingRot.z) {
+ Math_ApproachF(&this->leftWingRot.z, this->leftWingRotZTarget, 0.8f, 7000.0f);
}
- if (this->unk_268 != this->unk_2B0.x) {
- Math_ApproachF(&this->unk_2B0.x, this->unk_268, 0.8f, 7000.0f);
+ if (this->rightWingRotXTarget != this->rightWingRot.x) {
+ Math_ApproachF(&this->rightWingRot.x, this->rightWingRotXTarget, 0.8f, 7000.0f);
}
- if (this->unk_278 != this->unk_2B0.y) {
- Math_ApproachF(&this->unk_2B0.y, this->unk_278, 0.8f, 7000.0f);
+ if (this->rightWingRotYTarget != this->rightWingRot.y) {
+ Math_ApproachF(&this->rightWingRot.y, this->rightWingRotYTarget, 0.8f, 7000.0f);
}
- if (this->unk_27C != this->unk_2B0.z) {
- Math_ApproachF(&this->unk_2B0.z, this->unk_27C, 0.8f, 7000.0f);
+ if (this->rightWingRotZTarget != this->rightWingRot.z) {
+ Math_ApproachF(&this->rightWingRot.z, this->rightWingRotZTarget, 0.8f, 7000.0f);
}
}
-void func_80B11DEC(EnSyatekiNiw* this, PlayState* play) {
+void EnSyatekiNiw_SetupDefault(EnSyatekiNiw* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP,
-10.0f);
- if (this->unk_29E != 0) {
- Actor_SetScale(&this->actor, this->unk_2F4);
+ if (this->minigameType != SYATEKI_MINIGAME_ARCHERY) {
+ Actor_SetScale(&this->actor, this->scale);
}
- this->actionFunc = func_80B11E78;
+ this->actionFunc = EnSyatekiNiw_Default;
}
-void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
+void EnSyatekiNiw_Default(EnSyatekiNiw* this, PlayState* play) {
Vec3f dustVelocity = { 0.0f, 0.0f, 0.0f };
Vec3f dustAccel = { 0.0f, 0.2f, 0.0f };
Color_RGBA8 dustPrimColor = { 0, 0, 0, 255 };
Color_RGBA8 dustEnvColor = { 0, 0, 0, 255 };
Vec3f dustPos;
- f32 tmpf2;
- f32 sp4C;
- f32 sp50;
- f32 tmpf1;
- s16 sp4A;
-
- if ((this->unk_29C != 0) && (this->unk_29E == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
- this->unk_29C = 0;
- this->actionFunc = func_80B123A8;
+ f32 posZDiff;
+ f32 posZMod;
+ f32 posXMod;
+ f32 posXDiff;
+ s16 animationType;
+
+ if (this->isFalling && (this->minigameType == SYATEKI_MINIGAME_ARCHERY) &&
+ (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
+ this->isFalling = false;
+ this->actionFunc = EnSyatekiNiw_SetupArchery;
return;
}
- sp4A = 0;
- if ((this->unk_25E == 0) && (this->unk_25C == 0)) {
- this->unk_294++;
- if (this->unk_294 >= 8) {
- this->unk_25E = Rand_ZeroFloat(30.0f);
- this->unk_294 = Rand_ZeroFloat(3.99f);
+ animationType = 0;
+ if ((this->movementTimer == 0) && (this->hopTimer == 0)) {
+ this->targetPosTimer++;
+ if (this->targetPosTimer >= 8) {
+ this->movementTimer = Rand_ZeroFloat(30.0f);
+ this->targetPosTimer = Rand_ZeroFloat(3.99f);
- switch (this->unk_29E) {
- case 0:
- sp50 = Rand_CenteredFloat(100.0f);
- if (sp50 < 0.0f) {
- sp50 -= 100.0f;
+ switch (this->minigameType) {
+ case SYATEKI_MINIGAME_ARCHERY:
+ posXMod = Rand_CenteredFloat(100.0f);
+ if (posXMod < 0.0f) {
+ posXMod -= 100.0f;
} else {
- sp50 += 100.0f;
+ posXMod += 100.0f;
}
- sp4C = Rand_CenteredFloat(100.0f);
- if (sp4C < 0.0f) {
- sp4C -= 100.0f;
+ posZMod = Rand_CenteredFloat(100.0f);
+ if (posZMod < 0.0f) {
+ posZMod -= 100.0f;
} else {
- sp4C += 100.0f;
+ posZMod += 100.0f;
}
- this->unk_2E8.x = this->unk_2DC.x + sp50;
- this->unk_2E8.z = this->unk_2DC.z + sp4C;
+ this->targetPos.x = this->initPos.x + posXMod;
+ this->targetPos.z = this->initPos.z + posZMod;
- if (this->unk_2E8.x < -150.0f) {
- this->unk_2E8.x = -150.0f;
+ if (this->targetPos.x < -150.0f) {
+ this->targetPos.x = -150.0f;
}
- if (this->unk_2E8.x > 150.0f) {
- this->unk_2E8.x = 150.0f;
+ if (this->targetPos.x > 150.0f) {
+ this->targetPos.x = 150.0f;
}
- if (this->unk_2E8.z < -60.0f) {
- this->unk_2E8.z = -60.0f;
+ if (this->targetPos.z < -60.0f) {
+ this->targetPos.z = -60.0f;
}
- if (this->unk_2E8.z > -40.0f) {
- this->unk_2E8.z = -40.0f;
+ if (this->targetPos.z > -40.0f) {
+ this->targetPos.z = -40.0f;
}
break;
- case 1:
- sp50 = Rand_CenteredFloat(50.0f);
- if (sp50 < 0.0f) {
- sp50 -= 50.0f;
+ case SYATEKI_MINIGAME_ALLEY:
+ posXMod = Rand_CenteredFloat(50.0f);
+ if (posXMod < 0.0f) {
+ posXMod -= 50.0f;
} else {
- sp50 += 50.0f;
+ posXMod += 50.0f;
}
- sp4C = Rand_CenteredFloat(30.0f);
- if (sp4C < 0.0f) {
- sp4C -= 30.0f;
+ posZMod = Rand_CenteredFloat(30.0f);
+ if (posZMod < 0.0f) {
+ posZMod -= 30.0f;
} else {
- sp4C += 30.0f;
+ posZMod += 30.0f;
}
- this->unk_2E8.x = this->unk_2DC.x + sp50;
- this->unk_2E8.z = this->unk_2DC.z + sp4C;
+ this->targetPos.x = this->initPos.x + posXMod;
+ this->targetPos.z = this->initPos.z + posZMod;
break;
}
} else {
- this->unk_25C = 4;
+ this->hopTimer = 4;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.velocity.y = 2.5f;
- if ((Rand_ZeroFloat(10.0f) < 1.0f) && (this->unk_29E == 0)) {
- this->unk_25C = 0xC;
+ if ((Rand_ZeroFloat(10.0f) < 1.0f) && (this->minigameType == SYATEKI_MINIGAME_ARCHERY)) {
+ this->hopTimer = 12;
this->actor.velocity.y = 10.0f;
}
}
}
}
- if (this->unk_25C != 0) {
- sp4A = 1;
- Math_ApproachF(&this->actor.world.pos.x, this->unk_2E8.x, 1.0f, this->unk_2C8.y);
- Math_ApproachF(&this->actor.world.pos.z, this->unk_2E8.z, 1.0f, this->unk_2C8.y);
- Math_ApproachF(&this->unk_2C8.y, 3.0f, 1.0f, 0.3f);
- tmpf1 = this->unk_2E8.x - this->actor.world.pos.x;
- tmpf2 = this->unk_2E8.z - this->actor.world.pos.z;
+ if (this->hopTimer != 0) {
+ animationType = 1;
+ Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 1.0f, this->posRotStep.y);
+ Math_ApproachF(&this->actor.world.pos.z, this->targetPos.z, 1.0f, this->posRotStep.y);
+ Math_ApproachF(&this->posRotStep.y, 3.0f, 1.0f, 0.3f);
+ posXDiff = this->targetPos.x - this->actor.world.pos.x;
+ posZDiff = this->targetPos.z - this->actor.world.pos.z;
- if (fabsf(tmpf1) < 10.0f) {
- tmpf1 = 0;
+ if (fabsf(posXDiff) < 10.0f) {
+ posXDiff = 0;
}
- if (fabsf(tmpf2) < 10.0f) {
- tmpf2 = 0.0f;
+ if (fabsf(posZDiff) < 10.0f) {
+ posZDiff = 0.0f;
}
- if ((tmpf1 == 0.0f) && (tmpf2 == 0.0f)) {
- this->unk_25C = 0;
- this->unk_294 = 7;
+ if ((posXDiff == 0.0f) && (posZDiff == 0.0f)) {
+ this->hopTimer = 0;
+ this->targetPosTimer = 7;
}
- Math_SmoothStepToS(&this->actor.world.rot.y, RAD_TO_BINANG(Math_FAtan2F(tmpf1, tmpf2)), 3, this->unk_2C8.z, 0);
- Math_ApproachF(&this->unk_2C8.z, 10000.0f, 1.0f, 1000.0f);
+ Math_SmoothStepToS(&this->actor.world.rot.y, RAD_TO_BINANG(Math_FAtan2F(posXDiff, posZDiff)), 3,
+ this->posRotStep.z, 0);
+ Math_ApproachF(&this->posRotStep.z, 10000.0f, 1.0f, 1000.0f);
}
- if (this->unk_260 == 0) {
- func_80B11A94(this, play, sp4A);
- return;
- }
-
- if ((play->gameplayFrames % 4) == 0) {
+ if (this->sootTimer == 0) {
+ EnSyatekiNiw_UpdateRotations(this, play, animationType);
+ } else if ((play->gameplayFrames % 4) == 0) { // draw smoke from bombchu hit
dustVelocity.y = Rand_CenteredFloat(5.0f);
dustAccel.y = 0.2f;
dustPos = this->actor.world.pos;
@@ -345,54 +344,54 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
}
}
-void func_80B123A8(EnSyatekiNiw* this, PlayState* play) {
+void EnSyatekiNiw_SetupArchery(EnSyatekiNiw* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP,
-10.0f);
- this->unk_27C = 6000.0f;
- this->unk_288 = -10000.0f;
- this->unk_2B0.z = 6000.0f;
- this->unk_2B0.y = 10000.0f;
- this->actionFunc = func_80B12460;
- this->unk_2A4.z = 6000.0f;
- this->unk_284 = 6000.0f;
- this->unk_2B0.x = -10000.0f;
- this->unk_268 = -10000.0f;
- this->unk_2A4.y = -10000.0f;
- this->unk_2A4.x = -10000.0f;
- this->unk_26C = -10000.0f;
+ this->rightWingRotZTarget = 6000.0f;
+ this->unkArcheryFloat = -10000.0f;
+ this->rightWingRot.z = 6000.0f;
+ this->rightWingRot.y = 10000.0f;
+ this->actionFunc = EnSyatekiNiw_Archery;
+ this->leftWingRot.z = 6000.0f;
+ this->leftWingRotZTarget = 6000.0f;
+ this->rightWingRot.x = -10000.0f;
+ this->rightWingRotXTarget = -10000.0f;
+ this->leftWingRot.y = -10000.0f;
+ this->leftWingRot.x = -10000.0f;
+ this->leftWingRotXTarget = -10000.0f;
}
-void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
+void EnSyatekiNiw_Archery(EnSyatekiNiw* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- f32 phi_f16 = 0.0f;
+ f32 rotYTargetOffset = 0.0f;
player->actor.freezeTimer = 10;
- switch (this->unk_29A) {
+ switch (this->archeryState) {
case 0:
- this->unk_296 = 2;
- this->unk_2C8.y = 0.0f;
- this->unk_29A = 1;
+ this->archeryAnimationType = 2;
+ this->posRotStep.y = 0.0f;
+ this->archeryState = 1;
break;
case 1:
this->actor.speed = 2.0f;
- if (this->unk_25C == 0) {
- this->unk_25C = 3;
+ if (this->hopTimer == 0) {
+ this->hopTimer = 3;
this->actor.velocity.y = 3.5f;
}
- if (this->unk_25A == 0) {
- this->unk_298++;
- this->unk_298 &= 1;
- this->unk_25A = 5;
+ if (this->archeryTimer == 0) {
+ this->rotYFlip++;
+ this->rotYFlip &= 1;
+ this->archeryTimer = 5;
}
- phi_f16 = (this->unk_298 == 0) ? 5000.0f : -5000.0f;
+ rotYTargetOffset = (this->rotYFlip == 0) ? 5000.0f : -5000.0f;
if (this->actor.world.pos.z > 100.0f) {
this->actor.speed = 2.0f;
this->actor.gravity = -0.3f;
this->actor.velocity.y = 5.0f;
- this->unk_29A = 2;
+ this->archeryState = 2;
}
break;
@@ -404,71 +403,71 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.world.pos.z > 110.0f)) {
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
- this->unk_284 = 0.0f;
- this->unk_27C = 0.0f;
- this->unk_278 = 0.0f;
- this->unk_280 = 0.0f;
- this->unk_288 = 0.0f;
+ this->leftWingRotZTarget = 0.0f;
+ this->rightWingRotZTarget = 0.0f;
+ this->rightWingRotYTarget = 0.0f;
+ this->leftWingRotYTarget = 0.0f;
+ this->unkArcheryFloat = 0.0f;
this->actor.speed = 0.5f;
- this->unk_254 = this->unk_256 = 0;
- this->unk_28E = this->unk_290 = 0;
- this->unk_296 = 1;
- this->unk_29A = 3;
+ this->peckTimer = this->timer1 = 0;
+ this->headRotXState = this->unk_290 = 0;
+ this->archeryAnimationType = 1;
+ this->archeryState = 3;
}
break;
case 3:
if ((player->actor.world.pos.z - 50.0f) < this->actor.world.pos.z) {
this->actor.speed = 0.0f;
- this->unk_262 = 0x3C;
- this->unk_25A = 0x14;
- this->unk_264 = 10000.0f;
- this->unk_29A = 4;
+ this->cluckTimer = 60;
+ this->archeryTimer = 20;
+ this->headRotXTarget = 10000.0f;
+ this->archeryState = 4;
}
break;
case 4:
- if (this->unk_25A == 0) {
- this->unk_296 = 4;
- this->unk_264 = 5000.0f;
- this->unk_26C = 0.0f;
- this->unk_268 = 0.0f;
- this->unk_284 = 0.0f;
- this->unk_27C = 0.0f;
- this->unk_280 = 14000.0f;
- this->unk_278 = 14000.0f;
+ if (this->archeryTimer == 0) {
+ this->archeryAnimationType = 4;
+ this->headRotXTarget = 5000.0f;
+ this->leftWingRotXTarget = 0.0f;
+ this->rightWingRotXTarget = 0.0f;
+ this->leftWingRotZTarget = 0.0f;
+ this->rightWingRotZTarget = 0.0f;
+ this->leftWingRotYTarget = 14000.0f;
+ this->rightWingRotYTarget = 14000.0f;
Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M);
- this->unk_254 = this->unk_256 = this->unk_25A = 0x1E;
- this->unk_29A = 5;
+ this->peckTimer = this->timer1 = this->archeryTimer = 30;
+ this->archeryState = 5;
}
break;
case 5:
- if (this->unk_25A == 1) {
- this->unk_258 = 0;
- this->unk_296 = 5;
- this->unk_256 = this->unk_258;
- this->unk_254 = this->unk_258;
+ if (this->archeryTimer == 1) {
+ this->flapTimer = 0;
+ this->archeryAnimationType = 5;
+ this->timer1 = this->flapTimer;
+ this->peckTimer = this->flapTimer;
this->actor.speed = 1.0f;
}
- if ((this->unk_25A == 0) && ((player->actor.world.pos.z - 30.0f) < this->actor.world.pos.z)) {
+ if ((this->archeryTimer == 0) && ((player->actor.world.pos.z - 30.0f) < this->actor.world.pos.z)) {
Audio_PlaySfxGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
- this->unk_25E = 0x14;
- this->unk_29A = 6;
+ this->movementTimer = 20;
+ this->archeryState = 6;
this->actor.speed = 0.0f;
}
break;
case 6:
- if (this->unk_25E == 1) {
+ if (this->movementTimer == 1) {
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.save.entranceIndex;
play->shootingGalleryStatus = 0;
player->actor.freezeTimer = 20;
- this->unk_25E = 0x14;
- this->actionFunc = func_80B128D8;
+ this->movementTimer = 20;
+ this->actionFunc = EnSyatekiNiw_ExitArchery;
}
break;
}
@@ -476,94 +475,94 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.y,
RAD_TO_BINANG(Math_FAtan2F(player->actor.world.pos.x - this->actor.world.pos.x,
player->actor.world.pos.z - this->actor.world.pos.z)) +
- phi_f16,
- 5, this->unk_2C8.y, 0);
- Math_ApproachF(&this->unk_2C8.y, 3000.0f, 1.0f, 500.0f);
- if (this->unk_296 == 2) {
- this->unk_256 = 10;
- this->unk_254 = this->unk_256;
+ rotYTargetOffset,
+ 5, this->posRotStep.y, 0);
+ Math_ApproachF(&this->posRotStep.y, 3000.0f, 1.0f, 500.0f);
+ if (this->archeryAnimationType == 2) {
+ this->peckTimer = this->timer1 = 10;
}
- func_80B11A94(this, play, this->unk_296);
+ EnSyatekiNiw_UpdateRotations(this, play, this->archeryAnimationType);
}
-void func_80B128D8(EnSyatekiNiw* this, PlayState* play) {
- if (this->unk_25E == 1) {
+void EnSyatekiNiw_ExitArchery(EnSyatekiNiw* this, PlayState* play) {
+ if (this->movementTimer == 1) {
gSaveContext.timerState = TIMER_STATE_OFF;
}
}
-void func_80B128F8(EnSyatekiNiw* this, PlayState* play) {
- s16 sp26;
- s16 sp24;
+void EnSyatekiNiw_SetupRemove(EnSyatekiNiw* this, PlayState* play) {
+ s16 screenX;
+ s16 screenY;
- Actor_SetFocus(&this->actor, this->unk_2D4);
- Actor_GetScreenPos(play, &this->actor, &sp26, &sp24);
- if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (sp26 > 0) &&
- (sp26 < SCREEN_WIDTH) && (sp24 > 0) && (sp24 < SCREEN_HEIGHT)) {
+ Actor_SetFocus(&this->actor, this->focusYOffset);
+ Actor_GetScreenPos(play, &this->actor, &screenX, &screenY);
+ if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f)
+ && (screenX > 0) && (screenX < SCREEN_WIDTH) && (screenY > 0)
+ && (screenY < SCREEN_HEIGHT)) {
this->actor.speed = 5.0f;
- this->unk_298 = Rand_ZeroFloat(1.99f);
- this->unk_2D8 = Rand_CenteredFloat(8000.0f) + -10000.0f;
- this->unk_262 = 0x1E;
- this->unk_25E = 0x64;
- this->actionFunc = func_80B129EC;
+ this->rotYFlip = Rand_ZeroFloat(1.99f);
+ this->removeStateYaw = Rand_CenteredFloat(8000.0f) + -10000.0f;
+ this->cluckTimer = 30;
+ this->movementTimer = 100;
+ this->actionFunc = EnSyatekiNiw_Remove;
}
}
-void func_80B129EC(EnSyatekiNiw* this, PlayState* play) {
+void EnSyatekiNiw_Remove(EnSyatekiNiw* this, PlayState* play) {
s32 pad;
- f32 phi_f2;
- s16 sp2E;
- s16 sp2C;
- f32 tmpf2;
-
- Actor_SetFocus(&this->actor, this->unk_2D4);
- Actor_GetScreenPos(play, &this->actor, &sp2E, &sp2C);
- if ((this->unk_25E == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) ||
- (sp2C < 0) || (sp2C > SCREEN_HEIGHT)) {
+ f32 rotYTargetOffset;
+ s16 screenX;
+ s16 screenY;
+ f32 rotYTarget;
+
+ Actor_SetFocus(&this->actor, this->focusYOffset);
+ Actor_GetScreenPos(play, &this->actor, &screenX, &screenY);
+ if ((this->movementTimer == 0) || (this->actor.projectedPos.z < -70.0f) || (screenX < 0) ||
+ (screenX > SCREEN_WIDTH) || (screenY < 0) || (screenY > SCREEN_HEIGHT)) {
Actor_Kill(&this->actor);
return;
}
- this->unk_2A0 = 1;
- if (this->unk_25C == 0) {
- this->unk_298++;
- this->unk_298 &= 1;
- this->unk_25C = (s16)Rand_CenteredFloat(4.0f) + 5;
+ this->spawnFeathers = true;
+ if (this->hopTimer == 0) {
+ this->rotYFlip++;
+ this->rotYFlip &= 1;
+ this->hopTimer = (s16)Rand_CenteredFloat(4.0f) + 5;
if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.velocity.y = 4.0f;
}
}
- phi_f2 = (this->unk_298 == 0) ? 5000.0f : -5000.0f;
- tmpf2 = this->unk_2D8 + phi_f2;
- Math_SmoothStepToS(&this->actor.world.rot.y, tmpf2, 3, this->unk_2C8.y, 0);
- Math_ApproachF(&this->unk_2C8.y, 3000.0f, 1.0f, 500.0f);
- func_80B11A94(this, play, 2);
+ rotYTargetOffset = (this->rotYFlip == 0) ? 5000.0f : -5000.0f;
+ rotYTarget = this->removeStateYaw + rotYTargetOffset;
+ Math_SmoothStepToS(&this->actor.world.rot.y, rotYTarget, 3, this->posRotStep.y, 0);
+ Math_ApproachF(&this->posRotStep.y, 3000.0f, 1.0f, 500.0f);
+ EnSyatekiNiw_UpdateRotations(this, play, 2);
}
-void func_80B12BA4(EnSyatekiNiw* this, PlayState* play) {
+void EnSyatekiNiw_CheckHit(EnSyatekiNiw* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
- switch (this->unk_29E) {
- case 0:
- if (this->unk_29C == 0) {
- this->unk_262 = 0x1E;
+ switch (this->minigameType) {
+ case SYATEKI_MINIGAME_ARCHERY:
+ if (!this->isFalling) {
+ this->cluckTimer = 30;
Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
- this->unk_29C = 1;
- this->unk_2A0 = 1;
- this->actionFunc = func_80B123A8;
+ this->isFalling = true;
+ this->spawnFeathers = true;
+ this->actionFunc = EnSyatekiNiw_SetupArchery;
this->actor.gravity = -3.0f;
}
break;
- case 1:
- this->unk_262 = 0x1E;
- this->unk_2F8 = 1;
+ case SYATEKI_MINIGAME_ALLEY:
+ this->cluckTimer = 30;
+ this->unkAlleyHitByte = 1;
Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
- this->unk_260 = 100;
- this->unk_2A0 = 1;
- this->unk_25E = this->unk_260;
+ this->sootTimer = 100;
+ this->spawnFeathers = true;
+ this->movementTimer = this->sootTimer;
break;
}
}
@@ -575,42 +574,42 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
s16 i;
Vec3f sp90 = { 0.0f, 0.0f, 0.0f };
Vec3f sp84 = { 0.0f, 0.0f, 0.0f };
- Vec3f sp78;
- Vec3f sp6C;
- Vec3f sp60;
+ Vec3f pos;
+ Vec3f vel;
+ Vec3f accel;
if (1) {}
if (1) {}
if (1) {}
EnSyatekiNiw_UpdateEffects(this, play);
- this->unk_28C++;
- if (this->unk_254 != 0) {
- this->unk_254--;
+ this->lifetime++;
+ if (this->peckTimer != 0) {
+ this->peckTimer--;
}
- if (this->unk_258 != 0) {
- this->unk_258--;
+ if (this->flapTimer != 0) {
+ this->flapTimer--;
}
- if (this->unk_25A != 0) {
- this->unk_25A--;
+ if (this->archeryTimer != 0) {
+ this->archeryTimer--;
}
- if (this->unk_25C != 0) {
- this->unk_25C--;
+ if (this->hopTimer != 0) {
+ this->hopTimer--;
}
- if (this->unk_25E != 0) {
- this->unk_25E--;
+ if (this->movementTimer != 0) {
+ this->movementTimer--;
}
- if (this->unk_262 != 0) {
- this->unk_262--;
+ if (this->cluckTimer != 0) {
+ this->cluckTimer--;
}
- if (this->unk_260 != 0) {
- this->unk_260--;
+ if (this->sootTimer != 0) {
+ this->sootTimer--;
}
this->actor.shape.rot = this->actor.world.rot;
@@ -622,47 +621,48 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);
- if (this->unk_2A0 != 0) {
+ if (this->spawnFeathers) {
for (i = 0; i < 20; i++) {
- sp78.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x;
- sp78.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 20.0f);
- sp78.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z;
- sp6C.x = Rand_CenteredFloat(3.0f);
- sp6C.y = (Rand_ZeroFloat(2.0f) * 0.5f) + 2.0f;
- sp6C.z = Rand_CenteredFloat(3.0f);
- sp60.z = sp60.x = 0.0f;
- sp60.y = -0.15f;
- EnSyatekiNiw_SpawnFeather(this, &sp78, &sp6C, &sp60, Rand_ZeroFloat(8.0f) + 8.0f);
+ pos.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x;
+ pos.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 20.0f);
+ pos.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z;
+ vel.x = Rand_CenteredFloat(3.0f);
+ vel.y = (Rand_ZeroFloat(2.0f) * 0.5f) + 2.0f;
+ vel.z = Rand_CenteredFloat(3.0f);
+ accel.z = accel.x = 0.0f;
+ accel.y = -0.15f;
+ EnSyatekiNiw_SpawnFeather(this, &pos, &vel, &accel, Rand_ZeroFloat(8.0f) + 8.0f);
}
- this->unk_2A0 = 0;
+ this->spawnFeathers = false;
}
- func_80B12BA4(this, play);
- if (this->unk_262 == 0) {
- if (this->actionFunc == func_80B11E78) {
- this->unk_262 = 0x12C;
+ EnSyatekiNiw_CheckHit(this, play);
+ if (this->cluckTimer == 0) {
+ if (this->actionFunc == EnSyatekiNiw_Default) {
+ this->cluckTimer = 300;
Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_N);
} else {
- this->unk_262 = 0x1E;
+ this->cluckTimer = 30;
Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
}
}
- i = 0;
- switch (this->unk_29E) {
- case 0:
+ // here, "i" doubles as boolean value.
+ i = false;
+ switch (this->minigameType) {
+ case SYATEKI_MINIGAME_ARCHERY:
if (play->shootingGalleryStatus != 0) {
- i = 1;
+ i = true;
}
break;
- case 1:
- i = 1;
+ case SYATEKI_MINIGAME_ALLEY:
+ i = true;
break;
}
- if (i != 0) {
+ if (i) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
@@ -671,22 +671,22 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
s32 SyatekiNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
EnSyatekiNiw* this = (EnSyatekiNiw*)thisx;
- Vec3f sp0 = { 0.0f, 0.0f, 0.0f };
+ Vec3f unusedZeroVec = { 0.0f, 0.0f, 0.0f };
if (limbIndex == 13) {
- rot->y += (s16)this->unk_2BC.x;
+ rot->y += (s16)this->headRot.x;
}
if (limbIndex == 11) {
- rot->x += (s16)this->unk_2B0.z;
- rot->y += (s16)this->unk_2B0.y;
- rot->z += (s16)this->unk_2B0.x;
+ rot->x += (s16)this->rightWingRot.z;
+ rot->y += (s16)this->rightWingRot.y;
+ rot->z += (s16)this->rightWingRot.x;
}
if (limbIndex == 7) {
- rot->x += (s16)this->unk_2A4.z;
- rot->y += (s16)this->unk_2A4.y;
- rot->z += (s16)this->unk_2A4.x;
+ rot->x += (s16)this->leftWingRot.z;
+ rot->y += (s16)this->leftWingRot.y;
+ rot->z += (s16)this->leftWingRot.x;
}
return false;
@@ -694,12 +694,12 @@ s32 SyatekiNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play) {
EnSyatekiNiw* this = (EnSyatekiNiw*)thisx;
- Color_RGBA8 sp30 = { 0, 0, 0, 255 };
+ Color_RGBA8 sootShade = { 0, 0, 0, 255 };
- if (this->actionFunc != func_80B128F8) {
+ if (this->actionFunc != EnSyatekiNiw_SetupRemove) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
- if (this->unk_260 != 0) {
- func_80026230(play, &sp30, 0, 0x14);
+ if (this->sootTimer != 0) {
+ func_80026230(play, &sootShade, 0, 20);
}
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
@@ -709,20 +709,20 @@ void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play) {
}
}
-void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) {
+void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale) {
s16 i;
EnSyatekiNiwEffect* effect = &this->effects[0];
for (i = 0; i < EN_SYATEKI_NIW_EFFECT_COUNT; i++, effect++) {
- if (effect->unk_00 == 0) {
- effect->unk_00 = 1;
- effect->unk_04 = *arg1;
- effect->unk_10 = *arg2;
- effect->unk_1C = *arg3;
- effect->unk_34 = 0;
- effect->unk_2C = (arg4 / 1000.0f);
- effect->unk_28 = (s16)Rand_ZeroFloat(20.0f) + 0x28;
- effect->unk_2A = Rand_ZeroFloat(1000.0f);
+ if (effect->state == 0) {
+ effect->state = 1;
+ effect->pos = *pos;
+ effect->vel = *vel;
+ effect->accel = *accel;
+ effect->timer = 0;
+ effect->scale = (scale / 1000.0f);
+ effect->lifespan = (s16)Rand_ZeroFloat(20.0f) + 40;
+ effect->rotPulse = Rand_ZeroFloat(1000.0f);
return;
}
}
@@ -733,25 +733,25 @@ void EnSyatekiNiw_UpdateEffects(EnSyatekiNiw* this, PlayState* play) {
EnSyatekiNiwEffect* effect = &this->effects[0];
for (i = 0; i < EN_SYATEKI_NIW_EFFECT_COUNT; i++, effect++) {
- if (effect->unk_00 != 0) {
- effect->unk_04.x += effect->unk_10.x;
- effect->unk_04.y += effect->unk_10.y;
- effect->unk_04.z += effect->unk_10.z;
- effect->unk_34++;
- effect->unk_10.x += effect->unk_1C.x;
- effect->unk_10.y += effect->unk_1C.y;
- effect->unk_10.z += effect->unk_1C.z;
- if (effect->unk_00 == 1) {
- effect->unk_2A++;
- Math_ApproachF(&effect->unk_10.x, 0.0f, 1.0f, 0.05f);
- Math_ApproachF(&effect->unk_10.z, 0.0f, 1.0f, 0.05f);
- if (effect->unk_10.y < -0.5f) {
- effect->unk_10.y = 0.5f;
+ if (effect->state != 0) {
+ effect->pos.x += effect->vel.x;
+ effect->pos.y += effect->vel.y;
+ effect->pos.z += effect->vel.z;
+ effect->timer++;
+ effect->vel.x += effect->accel.x;
+ effect->vel.y += effect->accel.y;
+ effect->vel.z += effect->accel.z;
+ if (effect->state == 1) {
+ effect->rotPulse++;
+ Math_ApproachF(&effect->vel.x, 0.0f, 1.0f, 0.05f);
+ Math_ApproachF(&effect->vel.z, 0.0f, 1.0f, 0.05f);
+ if (effect->vel.y < -0.5f) {
+ effect->vel.y = 0.5f;
}
- effect->unk_30 = (Math_SinS(effect->unk_2A * 3000) * M_PI) * 0.2f;
- if (effect->unk_28 < effect->unk_34) {
- effect->unk_00 = 0;
+ effect->rot = (Math_SinS(effect->rotPulse * 3000) * M_PI) * 0.2f;
+ if (effect->lifespan < effect->timer) {
+ effect->state = 0;
}
}
}
@@ -769,16 +769,16 @@ void EnSyatekiNiw_DrawEffects(EnSyatekiNiw* this, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < EN_SYATEKI_NIW_EFFECT_COUNT; i++, effect++) {
- if (effect->unk_00 == 1) {
+ if (effect->state == 1) {
if (materialFlag == 0) {
gSPDisplayList(POLY_XLU_DISP++, gCuccoEffectFeatherMaterialDL);
materialFlag++;
}
- Matrix_Translate(effect->unk_04.x, effect->unk_04.y, effect->unk_04.z, MTXMODE_NEW);
+ Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
- Matrix_Scale(effect->unk_2C, effect->unk_2C, 1.0f, MTXMODE_APPLY);
- Matrix_RotateZ(effect->unk_30, MTXMODE_APPLY);
+ Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY);
+ Matrix_RotateZ(effect->rot, MTXMODE_APPLY);
Matrix_Translate(0.0f, -1000.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_syateki_niw.c", 1251),
diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h
index 26e6449aa..5f1cfcf72 100644
--- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h
+++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h
@@ -9,15 +9,15 @@ struct EnSyatekiNiw;
typedef void (*EnSyatekiNiwActionFunc)(struct EnSyatekiNiw*, PlayState*);
typedef struct {
- /* 0x00 */ u8 unk_00;
- /* 0x0C */ Vec3f unk_04;
- /* 0x10 */ Vec3f unk_10;
- /* 0x1C */ Vec3f unk_1C;
- /* 0x28 */ s16 unk_28;
- /* 0x2A */ s16 unk_2A;
- /* 0x2C */ f32 unk_2C;
- /* 0x30 */ f32 unk_30;
- /* 0x34 */ u8 unk_34;
+ /* 0x00 */ u8 state;
+ /* 0x0C */ Vec3f pos;
+ /* 0x10 */ Vec3f vel;
+ /* 0x1C */ Vec3f accel;
+ /* 0x28 */ s16 lifespan;
+ /* 0x2A */ s16 rotPulse;
+ /* 0x2C */ f32 scale;
+ /* 0x30 */ f32 rot;
+ /* 0x34 */ u8 timer;
} EnSyatekiNiwEffect; // size = 0x38
#define EN_SYATEKI_NIW_EFFECT_COUNT 5
@@ -28,46 +28,51 @@ typedef struct EnSyatekiNiw {
/* 0x0190 */ Vec3s jointTable[16];
/* 0x01F0 */ Vec3s morphTable[16];
/* 0x0250 */ EnSyatekiNiwActionFunc actionFunc;
- /* 0x0254 */ s16 unk_254;
- /* 0x0256 */ s16 unk_256;
- /* 0x0258 */ s16 unk_258;
- /* 0x025A */ s16 unk_25A;
- /* 0x025C */ s16 unk_25C;
- /* 0x025E */ s16 unk_25E;
- /* 0x0260 */ s16 unk_260;
- /* 0x0262 */ s16 unk_262;
- /* 0x0264 */ f32 unk_264;
- /* 0x0268 */ f32 unk_268;
- /* 0x026C */ f32 unk_26C;
+ /* 0x0254 */ s16 peckTimer; // intervals of bobbing head on ground
+ /* 0x0256 */ s16 timer1; // sometimes set alongside peckTimer, never read.
+ /* 0x0258 */ s16 flapTimer; // intervals of beating wings
+ /* 0x025A */ s16 archeryTimer;
+ /* 0x025C */ s16 hopTimer; // intervals of jumping
+ /* 0x025E */ s16 movementTimer; // intervals of changing location
+ /* 0x0260 */ s16 sootTimer; // cucco is covered in soot, smoke emmits
+ /* 0x0262 */ s16 cluckTimer; // intervals of clucking SFX
+ /* 0x0264 */ f32 headRotXTarget;
+ /* 0x0268 */ f32 rightWingRotXTarget;
+ /* 0x026C */ f32 leftWingRotXTarget;
/* 0x0270 */ char unk_270[0x8];
- /* 0x0278 */ f32 unk_278;
- /* 0x027C */ f32 unk_27C;
- /* 0x0284 */ f32 unk_280;
- /* 0x0280 */ f32 unk_284;
- /* 0x0288 */ f32 unk_288;
- /* 0x028C */ s16 unk_28C;
- /* 0x028E */ s16 unk_28E;
- /* 0x0290 */ s16 unk_290;
- /* 0x0292 */ s16 unk_292;
- /* 0x0294 */ s16 unk_294;
- /* 0x0296 */ s16 unk_296;
- /* 0x0298 */ s16 unk_298;
- /* 0x029C */ s16 unk_29A;
- /* 0x029C */ s16 unk_29C;
- /* 0x029E */ s16 unk_29E;
- /* 0x02A0 */ s16 unk_2A0;
- /* 0x02A4 */ Vec3f unk_2A4;
- /* 0x02B0 */ Vec3f unk_2B0;
- /* 0x02BC */ Vec3f unk_2BC;
- /* 0x02C8 */ Vec3f unk_2C8;
- /* 0x02D4 */ f32 unk_2D4;
- /* 0x02D8 */ f32 unk_2D8;
- /* 0x02DC */ Vec3f unk_2DC;
- /* 0x02E8 */ Vec3f unk_2E8;
- /* 0x02F4 */ f32 unk_2F4;
- /* 0x02F8 */ u8 unk_2F8;
+ /* 0x0278 */ f32 rightWingRotYTarget;
+ /* 0x027C */ f32 rightWingRotZTarget;
+ /* 0x0284 */ f32 leftWingRotYTarget;
+ /* 0x0280 */ f32 leftWingRotZTarget;
+ /* 0x0288 */ f32 unkArcheryFloat; // set, but never used. another rot target?
+ /* 0x028C */ s16 lifetime; // always ticks up, never read
+ /* 0x028E */ s16 headRotXState;
+ /* 0x0290 */ s16 unk_290; // set to 0, never read.
+ /* 0x0292 */ s16 wingsRotState;
+ /* 0x0294 */ s16 targetPosTimer;
+ /* 0x0296 */ s16 archeryAnimationType;
+ /* 0x0298 */ s16 rotYFlip;
+ /* 0x029C */ s16 archeryState; // state index for "Archery" action
+ /* 0x029C */ s16 isFalling; // set when hit in archery game
+ /* 0x029E */ s16 minigameType; // uses EnSyatekiMinigame from params
+ /* 0x02A0 */ s16 spawnFeathers; // triggers feather particles
+ /* 0x02A4 */ Vec3f leftWingRot;
+ /* 0x02B0 */ Vec3f rightWingRot;
+ /* 0x02BC */ Vec3f headRot;
+ /* 0x02C8 */ Vec3f posRotStep;
+ /* 0x02D4 */ f32 focusYOffset;
+ /* 0x02D8 */ f32 removeStateYaw;
+ /* 0x02DC */ Vec3f initPos;
+ /* 0x02E8 */ Vec3f targetPos;
+ /* 0x02F4 */ f32 scale;
+ /* 0x02F8 */ u8 unkAlleyHitByte; // Set when hit in Bombchu Alley. Never read.
/* 0x02FC */ ColliderCylinder collider;
- /* 0x0348 */ EnSyatekiNiwEffect effects[EN_SYATEKI_NIW_EFFECT_COUNT];
+ /* 0x0348 */ EnSyatekiNiwEffect effects[EN_SYATEKI_NIW_EFFECT_COUNT]; // feather particles
} EnSyatekiNiw; // size = 0x0460
+typedef enum {
+ SYATEKI_MINIGAME_ARCHERY, // unused archery game behavior
+ SYATEKI_MINIGAME_ALLEY // Bombchu Alley behavior
+} EnSyatekiMinigame;
+
#endif