port over unk renaming from upstream (#6470)

This commit is contained in:
Philip Dubé 2026-04-10 17:25:27 +00:00 committed by GitHub
parent c879c97066
commit 06b512faa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
124 changed files with 1958 additions and 1937 deletions

View file

@ -18,8 +18,8 @@ void Custom_EnMThunder_Update(Actor* thisx, PlayState* play) {
enMThunder->actionFunc(enMThunder, play); enMThunder->actionFunc(enMThunder, play);
// don't call this part, it's what makes the spin attack darkness happen // don't call this part, it's what makes the spin attack darkness happen
// func_80A9F314(play, this->unk_1BC); // func_80A9F314(play, this->dimmingIntensity);
blueRadius = enMThunder->unk_1AC; blueRadius = enMThunder->spinAttackTimer;
redGreen = (u32)(blueRadius * 255.0f) & 0xFF; redGreen = (u32)(blueRadius * 255.0f) & 0xFF;
Lights_PointNoGlowSetInfo(&enMThunder->lightInfo, enMThunder->actor.world.pos.x, enMThunder->actor.world.pos.y, Lights_PointNoGlowSetInfo(&enMThunder->lightInfo, enMThunder->actor.world.pos.x, enMThunder->actor.world.pos.y,
enMThunder->actor.world.pos.z, redGreen, redGreen, (u32)(blueRadius * 100.0f), enMThunder->actor.world.pos.z, redGreen, redGreen, (u32)(blueRadius * 100.0f),

View file

@ -19,9 +19,8 @@ void RegisterWideShutterDoorRange() {
COND_VB_SHOULD(VB_BE_NEAR_DOOR_SHUTTER, CVAR_WIDE_SHUTTER_DOOR_RANGE_VALUE, { COND_VB_SHOULD(VB_BE_NEAR_DOOR_SHUTTER, CVAR_WIDE_SHUTTER_DOOR_RANGE_VALUE, {
DoorShutter* doorShutter = va_arg(args, DoorShutter*); DoorShutter* doorShutter = va_arg(args, DoorShutter*);
Vec3f relPlayerPos = *va_arg(args, Vec3f*); Vec3f relPlayerPos = *va_arg(args, Vec3f*);
// Jabu-Jabu door, Phantom Ganon bars, Gohma door, or boss door if (doorShutter->gfxType == SHUTTER_BACK_LOCKED || doorShutter->gfxType == SHUTTER_PG_BARS ||
if (doorShutter->unk_16C == 3 || doorShutter->unk_16C == 4 || doorShutter->unk_16C == 5 || doorShutter->gfxType == SHUTTER_BOSS || doorShutter->gfxType == SHUTTER_GOHMA_BLOCK) {
doorShutter->unk_16C == 7) {
*should = (SHUTTER_DOOR_RANGE_X < fabsf(relPlayerPos.x) || SHUTTER_DOOR_RANGE_Y < fabsf(relPlayerPos.y)); *should = (SHUTTER_DOOR_RANGE_X < fabsf(relPlayerPos.x) || SHUTTER_DOOR_RANGE_Y < fabsf(relPlayerPos.y));
} }
}); });

View file

@ -2490,7 +2490,7 @@ void RandomizerOnActorUpdateHandler(void* refActor) {
} else if (actor->id == ACTOR_DOOR_SHUTTER) { } else if (actor->id == ACTOR_DOOR_SHUTTER) {
DoorShutter* shutterDoor = reinterpret_cast<DoorShutter*>(actor); DoorShutter* shutterDoor = reinterpret_cast<DoorShutter*>(actor);
if (shutterDoor->doorType == SHUTTER_KEY_LOCKED) { if (shutterDoor->doorType == SHUTTER_KEY_LOCKED) {
shutterDoor->unk_16E = 0; shutterDoor->unlockTimer = 0;
} }
} else if (actor->id == ACTOR_DOOR_GERUDO) { } else if (actor->id == ACTOR_DOOR_GERUDO) {
DoorGerudo* gerudoDoor = reinterpret_cast<DoorGerudo*>(actor); DoorGerudo* gerudoDoor = reinterpret_cast<DoorGerudo*>(actor);

View file

@ -57,7 +57,7 @@ void EnMa1_EndTeachSong(EnMa1* enMa1, PlayState* play) {
enMa1->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; enMa1->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
play->msgCtx.ocarinaMode = OCARINA_MODE_04; play->msgCtx.ocarinaMode = OCARINA_MODE_04;
enMa1->actionFunc = func_80AA0D88; enMa1->actionFunc = func_80AA0D88;
enMa1->unk_1E0 = 1; enMa1->singingDisabled = 1;
enMa1->interactInfo.talkState = NPC_TALK_STATE_IDLE; enMa1->interactInfo.talkState = NPC_TALK_STATE_IDLE;
return; return;
} }

View file

@ -322,7 +322,7 @@ void Anchor::RegisterHooks() {
DoorShutter* actor = static_cast<DoorShutter*>(refActor); DoorShutter* actor = static_cast<DoorShutter*>(refActor);
if (Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) { if (Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) {
DECR(actor->unk_16E); DECR(actor->unlockTimer);
} }
}); });

View file

@ -21,8 +21,8 @@ typedef struct {
/* 0x30 */ f32 scale; /* 0x30 */ f32 scale;
/* 0x34 */ s16 timer; // lifetime /* 0x34 */ s16 timer; // lifetime
/* 0x36 */ s16 type; // 0 is general radiance, else is directed towards Player /* 0x36 */ s16 type; // 0 is general radiance, else is directed towards Player
/* 0x36 */ f32 pitch; /* 0x38 */ f32 pitch;
/* 0x36 */ f32 yaw; /* 0x3C */ f32 yaw;
/* 0x40 */ f32 roll; /* 0x40 */ f32 roll;
/* 0x44 */ u32 epoch; /* 0x44 */ u32 epoch;
} BgDyYoseizoParticle; // size = 0x48 } BgDyYoseizoParticle; // size = 0x48
@ -48,7 +48,7 @@ typedef struct BgDyYoseizo {
/* 0x02FA */ s16 unusedTimer; /* 0x02FA */ s16 unusedTimer;
/* 0x02FC */ s16 animationChanged; /* 0x02FC */ s16 animationChanged;
/* 0x02FE */ s16 finishedSpinGrow; /* 0x02FE */ s16 finishedSpinGrow;
/* 0x02FE */ s16 itemSpawned; /* 0x0300 */ s16 itemSpawned;
/* 0x0302 */ s16 healingTimer; /* 0x0302 */ s16 healingTimer;
/* 0x0304 */ s16 warpEffectSpawned; /* 0x0304 */ s16 warpEffectSpawned;
/* 0x0306 */ s16 refillTimer; /* 0x0306 */ s16 refillTimer;

View file

@ -60,7 +60,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) {
CollisionHeader* colHeader = NULL; CollisionHeader* colHeader = NULL;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->unk_168 = (thisx->params >> 8) & 0xFF; this->switchFlag = (thisx->params >> 8) & 0xFF;
thisx->params &= 0xFF; thisx->params &= 0xFF;
if (thisx->params == 2) { if (thisx->params == 2) {
@ -74,13 +74,13 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) {
if (thisx->params == 0) { if (thisx->params == 0) {
CollisionHeader_GetVirtual(&object_haka_objects_Col_009168, &colHeader); CollisionHeader_GetVirtual(&object_haka_objects_Col_009168, &colHeader);
thisx->flags |= ACTOR_FLAG_REACT_TO_LENS; thisx->flags |= ACTOR_FLAG_REACT_TO_LENS;
this->unk_16A = 20; this->timer = 20;
this->actionFunc = func_8087DFF8; this->actionFunc = func_8087DFF8;
} else if (thisx->params == 3) { } else if (thisx->params == 3) {
CollisionHeader_GetVirtual(&object_haka_objects_Col_000118, &colHeader); CollisionHeader_GetVirtual(&object_haka_objects_Col_000118, &colHeader);
thisx->home.pos.y += 100.0f; thisx->home.pos.y += 100.0f;
if (Flags_GetSwitch(play, this->unk_168)) { if (Flags_GetSwitch(play, this->switchFlag)) {
this->actionFunc = func_8087E34C; this->actionFunc = func_8087E34C;
thisx->world.pos.y = thisx->home.pos.y; thisx->world.pos.y = thisx->home.pos.y;
} else { } else {
@ -89,7 +89,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) {
} }
} else { } else {
CollisionHeader_GetVirtual(&object_haka_objects_Col_00A7F4, &colHeader); CollisionHeader_GetVirtual(&object_haka_objects_Col_00A7F4, &colHeader);
this->unk_16A = 80; this->timer = 80;
this->actionFunc = func_8087E10C; this->actionFunc = func_8087E10C;
thisx->uncullZoneScale = 3000.0f; thisx->uncullZoneScale = 3000.0f;
thisx->uncullZoneDownward = 3000.0f; thisx->uncullZoneDownward = 3000.0f;
@ -106,12 +106,12 @@ void BgHakaMeganeBG_Destroy(Actor* thisx, PlayState* play) {
} }
void func_8087DFF8(BgHakaMeganeBG* this, PlayState* play) { void func_8087DFF8(BgHakaMeganeBG* this, PlayState* play) {
if (this->unk_16A != 0) { if (this->timer != 0) {
this->unk_16A--; this->timer--;
} }
if (this->unk_16A == 0) { if (this->timer == 0) {
this->unk_16A = 40; this->timer = 40;
this->dyna.actor.world.rot.y += 0x8000; this->dyna.actor.world.rot.y += 0x8000;
this->actionFunc = func_8087E040; this->actionFunc = func_8087E040;
} }
@ -120,11 +120,11 @@ void func_8087DFF8(BgHakaMeganeBG* this, PlayState* play) {
void func_8087E040(BgHakaMeganeBG* this, PlayState* play) { void func_8087E040(BgHakaMeganeBG* this, PlayState* play) {
f32 xSub; f32 xSub;
if (this->unk_16A != 0) { if (this->timer != 0) {
this->unk_16A--; this->timer--;
} }
xSub = (sinf(((this->unk_16A * 0.025f) + 0.5f) * M_PI) + 1.0f) * 160.0f; xSub = (sinf(((this->timer * 0.025f) + 0.5f) * M_PI) + 1.0f) * 160.0f;
if (this->dyna.actor.world.rot.y != this->dyna.actor.shape.rot.y) { if (this->dyna.actor.world.rot.y != this->dyna.actor.shape.rot.y) {
xSub = 320.0f - xSub; xSub = 320.0f - xSub;
@ -132,8 +132,8 @@ void func_8087E040(BgHakaMeganeBG* this, PlayState* play) {
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - xSub; this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - xSub;
if (this->unk_16A == 0) { if (this->timer == 0) {
this->unk_16A = 20; this->timer = 20;
this->actionFunc = func_8087DFF8; this->actionFunc = func_8087DFF8;
} }
} }
@ -147,8 +147,8 @@ void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) {
this->dyna.actor.velocity.y = this->dyna.actor.velocity.y; this->dyna.actor.velocity.y = this->dyna.actor.velocity.y;
} }
if (this->unk_16A != 0) { if (this->timer != 0) {
this->unk_16A--; this->timer--;
} }
if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 640.0f, if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 640.0f,
@ -156,8 +156,8 @@ void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) {
func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG);
} }
if (this->unk_16A == 0) { if (this->timer == 0) {
this->unk_16A = 120; this->timer = 120;
this->actionFunc = func_8087E1E0; this->actionFunc = func_8087E1E0;
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
} }
@ -167,12 +167,12 @@ void func_8087E1E0(BgHakaMeganeBG* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f); Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f);
func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG);
if (this->unk_16A != 0) { if (this->timer != 0) {
this->unk_16A--; this->timer--;
} }
if (this->unk_16A == 0) { if (this->timer == 0) {
this->unk_16A = 80; this->timer = 80;
this->actionFunc = func_8087E10C; this->actionFunc = func_8087E10C;
} }
} }
@ -183,7 +183,7 @@ void func_8087E258(BgHakaMeganeBG* this, PlayState* play) {
} }
void func_8087E288(BgHakaMeganeBG* this, PlayState* play) { void func_8087E288(BgHakaMeganeBG* this, PlayState* play) {
if (Flags_GetSwitch(play, this->unk_168)) { if (Flags_GetSwitch(play, this->switchFlag)) {
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
this->actionFunc = func_8087E2D8; this->actionFunc = func_8087E2D8;
} }

View file

@ -11,8 +11,8 @@ typedef void (*BgHakaMeganeBGActionFunc)(struct BgHakaMeganeBG*, PlayState*);
typedef struct BgHakaMeganeBG { typedef struct BgHakaMeganeBG {
/* 0x0000 */ DynaPolyActor dyna; /* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgHakaMeganeBGActionFunc actionFunc; /* 0x0164 */ BgHakaMeganeBGActionFunc actionFunc;
/* 0x0168 */ u8 unk_168; /* 0x0168 */ u8 switchFlag;
/* 0x016A */ s16 unk_16A; /* 0x016A */ s16 timer;
} BgHakaMeganeBG; // size = 0x016C } BgHakaMeganeBG; // size = 0x016C
#endif #endif

View file

@ -200,7 +200,7 @@ void BgHakaTrap_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->colliderCylinder); Collider_DestroyCylinder(play, &this->colliderCylinder);
} }
Audio_StopSfxByPos(&this->unk_16C); Audio_StopSfxByPos(&this->chainLiftSfxPos);
} }
void func_8087FFC0(BgHakaTrap* this, PlayState* play) { void func_8087FFC0(BgHakaTrap* this, PlayState* play) {
@ -406,9 +406,10 @@ void func_808808F4(BgHakaTrap* this, PlayState* play) {
} }
if (this->timer > 20) { if (this->timer > 20) {
this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->unk_16A, 15.0f); this->isSpikedCrusherStationary = Math_StepToF(&this->dyna.actor.world.pos.y, this->unk_16A, 15.0f);
} else { } else {
this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 20.0f); this->isSpikedCrusherStationary =
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 20.0f);
} }
if (this->timer == 0) { if (this->timer == 0) {
@ -539,13 +540,13 @@ void BgHakaTrap_Draw(Actor* thisx, PlayState* play) {
func_80026608(play); func_80026608(play);
} }
if ((this->actionFunc == func_808808F4) && !this->unk_169) { if ((this->actionFunc == func_808808F4) && !this->isSpikedCrusherStationary) {
sp2C.x = this->dyna.actor.world.pos.x; sp2C.x = this->dyna.actor.world.pos.x;
sp2C.z = this->dyna.actor.world.pos.z; sp2C.z = this->dyna.actor.world.pos.z;
sp2C.y = this->dyna.actor.world.pos.y + 110.0f; sp2C.y = this->dyna.actor.world.pos.y + 110.0f;
SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &sp2C, &this->unk_16C); SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &sp2C, &this->chainLiftSfxPos);
Sfx_PlaySfxAtPos(&this->unk_16C, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); Sfx_PlaySfxAtPos(&this->chainLiftSfxPos, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG);
} }
} }

View file

@ -21,9 +21,9 @@ typedef struct BgHakaTrap {
/* 0x0000 */ DynaPolyActor dyna; /* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgHakaTrapActionFunc actionFunc; /* 0x0164 */ BgHakaTrapActionFunc actionFunc;
/* 0x0168 */ u8 timer; /* 0x0168 */ u8 timer;
/* 0x0169 */ u8 unk_169; /* 0x0169 */ u8 isSpikedCrusherStationary;
/* 0x016A */ s16 unk_16A; // used as boolean for HAKA_TRAP_GUILLOTINE_SLOW/FAST, s16 for HAKA_TRAP_SPIKED_BOX /* 0x016A */ s16 unk_16A; // used as boolean for HAKA_TRAP_GUILLOTINE_SLOW/FAST, s16 for HAKA_TRAP_SPIKED_BOX
/* 0x016C */ Vec3f unk_16C; /* 0x016C */ Vec3f chainLiftSfxPos;
/* 0x0178 */ ColliderCylinder colliderCylinder; /* 0x0178 */ ColliderCylinder colliderCylinder;
/* 0x01C4 */ ColliderTris colliderSpikes; /* 0x01C4 */ ColliderTris colliderSpikes;
/* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2]; /* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2];

View file

@ -127,15 +127,15 @@ void BgHidanFslift_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play); this->actionFunc(this, play);
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_16A == 0) { if (this->cameraSetting == 0) {
this->unk_16A = 3; this->cameraSetting = 3;
} }
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM); Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM);
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_16A != 0) { if (this->cameraSetting != 0) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0); Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
} }
this->unk_16A = 0; this->cameraSetting = 0;
} }
} }

View file

@ -12,7 +12,7 @@ typedef struct BgHidanFslift {
/* 0x0000 */ DynaPolyActor dyna; /* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgHidanFsliftActionFunc actionFunc; /* 0x0164 */ BgHidanFsliftActionFunc actionFunc;
/* 0x0168 */ s16 timer; /* 0x0168 */ s16 timer;
/* 0x016A */ s16 unk_16A; /* 0x016A */ s16 cameraSetting;
} BgHidanFslift; // size = 0x016C } BgHidanFslift; // size = 0x016C
#endif #endif

View file

@ -185,11 +185,11 @@ void func_808B7AFC(BgSpot18Basket* this, PlayState* play) {
void func_808B7B58(BgSpot18Basket* this) { void func_808B7B58(BgSpot18Basket* this) {
this->actionFunc = func_808B7B6C; this->actionFunc = func_808B7B6C;
this->unk_216 = 0; this->timer = 0;
} }
void func_808B7B6C(BgSpot18Basket* this, PlayState* play) { void func_808B7B6C(BgSpot18Basket* this, PlayState* play) {
if (this->unk_216 > 20) { if (this->timer > 20) {
func_808B7BB0(this); func_808B7BB0(this);
this->dyna.actor.child->parent = NULL; this->dyna.actor.child->parent = NULL;
this->dyna.actor.child = NULL; this->dyna.actor.child = NULL;
@ -198,24 +198,26 @@ void func_808B7B6C(BgSpot18Basket* this, PlayState* play) {
void func_808B7BB0(BgSpot18Basket* this) { void func_808B7BB0(BgSpot18Basket* this) {
this->actionFunc = func_808B7BCC; this->actionFunc = func_808B7BCC;
this->unk_210 = this->unk_20C = 0; this->spinRate = this->circleRate = 0;
} }
void func_808B7BCC(BgSpot18Basket* this, PlayState* play) { void func_808B7BCC(BgSpot18Basket* this, PlayState* play) {
f32 positionDiff; f32 positionDiff;
Actor* colliderBaseAc; Actor* colliderBaseAc;
Math_StepToS(&this->unk_210, 0x1F4, 0x1E); Math_StepToS(&this->spinRate, 0x1F4, 0x1E);
this->dyna.actor.shape.rot.y += this->unk_210; this->dyna.actor.shape.rot.y += this->spinRate;
Math_StepToF(&this->unk_208, 50.0f, 1.5f); Math_StepToF(&this->circleRadius, 50.0f, 1.5f);
Math_StepToS(&this->unk_20C, 400, 15); Math_StepToS(&this->circleRate, 400, 15);
this->unk_20E += this->unk_20C; this->circleMoveAngle += this->circleRate;
this->dyna.actor.world.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.x =
this->dyna.actor.world.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.z; (Math_SinS(this->circleMoveAngle) * this->circleRadius) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z =
(Math_CosS(this->circleMoveAngle) * this->circleRadius) + this->dyna.actor.home.pos.z;
if (this->colliderJntSph.base.acFlags & AC_HIT) { if (this->colliderJntSph.base.acFlags & AC_HIT) {
colliderBaseAc = this->colliderJntSph.base.ac; colliderBaseAc = this->colliderJntSph.base.ac;
@ -238,53 +240,55 @@ void func_808B7BCC(BgSpot18Basket* this, PlayState* play) {
void func_808B7D38(BgSpot18Basket* this) { void func_808B7D38(BgSpot18Basket* this) {
this->actionFunc = func_808B7D50; this->actionFunc = func_808B7D50;
this->unk_216 = 0; this->timer = 0;
this->unk_214 = 0; this->pivotAltitude = 0;
} }
void func_808B7D50(BgSpot18Basket* this, PlayState* play) { void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
f32 tempValue2; f32 tempValue2;
f32 tempValue; f32 tempValue;
if (this->unk_216 > 120) { if (this->timer > 120) {
Math_StepToS(&this->unk_210, 0x3E8, 0x32); Math_StepToS(&this->spinRate, 0x3E8, 0x32);
} else { } else {
Math_StepToS(&this->unk_210, 0xBB8, 0x64); Math_StepToS(&this->spinRate, 0xBB8, 0x64);
} }
this->dyna.actor.shape.rot.y = this->dyna.actor.shape.rot.y + this->unk_210; this->dyna.actor.shape.rot.y = this->dyna.actor.shape.rot.y + this->spinRate;
if (this->unk_216 < 70) { if (this->timer < 70) {
Math_StepToF(&this->unk_208, 100.0f, 2.0f); Math_StepToF(&this->circleRadius, 100.0f, 2.0f);
} else { } else {
Math_StepToF(&this->unk_208, 0.0f, 2.0f); Math_StepToF(&this->circleRadius, 0.0f, 2.0f);
} }
Math_StepToS(&this->unk_20C, 1000, 20); Math_StepToS(&this->circleRate, 1000, 20);
this->unk_20E += this->unk_20C; this->circleMoveAngle += this->circleRate;
this->dyna.actor.world.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.x =
this->dyna.actor.world.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.z; (Math_SinS(this->circleMoveAngle) * this->circleRadius) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z =
(Math_CosS(this->circleMoveAngle) * this->circleRadius) + this->dyna.actor.home.pos.z;
this->unk_212 += 0xBB8; this->pivotAzimuth += 0xBB8;
Math_StepToS(&this->unk_214, 0x5DC, 0x1E); Math_StepToS(&this->pivotAltitude, 0x5DC, 0x1E);
this->dyna.actor.shape.rot.x = Math_CosS(this->unk_212) * this->unk_214; this->dyna.actor.shape.rot.x = Math_CosS(this->pivotAzimuth) * this->pivotAltitude;
this->dyna.actor.shape.rot.z = -Math_SinS(this->unk_212) * this->unk_214; this->dyna.actor.shape.rot.z = -Math_SinS(this->pivotAzimuth) * this->pivotAltitude;
if (this->unk_216 > 140) { if (this->timer > 140) {
func_808B7F74(this); func_808B7F74(this);
} }
if (this->unk_216 < 80) { if (this->timer < 80) {
func_808B7770(this, play, 1.0f); func_808B7770(this, play, 1.0f);
} else { } else {
func_808B7770(this, play, 0.8f); func_808B7770(this, play, 0.8f);
} }
tempValue2 = (this->unk_210 - 500) * 0.0006f; tempValue2 = (this->spinRate - 500) * 0.0006f;
tempValue = CLAMP(tempValue2, 0.0f, 1.5f); tempValue = CLAMP(tempValue2, 0.0f, 1.5f);
@ -298,14 +302,14 @@ void func_808B7F74(BgSpot18Basket* this) {
this->actionFunc = func_808B7FC0; this->actionFunc = func_808B7FC0;
if (GameInteractor_Should(VB_WIN_GORON_POT, (shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19))) { if (GameInteractor_Should(VB_WIN_GORON_POT, (shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19))) {
this->unk_218 = 2; this->prize = 2;
} else if (shapeRotY < 0x26C2) { } else if (shapeRotY < 0x26C2) {
this->unk_218 = 1; this->prize = 1;
} else { } else {
this->unk_218 = 0; this->prize = 0;
} }
this->unk_216 = 0; this->timer = 0;
} }
void func_808B7FC0(BgSpot18Basket* this, PlayState* play) { void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
@ -315,22 +319,22 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
s16 arrayValue; s16 arrayValue;
f32 clampedTempUnk210; f32 clampedTempUnk210;
this->unk_212 += 0xBB8; this->pivotAzimuth += 0xBB8;
if (this->unk_216 >= 13) { if (this->timer >= 13) {
tempUnk214 = Math_StepToS(&this->unk_214, 0, 55); tempUnk214 = Math_StepToS(&this->pivotAltitude, 0, 55);
} else { } else {
tempUnk214 = 0; tempUnk214 = 0;
} }
this->dyna.actor.shape.rot.x = Math_CosS(this->unk_212) * this->unk_214; this->dyna.actor.shape.rot.x = Math_CosS(this->pivotAzimuth) * this->pivotAltitude;
this->dyna.actor.shape.rot.z = -Math_SinS(this->unk_212) * this->unk_214; this->dyna.actor.shape.rot.z = -Math_SinS(this->pivotAzimuth) * this->pivotAltitude;
Math_StepToS(&this->unk_210, 0x1F4, 0xA); Math_StepToS(&this->spinRate, 0x1F4, 0xA);
this->dyna.actor.shape.rot.y += this->unk_210; this->dyna.actor.shape.rot.y += this->spinRate;
if (tempUnk214 != 0) { if (tempUnk214 != 0) {
arrayValue = D_808B85C8[this->unk_218]; arrayValue = D_808B85C8[this->prize];
if ((s16)(this->dyna.actor.shape.rot.y - arrayValue) >= 0) { if ((s16)(this->dyna.actor.shape.rot.y - arrayValue) >= 0) {
this->dyna.actor.shape.rot.y = arrayValue; this->dyna.actor.shape.rot.y = arrayValue;
@ -340,13 +344,13 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
} }
} }
if (this->unk_216 < 30) { if (this->timer < 30) {
func_808B7770(this, play, 0.5f); func_808B7770(this, play, 0.5f);
} else { } else {
func_808B7770(this, play, 0.3f); func_808B7770(this, play, 0.3f);
} }
tempUnk210 = (this->unk_210 - 500) * 0.0006f; tempUnk210 = (this->spinRate - 500) * 0.0006f;
clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f); clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f);
@ -355,7 +359,7 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
void func_808B818C(BgSpot18Basket* this) { void func_808B818C(BgSpot18Basket* this) {
this->actionFunc = func_808B81A0; this->actionFunc = func_808B81A0;
this->unk_216 = 0; this->timer = 0;
} }
static s16 D_808B85E4[] = { -0x0FA0, 0x0320, 0x0FA0 }; static s16 D_808B85E4[] = { -0x0FA0, 0x0320, 0x0FA0 };
@ -366,12 +370,12 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
Vec3f tempVector; Vec3f tempVector;
EnItem00* collectible; EnItem00* collectible;
if (this->unk_216 == 1) { if (this->timer == 1) {
tempVector.x = actor->world.pos.x; tempVector.x = actor->world.pos.x;
tempVector.y = actor->world.pos.y + 170.0f; tempVector.y = actor->world.pos.y + 170.0f;
tempVector.z = actor->world.pos.z; tempVector.z = actor->world.pos.z;
if (this->unk_218 == 0) { if (this->prize == 0) {
for (i = 0; i < ARRAY_COUNT(D_808B85E4); i++) { for (i = 0; i < ARRAY_COUNT(D_808B85E4); i++) {
collectible = Item_DropCollectible(play, &tempVector, ITEM00_BOMBS_A); collectible = Item_DropCollectible(play, &tempVector, ITEM00_BOMBS_A);
if (collectible != NULL) { if (collectible != NULL) {
@ -379,7 +383,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
collectible->actor.world.rot.y = D_808B85E4[i]; collectible->actor.world.rot.y = D_808B85E4[i];
} }
} }
} else if (this->unk_218 == 1) { } else if (this->prize == 1) {
for (i = 0; i < ARRAY_COUNT(D_808B85E4); i++) { for (i = 0; i < ARRAY_COUNT(D_808B85E4); i++) {
collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_GREEN); collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_GREEN);
if (collectible != NULL) { if (collectible != NULL) {
@ -387,8 +391,8 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
collectible->actor.world.rot.y = D_808B85E4[i]; collectible->actor.world.rot.y = D_808B85E4[i];
} }
} }
} else if (this->unk_218 == 2) { } else if (this->prize == 2) {
if ((this->unk_21A != 0) || Flags_GetCollectible(play, (actor->params & 0x3F))) { if ((this->isHeartPieceGiven != 0) || Flags_GetCollectible(play, (actor->params & 0x3F))) {
collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_PURPLE); collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_PURPLE);
if (collectible != NULL) { if (collectible != NULL) {
collectible->actor.velocity.y = 11.0f; collectible->actor.velocity.y = 11.0f;
@ -400,7 +404,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
if (collectible != NULL) { if (collectible != NULL) {
collectible->actor.velocity.y = 11.0f; collectible->actor.velocity.y = 11.0f;
collectible->actor.world.rot.y = D_808B85E4[1]; collectible->actor.world.rot.y = D_808B85E4[1];
this->unk_21A = 1; this->isHeartPieceGiven = 1;
} }
} }
@ -416,13 +420,13 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
collectible->actor.world.rot.y = D_808B85E4[2]; collectible->actor.world.rot.y = D_808B85E4[2];
} }
} }
} else if (this->unk_216 == 2) { } else if (this->timer == 2) {
if (this->unk_218 == 2) { if (this->prize == 2) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
} else { } else {
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
} }
} else if (this->unk_216 == 200) { } else if (this->timer == 200) {
func_808B7BB0(this); func_808B7BB0(this);
} }
} }
@ -432,7 +436,7 @@ void BgSpot18Basket_Update(Actor* thisx, PlayState* play) {
BgSpot18Basket* this = (BgSpot18Basket*)thisx; BgSpot18Basket* this = (BgSpot18Basket*)thisx;
s32 bgId; s32 bgId;
this->unk_216++; this->timer++;
this->actionFunc(this, play); this->actionFunc(this, play);
this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId,
&this->dyna.actor, &this->dyna.actor.world.pos); &this->dyna.actor, &this->dyna.actor.world.pos);

View file

@ -13,16 +13,16 @@ typedef struct BgSpot18Basket {
/* 0x0164 */ ColliderJntSph colliderJntSph; /* 0x0164 */ ColliderJntSph colliderJntSph;
/* 0x0184 */ ColliderJntSphElement ColliderJntSphElements[2]; /* 0x0184 */ ColliderJntSphElement ColliderJntSphElements[2];
/* 0x0204 */ BgSpot18BasketActionFunc actionFunc; /* 0x0204 */ BgSpot18BasketActionFunc actionFunc;
/* 0x0208 */ f32 unk_208; /* 0x0208 */ f32 circleRadius;
/* 0x020C */ s16 unk_20C; /* 0x020C */ s16 circleRate;
/* 0x020E */ s16 unk_20E; /* 0x020E */ s16 circleMoveAngle;
/* 0x0210 */ s16 unk_210; /* 0x0210 */ s16 spinRate;
/* 0x0212 */ s16 unk_212; /* 0x0212 */ s16 pivotAzimuth;
/* 0x0214 */ s16 unk_214; /* 0x0214 */ s16 pivotAltitude;
/* 0x0216 */ s16 unk_216; /* 0x0216 */ s16 timer;
/* 0x0218 */ s16 unk_218; /* 0x0218 */ s16 prize;
/* 0x021A */ u8 unk_21A; /* 0x021A */ u8 isHeartPieceGiven;
/* 0x021B */ u8 unk_21B; /* 0x021B */ u8 pad;
} BgSpot18Basket; // size = 0x021C } BgSpot18Basket; // size = 0x021C
#endif #endif

View file

@ -72,7 +72,7 @@ typedef struct BossDodongo {
/* 0x020C */ f32 unk_20C; /* 0x020C */ f32 unk_20C;
/* 0x0210 */ f32 colorFilterR; /* 0x0210 */ f32 colorFilterR;
/* 0x0214 */ f32 colorFilterG; /* 0x0214 */ f32 colorFilterG;
/* 0x0214 */ f32 colorFilterB; /* 0x0218 */ f32 colorFilterB;
/* 0x021C */ f32 colorFilterMin; /* 0x021C */ f32 colorFilterMin;
/* 0x0220 */ f32 colorFilterMax; /* 0x0220 */ f32 colorFilterMax;
/* 0x0224 */ f32 unk_224; /* 0x0224 */ f32 unk_224;

View file

@ -233,9 +233,9 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, objectIdx)) { if (Object_IsLoaded(&play->objectCtx, objectIdx)) {
func_80064520(play, &play->csCtx); func_80064520(play, &play->csCtx);
Player_SetCsActionWithHaltedActors(play, &this->actor, 8); Player_SetCsActionWithHaltedActors(play, &this->actor, 8);
this->unk_39E = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->unk_39E, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
sBossGanon2Zelda = (EnZl3*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ZL3, 970.0f, sBossGanon2Zelda = (EnZl3*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ZL3, 970.0f,
1086.0f, -200.0f, 0, 0, 0, 1); 1086.0f, -200.0f, 0, 0, 0, 1);
sBossGanon2Zelda->unk_3C8 = 0; sBossGanon2Zelda->unk_3C8 = 0;
@ -254,12 +254,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
sBossGanon2Zelda->unk_3C8 = 4; sBossGanon2Zelda->unk_3C8 = 4;
} }
this->unk_3BC.x = 0.0f; this->subCamUp.x = 0.0f;
this->unk_3BC.y = 1.0f; this->subCamUp.y = 1.0f;
this->unk_3BC.z = 0.0f; this->subCamUp.z = 0.0f;
this->unk_3A4.x = 0.0f; this->subCamEye.x = 0.0f;
this->unk_3A4.y = 1400.0f; this->subCamEye.y = 1400.0f;
this->unk_3A4.z = 1600.0f; this->subCamEye.z = 1600.0f;
player->actor.world.pos.x = 970.0f; player->actor.world.pos.x = 970.0f;
player->actor.world.pos.y = 1086.0f; player->actor.world.pos.y = 1086.0f;
player->actor.world.pos.z = -186.0f; player->actor.world.pos.z = -186.0f;
@ -268,7 +268,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
play->envCtx.unk_D8 = 0.0f; play->envCtx.unk_D8 = 0.0f;
// fake, tricks the compiler into allocating more stack // fake, tricks the compiler into allocating more stack
if (zero) { if (zero) {
this->unk_3A4.x *= 2.0; this->subCamEye.x *= 2.0;
} }
} else { } else {
break; break;
@ -278,12 +278,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
play->envCtx.unk_D8 = 0.0f; play->envCtx.unk_D8 = 0.0f;
} }
this->unk_339 = 3; this->unk_339 = 3;
Math_ApproachF(&this->unk_3A4.x, 1500.0f, 0.1f, this->unk_410.x * 1500.0f); Math_ApproachF(&this->subCamEye.x, 1500.0f, 0.1f, this->unk_410.x * 1500.0f);
Math_ApproachF(&this->unk_3A4.z, -160.0f, 0.1f, this->unk_410.x * 1760.0f); Math_ApproachF(&this->subCamEye.z, -160.0f, 0.1f, this->unk_410.x * 1760.0f);
Math_ApproachF(&this->unk_410.x, 0.0075f, 1.0f, 0.0001f); Math_ApproachF(&this->unk_410.x, 0.0075f, 1.0f, 0.0001f);
this->unk_3B0.x = -200.0f; this->subCamAt.x = -200.0f;
this->unk_3B0.y = 1086.0f; this->subCamAt.y = 1086.0f;
this->unk_3B0.z = -200.0f; this->subCamAt.z = -200.0f;
if (this->csTimer == 150) { if (this->csTimer == 150) {
Message_StartTextbox(play, 0x70D3, NULL); Message_StartTextbox(play, 0x70D3, NULL);
} }
@ -316,17 +316,17 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
sBossGanon2Zelda->unk_3C8 = 2; sBossGanon2Zelda->unk_3C8 = 2;
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x4F); Player_SetCsActionWithHaltedActors(play, &this->actor, 0x4F);
} }
this->unk_3A4.x = 930.0f; this->subCamEye.x = 930.0f;
this->unk_3A4.y = 1129.0f; this->subCamEye.y = 1129.0f;
this->unk_3A4.z = -181.0f; this->subCamEye.z = -181.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.z = (player->actor.world.pos.z - 15.0f) + 5.0f; this->subCamAt.z = (player->actor.world.pos.z - 15.0f) + 5.0f;
if (this->csTimer > 104) { if (this->csTimer > 104) {
Math_ApproachF(&this->unk_3B0.y, player->actor.world.pos.y + 47.0f + 7.0f + 15.0f, 0.1f, Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y + 47.0f + 7.0f + 15.0f, 0.1f,
this->unk_410.x); this->unk_410.x);
Math_ApproachF(&this->unk_410.x, 2.0f, 1.0f, 0.1f); Math_ApproachF(&this->unk_410.x, 2.0f, 1.0f, 0.1f);
} else { } else {
this->unk_3B0.y = player->actor.world.pos.y + 47.0f + 7.0f; this->subCamAt.y = player->actor.world.pos.y + 47.0f + 7.0f;
} }
if ((this->csTimer > 170) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) { if ((this->csTimer > 170) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) {
this->csState = 3; this->csState = 3;
@ -335,7 +335,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
} }
break; break;
case 3: case 3:
Math_ApproachF(&this->unk_3B0.y, player->actor.world.pos.y + 47.0f + 7.0f, 0.1f, 2.0f); Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y + 47.0f + 7.0f, 0.1f, 2.0f);
this->unk_339 = 4; this->unk_339 = 4;
if (this->csTimer == 10) { if (this->csTimer == 10) {
Sfx_PlaySfxAtPos(&D_80906D6C, NA_SE_EV_STONE_BOUND); Sfx_PlaySfxAtPos(&D_80906D6C, NA_SE_EV_STONE_BOUND);
@ -355,17 +355,17 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
break; break;
case 4: case 4:
this->unk_339 = 4; this->unk_339 = 4;
Math_ApproachF(&this->unk_3A4.x, -360.0f, 0.1f, this->unk_410.x * 1290.0f); Math_ApproachF(&this->subCamEye.x, -360.0f, 0.1f, this->unk_410.x * 1290.0f);
Math_ApproachF(&this->unk_3A4.z, -20.0f, 0.1f, this->unk_410.x * 170.0f); Math_ApproachF(&this->subCamEye.z, -20.0f, 0.1f, this->unk_410.x * 170.0f);
Math_ApproachF(&this->unk_410.x, 0.04f, 1.0f, 0.0005f); Math_ApproachF(&this->unk_410.x, 0.04f, 1.0f, 0.0005f);
if (this->csTimer == 100) { if (this->csTimer == 100) {
Camera* camera = Play_GetCamera(play, MAIN_CAM); Camera* camera = Play_GetCamera(play, MAIN_CAM);
camera->eye = this->unk_3A4; camera->eye = this->subCamEye;
camera->eyeNext = this->unk_3A4; camera->eyeNext = this->subCamEye;
camera->at = this->unk_3B0; camera->at = this->subCamAt;
func_800C08AC(play, this->unk_39E, 0); func_800C08AC(play, this->subCamId, 0);
this->unk_39E = 0; this->subCamId = 0;
func_80064534(play, &play->csCtx); func_80064534(play, &play->csCtx);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7); Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
this->csState = 5; this->csState = 5;
@ -379,9 +379,9 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
this->csState = 10; this->csState = 10;
this->csTimer = 0; this->csTimer = 0;
func_80064520(play, &play->csCtx); func_80064520(play, &play->csCtx);
this->unk_39E = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->unk_39E, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
} else { } else {
break; break;
} }
@ -394,12 +394,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
sBossGanon2Zelda->actor.world.pos.z = -186.0f; sBossGanon2Zelda->actor.world.pos.z = -186.0f;
player->actor.shape.rot.y = -0x4000; player->actor.shape.rot.y = -0x4000;
sBossGanon2Zelda->actor.shape.rot.y = -0x5000; sBossGanon2Zelda->actor.shape.rot.y = -0x5000;
this->unk_3A4.x = 410.0f; this->subCamEye.x = 410.0f;
this->unk_3A4.y = 1096.0f; this->subCamEye.y = 1096.0f;
this->unk_3A4.z = -110.0f; this->subCamEye.z = -110.0f;
this->unk_3B0.x = player->actor.world.pos.x + 10.0f; this->subCamAt.x = player->actor.world.pos.x + 10.0f;
this->unk_3B0.y = (player->actor.world.pos.y + 200.0f) - 160.0f; this->subCamAt.y = (player->actor.world.pos.y + 200.0f) - 160.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
if (this->csTimer >= 20) { if (this->csTimer >= 20) {
Sfx_PlaySfxCentered(NA_SE_EN_GOMA_LAST - SFX_FLAG); Sfx_PlaySfxCentered(NA_SE_EN_GOMA_LAST - SFX_FLAG);
Math_ApproachF(&this->unk_324, 255.0f, 1.0f, 10.0f); Math_ApproachF(&this->unk_324, 255.0f, 1.0f, 10.0f);
@ -431,12 +431,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
sBossGanon2Zelda->actor.world.pos.z = -186.0f; sBossGanon2Zelda->actor.world.pos.z = -186.0f;
player->actor.shape.rot.y = -0x4000; player->actor.shape.rot.y = -0x4000;
sBossGanon2Zelda->actor.shape.rot.y = -0x5000; sBossGanon2Zelda->actor.shape.rot.y = -0x5000;
this->unk_3A4.x = 450.0f; this->subCamEye.x = 450.0f;
this->unk_3A4.y = 1121.0f; this->subCamEye.y = 1121.0f;
this->unk_3A4.z = -158.0f; this->subCamEye.z = -158.0f;
this->unk_3B0.x = (player->actor.world.pos.x - 20.0f) + 2.0f; this->subCamAt.x = (player->actor.world.pos.x - 20.0f) + 2.0f;
this->unk_3B0.y = ((player->actor.world.pos.y + 200.0f) - 151.0f) - 2.0f; this->subCamAt.y = ((player->actor.world.pos.y + 200.0f) - 151.0f) - 2.0f;
this->unk_3B0.z = player->actor.world.pos.z + 2.0f; this->subCamAt.z = player->actor.world.pos.z + 2.0f;
if (this->csTimer == 10) { if (this->csTimer == 10) {
Sfx_PlaySfxAtPos(&D_80906D6C, NA_SE_EV_STONE_BOUND); Sfx_PlaySfxAtPos(&D_80906D6C, NA_SE_EV_STONE_BOUND);
} }
@ -455,11 +455,11 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
this->actor.world.pos.y = 1009.0f; this->actor.world.pos.y = 1009.0f;
this->actor.shape.yOffset = 7000.0f; this->actor.shape.yOffset = 7000.0f;
this->actor.world.rot.y = 0x5000; this->actor.world.rot.y = 0x5000;
this->unk_3A4.x = -60.0f; this->subCamEye.x = -60.0f;
this->unk_3A4.y = 1106.0f; this->subCamEye.y = 1106.0f;
this->unk_3A4.z = -200.0f; this->subCamEye.z = -200.0f;
this->unk_3B0.x = this->unk_3B0.z = -200.0f; this->subCamAt.x = this->subCamAt.z = -200.0f;
this->unk_3B0.y = this->actor.world.pos.y + 70.0f; this->subCamAt.y = this->actor.world.pos.y + 70.0f;
play->envCtx.unk_D8 = 0.0f; play->envCtx.unk_D8 = 0.0f;
play->envCtx.unk_BE = play->envCtx.unk_BD = 0; play->envCtx.unk_BE = play->envCtx.unk_BD = 0;
this->unk_339 = 0; this->unk_339 = 0;
@ -479,7 +479,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
} }
if (this->csTimer >= 30) { if (this->csTimer >= 30) {
Math_ApproachF(&this->actor.world.pos.y, 1289.0f, 0.1f, 10.0f); Math_ApproachF(&this->actor.world.pos.y, 1289.0f, 0.1f, 10.0f);
this->unk_3B0.y = this->actor.world.pos.y + 70.0f; this->subCamAt.y = this->actor.world.pos.y + 70.0f;
} }
if (Animation_OnFrame(&this->skelAnime, this->unk_194)) { if (Animation_OnFrame(&this->skelAnime, this->unk_194)) {
Animation_MorphToLoop(&this->skelAnime, &gGanondorfFloatingHeavyBreathingAnim, 0.0f); Animation_MorphToLoop(&this->skelAnime, &gGanondorfFloatingHeavyBreathingAnim, 0.0f);
@ -502,25 +502,25 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
sBossGanon2Zelda->actor.world.pos.x = 724.0f; sBossGanon2Zelda->actor.world.pos.x = 724.0f;
sBossGanon2Zelda->actor.world.pos.y = 1086.0f; sBossGanon2Zelda->actor.world.pos.y = 1086.0f;
sBossGanon2Zelda->actor.world.pos.z = -186.0f; sBossGanon2Zelda->actor.world.pos.z = -186.0f;
this->unk_3A4.x = this->actor.world.pos.x + -10.0f; this->subCamEye.x = this->actor.world.pos.x + -10.0f;
this->unk_3A4.y = this->actor.world.pos.y + 80.0f; this->subCamEye.y = this->actor.world.pos.y + 80.0f;
this->unk_3A4.z = this->actor.world.pos.z + 50.0f; this->subCamEye.z = this->actor.world.pos.z + 50.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = player->actor.world.pos.y; this->subCamAt.y = player->actor.world.pos.y;
this->unk_3B0.z = player->actor.world.pos.z - 200.0f; this->subCamAt.z = player->actor.world.pos.z - 200.0f;
if (this->csTimer == 20) { if (this->csTimer == 20) {
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x1E); Player_SetCsActionWithHaltedActors(play, &this->actor, 0x1E);
} }
if (this->csTimer == 60) { if (this->csTimer == 60) {
this->unk_3A4.x = (this->actor.world.pos.x + 200.0f) - 154.0f; this->subCamEye.x = (this->actor.world.pos.x + 200.0f) - 154.0f;
this->unk_3A4.y = this->actor.world.pos.y + 60.0f; this->subCamEye.y = this->actor.world.pos.y + 60.0f;
this->unk_3A4.z = this->actor.world.pos.z - 15.0f; this->subCamEye.z = this->actor.world.pos.z - 15.0f;
this->csState = 15; this->csState = 15;
this->csTimer = 0; this->csTimer = 0;
this->unk_3B0.y = this->actor.world.pos.y + 77.0f + 100.0f; this->subCamAt.y = this->actor.world.pos.y + 77.0f + 100.0f;
this->unk_314 = 2; this->unk_314 = 2;
this->unk_3B0.z = this->actor.world.pos.z + 5.0f; this->subCamAt.z = this->actor.world.pos.z + 5.0f;
this->unk_3B0.x = this->actor.world.pos.x; this->subCamAt.x = this->actor.world.pos.x;
} }
if ((play->gameplayFrames % 32) == 0) { if ((play->gameplayFrames % 32) == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BREATH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BREATH);
@ -531,7 +531,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BREATH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BREATH);
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachF(&this->unk_3B0.y, this->actor.world.pos.y + 77.0f, 0.05f, 5.0f); Math_ApproachF(&this->subCamAt.y, this->actor.world.pos.y + 77.0f, 0.05f, 5.0f);
if (this->csTimer >= 50) { if (this->csTimer >= 50) {
if (this->csTimer == 50) { if (this->csTimer == 50) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfShowTriforceStartAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfShowTriforceStartAnim, 0.0f);
@ -574,9 +574,9 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfTransformEndAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfTransformEndAnim, 0.0f);
this->unk_194 = 1000.0f; this->unk_194 = 1000.0f;
} }
Math_ApproachF(&this->unk_3A4.x, (this->actor.world.pos.x + 200.0f) - 90.0f, 0.1f, 6.3999996f); Math_ApproachF(&this->subCamEye.x, (this->actor.world.pos.x + 200.0f) - 90.0f, 0.1f, 6.3999996f);
Math_ApproachF(&this->unk_3A4.y, ((this->actor.world.pos.y + 60.0f) - 60.0f) - 70.0f, 0.1f, 13.0f); Math_ApproachF(&this->subCamEye.y, ((this->actor.world.pos.y + 60.0f) - 60.0f) - 70.0f, 0.1f, 13.0f);
Math_ApproachF(&this->unk_3B0.y, this->actor.world.pos.y + 40.0f, 0.1f, 3.6999998f); Math_ApproachF(&this->subCamAt.y, this->actor.world.pos.y + 40.0f, 0.1f, 3.6999998f);
if (this->csTimer == 30) { if (this->csTimer == 30) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BIGMASIC); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BIGMASIC);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_THROW_BIG); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_THROW_BIG);
@ -587,9 +587,9 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
if (this->csTimer >= 60) { if (this->csTimer >= 60) {
Camera* camera = Play_GetCamera(play, MAIN_CAM); Camera* camera = Play_GetCamera(play, MAIN_CAM);
camera->eye = this->unk_3A4; camera->eye = this->subCamEye;
camera->eyeNext = this->unk_3A4; camera->eyeNext = this->subCamEye;
camera->at = this->unk_3B0; camera->at = this->subCamAt;
this->csState = 17; this->csState = 17;
this->csTimer = 0; this->csTimer = 0;
this->unk_337 = 2; this->unk_337 = 2;
@ -610,29 +610,29 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
} }
// fake, tricks the compiler into using stack the way we need it to // fake, tricks the compiler into using stack the way we need it to
if (zero) { if (zero) {
Math_ApproachF(&this->unk_3B0.y, 0.0f, 0.0f, 0.0f); Math_ApproachF(&this->subCamAt.y, 0.0f, 0.0f, 0.0f);
} }
break; break;
case 17: case 17:
this->unk_339 = 6; this->unk_339 = 6;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->unk_3A4.x = player->actor.world.pos.x - 40.0f; this->subCamEye.x = player->actor.world.pos.x - 40.0f;
this->unk_3A4.y = player->actor.world.pos.y + 40.0f; this->subCamEye.y = player->actor.world.pos.y + 40.0f;
this->unk_3A4.z = player->actor.world.pos.z + 20.0f; this->subCamEye.z = player->actor.world.pos.z + 20.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = (player->actor.world.pos.y + 10.0f + 60.0f) - 30.0f; this->subCamAt.y = (player->actor.world.pos.y + 10.0f + 60.0f) - 30.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
if (this->csTimer == 25) { if (this->csTimer == 25) {
this->csState = 18; this->csState = 18;
this->csTimer = 0; this->csTimer = 0;
Animation_MorphToPlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim, 0.0f);
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
this->unk_3A4.x = ((this->actor.world.pos.x + 500.0f) - 350.0f) - 50.0f; this->subCamEye.x = ((this->actor.world.pos.x + 500.0f) - 350.0f) - 50.0f;
this->unk_3A4.y = this->actor.world.pos.y; this->subCamEye.y = this->actor.world.pos.y;
this->unk_3A4.z = this->actor.world.pos.z; this->subCamEye.z = this->actor.world.pos.z;
this->unk_3B0.x = this->actor.world.pos.x + 50.0f; this->subCamAt.x = this->actor.world.pos.x + 50.0f;
this->unk_3B0.y = this->actor.world.pos.y + 60.0f; this->subCamAt.y = this->actor.world.pos.y + 60.0f;
this->unk_3B0.z = this->actor.world.pos.z; this->subCamAt.z = this->actor.world.pos.z;
this->actor.world.rot.y = 0x4000; this->actor.world.rot.y = 0x4000;
} }
break; break;
@ -642,8 +642,8 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_GANON_BOSS); Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_GANON_BOSS);
} }
Math_ApproachF(&this->unk_30C, 7.0f, 1.0f, 0.1f); Math_ApproachF(&this->unk_30C, 7.0f, 1.0f, 0.1f);
Math_ApproachF(&this->unk_3A4.x, (this->actor.world.pos.x + 500.0f) - 350.0f, 0.1f, 1.0f); Math_ApproachF(&this->subCamEye.x, (this->actor.world.pos.x + 500.0f) - 350.0f, 0.1f, 1.0f);
Math_ApproachF(&this->unk_3B0.x, this->actor.world.pos.x, 0.1f, 1.0f); Math_ApproachF(&this->subCamAt.x, this->actor.world.pos.x, 0.1f, 1.0f);
Math_ApproachF(&this->unk_228, 1.0f, 0.1f, 0.02f); Math_ApproachF(&this->unk_228, 1.0f, 0.1f, 0.02f);
if (this->csTimer == 65) { if (this->csTimer == 65) {
this->csState = 19; this->csState = 19;
@ -675,13 +675,13 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
player->actor.world.pos.y = 1086.0f; player->actor.world.pos.y = 1086.0f;
player->actor.world.pos.z = -266.0f; player->actor.world.pos.z = -266.0f;
player->actor.shape.rot.y = -0x4000; player->actor.shape.rot.y = -0x4000;
this->unk_3A4.x = (player->actor.world.pos.x - 40.0f) - 200.0f; this->subCamEye.x = (player->actor.world.pos.x - 40.0f) - 200.0f;
this->unk_3A4.y = (player->actor.world.pos.y + 40.0f) - 30.0f; this->subCamEye.y = (player->actor.world.pos.y + 40.0f) - 30.0f;
this->unk_3A4.z = (player->actor.world.pos.z - 20.0f) + 100.0f; this->subCamEye.z = (player->actor.world.pos.z - 20.0f) + 100.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) + 30.0f; this->subCamAt.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) + 30.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
this->unk_3BC.x = 0.8f; this->subCamUp.x = 0.8f;
if (this->actor.world.pos.y <= 1099.0f) { if (this->actor.world.pos.y <= 1099.0f) {
this->actor.world.pos.y = 1099.0f; this->actor.world.pos.y = 1099.0f;
this->csState = 21; this->csState = 21;
@ -708,7 +708,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
if (this->csTimer < 60) { if (this->csTimer < 60) {
this->unk_339 = 7; this->unk_339 = 7;
} }
this->unk_3BC.x = 0.0f; this->subCamUp.x = 0.0f;
this->actor.world.pos.y = 1099.0f; this->actor.world.pos.y = 1099.0f;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachZeroF(&this->unk_30C, 1.0f, 0.1f); Math_ApproachZeroF(&this->unk_30C, 1.0f, 0.1f);
@ -724,12 +724,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
180, 128, 40, true); 180, 128, 40, true);
// It has translation but they are all the same. they all say "GANON" only // It has translation but they are all the same. they all say "GANON" only
} }
this->unk_3A4.x = ((this->actor.world.pos.x + 500.0f) - 350.0f) + 100.0f; this->subCamEye.x = ((this->actor.world.pos.x + 500.0f) - 350.0f) + 100.0f;
this->unk_3A4.y = this->actor.world.pos.y; this->subCamEye.y = this->actor.world.pos.y;
this->unk_3A4.z = this->actor.world.pos.z; this->subCamEye.z = this->actor.world.pos.z;
this->unk_3B0.x = this->actor.world.pos.x; this->subCamAt.x = this->actor.world.pos.x;
this->unk_3B0.z = this->actor.world.pos.z; this->subCamAt.z = this->actor.world.pos.z;
this->unk_3B0.y = (this->unk_1B8.y + 60.0f) - 40.0f; this->subCamAt.y = (this->unk_1B8.y + 60.0f) - 40.0f;
if (this->csTimer > 166 && this->csTimer < 173) { if (this->csTimer > 166 && this->csTimer < 173) {
this->unk_312 = 2; this->unk_312 = 2;
} }
@ -758,12 +758,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
Sfx_PlaySfxCentered(NA_SE_EN_MGANON_SWORD); Sfx_PlaySfxCentered(NA_SE_EN_MGANON_SWORD);
Sfx_PlaySfxCentered(NA_SE_EN_MGANON_ROAR); Sfx_PlaySfxCentered(NA_SE_EN_MGANON_ROAR);
} }
this->unk_3A4.x = (player->actor.world.pos.x - 40.0f) + 6.0f; this->subCamEye.x = (player->actor.world.pos.x - 40.0f) + 6.0f;
this->unk_3A4.y = player->actor.world.pos.y + 40.0f; this->subCamEye.y = player->actor.world.pos.y + 40.0f;
this->unk_3A4.z = (player->actor.world.pos.z + 20.0f) - 7.0f; this->subCamEye.z = (player->actor.world.pos.z + 20.0f) - 7.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) - 2.0f; this->subCamAt.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) - 2.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
if (this->csTimer == 228) { if (this->csTimer == 228) {
Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_SW); Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_SW);
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x56); Player_SetCsActionWithHaltedActors(play, &this->actor, 0x56);
@ -794,10 +794,10 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
if (1) { if (1) {
BossGanon2Effect* effect = play->specialEffects; BossGanon2Effect* effect = play->specialEffects;
this->unk_3B0 = effect->position; this->subCamAt = effect->position;
this->unk_3A4.x = effect->position.x + 70.0f; this->subCamEye.x = effect->position.x + 70.0f;
this->unk_3A4.y = effect->position.y - 30.0f; this->subCamEye.y = effect->position.y - 30.0f;
this->unk_3A4.z = effect->position.z + 70.0f; this->subCamEye.z = effect->position.z + 70.0f;
} }
if ((this->csTimer & 3) == 0) { if ((this->csTimer & 3) == 0) {
Sfx_PlaySfxCentered(NA_SE_IT_SWORD_SWING); Sfx_PlaySfxCentered(NA_SE_IT_SWORD_SWING);
@ -810,12 +810,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
break; break;
case 25: case 25:
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->unk_3A4.x = (player->actor.world.pos.x - 40.0f) + 80.0f; this->subCamEye.x = (player->actor.world.pos.x - 40.0f) + 80.0f;
this->unk_3A4.y = player->actor.world.pos.y + 40.0f + 10.0f; this->subCamEye.y = player->actor.world.pos.y + 40.0f + 10.0f;
this->unk_3A4.z = player->actor.world.pos.z + 20.0f + 10.0f; this->subCamEye.z = player->actor.world.pos.z + 20.0f + 10.0f;
this->unk_3B0.x = player->actor.world.pos.x - 20.0f; this->subCamAt.x = player->actor.world.pos.x - 20.0f;
this->unk_3B0.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) - 3.0f; this->subCamAt.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) - 3.0f;
this->unk_3B0.z = (player->actor.world.pos.z - 40.0f) - 10.0f; this->subCamAt.z = (player->actor.world.pos.z - 40.0f) - 10.0f;
if (this->csTimer == 10) { if (this->csTimer == 10) {
BossGanon2Effect* effect = play->specialEffects; BossGanon2Effect* effect = play->specialEffects;
@ -832,13 +832,13 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
break; break;
} }
case 26: case 26:
this->unk_3A4.x = sBossGanon2Zelda->actor.world.pos.x + 100.0f + 30.0f; this->subCamEye.x = sBossGanon2Zelda->actor.world.pos.x + 100.0f + 30.0f;
this->unk_3A4.y = sBossGanon2Zelda->actor.world.pos.y + 10.0f; this->subCamEye.y = sBossGanon2Zelda->actor.world.pos.y + 10.0f;
this->unk_3A4.z = sBossGanon2Zelda->actor.world.pos.z + 5.0f; this->subCamEye.z = sBossGanon2Zelda->actor.world.pos.z + 5.0f;
this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; this->subCamAt.x = sBossGanon2Zelda->actor.world.pos.x;
this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f; this->subCamAt.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f;
this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z - 20.0f; this->subCamAt.z = sBossGanon2Zelda->actor.world.pos.z - 20.0f;
this->unk_3BC.z = -0.5f; this->subCamUp.z = -0.5f;
if (this->csTimer == 13) { if (this->csTimer == 13) {
sBossGanon2Zelda->unk_3C8 = 6; sBossGanon2Zelda->unk_3C8 = 6;
} }
@ -848,26 +848,26 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
} }
break; break;
case 27: case 27:
this->unk_3BC.z = 0.0f; this->subCamUp.z = 0.0f;
if (this->csTimer == 4) { if (this->csTimer == 4) {
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x58); Player_SetCsActionWithHaltedActors(play, &this->actor, 0x58);
} }
this->unk_3A4.x = player->actor.world.pos.x - 20.0f; this->subCamEye.x = player->actor.world.pos.x - 20.0f;
this->unk_3A4.y = player->actor.world.pos.y + 50.0f; this->subCamEye.y = player->actor.world.pos.y + 50.0f;
this->unk_3A4.z = player->actor.world.pos.z; this->subCamEye.z = player->actor.world.pos.z;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = player->actor.world.pos.y + 50.0f; this->subCamAt.y = player->actor.world.pos.y + 50.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
if (this->csTimer == 26) { if (this->csTimer == 26) {
D_8090EB30 = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; D_8090EB30 = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head;
while (D_8090EB30 != NULL) { while (D_8090EB30 != NULL) {
if (D_8090EB30->id == ACTOR_EN_ELF) { if (D_8090EB30->id == ACTOR_EN_ELF) {
this->unk_3A4.x = D_8090EB30->world.pos.x - 30.0f; this->subCamEye.x = D_8090EB30->world.pos.x - 30.0f;
this->unk_3A4.y = D_8090EB30->world.pos.y; this->subCamEye.y = D_8090EB30->world.pos.y;
this->unk_3A4.z = D_8090EB30->world.pos.z; this->subCamEye.z = D_8090EB30->world.pos.z;
this->unk_3B0.x = D_8090EB30->world.pos.x; this->subCamAt.x = D_8090EB30->world.pos.x;
this->unk_3B0.y = D_8090EB30->world.pos.y; this->subCamAt.y = D_8090EB30->world.pos.y;
this->unk_3B0.z = D_8090EB30->world.pos.z; this->subCamAt.z = D_8090EB30->world.pos.z;
break; break;
} }
D_8090EB30 = D_8090EB30->next; D_8090EB30 = D_8090EB30->next;
@ -881,12 +881,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
Message_StartTextbox(play, 0x70D6, NULL); Message_StartTextbox(play, 0x70D6, NULL);
} }
if (D_8090EB30 != NULL) { if (D_8090EB30 != NULL) {
this->unk_3A4.x = D_8090EB30->world.pos.x - 20.0f; this->subCamEye.x = D_8090EB30->world.pos.x - 20.0f;
this->unk_3A4.y = D_8090EB30->world.pos.y; this->subCamEye.y = D_8090EB30->world.pos.y;
this->unk_3A4.z = D_8090EB30->world.pos.z; this->subCamEye.z = D_8090EB30->world.pos.z;
Math_ApproachF(&this->unk_3B0.x, D_8090EB30->world.pos.x, 0.2f, 50.0f); Math_ApproachF(&this->subCamAt.x, D_8090EB30->world.pos.x, 0.2f, 50.0f);
Math_ApproachF(&this->unk_3B0.y, D_8090EB30->world.pos.y, 0.2f, 50.0f); Math_ApproachF(&this->subCamAt.y, D_8090EB30->world.pos.y, 0.2f, 50.0f);
Math_ApproachF(&this->unk_3B0.z, D_8090EB30->world.pos.z, 0.2f, 50.0f); Math_ApproachF(&this->subCamAt.z, D_8090EB30->world.pos.z, 0.2f, 50.0f);
if ((this->csTimer > 40) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) { if ((this->csTimer > 40) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) {
this->csState = 29; this->csState = 29;
this->csTimer = 0; this->csTimer = 0;
@ -902,12 +902,12 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
break; break;
case 29: case 29:
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->unk_3A4.x = (((this->actor.world.pos.x + 500.0f) - 350.0f) + 100.0f) - 60.0f; this->subCamEye.x = (((this->actor.world.pos.x + 500.0f) - 350.0f) + 100.0f) - 60.0f;
this->unk_3B0.x = this->actor.world.pos.x; this->subCamAt.x = this->actor.world.pos.x;
this->unk_3B0.z = this->actor.world.pos.z; this->subCamAt.z = this->actor.world.pos.z;
this->unk_3A4.y = this->actor.world.pos.y; this->subCamEye.y = this->actor.world.pos.y;
this->unk_3A4.z = this->actor.world.pos.z + 10.0f; this->subCamEye.z = this->actor.world.pos.z + 10.0f;
this->unk_3B0.y = (this->unk_1B8.y + 60.0f) - 40.0f; this->subCamAt.y = (this->unk_1B8.y + 60.0f) - 40.0f;
player->actor.shape.rot.y = -0x4000; player->actor.shape.rot.y = -0x4000;
player->actor.world.pos.x = 140.0f; player->actor.world.pos.x = 140.0f;
player->actor.world.pos.z = -196.0f; player->actor.world.pos.z = -196.0f;
@ -917,11 +917,11 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->unk_194)) { if (Animation_OnFrame(&this->skelAnime, this->unk_194)) {
Camera* camera = Play_GetCamera(play, MAIN_CAM); Camera* camera = Play_GetCamera(play, MAIN_CAM);
camera->eye = this->unk_3A4; camera->eye = this->subCamEye;
camera->eyeNext = this->unk_3A4; camera->eyeNext = this->subCamEye;
camera->at = this->unk_3B0; camera->at = this->subCamAt;
func_800C08AC(play, this->unk_39E, 0); func_800C08AC(play, this->subCamId, 0);
this->unk_39E = 0; this->subCamId = 0;
func_80064534(play, &play->csCtx); func_80064534(play, &play->csCtx);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7); Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
this->csState = 0; this->csState = 0;
@ -938,18 +938,18 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BODY_SPARK - SFX_FLAG); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_BODY_SPARK - SFX_FLAG);
} }
if (this->unk_39E != 0) { if (this->subCamId != 0) {
// fake, tricks the compiler into putting some pointers on the stack // fake, tricks the compiler into putting some pointers on the stack
if (zero) { if (zero) {
osSyncPrintf(NULL, 0, 0); osSyncPrintf(NULL, 0, 0);
} }
this->unk_3B0.y += this->unk_41C; this->subCamAt.y += this->unk_41C;
Play_CameraSetAtEyeUp(play, this->unk_39E, &this->unk_3B0, &this->unk_3A4, &this->unk_3BC); Play_CameraSetAtEyeUp(play, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp);
} }
} }
void func_808FF898(BossGanon2* this, PlayState* play) { void func_808FF898(BossGanon2* this, PlayState* play) {
if ((this->unk_312 != 0) && (this->unk_39E == 0)) { if ((this->unk_312 != 0) && (this->subCamId == 0)) {
Actor* actor = play->actorCtx.actorLists[ACTORCAT_PROP].head; Actor* actor = play->actorCtx.actorLists[ACTORCAT_PROP].head;
while (actor != NULL) { while (actor != NULL) {
if (actor->id == ACTOR_DEMO_GJ) { if (actor->id == ACTOR_DEMO_GJ) {
@ -1341,13 +1341,13 @@ void func_80900890(BossGanon2* this, PlayState* play) {
switch (this->csState) { switch (this->csState) {
case 0: case 0:
func_80064520(play, &play->csCtx); func_80064520(play, &play->csCtx);
this->unk_39E = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->unk_39E, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
Player_SetCsActionWithHaltedActors(play, &this->actor, 8); Player_SetCsActionWithHaltedActors(play, &this->actor, 8);
this->csState = 1; this->csState = 1;
this->unk_3A4 = sp4C->eye; this->subCamEye = sp4C->eye;
this->unk_3B0 = sp4C->at; this->subCamAt = sp4C->at;
this->unk_1A2[0] = 300; this->unk_1A2[0] = 300;
this->unk_1A2[1] = 100; this->unk_1A2[1] = 100;
play->envCtx.unk_D8 = 0.0f; play->envCtx.unk_D8 = 0.0f;
@ -1360,12 +1360,12 @@ void func_80900890(BossGanon2* this, PlayState* play) {
sp5C.y = 0.0f; sp5C.y = 0.0f;
sp5C.z = 250.0f; sp5C.z = 250.0f;
Matrix_MultVec3f(&sp5C, &sp50); Matrix_MultVec3f(&sp5C, &sp50);
Math_ApproachF(&this->unk_3A4.x, this->actor.world.pos.x + sp50.x, 0.2f, 100.0f); Math_ApproachF(&this->subCamEye.x, this->actor.world.pos.x + sp50.x, 0.2f, 100.0f);
Math_ApproachF(&this->unk_3A4.y, 1136.0f, 0.2f, 100.0f); Math_ApproachF(&this->subCamEye.y, 1136.0f, 0.2f, 100.0f);
Math_ApproachF(&this->unk_3A4.z, this->actor.world.pos.z + sp50.z, 0.2f, 100.0f); Math_ApproachF(&this->subCamEye.z, this->actor.world.pos.z + sp50.z, 0.2f, 100.0f);
Math_ApproachF(&this->unk_3B0.x, this->unk_1B8.x, 0.2f, 100.0f); Math_ApproachF(&this->subCamAt.x, this->unk_1B8.x, 0.2f, 100.0f);
Math_ApproachF(&this->unk_3B0.y, this->unk_1B8.y, 0.2f, 100.0f); Math_ApproachF(&this->subCamAt.y, this->unk_1B8.y, 0.2f, 100.0f);
Math_ApproachF(&this->unk_3B0.z, this->unk_1B8.z, 0.2f, 100.0f); Math_ApproachF(&this->subCamAt.z, this->unk_1B8.z, 0.2f, 100.0f);
if (this->unk_1A2[1] == 0) { if (this->unk_1A2[1] == 0) {
this->csState = 2; this->csState = 2;
this->unk_1A2[1] = 90; this->unk_1A2[1] = 90;
@ -1373,12 +1373,12 @@ void func_80900890(BossGanon2* this, PlayState* play) {
break; break;
case 2: case 2:
this->unk_1A2[0] = 300; this->unk_1A2[0] = 300;
this->unk_3A4.x = sBossGanon2Zelda->actor.world.pos.x - 100.0f; this->subCamEye.x = sBossGanon2Zelda->actor.world.pos.x - 100.0f;
this->unk_3A4.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f; this->subCamEye.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f;
this->unk_3A4.z = (sBossGanon2Zelda->actor.world.pos.z + 30.0f) - 60.0f; this->subCamEye.z = (sBossGanon2Zelda->actor.world.pos.z + 30.0f) - 60.0f;
this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; this->subCamAt.x = sBossGanon2Zelda->actor.world.pos.x;
this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f; this->subCamAt.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f;
this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z - 10.0f; this->subCamAt.z = sBossGanon2Zelda->actor.world.pos.z - 10.0f;
Math_ApproachZeroF(&this->unk_324, 1.0f, 5.0f); Math_ApproachZeroF(&this->unk_324, 1.0f, 5.0f);
Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 1.0f / 51); Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 1.0f / 51);
if (this->unk_1A2[1] == 80) { if (this->unk_1A2[1] == 80) {
@ -1386,11 +1386,11 @@ void func_80900890(BossGanon2* this, PlayState* play) {
} }
if ((this->unk_1A2[1] < 30) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) { if ((this->unk_1A2[1] < 30) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) {
temp_v0 = Play_GetCamera(play, MAIN_CAM); temp_v0 = Play_GetCamera(play, MAIN_CAM);
temp_v0->eye = this->unk_3A4; temp_v0->eye = this->subCamEye;
temp_v0->eyeNext = this->unk_3A4; temp_v0->eyeNext = this->subCamEye;
temp_v0->at = this->unk_3B0; temp_v0->at = this->subCamAt;
func_800C08AC(play, this->unk_39E, 0); func_800C08AC(play, this->subCamId, 0);
this->unk_39E = 0; this->subCamId = 0;
func_80064534(play, &play->csCtx); func_80064534(play, &play->csCtx);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7); Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
this->csState = 3; this->csState = 3;
@ -1398,9 +1398,9 @@ void func_80900890(BossGanon2* this, PlayState* play) {
break; break;
case 10: case 10:
func_80064520(play, &play->csCtx); func_80064520(play, &play->csCtx);
this->unk_39E = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->unk_39E, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
this->csState = 11; this->csState = 11;
this->unk_334 = 1; this->unk_334 = 1;
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x60); Player_SetCsActionWithHaltedActors(play, &this->actor, 0x60);
@ -1409,28 +1409,28 @@ void func_80900890(BossGanon2* this, PlayState* play) {
player->actor.world.pos.x = sBossGanon2Zelda->actor.world.pos.x + 50.0f + 10.0f; player->actor.world.pos.x = sBossGanon2Zelda->actor.world.pos.x + 50.0f + 10.0f;
player->actor.world.pos.z = sBossGanon2Zelda->actor.world.pos.z - 25.0f; player->actor.world.pos.z = sBossGanon2Zelda->actor.world.pos.z - 25.0f;
player->actor.shape.rot.y = -0x8000; player->actor.shape.rot.y = -0x8000;
this->unk_3A4.x = (player->actor.world.pos.x + 100.0f) - 80.0f; this->subCamEye.x = (player->actor.world.pos.x + 100.0f) - 80.0f;
this->unk_3A4.y = (player->actor.world.pos.y + 60.0f) - 40.0f; this->subCamEye.y = (player->actor.world.pos.y + 60.0f) - 40.0f;
this->unk_3A4.z = player->actor.world.pos.z - 110.0f; this->subCamEye.z = player->actor.world.pos.z - 110.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = (player->actor.world.pos.y + 60.0f) - 25.0f; this->subCamAt.y = (player->actor.world.pos.y + 60.0f) - 25.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
if (this->csTimer == 80) { if (this->csTimer == 80) {
temp_v0_2 = Play_GetCamera(play, MAIN_CAM); temp_v0_2 = Play_GetCamera(play, MAIN_CAM);
temp_v0_2->eye = this->unk_3A4; temp_v0_2->eye = this->subCamEye;
temp_v0_2->eyeNext = this->unk_3A4; temp_v0_2->eyeNext = this->subCamEye;
temp_v0_2->at = this->unk_3B0; temp_v0_2->at = this->subCamAt;
this->csState = 3; this->csState = 3;
func_800C08AC(play, this->unk_39E, 0); func_800C08AC(play, this->subCamId, 0);
this->unk_39E = 0; this->subCamId = 0;
func_80064534(play, &play->csCtx); func_80064534(play, &play->csCtx);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7); Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
} }
break; break;
} }
if (this->unk_39E != 0) { if (this->subCamId != 0) {
Play_CameraSetAtEye(play, this->unk_39E, &this->unk_3B0, &this->unk_3A4); Play_CameraSetAtEye(play, this->subCamId, &this->subCamAt, &this->subCamEye);
} }
switch (this->unk_1AC) { switch (this->unk_1AC) {
@ -1529,16 +1529,16 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
this->csTimer++; this->csTimer++;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->unk_3BC.x = 0.0f; this->subCamUp.x = 0.0f;
this->unk_3BC.y = 1.0f; this->subCamUp.y = 1.0f;
this->unk_3BC.z = 0.0f; this->subCamUp.z = 0.0f;
switch (this->csState) { switch (this->csState) {
case 0: case 0:
func_80064520(play, &play->csCtx); func_80064520(play, &play->csCtx);
this->unk_39E = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->unk_39E, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
Player_SetCsActionWithHaltedActors(play, &this->actor, 8); Player_SetCsActionWithHaltedActors(play, &this->actor, 8);
this->csState = 1; this->csState = 1;
this->csTimer = 0; this->csTimer = 0;
@ -1585,12 +1585,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
sBossGanon2Zelda->actor.world.pos.x = 340.0f; sBossGanon2Zelda->actor.world.pos.x = 340.0f;
sBossGanon2Zelda->actor.world.pos.z = -250.0f; sBossGanon2Zelda->actor.world.pos.z = -250.0f;
sBossGanon2Zelda->actor.world.rot.y = sBossGanon2Zelda->actor.shape.rot.y = -0x2000; sBossGanon2Zelda->actor.world.rot.y = sBossGanon2Zelda->actor.shape.rot.y = -0x2000;
this->unk_3A4.x = 250; this->subCamEye.x = 250;
this->unk_3A4.y = 1150.0f; this->subCamEye.y = 1150.0f;
this->unk_3A4.z = 0.0f; this->subCamEye.z = 0.0f;
this->unk_3B0.x = this->unk_1B8.x; this->subCamAt.x = this->unk_1B8.x;
this->unk_3B0.y = this->unk_1B8.y; this->subCamAt.y = this->unk_1B8.y;
this->unk_3B0.z = this->unk_1B8.z; this->subCamAt.z = this->unk_1B8.z;
if (this->csTimer > 135) { if (this->csTimer > 135) {
this->csState = 2; this->csState = 2;
this->csTimer = 0; this->csTimer = 0;
@ -1600,12 +1600,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
this->unk_339 = 22; this->unk_339 = 22;
Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 0.1f); Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 0.1f);
Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG);
this->unk_3A4.x = 250; this->subCamEye.x = 250;
this->unk_3A4.y = 1150.0f; this->subCamEye.y = 1150.0f;
this->unk_3A4.z = 0.0f; this->subCamEye.z = 0.0f;
Math_ApproachF(&this->unk_3B0.x, sBossGanon2Zelda->actor.world.pos.x, 0.2f, 20.0f); Math_ApproachF(&this->subCamAt.x, sBossGanon2Zelda->actor.world.pos.x, 0.2f, 20.0f);
Math_ApproachF(&this->unk_3B0.y, sBossGanon2Zelda->actor.world.pos.y + 50.0f, 0.2f, 10.0f); Math_ApproachF(&this->subCamAt.y, sBossGanon2Zelda->actor.world.pos.y + 50.0f, 0.2f, 10.0f);
Math_ApproachF(&this->unk_3B0.z, sBossGanon2Zelda->actor.world.pos.z, 0.2f, 20.0f); Math_ApproachF(&this->subCamAt.z, sBossGanon2Zelda->actor.world.pos.z, 0.2f, 20.0f);
if (this->csTimer == 50) { if (this->csTimer == 50) {
this->csState = 3; this->csState = 3;
this->csTimer = 0; this->csTimer = 0;
@ -1614,12 +1614,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
case 3: case 3:
this->unk_339 = 22; this->unk_339 = 22;
Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG);
this->unk_3A4.x = 330.0f; this->subCamEye.x = 330.0f;
this->unk_3A4.y = 1120.0f; this->subCamEye.y = 1120.0f;
this->unk_3A4.z = -150.0f; this->subCamEye.z = -150.0f;
this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; this->subCamAt.x = sBossGanon2Zelda->actor.world.pos.x;
this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 40.0f; this->subCamAt.y = sBossGanon2Zelda->actor.world.pos.y + 40.0f;
this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z; this->subCamAt.z = sBossGanon2Zelda->actor.world.pos.z;
if (this->csTimer == 10) { if (this->csTimer == 10) {
Message_StartTextbox(play, 0x70D8, NULL); Message_StartTextbox(play, 0x70D8, NULL);
} }
@ -1665,19 +1665,19 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
this->unk_30C = 10.0f; this->unk_30C = 10.0f;
player->actor.world.pos.x = 250.0f; player->actor.world.pos.x = 250.0f;
player->actor.world.pos.z = 30.0f; player->actor.world.pos.z = 30.0f;
this->unk_3A4.x = player->actor.world.pos.x - 50.0f; this->subCamEye.x = player->actor.world.pos.x - 50.0f;
this->unk_3A4.y = player->actor.world.pos.y + 50.0f; this->subCamEye.y = player->actor.world.pos.y + 50.0f;
this->unk_3A4.z = player->actor.world.pos.z + 40.0f; this->subCamEye.z = player->actor.world.pos.z + 40.0f;
this->unk_3B0.x = player->actor.world.pos.x; this->subCamAt.x = player->actor.world.pos.x;
this->unk_3B0.y = player->actor.world.pos.y + 40.0f; this->subCamAt.y = player->actor.world.pos.y + 40.0f;
this->unk_3B0.z = player->actor.world.pos.z; this->subCamAt.z = player->actor.world.pos.z;
if (this->csTimer == 166) { if (this->csTimer == 166) {
temp_v0_2 = Play_GetCamera(play, MAIN_CAM); temp_v0_2 = Play_GetCamera(play, MAIN_CAM);
temp_v0_2->eye = this->unk_3A4; temp_v0_2->eye = this->subCamEye;
temp_v0_2->eyeNext = this->unk_3A4; temp_v0_2->eyeNext = this->subCamEye;
temp_v0_2->at = this->unk_3B0; temp_v0_2->at = this->subCamAt;
func_800C08AC(play, this->unk_39E, 0); func_800C08AC(play, this->subCamId, 0);
this->unk_39E = 0; this->subCamId = 0;
func_80064534(play, &play->csCtx); func_80064534(play, &play->csCtx);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7); Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
this->csState = 6; this->csState = 6;
@ -1692,9 +1692,9 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
(player->meleeWeaponState != 0) && (player->heldItemAction == PLAYER_IA_SWORD_MASTER)) { (player->meleeWeaponState != 0) && (player->heldItemAction == PLAYER_IA_SWORD_MASTER)) {
func_80064520(play, &play->csCtx); func_80064520(play, &play->csCtx);
GameInteractor_ExecuteOnBossDefeat(&this->actor); GameInteractor_ExecuteOnBossDefeat(&this->actor);
this->unk_39E = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->unk_39E, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
this->csState = 7; this->csState = 7;
this->csTimer = 0; this->csTimer = 0;
Animation_MorphToPlayOnce(&this->skelAnime, &gGanonFinalBlowAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGanonFinalBlowAnim, 0.0f);
@ -1722,42 +1722,42 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
func_8090109C(this, play); func_8090109C(this, play);
} }
if ((this->csTimer >= 34) && (this->csTimer < 40)) { if ((this->csTimer >= 34) && (this->csTimer < 40)) {
this->unk_3A4.x = 269.0f; this->subCamEye.x = 269.0f;
this->unk_3A4.y = 1112.0f; this->subCamEye.y = 1112.0f;
this->unk_3A4.z = -28.0f; this->subCamEye.z = -28.0f;
this->unk_3B0.x = 234.0f; this->subCamAt.x = 234.0f;
this->unk_3B0.y = 1117.0f; this->subCamAt.y = 1117.0f;
this->unk_3B0.z = -11.0f; this->subCamAt.z = -11.0f;
} else { } else {
if (this->csTimer < 30) { if (this->csTimer < 30) {
phi_a1 = 0; phi_a1 = 0;
} else if (this->csTimer < 43) { } else if (this->csTimer < 43) {
phi_a1 = 1; phi_a1 = 1;
} else { } else {
this->unk_3BC.z = -0.8f; this->subCamUp.z = -0.8f;
player->actor.world.pos.x = 200.0f; player->actor.world.pos.x = 200.0f;
player->actor.world.pos.z = 10.0f; player->actor.world.pos.z = 10.0f;
phi_a1 = 2; phi_a1 = 2;
} }
this->unk_3A4.x = D_8090702C[phi_a1].x + (player->actor.world.pos.x - 50.0f); this->subCamEye.x = D_8090702C[phi_a1].x + (player->actor.world.pos.x - 50.0f);
this->unk_3A4.y = D_8090702C[phi_a1].y + (player->actor.world.pos.y + 50.0f); this->subCamEye.y = D_8090702C[phi_a1].y + (player->actor.world.pos.y + 50.0f);
this->unk_3A4.z = D_8090702C[phi_a1].z + (player->actor.world.pos.z + 40.0f); this->subCamEye.z = D_8090702C[phi_a1].z + (player->actor.world.pos.z + 40.0f);
this->unk_3B0.x = D_80907050[phi_a1].x + player->actor.world.pos.x; this->subCamAt.x = D_80907050[phi_a1].x + player->actor.world.pos.x;
this->unk_3B0.y = D_80907050[phi_a1].y + (player->actor.world.pos.y + 40.0f); this->subCamAt.y = D_80907050[phi_a1].y + (player->actor.world.pos.y + 40.0f);
this->unk_3B0.z = D_80907050[phi_a1].z + player->actor.world.pos.z; this->subCamAt.z = D_80907050[phi_a1].z + player->actor.world.pos.z;
} }
if (this->csTimer > 80) { if (this->csTimer > 80) {
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
this->csState = 75; this->csState = 75;
this->csTimer = 0; this->csTimer = 0;
this->unk_3A4.x = 112.0f; this->subCamEye.x = 112.0f;
this->unk_3A4.y = 1146.0f; this->subCamEye.y = 1146.0f;
this->unk_3A4.z = 202.0f; this->subCamEye.z = 202.0f;
this->unk_3B0.x = 110.0f; this->subCamAt.x = 110.0f;
this->unk_3B0.y = 1144.0f; this->subCamAt.y = 1144.0f;
this->unk_3B0.z = 177.0f; this->subCamAt.z = 177.0f;
player->actor.world.pos.x = 200.0f; player->actor.world.pos.x = 200.0f;
this->unk_3BC.z = 0.0f; this->subCamUp.z = 0.0f;
} }
break; break;
case 75: case 75:
@ -1792,12 +1792,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
this->csTimer = 0; this->csTimer = 0;
this->unk_194 = 1000.0f; this->unk_194 = 1000.0f;
} }
this->unk_3A4.x = 250; this->subCamEye.x = 250;
this->unk_3A4.y = 1150.0f; this->subCamEye.y = 1150.0f;
this->unk_3A4.z = 0.0f; this->subCamEye.z = 0.0f;
this->unk_3B0.x = this->unk_1B8.x; this->subCamAt.x = this->unk_1B8.x;
this->unk_3B0.y = this->unk_1B8.y; this->subCamAt.y = this->unk_1B8.y;
this->unk_3B0.z = this->unk_1B8.z; this->subCamAt.z = this->unk_1B8.z;
if ((this->csTimer < 1000) && ((this->csTimer % 16) == 0)) { if ((this->csTimer < 1000) && ((this->csTimer % 16) == 0)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_SWORD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_SWORD);
} }
@ -1812,12 +1812,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
break; break;
case 9: case 9:
this->unk_339 = 24; this->unk_339 = 24;
this->unk_3A4.x = 330.0f; this->subCamEye.x = 330.0f;
this->unk_3A4.y = 1120.0f; this->subCamEye.y = 1120.0f;
this->unk_3A4.z = -150.0f; this->subCamEye.z = -150.0f;
this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; this->subCamAt.x = sBossGanon2Zelda->actor.world.pos.x;
this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 40.0f; this->subCamAt.y = sBossGanon2Zelda->actor.world.pos.y + 40.0f;
this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z; this->subCamAt.z = sBossGanon2Zelda->actor.world.pos.z;
if (this->csTimer > 60) { if (this->csTimer > 60) {
this->csState = 10; this->csState = 10;
this->csTimer = 0; this->csTimer = 0;
@ -1826,9 +1826,9 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
break; break;
case 10: case 10:
this->unk_339 = 24; this->unk_339 = 24;
Math_ApproachF(&this->unk_3A4.x, 290.0f, 0.05f, this->unk_410.x); Math_ApproachF(&this->subCamEye.x, 290.0f, 0.05f, this->unk_410.x);
Math_ApproachF(&this->unk_3A4.y, 1130.0f, 0.05f, this->unk_410.x * 0.25f); Math_ApproachF(&this->subCamEye.y, 1130.0f, 0.05f, this->unk_410.x * 0.25f);
Math_ApproachF(&this->unk_3A4.z, -260.0f, 0.05f, this->unk_410.x * 1.25f); Math_ApproachF(&this->subCamEye.z, -260.0f, 0.05f, this->unk_410.x * 1.25f);
if ((this->csTimer >= 40) && (this->csTimer <= 110)) { if ((this->csTimer >= 40) && (this->csTimer <= 110)) {
Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 0.02f); Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 0.02f);
Math_ApproachF(&this->unk_384, 10.0f, 0.1f, 0.2f); Math_ApproachF(&this->unk_384, 10.0f, 0.1f, 0.2f);
@ -1837,10 +1837,10 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
Math_ApproachZeroF(&this->unk_384, 1.0f, 0.2f); Math_ApproachZeroF(&this->unk_384, 1.0f, 0.2f);
} }
if (this->csTimer > 130) { if (this->csTimer > 130) {
Math_ApproachF(&this->unk_3B0.y, (sBossGanon2Zelda->actor.world.pos.y + 40.0f + 10.0f) - 20.0f, 0.1f, Math_ApproachF(&this->subCamAt.y, (sBossGanon2Zelda->actor.world.pos.y + 40.0f + 10.0f) - 20.0f, 0.1f,
this->unk_410.x); this->unk_410.x);
} else { } else {
Math_ApproachF(&this->unk_3B0.y, sBossGanon2Zelda->actor.world.pos.y + 40.0f + 10.0f, 0.05f, Math_ApproachF(&this->subCamAt.y, sBossGanon2Zelda->actor.world.pos.y + 40.0f + 10.0f, 0.05f,
this->unk_410.x * 0.25f); this->unk_410.x * 0.25f);
} }
Math_ApproachF(&this->unk_410.x, 1.0f, 1.0f, 0.01f); Math_ApproachF(&this->unk_410.x, 1.0f, 1.0f, 0.01f);
@ -1865,8 +1865,8 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
break; break;
} }
if (this->unk_39E != 0) { if (this->subCamId != 0) {
Play_CameraSetAtEyeUp(play, this->unk_39E, &this->unk_3B0, &this->unk_3A4, &this->unk_3BC); Play_CameraSetAtEyeUp(play, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp);
} }
switch (this->unk_1AC) { switch (this->unk_1AC) {
@ -2121,7 +2121,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_424.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_424.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk_444.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk_444.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_444.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_444.base);
if (this->unk_39E == 0) { if (this->subCamId == 0) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk_444.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk_444.base);
} }
} }

View file

@ -93,11 +93,11 @@ typedef struct BossGanon2 {
/* 0x0394 */ f32 unk_394; /* 0x0394 */ f32 unk_394;
/* 0x0398 */ u32 csTimer; /* 0x0398 */ u32 csTimer;
/* 0x039C */ s16 csState; /* 0x039C */ s16 csState;
/* 0x039E */ s16 unk_39E; /* 0x039E */ s16 subCamId;
/* 0x03A0 */ char unk_3A0[0x4]; /* 0x03A0 */ char unk_3A0[0x4];
/* 0x03A4 */ Vec3f unk_3A4; /* 0x03A4 */ Vec3f subCamEye;
/* 0x03B0 */ Vec3f unk_3B0; /* 0x03B0 */ Vec3f subCamAt;
/* 0x03BC */ Vec3f unk_3BC; /* 0x03BC */ Vec3f subCamUp;
/* 0x03C8 */ char unk_3C8[0x48]; /* 0x03C8 */ char unk_3C8[0x48];
/* 0x0410 */ Vec3f unk_410; /* 0x0410 */ Vec3f unk_410;
/* 0x041C */ f32 unk_41C; /* 0x041C */ f32 unk_41C;

View file

@ -618,7 +618,7 @@ void func_809861C4(DemoIm* this, PlayState* play) {
if (npcAction != NULL) { if (npcAction != NULL) {
u32 action = npcAction->action; u32 action = npcAction->action;
u32 unk_274 = this->unk_274; u32 unk_274 = this->cueId;
if (action != unk_274) { if (action != unk_274) {
switch (action) { switch (action) {
@ -633,7 +633,7 @@ void func_809861C4(DemoIm* this, PlayState* play) {
default: default:
osSyncPrintf("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); osSyncPrintf("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
} }
this->unk_274 = action; this->cueId = action;
} }
} }
} }
@ -651,7 +651,7 @@ void func_809862E0(DemoIm* this, PlayState* play) {
if (npcAction != NULL) { if (npcAction != NULL) {
u32 action = npcAction->action; u32 action = npcAction->action;
u32 unk_274 = this->unk_274; u32 unk_274 = this->cueId;
if (action != unk_274) { if (action != unk_274) {
switch (action) { switch (action) {
@ -673,7 +673,7 @@ void func_809862E0(DemoIm* this, PlayState* play) {
default: default:
osSyncPrintf("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); osSyncPrintf("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
} }
this->unk_274 = action; this->cueId = action;
} }
} }
} }
@ -782,7 +782,7 @@ void func_8098680C(DemoIm* this, PlayState* play) {
if (npcAction != NULL) { if (npcAction != NULL) {
u32 action = npcAction->action; u32 action = npcAction->action;
u32 unk_274 = this->unk_274; u32 unk_274 = this->cueId;
if (action != unk_274) { if (action != unk_274) {
switch (action) { switch (action) {
@ -801,7 +801,7 @@ void func_8098680C(DemoIm* this, PlayState* play) {
default: default:
osSyncPrintf("Demo_Im_Spot00_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); osSyncPrintf("Demo_Im_Spot00_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
} }
this->unk_274 = action; this->cueId = action;
} }
} }
} }
@ -1061,7 +1061,7 @@ void func_809871E8(DemoIm* this, PlayState* play) {
if (npcAction != NULL) { if (npcAction != NULL) {
u32 action = npcAction->action; u32 action = npcAction->action;
u32 unk_274 = this->unk_274; u32 unk_274 = this->cueId;
if (action != unk_274) { if (action != unk_274) {
switch (action) { switch (action) {
@ -1074,7 +1074,7 @@ void func_809871E8(DemoIm* this, PlayState* play) {
default: default:
osSyncPrintf("Demo_Im_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); osSyncPrintf("Demo_Im_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
} }
this->unk_274 = action; this->cueId = action;
} }
} }
} }

View file

@ -42,7 +42,7 @@ typedef struct DemoIm {
/* 0x0268 */ f32 unk_268; /* 0x0268 */ f32 unk_268;
/* 0x026C */ s32 alpha; /* 0x026C */ s32 alpha;
/* 0x0270 */ s32 unk_270; /* 0x0270 */ s32 unk_270;
/* 0x0274 */ s32 unk_274; /* 0x0274 */ s32 cueId;
/* 0x0278 */ f32 unk_278; /* 0x0278 */ f32 unk_278;
/* 0x027C */ s32 unk_27C; /* 0x027C */ s32 unk_27C;
/* 0x0280 */ s32 unk_280; /* 0x0280 */ s32 unk_280;

View file

@ -554,7 +554,7 @@ void func_8098F654(DemoSa* this, PlayState* play) {
if (npcAction != NULL) { if (npcAction != NULL) {
action = npcAction->action; action = npcAction->action;
unk_1AC = this->unk_1AC; unk_1AC = this->cueId;
if (action != unk_1AC) { if (action != unk_1AC) {
switch (action) { switch (action) {
case 7: case 7:
@ -569,7 +569,7 @@ void func_8098F654(DemoSa* this, PlayState* play) {
default: default:
osSyncPrintf("Demo_Sa_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); osSyncPrintf("Demo_Sa_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
} }
this->unk_1AC = action; this->cueId = action;
} }
} }
} }
@ -644,7 +644,7 @@ void func_8098F984(DemoSa* this) {
} }
void func_8098F998(DemoSa* this, PlayState* play) { void func_8098F998(DemoSa* this, PlayState* play) {
if (this->unk_1AC == 4) { if (this->cueId == 4) {
func_8098E6EC(this, play, 1); func_8098E6EC(this, play, 1);
this->action = 17; this->action = 17;
this->drawConfig = 2; this->drawConfig = 2;
@ -699,7 +699,7 @@ void func_8098FB68(DemoSa* this, PlayState* play) {
if (npcAction != NULL) { if (npcAction != NULL) {
action = npcAction->action; action = npcAction->action;
unk_1AC = this->unk_1AC; unk_1AC = this->cueId;
if (action != unk_1AC) { if (action != unk_1AC) {
switch (action) { switch (action) {
case 4: case 4:
@ -717,7 +717,7 @@ void func_8098FB68(DemoSa* this, PlayState* play) {
default: default:
osSyncPrintf("Demo_Sa_inPresent_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); osSyncPrintf("Demo_Sa_inPresent_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
} }
this->unk_1AC = action; this->cueId = action;
} }
} }
} }

View file

@ -20,7 +20,7 @@ typedef struct DemoSa {
/* 0x01A0 */ f32 unk_1A0; /* 0x01A0 */ f32 unk_1A0;
/* 0x01A4 */ s32 alpha; /* 0x01A4 */ s32 alpha;
/* 0x01A8 */ s32 unk_1A8; /* 0x01A8 */ s32 unk_1A8;
/* 0x01AC */ s32 unk_1AC; /* 0x01AC */ s32 cueId;
/* 0x01B0 */ s32 unk_1B0; /* 0x01B0 */ s32 unk_1B0;
} DemoSa; // size = 0x01B4 } DemoSa; // size = 0x01B4

View file

@ -184,14 +184,14 @@ static void* D_809982D4[] = {
void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc) { void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
this->unk_16F = 0; this->actionTimer = 0;
} }
s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) { s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[(u16)this->dyna.actor.params >> 0xA]; TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[(u16)this->dyna.actor.params >> 0xA];
s8 frontRoom = transitionEntry->sides[0].room; s8 frontRoom = transitionEntry->sides[0].room;
s32 doorType = this->doorType; s32 doorType = this->doorType;
ShutterObjectInfo* temp_t0 = &sObjectInfo[this->unk_16B]; ShutterObjectInfo* temp_t0 = &sObjectInfo[this->styleType];
if (doorType != SHUTTER_KEY_LOCKED) { if (doorType != SHUTTER_KEY_LOCKED) {
if (frontRoom == transitionEntry->sides[1].room) { if (frontRoom == transitionEntry->sides[1].room) {
@ -207,18 +207,18 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
} }
} }
} }
this->unk_16C = (doorType == SHUTTER) ? temp_t0->index1 : temp_t0->index2; this->gfxType = (doorType == SHUTTER) ? temp_t0->index1 : temp_t0->index2;
if (doorType == SHUTTER_FRONT_CLEAR) { if (doorType == SHUTTER_FRONT_CLEAR) {
if (!Flags_GetClear(play, this->dyna.actor.room)) { if (!Flags_GetClear(play, this->dyna.actor.room)) {
DoorShutter_SetupAction(this, func_80996A54); DoorShutter_SetupAction(this, func_80996A54);
this->unk_170 = 1.0f; this->barsClosedAmount = 1.0f;
return true; return true;
} }
} else if (doorType == SHUTTER_FRONT_SWITCH || doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) { } else if (doorType == SHUTTER_FRONT_SWITCH || doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) {
if (!Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { if (!Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
DoorShutter_SetupAction(this, func_80996EE8); DoorShutter_SetupAction(this, func_80996EE8);
this->unk_170 = 1.0f; this->barsClosedAmount = 1.0f;
return true; return true;
} }
DoorShutter_SetupAction(this, func_80996F98); DoorShutter_SetupAction(this, func_80996F98);
@ -261,7 +261,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
break; break;
} }
} }
this->unk_168 = phi_v1_2->index; this->bossDoorTexIndex = phi_v1_2->index;
} else { } else {
this->dyna.actor.room = -1; this->dyna.actor.room = -1;
} }
@ -271,15 +271,15 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
return; return;
} }
DoorShutter_SetupAction(this, DoorShutter_SetupType); DoorShutter_SetupAction(this, DoorShutter_SetupType);
this->unk_16B = phi_a3; this->styleType = phi_a3;
if (this->doorType == SHUTTER_KEY_LOCKED || this->doorType == SHUTTER_BOSS) { if (this->doorType == SHUTTER_KEY_LOCKED || this->doorType == SHUTTER_BOSS) {
if (GameInteractor_Should(VB_LOCK_BOSS_DOOR, !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F), this)) { if (GameInteractor_Should(VB_LOCK_BOSS_DOOR, !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F), this)) {
this->unk_16E = 10; this->unlockTimer = 10;
} }
Actor_SetFocus(&this->dyna.actor, 60.0f); Actor_SetFocus(&this->dyna.actor, 60.0f);
} else if (phi_a3 == 4) { } else if (phi_a3 == 4) {
Actor_SetScale(&this->dyna.actor, 0.1f); Actor_SetScale(&this->dyna.actor, 0.1f);
this->unk_166 = 100; this->jabuDoorClosedAmount = 100;
this->dyna.actor.uncullZoneScale = 200.0f; this->dyna.actor.uncullZoneScale = 200.0f;
Actor_SetFocus(&this->dyna.actor, 0.0f); Actor_SetFocus(&this->dyna.actor, 0.0f);
} else { } else {
@ -306,7 +306,7 @@ void DoorShutter_SetupType(DoorShutter* this, PlayState* play) {
CollisionHeader* colHeader = NULL; CollisionHeader* colHeader = NULL;
Actor_SetObjectDependency(play, &this->dyna.actor); Actor_SetObjectDependency(play, &this->dyna.actor);
this->unk_16C = sObjectInfo[this->unk_16B].index1; this->gfxType = sObjectInfo[this->styleType].index1;
CollisionHeader_GetVirtual((this->doorType == SHUTTER_GOHMA_BLOCK) ? &gGohmaDoorCol : &gPhantomGanonBarsCol, CollisionHeader_GetVirtual((this->doorType == SHUTTER_GOHMA_BLOCK) ? &gGohmaDoorCol : &gPhantomGanonBarsCol,
&colHeader); &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
@ -346,8 +346,8 @@ s32 func_809968D4(DoorShutter* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (!Player_InCsMode(play)) { if (!Player_InCsMode(play)) {
ShutterInfo* temp_v1 = &sShutterInfo[this->unk_16C]; ShutterInfo* temp_v1 = &sShutterInfo[this->gfxType];
f32 temp_f2 = func_80996840(play, this, (this->unk_16C != 3) ? 0.0f : 80.0f, temp_v1->e, temp_v1->f); f32 temp_f2 = func_80996840(play, this, (this->gfxType != 3) ? 0.0f : 80.0f, temp_v1->e, temp_v1->f);
if (fabsf(temp_f2) < 50.0f) { if (fabsf(temp_f2) < 50.0f) {
s16 phi_v0 = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y; s16 phi_v0 = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
@ -370,7 +370,7 @@ void func_80996A54(DoorShutter* this, PlayState* play) {
if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) { if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) {
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
OnePointCutscene_Attention(play, &GET_PLAYER(play)->actor); OnePointCutscene_Attention(play, &GET_PLAYER(play)->actor);
this->unk_16F = -100; this->actionTimer = -100;
} }
} else if (func_809968D4(this, play) != 0) { } else if (func_809968D4(this, play) != 0) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
@ -386,7 +386,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) {
if (this->unk_164 != 0) { if (this->unk_164 != 0) {
DoorShutter_SetupAction(this, func_80997004); DoorShutter_SetupAction(this, func_80997004);
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
if (this->unk_16E != 0) { if (this->unlockTimer != 0) {
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
if (this->doorType != SHUTTER_BOSS) { if (this->doorType != SHUTTER_BOSS) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--;
@ -402,7 +402,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) {
if (doorDirection != 0) { if (doorDirection != 0) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (this->unk_16E != 0) { if (this->unlockTimer != 0) {
if (this->doorType == SHUTTER_BOSS) { if (this->doorType == SHUTTER_BOSS) {
if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) { if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) {
player->naviTextId = -0x204; player->naviTextId = -0x204;
@ -424,22 +424,22 @@ void func_80996B0C(DoorShutter* this, PlayState* play) {
void func_80996C60(DoorShutter* this, PlayState* play) { void func_80996C60(DoorShutter* this, PlayState* play) {
if (this->dyna.actor.category == ACTORCAT_DOOR) { if (this->dyna.actor.category == ACTORCAT_DOOR) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s32 sp38 = this->unk_16C; s32 sp38 = this->gfxType;
s32 sp34 = 0xF; s32 sp34 = 0xF;
if (DoorShutter_SetupDoor(this, play)) { if (DoorShutter_SetupDoor(this, play)) {
sp34 = 0x20; sp34 = 0x20;
} }
DoorShutter_SetupAction(this, func_80997004); DoorShutter_SetupAction(this, func_80997004);
this->unk_16C = sp38; this->gfxType = sp38;
this->unk_170 = 0.0f; this->barsClosedAmount = 0.0f;
Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->cv.slidingDoorBgCamIndex, 0.0f, 12, Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->cv.slidingDoorBgCamIndex, 0.0f, 12,
sp34, 10); sp34, 10);
} }
} }
s32 func_80996D14(DoorShutter* this, PlayState* play) { s32 func_80996D14(DoorShutter* this, PlayState* play) {
if (this->unk_16C != 3) { if (this->gfxType != 3) {
if (this->dyna.actor.velocity.y == 0.0f) { if (this->dyna.actor.velocity.y == 0.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
func_80996C60(this, play); func_80996C60(this, play);
@ -450,11 +450,11 @@ s32 func_80996D14(DoorShutter* this, PlayState* play) {
return true; return true;
} }
} else { } else {
if (this->unk_166 == 100) { if (this->jabuDoorClosedAmount == 100) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYODOOR_OPEN); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYODOOR_OPEN);
func_80996C60(this, play); func_80996C60(this, play);
} }
if (Math_StepToS(&this->unk_166, 0, 10)) { if (Math_StepToS(&this->jabuDoorClosedAmount, 0, 10)) {
return true; return true;
} }
} }
@ -462,8 +462,8 @@ s32 func_80996D14(DoorShutter* this, PlayState* play) {
} }
s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) { s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) {
if (this->unk_170 == 1.0f - arg2) { if (this->barsClosedAmount == 1.0f - arg2) {
if (this->unk_16C != 3) { if (this->gfxType != 3) {
if (arg2 == 1.0f) { if (arg2 == 1.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE);
} else { } else {
@ -477,7 +477,7 @@ s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) {
} }
} }
} }
if (Math_StepToF(&this->unk_170, arg2, 0.2f)) { if (Math_StepToF(&this->barsClosedAmount, arg2, 0.2f)) {
return true; return true;
} }
return false; return false;
@ -489,7 +489,7 @@ void func_80996EE8(DoorShutter* this, PlayState* play) {
DoorShutter_SetupAction(this, func_80997150); DoorShutter_SetupAction(this, func_80997150);
if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) { if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) {
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
this->unk_16F = -100; this->actionTimer = -100;
} }
} else if (func_809968D4(this, play)) { } else if (func_809968D4(this, play)) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
@ -508,12 +508,12 @@ void func_80996F98(DoorShutter* this, PlayState* play) {
} }
void func_80997004(DoorShutter* this, PlayState* play) { void func_80997004(DoorShutter* this, PlayState* play) {
if (DECR(this->unk_16E) == 0 && play->roomCtx.status == 0 && func_80996D14(this, play) != 0) { if (DECR(this->unlockTimer) == 0 && play->roomCtx.status == 0 && func_80996D14(this, play) != 0) {
if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToPlayer) { if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToPlayer) {
if (DoorShutter_SetupDoor(this, play)) { if (DoorShutter_SetupDoor(this, play)) {
this->dyna.actor.velocity.y = 30.0f; this->dyna.actor.velocity.y = 30.0f;
} }
if (this->unk_16C != 3) { if (this->gfxType != 3) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
DoorShutter_SetupAction(this, func_809973E8); DoorShutter_SetupAction(this, func_809973E8);
} else { } else {
@ -529,16 +529,16 @@ void func_80997004(DoorShutter* this, PlayState* play) {
} }
void func_80997150(DoorShutter* this, PlayState* play) { void func_80997150(DoorShutter* this, PlayState* play) {
if (this->unk_16F != 0) { if (this->actionTimer != 0) {
if (this->unk_16F < 0) { if (this->actionTimer < 0) {
if (play->state.frames % 2 != 0) { if (play->state.frames % 2 != 0) {
this->unk_16F++; this->actionTimer++;
} }
if (this->dyna.actor.category == func_8005B198() || this->unk_16F == 0) { if (this->dyna.actor.category == func_8005B198() || this->actionTimer == 0) {
this->unk_16F = 5; this->actionTimer = 5;
} }
} else { } else {
this->unk_16F--; this->actionTimer--;
} }
} else if (func_80996E08(this, play, 0.0f)) { } else if (func_80996E08(this, play, 0.0f)) {
if (!(this->doorType == SHUTTER || this->doorType == SHUTTER_FRONT_CLEAR)) { if (!(this->doorType == SHUTTER || this->doorType == SHUTTER_FRONT_CLEAR)) {
@ -601,13 +601,13 @@ void func_809973E8(DoorShutter* this, PlayState* play) {
} }
void func_80997528(DoorShutter* this, PlayState* play) { void func_80997528(DoorShutter* this, PlayState* play) {
if (Math_StepToS(&this->unk_166, 0x64, 0xA)) { if (Math_StepToS(&this->jabuDoorClosedAmount, 0x64, 0xA)) {
func_80997220(this, play); func_80997220(this, play);
} }
} }
void func_80997568(DoorShutter* this, PlayState* play) { void func_80997568(DoorShutter* this, PlayState* play) {
if (this->unk_16F++ > 30) { if (this->actionTimer++ > 30) {
Player_SetCsActionWithHaltedActors(play, NULL, 7); Player_SetCsActionWithHaltedActors(play, NULL, 7);
DoorShutter_SetupDoor(this, play); DoorShutter_SetupDoor(this, play);
} }
@ -666,7 +666,7 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) {
Gfx* func_80997838(PlayState* play, DoorShutter* this, Gfx* p) { Gfx* func_80997838(PlayState* play, DoorShutter* this, Gfx* p) {
MtxF mtx; MtxF mtx;
f32 angle = 0.0f; f32 angle = 0.0f;
f32 yScale = this->unk_166 * 0.01f; f32 yScale = this->jabuDoorClosedAmount * 0.01f;
s32 i; s32 i;
Matrix_Get(&mtx); Matrix_Get(&mtx);
@ -679,7 +679,7 @@ Gfx* func_80997838(PlayState* play, DoorShutter* this, Gfx* p) {
} else { } else {
Matrix_Translate(0.0f, 989.94f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 989.94f, 0.0f, MTXMODE_APPLY);
} }
if (this->unk_166 != 100) { if (this->jabuDoorClosedAmount != 100) {
Matrix_Scale(1.0f, yScale, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, yScale, 1.0f, MTXMODE_APPLY);
} }
gSPMatrix(p++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(p++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -723,18 +723,18 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
//! the init vars for the actor, and only set draw after initialization is complete. //! the init vars for the actor, and only set draw after initialization is complete.
if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex && if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex &&
(this->unk_16B == 0 || func_80997A34(this, play) != 0)) { (this->styleType == 0 || func_80997A34(this, play) != 0)) {
s32 pad[2]; s32 pad[2];
ShutterInfo* sp70 = &sShutterInfo[this->unk_16C]; ShutterInfo* sp70 = &sShutterInfo[this->gfxType];
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
if (this->unk_16C == 3) { if (this->gfxType == 3) {
POLY_OPA_DISP = func_80997838(play, this, POLY_OPA_DISP); POLY_OPA_DISP = func_80997838(play, this, POLY_OPA_DISP);
if (this->unk_170 != 0.0f) { if (this->barsClosedAmount != 0.0f) {
f32 sp58 = (this->unk_166 * 0.01f) * this->unk_170; f32 sp58 = (this->jabuDoorClosedAmount * 0.01f) * this->barsClosedAmount;
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255.0f * sp58); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255.0f * sp58);
@ -759,24 +759,24 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
Matrix_RotateY(M_PI, MTXMODE_APPLY); Matrix_RotateY(M_PI, MTXMODE_APPLY);
} }
} else if (this->doorType == SHUTTER_BOSS) { } else if (this->doorType == SHUTTER_BOSS) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809982D4[this->unk_168])); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809982D4[this->bossDoorTexIndex]));
} }
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, sp70->a); gSPDisplayList(POLY_OPA_DISP++, sp70->a);
if (this->unk_170 != 0.0f && sp70->b != NULL) { if (this->barsClosedAmount != 0.0f && sp70->b != NULL) {
Matrix_Translate(0, sp70->c * (1.0f - this->unk_170), sp70->translateZ, MTXMODE_APPLY); Matrix_Translate(0, sp70->c * (1.0f - this->barsClosedAmount), sp70->translateZ, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, sp70->b); gSPDisplayList(POLY_OPA_DISP++, sp70->b);
} }
} }
if (this->unk_16E != 0) { if (this->unlockTimer != 0) {
Matrix_Scale(0.01f, 0.01f, 0.025f, MTXMODE_APPLY); Matrix_Scale(0.01f, 0.01f, 0.025f, MTXMODE_APPLY);
Actor_DrawDoorLock(play, this->unk_16E, Actor_DrawDoorLock(play, this->unlockTimer,
(this->doorType == SHUTTER_BOSS) (this->doorType == SHUTTER_BOSS)
? DOORLOCK_BOSS ? DOORLOCK_BOSS
: ((this->unk_16C == 6) ? DOORLOCK_NORMAL_SPIRIT : DOORLOCK_NORMAL)); : ((this->gfxType == 6) ? DOORLOCK_NORMAL_SPIRIT : DOORLOCK_NORMAL));
} }
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);

View file

@ -46,15 +46,15 @@ typedef void (*DoorShutterActionFunc)(struct DoorShutter*, PlayState*);
typedef struct DoorShutter { typedef struct DoorShutter {
/* 0x0000 */ DynaPolyActor dyna; /* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ s16 unk_164; /* 0x0164 */ s16 unk_164;
/* 0x0166 */ s16 unk_166; /* 0x0166 */ s16 jabuDoorClosedAmount;
/* 0x0168 */ s16 unk_168; /* 0x0168 */ s16 bossDoorTexIndex;
/* 0x016A */ u8 doorType; /* 0x016A */ u8 doorType;
/* 0x016B */ u8 unk_16B; /* 0x016B */ u8 styleType;
/* 0x016C */ u8 unk_16C; /* 0x016C */ u8 gfxType;
/* 0x016D */ s8 requiredObjBankIndex; /* 0x016D */ s8 requiredObjBankIndex;
/* 0x016E */ s8 unk_16E; /* 0x016E */ s8 unlockTimer;
/* 0x016F */ s8 unk_16F; /* 0x016F */ s8 actionTimer;
/* 0x0170 */ f32 unk_170; /* 0x0170 */ f32 barsClosedAmount;
/* 0x0174 */ DoorShutterActionFunc actionFunc; /* 0x0174 */ DoorShutterActionFunc actionFunc;
} DoorShutter; // size = 0x0178 } DoorShutter; // size = 0x0178

View file

@ -24,7 +24,7 @@ typedef struct EnAm {
/* 0x0264 */ s16 unk_264; /* 0x0264 */ s16 unk_264;
/* 0x0266 */ u8 textureBlend; // 0 = statue textures; 255 = enemy textures /* 0x0266 */ u8 textureBlend; // 0 = statue textures; 255 = enemy textures
/* 0x0267 */ u8 damageEffect; /* 0x0267 */ u8 damageEffect;
/* 0x0267 */ Vec3f shakeOrigin; // center point to shake around when waking up /* 0x0268 */ Vec3f shakeOrigin; // center point to shake around when waking up
/* 0x0274 */ ColliderCylinder hurtCollider; /* 0x0274 */ ColliderCylinder hurtCollider;
/* 0x02C0 */ ColliderCylinder blockCollider; /* 0x02C0 */ ColliderCylinder blockCollider;
/* 0x030C */ ColliderQuad hitCollider; /* 0x030C */ ColliderQuad hitCollider;

View file

@ -30,7 +30,7 @@ typedef struct EnAttackNiw {
/* 0x027C */ f32 unk_27C; /* 0x027C */ f32 unk_27C;
/* 0x0280 */ f32 unk_280; /* 0x0280 */ f32 unk_280;
/* 0x0284 */ f32 unk_284; /* 0x0284 */ f32 unk_284;
/* 0x0284 */ f32 unk_288; /* 0x0288 */ f32 unk_288;
/* 0x028C */ s16 unk_28C; /* 0x028C */ s16 unk_28C;
/* 0x028E */ s16 unk_28E; /* 0x028E */ s16 unk_28E;
/* 0x0290 */ char unk_290[0x2]; /* 0x0290 */ char unk_290[0x2];

View file

@ -48,15 +48,15 @@ void EnBird_Init(Actor* thisx, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gBirdSkel, &gBirdFlyAnim, NULL, NULL, 0); SkelAnime_Init(play, &this->skelAnime, &gBirdSkel, &gBirdFlyAnim, NULL, NULL, 0);
ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawCircle, 4); ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawCircle, 4);
this->unk_194 = 0; this->unk_194 = 0;
this->unk_198 = 0; this->timer = 0;
this->unk_1C0 = 0x9C4; this->rotYStep = 0x9C4;
this->actor.colChkInfo.mass = 0; this->actor.colChkInfo.mass = 0;
this->unk_1A8 = 1.5f; this->speedTarget = 1.5f;
this->unk_1AC = 0.5f; this->speedStep = 0.5f;
this->unk_1A0 = 0.0f; this->posYMag = 0.0f;
this->unk_1A4 = 0.0f; this->rotYMag = 0.0f;
this->unk_1B8 = 0.0f; this->posYPhaseStep = 0.0f;
this->unk_1B0 = 40.0f; this->flightDistance = 40.0f;
this->unk_1BC = 70.0f; this->unk_1BC = 70.0f;
func_809C1CAC(this, this->actor.params); func_809C1CAC(this, this->actor.params);
} }
@ -69,55 +69,55 @@ void EnBird_Destroy(Actor* thisx, PlayState* play) {
void func_809C1CAC(EnBird* this, s16 params) { void func_809C1CAC(EnBird* this, s16 params) {
f32 frameCount = Animation_GetLastFrame(&gBirdFlyAnim); f32 frameCount = Animation_GetLastFrame(&gBirdFlyAnim);
f32 playbackSpeed = this->unk_19C ? 0.0f : 1.0f; f32 playbackSpeed = this->scaleAnimSpeed ? 0.0f : 1.0f;
AnimationHeader* anim = &gBirdFlyAnim; AnimationHeader* anim = &gBirdFlyAnim;
this->unk_198 = Rand_S16Offset(5, 0x23); this->timer = Rand_S16Offset(5, 0x23);
Animation_Change(&this->skelAnime, anim, playbackSpeed, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f); Animation_Change(&this->skelAnime, anim, playbackSpeed, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f);
EnBird_SetupAction(this, func_809C1D60); EnBird_SetupAction(this, func_809C1D60);
} }
void func_809C1D60(EnBird* this, PlayState* play) { void func_809C1D60(EnBird* this, PlayState* play) {
f32 fVar2 = sinf(this->unk_1B4); f32 fVar2 = sinf(this->posYPhase);
this->actor.shape.yOffset = this->actor.shape.yOffset + fVar2 * this->unk_1A0; this->actor.shape.yOffset = this->actor.shape.yOffset + fVar2 * this->posYMag;
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f);
if (this->unk_19C != 0) { if (this->scaleAnimSpeed != 0) {
this->skelAnime.playSpeed = this->actor.speedXZ + this->actor.speedXZ; this->skelAnime.playSpeed = this->actor.speedXZ + this->actor.speedXZ;
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->unk_198 -= 1; this->timer -= 1;
if (this->unk_198 <= 0) { if (this->timer <= 0) {
func_809C1E00(this, this->actor.params); func_809C1E00(this, this->actor.params);
} }
} }
void func_809C1E00(EnBird* this, s16 params) { void func_809C1E00(EnBird* this, s16 params) {
this->unk_198 = Rand_S16Offset(0x14, 0x2D); this->timer = Rand_S16Offset(0x14, 0x2D);
EnBird_SetupAction(this, func_809C1E40); EnBird_SetupAction(this, func_809C1E40);
} }
void func_809C1E40(EnBird* this, PlayState* play) { void func_809C1E40(EnBird* this, PlayState* play) {
f32 fVar4 = sinf(this->unk_1B4); f32 fVar4 = sinf(this->posYPhase);
this->actor.shape.yOffset += fVar4 * this->unk_1A0; this->actor.shape.yOffset += fVar4 * this->posYMag;
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_1A8, 0.1f, this->unk_1AC, 0.0f); Math_SmoothStepToF(&this->actor.speedXZ, this->speedTarget, 0.1f, this->speedStep, 0.0f);
if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) || this->unk_198 < 4) { if (this->flightDistance < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) || this->timer < 4) {
Math_StepToAngleS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos), Math_StepToAngleS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos),
this->unk_1C0); this->rotYStep);
} else { } else {
fVar4 = sinf(this->unk_1B4); fVar4 = sinf(this->posYPhase);
this->actor.world.rot.y += (s16)(fVar4 * this->unk_1A4); this->actor.world.rot.y += (s16)(fVar4 * this->rotYMag);
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->unk_198 -= 1; this->timer -= 1;
if (this->unk_198 < 0) { if (this->timer < 0) {
func_809C1CAC(this, this->actor.params); func_809C1CAC(this, this->actor.params);
} }
} }
@ -125,7 +125,7 @@ void func_809C1E40(EnBird* this, PlayState* play) {
void EnBird_Update(Actor* thisx, PlayState* play) { void EnBird_Update(Actor* thisx, PlayState* play) {
EnBird* this = (EnBird*)thisx; EnBird* this = (EnBird*)thisx;
this->unk_1B4 += this->unk_1B8; this->posYPhase += this->posYPhaseStep;
this->actionFunc(this, play); this->actionFunc(this, play);
} }

View file

@ -13,18 +13,18 @@ typedef struct EnBird {
/* 0x014C */ SkelAnime skelAnime; /* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnBirdActionFunc actionFunc; /* 0x0190 */ EnBirdActionFunc actionFunc;
/* 0x0194 */ u32 unk_194; /* 0x0194 */ u32 unk_194;
/* 0x0198 */ s32 unk_198; /* 0x0198 */ s32 timer;
/* 0x019C */ s16 unk_19C; /* 0x019C */ s16 scaleAnimSpeed;
/* 0x019E */ char unk_19E[0x2]; /* 0x019E */ char unk_19E[0x2];
/* 0x01A0 */ f32 unk_1A0; /* 0x01A0 */ f32 posYMag;
/* 0x01A4 */ f32 unk_1A4; /* 0x01A4 */ f32 rotYMag;
/* 0x01A8 */ f32 unk_1A8; /* 0x01A8 */ f32 speedTarget;
/* 0x01AC */ f32 unk_1AC; /* 0x01AC */ f32 speedStep;
/* 0x01B0 */ f32 unk_1B0; /* 0x01B0 */ f32 flightDistance;
/* 0x01B4 */ f32 unk_1B4; /* 0x01B4 */ f32 posYPhase;
/* 0x01B8 */ f32 unk_1B8; /* 0x01B8 */ f32 posYPhaseStep;
/* 0x01BC */ f32 unk_1BC; /* 0x01BC */ f32 unk_1BC;
/* 0x01C0 */ s16 unk_1C0; /* 0x01C0 */ s16 rotYStep;
/* 0x01C2 */ char unk_1C2[0x1A]; /* 0x01C2 */ char unk_1C2[0x1A];
} EnBird; // size = 0x01DC } EnBird; // size = 0x01DC

View file

@ -86,7 +86,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) {
cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, 1); cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, 1);
if (cucco != NULL) { if (cucco != NULL) {
cucco->unk_2F4 = cuccoScales[i]; cucco->scale = cuccoScales[i];
cucco->collider.dim.radius = (s16)cuccoColliderDims[i][0]; cucco->collider.dim.radius = (s16)cuccoColliderDims[i][0];
cucco->collider.dim.height = (s16)cuccoColliderDims[i][1]; cucco->collider.dim.height = (s16)cuccoColliderDims[i][1];
} }

View file

@ -76,34 +76,34 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, PlayState* play) {
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->camId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->camId, CAM_STAT_ACTIVE);
this->unk_1C8.x = this->unk_1C8.y = this->unk_1C8.z = 0.1f; this->subCamAtMaxVelFrac.x = this->subCamAtMaxVelFrac.y = this->subCamAtMaxVelFrac.z = 0.1f;
this->unk_1A4.x = this->unk_1A4.y = this->unk_1A4.z = 0.1f; this->subCamEyeMaxVelFrac.x = this->subCamEyeMaxVelFrac.y = this->subCamEyeMaxVelFrac.z = 0.1f;
this->unk_180.x = this->unk_168.x = play->view.lookAt.x; this->subCamAt.x = this->viewAt.x = play->view.lookAt.x;
this->unk_180.y = this->unk_168.y = play->view.lookAt.y; this->subCamAt.y = this->viewAt.y = play->view.lookAt.y;
this->unk_180.z = this->unk_168.z = play->view.lookAt.z; this->subCamAt.z = this->viewAt.z = play->view.lookAt.z;
this->unk_18C.x = this->unk_174.x = play->view.eye.x; this->subCamEye.x = this->viewEye.x = play->view.eye.x;
this->unk_18C.y = this->unk_174.y = play->view.eye.y; this->subCamEye.y = this->viewEye.y = play->view.eye.y;
this->unk_18C.z = this->unk_174.z = play->view.eye.z; this->subCamEye.z = this->viewEye.z = play->view.eye.z;
this->unk_1BC.x = 20.0f; this->subCamAtNext.x = 20.0f;
this->unk_1BC.y = 100.0f; this->subCamAtNext.y = 100.0f;
this->unk_1BC.z = -800.0f; this->subCamAtNext.z = -800.0f;
this->unk_198.x = 20.0f; this->subCamEyeNext.x = 20.0f;
this->unk_198.y = 50.0f; this->subCamEyeNext.y = 50.0f;
this->unk_198.z = -485.0f; this->subCamEyeNext.z = -485.0f;
this->unk_1B0.x = fabsf(this->unk_18C.x - this->unk_198.x) * 0.02f; this->subCamEyeVel.x = fabsf(this->subCamEye.x - this->subCamEyeNext.x) * 0.02f;
this->unk_1B0.y = fabsf(this->unk_18C.y - this->unk_198.y) * 0.02f; this->subCamEyeVel.y = fabsf(this->subCamEye.y - this->subCamEyeNext.y) * 0.02f;
this->unk_1B0.z = fabsf(this->unk_18C.z - this->unk_198.z) * 0.02f; this->subCamEyeVel.z = fabsf(this->subCamEye.z - this->subCamEyeNext.z) * 0.02f;
this->unk_1D4.x = fabsf(this->unk_180.x - this->unk_1BC.x) * 0.02f; this->subCamAtVel.x = fabsf(this->subCamAt.x - this->subCamAtNext.x) * 0.02f;
this->unk_1D4.y = fabsf(this->unk_180.y - this->unk_1BC.y) * 0.02f; this->subCamAtVel.y = fabsf(this->subCamAt.y - this->subCamAtNext.y) * 0.02f;
this->unk_1D4.z = fabsf(this->unk_180.z - this->unk_1BC.z) * 0.02f; this->subCamAtVel.z = fabsf(this->subCamAt.z - this->subCamAtNext.z) * 0.02f;
Play_CameraSetAtEye(play, this->camId, &this->unk_180, &this->unk_18C); Play_CameraSetAtEye(play, this->camId, &this->subCamAt, &this->subCamEye);
this->actor.textId = 0xF; this->actor.textId = 0xF;
Message_StartTextbox(play, this->actor.textId, NULL); Message_StartTextbox(play, this->actor.textId, NULL);
this->unk_154 = TEXT_STATE_EVENT; this->unk_154 = TEXT_STATE_EVENT;
@ -121,23 +121,26 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, PlayState* play) {
void EnBomBowlPit_CameraDollyIn(EnBomBowlPit* this, PlayState* play) { void EnBomBowlPit_CameraDollyIn(EnBomBowlPit* this, PlayState* play) {
if (this->camId != SUBCAM_FREE) { if (this->camId != SUBCAM_FREE) {
Math_ApproachF(&this->unk_180.x, this->unk_1BC.x, this->unk_1C8.x, this->unk_1D4.x); Math_ApproachF(&this->subCamAt.x, this->subCamAtNext.x, this->subCamAtMaxVelFrac.x, this->subCamAtVel.x);
Math_ApproachF(&this->unk_180.y, this->unk_1BC.y, this->unk_1C8.y, this->unk_1D4.y); Math_ApproachF(&this->subCamAt.y, this->subCamAtNext.y, this->subCamAtMaxVelFrac.y, this->subCamAtVel.y);
Math_ApproachF(&this->unk_180.z, this->unk_1BC.z, this->unk_1C8.z, this->unk_1D4.z); Math_ApproachF(&this->subCamAt.z, this->subCamAtNext.z, this->subCamAtMaxVelFrac.z, this->subCamAtVel.z);
Math_ApproachF(&this->unk_18C.x, this->unk_198.x, this->unk_1A4.x, this->unk_1B0.x); Math_ApproachF(&this->subCamEye.x, this->subCamEyeNext.x, this->subCamEyeMaxVelFrac.x, this->subCamEyeVel.x);
Math_ApproachF(&this->unk_18C.y, this->unk_198.y, this->unk_1A4.y, this->unk_1B0.y); Math_ApproachF(&this->subCamEye.y, this->subCamEyeNext.y, this->subCamEyeMaxVelFrac.y, this->subCamEyeVel.y);
Math_ApproachF(&this->unk_18C.z, this->unk_198.z, this->unk_1A4.z, this->unk_1B0.z); Math_ApproachF(&this->subCamEye.z, this->subCamEyeNext.z, this->subCamEyeMaxVelFrac.z, this->subCamEyeVel.z);
} }
Play_CameraSetAtEye(play, this->camId, &this->unk_180, &this->unk_18C); Play_CameraSetAtEye(play, this->camId, &this->subCamAt, &this->subCamEye);
if ((this->unk_154 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) { if ((this->unk_154 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
} }
if ((fabsf(this->unk_18C.x - this->unk_198.x) < 5.0f) && (fabsf(this->unk_18C.y - this->unk_198.y) < 5.0f) && if ((fabsf(this->subCamEye.x - this->subCamEyeNext.x) < 5.0f) &&
(fabsf(this->unk_18C.z - this->unk_198.z) < 5.0f) && (fabsf(this->unk_180.x - this->unk_1BC.x) < 5.0f) && (fabsf(this->subCamEye.y - this->subCamEyeNext.y) < 5.0f) &&
(fabsf(this->unk_180.y - this->unk_1BC.y) < 5.0f) && (fabsf(this->unk_180.z - this->unk_1BC.z) < 5.0f)) { (fabsf(this->subCamEye.z - this->subCamEyeNext.z) < 5.0f) &&
(fabsf(this->subCamAt.x - this->subCamAtNext.x) < 5.0f) &&
(fabsf(this->subCamAt.y - this->subCamAtNext.y) < 5.0f) &&
(fabsf(this->subCamAt.z - this->subCamAtNext.z) < 5.0f)) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
this->timer = 30; this->timer = 30;
this->actionFunc = EnBomBowlPit_SpawnPrize; this->actionFunc = EnBomBowlPit_SpawnPrize;

View file

@ -21,16 +21,16 @@ typedef struct EnBomBowlPit {
/* 0x015C */ s16 start; /* 0x015C */ s16 start;
/* 0x0160 */ s32 getItemId; /* 0x0160 */ s32 getItemId;
/* 0x0164 */ u8 status; /* 0x0164 */ u8 status;
/* 0x0168 */ Vec3f unk_168; // set and not used? /* 0x0168 */ Vec3f viewAt; // set and not used?
/* 0x0174 */ Vec3f unk_174; // set and not used? /* 0x0174 */ Vec3f viewEye; // set and not used?
/* 0x0180 */ Vec3f unk_180; // camera at (start) /* 0x0180 */ Vec3f subCamAt; // camera at (start)
/* 0x018C */ Vec3f unk_18C; // camera eye (start) /* 0x018C */ Vec3f subCamEye; // camera eye (start)
/* 0x0198 */ Vec3f unk_198; // camera eye (end) /* 0x0198 */ Vec3f subCamEyeNext; // camera eye (end)
/* 0x01A4 */ Vec3f unk_1A4; // camera eye (scales) /* 0x01A4 */ Vec3f subCamEyeMaxVelFrac; // camera eye (scales)
/* 0x01B0 */ Vec3f unk_1B0; // camera eye (maxsteps) /* 0x01B0 */ Vec3f subCamEyeVel; // camera eye (maxsteps)
/* 0x01BC */ Vec3f unk_1BC; // camera at (end) /* 0x01BC */ Vec3f subCamAtNext; // camera at (end)
/* 0x01C8 */ Vec3f unk_1C8; // camera at (scales) /* 0x01C8 */ Vec3f subCamAtMaxVelFrac; // camera at (scales)
/* 0x01D4 */ Vec3f unk_1D4; // camera eye (maxsteps) /* 0x01D4 */ Vec3f subCamAtVel; // camera eye (maxsteps)
/* 0x01E0 */ EnExItem* exItem; /* 0x01E0 */ EnExItem* exItem;
/* 0x01E4 */ char unk_1E4[0x3520]; /* 0x01E4 */ char unk_1E4[0x3520];
} EnBomBowlPit; // size = 0x3704 } EnBomBowlPit; // size = 0x3704

View file

@ -271,7 +271,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) {
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
EnBox_SetupAction(this, EnBox_WaitOpen); EnBox_SetupAction(this, EnBox_WaitOpen);
if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) { if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) {
OnePointCutscene_EndCutscene(play, this->unk_1AC); OnePointCutscene_EndCutscene(play, this->subCamId);
} }
} }
Audio_PlaySoundGeneral(NA_SE_EV_COFFIN_CAP_BOUND, &this->dyna.actor.projectedPos, 4, Audio_PlaySoundGeneral(NA_SE_EV_COFFIN_CAP_BOUND, &this->dyna.actor.projectedPos, 4,
@ -295,7 +295,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) {
if (this->unk_1A8 >= 0) { if (this->unk_1A8 >= 0) {
EnBox_SetupAction(this, EnBox_Fall); EnBox_SetupAction(this, EnBox_Fall);
this->unk_1AC = OnePointCutscene_Init(play, 4500, 9999, &this->dyna.actor, MAIN_CAM); this->subCamId = OnePointCutscene_Init(play, 4500, 9999, &this->dyna.actor, MAIN_CAM);
func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId); func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId);
} else if (this->unk_1A8 >= -11) { } else if (this->unk_1A8 >= -11) {
this->unk_1A8++; this->unk_1A8++;

View file

@ -34,7 +34,7 @@ typedef struct EnBox {
/* 0x0000 */ DynaPolyActor dyna; /* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ SkelAnime skelanime; /* 0x0164 */ SkelAnime skelanime;
/* 0x01A8 */ s32 unk_1A8; // related to animation delays for types 3 and 8 /* 0x01A8 */ s32 unk_1A8; // related to animation delays for types 3 and 8
/* 0x01AC */ s32 unk_1AC; /* 0x01AC */ s32 subCamId;
/* 0x01B0 */ f32 unk_1B0; // 0-1, rotation-related, apparently unused (in z_en_box.c at least) /* 0x01B0 */ f32 unk_1B0; // 0-1, rotation-related, apparently unused (in z_en_box.c at least)
/* 0x01B4 */ EnBoxActionFunc actionFunc; /* 0x01B4 */ EnBoxActionFunc actionFunc;
/* 0x01B8 */ Vec3s jointTable[5]; /* 0x01B8 */ Vec3s jointTable[5];

View file

@ -110,27 +110,27 @@ void EnBrob_Destroy(Actor* thisx, PlayState* play) {
void func_809CADDC(EnBrob* this, PlayState* play) { void func_809CADDC(EnBrob* this, PlayState* play) {
func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId); func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId);
this->timer = this->actionFunc == func_809CB2B8 ? 200 : 0; this->timer = this->actionFunc == func_809CB2B8 ? 200 : 0;
this->unk_1AE = 0; this->modelOffsetY = 0;
this->actionFunc = func_809CB054; this->actionFunc = func_809CB054;
} }
void func_809CAE44(EnBrob* this, PlayState* play) { void func_809CAE44(EnBrob* this, PlayState* play) {
Animation_PlayOnce(&this->skelAnime, &object_brob_Anim_001750); Animation_PlayOnce(&this->skelAnime, &object_brob_Anim_001750);
func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId); func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId);
this->unk_1AE = 1000; this->modelOffsetY = 1000;
this->actionFunc = func_809CB114; this->actionFunc = func_809CB114;
} }
void func_809CAEA0(EnBrob* this) { void func_809CAEA0(EnBrob* this) {
Animation_MorphToLoop(&this->skelAnime, &object_brob_Anim_001958, -5.0f); Animation_MorphToLoop(&this->skelAnime, &object_brob_Anim_001958, -5.0f);
this->unk_1AE = 8000; this->modelOffsetY = 8000;
this->timer = 1200; this->timer = 1200;
this->actionFunc = func_809CB218; this->actionFunc = func_809CB218;
} }
void func_809CAEF4(EnBrob* this) { void func_809CAEF4(EnBrob* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_brob_Anim_000290, -5.0f); Animation_MorphToPlayOnce(&this->skelAnime, &object_brob_Anim_000290, -5.0f);
this->unk_1AE -= 125.0f; this->modelOffsetY -= 125.0f;
Actor_SetColorFilter(&this->dyna.actor, 0, 0xFF, 0, 0x50); Actor_SetColorFilter(&this->dyna.actor, 0, 0xFF, 0, 0x50);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_GOMA_JR_FREEZE); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actionFunc = func_809CB2B8; this->actionFunc = func_809CB2B8;
@ -139,7 +139,7 @@ void func_809CAEF4(EnBrob* this) {
void func_809CAF88(EnBrob* this) { void func_809CAF88(EnBrob* this) {
Animation_Change(&this->skelAnime, &object_brob_Anim_001750, -1.0f, Animation_Change(&this->skelAnime, &object_brob_Anim_001750, -1.0f,
Animation_GetLastFrame(&object_brob_Anim_001750), 0.0f, ANIMMODE_ONCE, -5.0f); Animation_GetLastFrame(&object_brob_Anim_001750), 0.0f, ANIMMODE_ONCE, -5.0f);
this->unk_1AE = 8250; this->modelOffsetY = 8250;
this->actionFunc = func_809CB354; this->actionFunc = func_809CB354;
} }
@ -173,11 +173,11 @@ void func_809CB114(EnBrob* this, PlayState* play) {
} else { } else {
curFrame = this->skelAnime.curFrame; curFrame = this->skelAnime.curFrame;
if (curFrame < 8.0f) { if (curFrame < 8.0f) {
this->unk_1AE += 1000.0f; this->modelOffsetY += 1000.0f;
} else if (curFrame < 12.0f) { } else if (curFrame < 12.0f) {
this->unk_1AE += 250.0f; this->modelOffsetY += 250.0f;
} else { } else {
this->unk_1AE -= 250.0f; this->modelOffsetY -= 250.0f;
} }
} }
} }
@ -199,7 +199,7 @@ void func_809CB2B8(EnBrob* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
func_809CADDC(this, play); func_809CADDC(this, play);
} else if (this->skelAnime.curFrame < 8.0f) { } else if (this->skelAnime.curFrame < 8.0f) {
this->unk_1AE -= 1250.0f; this->modelOffsetY -= 1250.0f;
} }
this->dyna.actor.colorFilterTimer = 0x50; this->dyna.actor.colorFilterTimer = 0x50;
} }
@ -212,11 +212,11 @@ void func_809CB354(EnBrob* this, PlayState* play) {
} else { } else {
curFrame = this->skelAnime.curFrame; curFrame = this->skelAnime.curFrame;
if (curFrame < 8.0f) { if (curFrame < 8.0f) {
this->unk_1AE -= 1000.0f; this->modelOffsetY -= 1000.0f;
} else if (curFrame < 12.0f) { } else if (curFrame < 12.0f) {
this->unk_1AE -= 250.0f; this->modelOffsetY -= 250.0f;
} else { } else {
this->unk_1AE += 250.0f; this->modelOffsetY += 250.0f;
} }
} }
} }
@ -326,6 +326,6 @@ void EnBrob_Draw(Actor* thisx, PlayState* play) {
EnBrob* this = (EnBrob*)thisx; EnBrob* this = (EnBrob*)thisx;
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
Matrix_Translate(0.0f, this->unk_1AE, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, this->modelOffsetY, 0.0f, MTXMODE_APPLY);
SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, EnBrob_PostLimbDraw, this); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, EnBrob_PostLimbDraw, this);
} }

View file

@ -13,7 +13,7 @@ typedef struct EnBrob {
/* 0x0164 */ SkelAnime skelAnime; /* 0x0164 */ SkelAnime skelAnime;
/* 0x01A8 */ EnBrobActionFunc actionFunc; /* 0x01A8 */ EnBrobActionFunc actionFunc;
/* 0x01AC */ s16 timer; /* 0x01AC */ s16 timer;
/* 0x01AE */ s16 unk_1AE; /* 0x01AE */ s16 modelOffsetY;
/* 0x01B0 */ Vec3s jointTable[10]; /* 0x01B0 */ Vec3s jointTable[10];
/* 0x01EC */ Vec3s morphTable[10]; /* 0x01EC */ Vec3s morphTable[10];
/* 0x0228 */ ColliderCylinder colliders[2]; /* 0x0228 */ ColliderCylinder colliders[2];

View file

@ -129,8 +129,8 @@ void EnCow_Init(Actor* thisx, PlayState* play) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_COW, this->actor.world.pos.x, Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_COW, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 1); this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 1);
this->unk_278 = Rand_ZeroFloat(1000.0f) + 40.0f; this->animationTimer = Rand_ZeroFloat(1000.0f) + 40.0f;
this->unk_27A = 0; this->breathTimer = 0;
this->actor.targetMode = 6; this->actor.targetMode = 6;
DREG(53) = 0; DREG(53) = 0;
break; break;
@ -142,12 +142,12 @@ void EnCow_Init(Actor* thisx, PlayState* play) {
this->actionFunc = func_809DFA84; this->actionFunc = func_809DFA84;
func_809DEF94(this); func_809DEF94(this);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->unk_278 = ((u32)(Rand_ZeroFloat(1000.0f)) & 0xFFFF) + 40.0f; this->animationTimer = ((u32)(Rand_ZeroFloat(1000.0f)) & 0xFFFF) + 40.0f;
break; break;
} }
this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f); Actor_SetScale(&this->actor, 0.01f);
this->unk_276 = 0; this->cowFlags = 0;
} }
void EnCow_Destroy(Actor* thisx, PlayState* play) { void EnCow_Destroy(Actor* thisx, PlayState* play) {
@ -162,35 +162,35 @@ void EnCow_Destroy(Actor* thisx, PlayState* play) {
} }
void func_809DF494(EnCow* this, PlayState* play) { void func_809DF494(EnCow* this, PlayState* play) {
if (this->unk_278 > 0) { if (this->animationTimer > 0) {
this->unk_278 -= 1; this->animationTimer -= 1;
} else { } else {
this->unk_278 = Rand_ZeroFloat(500.0f) + 40.0f; this->animationTimer = Rand_ZeroFloat(500.0f) + 40.0f;
Animation_Change(&this->skelAnime, &gCowBodyChewAnim, 1.0f, this->skelAnime.curFrame, Animation_Change(&this->skelAnime, &gCowBodyChewAnim, 1.0f, this->skelAnime.curFrame,
Animation_GetLastFrame(&gCowBodyChewAnim), ANIMMODE_ONCE, 1.0f); Animation_GetLastFrame(&gCowBodyChewAnim), ANIMMODE_ONCE, 1.0f);
} }
if ((this->actor.xzDistToPlayer < 150.0f) && (!(this->unk_276 & 2))) { if ((this->actor.xzDistToPlayer < 150.0f) && (!(this->cowFlags & 2))) {
this->unk_276 |= 2; this->cowFlags |= 2;
if (this->skelAnime.animation == &gCowBodyChewAnim) { if (this->skelAnime.animation == &gCowBodyChewAnim) {
this->unk_278 = 0; this->animationTimer = 0;
} }
} }
this->unk_27A += 1; this->breathTimer += 1;
if (this->unk_27A >= 0x31) { if (this->breathTimer >= 0x31) {
this->unk_27A = 0; this->breathTimer = 0;
} }
// (1.0f / 100.0f) instead of 0.01f below is necessary so 0.01f doesn't get reused mistakenly // (1.0f / 100.0f) instead of 0.01f below is necessary so 0.01f doesn't get reused mistakenly
if (this->unk_27A < 0x20) { if (this->breathTimer < 0x20) {
this->actor.scale.x = ((Math_SinS(this->unk_27A << 0xA) * (1.0f / 100.0f)) + 1.0f) * 0.01f; this->actor.scale.x = ((Math_SinS(this->breathTimer << 0xA) * (1.0f / 100.0f)) + 1.0f) * 0.01f;
} else { } else {
this->actor.scale.x = 0.01f; this->actor.scale.x = 0.01f;
} }
if (this->unk_27A >= 0x11) { if (this->breathTimer >= 0x11) {
this->actor.scale.y = ((Math_SinS((this->unk_27A << 0xA) - 0x4000) * (1.0f / 100.0f)) + 1.0f) * 0.01f; this->actor.scale.y = ((Math_SinS((this->breathTimer << 0xA) - 0x4000) * (1.0f / 100.0f)) + 1.0f) * 0.01f;
} else { } else {
this->actor.scale.y = 0.01f; this->actor.scale.y = 0.01f;
} }
@ -255,8 +255,8 @@ void func_809DF8FC(EnCow* this, PlayState* play) {
void func_809DF96C(EnCow* this, PlayState* play) { void func_809DF96C(EnCow* this, PlayState* play) {
if ((play->msgCtx.ocarinaMode == OCARINA_MODE_00) || (play->msgCtx.ocarinaMode == OCARINA_MODE_04)) { if ((play->msgCtx.ocarinaMode == OCARINA_MODE_00) || (play->msgCtx.ocarinaMode == OCARINA_MODE_04)) {
if (DREG(53) != 0) { if (DREG(53) != 0) {
if (this->unk_276 & 4) { if (this->cowFlags & 4) {
this->unk_276 &= ~0x4; this->cowFlags &= ~0x4;
DREG(53) = 0; DREG(53) = 0;
} else { } else {
if ((this->actor.xzDistToPlayer < 150.0f) && if ((this->actor.xzDistToPlayer < 150.0f) &&
@ -271,30 +271,30 @@ void func_809DF96C(EnCow* this, PlayState* play) {
return; return;
} }
} else { } else {
this->unk_276 |= 4; this->cowFlags |= 4;
} }
} }
} else { } else {
this->unk_276 &= ~0x4; this->cowFlags &= ~0x4;
} }
} }
func_809DF494(this, play); func_809DF494(this, play);
} }
void func_809DFA84(EnCow* this, PlayState* play) { void func_809DFA84(EnCow* this, PlayState* play) {
if (this->unk_278 > 0) { if (this->animationTimer > 0) {
this->unk_278--; this->animationTimer--;
} else { } else {
this->unk_278 = Rand_ZeroFloat(200.0f) + 40.0f; this->animationTimer = Rand_ZeroFloat(200.0f) + 40.0f;
Animation_Change(&this->skelAnime, &gCowTailIdleAnim, 1.0f, this->skelAnime.curFrame, Animation_Change(&this->skelAnime, &gCowTailIdleAnim, 1.0f, this->skelAnime.curFrame,
Animation_GetLastFrame(&gCowTailIdleAnim), ANIMMODE_ONCE, 1.0f); Animation_GetLastFrame(&gCowTailIdleAnim), ANIMMODE_ONCE, 1.0f);
} }
if ((this->actor.xzDistToPlayer < 150.0f) && if ((this->actor.xzDistToPlayer < 150.0f) &&
(ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) { (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->cowFlags & 2))) {
this->unk_276 |= 2; this->cowFlags |= 2;
if (this->skelAnime.animation == &gCowTailIdleAnim) { if (this->skelAnime.animation == &gCowTailIdleAnim) {
this->unk_278 = 0; this->animationTimer = 0;
} }
} }
} }

View file

@ -15,9 +15,9 @@ typedef struct EnCow {
/* 0x0228 */ Vec3s jointTable[6]; /* 0x0228 */ Vec3s jointTable[6];
/* 0x024C */ Vec3s morphTable[6]; /* 0x024C */ Vec3s morphTable[6];
/* 0x0270 */ Vec3s someRot; /* 0x0270 */ Vec3s someRot;
/* 0x0276 */ u16 unk_276; /* 0x0276 */ u16 cowFlags;
/* 0x0278 */ u16 unk_278; /* 0x0278 */ u16 animationTimer;
/* 0x027A */ u16 unk_27A; /* 0x027A */ u16 breathTimer;
/* 0x027C */ EnCowActionFunc actionFunc; /* 0x027C */ EnCowActionFunc actionFunc;
} EnCow; // size = 0x0280 } EnCow; // size = 0x0280

View file

@ -308,35 +308,36 @@ void EnDivingGame_SetupRupeeThrow(EnDivingGame* this, PlayState* play) {
Play_ChangeCameraStatus(play, 0, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, 0, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
this->spawnRuppyTimer = 10; this->spawnRuppyTimer = 10;
this->unk_2F4.x = -210.0f; this->subCamAtNext.x = -210.0f;
this->unk_2F4.y = -80.0f; this->subCamAtNext.y = -80.0f;
this->unk_2F4.z = -1020.0f; this->subCamAtNext.z = -1020.0f;
this->unk_2D0.x = -280.0f; this->subCamEyeNext.x = -280.0f;
this->unk_2D0.y = -20.0f; this->subCamEyeNext.y = -20.0f;
this->unk_2D0.z = -240.0f; this->subCamEyeNext.z = -240.0f;
if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) {
this->rupeesLeftToThrow = 5; this->rupeesLeftToThrow = 5;
} else { } else {
this->rupeesLeftToThrow = 10; this->rupeesLeftToThrow = 10;
} }
this->unk_2DC.x = this->unk_2DC.y = this->unk_2DC.z = this->unk_300.x = this->unk_300.y = this->unk_300.z = 0.1f; this->subCamEyeMaxVelFrac.x = this->subCamEyeMaxVelFrac.y = this->subCamEyeMaxVelFrac.z =
this->subCamAtMaxVelFrac.x = this->subCamAtMaxVelFrac.y = this->subCamAtMaxVelFrac.z = 0.1f;
this->camLookAt.x = play->view.lookAt.x; this->camLookAt.x = play->view.lookAt.x;
this->camLookAt.y = play->view.lookAt.y; this->camLookAt.y = play->view.lookAt.y;
this->camLookAt.z = play->view.lookAt.z; this->camLookAt.z = play->view.lookAt.z;
this->camEye.x = play->view.eye.x; this->camEye.x = play->view.eye.x;
this->camEye.y = play->view.eye.y + 80.0f; this->camEye.y = play->view.eye.y + 80.0f;
this->camEye.z = play->view.eye.z + 250.0f; this->camEye.z = play->view.eye.z + 250.0f;
this->unk_2E8.x = fabsf(this->camEye.x - this->unk_2D0.x) * 0.04f; this->subCamEyeVel.x = fabsf(this->camEye.x - this->subCamEyeNext.x) * 0.04f;
this->unk_2E8.y = fabsf(this->camEye.y - this->unk_2D0.y) * 0.04f; this->subCamEyeVel.y = fabsf(this->camEye.y - this->subCamEyeNext.y) * 0.04f;
this->unk_2E8.z = fabsf(this->camEye.z - this->unk_2D0.z) * 0.04f; this->subCamEyeVel.z = fabsf(this->camEye.z - this->subCamEyeNext.z) * 0.04f;
this->unk_30C.x = fabsf(this->camLookAt.x - this->unk_2F4.x) * 0.04f; this->subCamAtVel.x = fabsf(this->camLookAt.x - this->subCamAtNext.x) * 0.04f;
this->unk_30C.y = fabsf(this->camLookAt.y - this->unk_2F4.y) * 0.04f; this->subCamAtVel.y = fabsf(this->camLookAt.y - this->subCamAtNext.y) * 0.04f;
this->unk_30C.z = fabsf(this->camLookAt.z - this->unk_2F4.z) * 0.04f; this->subCamAtVel.z = fabsf(this->camLookAt.z - this->subCamAtNext.z) * 0.04f;
Play_CameraSetAtEye(play, this->subCamId, &this->camLookAt, &this->camEye); Play_CameraSetAtEye(play, this->subCamId, &this->camLookAt, &this->camEye);
Play_CameraSetFov(play, this->subCamId, play->mainCamera.fov); Play_CameraSetFov(play, this->subCamId, play->mainCamera.fov);
this->csCameraTimer = 60; this->csCameraTimer = 60;
this->actionFunc = EnDivingGame_RupeeThrow; this->actionFunc = EnDivingGame_RupeeThrow;
this->unk_318 = 0.0f; this->subCamVelFactor = 0.0f;
} }
// Throws rupee when this->spawnRuppyTimer == 0 // Throws rupee when this->spawnRuppyTimer == 0
@ -346,12 +347,17 @@ void EnDivingGame_RupeeThrow(EnDivingGame* this, PlayState* play) {
Audio_SetExtraFilter(0); Audio_SetExtraFilter(0);
} }
if (this->subCamId != 0) { if (this->subCamId != 0) {
Math_ApproachF(&this->camEye.x, this->unk_2D0.x, this->unk_2DC.x, this->unk_2E8.x * this->unk_318); Math_ApproachF(&this->camEye.x, this->subCamEyeNext.x, this->subCamEyeMaxVelFrac.x,
Math_ApproachF(&this->camEye.z, this->unk_2D0.z, this->unk_2DC.z, this->unk_2E8.z * this->unk_318); this->subCamEyeVel.x * this->subCamVelFactor);
Math_ApproachF(&this->camLookAt.x, this->unk_2F4.x, this->unk_300.x, this->unk_30C.x * this->unk_318); Math_ApproachF(&this->camEye.z, this->subCamEyeNext.z, this->subCamEyeMaxVelFrac.z,
Math_ApproachF(&this->camLookAt.y, this->unk_2F4.y, this->unk_300.y, this->unk_30C.y * this->unk_318); this->subCamEyeVel.z * this->subCamVelFactor);
Math_ApproachF(&this->camLookAt.z, this->unk_2F4.z, this->unk_300.z, this->unk_30C.z * this->unk_318); Math_ApproachF(&this->camLookAt.x, this->subCamAtNext.x, this->subCamAtMaxVelFrac.x,
Math_ApproachF(&this->unk_318, 1.0f, 1.0f, 0.02f); this->subCamAtVel.x * this->subCamVelFactor);
Math_ApproachF(&this->camLookAt.y, this->subCamAtNext.y, this->subCamAtMaxVelFrac.y,
this->subCamAtVel.y * this->subCamVelFactor);
Math_ApproachF(&this->camLookAt.z, this->subCamAtNext.z, this->subCamAtMaxVelFrac.z,
this->subCamAtVel.z * this->subCamVelFactor);
Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, 0.02f);
} }
Play_CameraSetAtEye(play, this->subCamId, &this->camLookAt, &this->camEye); Play_CameraSetAtEye(play, this->subCamId, &this->camLookAt, &this->camEye);
if (!this->allRupeesThrown && this->spawnRuppyTimer == 0) { if (!this->allRupeesThrown && this->spawnRuppyTimer == 0) {
@ -368,10 +374,12 @@ void EnDivingGame_RupeeThrow(EnDivingGame* this, PlayState* play) {
this->allRupeesThrown = true; this->allRupeesThrown = true;
} }
} }
if (this->csCameraTimer == 0 || if (this->csCameraTimer == 0 || ((fabsf(this->camEye.x - this->subCamEyeNext.x) < 2.0f) &&
((fabsf(this->camEye.x - this->unk_2D0.x) < 2.0f) && (fabsf(this->camEye.y - this->unk_2D0.y) < 2.0f) && (fabsf(this->camEye.y - this->subCamEyeNext.y) < 2.0f) &&
(fabsf(this->camEye.z - this->unk_2D0.z) < 2.0f) && (fabsf(this->camLookAt.x - this->unk_2F4.x) < 2.0f) && (fabsf(this->camEye.z - this->subCamEyeNext.z) < 2.0f) &&
(fabsf(this->camLookAt.y - this->unk_2F4.y) < 2.0f) && (fabsf(this->camLookAt.z - this->unk_2F4.z) < 2.0f))) { (fabsf(this->camLookAt.x - this->subCamAtNext.x) < 2.0f) &&
(fabsf(this->camLookAt.y - this->subCamAtNext.y) < 2.0f) &&
(fabsf(this->camLookAt.z - this->subCamAtNext.z) < 2.0f))) {
if (this->unk_2A2 != 0) { if (this->unk_2A2 != 0) {
this->csCameraTimer = 70; this->csCameraTimer = 70;
this->unk_2A2 = 2; this->unk_2A2 = 2;
@ -389,12 +397,12 @@ void EnDivingGame_SetupUnderwaterViewCs(EnDivingGame* this, PlayState* play) {
this->unk_2A2 = 1; this->unk_2A2 = 1;
this->csCameraTimer = 100; this->csCameraTimer = 100;
this->actionFunc = EnDivingGame_RupeeThrow; this->actionFunc = EnDivingGame_RupeeThrow;
this->camLookAt.x = this->unk_2F4.x = -210.0f; this->camLookAt.x = this->subCamAtNext.x = -210.0f;
this->camLookAt.y = this->unk_2F4.y = -80.0f; this->camLookAt.y = this->subCamAtNext.y = -80.0f;
this->camLookAt.z = this->unk_2F4.z = -1020.0f; this->camLookAt.z = this->subCamAtNext.z = -1020.0f;
this->camEye.x = this->unk_2D0.x = -280.0f; this->camEye.x = this->subCamEyeNext.x = -280.0f;
this->camEye.y = this->unk_2D0.y = -20.0f; this->camEye.y = this->subCamEyeNext.y = -20.0f;
this->camEye.z = this->unk_2D0.z = -240.0f; this->camEye.z = this->subCamEyeNext.z = -240.0f;
} }
} }

View file

@ -33,13 +33,13 @@ typedef struct EnDivingGame {
/* 0x02AC */ char unk_2AC[0xC]; // probably another Vec3f, but unused. /* 0x02AC */ char unk_2AC[0xC]; // probably another Vec3f, but unused.
/* 0x02B8 */ Vec3f camLookAt; /* 0x02B8 */ Vec3f camLookAt;
/* 0x02C4 */ Vec3f camEye; /* 0x02C4 */ Vec3f camEye;
/* 0x02D0 */ Vec3f unk_2D0; /* 0x02D0 */ Vec3f subCamEyeNext;
/* 0x02DC */ Vec3f unk_2DC; /* 0x02DC */ Vec3f subCamEyeMaxVelFrac;
/* 0x02E8 */ Vec3f unk_2E8; /* 0x02E8 */ Vec3f subCamEyeVel;
/* 0x02F4 */ Vec3f unk_2F4; /* 0x02F4 */ Vec3f subCamAtNext;
/* 0x0300 */ Vec3f unk_300; /* 0x0300 */ Vec3f subCamAtMaxVelFrac;
/* 0x030C */ Vec3f unk_30C; /* 0x030C */ Vec3f subCamAtVel;
/* 0x0318 */ f32 unk_318; /* 0x0318 */ f32 subCamVelFactor;
/* 0x031C */ char unk_31C; // unused /* 0x031C */ char unk_31C; // unused
/* 0x031D */ u8 notPlayingMinigame; // flag /* 0x031D */ u8 notPlayingMinigame; // flag
/* 0x031E */ u8 allRupeesThrown; // flag /* 0x031E */ u8 allRupeesThrown; // flag

View file

@ -145,7 +145,7 @@ s32 func_809F68B0(EnDodojr* this, PlayState* play) {
return 0; return 0;
} }
if (this->unk_1FC == 0) { if (this->counter == 0) {
return 0; return 0;
} }
@ -153,10 +153,10 @@ s32 func_809F68B0(EnDodojr* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
this->dustPos = this->actor.world.pos; this->dustPos = this->actor.world.pos;
func_809F6510(this, play, 10); func_809F6510(this, play, 10);
this->actor.velocity.y = 10.0f / (4 - this->unk_1FC); this->actor.velocity.y = 10.0f / (4 - this->counter);
this->unk_1FC--; this->counter--;
if (this->unk_1FC == 0) { if (this->counter == 0) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
return 1; return 1;
} }
@ -183,8 +183,8 @@ void func_809F6A20(EnDodojr* this) {
this->actor.velocity.z = 0.0f; this->actor.velocity.z = 0.0f;
this->actor.gravity = -0.8f; this->actor.gravity = -0.8f;
if (this->unk_1FC == 0) { if (this->counter == 0) {
this->unk_1FC = 3; this->counter = 3;
this->actor.velocity.y = 10.0f; this->actor.velocity.y = 10.0f;
} }
GameInteractor_ExecuteOnEnemyDefeat(&this->actor); GameInteractor_ExecuteOnEnemyDefeat(&this->actor);
@ -203,7 +203,7 @@ void func_809F6B38(EnDodojr* this) {
Animation_Change(&this->skelAnime, &object_dodojr_Anim_000724, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &object_dodojr_Anim_000724, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, -10.0f);
this->actor.gravity = -0.8f; this->actor.gravity = -0.8f;
this->unk_1FC = 3; this->counter = 3;
this->actor.velocity.y = 10.0f; this->actor.velocity.y = 10.0f;
} }
@ -474,7 +474,7 @@ void func_809F768C(EnDodojr* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_DRINK); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_DRINK);
Actor_Kill(this->bomb); Actor_Kill(this->bomb);
this->timer3 = 24; this->timer3 = 24;
this->unk_1FC = 0; this->counter = 0;
this->actionFunc = func_809F773C; this->actionFunc = func_809F773C;
} }
} }
@ -496,7 +496,7 @@ void func_809F77AC(EnDodojr* this, PlayState* play) {
if (func_809F68B0(this, play) != 0) { if (func_809F68B0(this, play) != 0) {
this->timer3 = 60; this->timer3 = 60;
func_809F6AC4(this); func_809F6AC4(this);
this->unk_1FC = 7; this->counter = 7;
this->actionFunc = func_809F784C; this->actionFunc = func_809F784C;
} }
} }
@ -570,7 +570,7 @@ void func_809F7AB8(EnDodojr* this, PlayState* play) {
if (func_809F68B0(this, play) != 0) { if (func_809F68B0(this, play) != 0) {
this->timer3 = 60; this->timer3 = 60;
func_809F6AC4(this); func_809F6AC4(this);
this->unk_1FC = 7; this->counter = 7;
this->actionFunc = func_809F7B3C; this->actionFunc = func_809F7B3C;
} }
} }
@ -578,10 +578,10 @@ void func_809F7AB8(EnDodojr* this, PlayState* play) {
void func_809F7B3C(EnDodojr* this, PlayState* play) { void func_809F7B3C(EnDodojr* this, PlayState* play) {
EnBom* bomb; EnBom* bomb;
if (this->unk_1FC != 0) { if (this->counter != 0) {
if (this->actor.colorFilterTimer == 0) { if (this->actor.colorFilterTimer == 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_1FC); Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->counter);
this->unk_1FC--; this->counter--;
} }
} else { } else {
bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,

View file

@ -16,7 +16,7 @@ typedef struct EnDodojr {
/* 0x01E0 */ Actor* bomb; /* 0x01E0 */ Actor* bomb;
/* 0x01E4 */ Vec3f headPos; /* 0x01E4 */ Vec3f headPos;
/* 0x01F0 */ Vec3f dustPos; /* 0x01F0 */ Vec3f dustPos;
/* 0x01FC */ s16 unk_1FC; /* 0x01FC */ s16 counter;
/* 0x01FE */ s16 timer1; /* 0x01FE */ s16 timer1;
/* 0x0200 */ s16 timer2; /* 0x0200 */ s16 timer2;
/* 0x0202 */ s16 timer3; /* 0x0202 */ s16 timer3;

View file

@ -144,7 +144,7 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, PlayState* play) {
if (leever != NULL) { if (leever != NULL) {
this->curNumSpawn++; this->curNumSpawn++;
leever->unk_280 = this->leeverIndex++; leever->aimType = this->leeverIndex++;
if (this->leeverIndex >= 5) { if (this->leeverIndex >= 5) {
this->leeverIndex = 0; this->leeverIndex = 0;
} }

View file

@ -14,7 +14,7 @@ typedef struct EnExItem {
/* 0x014C */ EnExItemActionFunc actionFunc; /* 0x014C */ EnExItemActionFunc actionFunc;
/* 0x0150 */ s16 getItemObjId; /* 0x0150 */ s16 getItemObjId;
/* 0x0152 */ s16 type; /* 0x0152 */ s16 type;
/* 0x0152 */ s16 unusedParam; /* 0x0154 */ s16 unusedParam;
/* 0x0156 */ s16 giDrawId; /* 0x0156 */ s16 giDrawId;
/* 0x0158 */ s16 stopRotate; /* 0x0158 */ s16 stopRotate;
/* 0x015A */ s16 timer; /* 0x015A */ s16 timer;

View file

@ -823,8 +823,8 @@ s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) {
s32 func_80A44790(EnGo2* this, PlayState* play) { s32 func_80A44790(EnGo2* this, PlayState* play) {
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON && (this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) { if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON && (this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) {
return Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->unk_218, EnGo2_GetTextId, return Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange,
EnGo2_UpdateTalkState); EnGo2_GetTextId, EnGo2_UpdateTalkState);
} else if (((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) && ((this->collider.base.ocFlags2 & 1) == 0)) { } else if (((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) && ((this->collider.base.ocFlags2 & 1) == 0)) {
return false; return false;
} else { } else {
@ -834,7 +834,7 @@ s32 func_80A44790(EnGo2* this, PlayState* play) {
} else if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { } else if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
this->interactInfo.talkState = EnGo2_UpdateTalkState(play, &this->actor); this->interactInfo.talkState = EnGo2_UpdateTalkState(play, &this->actor);
return false; return false;
} else if (func_8002F2CC(&this->actor, play, this->unk_218)) { } else if (func_8002F2CC(&this->actor, play, this->interactRange)) {
this->actor.textId = EnGo2_GetTextId(play, &this->actor); this->actor.textId = EnGo2_GetTextId(play, &this->actor);
} }
return false; return false;
@ -854,8 +854,8 @@ void EnGo2_SetShape(EnGo2* this) {
this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10; this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10;
Actor_SetScale(&this->actor, D_80A481F8[index].scale); Actor_SetScale(&this->actor, D_80A481F8[index].scale);
this->actor.targetMode = D_80A481F8[index].actor_unk_1F; this->actor.targetMode = D_80A481F8[index].actor_unk_1F;
this->unk_218 = D_80A481F8[index].unk_218; this->interactRange = D_80A481F8[index].interactRange;
this->unk_218 += this->collider.dim.radius; this->interactRange += this->collider.dim.radius;
} }
void EnGo2_CheckCollision(EnGo2* this, PlayState* play) { void EnGo2_CheckCollision(EnGo2* this, PlayState* play) {
@ -2017,7 +2017,7 @@ void EnGo2_Update(Actor* thisx, PlayState* play) {
} }
this->actionFunc(this, play); this->actionFunc(this, play);
if (this->unk_211 == true) { if (this->unk_211 == true) {
func_80034F54(play, this->unk_226, this->unk_24A, 18); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 18);
} }
func_80A45288(this, play); func_80A45288(this, play);
EnGo2_EyeMouthTexState(this); EnGo2_EyeMouthTexState(this);
@ -2075,9 +2075,9 @@ s32 EnGo2_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, V
Matrix_RotateX(float1, MTXMODE_APPLY); Matrix_RotateX(float1, MTXMODE_APPLY);
} }
if ((limb == 10) || (limb == 11) || (limb == 14)) { if ((limb == 10) || (limb == 11) || (limb == 14)) {
float1 = Math_SinS(this->unk_226[limb]); float1 = Math_SinS(this->fidgetTableY[limb]);
rot->y += float1 * 200.0f; rot->y += float1 * 200.0f;
float1 = Math_CosS(this->unk_24A[limb]); float1 = Math_CosS(this->fidgetTableZ[limb]);
rot->z += float1 * 200.0f; rot->z += float1 * 200.0f;
} }
return 0; return 0;

View file

@ -53,7 +53,7 @@ typedef struct {
f32 shape_unk_10; f32 shape_unk_10;
f32 scale; f32 scale;
s8 actor_unk_1F; s8 actor_unk_1F;
f32 unk_218; f32 interactRange;
} EnGo2DataStruct2; // size = 0x10 } EnGo2DataStruct2; // size = 0x10
typedef struct { typedef struct {
@ -86,12 +86,12 @@ typedef struct EnGo2 {
/* 0x0214 */ u8 eyeTexIndex; /* 0x0214 */ u8 eyeTexIndex;
/* 0x0215 */ u8 mouthTexIndex; /* 0x0215 */ u8 mouthTexIndex;
/* 0x0216 */ u8 unk_216; // Set to z rotation, checked by waypoint /* 0x0216 */ u8 unk_216; // Set to z rotation, checked by waypoint
/* 0x0218 */ f32 unk_218; /* 0x0218 */ f32 interactRange;
/* 0x021C */ char unk_21C[0x04]; /* 0x021C */ char unk_21C[0x04];
/* 0x0220 */ f32 alpha; // Set to 0, used by func_80A45360, smoothed to this->actor.shape.unk_14 from either 0 or 255.0f /* 0x0220 */ f32 alpha; // Set to 0, used by func_80A45360, smoothed to this->actor.shape.unk_14 from either 0 or 255.0f
/* 0x0224 */ s16 blinkTimer; /* 0x0224 */ s16 blinkTimer;
/* 0x0226 */ s16 unk_226[18]; // Remains unknown /* 0x0226 */ s16 fidgetTableY[18]; // Remains unknown
/* 0x024A */ s16 unk_24A[18]; // Remains unknown /* 0x024A */ s16 fidgetTableZ[18]; // Remains unknown
/* 0x026E */ u16 trackingMode; /* 0x026E */ u16 trackingMode;
/* 0x0270 */ EnGoEffect dustEffects[10]; /* 0x0270 */ EnGoEffect dustEffects[10];
/* 0x04A0 */ Vec3f eye; /* 0x04A0 */ Vec3f eye;

View file

@ -163,7 +163,7 @@ void func_80A505CC(Actor* thisx, PlayState* play) {
} }
Npc_TrackPoint(&this->actor, &this->interactInfo, 6, NPC_TRACKING_HEAD_AND_TORSO); Npc_TrackPoint(&this->actor, &this->interactInfo, 6, NPC_TRACKING_HEAD_AND_TORSO);
func_80034F54(play, this->unk_2CC, this->unk_2EC, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->osAnimeBankIndex].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->osAnimeBankIndex].segment);
@ -206,8 +206,8 @@ s32 EnGuest_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
} }
if (limbIndex == 8 || limbIndex == 9 || limbIndex == 12) { if (limbIndex == 8 || limbIndex == 9 || limbIndex == 12) {
rot->y += Math_SinS(this->unk_2CC[limbIndex]) * 200.0f; rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f;
rot->z += Math_CosS(this->unk_2EC[limbIndex]) * 200.0f; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f;
} }
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);

View file

@ -18,8 +18,8 @@ typedef struct EnGuest {
/* 0x02A0 */ NpcInteractInfo interactInfo; /* 0x02A0 */ NpcInteractInfo interactInfo;
/* 0x02C8 */ s16 unk_2C8; /* 0x02C8 */ s16 unk_2C8;
/* 0x02CA */ s16 unk_2CA; /* 0x02CA */ s16 unk_2CA;
/* 0x02CC */ s16 unk_2CC[16]; /* 0x02CC */ s16 fidgetTableY[16];
/* 0x02EC */ s16 unk_2EC[16]; /* 0x02EC */ s16 fidgetTableZ[16];
/* 0x030C */ s8 osAnimeBankIndex; /* 0x030C */ s8 osAnimeBankIndex;
/* 0x030D */ u8 unk_30D; /* 0x030D */ u8 unk_30D;
/* 0x030E */ u8 unk_30E; /* 0x030E */ u8 unk_30E;

View file

@ -321,15 +321,15 @@ void func_80A5372C(EnHeishi2* this, PlayState* play) {
this->cameraId = Play_CreateSubCamera(play); this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE);
this->unk_280.x = 947.0f; this->subCamEye.x = 947.0f;
this->unk_280.y = 1195.0f; this->subCamEye.y = 1195.0f;
this->unk_280.z = 2682.0f; this->subCamEye.z = 2682.0f;
this->unk_28C.x = 1164.0f; this->subCamAt.x = 1164.0f;
this->unk_28C.y = 1145.0f; this->subCamAt.y = 1145.0f;
this->unk_28C.z = 3014.0f; this->subCamAt.z = 3014.0f;
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C); Play_CameraSetAtEye(play, this->cameraId, &this->subCamEye, &this->subCamAt);
} }
this->actionFunc = func_80A53850; this->actionFunc = func_80A53850;
} }
@ -339,7 +339,7 @@ void func_80A53850(EnHeishi2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) { if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) {
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C); Play_CameraSetAtEye(play, this->cameraId, &this->subCamEye, &this->subCamAt);
} }
gate = (BgSpot15Saku*)this->gate; gate = (BgSpot15Saku*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->unk_168 == 0)) { if ((this->unk_2F2[0] == 0) || (gate->unk_168 == 0)) {
@ -492,19 +492,19 @@ void func_80A53DF8(EnHeishi2* this, PlayState* play) {
this->cameraId = Play_CreateSubCamera(play); this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE);
this->unk_2BC.x = -71.0f; this->subCamEyeInit.x = -71.0f;
this->unk_280.x = -71.0f; this->subCamEye.x = -71.0f;
this->unk_2BC.y = 571.0f; this->subCamEyeInit.y = 571.0f;
this->unk_280.y = 571.0f; this->subCamEye.y = 571.0f;
this->unk_2BC.z = -1487.0f; this->subCamEyeInit.z = -1487.0f;
this->unk_280.z = -1487.0f; this->subCamEye.z = -1487.0f;
this->unk_298.x = 181.0f; this->subCamAtInit.x = 181.0f;
this->unk_28C.x = 181.0f; this->subCamAt.x = 181.0f;
this->unk_298.y = 417.0f; this->subCamAtInit.y = 417.0f;
this->unk_28C.y = 417.0f; this->subCamAt.y = 417.0f;
this->unk_298.z = -1079.0f; this->subCamAtInit.z = -1079.0f;
this->unk_28C.z = -1079.0f; this->subCamAt.z = -1079.0f;
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C); Play_CameraSetAtEye(play, this->cameraId, &this->subCamEye, &this->subCamAt);
} }
this->actionFunc = func_80A53F30; this->actionFunc = func_80A53F30;
} }
@ -514,7 +514,7 @@ void func_80A53F30(EnHeishi2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) { if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) {
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C); Play_CameraSetAtEye(play, this->cameraId, &this->subCamEye, &this->subCamAt);
} }
gate = (BgGateShutter*)this->gate; gate = (BgGateShutter*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) { if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) {

View file

@ -19,11 +19,11 @@ typedef struct EnHeishi2 {
/* 0x0266 */ char unk_266[0x06]; /* 0x0266 */ char unk_266[0x06];
/* 0x026C */ Vec3s unk_26C; // padding inbetween these /* 0x026C */ Vec3s unk_26C; // padding inbetween these
/* 0x0274 */ Vec3f unk_274; /* 0x0274 */ Vec3f unk_274;
/* 0x0280 */ Vec3f unk_280; // camera related /* 0x0280 */ Vec3f subCamEye; // camera related
/* 0x028C */ Vec3f unk_28C; // camera related /* 0x028C */ Vec3f subCamAt; // camera related
/* 0x0298 */ Vec3f unk_298; // camera related /* 0x0298 */ Vec3f subCamAtInit; // camera related
/* 0x02A4 */ char unk_2A4[0x18]; /* 0x02A4 */ char unk_2A4[0x18];
/* 0x02BC */ Vec3f unk_2BC; // camera related /* 0x02BC */ Vec3f subCamEyeInit; // camera related
/* 0x02C8 */ char unk_2C8[0x18]; /* 0x02C8 */ char unk_2C8[0x18];
/* 0x02E0 */ f32 unk_2E0; /* 0x02E0 */ f32 unk_2E0;
/* 0x02E4 */ f32 unk_2E4; /* 0x02E4 */ f32 unk_2E4;

View file

@ -268,7 +268,7 @@ void func_80A56900(EnHeishi4* this, PlayState* play) {
void func_80A56994(EnHeishi4* this, PlayState* play) { void func_80A56994(EnHeishi4* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
func_80038290(play, &this->actor, &this->unk_260, &this->unk_266, this->actor.focus.pos); func_80038290(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos);
if ((this->unk_282 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) { if ((this->unk_282 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
Flags_SetInfTable(INFTABLE_6C); Flags_SetInfTable(INFTABLE_6C);
@ -393,8 +393,8 @@ void EnHeishi4_Update(Actor* thisx, PlayState* play) {
this->interactInfo.trackPos.y = player->actor.world.pos.y - 10.0f; this->interactInfo.trackPos.y = player->actor.world.pos.y - 10.0f;
} }
Npc_TrackPoint(thisx, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); Npc_TrackPoint(thisx, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY);
this->unk_260 = this->interactInfo.headRot; this->headRot = this->interactInfo.headRot;
this->unk_266 = this->interactInfo.torsoRot; this->torsoRot = this->interactInfo.torsoRot;
} }
this->unk_27E += 1; this->unk_27E += 1;
this->actionFunc(this, play); this->actionFunc(this, play);
@ -408,11 +408,11 @@ s32 EnHeishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
EnHeishi4* this = (EnHeishi4*)thisx; EnHeishi4* this = (EnHeishi4*)thisx;
if (limbIndex == 9) { if (limbIndex == 9) {
rot->x += this->unk_266.y; rot->x += this->torsoRot.y;
} }
if (limbIndex == 16) { if (limbIndex == 16) {
rot->x += this->unk_260.y; rot->x += this->headRot.y;
rot->z += this->unk_260.z; rot->z += this->headRot.z;
} }
return false; return false;
} }

View file

@ -21,8 +21,8 @@ typedef struct EnHeishi4 {
/* 0x0190 */ Vec3s jointTable[17]; /* 0x0190 */ Vec3s jointTable[17];
/* 0x01F6 */ Vec3s morphTable[17]; /* 0x01F6 */ Vec3s morphTable[17];
/* 0x025C */ EnHeishi4ActionFunc actionFunc; /* 0x025C */ EnHeishi4ActionFunc actionFunc;
/* 0x0260 */ Vec3s unk_260; /* 0x0260 */ Vec3s headRot;
/* 0x0266 */ Vec3s unk_266; /* 0x0266 */ Vec3s torsoRot;
/* 0x026C */ Vec3f pos; /* 0x026C */ Vec3f pos;
/* 0x0278 */ f32 height; /* 0x0278 */ f32 height;
/* 0x027C */ s16 unk_27C; /* 0x027C */ s16 unk_27C;

View file

@ -97,7 +97,7 @@ void EnHoll_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
EnHoll_ChooseAction(this); EnHoll_ChooseAction(this);
this->unk_14F = 0; this->resetBgCoverAlpha = 0;
} }
void EnHoll_Destroy(Actor* thisx, PlayState* play) { void EnHoll_Destroy(Actor* thisx, PlayState* play) {
@ -206,13 +206,13 @@ void func_80A591C0(EnHoll* this, PlayState* play) {
if (this->actor.room != play->roomCtx.curRoom.num && if (this->actor.room != play->roomCtx.curRoom.num &&
func_8009728C(play, &play->roomCtx, this->actor.room) != 0) { func_8009728C(play, &play->roomCtx, this->actor.room) != 0) {
EnHoll_SetupAction(this, EnHoll_NextAction); EnHoll_SetupAction(this, EnHoll_NextAction);
this->unk_14F = 1; this->resetBgCoverAlpha = 1;
player->actor.speedXZ = 0.0f; player->actor.speedXZ = 0.0f;
} }
} }
} else if (this->unk_14F != 0) { } else if (this->resetBgCoverAlpha != 0) {
play->unk_11E18 = 0; play->unk_11E18 = 0;
this->unk_14F = 0; this->resetBgCoverAlpha = 0;
} }
} }
@ -235,11 +235,11 @@ void func_80A593A4(EnHoll* this, PlayState* play) {
if (this->actor.room != play->roomCtx.curRoom.num && if (this->actor.room != play->roomCtx.curRoom.num &&
func_8009728C(play, &play->roomCtx, this->actor.room) != 0) { func_8009728C(play, &play->roomCtx, this->actor.room) != 0) {
EnHoll_SetupAction(this, EnHoll_NextAction); EnHoll_SetupAction(this, EnHoll_NextAction);
this->unk_14F = 1; this->resetBgCoverAlpha = 1;
} }
} }
} else if (this->unk_14F != 0) { } else if (this->resetBgCoverAlpha != 0) {
this->unk_14F = 0; this->resetBgCoverAlpha = 0;
play->unk_11E18 = 0; play->unk_11E18 = 0;
} }
} }
@ -273,15 +273,15 @@ void func_80A59618(EnHoll* this, PlayState* play) {
s32 transitionActorIdx; s32 transitionActorIdx;
if (!Flags_GetSwitch(play, this->actor.params & 0x3F)) { if (!Flags_GetSwitch(play, this->actor.params & 0x3F)) {
if (this->unk_14F != 0) { if (this->resetBgCoverAlpha != 0) {
play->unk_11E18 = 0; play->unk_11E18 = 0;
this->unk_14F = 0; this->resetBgCoverAlpha = 0;
} }
} else { } else {
Actor_WorldToActorCoords(&this->actor, &vec, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &vec, &player->actor.world.pos);
absZ = fabsf(vec.z); absZ = fabsf(vec.z);
if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) { if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) {
this->unk_14F = 1; this->resetBgCoverAlpha = 1;
transitionActorIdx = (u16)this->actor.params >> 0xA; transitionActorIdx = (u16)this->actor.params >> 0xA;
play->unk_11E18 = 0xFF - (s32)((absZ - 50.0f) * 5.9f); play->unk_11E18 = 0xFF - (s32)((absZ - 50.0f) * 5.9f);
if (play->unk_11E18 >= 0x100) { if (play->unk_11E18 >= 0x100) {
@ -297,9 +297,9 @@ void func_80A59618(EnHoll* this, PlayState* play) {
EnHoll_SetupAction(this, EnHoll_NextAction); EnHoll_SetupAction(this, EnHoll_NextAction);
} }
} }
} else if (this->unk_14F != 0) { } else if (this->resetBgCoverAlpha != 0) {
play->unk_11E18 = 0; play->unk_11E18 = 0;
this->unk_14F = 0; this->resetBgCoverAlpha = 0;
} }
} }
} }
@ -308,7 +308,7 @@ void EnHoll_NextAction(EnHoll* this, PlayState* play) {
if (!EnHoll_IsKokiriSetup8() && play->roomCtx.status == 0) { if (!EnHoll_IsKokiriSetup8() && play->roomCtx.status == 0) {
func_80097534(play, &play->roomCtx); func_80097534(play, &play->roomCtx);
if (play->unk_11E18 == 0) { if (play->unk_11E18 == 0) {
this->unk_14F = 0; this->resetBgCoverAlpha = 0;
} }
EnHoll_ChooseAction(this); EnHoll_ChooseAction(this);
} }

View file

@ -12,7 +12,7 @@ typedef struct EnHoll {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x014C */ s16 planeAlpha; /* 0x014C */ s16 planeAlpha;
/* 0x014E */ u8 side; /* 0x014E */ u8 side;
/* 0x014F */ u8 unk_14F; /* 0x014F */ u8 resetBgCoverAlpha;
/* 0x0150 */ EnHollActionFunc actionFunc; /* 0x0150 */ EnHollActionFunc actionFunc;
} EnHoll; // size = 0x0154 } EnHoll; // size = 0x0154

View file

@ -231,7 +231,7 @@ s32 EnHorseGameCheck_InitGerudoArchery(EnHorseGameCheckBase* base, PlayState* pl
EnHorseGameCheckGerudoArchery* this = (EnHorseGameCheckGerudoArchery*)base; EnHorseGameCheckGerudoArchery* this = (EnHorseGameCheckGerudoArchery*)base;
this->base.type = HORSEGAME_GERUDO_ARCHERY; this->base.type = HORSEGAME_GERUDO_ARCHERY;
this->unk_150 = 0; this->startFlags = 0;
this->startTimer = 0; this->startTimer = 0;
return true; return true;
} }
@ -261,7 +261,7 @@ s32 EnHorseGameCheck_InitType3(EnHorseGameCheckBase* base, PlayState* play) {
EnHorseGameCheck3* this = (EnHorseGameCheck3*)base; EnHorseGameCheck3* this = (EnHorseGameCheck3*)base;
this->base.type = HORSEGAME_TYPE3; this->base.type = HORSEGAME_TYPE3;
this->unk_150 = 0; this->startFlags = 0;
return true; return true;
} }

View file

@ -28,13 +28,13 @@ typedef struct EnHorseGameCheckIngoRace {
typedef struct EnHorseGameCheckGerudoArchery { typedef struct EnHorseGameCheckGerudoArchery {
/* 0x0000 */ EnHorseGameCheckBase base; /* 0x0000 */ EnHorseGameCheckBase base;
/* 0x0150 */ s32 unk_150; /* 0x0150 */ s32 startFlags;
/* 0x0154 */ u32 startTimer; /* 0x0154 */ u32 startTimer;
} EnHorseGameCheckGerudoArchery; // size = 0x0158 } EnHorseGameCheckGerudoArchery; // size = 0x0158
typedef struct EnHorseGameCheck3 { typedef struct EnHorseGameCheck3 {
/* 0x0000 */ EnHorseGameCheckBase base; /* 0x0000 */ EnHorseGameCheckBase base;
/* 0x0150 */ s32 unk_150; /* 0x0150 */ s32 startFlags;
} EnHorseGameCheck3; // size = 0x0154 } EnHorseGameCheck3; // size = 0x0154
typedef struct EnHorseGameCheckMalonRace { typedef struct EnHorseGameCheckMalonRace {

View file

@ -116,11 +116,11 @@ void func_80A6D918(EnHorseZelda* this, PlayState* play) {
Vec3f sp28; Vec3f sp28;
s16 yawDiff; s16 yawDiff;
func_80A6D8D0(D_80A6E240, this->unk_1EC, &sp28); func_80A6D8D0(D_80A6E240, this->fieldPosIndex, &sp28);
if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.world.pos) <= 400.0f) { if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.world.pos) <= 400.0f) {
this->unk_1EC++; this->fieldPosIndex++;
if (this->unk_1EC >= 14) { if (this->fieldPosIndex >= 14) {
this->unk_1EC = 0; this->fieldPosIndex = 0;
func_80A6D8D0(D_80A6E240, 0, &sp28); func_80A6D8D0(D_80A6E240, 0, &sp28);
} }
} }
@ -140,7 +140,7 @@ void func_80A6D918(EnHorseZelda* this, PlayState* play) {
} else { } else {
this->actor.speedXZ -= 1.0f; this->actor.speedXZ -= 1.0f;
} }
} else if (this->actor.speedXZ < D_80A6E240[this->unk_1EC].unk_6) { } else if (this->actor.speedXZ < D_80A6E240[this->fieldPosIndex].unk_6) {
this->actor.speedXZ += 0.5f; this->actor.speedXZ += 0.5f;
} else { } else {
this->actor.speedXZ -= 0.5f; this->actor.speedXZ -= 0.5f;
@ -224,8 +224,8 @@ void func_80A6DE38(EnHorseZelda* this, PlayState* play) {
pos.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.x; pos.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.x;
pos.y = this->actor.world.pos.y + 60.0f; pos.y = this->actor.world.pos.y + 60.0f;
pos.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.z; pos.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.z;
this->unk_1F4 = BgCheck_EntityRaycastFloor3(&play->colCtx, &poly, &bgId, &pos); this->floorYForwards = BgCheck_EntityRaycastFloor3(&play->colCtx, &poly, &bgId, &pos);
this->actor.shape.rot.x = Math_FAtan2F(this->actor.world.pos.y - this->unk_1F4, 30.0f) * (0x8000 / M_PI); this->actor.shape.rot.x = Math_FAtan2F(this->actor.world.pos.y - this->floorYForwards, 30.0f) * (0x8000 / M_PI);
} }
void EnHorseZelda_Update(Actor* thisx, PlayState* play) { void EnHorseZelda_Update(Actor* thisx, PlayState* play) {

View file

@ -14,9 +14,9 @@ typedef struct EnHorseZelda {
/* 0x0150 */ s32 animationIndex; /* 0x0150 */ s32 animationIndex;
/* 0x0154 */ Skin skin; /* 0x0154 */ Skin skin;
/* 0x01E4 */ char unk_1E4[0x8]; /* 0x01E4 */ char unk_1E4[0x8];
/* 0x01EC */ s32 unk_1EC; /* 0x01EC */ s32 fieldPosIndex;
/* 0x01F0 */ char unk_1F0[0x4]; /* 0x01F0 */ char unk_1F0[0x4];
/* 0x01F4 */ f32 unk_1F4; /* 0x01F4 */ f32 floorYForwards;
/* 0x01F8 */ char unk_1F8[0x4]; /* 0x01F8 */ char unk_1F8[0x4];
/* 0x01FC */ ColliderCylinder colliderCylinder; /* 0x01FC */ ColliderCylinder colliderCylinder;
/* 0x0248 */ ColliderJntSph colliderSphere; /* 0x0248 */ ColliderJntSph colliderSphere;

View file

@ -432,14 +432,14 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) {
switch (this->actor.params & 0x7F) { switch (this->actor.params & 0x7F) {
case ENHY_TYPE_AOB: case ENHY_TYPE_AOB:
if (play->sceneNum == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { if (play->sceneNum == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) {
return (this->unk_330 & 0x800) ? 0x508D : ((Flags_GetInfTable(INFTABLE_CB)) ? 0x508C : 0x508B); return (this->talonEventChkInf & 0x800) ? 0x508D : ((Flags_GetInfTable(INFTABLE_CB)) ? 0x508C : 0x508B);
} else if (play->sceneNum == SCENE_MARKET_DAY) { } else if (play->sceneNum == SCENE_MARKET_DAY) {
return (gSaveContext.eventInf[3] & 1) ? 0x709B : 0x709C; return (gSaveContext.eventInf[3] & 1) ? 0x709B : 0x709C;
} else if (gSaveContext.dogIsLost) { } else if (gSaveContext.dogIsLost) {
s16 followingDog = (gSaveContext.dogParams & 0xF00) >> 8; s16 followingDog = (gSaveContext.dogParams & 0xF00) >> 8;
if (followingDog != 0) { if (followingDog != 0) {
this->unk_215 = false; this->playedSfx = false;
return ((followingDog == 1) || (CVarGetInteger(CVAR_ENHANCEMENT("AllDogsRichard"), 0))) ? 0x709F return ((followingDog == 1) || (CVarGetInteger(CVAR_ENHANCEMENT("AllDogsRichard"), 0))) ? 0x709F
: 0x709E; : 0x709E;
} else { } else {
@ -557,7 +557,8 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) {
? 0x505F ? 0x505F
: ((Flags_GetInfTable(INFTABLE_163)) ? 0x505E : 0x505D); : ((Flags_GetInfTable(INFTABLE_163)) ? 0x505E : 0x505D);
} else { } else {
return (this->unk_330 & 0x800) ? 0x5062 : ((Flags_GetInfTable(INFTABLE_164)) ? 0x5061 : 0x5060); return (this->talonEventChkInf & 0x800) ? 0x5062
: ((Flags_GetInfTable(INFTABLE_164)) ? 0x5061 : 0x5060);
} }
case ENHY_TYPE_BJI_19: case ENHY_TYPE_BJI_19:
return 0x7120; return 0x7120;
@ -586,11 +587,11 @@ s16 func_80A70058(PlayState* play, Actor* thisx) {
switch (this->actor.textId) { switch (this->actor.textId) {
case 0x709E: case 0x709E:
case 0x709F: case 0x709F:
if (!this->unk_215) { if (!this->playedSfx) {
Audio_PlaySoundGeneral(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR, Audio_PlaySoundGeneral(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR,
&gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_215 = true; this->playedSfx = true;
} }
break; break;
case 0x70F0: case 0x70F0:
@ -941,7 +942,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) {
} }
if (play->sceneNum == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { if (play->sceneNum == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) {
this->unk_330 = gSaveContext.eventChkInf[6]; this->talonEventChkInf = gSaveContext.eventChkInf[6];
} }
EnHy_InitSetProperties(this); EnHy_InitSetProperties(this);
@ -1024,7 +1025,7 @@ void func_80A711B4(EnHy* this, PlayState* play) {
} }
void func_80A7127C(EnHy* this, PlayState* play) { void func_80A7127C(EnHy* this, PlayState* play) {
func_80034F54(play, this->unk_21C, this->unk_23C, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
} }
void EnHy_DoNothing(EnHy* this, PlayState* play) { void EnHy_DoNothing(EnHy* this, PlayState* play) {
@ -1037,7 +1038,7 @@ void func_80A712C0(EnHy* this, PlayState* play) {
this->actionFunc = func_80A7134C; this->actionFunc = func_80A7134C;
} }
func_80034F54(play, this->unk_21C, this->unk_23C, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
} }
void func_80A7134C(EnHy* this, PlayState* play) { void func_80A7134C(EnHy* this, PlayState* play) {
@ -1160,8 +1161,8 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
} }
if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 12)) { if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 12)) {
rot->y += Math_SinS(this->unk_21C[limbIndex]) * 200.0f; rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f;
rot->z += Math_CosS(this->unk_23C[limbIndex]) * 200.0f; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f;
} }
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);

View file

@ -47,18 +47,18 @@ typedef struct EnHy {
/* 0x01E8 */ NpcInteractInfo interactInfo; /* 0x01E8 */ NpcInteractInfo interactInfo;
/* 0x0210 */ Path* path; /* 0x0210 */ Path* path;
/* 0x0214 */ s8 waypoint; /* 0x0214 */ s8 waypoint;
/* 0x0215 */ s8 unk_215; /* 0x0215 */ s8 playedSfx;
/* 0x0216 */ char unk_216[2]; // unused /* 0x0216 */ char unk_216[2]; // unused
/* 0x0218 */ s16 curEyeIndex; /* 0x0218 */ s16 curEyeIndex;
/* 0x021A */ s16 nextEyeIndexTimer; /* 0x021A */ s16 nextEyeIndexTimer;
/* 0x021C */ s16 unk_21C[16]; // bodyWiggleY ? /* 0x021C */ s16 fidgetTableY[16]; // bodyWiggleY ?
/* 0x023C */ s16 unk_23C[16]; // bodyWiggleZ ? /* 0x023C */ s16 fidgetTableZ[16]; // bodyWiggleZ ?
/* 0x025C */ f32 unkRange; /* 0x025C */ f32 unkRange;
/* 0x0260 */ s32 unkGetItemId; /* 0x0260 */ s32 unkGetItemId;
/* 0x0264 */ Vec3f modelOffset; /* 0x0264 */ Vec3f modelOffset;
/* 0x0270 */ Vec3s jointTable[16]; /* 0x0270 */ Vec3s jointTable[16];
/* 0x02D0 */ Vec3s morphTable[16]; /* 0x02D0 */ Vec3s morphTable[16];
/* 0x0330 */ u16 unk_330; /* 0x0330 */ u16 talonEventChkInf;
/* */ GetItemEntry getItemEntry; /* */ GetItemEntry getItemEntry;
} EnHy; // size = 0x0334 } EnHy; // size = 0x0334

View file

@ -203,7 +203,7 @@ void func_80A74398(Actor* thisx, PlayState* play) {
thisx->colChkInfo.damageTable = &sDamageTable; thisx->colChkInfo.damageTable = &sDamageTable;
thisx->colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.mass = MASS_HEAVY;
this->unk_2FC = 0; this->isBreakingProp = 0;
thisx->colChkInfo.health = 30; thisx->colChkInfo.health = 30;
thisx->gravity = -1.0f; thisx->gravity = -1.0f;
this->switchFlags = (thisx->params >> 8) & 0xFF; this->switchFlags = (thisx->params >> 8) & 0xFF;
@ -252,7 +252,7 @@ void func_80A74398(Actor* thisx, PlayState* play) {
} }
s32 func_80A745E4(EnIk* this, PlayState* play) { s32 func_80A745E4(EnIk* this, PlayState* play) {
if (((this->unk_2FB != 0) || (this->actor.params == 0)) && if (((this->armorStatusFlag != 0) || (this->actor.params == 0)) &&
(func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y) != 0) && (func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y) != 0) &&
(play->gameplayFrames & 1)) { (play->gameplayFrames & 1)) {
func_80A755F0(this); func_80A755F0(this);
@ -330,7 +330,7 @@ void func_80A7489C(EnIk* this) {
} }
void func_80A7492C(EnIk* this, PlayState* play) { void func_80A7492C(EnIk* this, PlayState* play) {
s32 phi_a0 = (this->unk_2FB == 0) ? 0xAAA : 0x3FFC; s32 phi_a0 = (this->armorStatusFlag == 0) ? 0xAAA : 0x3FFC;
s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistToPlayer < 100.0f) && if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistToPlayer < 100.0f) &&
@ -351,7 +351,7 @@ void func_80A7492C(EnIk* this, PlayState* play) {
void func_80A74AAC(EnIk* this) { void func_80A74AAC(EnIk* this) {
this->unk_2F8 = 5; this->unk_2F8 = 5;
if (this->unk_2FB == 0) { if (this->armorStatusFlag == 0) {
Animation_Change(&this->skelAnime, &gIronKnuckleWalkAnim, 1.0f, 0.0f, Animation_Change(&this->skelAnime, &gIronKnuckleWalkAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gIronKnuckleWalkAnim), ANIMMODE_LOOP, -4.0f); Animation_GetLastFrame(&gIronKnuckleWalkAnim), ANIMMODE_LOOP, -4.0f);
this->actor.speedXZ = 0.9f; this->actor.speedXZ = 0.9f;
@ -373,7 +373,7 @@ void func_80A74BA4(EnIk* this, PlayState* play) {
s16 sp2E; s16 sp2E;
s16 phi_a3; s16 phi_a3;
if (this->unk_2FB == 0) { if (this->armorStatusFlag == 0) {
temp_t0 = 0xAAA; temp_t0 = 0xAAA;
phi_a3 = 0x320; phi_a3 = 0x320;
sp30 = 0; sp30 = 0;
@ -404,7 +404,7 @@ void func_80A74BA4(EnIk* this, PlayState* play) {
} }
if (func_80A74674(play, &this->actor) != NULL) { if (func_80A74674(play, &this->actor) != NULL) {
func_80A751C8(this); func_80A751C8(this);
this->unk_2FC = 1; this->isBreakingProp = 1;
} else { } else {
temp_t0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; temp_t0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if (ABS(temp_t0) > 0x4000) { if (ABS(temp_t0) > 0x4000) {
@ -451,7 +451,7 @@ void func_80A74EBC(EnIk* this, PlayState* play) {
if ((this->skelAnime.curFrame > 17.0f) && (this->skelAnime.curFrame < 23.0f)) { if ((this->skelAnime.curFrame > 17.0f) && (this->skelAnime.curFrame < 23.0f)) {
this->unk_2FE = 1; this->unk_2FE = 1;
} else { } else {
if ((this->unk_2FB != 0) && (this->skelAnime.curFrame < 10.0f)) { if ((this->armorStatusFlag != 0) && (this->skelAnime.curFrame < 10.0f)) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0);
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
} }
@ -467,7 +467,7 @@ void func_80A7506C(EnIk* this) {
f32 frames = Animation_GetLastFrame(&gIronKnuckleAxeStuckAnim); f32 frames = Animation_GetLastFrame(&gIronKnuckleAxeStuckAnim);
this->unk_2FE = 0; this->unk_2FE = 0;
this->unk_2F9 = (s8)frames; this->animationTimer = (s8)frames;
this->unk_2F8 = 7; this->unk_2F8 = 7;
this->unk_2FF = this->unk_2FE; this->unk_2FF = this->unk_2FE;
Animation_Change(&this->skelAnime, &gIronKnuckleAxeStuckAnim, 1.0f, 0.0f, frames, ANIMMODE_LOOP, -4.0f); Animation_Change(&this->skelAnime, &gIronKnuckleAxeStuckAnim, 1.0f, 0.0f, frames, ANIMMODE_LOOP, -4.0f);
@ -478,7 +478,7 @@ void func_80A7506C(EnIk* this) {
void func_80A7510C(EnIk* this, PlayState* play) { void func_80A7510C(EnIk* this, PlayState* play) {
f32 frames; f32 frames;
if (SkelAnime_Update(&this->skelAnime) || (--this->unk_2F9 == 0)) { if (SkelAnime_Update(&this->skelAnime) || (--this->animationTimer == 0)) {
if (this->unk_2F8 == 8) { if (this->unk_2F8 == 8) {
func_80A7489C(this); func_80A7489C(this);
} else { } else {
@ -499,7 +499,7 @@ void func_80A751C8(EnIk* this) {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
Animation_Change(&this->skelAnime, &gIronKnuckleHorizontalAttackAnim, 0.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, Animation_Change(&this->skelAnime, &gIronKnuckleHorizontalAttackAnim, 0.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP,
-6.0f); -6.0f);
this->unk_2FC = 0; this->isBreakingProp = 0;
EnIk_SetupAction(this, func_80A75260); EnIk_SetupAction(this, func_80A75260);
} }
@ -515,7 +515,7 @@ void func_80A75260(EnIk* this, PlayState* play) {
} }
if (((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 9.0f)) || if (((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 9.0f)) ||
((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 18.0f))) { ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 18.0f))) {
if ((this->unk_2FC == 0) && (this->unk_2FB != 0) && (this->skelAnime.curFrame < 10.0f)) { if ((this->isBreakingProp == 0) && (this->armorStatusFlag != 0) && (this->skelAnime.curFrame < 10.0f)) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0);
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
} }
@ -644,7 +644,7 @@ void func_80A7598C(EnIk* this) {
this->unk_2F8 = 2; this->unk_2F8 = 2;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
Animation_Change(&this->skelAnime, &gIronKnuckleDeathAnim, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -4.0f); Animation_Change(&this->skelAnime, &gIronKnuckleDeathAnim, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -4.0f);
this->unk_2F9 = 0x18; this->animationTimer = 0x18;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DEAD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DEAD);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_CUTBODY); Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_CUTBODY);
EnIk_SetupAction(this, func_80A75A38); EnIk_SetupAction(this, func_80A75A38);
@ -653,20 +653,20 @@ void func_80A7598C(EnIk* this) {
void func_80A75A38(EnIk* this, PlayState* play) { void func_80A75A38(EnIk* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
if ((this->actor.colChkInfo.health == 0) && (this->unk_2F9 != 0)) { if ((this->actor.colChkInfo.health == 0) && (this->animationTimer != 0)) {
s32 i; s32 i;
Vec3f pos; Vec3f pos;
Vec3f sp7C = { 0.0f, 0.5f, 0.0f }; Vec3f sp7C = { 0.0f, 0.5f, 0.0f };
this->unk_2F9--; this->animationTimer--;
for (i = 0xC - (this->unk_2F9 >> 1); i >= 0; i--) { for (i = 0xC - (this->animationTimer >> 1); i >= 0; i--) {
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(120.0f); pos.x = this->actor.world.pos.x + Rand_CenteredFloat(120.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(120.0f); pos.z = this->actor.world.pos.z + Rand_CenteredFloat(120.0f);
pos.y = this->actor.world.pos.y + 20.0f + Rand_CenteredFloat(50.0f); pos.y = this->actor.world.pos.y + 20.0f + Rand_CenteredFloat(50.0f);
EffectSsDeadDb_Spawn(play, &pos, &sp7C, &sp7C, 100, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); EffectSsDeadDb_Spawn(play, &pos, &sp7C, &sp7C, 100, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true);
} }
if (this->unk_2F9 == 0) { if (this->animationTimer == 0) {
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0);
// Don't set flag when Enemy Rando or CrowdControl are on. // Don't set flag when Enemy Rando or CrowdControl are on.
// Instead Iron Knuckles rely on the "clear room" flag. // Instead Iron Knuckles rely on the "clear room" flag.
@ -709,11 +709,12 @@ void func_80A75C38(EnIk* this, PlayState* play) {
sp38.y += 50.0f; sp38.y += 50.0f;
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1); Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1);
temp_v0_3 = this->actor.colChkInfo.damageEffect; temp_v0_3 = this->actor.colChkInfo.damageEffect;
this->unk_2FD = temp_v0_3 & 0xFF; this->damageReaction = temp_v0_3 & 0xFF;
this->bodyCollider.base.acFlags &= ~AC_HIT; this->bodyCollider.base.acFlags &= ~AC_HIT;
if ((this->unk_2FD == 0) || (this->unk_2FD == 0xD) || ((this->unk_2FB == 0) && (this->unk_2FD == 0xE))) { if ((this->damageReaction == 0) || (this->damageReaction == 0xD) ||
if (this->unk_2FD != 0) { ((this->armorStatusFlag == 0) && (this->damageReaction == 0xE))) {
if (this->damageReaction != 0) {
CollisionCheck_SpawnShieldParticlesMetal(play, &sp38); CollisionCheck_SpawnShieldParticlesMetal(play, &sp38);
} }
return; return;
@ -723,7 +724,7 @@ void func_80A75C38(EnIk* this, PlayState* play) {
Actor_ApplyDamage(&this->actor); Actor_ApplyDamage(&this->actor);
if (this->actor.params != 0) { if (this->actor.params != 0) {
if ((prevHealth > 10) && (this->actor.colChkInfo.health <= 10)) { if ((prevHealth > 10) && (this->actor.colChkInfo.health <= 10)) {
this->unk_2FB = 1; this->armorStatusFlag = 1;
BodyBreak_Alloc(&this->bodyBreak, 3, play); BodyBreak_Alloc(&this->bodyBreak, 3, play);
} }
} else if (this->actor.colChkInfo.health <= 10) { } else if (this->actor.colChkInfo.health <= 10) {
@ -748,7 +749,7 @@ void func_80A75C38(EnIk* this, PlayState* play) {
func_80A754A0(this); func_80A754A0(this);
} }
} }
if ((this->actor.params != 0) && (this->unk_2FB != 0)) { if ((this->actor.params != 0) && (this->armorStatusFlag != 0)) {
if ((prevHealth > 10) && (this->actor.colChkInfo.health <= 10)) { if ((prevHealth > 10) && (this->actor.colChkInfo.health <= 10)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO); Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO);
} else { } else {
@ -769,7 +770,7 @@ void func_80A75FA0(Actor* thisx, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
u8 prevInvincibilityTimer; u8 prevInvincibilityTimer;
this->unk_2FA = this->unk_2FB; this->drawArmorFlag = this->armorStatusFlag;
func_80A75C38(this, play); func_80A75C38(this, play);
if ((this->actor.params == 0) && (this->actor.colChkInfo.health <= 10)) { if ((this->actor.params == 0) && (this->actor.colChkInfo.health <= 10)) {
func_80A781CC(&this->actor, play); func_80A781CC(&this->actor, play);
@ -842,11 +843,11 @@ s32 EnIk_OverrideLimbDraw3(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
*dList = gIronKnuckleGerudoHeadDL; *dList = gIronKnuckleGerudoHeadDL;
} }
} else if ((limbIndex == 26) || (limbIndex == 27)) { } else if ((limbIndex == 26) || (limbIndex == 27)) {
if ((this->unk_2FA & 1)) { if ((this->drawArmorFlag & 1)) {
*dList = NULL; *dList = NULL;
} }
} else if ((limbIndex == 28) || (limbIndex == 29)) { } else if ((limbIndex == 28) || (limbIndex == 29)) {
if (!(this->unk_2FA & 1)) { if (!(this->drawArmorFlag & 1)) {
*dList = NULL; *dList = NULL;
} }
} }
@ -882,7 +883,7 @@ void EnIk_PostLimbDraw3(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
if (this->unk_2FB & 1) { if (this->armorStatusFlag & 1) {
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 26, 27, 28, dList, BODYBREAK_OBJECT_DEFAULT); BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 26, 27, 28, dList, BODYBREAK_OBJECT_DEFAULT);
} }
if (limbIndex == 12) { if (limbIndex == 12) {
@ -932,14 +933,14 @@ void EnIk_PostLimbDraw3(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016EE8); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016EE8);
break; break;
case 26: case 26:
if (!(this->unk_2FA & 1)) { if (!(this->drawArmorFlag & 1)) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL); gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL);
} }
break; break;
case 27: case 27:
if (!(this->unk_2FA & 1)) { if (!(this->drawArmorFlag & 1)) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8);
@ -1022,7 +1023,7 @@ void func_80A76E2C(EnIk* this, PlayState* play, Vec3f* pos) {
{ 900.0, -800.0, 2700.0 }, { 720.0f, 900.0f, 2500.0f }, { 900.0, -800.0, 2700.0 }, { 720.0f, 900.0f, 2500.0f },
}; };
if (this->unk_4D4 == 0) { if (this->isAxeSummoned == 0) {
s32 pad; s32 pad;
Vec3f effectVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f effectVelocity = { 0.0f, 0.0f, 0.0f };
Vec3f effectAccel = { 0.0f, 0.3f, 0.0f }; Vec3f effectAccel = { 0.0f, 0.3f, 0.0f };
@ -1046,7 +1047,7 @@ void func_80A76E2C(EnIk* this, PlayState* play, Vec3f* pos) {
(Rand_ZeroOne() * 60.0f) + 300.0f, 0); (Rand_ZeroOne() * 60.0f) + 300.0f, 0);
} }
this->unk_4D4 = 1; this->isAxeSummoned = 1;
func_80A76DDC(this, play, pos); func_80A76DDC(this, play, pos);
} }
} }
@ -1104,7 +1105,7 @@ void func_80A771E4(EnIk* this) {
Animation_GetLastFrame(&gIronKnuckleNabooruSummonAxeAnim), ANIMMODE_ONCE, 0.0f); Animation_GetLastFrame(&gIronKnuckleNabooruSummonAxeAnim), ANIMMODE_ONCE, 0.0f);
this->action = 2; this->action = 2;
this->drawMode = 1; this->drawMode = 1;
this->unk_4D4 = 0; this->isAxeSummoned = 0;
this->actor.shape.shadowAlpha = 0xFF; this->actor.shape.shadowAlpha = 0xFF;
} }

View file

@ -14,11 +14,11 @@ typedef struct EnIk {
/* 0x0190 */ Vec3s jointTable[30]; /* 0x0190 */ Vec3s jointTable[30];
/* 0x0244 */ Vec3s morphTable[30]; /* 0x0244 */ Vec3s morphTable[30];
/* 0x02F8 */ u8 unk_2F8; /* 0x02F8 */ u8 unk_2F8;
/* 0x02F9 */ u8 unk_2F9; /* 0x02F9 */ u8 animationTimer;
/* 0x02FA */ u8 unk_2FA; /* 0x02FA */ u8 drawArmorFlag;
/* 0x02FB */ u8 unk_2FB; /* 0x02FB */ u8 armorStatusFlag;
/* 0x02FC */ u8 unk_2FC; /* 0x02FC */ u8 isBreakingProp;
/* 0x02FD */ u8 unk_2FD; /* 0x02FD */ u8 damageReaction;
/* 0x02FE */ s8 unk_2FE; /* 0x02FE */ s8 unk_2FE;
/* 0x02FF */ s8 unk_2FF; /* 0x02FF */ s8 unk_2FF;
/* 0x0300 */ s16 unk_300; /* 0x0300 */ s16 unk_300;
@ -33,7 +33,7 @@ typedef struct EnIk {
/* 0x04C8 */ s32 action; /* 0x04C8 */ s32 action;
/* 0x04CC */ s32 drawMode; /* 0x04CC */ s32 drawMode;
/* 0x04D0 */ u32 npcAction; /* 0x04D0 */ u32 npcAction;
/* 0x04D4 */ s32 unk_4D4; /* 0x04D4 */ s32 isAxeSummoned;
/* 0x04D8 */ char unk_4D8[0x04]; /* 0x04D8 */ char unk_4D8[0x04];
} EnIk; // size = 0x04DC } EnIk; // size = 0x04DC

View file

@ -771,21 +771,21 @@ void func_80A7AA40(EnIn* this, PlayState* play) {
Play_ChangeCameraStatus(play, this->activeCamId, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, this->activeCamId, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->camId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->camId, CAM_STAT_ACTIVE);
this->unk_2F0 = 0.0f; this->subCamAtOffset = 0.0f;
this->unk_2F4 = 50.0f; this->unk_2F4 = 50.0f;
this->unk_2F8 = 0.0f; this->unk_2F8 = 0.0f;
this->unk_2FC = 0.0f; this->subCamEyeOffset = 0.0f;
this->unk_300 = 50.0f; this->unk_300 = 50.0f;
this->unk_304 = 50.0f; this->unk_304 = 50.0f;
sp30 = this->actor.world.pos; sp30 = this->actor.world.pos;
sp24 = this->actor.world.pos; sp24 = this->actor.world.pos;
sp30.x += this->unk_2F0; sp30.x += this->subCamAtOffset;
sp30.y += this->unk_2F4; sp30.y += this->unk_2F4;
sp30.z += this->unk_2F8; sp30.z += this->unk_2F8;
sp24.x += this->unk_2FC; sp24.x += this->subCamEyeOffset;
sp24.y += this->unk_300; sp24.y += this->unk_300;
sp24.z += this->unk_304; sp24.z += this->unk_304;
@ -837,20 +837,20 @@ void func_80A7ABD4(EnIn* this, PlayState* play) {
if (play->csCtx.frames == 44) { if (play->csCtx.frames == 44) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_RONRON_DOOR_CLOSE); Audio_PlayActorSound2(&this->actor, NA_SE_EV_RONRON_DOOR_CLOSE);
} }
Math_SmoothStepToF(&this->unk_2F0, 0.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->subCamAtOffset, 0.0f, 0.06f, 10000.0f, 0.0f);
Math_SmoothStepToF(&this->unk_2F4, 50.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->unk_2F4, 50.0f, 0.06f, 10000.0f, 0.0f);
Math_SmoothStepToF(&this->unk_2F8, 0.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->unk_2F8, 0.0f, 0.06f, 10000.0f, 0.0f);
Math_SmoothStepToF(&this->unk_2FC, 0.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->subCamEyeOffset, 0.0f, 0.06f, 10000.0f, 0.0f);
Math_SmoothStepToF(&this->unk_300, 150.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->unk_300, 150.0f, 0.06f, 10000.0f, 0.0f);
Math_SmoothStepToF(&this->unk_304, 300.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->unk_304, 300.0f, 0.06f, 10000.0f, 0.0f);
sp48 = this->actor.world.pos; sp48 = this->actor.world.pos;
sp3C = this->actor.world.pos; sp3C = this->actor.world.pos;
sp48.x += this->unk_2F0; sp48.x += this->subCamAtOffset;
sp48.y += this->unk_2F4; sp48.y += this->unk_2F4;
sp48.z += this->unk_2F8; sp48.z += this->unk_2F8;
sp3C.x += this->unk_2FC; sp3C.x += this->subCamEyeOffset;
sp3C.y += this->unk_300; sp3C.y += this->unk_300;
sp3C.z += this->unk_304; sp3C.z += this->unk_304;
Play_CameraSetAtEye(play, this->camId, &sp48, &sp3C); Play_CameraSetAtEye(play, this->camId, &sp48, &sp3C);

View file

@ -52,10 +52,10 @@ typedef struct EnIn {
/* 0x01FC */ s16 unk_1FC; /* 0x01FC */ s16 unk_1FC;
/* 0x01FE */ Vec3s jointTable[INGO_LIMB_MAX]; /* 0x01FE */ Vec3s jointTable[INGO_LIMB_MAX];
/* 0x0276 */ Vec3s morphTable[INGO_LIMB_MAX]; /* 0x0276 */ Vec3s morphTable[INGO_LIMB_MAX];
/* 0x02F0 */ f32 unk_2F0; /* 0x02F0 */ f32 subCamAtOffset;
/* 0x02F4 */ f32 unk_2F4; /* 0x02F4 */ f32 unk_2F4;
/* 0x02F8 */ f32 unk_2F8; /* 0x02F8 */ f32 unk_2F8;
/* 0x02FC */ f32 unk_2FC; /* 0x02FC */ f32 subCamEyeOffset;
/* 0x0300 */ f32 unk_300; /* 0x0300 */ f32 unk_300;
/* 0x0304 */ f32 unk_304; /* 0x0304 */ f32 unk_304;
/* 0x0308 */ NpcInteractInfo interactInfo; /* 0x0308 */ NpcInteractInfo interactInfo;

View file

@ -87,7 +87,7 @@ static InitChainEntry sInitChain[] = {
}; };
void func_80A7BE20(EnInsect* this) { void func_80A7BE20(EnInsect* this) {
this->unk_314 = D_80A7DF10[this->actor.params & 3]; this->insectFlags = D_80A7DF10[this->actor.params & 3];
} }
f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) { f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) {
@ -152,16 +152,16 @@ s32 EnInsect_FoundNearbySoil(EnInsect* this, PlayState* play) {
} }
void func_80A7C058(EnInsect* this) { void func_80A7C058(EnInsect* this) {
if (this->unk_31E > 0) { if (this->crawlSoundDelay > 0) {
this->unk_31E--; this->crawlSoundDelay--;
return; return;
} }
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_WALK); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_WALK);
this->unk_31E = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.1f); this->crawlSoundDelay = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.1f);
if (this->unk_31E < 2) { if (this->crawlSoundDelay < 2) {
this->unk_31E = 2; this->crawlSoundDelay = 2;
} }
} }
@ -183,19 +183,19 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) {
this->actor.colChkInfo.mass = 30; this->actor.colChkInfo.mass = 30;
if (this->unk_314 & 1) { if (this->insectFlags & 1) {
this->actor.gravity = -0.2f; this->actor.gravity = -0.2f;
this->actor.minVelocityY = -2.0f; this->actor.minVelocityY = -2.0f;
} }
if (this->unk_314 & 4) { if (this->insectFlags & 4) {
this->unk_31C = Rand_S16Offset(200, 40); this->lifeTimer = Rand_S16Offset(200, 40);
this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED; this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
} }
if (temp_s2 == 2 || temp_s2 == 3) { if (temp_s2 == 2 || temp_s2 == 3) {
if (EnInsect_FoundNearbySoil(this, play)) { if (EnInsect_FoundNearbySoil(this, play)) {
this->unk_314 |= 0x10; this->insectFlags |= 0x10;
D_80A7DEB0 = 0.0f; D_80A7DEB0 = 0.0f;
} }
@ -215,7 +215,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) {
// For bugs that aren't linked to a soil patch, we remove the "short lived" flag to prevent them from despawning // For bugs that aren't linked to a soil patch, we remove the "short lived" flag to prevent them from despawning
// And exit early to not increment the "bugs dropped count" // And exit early to not increment the "bugs dropped count"
if (CVarGetInteger(CVAR_CHEAT("NoBugsDespawn"), 0) && this->soilActor == NULL) { if (CVarGetInteger(CVAR_CHEAT("NoBugsDespawn"), 0) && this->soilActor == NULL) {
this->unk_314 &= ~4; this->insectFlags &= ~4;
return; return;
} }
@ -247,10 +247,10 @@ void EnInsect_Destroy(Actor* thisx, PlayState* play) {
} }
void func_80A7C3A0(EnInsect* this) { void func_80A7C3A0(EnInsect* this) {
this->unk_31A = Rand_S16Offset(5, 35); this->actionTimer = Rand_S16Offset(5, 35);
func_80A7BF58(this); func_80A7BF58(this);
this->actionFunc = func_80A7C3F4; this->actionFunc = func_80A7C3F4;
this->unk_314 |= 0x100; this->insectFlags |= 0x100;
} }
void func_80A7C3F4(EnInsect* this, PlayState* play) { void func_80A7C3F4(EnInsect* this, PlayState* play) {
@ -267,14 +267,14 @@ void func_80A7C3F4(EnInsect* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->unk_31A <= 0) { if (this->actionTimer <= 0) {
func_80A7C598(this); func_80A7C598(this);
} }
if (((this->unk_314 & 4) && this->unk_31C <= 0) || if (((this->insectFlags & 4) && this->lifeTimer <= 0) ||
((sp2E == 2 || sp2E == 3) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) { ((sp2E == 2 || sp2E == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) {
func_80A7CBC8(this); func_80A7CBC8(this);
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { } else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this); func_80A7CE60(this);
} else if (this->actor.xzDistToPlayer < 40.0f) { } else if (this->actor.xzDistToPlayer < 40.0f) {
func_80A7C818(this); func_80A7C818(this);
@ -282,10 +282,10 @@ void func_80A7C3F4(EnInsect* this, PlayState* play) {
} }
void func_80A7C598(EnInsect* this) { void func_80A7C598(EnInsect* this) {
this->unk_31A = Rand_S16Offset(10, 45); this->actionTimer = Rand_S16Offset(10, 45);
func_80A7BF58(this); func_80A7BF58(this);
this->actionFunc = func_80A7C5EC; this->actionFunc = func_80A7C5EC;
this->unk_314 |= 0x100; this->insectFlags |= 0x100;
} }
void func_80A7C5EC(EnInsect* this, PlayState* play) { void func_80A7C5EC(EnInsect* this, PlayState* play) {
@ -296,7 +296,8 @@ void func_80A7C5EC(EnInsect* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f);
if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 1600.0f || (this->unk_31A < 4)) { if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 1600.0f ||
(this->actionTimer < 4)) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000);
} else if (this->actor.child != NULL && &this->actor != this->actor.child) { } else if (this->actor.child != NULL && &this->actor != this->actor.child) {
@ -309,14 +310,14 @@ void func_80A7C5EC(EnInsect* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->unk_31A <= 0) { if (this->actionTimer <= 0) {
func_80A7C3A0(this); func_80A7C3A0(this);
} }
if (((this->unk_314 & 4) && this->unk_31C <= 0) || if (((this->insectFlags & 4) && this->lifeTimer <= 0) ||
((sp34 == 2 || sp34 == 3) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) { ((sp34 == 2 || sp34 == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) {
func_80A7CBC8(this); func_80A7CBC8(this);
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { } else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this); func_80A7CE60(this);
} else if (this->actor.xzDistToPlayer < 40.0f) { } else if (this->actor.xzDistToPlayer < 40.0f) {
func_80A7C818(this); func_80A7C818(this);
@ -324,10 +325,10 @@ void func_80A7C5EC(EnInsect* this, PlayState* play) {
} }
void func_80A7C818(EnInsect* this) { void func_80A7C818(EnInsect* this) {
this->unk_31A = Rand_S16Offset(10, 40); this->actionTimer = Rand_S16Offset(10, 40);
func_80A7BF58(this); func_80A7BF58(this);
this->actionFunc = func_80A7C86C; this->actionFunc = func_80A7C86C;
this->unk_314 |= 0x100; this->insectFlags |= 0x100;
} }
void func_80A7C86C(EnInsect* this, PlayState* play) { void func_80A7C86C(EnInsect* this, PlayState* play) {
@ -340,7 +341,7 @@ void func_80A7C86C(EnInsect* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f);
if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 25600.0f || this->unk_31A < 4) { if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 25600.0f || this->actionTimer < 4) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000);
} else if (sp38 != 0) { } else if (sp38 != 0) {
@ -363,15 +364,15 @@ void func_80A7C86C(EnInsect* this, PlayState* play) {
this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.6f, 0.8f, 1.9f); this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.6f, 0.8f, 1.9f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->unk_31A <= 0 || !sp38) { if (this->actionTimer <= 0 || !sp38) {
func_80A7C3A0(this); func_80A7C3A0(this);
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { } else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this); func_80A7CE60(this);
} }
} }
void func_80A7CA64(EnInsect* this) { void func_80A7CA64(EnInsect* this) {
this->unk_31A = 200; this->actionTimer = 200;
Actor_SetScale(&this->actor, 0.001f); Actor_SetScale(&this->actor, 0.001f);
@ -382,34 +383,34 @@ void func_80A7CA64(EnInsect* this) {
this->skelAnime.playSpeed = 0.3f; this->skelAnime.playSpeed = 0.3f;
this->actionFunc = func_80A7CAD0; this->actionFunc = func_80A7CAD0;
this->unk_314 &= ~0x100; this->insectFlags &= ~0x100;
} }
void func_80A7CAD0(EnInsect* this, PlayState* play) { void func_80A7CAD0(EnInsect* this, PlayState* play) {
if (this->unk_31A == 20 && !(this->unk_314 & 4)) { if (this->actionTimer == 20 && !(this->insectFlags & 4)) {
this->actor.draw = EnInsect_Draw; this->actor.draw = EnInsect_Draw;
} else if (this->unk_31A == 0) { } else if (this->actionTimer == 0) {
if (this->unk_314 & 4) { if (this->insectFlags & 4) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} else { } else {
Actor_SetScale(&this->actor, 0.01f); Actor_SetScale(&this->actor, 0.01f);
func_80A7C3A0(this); func_80A7C3A0(this);
} }
} else if (this->unk_31A < 20) { } else if (this->actionTimer < 20) {
Actor_SetScale(&this->actor, CLAMP_MAX(this->actor.scale.x + 0.001f, 0.01f)); Actor_SetScale(&this->actor, CLAMP_MAX(this->actor.scale.x + 0.001f, 0.01f));
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
} }
} }
void func_80A7CBC8(EnInsect* this) { void func_80A7CBC8(EnInsect* this) {
this->unk_31A = 60; this->actionTimer = 60;
func_80A7BF58(this); func_80A7BF58(this);
this->skelAnime.playSpeed = 1.9f; this->skelAnime.playSpeed = 1.9f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_SINK); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_SINK);
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
this->actionFunc = func_80A7CC3C; this->actionFunc = func_80A7CC3C;
this->unk_314 &= ~0x100; this->insectFlags &= ~0x100;
this->unk_314 |= 0x8; this->insectFlags |= 0x8;
} }
void func_80A7CC3C(EnInsect* this, PlayState* play) { void func_80A7CC3C(EnInsect* this, PlayState* play) {
@ -429,7 +430,7 @@ void func_80A7CC3C(EnInsect* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->unk_31A > 20 && Rand_ZeroOne() < 0.1f) { if (this->actionTimer > 20 && Rand_ZeroOne() < 0.1f) {
velocity.x = Math_SinS(this->actor.shape.rot.y) * -0.6f; velocity.x = Math_SinS(this->actor.shape.rot.y) * -0.6f;
velocity.y = Math_SinS(this->actor.shape.rot.x) * 0.6f; velocity.y = Math_SinS(this->actor.shape.rot.x) * 0.6f;
velocity.z = Math_CosS(this->actor.shape.rot.y) * -0.6f; velocity.z = Math_CosS(this->actor.shape.rot.y) * -0.6f;
@ -437,8 +438,8 @@ void func_80A7CC3C(EnInsect* this, PlayState* play) {
Rand_ZeroOne() * 5.0f + 8.0f); Rand_ZeroOne() * 5.0f + 8.0f);
} }
if (this->unk_31A <= 0) { if (this->actionTimer <= 0) {
if ((this->unk_314 & 0x10) && this->soilActor != NULL && if ((this->insectFlags & 0x10) && this->soilActor != NULL &&
Math3D_Vec3fDistSq(&this->soilActor->actor.world.pos, &this->actor.world.pos) < 64.0f) { Math3D_Vec3fDistSq(&this->soilActor->actor.world.pos, &this->actor.world.pos) < 64.0f) {
this->soilActor->unk_152 = 1; this->soilActor->unk_152 = 1;
} }
@ -447,11 +448,11 @@ void func_80A7CC3C(EnInsect* this, PlayState* play) {
} }
void func_80A7CE60(EnInsect* this) { void func_80A7CE60(EnInsect* this) {
this->unk_31A = Rand_S16Offset(120, 50); this->actionTimer = Rand_S16Offset(120, 50);
func_80A7BF58(this); func_80A7BF58(this);
this->unk_316 = this->unk_318 = 0; this->unk_316 = this->unk_318 = 0;
this->actionFunc = func_80A7CEC0; this->actionFunc = func_80A7CEC0;
this->unk_314 &= ~0x100; this->insectFlags &= ~0x100;
} }
void func_80A7CEC0(EnInsect* this, PlayState* play) { void func_80A7CEC0(EnInsect* this, PlayState* play) {
@ -465,18 +466,18 @@ void func_80A7CEC0(EnInsect* this, PlayState* play) {
sp4E = this->actor.params & 3; sp4E = this->actor.params & 3;
if (this->unk_31A >= 81) { if (this->actionTimer >= 81) {
Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f); Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f);
} else { } else {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f); Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f);
} }
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.world.pos.y += this->actor.yDistToWater; this->actor.world.pos.y += this->actor.yDistToWater;
this->skelAnime.playSpeed = CLAMP(this->unk_31A * 0.018f, 0.1f, 1.9f); this->skelAnime.playSpeed = CLAMP(this->actionTimer * 0.018f, 0.1f, 1.9f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->unk_31A >= 81) { if (this->actionTimer >= 81) {
this->unk_316 += Rand_S16Offset(-50, 100); this->unk_316 += Rand_S16Offset(-50, 100);
this->unk_318 += Rand_S16Offset(-300, 600); this->unk_318 += Rand_S16Offset(-300, 600);
} }
@ -519,11 +520,11 @@ void func_80A7CEC0(EnInsect* this, PlayState* play) {
EffectSsGRipple_Spawn(play, &sp40, 40, 200, 8); EffectSsGRipple_Spawn(play, &sp40, 40, 200, 8);
} }
if (this->unk_31A <= 0 || ((this->unk_314 & 4) && this->unk_31C <= 0) || if (this->actionTimer <= 0 || ((this->insectFlags & 4) && this->lifeTimer <= 0) ||
((sp4E == 2 || sp4E == 3) && (this->unk_314 & 1) && D_80A7DEB8 >= 4)) { ((sp4E == 2 || sp4E == 3) && (this->insectFlags & 1) && D_80A7DEB8 >= 4)) {
func_80A7D1F4(this); func_80A7D1F4(this);
} else if (!(this->actor.bgCheckFlags & 0x40)) { } else if (!(this->actor.bgCheckFlags & 0x40)) {
if (this->unk_314 & 0x10) { if (this->insectFlags & 0x10) {
func_80A7D39C(this); func_80A7D39C(this);
} else { } else {
func_80A7C3A0(this); func_80A7C3A0(this);
@ -532,16 +533,16 @@ void func_80A7CEC0(EnInsect* this, PlayState* play) {
} }
void func_80A7D1F4(EnInsect* this) { void func_80A7D1F4(EnInsect* this) {
this->unk_31A = 100; this->actionTimer = 100;
func_80A7BF58(this); func_80A7BF58(this);
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actor.minVelocityY = -0.8f; this->actor.minVelocityY = -0.8f;
this->actor.gravity = -0.04f; this->actor.gravity = -0.04f;
this->unk_314 &= ~0x3; this->insectFlags &= ~0x3;
this->actionFunc = func_80A7D26C; this->actionFunc = func_80A7D26C;
this->unk_314 &= ~0x100; this->insectFlags &= ~0x100;
this->unk_314 |= 8; this->insectFlags |= 8;
} }
void func_80A7D26C(EnInsect* this, PlayState* play) { void func_80A7D26C(EnInsect* this, PlayState* play) {
@ -553,21 +554,21 @@ void func_80A7D26C(EnInsect* this, PlayState* play) {
EffectSsBubble_Spawn(play, &this->actor.world.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f); EffectSsBubble_Spawn(play, &this->actor.world.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f);
} }
if (this->unk_31A <= 0) { if (this->actionTimer <= 0) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
} }
void func_80A7D39C(EnInsect* this) { void func_80A7D39C(EnInsect* this) {
func_80A7BF58(this); func_80A7BF58(this);
this->unk_31A = 100; this->actionTimer = 100;
this->unk_324 = 1.5f; this->unk_324 = 1.5f;
this->unk_328 = Rand_ZeroOne() * (0xFFFF + 0.5f); this->unk_328 = Rand_ZeroOne() * (0xFFFF + 0.5f);
this->unk_316 = (Rand_ZeroOne() - 0.5f) * 1500.0f; this->unk_316 = (Rand_ZeroOne() - 0.5f) * 1500.0f;
this->actor.world.rot.y = Rand_ZeroOne() * (0xFFFF + 0.5f); this->actor.world.rot.y = Rand_ZeroOne() * (0xFFFF + 0.5f);
Actor_SetScale(&this->actor, 0.003f); Actor_SetScale(&this->actor, 0.003f);
this->actionFunc = func_80A7D460; this->actionFunc = func_80A7D460;
this->unk_314 |= 0x100; this->insectFlags |= 0x100;
} }
void func_80A7D460(EnInsect* this, PlayState* play) { void func_80A7D460(EnInsect* this, PlayState* play) {
@ -588,7 +589,7 @@ void func_80A7D460(EnInsect* this, PlayState* play) {
if (this->soilActor != NULL) { if (this->soilActor != NULL) {
sp40 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); sp40 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos);
} else { } else {
if (this->unk_314 & 0x10) { if (this->insectFlags & 0x10) {
osSyncPrintf(VT_COL(YELLOW, BLACK)); osSyncPrintf(VT_COL(YELLOW, BLACK));
// "warning: target Actor is NULL" // "warning: target Actor is NULL"
osSyncPrintf("warning:目標 Actor が NULL (%s %d)\n", __FILE__, __LINE__); osSyncPrintf("warning:目標 Actor が NULL (%s %d)\n", __FILE__, __LINE__);
@ -674,12 +675,12 @@ void func_80A7D460(EnInsect* this, PlayState* play) {
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (!(this->unk_314 & 0x40) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1)) { if (!(this->insectFlags & 0x40) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
this->unk_314 |= 0x40; this->insectFlags |= 0x40;
} }
if (sp3A == 2 && (this->unk_314 & 0x10) && !(this->unk_314 & 0x80)) { if (sp3A == 2 && (this->insectFlags & 0x10) && !(this->insectFlags & 0x80)) {
if (this->unk_32A >= 15) { if (this->unk_32A >= 15) {
if (this->soilActor != NULL) { if (this->soilActor != NULL) {
if (!(GET_GS_FLAGS(((this->soilActor->actor.params >> 8) & 0x1F) - 1) & if (!(GET_GS_FLAGS(((this->soilActor->actor.params >> 8) & 0x1F) - 1) &
@ -687,32 +688,32 @@ void func_80A7D460(EnInsect* this, PlayState* play) {
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
} }
} }
this->unk_314 |= 0x80; this->insectFlags |= 0x80;
} else { } else {
this->unk_32A++; this->unk_32A++;
} }
} }
if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this); func_80A7CE60(this);
} else if (this->unk_314 & 0x10) { } else if (this->insectFlags & 0x10) {
if (sp40 < 9.0f) { if (sp40 < 9.0f) {
func_80A7CBC8(this); func_80A7CBC8(this);
} else if (this->unk_31A <= 0 || this->unk_31C <= 0 || } else if (this->actionTimer <= 0 || this->lifeTimer <= 0 ||
((this->unk_314 & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4 && ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4 &&
(sp3A == 2 || sp3A == 3))) { (sp3A == 2 || sp3A == 3))) {
func_80A7CBC8(this); func_80A7CBC8(this);
} else { } else {
if (sp40 < 900.0f) { if (sp40 < 900.0f) {
this->unk_31C++; this->lifeTimer++;
this->unk_314 |= 0x20; this->insectFlags |= 0x20;
} else { } else {
this->unk_31A = 100; this->actionTimer = 100;
} }
} }
} else if (sp50 != 0) { } else if (sp50 != 0) {
func_80A7C3A0(this); func_80A7C3A0(this);
} else if ((sp3A == 2 || sp3A == 3) && (this->unk_314 & 1) && this->unk_31C <= 0 && this->unk_31A <= 0 && } else if ((sp3A == 2 || sp3A == 3) && (this->insectFlags & 1) && this->lifeTimer <= 0 && this->actionTimer <= 0 &&
this->actor.floorHeight < BGCHECK_Y_MIN + 10.0f) { this->actor.floorHeight < BGCHECK_Y_MIN + 10.0f) {
osSyncPrintf(VT_COL(YELLOW, BLACK)); osSyncPrintf(VT_COL(YELLOW, BLACK));
// "BG missing? To do Actor_delete" // "BG missing? To do Actor_delete"
@ -734,20 +735,20 @@ void EnInsect_Update(Actor* thisx, PlayState* play) {
} }
} }
if (this->unk_31A > 0) { if (this->actionTimer > 0) {
this->unk_31A--; this->actionTimer--;
} }
if (this->unk_31C > 0) { if (this->lifeTimer > 0) {
this->unk_31C--; this->lifeTimer--;
} }
this->actionFunc(this, play); this->actionFunc(this, play);
if (this->actor.update != NULL) { if (this->actor.update != NULL) {
Actor_MoveXZGravity(&this->actor); Actor_MoveXZGravity(&this->actor);
if (this->unk_314 & 0x100) { if (this->insectFlags & 0x100) {
if (this->unk_314 & 1) { if (this->insectFlags & 1) {
if (this->actor.bgCheckFlags & 1) { if (this->actor.bgCheckFlags & 1) {
func_80A7C058(this); func_80A7C058(this);
} }
@ -758,11 +759,11 @@ void EnInsect_Update(Actor* thisx, PlayState* play) {
phi_v0 = 0; phi_v0 = 0;
if (this->unk_314 & 1) { if (this->insectFlags & 1) {
phi_v0 = 4; phi_v0 = 4;
} }
if (this->unk_314 & 2) { if (this->insectFlags & 2) {
phi_v0 |= 1; phi_v0 |= 1;
} }
@ -781,11 +782,11 @@ void EnInsect_Update(Actor* thisx, PlayState* play) {
func_80A7CA64(this); func_80A7CA64(this);
} }
} else if (this->actor.xzDistToPlayer < 50.0f && this->actionFunc != func_80A7CAD0) { } else if (this->actor.xzDistToPlayer < 50.0f && this->actionFunc != func_80A7CAD0) {
if (!(this->unk_314 & 0x20) && this->unk_31C < 180) { if (!(this->insectFlags & 0x20) && this->lifeTimer < 180) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
} }
if (!(this->unk_314 & 8) && D_80A7DEB4 < 4 && EnInsect_InBottleRange(this, play) && if (!(this->insectFlags & 8) && D_80A7DEB4 < 4 && EnInsect_InBottleRange(this, play) &&
// GI_MAX in this case allows the player to catch the actor in a bottle // GI_MAX in this case allows the player to catch the actor in a bottle
Actor_OfferGetItem(&this->actor, play, GI_MAX, 60.0f, 30.0f)) { Actor_OfferGetItem(&this->actor, play, GI_MAX, 60.0f, 30.0f)) {
D_80A7DEB4++; D_80A7DEB4++;

View file

@ -17,12 +17,12 @@ typedef struct EnInsect {
/* 0x01F0 */ Vec3s jointTable[24]; /* 0x01F0 */ Vec3s jointTable[24];
/* 0x0280 */ Vec3s morphTable[24]; /* 0x0280 */ Vec3s morphTable[24];
/* 0x0310 */ EnInsectActionFunc actionFunc; /* 0x0310 */ EnInsectActionFunc actionFunc;
/* 0x0314 */ u16 unk_314; /* 0x0314 */ u16 insectFlags;
/* 0x0316 */ s16 unk_316; /* 0x0316 */ s16 unk_316;
/* 0x0318 */ s16 unk_318; /* 0x0318 */ s16 unk_318;
/* 0x031A */ s16 unk_31A; /* 0x031A */ s16 actionTimer;
/* 0x031C */ s16 unk_31C; /* 0x031C */ s16 lifeTimer;
/* 0x031E */ s16 unk_31E; /* 0x031E */ s16 crawlSoundDelay;
/* 0x0320 */ ObjMakekinsuta* soilActor; /* 0x0320 */ ObjMakekinsuta* soilActor;
/* 0x0324 */ f32 unk_324; /* 0x0324 */ f32 unk_324;
/* 0x0328 */ s16 unk_328; /* 0x0328 */ s16 unk_328;

View file

@ -707,7 +707,7 @@ s32 func_80A97D68(EnKo* this, PlayState* play) {
s32 func_80A97E18(EnKo* this, PlayState* play) { s32 func_80A97E18(EnKo* this, PlayState* play) {
s16 trackingMode; s16 trackingMode;
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
if (EnKo_IsWithinTalkAngle(this) == true) { if (EnKo_IsWithinTalkAngle(this) == true) {
trackingMode = NPC_TRACKING_HEAD_AND_TORSO; trackingMode = NPC_TRACKING_HEAD_AND_TORSO;
} else { } else {
@ -726,7 +726,7 @@ s32 func_80A97EB0(EnKo* this, PlayState* play) {
s16 trackingMode; s16 trackingMode;
s32 result; s32 result;
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
result = EnKo_IsWithinTalkAngle(this); result = EnKo_IsWithinTalkAngle(this);
trackingMode = (result == true) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; trackingMode = (result == true) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
Npc_TrackPoint(&this->actor, &this->interactInfo, 2, trackingMode); Npc_TrackPoint(&this->actor, &this->interactInfo, 2, trackingMode);
@ -734,7 +734,7 @@ s32 func_80A97EB0(EnKo* this, PlayState* play) {
} }
s32 func_80A97F20(EnKo* this, PlayState* play) { s32 func_80A97F20(EnKo* this, PlayState* play) {
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY);
return 1; return 1;
} }
@ -746,7 +746,7 @@ s32 func_80A97F70(EnKo* this, PlayState* play) {
if ((this->skelAnime.animation == &gKokiriBlockingAnim) == false) { if ((this->skelAnime.animation == &gKokiriBlockingAnim) == false) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENKO_ANIM_BLOCKING_STATIC); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENKO_ANIM_BLOCKING_STATIC);
} }
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
trackingMode = NPC_TRACKING_HEAD_AND_TORSO; trackingMode = NPC_TRACKING_HEAD_AND_TORSO;
} else { } else {
if ((this->skelAnime.animation == &gKokiriCuttingGrassAnim) == false) { if ((this->skelAnime.animation == &gKokiriCuttingGrassAnim) == false) {
@ -766,7 +766,7 @@ s32 func_80A98034(EnKo* this, PlayState* play) {
if ((this->skelAnime.animation == &gKokiriBlockingAnim) == false) { if ((this->skelAnime.animation == &gKokiriBlockingAnim) == false) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENKO_ANIM_BLOCKING_STATIC); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENKO_ANIM_BLOCKING_STATIC);
} }
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
result = EnKo_IsWithinTalkAngle(this); result = EnKo_IsWithinTalkAngle(this);
trackingMode = (result == true) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; trackingMode = (result == true) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
} else { } else {
@ -782,7 +782,7 @@ s32 func_80A98034(EnKo* this, PlayState* play) {
// Same as func_80A97F20 // Same as func_80A97F20
s32 func_80A98124(EnKo* this, PlayState* play) { s32 func_80A98124(EnKo* this, PlayState* play) {
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY);
return 1; return 1;
} }
@ -796,7 +796,7 @@ s32 func_80A98174(EnKo* this, PlayState* play) {
this->skelAnime.playSpeed = 1.0f; this->skelAnime.playSpeed = 1.0f;
} }
if (this->skelAnime.playSpeed == 0.0f) { if (this->skelAnime.playSpeed == 0.0f) {
func_80034F54(play, this->unk_2E4, this->unk_304, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
} }
Npc_TrackPoint(&this->actor, &this->interactInfo, 2, Npc_TrackPoint(&this->actor, &this->interactInfo, 2,
(this->skelAnime.playSpeed == 0.0f) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE); (this->skelAnime.playSpeed == 0.0f) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE);
@ -1338,8 +1338,8 @@ s32 EnKo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
Matrix_Translate(-1200.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(-1200.0f, 0.0f, 0.0f, MTXMODE_APPLY);
} }
if (limbIndex == 8 || limbIndex == 9 || limbIndex == 12) { if (limbIndex == 8 || limbIndex == 9 || limbIndex == 12) {
rot->y += Math_SinS(this->unk_2E4[limbIndex]) * 200.0f; rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f;
rot->z += Math_CosS(this->unk_304[limbIndex]) * 200.0f; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f;
} }
return false; return false;
} }

View file

@ -30,8 +30,8 @@ typedef struct EnKo {
/* 0x0220 */ f32 modelAlpha; /* 0x0220 */ f32 modelAlpha;
/* 0x0224 */ Vec3s jointTable[16]; /* 0x0224 */ Vec3s jointTable[16];
/* 0x0284 */ Vec3s morphTable[16]; /* 0x0284 */ Vec3s morphTable[16];
/* 0x02E4 */ s16 unk_2E4[16]; /* 0x02E4 */ s16 fidgetTableY[16];
/* 0x0304 */ s16 unk_304[16]; /* 0x0304 */ s16 fidgetTableZ[16];
} EnKo; // size = 0x0324 } EnKo; // size = 0x0324
typedef enum { typedef enum {

View file

@ -416,7 +416,7 @@ void EnKz_PreMweepWait(EnKz* this, PlayState* play) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
this->actionFunc = EnKz_SetupMweep; this->actionFunc = EnKz_SetupMweep;
} else { } else {
func_80034F54(play, this->unk_2A6, this->unk_2BE, 12); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 12);
} }
} }
@ -489,7 +489,7 @@ void EnKz_Wait(EnKz* this, PlayState* play) {
this->actionFunc = EnKz_SetupGetItem; this->actionFunc = EnKz_SetupGetItem;
EnKz_SetupGetItem(this, play); EnKz_SetupGetItem(this, play);
} else { } else {
func_80034F54(play, this->unk_2A6, this->unk_2BE, 12); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 12);
} }
} }
@ -548,8 +548,8 @@ s32 EnKz_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
EnKz* this = (EnKz*)thisx; EnKz* this = (EnKz*)thisx;
if (limbIndex == 8 || limbIndex == 9 || limbIndex == 10) { if (limbIndex == 8 || limbIndex == 9 || limbIndex == 10) {
rot->y += Math_SinS(this->unk_2A6[limbIndex]) * 200.0f; rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f;
rot->z += Math_CosS(this->unk_2BE[limbIndex]) * 200.0f; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f;
} }
if (limbIndex) {} if (limbIndex) {}
return false; return false;

View file

@ -24,8 +24,8 @@ typedef struct EnKz {
/* 0x0214 */ s16 gameplayCamera; /* 0x0214 */ s16 gameplayCamera;
/* 0x0216 */ Vec3s jointTable[12]; /* 0x0216 */ Vec3s jointTable[12];
/* 0x025E */ Vec3s morphTable[12]; /* 0x025E */ Vec3s morphTable[12];
/* 0x02A6 */ s16 unk_2A6[12]; /* 0x02A6 */ s16 fidgetTableY[12];
/* 0x02BE */ s16 unk_2BE[12]; /* 0x02BE */ s16 fidgetTableZ[12];
} EnKz; // size = 0x02D8 } EnKz; // size = 0x02D8

View file

@ -67,22 +67,22 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
Collider_InitCylinder(play, &this->collider); Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420);
this->unk_1C7 = (this->actor.params & 0xFF) - 1; this->swordType = (this->actor.params & 0xFF) - 1;
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 255, 255, 255, 0); this->actor.world.pos.z, 255, 255, 255, 0);
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
this->collider.dim.radius = 0; this->collider.dim.radius = 0;
this->collider.dim.height = 40; this->collider.dim.height = 40;
this->collider.dim.yShift = -20; this->collider.dim.yShift = -20;
this->unk_1C4 = 8; this->followPlayerTimer = 8;
this->unk_1B4 = 0.0f; this->spinTrailTexScroll = 0.0f;
this->actor.world.pos = player->bodyPartsPos[0]; this->actor.world.pos = player->bodyPartsPos[0];
this->unk_1AC = 0.0f; this->spinAttackTimer = 0.0f;
this->unk_1BC = 0.0f; this->dimmingIntensity = 0.0f;
this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000; this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000;
this->actor.room = -1; this->actor.room = -1;
Actor_SetScale(&this->actor, 0.1f); Actor_SetScale(&this->actor, 0.1f);
this->unk_1CA = 0; this->isUsingMagic = 0;
if (player->stateFlags2 & PLAYER_STATE2_SPIN_ATTACKING) { if (player->stateFlags2 & PLAYER_STATE2_SPIN_ATTACKING) {
if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) ||
@ -97,15 +97,15 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
} }
player->stateFlags2 &= ~PLAYER_STATE2_SPIN_ATTACKING; player->stateFlags2 &= ~PLAYER_STATE2_SPIN_ATTACKING;
this->unk_1CA = 1; this->isUsingMagic = 1;
this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7]; this->collider.info.toucher.dmgFlags = D_80AA044C[this->swordType];
this->unk_1C6 = 1; this->attackStrength = 1;
this->unk_1C9 = ((this->unk_1C7 == 1) ? 2 : 4); this->targetScale = ((this->swordType == 1) ? 2 : 4);
func_80A9EFE0(this, func_80A9F9B4); func_80A9EFE0(this, func_80A9F9B4);
this->unk_1C4 = 8; this->followPlayerTimer = 8;
Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_1AC = 1.0f; this->spinAttackTimer = 1.0f;
} else { } else {
func_80A9EFE0(this, func_80A9F408); func_80A9EFE0(this, func_80A9F408);
} }
@ -115,7 +115,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
void EnMThunder_Destroy(Actor* thisx, PlayState* play) { void EnMThunder_Destroy(Actor* thisx, PlayState* play) {
EnMThunder* this = (EnMThunder*)thisx; EnMThunder* this = (EnMThunder*)thisx;
if (this->unk_1CA != 0) { if (this->isUsingMagic != 0) {
Magic_Reset(play); Magic_Reset(play);
} }
@ -152,24 +152,24 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Actor* child = this->actor.child; Actor* child = this->actor.child;
this->unk_1B8 = player->unk_858; this->spinChargePercent = player->unk_858;
this->actor.world.pos = player->bodyPartsPos[0]; this->actor.world.pos = player->bodyPartsPos[0];
this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000; this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000;
if (this->unk_1CA == 0) { if (this->isUsingMagic == 0) {
if (player->unk_858 >= 0.1f) { if (player->unk_858 >= 0.1f) {
if ((gSaveContext.magicState != MAGIC_STATE_IDLE) || if ((gSaveContext.magicState != MAGIC_STATE_IDLE) ||
(((this->actor.params & 0xFF00) >> 8) && (((this->actor.params & 0xFF00) >> 8) &&
!(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_WAIT_PREVIEW)))) { !(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_WAIT_PREVIEW)))) {
func_80A9F350(this, play); func_80A9F350(this, play);
func_80A9EFE0(this, func_80A9F350); func_80A9EFE0(this, func_80A9F350);
this->unk_1C8 = 0; this->chargeAlpha = 0;
this->unk_1BC = 0.0; this->dimmingIntensity = 0.0;
this->unk_1AC = 0.0f; this->spinAttackTimer = 0.0f;
return; return;
} }
this->unk_1CA = 1; this->isUsingMagic = 1;
} }
} }
@ -197,20 +197,20 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
} }
if (player->unk_858 < 0.85f) { if (player->unk_858 < 0.85f) {
this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7]; this->collider.info.toucher.dmgFlags = D_80AA044C[this->swordType];
this->unk_1C6 = 1; this->attackStrength = 1;
this->unk_1C9 = ((this->unk_1C7 == 1) ? 2 : 4); this->targetScale = ((this->swordType == 1) ? 2 : 4);
} else { } else {
this->collider.info.toucher.dmgFlags = D_80AA0458[this->unk_1C7]; this->collider.info.toucher.dmgFlags = D_80AA0458[this->swordType];
this->unk_1C6 = 0; this->attackStrength = 0;
this->unk_1C9 = ((this->unk_1C7 == 1) ? 4 : 8); this->targetScale = ((this->swordType == 1) ? 4 : 8);
} }
func_80A9EFE0(this, func_80A9F9B4); func_80A9EFE0(this, func_80A9F9B4);
this->unk_1C4 = 8; this->followPlayerTimer = 8;
Audio_PlaySoundGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySoundGeneral(sSfxIds[this->attackStrength], &player->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_1AC = 1.0f; this->spinAttackTimer = 1.0f;
return; return;
} }
} }
@ -224,19 +224,19 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
} }
if (player->unk_858 > 0.15f) { if (player->unk_858 > 0.15f) {
this->unk_1C8 = 255; this->chargeAlpha = 255;
if (this->actor.child == NULL) { if (this->actor.child == NULL) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_DUST, this->actor.world.pos.x, Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_DUST, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0,
this->unk_1C7 + 2); this->swordType + 2);
} }
this->unk_1BC += ((((player->unk_858 - 0.15f) * 1.5f) - this->unk_1BC) * 0.5f); this->dimmingIntensity += ((((player->unk_858 - 0.15f) * 1.5f) - this->dimmingIntensity) * 0.5f);
} else if (player->unk_858 > .1f) { } else if (player->unk_858 > .1f) {
this->unk_1C8 = (s32)((player->unk_858 - .1f) * 255.0f * 20.0f); this->chargeAlpha = (s32)((player->unk_858 - .1f) * 255.0f * 20.0f);
this->unk_1AC = (player->unk_858 - .1f) * 10.0f; this->spinAttackTimer = (player->unk_858 - .1f) * 10.0f;
} else { } else {
this->unk_1C8 = 0; this->chargeAlpha = 0;
} }
if (player->unk_858 > 0.85f) { if (player->unk_858 > 0.85f) {
@ -253,46 +253,46 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
} }
void func_80A9F938(EnMThunder* this, PlayState* play) { void func_80A9F938(EnMThunder* this, PlayState* play) {
if (this->unk_1C4 < 2) { if (this->followPlayerTimer < 2) {
if (this->unk_1C8 < 40) { if (this->chargeAlpha < 40) {
this->unk_1C8 = 0; this->chargeAlpha = 0;
} else { } else {
this->unk_1C8 -= 40; this->chargeAlpha -= 40;
} }
} }
this->unk_1B4 += 2.0f * this->unk_1B0; this->spinTrailTexScroll += 2.0f * this->spinAttackAlpha;
if (this->unk_1BC < this->unk_1AC) { if (this->dimmingIntensity < this->spinAttackTimer) {
this->unk_1BC += ((this->unk_1AC - this->unk_1BC) * 0.1f); this->dimmingIntensity += ((this->spinAttackTimer - this->dimmingIntensity) * 0.1f);
} else { } else {
this->unk_1BC = this->unk_1AC; this->dimmingIntensity = this->spinAttackTimer;
} }
} }
void func_80A9F9B4(EnMThunder* this, PlayState* play) { void func_80A9F9B4(EnMThunder* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (Math_StepToF(&this->unk_1AC, 0.0f, 1 / 16.0f)) { if (Math_StepToF(&this->spinAttackTimer, 0.0f, 1 / 16.0f)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} else { } else {
Math_SmoothStepToF(&this->actor.scale.x, (s32)this->unk_1C9, 0.6f, 0.8f, 0.0f); Math_SmoothStepToF(&this->actor.scale.x, (s32)this->targetScale, 0.6f, 0.8f, 0.0f);
Actor_SetScale(&this->actor, this->actor.scale.x); Actor_SetScale(&this->actor, this->actor.scale.x);
this->collider.dim.radius = (this->actor.scale.x * 25.0f); this->collider.dim.radius = (this->actor.scale.x * 25.0f);
Collider_UpdateCylinder(&this->actor, &this->collider); Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
} }
if (this->unk_1C4 > 0) { if (this->followPlayerTimer > 0) {
this->actor.world.pos.x = player->bodyPartsPos[0].x; this->actor.world.pos.x = player->bodyPartsPos[0].x;
this->actor.world.pos.z = player->bodyPartsPos[0].z; this->actor.world.pos.z = player->bodyPartsPos[0].z;
this->unk_1C4--; this->followPlayerTimer--;
} }
if (this->unk_1AC > 0.6f) { if (this->spinAttackTimer > 0.6f) {
this->unk_1B0 = 1.0f; this->spinAttackAlpha = 1.0f;
} else { } else {
this->unk_1B0 = this->unk_1AC * (5.0f / 3.0f); this->spinAttackAlpha = this->spinAttackTimer * (5.0f / 3.0f);
} }
func_80A9F938(this, play); func_80A9F938(this, play);
@ -308,8 +308,8 @@ void EnMThunder_Update(Actor* thisx, PlayState* play) {
s32 redGreen; s32 redGreen;
this->actionFunc(this, play); this->actionFunc(this, play);
func_80A9F314(play, this->unk_1BC); func_80A9F314(play, this->dimmingIntensity);
blueRadius = this->unk_1AC; blueRadius = this->spinAttackTimer;
redGreen = (u32)(blueRadius * 255.0f) & 0xFF; redGreen = (u32)(blueRadius * 255.0f) & 0xFF;
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, redGreen, redGreen, (u32)(blueRadius * 100.0f), this->actor.world.pos.z, redGreen, redGreen, (u32)(blueRadius * 100.0f),
@ -329,24 +329,24 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY); Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
switch (this->unk_1C6) { switch (this->attackStrength) {
case 0: case 0:
case 1: case 1:
gSPSegment(POLY_XLU_DISP++, 0x08, gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0xFF - ((u8)(s32)(this->unk_1B4 * 30) & 0xFF), 0, 0x40, Gfx_TwoTexScrollEx(
0x20, 1, 0xFF - ((u8)(s32)(this->unk_1B4 * 20) & 0xFF), 0, 8, 8, -30, 0, -20, play->state.gfxCtx, 0, 0xFF - ((u8)(s32)(this->spinTrailTexScroll * 30) & 0xFF), 0, 0x40,
0)); 0x20, 1, 0xFF - ((u8)(s32)(this->spinTrailTexScroll * 20) & 0xFF), 0, 8, 8, -30, 0, -20, 0));
break; break;
} }
switch (this->unk_1C6) { switch (this->attackStrength) {
case 0: case 0:
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Primary.Changed"), 0)) { if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Primary.Changed"), 0)) {
Color_RGB8 color = Color_RGB8 color =
CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level2Primary.Value"), (Color_RGB8){ 255, 255, 170 }); CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level2Primary.Value"), (Color_RGB8){ 255, 255, 170 });
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, (u8)(this->unk_1B0 * 255)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, (u8)(this->spinAttackAlpha * 255));
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)(this->unk_1B0 * 255)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)(this->spinAttackAlpha * 255));
} }
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack3DL); gSPDisplayList(POLY_XLU_DISP++, gSpinAttack3DL);
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack4DL); gSPDisplayList(POLY_XLU_DISP++, gSpinAttack4DL);
@ -355,9 +355,9 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Primary.Changed"), 0)) { if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Primary.Changed"), 0)) {
Color_RGB8 color = Color_RGB8 color =
CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level1Primary.Value"), (Color_RGB8){ 170, 255, 255 }); CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level1Primary.Value"), (Color_RGB8){ 170, 255, 255 });
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, (u8)(this->unk_1B0 * 255)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, (u8)(this->spinAttackAlpha * 255));
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)(this->unk_1B0 * 255)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)(this->spinAttackAlpha * 255));
} }
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack1DL); gSPDisplayList(POLY_XLU_DISP++, gSpinAttack1DL);
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack2DL); gSPDisplayList(POLY_XLU_DISP++, gSpinAttack2DL);
@ -366,7 +366,7 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); Matrix_Mult(&player->mf_9E0, MTXMODE_NEW);
switch (this->unk_1C7) { switch (this->swordType) {
case 1: case 1:
Matrix_Translate(0.0f, 220.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 220.0f, 0.0f, MTXMODE_APPLY);
Matrix_Scale(-0.7f, -0.6f, -0.4f, MTXMODE_APPLY); Matrix_Scale(-0.7f, -0.6f, -0.4f, MTXMODE_APPLY);
@ -384,14 +384,14 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
break; break;
} }
if (this->unk_1B8 >= 0.85f) { if (this->spinChargePercent >= 0.85f) {
phi_f14 = (D_80AA046C[(play->gameplayFrames & 7)] * 6.0f) + 1.0f; phi_f14 = (D_80AA046C[(play->gameplayFrames & 7)] * 6.0f) + 1.0f;
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Primary.Changed"), 0)) { if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Primary.Changed"), 0)) {
Color_RGB8 color = Color_RGB8 color =
CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level2Primary.Value"), (Color_RGB8){ 255, 255, 170 }); CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level2Primary.Value"), (Color_RGB8){ 255, 255, 170 });
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, this->unk_1C8); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, this->chargeAlpha);
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->unk_1C8); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->chargeAlpha);
} }
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Secondary.Changed"), 0)) { if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Secondary.Changed"), 0)) {
Color_RGB8 color = Color_RGB8 color =
@ -406,9 +406,9 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Primary.Changed"), 0)) { if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Primary.Changed"), 0)) {
Color_RGB8 color = Color_RGB8 color =
CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level1Primary.Value"), (Color_RGB8){ 170, 255, 255 }); CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level1Primary.Value"), (Color_RGB8){ 170, 255, 255 });
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, this->unk_1C8); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, this->chargeAlpha);
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->unk_1C8); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->chargeAlpha);
} }
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Secondary.Changed"), 0)) { if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Secondary.Changed"), 0)) {
Color_RGB8 color = Color_RGB8 color =

View file

@ -13,18 +13,18 @@ typedef struct EnMThunder {
/* 0x014C */ ColliderCylinder collider; /* 0x014C */ ColliderCylinder collider;
/* 0x0198 */ LightNode* lightNode; /* 0x0198 */ LightNode* lightNode;
/* 0x019C */ LightInfo lightInfo; /* 0x019C */ LightInfo lightInfo;
/* 0x01AC */ f32 unk_1AC; /* 0x01AC */ f32 spinAttackTimer;
/* 0x01B0 */ f32 unk_1B0; /* 0x01B0 */ f32 spinAttackAlpha;
/* 0x01B0 */ f32 unk_1B4; /* 0x01B4 */ f32 spinTrailTexScroll;
/* 0x01B0 */ f32 unk_1B8; /* 0x01B8 */ f32 spinChargePercent;
/* 0x01BC */ f32 unk_1BC; /* 0x01BC */ f32 dimmingIntensity;
/* 0x01C0 */ EnMThunderActionFunc actionFunc; /* 0x01C0 */ EnMThunderActionFunc actionFunc;
/* 0x01C4 */ u16 unk_1C4; /* 0x01C4 */ u16 followPlayerTimer;
/* 0x01C6 */ u8 unk_1C6; /* 0x01C6 */ u8 attackStrength;
/* 0x01C7 */ u8 unk_1C7; /* 0x01C7 */ u8 swordType;
/* 0x01C8 */ u8 unk_1C8; /* 0x01C8 */ u8 chargeAlpha;
/* 0x01C9 */ u8 unk_1C9; /* 0x01C9 */ u8 targetScale;
/* 0x01CA */ u8 unk_1CA; /* 0x01CA */ u8 isUsingMagic;
} EnMThunder; // size = 0x01CC } EnMThunder; // size = 0x01CC
#endif #endif

View file

@ -259,13 +259,13 @@ void func_80AA0AF4(EnMa1* this, PlayState* play) {
void func_80AA0B74(EnMa1* this) { void func_80AA0B74(EnMa1* this) {
if (this->skelAnime.animation == &gMalonChildSingAnim) { if (this->skelAnime.animation == &gMalonChildSingAnim) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
if (this->unk_1E0 != 0) { if (this->singingDisabled != 0) {
this->unk_1E0 = 0; this->singingDisabled = 0;
func_800F6584(0); func_800F6584(0);
} }
} else { } else {
if (this->unk_1E0 == 0) { if (this->singingDisabled == 0) {
this->unk_1E0 = 1; this->singingDisabled = 1;
func_800F6584(1); func_800F6584(1);
} }
} }

View file

@ -13,7 +13,7 @@ typedef struct EnMa1 {
/* 0x014C */ SkelAnime skelAnime; /* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnMa1ActionFunc actionFunc; /* 0x0190 */ EnMa1ActionFunc actionFunc;
/* 0x0194 */ ColliderCylinder collider; /* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ s16 unk_1E0; /* 0x01E0 */ s16 singingDisabled;
/* 0x01E2 */ s16 blinkTimer; /* 0x01E2 */ s16 blinkTimer;
/* 0x01E4 */ s16 eyeIndex; /* 0x01E4 */ s16 eyeIndex;
/* 0x01E6 */ s16 mouthIndex; /* 0x01E6 */ s16 mouthIndex;

View file

@ -199,14 +199,14 @@ void EnMa2_ChangeAnim(EnMa2* this, s32 index) {
void func_80AA1DB4(EnMa2* this, PlayState* play) { void func_80AA1DB4(EnMa2* this, PlayState* play) {
if (this->skelAnime.animation == &gMalonAdultSingAnim) { if (this->skelAnime.animation == &gMalonAdultSingAnim) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
if (this->unk_20A != 0) { if (this->singingDisabled != 0) {
func_800F6584(0); func_800F6584(0);
this->unk_20A = 0; this->singingDisabled = 0;
} }
} else { } else {
if (this->unk_20A == 0) { if (this->singingDisabled == 0) {
func_800F6584(1); func_800F6584(1);
this->unk_20A = 1; this->singingDisabled = 1;
} }
} }
} }
@ -286,7 +286,7 @@ void func_80AA20E4(EnMa2* this, PlayState* play) {
} else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) {
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_208 = 0x1E; this->timer = 0x1E;
Flags_SetInfTable(INFTABLE_8E); Flags_SetInfTable(INFTABLE_8E);
this->actionFunc = func_80AA21C8; this->actionFunc = func_80AA21C8;
play->msgCtx.ocarinaMode = OCARINA_MODE_04; play->msgCtx.ocarinaMode = OCARINA_MODE_04;
@ -298,7 +298,7 @@ void func_80AA20E4(EnMa2* this, PlayState* play) {
void func_80AA21C8(EnMa2* this, PlayState* play) { void func_80AA21C8(EnMa2* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (DECR(this->unk_208)) { if (DECR(this->timer)) {
player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
} else { } else {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
@ -349,8 +349,8 @@ s32 EnMa2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
} }
if ((limbIndex == MALON_ADULT_CHEST_AND_NECK_LIMB) || (limbIndex == MALON_ADULT_LEFT_SHOULDER_LIMB) || if ((limbIndex == MALON_ADULT_CHEST_AND_NECK_LIMB) || (limbIndex == MALON_ADULT_LEFT_SHOULDER_LIMB) ||
(limbIndex == MALON_ADULT_RIGHT_SHOULDER_LIMB)) { (limbIndex == MALON_ADULT_RIGHT_SHOULDER_LIMB)) {
rot->y += Math_SinS(this->unk_212[limbIndex].y) * 200.0f; rot->y += Math_SinS(this->upperBodyRot[limbIndex].y) * 200.0f;
rot->z += Math_CosS(this->unk_212[limbIndex].z) * 200.0f; rot->z += Math_CosS(this->upperBodyRot[limbIndex].z) * 200.0f;
} }
return false; return false;
} }

View file

@ -37,12 +37,12 @@ typedef struct EnMa2 {
/* 0x0190 */ EnMa2ActionFunc actionFunc; /* 0x0190 */ EnMa2ActionFunc actionFunc;
/* 0x0194 */ ColliderCylinder collider; /* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ NpcInteractInfo interactInfo; /* 0x01E0 */ NpcInteractInfo interactInfo;
/* 0x0208 */ s16 unk_208; /* 0x0208 */ s16 timer;
/* 0x020A */ s16 unk_20A; /* 0x020A */ s16 singingDisabled;
/* 0x020C */ s16 blinkTimer; /* 0x020C */ s16 blinkTimer;
/* 0x020E */ s16 eyeIndex; /* 0x020E */ s16 eyeIndex;
/* 0x0210 */ s16 mouthIndex; /* 0x0210 */ s16 mouthIndex;
/* 0x0212 */ Vec3s unk_212[MALON_ADULT_LIMB_MAX]; /* 0x0212 */ Vec3s upperBodyRot[MALON_ADULT_LIMB_MAX];
} EnMa2; // size = 0x0284 } EnMa2; // size = 0x0284
#endif #endif

View file

@ -297,13 +297,13 @@ void EnMa3_Update(Actor* thisx, PlayState* play) {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, (f32)this->collider.dim.radius + 150.0f, Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, (f32)this->collider.dim.radius + 150.0f,
func_80AA2AA0, func_80AA2BD4); func_80AA2AA0, func_80AA2BD4);
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
if (this->unk_20A != 0) { if (this->isNotSinging != 0) {
func_800F6584(0); func_800F6584(0);
this->unk_20A = 0; this->isNotSinging = 0;
} }
} else if (this->unk_20A == 0) { } else if (this->isNotSinging == 0) {
func_800F6584(1); func_800F6584(1);
this->unk_20A = 1; this->isNotSinging = 1;
} }
} }

View file

@ -38,7 +38,7 @@ typedef struct EnMa3 {
/* 0x0194 */ ColliderCylinder collider; /* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ NpcInteractInfo interactInfo; /* 0x01E0 */ NpcInteractInfo interactInfo;
/* 0x0208 */ s16 unk_208; /* 0x0208 */ s16 unk_208;
/* 0x020A */ s16 unk_20A; /* 0x020A */ s16 isNotSinging;
/* 0x020C */ s16 blinkTimer; /* 0x020C */ s16 blinkTimer;
/* 0x020E */ s16 eyeIndex; /* 0x020E */ s16 eyeIndex;
/* 0x0210 */ s16 mouthIndex; /* 0x0210 */ s16 mouthIndex;

View file

@ -682,7 +682,7 @@ void EnMd_Destroy(Actor* thisx, PlayState* play) {
void EnMd_Idle(EnMd* this, PlayState* play) { void EnMd_Idle(EnMd* this, PlayState* play) {
if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) { if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) {
func_80034F54(play, this->unk_214, this->unk_236, 17); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 17);
} else if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (this->animSequence != 7)) { } else if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (this->animSequence != 7)) {
EnMd_SetAnimSequence(this, 7); EnMd_SetAnimSequence(this, 7);
} }
@ -692,7 +692,7 @@ void EnMd_Idle(EnMd* this, PlayState* play) {
void EnMd_Watch(EnMd* this, PlayState* play) { void EnMd_Watch(EnMd* this, PlayState* play) {
if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) { if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) {
func_80034F54(play, this->unk_214, this->unk_236, 17); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 17);
} }
EnMd_UpdateAnimSequence(this); EnMd_UpdateAnimSequence(this);
} }
@ -748,7 +748,7 @@ void EnMd_BlockPath(EnMd* this, PlayState* play) {
} }
if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) { if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) {
func_80034F54(play, this->unk_214, this->unk_236, 17); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 17);
} }
if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (play->sceneNum == SCENE_LOST_WOODS)) { if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (play->sceneNum == SCENE_LOST_WOODS)) {
@ -786,7 +786,7 @@ void EnMd_ListenToOcarina(EnMd* this, PlayState* play) {
} }
void EnMd_Walk(EnMd* this, PlayState* play) { void EnMd_Walk(EnMd* this, PlayState* play) {
func_80034F54(play, this->unk_214, this->unk_236, 17); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 17);
EnMd_UpdateAnimSequence(this); EnMd_UpdateAnimSequence(this);
if (!(EnMd_FollowPath(this, play)) || (this->waypoint != 0)) { if (!(EnMd_FollowPath(this, play)) || (this->waypoint != 0)) {
@ -844,8 +844,8 @@ s32 EnMd_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
} }
if (((limbIndex == 9) || (limbIndex == 10)) || (limbIndex == 13)) { if (((limbIndex == 9) || (limbIndex == 10)) || (limbIndex == 13)) {
rot->y += Math_SinS(this->unk_214[limbIndex]) * 200.0f; rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f;
rot->z += Math_CosS(this->unk_236[limbIndex]) * 200.0f; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f;
} }
return false; return false;

View file

@ -22,8 +22,8 @@ typedef struct EnMd {
/* 0x020E */ s16 eyeIdx; /* 0x020E */ s16 eyeIdx;
/* 0x0210 */ s16 alpha; /* 0x0210 */ s16 alpha;
/* 0x0212 */ s16 waypoint; /* 0x0212 */ s16 waypoint;
/* 0x0214 */ s16 unk_214[17]; /* 0x0214 */ s16 fidgetTableY[17];
/* 0x0236 */ s16 unk_236[17]; /* 0x0236 */ s16 fidgetTableZ[17];
/* 0x0258 */ Vec3s jointTable[17]; /* 0x0258 */ Vec3s jointTable[17];
/* 0x02BE */ Vec3s morphTable[17]; /* 0x02BE */ Vec3s morphTable[17];
} EnMd; // size = 0x0324 } EnMd; // size = 0x0324

View file

@ -149,7 +149,7 @@ void EnMu_Destroy(Actor* thisx, PlayState* play) {
} }
void EnMu_Pose(EnMu* this, PlayState* play) { void EnMu_Pose(EnMu* this, PlayState* play) {
func_80034F54(play, this->unk_20A, this->unk_22A, 16); func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
} }
void EnMu_Update(Actor* thisx, PlayState* play) { void EnMu_Update(Actor* thisx, PlayState* play) {
@ -181,8 +181,8 @@ s32 EnMu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
if ((limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 11) || (limbIndex == 12) || if ((limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 11) || (limbIndex == 12) ||
(limbIndex == 13) || (limbIndex == 14)) { (limbIndex == 13) || (limbIndex == 14)) {
rot->y += Math_SinS(this->unk_20A[limbIndex]) * 200.0f; rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f;
rot->z += Math_CosS(this->unk_22A[limbIndex]) * 200.0f; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f;
} }
return false; return false;
} }

View file

@ -15,8 +15,8 @@ typedef struct EnMu {
/* 0x0194 */ ColliderCylinder collider; /* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ NpcInteractInfo npcInfo; /* 0x01E0 */ NpcInteractInfo npcInfo;
/* 0x0208 */ u16 defFaceReaction; /* 0x0208 */ u16 defFaceReaction;
/* 0x020A */ s16 unk_20A[16]; /* 0x020A */ s16 fidgetTableY[16];
/* 0x022A */ s16 unk_22A[17]; /* 0x022A */ s16 fidgetTableZ[17];
} EnMu; // size = 0x024C } EnMu; // size = 0x024C
#endif #endif

View file

@ -212,12 +212,12 @@ void EnNiwGirl_Update(Actor* thisx, PlayState* play) {
this->interactInfo.trackPos.y = player->actor.world.pos.y - 10.0f; this->interactInfo.trackPos.y = player->actor.world.pos.y - 10.0f;
} }
Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY);
this->unk_260 = this->interactInfo.headRot; this->headRot = this->interactInfo.headRot;
this->unk_266 = this->interactInfo.torsoRot; this->torsoRot = this->interactInfo.torsoRot;
} else { } else {
Math_SmoothStepToS(&this->unk_266.y, 0, 5, 3000, 0); Math_SmoothStepToS(&this->torsoRot.y, 0, 5, 3000, 0);
Math_SmoothStepToS(&this->unk_260.y, 0, 5, 3000, 0); Math_SmoothStepToS(&this->headRot.y, 0, 5, 3000, 0);
Math_SmoothStepToS(&this->unk_260.z, 0, 5, 3000, 0); Math_SmoothStepToS(&this->headRot.z, 0, 5, 3000, 0);
} }
if (this->blinkTimer != 0) { if (this->blinkTimer != 0) {
this->blinkTimer--; this->blinkTimer--;
@ -236,11 +236,11 @@ s32 EnNiwGirlOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
EnNiwGirl* this = (EnNiwGirl*)thisx; EnNiwGirl* this = (EnNiwGirl*)thisx;
if (limbIndex == 3) { if (limbIndex == 3) {
rot->x += this->unk_266.y; rot->x += this->torsoRot.y;
} }
if (limbIndex == 4) { if (limbIndex == 4) {
rot->x += this->unk_260.y; rot->x += this->headRot.y;
rot->z += this->unk_260.z; rot->z += this->headRot.z;
} }
return false; return false;
} }

View file

@ -15,8 +15,8 @@ typedef struct EnNiwGirl {
/* 0x0190 */ Vec3s jointTable[17]; /* 0x0190 */ Vec3s jointTable[17];
/* 0x01F6 */ Vec3s morphTable[17]; /* 0x01F6 */ Vec3s morphTable[17];
/* 0x025C */ EnNiwGirlActionFunc actionFunc; /* 0x025C */ EnNiwGirlActionFunc actionFunc;
/* 0x0260 */ Vec3s unk_260; /* 0x0260 */ Vec3s headRot;
/* 0x0266 */ Vec3s unk_266; /* 0x0266 */ Vec3s torsoRot;
/* 0x026C */ s16 jumpTimer; // Controls how many frames she jumps for and how long until she jumps again /* 0x026C */ s16 jumpTimer; // Controls how many frames she jumps for and how long until she jumps again
/* 0x026E */ s16 unkUpTimer; /* 0x026E */ s16 unkUpTimer;
/* 0x0270 */ s16 unk_270; /* 0x0270 */ s16 unk_270;

View file

@ -518,10 +518,10 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
this->interactInfo.trackPos.y = player->actor.world.pos.y - 10.0f; this->interactInfo.trackPos.y = player->actor.world.pos.y - 10.0f;
} }
Npc_TrackPoint(thisx, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); Npc_TrackPoint(thisx, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY);
this->unk_254 = this->interactInfo.headRot; this->headRot = this->interactInfo.headRot;
this->unk_25A = this->interactInfo.torsoRot; this->torsoRot = this->interactInfo.torsoRot;
if (this->unk_276 == 0) { if (this->unk_276 == 0) {
Math_SmoothStepToS(&this->unk_254.y, 0, 5, 3000, 0); Math_SmoothStepToS(&this->headRot.y, 0, 5, 3000, 0);
} }
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectOsAnimeIndex].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectOsAnimeIndex].segment);
if (this->objectOsAnimeIndex >= 0) { if (this->objectOsAnimeIndex >= 0) {
@ -570,11 +570,11 @@ s32 EnNiwLady_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
s32 pad; s32 pad;
if (limbIndex == 15) { if (limbIndex == 15) {
rot->x += this->unk_254.y; rot->x += this->headRot.y;
rot->z += this->unk_254.x; rot->z += this->headRot.x;
} }
if (limbIndex == 8) { if (limbIndex == 8) {
rot->x += this->unk_25A.y; rot->x += this->torsoRot.y;
} }
if (this->unk_275 != 0) { if (this->unk_275 != 0) {
if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) { if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) {

View file

@ -14,8 +14,8 @@ typedef struct EnNiwLady {
/* 0x0190 */ Vec3s jointTable[16]; /* 0x0190 */ Vec3s jointTable[16];
/* 0x01F0 */ Vec3s morphTable[16]; /* 0x01F0 */ Vec3s morphTable[16];
/* 0x0250 */ EnNiwLadyActionFunc actionFunc; /* 0x0250 */ EnNiwLadyActionFunc actionFunc;
/* 0x0254 */ Vec3s unk_254; /* 0x0254 */ Vec3s headRot;
/* 0x025A */ Vec3s unk_25A; /* 0x025A */ Vec3s torsoRot;
/* 0x0260 */ s16 unusedTimer; /* 0x0260 */ s16 unusedTimer;
/* 0x0262 */ s16 unk_262; // "message_end_code" /* 0x0262 */ s16 unk_262; // "message_end_code"
/* 0x0264 */ s16 unusedTimer2; /* 0x0264 */ s16 unusedTimer2;

View file

@ -33,7 +33,7 @@ typedef struct EnPoField {
/* 0x019C */ Vec3s jointTable[10]; /* 0x019C */ Vec3s jointTable[10];
/* 0x01D8 */ Vec3s morphTable[10]; /* 0x01D8 */ Vec3s morphTable[10];
/* 0x0214 */ Color_RGBA8 lightColor; /* 0x0214 */ Color_RGBA8 lightColor;
/* 0x0214 */ Color_RGBA8 soulColor; /* 0x0218 */ Color_RGBA8 soulColor;
/* 0x021C */ f32 scaleModifier; /* 0x021C */ f32 scaleModifier;
/* 0x0220 */ f32 flameScale; /* 0x0220 */ f32 flameScale;
/* 0x0224 */ Vec3f flamePosition; /* 0x0224 */ Vec3f flamePosition;

View file

@ -126,7 +126,7 @@ void EnPoRelay_Destroy(Actor* thisx, PlayState* play) {
} }
void EnPoRelay_SetupIdle(EnPoRelay* this) { void EnPoRelay_SetupIdle(EnPoRelay* this) {
this->unk_195 = 32; this->bobTimer = 32;
this->pathIndex = 0; this->pathIndex = 0;
this->actor.room = -1; this->actor.room = -1;
this->actor.shape.rot.y = 0; this->actor.shape.rot.y = 0;
@ -149,7 +149,7 @@ void EnPoRelay_SetupRace(EnPoRelay* this) {
Interface_SetTimer(0); Interface_SetTimer(0);
this->hookshotSlotFull = this->hookshotSlotFull =
(INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE && !IS_RANDO) || (IS_RANDO && Flags_GetTreasure(gPlayState, 0x1E)); (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE && !IS_RANDO) || (IS_RANDO && Flags_GetTreasure(gPlayState, 0x1E));
this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); this->yawTowardsPathPoint = Actor_WorldYawTowardPoint(&this->actor, &vec);
this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH);
this->actionFunc = EnPoRelay_Race; this->actionFunc = EnPoRelay_Race;
@ -164,7 +164,7 @@ void EnPoRelay_SetupEndRace(EnPoRelay* this) {
void EnPoRelay_CorrectY(EnPoRelay* this) { void EnPoRelay_CorrectY(EnPoRelay* this) {
Math_StepToF(&this->actor.home.pos.y, D_80AD8C30[(this->pathIndex >= 28) ? 27 : this->pathIndex].y + 45.0f, 2.0f); Math_StepToF(&this->actor.home.pos.y, D_80AD8C30[(this->pathIndex >= 28) ? 27 : this->pathIndex].y + 45.0f, 2.0f);
this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 8.0f + this->actor.home.pos.y; this->actor.world.pos.y = Math_SinS(this->bobTimer * 0x800) * 8.0f + this->actor.home.pos.y;
} }
void EnPoRelay_Idle(EnPoRelay* this, PlayState* play) { void EnPoRelay_Idle(EnPoRelay* this, PlayState* play) {
@ -213,12 +213,12 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) {
speed = 30.0f * multiplier; speed = 30.0f * multiplier;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HONOTRAP, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HONOTRAP,
Math_CosS(this->unk_19A) * speed + this->actor.world.pos.x, this->actor.world.pos.y, Math_CosS(this->yawTowardsPathPoint) * speed + this->actor.world.pos.x, this->actor.world.pos.y,
Math_SinS(this->unk_19A) * speed + this->actor.world.pos.z, 0, Math_SinS(this->yawTowardsPathPoint) * speed + this->actor.world.pos.z, 0,
(this->unk_19A + 0x8000) - (0x2000 * multiplier), 0, HONOTRAP_FLAME_DROP); (this->yawTowardsPathPoint + 0x8000) - (0x2000 * multiplier), 0, HONOTRAP_FLAME_DROP);
} }
} }
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_19A, 2, 0x1000, 0x100); Math_SmoothStepToS(&this->actor.world.rot.y, this->yawTowardsPathPoint, 2, 0x1000, 0x100);
this->actor.shape.rot.y = this->actor.world.rot.y + (this->actionTimer * 0x800) + 0x8000; this->actor.shape.rot.y = this->actor.world.rot.y + (this->actionTimer * 0x800) + 0x8000;
if (this->pathIndex < 23) { if (this->pathIndex < 23) {
// If the player travels along a different path to Dampé that converges later // If the player travels along a different path to Dampé that converges later
@ -264,7 +264,7 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) {
Flags_SetSwitch(play, 0x37); Flags_SetSwitch(play, 0x37);
} }
} }
this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); this->yawTowardsPathPoint = Actor_WorldYawTowardPoint(&this->actor, &vec);
func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG);
} }
@ -394,11 +394,11 @@ void EnPoRelay_Update(Actor* thisx, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider); Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
Actor_SetFocus(&this->actor, 50.0f); Actor_SetFocus(&this->actor, 50.0f);
if (this->unk_195 != 0) { if (this->bobTimer != 0) {
this->unk_195 -= 1; this->bobTimer -= 1;
} }
if (this->unk_195 == 0) { if (this->bobTimer == 0) {
this->unk_195 = 32; this->bobTimer = 32;
} }
this->eyeTextureIdx++; this->eyeTextureIdx++;
if (this->eyeTextureIdx == 3) { if (this->eyeTextureIdx == 3) {

View file

@ -13,10 +13,10 @@ typedef struct EnPoRelay {
/* 0x014C */ SkelAnime skelAnime; /* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnPoRelayActionFunc actionFunc; /* 0x0190 */ EnPoRelayActionFunc actionFunc;
/* 0x0194 */ u8 hookshotSlotFull; /* 0x0194 */ u8 hookshotSlotFull;
/* 0x0195 */ u8 unk_195; /* 0x0195 */ u8 bobTimer;
/* 0x0196 */ s16 actionTimer; /* 0x0196 */ s16 actionTimer;
/* 0x0198 */ s16 pathIndex; /* 0x0198 */ s16 pathIndex;
/* 0x019A */ s16 unk_19A; /* 0x019A */ s16 yawTowardsPathPoint;
/* 0x019C */ u16 textId; /* 0x019C */ u16 textId;
/* 0x019E */ u16 eyeTextureIdx; /* 0x019E */ u16 eyeTextureIdx;
/* 0x01A0 */ Vec3s jointTable[18]; /* 0x01A0 */ Vec3s jointTable[18];

View file

@ -24,7 +24,7 @@ typedef struct {
/* 0x0000 */ Color_RGB8 primColor; /* 0x0000 */ Color_RGB8 primColor;
/* 0x0003 */ Color_RGB8 lightColor; /* 0x0003 */ Color_RGB8 lightColor;
/* 0x0006 */ u8 unk_6; // limb index /* 0x0006 */ u8 unk_6; // limb index
/* 0x0006 */ u8 unk_7; // limb index /* 0x0007 */ u8 unk_7; // limb index
/* 0x0008 */ s8 unk_8; // rate of some kind /* 0x0008 */ s8 unk_8; // rate of some kind
/* 0x000C */ AnimationHeader* idleAnim; /* 0x000C */ AnimationHeader* idleAnim;
/* 0x0010 */ AnimationHeader* idleAnim2; /* 0x0010 */ AnimationHeader* idleAnim2;

View file

@ -46,7 +46,7 @@ void EnPubox_Init(Actor* thisx, PlayState* play) {
default: default:
break; break;
} }
this->unk_164 = 1; this->unused_164 = 1;
thisx->colChkInfo.cylRadius = 20; thisx->colChkInfo.cylRadius = 20;
thisx->colChkInfo.cylHeight = 50; thisx->colChkInfo.cylHeight = 50;
thisx->uncullZoneDownward = 1200.0f; thisx->uncullZoneDownward = 1200.0f;

View file

@ -8,7 +8,7 @@ struct EnPubox;
typedef struct EnPubox { typedef struct EnPubox {
/* 0x0000 */ DynaPolyActor dyna; /* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ u32 unk_164; /* 0x0164 */ u32 unused_164;
} EnPubox; // size = 0x0168 } EnPubox; // size = 0x0168
#endif #endif

View file

@ -132,13 +132,13 @@ void EnRd_Init(Actor* thisx, PlayState* play) {
thisx->targetMode = 0; thisx->targetMode = 0;
thisx->colChkInfo.damageTable = &sDamageTable; thisx->colChkInfo.damageTable = &sDamageTable;
ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f);
this->unk_310 = this->unk_30E = 0; this->upperBodyYRotation = this->headYRotation = 0;
thisx->focus.pos = thisx->world.pos; thisx->focus.pos = thisx->world.pos;
thisx->focus.pos.y += 50.0f; thisx->focus.pos.y += 50.0f;
thisx->colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.mass = MASS_HEAVY;
thisx->colChkInfo.health = 8; thisx->colChkInfo.health = 8;
this->unk_314 = this->unk_31D = 0xFF; this->alpha = this->unk_31D = 0xFF;
this->unk_312 = (thisx->params & 0xFF00) >> 8; this->rdFlags = (thisx->params & 0xFF00) >> 8;
if (thisx->params & 0x80) { if (thisx->params & 0x80) {
thisx->params |= 0xFF00; thisx->params |= 0xFF00;
@ -208,8 +208,8 @@ void func_80AE269C(EnRd* this) {
Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadSobbingAnim); Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadSobbingAnim);
} }
this->unk_31B = 0; this->action = 0;
this->unk_30C = (Rand_ZeroOne() * 10.0f) + 5.0f; this->timer = (Rand_ZeroOne() * 10.0f) + 5.0f;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
EnRd_SetupAction(this, func_80AE2744); EnRd_SetupAction(this, func_80AE2744);
@ -217,8 +217,8 @@ void func_80AE269C(EnRd* this) {
void func_80AE2744(EnRd* this, PlayState* play) { void func_80AE2744(EnRd* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x64, 0);
if ((this->actor.params == 2) && (0.0f == this->skelAnime.curFrame)) { if ((this->actor.params == 2) && (0.0f == this->skelAnime.curFrame)) {
if (Rand_ZeroOne() >= 0.5f) { if (Rand_ZeroOne() >= 0.5f) {
@ -227,15 +227,15 @@ void func_80AE2744(EnRd* this, PlayState* play) {
Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadWipingTearsAnim); Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadWipingTearsAnim);
} }
} else { } else {
this->unk_30C--; this->timer--;
if (this->unk_30C == 0) { if (this->timer == 0) {
this->unk_30C = (Rand_ZeroOne() * 10.0f) + 10.0f; this->timer = (Rand_ZeroOne() * 10.0f) + 10.0f;
this->skelAnime.curFrame = 0.0f; this->skelAnime.curFrame = 0.0f;
} }
} }
if (this->actor.parent != NULL) { if (this->actor.parent != NULL) {
if (this->unk_305 == 0) { if (this->isMourning == 0) {
if (this->actor.params != 2) { if (this->actor.params != 2) {
func_80AE31DC(this); func_80AE31DC(this);
} else { } else {
@ -243,7 +243,7 @@ void func_80AE2744(EnRd* this, PlayState* play) {
} }
} }
} else { } else {
if (this->unk_305 != 0) { if (this->isMourning != 0) {
if (this->actor.params != 2) { if (this->actor.params != 2) {
func_80AE37BC(this); func_80AE37BC(this);
} else { } else {
@ -251,7 +251,7 @@ void func_80AE2744(EnRd* this, PlayState* play) {
} }
} }
this->unk_305 = 0; this->isMourning = 0;
if (this->actor.xzDistToPlayer <= 150.0f && func_8002DDE4(play)) { if (this->actor.xzDistToPlayer <= 150.0f && func_8002DDE4(play)) {
// Add a height check to redeads/gibdos freeze when Enemy Randomizer is on. // Add a height check to redeads/gibdos freeze when Enemy Randomizer is on.
@ -261,7 +261,7 @@ void func_80AE2744(EnRd* this, PlayState* play) {
(CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0)); (CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0));
if (!enemyRandoCCActive || if (!enemyRandoCCActive ||
(enemyRandoCCActive && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) { (enemyRandoCCActive && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) {
if ((this->actor.params != 2) && (this->unk_305 == 0)) { if ((this->actor.params != 2) && (this->isMourning == 0)) {
func_80AE37BC(this); func_80AE37BC(this);
} else { } else {
func_80AE392C(this); func_80AE392C(this);
@ -278,8 +278,8 @@ void func_80AE2744(EnRd* this, PlayState* play) {
void func_80AE2970(EnRd* this) { void func_80AE2970(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadIdleAnim, 0, 0, Animation_GetLastFrame(&gGibdoRedeadIdleAnim), Animation_Change(&this->skelAnime, &gGibdoRedeadIdleAnim, 0, 0, Animation_GetLastFrame(&gGibdoRedeadIdleAnim),
ANIMMODE_LOOP, -6.0f); ANIMMODE_LOOP, -6.0f);
this->unk_31B = 11; this->action = 11;
this->unk_30C = 6; this->timer = 6;
this->actor.shape.rot.x = -0x4000; this->actor.shape.rot.x = -0x4000;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.shape.yOffset = 0.0f; this->actor.shape.yOffset = 0.0f;
@ -300,8 +300,8 @@ void func_80AE2A10(EnRd* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY);
} }
if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) { if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) {
if (this->unk_30C != 0) { if (this->timer != 0) {
this->unk_30C--; this->timer--;
Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.3f, 1.0f, 0.3f); Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.3f, 1.0f, 0.3f);
} else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.3f, 1.0f, 0.3f) == 0.0f) { } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.3f, 1.0f, 0.3f) == 0.0f) {
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0); Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0);
@ -314,7 +314,7 @@ void func_80AE2B90(EnRd* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, Animation_GetLastFrame(&gGibdoRedeadWalkAnim), Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
ANIMMODE_LOOP_INTERP, -4.0f); ANIMMODE_LOOP_INTERP, -4.0f);
this->actor.speedXZ = 0.4f; this->actor.speedXZ = 0.4f;
this->unk_31B = 4; this->action = 4;
EnRd_SetupAction(this, func_80AE2C1C); EnRd_SetupAction(this, func_80AE2C1C);
} }
@ -324,12 +324,12 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
Color_RGBA8 sp3C = D_80AE4928; Color_RGBA8 sp3C = D_80AE4928;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s32 pad; s32 pad;
s16 sp32 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_30E - this->unk_310; s16 sp32 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headYRotation - this->upperBodyYRotation;
this->skelAnime.playSpeed = this->actor.speedXZ; this->skelAnime.playSpeed = this->actor.speedXZ;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0);
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x64, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -342,15 +342,15 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
(PLAYER_STATE1_DEAD | PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE | (PLAYER_STATE1_DEAD | PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE |
PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL | PLAYER_STATE1_CLIMBING_LADDER)) && PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL | PLAYER_STATE1_CLIMBING_LADDER)) &&
!(player->stateFlags2 & PLAYER_STATE2_GRABBED_BY_ENEMY)) { !(player->stateFlags2 & PLAYER_STATE2_GRABBED_BY_ENEMY)) {
if (this->unk_306 == 0) { if (this->playerStunWaitTimer == 0) {
if (!(this->unk_312 & PLAYER_STATE2_GRABBED_BY_ENEMY) && if (!(this->rdFlags & PLAYER_STATE2_GRABBED_BY_ENEMY) &&
GameInteractor_Should(VB_REDEAD_GIBDO_FREEZE_LINK, true, this)) { GameInteractor_Should(VB_REDEAD_GIBDO_FREEZE_LINK, true, this)) {
player->actor.freezeTimer = 40; player->actor.freezeTimer = 40;
Player_SetAutoLockOnActor(play, &this->actor); Player_SetAutoLockOnActor(play, &this->actor);
GET_PLAYER(play)->autoLockOnActor = &this->actor; GET_PLAYER(play)->autoLockOnActor = &this->actor;
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
} }
this->unk_306 = 0x3C; this->playerStunWaitTimer = 0x3C;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
} }
} else { } else {
@ -358,11 +358,11 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
} }
} }
if (this->unk_307 != 0) { if (this->grabWaitTimer != 0) {
this->unk_307--; this->grabWaitTimer--;
} }
if (!this->unk_307 && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 45.0f) && if (!this->grabWaitTimer && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 45.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x38E3)) { Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
player->actor.freezeTimer = 0; player->actor.freezeTimer = 0;
if (play->grabPlayer(play, player)) { if (play->grabPlayer(play, player)) {
@ -373,7 +373,7 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
if (this->actor.parent != NULL) { if (this->actor.parent != NULL) {
func_80AE31DC(this); func_80AE31DC(this);
} else { } else {
this->unk_305 = 0; this->isMourning = 0;
} }
} }
@ -387,7 +387,7 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
void func_80AE2F50(EnRd* this, PlayState* play) { void func_80AE2F50(EnRd* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0, Animation_GetLastFrame(&gGibdoRedeadWalkAnim), Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
ANIMMODE_LOOP_INTERP, -4.0f); ANIMMODE_LOOP_INTERP, -4.0f);
this->unk_31B = 2; this->action = 2;
EnRd_SetupAction(this, func_80AE2FD0); EnRd_SetupAction(this, func_80AE2FD0);
} }
@ -409,8 +409,8 @@ void func_80AE2FD0(EnRd* this, PlayState* play) {
} }
} }
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x64, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -424,7 +424,7 @@ void func_80AE2FD0(EnRd* this, PlayState* play) {
if (this->actor.parent != NULL) { if (this->actor.parent != NULL) {
func_80AE31DC(this); func_80AE31DC(this);
} else { } else {
this->unk_305 = 0; this->isMourning = 0;
} }
} }
@ -438,8 +438,8 @@ void func_80AE2FD0(EnRd* this, PlayState* play) {
void func_80AE31DC(EnRd* this) { void func_80AE31DC(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0, Animation_GetLastFrame(&gGibdoRedeadWalkAnim), Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
ANIMMODE_LOOP_INTERP, -4.0f); ANIMMODE_LOOP_INTERP, -4.0f);
this->unk_31B = 3; this->action = 3;
this->unk_305 = 1; this->isMourning = 1;
EnRd_SetupAction(this, func_80AE3260); EnRd_SetupAction(this, func_80AE3260);
} }
@ -465,8 +465,8 @@ void func_80AE3260(EnRd* this, PlayState* play) {
} }
} }
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x64, 0);
} else { } else {
func_80AE2B90(this, play); func_80AE2B90(this, play);
} }
@ -483,9 +483,9 @@ void func_80AE3260(EnRd* this, PlayState* play) {
void func_80AE33F0(EnRd* this) { void func_80AE33F0(EnRd* this) {
Animation_PlayOnce(&this->skelAnime, &gGibdoRedeadGrabStartAnim); Animation_PlayOnce(&this->skelAnime, &gGibdoRedeadGrabStartAnim);
this->unk_30C = this->unk_304 = 0; this->timer = this->grabState = 0;
this->unk_319 = 200; this->grabDamageTimer = 200;
this->unk_31B = 8; this->action = 8;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
EnRd_SetupAction(this, func_80AE3454); EnRd_SetupAction(this, func_80AE3454);
} }
@ -495,25 +495,25 @@ void func_80AE3454(EnRd* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
this->unk_304++; this->grabState++;
} }
switch (this->unk_304) { switch (this->grabState) {
case 1: case 1:
Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadGrabAttackAnim); Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadGrabAttackAnim);
this->unk_304++; this->grabState++;
play->damagePlayer(play, -8); play->damagePlayer(play, -8);
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 1, 0xC); func_800AA000(this->actor.xzDistToPlayer, 0xFF, 1, 0xC);
this->unk_319 = 20; this->grabDamageTimer = 20;
case 0: case 0:
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x5DC, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x5DC, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x5DC, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x5DC, 0);
case 2: case 2:
if (!(player->stateFlags2 & 0x80)) { if (!(player->stateFlags2 & 0x80)) {
Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f,
Animation_GetLastFrame(&gGibdoRedeadGrabEndAnim), ANIMMODE_ONCE_INTERP, 0.0f); Animation_GetLastFrame(&gGibdoRedeadGrabEndAnim), ANIMMODE_ONCE_INTERP, 0.0f);
this->unk_304++; this->grabState++;
this->unk_31B = 4; this->action = 4;
return; return;
} }
@ -533,12 +533,12 @@ void func_80AE3454(EnRd* this, PlayState* play) {
if (this->skelAnime.curFrame == 0.0f) { if (this->skelAnime.curFrame == 0.0f) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_ATTACK); Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_ATTACK);
} }
this->unk_319--; this->grabDamageTimer--;
if (this->unk_319 == 0) { if (this->grabDamageTimer == 0) {
play->damagePlayer(play, -8); play->damagePlayer(play, -8);
func_800AA000(this->actor.xzDistToPlayer, 0xF0, 1, 0xC); func_800AA000(this->actor.xzDistToPlayer, 0xF0, 1, 0xC);
this->unk_319 = 20; this->grabDamageTimer = 20;
Player_PlaySfx(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92); Player_PlaySfx(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92);
} }
break; break;
@ -553,8 +553,8 @@ void func_80AE3454(EnRd* this, PlayState* play) {
} }
this->actor.targetMode = 0; this->actor.targetMode = 0;
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
this->unk_306 = 0xA; this->playerStunWaitTimer = 0xA;
this->unk_307 = 0xF; this->grabWaitTimer = 0xF;
func_80AE2B90(this, play); func_80AE2B90(this, play);
break; break;
} }
@ -563,7 +563,7 @@ void func_80AE3454(EnRd* this, PlayState* play) {
void func_80AE37BC(EnRd* this) { void func_80AE37BC(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f,
Animation_GetLastFrame(&gGibdoRedeadLookBackAnim), ANIMMODE_ONCE, 0.0f); Animation_GetLastFrame(&gGibdoRedeadLookBackAnim), ANIMMODE_ONCE, 0.0f);
this->unk_31B = 7; this->action = 7;
EnRd_SetupAction(this, func_80AE3834); EnRd_SetupAction(this, func_80AE3834);
} }
@ -572,10 +572,11 @@ void func_80AE3834(EnRd* this, PlayState* play) {
Color_RGBA8 sp30 = D_80AE4938; Color_RGBA8 sp30 = D_80AE4938;
Color_RGBA8 sp2C = D_80AE493C; Color_RGBA8 sp2C = D_80AE493C;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s16 temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_30E - this->unk_310; s16 temp_v0 =
this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headYRotation - this->upperBodyYRotation;
if (ABS(temp_v0) < 0x2008) { if (ABS(temp_v0) < 0x2008) {
if (!(this->unk_312 & 0x80) && GameInteractor_Should(VB_REDEAD_GIBDO_FREEZE_LINK, true, this)) { if (!(this->rdFlags & 0x80) && GameInteractor_Should(VB_REDEAD_GIBDO_FREEZE_LINK, true, this)) {
player->actor.freezeTimer = 60; player->actor.freezeTimer = 60;
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
Player_SetAutoLockOnActor(play, &this->actor); Player_SetAutoLockOnActor(play, &this->actor);
@ -587,7 +588,7 @@ void func_80AE3834(EnRd* this, PlayState* play) {
void func_80AE392C(EnRd* this) { void func_80AE392C(EnRd* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadStandUpAnim, -4.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadStandUpAnim, -4.0f);
this->unk_31B = 5; this->action = 5;
EnRd_SetupAction(this, func_80AE3978); EnRd_SetupAction(this, func_80AE3978);
} }
@ -604,7 +605,7 @@ void func_80AE3978(EnRd* this, PlayState* play) {
void func_80AE39D4(EnRd* this) { void func_80AE39D4(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadStandUpAnim, -1.0f, Animation_Change(&this->skelAnime, &gGibdoRedeadStandUpAnim, -1.0f,
Animation_GetLastFrame(&gGibdoRedeadStandUpAnim), 0.0f, ANIMMODE_ONCE, -4.0f); Animation_GetLastFrame(&gGibdoRedeadStandUpAnim), 0.0f, ANIMMODE_ONCE, -4.0f);
this->unk_31B = 6; this->action = 6;
EnRd_SetupAction(this, func_80AE3A54); EnRd_SetupAction(this, func_80AE3A54);
} }
@ -623,7 +624,7 @@ void func_80AE3A8C(EnRd* this) {
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
this->unk_31B = 9; this->action = 9;
EnRd_SetupAction(this, func_80AE3B18); EnRd_SetupAction(this, func_80AE3B18);
} }
@ -635,8 +636,8 @@ void func_80AE3B18(EnRd* this, PlayState* play) {
} }
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x12C, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x12C, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x12C, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x12C, 0);
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
@ -654,8 +655,8 @@ void func_80AE3B18(EnRd* this, PlayState* play) {
void func_80AE3C20(EnRd* this) { void func_80AE3C20(EnRd* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f);
this->unk_31B = 10; this->action = 10;
this->unk_30C = 300; this->timer = 300;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD);
@ -668,28 +669,28 @@ void func_80AE3C98(EnRd* this, PlayState* play) {
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
} }
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x7D0, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x7D0, 0);
Math_SmoothStepToS(&this->unk_310, 0, 1, 0x7D0, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x7D0, 0);
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
if (this->unk_30C == 0) { if (this->timer == 0) {
s8 enemyRandoCCActive = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || s8 enemyRandoCCActive = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) ||
(CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0)); (CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0));
// Don't set this flag in Enemy Rando as it can overlap with other objects using the same flag. // Don't set this flag in Enemy Rando as it can overlap with other objects using the same flag.
if (!Flags_GetSwitch(play, this->unk_312 & 0x7F) && !enemyRandoCCActive) { if (!Flags_GetSwitch(play, this->rdFlags & 0x7F) && !enemyRandoCCActive) {
Flags_SetSwitch(play, this->unk_312 & 0x7F); Flags_SetSwitch(play, this->rdFlags & 0x7F);
} }
if (this->unk_314 != 0) { if (this->alpha != 0) {
if (this->unk_314 == 0xB4) { if (this->alpha == 0xB4) {
func_80AE2630(play, &this->actor, 0); func_80AE2630(play, &this->actor, 0);
} }
this->actor.scale.y -= 0.000075f; this->actor.scale.y -= 0.000075f;
this->unk_314 -= 5; this->alpha -= 5;
} else { } else {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
} else { } else {
this->unk_30C--; this->timer--;
} }
} else if (((s32)this->skelAnime.curFrame == 33) || ((s32)this->skelAnime.curFrame == 40)) { } else if (((s32)this->skelAnime.curFrame == 33) || ((s32)this->skelAnime.curFrame == 40)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
@ -697,15 +698,15 @@ void func_80AE3C98(EnRd* this, PlayState* play) {
} }
void func_80AE3DE4(EnRd* this) { void func_80AE3DE4(EnRd* this) {
this->unk_31B = 1; this->action = 1;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) { if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
this->unk_318 = 1; this->stunnedBySunsSong = 1;
this->unk_316 = 0x258; this->sunsSongStunTimer = 0x258;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT);
Actor_SetColorFilter(&this->actor, -0x8000, -0x7F38, 0, 0xFF); Actor_SetColorFilter(&this->actor, -0x8000, -0x7F38, 0, 0xFF);
} else if (this->unk_31C == 1) { } else if (this->damageReaction == 1) {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x50); Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x50);
} else { } else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT);
@ -715,13 +716,13 @@ void func_80AE3DE4(EnRd* this) {
} }
void func_80AE3ECC(EnRd* this, PlayState* play) { void func_80AE3ECC(EnRd* this, PlayState* play) {
if ((this->unk_318 != 0) && (this->unk_316 != 0)) { if ((this->stunnedBySunsSong != 0) && (this->sunsSongStunTimer != 0)) {
this->unk_316--; this->sunsSongStunTimer--;
if (this->unk_316 >= 0xFF) { if (this->sunsSongStunTimer >= 0xFF) {
Actor_SetColorFilter(&this->actor, -0x8000, 0xC8, 0, 0xFF); Actor_SetColorFilter(&this->actor, -0x8000, 0xC8, 0, 0xFF);
} }
if (this->unk_316 == 0) { if (this->sunsSongStunTimer == 0) {
this->unk_318 = 0; this->stunnedBySunsSong = 0;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE; gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
} }
} }
@ -742,57 +743,57 @@ void func_80AE3F9C(EnRd* this, PlayState* play) {
s16 temp2; s16 temp2;
s16 temp3; s16 temp3;
temp1 = this->actor.yawTowardsPlayer - (s16)(this->actor.shape.rot.y + this->unk_310); temp1 = this->actor.yawTowardsPlayer - (s16)(this->actor.shape.rot.y + this->upperBodyYRotation);
temp2 = CLAMP(temp1, -500, 500); temp2 = CLAMP(temp1, -500, 500);
temp1 -= this->unk_30E; temp1 -= this->headYRotation;
temp3 = CLAMP(temp1, -500, 500); temp3 = CLAMP(temp1, -500, 500);
if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) { if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) {
this->unk_310 += ABS(temp2); this->upperBodyYRotation += ABS(temp2);
this->unk_30E += ABS(temp3); this->headYRotation += ABS(temp3);
} else { } else {
this->unk_310 -= ABS(temp2); this->upperBodyYRotation -= ABS(temp2);
this->unk_30E -= ABS(temp3); this->headYRotation -= ABS(temp3);
} }
this->unk_310 = CLAMP(this->unk_310, -18783, 18783); this->upperBodyYRotation = CLAMP(this->upperBodyYRotation, -18783, 18783);
this->unk_30E = CLAMP(this->unk_30E, -9583, 9583); this->headYRotation = CLAMP(this->headYRotation, -9583, 9583);
} }
void func_80AE4114(EnRd* this, PlayState* play) { void func_80AE4114(EnRd* this, PlayState* play) {
s32 pad; s32 pad;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (this->actor.shape.rot.x == 0) && (this->unk_318 == 0) && if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (this->actor.shape.rot.x == 0) &&
(this->unk_31B != 9) && (this->unk_31B != 10) && (this->unk_31B != 1)) { (this->stunnedBySunsSong == 0) && (this->action != 9) && (this->action != 10) && (this->action != 1)) {
func_80AE3DE4(this); func_80AE3DE4(this);
return; return;
} }
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT; this->collider.base.acFlags &= ~AC_HIT;
this->unk_31C = this->actor.colChkInfo.damageEffect; this->damageReaction = this->actor.colChkInfo.damageEffect;
if (this->unk_31B != 11) { if (this->action != 11) {
Actor_SetDropFlag(&this->actor, &this->collider.info, 1); Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
if (player->unk_844 != 0) { if (player->unk_844 != 0) {
this->unk_31D = player->unk_845; this->unk_31D = player->unk_845;
} }
if ((this->unk_31C != 0) && (this->unk_31C != 6)) { if ((this->damageReaction != 0) && (this->damageReaction != 6)) {
if (((this->unk_31C == 1) || (this->unk_31C == 13)) && (this->unk_31B != 1)) { if (((this->damageReaction == 1) || (this->damageReaction == 13)) && (this->action != 1)) {
Actor_ApplyDamage(&this->actor); Actor_ApplyDamage(&this->actor);
func_80AE3DE4(this); func_80AE3DE4(this);
return; return;
} }
this->unk_318 = 0; this->stunnedBySunsSong = 0;
this->unk_316 = 0; this->sunsSongStunTimer = 0;
if (this->unk_31C == 0xE) { if (this->damageReaction == 0xE) {
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x50); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x50);
this->unk_31A = 0x28; this->fireTimer = 0x28;
} else { } else {
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
} }
@ -818,25 +819,25 @@ void EnRd_Update(Actor* thisx, PlayState* play) {
func_80AE4114(this, play); func_80AE4114(this, play);
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE && this->unk_318 == 0) { if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE && this->stunnedBySunsSong == 0) {
gSaveContext.sunsSongState = SUNSSONG_INACTIVE; gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
} }
if (this->unk_31C != 6 && ((this->unk_31B != 11) || (this->unk_31C != 14))) { if (this->damageReaction != 6 && ((this->action != 11) || (this->damageReaction != 14))) {
if (this->unk_306 != 0) { if (this->playerStunWaitTimer != 0) {
this->unk_306--; this->playerStunWaitTimer--;
} }
this->actionFunc(this, play); this->actionFunc(this, play);
if (this->unk_31B != 8 && this->actor.speedXZ != 0.0f) { if (this->action != 8 && this->actor.speedXZ != 0.0f) {
Actor_MoveXZGravity(&this->actor); Actor_MoveXZGravity(&this->actor);
} }
if ((this->actor.shape.rot.x == 0) && (this->unk_31B != 8) && (this->actor.speedXZ != 0.0f)) { if ((this->actor.shape.rot.x == 0) && (this->action != 8) && (this->actor.speedXZ != 0.0f)) {
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D);
} }
if (this->unk_31B == 7) { if (this->action == 7) {
func_80AE3F9C(this, play); func_80AE3F9C(this, play);
} }
} }
@ -844,10 +845,10 @@ void EnRd_Update(Actor* thisx, PlayState* play) {
this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 50.0f; this->actor.focus.pos.y += 50.0f;
if ((this->actor.colChkInfo.health > 0) && (this->unk_31B != 8)) { if ((this->actor.colChkInfo.health > 0) && (this->action != 8)) {
Collider_UpdateCylinder(&this->actor, &this->collider); Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if ((this->unk_31B != 9) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_31D))) { if ((this->action != 9) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_31D))) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
} }
} }
@ -857,9 +858,9 @@ s32 EnRd_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
EnRd* this = (EnRd*)thisx; EnRd* this = (EnRd*)thisx;
if (limbIndex == 23) { if (limbIndex == 23) {
rot->y += this->unk_30E; rot->y += this->headYRotation;
} else if (limbIndex == 12) { } else if (limbIndex == 12) {
rot->y += this->unk_310; rot->y += this->upperBodyYRotation;
} }
return false; return false;
} }
@ -870,7 +871,7 @@ void EnRd_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
s32 idx = -1; s32 idx = -1;
Vec3f destPos; Vec3f destPos;
if ((this->unk_31A != 0) || ((this->actor.colorFilterTimer != 0) && (this->actor.colorFilterParams & 0x4000))) { if ((this->fireTimer != 0) || ((this->actor.colorFilterTimer != 0) && (this->actor.colorFilterParams & 0x4000))) {
switch (limbIndex - 1) { switch (limbIndex - 1) {
case 23: case 23:
idx = 0; idx = 0;
@ -920,31 +921,31 @@ void EnRd_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
if (this->unk_314 == 0xFF) { if (this->alpha == 0xFF) {
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->unk_314); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->alpha);
gSPSegment(POLY_OPA_DISP++, 8, &D_80116280[2]); gSPSegment(POLY_OPA_DISP++, 8, &D_80116280[2]);
POLY_OPA_DISP = POLY_OPA_DISP =
SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnRd_OverrideLimbDraw, EnRd_PostLimbDraw, this, POLY_OPA_DISP); EnRd_OverrideLimbDraw, EnRd_PostLimbDraw, this, POLY_OPA_DISP);
func_80033C30(&thisPos, &D_80AE4958, 255, play); func_80033C30(&thisPos, &D_80AE4958, 255, play);
if (this->unk_31A != 0) { if (this->fireTimer != 0) {
thisx->colorFilterTimer++; thisx->colorFilterTimer++;
this->unk_31A--; this->fireTimer--;
if (this->unk_31A % 4 == 0) { if (this->fireTimer % 4 == 0) {
EffectSsEnFire_SpawnVec3s(play, thisx, &this->firePos[this->unk_31A >> 2], 0x4B, 0, 0, EffectSsEnFire_SpawnVec3s(play, thisx, &this->firePos[this->fireTimer >> 2], 0x4B, 0, 0,
(this->unk_31A >> 2)); (this->fireTimer >> 2));
} }
} }
} else { } else {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_314); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
gSPSegment(POLY_XLU_DISP++, 8, &D_80116280[0]); gSPSegment(POLY_XLU_DISP++, 8, &D_80116280[0]);
POLY_XLU_DISP = POLY_XLU_DISP =
SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnRd_OverrideLimbDraw, NULL, this, POLY_XLU_DISP); EnRd_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
func_80033C30(&thisPos, &D_80AE4958, this->unk_314, play); func_80033C30(&thisPos, &D_80AE4958, this->alpha, play);
} }
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);

View file

@ -14,22 +14,22 @@ typedef struct EnRd {
/* 0x0188 */ SkelAnime skelAnime; /* 0x0188 */ SkelAnime skelAnime;
/* 0x01CC */ Vec3s jointTable[26]; /* 0x01CC */ Vec3s jointTable[26];
/* 0x0268 */ Vec3s morphTable[26]; /* 0x0268 */ Vec3s morphTable[26];
/* 0x0304 */ u8 unk_304; /* 0x0304 */ u8 grabState;
/* 0x0305 */ u8 unk_305; /* 0x0305 */ u8 isMourning;
/* 0x0306 */ u8 unk_306; /* 0x0306 */ u8 playerStunWaitTimer;
/* 0x0307 */ u8 unk_307; /* 0x0307 */ u8 grabWaitTimer;
/* 0x0308 */ EnRdActionFunc actionFunc; /* 0x0308 */ EnRdActionFunc actionFunc;
/* 0x030C */ s16 unk_30C; /* 0x030C */ s16 timer;
/* 0x030E */ s16 unk_30E; /* 0x030E */ s16 headYRotation;
/* 0x0310 */ s16 unk_310; /* 0x0310 */ s16 upperBodyYRotation;
/* 0x0312 */ s16 unk_312; /* 0x0312 */ s16 rdFlags;
/* 0x0314 */ s16 unk_314; /* 0x0314 */ s16 alpha;
/* 0x0316 */ s16 unk_316; /* 0x0316 */ s16 sunsSongStunTimer;
/* 0x0318 */ u8 unk_318; /* 0x0318 */ u8 stunnedBySunsSong;
/* 0x0319 */ u8 unk_319; /* 0x0319 */ u8 grabDamageTimer;
/* 0x031A */ u8 unk_31A; /* 0x031A */ u8 fireTimer;
/* 0x031B */ u8 unk_31B; /* 0x031B */ u8 action;
/* 0x031C */ u8 unk_31C; /* 0x031C */ u8 damageReaction;
/* 0x031D */ u8 unk_31D; /* 0x031D */ u8 unk_31D;
/* 0x0320 */ ColliderCylinder collider; /* 0x0320 */ ColliderCylinder collider;
} EnRd; // size = 0x036C } EnRd; // size = 0x036C

View file

@ -131,7 +131,7 @@ void EnReeba_Init(Actor* thisx, PlayState* play) {
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
} }
this->actor.shape.yOffset = this->unk_284 = this->scale * -27500.0f; this->actor.shape.yOffset = this->yOffsetTarget = this->scale * -27500.0f;
ActorShape_Init(&this->actor.shape, this->actor.shape.yOffset, ActorShadow_DrawCircle, 0.0f); ActorShape_Init(&this->actor.shape, this->actor.shape.yOffset, ActorShadow_DrawCircle, 0.0f);
this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.damageTable = &sDamageTable;
Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D);
@ -177,12 +177,12 @@ void func_80AE4F40(EnReeba* this, PlayState* play) {
Animation_Change(&this->skelanime, &object_reeba_Anim_0001E4, 2.0f, 0.0f, frames, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelanime, &object_reeba_Anim_0001E4, 2.0f, 0.0f, frames, ANIMMODE_LOOP, -10.0f);
playerSpeed = fabsf(player->linearVelocity); playerSpeed = fabsf(player->linearVelocity);
this->unk_278 = 20 - playerSpeed * 2; this->waitTimer = 20 - playerSpeed * 2;
if (this->unk_278 < 0) { if (this->waitTimer < 0) {
this->unk_278 = 2; this->waitTimer = 2;
} }
if (this->unk_278 > 20) { if (this->waitTimer > 20) {
this->unk_278 = 20; this->waitTimer = 20;
} }
this->actor.flags &= ~ACTOR_FLAG_LOCK_ON_DISABLED; this->actor.flags &= ~ACTOR_FLAG_LOCK_ON_DISABLED;
@ -208,17 +208,17 @@ void func_80AE5054(EnReeba* this, PlayState* play) {
500, 10, true); 500, 10, true);
} }
if (this->unk_278 == 0) { if (this->waitTimer == 0) {
Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 1.0f, 1.0f); Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 1.0f, 1.0f);
if (this->actor.shape.yOffset < 0.0f) { if (this->actor.shape.yOffset < 0.0f) {
Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, this->unk_288); Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, this->yOffsetStep);
Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f); Math_ApproachF(&this->yOffsetStep, 300.0f, 1.0f, 5.0f);
} else { } else {
this->unk_288 = 0.0f; this->yOffsetStep = 0.0f;
this->actor.shape.yOffset = 0.0f; this->actor.shape.yOffset = 0.0f;
playerLinearVel = player->linearVelocity; playerLinearVel = player->linearVelocity;
switch (this->unk_280) { switch (this->aimType) {
case 0: case 0:
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
break; break;
@ -239,7 +239,7 @@ void func_80AE5054(EnReeba* this, PlayState* play) {
if (this->isBig) { if (this->isBig) {
this->actionfunc = func_80AE538C; this->actionfunc = func_80AE538C;
} else { } else {
this->unk_272 = 130; this->moveTimer = 130;
this->actor.speedXZ = Rand_ZeroFloat(4.0f) + 6.0f; this->actor.speedXZ = Rand_ZeroFloat(4.0f) + 6.0f;
this->actionfunc = func_80AE5270; this->actionfunc = func_80AE5270;
} }
@ -261,12 +261,12 @@ void func_80AE5270(EnReeba* this, PlayState* play) {
if ((surfaceType != 4) && (surfaceType != 7)) { if ((surfaceType != 4) && (surfaceType != 7)) {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actionfunc = func_80AE5688; this->actionfunc = func_80AE5688;
} else if ((this->unk_272 == 0) || (this->actor.xzDistToPlayer < 30.0f) || (this->actor.xzDistToPlayer > 400.0f) || } else if ((this->moveTimer == 0) || (this->actor.xzDistToPlayer < 30.0f) ||
(this->actor.bgCheckFlags & 8)) { (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) {
this->actionfunc = func_80AE5688; this->actionfunc = func_80AE5688;
} else if (this->unk_274 == 0) { } else if (this->sfxTimer == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE);
this->unk_274 = 10; this->sfxTimer = 10;
} }
} }
@ -293,8 +293,8 @@ void func_80AE53AC(EnReeba* this, PlayState* play) {
(this->actor.bgCheckFlags & 8)) { (this->actor.bgCheckFlags & 8)) {
this->actionfunc = func_80AE5688; this->actionfunc = func_80AE5688;
} else { } else {
if ((this->actor.xzDistToPlayer < 70.0f) && (this->unk_270 == 0)) { if ((this->actor.xzDistToPlayer < 70.0f) && (this->bigLeeverTimer == 0)) {
this->unk_270 = 30; this->bigLeeverTimer = 30;
} }
speed = (this->actor.xzDistToPlayer - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f); speed = (this->actor.xzDistToPlayer - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f);
@ -306,14 +306,14 @@ void func_80AE53AC(EnReeba* this, PlayState* play) {
this->actor.speedXZ = -3.0f; this->actor.speedXZ = -3.0f;
} }
yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsPlayer : -this->actor.yawTowardsPlayer; yawDiff = (this->bigLeeverTimer == 0) ? this->actor.yawTowardsPlayer : -this->actor.yawTowardsPlayer;
yawDiff -= this->actor.world.rot.y; yawDiff -= this->actor.world.rot.y;
yaw = (yawDiff > 0) ? ((yawDiff / 31.0f) + 10.0f) : ((yawDiff / 31.0f) - 10.0f); yaw = (yawDiff > 0) ? ((yawDiff / 31.0f) + 10.0f) : ((yawDiff / 31.0f) - 10.0f);
this->actor.world.rot.y += yaw * 2.0f; this->actor.world.rot.y += yaw * 2.0f;
if (this->unk_274 == 0) { if (this->sfxTimer == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE);
this->unk_274 = 20; this->sfxTimer = 20;
} }
} }
} }
@ -321,7 +321,7 @@ void func_80AE53AC(EnReeba* this, PlayState* play) {
void func_80AE561C(EnReeba* this, PlayState* play) { void func_80AE561C(EnReeba* this, PlayState* play) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.3f); Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.3f);
if (this->unk_272 == 0) { if (this->moveTimer == 0) {
if (this->isBig) { if (this->isBig) {
this->actionfunc = func_80AE538C; this->actionfunc = func_80AE538C;
} else { } else {
@ -331,7 +331,7 @@ void func_80AE561C(EnReeba* this, PlayState* play) {
} }
void func_80AE5688(EnReeba* this, PlayState* play) { void func_80AE5688(EnReeba* this, PlayState* play) {
this->unk_27E = 0; this->stunType = 0;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED;
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE);
@ -343,21 +343,21 @@ void func_80AE56E0(EnReeba* this, PlayState* play) {
Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.3f); Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.3f);
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
if ((this->unk_284 + 10.0f) <= this->actor.shape.yOffset) { if ((this->yOffsetTarget + 10.0f) <= this->actor.shape.yOffset) {
if ((play->gameplayFrames % 4) == 0) { if ((play->gameplayFrames % 4) == 0) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f,
500, 10, true); 500, 10, true);
} }
Math_ApproachF(&this->actor.shape.yOffset, this->unk_284, 1.0f, this->unk_288); Math_ApproachF(&this->actor.shape.yOffset, this->yOffsetTarget, 1.0f, this->yOffsetStep);
Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f); Math_ApproachF(&this->yOffsetStep, 300.0f, 1.0f, 5.0f);
} else { } else {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
} }
void func_80AE57F0(EnReeba* this, PlayState* play) { void func_80AE57F0(EnReeba* this, PlayState* play) {
this->unk_276 = 14; this->damagedTimer = 14;
this->actor.speedXZ = -8.0f; this->actor.speedXZ = -8.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
@ -371,9 +371,9 @@ void func_80AE5854(EnReeba* this, PlayState* play) {
this->actor.speedXZ += 1.0f; this->actor.speedXZ += 1.0f;
} }
if (this->unk_276 == 0) { if (this->damagedTimer == 0) {
if (this->isBig) { if (this->isBig) {
this->unk_270 = 30; this->bigLeeverTimer = 30;
this->actionfunc = func_80AE538C; this->actionfunc = func_80AE538C;
} else { } else {
this->actionfunc = func_80AE5688; this->actionfunc = func_80AE5688;
@ -382,7 +382,7 @@ void func_80AE5854(EnReeba* this, PlayState* play) {
} }
void func_80AE58EC(EnReeba* this, PlayState* play) { void func_80AE58EC(EnReeba* this, PlayState* play) {
this->unk_278 = 14; this->waitTimer = 14;
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = -8.0f; this->actor.speedXZ = -8.0f;
this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED;
@ -394,15 +394,15 @@ void func_80AE5938(EnReeba* this, PlayState* play) {
Vec3f pos; Vec3f pos;
f32 scale; f32 scale;
if (this->unk_278 != 0) { if (this->waitTimer != 0) {
if (this->actor.speedXZ < 0.0f) { if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 1.0f; this->actor.speedXZ += 1.0f;
} }
} else { } else {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
if ((this->unk_27E == 4) || (this->actor.colChkInfo.health != 0)) { if ((this->stunType == 4) || (this->actor.colChkInfo.health != 0)) {
if (this->unk_27E == 2) { if (this->stunType == 2) {
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f);
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f); pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f);
@ -415,10 +415,10 @@ void func_80AE5938(EnReeba* this, PlayState* play) {
EffectSsEnIce_SpawnFlyingVec3f(play, &this->actor, &pos, 150, 150, 150, 250, 235, 245, 255, scale); EffectSsEnIce_SpawnFlyingVec3f(play, &this->actor, &pos, 150, 150, 150, 250, 235, 245, 255, scale);
} }
this->unk_278 = 66; this->waitTimer = 66;
this->actionfunc = func_80AE5E48; this->actionfunc = func_80AE5E48;
} else { } else {
this->unk_278 = 30; this->waitTimer = 30;
this->actionfunc = func_80AE5A9C; this->actionfunc = func_80AE5A9C;
} }
} }
@ -428,8 +428,8 @@ void func_80AE5A9C(EnReeba* this, PlayState* play) {
Vec3f pos; Vec3f pos;
f32 scale; f32 scale;
if (this->unk_278 != 0) { if (this->waitTimer != 0) {
if ((this->unk_27E == 2) && ((this->unk_278 & 0xF) == 0)) { if ((this->stunType == 2) && ((this->waitTimer & 0xF) == 0)) {
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f);
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f); pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f);
@ -453,7 +453,7 @@ void func_80AE5BC4(EnReeba* this, PlayState* play) {
this->actor.speedXZ = -8.0f; this->actor.speedXZ = -8.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->unk_278 = 14; this->waitTimer = 14;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actionfunc = func_80AE5C38; this->actionfunc = func_80AE5C38;
} }
@ -463,7 +463,7 @@ void func_80AE5C38(EnReeba* this, PlayState* play) {
Vec3f accel = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f };
Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f velocity = { 0.0f, 0.0f, 0.0f };
if (this->unk_278 != 0) { if (this->waitTimer != 0) {
if (this->actor.speedXZ < 0.0f) { if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 1.0f; this->actor.speedXZ += 1.0f;
} }
@ -507,11 +507,11 @@ void func_80AE5C38(EnReeba* this, PlayState* play) {
} }
void func_80AE5E48(EnReeba* this, PlayState* play) { void func_80AE5E48(EnReeba* this, PlayState* play) {
if (this->unk_278 < 37) { if (this->waitTimer < 37) {
this->actor.shape.rot.x = Rand_CenteredFloat(3000.0f); this->actor.shape.rot.x = Rand_CenteredFloat(3000.0f);
this->actor.shape.rot.z = Rand_CenteredFloat(3000.0f); this->actor.shape.rot.z = Rand_CenteredFloat(3000.0f);
if (this->unk_278 == 0) { if (this->waitTimer == 0) {
if (this->isBig) { if (this->isBig) {
this->actionfunc = func_80AE538C; this->actionfunc = func_80AE538C;
} else { } else {
@ -527,28 +527,28 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) {
if ((this->actionfunc != func_80AE5C38) && (this->actionfunc != func_80AE5854)) { if ((this->actionfunc != func_80AE5C38) && (this->actionfunc != func_80AE5854)) {
this->actor.shape.rot.x = this->actor.shape.rot.z = 0; this->actor.shape.rot.x = this->actor.shape.rot.z = 0;
this->unk_27E = 0; this->stunType = 0;
switch (this->actor.colChkInfo.damageEffect) { switch (this->actor.colChkInfo.damageEffect) {
case 11: // none case 11: // none
case 12: // boomerang case 12: // boomerang
if ((this->actor.colChkInfo.health > 1) && (this->unk_27E != 4)) { if ((this->actor.colChkInfo.health > 1) && (this->stunType != 4)) {
this->unk_27E = 4; this->stunType = 4;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50);
this->actionfunc = func_80AE58EC; this->actionfunc = func_80AE58EC;
break; break;
} }
case 13: // hookshot/longshot case 13: // hookshot/longshot
if ((this->actor.colChkInfo.health > 2) && (this->unk_27E != 4)) { if ((this->actor.colChkInfo.health > 2) && (this->stunType != 4)) {
this->unk_27E = 4; this->stunType = 4;
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actionfunc = func_80AE58EC; this->actionfunc = func_80AE58EC;
break; break;
} }
case 14: case 14:
this->unk_27C = 6; this->unkDamageField = 6;
Actor_ApplyDamage(&this->actor); Actor_ApplyDamage(&this->actor);
if (this->actor.colChkInfo.health == 0) { if (this->actor.colChkInfo.health == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_DEAD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_DEAD);
@ -564,14 +564,14 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) {
break; break;
case 3: // ice arrows/ice magic case 3: // ice arrows/ice magic
Actor_ApplyDamage(&this->actor); Actor_ApplyDamage(&this->actor);
this->unk_27C = 2; this->unkDamageField = 2;
this->unk_27E = 2; this->stunType = 2;
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80); Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80);
this->actionfunc = func_80AE58EC; this->actionfunc = func_80AE58EC;
break; break;
case 1: // unknown case 1: // unknown
if (this->unk_27E != 4) { if (this->stunType != 4) {
this->unk_27E = 4; this->stunType = 4;
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80); Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80);
this->actionfunc = func_80AE58EC; this->actionfunc = func_80AE58EC;
} }
@ -590,24 +590,24 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) {
this->actionfunc(this, play); this->actionfunc(this, play);
Actor_SetScale(&this->actor, this->scale); Actor_SetScale(&this->actor, this->scale);
if (this->unk_270 != 0) { if (this->bigLeeverTimer != 0) {
this->unk_270--; this->bigLeeverTimer--;
} }
if (this->unk_272 != 0) { if (this->moveTimer != 0) {
this->unk_272--; this->moveTimer--;
} }
if (this->unk_278 != 0) { if (this->waitTimer != 0) {
this->unk_278--; this->waitTimer--;
} }
if (this->unk_274 != 0) { if (this->sfxTimer != 0) {
this->unk_274--; this->sfxTimer--;
} }
if (this->unk_276 != 0) { if (this->damagedTimer != 0) {
this->unk_276--; this->damagedTimer--;
} }
Actor_MoveXZGravity(&this->actor); Actor_MoveXZGravity(&this->actor);
@ -619,7 +619,7 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) {
if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) { if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) {
this->actor.speedXZ = 8.0f; this->actor.speedXZ = 8.0f;
this->actor.world.rot.y *= -1.0f; this->actor.world.rot.y *= -1.0f;
this->unk_272 = 14; this->moveTimer = 14;
this->actionfunc = func_80AE561C; this->actionfunc = func_80AE561C;
return; return;
} }

View file

@ -15,17 +15,17 @@ typedef struct EnReeba {
/* 0x01FC */ Vec3s morphTable[18]; /* 0x01FC */ Vec3s morphTable[18];
/* 0x0268 */ char unk_268[0x4]; /* 0x0268 */ char unk_268[0x4];
/* 0x026C */ EnReebaActionFunc actionfunc; /* 0x026C */ EnReebaActionFunc actionfunc;
/* 0x0270 */ s16 unk_270; /* 0x0270 */ s16 bigLeeverTimer;
/* 0x0272 */ s16 unk_272; /* 0x0272 */ s16 moveTimer;
/* 0x0274 */ s16 unk_274; /* 0x0274 */ s16 sfxTimer;
/* 0x0276 */ s16 unk_276; /* 0x0276 */ s16 damagedTimer;
/* 0x0278 */ s16 unk_278; /* 0x0278 */ s16 waitTimer;
/* 0x027A */ s16 isBig; /* 0x027A */ s16 isBig;
/* 0x027C */ s16 unk_27C; /* 0x027C */ s16 unkDamageField;
/* 0x027E */ s16 unk_27E; /* 0x027E */ s16 stunType;
/* 0x0280 */ s16 unk_280; /* 0x0280 */ s16 aimType;
/* 0x0284 */ f32 unk_284; /* 0x0284 */ f32 yOffsetTarget;
/* 0x0288 */ f32 unk_288; /* 0x0288 */ f32 yOffsetStep;
/* 0x028C */ f32 scale; /* 0x028C */ f32 scale;
/* 0x0290 */ ColliderCylinder collider; /* 0x0290 */ ColliderCylinder collider;
} EnReeba; // size = 0x02DC } EnReeba; // size = 0x02DC

View file

@ -157,10 +157,10 @@ void func_80AEAC54(EnRu1* this, PlayState* play) {
s32 pad[5]; s32 pad[5];
Collider_UpdateCylinder(&this->actor, &this->collider2); Collider_UpdateCylinder(&this->actor, &this->collider2);
if (this->unk_34C != 0) { if (this->isSittingOCActive != 0) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider2.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider2.base);
} else if (this->actor.xzDistToPlayer > 32.0f) { } else if (this->actor.xzDistToPlayer > 32.0f) {
this->unk_34C = 1; this->isSittingOCActive = 1;
} }
} }
@ -187,7 +187,7 @@ void EnRu1_DestroyColliders(EnRu1* this, PlayState* play) {
} }
void func_80AEADD8(EnRu1* this) { void func_80AEADD8(EnRu1* this) {
this->unk_34C = 0; this->isSittingOCActive = 0;
} }
u8 func_80AEADE0(EnRu1* this) { u8 func_80AEADE0(EnRu1* this) {
@ -437,10 +437,10 @@ void EnRu1_SpawnRipple(EnRu1* this, PlayState* play, s16 radiusMax, s16 life) {
} }
void func_80AEB50C(EnRu1* this, PlayState* play) { void func_80AEB50C(EnRu1* this, PlayState* play) {
this->unk_270 += 1.0f; this->treadTimer += 1.0f;
if (this->unk_270 >= kREG(3) + 10.0f) { if (this->treadTimer >= kREG(3) + 10.0f) {
EnRu1_SpawnRipple(this, play, kREG(1) + 500, 0); EnRu1_SpawnRipple(this, play, kREG(1) + 500, 0);
this->unk_270 = 0.0f; this->treadTimer = 0.0f;
} }
} }
@ -548,7 +548,7 @@ void func_80AEBA0C(EnRu1* this, PlayState* play) {
void func_80AEBA2C(EnRu1* this, PlayState* play) { void func_80AEBA2C(EnRu1* this, PlayState* play) {
s32 pad; s32 pad;
Vec3f* unk_364 = &this->unk_364; Vec3f* unk_364 = &this->treadStartPos;
Vec3f* thisPos; Vec3f* thisPos;
f32 temp_ret_2; f32 temp_ret_2;
CsCmdActorCue* csCmdNPCAction = func_80AEB438(play); CsCmdActorCue* csCmdNPCAction = func_80AEB438(play);
@ -670,7 +670,7 @@ void func_80AEBF60(EnRu1* this, PlayState* play) {
if (func_80AEB480(play, 6)) { if (func_80AEB480(play, 6)) {
func_80AEB7D0(this); func_80AEB7D0(this);
this->action = 5; this->action = 5;
this->unk_364 = this->actor.world.pos; this->treadStartPos = this->actor.world.pos;
} else { } else {
func_80AEBA0C(this, play); func_80AEBA0C(this, play);
} }
@ -791,7 +791,7 @@ void func_80AEC320(EnRu1* this, PlayState* play) {
} }
void func_80AEC40C(EnRu1* this) { void func_80AEC40C(EnRu1* this) {
f32 unk_26C = this->unk_26C; f32 unk_26C = this->walkingFrame;
if (unk_26C < 8.0f) { if (unk_26C < 8.0f) {
this->actor.speedXZ = (((kREG(3) * 0.01f) + 2.7f) / 8.0f) * unk_26C; this->actor.speedXZ = (((kREG(3) * 0.01f) + 2.7f) / 8.0f) * unk_26C;
@ -809,9 +809,9 @@ void func_80AEC4CC(EnRu1* this) {
void func_80AEC4F4(EnRu1* this) { void func_80AEC4F4(EnRu1* this) {
f32* speedXZ = &this->actor.speedXZ; f32* speedXZ = &this->actor.speedXZ;
f32* unk_26C = &this->unk_26C; f32* unk_26C = &this->walkingFrame;
if (this->unk_26C < 8.0f) { if (this->walkingFrame < 8.0f) {
*unk_26C += 1.0f; *unk_26C += 1.0f;
*speedXZ *= (8.0f - *unk_26C) / 8.0f; *speedXZ *= (8.0f - *unk_26C) / 8.0f;
this->actor.velocity.y = -*unk_26C * (((kREG(4) * 0.01f) + 13.0f) / 8.0f); this->actor.velocity.y = -*unk_26C * (((kREG(4) * 0.01f) + 13.0f) / 8.0f);
@ -836,7 +836,7 @@ s32 func_80AEC5FC(EnRu1* this, PlayState* play) {
void func_80AEC650(EnRu1* this) { void func_80AEC650(EnRu1* this) {
s32 pad[2]; s32 pad[2];
if (this->unk_280 == 0) { if (this->isFalling == 0) {
if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) {
Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT);
} }
@ -849,10 +849,10 @@ void func_80AEC6B0(EnRu1* this) {
} }
void func_80AEC6E4(EnRu1* this, PlayState* play) { void func_80AEC6E4(EnRu1* this, PlayState* play) {
if ((func_80AEAFA0(play, 4, 3)) && (this->unk_280 == 0)) { if ((func_80AEAFA0(play, 4, 3)) && (this->isFalling == 0)) {
Animation_Change(&this->skelAnime, &gRutoChildBringArmsUpAnim, 1.0f, 0, Animation_Change(&this->skelAnime, &gRutoChildBringArmsUpAnim, 1.0f, 0,
Animation_GetLastFrame(&gRutoChildBringArmsUpAnim), ANIMMODE_ONCE, -8.0f); Animation_GetLastFrame(&gRutoChildBringArmsUpAnim), ANIMMODE_ONCE, -8.0f);
this->unk_280 = 1; this->isFalling = 1;
func_80AEC6B0(this); func_80AEC6B0(this);
} }
} }
@ -907,15 +907,15 @@ void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) {
ANIMMODE_LOOP, -8.0f); ANIMMODE_LOOP, -8.0f);
this->actor.world.rot.y += 0x8000; this->actor.world.rot.y += 0x8000;
this->action = 0xB; this->action = 0xB;
this->unk_26C = 0.0f; this->walkingFrame = 0.0f;
} }
} }
void func_80AEC9C4(EnRu1* this) { void func_80AEC9C4(EnRu1* this) {
this->unk_26C += 1.0f; this->walkingFrame += 1.0f;
if (this->unk_26C >= 8.0f) { if (this->walkingFrame >= 8.0f) {
this->action = 12; this->action = 12;
this->unk_26C = 0.0f; this->walkingFrame = 0.0f;
this->actor.velocity.y = -1.0f; this->actor.velocity.y = -1.0f;
} }
} }
@ -923,7 +923,7 @@ void func_80AEC9C4(EnRu1* this) {
void func_80AECA18(EnRu1* this) { void func_80AECA18(EnRu1* this) {
if (!(this->actor.bgCheckFlags & 1)) { if (!(this->actor.bgCheckFlags & 1)) {
this->action = 13; this->action = 13;
this->unk_26C = 0.0f; this->walkingFrame = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
} }
} }
@ -1030,7 +1030,7 @@ void func_80AECE20(EnRu1* this, PlayState* play) {
Vec3f* playerPos = &player->actor.world.pos; Vec3f* playerPos = &player->actor.world.pos;
s16 shapeRotY = player->actor.shape.rot.y; s16 shapeRotY = player->actor.shape.rot.y;
s32 pad; s32 pad;
f32 unk_27C = this->unk_27C; f32 unk_27C = this->xzDistToPlayerInBlueWarp;
Vec3f* pos = &this->actor.world.pos; Vec3f* pos = &this->actor.world.pos;
pos->x = (Math_SinS(shapeRotY) * unk_27C) + playerPos->x; pos->x = (Math_SinS(shapeRotY) * unk_27C) + playerPos->x;
@ -1058,8 +1058,8 @@ s32 func_80AECF6C(EnRu1* this, PlayState* play) {
f32 temp2; f32 temp2;
s32 pad2[5]; s32 pad2[5];
this->unk_26C += 1.0f; this->walkingFrame += 1.0f;
if ((player->actor.speedXZ == 0.0f) && (this->unk_26C >= 3.0f)) { if ((player->actor.speedXZ == 0.0f) && (this->walkingFrame >= 3.0f)) {
otherPlayer = GET_PLAYER(play); otherPlayer = GET_PLAYER(play);
player->actor.world.pos.x = otherPlayer->unk_450.x; player->actor.world.pos.x = otherPlayer->unk_450.x;
player->actor.world.pos.y = otherPlayer->unk_450.y; player->actor.world.pos.y = otherPlayer->unk_450.y;
@ -1114,7 +1114,7 @@ void func_80AED110(EnRu1* this) {
void func_80AED154(EnRu1* this, PlayState* play) { void func_80AED154(EnRu1* this, PlayState* play) {
if (func_80AED084(this, WARP_BLUE_RUTO_STATE_ENTERED)) { if (func_80AED084(this, WARP_BLUE_RUTO_STATE_ENTERED)) {
this->action = 0x13; this->action = 0x13;
this->unk_26C = 0.0f; this->walkingFrame = 0.0f;
func_80AECEB4(this, play); func_80AECEB4(this, play);
} }
} }
@ -1139,7 +1139,7 @@ void func_80AED218(EnRu1* this, UNK_TYPE arg1) {
Animation_Change(&this->skelAnime, &gRutoChildWaitInBlueWarpAnim, 1.0f, 0, Animation_Change(&this->skelAnime, &gRutoChildWaitInBlueWarpAnim, 1.0f, 0,
Animation_GetLastFrame(&gRutoChildWaitInBlueWarpAnim), ANIMMODE_ONCE, -8.0f); Animation_GetLastFrame(&gRutoChildWaitInBlueWarpAnim), ANIMMODE_ONCE, -8.0f);
this->action = 21; this->action = 21;
this->unk_27C = this->actor.xzDistToPlayer; this->xzDistToPlayerInBlueWarp = this->actor.xzDistToPlayer;
} }
} }
@ -1294,28 +1294,28 @@ void func_80AED83C(EnRu1* this) {
void func_80AED8DC(EnRu1* this) { void func_80AED8DC(EnRu1* this) {
s32 temp_hi; s32 temp_hi;
s16* unk_2AC = &this->unk_2AC; s16* unk_2AC = &this->headRotTimer;
s16* someY = &this->interactInfo.headRot.y; s16* someY = &this->interactInfo.headRot.y;
s16* unk_29E = &this->unk_29E; s16* unk_29E = &this->headTurnSpeed;
s32 pad[2]; s32 pad[2];
if (DECR(*unk_2AC) == 0) { if (DECR(*unk_2AC) == 0) {
*unk_2AC = Rand_S16Offset(0xA, 0x19); *unk_2AC = Rand_S16Offset(0xA, 0x19);
temp_hi = *unk_2AC % 5; temp_hi = *unk_2AC % 5;
if (temp_hi == 0) { if (temp_hi == 0) {
this->unk_2B0 = 1; this->headRotDirection = 1;
} else if (temp_hi == 1) { } else if (temp_hi == 1) {
this->unk_2B0 = 2; this->headRotDirection = 2;
} else { } else {
this->unk_2B0 = 0; this->headRotDirection = 0;
} }
*unk_29E = 0; *unk_29E = 0;
} }
if (this->unk_2B0 == 0) { if (this->headRotDirection == 0) {
Math_SmoothStepToS(unk_29E, 0 - *someY, 1, 0x190, 0x190); Math_SmoothStepToS(unk_29E, 0 - *someY, 1, 0x190, 0x190);
Math_SmoothStepToS(someY, 0, 3, ABS(*unk_29E), 0x64); Math_SmoothStepToS(someY, 0, 3, ABS(*unk_29E), 0x64);
} else if (this->unk_2B0 == 1) { } else if (this->headRotDirection == 1) {
Math_SmoothStepToS(unk_29E, -0x2AAA - *someY, 1, 0x190, 0x190); Math_SmoothStepToS(unk_29E, -0x2AAA - *someY, 1, 0x190, 0x190);
Math_SmoothStepToS(someY, -0x2AAA, 3, ABS(*unk_29E), 0x64); Math_SmoothStepToS(someY, -0x2AAA, 3, ABS(*unk_29E), 0x64);
} else { } else {
@ -1458,13 +1458,13 @@ void func_80AEE050(EnRu1* this) {
f32 temp_f10; f32 temp_f10;
EnRu1* thisx = this; // necessary to match EnRu1* thisx = this; // necessary to match
if (this->unk_350 == 0) { if (this->waterState == 0) {
if ((this->actor.minVelocityY == 0.0f) && (this->actor.speedXZ == 0.0f)) { if ((this->actor.minVelocityY == 0.0f) && (this->actor.speedXZ == 0.0f)) {
this->unk_350 = 1; this->waterState = 1;
func_80AEE02C(this); func_80AEE02C(this);
this->unk_35C = 0; this->bobPhase = 0;
this->unk_358 = (this->actor.yDistToWater - 10.0f) * 0.5f; this->bobDepth = (this->actor.yDistToWater - 10.0f) * 0.5f;
this->unk_354 = this->actor.world.pos.y + thisx->unk_358; // thisx only used here this->sinkingStartPosY = this->actor.world.pos.y + thisx->bobDepth; // thisx only used here
} else { } else {
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.minVelocityY *= 0.2f; this->actor.minVelocityY *= 0.2f;
@ -1482,23 +1482,23 @@ void func_80AEE050(EnRu1* this) {
Actor_UpdatePos(&this->actor); Actor_UpdatePos(&this->actor);
} }
} else { } else {
if (this->unk_350 == 1) { if (this->waterState == 1) {
if (this->unk_358 <= 1.0f) { if (this->bobDepth <= 1.0f) {
func_80AEE02C(this); func_80AEE02C(this);
this->unk_350 = 2; this->waterState = 2;
this->unk_360 = 0.0f; this->isSinking = 0.0f;
} else { } else {
sp28 = this->unk_358; sp28 = this->bobDepth;
sp24 = this->unk_354; sp24 = this->sinkingStartPosY;
temp_f10 = Math_CosS(this->unk_35C) * -sp28; temp_f10 = Math_CosS(this->bobPhase) * -sp28;
this->actor.world.pos.y = temp_f10 + sp24; this->actor.world.pos.y = temp_f10 + sp24;
this->unk_35C += 0x3E8; this->bobPhase += 0x3E8;
this->unk_358 *= 0.95f; this->bobDepth *= 0.95f;
} }
} else { } else {
this->unk_360 += 1.0f; this->isSinking += 1.0f;
if (this->unk_360 > 0.0f) { if (this->isSinking > 0.0f) {
this->unk_350 = 3; this->waterState = 3;
} }
} }
} }
@ -1591,7 +1591,7 @@ void func_80AEE568(EnRu1* this, PlayState* play) {
func_80AEADD8(this); func_80AEADD8(this);
} else if (this->actor.yDistToWater > 0.0f) { } else if (this->actor.yDistToWater > 0.0f) {
this->action = 29; this->action = 29;
this->unk_350 = 0; this->waterState = 0;
} }
} }
} }
@ -1622,7 +1622,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) {
Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f); Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f);
func_80AED600(this); func_80AED600(this);
this->action = 34; this->action = 34;
this->unk_26C = 0.0f; this->walkingFrame = 0.0f;
play->csCtx.segment = &D_80AF1728; play->csCtx.segment = &D_80AF1728;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
} }
@ -1637,7 +1637,7 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) {
f32 frameCount; f32 frameCount;
s32 pad[13]; s32 pad[13];
Player* player; Player* player;
f32* unk_370 = &this->unk_370; f32* unk_370 = &this->carryIdleTimer;
if (Actor_HasNoParent(&this->actor, play)) { if (Actor_HasNoParent(&this->actor, play)) {
frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim);
@ -1660,7 +1660,7 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) {
player = GET_PLAYER(play); player = GET_PLAYER(play);
if (player->stateFlags2 & PLAYER_STATE2_IDLE_FIDGET) { if (player->stateFlags2 & PLAYER_STATE2_IDLE_FIDGET) {
this->unk_370 += 1.0f; this->carryIdleTimer += 1.0f;
if (this->action != 32) { if (this->action != 32) {
if (*unk_370 > 30.0f) { if (*unk_370 > 30.0f) {
if (Rand_S16Offset(0, 3) == 0) { if (Rand_S16Offset(0, 3) == 0) {
@ -1699,7 +1699,7 @@ s32 func_80AEEAC8(EnRu1* this, PlayState* play) {
} }
void func_80AEEB24(EnRu1* this, PlayState* play) { void func_80AEEB24(EnRu1* this, PlayState* play) {
if ((func_80AEEAC8(this, play) == 0) && (this->unk_350 == 3)) { if ((func_80AEEAC8(this, play) == 0) && (this->waterState == 3)) {
this->action = 30; this->action = 30;
func_80AEE02C(this); func_80AEE02C(this);
this->actor.gravity = -0.1f; this->actor.gravity = -0.1f;
@ -2295,11 +2295,12 @@ s32 EnRu1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
Gfx** gfx) { Gfx** gfx) {
EnRu1* this = (EnRu1*)thisx; EnRu1* this = (EnRu1*)thisx;
if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*sPreLimbDrawFuncs[this->unk_290] == NULL)) { if ((this->preLimbDrawIndex < 0) || (this->preLimbDrawIndex > 0) ||
(*sPreLimbDrawFuncs[this->preLimbDrawIndex] == NULL)) {
// "Neck rotation mode is improper!" // "Neck rotation mode is improper!"
osSyncPrintf(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
} else { } else {
sPreLimbDrawFuncs[this->unk_290](this, play, limbIndex, rot); sPreLimbDrawFuncs[this->preLimbDrawIndex](this, play, limbIndex, rot);
} }
return false; return false;
} }

View file

@ -23,37 +23,37 @@ typedef struct EnRu1 {
/* 0x0260 */ s16 mouthIndex; /* 0x0260 */ s16 mouthIndex;
/* 0x0264 */ s32 action; /* 0x0264 */ s32 action;
/* 0x0268 */ s32 drawConfig; /* 0x0268 */ s32 drawConfig;
/* 0x026C */ f32 unk_26C; /* 0x026C */ f32 walkingFrame;
/* 0x0270 */ f32 unk_270; /* 0x0270 */ f32 treadTimer;
/* 0x0274 */ char unk_274[0x4]; /* 0x0274 */ char unk_274[0x4];
/* 0x0278 */ DoorWarp1* blueWarp; /* 0x0278 */ DoorWarp1* blueWarp;
/* 0x027C */ f32 unk_27C; /* 0x027C */ f32 xzDistToPlayerInBlueWarp;
/* 0x0280 */ s32 unk_280; /* 0x0280 */ s32 isFalling;
/* 0x0284 */ s8 roomNum1; /* 0x0284 */ s8 roomNum1;
/* 0x0285 */ s8 roomNum2; /* 0x0285 */ s8 roomNum2;
/* 0x0286 */ s8 roomNum3; /* 0x0286 */ s8 roomNum3;
/* 0x0288 */ f32 unk_288; /* 0x0288 */ f32 unk_288;
/* 0x028C */ BgBdanObjects* unk_28C; /* 0x028C */ BgBdanObjects* unk_28C;
/* 0x0290 */ s32 unk_290; /* 0x0290 */ s32 preLimbDrawIndex;
/* 0x0294 */ char unk_294[0x4]; /* 0x0294 */ char unk_294[0x4];
/* 0x0298 */ s32 unk_298; /* 0x0298 */ s32 unk_298;
/* 0x029C */ char unk_29C[0x2]; /* 0x029C */ char unk_29C[0x2];
/* 0x029E */ s16 unk_29E; /* 0x029E */ s16 headTurnSpeed;
/* 0x02A0 */ char unk_2A0[0x4]; /* 0x02A0 */ char unk_2A0[0x4];
/* 0x02A4 */ f32 unk_2A4; /* 0x02A4 */ f32 unk_2A4;
/* 0x02A8 */ s32 alpha; /* 0x02A8 */ s32 alpha;
/* 0x02AC */ s16 unk_2AC; /* 0x02AC */ s16 headRotTimer;
/* 0x02B0 */ s32 unk_2B0; /* 0x02B0 */ s32 headRotDirection;
/* 0x02B4 */ ColliderCylinder collider; /* 0x02B4 */ ColliderCylinder collider;
/* 0x0300 */ ColliderCylinder collider2; /* 0x0300 */ ColliderCylinder collider2;
/* 0x034C */ s32 unk_34C; /* 0x034C */ s32 isSittingOCActive;
/* 0x0350 */ s32 unk_350; /* 0x0350 */ s32 waterState;
/* 0x0354 */ f32 unk_354; /* 0x0354 */ f32 sinkingStartPosY;
/* 0x0358 */ f32 unk_358; /* 0x0358 */ f32 bobDepth;
/* 0x035C */ s16 unk_35C; /* 0x035C */ s16 bobPhase;
/* 0x0360 */ f32 unk_360; /* 0x0360 */ f32 isSinking;
/* 0x0364 */ Vec3f unk_364; /* 0x0364 */ Vec3f treadStartPos;
/* 0x0370 */ f32 unk_370; /* 0x0370 */ f32 carryIdleTimer;
/* 0x0374 */ NpcInteractInfo interactInfo; /* 0x0374 */ NpcInteractInfo interactInfo;
} EnRu1; // size = 0x039C } EnRu1; // size = 0x039C

View file

@ -205,7 +205,7 @@ void func_80AFCD60(EnSkb* this) {
void func_80AFCDF8(EnSkb* this) { void func_80AFCDF8(EnSkb* this) {
Animation_PlayOnceSetSpeed(&this->skelAnime, &gStalchildUncurlingAnim, 1.0f); Animation_PlayOnceSetSpeed(&this->skelAnime, &gStalchildUncurlingAnim, 1.0f);
this->unk_280 = 0; this->actionState = 0;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_APPEAR); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_APPEAR);
EnSkb_SetupAction(this, func_80AFCE5C); EnSkb_SetupAction(this, func_80AFCE5C);
@ -231,8 +231,8 @@ void func_80AFCE5C(EnSkb* this, PlayState* play) {
void func_80AFCF48(EnSkb* this) { void func_80AFCF48(EnSkb* this) {
Animation_Change(&this->skelAnime, &gStalchildUncurlingAnim, -1.0f, Animation_Change(&this->skelAnime, &gStalchildUncurlingAnim, -1.0f,
Animation_GetLastFrame(&gStalchildUncurlingAnim), 0.0f, ANIMMODE_ONCE, -4.0f); Animation_GetLastFrame(&gStalchildUncurlingAnim), 0.0f, ANIMMODE_ONCE, -4.0f);
this->unk_280 = 0; this->actionState = 0;
this->unk_281 = 0; this->setColliderAT = 0;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
@ -253,8 +253,8 @@ void func_80AFCFF0(EnSkb* this, PlayState* play) {
void func_80AFD0A4(EnSkb* this) { void func_80AFD0A4(EnSkb* this) {
Animation_Change(&this->skelAnime, &gStalchildWalkingAnim, 0.96000004f, 0.0f, Animation_Change(&this->skelAnime, &gStalchildWalkingAnim, 0.96000004f, 0.0f,
Animation_GetLastFrame(&gStalchildWalkingAnim), ANIMMODE_LOOP, -4.0f); Animation_GetLastFrame(&gStalchildWalkingAnim), ANIMMODE_LOOP, -4.0f);
this->unk_280 = 4; this->actionState = 4;
this->unk_288 = 0; this->headlessYawOffset = 0;
this->actor.speedXZ = this->actor.scale.y * 160.0f; this->actor.speedXZ = this->actor.scale.y * 160.0f;
EnSkb_SetupAction(this, EnSkb_Advance); EnSkb_SetupAction(this, EnSkb_Advance);
} }
@ -265,10 +265,10 @@ void EnSkb_Advance(EnSkb* this, PlayState* play) {
f32 playSpeed; f32 playSpeed;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if ((this->unk_283 != 0) && ((play->gameplayFrames & 0xF) == 0)) { if ((this->breakFlags != 0) && ((play->gameplayFrames & 0xF) == 0)) {
this->unk_288 = Rand_CenteredFloat(50000.0f); this->headlessYawOffset = Rand_CenteredFloat(50000.0f);
} }
Math_SmoothStepToS(&this->actor.shape.rot.y, (this->actor.yawTowardsPlayer + this->unk_288), 1, 0x2EE, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, (this->actor.yawTowardsPlayer + this->headlessYawOffset), 1, 0x2EE, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
thisKeyFrame = this->skelAnime.curFrame; thisKeyFrame = this->skelAnime.curFrame;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -305,7 +305,7 @@ void func_80AFD33C(EnSkb* this) {
Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, 0.6f, 0.0f, Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, 0.6f, 0.0f,
Animation_GetLastFrame(&gStalchildAttackingAnim), ANIMMODE_ONCE_INTERP, 4.0f); Animation_GetLastFrame(&gStalchildAttackingAnim), ANIMMODE_ONCE_INTERP, 4.0f);
this->collider.base.atFlags &= ~4; this->collider.base.atFlags &= ~4;
this->unk_280 = 3; this->actionState = 3;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
EnSkb_SetupAction(this, EnSkb_SetupAttack); EnSkb_SetupAction(this, EnSkb_SetupAttack);
} }
@ -316,9 +316,9 @@ void EnSkb_SetupAttack(EnSkb* this, PlayState* play) {
frameData = this->skelAnime.curFrame; frameData = this->skelAnime.curFrame;
if (frameData == 3) { if (frameData == 3) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK);
this->unk_281 = 1; this->setColliderAT = 1;
} else if (frameData == 6) { } else if (frameData == 6) {
this->unk_281 = 0; this->setColliderAT = 0;
} }
if (this->collider.base.atFlags & 4) { if (this->collider.base.atFlags & 4) {
this->collider.base.atFlags &= ~6; this->collider.base.atFlags &= ~6;
@ -332,8 +332,8 @@ void func_80AFD47C(EnSkb* this) {
Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f,
ANIMMODE_ONCE_INTERP, 0.0f); ANIMMODE_ONCE_INTERP, 0.0f);
this->collider.base.atFlags &= ~4; this->collider.base.atFlags &= ~4;
this->unk_280 = 5; this->actionState = 5;
this->unk_281 = 0; this->setColliderAT = 0;
EnSkb_SetupAction(this, func_80AFD508); EnSkb_SetupAction(this, func_80AFD508);
} }
@ -348,8 +348,8 @@ void EnSkb_SetupStunned(EnSkb* this) {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->unk_281 = 0; this->setColliderAT = 0;
this->unk_280 = 6; this->actionState = 6;
EnSkb_SetupAction(this, func_80AFD59C); EnSkb_SetupAction(this, func_80AFD59C);
} }
@ -378,7 +378,7 @@ void func_80AFD644(EnSkb* this) {
} }
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE);
this->unk_280 = 2; this->actionState = 2;
EnSkb_SetupAction(this, func_80AFD6CC); EnSkb_SetupAction(this, func_80AFD6CC);
} }
@ -386,10 +386,10 @@ void func_80AFD6CC(EnSkb* this, PlayState* play) {
// this cast is likely not real, but allows for a match // this cast is likely not real, but allows for a match
u8* new_var; u8* new_var;
new_var = &this->unk_283; new_var = &this->breakFlags;
if ((this->unk_283 != 1) || BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, 1)) { if ((this->breakFlags != 1) || BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, 1)) {
if ((*new_var) != 0) { if ((*new_var) != 0) {
this->unk_283 = (*new_var) | 2; this->breakFlags = (*new_var) | 2;
} }
if (this->actor.bgCheckFlags & 2) { if (this->actor.bgCheckFlags & 2) {
this->actor.speedXZ = 0; this->actor.speedXZ = 0;
@ -414,10 +414,10 @@ void func_80AFD7B4(EnSkb* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) { if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -6.0f; this->actor.speedXZ = -6.0f;
} }
this->unk_280 = 1; this->actionState = 1;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
BodyBreak_Alloc(&this->bodyBreak, 18, play); BodyBreak_Alloc(&this->bodyBreak, 18, play);
this->unk_283 |= 4; this->breakFlags |= 4;
EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_STALKID_DEAD, 1, 1, 0x28); EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_STALKID_DEAD, 1, 1, 0x28);
EnSkb_SetupAction(this, func_80AFD880); EnSkb_SetupAction(this, func_80AFD880);
GameInteractor_ExecuteOnEnemyDefeat(&this->actor); GameInteractor_ExecuteOnEnemyDefeat(&this->actor);
@ -435,7 +435,7 @@ void func_80AFD880(EnSkb* this, PlayState* play) {
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED); Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED);
} }
this->unk_283 |= 8; this->breakFlags |= 8;
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
} }
@ -448,19 +448,19 @@ void func_80AFD968(EnSkb* this, PlayState* play) {
s16 phi_v1; s16 phi_v1;
Player* player; Player* player;
if ((this->unk_280 != 1) && (this->actor.bgCheckFlags & 0x60) && (this->actor.yDistToWater >= 40.0f)) { if ((this->actionState != 1) && (this->actor.bgCheckFlags & 0x60) && (this->actor.yDistToWater >= 40.0f)) {
this->actor.colChkInfo.health = 0; this->actor.colChkInfo.health = 0;
this->unk_281 = 0; this->setColliderAT = 0;
func_80AFD7B4(this, play); func_80AFD7B4(this, play);
} else if (this->unk_280 >= 3) { } else if (this->actionState >= 3) {
if ((this->collider.base.acFlags & 2) != 0) { if ((this->collider.base.acFlags & 2) != 0) {
this->collider.base.acFlags &= ~2; this->collider.base.acFlags &= ~2;
if (this->actor.colChkInfo.damageEffect != 6) { if (this->actor.colChkInfo.damageEffect != 6) {
this->unk_282 = this->actor.colChkInfo.damageEffect; this->lastDamageReaction = this->actor.colChkInfo.damageEffect;
Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, 1); Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, 1);
this->unk_281 = 0; this->setColliderAT = 0;
if (this->actor.colChkInfo.damageEffect == 1) { if (this->actor.colChkInfo.damageEffect == 1) {
if (this->unk_280 != 6) { if (this->actionState != 6) {
Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50);
Actor_ApplyDamage(&this->actor); Actor_ApplyDamage(&this->actor);
EnSkb_SetupStunned(this); EnSkb_SetupStunned(this);
@ -484,13 +484,13 @@ void func_80AFD968(EnSkb* this, PlayState* play) {
return; return;
} }
player = GET_PLAYER(play); player = GET_PLAYER(play);
if (this->unk_283 == 0) { if (this->breakFlags == 0) {
if ((this->actor.colChkInfo.damageEffect == 0xD) || if ((this->actor.colChkInfo.damageEffect == 0xD) ||
((this->actor.colChkInfo.damageEffect == 0xE) && ((this->actor.colChkInfo.damageEffect == 0xE) &&
((player->meleeWeaponAnimation >= 4 && player->meleeWeaponAnimation <= 11) || ((player->meleeWeaponAnimation >= 4 && player->meleeWeaponAnimation <= 11) ||
(player->meleeWeaponAnimation == 20 || player->meleeWeaponAnimation == 21)))) { (player->meleeWeaponAnimation == 20 || player->meleeWeaponAnimation == 21)))) {
BodyBreak_Alloc(&this->bodyBreak, 2, play); BodyBreak_Alloc(&this->bodyBreak, 2, play);
this->unk_283 = 1; this->breakFlags = 1;
} }
} }
func_80AFD644(this); func_80AFD644(this);
@ -510,11 +510,11 @@ void EnSkb_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play); this->actionFunc(this, play);
this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += (3000.0f * this->actor.scale.y); this->actor.focus.pos.y += (3000.0f * this->actor.scale.y);
if (this->unk_281 != 0) { if (this->setColliderAT != 0) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
} }
if (this->unk_280 >= 3) { if (this->actionState >= 3) {
if ((this->actor.colorFilterTimer == 0) || ((this->actor.colorFilterParams & 0x4000) == 0)) { if ((this->actor.colorFilterTimer == 0) || ((this->actor.colorFilterParams & 0x4000) == 0)) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
@ -529,7 +529,7 @@ s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
s16 pad[2]; s16 pad[2];
if (limbIndex == 11) { if (limbIndex == 11) {
if ((this->unk_283 & 2) == 0) { if ((this->breakFlags & 2) == 0) {
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
color = ABS((s16)(Math_SinS((play->gameplayFrames * 0x1770)) * 95.0f)) + 160; color = ABS((s16)(Math_SinS((play->gameplayFrames * 0x1770)) * 95.0f)) + 160;
gDPPipeSync(POLY_OPA_DISP++); gDPPipeSync(POLY_OPA_DISP++);
@ -538,7 +538,7 @@ s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
} else { } else {
*dList = NULL; *dList = NULL;
} }
} else if ((limbIndex == 12) && ((this->unk_283 & 2) != 0)) { } else if ((limbIndex == 12) && ((this->breakFlags & 2) != 0)) {
*dList = NULL; *dList = NULL;
} }
return 0; return 0;
@ -549,9 +549,9 @@ void EnSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
Collider_UpdateSpheres(limbIndex, &this->collider); Collider_UpdateSpheres(limbIndex, &this->collider);
if ((this->unk_283 ^ 1) == 0) { if ((this->breakFlags ^ 1) == 0) {
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 11, 12, 18, dList, BODYBREAK_OBJECT_DEFAULT); BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 11, 12, 18, dList, BODYBREAK_OBJECT_DEFAULT);
} else if ((this->unk_283 ^ (this->unk_283 | 4)) == 0) { } else if ((this->breakFlags ^ (this->breakFlags | 4)) == 0) {
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 18, 18, dList, BODYBREAK_OBJECT_DEFAULT); BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 18, 18, dList, BODYBREAK_OBJECT_DEFAULT);
} }
} }

View file

@ -13,12 +13,12 @@ typedef struct EnSkb {
/* 0x014C */ SkelAnime skelAnime; /* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ Vec3s jointTable[20]; /* 0x0190 */ Vec3s jointTable[20];
/* 0x0208 */ Vec3s morphTable[20]; /* 0x0208 */ Vec3s morphTable[20];
/* 0x0280 */ u8 unk_280; /* 0x0280 */ u8 actionState;
/* 0x0281 */ u8 unk_281; /* 0x0281 */ u8 setColliderAT;
/* 0x0282 */ u8 unk_282; /* 0x0282 */ u8 lastDamageReaction;
/* 0x0283 */ u8 unk_283; /* 0x0283 */ u8 breakFlags;
/* 0x0284 */ EnSkbActionFunc actionFunc; /* 0x0284 */ EnSkbActionFunc actionFunc;
/* 0x0288 */ s16 unk_288; /* 0x0288 */ s16 headlessYawOffset;
/* 0x028C */ BodyBreak bodyBreak; /* 0x028C */ BodyBreak bodyBreak;
/* 0x02A4 */ ColliderJntSph collider; /* 0x02A4 */ ColliderJntSph collider;
/* 0x02C4 */ ColliderJntSphElement colliderItem[2]; /* 0x02C4 */ ColliderJntSphElement colliderItem[2];

View file

@ -75,14 +75,14 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16); SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16);
this->unk_29E = this->actor.params; this->minigameType = this->actor.params;
if (this->unk_29E < 0) { if (this->minigameType < 0) {
this->unk_29E = 0; this->minigameType = 0;
} }
Collider_InitCylinder(play, &this->collider); Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
if (this->unk_29E == 0) { if (this->minigameType == 0) {
osSyncPrintf("\n\n"); osSyncPrintf("\n\n");
// "Archery range chicken" // "Archery range chicken"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 射的場鶏 ☆☆☆☆☆ \n" VT_RST); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 射的場鶏 ☆☆☆☆☆ \n" VT_RST);
@ -95,8 +95,8 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.01f); Actor_SetScale(&this->actor, 0.01f);
} }
this->unk_2DC = this->actor.world.pos; this->initPos = this->actor.world.pos;
this->unk_2E8 = this->actor.world.pos; this->targetPos = this->actor.world.pos;
this->actionFunc = func_80B11DEC; this->actionFunc = func_80B11DEC;
} }
@ -109,113 +109,113 @@ void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play) {
} }
void func_80B11A94(EnSyatekiNiw* this, PlayState* play, s16 arg2) { void func_80B11A94(EnSyatekiNiw* this, PlayState* play, s16 arg2) {
if (this->unk_254 == 0) { if (this->peckTimer == 0) {
if (arg2 == 0) { if (arg2 == 0) {
this->unk_264 = 0.0f; this->headRotXTarget = 0.0f;
} else { } else {
this->unk_264 = -10000.0f; this->headRotXTarget = -10000.0f;
} }
this->unk_28E += 1; this->headRotXState += 1;
this->unk_254 = 3; this->peckTimer = 3;
if (!(this->unk_28E & 1)) { if (!(this->headRotXState & 1)) {
this->unk_264 = 0.0f; this->headRotXTarget = 0.0f;
if (arg2 == 0) { if (arg2 == 0) {
this->unk_254 = Rand_ZeroFloat(30.0f); this->peckTimer = Rand_ZeroFloat(30.0f);
} }
} }
} }
if (this->unk_258 == 0) { if (this->flapTimer == 0) {
this->unk_292++; this->wingsRotState++;
this->unk_292 &= 1; this->wingsRotState &= 1;
switch (arg2) { switch (arg2) {
case 0: case 0:
this->unk_26C = 0.0f; this->leftWingRotXTarget = 0.0f;
this->unk_268 = 0.0f; this->rightWingRotXTarget = 0.0f;
break; break;
case 1: case 1:
this->unk_258 = 3; this->flapTimer = 3;
this->unk_26C = 7000.0f; this->leftWingRotXTarget = 7000.0f;
this->unk_268 = 7000.0f; this->rightWingRotXTarget = 7000.0f;
if (this->unk_292 == 0) { if (this->wingsRotState == 0) {
this->unk_26C = 0.0f; this->leftWingRotXTarget = 0.0f;
this->unk_268 = 0.0f; this->rightWingRotXTarget = 0.0f;
} }
break; break;
case 2: case 2:
this->unk_258 = 2; this->flapTimer = 2;
this->unk_268 = this->unk_26C = -10000.0f; this->rightWingRotXTarget = this->leftWingRotXTarget = -10000.0f;
this->unk_280 = this->unk_278 = 25000.0f; this->leftWingRotYTarget = this->rightWingRotYTarget = 25000.0f;
this->unk_284 = this->unk_27C = 6000.0f; this->leftWingRotZTarget = this->rightWingRotZTarget = 6000.0f;
if (this->unk_292 == 0) { if (this->wingsRotState == 0) {
this->unk_278 = 8000.0f; this->rightWingRotYTarget = 8000.0f;
this->unk_280 = 8000.0f; this->leftWingRotYTarget = 8000.0f;
} }
break; break;
case 3: case 3:
this->unk_258 = 2; this->flapTimer = 2;
this->unk_278 = 10000.0f; this->rightWingRotYTarget = 10000.0f;
this->unk_280 = 10000.0f; this->leftWingRotYTarget = 10000.0f;
if (this->unk_292 == 0) { if (this->wingsRotState == 0) {
this->unk_278 = 3000.0f; this->rightWingRotYTarget = 3000.0f;
this->unk_280 = 3000.0f; this->leftWingRotYTarget = 3000.0f;
} }
break; break;
case 4: case 4:
this->unk_254 = this->unk_256 = 5; this->peckTimer = this->timer1 = 5;
break; break;
case 5: case 5:
this->unk_258 = 5; this->flapTimer = 5;
this->unk_278 = 14000.0f; this->rightWingRotYTarget = 14000.0f;
this->unk_280 = 14000.0f; this->leftWingRotYTarget = 14000.0f;
if (this->unk_292 == 0) { if (this->wingsRotState == 0) {
this->unk_278 = 10000.0f; this->rightWingRotYTarget = 10000.0f;
this->unk_280 = 10000.0f; this->leftWingRotYTarget = 10000.0f;
} }
break; break;
} }
} }
if (this->unk_264 != this->unk_2BC.x) { if (this->headRotXTarget != this->headRot.x) {
Math_ApproachF(&this->unk_2BC.x, this->unk_264, 0.5f, 4000.0f); Math_ApproachF(&this->headRot.x, this->headRotXTarget, 0.5f, 4000.0f);
} }
if (this->unk_26C != this->unk_2A4.x) { if (this->leftWingRotXTarget != this->leftWingRot.x) {
Math_ApproachF(&this->unk_2A4.x, this->unk_26C, 0.8f, 7000.0f); Math_ApproachF(&this->leftWingRot.x, this->leftWingRotXTarget, 0.8f, 7000.0f);
} }
if (this->unk_280 != this->unk_2A4.y) { if (this->leftWingRotYTarget != this->leftWingRot.y) {
Math_ApproachF(&this->unk_2A4.y, this->unk_280, 0.8f, 7000.0f); Math_ApproachF(&this->leftWingRot.y, this->leftWingRotYTarget, 0.8f, 7000.0f);
} }
if (this->unk_284 != this->unk_2A4.z) { if (this->leftWingRotZTarget != this->leftWingRot.z) {
Math_ApproachF(&this->unk_2A4.z, this->unk_284, 0.8f, 7000.0f); Math_ApproachF(&this->leftWingRot.z, this->leftWingRotZTarget, 0.8f, 7000.0f);
} }
if (this->unk_268 != this->unk_2B0.x) { if (this->rightWingRotXTarget != this->rightWingRot.x) {
Math_ApproachF(&this->unk_2B0.x, this->unk_268, 0.8f, 7000.0f); Math_ApproachF(&this->rightWingRot.x, this->rightWingRotXTarget, 0.8f, 7000.0f);
} }
if (this->unk_278 != this->unk_2B0.y) { if (this->rightWingRotYTarget != this->rightWingRot.y) {
Math_ApproachF(&this->unk_2B0.y, this->unk_278, 0.8f, 7000.0f); Math_ApproachF(&this->rightWingRot.y, this->rightWingRotYTarget, 0.8f, 7000.0f);
} }
if (this->unk_27C != this->unk_2B0.z) { if (this->rightWingRotZTarget != this->rightWingRot.z) {
Math_ApproachF(&this->unk_2B0.z, this->unk_27C, 0.8f, 7000.0f); Math_ApproachF(&this->rightWingRot.z, this->rightWingRotZTarget, 0.8f, 7000.0f);
} }
} }
void func_80B11DEC(EnSyatekiNiw* this, PlayState* play) { void func_80B11DEC(EnSyatekiNiw* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP, Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP,
-10.0f); -10.0f);
if (this->unk_29E != 0) { if (this->minigameType != 0) {
Actor_SetScale(&this->actor, this->unk_2F4); Actor_SetScale(&this->actor, this->scale);
} }
this->actionFunc = func_80B11E78; this->actionFunc = func_80B11E78;
@ -233,20 +233,20 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
f32 tmpf1; f32 tmpf1;
s16 sp4A; s16 sp4A;
if ((this->unk_29C != 0) && (this->unk_29E == 0) && (this->actor.bgCheckFlags & 1)) { if ((this->archeryState != 0) && (this->minigameType == 0) && (this->actor.bgCheckFlags & 1)) {
this->unk_29C = 0; this->archeryState = 0;
this->actionFunc = func_80B123A8; this->actionFunc = func_80B123A8;
return; return;
} }
sp4A = 0; sp4A = 0;
if ((this->unk_25E == 0) && (this->unk_25C == 0)) { if ((this->movementTimer == 0) && (this->hopTimer == 0)) {
this->unk_294++; this->targetPosTimer++;
if (this->unk_294 >= 8) { if (this->targetPosTimer >= 8) {
this->unk_25E = Rand_ZeroFloat(30.0f); this->movementTimer = Rand_ZeroFloat(30.0f);
this->unk_294 = Rand_ZeroFloat(3.99f); this->targetPosTimer = Rand_ZeroFloat(3.99f);
switch (this->unk_29E) { switch (this->minigameType) {
case 0: case 0:
sp50 = Rand_CenteredFloat(100.0f); sp50 = Rand_CenteredFloat(100.0f);
if (sp50 < 0.0f) { if (sp50 < 0.0f) {
@ -262,23 +262,23 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
sp4C += 100.0f; sp4C += 100.0f;
} }
this->unk_2E8.x = this->unk_2DC.x + sp50; this->targetPos.x = this->initPos.x + sp50;
this->unk_2E8.z = this->unk_2DC.z + sp4C; this->targetPos.z = this->initPos.z + sp4C;
if (this->unk_2E8.x < -150.0f) { if (this->targetPos.x < -150.0f) {
this->unk_2E8.x = -150.0f; this->targetPos.x = -150.0f;
} }
if (this->unk_2E8.x > 150.0f) { if (this->targetPos.x > 150.0f) {
this->unk_2E8.x = 150.0f; this->targetPos.x = 150.0f;
} }
if (this->unk_2E8.z < -60.0f) { if (this->targetPos.z < -60.0f) {
this->unk_2E8.z = -60.0f; this->targetPos.z = -60.0f;
} }
if (this->unk_2E8.z > -40.0f) { if (this->targetPos.z > -40.0f) {
this->unk_2E8.z = -40.0f; this->targetPos.z = -40.0f;
} }
break; break;
@ -297,28 +297,28 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
sp4C += 30.0f; sp4C += 30.0f;
} }
this->unk_2E8.x = this->unk_2DC.x + sp50; this->targetPos.x = this->initPos.x + sp50;
this->unk_2E8.z = this->unk_2DC.z + sp4C; this->targetPos.z = this->initPos.z + sp4C;
break; break;
} }
} else { } else {
this->unk_25C = 4; this->hopTimer = 4;
if (this->actor.bgCheckFlags & 1) { if (this->actor.bgCheckFlags & 1) {
this->actor.velocity.y = 2.5f; this->actor.velocity.y = 2.5f;
if ((Rand_ZeroFloat(10.0f) < 1.0f) && (this->unk_29E == 0)) { if ((Rand_ZeroFloat(10.0f) < 1.0f) && (this->minigameType == 0)) {
this->unk_25C = 0xC; this->hopTimer = 0xC;
this->actor.velocity.y = 10.0f; this->actor.velocity.y = 10.0f;
} }
} }
} }
} }
if (this->unk_25C != 0) { if (this->hopTimer != 0) {
sp4A = 1; 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.x, this->targetPos.x, 1.0f, this->posRotStep.y);
Math_ApproachF(&this->actor.world.pos.z, this->unk_2E8.z, 1.0f, this->unk_2C8.y); Math_ApproachF(&this->actor.world.pos.z, this->targetPos.z, 1.0f, this->posRotStep.y);
Math_ApproachF(&this->unk_2C8.y, 3.0f, 1.0f, 0.3f); Math_ApproachF(&this->posRotStep.y, 3.0f, 1.0f, 0.3f);
tmpf1 = this->unk_2E8.x - this->actor.world.pos.x; tmpf1 = this->targetPos.x - this->actor.world.pos.x;
tmpf2 = this->unk_2E8.z - this->actor.world.pos.z; tmpf2 = this->targetPos.z - this->actor.world.pos.z;
if (fabsf(tmpf1) < 10.0f) { if (fabsf(tmpf1) < 10.0f) {
tmpf1 = 0; tmpf1 = 0;
@ -329,16 +329,16 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
} }
if ((tmpf1 == 0.0f) && (tmpf2 == 0.0f)) { if ((tmpf1 == 0.0f) && (tmpf2 == 0.0f)) {
this->unk_25C = 0; this->hopTimer = 0;
this->unk_294 = 7; this->targetPosTimer = 7;
} }
Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(tmpf1, tmpf2) * (0x8000 / M_PI), 3, this->unk_2C8.z, Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(tmpf1, tmpf2) * (0x8000 / M_PI), 3,
0); this->posRotStep.z, 0);
Math_ApproachF(&this->unk_2C8.z, 10000.0f, 1.0f, 1000.0f); Math_ApproachF(&this->posRotStep.z, 10000.0f, 1.0f, 1000.0f);
} }
if (this->unk_260 == 0) { if (this->sootTimer == 0) {
func_80B11A94(this, play, sp4A); func_80B11A94(this, play, sp4A);
return; return;
} }
@ -354,18 +354,18 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
void func_80B123A8(EnSyatekiNiw* this, PlayState* play) { void func_80B123A8(EnSyatekiNiw* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP, Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP,
-10.0f); -10.0f);
this->unk_27C = 6000.0f; this->rightWingRotZTarget = 6000.0f;
this->unk_288 = -10000.0f; this->unkArcheryFloat = -10000.0f;
this->unk_2B0.z = 6000.0f; this->rightWingRot.z = 6000.0f;
this->unk_2B0.y = 10000.0f; this->rightWingRot.y = 10000.0f;
this->actionFunc = func_80B12460; this->actionFunc = func_80B12460;
this->unk_2A4.z = 6000.0f; this->leftWingRot.z = 6000.0f;
this->unk_284 = 6000.0f; this->leftWingRotZTarget = 6000.0f;
this->unk_2B0.x = -10000.0f; this->rightWingRot.x = -10000.0f;
this->unk_268 = -10000.0f; this->rightWingRotXTarget = -10000.0f;
this->unk_2A4.y = -10000.0f; this->leftWingRot.y = -10000.0f;
this->unk_2A4.x = -10000.0f; this->leftWingRot.x = -10000.0f;
this->unk_26C = -10000.0f; this->leftWingRotXTarget = -10000.0f;
} }
void func_80B12460(EnSyatekiNiw* this, PlayState* play) { void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
@ -373,32 +373,32 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
f32 phi_f16 = 0.0f; f32 phi_f16 = 0.0f;
player->actor.freezeTimer = 10; player->actor.freezeTimer = 10;
switch (this->unk_29A) { switch (this->archeryState) {
case 0: case 0:
this->unk_296 = 2; this->archeryAnimationType = 2;
this->unk_2C8.y = 0.0f; this->posRotStep.y = 0.0f;
this->unk_29A = 1; this->archeryState = 1;
break; break;
case 1: case 1:
this->actor.speedXZ = 2.0f; this->actor.speedXZ = 2.0f;
if (this->unk_25C == 0) { if (this->hopTimer == 0) {
this->unk_25C = 3; this->hopTimer = 3;
this->actor.velocity.y = 3.5f; this->actor.velocity.y = 3.5f;
} }
if (this->unk_25A == 0) { if (this->archeryTimer == 0) {
this->unk_298++; this->rotYFlip++;
this->unk_298 &= 1; this->rotYFlip &= 1;
this->unk_25A = 5; this->archeryTimer = 5;
} }
phi_f16 = (this->unk_298 == 0) ? 5000.0f : -5000.0f; phi_f16 = (this->rotYFlip == 0) ? 5000.0f : -5000.0f;
if (this->actor.world.pos.z > 100.0f) { if (this->actor.world.pos.z > 100.0f) {
this->actor.speedXZ = 2.0f; this->actor.speedXZ = 2.0f;
this->actor.gravity = -0.3f; this->actor.gravity = -0.3f;
this->actor.velocity.y = 5.0f; this->actor.velocity.y = 5.0f;
this->unk_29A = 2; this->archeryState = 2;
} }
break; break;
@ -410,70 +410,70 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
if ((this->actor.bgCheckFlags & 1) && (this->actor.world.pos.z > 110.0f)) { if ((this->actor.bgCheckFlags & 1) && (this->actor.world.pos.z > 110.0f)) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->unk_284 = 0.0f; this->leftWingRotZTarget = 0.0f;
this->unk_27C = 0.0f; this->rightWingRotZTarget = 0.0f;
this->unk_278 = 0.0f; this->rightWingRotYTarget = 0.0f;
this->unk_280 = 0.0f; this->leftWingRotYTarget = 0.0f;
this->unk_288 = 0.0f; this->unkArcheryFloat = 0.0f;
this->actor.speedXZ = 0.5f; this->actor.speedXZ = 0.5f;
this->unk_254 = this->unk_256 = 0; this->peckTimer = this->timer1 = 0;
this->unk_28E = this->unk_290 = 0; this->headRotXState = this->unk_290 = 0;
this->unk_296 = 1; this->archeryAnimationType = 1;
this->unk_29A = 3; this->archeryState = 3;
} }
break; break;
case 3: case 3:
if ((player->actor.world.pos.z - 50.0f) < this->actor.world.pos.z) { if ((player->actor.world.pos.z - 50.0f) < this->actor.world.pos.z) {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->unk_262 = 0x3C; this->cluckTimer = 0x3C;
this->unk_25A = 0x14; this->archeryTimer = 0x14;
this->unk_264 = 10000.0f; this->headRotXTarget = 10000.0f;
this->unk_29A = 4; this->archeryState = 4;
} }
break; break;
case 4: case 4:
if (this->unk_25A == 0) { if (this->archeryTimer == 0) {
this->unk_296 = 4; this->archeryAnimationType = 4;
this->unk_264 = 5000.0f; this->headRotXTarget = 5000.0f;
this->unk_26C = 0.0f; this->leftWingRotXTarget = 0.0f;
this->unk_268 = 0.0f; this->rightWingRotXTarget = 0.0f;
this->unk_284 = 0.0f; this->leftWingRotZTarget = 0.0f;
this->unk_27C = 0.0f; this->rightWingRotZTarget = 0.0f;
this->unk_280 = 14000.0f; this->leftWingRotYTarget = 14000.0f;
this->unk_278 = 14000.0f; this->rightWingRotYTarget = 14000.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M);
this->unk_254 = this->unk_256 = this->unk_25A = 0x1E; this->peckTimer = this->timer1 = this->archeryTimer = 0x1E;
this->unk_29A = 5; this->archeryState = 5;
} }
break; break;
case 5: case 5:
if (this->unk_25A == 1) { if (this->archeryTimer == 1) {
this->unk_258 = 0; this->flapTimer = 0;
this->unk_296 = 5; this->archeryAnimationType = 5;
this->unk_256 = this->unk_258; this->timer1 = this->flapTimer;
this->unk_254 = this->unk_258; this->peckTimer = this->flapTimer;
this->actor.speedXZ = 1.0f; this->actor.speedXZ = 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_PlaySoundGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySoundGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_25E = 0x14; this->movementTimer = 0x14;
this->unk_29A = 6; this->archeryState = 6;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
break; break;
case 6: case 6:
if (this->unk_25E == 1) { if (this->movementTimer == 1) {
play->transitionTrigger = TRANS_TRIGGER_START; play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.entranceIndex; play->nextEntranceIndex = gSaveContext.entranceIndex;
play->shootingGalleryStatus = 0; play->shootingGalleryStatus = 0;
player->actor.freezeTimer = 20; player->actor.freezeTimer = 20;
this->unk_25E = 0x14; this->movementTimer = 0x14;
this->actionFunc = func_80B128D8; this->actionFunc = func_80B128D8;
} }
break; break;
@ -484,18 +484,18 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
player->actor.world.pos.z - this->actor.world.pos.z) * player->actor.world.pos.z - this->actor.world.pos.z) *
(0x8000 / M_PI)) + (0x8000 / M_PI)) +
phi_f16, phi_f16,
5, this->unk_2C8.y, 0); 5, this->posRotStep.y, 0);
Math_ApproachF(&this->unk_2C8.y, 3000.0f, 1.0f, 500.0f); Math_ApproachF(&this->posRotStep.y, 3000.0f, 1.0f, 500.0f);
if (this->unk_296 == 2) { if (this->archeryAnimationType == 2) {
this->unk_256 = 10; this->timer1 = 10;
this->unk_254 = this->unk_256; this->peckTimer = this->timer1;
} }
func_80B11A94(this, play, this->unk_296); func_80B11A94(this, play, this->archeryAnimationType);
} }
void func_80B128D8(EnSyatekiNiw* this, PlayState* play) { void func_80B128D8(EnSyatekiNiw* this, PlayState* play) {
if (this->unk_25E == 1) { if (this->movementTimer == 1) {
gSaveContext.timerState = TIMER_STATE_OFF; gSaveContext.timerState = TIMER_STATE_OFF;
} }
} }
@ -504,15 +504,15 @@ void func_80B128F8(EnSyatekiNiw* this, PlayState* play) {
s16 sp26; s16 sp26;
s16 sp24; s16 sp24;
Actor_SetFocus(&this->actor, this->unk_2D4); Actor_SetFocus(&this->actor, this->focusYOffset);
Actor_GetScreenPos(play, &this->actor, &sp26, &sp24); Actor_GetScreenPos(play, &this->actor, &sp26, &sp24);
if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (sp26 > 0) && if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (sp26 > 0) &&
(sp26 < SCREEN_WIDTH) && (sp24 > 0) && (sp24 < SCREEN_HEIGHT)) { (sp26 < SCREEN_WIDTH) && (sp24 > 0) && (sp24 < SCREEN_HEIGHT)) {
this->actor.speedXZ = 5.0f; this->actor.speedXZ = 5.0f;
this->unk_298 = Rand_ZeroFloat(1.99f); this->rotYFlip = Rand_ZeroFloat(1.99f);
this->unk_2D8 = Rand_CenteredFloat(8000.0f) + -10000.0f; this->removeStateYaw = Rand_CenteredFloat(8000.0f) + -10000.0f;
this->unk_262 = 0x1E; this->cluckTimer = 0x1E;
this->unk_25E = 0x64; this->movementTimer = 0x64;
this->actionFunc = func_80B129EC; this->actionFunc = func_80B129EC;
} }
} }
@ -524,53 +524,53 @@ void func_80B129EC(EnSyatekiNiw* this, PlayState* play) {
s16 sp2C; s16 sp2C;
f32 tmpf2; f32 tmpf2;
Actor_SetFocus(&this->actor, this->unk_2D4); Actor_SetFocus(&this->actor, this->focusYOffset);
Actor_GetScreenPos(play, &this->actor, &sp2E, &sp2C); Actor_GetScreenPos(play, &this->actor, &sp2E, &sp2C);
if ((this->unk_25E == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || if ((this->movementTimer == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) ||
(sp2C < 0) || (sp2C > SCREEN_HEIGHT)) { (sp2C < 0) || (sp2C > SCREEN_HEIGHT)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
this->unk_2A0 = 1; this->spawnFeathers = 1;
if (this->unk_25C == 0) { if (this->hopTimer == 0) {
this->unk_298++; this->rotYFlip++;
this->unk_298 &= 1; this->rotYFlip &= 1;
this->unk_25C = (s16)Rand_CenteredFloat(4.0f) + 5; this->hopTimer = (s16)Rand_CenteredFloat(4.0f) + 5;
if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & 1)) { if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & 1)) {
this->actor.velocity.y = 4.0f; this->actor.velocity.y = 4.0f;
} }
} }
phi_f2 = (this->unk_298 == 0) ? 5000.0f : -5000.0f; phi_f2 = (this->rotYFlip == 0) ? 5000.0f : -5000.0f;
tmpf2 = this->unk_2D8 + phi_f2; tmpf2 = this->removeStateYaw + phi_f2;
Math_SmoothStepToS(&this->actor.world.rot.y, tmpf2, 3, this->unk_2C8.y, 0); Math_SmoothStepToS(&this->actor.world.rot.y, tmpf2, 3, this->posRotStep.y, 0);
Math_ApproachF(&this->unk_2C8.y, 3000.0f, 1.0f, 500.0f); Math_ApproachF(&this->posRotStep.y, 3000.0f, 1.0f, 500.0f);
func_80B11A94(this, play, 2); func_80B11A94(this, play, 2);
} }
void func_80B12BA4(EnSyatekiNiw* this, PlayState* play) { void func_80B12BA4(EnSyatekiNiw* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT; this->collider.base.acFlags &= ~AC_HIT;
switch (this->unk_29E) { switch (this->minigameType) {
case 0: case 0:
if (this->unk_29C == 0) { if (this->archeryState == 0) {
this->unk_262 = 0x1E; this->cluckTimer = 0x1E;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
this->unk_29C = 1; this->archeryState = 1;
this->unk_2A0 = 1; this->spawnFeathers = 1;
this->actionFunc = func_80B123A8; this->actionFunc = func_80B123A8;
this->actor.gravity = -3.0f; this->actor.gravity = -3.0f;
} }
break; break;
case 1: case 1:
this->unk_262 = 0x1E; this->cluckTimer = 0x1E;
this->unk_2F8 = 1; this->unkAlleyHitByte = 1;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
this->unk_260 = 100; this->sootTimer = 100;
this->unk_2A0 = 1; this->spawnFeathers = 1;
this->unk_25E = this->unk_260; this->movementTimer = this->sootTimer;
break; break;
} }
} }
@ -587,33 +587,33 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
Vec3f sp60; Vec3f sp60;
func_80B132A8(this, play); func_80B132A8(this, play);
this->unk_28C++; this->lifetime++;
if (this->unk_254 != 0) { if (this->peckTimer != 0) {
this->unk_254--; this->peckTimer--;
} }
if (this->unk_258 != 0) { if (this->flapTimer != 0) {
this->unk_258--; this->flapTimer--;
} }
if (this->unk_25A != 0) { if (this->archeryTimer != 0) {
this->unk_25A--; this->archeryTimer--;
} }
if (this->unk_25C != 0) { if (this->hopTimer != 0) {
this->unk_25C--; this->hopTimer--;
} }
if (this->unk_25E != 0) { if (this->movementTimer != 0) {
this->unk_25E--; this->movementTimer--;
} }
if (this->unk_262 != 0) { if (this->cluckTimer != 0) {
this->unk_262--; this->cluckTimer--;
} }
if (this->unk_260 != 0) { if (this->sootTimer != 0) {
this->unk_260--; this->sootTimer--;
} }
this->actor.shape.rot = this->actor.world.rot; this->actor.shape.rot = this->actor.world.rot;
@ -623,7 +623,7 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
Actor_MoveXZGravity(&this->actor); Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D);
if (this->unk_2A0 != 0) { if (this->spawnFeathers != 0) {
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
sp78.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x; 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.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 20.0f);
@ -636,22 +636,22 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
func_80B131B8(this, &sp78, &sp6C, &sp60, Rand_ZeroFloat(8.0f) + 8.0f); func_80B131B8(this, &sp78, &sp6C, &sp60, Rand_ZeroFloat(8.0f) + 8.0f);
} }
this->unk_2A0 = 0; this->spawnFeathers = 0;
} }
func_80B12BA4(this, play); func_80B12BA4(this, play);
if (this->unk_262 == 0) { if (this->cluckTimer == 0) {
if (this->actionFunc == func_80B11E78) { if (this->actionFunc == func_80B11E78) {
this->unk_262 = 0x12C; this->cluckTimer = 0x12C;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_N); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_N);
} else { } else {
this->unk_262 = 0x1E; this->cluckTimer = 0x1E;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
} }
} }
i = 0; i = 0;
switch (this->unk_29E) { switch (this->minigameType) {
case 0: case 0:
if (play->shootingGalleryStatus != 0) { if (play->shootingGalleryStatus != 0) {
i = 1; i = 1;
@ -675,19 +675,19 @@ s32 SyatekiNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
Vec3f sp0 = { 0.0f, 0.0f, 0.0f }; Vec3f sp0 = { 0.0f, 0.0f, 0.0f };
if (limbIndex == 13) { if (limbIndex == 13) {
rot->y += (s16)this->unk_2BC.x; rot->y += (s16)this->headRot.x;
} }
if (limbIndex == 11) { if (limbIndex == 11) {
rot->x += (s16)this->unk_2B0.z; rot->x += (s16)this->rightWingRot.z;
rot->y += (s16)this->unk_2B0.y; rot->y += (s16)this->rightWingRot.y;
rot->z += (s16)this->unk_2B0.x; rot->z += (s16)this->rightWingRot.x;
} }
if (limbIndex == 7) { if (limbIndex == 7) {
rot->x += (s16)this->unk_2A4.z; rot->x += (s16)this->leftWingRot.z;
rot->y += (s16)this->unk_2A4.y; rot->y += (s16)this->leftWingRot.y;
rot->z += (s16)this->unk_2A4.x; rot->z += (s16)this->leftWingRot.x;
} }
return false; return false;
@ -699,7 +699,7 @@ void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play) {
if (this->actionFunc != func_80B128F8) { if (this->actionFunc != func_80B128F8) {
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
if (this->unk_260 != 0) { if (this->sootTimer != 0) {
func_80026230(play, &sp30, 0, 0x14); func_80026230(play, &sp30, 0, 0x14);
} }
@ -711,19 +711,19 @@ void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play) {
void func_80B131B8(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) { void func_80B131B8(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) {
s16 i; s16 i;
EnSyatekiNiw_1* ptr = &this->unk_348[0]; EnSyatekiNiw_1* ptr = &this->effects[0];
for (i = 0; i < 5; i++, ptr++) { for (i = 0; i < 5; i++, ptr++) {
if (ptr->unk_00 == 0) { if (ptr->state == 0) {
ptr->epoch++; ptr->epoch++;
ptr->unk_00 = 1; ptr->state = 1;
ptr->unk_04 = *arg1; ptr->pos = *arg1;
ptr->unk_10 = *arg2; ptr->vel = *arg2;
ptr->unk_1C = *arg3; ptr->accel = *arg3;
ptr->unk_34 = 0; ptr->timer = 0;
ptr->unk_2C = (arg4 / 1000.0f); ptr->scale = (arg4 / 1000.0f);
ptr->unk_28 = (s16)Rand_ZeroFloat(20.0f) + 0x28; ptr->lifespan = (s16)Rand_ZeroFloat(20.0f) + 0x28;
ptr->unk_2A = Rand_ZeroFloat(1000.0f); ptr->rotPulse = Rand_ZeroFloat(1000.0f);
return; return;
} }
} }
@ -731,28 +731,28 @@ void func_80B131B8(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f3
void func_80B132A8(EnSyatekiNiw* this, PlayState* play) { void func_80B132A8(EnSyatekiNiw* this, PlayState* play) {
s16 i; s16 i;
EnSyatekiNiw_1* ptr = &this->unk_348[0]; EnSyatekiNiw_1* ptr = &this->effects[0];
for (i = 0; i < 5; i++, ptr++) { for (i = 0; i < 5; i++, ptr++) {
if (ptr->unk_00 != 0) { if (ptr->state != 0) {
ptr->unk_04.x += ptr->unk_10.x; ptr->pos.x += ptr->vel.x;
ptr->unk_04.y += ptr->unk_10.y; ptr->pos.y += ptr->vel.y;
ptr->unk_04.z += ptr->unk_10.z; ptr->pos.z += ptr->vel.z;
ptr->unk_34++; ptr->timer++;
ptr->unk_10.x += ptr->unk_1C.x; ptr->vel.x += ptr->accel.x;
ptr->unk_10.y += ptr->unk_1C.y; ptr->vel.y += ptr->accel.y;
ptr->unk_10.z += ptr->unk_1C.z; ptr->vel.z += ptr->accel.z;
if (ptr->unk_00 == 1) { if (ptr->state == 1) {
ptr->unk_2A++; ptr->rotPulse++;
Math_ApproachF(&ptr->unk_10.x, 0.0f, 1.0f, 0.05f); Math_ApproachF(&ptr->vel.x, 0.0f, 1.0f, 0.05f);
Math_ApproachF(&ptr->unk_10.z, 0.0f, 1.0f, 0.05f); Math_ApproachF(&ptr->vel.z, 0.0f, 1.0f, 0.05f);
if (ptr->unk_10.y < -0.5f) { if (ptr->vel.y < -0.5f) {
ptr->unk_10.y = 0.5f; ptr->vel.y = 0.5f;
} }
ptr->unk_30 = (Math_SinS(ptr->unk_2A * 3000) * M_PI) * 0.2f; ptr->rot = (Math_SinS(ptr->rotPulse * 3000) * M_PI) * 0.2f;
if (ptr->unk_28 < ptr->unk_34) { if (ptr->lifespan < ptr->timer) {
ptr->unk_00 = 0; ptr->state = 0;
} }
} }
} }
@ -762,7 +762,7 @@ void func_80B132A8(EnSyatekiNiw* this, PlayState* play) {
void func_80B13464(EnSyatekiNiw* this, PlayState* play) { void func_80B13464(EnSyatekiNiw* this, PlayState* play) {
GraphicsContext* gfxCtx = play->state.gfxCtx; GraphicsContext* gfxCtx = play->state.gfxCtx;
s16 i; s16 i;
EnSyatekiNiw_1* ptr = &this->unk_348[0]; EnSyatekiNiw_1* ptr = &this->effects[0];
u8 flag = 0; u8 flag = 0;
OPEN_DISPS(gfxCtx); OPEN_DISPS(gfxCtx);
@ -770,17 +770,17 @@ void func_80B13464(EnSyatekiNiw* this, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < 5; i++, ptr++) { for (i = 0; i < 5; i++, ptr++) {
if (ptr->unk_00 == 1) { if (ptr->state == 1) {
if (flag == 0) { if (flag == 0) {
gSPDisplayList(POLY_XLU_DISP++, gCuccoEffectFeatherMaterialDL); gSPDisplayList(POLY_XLU_DISP++, gCuccoEffectFeatherMaterialDL);
flag++; flag++;
} }
FrameInterpolation_RecordOpenChild(ptr, ptr->epoch); FrameInterpolation_RecordOpenChild(ptr, ptr->epoch);
Matrix_Translate(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, MTXMODE_NEW); Matrix_Translate(ptr->pos.x, ptr->pos.y, ptr->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(ptr->unk_2C, ptr->unk_2C, 1.0f, MTXMODE_APPLY); Matrix_Scale(ptr->scale, ptr->scale, 1.0f, MTXMODE_APPLY);
Matrix_RotateZ(ptr->unk_30, MTXMODE_APPLY); Matrix_RotateZ(ptr->rot, MTXMODE_APPLY);
Matrix_Translate(0.0f, -1000.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, -1000.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -9,15 +9,15 @@ struct EnSyatekiNiw;
typedef void (*EnSyatekiNiwActionFunc)(struct EnSyatekiNiw*, PlayState*); typedef void (*EnSyatekiNiwActionFunc)(struct EnSyatekiNiw*, PlayState*);
typedef struct { typedef struct {
/* 0x00 */ u8 unk_00; /* 0x00 */ u8 state;
/* 0x0C */ Vec3f unk_04; /* 0x0C */ Vec3f pos;
/* 0x10 */ Vec3f unk_10; /* 0x10 */ Vec3f vel;
/* 0x1C */ Vec3f unk_1C; /* 0x1C */ Vec3f accel;
/* 0x28 */ s16 unk_28; /* 0x28 */ s16 lifespan;
/* 0x2A */ s16 unk_2A; /* 0x2A */ s16 rotPulse;
/* 0x2C */ f32 unk_2C; /* 0x2C */ f32 scale;
/* 0x30 */ f32 unk_30; /* 0x30 */ f32 rot;
/* 0x34 */ u8 unk_34; /* 0x34 */ u8 timer;
u32 epoch; u32 epoch;
} EnSyatekiNiw_1; // size = 0x38 } EnSyatekiNiw_1; // size = 0x38
@ -27,46 +27,45 @@ typedef struct EnSyatekiNiw {
/* 0x0190 */ Vec3s jointTable[16]; /* 0x0190 */ Vec3s jointTable[16];
/* 0x01F0 */ Vec3s morphTable[16]; /* 0x01F0 */ Vec3s morphTable[16];
/* 0x0250 */ EnSyatekiNiwActionFunc actionFunc; /* 0x0250 */ EnSyatekiNiwActionFunc actionFunc;
/* 0x0254 */ s16 unk_254; /* 0x0254 */ s16 peckTimer;
/* 0x0256 */ s16 unk_256; /* 0x0256 */ s16 timer1;
/* 0x0258 */ s16 unk_258; /* 0x0258 */ s16 flapTimer;
/* 0x025A */ s16 unk_25A; /* 0x025A */ s16 archeryTimer;
/* 0x025C */ s16 unk_25C; /* 0x025C */ s16 hopTimer;
/* 0x025E */ s16 unk_25E; /* 0x025E */ s16 movementTimer;
/* 0x0260 */ s16 unk_260; /* 0x0260 */ s16 sootTimer;
/* 0x0262 */ s16 unk_262; /* 0x0262 */ s16 cluckTimer;
/* 0x0264 */ f32 unk_264; /* 0x0264 */ f32 headRotXTarget;
/* 0x0268 */ f32 unk_268; /* 0x0268 */ f32 rightWingRotXTarget;
/* 0x026C */ f32 unk_26C; /* 0x026C */ f32 leftWingRotXTarget;
/* 0x0270 */ char unk_270[0x8]; /* 0x0270 */ char unk_270[0x8];
/* 0x0278 */ f32 unk_278; /* 0x0278 */ f32 rightWingRotYTarget;
/* 0x027C */ f32 unk_27C; /* 0x027C */ f32 rightWingRotZTarget;
/* 0x0284 */ f32 unk_280; /* 0x0284 */ f32 leftWingRotYTarget;
/* 0x0280 */ f32 unk_284; /* 0x0280 */ f32 leftWingRotZTarget;
/* 0x0288 */ f32 unk_288; /* 0x0288 */ f32 unkArcheryFloat;
/* 0x028C */ s16 unk_28C; /* 0x028C */ s16 lifetime;
/* 0x028E */ s16 unk_28E; /* 0x028E */ s16 headRotXState;
/* 0x0290 */ s16 unk_290; /* 0x0290 */ s16 unk_290;
/* 0x0292 */ s16 unk_292; /* 0x0292 */ s16 wingsRotState;
/* 0x0294 */ s16 unk_294; /* 0x0294 */ s16 targetPosTimer;
/* 0x0296 */ s16 unk_296; /* 0x0296 */ s16 archeryAnimationType;
/* 0x0298 */ s16 unk_298; /* 0x0298 */ s16 rotYFlip;
/* 0x029C */ s16 unk_29A; /* 0x029C */ s16 archeryState;
/* 0x029C */ s16 unk_29C; /* 0x029E */ s16 minigameType;
/* 0x029E */ s16 unk_29E; /* 0x02A0 */ s16 spawnFeathers;
/* 0x02A0 */ s16 unk_2A0; /* 0x02A4 */ Vec3f leftWingRot;
/* 0x02A4 */ Vec3f unk_2A4; /* 0x02B0 */ Vec3f rightWingRot;
/* 0x02B0 */ Vec3f unk_2B0; /* 0x02BC */ Vec3f headRot;
/* 0x02BC */ Vec3f unk_2BC; /* 0x02C8 */ Vec3f posRotStep;
/* 0x02C8 */ Vec3f unk_2C8; /* 0x02D4 */ f32 focusYOffset;
/* 0x02D4 */ f32 unk_2D4; /* 0x02D8 */ f32 removeStateYaw;
/* 0x02D8 */ f32 unk_2D8; /* 0x02DC */ Vec3f initPos;
/* 0x02DC */ Vec3f unk_2DC; /* 0x02E8 */ Vec3f targetPos;
/* 0x02E8 */ Vec3f unk_2E8; /* 0x02F4 */ f32 scale;
/* 0x02F4 */ f32 unk_2F4; /* 0x02F8 */ u8 unkAlleyHitByte;
/* 0x02F8 */ u8 unk_2F8;
/* 0x02FC */ ColliderCylinder collider; /* 0x02FC */ ColliderCylinder collider;
/* 0x0348 */ EnSyatekiNiw_1 unk_348[5]; /* 0x0348 */ EnSyatekiNiw_1 effects[5];
} EnSyatekiNiw; // size = 0x0460 } EnSyatekiNiw; // size = 0x0460
#endif #endif

Some files were not shown because too many files have changed in this diff Show more