1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 22:44:30 +00:00

speedXZ -> speed (#1477)

* speedXZ -> speed

* +=

* revert arg in player function

* anon review

* engineer review

* forgot one

* last review

* revert decimal
This commit is contained in:
fig02 2022-12-24 12:18:57 -05:00 committed by GitHub
parent 4a9873775c
commit 92e03cf747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
171 changed files with 1771 additions and 1773 deletions

View file

@ -207,7 +207,7 @@ typedef struct Actor {
/* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position /* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position
/* 0x050 */ Vec3f scale; // Scale of the actor in each axis /* 0x050 */ Vec3f scale; // Scale of the actor in each axis
/* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis /* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis
/* 0x068 */ f32 speedXZ; // How fast the actor is traveling along the XZ plane /* 0x068 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used
/* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame /* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame
/* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis
/* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching /* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching

View file

@ -850,8 +850,8 @@ void func_8002D7EC(Actor* actor) {
} }
void func_8002D868(Actor* actor) { void func_8002D868(Actor* actor) {
actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ; actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speed;
actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ; actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speed;
actor->velocity.y += actor->gravity; actor->velocity.y += actor->gravity;
if (actor->velocity.y < actor->minVelocityY) { if (actor->velocity.y < actor->minVelocityY) {
@ -865,11 +865,11 @@ void Actor_MoveForward(Actor* actor) {
} }
void func_8002D908(Actor* actor) { void func_8002D908(Actor* actor) {
f32 sp24 = Math_CosS(actor->world.rot.x) * actor->speedXZ; f32 speedXZ = Math_CosS(actor->world.rot.x) * actor->speed;
actor->velocity.x = Math_SinS(actor->world.rot.y) * sp24; actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ;
actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ; actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speed;
actor->velocity.z = Math_CosS(actor->world.rot.y) * sp24; actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ;
} }
void func_8002D97C(Actor* actor) { void func_8002D97C(Actor* actor) {
@ -878,7 +878,7 @@ void func_8002D97C(Actor* actor) {
} }
void func_8002D9A4(Actor* actor, f32 arg1) { void func_8002D9A4(Actor* actor, f32 arg1) {
actor->speedXZ = Math_CosS(actor->world.rot.x) * arg1; actor->speed = Math_CosS(actor->world.rot.x) * arg1;
actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1; actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1;
} }
@ -3350,9 +3350,9 @@ Actor* Actor_GetProjectileActor(PlayState* play, Actor* refActor, f32 radius) {
(((ArmsHook*)actor)->timer == 0)) { (((ArmsHook*)actor)->timer == 0)) {
actor = actor->next; actor = actor->next;
} else { } else {
deltaX = Math_SinS(actor->world.rot.y) * (actor->speedXZ * 10.0f); deltaX = Math_SinS(actor->world.rot.y) * (actor->speed * 10.0f);
deltaY = actor->velocity.y + (actor->gravity * 10.0f); deltaY = actor->velocity.y + (actor->gravity * 10.0f);
deltaZ = Math_CosS(actor->world.rot.y) * (actor->speedXZ * 10.0f); deltaZ = Math_CosS(actor->world.rot.y) * (actor->speed * 10.0f);
spA8.x = actor->world.pos.x + deltaX; spA8.x = actor->world.pos.x + deltaX;
spA8.y = actor->world.pos.y + deltaY; spA8.y = actor->world.pos.y + deltaY;
@ -4091,7 +4091,7 @@ s32 func_80035124(Actor* actor, PlayState* play) {
actor->params = 1; actor->params = 1;
} else if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) { } else if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
Actor_MoveForward(actor); Actor_MoveForward(actor);
Math_SmoothStepToF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f); Math_SmoothStepToF(&actor->speed, 0.0f, 1.0f, 0.1f, 0.0f);
} else if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (actor->velocity.y < -4.0f)) { } else if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (actor->velocity.y < -4.0f)) {
ret = 1; ret = 1;
} else { } else {
@ -4299,7 +4299,7 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3,
spawnPos->z, spawnRot->x, spawnRot->y, actor->objBankIndex, params); spawnPos->z, spawnRot->x, spawnRot->y, actor->objBankIndex, params);
if (spawnedEnPart != NULL) { if (spawnedEnPart != NULL) {
spawnedEnPart->actor.scale = actor->scale; spawnedEnPart->actor.scale = actor->scale;
spawnedEnPart->actor.speedXZ = arg3[0]; spawnedEnPart->actor.speed = arg3[0];
spawnedEnPart->displayList = dList; spawnedEnPart->displayList = dList;
spawnedEnPart->action = 2; spawnedEnPart->action = 2;
spawnedEnPart->timer = timer; spawnedEnPart->timer = timer;

View file

@ -265,11 +265,11 @@ void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type) {
} }
void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) { void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) {
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->dyna.actor.speed, 1.0f, 1.0f, 0.5f, 0.0f);
this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1; this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1;
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1; this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1;
if (this->dyna.actor.speedXZ != 0.0f && this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->dyna.actor.speed != 0.0f && this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->dyna.actor.world.rot.y = this->dyna.actor.world.rot.y =
this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y + this->dyna.actor.wallYaw - 0x8000; this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y + this->dyna.actor.wallYaw - 0x8000;
if (1) {} if (1) {}
@ -279,7 +279,7 @@ void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) {
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
if (this->dyna.actor.velocity.y < -8.0f) { if (this->dyna.actor.velocity.y < -8.0f) {
this->dyna.actor.velocity.y *= -0.6f; this->dyna.actor.velocity.y *= -0.6f;
this->dyna.actor.speedXZ *= 0.6f; this->dyna.actor.speed *= 0.6f;
this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH); this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
} else { } else {
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
@ -294,13 +294,13 @@ void EnAObj_SetupBlock(EnAObj* this, s16 type) {
} }
void EnAObj_Block(EnAObj* this, PlayState* play) { void EnAObj_Block(EnAObj* this, PlayState* play) {
this->dyna.actor.speedXZ += this->dyna.unk_150; this->dyna.actor.speed += this->dyna.unk_150;
this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.world.rot.y = this->dyna.unk_158;
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f); this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -2.5f, 2.5f);
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); Math_SmoothStepToF(&this->dyna.actor.speed, 0.0f, 1.0f, 1.0f, 0.0f);
if (this->dyna.actor.speedXZ != 0.0f) { if (this->dyna.actor.speed != 0.0f) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
} }

View file

@ -280,7 +280,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
this->despawnTimer = 15; this->despawnTimer = 15;
this->unk_154 = 35; this->unk_154 = 35;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
@ -390,7 +390,7 @@ void func_8001DFC8(EnItem00* this, PlayState* play) {
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
} }
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
if (this->unk_154 == 0) { if (this->unk_154 == 0) {
if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) && if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) &&
@ -448,7 +448,7 @@ void func_8001E304(EnItem00* this, PlayState* play) {
if (this->actor.params == ITEM00_RECOVERY_HEART) { if (this->actor.params == ITEM00_RECOVERY_HEART) {
if (this->actor.velocity.y < 0.0f) { if (this->actor.velocity.y < 0.0f) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.gravity = -0.4f; this->actor.gravity = -0.4f;
if (this->actor.velocity.y < -1.5f) { if (this->actor.velocity.y < -1.5f) {
this->actor.velocity.y = -1.5f; this->actor.velocity.y = -1.5f;
@ -489,7 +489,7 @@ void func_8001E304(EnItem00* this, PlayState* play) {
EnItem00_SetupAction(this, func_8001DFC8); EnItem00_SetupAction(this, func_8001DFC8);
this->actor.shape.rot.z = 0; this->actor.shape.rot.z = 0;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} }
@ -733,7 +733,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
this->despawnTimer = 15; this->despawnTimer = 15;
this->unk_154 = 35; this->unk_154 = 35;
this->actor.shape.rot.z = 0; this->actor.shape.rot.z = 0;
this->actor.speedXZ = 0; this->actor.speed = 0;
this->actor.velocity.y = 0; this->actor.velocity.y = 0;
this->actor.gravity = 0; this->actor.gravity = 0;
@ -969,7 +969,7 @@ EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) {
spawnPos->z, 0, 0, 0, params | param8000 | param3F00); spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
if ((spawnedActor != NULL) && !param8000) { if ((spawnedActor != NULL) && !param8000) {
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f; spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.speed = 2.0f;
spawnedActor->actor.gravity = -0.9f; spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
Actor_SetScale(&spawnedActor->actor, 0.0f); Actor_SetScale(&spawnedActor->actor, 0.0f);
@ -1009,7 +1009,7 @@ EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) {
spawnPos->z, 0, 0, 0, params | param8000 | param3F00); spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
if ((spawnedActor != NULL) && !param8000) { if ((spawnedActor != NULL) && !param8000) {
spawnedActor->actor.velocity.y = 0.0f; spawnedActor->actor.velocity.y = 0.0f;
spawnedActor->actor.speedXZ = 0.0f; spawnedActor->actor.speed = 0.0f;
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f; spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.flags |= ACTOR_FLAG_4; spawnedActor->actor.flags |= ACTOR_FLAG_4;
@ -1119,7 +1119,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP
spawnPos->y, spawnPos->z, 0, 0, 0, dropId); spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
if ((spawnedActor != NULL) && (dropId != ITEM00_NONE)) { if ((spawnedActor != NULL) && (dropId != ITEM00_NONE)) {
spawnedActor->actor.velocity.y = 8.0f; spawnedActor->actor.velocity.y = 8.0f;
spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.speed = 2.0f;
spawnedActor->actor.gravity = -0.9f; spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f; spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
Actor_SetScale(&spawnedActor->actor, 0.0f); Actor_SetScale(&spawnedActor->actor, 0.0f);

View file

@ -1130,7 +1130,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx**
} else if ((sLeftHandType == PLAYER_MODELTYPE_LH_BOOMERANG) && (this->stateFlags1 & PLAYER_STATE1_25)) { } else if ((sLeftHandType == PLAYER_MODELTYPE_LH_BOOMERANG) && (this->stateFlags1 & PLAYER_STATE1_25)) {
dLists = gPlayerLeftHandOpenDLs + gSaveContext.linkAge; dLists = gPlayerLeftHandOpenDLs + gSaveContext.linkAge;
sLeftHandType = PLAYER_MODELTYPE_LH_OPEN; sLeftHandType = PLAYER_MODELTYPE_LH_OPEN;
} else if ((this->leftHandType == PLAYER_MODELTYPE_LH_OPEN) && (this->actor.speedXZ > 2.0f) && } else if ((this->leftHandType == PLAYER_MODELTYPE_LH_OPEN) && (this->actor.speed > 2.0f) &&
!(this->stateFlags1 & PLAYER_STATE1_27)) { !(this->stateFlags1 & PLAYER_STATE1_27)) {
dLists = gPlayerLeftHandClosedDLs + gSaveContext.linkAge; dLists = gPlayerLeftHandClosedDLs + gSaveContext.linkAge;
sLeftHandType = PLAYER_MODELTYPE_LH_CLOSED; sLeftHandType = PLAYER_MODELTYPE_LH_CLOSED;
@ -1142,7 +1142,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx**
if (sRightHandType == PLAYER_MODELTYPE_RH_SHIELD) { if (sRightHandType == PLAYER_MODELTYPE_RH_SHIELD) {
dLists += this->currentShield * 4; dLists += this->currentShield * 4;
} else if ((this->rightHandType == PLAYER_MODELTYPE_RH_OPEN) && (this->actor.speedXZ > 2.0f) && } else if ((this->rightHandType == PLAYER_MODELTYPE_RH_OPEN) && (this->actor.speed > 2.0f) &&
!(this->stateFlags1 & PLAYER_STATE1_27)) { !(this->stateFlags1 & PLAYER_STATE1_27)) {
dLists = sPlayerRightHandClosedDLs + gSaveContext.linkAge; dLists = sPlayerRightHandClosedDLs + gSaveContext.linkAge;
sRightHandType = PLAYER_MODELTYPE_RH_CLOSED; sRightHandType = PLAYER_MODELTYPE_RH_CLOSED;

View file

@ -253,7 +253,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff);
Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8); Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8);
this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y); this->actor.shape.rot.x = Math_Atan2S(this->actor.speed, -this->actor.velocity.y);
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x); sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y); sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y);
sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z); sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z);

View file

@ -180,7 +180,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos
} }
if (actor != NULL) { if (actor != NULL) {
actor->speedXZ = Rand_ZeroOne() + (accel * 0.6f); actor->speed = Rand_ZeroOne() + (accel * 0.6f);
actor->velocity.y = Rand_ZeroOne() + (accel * 0.6f); actor->velocity.y = Rand_ZeroOne() + (accel * 0.6f);
actor->world.rot.y += (s16)((Rand_ZeroOne() - 0.5f) * 3000.0f); actor->world.rot.y += (s16)((Rand_ZeroOne() - 0.5f) * 3000.0f);
actor->world.rot.x = (s16)(Rand_ZeroOne() * 3500.0f) + 2000; actor->world.rot.x = (s16)(Rand_ZeroOne() * 3500.0f) + 2000;

View file

@ -126,16 +126,15 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) {
Vec3f pos2; Vec3f pos2;
f32 effectStrength; f32 effectStrength;
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f); Math_SmoothStepToF(&this->dyna.actor.speed, 4.0f, 0.5f, 0.025f, 0.0f);
Rumble_Request(500.0f, 120, 20, 10); Rumble_Request(500.0f, 120, 20, 10);
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 200.0f - 20.0f, 0.075f, if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 200.0f - 20.0f, 0.075f,
this->dyna.actor.speedXZ, 0.0075f) == 0.0f) { this->dyna.actor.speed, 0.0075f) == 0.0f) {
Flags_SetSwitch(play, this->dyna.actor.params); Flags_SetSwitch(play, this->dyna.actor.params);
BgDdanKd_SetupAction(this, BgDdanKd_DoNothing); BgDdanKd_SetupAction(this, BgDdanKd_DoNothing);
} else { } else {
effectStrength = effectStrength = (this->dyna.actor.prevPos.y - this->dyna.actor.world.pos.y) + (this->dyna.actor.speed * 0.25f);
(this->dyna.actor.prevPos.y - this->dyna.actor.world.pos.y) + (this->dyna.actor.speedXZ * 0.25f);
if (play->state.frames & 1) { if (play->state.frames & 1) {
pos1 = pos2 = this->dyna.actor.world.pos; pos1 = pos2 = this->dyna.actor.world.pos;

View file

@ -290,7 +290,7 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) {
// disable the bomb catcher for a few seconds // disable the bomb catcher for a few seconds
this->dyna.actor.parent = &bomb->actor; this->dyna.actor.parent = &bomb->actor;
bomb->timer = 50; bomb->timer = 50;
bomb->actor.speedXZ = 0.0f; bomb->actor.speed = 0.0f;
sTimer = 0; sTimer = 0;
} }
} }

View file

@ -183,19 +183,19 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play) {
} }
if (this->dropTimer == 0) { if (this->dropTimer == 0) {
this->flashYScale = 0.0f; this->flashYScale = 0.0f;
Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speed);
Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 2.0f); Math_ApproachF(&this->dyna.actor.speed, 100.0f, 1.0f, 2.0f);
if (!(this->unwalledSides & OTYUKA_SIDE_EAST)) { if (!(this->unwalledSides & OTYUKA_SIDE_EAST)) {
this->dyna.actor.shape.rot.z -= (s16)(this->dyna.actor.speedXZ * 30.0f); this->dyna.actor.shape.rot.z -= (s16)(this->dyna.actor.speed * 30.0f);
} }
if (!(this->unwalledSides & OTYUKA_SIDE_WEST)) { if (!(this->unwalledSides & OTYUKA_SIDE_WEST)) {
this->dyna.actor.shape.rot.z += (s16)(this->dyna.actor.speedXZ * 30.0f); this->dyna.actor.shape.rot.z += (s16)(this->dyna.actor.speed * 30.0f);
} }
if (!(this->unwalledSides & OTYUKA_SIDE_SOUTH)) { if (!(this->unwalledSides & OTYUKA_SIDE_SOUTH)) {
this->dyna.actor.shape.rot.x += (s16)(this->dyna.actor.speedXZ * 30.0f); this->dyna.actor.shape.rot.x += (s16)(this->dyna.actor.speed * 30.0f);
} }
if (!(this->unwalledSides & OTYUKA_SIDE_NORTH)) { if (!(this->unwalledSides & OTYUKA_SIDE_NORTH)) {
this->dyna.actor.shape.rot.x -= (s16)(this->dyna.actor.speedXZ * 30.0f); this->dyna.actor.shape.rot.x -= (s16)(this->dyna.actor.speed * 30.0f);
} }
if (this->dyna.actor.world.pos.y < -750.0f) { if (this->dyna.actor.world.pos.y < -750.0f) {
if (player->actor.world.pos.y < -400.0f) { if (player->actor.world.pos.y < -400.0f) {
@ -224,8 +224,8 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play) {
Audio_PlaySfxGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speed);
Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 0.1f); Math_ApproachF(&this->dyna.actor.speed, 100.0f, 1.0f, 0.1f);
} }
osSyncPrintf("MODE DOWN END\n"); osSyncPrintf("MODE DOWN END\n");
} }

View file

@ -257,7 +257,7 @@ void BgGndIceblock_Reset(BgGndIceblock* this, PlayState* play) {
} }
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) {
this->targetPos = thisx->home.pos; this->targetPos = thisx->home.pos;
thisx->speedXZ = 0.0f; thisx->speed = 0.0f;
this->actionFunc = BgGndIceblock_Idle; this->actionFunc = BgGndIceblock_Idle;
switch (thisx->params) { switch (thisx->params) {
case 0: case 0:
@ -306,11 +306,11 @@ void BgGndIceblock_Slide(BgGndIceblock* this, PlayState* play) {
f32 spread; f32 spread;
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f); Math_StepToF(&thisx->speed, 10.0f, 0.5f);
atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ); atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speed);
atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ); atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speed);
if (atTarget) { if (atTarget) {
thisx->speedXZ = 0.0f; thisx->speed = 0.0f;
this->targetPos.x = thisx->world.pos.x; this->targetPos.x = thisx->world.pos.x;
this->targetPos.z = thisx->world.pos.z; this->targetPos.z = thisx->world.pos.z;
Actor_PlaySfx(thisx, NA_SE_EV_BLOCK_BOUND); Actor_PlaySfx(thisx, NA_SE_EV_BLOCK_BOUND);
@ -326,7 +326,7 @@ void BgGndIceblock_Slide(BgGndIceblock* this, PlayState* play) {
this->actionFunc = BgGndIceblock_Hole; this->actionFunc = BgGndIceblock_Hole;
break; break;
} }
} else if (thisx->speedXZ > 6.0f) { } else if (thisx->speed > 6.0f) {
spread = Rand_CenteredFloat(120.0f); spread = Rand_CenteredFloat(120.0f);
velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158); velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158);
velocity.y = Rand_ZeroOne() + 1.0f; velocity.y = Rand_ZeroOne() + 1.0f;

View file

@ -92,9 +92,9 @@ void func_8087B938(BgHaka* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s32 sp38; s32 sp38;
this->dyna.actor.speedXZ += 0.05f; this->dyna.actor.speed += 0.05f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 1.5f); this->dyna.actor.speed = CLAMP_MAX(this->dyna.actor.speed, 1.5f);
sp38 = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speedXZ); sp38 = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speed);
this->dyna.actor.world.pos.x = this->dyna.actor.world.pos.x =
Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.x; Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = this->dyna.actor.world.pos.z =

View file

@ -189,9 +189,9 @@ void func_8087E288(BgHakaMeganeBG* this, PlayState* play) {
} }
void func_8087E2D8(BgHakaMeganeBG* this, PlayState* play) { void func_8087E2D8(BgHakaMeganeBG* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.speedXZ, 30.0f, 2.0f); Math_StepToF(&this->dyna.actor.speed, 30.0f, 2.0f);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.speedXZ)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.speed)) {
Actor_SetFocus(&this->dyna.actor, 50.0f); Actor_SetFocus(&this->dyna.actor, 50.0f);
this->actionFunc = func_8087E34C; this->actionFunc = func_8087E34C;
} else { } else {

View file

@ -125,19 +125,19 @@ void BgHakaShip_Move(BgHakaShip* this, PlayState* play) {
distanceFromHome = this->dyna.actor.home.pos.x - this->dyna.actor.world.pos.x; distanceFromHome = this->dyna.actor.home.pos.x - this->dyna.actor.world.pos.x;
if (distanceFromHome > 7650.0f) { if (distanceFromHome > 7650.0f) {
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - 7650.0f; this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - 7650.0f;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
} }
if (distanceFromHome > 7600.0f && !Play_InCsMode(play)) { if (distanceFromHome > 7600.0f && !Play_InCsMode(play)) {
this->counter = 40; this->counter = 40;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
Message_StartTextbox(play, 0x5071, NULL); Message_StartTextbox(play, 0x5071, NULL);
this->actionFunc = BgHakaShip_SetupCrash; this->actionFunc = BgHakaShip_SetupCrash;
} else { } else {
Math_StepToF(&this->dyna.actor.speedXZ, 4.0f, 0.2f); Math_StepToF(&this->dyna.actor.speed, 4.0f, 0.2f);
} }
child = this->dyna.actor.child; child = this->dyna.actor.child;
if (child != NULL && child->update != NULL) { if (child != NULL && child->update != NULL) {
child->shape.rot.z += ((655.0f / 13.0f) * this->dyna.actor.speedXZ); child->shape.rot.z += ((655.0f / 13.0f) * this->dyna.actor.speed);
} else { } else {
this->dyna.actor.child = NULL; this->dyna.actor.child = NULL;
} }

View file

@ -83,7 +83,7 @@ void BgHakaZou_Init(Actor* thisx, PlayState* play) {
if (thisx->params == STA_UNKNOWN) { if (thisx->params == STA_UNKNOWN) {
Actor_SetScale(thisx, (Rand_ZeroOne() * 0.005f) + 0.025f); Actor_SetScale(thisx, (Rand_ZeroOne() * 0.005f) + 0.025f);
thisx->speedXZ = Rand_ZeroOne(); thisx->speed = Rand_ZeroOne();
thisx->world.rot.y = thisx->shape.rot.y * ((Rand_ZeroOne() < 0.5f) ? -1 : 1) + Rand_CenteredFloat(0x1000); thisx->world.rot.y = thisx->shape.rot.y * ((Rand_ZeroOne() < 0.5f) ? -1 : 1) + Rand_CenteredFloat(0x1000);
this->timer = 20; this->timer = 20;
thisx->world.rot.x = Rand_S16Offset(0x100, 0x300) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1); thisx->world.rot.x = Rand_S16Offset(0x100, 0x300) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1);
@ -209,7 +209,7 @@ void func_80882BDC(BgHakaZou* this, PlayState* play) {
this->dyna.actor.velocity.y *= -0.6f; this->dyna.actor.velocity.y *= -0.6f;
this->dyna.actor.velocity.y = CLAMP_MAX(this->dyna.actor.velocity.y, 10.0f); this->dyna.actor.velocity.y = CLAMP_MAX(this->dyna.actor.velocity.y, 10.0f);
this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH); this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
this->dyna.actor.speedXZ = 2.0f; this->dyna.actor.speed = 2.0f;
} else { } else {
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
} }

View file

@ -441,7 +441,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
this->actionFunc = BgHeavyBlock_Land; this->actionFunc = BgHeavyBlock_Land;
} }
} }
this->dyna.actor.shape.rot.x = Math_Atan2S(this->dyna.actor.velocity.y, this->dyna.actor.speedXZ); this->dyna.actor.shape.rot.x = Math_Atan2S(this->dyna.actor.velocity.y, this->dyna.actor.speed);
} }
void BgHeavyBlock_DoNothing(BgHeavyBlock* this, PlayState* play) { void BgHeavyBlock_DoNothing(BgHeavyBlock* this, PlayState* play) {
@ -451,7 +451,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) {
s32 pad; s32 pad;
if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x8AD0, 6, 2000, 100) != 0) { if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x8AD0, 6, 2000, 100) != 0) {
Math_StepToF(&this->dyna.actor.speedXZ, 0.0f, 20.0f); Math_StepToF(&this->dyna.actor.speed, 0.0f, 20.0f);
Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f); Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f);
this->dyna.actor.gravity = 0.0f; this->dyna.actor.gravity = 0.0f;
this->dyna.actor.world.pos = this->dyna.actor.home.pos; this->dyna.actor.world.pos = this->dyna.actor.home.pos;

View file

@ -143,7 +143,7 @@ void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play) {
this->actionFunc = BgHidanDalm_Shrink; this->actionFunc = BgHidanDalm_Shrink;
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
this->dyna.actor.speedXZ = 10.0f; this->dyna.actor.speed = 10.0f;
Flags_SetSwitch(play, this->switchFlag); Flags_SetSwitch(play, this->switchFlag);
Player_PlaySfx(GET_PLAYER(play), NA_SE_IT_HAMMER_HIT); Player_PlaySfx(GET_PLAYER(play), NA_SE_IT_HAMMER_HIT);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH);

View file

@ -119,9 +119,9 @@ void func_80889BC0(BgHidanKousi* this, PlayState* play) {
} }
void func_80889C18(BgHidanKousi* this, PlayState* play) { void func_80889C18(BgHidanKousi* this, PlayState* play) {
this->dyna.actor.speedXZ += 0.2f; this->dyna.actor.speed += 0.2f;
if (this->dyna.actor.speedXZ > 2.0f) { if (this->dyna.actor.speed > 2.0f) {
this->dyna.actor.speedXZ = 2.0f; this->dyna.actor.speed = 2.0f;
BgHidanKousi_SetupAction(this, func_80889C90); BgHidanKousi_SetupAction(this, func_80889C90);
} }
Actor_MoveForward(&this->dyna.actor); Actor_MoveForward(&this->dyna.actor);

View file

@ -135,13 +135,13 @@ void func_8088B268(BgHidanRock* this, PlayState* play) {
} }
} }
this->dyna.actor.speedXZ += 0.05f; this->dyna.actor.speed += 0.05f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); this->dyna.actor.speed = CLAMP_MAX(this->dyna.actor.speed, 2.0f);
if (D_8088BFC0 > 0.0f) { if (D_8088BFC0 > 0.0f) {
temp_v1 = Math_StepToF(&D_8088BFC0, 20.0f, this->dyna.actor.speedXZ); temp_v1 = Math_StepToF(&D_8088BFC0, 20.0f, this->dyna.actor.speed);
} else { } else {
temp_v1 = Math_StepToF(&D_8088BFC0, -20.0f, this->dyna.actor.speedXZ); temp_v1 = Math_StepToF(&D_8088BFC0, -20.0f, this->dyna.actor.speed);
} }
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * D_8088BFC0) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * D_8088BFC0) + this->dyna.actor.home.pos.x;
@ -153,7 +153,7 @@ void func_8088B268(BgHidanRock* this, PlayState* play) {
this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
D_8088BFC0 = 0.0f; D_8088BFC0 = 0.0f;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->timer = 5; this->timer = 5;
} }
@ -175,7 +175,7 @@ void func_8088B268(BgHidanRock* this, PlayState* play) {
Math_Vec3f_Copy(&this->dyna.actor.home.pos, &D_8088BF60); Math_Vec3f_Copy(&this->dyna.actor.home.pos, &D_8088BF60);
this->dyna.actor.world.pos.x = D_8088BF60.x; this->dyna.actor.world.pos.x = D_8088BF60.x;
this->dyna.actor.world.pos.z = D_8088BF60.z; this->dyna.actor.world.pos.z = D_8088BF60.z;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
D_8088BFC0 = 0.0f; D_8088BFC0 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4; player->stateFlags2 &= ~PLAYER_STATE2_4;
this->actionFunc = func_8088B79C; this->actionFunc = func_8088B79C;
@ -296,7 +296,7 @@ void func_8088B990(BgHidanRock* this, PlayState* play) {
this->timer++; this->timer++;
if (this->dyna.unk_150 != 0.0f) { if (this->dyna.unk_150 != 0.0f) {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4; player->stateFlags2 &= ~PLAYER_STATE2_4;
} }

View file

@ -161,11 +161,11 @@ void BgIceObjects_Slide(BgIceObjects* this, PlayState* play) {
f32 spread; f32 spread;
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f); Math_StepToF(&thisx->speed, 10.0f, 0.5f);
atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ); atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speed);
atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ); atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speed);
if (atTarget) { if (atTarget) {
thisx->speedXZ = 0.0f; thisx->speed = 0.0f;
this->targetPos.x = thisx->world.pos.x; this->targetPos.x = thisx->world.pos.x;
this->targetPos.z = thisx->world.pos.z; this->targetPos.z = thisx->world.pos.z;
if (thisx->velocity.y <= 0.0f) { if (thisx->velocity.y <= 0.0f) {
@ -179,7 +179,7 @@ void BgIceObjects_Slide(BgIceObjects* this, PlayState* play) {
} else { } else {
this->actionFunc = BgIceObjects_Idle; this->actionFunc = BgIceObjects_Idle;
} }
} else if ((thisx->speedXZ > 6.0f) && (thisx->world.pos.y >= 0.0f)) { } else if ((thisx->speed > 6.0f) && (thisx->world.pos.y >= 0.0f)) {
spread = Rand_CenteredFloat(120.0f); spread = Rand_CenteredFloat(120.0f);
velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158); velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158);
velocity.y = Rand_ZeroOne() + 1.0f; velocity.y = Rand_ZeroOne() + 1.0f;
@ -209,7 +209,7 @@ void BgIceObjects_Reset(BgIceObjects* this, PlayState* play) {
thisx->flags &= ~ACTOR_FLAG_4; thisx->flags &= ~ACTOR_FLAG_4;
Math_Vec3f_Copy(&this->targetPos, &thisx->home.pos); Math_Vec3f_Copy(&this->targetPos, &thisx->home.pos);
this->actionFunc = BgIceObjects_Idle; this->actionFunc = BgIceObjects_Idle;
thisx->speedXZ = 0.0f; thisx->speed = 0.0f;
} }
} }

View file

@ -114,8 +114,8 @@ void func_80891D6C(BgIceShutter* this, PlayState* play) {
} }
void func_80891DD4(BgIceShutter* this, PlayState* play) { void func_80891DD4(BgIceShutter* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.speedXZ, 30.0f, 2.0f); Math_StepToF(&this->dyna.actor.speed, 30.0f, 2.0f);
if (Math_StepToF(&this->dyna.actor.velocity.y, 210.0f, this->dyna.actor.speedXZ)) { if (Math_StepToF(&this->dyna.actor.velocity.y, 210.0f, this->dyna.actor.speed)) {
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
return; return;
} }

View file

@ -122,19 +122,19 @@ void BgJyaGoroiwa_SetupMove(BgJyaGoroiwa* this) {
void BgJyaGoroiwa_Move(BgJyaGoroiwa* this, PlayState* play) { void BgJyaGoroiwa_Move(BgJyaGoroiwa* this, PlayState* play) {
Actor* thisx = &this->actor; Actor* thisx = &this->actor;
s16 relYawTowardsPlayer; s16 relYawTowardsPlayer;
f32 speedXZsqBase = (-100.0f - thisx->world.pos.y) * 2.5f; f32 speedXZBaseSq = (-100.0f - thisx->world.pos.y) * 2.5f;
f32 posYfac; f32 posYfac;
if (speedXZsqBase < 0.01f) { if (speedXZBaseSq < 0.01f) {
speedXZsqBase = 0.01f; speedXZBaseSq = 0.01f;
} }
thisx->speedXZ = sqrtf(speedXZsqBase) * this->speedFactor; thisx->speed = sqrtf(speedXZBaseSq) * this->speedFactor;
thisx->velocity.x = Math_SinS(thisx->world.rot.y) * thisx->speedXZ; thisx->velocity.x = Math_SinS(thisx->world.rot.y) * thisx->speed;
thisx->velocity.z = Math_CosS(thisx->world.rot.y) * thisx->speedXZ; thisx->velocity.z = Math_CosS(thisx->world.rot.y) * thisx->speed;
thisx->world.pos.x = thisx->world.pos.x + thisx->velocity.x; thisx->world.pos.x += thisx->velocity.x;
thisx->world.pos.z = thisx->world.pos.z + thisx->velocity.z; thisx->world.pos.z += thisx->velocity.z;
if ((thisx->world.pos.x > 1466.0f) && (thisx->world.pos.x < 1673.0f)) { if ((thisx->world.pos.x > 1466.0f) && (thisx->world.pos.x < 1673.0f)) {
thisx->world.pos.y = -129.5f; thisx->world.pos.y = -129.5f;

View file

@ -119,7 +119,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk
Rand_ZeroOne() * 80.0f + this->dyna.actor.world.pos.y + 20.0f, this->dyna.actor.world.pos.z, 0, Rand_ZeroOne() * 80.0f + this->dyna.actor.world.pos.y + 20.0f, this->dyna.actor.world.pos.z, 0,
(s16)(Rand_ZeroOne() * 0x4000) + rotY - 0x2000, 0, 0); (s16)(Rand_ZeroOne() * 0x4000) + rotY - 0x2000, 0, 0);
if (actor != NULL) { if (actor != NULL) {
actor->speedXZ = Rand_ZeroOne() * 8.0f + 9.0f; actor->speed = Rand_ZeroOne() * 8.0f + 9.0f;
actor->velocity.y = Rand_ZeroOne() * 10.0f + 6.0f; actor->velocity.y = Rand_ZeroOne() * 10.0f + 6.0f;
} }
} }
@ -181,7 +181,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk
(Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.y + 10.0f, this->dyna.actor.world.pos.z, (Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.y + 10.0f, this->dyna.actor.world.pos.z,
0, ((s16)(s32)(Rand_ZeroOne() * 0x4000) + rotY) - 0x2000, 0, 0); 0, ((s16)(s32)(Rand_ZeroOne() * 0x4000) + rotY) - 0x2000, 0, 0);
if (actor != NULL) { if (actor != NULL) {
actor->speedXZ = Rand_ZeroOne() * 8.0f + 9.0f; actor->speed = Rand_ZeroOne() * 8.0f + 9.0f;
actor->velocity.y = Rand_ZeroOne() * 10.0f + 6.0f; actor->velocity.y = Rand_ZeroOne() * 10.0f + 6.0f;
} }
} }

View file

@ -322,11 +322,11 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) {
f32 dy; f32 dy;
f32 dz; f32 dz;
this->dyna.actor.speedXZ = MOVEBG_SPEED(this->dyna.actor.params) * 0.1f; this->dyna.actor.speed = MOVEBG_SPEED(this->dyna.actor.params) * 0.1f;
func_8089E108(play->pathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId); func_8089E108(play->pathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId);
dist = Actor_WorldDistXYZToPoint(&this->dyna.actor, &waypoint); dist = Actor_WorldDistXYZToPoint(&this->dyna.actor, &waypoint);
if (dist < this->dyna.actor.speedXZ) { if (dist < this->dyna.actor.speed) {
this->dyna.actor.speedXZ = dist; this->dyna.actor.speed = dist;
} }
func_80035844(&this->dyna.actor.world.pos, &waypoint, &this->dyna.actor.world.rot, 1); func_80035844(&this->dyna.actor.world.pos, &waypoint, &this->dyna.actor.world.rot, 1);
func_8002D97C(&this->dyna.actor); func_8002D97C(&this->dyna.actor);

View file

@ -385,9 +385,9 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) {
s32 blockStop; s32 blockStop;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
this->dyna.actor.speedXZ += 0.1f; this->dyna.actor.speed += 0.1f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); this->dyna.actor.speed = CLAMP_MAX(this->dyna.actor.speed, 2.0f);
blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speedXZ); blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speed);
displacement = this->direction * blockPushDist; displacement = this->direction * blockPushDist;
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z;
@ -400,7 +400,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) {
this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
blockPushDist = 0.0f; blockPushDist = 0.0f;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->direction = 5; this->direction = 5;
sBlocksAtRest++; sBlocksAtRest++;
this->actionFunc = BgPoEvent_BlockIdle; this->actionFunc = BgPoEvent_BlockIdle;

View file

@ -58,11 +58,9 @@ void BgPushbox_Destroy(Actor* thisx, PlayState* play) {
} }
void BgPushbox_UpdateImpl(BgPushbox* this, PlayState* play) { void BgPushbox_UpdateImpl(BgPushbox* this, PlayState* play) {
this->dyna.actor.speedXZ += this->dyna.unk_150 * 0.2f; this->dyna.actor.speed += this->dyna.unk_150 * 0.2f;
this->dyna.actor.speedXZ = (this->dyna.actor.speedXZ < -1.0f) this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -1.0f, 1.0f);
? -1.0f Math_StepToF(&this->dyna.actor.speed, 0.0f, 0.2f);
: ((this->dyna.actor.speedXZ > 1.0f) ? 1.0f : this->dyna.actor.speedXZ);
Math_StepToF(&this->dyna.actor.speedXZ, 0.0f, 0.2f);
this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.world.rot.y = this->dyna.unk_158;
Actor_MoveForward(&this->dyna.actor); Actor_MoveForward(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 40.0f, 40.0f, Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 40.0f, 40.0f,

View file

@ -82,13 +82,13 @@ void func_808AE5B4(BgSpot05Soko* this, PlayState* play) {
Actor_SetFocus(&this->dyna.actor, 50.0f); Actor_SetFocus(&this->dyna.actor, 50.0f);
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
this->actionFunc = func_808AE630; this->actionFunc = func_808AE630;
this->dyna.actor.speedXZ = 0.5f; this->dyna.actor.speed = 0.5f;
} }
} }
void func_808AE630(BgSpot05Soko* this, PlayState* play) { void func_808AE630(BgSpot05Soko* this, PlayState* play) {
this->dyna.actor.speedXZ *= 1.5f; this->dyna.actor.speed *= 1.5f;
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 120.0f, this->dyna.actor.speedXZ) != if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 120.0f, this->dyna.actor.speed) !=
0) { 0) {
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
} }

View file

@ -196,7 +196,7 @@ s32 func_808B4E58(BgSpot16Bombstone* this, PlayState* play) {
Actor_ProcessInitChain(actor, sInitChainDebris); Actor_ProcessInitChain(actor, sInitChainDebris);
actor->speedXZ = D_808B5DD8[actor->params][0]; actor->speed = D_808B5DD8[actor->params][0];
actor->velocity.y = D_808B5DD8[actor->params][1]; actor->velocity.y = D_808B5DD8[actor->params][1];
Actor_SetScale(actor, D_808B5DD8[actor->params][2] * scaleFactor); Actor_SetScale(actor, D_808B5DD8[actor->params][2] * scaleFactor);

View file

@ -236,7 +236,7 @@ void func_808B8E7C(BgSpot18Obj* this, PlayState* play) {
void func_808B8EE0(BgSpot18Obj* this) { void func_808B8EE0(BgSpot18Obj* this) {
this->actionFunc = func_808B8F08; this->actionFunc = func_808B8F08;
this->dyna.actor.world.rot.y = 0; this->dyna.actor.world.rot.y = 0;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.velocity.z = 0.0f;
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.velocity.x = 0.0f; this->dyna.actor.velocity.x = 0.0f;
@ -246,7 +246,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) {
s32 pad; s32 pad;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Math_StepToF(&this->dyna.actor.speedXZ, 1.2f, 0.1f); Math_StepToF(&this->dyna.actor.speed, 1.2f, 0.1f);
Actor_MoveForward(&this->dyna.actor); Actor_MoveForward(&this->dyna.actor);
func_808B8DDC(this, play); func_808B8DDC(this, play);

View file

@ -308,7 +308,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) {
this->timer = 14; this->timer = 14;
} }
} }
if (player->actor.speedXZ != 0.0f) { if (player->actor.speed != 0.0f) {
if (this->unk_16C < 0.1f) { if (this->unk_16C < 0.1f) {
this->timer = 14; this->timer = 14;
} }

View file

@ -285,7 +285,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
player->actor.world.pos.x = -890.0f; player->actor.world.pos.x = -890.0f;
player->actor.world.pos.z = -2804.0f; player->actor.world.pos.z = -2804.0f;
player->actor.speedXZ = 0.0f; player->actor.speed = 0.0f;
player->actor.shape.rot.y = player->actor.world.rot.y = 0x3FFF; player->actor.shape.rot.y = player->actor.world.rot.y = 0x3FFF;
this->subCamEye.x = -890.0f; this->subCamEye.x = -890.0f;
@ -489,7 +489,7 @@ void BossDodongo_SetupRoll(BossDodongo* this) {
} }
void BossDodongo_SetupBlowFire(BossDodongo* this) { void BossDodongo_SetupBlowFire(BossDodongo* this) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->unk_1E4 = 0.0f; this->unk_1E4 = 0.0f;
Animation_Change(&this->skelAnime, &object_kingdodongo_Anim_0061D4, 1.0f, 0.0f, Animation_Change(&this->skelAnime, &object_kingdodongo_Anim_0061D4, 1.0f, 0.0f,
Animation_GetLastFrame(&object_kingdodongo_Anim_0061D4), ANIMMODE_ONCE, 0.0f); Animation_GetLastFrame(&object_kingdodongo_Anim_0061D4), ANIMMODE_ONCE, 0.0f);
@ -499,7 +499,7 @@ void BossDodongo_SetupBlowFire(BossDodongo* this) {
} }
void BossDodongo_SetupInhale(BossDodongo* this) { void BossDodongo_SetupInhale(BossDodongo* this) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Animation_Change(&this->skelAnime, &object_kingdodongo_Anim_008EEC, 1.0f, 0.0f, Animation_Change(&this->skelAnime, &object_kingdodongo_Anim_008EEC, 1.0f, 0.0f,
Animation_GetLastFrame(&object_kingdodongo_Anim_008EEC), ANIMMODE_ONCE, -5.0f); Animation_GetLastFrame(&object_kingdodongo_Anim_008EEC), ANIMMODE_ONCE, -5.0f);
this->actionFunc = BossDodongo_Inhale; this->actionFunc = BossDodongo_Inhale;
@ -1274,7 +1274,7 @@ void BossDodongo_UpdateDamage(BossDodongo* this, PlayState* play) {
} }
void BossDodongo_SetupDeathCutscene(BossDodongo* this) { void BossDodongo_SetupDeathCutscene(BossDodongo* this) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->unk_1E4 = 0.0f; this->unk_1E4 = 0.0f;
Animation_Change(&this->skelAnime, &object_kingdodongo_Anim_002D0C, 1.0f, 0.0f, Animation_Change(&this->skelAnime, &object_kingdodongo_Anim_002D0C, 1.0f, 0.0f,
Animation_GetLastFrame(&object_kingdodongo_Anim_002D0C), ANIMMODE_ONCE, -5.0f); Animation_GetLastFrame(&object_kingdodongo_Anim_002D0C), ANIMMODE_ONCE, -5.0f);
@ -1364,7 +1364,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) {
Math_SmoothStepToF(&this->unk_204, 1.0f, 1.0f, 0.1f, 0.0f); Math_SmoothStepToF(&this->unk_204, 1.0f, 1.0f, 0.1f, 0.0f);
if (this->unk_1DA == 1) { if (this->unk_1DA == 1) {
this->csState = 8; this->csState = 8;
this->actor.speedXZ = this->unk_1E4 / 1.5f; this->actor.speed = this->unk_1E4 / 1.5f;
if (this->unk_1A2 == 0) { if (this->unk_1A2 == 0) {
this->unk_238 = 250.0f; this->unk_238 = 250.0f;
} else { } else {
@ -1527,7 +1527,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) {
false); false);
} }
} }
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.2f, 0.1f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.2f, 0.1f, 0.0f);
this->actor.world.rot.y += (s16)this->unk_238; this->actor.world.rot.y += (s16)this->unk_238;
this->unk_1C4 += (s16)this->unk_234; this->unk_1C4 += (s16)this->unk_234;
if (this->unk_1DA >= 0x367) { if (this->unk_1DA >= 0x367) {

View file

@ -320,7 +320,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
player2->actor.world.pos.y = 100.0f; player2->actor.world.pos.y = 100.0f;
player2->actor.world.pos.z = 0.0f; player2->actor.world.pos.z = 0.0f;
player2->actor.shape.rot.y = player2->actor.world.rot.y = -0x4000; player2->actor.shape.rot.y = player2->actor.world.rot.y = -0x4000;
player2->actor.speedXZ = 0.0f; player2->actor.speed = 0.0f;
this->subCamEye.x = player2->actor.world.pos.x - 70.0f; this->subCamEye.x = player2->actor.world.pos.x - 70.0f;
this->subCamEye.y = player2->actor.world.pos.y + 40.0f; this->subCamEye.y = player2->actor.world.pos.y + 40.0f;
this->subCamEye.z = player2->actor.world.pos.z + 70.0f; this->subCamEye.z = player2->actor.world.pos.z + 70.0f;
@ -377,7 +377,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
player2->actor.world.pos.x = 380.0f; player2->actor.world.pos.x = 380.0f;
player2->actor.world.pos.y = 100.0f; player2->actor.world.pos.y = 100.0f;
player2->actor.world.pos.z = 0.0f; player2->actor.world.pos.z = 0.0f;
player2->actor.speedXZ = 0.0f; player2->actor.speed = 0.0f;
player2->actor.shape.rot.y = player2->actor.world.rot.y = -0x4000; player2->actor.shape.rot.y = player2->actor.world.rot.y = -0x4000;
if (this->timers[0] == 50) { if (this->timers[0] == 50) {
this->fogMode = 1; this->fogMode = 1;
@ -824,7 +824,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
} }
break; break;
case BOSSFD_SKULL_FALL: case BOSSFD_SKULL_FALL:
this->fwork[BFD_TURN_RATE] = this->fwork[BFD_TURN_RATE_MAX] = this->actor.speedXZ = this->fwork[BFD_TURN_RATE] = this->fwork[BFD_TURN_RATE_MAX] = this->actor.speed =
this->fwork[BFD_FLY_SPEED] = 0; this->fwork[BFD_FLY_SPEED] = 0;
if (this->timers[0] == 1) { if (this->timers[0] == 1) {
@ -879,7 +879,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
case BOSSFD_SKULL_BURN: case BOSSFD_SKULL_BURN:
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.world.pos.y = 110.0f; this->actor.world.pos.y = 110.0f;
this->fwork[BFD_TURN_RATE] = this->fwork[BFD_TURN_RATE_MAX] = this->actor.speedXZ = this->fwork[BFD_TURN_RATE] = this->fwork[BFD_TURN_RATE_MAX] = this->actor.speed =
this->fwork[BFD_FLY_SPEED] = 0.0f; this->fwork[BFD_FLY_SPEED] = 0.0f;
if ((50 > this->timers[0]) && (this->timers[0] > 0)) { if ((50 > this->timers[0]) && (this->timers[0] > 0)) {
@ -937,7 +937,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
Math_ApproachS(&this->actor.world.rot.x, pitchToTarget, 0xA, this->fwork[BFD_TURN_RATE]); Math_ApproachS(&this->actor.world.rot.x, pitchToTarget, 0xA, this->fwork[BFD_TURN_RATE]);
Math_ApproachF(&this->fwork[BFD_TURN_RATE], this->fwork[BFD_TURN_RATE_MAX], 1.0f, 20000.0f); Math_ApproachF(&this->fwork[BFD_TURN_RATE], this->fwork[BFD_TURN_RATE_MAX], 1.0f, 20000.0f);
Math_ApproachF(&this->actor.speedXZ, this->fwork[BFD_FLY_SPEED], 1.0f, 0.1f); Math_ApproachF(&this->actor.speed, this->fwork[BFD_FLY_SPEED], 1.0f, 0.1f);
if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) { if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) {
func_8002D908(&this->actor); func_8002D908(&this->actor);
} }
@ -1930,7 +1930,7 @@ void BossFd_DrawBody(PlayState* play, BossFd* this) {
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, (s8)this->fwork[BFD_HEAD_TEX2_ALPHA]); gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, (s8)this->fwork[BFD_HEAD_TEX2_ALPHA]);
Matrix_Push(); Matrix_Push();
temp_float = temp_float =
(this->work[BFD_ACTION_STATE] >= BOSSFD_SKULL_FALL) ? -20.0f : -10.0f - ((this->actor.speedXZ - 5.0f) * 10.0f); (this->work[BFD_ACTION_STATE] >= BOSSFD_SKULL_FALL) ? -20.0f : -10.0f - ((this->actor.speed - 5.0f) * 10.0f);
segIndex = (this->work[BFD_LEAD_BODY_SEG] + sBodyIndex[0]) % 100; segIndex = (this->work[BFD_LEAD_BODY_SEG] + sBodyIndex[0]) % 100;
Matrix_Translate(this->bodySegsPos[segIndex].x, this->bodySegsPos[segIndex].y, this->bodySegsPos[segIndex].z, Matrix_Translate(this->bodySegsPos[segIndex].x, this->bodySegsPos[segIndex].y, this->bodySegsPos[segIndex].z,
MTXMODE_NEW); MTXMODE_NEW);

View file

@ -423,7 +423,7 @@ void BossGanon_Init(Actor* thisx, PlayState* play2) {
thisx->update = func_808E1EB4; thisx->update = func_808E1EB4;
thisx->draw = func_808E229C; thisx->draw = func_808E229C;
if (1) {} if (1) {}
thisx->speedXZ = 11.0f; thisx->speed = 11.0f;
if (thisx->params == 0xC8) { if (thisx->params == 0xC8) {
this->timers[0] = 7; this->timers[0] = 7;
@ -439,7 +439,7 @@ void BossGanon_Init(Actor* thisx, PlayState* play2) {
// light ball (anything from 0x64 - 0xC7) // light ball (anything from 0x64 - 0xC7)
thisx->update = BossGanon_LightBall_Update; thisx->update = BossGanon_LightBall_Update;
thisx->draw = BossGanon_LightBall_Draw; thisx->draw = BossGanon_LightBall_Draw;
thisx->speedXZ = 12.0f; thisx->speed = 12.0f;
xDistFromPlayer = player->actor.world.pos.x - thisx->world.pos.x; xDistFromPlayer = player->actor.world.pos.x - thisx->world.pos.x;
yDistFromPlayer = (player->actor.world.pos.y + 30.0f) - thisx->world.pos.y; yDistFromPlayer = (player->actor.world.pos.y + 30.0f) - thisx->world.pos.y;
@ -3969,7 +3969,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
} }
if (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) { if (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) {
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
} }
break; break;
} else { } else {
@ -4000,7 +4000,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
case 1: case 1:
if ((ganondorf->actionFunc == BossGanon_PlayTennis) && (ganondorf->unk_1C2 == 1)) { if ((ganondorf->actionFunc == BossGanon_PlayTennis) && (ganondorf->unk_1C2 == 1)) {
minReflectDist = (this->actor.speedXZ >= 19.0f) ? 250.0f : 170.0f; minReflectDist = (this->actor.speed >= 19.0f) ? 250.0f : 170.0f;
if (sqrtf(SQ(xDistFromGanondorf) + SQ(yDistFromGanondorf) + SQ(zDistFromGanondorf)) < if (sqrtf(SQ(xDistFromGanondorf) + SQ(yDistFromGanondorf) + SQ(zDistFromGanondorf)) <
minReflectDist) { minReflectDist) {
@ -4226,7 +4226,7 @@ void func_808E1EB4(Actor* thisx, PlayState* play2) {
if (sqrtf(SQ(xDiff) + SQ(zDiff) + SQ(yDiff)) < 40.0f) { if (sqrtf(SQ(xDiff) + SQ(zDiff) + SQ(yDiff)) < 40.0f) {
this->unk_1C2 = 2; this->unk_1C2 = 2;
this->timers[0] = 30; this->timers[0] = 30;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->actor.params == 0xC8) { if (this->actor.params == 0xC8) {
func_80078884(NA_SE_EN_GANON_DAMAGE2); func_80078884(NA_SE_EN_GANON_DAMAGE2);
@ -4338,7 +4338,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
switch (this->unk_1C2) { switch (this->unk_1C2) {
if (1) {} if (1) {}
case 0: case 0:
this->actor.speedXZ = 40.0f; this->actor.speed = 40.0f;
Math_ApproachF(&this->fwork[1], 255.0f, 1.0f, 40.0f); Math_ApproachF(&this->fwork[1], 255.0f, 1.0f, 40.0f);
xDiff = dorf->unk_278.x - this->actor.world.pos.x; xDiff = dorf->unk_278.x - this->actor.world.pos.x;
yDiff = dorf->unk_278.y - this->actor.world.pos.y; yDiff = dorf->unk_278.y - this->actor.world.pos.y;
@ -4360,7 +4360,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
if (sqrtf(SQ(xDiff) + SQ(zDiff) + SQ(yDiff)) < 45.0f) { if (sqrtf(SQ(xDiff) + SQ(zDiff) + SQ(yDiff)) < 45.0f) {
this->unk_1C2 = 1; this->unk_1C2 = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
break; break;
@ -4380,7 +4380,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
this->collider.dim.height = 20; this->collider.dim.height = 20;
this->collider.dim.yShift = -10; this->collider.dim.yShift = -10;
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
this->fwork[1] = 255.0f; this->fwork[1] = 255.0f;
this->unk_1F0 = player->actor.world.pos; this->unk_1F0 = player->actor.world.pos;
new_var = this->unk_1F0.x - this->actor.world.pos.x; new_var = this->unk_1F0.x - this->actor.world.pos.x;
@ -4411,7 +4411,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
if ((player->meleeWeaponState != 0) && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) && if ((player->meleeWeaponState != 0) && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) &&
(this->actor.xzDistToPlayer < 80.0f)) { (this->actor.xzDistToPlayer < 80.0f)) {
this->unk_1C2 = 0xC; this->unk_1C2 = 0xC;
this->actor.speedXZ = -30.0f; this->actor.speed = -30.0f;
func_8002D908(&this->actor); func_8002D908(&this->actor);
func_8002D7EC(&this->actor); func_8002D7EC(&this->actor);
this->unk_1F0 = dorf->unk_1FC; this->unk_1F0 = dorf->unk_1FC;
@ -4427,7 +4427,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
if (!(acHitInfo->toucher.dmgFlags & DMG_SHIELD) || Player_HasMirrorShieldEquipped(play)) { if (!(acHitInfo->toucher.dmgFlags & DMG_SHIELD) || Player_HasMirrorShieldEquipped(play)) {
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
this->unk_1C2 = 0xC; this->unk_1C2 = 0xC;
this->actor.speedXZ = -30.0f; this->actor.speed = -30.0f;
func_8002D908(&this->actor); func_8002D908(&this->actor);
func_8002D7EC(&this->actor); func_8002D7EC(&this->actor);
@ -4457,7 +4457,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
if (sqrtf(SQ(xDiff) + SQ(zDiff) + SQ(yDiff)) < 30.0f) { if (sqrtf(SQ(xDiff) + SQ(zDiff) + SQ(yDiff)) < 30.0f) {
this->unk_1C2 = 1; this->unk_1C2 = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (dorf->timers[2] == 0) { if (dorf->timers[2] == 0) {
func_8002F6D4(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50); func_8002F6D4(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50);
@ -4477,7 +4477,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
break; break;
case 12: case 12:
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
xDiff = this->unk_1F0.x - this->actor.world.pos.x; xDiff = this->unk_1F0.x - this->actor.world.pos.x;
yDiff = this->unk_1F0.y - this->actor.world.pos.y; yDiff = this->unk_1F0.y - this->actor.world.pos.y;
@ -4508,7 +4508,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
this->timers[0] = 150; this->timers[0] = 150;
numEffects = 40; numEffects = 40;
this->unk_1C2 = 1; this->unk_1C2 = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
break; break;
} }
@ -4520,7 +4520,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
(fabsf(this->actor.world.pos.z) > (465.0f + xzDist)) || (this->actor.world.pos.y < 0.0f) || (fabsf(this->actor.world.pos.z) > (465.0f + xzDist)) || (this->actor.world.pos.y < 0.0f) ||
(this->actor.world.pos.y > 450.0f)) { (this->actor.world.pos.y > 450.0f)) {
this->unk_1C2 = 1; this->unk_1C2 = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
numEffects = 10; numEffects = 10;
BossGanon_CheckFallingPlatforms(this, play, &this->actor.world.pos); BossGanon_CheckFallingPlatforms(this, play, &this->actor.world.pos);
Actor_SpawnAsChild(&play->actorCtx, &dorf->actor, play, ACTOR_BOSS_GANON, this->actor.world.pos.x, Actor_SpawnAsChild(&play->actorCtx, &dorf->actor, play, ACTOR_BOSS_GANON, this->actor.world.pos.x,

View file

@ -1069,7 +1069,7 @@ void func_808FFEBC(BossGanon2* this, PlayState* play) {
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f);
if (this->unk_1A2[0] == 0) { if (this->unk_1A2[0] == 0) {
func_809002CC(this, play); func_809002CC(this, play);
@ -1091,7 +1091,7 @@ void func_808FFFE0(BossGanon2* this, PlayState* play) {
s16 target; s16 target;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f);
if (this->unk_1A2[0] == 0) { if (this->unk_1A2[0] == 0) {
func_809002CC(this, play); func_809002CC(this, play);
@ -1115,7 +1115,7 @@ void func_809000A0(BossGanon2* this, PlayState* play) {
void func_80900104(BossGanon2* this, PlayState* play) { void func_80900104(BossGanon2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f);
switch (this->unk_1AC) { switch (this->unk_1AC) {
case 0: case 0:
@ -1148,7 +1148,7 @@ void func_80900210(BossGanon2* this, PlayState* play) {
void func_8090026C(BossGanon2* this, PlayState* play) { void func_8090026C(BossGanon2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
if (Animation_OnFrame(&this->skelAnime, this->unk_194)) { if (Animation_OnFrame(&this->skelAnime, this->unk_194)) {
func_809002CC(this, play); func_809002CC(this, play);
@ -1201,7 +1201,7 @@ void func_80900344(BossGanon2* this, PlayState* play) {
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachF(&this->actor.speedXZ, phi_f0, 0.5f, 1.0f); Math_ApproachF(&this->actor.speed, phi_f0, 0.5f, 1.0f);
if (this->unk_1A2[0] == 0) { if (this->unk_1A2[0] == 0) {
func_808FFDB0(this, play); func_808FFDB0(this, play);
@ -1245,7 +1245,7 @@ void func_80900650(BossGanon2* this, PlayState* play) {
this->unk_312 = 2; this->unk_312 = 2;
} }
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f);
if (Animation_OnFrame(&this->skelAnime, this->unk_194)) { if (Animation_OnFrame(&this->skelAnime, this->unk_194)) {
this->unk_311 = 1 - this->unk_311; this->unk_311 = 1 - this->unk_311;
@ -1428,7 +1428,7 @@ void func_80900890(BossGanon2* this, PlayState* play) {
break; break;
} }
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f);
} }
void func_80901020(BossGanon2* this, PlayState* play) { void func_80901020(BossGanon2* this, PlayState* play) {
@ -1493,7 +1493,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
this->unk_1A2[2] = 0; this->unk_1A2[2] = 0;
this->unk_336 = 0; this->unk_336 = 0;
this->unk_324 = 0.0f; this->unk_324 = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->unk_31A = this->unk_31C; this->unk_31A = this->unk_31C;
play->envCtx.lightBlend = 0.0f; play->envCtx.lightBlend = 0.0f;
FALLTHROUGH; FALLTHROUGH;

View file

@ -821,7 +821,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) {
if (this->timers[0] == 0) { if (this->timers[0] == 0) {
this->work[GND_ACTION_STATE] = CHARGE_START; this->work[GND_ACTION_STATE] = CHARGE_START;
this->timers[0] = 10; this->timers[0] = 10;
thisx->speedXZ = 0.0f; thisx->speed = 0.0f;
this->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonChargeStartAnim); this->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonChargeStartAnim);
Animation_MorphToPlayOnce(&this->skelAnime, &gPhantomGanonChargeStartAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gPhantomGanonChargeStartAnim, 0.0f);
} }
@ -849,7 +849,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) {
func_8002D908(thisx); func_8002D908(thisx);
func_8002D7EC(thisx); func_8002D7EC(thisx);
Math_ApproachF(&thisx->speedXZ, 10.0f, 1.0f, 0.5f); Math_ApproachF(&thisx->speed, 10.0f, 1.0f, 0.5f);
if ((sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) || (thisx->xyzDistToPlayerSq < SQ(100.0f))) { if ((sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) || (thisx->xyzDistToPlayerSq < SQ(100.0f))) {
this->work[GND_ACTION_STATE] = CHARGE_FINISH; this->work[GND_ACTION_STATE] = CHARGE_FINISH;
this->timers[0] = 20; this->timers[0] = 20;
@ -865,15 +865,15 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) {
} }
if (sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) { if (sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) {
Math_ApproachZeroF(&thisx->speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&thisx->speed, 1.0f, 2.0f);
this->timers[0] = 0; this->timers[0] = 0;
} }
if (this->timers[0] == 0) { if (this->timers[0] == 0) {
Math_ApproachZeroF(&thisx->speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&thisx->speed, 1.0f, 2.0f);
Math_ApproachZeroF(&thisx->velocity.y, 1.0f, 2.0f); Math_ApproachZeroF(&thisx->velocity.y, 1.0f, 2.0f);
Math_ApproachS(&thisx->shape.rot.y, thisx->yawTowardsPlayer, 5, 0x7D0); Math_ApproachS(&thisx->shape.rot.y, thisx->yawTowardsPlayer, 5, 0x7D0);
if ((thisx->speedXZ <= 0.5f) && (fabsf(thisx->velocity.y) <= 0.1f)) { if ((thisx->speed <= 0.5f) && (fabsf(thisx->velocity.y) <= 0.1f)) {
BossGanondrof_SetupNeutral(this, -10.0f); BossGanondrof_SetupNeutral(this, -10.0f);
this->timers[0] = 30; this->timers[0] = 30;
this->flyMode = GND_FLY_NEUTRAL; this->flyMode = GND_FLY_NEUTRAL;
@ -963,7 +963,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) {
Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
osSyncPrintf("8\n"); osSyncPrintf("8\n");
this->deathState = DEATH_THROES; this->deathState = DEATH_THROES;
player->actor.speedXZ = 0.0f; player->actor.speed = 0.0f;
this->timers[0] = 50; this->timers[0] = 50;
this->subCamEye = mainCam->eye; this->subCamEye = mainCam->eye;
this->subCamAt = mainCam->at; this->subCamAt = mainCam->at;

View file

@ -405,7 +405,7 @@ void BossGoma_SetupDefeated(BossGoma* this, PlayState* play) {
this->framesUntilNextAction = 1200; this->framesUntilNextAction = 1200;
this->actionState = 0; this->actionState = 0;
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.shape.shadowScale = 0.0f; this->actor.shape.shadowScale = 0.0f;
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_DEAD); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_DEAD);
@ -452,7 +452,7 @@ void BossGoma_SetupCeilingIdle(BossGoma* this) {
void BossGoma_SetupFallJump(BossGoma* this) { void BossGoma_SetupFallJump(BossGoma* this) {
Animation_Change(&this->skelanime, &gGohmaLandAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -5.0f); Animation_Change(&this->skelanime, &gGohmaLandAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -5.0f);
this->actionFunc = BossGoma_FallJump; this->actionFunc = BossGoma_FallJump;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = -2.0f; this->actor.gravity = -2.0f;
} }
@ -463,7 +463,7 @@ void BossGoma_SetupFallJump(BossGoma* this) {
void BossGoma_SetupFallStruckDown(BossGoma* this) { void BossGoma_SetupFallStruckDown(BossGoma* this) {
Animation_Change(&this->skelanime, &gGohmaCrashAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -5.0f); Animation_Change(&this->skelanime, &gGohmaCrashAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -5.0f);
this->actionFunc = BossGoma_FallStruckDown; this->actionFunc = BossGoma_FallStruckDown;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = -2.0f; this->actor.gravity = -2.0f;
} }
@ -486,7 +486,7 @@ void BossGoma_SetupWallClimb(BossGoma* this) {
Animation_Change(&this->skelanime, &gGohmaClimbAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGohmaClimbAnim), Animation_Change(&this->skelanime, &gGohmaClimbAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGohmaClimbAnim),
ANIMMODE_LOOP, -10.0f); ANIMMODE_LOOP, -10.0f);
this->actionFunc = BossGoma_WallClimb; this->actionFunc = BossGoma_WallClimb;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
} }
@ -498,7 +498,7 @@ void BossGoma_SetupCeilingMoveToCenter(BossGoma* this) {
Animation_Change(&this->skelanime, &gGohmaWalkAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGohmaWalkAnim), Animation_Change(&this->skelanime, &gGohmaWalkAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGohmaWalkAnim),
ANIMMODE_LOOP, -5.0f); ANIMMODE_LOOP, -5.0f);
this->actionFunc = BossGoma_CeilingMoveToCenter; this->actionFunc = BossGoma_CeilingMoveToCenter;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->framesUntilNextAction = Rand_S16Offset(30, 60); this->framesUntilNextAction = Rand_S16Offset(30, 60);
@ -595,7 +595,7 @@ void BossGoma_UpdateCeilingMovement(BossGoma* this, PlayState* play, f32 dz, f32
roomCenter.z += dz; // dz is always 0 roomCenter.z += dz; // dz is always 0
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachF(&this->actor.speedXZ, targetSpeedXZ, 0.5f, 2.0f); Math_ApproachF(&this->actor.speed, targetSpeedXZ, 0.5f, 2.0f);
if (rotateTowardsCenter) { if (rotateTowardsCenter) {
Math_ApproachS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &roomCenter) + 0x8000, 3, Math_ApproachS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &roomCenter) + 0x8000, 3,
@ -674,7 +674,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s32 pad[2]; s32 pad[2];
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
switch (this->actionState) { switch (this->actionState) {
case 0: // wait for the player to enter the room case 0: // wait for the player to enter the room
@ -725,7 +725,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
player->actor.world.pos.x = 150.0f; player->actor.world.pos.x = 150.0f;
player->actor.world.pos.z = 300.0f; player->actor.world.pos.z = 300.0f;
player->actor.world.rot.y = player->actor.shape.rot.y; player->actor.world.rot.y = player->actor.shape.rot.y;
player->actor.speedXZ = 0.0f; player->actor.speed = 0.0f;
if (this->framesUntilNextAction == 0) { if (this->framesUntilNextAction == 0) {
// (-20, 25, -65) is towards room center // (-20, 25, -65) is towards room center
@ -777,7 +777,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
if (fabsf(this->actor.projectedPos.x) < 150.0f && fabsf(this->actor.projectedPos.y) < 250.0f && if (fabsf(this->actor.projectedPos.x) < 150.0f && fabsf(this->actor.projectedPos.y) < 250.0f &&
this->actor.projectedPos.z < 800.0f && this->actor.projectedPos.z > 0.0f) { this->actor.projectedPos.z < 800.0f && this->actor.projectedPos.z > 0.0f) {
this->lookedAtFrames++; this->lookedAtFrames++;
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
Math_ApproachS(&this->actor.world.rot.y, Math_ApproachS(&this->actor.world.rot.y,
Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) + 0x8000, 2, 0xBB8); Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) + 0x8000, 2, 0xBB8);
this->eyeLidBottomRotX = this->eyeLidTopRotX = this->eyeIrisRotX = this->eyeIrisRotY = 0; this->eyeLidBottomRotX = this->eyeLidTopRotX = this->eyeIrisRotX = this->eyeIrisRotY = 0;
@ -845,7 +845,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
if (this->framesUntilNextAction < 0) { if (this->framesUntilNextAction < 0) {
//! @bug ? unreachable, timer is >= 0 //! @bug ? unreachable, timer is >= 0
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f);
} else { } else {
BossGoma_UpdateCeilingMovement(this, play, 0.0f, -7.5f, false); BossGoma_UpdateCeilingMovement(this, play, 0.0f, -7.5f, false);
} }
@ -857,7 +857,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
if (this->framesUntilNextAction == 0) { if (this->framesUntilNextAction == 0) {
this->actionState = 9; this->actionState = 9;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = -2.0f; this->actor.gravity = -2.0f;
Animation_Change(&this->skelanime, &gGohmaInitialLandingAnim, 1.0f, 0.0f, Animation_Change(&this->skelanime, &gGohmaInitialLandingAnim, 1.0f, 0.0f,
@ -1255,7 +1255,7 @@ void BossGoma_Defeated(BossGoma* this, PlayState* play) {
*/ */
void BossGoma_FloorAttackPosture(BossGoma* this, PlayState* play) { void BossGoma_FloorAttackPosture(BossGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
if (this->skelanime.curFrame >= (19.0f + 1.0f / 3.0f) && this->skelanime.curFrame <= 30.0f) { if (this->skelanime.curFrame >= (19.0f + 1.0f / 3.0f) && this->skelanime.curFrame <= 30.0f) {
Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 3, Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 3,
@ -1406,7 +1406,7 @@ void BossGoma_FloorStunned(BossGoma* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 55.0f, 4, 8.0f, 500, 10, true); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 55.0f, 4, 8.0f, 500, 10, true);
} }
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f);
if (this->framesUntilNextAction == 0) { if (this->framesUntilNextAction == 0) {
BossGoma_SetupFloorMain(this); BossGoma_SetupFloorMain(this);
@ -1468,7 +1468,7 @@ void BossGoma_CeilingSpawnGohmas(BossGoma* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_UNARI); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_UNARI);
} }
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
this->spawnGohmasActionTimer++; this->spawnGohmasActionTimer++;
switch (this->spawnGohmasActionTimer) { switch (this->spawnGohmasActionTimer) {
@ -1530,7 +1530,7 @@ void BossGoma_CeilingPrepareSpawnGohmas(BossGoma* this, PlayState* play) {
*/ */
void BossGoma_FloorIdle(BossGoma* this, PlayState* play) { void BossGoma_FloorIdle(BossGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
Math_ApproachS(&this->actor.shape.rot.x, 0, 2, 0xBB8); Math_ApproachS(&this->actor.shape.rot.x, 0, 2, 0xBB8);
if (this->framesUntilNextAction == 0) { if (this->framesUntilNextAction == 0) {
@ -1547,7 +1547,7 @@ void BossGoma_CeilingIdle(BossGoma* this, PlayState* play) {
s16 i; s16 i;
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
if (this->framesUntilNextAction == 0) { if (this->framesUntilNextAction == 0) {
if (this->childrenGohmaState[0] == 0 && this->childrenGohmaState[1] == 0 && this->childrenGohmaState[2] == 0) { if (this->childrenGohmaState[0] == 0 && this->childrenGohmaState[1] == 0 && this->childrenGohmaState[2] == 0) {
@ -1613,19 +1613,19 @@ void BossGoma_FloorMain(BossGoma* this, PlayState* play) {
BossGoma_SetupFloorAttackPosture(this); BossGoma_SetupFloorAttackPosture(this);
} }
Math_ApproachF(&this->actor.speedXZ, 10.0f / 3.0f, 0.5f, 2.0f); Math_ApproachF(&this->actor.speed, 10.0f / 3.0f, 0.5f, 2.0f);
Math_ApproachS(&this->actor.world.rot.y, rot, 5, 0x3E8); Math_ApproachS(&this->actor.world.rot.y, rot, 5, 0x3E8);
} else { } else {
if (this->timer != 0) { if (this->timer != 0) {
// move away from the player, walking backwards // move away from the player, walking backwards
Math_ApproachF(&this->actor.speedXZ, -10.0f, 0.5f, 2.0f); Math_ApproachF(&this->actor.speed, -10.0f, 0.5f, 2.0f);
this->skelanime.playSpeed = -3.0f; this->skelanime.playSpeed = -3.0f;
if (this->timer == 1) { if (this->timer == 1) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} else { } else {
// move away from the player, walking forwards // move away from the player, walking forwards
Math_ApproachF(&this->actor.speedXZ, 20.0f / 3.0f, 0.5f, 2.0f); Math_ApproachF(&this->actor.speed, 20.0f / 3.0f, 0.5f, 2.0f);
this->skelanime.playSpeed = 2.0f; this->skelanime.playSpeed = 2.0f;
rot += 0x8000; rot += 0x8000;
} }

View file

@ -613,7 +613,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed);
} }
this->targetPos = this->actor.world.pos; this->targetPos = this->actor.world.pos;
Math_ApproachF(&this->actor.speedXZ, 0.75f, 1.0f, 0.04f); Math_ApproachF(&this->actor.speed, 0.75f, 1.0f, 0.04f);
if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SWING) { if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SWING) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->attackAngleMod, 0xA, Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->attackAngleMod, 0xA,
0x1F4); 0x1F4);
@ -757,7 +757,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
} }
if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_GRAB) { if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_GRAB) {
player->unk_850 = 0xA; player->unk_850 = 0xA;
player->actor.speedXZ = player->actor.velocity.y = 0; player->actor.speed = player->actor.velocity.y = 0;
Math_ApproachF(&player->actor.world.pos.x, this->grabPosRot.pos.x, 0.5f, 20.0f); Math_ApproachF(&player->actor.world.pos.x, this->grabPosRot.pos.x, 0.5f, 20.0f);
Math_ApproachF(&player->actor.world.pos.y, this->grabPosRot.pos.y, 0.5f, 20.0f); Math_ApproachF(&player->actor.world.pos.y, this->grabPosRot.pos.y, 0.5f, 20.0f);
Math_ApproachF(&player->actor.world.pos.z, this->grabPosRot.pos.z, 0.5f, 20.0f); Math_ApproachF(&player->actor.world.pos.z, this->grabPosRot.pos.z, 0.5f, 20.0f);
@ -822,7 +822,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
player->actor.world.rot.y = player->actor.shape.rot.y = this->grabPosRot.rot.y; player->actor.world.rot.y = player->actor.shape.rot.y = this->grabPosRot.rot.y;
player->actor.world.rot.z = player->actor.shape.rot.z = this->grabPosRot.rot.z; player->actor.world.rot.z = player->actor.shape.rot.z = this->grabPosRot.rot.z;
player->actor.velocity.y = 0; player->actor.velocity.y = 0;
player->actor.speedXZ = 0; player->actor.speed = 0;
Math_ApproachF(&this->fwork[MO_TENT_MAX_STRETCH], 1.0f, 0.5f, 0.01); Math_ApproachF(&this->fwork[MO_TENT_MAX_STRETCH], 1.0f, 0.5f, 0.01);
Math_ApproachF(&this->tentMaxAngle, 0.5f, 1.0f, 0.005f); Math_ApproachF(&this->tentMaxAngle, 0.5f, 1.0f, 0.005f);
Math_ApproachF(&this->tentSpeed, 480.0f, 1.0f, 10.0f); Math_ApproachF(&this->tentSpeed, 480.0f, 1.0f, 10.0f);
@ -999,7 +999,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
Math_ApproachS(&this->tentRot[indS1].x, tempf1, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].x, tempf1, 1.0f / this->tentMaxAngle, this->tentSpeed);
Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed);
} }
this->actor.speedXZ = 0.0; this->actor.speed = 0.0;
Math_ApproachF(&this->fwork[MO_TENT_MAX_STRETCH], 4.3f, 0.5f, 0.04); Math_ApproachF(&this->fwork[MO_TENT_MAX_STRETCH], 4.3f, 0.5f, 0.04);
Math_ApproachF(&this->tentPulse, 1.3f, 0.5f, 0.05f); Math_ApproachF(&this->tentPulse, 1.3f, 0.5f, 0.05f);
break; break;
@ -1018,7 +1018,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
Math_ApproachS(&this->tentRot[indS1].x, tempf1, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].x, tempf1, 1.0f / this->tentMaxAngle, this->tentSpeed);
Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed);
} }
this->actor.speedXZ = 0.0; this->actor.speed = 0.0;
Math_ApproachF(&this->tentPulse, 1.3f, 0.5f, 0.05f); Math_ApproachF(&this->tentPulse, 1.3f, 0.5f, 0.05f);
break; break;
case MO_TENT_DEATH_2: case MO_TENT_DEATH_2:
@ -1034,7 +1034,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
Math_ApproachS(&this->tentRot[indS1].x, tempf1, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].x, tempf1, 1.0f / this->tentMaxAngle, this->tentSpeed);
Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->tentRot[indS1].z, tempf2, 1.0f / this->tentMaxAngle, this->tentSpeed);
} }
this->actor.speedXZ = 0.0; this->actor.speed = 0.0;
this->noBubbles--; this->noBubbles--;
Math_ApproachF(&this->fwork[MO_TENT_MAX_STRETCH], 0.1f, 0.1f, 0.03); Math_ApproachF(&this->fwork[MO_TENT_MAX_STRETCH], 0.1f, 0.1f, 0.03);
Math_ApproachF(&this->tentPulse, 0.02f, 0.5f, 0.015f); Math_ApproachF(&this->tentPulse, 0.02f, 0.5f, 0.015f);
@ -1229,7 +1229,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
this->subCamId = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->csState = MO_INTRO_START; this->csState = MO_INTRO_START;
this->timers[2] = 50; this->timers[2] = 50;
this->work[MO_TENT_VAR_TIMER] = this->work[MO_TENT_MOVE_TIMER] = 0; this->work[MO_TENT_VAR_TIMER] = this->work[MO_TENT_MOVE_TIMER] = 0;
@ -1245,7 +1245,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
player->actor.world.pos.x = 180.0f; player->actor.world.pos.x = 180.0f;
player->actor.world.pos.z = -130.0f; player->actor.world.pos.z = -130.0f;
player->actor.shape.rot.y = player->actor.world.rot.y = 0; player->actor.shape.rot.y = player->actor.world.rot.y = 0;
player->actor.speedXZ = 0.0f; player->actor.speed = 0.0f;
this->subCamEye.x = -424.0f; this->subCamEye.x = -424.0f;
this->subCamEye.y = -190.0f; this->subCamEye.y = -190.0f;
this->subCamEye.z = 180.0f; this->subCamEye.z = 180.0f;
@ -1330,7 +1330,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
sp80 = 1.5f; sp80 = 1.5f;
sp7C = (f32)0x600; sp7C = (f32)0x600;
} }
Math_ApproachF(&this->actor.speedXZ, sp80, 1.0f, sp78); Math_ApproachF(&this->actor.speed, sp80, 1.0f, sp78);
Math_ApproachF(&this->subCamYawRate, sp7C, 1.0f, 128.0f); Math_ApproachF(&this->subCamYawRate, sp7C, 1.0f, 128.0f);
if (this->work[MO_TENT_MOVE_TIMER] == 525) { if (this->work[MO_TENT_MOVE_TIMER] == 525) {
func_8002DF54(play, &this->actor, PLAYER_CSMODE_2); func_8002DF54(play, &this->actor, PLAYER_CSMODE_2);
@ -1345,7 +1345,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
player->actor.shape.rot.y = player->actor.world.rot.y; player->actor.shape.rot.y = player->actor.world.rot.y;
this->subCamYawShake = 0.0f; this->subCamYawShake = 0.0f;
sMorphaTent1->baseAlpha = 150.0; sMorphaTent1->baseAlpha = 150.0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->timers[2] = 200; this->timers[2] = 200;
this->subCamFov = 60.0f; this->subCamFov = 60.0f;
this->actor.world.pos = sMorphaTent1->actor.world.pos; this->actor.world.pos = sMorphaTent1->actor.world.pos;
@ -1454,7 +1454,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
sMorphaTent1->actor.world.pos.x = 180.0f; sMorphaTent1->actor.world.pos.x = 180.0f;
sMorphaTent1->actor.world.pos.z = -360.0f; sMorphaTent1->actor.world.pos.z = -360.0f;
sMorphaTent1->actor.prevPos = sMorphaTent1->actor.world.pos; sMorphaTent1->actor.prevPos = sMorphaTent1->actor.world.pos;
sMorphaTent1->actor.speedXZ = 0.0f; sMorphaTent1->actor.speed = 0.0f;
sMorphaTent1->actor.shape.rot.y = sMorphaTent1->actor.yawTowardsPlayer; sMorphaTent1->actor.shape.rot.y = sMorphaTent1->actor.yawTowardsPlayer;
} }
if (this->subCamId != SUB_CAM_ID_DONE) { if (this->subCamId != SUB_CAM_ID_DONE) {
@ -1763,7 +1763,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_STUNNED; this->work[MO_TENT_ACTION_STATE] = MO_CORE_STUNNED;
this->timers[0] = 25; this->timers[0] = 25;
this->actor.speedXZ = 15.0f; this->actor.speed = 15.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000;
this->work[MO_CORE_DMG_FLASH_TIMER] = 15; this->work[MO_CORE_DMG_FLASH_TIMER] = 15;
@ -1811,7 +1811,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_STUNNED; this->work[MO_TENT_ACTION_STATE] = MO_CORE_STUNNED;
this->timers[0] = 30; this->timers[0] = 30;
this->work[MO_TENT_INVINC_TIMER] = 10; this->work[MO_TENT_INVINC_TIMER] = 10;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
Vec3f pos; Vec3f pos;
@ -1903,7 +1903,7 @@ void BossMo_Core(BossMo* this, PlayState* play) {
((this->work[MO_TENT_ACTION_STATE] == MO_CORE_MOVE) || ((this->work[MO_TENT_ACTION_STATE] == MO_CORE_MOVE) ||
(this->work[MO_TENT_ACTION_STATE] == MO_CORE_MAKE_TENT))) { (this->work[MO_TENT_ACTION_STATE] == MO_CORE_MAKE_TENT))) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_UNDERWATER; this->work[MO_TENT_ACTION_STATE] = MO_CORE_UNDERWATER;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->work[MO_CORE_WAIT_IN_WATER] = 0; this->work[MO_CORE_WAIT_IN_WATER] = 0;
} }
switch (this->work[MO_TENT_ACTION_STATE]) { switch (this->work[MO_TENT_ACTION_STATE]) {
@ -1913,7 +1913,7 @@ void BossMo_Core(BossMo* this, PlayState* play) {
((sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_WAIT) || ((sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_WAIT) ||
(sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_READY)) && (sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_READY)) &&
(this->actor.world.pos.y < MO_WATER_LEVEL(play))) { (this->actor.world.pos.y < MO_WATER_LEVEL(play))) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->work[MO_TENT_ACTION_STATE] = MO_CORE_MAKE_TENT; this->work[MO_TENT_ACTION_STATE] = MO_CORE_MAKE_TENT;
if (sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_WAIT) { if (sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_WAIT) {
sMorphaTent1->work[MO_TENT_ACTION_STATE] = MO_TENT_SPAWN; sMorphaTent1->work[MO_TENT_ACTION_STATE] = MO_TENT_SPAWN;
@ -1937,13 +1937,13 @@ void BossMo_Core(BossMo* this, PlayState* play) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_ATTACK; this->work[MO_TENT_ACTION_STATE] = MO_CORE_ATTACK;
this->work[MO_CORE_POS_IN_TENT] = 0; this->work[MO_CORE_POS_IN_TENT] = 0;
this->timers[0] = 0; this->timers[0] = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
break; break;
case MO_CORE_UNDERWATER: case MO_CORE_UNDERWATER:
if (player->actor.world.pos.y >= MO_WATER_LEVEL(play)) { if (player->actor.world.pos.y >= MO_WATER_LEVEL(play)) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_MOVE; this->work[MO_TENT_ACTION_STATE] = MO_CORE_MOVE;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
break; break;
case MO_CORE_STUNNED: case MO_CORE_STUNNED:
@ -1955,7 +1955,7 @@ void BossMo_Core(BossMo* this, PlayState* play) {
if (this->actor.world.pos.y < MO_WATER_LEVEL(play)) { if (this->actor.world.pos.y < MO_WATER_LEVEL(play)) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_MAKE_TENT; this->work[MO_TENT_ACTION_STATE] = MO_CORE_MAKE_TENT;
this->timers[0] = 50; this->timers[0] = 50;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
break; break;
case MO_CORE_UNUSED: case MO_CORE_UNUSED:
@ -1984,7 +1984,7 @@ void BossMo_Core(BossMo* this, PlayState* play) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_MAKE_TENT; this->work[MO_TENT_ACTION_STATE] = MO_CORE_MAKE_TENT;
this->timers[0] = 100; this->timers[0] = 100;
this->tentSpeed = 0.0f; this->tentSpeed = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
this->timers[0] = 0; this->timers[0] = 0;
break; break;
@ -2023,22 +2023,22 @@ void BossMo_Core(BossMo* this, PlayState* play) {
if (this->work[MO_CORE_POS_IN_TENT] <= 1) { if (this->work[MO_CORE_POS_IN_TENT] <= 1) {
this->targetPos.y -= 20.0f; this->targetPos.y -= 20.0f;
} }
Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.5f, this->actor.speedXZ); Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.5f, this->actor.speed);
Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.5f, this->actor.speedXZ); Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.5f, this->actor.speed);
Math_ApproachF(&this->actor.world.pos.z, this->targetPos.z, 0.5f, this->actor.speedXZ); Math_ApproachF(&this->actor.world.pos.z, this->targetPos.z, 0.5f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 30.0f, 1.0f, 1.0f); Math_ApproachF(&this->actor.speed, 30.0f, 1.0f, 1.0f);
} else { } else {
switch (this->work[MO_TENT_ACTION_STATE]) { switch (this->work[MO_TENT_ACTION_STATE]) {
case MO_CORE_MOVE: case MO_CORE_MOVE:
sp80 = Math_SinS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f; sp80 = Math_SinS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f;
sp7C = Math_CosS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f; sp7C = Math_CosS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f;
Math_ApproachF(&this->actor.world.pos.x, sMorphaTent1->targetPos.x + sp80, 0.05f, this->actor.speedXZ); Math_ApproachF(&this->actor.world.pos.x, sMorphaTent1->targetPos.x + sp80, 0.05f, this->actor.speed);
Math_ApproachF(&this->actor.world.pos.z, sMorphaTent1->targetPos.z + sp7C, 0.05f, this->actor.speedXZ); Math_ApproachF(&this->actor.world.pos.z, sMorphaTent1->targetPos.z + sp7C, 0.05f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 0.5f); Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 0.5f);
break; break;
case MO_CORE_STUNNED: case MO_CORE_STUNNED:
this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed;
this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed;
this->actor.world.pos.x += this->actor.velocity.x; this->actor.world.pos.x += this->actor.velocity.x;
this->actor.world.pos.z += this->actor.velocity.z; this->actor.world.pos.z += this->actor.velocity.z;
break; break;
@ -2097,7 +2097,7 @@ void BossMo_Core(BossMo* this, PlayState* play) {
this->targetPos.x = sMorphaTent1->targetPos.x; this->targetPos.x = sMorphaTent1->targetPos.x;
this->targetPos.y = sMorphaTent1->actor.world.pos.y - 40.0f; this->targetPos.y = sMorphaTent1->actor.world.pos.y - 40.0f;
this->targetPos.z = sMorphaTent1->targetPos.z; this->targetPos.z = sMorphaTent1->targetPos.z;
Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 0.5f); Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 0.5f);
} else if (this->work[MO_TENT_ACTION_STATE] == MO_CORE_UNDERWATER) { } else if (this->work[MO_TENT_ACTION_STATE] == MO_CORE_UNDERWATER) {
switch (this->work[MO_CORE_WAIT_IN_WATER]) { switch (this->work[MO_CORE_WAIT_IN_WATER]) {
case false: case false:
@ -2111,14 +2111,14 @@ void BossMo_Core(BossMo* this, PlayState* play) {
this->targetPos.x = player->actor.world.pos.x + sp64.x; this->targetPos.x = player->actor.world.pos.x + sp64.x;
this->targetPos.y = player->actor.world.pos.y + 30.0f; this->targetPos.y = player->actor.world.pos.y + 30.0f;
this->targetPos.z = player->actor.world.pos.z + sp64.z; this->targetPos.z = player->actor.world.pos.z + sp64.z;
Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 1.0f); Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 1.0f);
if (this->timers[0] == 0) { if (this->timers[0] == 0) {
this->work[MO_CORE_WAIT_IN_WATER] = true; this->work[MO_CORE_WAIT_IN_WATER] = true;
this->timers[0] = (s16)Rand_ZeroFloat(50.0f) + 50; this->timers[0] = (s16)Rand_ZeroFloat(50.0f) + 50;
} }
break; break;
case true: case true:
Math_ApproachF(&this->actor.speedXZ, 1.0f, 1.0f, 0.5f); Math_ApproachF(&this->actor.speed, 1.0f, 1.0f, 0.5f);
if (this->timers[0] == 0) { if (this->timers[0] == 0) {
this->work[MO_CORE_WAIT_IN_WATER] = false; this->work[MO_CORE_WAIT_IN_WATER] = false;
this->timers[0] = (s16)Rand_ZeroFloat(20.0f) + 20; this->timers[0] = (s16)Rand_ZeroFloat(20.0f) + 20;
@ -2322,7 +2322,7 @@ void BossMo_UpdateTent(Actor* thisx, PlayState* play) {
} }
Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xC8); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xC8);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
Math_ApproachF(&this->actor.speedXZ, 0.0, 1.0f, 0.02f); Math_ApproachF(&this->actor.speed, 0.0, 1.0f, 0.02f);
if (BossMo_NearLand(&this->actor.world.pos, 40)) { if (BossMo_NearLand(&this->actor.world.pos, 40)) {
this->actor.world.pos = this->actor.prevPos; this->actor.world.pos = this->actor.prevPos;

View file

@ -695,7 +695,7 @@ void BossSst_HeadDamagedHand(BossSst* this, PlayState* play) {
void BossSst_HeadSetupReadyCharge(BossSst* this) { void BossSst_HeadSetupReadyCharge(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadEyeOpenIdleAnim, -5.0f); Animation_MorphToLoop(&this->skelAnime, &gBongoHeadEyeOpenIdleAnim, -5.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->colliderCyl.base.acFlags |= AC_ON; this->colliderCyl.base.acFlags |= AC_ON;
this->actionFunc = BossSst_HeadReadyCharge; this->actionFunc = BossSst_HeadReadyCharge;
} }
@ -716,7 +716,7 @@ void BossSst_HeadSetupCharge(BossSst* this) {
BossSst_HandSetDamage(sHands[LEFT], 0x20); BossSst_HandSetDamage(sHands[LEFT], 0x20);
BossSst_HandSetDamage(sHands[RIGHT], 0x20); BossSst_HandSetDamage(sHands[RIGHT], 0x20);
this->colliderJntSph.base.atFlags |= AT_ON; this->colliderJntSph.base.atFlags |= AT_ON;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
this->radius = -650.0f; this->radius = -650.0f;
this->ready = false; this->ready = false;
this->actionFunc = BossSst_HeadCharge; this->actionFunc = BossSst_HeadCharge;
@ -728,15 +728,15 @@ void BossSst_HeadCharge(BossSst* this, PlayState* play) {
if (!this->ready && Animation_OnFrame(&this->skelAnime, 6.0f)) { if (!this->ready && Animation_OnFrame(&this->skelAnime, 6.0f)) {
this->ready = true; this->ready = true;
this->actor.speedXZ = 0.25f; this->actor.speed = 0.25f;
this->skelAnime.playSpeed = 0.2f; this->skelAnime.playSpeed = 0.2f;
} }
this->actor.speedXZ *= 1.25f; this->actor.speed *= 1.25f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 45.0f); this->actor.speed = CLAMP_MAX(this->actor.speed, 45.0f);
if (this->ready) { if (this->ready) {
if (Math_SmoothStepToF(&this->radius, 650.0f, 0.4f, this->actor.speedXZ, 1.0f) < 10.0f) { if (Math_SmoothStepToF(&this->radius, 650.0f, 0.4f, this->actor.speed, 1.0f) < 10.0f) {
this->radius = 650.0f; this->radius = 650.0f;
BossSst_HeadSetupEndCharge(this); BossSst_HeadSetupEndCharge(this);
} else { } else {
@ -753,7 +753,7 @@ void BossSst_HeadCharge(BossSst* this, PlayState* play) {
sHandOffsets[RIGHT].z += 5.0f; sHandOffsets[RIGHT].z += 5.0f;
} }
} else { } else {
Math_ApproachF(&this->radius, -700.0f, 0.4f, this->actor.speedXZ); Math_ApproachF(&this->radius, -700.0f, 0.4f, this->actor.speed);
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 180.0f, 20.0f); Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 180.0f, 20.0f);
sHandOffsets[LEFT].y += 5.0f; sHandOffsets[LEFT].y += 5.0f;
sHandOffsets[RIGHT].y += 5.0f; sHandOffsets[RIGHT].y += 5.0f;
@ -855,8 +855,8 @@ void BossSst_HeadStunned(BossSst* this, PlayState* play) {
if (this->radius < -500.0f) { if (this->radius < -500.0f) {
Math_SmoothStepToF(&this->radius, -500.0f, 1.0f, 50.0f, 5.0f); Math_SmoothStepToF(&this->radius, -500.0f, 1.0f, 50.0f, 5.0f);
} else { } else {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.5f, 15.0f, 3.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.5f, 15.0f, 3.0f);
this->radius += this->actor.speedXZ; this->radius += this->actor.speed;
} }
this->radius = CLAMP_MAX(this->radius, 400.0f); this->radius = CLAMP_MAX(this->radius, 400.0f);
@ -871,7 +871,7 @@ void BossSst_HeadSetupVulnerable(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadStunnedAnim, -5.0f); Animation_MorphToLoop(&this->skelAnime, &gBongoHeadStunnedAnim, -5.0f);
this->colliderCyl.base.acFlags |= AC_ON; this->colliderCyl.base.acFlags |= AC_ON;
this->colliderCyl.info.bumper.dmgFlags = DMG_SWORD | DMG_DEKU_STICK; this->colliderCyl.info.bumper.dmgFlags = DMG_SWORD | DMG_DEKU_STICK;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->colliderJntSph.elements[10].info.bumperFlags |= (BUMP_ON | BUMP_HOOKABLE); this->colliderJntSph.elements[10].info.bumperFlags |= (BUMP_ON | BUMP_HOOKABLE);
this->colliderJntSph.elements[0].info.bumperFlags &= ~BUMP_ON; this->colliderJntSph.elements[0].info.bumperFlags &= ~BUMP_ON;
if (this->actionFunc != BossSst_HeadDamage) { if (this->actionFunc != BossSst_HeadDamage) {
@ -933,7 +933,7 @@ void BossSst_HeadSetupRecover(BossSst* this) {
this->colliderJntSph.elements[10].info.bumperFlags &= ~(BUMP_ON | BUMP_HOOKABLE); this->colliderJntSph.elements[10].info.bumperFlags &= ~(BUMP_ON | BUMP_HOOKABLE);
this->colliderJntSph.elements[0].info.bumperFlags |= BUMP_ON; this->colliderJntSph.elements[0].info.bumperFlags |= BUMP_ON;
this->vVanish = true; this->vVanish = true;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actionFunc = BossSst_HeadRecover; this->actionFunc = BossSst_HeadRecover;
} }
@ -948,11 +948,11 @@ void BossSst_HeadRecover(BossSst* this, PlayState* play) {
this->actor.world.pos.y += 10.0f; this->actor.world.pos.y += 10.0f;
sHandOffsets[LEFT].y -= 10.0f; sHandOffsets[LEFT].y -= 10.0f;
sHandOffsets[RIGHT].y -= 10.0f; sHandOffsets[RIGHT].y -= 10.0f;
Math_SmoothStepToF(&this->radius, -750.0f, 1.0f, this->actor.speedXZ, 2.0f); Math_SmoothStepToF(&this->radius, -750.0f, 1.0f, this->actor.speed, 2.0f);
} else { } else {
this->actor.speedXZ *= 1.25f; this->actor.speed *= 1.25f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 50.0f); this->actor.speed = CLAMP_MAX(this->actor.speed, 50.0f);
diff = Math_SmoothStepToF(&this->radius, -650.0f, 1.0f, this->actor.speedXZ, 2.0f); diff = Math_SmoothStepToF(&this->radius, -650.0f, 1.0f, this->actor.speed, 2.0f);
diff += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 30.0f, 3.0f); diff += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 30.0f, 3.0f);
} }
if (animFinish && (diff < 10.0f)) { if (animFinish && (diff < 10.0f)) {
@ -1117,7 +1117,7 @@ void BossSst_HeadDarken(BossSst* this, PlayState* play) {
} }
void BossSst_HeadSetupFall(BossSst* this) { void BossSst_HeadSetupFall(BossSst* this) {
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
Math_Vec3f_Copy(&sSubCamAt, &sSubCamAtPoints[3]); Math_Vec3f_Copy(&sSubCamAt, &sSubCamAtPoints[3]);
Math_Vec3f_Copy(&sSubCamEye, &sSubCamEyePoints[3]); Math_Vec3f_Copy(&sSubCamEye, &sSubCamEyePoints[3]);
sSubCamAtVel.x = 0.0f; sSubCamAtVel.x = 0.0f;
@ -1128,8 +1128,8 @@ void BossSst_HeadSetupFall(BossSst* this) {
} }
void BossSst_HeadFall(BossSst* this, PlayState* play) { void BossSst_HeadFall(BossSst* this, PlayState* play) {
this->actor.speedXZ *= 1.5f; this->actor.speed *= 1.5f;
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 230.0f, this->actor.speedXZ)) { if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 230.0f, this->actor.speed)) {
BossSst_HeadSetupMelt(this); BossSst_HeadSetupMelt(this);
} }
@ -1400,7 +1400,7 @@ void BossSst_HandSetupRetreat(BossSst* this) {
BossSst_HandSetInvulnerable(this, false); BossSst_HandSetInvulnerable(this, false);
this->timer = 0; this->timer = 0;
this->actionFunc = BossSst_HandRetreat; this->actionFunc = BossSst_HandRetreat;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
} }
void BossSst_HandRetreat(BossSst* this, PlayState* play) { void BossSst_HandRetreat(BossSst* this, PlayState* play) {
@ -1408,11 +1408,11 @@ void BossSst_HandRetreat(BossSst* this, PlayState* play) {
s32 inPosition; s32 inPosition;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->actor.speedXZ = this->actor.speedXZ * 1.2f; this->actor.speed *= 1.2f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 50.0f); this->actor.speed = CLAMP_MAX(this->actor.speed, 50.0f);
diff = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, this->actor.speedXZ, 1.0f); diff = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, this->actor.speed, 1.0f);
diff += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 0.3f, this->actor.speedXZ, 1.0f); diff += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 0.3f, this->actor.speed, 1.0f);
if (this->timer != 0) { if (this->timer != 0) {
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
@ -1612,7 +1612,7 @@ void BossSst_HandReadyPunch(BossSst* this, PlayState* play) {
} }
void BossSst_HandSetupPunch(BossSst* this) { void BossSst_HandSetupPunch(BossSst* this) {
this->actor.speedXZ = 0.5f; this->actor.speed = 0.5f;
Animation_MorphToPlayOnce(&this->skelAnime, sHandFistPoses[this->actor.params], 5.0f); Animation_MorphToPlayOnce(&this->skelAnime, sHandFistPoses[this->actor.params], 5.0f);
BossSst_HandSetInvulnerable(this, true); BossSst_HandSetInvulnerable(this, true);
this->targetRoll = this->vParity * 0x3F00; this->targetRoll = this->vParity * 0x3F00;
@ -1627,11 +1627,11 @@ void BossSst_HandPunch(BossSst* this, PlayState* play) {
this->targetRoll *= -1; this->targetRoll *= -1;
} }
this->actor.speedXZ *= 1.25f; this->actor.speed *= 1.25f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 50.0f); this->actor.speed = CLAMP_MAX(this->actor.speed, 50.0f);
this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.shape.rot.y); this->actor.world.pos.x += this->actor.speed * Math_SinS(this->actor.shape.rot.y);
this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.shape.rot.y); this->actor.world.pos.z += this->actor.speed * Math_CosS(this->actor.shape.rot.y);
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
BossSst_HandSetupRetreat(this); BossSst_HandSetupRetreat(this);
} else if (this->colliderJntSph.base.atFlags & AT_HIT) { } else if (this->colliderJntSph.base.atFlags & AT_HIT) {
@ -1796,7 +1796,7 @@ void BossSst_HandSetupGrab(BossSst* this) {
this->actor.world.rot.y = this->actor.shape.rot.y + (this->vParity * 0x4000); this->actor.world.rot.y = this->actor.shape.rot.y + (this->vParity * 0x4000);
this->targetYaw = this->actor.world.rot.y; this->targetYaw = this->actor.world.rot.y;
this->timer = 30; this->timer = 30;
this->actor.speedXZ = 0.5f; this->actor.speed = 0.5f;
BossSst_HandSetDamage(this, 0x20); BossSst_HandSetDamage(this, 0x20);
this->actionFunc = BossSst_HandGrab; this->actionFunc = BossSst_HandGrab;
} }
@ -1812,10 +1812,10 @@ void BossSst_HandGrab(BossSst* this, PlayState* play) {
((1.0f - sinf(this->timer * (M_PI / 60.0f))) * (this->vParity * 0x2000)) + this->targetYaw; ((1.0f - sinf(this->timer * (M_PI / 60.0f))) * (this->vParity * 0x2000)) + this->targetYaw;
this->actor.shape.rot.y = this->actor.world.rot.y - (this->vParity * 0x4000); this->actor.shape.rot.y = this->actor.world.rot.y - (this->vParity * 0x4000);
if (this->timer < 5) { if (this->timer < 5) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.5f, 25.0f, 5.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.5f, 25.0f, 5.0f);
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (player->stateFlags2 & PLAYER_STATE2_7) { if (player->stateFlags2 & PLAYER_STATE2_7) {
if (Rand_ZeroOne() < 0.5f) { if (Rand_ZeroOne() < 0.5f) {
BossSst_HandSetupCrush(this); BossSst_HandSetupCrush(this);
@ -1829,8 +1829,8 @@ void BossSst_HandGrab(BossSst* this, PlayState* play) {
} }
} }
} else { } else {
this->actor.speedXZ *= 1.26f; this->actor.speed *= 1.26f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 70.0f); this->actor.speed = CLAMP_MAX(this->actor.speed, 70.0f);
func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG);
} }
@ -1841,8 +1841,8 @@ void BossSst_HandGrab(BossSst* this, PlayState* play) {
this->timer = CLAMP_MAX(this->timer, 5); this->timer = CLAMP_MAX(this->timer, 5);
} }
this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.world.rot.y); this->actor.world.pos.x += this->actor.speed * Math_SinS(this->actor.world.rot.y);
this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.world.rot.y); this->actor.world.pos.z += this->actor.speed * Math_CosS(this->actor.world.rot.y);
if (player->stateFlags2 & PLAYER_STATE2_7) { if (player->stateFlags2 & PLAYER_STATE2_7) {
player->unk_850 = 0; player->unk_850 = 0;
player->actor.world.pos = this->actor.world.pos; player->actor.world.pos = this->actor.world.pos;
@ -2362,15 +2362,15 @@ void BossSst_HandReadyBreakIce(BossSst* this, PlayState* play) {
void BossSst_HandSetupBreakIce(BossSst* this) { void BossSst_HandSetupBreakIce(BossSst* this) {
this->timer = 9; this->timer = 9;
this->actionFunc = BossSst_HandBreakIce; this->actionFunc = BossSst_HandBreakIce;
this->actor.speedXZ = 0.5f; this->actor.speed = 0.5f;
} }
void BossSst_HandBreakIce(BossSst* this, PlayState* play) { void BossSst_HandBreakIce(BossSst* this, PlayState* play) {
if ((this->timer % 2) != 0) { if ((this->timer % 2) != 0) {
this->actor.speedXZ *= 1.5f; this->actor.speed *= 1.5f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 60.0f); this->actor.speed = CLAMP_MAX(this->actor.speed, 60.0f);
if (Math_StepToF(&this->radius, 100.0f, this->actor.speedXZ)) { if (Math_StepToF(&this->radius, 100.0f, this->actor.speed)) {
BossSst_SpawnIceShard(this); BossSst_SpawnIceShard(this);
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
@ -2383,9 +2383,9 @@ void BossSst_HandBreakIce(BossSst* this, PlayState* play) {
OTHER_HAND(this)->handAngSpeed = 5; OTHER_HAND(this)->handAngSpeed = 5;
} }
} else { } else {
this->actor.speedXZ *= 0.8f; this->actor.speed *= 0.8f;
Math_StepToF(&this->radius, 500.0f, this->actor.speedXZ); Math_StepToF(&this->radius, 500.0f, this->actor.speed);
if (this->actor.speedXZ < 2.0f) { if (this->actor.speed < 2.0f) {
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
} }

View file

@ -622,7 +622,7 @@ void BossTw_TurnToPlayer(BossTw* this, PlayState* play) {
BossTw* otherTw = (BossTw*)this->actor.parent; BossTw* otherTw = (BossTw*)this->actor.parent;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f); Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 1.0f);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->rotateSpeed); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->rotateSpeed);
Math_ApproachS(&this->actor.shape.rot.x, 0, 5, this->rotateSpeed); Math_ApproachS(&this->actor.shape.rot.x, 0, 5, this->rotateSpeed);
Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 200.0f); Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 200.0f);
@ -632,7 +632,7 @@ void BossTw_TurnToPlayer(BossTw* this, PlayState* play) {
if ((otherTw->actionFunc != BossTw_ShootBeam) && this->work[CAN_SHOOT]) { if ((otherTw->actionFunc != BossTw_ShootBeam) && this->work[CAN_SHOOT]) {
this->work[CAN_SHOOT] = false; this->work[CAN_SHOOT] = false;
BossTw_SetupShootBeam(this, play); BossTw_SetupShootBeam(this, play);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} else { } else {
BossTw_SetupFlyTo(this, play); BossTw_SetupFlyTo(this, play);
} }
@ -697,7 +697,7 @@ void BossTw_FlyTo(BossTw* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, yawTarget, 0xA, this->rotateSpeed); Math_ApproachS(&this->actor.shape.rot.y, yawTarget, 0xA, this->rotateSpeed);
Math_ApproachS(&this->actor.shape.rot.x, pitchTarget, 0xA, this->rotateSpeed); Math_ApproachS(&this->actor.shape.rot.x, pitchTarget, 0xA, this->rotateSpeed);
Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 100.0f); Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 100.0f);
Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 1.0f); Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 1.0f);
func_8002D908(&this->actor); func_8002D908(&this->actor);
func_8002D7EC(&this->actor); func_8002D7EC(&this->actor);
@ -972,8 +972,8 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) {
BossTw* otherTw = (BossTw*)this->actor.parent; BossTw* otherTw = (BossTw*)this->actor.parent;
Input* input = &play->state.input[0]; Input* input = &play->state.input[0];
Math_ApproachF(&this->actor.world.pos.y, 400.0f, 0.05f, this->actor.speedXZ); Math_ApproachF(&this->actor.world.pos.y, 400.0f, 0.05f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 5.0f, 1.0f, 0.25f); Math_ApproachF(&this->actor.speed, 5.0f, 1.0f, 0.25f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->beamRoll += -0.3f; this->beamRoll += -0.3f;
@ -1342,7 +1342,7 @@ void BossTw_SetupHitByBeam(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_HitByBeam; this->actionFunc = BossTw_HitByBeam;
Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaKotakeKoumeDamageStartAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaKotakeKoumeDamageStartAnim, 0.0f);
this->timers[0] = 53; this->timers[0] = 53;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->actor.params == TW_KOTAKE) { if (this->actor.params == TW_KOTAKE) {
this->work[FOG_TIMER] = 20; this->work[FOG_TIMER] = 20;
@ -1382,15 +1382,15 @@ void BossTw_HitByBeam(BossTw* this, PlayState* play) {
} }
Math_ApproachF(&this->actor.world.pos.y, ((Math_SinS(this->work[CS_TIMER_1] * 1500) * 20.0f) + 350.0f) + 50.0f, Math_ApproachF(&this->actor.world.pos.y, ((Math_SinS(this->work[CS_TIMER_1] * 1500) * 20.0f) + 350.0f) + 50.0f,
0.1f, this->actor.speedXZ); 0.1f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 5.0f, 1.0f, 1.0f); Math_ApproachF(&this->actor.speed, 5.0f, 1.0f, 1.0f);
this->actor.world.pos.y -= 50.0f; this->actor.world.pos.y -= 50.0f;
Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_2); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_2);
this->actor.world.pos.y += 50.0f; this->actor.world.pos.y += 50.0f;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->timers[0] == 1) { if (this->timers[0] == 1) {
@ -1407,7 +1407,7 @@ void BossTw_SetupLaugh(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_Laugh; this->actionFunc = BossTw_Laugh;
Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaKotakeKoumeLaughAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaKotakeKoumeLaughAnim, 0.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaKotakeKoumeLaughAnim); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaKotakeKoumeLaughAnim);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void BossTw_Laugh(BossTw* this, PlayState* play) { void BossTw_Laugh(BossTw* this, PlayState* play) {
@ -1430,7 +1430,7 @@ void BossTw_SetupSpin(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_Spin; this->actionFunc = BossTw_Spin;
Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaKotakeKoumeSpinAnim, -3.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaKotakeKoumeSpinAnim, -3.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaKotakeKoumeSpinAnim); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaKotakeKoumeSpinAnim);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->timers[0] = 20; this->timers[0] = 20;
} }
@ -1456,7 +1456,7 @@ void BossTw_Spin(BossTw* this, PlayState* play) {
void BossTw_SetupMergeCS(BossTw* this, PlayState* play) { void BossTw_SetupMergeCS(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_MergeCS; this->actionFunc = BossTw_MergeCS;
this->rotateSpeed = 0.0f; this->rotateSpeed = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Animation_MorphToLoop(&this->skelAnime, &gTwinrovaKotakeKoumeFlyAnim, -10.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaKotakeKoumeFlyAnim, -10.0f);
} }
@ -1914,7 +1914,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
if (this->work[CS_TIMER_1] > 80) { if (this->work[CS_TIMER_1] > 80) {
this->csState2 = 4; this->csState2 = 4;
this->actor.speedXZ = 0; this->actor.speed = 0;
this->subCamEyeNext.x = -80.0f; this->subCamEyeNext.x = -80.0f;
this->subCamEyeNext.y = 260.0f; this->subCamEyeNext.y = 260.0f;
@ -1942,8 +1942,8 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
updateCam = true; updateCam = true;
SkelAnime_Update(&sKoumePtr->skelAnime); SkelAnime_Update(&sKoumePtr->skelAnime);
this->subCamAtNext.y = 20.0f + sKoumePtr->actor.world.pos.y; this->subCamAtNext.y = 20.0f + sKoumePtr->actor.world.pos.y;
Math_ApproachF(&sKoumePtr->actor.world.pos.y, 350, 0.1f, this->actor.speedXZ); Math_ApproachF(&sKoumePtr->actor.world.pos.y, 350, 0.1f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 9.0f, 1.0f, 0.9f); Math_ApproachF(&this->actor.speed, 9.0f, 1.0f, 0.9f);
Math_ApproachF(&this->subCamUpdateRate, 1.0f, 1.0f, 0.02f); Math_ApproachF(&this->subCamUpdateRate, 1.0f, 1.0f, 0.02f);
if (this->work[CS_TIMER_1] >= 30) { if (this->work[CS_TIMER_1] >= 30) {
@ -2077,7 +2077,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
if (this->work[CS_TIMER_1] > 80) { if (this->work[CS_TIMER_1] > 80) {
this->csState2 = 12; this->csState2 = 12;
this->actor.speedXZ = 0; this->actor.speed = 0;
this->subCamEyeNext.y = 260.0f; this->subCamEyeNext.y = 260.0f;
this->subCamEyeNext.x = -80.0f; this->subCamEyeNext.x = -80.0f;
@ -2105,8 +2105,8 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
updateCam = true; updateCam = true;
SkelAnime_Update(&sKotakePtr->skelAnime); SkelAnime_Update(&sKotakePtr->skelAnime);
this->subCamAtNext.y = sKotakePtr->actor.world.pos.y + 20.0f; this->subCamAtNext.y = sKotakePtr->actor.world.pos.y + 20.0f;
Math_ApproachF(&sKotakePtr->actor.world.pos.y, 350, 0.1f, this->actor.speedXZ); Math_ApproachF(&sKotakePtr->actor.world.pos.y, 350, 0.1f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 9.0f, 1.0f, 0.9f); Math_ApproachF(&this->actor.speed, 9.0f, 1.0f, 0.9f);
Math_ApproachF(&this->subCamUpdateRate, 1.0f, 1.0f, 0.02f); Math_ApproachF(&this->subCamUpdateRate, 1.0f, 1.0f, 0.02f);
if (this->work[CS_TIMER_1] >= 30) { if (this->work[CS_TIMER_1] >= 30) {
@ -2326,7 +2326,7 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) {
this->timers[1] = 10; this->timers[1] = 10;
this->rotateSpeed = 8192.0f; this->rotateSpeed = 8192.0f;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
} else { } else {
if (this->timers[1] == 9) { if (this->timers[1] == 9) {
this->targetPos.y = 413.0f; this->targetPos.y = 413.0f;
@ -2348,7 +2348,7 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) {
Math_ApproachF(&this->targetPos.y, 263.0f, 1.0f, 2.0f); Math_ApproachF(&this->targetPos.y, 263.0f, 1.0f, 2.0f);
if (this->targetPos.y == 263.0f) { if (this->targetPos.y == 263.0f) {
Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 0.2f); Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 0.2f);
if (sTwinrovaPtr->csState2 == 3) { if (sTwinrovaPtr->csState2 == 3) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
@ -2583,9 +2583,9 @@ void BossTw_DeathCSMsgSfx(BossTw* this, PlayState* play) {
0.01f); 0.01f);
if (this->work[CS_TIMER_2] >= 880) { if (this->work[CS_TIMER_2] >= 880) {
Math_ApproachF(&sKotakePtr->actor.world.pos.y, 2000.0f, 1.0f, this->actor.speedXZ); Math_ApproachF(&sKotakePtr->actor.world.pos.y, 2000.0f, 1.0f, this->actor.speed);
Math_ApproachF(&sKoumePtr->actor.world.pos.y, 2000.0f, 1.0f, this->actor.speedXZ); Math_ApproachF(&sKoumePtr->actor.world.pos.y, 2000.0f, 1.0f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 0.25f); Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 0.25f);
if (this->work[CS_TIMER_2] >= 930) { if (this->work[CS_TIMER_2] >= 930) {
Math_ApproachF(&this->workf[UNK_F19], 5.0f, 1.0f, 0.05f); Math_ApproachF(&this->workf[UNK_F19], 5.0f, 1.0f, 0.05f);
@ -2595,10 +2595,10 @@ void BossTw_DeathCSMsgSfx(BossTw* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EV_GOTO_HEAVEN - SFX_FLAG); Actor_PlaySfx(&this->actor, NA_SE_EV_GOTO_HEAVEN - SFX_FLAG);
} else { } else {
f32 yTarget = Math_CosS(this->work[CS_TIMER_2] * 1700) * 4.0f; f32 yTarget = Math_CosS(this->work[CS_TIMER_2] * 1700) * 4.0f;
Math_ApproachF(&sKotakePtr->actor.world.pos.y, 20.0f + (263.0f + yTarget), 0.1f, this->actor.speedXZ); Math_ApproachF(&sKotakePtr->actor.world.pos.y, 20.0f + (263.0f + yTarget), 0.1f, this->actor.speed);
yTarget = Math_SinS(this->work[CS_TIMER_2] * 1500) * 4.0f; yTarget = Math_SinS(this->work[CS_TIMER_2] * 1500) * 4.0f;
Math_ApproachF(&sKoumePtr->actor.world.pos.y, 20.0f + (263.0f + yTarget), 0.1f, this->actor.speedXZ); Math_ApproachF(&sKoumePtr->actor.world.pos.y, 20.0f + (263.0f + yTarget), 0.1f, this->actor.speed);
Math_ApproachF(&this->actor.speedXZ, 1.0f, 1.0f, 0.05f); Math_ApproachF(&this->actor.speed, 1.0f, 1.0f, 0.05f);
} }
} }
} }
@ -2639,13 +2639,13 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) {
play->envCtx.lightSetting = 0; play->envCtx.lightSetting = 0;
Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.015f); Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.015f);
Math_ApproachF(&this->actor.scale.x, 0.00024999998f, 0.1f, 0.00005f); Math_ApproachF(&this->actor.scale.x, 0.00024999998f, 0.1f, 0.00005f);
this->actor.shape.rot.y += (s16)this->actor.speedXZ; this->actor.shape.rot.y += (s16)this->actor.speed;
this->workf[UNK_F13] += this->actor.speedXZ; this->workf[UNK_F13] += this->actor.speed;
if (this->workf[UNK_F13] > 65536.0f) { if (this->workf[UNK_F13] > 65536.0f) {
this->workf[UNK_F13] -= 65536.0f; this->workf[UNK_F13] -= 65536.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_ROLL); Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_ROLL);
} }
Math_ApproachF(&this->actor.speedXZ, 12288.0f, 1.0f, 256.0f); Math_ApproachF(&this->actor.speed, 12288.0f, 1.0f, 256.0f);
if (this->work[CS_TIMER_1] == 135) { if (this->work[CS_TIMER_1] == 135) {
Vec3f spBC; Vec3f spBC;
Vec3f spB0; Vec3f spB0;
@ -2766,7 +2766,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) {
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_KOTAKE_KOUME); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_KOTAKE_KOUME);
this->csState2 = 3; this->csState2 = 3;
this->work[CS_TIMER_2] = 0; this->work[CS_TIMER_2] = 0;
this->subCamYaw = this->subCamYawStep = this->actor.speedXZ = this->subCamDistStep = 0.0f; this->subCamYaw = this->subCamYawStep = this->actor.speed = this->subCamDistStep = 0.0f;
} }
break; break;
case 3: case 3:
@ -3925,7 +3925,7 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) {
// pitch // pitch
distXZ = sqrtf(SQ(xDiff) + SQ(zDiff)); distXZ = sqrtf(SQ(xDiff) + SQ(zDiff));
this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, distXZ)); this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, distXZ));
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
for (i = 0; i < 50; i++) { for (i = 0; i < 50; i++) {
this->blastTailPos[i] = this->actor.world.pos; this->blastTailPos[i] = this->actor.world.pos;
@ -4113,7 +4113,7 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff)); this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff));
xzDist = sqrtf(SQ(xDiff) + SQ(zDiff)); xzDist = sqrtf(SQ(xDiff) + SQ(zDiff));
this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, xzDist)); this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, xzDist));
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
for (i = 0; i < 50; i++) { for (i = 0; i < 50; i++) {
this->blastTailPos[i] = this->actor.world.pos; this->blastTailPos[i] = this->actor.world.pos;
} }
@ -5377,7 +5377,7 @@ void BossTw_TwinrovaSetupFly(BossTw* this, PlayState* play) {
zDiff = this->targetPos.z - this->actor.world.pos.z; zDiff = this->targetPos.z - this->actor.world.pos.z;
this->actionFunc = BossTw_TwinrovaFly; this->actionFunc = BossTw_TwinrovaFly;
this->rotateSpeed = 0.0f; this->rotateSpeed = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff)); this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff));
xzDist = sqrtf(SQ(xDiff) + SQ(zDiff)); xzDist = sqrtf(SQ(xDiff) + SQ(zDiff));
this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, xzDist)); this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, xzDist));
@ -5403,7 +5403,7 @@ void BossTw_TwinrovaFly(BossTw* this, PlayState* play) {
Math_ApproachS(&this->actor.world.rot.y, yaw, 0xA, this->rotateSpeed); Math_ApproachS(&this->actor.world.rot.y, yaw, 0xA, this->rotateSpeed);
Math_ApproachS(&this->actor.shape.rot.y, yaw, 0xA, this->rotateSpeed); Math_ApproachS(&this->actor.shape.rot.y, yaw, 0xA, this->rotateSpeed);
Math_ApproachF(&this->rotateSpeed, 2000.0f, 1.0f, 100.0f); Math_ApproachF(&this->rotateSpeed, 2000.0f, 1.0f, 100.0f);
Math_ApproachF(&this->actor.speedXZ, 30.0f, 1.0f, 2.0f); Math_ApproachF(&this->actor.speed, 30.0f, 1.0f, 2.0f);
func_8002D908(&this->actor); func_8002D908(&this->actor);
Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.1f, fabsf(this->actor.velocity.x) * 1.5f); Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.1f, fabsf(this->actor.velocity.x) * 1.5f);
Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.1f, fabsf(this->actor.velocity.y) * 1.5f); Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.1f, fabsf(this->actor.velocity.y) * 1.5f);
@ -5419,7 +5419,7 @@ void BossTw_TwinrovaSetupSpin(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaSpin; this->actionFunc = BossTw_TwinrovaSpin;
Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, 0.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, 0.0f);
this->timers[0] = 20; this->timers[0] = 20;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void BossTw_TwinrovaSpin(BossTw* this, PlayState* play) { void BossTw_TwinrovaSpin(BossTw* this, PlayState* play) {
@ -5440,7 +5440,7 @@ void BossTw_TwinrovaSetupLaugh(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaLaugh; this->actionFunc = BossTw_TwinrovaLaugh;
Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaLaughAnim, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaLaughAnim, 0.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaLaughAnim); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaLaughAnim);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void BossTw_TwinrovaLaugh(BossTw* this, PlayState* play) { void BossTw_TwinrovaLaugh(BossTw* this, PlayState* play) {

View file

@ -1165,7 +1165,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
} }
} }
if ((sPhase2Timer > 10) && !(sPhase2Timer & 7) && (this->actor.speedXZ == 1.0f)) { if ((sPhase2Timer > 10) && !(sPhase2Timer & 7) && (this->actor.speed == 1.0f)) {
sp48 = this->actor.world.pos; sp48 = this->actor.world.pos;
sp48.y += 310.0f + (this->actor.shape.yOffset * this->actor.scale.y); sp48.y += 310.0f + (this->actor.shape.yOffset * this->actor.scale.y);
sp48.x += -10.0f; sp48.x += -10.0f;
@ -1182,10 +1182,10 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 20.0f, 0.0f);
if (!(sPhase2Timer & 0x100)) { if (!(sPhase2Timer & 0x100)) {
this->actor.flags |= ACTOR_FLAG_0; this->actor.flags |= ACTOR_FLAG_0;
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
} else { } else {
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (SkelAnime_Update(&this->skelAnime) && (sFightPhase >= PHASE_3)) { if (SkelAnime_Update(&this->skelAnime) && (sFightPhase >= PHASE_3)) {
@ -1218,7 +1218,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
void BossVa_SetupBodyPhase3(BossVa* this) { void BossVa_SetupBodyPhase3(BossVa* this) {
this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG; this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
sPhase3StopMoving = false; sPhase3StopMoving = false;
BossVa_SetupAction(this, BossVa_BodyPhase3); BossVa_SetupAction(this, BossVa_BodyPhase3);
} }
@ -1252,10 +1252,10 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) {
sBodyState = 0; sBodyState = 0;
if (this->timer == 0) { if (this->timer == 0) {
if (Math_SmoothStepToS(&this->vaBodySpinRate, 0xFA0, 1, 0x12C, 0) == 0) { if (Math_SmoothStepToS(&this->vaBodySpinRate, 0xFA0, 1, 0x12C, 0) == 0) {
if (this->actor.speedXZ == 0.0f) { if (this->actor.speed == 0.0f) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
} }
Math_SmoothStepToF(&this->actor.speedXZ, 3.0f, 1.0f, 0.15f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 3.0f, 1.0f, 0.15f, 0.0f);
} }
this->actor.flags |= ACTOR_FLAG_0; this->actor.flags |= ACTOR_FLAG_0;
} else { } else {
@ -1264,7 +1264,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) {
sBodyState = 0x80; sBodyState = 0x80;
} }
Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0x12C, 0); Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0x12C, 0);
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.2f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.2f, 0.0f);
Math_SmoothStepToF(&this->actor.shape.yOffset, -1420.0f, 1.0f, 30.0f, 0.0f); Math_SmoothStepToF(&this->actor.shape.yOffset, -1420.0f, 1.0f, 30.0f, 0.0f);
} }
} }
@ -1280,7 +1280,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) {
} }
if (sPhase3StopMoving) { if (sPhase3StopMoving) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
@ -1385,13 +1385,13 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
Enemy_StartFinishingBlow(play, &this->actor); Enemy_StartFinishingBlow(play, &this->actor);
return; return;
} }
this->actor.speedXZ = -10.0f; this->actor.speed = -10.0f;
this->timer = -170 - (s16)(Rand_ZeroOne() * 150.0f); this->timer = -170 - (s16)(Rand_ZeroOne() * 150.0f);
} }
} else { } else {
this->timer = (s16)Rand_CenteredFloat(40.0f) + 160; this->timer = (s16)Rand_CenteredFloat(40.0f) + 160;
this->vaBodySpinRate = 0; this->vaBodySpinRate = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 125, COLORFILTER_BUFFLAG_OPA, 255); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 125, COLORFILTER_BUFFLAG_OPA, 255);
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_FAINT); Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_FAINT);
} }
@ -1414,12 +1414,12 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, ((sFightPhase - PHASE_4 + 1) * 5.0f) + 10.0f, 0.0f); Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, ((sFightPhase - PHASE_4 + 1) * 5.0f) + 10.0f, 0.0f);
if (Math_SmoothStepToS(&this->vaBodySpinRate, (s16)((sFightPhase - PHASE_4 + 1) * 500.0f) + 0xFA0, 1, 0x12C, if (Math_SmoothStepToS(&this->vaBodySpinRate, (s16)((sFightPhase - PHASE_4 + 1) * 500.0f) + 0xFA0, 1, 0x12C,
0) == 0) { 0) == 0) {
if (this->actor.speedXZ == 0.0f) { if (this->actor.speed == 0.0f) {
this->actor.colorFilterTimer = 0; this->actor.colorFilterTimer = 0;
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->timer2 = (s16)(Rand_ZeroOne() * 150.0f) + 300; this->timer2 = (s16)(Rand_ZeroOne() * 150.0f) + 300;
} }
Math_SmoothStepToF(&this->actor.speedXZ, ((sFightPhase - PHASE_4 + 1) * 1.5f) + 4.0f, 1.0f, 0.25f, 0.0f); Math_SmoothStepToF(&this->actor.speed, ((sFightPhase - PHASE_4 + 1) * 1.5f) + 4.0f, 1.0f, 0.25f, 0.0f);
} }
this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG; this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG;
} else { } else {
@ -1439,18 +1439,18 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
BossVa_Spark(play, this, 2, 0x64, 220.0f, 5.0f, SPARK_BODY, 12.0f, true); BossVa_Spark(play, this, 2, 0x64, 220.0f, 5.0f, SPARK_BODY, 12.0f, true);
} }
if (this->timer < -30) { if (this->timer < -30) {
if (this->actor.speedXZ > 0.0f) { if (this->actor.speed > 0.0f) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
} }
Math_SmoothStepToF(&this->actor.shape.yOffset, -1400.0f, 1.0f, 60.0f, 0.0f); Math_SmoothStepToF(&this->actor.shape.yOffset, -1400.0f, 1.0f, 60.0f, 0.0f);
} else { } else {
if (this->actor.speedXZ == 0.0f) { if (this->actor.speed == 0.0f) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000;
this->timer2 = (s16)(Rand_ZeroOne() * 150.0f) + 330; this->timer2 = (s16)(Rand_ZeroOne() * 150.0f) + 330;
} }
Math_SmoothStepToS(&this->vaBodySpinRate, 0xFA0, 1, 0x1F4, 0); Math_SmoothStepToS(&this->vaBodySpinRate, 0xFA0, 1, 0x1F4, 0);
tmpf1 = sFightPhase - PHASE_4 + 1; tmpf1 = sFightPhase - PHASE_4 + 1;
Math_SmoothStepToF(&this->actor.speedXZ, (tmpf1 + tmpf1) + 4.0f, 1.0f, 0.25f, 0.0f); Math_SmoothStepToF(&this->actor.speed, (tmpf1 + tmpf1) + 4.0f, 1.0f, 0.25f, 0.0f);
Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 20.0f, 0.0f);
} }
this->timer++; this->timer++;
@ -1458,8 +1458,8 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
} }
this->actor.shape.rot.y += this->vaBodySpinRate; this->actor.shape.rot.y += this->vaBodySpinRate;
if (this->actor.speedXZ < 0.0f) { if (this->actor.speed < 0.0f) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
} }
this->unk_1AC += 0xC31; this->unk_1AC += 0xC31;
@ -1515,7 +1515,7 @@ void BossVa_SetupBodyDeath(BossVa* this, PlayState* play) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
this->vaCamRotMod = 0xC31; this->vaCamRotMod = 0xC31;
sCsState = DEATH_START; sCsState = DEATH_START;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->unk_1A8 = 0.0f; this->unk_1A8 = 0.0f;
Flags_SetClear(play, play->roomCtx.curRoom.num); Flags_SetClear(play, play->roomCtx.curRoom.num);
BossVa_SetupAction(this, BossVa_BodyDeath); BossVa_SetupAction(this, BossVa_BodyDeath);
@ -1675,7 +1675,7 @@ void BossVa_BodyDeath(BossVa* this, PlayState* play) {
play->envCtx.screenFillColor[3] -= 50; play->envCtx.screenFillColor[3] -= 50;
} }
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
this->actor.shape.rot.y += this->vaBodySpinRate; this->actor.shape.rot.y += this->vaBodySpinRate;
this->unk_1AC += this->vaCamRotMod; this->unk_1AC += this->vaCamRotMod;
@ -1992,7 +1992,7 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) {
return; return;
} }
if ((sFightPhase < PHASE_4) && (GET_BODY(this)->actor.speedXZ != 0.0f)) { if ((sFightPhase < PHASE_4) && (GET_BODY(this)->actor.speed != 0.0f)) {
BossVa_SetupZapperHold(this, play); BossVa_SetupZapperHold(this, play);
return; return;
} }
@ -2381,7 +2381,7 @@ void BossVa_ZapperHold(BossVa* this, PlayState* play) {
Math_SmoothStepToS(&this->unk_1EA, 0, 1, 0x1770, 0); Math_SmoothStepToS(&this->unk_1EA, 0, 1, 0x1770, 0);
Math_SmoothStepToS(&this->unk_1F2, this->actor.shape.rot.y - 0x4000, 1, 0x2710, 0); Math_SmoothStepToS(&this->unk_1F2, this->actor.shape.rot.y - 0x4000, 1, 0x2710, 0);
Math_SmoothStepToS(&this->unk_1F0, this->skelAnime.jointTable[7].z - 0x1388, 1, 0x1770, 0); Math_SmoothStepToS(&this->unk_1F0, this->skelAnime.jointTable[7].z - 0x1388, 1, 0x1770, 0);
if (GET_BODY(this)->actor.speedXZ == 0.0f) { if (GET_BODY(this)->actor.speed == 0.0f) {
BossVa_SetupZapperAttack(this, play); BossVa_SetupZapperAttack(this, play);
} }
} }

View file

@ -939,7 +939,7 @@ void DemoEffect_UpdateCreationFireball(DemoEffect* this, PlayState* play) {
DemoEffect* effect; DemoEffect* effect;
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
this->actor.speedXZ = this->actor.speedXZ + (this->actor.gravity * 0.5f); this->actor.speed += this->actor.gravity * 0.5f;
if (this->fireBall.timer != 0) { if (this->fireBall.timer != 0) {
this->fireBall.timer--; this->fireBall.timer--;
@ -980,7 +980,7 @@ void DemoEffect_InitCreationFireball(DemoEffect* this, PlayState* play) {
this->actor.world.rot.y = parent->shape.rot.y; this->actor.world.rot.y = parent->shape.rot.y;
this->fireBall.timer = 50; this->fireBall.timer = 50;
this->actor.speedXZ = 1.5f; this->actor.speed = 1.5f;
this->actor.minVelocityY = -1.5f; this->actor.minVelocityY = -1.5f;
this->actor.gravity = -0.03f; this->actor.gravity = -0.03f;
this->updateFunc = DemoEffect_UpdateCreationFireball; this->updateFunc = DemoEffect_UpdateCreationFireball;

View file

@ -311,7 +311,7 @@ void DemoGj_DrawRotated(DemoGj* this, PlayState* play, Gfx* displayList) {
void DemoGj_SetupRotation(DemoGj* this, PlayState* play) { void DemoGj_SetupRotation(DemoGj* this, PlayState* play) {
f32 yPosition = this->dyna.actor.world.pos.y; f32 yPosition = this->dyna.actor.world.pos.y;
f32* yVelocity = &this->dyna.actor.velocity.y; f32* yVelocity = &this->dyna.actor.velocity.y;
f32* speedXZ = &this->dyna.actor.speedXZ; f32* speedXZ = &this->dyna.actor.speed;
Vec3s* unk_172 = &this->unk_172; Vec3s* unk_172 = &this->unk_172;
f32 verticalTranslation; f32 verticalTranslation;
Vec3f vec; Vec3f vec;
@ -467,7 +467,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
switch (DemoGj_GetType(this)) { switch (DemoGj_GetType(this)) {
case DEMOGJ_TYPE_RUBBLE_PILE_1: case DEMOGJ_TYPE_RUBBLE_PILE_1:
actor->speedXZ = kREG(16) + 10.0f; actor->speed = kREG(16) + 10.0f;
actor->velocity.y = kREG(17) + 40.0f; actor->velocity.y = kREG(17) + 40.0f;
unk_172->x = kREG(18); unk_172->x = kREG(18);
unk_172->y = kREG(19) + 0x3E8; unk_172->y = kREG(19) + 0x3E8;
@ -477,7 +477,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break; break;
case DEMOGJ_TYPE_RUBBLE_PILE_2: case DEMOGJ_TYPE_RUBBLE_PILE_2:
actor->speedXZ = kREG(29) + 10.0f; actor->speed = kREG(29) + 10.0f;
actor->velocity.y = kREG(30) + 40.0f; actor->velocity.y = kREG(30) + 40.0f;
unk_172->x = kREG(31); unk_172->x = kREG(31);
unk_172->y = kREG(32) + 0x3E8; unk_172->y = kREG(32) + 0x3E8;
@ -487,7 +487,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break; break;
case DEMOGJ_TYPE_RUBBLE_PILE_3: case DEMOGJ_TYPE_RUBBLE_PILE_3:
actor->speedXZ = kREG(42) + 10.0f; actor->speed = kREG(42) + 10.0f;
actor->velocity.y = kREG(43) + 40.0f; actor->velocity.y = kREG(43) + 40.0f;
unk_172->x = kREG(44); unk_172->x = kREG(44);
unk_172->y = kREG(45) + 0x3E8; unk_172->y = kREG(45) + 0x3E8;
@ -497,7 +497,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break; break;
case DEMOGJ_TYPE_RUBBLE_PILE_4: case DEMOGJ_TYPE_RUBBLE_PILE_4:
actor->speedXZ = kREG(55) + 10.0f; actor->speed = kREG(55) + 10.0f;
actor->velocity.y = kREG(56) + 40.0f; actor->velocity.y = kREG(56) + 40.0f;
unk_172->x = kREG(57); unk_172->x = kREG(57);
unk_172->y = kREG(58) + 0x3E8; unk_172->y = kREG(58) + 0x3E8;
@ -507,7 +507,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break; break;
case DEMOGJ_TYPE_RUBBLE_PILE_5: case DEMOGJ_TYPE_RUBBLE_PILE_5:
actor->speedXZ = kREG(68) + 10.0f; actor->speed = kREG(68) + 10.0f;
actor->velocity.y = kREG(69) + 40.0f; actor->velocity.y = kREG(69) + 40.0f;
unk_172->x = kREG(70); unk_172->x = kREG(70);
unk_172->y = kREG(71) + 0x3E8; unk_172->y = kREG(71) + 0x3E8;
@ -517,7 +517,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break; break;
case DEMOGJ_TYPE_RUBBLE_PILE_6: case DEMOGJ_TYPE_RUBBLE_PILE_6:
actor->speedXZ = kREG(81) + 10.0f; actor->speed = kREG(81) + 10.0f;
actor->velocity.y = kREG(82) + 40.0f; actor->velocity.y = kREG(82) + 40.0f;
unk_172->x = kREG(83); unk_172->x = kREG(83);
unk_172->y = kREG(84) + 0x3E8; unk_172->y = kREG(84) + 0x3E8;
@ -527,7 +527,7 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break; break;
case DEMOGJ_TYPE_RUBBLE_PILE_7: case DEMOGJ_TYPE_RUBBLE_PILE_7:
actor->speedXZ = kREG(94) + 10.0f; actor->speed = kREG(94) + 10.0f;
actor->velocity.y = kREG(95) + 70.0f; actor->velocity.y = kREG(95) + 70.0f;
unk_172->x = kREG(15); unk_172->x = kREG(15);
unk_172->y = kREG(14) + 0x3E8; unk_172->y = kREG(14) + 0x3E8;

View file

@ -154,9 +154,9 @@ void func_8097CC08(DemoGo* this) {
f32 something = this->unk_19C; f32 something = this->unk_19C;
if (something < 8.0f) { if (something < 8.0f) {
this->actor.speedXZ = (((kREG(15) * 0.01f) + 1.2f) / 8.0f) * something; this->actor.speed = (((kREG(15) * 0.01f) + 1.2f) / 8.0f) * something;
} else { } else {
this->actor.speedXZ = (kREG(15) * 0.01f) + 1.2f; this->actor.speed = (kREG(15) * 0.01f) + 1.2f;
} }
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
} }

View file

@ -275,7 +275,7 @@ void EnAm_SetupSleep(EnAm* this) {
Animation_Change(&this->skelAnime, &gArmosRicochetAnim, 0.0f, lastFrame, lastFrame, ANIMMODE_LOOP, 0.0f); Animation_Change(&this->skelAnime, &gArmosRicochetAnim, 0.0f, lastFrame, lastFrame, ANIMMODE_LOOP, 0.0f);
this->behavior = AM_BEHAVIOR_DO_NOTHING; this->behavior = AM_BEHAVIOR_DO_NOTHING;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->unk_258 = (this->textureBlend == 255) ? 0 : 1; this->unk_258 = (this->textureBlend == 255) ? 0 : 1;
EnAm_SetupAction(this, EnAm_Sleep); EnAm_SetupAction(this, EnAm_Sleep);
} }
@ -286,7 +286,7 @@ void EnAm_SetupStatue(EnAm* this) {
Animation_Change(&this->skelAnime, &gArmosRicochetAnim, 0.0f, lastFrame, lastFrame, ANIMMODE_LOOP, 0.0f); Animation_Change(&this->skelAnime, &gArmosRicochetAnim, 0.0f, lastFrame, lastFrame, ANIMMODE_LOOP, 0.0f);
this->dyna.actor.flags &= ~ACTOR_FLAG_0; this->dyna.actor.flags &= ~ACTOR_FLAG_0;
this->behavior = AM_BEHAVIOR_DO_NOTHING; this->behavior = AM_BEHAVIOR_DO_NOTHING;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
EnAm_SetupAction(this, EnAm_Statue); EnAm_SetupAction(this, EnAm_Statue);
} }
@ -294,7 +294,7 @@ void EnAm_SetupLunge(EnAm* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f); Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
this->unk_258 = 3; this->unk_258 = 3;
this->behavior = AM_BEHAVIOR_AGGRO; this->behavior = AM_BEHAVIOR_AGGRO;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y;
EnAm_SetupAction(this, EnAm_Lunge); EnAm_SetupAction(this, EnAm_Lunge);
} }
@ -304,7 +304,7 @@ void EnAm_SetupCooldown(EnAm* this) {
this->unk_258 = 3; this->unk_258 = 3;
this->cooldownTimer = 40; this->cooldownTimer = 40;
this->behavior = AM_BEHAVIOR_AGGRO; this->behavior = AM_BEHAVIOR_AGGRO;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y;
EnAm_SetupAction(this, EnAm_Cooldown); EnAm_SetupAction(this, EnAm_Cooldown);
} }
@ -313,7 +313,7 @@ void EnAm_SetupMoveToHome(EnAm* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f); Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
this->behavior = AM_BEHAVIOR_GO_HOME; this->behavior = AM_BEHAVIOR_GO_HOME;
this->unk_258 = 1; this->unk_258 = 1;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
EnAm_SetupAction(this, EnAm_MoveToHome); EnAm_SetupAction(this, EnAm_MoveToHome);
} }
@ -321,14 +321,14 @@ void EnAm_SetupRotateToInit(EnAm* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f); Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
this->behavior = AM_BEHAVIOR_GO_HOME; this->behavior = AM_BEHAVIOR_GO_HOME;
this->unk_258 = 1; this->unk_258 = 1;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
EnAm_SetupAction(this, EnAm_RotateToInit); EnAm_SetupAction(this, EnAm_RotateToInit);
} }
void EnAm_SetupRotateToHome(EnAm* this) { void EnAm_SetupRotateToHome(EnAm* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f); Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
this->behavior = AM_BEHAVIOR_GO_HOME; this->behavior = AM_BEHAVIOR_GO_HOME;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y;
EnAm_SetupAction(this, EnAm_RotateToHome); EnAm_SetupAction(this, EnAm_RotateToHome);
} }
@ -341,7 +341,7 @@ void EnAm_SetupRecoilFromDamage(EnAm* this, PlayState* play) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_AMOS_DAMAGE); Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_AMOS_DAMAGE);
if (EnAm_CanMove(this, play, -6.0f, this->dyna.actor.world.rot.y)) { if (EnAm_CanMove(this, play, -6.0f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = -6.0f; this->dyna.actor.speed = -6.0f;
} }
this->dyna.actor.colorFilterTimer = 0; this->dyna.actor.colorFilterTimer = 0;
@ -354,7 +354,7 @@ void EnAm_SetupRicochet(EnAm* this, PlayState* play) {
this->dyna.actor.world.rot.y = this->dyna.actor.yawTowardsPlayer; this->dyna.actor.world.rot.y = this->dyna.actor.yawTowardsPlayer;
if (EnAm_CanMove(this, play, -6.0f, this->dyna.actor.world.rot.y)) { if (EnAm_CanMove(this, play, -6.0f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = -6.0f; this->dyna.actor.speed = -6.0f;
} }
this->unk_264 = 0; this->unk_264 = 0;
@ -412,13 +412,13 @@ void EnAm_Sleep(EnAm* this, PlayState* play) {
this->unk_264 = 0; this->unk_264 = 0;
} }
this->dyna.actor.speedXZ += this->dyna.unk_150; this->dyna.actor.speed += this->dyna.unk_150;
this->shakeOrigin = this->dyna.actor.world.pos; this->shakeOrigin = this->dyna.actor.world.pos;
this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.world.rot.y = this->dyna.unk_158;
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f); this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -2.5f, 2.5f);
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); Math_SmoothStepToF(&this->dyna.actor.speed, 0.0f, 1.0f, 1.0f, 0.0f);
if (this->dyna.actor.speedXZ != 0.0f) { if (this->dyna.actor.speed != 0.0f) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
} }
@ -507,7 +507,7 @@ void EnAm_MoveToHome(EnAm* this, PlayState* play) {
if (this->skelAnime.curFrame == 8.0f) { if (this->skelAnime.curFrame == 8.0f) {
this->dyna.actor.velocity.y = 12.0f; this->dyna.actor.velocity.y = 12.0f;
this->dyna.actor.speedXZ = 6.0f; this->dyna.actor.speed = 6.0f;
} else if (this->skelAnime.curFrame > 11.0f) { } else if (this->skelAnime.curFrame > 11.0f) {
if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->skelAnime.curFrame = 11; this->skelAnime.curFrame = 11;
@ -519,7 +519,7 @@ void EnAm_MoveToHome(EnAm* this, PlayState* play) {
} }
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
EnAm_SpawnEffects(this, play); EnAm_SpawnEffects(this, play);
@ -530,7 +530,7 @@ void EnAm_MoveToHome(EnAm* this, PlayState* play) {
} }
// turn away from a wall if touching one // turn away from a wall if touching one
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) { if ((this->dyna.actor.speed != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->dyna.actor.world.rot.y = this->dyna.actor.wallYaw; this->dyna.actor.world.rot.y = this->dyna.actor.wallYaw;
Actor_MoveForward(&this->dyna.actor); Actor_MoveForward(&this->dyna.actor);
} }
@ -541,12 +541,12 @@ void EnAm_MoveToHome(EnAm* this, PlayState* play) {
} }
void EnAm_RecoilFromDamage(EnAm* this, PlayState* play) { void EnAm_RecoilFromDamage(EnAm* this, PlayState* play) {
if (this->dyna.actor.speedXZ < 0.0f) { if (this->dyna.actor.speed < 0.0f) {
this->dyna.actor.speedXZ += 0.5f; this->dyna.actor.speed += 0.5f;
} }
if ((this->dyna.actor.velocity.y <= 0.0f) && !EnAm_CanMove(this, play, -8.0f, this->dyna.actor.world.rot.y)) { if ((this->dyna.actor.velocity.y <= 0.0f) && !EnAm_CanMove(this, play, -8.0f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
} }
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
@ -605,9 +605,9 @@ void EnAm_Lunge(EnAm* this, PlayState* play) {
this->dyna.actor.velocity.y = 12.0f; this->dyna.actor.velocity.y = 12.0f;
if (EnAm_CanMove(this, play, 80.0f, this->dyna.actor.world.rot.y)) { if (EnAm_CanMove(this, play, 80.0f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = 6.0f; this->dyna.actor.speed = 6.0f;
} else { } else {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
} }
this->unk_264 = 1; this->unk_264 = 1;
@ -623,7 +623,7 @@ void EnAm_Lunge(EnAm* this, PlayState* play) {
} }
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->unk_264 = 0; this->unk_264 = 0;
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
EnAm_SpawnEffects(this, play); EnAm_SpawnEffects(this, play);
@ -637,7 +637,7 @@ void EnAm_Lunge(EnAm* this, PlayState* play) {
} }
// turn and move away from a wall if contact is made with one // turn and move away from a wall if contact is made with one
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) { if ((this->dyna.actor.speed != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->dyna.actor.world.rot.y = this->dyna.actor.world.rot.y =
(this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw; (this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw;
Actor_MoveForward(&this->dyna.actor); Actor_MoveForward(&this->dyna.actor);
@ -690,12 +690,12 @@ void EnAm_Statue(EnAm* this, PlayState* play) {
this->unk_258 = 0; this->unk_258 = 0;
player->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_4 | PLAYER_STATE2_6 | PLAYER_STATE2_8); player->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_4 | PLAYER_STATE2_6 | PLAYER_STATE2_8);
player->actor.speedXZ = 0.0f; player->actor.speed = 0.0f;
this->dyna.unk_150 = this->dyna.unk_154 = 0.0f; this->dyna.unk_150 = this->dyna.unk_154 = 0.0f;
} }
this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.world.rot.y = this->dyna.unk_158;
this->dyna.actor.speedXZ = Math_SinS(this->unk_258) * (this->dyna.unk_150 * 0.5f); this->dyna.actor.speed = Math_SinS(this->unk_258) * (this->dyna.unk_150 * 0.5f);
} }
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
@ -714,7 +714,7 @@ void EnAm_SetupStunned(EnAm* this, PlayState* play) {
this->dyna.actor.world.rot.y = this->dyna.actor.yawTowardsPlayer; this->dyna.actor.world.rot.y = this->dyna.actor.yawTowardsPlayer;
if (EnAm_CanMove(this, play, -6.0f, this->dyna.actor.world.rot.y)) { if (EnAm_CanMove(this, play, -6.0f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = -6.0f; this->dyna.actor.speed = -6.0f;
} }
Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 100); Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 100);
@ -731,12 +731,12 @@ void EnAm_SetupStunned(EnAm* this, PlayState* play) {
void EnAm_Stunned(EnAm* this, PlayState* play) { void EnAm_Stunned(EnAm* this, PlayState* play) {
Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.world.rot.y, 1, 0xFA0, 0); Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.world.rot.y, 1, 0xFA0, 0);
if (this->dyna.actor.speedXZ < 0.0f) { if (this->dyna.actor.speed < 0.0f) {
this->dyna.actor.speedXZ += 0.5f; this->dyna.actor.speed += 0.5f;
} }
if ((this->dyna.actor.velocity.y <= 0.0f) && !EnAm_CanMove(this, play, -9.0f, this->dyna.actor.world.rot.y)) { if ((this->dyna.actor.velocity.y <= 0.0f) && !EnAm_CanMove(this, play, -9.0f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
} }
if (this->dyna.actor.colorFilterTimer == 0) { if (this->dyna.actor.colorFilterTimer == 0) {
@ -749,17 +749,17 @@ void EnAm_Stunned(EnAm* this, PlayState* play) {
} }
void EnAm_Ricochet(EnAm* this, PlayState* play) { void EnAm_Ricochet(EnAm* this, PlayState* play) {
if (this->dyna.actor.speedXZ < 0.0f) { if (this->dyna.actor.speed < 0.0f) {
this->dyna.actor.speedXZ += 0.5f; this->dyna.actor.speed += 0.5f;
} }
if ((this->dyna.actor.velocity.y <= 0.0f) && if ((this->dyna.actor.velocity.y <= 0.0f) &&
!EnAm_CanMove(this, play, this->dyna.actor.speedXZ * 1.5f, this->dyna.actor.world.rot.y)) { !EnAm_CanMove(this, play, this->dyna.actor.speed * 1.5f, this->dyna.actor.world.rot.y)) {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
} }
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
EnAm_SetupLunge(this); EnAm_SetupLunge(this);
} }
} }

View file

@ -197,8 +197,8 @@ void func_809B3CEC(PlayState* play, EnArrow* this) {
EnArrow_SetupAction(this, func_809B4640); EnArrow_SetupAction(this, func_809B4640);
Animation_PlayOnce(&this->skelAnime, &gArrow1Anim); Animation_PlayOnce(&this->skelAnime, &gArrow1Anim);
this->actor.world.rot.y += (s32)(24576.0f * (Rand_ZeroOne() - 0.5f)) + 0x8000; this->actor.world.rot.y += (s32)(24576.0f * (Rand_ZeroOne() - 0.5f)) + 0x8000;
this->actor.velocity.y += (this->actor.speedXZ * (0.4f + (0.4f * Rand_ZeroOne()))); this->actor.velocity.y += (this->actor.speed * (0.4f + (0.4f * Rand_ZeroOne())));
this->actor.speedXZ *= (0.04f + 0.3f * Rand_ZeroOne()); this->actor.speed *= (0.04f + 0.3f * Rand_ZeroOne());
this->timer = 50; this->timer = 50;
this->actor.gravity = -1.5f; this->actor.gravity = -1.5f;
} }
@ -294,7 +294,7 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
Math_Vec3f_Diff(&hitActor->world.pos, &this->actor.world.pos, &this->unk_250); Math_Vec3f_Diff(&hitActor->world.pos, &this->actor.world.pos, &this->unk_250);
hitActor->flags |= ACTOR_FLAG_15; hitActor->flags |= ACTOR_FLAG_15;
this->collider.base.atFlags &= ~AT_HIT; this->collider.base.atFlags &= ~AT_HIT;
this->actor.speedXZ /= 2.0f; this->actor.speed /= 2.0f;
this->actor.velocity.y /= 2.0f; this->actor.velocity.y /= 2.0f;
} else { } else {
this->hitFlags |= 1; this->hitFlags |= 1;
@ -336,7 +336,7 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
} }
if (this->actor.params <= ARROW_0E) { if (this->actor.params <= ARROW_0E) {
this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y); this->actor.shape.rot.x = Math_Atan2S(this->actor.speed, -this->actor.velocity.y);
} }
} }
@ -458,7 +458,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
SkelAnime_DrawLod(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, this, SkelAnime_DrawLod(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, this,
(this->actor.projectedPos.z < MREG(95)) ? 0 : 1); (this->actor.projectedPos.z < MREG(95)) ? 0 : 1);
} else if (this->actor.speedXZ != 0.0f) { } else if (this->actor.speed != 0.0f) {
alpha = (Math_CosS(this->timer * 5000) * 127.5f) + 127.5f; alpha = (Math_CosS(this->timer * 5000) * 127.5f) + 127.5f;
OPEN_DISPS(play->state.gfxCtx, "../z_en_arrow.c", 1346); OPEN_DISPS(play->state.gfxCtx, "../z_en_arrow.c", 1346);
@ -478,7 +478,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
Matrix_Push(); Matrix_Push();
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
// redundant check because this is contained in an if block for non-zero speed // redundant check because this is contained in an if block for non-zero speed
Matrix_RotateZ((this->actor.speedXZ == 0.0f) ? 0.0f : BINANG_TO_RAD((play->gameplayFrames & 0xFF) * 4000), Matrix_RotateZ((this->actor.speed == 0.0f) ? 0.0f : BINANG_TO_RAD((play->gameplayFrames & 0xFF) * 4000),
MTXMODE_APPLY); MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_arrow.c", 1374), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_arrow.c", 1374),

View file

@ -185,7 +185,7 @@ void func_809B5670(EnAttackNiw* this, PlayState* play) {
f32 tmpf3; f32 tmpf3;
Vec3f sp34; Vec3f sp34;
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
tmpf1 = (this->unk_298.x + play->view.at.x) - play->view.eye.x; tmpf1 = (this->unk_298.x + play->view.at.x) - play->view.eye.x;
tmpf2 = (this->unk_298.y + play->view.at.y) - play->view.eye.y; tmpf2 = (this->unk_298.y + play->view.at.y) - play->view.eye.y;
@ -266,7 +266,7 @@ void func_809B59B0(EnAttackNiw* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D4, 2, this->unk_2DC, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D4, 2, this->unk_2DC, 0);
Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 2, this->unk_2DC, 0); Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 2, this->unk_2DC, 0);
Math_ApproachF(&this->unk_2DC, 10000.0f, 1.0f, 1000.0f); Math_ApproachF(&this->unk_2DC, 10000.0f, 1.0f, 1000.0f);
Math_ApproachF(&this->actor.speedXZ, this->unk_2E0, 0.9f, 1.0f); Math_ApproachF(&this->actor.speed, this->unk_2E0, 0.9f, 1.0f);
if ((this->actor.gravity == -2.0f) && (this->unk_262 == 0) && if ((this->actor.gravity == -2.0f) && (this->unk_262 == 0) &&
((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_25C == 0))) { ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_25C == 0))) {
this->unk_2E0 = 0.0f; this->unk_2E0 = 0.0f;

View file

@ -133,7 +133,7 @@ void EnBa_Destroy(Actor* thisx, PlayState* play) {
void EnBa_SetupIdle(EnBa* this) { void EnBa_SetupIdle(EnBa* this) {
this->unk_14C = 2; this->unk_14C = 2;
this->unk_31C = 1500; this->unk_31C = 1500;
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
EnBa_SetupAction(this, EnBa_Idle); EnBa_SetupAction(this, EnBa_Idle);
} }
@ -159,7 +159,7 @@ void EnBa_Idle(EnBa* this, PlayState* play) {
this->unk_2FC.y -= 448.0f; this->unk_2FC.y -= 448.0f;
this->unk_2FC.x += this->unk_308.x; this->unk_2FC.x += this->unk_308.x;
this->unk_2FC.z += this->unk_308.y; this->unk_2FC.z += this->unk_308.y;
func_80033AEC(&this->unk_2FC, &this->unk_158[13], 1.0f, this->actor.speedXZ, 0.0f, 0.0f); func_80033AEC(&this->unk_2FC, &this->unk_158[13], 1.0f, this->actor.speed, 0.0f, 0.0f);
for (i = 12; i >= 0; i--) { for (i = 12; i >= 0; i--) {
func_80035844(&this->unk_158[i + 1], &this->unk_158[i], &sp5C, 0); func_80035844(&this->unk_158[i + 1], &this->unk_158[i], &sp5C, 0);
Matrix_Translate(this->unk_158[i + 1].x, this->unk_158[i + 1].y, this->unk_158[i + 1].z, MTXMODE_NEW); Matrix_Translate(this->unk_158[i + 1].x, this->unk_158[i + 1].y, this->unk_158[i + 1].z, MTXMODE_NEW);
@ -192,7 +192,7 @@ void EnBa_Idle(EnBa* this, PlayState* play) {
void EnBa_SetupFallAsBlob(EnBa* this) { void EnBa_SetupFallAsBlob(EnBa* this) {
this->unk_14C = 0; this->unk_14C = 0;
this->actor.speedXZ = Rand_CenteredFloat(8.0f); this->actor.speed = Rand_CenteredFloat(8.0f);
this->actor.world.rot.y = Rand_CenteredFloat(65535.0f); this->actor.world.rot.y = Rand_CenteredFloat(65535.0f);
this->unk_318 = 20; this->unk_318 = 20;
this->actor.gravity = -2.0f; this->actor.gravity = -2.0f;
@ -223,7 +223,7 @@ void EnBa_SetupSwingAtPlayer(EnBa* this) {
this->unk_31A = 0; this->unk_31A = 0;
this->unk_31C = 1500; this->unk_31C = 1500;
this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
EnBa_SetupAction(this, EnBa_SwingAtPlayer); EnBa_SetupAction(this, EnBa_SwingAtPlayer);
} }
@ -271,7 +271,7 @@ void EnBa_SwingAtPlayer(EnBa* this, PlayState* play) {
} }
if (this->unk_31A != 0) { if (this->unk_31A != 0) {
this->unk_31C = 8000; this->unk_31C = 8000;
this->actor.speedXZ = 30.0f; this->actor.speed = 30.0f;
phi_fp = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2FC); phi_fp = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2FC);
temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000; temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000;
Math_SmoothStepToS(&this->actor.shape.rot.y, phi_fp, 1, this->unk_31C, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, phi_fp, 1, this->unk_31C, 0);
@ -323,7 +323,7 @@ void func_809B7174(EnBa* this) {
this->unk_31C = 1500; this->unk_31C = 1500;
this->unk_318 = 20; this->unk_318 = 20;
this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_HAND_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_HAND_DAMAGE);
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12);
EnBa_SetupAction(this, EnBa_RecoilFromDamage); EnBa_SetupAction(this, EnBa_RecoilFromDamage);
@ -344,7 +344,7 @@ void EnBa_RecoilFromDamage(EnBa* this, PlayState* play) {
this->unk_2FC.y -= 448.0f; this->unk_2FC.y -= 448.0f;
this->unk_2FC.x += this->unk_308.x; this->unk_2FC.x += this->unk_308.x;
this->unk_2FC.z += this->unk_308.y; this->unk_2FC.z += this->unk_308.y;
func_80033AEC(&this->unk_2FC, &this->unk_158[13], 1.0f, this->actor.speedXZ, 0.0f, 0.0f); func_80033AEC(&this->unk_2FC, &this->unk_158[13], 1.0f, this->actor.speed, 0.0f, 0.0f);
for (i = 12; i >= 0; i--) { for (i = 12; i >= 0; i--) {
func_80035844(&this->unk_158[i + 1], &this->unk_158[i], &sp6C, 0); func_80035844(&this->unk_158[i + 1], &this->unk_158[i], &sp6C, 0);
Matrix_Translate(this->unk_158[i + 1].x, this->unk_158[i + 1].y, this->unk_158[i + 1].z, MTXMODE_NEW); Matrix_Translate(this->unk_158[i + 1].x, this->unk_158[i + 1].y, this->unk_158[i + 1].z, MTXMODE_NEW);
@ -413,7 +413,7 @@ void EnBa_Die(EnBa* this, PlayState* play) {
s32 i; s32 i;
if (this->unk_31A != 0) { if (this->unk_31A != 0) {
this->actor.speedXZ = 30.0f; this->actor.speed = 30.0f;
this->unk_31C = 8000; this->unk_31C = 8000;
this->actor.world.pos.y += 8.0f; this->actor.world.pos.y += 8.0f;
temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000; temp = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_158[0]) + 0x8000;

View file

@ -411,7 +411,7 @@ void EnBb_SetupFlameTrail(EnBb* this) {
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnBb_SetupAction(this, EnBb_FlameTrail); EnBb_SetupAction(this, EnBb_FlameTrail);
} }
@ -455,7 +455,7 @@ void EnBb_FlameTrail(EnBb* this, PlayState* play) {
void EnBb_SetupDeath(EnBb* this, PlayState* play) { void EnBb_SetupDeath(EnBb* this, PlayState* play) {
if (this->actor.params <= ENBB_BLUE) { if (this->actor.params <= ENBB_BLUE) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = -7.0f; this->actor.speed = -7.0f;
this->timer = 5; this->timer = 5;
this->actor.shape.rot.x += 0x4E20; this->actor.shape.rot.x += 0x4E20;
EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_BUBLE_DEAD, 1, 1, 0x28); EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_BUBLE_DEAD, 1, 1, 0x28);
@ -509,7 +509,7 @@ void EnBb_SetupDamage(EnBb* this) {
if (this->actor.params > ENBB_GREEN) { if (this->actor.params > ENBB_GREEN) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->actor.speedXZ = -7.0f; this->actor.speed = -7.0f;
} }
this->actor.shape.yOffset = 1500.0f; this->actor.shape.yOffset = 1500.0f;
} }
@ -522,8 +522,8 @@ void EnBb_SetupDamage(EnBb* this) {
} }
void EnBb_Damage(EnBb* this, PlayState* play) { void EnBb_Damage(EnBb* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
if (this->actor.speedXZ == 0.0f) { if (this->actor.speed == 0.0f) {
this->actor.shape.yOffset = 200.0f; this->actor.shape.yOffset = 200.0f;
EnBb_SetupDown(this); EnBb_SetupDown(this);
} }
@ -531,7 +531,7 @@ void EnBb_Damage(EnBb* this, PlayState* play) {
void EnBb_SetupBlue(EnBb* this) { void EnBb_SetupBlue(EnBb* this) {
Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000444); Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000444);
this->actor.speedXZ = (Rand_ZeroOne() * 0.5f) + 0.5f; this->actor.speed = (Rand_ZeroOne() * 0.5f) + 0.5f;
this->timer = (Rand_ZeroOne() * 20.0f) + 40.0f; this->timer = (Rand_ZeroOne() * 20.0f) + 40.0f;
this->unk_264 = (Rand_ZeroOne() * 30.0f) + 180.0f; this->unk_264 = (Rand_ZeroOne() * 30.0f) + 180.0f;
this->targetActor = NULL; this->targetActor = NULL;
@ -561,7 +561,7 @@ void EnBb_Blue(EnBb* this, PlayState* play) {
} }
this->actor.world.pos.y += Math_CosF(this->bobPhase) * (1.0f + this->bobSpeedMod); this->actor.world.pos.y += Math_CosF(this->bobPhase) * (1.0f + this->bobSpeedMod);
this->bobPhase += 0.2f; this->bobPhase += 0.2f;
Math_SmoothStepToF(&this->actor.speedXZ, this->maxSpeed, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, this->maxSpeedXZ, 1.0f, 0.5f, 0.0f);
if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 300.0f) { if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 300.0f) {
this->vMoveAngleY = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->vMoveAngleY = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
@ -571,19 +571,19 @@ void EnBb_Blue(EnBb* this, PlayState* play) {
if (this->timer <= 0) { if (this->timer <= 0) {
this->charge ^= true; this->charge ^= true;
this->flyHeightMod = (s16)(Math_CosF(this->bobPhase) * 10.0f); this->flyHeightMod = (s16)(Math_CosF(this->bobPhase) * 10.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->charge && (this->targetActor == NULL)) { if (this->charge && (this->targetActor == NULL)) {
this->vMoveAngleY = this->actor.world.rot.y; this->vMoveAngleY = this->actor.world.rot.y;
if (this->actor.xzDistToPlayer < 200.0f) { if (this->actor.xzDistToPlayer < 200.0f) {
Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000184); Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000184);
this->vMoveAngleY = this->actor.yawTowardsPlayer; this->vMoveAngleY = this->actor.yawTowardsPlayer;
} }
this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 6.0f; this->maxSpeedXZ = (Rand_ZeroOne() * 1.5f) + 6.0f;
this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f;
this->actionState = BBBLUE_NORMAL; this->actionState = BBBLUE_NORMAL;
} else { } else {
Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000444); Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000444);
this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 1.0f; this->maxSpeedXZ = (Rand_ZeroOne() * 1.5f) + 1.0f;
this->timer = (Rand_ZeroOne() * 20.0f) + 40.0f; this->timer = (Rand_ZeroOne() * 20.0f) + 40.0f;
this->vMoveAngleY = Math_SinF(this->bobPhase) * 65535.0f; this->vMoveAngleY = Math_SinF(this->bobPhase) * 65535.0f;
} }
@ -591,7 +591,7 @@ void EnBb_Blue(EnBb* this, PlayState* play) {
if ((this->actor.xzDistToPlayer < 150.0f) && (this->actionState != BBBLUE_NORMAL)) { if ((this->actor.xzDistToPlayer < 150.0f) && (this->actionState != BBBLUE_NORMAL)) {
if (!this->charge) { if (!this->charge) {
Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000184); Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000184);
this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 6.0f; this->maxSpeedXZ = (Rand_ZeroOne() * 1.5f) + 6.0f;
this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f;
this->vMoveAngleY = this->actor.yawTowardsPlayer; this->vMoveAngleY = this->actor.yawTowardsPlayer;
this->actionState = this->charge = true; // Sets actionState to BBBLUE_AGGRO this->actionState = this->charge = true; // Sets actionState to BBBLUE_AGGRO
@ -611,7 +611,7 @@ void EnBb_Blue(EnBb* this, PlayState* play) {
if ((this->vBombHopPhase == 0) && (explosive != this->targetActor)) { if ((this->vBombHopPhase == 0) && (explosive != this->targetActor)) {
this->vBombHopPhase = -0x8000; this->vBombHopPhase = -0x8000;
this->targetActor = explosive; this->targetActor = explosive;
this->actor.speedXZ *= 0.5f; this->actor.speed *= 0.5f;
} }
Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x1388, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x1388, 0);
Math_SmoothStepToF(&this->actor.world.pos.x, explosive->world.pos.x, 1.0f, 1.5f, 0.0f); Math_SmoothStepToF(&this->actor.world.pos.x, explosive->world.pos.x, 1.0f, 1.5f, 0.0f);
@ -650,7 +650,7 @@ void EnBb_Blue(EnBb* this, PlayState* play) {
this->collider.base.atFlags &= ~AT_HIT; this->collider.base.atFlags &= ~AT_HIT;
} }
if (this->maxSpeed >= 6.0f) { if (this->maxSpeedXZ >= 6.0f) {
if ((s32)this->skelAnime.curFrame == 0 || (s32)this->skelAnime.curFrame == 5) { if ((s32)this->skelAnime.curFrame == 0 || (s32)this->skelAnime.curFrame == 5) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_MOUTH); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_MOUTH);
} else if ((s32)this->skelAnime.curFrame == 2 || (s32)this->skelAnime.curFrame == 7) { } else if ((s32)this->skelAnime.curFrame == 2 || (s32)this->skelAnime.curFrame == 7) {
@ -673,7 +673,7 @@ void EnBb_SetupDown(EnBb* this) {
this->timer = 200; this->timer = 200;
this->actor.colorFilterTimer = 0; this->actor.colorFilterTimer = 0;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
this->flameScaleX = 0.0f; this->flameScaleX = 0.0f;
this->flameScaleY = 0.0f; this->flameScaleY = 0.0f;
this->actor.gravity = -2.0f; this->actor.gravity = -2.0f;
@ -748,7 +748,7 @@ void EnBb_Down(EnBb* this, PlayState* play) {
void EnBb_SetupRed(PlayState* play, EnBb* this) { void EnBb_SetupRed(PlayState* play, EnBb* this) {
Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000184); Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000184);
if (this->action == BB_DOWN) { if (this->action == BB_DOWN) {
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->actor.velocity.y = 16.0f; this->actor.velocity.y = 16.0f;
this->actionState = BBRED_ATTACK; this->actionState = BBRED_ATTACK;
@ -762,7 +762,7 @@ void EnBb_SetupRed(PlayState* play, EnBb* this) {
this->moveMode = BBMOVE_HIDDEN; this->moveMode = BBMOVE_HIDDEN;
this->actor.world.pos.y -= 80.0f; this->actor.world.pos.y -= 80.0f;
this->actor.home.pos = this->actor.world.pos; this->actor.home.pos = this->actor.world.pos;
this->actor.velocity.y = this->actor.gravity = this->actor.speedXZ = 0.0f; this->actor.velocity.y = this->actor.gravity = this->actor.speed = 0.0f;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
} }
@ -785,7 +785,7 @@ void EnBb_Red(EnBb* this, PlayState* play) {
case BBRED_WAIT: case BBRED_WAIT:
if ((Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 250.0f) && (ABS(yawDiff) <= 0x4000) && if ((Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 250.0f) && (ABS(yawDiff) <= 0x4000) &&
(this->timer == 0)) { (this->timer == 0)) {
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->actor.velocity.y = 18.0f; this->actor.velocity.y = 18.0f;
this->moveMode = BBMOVE_NOCLIP; this->moveMode = BBMOVE_NOCLIP;
@ -834,7 +834,7 @@ void EnBb_Red(EnBb* this, PlayState* play) {
break; break;
case BBRED_HIDE: case BBRED_HIDE:
if (this->timer == 0) { if (this->timer == 0) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actionState = BBRED_WAIT; this->actionState = BBRED_WAIT;
@ -874,24 +874,24 @@ void EnBb_SetWaypoint(EnBb* this, PlayState* play) {
void EnBb_SetupWhite(PlayState* play, EnBb* this) { void EnBb_SetupWhite(PlayState* play, EnBb* this) {
Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000444); Animation_PlayLoop(&this->skelAnime, &object_Bb_Anim_000444);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.world.pos.y += 60.0f; this->actor.world.pos.y += 60.0f;
this->flameScaleX = 100.0f; this->flameScaleX = 100.0f;
this->action = BB_WHITE; this->action = BB_WHITE;
this->waypoint = 0; this->waypoint = 0;
this->timer = (Rand_ZeroOne() * 30.0f) + 40.0f; this->timer = (Rand_ZeroOne() * 30.0f) + 40.0f;
this->maxSpeed = 7.0f; this->maxSpeedXZ = 7.0f;
EnBb_SetupAction(this, EnBb_White); EnBb_SetupAction(this, EnBb_White);
} }
void EnBb_White(EnBb* this, PlayState* play) { void EnBb_White(EnBb* this, PlayState* play) {
if (this->actor.speedXZ == 0.0f) { if (this->actor.speed == 0.0f) {
f32 distL1; f32 distL1;
f32 vx; f32 vx;
f32 vz; f32 vz;
s16 pitch = Math_Vec3f_Pitch(&this->actor.world.pos, &this->waypointPos); s16 pitch = Math_Vec3f_Pitch(&this->actor.world.pos, &this->waypointPos);
f32 vy = Math_SinS(pitch) * this->maxSpeed; f32 vy = Math_SinS(pitch) * this->maxSpeedXZ;
f32 vxz = Math_CosS(pitch) * this->maxSpeed; f32 vxz = Math_CosS(pitch) * this->maxSpeedXZ;
vx = Math_SinS(this->actor.shape.rot.y) * vxz; vx = Math_SinS(this->actor.shape.rot.y) * vxz;
vz = Math_CosS(this->actor.shape.rot.y) * vxz; vz = Math_CosS(this->actor.shape.rot.y) * vxz;
@ -913,17 +913,17 @@ void EnBb_White(EnBb* this, PlayState* play) {
this->actor.world.rot.y += 0x1F40; this->actor.world.rot.y += 0x1F40;
} }
this->moveMode = BBMOVE_NORMAL; this->moveMode = BBMOVE_NORMAL;
this->maxSpeed = 0.0f; this->maxSpeedXZ = 0.0f;
} else { } else {
this->moveMode = BBMOVE_NOCLIP; this->moveMode = BBMOVE_NOCLIP;
this->maxSpeed = 10.0f; this->maxSpeedXZ = 10.0f;
} }
if (this->collider.base.atFlags & AT_HIT) { if (this->collider.base.atFlags & AT_HIT) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_BITE); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_BITE);
this->collider.base.atFlags &= ~AT_HIT; this->collider.base.atFlags &= ~AT_HIT;
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
} else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { } else if (Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) {
EnBb_FaceWaypoint(this); EnBb_FaceWaypoint(this);
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -931,7 +931,7 @@ void EnBb_White(EnBb* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_LAUGH); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_LAUGH);
} }
if ((this->maxSpeed != 0.0f) && (((s32)this->skelAnime.curFrame == 0) || ((s32)this->skelAnime.curFrame == 5))) { if ((this->maxSpeedXZ != 0.0f) && (((s32)this->skelAnime.curFrame == 0) || ((s32)this->skelAnime.curFrame == 5))) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_MOUTH); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_MOUTH);
} else if (((s32)this->skelAnime.curFrame == 2) || ((s32)this->skelAnime.curFrame == 7)) { } else if (((s32)this->skelAnime.curFrame == 2) || ((s32)this->skelAnime.curFrame == 7)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_WING); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_WING);
@ -958,7 +958,7 @@ void EnBb_InitGreen(EnBb* this, PlayState* play) {
Matrix_MultVec3f(&bobOffset, &this->actor.world.pos); Matrix_MultVec3f(&bobOffset, &this->actor.world.pos);
this->targetActor = NULL; this->targetActor = NULL;
this->action = BB_GREEN; this->action = BB_GREEN;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->vFlameTimer = (Rand_ZeroOne() * 30.0f) + 180.0f; this->vFlameTimer = (Rand_ZeroOne() * 30.0f) + 180.0f;
EnBb_SetupAction(this, EnBb_Green); EnBb_SetupAction(this, EnBb_Green);
} }
@ -969,7 +969,7 @@ void EnBb_SetupGreen(EnBb* this) {
this->actionState = BBGREEN_FLAME_ON; this->actionState = BBGREEN_FLAME_ON;
this->targetActor = NULL; this->targetActor = NULL;
this->action = BB_GREEN; this->action = BB_GREEN;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->vFlameTimer = (Rand_ZeroOne() * 30.0f) + 180.0f; this->vFlameTimer = (Rand_ZeroOne() * 30.0f) + 180.0f;
this->actor.shape.rot.z = 0; this->actor.shape.rot.z = 0;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
@ -983,11 +983,11 @@ void EnBb_Green(EnBb* this, PlayState* play) {
nextPos.y += 30.0f; nextPos.y += 30.0f;
if (this->actor.params == ENBB_GREEN_BIG) { if (this->actor.params == ENBB_GREEN_BIG) {
if (this->actor.speedXZ == 0.0f) { if (this->actor.speed == 0.0f) {
s16 pitch = Math_Vec3f_Pitch(&this->actor.home.pos, &this->waypointPos); s16 pitch = Math_Vec3f_Pitch(&this->actor.home.pos, &this->waypointPos);
s16 yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &this->waypointPos); s16 yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &this->waypointPos);
f32 vy = Math_SinS(pitch) * this->maxSpeed; f32 vy = Math_SinS(pitch) * this->maxSpeedXZ;
f32 vxz = Math_CosS(pitch) * this->maxSpeed; f32 vxz = Math_CosS(pitch) * this->maxSpeedXZ;
f32 vz; f32 vz;
f32 vx; f32 vx;
f32 distL1; f32 distL1;
@ -1003,7 +1003,7 @@ void EnBb_Green(EnBb* this, PlayState* play) {
EnBb_SetWaypoint(this, play); EnBb_SetWaypoint(this, play);
} }
this->moveMode = BBMOVE_NOCLIP; this->moveMode = BBMOVE_NOCLIP;
this->maxSpeed = 10.0f; this->maxSpeedXZ = 10.0f;
if (this->collider.base.atFlags & AT_HIT) { if (this->collider.base.atFlags & AT_HIT) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_BITE); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_BITE);
this->collider.base.atFlags &= ~AT_HIT; this->collider.base.atFlags &= ~AT_HIT;
@ -1017,7 +1017,7 @@ void EnBb_Green(EnBb* this, PlayState* play) {
} }
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
} else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { } else if (Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) {
EnBb_FaceWaypoint(this); EnBb_FaceWaypoint(this);
} }
} else { } else {
@ -1074,7 +1074,7 @@ void EnBb_SetupStunned(EnBb* this) {
this->actor.gravity = -2.0f; this->actor.gravity = -2.0f;
this->actor.shape.yOffset = 1500.0f; this->actor.shape.yOffset = 1500.0f;
} }
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->flameScaleX = 0.0f; this->flameScaleX = 0.0f;
this->flameScaleY = 0.0f; this->flameScaleY = 0.0f;
} else { } else {
@ -1206,8 +1206,8 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) {
} else if ((this->actor.params == ENBB_WHITE) && } else if ((this->actor.params == ENBB_WHITE) &&
((this->action == BB_WHITE) || (this->action == BB_STUNNED))) { ((this->action == BB_WHITE) || (this->action == BB_STUNNED))) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12);
this->actor.speedXZ = -8.0f; this->actor.speed = -8.0f;
this->maxSpeed = 0.0f; this->maxSpeedXZ = 0.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_DAMAGE);
} else if (((this->action == BB_DOWN) && (this->timer < 190)) || } else if (((this->action == BB_DOWN) && (this->timer < 190)) ||
@ -1235,7 +1235,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) {
} }
if (this->actor.colChkInfo.damageEffect != 0xD) { if (this->actor.colChkInfo.damageEffect != 0xD) {
this->actionFunc(this, play); this->actionFunc(this, play);
if ((this->actor.params <= ENBB_BLUE) && (this->actor.speedXZ >= -6.0f) && if ((this->actor.params <= ENBB_BLUE) && (this->actor.speed >= -6.0f) &&
((this->actor.flags & ACTOR_FLAG_15) == 0)) { ((this->actor.flags & ACTOR_FLAG_15) == 0)) {
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
} }
@ -1252,7 +1252,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) {
this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y);
this->collider.elements->dim.worldSphere.center.z = this->actor.world.pos.z; this->collider.elements->dim.worldSphere.center.z = this->actor.world.pos.z;
if ((this->action > BB_KILL) && ((this->actor.speedXZ != 0.0f) || (this->action == BB_GREEN))) { if ((this->action > BB_KILL) && ((this->actor.speed != 0.0f) || (this->action == BB_GREEN))) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
} }
if ((this->action > BB_FLAME_TRAIL) && if ((this->action > BB_FLAME_TRAIL) &&
@ -1286,8 +1286,8 @@ void EnBb_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_bb.c", 2044); OPEN_DISPS(play->state.gfxCtx, "../z_en_bb.c", 2044);
blureBase1.z = this->maxSpeed * 80.0f; blureBase1.z = this->maxSpeedXZ * 80.0f;
blureBase2.z = this->maxSpeed * 80.0f; blureBase2.z = this->maxSpeedXZ * 80.0f;
if (this->moveMode != BBMOVE_HIDDEN) { if (this->moveMode != BBMOVE_HIDDEN) {
if (this->actor.params <= ENBB_BLUE) { if (this->actor.params <= ENBB_BLUE) {
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
@ -1344,7 +1344,7 @@ void EnBb_Draw(Actor* thisx, PlayState* play) {
} else { } else {
Matrix_MultVec3f(&blureBase1, &blureVtx1); Matrix_MultVec3f(&blureBase1, &blureVtx1);
Matrix_MultVec3f(&blureBase2, &blureVtx2); Matrix_MultVec3f(&blureBase2, &blureVtx2);
if ((this->maxSpeed != 0.0f) && (this->action == BB_WHITE) && !(play->gameplayFrames & 1) && if ((this->maxSpeedXZ != 0.0f) && (this->action == BB_WHITE) && !(play->gameplayFrames & 1) &&
(this->actor.colChkInfo.health != 0)) { (this->actor.colChkInfo.health != 0)) {
EffectBlure_AddVertex(Effect_GetByIndex(this->blureIdx), &blureVtx1, &blureVtx2); EffectBlure_AddVertex(Effect_GetByIndex(this->blureIdx), &blureVtx1, &blureVtx2);
} else if (this->action != BB_WHITE) { } else if (this->action != BB_WHITE) {

View file

@ -26,7 +26,7 @@ typedef struct EnBb {
/* 0x0270 */ s16 flameScrollMod; /* 0x0270 */ s16 flameScrollMod;
/* 0x0274 */ f32 bobPhase; /* 0x0274 */ f32 bobPhase;
/* 0x0278 */ f32 bobSize; /* 0x0278 */ f32 bobSize;
/* 0x027C */ f32 maxSpeed; /* 0x027C */ f32 maxSpeedXZ;
/* 0x0280 */ f32 flyHeightMod; /* 0x0280 */ f32 flyHeightMod;
/* 0x027C */ f32 bobSpeedMod; // y speed for blue, phase speed for green /* 0x027C */ f32 bobSpeedMod; // y speed for blue, phase speed for green
/* 0x0288 */ f32 flameScaleY; /* 0x0288 */ f32 flameScaleY;

View file

@ -54,7 +54,7 @@ void EnBdfire_Init(Actor* thisx, PlayState* play) {
} else { } else {
EnBdfire_SetupAction(this, func_809BC598); EnBdfire_SetupAction(this, func_809BC598);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
this->actor.speedXZ = 30.0f; this->actor.speed = 30.0f;
this->unk_154 = (25 - (s32)(this->actor.params * 0.8f)); this->unk_154 = (25 - (s32)(this->actor.params * 0.8f));
if (this->unk_154 < 0) { if (this->unk_154 < 0) {
this->unk_154 = 0; this->unk_154 = 0;

View file

@ -582,7 +582,7 @@ void func_809BE058(EnBigokuta* this, PlayState* play) {
if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->cylinder[0].base.ocFlags1 & OC1_HIT) || if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->cylinder[0].base.ocFlags1 & OC1_HIT) ||
(this->cylinder[1].base.ocFlags1 & OC1_HIT)) { (this->cylinder[1].base.ocFlags1 & OC1_HIT)) {
speedXZ = CLAMP_MIN(player->actor.speedXZ, 1.0f); speedXZ = CLAMP_MIN(player->actor.speed, 1.0f);
if (!(this->collider.base.ocFlags1 & OC1_HIT)) { if (!(this->collider.base.ocFlags1 & OC1_HIT)) {
this->cylinder[0].base.ocFlags1 &= ~OC1_HIT; this->cylinder[0].base.ocFlags1 &= ~OC1_HIT;
this->cylinder[1].base.ocFlags1 &= ~OC1_HIT; this->cylinder[1].base.ocFlags1 &= ~OC1_HIT;

View file

@ -140,7 +140,7 @@ void EnBili_Destroy(Actor* thisx, PlayState* play) {
// Setup Action Functions // Setup Action Functions
void EnBili_SetupFloatIdle(EnBili* this) { void EnBili_SetupFloatIdle(EnBili* this) {
this->actor.speedXZ = 0.7f; this->actor.speed = 0.7f;
this->collider.info.bumper.effect = 1; // Shock? this->collider.info.bumper.effect = 1; // Shock?
this->timer = 32; this->timer = 32;
this->collider.base.atFlags |= AT_ON; this->collider.base.atFlags |= AT_ON;
@ -161,7 +161,7 @@ void EnBili_SetupSpawnedFlyApart(EnBili* this) {
this->actor.gravity = -0.3f; this->actor.gravity = -0.3f;
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
this->actionFunc = EnBili_SpawnedFlyApart; this->actionFunc = EnBili_SpawnedFlyApart;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
} }
/** /**
@ -171,7 +171,7 @@ void EnBili_SetupDischargeLightning(EnBili* this) {
Animation_PlayLoop(&this->skelAnime, &gBiriDischargeLightningAnim); Animation_PlayLoop(&this->skelAnime, &gBiriDischargeLightningAnim);
this->timer = 10; this->timer = 10;
this->actionFunc = EnBili_DischargeLightning; this->actionFunc = EnBili_DischargeLightning;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = -1.0f; this->actor.velocity.y = -1.0f;
} }
@ -179,19 +179,19 @@ void EnBili_SetupClimb(EnBili* this) {
Animation_PlayOnce(&this->skelAnime, &gBiriClimbAnim); Animation_PlayOnce(&this->skelAnime, &gBiriClimbAnim);
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
this->actionFunc = EnBili_Climb; this->actionFunc = EnBili_Climb;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
} }
void EnBili_SetupApproachPlayer(EnBili* this) { void EnBili_SetupApproachPlayer(EnBili* this) {
this->actor.speedXZ = 1.2f; this->actor.speed = 1.2f;
this->actionFunc = EnBili_ApproachPlayer; this->actionFunc = EnBili_ApproachPlayer;
} }
void EnBili_SetupSetNewHomeHeight(EnBili* this) { void EnBili_SetupSetNewHomeHeight(EnBili* this) {
Animation_PlayLoop(&this->skelAnime, &gBiriDefaultAnim); Animation_PlayLoop(&this->skelAnime, &gBiriDefaultAnim);
this->timer = 96; this->timer = 96;
this->actor.speedXZ = 0.9f; this->actor.speed = 0.9f;
this->collider.base.atFlags |= AT_ON; this->collider.base.atFlags |= AT_ON;
this->actionFunc = EnBili_SetNewHomeHeight; this->actionFunc = EnBili_SetNewHomeHeight;
this->actor.home.pos.y = this->actor.world.pos.y; this->actor.home.pos.y = this->actor.world.pos.y;
@ -205,7 +205,7 @@ void EnBili_SetupRecoil(EnBili* this) {
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->collider.base.ac->prevPos) + 0x8000; this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->collider.base.ac->prevPos) + 0x8000;
this->actor.world.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &this->collider.base.ac->prevPos); this->actor.world.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &this->collider.base.ac->prevPos);
this->actionFunc = EnBili_Recoil; this->actionFunc = EnBili_Recoil;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
} }
/** /**
@ -220,7 +220,7 @@ void EnBili_SetupBurnt(EnBili* this) {
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
this->actor.flags |= ACTOR_FLAG_4; this->actor.flags |= ACTOR_FLAG_4;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_XLU, 20); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_XLU, 20);
this->actionFunc = EnBili_Burnt; this->actionFunc = EnBili_Burnt;
} }
@ -229,7 +229,7 @@ void EnBili_SetupDie(EnBili* this) {
this->timer = 18; this->timer = 18;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actionFunc = EnBili_Die; this->actionFunc = EnBili_Die;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
/** /**
@ -239,7 +239,7 @@ void EnBili_SetupStunned(EnBili* this) {
this->timer = 80; this->timer = 80;
this->collider.info.bumper.effect = 0; this->collider.info.bumper.effect = 0;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 80); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 80);
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
@ -267,7 +267,7 @@ void EnBili_SetupFrozen(EnBili* this, PlayState* play) {
(Rand_ZeroOne() * 0.2f) + 0.7f); (Rand_ZeroOne() * 0.2f) + 0.7f);
} }
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 10); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 10);
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
@ -446,7 +446,7 @@ void EnBili_SetNewHomeHeight(EnBili* this, PlayState* play) {
void EnBili_Recoil(EnBili* this, PlayState* play) { void EnBili_Recoil(EnBili* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.3f)) { if (Math_StepToF(&this->actor.speed, 0.0f, 0.3f)) {
this->actor.world.rot.y += 0x8000; this->actor.world.rot.y += 0x8000;
EnBili_SetupFloatIdle(this); EnBili_SetupFloatIdle(this);
} }

View file

@ -50,8 +50,8 @@ void EnBird_Init(Actor* thisx, PlayState* play) {
this->timer = 0; this->timer = 0;
this->rotYStep = 2500; this->rotYStep = 2500;
this->actor.colChkInfo.mass = 0; this->actor.colChkInfo.mass = 0;
this->speedXZTarget = 1.5f; this->speedTarget = 1.5f;
this->speedXZStep = 0.5f; this->speedStep = 0.5f;
this->posYMag = 0.0f; this->posYMag = 0.0f;
this->rotYMag = 0.0f; this->rotYMag = 0.0f;
this->posYPhaseStep = 0.0f; this->posYPhaseStep = 0.0f;
@ -74,10 +74,10 @@ void EnBird_SetupIdle(EnBird* this, s16 params) {
void EnBird_Idle(EnBird* this, PlayState* play) { void EnBird_Idle(EnBird* this, PlayState* play) {
this->actor.shape.yOffset += sinf(this->posYPhase) * this->posYMag; this->actor.shape.yOffset += sinf(this->posYPhase) * this->posYMag;
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.5f, 0.0f);
if (this->scaleAnimSpeed) { if (this->scaleAnimSpeed) {
this->skelAnime.playSpeed = this->actor.speedXZ * 2.0f; this->skelAnime.playSpeed = this->actor.speed * 2.0f;
} }
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -95,7 +95,7 @@ void EnBird_SetupMove(EnBird* this, s16 params) {
void EnBird_Move(EnBird* this, PlayState* play) { void EnBird_Move(EnBird* this, PlayState* play) {
this->actor.shape.yOffset += sinf(this->posYPhase) * this->posYMag; this->actor.shape.yOffset += sinf(this->posYPhase) * this->posYMag;
Math_SmoothStepToF(&this->actor.speedXZ, this->speedXZTarget, 0.1f, this->speedXZStep, 0.0f); Math_SmoothStepToF(&this->actor.speed, this->speedTarget, 0.1f, this->speedStep, 0.0f);
if (this->flightDistance < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) || this->timer < 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),

View file

@ -17,8 +17,8 @@ typedef struct EnBird {
/* 0x019C */ s16 scaleAnimSpeed; // when true, anim speed scales with XZ speed while slowing down. otherwise anim plays full speed /* 0x019C */ s16 scaleAnimSpeed; // when true, anim speed scales with XZ speed while slowing down. otherwise anim plays full speed
/* 0x01A0 */ f32 posYMag; /* 0x01A0 */ f32 posYMag;
/* 0x01A4 */ f32 rotYMag; /* 0x01A4 */ f32 rotYMag;
/* 0x01A8 */ f32 speedXZTarget; /* 0x01A8 */ f32 speedTarget;
/* 0x01AC */ f32 speedXZStep; /* 0x01AC */ f32 speedStep;
/* 0x01B0 */ f32 flightDistance; // radius of "home" area /* 0x01B0 */ f32 flightDistance; // radius of "home" area
/* 0x01B4 */ f32 posYPhase; /* 0x01B4 */ f32 posYPhase;
/* 0x01B8 */ f32 posYPhaseStep; /* 0x01B8 */ f32 posYPhaseStep;

View file

@ -131,20 +131,20 @@ void EnBom_Move(EnBom* this, PlayState* play) {
} }
// rebound bomb off the wall it hits // rebound bomb off the wall it hits
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) { if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) {
this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000; this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000;
} }
Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_BOUND); Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_BOUND);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
this->actor.speedXZ *= 0.7f; this->actor.speed *= 0.7f;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
} }
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f); Math_StepToF(&this->actor.speed, 0.0f, 0.08f);
} else { } else {
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -3.0f)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -3.0f)) {
func_8002F850(play, &this->actor); func_8002F850(play, &this->actor);
this->actor.velocity.y *= -0.3f; this->actor.velocity.y *= -0.3f;

View file

@ -112,7 +112,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) {
} }
this->timer = 1; this->timer = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->actor.yDistToWater > 0.0f) { if (this->actor.yDistToWater > 0.0f) {
for (i = 0; i < 40; i++) { for (i = 0; i < 40; i++) {
@ -230,7 +230,7 @@ void EnBomChu_WaitForRelease(EnBomChu* this, PlayState* play) {
this->axisLeft.y = 0; this->axisLeft.y = 0;
this->axisLeft.z = Math_CosS(this->actor.shape.rot.y + 0x4000); this->axisLeft.z = Math_CosS(this->actor.shape.rot.y + 0x4000);
this->actor.speedXZ = 8.0f; this->actor.speed = 8.0f;
//! @bug there is no NULL check on the floor poly. If the player is out of bounds the floor poly will be NULL //! @bug there is no NULL check on the floor poly. If the player is out of bounds the floor poly will be NULL
//! and will cause a crash inside this function. //! and will cause a crash inside this function.
EnBomChu_UpdateFloorPoly(this, this->actor.floorPoly, play); EnBomChu_UpdateFloorPoly(this, this->actor.floorPoly, play);
@ -252,8 +252,8 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
Vec3f posSide; Vec3f posSide;
Vec3f posUpDown; Vec3f posUpDown;
this->actor.speedXZ = 8.0f; this->actor.speed = 8.0f;
lineLength = this->actor.speedXZ * 2.0f; lineLength = this->actor.speed * 2.0f;
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
@ -289,7 +289,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
EnBomChu_UpdateFloorPoly(this, polySide, play); EnBomChu_UpdateFloorPoly(this, polySide, play);
this->actor.world.pos = posSide; this->actor.world.pos = posSide;
this->actor.floorBgId = bgIdSide; this->actor.floorBgId = bgIdSide;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} else { } else {
if (this->actor.floorPoly != polyUpDown) { if (this->actor.floorPoly != polyUpDown) {
EnBomChu_UpdateFloorPoly(this, polyUpDown, play); EnBomChu_UpdateFloorPoly(this, polyUpDown, play);
@ -299,7 +299,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
this->actor.floorBgId = bgIdUpDown; this->actor.floorBgId = bgIdUpDown;
} }
} else { } else {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
lineLength *= 3.0f; lineLength *= 3.0f;
posA = posB; posA = posB;

View file

@ -234,9 +234,9 @@ void EnBombf_Move(EnBombf* this, PlayState* play) {
this->flowerBombScale = 1.0f; this->flowerBombScale = 1.0f;
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.025f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.025f, 0.0f);
} else { } else {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f);
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -6.0f)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -6.0f)) {
func_8002F850(play, &this->actor); func_8002F850(play, &this->actor);
this->actor.velocity.y *= -0.5f; this->actor.velocity.y *= -0.5f;
@ -350,7 +350,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
} }
// rebound bomb off the wall it hits // rebound bomb off the wall it hits
if ((thisx->speedXZ != 0.0f) && (thisx->bgCheckFlags & BGCHECKFLAG_WALL)) { if ((thisx->speed != 0.0f) && (thisx->bgCheckFlags & BGCHECKFLAG_WALL)) {
if (ABS((s16)(thisx->wallYaw - thisx->world.rot.y)) > 0x4000) { if (ABS((s16)(thisx->wallYaw - thisx->world.rot.y)) > 0x4000) {
if (1) {} if (1) {}
@ -363,7 +363,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 |
UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4);
DREG(6) = 0; DREG(6) = 0;
thisx->speedXZ *= 0.7f; thisx->speed *= 0.7f;
thisx->bgCheckFlags &= ~BGCHECKFLAG_WALL; thisx->bgCheckFlags &= ~BGCHECKFLAG_WALL;
} }

View file

@ -224,7 +224,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) {
distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z); this->actor.home.pos.z);
func_809CD56C(this); func_809CD56C(this);
Math_SmoothStepToF(&this->actor.speedXZ, flightParams->speedXZTarget, flightParams->speedXZScale, Math_SmoothStepToF(&this->actor.speed, flightParams->speedXZTarget, flightParams->speedXZScale,
flightParams->speedXZStep, 0.0f); flightParams->speedXZStep, 0.0f);
if (this->unk_257 == 1) { if (this->unk_257 == 1) {
@ -259,7 +259,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) {
EnButte_Turn(this); EnButte_Turn(this);
animSpeed = this->actor.speedXZ / 2.0f + Rand_ZeroOne() * 0.2f + (1.0f - Math_SinS(this->unk_260)) * 0.15f + animSpeed = this->actor.speed / 2.0f + Rand_ZeroOne() * 0.2f + (1.0f - Math_SinS(this->unk_260)) * 0.15f +
(1.0f - Math_SinS(this->unk_25E)) * 0.3f + minAnimSpeed; (1.0f - Math_SinS(this->unk_25E)) * 0.3f + minAnimSpeed;
this->skelAnime.playSpeed = CLAMP(animSpeed, 0.2f, 1.5f); this->skelAnime.playSpeed = CLAMP(animSpeed, 0.2f, 1.5f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -299,7 +299,7 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
s16 yaw; s16 yaw;
func_809CD634(this); func_809CD634(this);
Math_SmoothStepToF(&this->actor.speedXZ, flightParams->speedXZTarget, flightParams->speedXZScale, Math_SmoothStepToF(&this->actor.speed, flightParams->speedXZTarget, flightParams->speedXZScale,
flightParams->speedXZStep, 0.0f); flightParams->speedXZStep, 0.0f);
minAnimSpeed = 0.0f; minAnimSpeed = 0.0f;
@ -322,7 +322,7 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
EnButte_Turn(this); EnButte_Turn(this);
animSpeed = this->actor.speedXZ / 2.0f + Rand_ZeroOne() * 0.2f + (1.0f - Math_SinS(this->unk_260)) * 0.15f + animSpeed = this->actor.speed / 2.0f + Rand_ZeroOne() * 0.2f + (1.0f - Math_SinS(this->unk_260)) * 0.15f +
(1.0f - Math_SinS(this->unk_25E)) * 0.3f + minAnimSpeed; (1.0f - Math_SinS(this->unk_25E)) * 0.3f + minAnimSpeed;
this->skelAnime.playSpeed = CLAMP(animSpeed, 0.2f, 1.5f); this->skelAnime.playSpeed = CLAMP(animSpeed, 0.2f, 1.5f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -334,7 +334,7 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z); this->actor.home.pos.z);
if (!((player->heldItemAction == PLAYER_IA_DEKU_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) && if (!((player->heldItemAction == PLAYER_IA_DEKU_STICK) && (fabsf(player->actor.speed) < 1.8f) &&
(this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) { (this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) {
EnButte_SetupFlyAround(this); EnButte_SetupFlyAround(this);
} else if (distSqFromHome > SQ(240.0f)) { } else if (distSqFromHome > SQ(240.0f)) {

View file

@ -162,7 +162,7 @@ void EnBw_Destroy(Actor* thisx, PlayState* play) {
} }
void func_809CE884(EnBw* this, PlayState* play) { void func_809CE884(EnBw* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
this->unk_222 -= 250; this->unk_222 -= 250;
this->actor.scale.x = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f; this->actor.scale.x = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f;
this->actor.scale.y = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f; this->actor.scale.y = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f;
@ -178,7 +178,7 @@ void func_809CE9A8(EnBw* this) {
this->unk_220 = 2; this->unk_220 = 2;
this->unk_222 = Rand_ZeroOne() * 200.0f + 200.0f; this->unk_222 = Rand_ZeroOne() * 200.0f + 200.0f;
this->unk_232 = 0; this->unk_232 = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnBw_SetupAction(this, func_809CEA24); EnBw_SetupAction(this, func_809CEA24);
} }
@ -215,13 +215,13 @@ void func_809CEA24(EnBw* this, PlayState* play) {
} }
} }
sp5C *= this->unk_24C * (10.0f * this->unk_244); sp5C *= this->unk_24C * (10.0f * this->unk_244);
this->actor.speedXZ = ABS(sp5C); this->actor.speed = ABS(sp5C);
if (this->unk_221 != 1) { if (this->unk_221 != 1) {
sp58 = Math_SinF(this->unk_240); sp58 = Math_SinF(this->unk_240);
sp60 = ABS(sp58) * 85.0f; sp60 = ABS(sp58) * 85.0f;
this->color1.g = sp60; this->color1.g = sp60;
} }
if ((((play->gameplayFrames % 4) == (u32)this->actor.params) && (this->actor.speedXZ != 0.0f) && if ((((play->gameplayFrames % 4) == (u32)this->actor.params) && (this->actor.speed != 0.0f) &&
(sp64 = (sp64 =
BgCheck_AnyLineTest2(&play->colCtx, &this->actor.world.pos, &this->unk_264, &sp68, &sp74, 1, 0, 0, 1))) || BgCheck_AnyLineTest2(&play->colCtx, &this->actor.world.pos, &this->unk_264, &sp68, &sp74, 1, 0, 0, 1))) ||
(this->unk_222 == 0)) { (this->unk_222 == 0)) {
@ -281,7 +281,7 @@ void func_809CEA24(EnBw* this, PlayState* play) {
} }
this->unk_222 = (Rand_ZeroOne() * 200.0f) + 200.0f; this->unk_222 = (Rand_ZeroOne() * 200.0f) + 200.0f;
} }
} else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { } else if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
if (this->unk_236 != this->actor.wallYaw) { if (this->unk_236 != this->actor.wallYaw) {
sp64 = 1; sp64 = 1;
this->unk_236 = this->actor.wallYaw; this->unk_236 = this->actor.wallYaw;
@ -339,14 +339,14 @@ void func_809CEA24(EnBw* this, PlayState* play) {
func_809CF72C(this); func_809CF72C(this);
} else { } else {
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1,
this->actor.speedXZ * 1000.0f, 0); this->actor.speed * 1000.0f, 0);
} }
break; break;
case 0: case 0:
Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f);
if (sp64 == 0) { if (sp64 == 0) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1,
this->actor.speedXZ * 1000.0f, 0); this->actor.speed * 1000.0f, 0);
if ((this->actor.xzDistToPlayer < 90.0f) && (this->actor.yDistToPlayer < 50.0f) && if ((this->actor.xzDistToPlayer < 90.0f) && (this->actor.yDistToPlayer < 50.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x1554) && Actor_IsFacingPlayer(&this->actor, 0x1554) &&
Actor_TestFloorInDirection(&this->actor, play, 71.24802f, this->actor.yawTowardsPlayer)) { Actor_TestFloorInDirection(&this->actor, play, 71.24802f, this->actor.yawTowardsPlayer)) {
@ -354,7 +354,7 @@ void func_809CEA24(EnBw* this, PlayState* play) {
} }
} else { } else {
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1,
this->actor.speedXZ * 1000.0f, 0); this->actor.speed * 1000.0f, 0);
} }
if ((this->unk_224 == 0) || (ABS(this->actor.yDistToPlayer) > 60.0f) || if ((this->unk_224 == 0) || (ABS(this->actor.yDistToPlayer) > 60.0f) ||
(player2->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14))) { (player2->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
@ -370,10 +370,10 @@ void func_809CEA24(EnBw* this, PlayState* play) {
this->unk_238 = -this->unk_238; this->unk_238 = -this->unk_238;
} }
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x8000, 1, Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x8000, 1,
this->actor.speedXZ * 1000.0f, 0); this->actor.speed * 1000.0f, 0);
} else { } else {
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1,
this->actor.speedXZ * 1000.0f, 0); this->actor.speed * 1000.0f, 0);
} }
if (this->unk_224 <= 200) { if (this->unk_224 <= 200) {
sp60 = Math_SinS(this->unk_224 * (0x960 - this->unk_224)) * 55.0f; sp60 = Math_SinS(this->unk_224 * (0x960 - this->unk_224)) * 55.0f;
@ -399,7 +399,7 @@ void func_809CF72C(EnBw* this) {
this->unk_250 = 0.6f; this->unk_250 = 0.6f;
this->unk_222 = 20; this->unk_222 = 20;
this->unk_224 = 0xBB8; this->unk_224 = 0xBB8;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_AIM); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_AIM);
EnBw_SetupAction(this, func_809CF7AC); EnBw_SetupAction(this, func_809CF7AC);
} }
@ -426,7 +426,7 @@ void func_809CF7AC(EnBw* this, PlayState* play) {
void func_809CF8F0(EnBw* this) { void func_809CF8F0(EnBw* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gTorchSlugEyestalkFlailAnim, -1.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTorchSlugEyestalkFlailAnim, -1.0f);
this->actor.speedXZ = 7.0f; this->actor.speed = 7.0f;
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->unk_220 = 4; this->unk_220 = 4;
this->unk_222 = 1000; this->unk_222 = 1000;
@ -440,14 +440,14 @@ void func_809CF984(EnBw* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s32 floorPolyType; s32 floorPolyType;
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
this->unk_222 += 250; this->unk_222 += 250;
this->actor.scale.x = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f; this->actor.scale.x = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f;
this->actor.scale.y = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0245f; this->actor.scale.y = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0245f;
this->actor.scale.z = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f; this->actor.scale.z = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f;
if (this->collider1.base.atFlags & AT_HIT) { if (this->collider1.base.atFlags & AT_HIT) {
this->collider1.base.atFlags &= ~AT_HIT; this->collider1.base.atFlags &= ~AT_HIT;
this->actor.speedXZ = -6.0f; this->actor.speed = -6.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & AT_BOUNCED)) { if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & AT_BOUNCED)) {
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
@ -463,7 +463,7 @@ void func_809CF984(EnBw* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false);
this->unk_222 = 3000; this->unk_222 = 3000;
this->actor.flags &= ~ACTOR_FLAG_24; this->actor.flags &= ~ACTOR_FLAG_24;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND); Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND);
EnBw_SetupAction(this, func_809CE884); EnBw_SetupAction(this, func_809CE884);
} }
@ -474,7 +474,7 @@ void func_809CFBA8(EnBw* this) {
this->unk_220 = 5; this->unk_220 = 5;
this->unk_222 = 1000; this->unk_222 = 1000;
this->unk_260 = 0.0f; this->unk_260 = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 11.0f; this->actor.velocity.y = 11.0f;
this->unk_25C = Rand_ZeroOne() * 0.25f + 1.0f; this->unk_25C = Rand_ZeroOne() * 0.25f + 1.0f;
this->unk_224 = 0xBB8; this->unk_224 = 0xBB8;
@ -532,7 +532,7 @@ void func_809CFF10(EnBw* this) {
this->unk_220 = 6; this->unk_220 = 6;
this->unk_222 = 1000; this->unk_222 = 1000;
this->unk_221 = 3; this->unk_221 = 3;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 11.0f; this->actor.velocity.y = 11.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_REVERSE); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_REVERSE);
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
@ -574,7 +574,7 @@ void func_809D00F4(EnBw* this) {
this->unk_220 = 0; this->unk_220 = 0;
this->unk_222 = 40; this->unk_222 = 40;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_DEAD);
EnBw_SetupAction(this, func_809D014C); EnBw_SetupAction(this, func_809D014C);
} }
@ -594,7 +594,7 @@ void func_809D014C(EnBw* this, PlayState* play) {
void func_809D01CC(EnBw* this) { void func_809D01CC(EnBw* this) {
this->unk_220 = 1; this->unk_220 = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->unk_25C = (Rand_ZeroOne() * 0.25f) + 1.0f; this->unk_25C = (Rand_ZeroOne() * 0.25f) + 1.0f;
this->unk_260 = 0.0f; this->unk_260 = 0.0f;
if (this->damageEffect == 0xE) { if (this->damageEffect == 0xE) {
@ -637,7 +637,7 @@ void func_809D0268(EnBw* this, PlayState* play) {
} }
void func_809D03CC(EnBw* this) { void func_809D03CC(EnBw* this) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->damageEffect == 0xE) { if (this->damageEffect == 0xE) {
this->iceTimer = 32; this->iceTimer = 32;
} }

View file

@ -235,7 +235,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
if (this->actor.params == CLEAR_TAG_LASER) { if (this->actor.params == CLEAR_TAG_LASER) {
this->state = CLEAR_TAG_STATE_LASER; this->state = CLEAR_TAG_STATE_LASER;
this->timers[CLEAR_TAG_TIMER_LASER_DEATH] = 70; this->timers[CLEAR_TAG_TIMER_LASER_DEATH] = 70;
this->actor.speedXZ = 35.0f; this->actor.speed = 35.0f;
func_8002D908(&this->actor); func_8002D908(&this->actor);
for (j = 0; j <= 0; j++) { for (j = 0; j <= 0; j++) {
func_8002D7EC(&this->actor); func_8002D7EC(&this->actor);
@ -243,7 +243,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
this->actor.scale.x = 0.4f; this->actor.scale.x = 0.4f;
this->actor.scale.y = 0.4f; this->actor.scale.y = 0.4f;
this->actor.scale.z = 2.0f; this->actor.scale.z = 2.0f;
this->actor.speedXZ = 70.0f; this->actor.speed = 70.0f;
this->actor.shape.rot.x = -this->actor.shape.rot.x; this->actor.shape.rot.x = -this->actor.shape.rot.x;
func_8002D908(&this->actor); func_8002D908(&this->actor);
@ -362,7 +362,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) {
} }
} }
Actor_SetScale(&this->actor, 0.2f); Actor_SetScale(&this->actor, 0.2f);
this->actor.speedXZ = 7.0f; this->actor.speed = 7.0f;
if (this->timers[CLEAR_TAG_TIMER_ARWING_UPDATE_STATE] == 0) { if (this->timers[CLEAR_TAG_TIMER_ARWING_UPDATE_STATE] == 0) {
if (this->timers[CLEAR_TAG_TIMER_ARWING_ENTER_LOCKED_ON] == 0) { if (this->timers[CLEAR_TAG_TIMER_ARWING_ENTER_LOCKED_ON] == 0) {

View file

@ -136,7 +136,7 @@ void EnCrow_SetupFlyIdle(EnCrow* this) {
void EnCrow_SetupDiveAttack(EnCrow* this) { void EnCrow_SetupDiveAttack(EnCrow* this) {
this->timer = 300; this->timer = 300;
this->actor.speedXZ = 4.0f; this->actor.speed = 4.0f;
this->skelAnime.playSpeed = 2.0f; this->skelAnime.playSpeed = 2.0f;
this->actionFunc = EnCrow_DiveAttack; this->actionFunc = EnCrow_DiveAttack;
} }
@ -146,7 +146,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) {
f32 scale; f32 scale;
Vec3f iceParticlePos; Vec3f iceParticlePos;
this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); this->actor.speed *= Math_CosS(this->actor.world.rot.x);
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f);
scale = this->actor.scale.x * 100.0f; scale = this->actor.scale.x * 100.0f;
@ -176,7 +176,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) {
} }
if (this->actor.flags & ACTOR_FLAG_15) { if (this->actor.flags & ACTOR_FLAG_15) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
@ -192,7 +192,7 @@ void EnCrow_SetupDie(EnCrow* this) {
void EnCrow_SetupTurnAway(EnCrow* this) { void EnCrow_SetupTurnAway(EnCrow* this) {
this->timer = 100; this->timer = 100;
this->actor.speedXZ = 3.5f; this->actor.speed = 3.5f;
this->aimRotX = -0x1000; this->aimRotX = -0x1000;
this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; this->aimRotY = this->actor.yawTowardsPlayer + 0x8000;
this->skelAnime.playSpeed = 2.0f; this->skelAnime.playSpeed = 2.0f;
@ -232,7 +232,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f); skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f);
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f; this->actor.speed = (Rand_ZeroOne() * 1.5f) + 3.0f;
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->aimRotY = this->actor.wallYaw; this->aimRotY = this->actor.wallYaw;
@ -325,7 +325,7 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
} }
void EnCrow_Damaged(EnCrow* this, PlayState* play) { void EnCrow_Damaged(EnCrow* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
this->actor.colorFilterTimer = 40; this->actor.colorFilterTimer = 40;
if (!(this->actor.flags & ACTOR_FLAG_15)) { if (!(this->actor.flags & ACTOR_FLAG_15)) {

View file

@ -312,7 +312,7 @@ s32 EnCs_HandleWalking(EnCs* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->walkAngle, 1, 2500, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, this->walkAngle, 1, 2500, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.speedXZ = this->walkSpeed; this->actor.speed = this->walkSpeed;
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);

View file

@ -541,7 +541,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
Math_SmoothStepToF(&this->actor.speedXZ, this->runSpeed, 0.6f, dxz, 0.0f); Math_SmoothStepToF(&this->actor.speed, this->runSpeed, 0.6f, dxz, 0.0f);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);

View file

@ -420,12 +420,12 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) {
if (angleStepDiff == 0) { if (angleStepDiff == 0) {
this->run = true; this->run = true;
} else { } else {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} }
if (this->run == true) { if (this->run == true) {
Math_SmoothStepToF(&this->actor.speedXZ, this->runSpeed, 0.8f, runDist, 0.0f); Math_SmoothStepToF(&this->actor.speed, this->runSpeed, 0.8f, runDist, 0.0f);
} }
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);

View file

@ -401,7 +401,7 @@ void EnDekubaba_SetupPrunedSomersault(EnDekubaba* this) {
this->actor.velocity.y = 4.0f; this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000;
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
this->actor.speedXZ = this->size * 3.0f; this->actor.speed = this->size * 3.0f;
this->actor.flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5; this->actor.flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5;
this->actionFunc = EnDekubaba_PrunedSomersault; this->actionFunc = EnDekubaba_PrunedSomersault;
} }
@ -941,7 +941,7 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, PlayState* play) {
f32 deltaZ; f32 deltaZ;
f32 deltaY; f32 deltaY;
Math_StepToF(&this->actor.speedXZ, 0.0f, this->size * 0.1f); Math_StepToF(&this->actor.speed, 0.0f, this->size * 0.1f);
if (this->timer == 0) { if (this->timer == 0) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
@ -954,7 +954,7 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, PlayState* play) {
if ((this->actor.scale.x > 0.005f) && if ((this->actor.scale.x > 0.005f) &&
((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) {
this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, this->size * 12.0f, EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, this->size * 12.0f,
this->size * 5.0f, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); this->size * 5.0f, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);

View file

@ -195,7 +195,7 @@ void EnDekunuts_SetupRun(EnDekunuts* this) {
void EnDekunuts_SetupGasp(EnDekunuts* this) { void EnDekunuts_SetupGasp(EnDekunuts* this) {
Animation_PlayLoop(&this->skelAnime, &gDekuNutsGaspAnim); Animation_PlayLoop(&this->skelAnime, &gDekuNutsGaspAnim);
this->animFlagAndTimer = 3; this->animFlagAndTimer = 3;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->runAwayCount != 0) { if (this->runAwayCount != 0) {
this->runAwayCount--; this->runAwayCount--;
} }
@ -211,7 +211,7 @@ void EnDekunuts_SetupBeDamaged(EnDekunuts* this) {
} }
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
this->actionFunc = EnDekunuts_BeDamaged; this->actionFunc = EnDekunuts_BeDamaged;
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DAMAGE);
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_CUTBODY); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_CUTBODY);
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA,
@ -222,7 +222,7 @@ void EnDekunuts_SetupBeStunned(EnDekunuts* this) {
Animation_MorphToLoop(&this->skelAnime, &gDekuNutsDamageAnim, -3.0f); Animation_MorphToLoop(&this->skelAnime, &gDekuNutsDamageAnim, -3.0f);
this->animFlagAndTimer = 5; this->animFlagAndTimer = 5;
this->actionFunc = EnDekunuts_BeStunned; this->actionFunc = EnDekunuts_BeStunned;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA,
Animation_GetLastFrame(&gDekuNutsDamageAnim) * this->animFlagAndTimer); Animation_GetLastFrame(&gDekuNutsDamageAnim) * this->animFlagAndTimer);
@ -231,7 +231,7 @@ void EnDekunuts_SetupBeStunned(EnDekunuts* this) {
void EnDekunuts_SetupDie(EnDekunuts* this) { void EnDekunuts_SetupDie(EnDekunuts* this) {
Animation_PlayOnce(&this->skelAnime, &gDekuNutsDieAnim); Animation_PlayOnce(&this->skelAnime, &gDekuNutsDieAnim);
this->actionFunc = EnDekunuts_Die; this->actionFunc = EnDekunuts_Die;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD);
} }
@ -358,7 +358,7 @@ void EnDekunuts_Run(EnDekunuts* this, PlayState* play) {
this->playWalkSfx = true; this->playWalkSfx = true;
} }
Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f); Math_StepToF(&this->actor.speed, 7.5f, 1.0f);
if (Math_SmoothStepToS(&this->actor.world.rot.y, this->runDirection, 1, 0xE38, 0xB6) == 0) { if (Math_SmoothStepToS(&this->actor.world.rot.y, this->runDirection, 1, 0xE38, 0xB6) == 0) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
this->runDirection = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->runDirection = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -382,7 +382,7 @@ void EnDekunuts_Run(EnDekunuts* this, PlayState* play) {
if ((this->runAwayCount == 0) && Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f && if ((this->runAwayCount == 0) && Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f &&
fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) { fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDekunuts_SetupBurrow(this); EnDekunuts_SetupBurrow(this);
} else if (this->animFlagAndTimer == 0) { } else if (this->animFlagAndTimer == 0) {
EnDekunuts_SetupGasp(this); EnDekunuts_SetupGasp(this);
@ -400,7 +400,7 @@ void EnDekunuts_Gasp(EnDekunuts* this, PlayState* play) {
} }
void EnDekunuts_BeDamaged(EnDekunuts* this, PlayState* play) { void EnDekunuts_BeDamaged(EnDekunuts* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
EnDekunuts_SetupDie(this); EnDekunuts_SetupDie(this);
} }

View file

@ -189,7 +189,7 @@ void EnDh_SetupWait(EnDh* this) {
this->actor.world.pos.x = Rand_CenteredFloat(600.0f) + this->actor.home.pos.x; this->actor.world.pos.x = Rand_CenteredFloat(600.0f) + this->actor.home.pos.x;
this->actor.world.pos.z = Rand_CenteredFloat(600.0f) + this->actor.home.pos.z; this->actor.world.pos.z = Rand_CenteredFloat(600.0f) + this->actor.home.pos.z;
this->actor.shape.yOffset = -15000.0f; this->actor.shape.yOffset = -15000.0f;
this->dirtWaveSpread = this->actor.speedXZ = 0.0f; this->dirtWaveSpread = this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.flags |= ACTOR_FLAG_7; this->actor.flags |= ACTOR_FLAG_7;
this->dirtWavePhase = this->actionState = this->actor.params = ENDH_WAIT_UNDERGROUND; this->dirtWavePhase = this->actionState = this->actor.params = ENDH_WAIT_UNDERGROUND;
@ -243,7 +243,7 @@ void EnDh_SetupWalk(EnDh* this) {
Animation_GetLastFrame(&object_dh_Anim_003A8C) - 3.0f, ANIMMODE_LOOP, -6.0f); Animation_GetLastFrame(&object_dh_Anim_003A8C) - 3.0f, ANIMMODE_LOOP, -6.0f);
this->curAction = DH_WALK; this->curAction = DH_WALK;
this->timer = 300; this->timer = 300;
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
EnDh_SetupAction(this, EnDh_Walk); EnDh_SetupAction(this, EnDh_Walk);
} }
@ -258,7 +258,7 @@ void EnDh_Walk(EnDh* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_LAUGH); Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_LAUGH);
} }
if (this->actor.xzDistToPlayer <= 100.0f) { if (this->actor.xzDistToPlayer <= 100.0f) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360)) { if (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360)) {
EnDh_SetupAttack(this); EnDh_SetupAttack(this);
} }
@ -271,7 +271,7 @@ void EnDh_SetupRetreat(EnDh* this, PlayState* play) {
Animation_MorphToLoop(&this->skelAnime, &object_dh_Anim_005880, -4.0f); Animation_MorphToLoop(&this->skelAnime, &object_dh_Anim_005880, -4.0f);
this->curAction = DH_RETREAT; this->curAction = DH_RETREAT;
this->timer = 70; this->timer = 70;
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
EnDh_SetupAction(this, EnDh_Retreat); EnDh_SetupAction(this, EnDh_Retreat);
} }
@ -291,7 +291,7 @@ void EnDh_SetupAttack(EnDh* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_004658, -6.0f); Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_004658, -6.0f);
this->timer = this->actionState = 0; this->timer = this->actionState = 0;
this->curAction = DH_ATTACK; this->curAction = DH_ATTACK;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDh_SetupAction(this, EnDh_Attack); EnDh_SetupAction(this, EnDh_Attack);
} }
@ -360,7 +360,7 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
void EnDh_SetupBurrow(EnDh* this) { void EnDh_SetupBurrow(EnDh* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_002148, -6.0f); Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_002148, -6.0f);
this->curAction = DH_BURROW; this->curAction = DH_BURROW;
this->dirtWaveSpread = this->actor.speedXZ = 0.0f; this->dirtWaveSpread = this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->dirtWavePhase = 0; this->dirtWavePhase = 0;
this->actionState = 0; this->actionState = 0;
@ -403,7 +403,7 @@ void EnDh_Burrow(EnDh* this, PlayState* play) {
void EnDh_SetupDamage(EnDh* this) { void EnDh_SetupDamage(EnDh* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_003D6C, -6.0f); Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_003D6C, -6.0f);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speedXZ = -1.0f; this->actor.speed = -1.0f;
} }
Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_DAMAGE);
this->curAction = DH_DAMAGE; this->curAction = DH_DAMAGE;
@ -411,8 +411,8 @@ void EnDh_SetupDamage(EnDh* this) {
} }
void EnDh_Damage(EnDh* this, PlayState* play) { void EnDh_Damage(EnDh* this, PlayState* play) {
if (this->actor.speedXZ < 0.0f) { if (this->actor.speed < 0.0f) {
this->actor.speedXZ += 0.15f; this->actor.speed += 0.15f;
} }
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
@ -436,7 +436,7 @@ void EnDh_SetupDeath(EnDh* this) {
this->curAction = DH_DEATH; this->curAction = DH_DEATH;
this->timer = 300; this->timer = 300;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
func_800F5B58(); func_800F5B58();
this->actor.params = ENDH_DEATH; this->actor.params = ENDH_DEATH;
Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_DEAD); Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_DEAD);

View file

@ -182,7 +182,7 @@ void EnDha_SetupWait(EnDha* this) {
Animation_PlayLoop(&this->skelAnime, &object_dh_Anim_0015B0); Animation_PlayLoop(&this->skelAnime, &object_dh_Anim_0015B0);
this->unk_1C0 = 0; this->unk_1C0 = 0;
this->actionTimer = ((Rand_ZeroOne() * 10.0f) + 5.0f); this->actionTimer = ((Rand_ZeroOne() * 10.0f) + 5.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.home.rot.z = 1; this->actor.home.rot.z = 1;
EnDha_SetupAction(this, EnDha_Wait); EnDha_SetupAction(this, EnDha_Wait);

View file

@ -119,7 +119,7 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, PlayState* play) {
rupeePos.y, rupeePos.z, 0, (s16)Rand_CenteredFloat(3500.0f) - 1000, rupeePos.y, rupeePos.z, 0, (s16)Rand_CenteredFloat(3500.0f) - 1000,
this->rupeesLeftToThrow, 0); this->rupeesLeftToThrow, 0);
if (rupee != NULL) { if (rupee != NULL) {
rupee->actor.speedXZ = 12.0f; rupee->actor.speed = 12.0f;
rupee->actor.velocity.y = 6.0f; rupee->actor.velocity.y = 6.0f;
} }
} }

View file

@ -160,7 +160,7 @@ void EnDns_Init(Actor* thisx, PlayState* play) {
this->maintainCollider = 1; this->maintainCollider = 1;
this->standOnGround = 1; this->standOnGround = 1;
this->dropCollectible = 0; this->dropCollectible = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->dnsItemEntry = sItemEntries[this->actor.params]; this->dnsItemEntry = sItemEntries[this->actor.params];

View file

@ -164,7 +164,7 @@ void EnDntJiji_Unburrow(EnDntJiji* this, PlayState* play) {
void EnDntJiji_SetupWalk(EnDntJiji* this, PlayState* play) { void EnDntJiji_SetupWalk(EnDntJiji* this, PlayState* play) {
this->endFrame = (f32)Animation_GetLastFrame(&gDntJijiWalkAnim); this->endFrame = (f32)Animation_GetLastFrame(&gDntJijiWalkAnim);
Animation_Change(&this->skelAnime, &gDntJijiWalkAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &gDntJijiWalkAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f);
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
this->isSolid = true; this->isSolid = true;
this->unburrow = true; this->unburrow = true;
this->actionFunc = EnDntJiji_Walk; this->actionFunc = EnDntJiji_Walk;
@ -174,14 +174,14 @@ void EnDntJiji_Walk(EnDntJiji* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3E8, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3E8, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 0.4f); Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 0.4f);
if (this->sfxTimer == 0) { if (this->sfxTimer == 0) {
this->sfxTimer = 5; this->sfxTimer = 5;
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
} }
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.velocity.y = 9.0f; this->actor.velocity.y = 9.0f;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
} }
if (this->actor.xzDistToPlayer < 100.0f) { if (this->actor.xzDistToPlayer < 100.0f) {
if (CUR_UPG_VALUE(UPG_DEKU_STICKS) == 1) { if (CUR_UPG_VALUE(UPG_DEKU_STICKS) == 1) {
@ -191,7 +191,7 @@ void EnDntJiji_Walk(EnDntJiji* this, PlayState* play) {
} }
this->actor.textId = 0x104D; this->actor.textId = 0x104D;
Message_StartTextbox(play, this->actor.textId, NULL); Message_StartTextbox(play, this->actor.textId, NULL);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->unused = 5; this->unused = 5;
this->actionFunc = EnDntJiji_Talk; this->actionFunc = EnDntJiji_Talk;
} }
@ -329,7 +329,7 @@ void EnDntJiji_Hide(EnDntJiji* this, PlayState* play) {
void EnDntJiji_SetupReturn(EnDntJiji* this, PlayState* play) { void EnDntJiji_SetupReturn(EnDntJiji* this, PlayState* play) {
this->endFrame = (f32)Animation_GetLastFrame(&gDntJijiWalkAnim); this->endFrame = (f32)Animation_GetLastFrame(&gDntJijiWalkAnim);
Animation_Change(&this->skelAnime, &gDntJijiWalkAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &gDntJijiWalkAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f);
this->actor.speedXZ = 2.0f; this->actor.speed = 2.0f;
this->isSolid = this->unburrow = true; this->isSolid = this->unburrow = true;
this->actionFunc = EnDntJiji_Return; this->actionFunc = EnDntJiji_Return;
} }
@ -345,7 +345,7 @@ void EnDntJiji_Return(EnDntJiji* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.velocity.y = 9.0f; this->actor.velocity.y = 9.0f;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
} }
if (this->sfxTimer == 0) { if (this->sfxTimer == 0) {
this->sfxTimer = 3; this->sfxTimer = 3;
@ -361,7 +361,7 @@ void EnDntJiji_Return(EnDntJiji* this, PlayState* play) {
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 8, NA_BGM_ENEMY); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 8, NA_BGM_ENEMY);
} }
} }
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->isSolid = 0; this->isSolid = 0;
this->actionFunc = EnDntJiji_SetupBurrow; this->actionFunc = EnDntJiji_SetupBurrow;
} }

View file

@ -291,7 +291,7 @@ void EnDntNomal_TargetUnburrow(EnDntNomal* this, PlayState* play) {
void EnDntNomal_SetupTargetWalk(EnDntNomal* this, PlayState* play) { void EnDntNomal_SetupTargetWalk(EnDntNomal* this, PlayState* play) {
this->endFrame = (f32)Animation_GetLastFrame(&gHintNutsRunAnim); this->endFrame = (f32)Animation_GetLastFrame(&gHintNutsRunAnim);
Animation_Change(&this->skelAnime, &gHintNutsRunAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &gHintNutsRunAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f);
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
this->actor.colChkInfo.mass = 0; this->actor.colChkInfo.mass = 0;
this->actionFunc = EnDntNomal_TargetWalk; this->actionFunc = EnDntNomal_TargetWalk;
} }
@ -309,7 +309,7 @@ void EnDntNomal_TargetWalk(EnDntNomal* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
} }
if (this->actor.world.pos.z > -30.0f) { if (this->actor.world.pos.z > -30.0f) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = EnDntNomal_TargetFacePlayer; this->actionFunc = EnDntNomal_TargetFacePlayer;
} }
} }
@ -384,7 +384,7 @@ void EnDntNomal_TargetReturn(EnDntNomal* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, RAD_TO_BINANG(Math_FAtan2F(dx, dz)), 3, 0x1388, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, RAD_TO_BINANG(Math_FAtan2F(dx, dz)), 3, 0x1388, 0);
if (fabsf(this->actor.shape.rot.y - RAD_TO_BINANG(Math_FAtan2F(dx, dz))) < 20.0f) { if (fabsf(this->actor.shape.rot.y - RAD_TO_BINANG(Math_FAtan2F(dx, dz))) < 20.0f) {
this->actor.speedXZ = 1.0f; this->actor.speed = 1.0f;
} }
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
@ -394,7 +394,7 @@ void EnDntNomal_TargetReturn(EnDntNomal* this, PlayState* play) {
this->endFrame = (f32)Animation_GetLastFrame(&gHintNutsBurrowAnim); this->endFrame = (f32)Animation_GetLastFrame(&gHintNutsBurrowAnim);
Animation_Change(&this->skelAnime, &gHintNutsBurrowAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_ONCE, -10.0f); Animation_Change(&this->skelAnime, &gHintNutsBurrowAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_ONCE, -10.0f);
this->actor.world.pos.z = -173.0f; this->actor.world.pos.z = -173.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = EnDntNomal_TargetBurrow; this->actionFunc = EnDntNomal_TargetBurrow;
} }
} }
@ -508,7 +508,7 @@ void EnDntNomal_StageUnburrow(EnDntNomal* this, PlayState* play) {
void EnDntNomal_SetupStageCelebrate(EnDntNomal* this, PlayState* play) { void EnDntNomal_SetupStageCelebrate(EnDntNomal* this, PlayState* play) {
this->endFrame = (f32)Animation_GetLastFrame(&gDntStageWalkAnim); this->endFrame = (f32)Animation_GetLastFrame(&gDntStageWalkAnim);
Animation_Change(&this->skelAnime, &gDntStageWalkAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &gDntStageWalkAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f);
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
this->isSolid = true; this->isSolid = true;
this->actionFunc = EnDntNomal_StageCelebrate; this->actionFunc = EnDntNomal_StageCelebrate;
} }
@ -522,7 +522,7 @@ void EnDntNomal_StageCelebrate(EnDntNomal* this, PlayState* play) {
if ((fabsf(dx) < 10.0f) && (fabsf(dz) < 10.0f) && (Message_GetState(&play->msgCtx) != TEXT_STATE_NONE)) { if ((fabsf(dx) < 10.0f) && (fabsf(dz) < 10.0f) && (Message_GetState(&play->msgCtx) != TEXT_STATE_NONE)) {
this->action = DNT_ACTION_PRIZE; this->action = DNT_ACTION_PRIZE;
this->actionFunc = EnDntNomal_SetupStageDance; this->actionFunc = EnDntNomal_SetupStageDance;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
return; return;
} }
Math_SmoothStepToS(&this->actor.shape.rot.y, RAD_TO_BINANG(Math_FAtan2F(dx, dz)), 1, 0xBB8, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, RAD_TO_BINANG(Math_FAtan2F(dx, dz)), 1, 0xBB8, 0);
@ -708,7 +708,7 @@ void EnDntNomal_StageAttack(EnDntNomal* this, PlayState* play) {
void EnDntNomal_StageSetupReturn(EnDntNomal* this, PlayState* play) { void EnDntNomal_StageSetupReturn(EnDntNomal* this, PlayState* play) {
this->endFrame = (f32)Animation_GetLastFrame(&gDntStageWalkAnim); this->endFrame = (f32)Animation_GetLastFrame(&gDntStageWalkAnim);
Animation_Change(&this->skelAnime, &gDntStageWalkAnim, 1.5f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &gDntStageWalkAnim, 1.5f, 0.0f, this->endFrame, ANIMMODE_LOOP, -10.0f);
this->actor.speedXZ = 4.0f; this->actor.speed = 4.0f;
this->isSolid = false; this->isSolid = false;
this->actionFunc = EnDntNomal_StageReturn; this->actionFunc = EnDntNomal_StageReturn;
} }
@ -729,7 +729,7 @@ void EnDntNomal_StageReturn(EnDntNomal* this, PlayState* play) {
if ((fabsf(sp2C) < 7.0f) && (fabsf(sp28) < 7.0f)) { if ((fabsf(sp2C) < 7.0f) && (fabsf(sp28) < 7.0f)) {
this->actor.world.pos.x = this->flowerPos.x; this->actor.world.pos.x = this->flowerPos.x;
this->actor.world.pos.z = this->flowerPos.z; this->actor.world.pos.z = this->flowerPos.z;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = EnDntNomal_SetupStageHide; this->actionFunc = EnDntNomal_SetupStageHide;
} }
} }

View file

@ -165,7 +165,7 @@ void EnDodojr_SetupCrawlTowardsTarget(EnDodojr* this) {
Animation_Change(&this->skelAnime, &object_dodojr_Anim_000860, 1.8f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, -10.0f); Animation_Change(&this->skelAnime, &object_dodojr_Anim_000860, 1.8f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, -10.0f);
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 2.6f; this->actor.speed = 2.6f;
this->actor.gravity = -0.8f; this->actor.gravity = -0.8f;
} }
@ -173,7 +173,7 @@ void EnDodojr_SetupFlipBounce(EnDodojr* this) {
f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_0004A0); f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_0004A0);
Animation_Change(&this->skelAnime, &object_dodojr_Anim_0004A0, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, -10.0f); Animation_Change(&this->skelAnime, &object_dodojr_Anim_0004A0, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, -10.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.x = 0.0f; this->actor.velocity.x = 0.0f;
this->actor.velocity.z = 0.0f; this->actor.velocity.z = 0.0f;
this->actor.gravity = -0.8f; this->actor.gravity = -0.8f;
@ -205,7 +205,7 @@ void EnDodojr_SetupDespawn(EnDodojr* this) {
this->actor.shape.shadowDraw = NULL; this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.home.pos = this->actor.world.pos; this->actor.home.pos = this->actor.world.pos;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.gravity = -0.8f; this->actor.gravity = -0.8f;
this->timer = 30; this->timer = 30;
this->dustPos = this->actor.world.pos; this->dustPos = this->actor.world.pos;
@ -214,7 +214,7 @@ void EnDodojr_SetupDespawn(EnDodojr* this) {
void EnDodojr_SetupEatBomb(EnDodojr* this) { void EnDodojr_SetupEatBomb(EnDodojr* this) {
Animation_Change(&this->skelAnime, &object_dodojr_Anim_000724, 1.0f, 8.0f, 12.0f, ANIMMODE_ONCE, 0.0f); Animation_Change(&this->skelAnime, &object_dodojr_Anim_000724, 1.0f, 8.0f, 12.0f, ANIMMODE_ONCE, 0.0f);
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_EAT); Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_EAT);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.x = 0.0f; this->actor.velocity.x = 0.0f;
this->actor.velocity.z = 0.0f; this->actor.velocity.z = 0.0f;
this->actor.gravity = -0.8f; this->actor.gravity = -0.8f;
@ -423,7 +423,7 @@ void EnDodojr_EmergeFromGround(EnDodojr* this, PlayState* play) {
if (sp2C == 0.0f) { if (sp2C == 0.0f) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.world.rot.x = this->actor.shape.rot.x; this->actor.world.rot.x = this->actor.shape.rot.x;
this->actor.speedXZ = 2.6f; this->actor.speed = 2.6f;
this->actionFunc = EnDodojr_CrawlTowardsTarget; this->actionFunc = EnDodojr_CrawlTowardsTarget;
} }
} }

View file

@ -357,7 +357,7 @@ void EnDodongo_Destroy(Actor* thisx, PlayState* play) {
void EnDodongo_SetupIdle(EnDodongo* this) { void EnDodongo_SetupIdle(EnDodongo* this) {
Animation_MorphToLoop(&this->skelAnime, &gDodongoWaitAnim, -4.0f); Animation_MorphToLoop(&this->skelAnime, &gDodongoWaitAnim, -4.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->timer = Rand_S16Offset(30, 50); this->timer = Rand_S16Offset(30, 50);
this->actionState = DODONGO_IDLE; this->actionState = DODONGO_IDLE;
EnDodongo_SetupAction(this, EnDodongo_Idle); EnDodongo_SetupAction(this, EnDodongo_Idle);
@ -367,7 +367,7 @@ void EnDodongo_SetupWalk(EnDodongo* this) {
f32 frames = Animation_GetLastFrame(&gDodongoWalkAnim); f32 frames = Animation_GetLastFrame(&gDodongoWalkAnim);
Animation_Change(&this->skelAnime, &gDodongoWalkAnim, 0.0f, 0.0f, frames, ANIMMODE_LOOP, -4.0f); Animation_Change(&this->skelAnime, &gDodongoWalkAnim, 0.0f, 0.0f, frames, ANIMMODE_LOOP, -4.0f);
this->actor.speedXZ = 1.5f; this->actor.speed = 1.5f;
this->timer = Rand_S16Offset(50, 70); this->timer = Rand_S16Offset(50, 70);
this->rightFootStep = true; this->rightFootStep = true;
this->actionState = DODONGO_WALK; this->actionState = DODONGO_WALK;
@ -377,14 +377,14 @@ void EnDodongo_SetupWalk(EnDodongo* this) {
void EnDodongo_SetupBreatheFire(EnDodongo* this) { void EnDodongo_SetupBreatheFire(EnDodongo* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gDodongoBreatheFireAnim, -4.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gDodongoBreatheFireAnim, -4.0f);
this->actionState = DODONGO_BREATHE_FIRE; this->actionState = DODONGO_BREATHE_FIRE;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_BreatheFire); EnDodongo_SetupAction(this, EnDodongo_BreatheFire);
} }
void EnDodongo_SetupEndBreatheFire(EnDodongo* this) { void EnDodongo_SetupEndBreatheFire(EnDodongo* this) {
Animation_PlayOnce(&this->skelAnime, &gDodongoAfterBreatheFireAnim); Animation_PlayOnce(&this->skelAnime, &gDodongoAfterBreatheFireAnim);
this->actionState = DODONGO_END_BREATHE_FIRE; this->actionState = DODONGO_END_BREATHE_FIRE;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_EndBreatheFire); EnDodongo_SetupAction(this, EnDodongo_EndBreatheFire);
} }
@ -392,14 +392,14 @@ void EnDodongo_SetupSwallowBomb(EnDodongo* this) {
Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, -1.0f, 35.0f, 0.0f, ANIMMODE_ONCE, -4.0f); Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, -1.0f, 35.0f, 0.0f, ANIMMODE_ONCE, -4.0f);
this->actionState = DODONGO_SWALLOW_BOMB; this->actionState = DODONGO_SWALLOW_BOMB;
this->timer = 25; this->timer = 25;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_SwallowBomb); EnDodongo_SetupAction(this, EnDodongo_SwallowBomb);
} }
void EnDodongo_SetupStunned(EnDodongo* this) { void EnDodongo_SetupStunned(EnDodongo* this) {
Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, 0.0f, 25.0f, 0.0f, ANIMMODE_ONCE, -4.0f); Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, 0.0f, 25.0f, 0.0f, ANIMMODE_ONCE, -4.0f);
this->actionState = DODONGO_STUNNED; this->actionState = DODONGO_STUNNED;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->damageEffect == 0xF) { if (this->damageEffect == 0xF) {
this->iceTimer = 36; this->iceTimer = 36;
} }
@ -532,10 +532,10 @@ void EnDodongo_Walk(EnDodongo* this, PlayState* play) {
yawDiff = ABS(yawDiff); yawDiff = ABS(yawDiff);
Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 1.5f, 0.1f, 1.0f, 0.0f);
playbackSpeed = this->actor.speedXZ * 0.75f; playbackSpeed = this->actor.speed * 0.75f;
if (this->actor.speedXZ >= 0.0f) { if (this->actor.speed >= 0.0f) {
if (playbackSpeed > 3.0f / 2) { if (playbackSpeed > 3.0f / 2) {
playbackSpeed = 3.0f / 2; playbackSpeed = 3.0f / 2;
} }
@ -596,7 +596,7 @@ void EnDodongo_SetupSweepTail(EnDodongo* this) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DAMAGE);
this->actionState = DODONGO_SWEEP_TAIL; this->actionState = DODONGO_SWEEP_TAIL;
this->timer = 0; this->timer = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_SweepTail); EnDodongo_SetupAction(this, EnDodongo_SweepTail);
} }
@ -664,7 +664,7 @@ void EnDodongo_SetupDeath(EnDodongo* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DEAD); Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DEAD);
this->actionState = DODONGO_DEATH; this->actionState = DODONGO_DEATH;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_Death); EnDodongo_SetupAction(this, EnDodongo_Death);
} }

View file

@ -277,7 +277,7 @@ void EnDog_Init(Actor* thisx, PlayState* play) {
if (!gSaveContext.dogIsLost) { if (!gSaveContext.dogIsLost) {
this->nextBehavior = DOG_SIT; this->nextBehavior = DOG_SIT;
this->actionFunc = EnDog_Wait; this->actionFunc = EnDog_Wait;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
return; return;
} else { } else {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
@ -304,7 +304,7 @@ void EnDog_Destroy(Actor* thisx, PlayState* play) {
void EnDog_FollowPath(EnDog* this, PlayState* play) { void EnDog_FollowPath(EnDog* this, PlayState* play) {
s32 behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK }; s32 behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK };
s32 unused[] = { 40, 80, 20 }; s32 unused[] = { 40, 80, 20 };
f32 speed; f32 speedXZ;
s32 frame; s32 frame;
if (EnDog_CanFollow(this, play) == 1) { if (EnDog_CanFollow(this, play) == 1) {
@ -313,11 +313,11 @@ void EnDog_FollowPath(EnDog* this, PlayState* play) {
if (DECR(this->behaviorTimer) != 0) { if (DECR(this->behaviorTimer) != 0) {
if (this->nextBehavior == DOG_WALK) { if (this->nextBehavior == DOG_WALK) {
speed = 1.0f; speedXZ = 1.0f;
} else { } else {
speed = 4.0f; speedXZ = 4.0f;
} }
Math_SmoothStepToF(&this->actor.speedXZ, speed, 0.4f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, speedXZ, 0.4f, 1.0f, 0.0f);
EnDog_Orient(this, play); EnDog_Orient(this, play);
this->actor.shape.rot = this->actor.world.rot; this->actor.shape.rot = this->actor.world.rot;
@ -357,16 +357,16 @@ void EnDog_ChooseMovement(EnDog* this, PlayState* play) {
} }
this->actionFunc = EnDog_FollowPath; this->actionFunc = EnDog_FollowPath;
} }
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.4f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.4f, 1.0f, 0.0f);
} }
void EnDog_FollowPlayer(EnDog* this, PlayState* play) { void EnDog_FollowPlayer(EnDog* this, PlayState* play) {
f32 speed; f32 speedXZ;
if (gSaveContext.dogParams == 0) { if (gSaveContext.dogParams == 0) {
this->nextBehavior = DOG_SIT; this->nextBehavior = DOG_SIT;
this->actionFunc = EnDog_Wait; this->actionFunc = EnDog_Wait;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
return; return;
} }
@ -375,21 +375,21 @@ void EnDog_FollowPlayer(EnDog* this, PlayState* play) {
this->nextBehavior = DOG_BOW; this->nextBehavior = DOG_BOW;
} }
gSaveContext.dogParams = 0; gSaveContext.dogParams = 0;
speed = 0.0f; speedXZ = 0.0f;
} else if (this->actor.xzDistToPlayer > 100.0f) { } else if (this->actor.xzDistToPlayer > 100.0f) {
this->nextBehavior = DOG_RUN; this->nextBehavior = DOG_RUN;
speed = 4.0f; speedXZ = 4.0f;
} else if (this->actor.xzDistToPlayer < 40.0f) { } else if (this->actor.xzDistToPlayer < 40.0f) {
if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) { if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) {
this->nextBehavior = DOG_BOW; this->nextBehavior = DOG_BOW;
} }
speed = 0.0f; speedXZ = 0.0f;
} else { } else {
this->nextBehavior = DOG_WALK; this->nextBehavior = DOG_WALK;
speed = 1.0f; speedXZ = 1.0f;
} }
Math_ApproachF(&this->actor.speedXZ, speed, 0.6f, 1.0f); Math_ApproachF(&this->actor.speed, speedXZ, 0.6f, 1.0f);
if (!(this->actor.xzDistToPlayer > 400.0f)) { if (!(this->actor.xzDistToPlayer > 400.0f)) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 1000, 1); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 1000, 1);
@ -399,7 +399,7 @@ void EnDog_FollowPlayer(EnDog* this, PlayState* play) {
void EnDog_RunAway(EnDog* this, PlayState* play) { void EnDog_RunAway(EnDog* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 200.0f) { if (this->actor.xzDistToPlayer < 200.0f) {
Math_ApproachF(&this->actor.speedXZ, 4.0f, 0.6f, 1.0f); Math_ApproachF(&this->actor.speed, 4.0f, 0.6f, 1.0f);
Math_SmoothStepToS(&this->actor.world.rot.y, (this->actor.yawTowardsPlayer ^ 0x8000), 10, 1000, 1); Math_SmoothStepToS(&this->actor.world.rot.y, (this->actor.yawTowardsPlayer ^ 0x8000), 10, 1000, 1);
} else { } else {
this->actionFunc = EnDog_FaceLink; this->actionFunc = EnDog_FaceLink;
@ -416,7 +416,7 @@ void EnDog_FaceLink(EnDog* this, PlayState* play) {
if (200.0f <= this->actor.xzDistToPlayer) { if (200.0f <= this->actor.xzDistToPlayer) {
this->nextBehavior = DOG_WALK; this->nextBehavior = DOG_WALK;
Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.6f, 1.0f); Math_ApproachF(&this->actor.speed, 1.0f, 0.6f, 1.0f);
rotTowardLink = this->actor.yawTowardsPlayer; rotTowardLink = this->actor.yawTowardsPlayer;
prevRotY = this->actor.world.rot.y; prevRotY = this->actor.world.rot.y;
@ -428,7 +428,7 @@ void EnDog_FaceLink(EnDog* this, PlayState* play) {
if (absAngleDiff < 200.0f) { if (absAngleDiff < 200.0f) {
this->nextBehavior = DOG_SIT; this->nextBehavior = DOG_SIT;
this->actionFunc = EnDog_Wait; this->actionFunc = EnDog_Wait;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} else { } else {
this->nextBehavior = DOG_RUN; this->nextBehavior = DOG_RUN;

View file

@ -185,7 +185,7 @@ void EnEiyer_SetupAppearFromGround(EnEiyer* this) {
this->actor.world.pos.y = this->actor.home.pos.y - 40.0f; this->actor.world.pos.y = this->actor.home.pos.y - 40.0f;
this->actor.world.pos.z = this->actor.home.pos.z; this->actor.world.pos.z = this->actor.home.pos.z;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->actor.params != 0xA) { if (this->actor.params != 0xA) {
if (this->actor.params == 0) { if (this->actor.params == 0) {
@ -208,7 +208,7 @@ void EnEiyer_SetupAppearFromGround(EnEiyer* this) {
void EnEiyer_SetupUnderground(EnEiyer* this) { void EnEiyer_SetupUnderground(EnEiyer* this) {
if (this->actor.params == 0xA) { if (this->actor.params == 0xA) {
this->actor.speedXZ = -0.5f; this->actor.speed = -0.5f;
this->actionFunc = EnEiyer_WanderUnderground; this->actionFunc = EnEiyer_WanderUnderground;
} else { } else {
this->actionFunc = EnEiyer_CircleUnderground; this->actionFunc = EnEiyer_CircleUnderground;
@ -226,7 +226,7 @@ void EnEiyer_SetupInactive(EnEiyer* this) {
} }
void EnEiyer_SetupAmbush(EnEiyer* this, PlayState* play) { void EnEiyer_SetupAmbush(EnEiyer* this, PlayState* play) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Animation_PlayOnce(&this->skelanime, &gStingerBackflipAnim); Animation_PlayOnce(&this->skelanime, &gStingerBackflipAnim);
this->collider.info.bumper.dmgFlags = DMG_DEFAULT; this->collider.info.bumper.dmgFlags = DMG_DEFAULT;
this->basePos = this->actor.world.pos; this->basePos = this->actor.world.pos;
@ -280,7 +280,7 @@ void EnEiyer_SetupHurt(EnEiyer* this) {
this->timer = 40; this->timer = 40;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40);
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
this->actionFunc = EnEiyer_Hurt; this->actionFunc = EnEiyer_Hurt;
@ -291,10 +291,10 @@ void EnEiyer_SetupDie(EnEiyer* this) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40);
if (this->collider.info.bumper.dmgFlags != (DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT)) { if (this->collider.info.bumper.dmgFlags != (DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT)) {
this->actor.speedXZ = 6.0f; this->actor.speed = 6.0f;
Animation_MorphToLoop(&this->skelanime, &gStingerHitAnim, -3.0f); Animation_MorphToLoop(&this->skelanime, &gStingerHitAnim, -3.0f);
} else { } else {
this->actor.speedXZ -= 6.0f; this->actor.speed -= 6.0f;
} }
this->collider.info.bumper.dmgFlags = DMG_DEFAULT; this->collider.info.bumper.dmgFlags = DMG_DEFAULT;
@ -305,7 +305,7 @@ void EnEiyer_SetupDie(EnEiyer* this) {
void EnEiyer_SetupDead(EnEiyer* this) { void EnEiyer_SetupDead(EnEiyer* this) {
this->actor.colorFilterParams |= 0x2000; this->actor.colorFilterParams |= 0x2000;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actionFunc = EnEiyer_Dead; this->actionFunc = EnEiyer_Dead;
} }
@ -313,7 +313,7 @@ void EnEiyer_SetupDead(EnEiyer* this) {
void EnEiyer_SetupStunned(EnEiyer* this) { void EnEiyer_SetupStunned(EnEiyer* this) {
Animation_Change(&this->skelanime, &gStingerPopOutAnim, 2.0f, 0.0f, 0.0f, 0, -8.0f); Animation_Change(&this->skelanime, &gStingerPopOutAnim, 2.0f, 0.0f, 0.0f, 0, -8.0f);
this->timer = 80; this->timer = 80;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->collider.dim.height = sColCylInit.dim.height + 8; this->collider.dim.height = sColCylInit.dim.height + 8;
@ -395,7 +395,7 @@ void EnEiyer_Ambush(EnEiyer* this, PlayState* play) {
this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * xzOffset) + this->basePos.z; this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * xzOffset) + this->basePos.z;
} else { } else {
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 80.0f, 0.5f); Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 80.0f, 0.5f);
this->actor.speedXZ = 0.8f; this->actor.speed = 0.8f;
} }
if (animFinished) { if (animFinished) {
@ -419,13 +419,13 @@ void EnEiyer_Glide(EnEiyer* this, PlayState* play) {
} }
curFrame = this->skelanime.curFrame; curFrame = this->skelanime.curFrame;
Math_ApproachF(&this->basePos.y, this->actor.floorHeight + 80.0f + 5.0f, 0.3f, this->actor.speedXZ); Math_ApproachF(&this->basePos.y, this->actor.floorHeight + 80.0f + 5.0f, 0.3f, this->actor.speed);
this->actor.world.pos.y = this->basePos.y - cosf((curFrame - 5.0f) * (M_PI / 40)) * 5.0f; this->actor.world.pos.y = this->basePos.y - cosf((curFrame - 5.0f) * (M_PI / 40)) * 5.0f;
if (curFrame <= 45.0f) { if (curFrame <= 45.0f) {
Math_StepToF(&this->actor.speedXZ, 1.0f, 0.03f); Math_StepToF(&this->actor.speed, 1.0f, 0.03f);
} else { } else {
Math_StepToF(&this->actor.speedXZ, 1.5f, 0.03f); Math_StepToF(&this->actor.speed, 1.5f, 0.03f);
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
@ -467,14 +467,14 @@ void EnEiyer_StartAttack(EnEiyer* this, PlayState* play) {
} }
this->actor.world.rot.x = -this->actor.shape.rot.x; this->actor.world.rot.x = -this->actor.shape.rot.x;
Math_StepToF(&this->actor.speedXZ, 5.0f, 0.3f); Math_StepToF(&this->actor.speed, 5.0f, 0.3f);
Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 2, 0x71C); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 2, 0x71C);
func_8002F974(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); func_8002F974(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG);
} }
void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) { void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
this->actor.speedXZ *= 1.1f; this->actor.speed *= 1.1f;
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
EnEiyer_SetupLand(this); EnEiyer_SetupLand(this);
@ -490,7 +490,7 @@ void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) {
void EnEiyer_Land(EnEiyer* this, PlayState* play) { void EnEiyer_Land(EnEiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ScaledStepToS(&this->actor.world.rot.x, -0x4000, 0x450); Math_ScaledStepToS(&this->actor.world.rot.x, -0x4000, 0x450);
Math_StepToF(&this->actor.speedXZ, 7.0f, 1.0f); Math_StepToF(&this->actor.speed, 7.0f, 1.0f);
if (this->timer == -1) { if (this->timer == -1) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
@ -521,7 +521,7 @@ void EnEiyer_Hurt(EnEiyer* this, PlayState* play) {
this->timer--; this->timer--;
} }
Math_ApproachF(&this->basePos.y, this->actor.floorHeight + 80.0f + 5.0f, 0.5f, this->actor.speedXZ); Math_ApproachF(&this->basePos.y, this->actor.floorHeight + 80.0f + 5.0f, 0.5f, this->actor.speed);
this->actor.world.pos.y = this->basePos.y - 5.0f; this->actor.world.pos.y = this->basePos.y - 5.0f;
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
@ -546,7 +546,7 @@ void EnEiyer_Hurt(EnEiyer* this, PlayState* play) {
void EnEiyer_Die(EnEiyer* this, PlayState* play) { void EnEiyer_Die(EnEiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
if (this->actor.speedXZ > 0.0f) { if (this->actor.speed > 0.0f) {
Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x400); Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x400);
} else { } else {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x400); Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x400);

View file

@ -257,7 +257,7 @@ void func_80A0214C(EnElf* this, PlayState* play) {
this->unk_2AC = 0x400; this->unk_2AC = 0x400;
this->unk_2B8 = 2.0f; this->unk_2B8 = 2.0f;
this->func_2C8 = func_80A020A4; this->func_2C8 = func_80A020A4;
this->actor.speedXZ = 1.5f; this->actor.speed = 1.5f;
this->unk_2C0 = (s16)Rand_ZeroFloat(8.0f) + 4; this->unk_2C0 = (s16)Rand_ZeroFloat(8.0f) + 4;
} else { } else {
this->unk_2C0 = 10; this->unk_2C0 = 10;
@ -542,7 +542,7 @@ void func_80A03018(EnElf* this, PlayState* play) {
s16 targetYaw; s16 targetYaw;
Vec3f* unk_28C = &this->unk_28C; Vec3f* unk_28C = &this->unk_28C;
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_2B8, 0.2f, 0.5f, 0.01f); Math_SmoothStepToF(&this->actor.speed, this->unk_2B8, 0.2f, 0.5f, 0.01f);
switch (this->unk_2A8) { switch (this->unk_2A8) {
case 0: case 0:
@ -584,7 +584,7 @@ void func_80A03148(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) {
xzVelocity = sqrtf(SQ(xVelTarget) + SQ(zVelTarget)); xzVelocity = sqrtf(SQ(xVelTarget) + SQ(zVelTarget));
this->actor.speedXZ = clampedXZ = CLAMP(xzVelocity, arg2, arg3); this->actor.speed = clampedXZ = CLAMP(xzVelocity, arg2, arg3);
if ((xzVelocity != clampedXZ) && (xzVelocity != 0.0f)) { if ((xzVelocity != clampedXZ) && (xzVelocity != 0.0f)) {
xzVelocity = clampedXZ / xzVelocity; xzVelocity = clampedXZ / xzVelocity;
@ -941,7 +941,7 @@ void func_80A03CF8(EnElf* this, PlayState* play) {
if (arrowPointedActor != NULL) { if (arrowPointedActor != NULL) {
func_80A03148(this, &nextPos, 0.0f, 20.0f, 0.2f); func_80A03148(this, &nextPos, 0.0f, 20.0f, 0.2f);
if (this->actor.speedXZ >= 5.0f) { if (this->actor.speed >= 5.0f) {
EnElf_SpawnSparkles(this, play, 16); EnElf_SpawnSparkles(this, play, 16);
} }
} else { } else {
@ -1240,7 +1240,7 @@ void func_80A04DE4(EnElf* this, PlayState* play) {
func_80A03148(this, &headCopy, 0, 20.0f, 0.2f); func_80A03148(this, &headCopy, 0, 20.0f, 0.2f);
if (this->actor.speedXZ >= 5.0f) { if (this->actor.speed >= 5.0f) {
EnElf_SpawnSparkles(this, play, 16); EnElf_SpawnSparkles(this, play, 16);
} }

View file

@ -215,7 +215,7 @@ void EnExRuppy_DropIntoWater(EnExRuppy* this, PlayState* play) {
if ((divingGame != NULL) && (divingGame->actor.update != NULL) && if ((divingGame != NULL) && (divingGame->actor.update != NULL) &&
((divingGame->unk_296 == 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) || (this->timer == 0))) { ((divingGame->unk_296 == 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) || (this->timer == 0))) {
this->invisible = true; this->invisible = true;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
func_80078914(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER); func_80078914(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER);

View file

@ -306,7 +306,7 @@ s32 EnFd_ColliderCheck(EnFd* this, PlayState* play) {
} }
this->attackTimer = 30; this->attackTimer = 30;
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
func_8002F71C(play, &this->actor, this->actor.speedXZ + 2.0f, this->actor.yawTowardsPlayer, 6.0f); func_8002F71C(play, &this->actor, this->actor.speed + 2.0f, this->actor.yawTowardsPlayer, 6.0f);
} }
return false; return false;
} }
@ -442,7 +442,7 @@ void EnFd_Fade(EnFd* this, PlayState* play) {
this->invincibilityTimer = 0; this->invincibilityTimer = 0;
this->spinTimer = 0; this->spinTimer = 0;
this->actionFunc = EnFd_WaitForCore; this->actionFunc = EnFd_WaitForCore;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} }
} }
@ -489,7 +489,7 @@ void EnFd_SpinAndGrow(EnFd* this, PlayState* play) {
this->actor.scale.y = 0.01f; this->actor.scale.y = 0.01f;
this->actor.world.rot.y ^= 0x8000; this->actor.world.rot.y ^= 0x8000;
this->actor.flags |= ACTOR_FLAG_0; this->actor.flags |= ACTOR_FLAG_0;
this->actor.speedXZ = 8.0f; this->actor.speed = 8.0f;
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_1); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_1);
this->actionFunc = EnFd_JumpToGround; this->actionFunc = EnFd_JumpToGround;
} else { } else {
@ -502,7 +502,7 @@ void EnFd_SpinAndGrow(EnFd* this, PlayState* play) {
void EnFd_JumpToGround(EnFd* this, PlayState* play) { void EnFd_JumpToGround(EnFd* this, PlayState* play) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.velocity.y > 0.0f)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.velocity.y > 0.0f)) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_2); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_2);
this->actionFunc = EnFd_Land; this->actionFunc = EnFd_Land;
@ -587,7 +587,7 @@ void EnFd_Run(EnFd* this, PlayState* play) {
if (this->invincibilityTimer == 0) { if (this->invincibilityTimer == 0) {
this->actor.world.rot.y ^= 0x8000; this->actor.world.rot.y ^= 0x8000;
this->actor.velocity.y = 6.0f; this->actor.velocity.y = 6.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_1); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_1);
this->actionFunc = EnFd_JumpToGround; this->actionFunc = EnFd_JumpToGround;
return; return;
@ -624,7 +624,7 @@ void EnFd_Run(EnFd* this, PlayState* play) {
if (this->skelAnime.curFrame == 6.0f || this->skelAnime.curFrame == 13.0f || this->skelAnime.curFrame == 28.0f) { if (this->skelAnime.curFrame == 6.0f || this->skelAnime.curFrame == 13.0f || this->skelAnime.curFrame == 28.0f) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_KICK); Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_KICK);
} }
Math_SmoothStepToF(&this->actor.speedXZ, 8.0f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 8.0f, 0.1f, 1.0f, 0.0f);
} }
/** /**

View file

@ -88,9 +88,9 @@ void EnFdFire_UpdatePos(EnFdFire* this, Vec3f* targetPos) {
f32 zDiff = targetPos->z - this->actor.world.pos.z; f32 zDiff = targetPos->z - this->actor.world.pos.z;
dist = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff)); dist = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff));
if (fabsf(dist) > fabsf(this->actor.speedXZ)) { if (fabsf(dist) > fabsf(this->actor.speed)) {
this->actor.velocity.x = (xDiff / dist) * this->actor.speedXZ; this->actor.velocity.x = (xDiff / dist) * this->actor.speed;
this->actor.velocity.z = (zDiff / dist) * this->actor.speedXZ; this->actor.velocity.z = (zDiff / dist) * this->actor.speed;
} else { } else {
this->actor.velocity.x = 0.0f; this->actor.velocity.x = 0.0f;
this->actor.velocity.z = 0.0f; this->actor.velocity.z = 0.0f;
@ -130,7 +130,7 @@ void EnFdFire_Init(Actor* thisx, PlayState* play) {
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInit);
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.gravity = -0.6f; this->actor.gravity = -0.6f;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actor.velocity.y = 12.0f; this->actor.velocity.y = 12.0f;
this->spawnRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.world.pos); this->spawnRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.world.pos);
this->scale = 3.0f; this->scale = 3.0f;
@ -153,7 +153,7 @@ void func_80A0E70C(EnFdFire* this, PlayState* play) {
EnFdFire_UpdatePos(this, &targetPos); EnFdFire_UpdatePos(this, &targetPos);
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (!(this->actor.velocity.y > 0.0f))) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (!(this->actor.velocity.y > 0.0f))) {
this->actor.velocity = velocity; this->actor.velocity = velocity;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
if (this->actor.params & 0x8000) { if (this->actor.params & 0x8000) {
this->deathTimer = 200; this->deathTimer = 200;
@ -188,16 +188,16 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play) {
this->actionFunc = EnFdFire_Disappear; this->actionFunc = EnFdFire_Disappear;
} else { } else {
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &pos), 8, 0xFA0, 1); Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &pos), 8, 0xFA0, 1);
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.4f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.4f, 1.0f, 0.0f);
if (this->actor.speedXZ < 0.1f) { if (this->actor.speed < 0.1f) {
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
} }
func_8002D868(&this->actor); func_8002D868(&this->actor);
} }
} }
void EnFdFire_Disappear(EnFdFire* this, PlayState* play) { void EnFdFire_Disappear(EnFdFire* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.6f, 9.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.6f, 9.0f, 0.0f);
func_8002D868(&this->actor); func_8002D868(&this->actor);
Math_SmoothStepToF(&this->scale, 0.0f, 0.3f, 0.1f, 0.0f); Math_SmoothStepToF(&this->scale, 0.0f, 0.3f, 0.1f, 0.0f);
this->actor.shape.shadowScale = 20.0f; this->actor.shape.shadowScale = 20.0f;

View file

@ -104,7 +104,7 @@ void EnFhgFire_Init(Actor* thisx, PlayState* play) {
if (this->actor.params == FHGFIRE_LIGHTNING_SHOCK) { if (this->actor.params == FHGFIRE_LIGHTNING_SHOCK) {
this->actor.draw = NULL; this->actor.draw = NULL;
EnFhgFire_SetUpdate(this, EnFhgFire_LightningShock); EnFhgFire_SetUpdate(this, EnFhgFire_LightningShock);
this->actor.speedXZ = 30.0f; this->actor.speed = 30.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_SPARK); Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_SPARK);
} else if (this->actor.params == FHGFIRE_LIGHTNING_BURST) { } else if (this->actor.params == FHGFIRE_LIGHTNING_BURST) {
EnFhgFire_SetUpdate(this, EnFhgFire_LightningBurst); EnFhgFire_SetUpdate(this, EnFhgFire_LightningBurst);
@ -141,7 +141,7 @@ void EnFhgFire_Init(Actor* thisx, PlayState* play) {
f32 dzL; f32 dzL;
f32 dxzL; f32 dxzL;
this->actor.speedXZ = (this->actor.world.rot.x == 0) ? 8.0f : 3.0f; this->actor.speed = (this->actor.world.rot.x == 0) ? 8.0f : 3.0f;
EnFhgFire_SetUpdate(this, EnFhgFire_EnergyBall); EnFhgFire_SetUpdate(this, EnFhgFire_EnergyBall);
this->work[FHGFIRE_TIMER] = 70; this->work[FHGFIRE_TIMER] = 70;
@ -501,7 +501,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
if (bossGnd->flyMode == GND_FLY_NEUTRAL) { if (bossGnd->flyMode == GND_FLY_NEUTRAL) {
angleModX = Rand_CenteredFloat(0x2000); angleModX = Rand_CenteredFloat(0x2000);
angleModY = Rand_CenteredFloat(0x2000); angleModY = Rand_CenteredFloat(0x2000);
this->actor.speedXZ = 15.0f; this->actor.speed = 15.0f;
} else { } else {
angleModX = 0; angleModX = 0;
angleModY = 0; angleModY = 0;
@ -511,10 +511,10 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
} }
if (!canBottleReflect2 && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H)) { if (!canBottleReflect2 && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H)) {
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
this->work[FHGFIRE_RETURN_COUNT] = 4; this->work[FHGFIRE_RETURN_COUNT] = 4;
} else { } else {
this->actor.speedXZ += 1.0f; this->actor.speed += 1.0f;
} }
} }
this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(dxPG, dzPG)) + angleModY; this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(dxPG, dzPG)) + angleModY;
@ -539,7 +539,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
case FHGFIRE_LIGHT_BLUE: case FHGFIRE_LIGHT_BLUE:
if ((bossGnd->flyMode == GND_FLY_RETURN) && (this->work[FHGFIRE_RETURN_COUNT] < 100)) { if ((bossGnd->flyMode == GND_FLY_RETURN) && (this->work[FHGFIRE_RETURN_COUNT] < 100)) {
this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(dxPG, dzPG)); this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(dxPG, dzPG));
if ((sqrtf(SQ(dxPG) + SQ(dzPG)) < (150.0f + (this->actor.speedXZ * 8.0f)))) { if ((sqrtf(SQ(dxPG) + SQ(dzPG)) < (150.0f + (this->actor.speed * 8.0f)))) {
this->work[FHGFIRE_FIRE_MODE] = FHGFIRE_LIGHT_REFLECT; this->work[FHGFIRE_FIRE_MODE] = FHGFIRE_LIGHT_REFLECT;
bossGnd->returnSuccess = true; bossGnd->returnSuccess = true;
this->work[FHGFIRE_TIMER] = 8; this->work[FHGFIRE_TIMER] = 8;
@ -582,7 +582,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(dyL, dxzL)); this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(dyL, dxzL));
this->work[FHGFIRE_FIRE_MODE] = FHGFIRE_LIGHT_GREEN; this->work[FHGFIRE_FIRE_MODE] = FHGFIRE_LIGHT_GREEN;
Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_REFLECT_MG); Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_REFLECT_MG);
this->actor.speedXZ += 2.0f; this->actor.speed += 2.0f;
} }
break; break;
} }
@ -631,8 +631,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
} }
Lights_PointNoGlowSetInfo(&this->lightInfo, (s16)this->actor.world.pos.x, (s16)this->actor.world.pos.y, Lights_PointNoGlowSetInfo(&this->lightInfo, (s16)this->actor.world.pos.x, (s16)this->actor.world.pos.y,
(s16)this->actor.world.pos.z, 255, 255, 255, 200); (s16)this->actor.world.pos.z, 255, 255, 255, 200);
if (this->actor.speedXZ > 20.0f) { if (this->actor.speed > 20.0f) {
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
} }
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_FIRE - SFX_FLAG); Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_FIRE - SFX_FLAG);
// "Why ah ah ah ah" // "Why ah ah ah ah"

View file

@ -118,7 +118,7 @@ void EnFireRock_Init(Actor* thisx, PlayState* play) {
break; break;
case FIRE_ROCK_BROKEN_PIECE1: case FIRE_ROCK_BROKEN_PIECE1:
this->actor.velocity.y = Rand_ZeroFloat(3.0f) + 4.0f; this->actor.velocity.y = Rand_ZeroFloat(3.0f) + 4.0f;
this->actor.speedXZ = Rand_ZeroFloat(3.0f) + 3.0f; this->actor.speed = Rand_ZeroFloat(3.0f) + 3.0f;
this->scale = (Rand_ZeroFloat(1.0f) / 100.0f) + 0.02f; this->scale = (Rand_ZeroFloat(1.0f) / 100.0f) + 0.02f;
Actor_SetScale(&this->actor, this->scale); Actor_SetScale(&this->actor, this->scale);
this->actor.gravity = -1.5f; this->actor.gravity = -1.5f;
@ -130,7 +130,7 @@ void EnFireRock_Init(Actor* thisx, PlayState* play) {
break; break;
case FIRE_ROCK_BROKEN_PIECE2: case FIRE_ROCK_BROKEN_PIECE2:
this->actor.velocity.y = Rand_ZeroFloat(3.0f) + 4.0f; this->actor.velocity.y = Rand_ZeroFloat(3.0f) + 4.0f;
this->actor.speedXZ = Rand_ZeroFloat(3.0f) + 2.0f; this->actor.speed = Rand_ZeroFloat(3.0f) + 2.0f;
this->scale = (Rand_ZeroFloat(1.0f) / 500.0f) + 0.01f; this->scale = (Rand_ZeroFloat(1.0f) / 500.0f) + 0.01f;
Actor_SetScale(&this->actor, this->scale); Actor_SetScale(&this->actor, this->scale);
this->actor.gravity = -1.2f; this->actor.gravity = -1.2f;
@ -352,7 +352,7 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) {
this->collider.base.atFlags &= ~AT_BOUNCED; this->collider.base.atFlags &= ~AT_BOUNCED;
Actor_PlaySfx(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); Actor_PlaySfx(thisx, NA_SE_EV_BRIDGE_OPEN_STOP);
thisx->velocity.y = 0.0f; thisx->velocity.y = 0.0f;
thisx->speedXZ = 0.0f; thisx->speed = 0.0f;
this->actionFunc = EnFireRock_SpawnMoreBrokenPieces; this->actionFunc = EnFireRock_SpawnMoreBrokenPieces;
// "☆☆☆☆☆ Shield Defense Lv1 ☆☆☆☆☆" // "☆☆☆☆☆ Shield Defense Lv1 ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ シールド防御 Lv ☆☆☆☆☆ \n" VT_RST); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ シールド防御 Lv ☆☆☆☆☆ \n" VT_RST);

View file

@ -201,7 +201,7 @@ void EnFirefly_Destroy(Actor* thisx, PlayState* play) {
void EnFirefly_SetupFlyIdle(EnFirefly* this) { void EnFirefly_SetupFlyIdle(EnFirefly* this) {
this->timer = Rand_S16Offset(70, 100); this->timer = Rand_S16Offset(70, 100);
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; this->actor.speed = (Rand_ZeroOne() * 1.5f) + 1.5f;
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300);
this->targetPitch = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554; this->targetPitch = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554;
this->skelAnime.playSpeed = 1.0f; this->skelAnime.playSpeed = 1.0f;
@ -220,7 +220,7 @@ void EnFirefly_SetupFall(EnFirefly* this) {
void EnFirefly_SetupDie(EnFirefly* this) { void EnFirefly_SetupDie(EnFirefly* this) {
this->timer = 15; this->timer = 15;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = EnFirefly_Die; this->actionFunc = EnFirefly_Die;
} }
@ -228,7 +228,7 @@ void EnFirefly_SetupRebound(EnFirefly* this) {
this->actor.world.rot.x = 0x7000; this->actor.world.rot.x = 0x7000;
this->timer = 18; this->timer = 18;
this->skelAnime.playSpeed = 1.0f; this->skelAnime.playSpeed = 1.0f;
this->actor.speedXZ = 2.5f; this->actor.speed = 2.5f;
this->actionFunc = EnFirefly_Rebound; this->actionFunc = EnFirefly_Rebound;
} }
@ -262,7 +262,7 @@ void EnFirefly_SetupFrozenFall(EnFirefly* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_4; this->actor.flags |= ACTOR_FLAG_4;
this->auraType = KEESE_AURA_NONE; this->auraType = KEESE_AURA_NONE;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 255); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 255);
Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD); Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD);
@ -279,7 +279,7 @@ void EnFirefly_SetupFrozenFall(EnFirefly* this, PlayState* play) {
void EnFirefly_SetupPerch(EnFirefly* this) { void EnFirefly_SetupPerch(EnFirefly* this) {
this->timer = 1; this->timer = 1;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = EnFirefly_Perch; this->actionFunc = EnFirefly_Perch;
} }
@ -287,7 +287,7 @@ void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) {
this->skelAnime.playSpeed = 3.0f; this->skelAnime.playSpeed = 3.0f;
this->actor.shape.rot.x = 0x1554; this->actor.shape.rot.x = 0x1554;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
this->timer = 50; this->timer = 50;
this->actionFunc = EnFirefly_DisturbDiveAttack; this->actionFunc = EnFirefly_DisturbDiveAttack;
} }
@ -311,7 +311,7 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) {
distFromHome *= 0.05f; distFromHome *= 0.05f;
if (distFromHome < 1.0f) { if (distFromHome < 1.0f) {
this->actor.speedXZ *= distFromHome; this->actor.speed *= distFromHome;
} }
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
@ -373,7 +373,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
this->timer--; this->timer--;
} }
skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f); skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f);
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; this->actor.speed = (Rand_ZeroOne() * 1.5f) + 1.5f;
if (this->onFire || (this->actor.params == KEESE_ICE_FLY) || if (this->onFire || (this->actor.params == KEESE_ICE_FLY) ||
((EnFirefly_ReturnToPerch(this, play) == 0) && (EnFirefly_SeekTorch(this, play) == 0))) { ((EnFirefly_ReturnToPerch(this, play) == 0) && (EnFirefly_SeekTorch(this, play) == 0))) {
if (skelanimeUpdated) { if (skelanimeUpdated) {
@ -421,7 +421,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
} }
this->actor.colorFilterTimer = 40; this->actor.colorFilterTimer = 40;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (this->actor.flags & ACTOR_FLAG_15) { if (this->actor.flags & ACTOR_FLAG_15) {
this->actor.colorFilterTimer = 40; this->actor.colorFilterTimer = 40;
} else { } else {
@ -457,7 +457,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) {
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
} }
Math_StepToF(&this->actor.speedXZ, 4.0f, 0.5f); Math_StepToF(&this->actor.speed, 4.0f, 0.5f);
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100);
@ -497,7 +497,7 @@ void EnFirefly_Rebound(EnFirefly* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100); Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
Math_StepToF(&this->actor.velocity.y, 0.0f, 0.4f); Math_StepToF(&this->actor.velocity.y, 0.0f, 0.4f);
if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.15f)) { if (Math_StepToF(&this->actor.speed, 0.0f, 0.15f)) {
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
} }
@ -518,7 +518,7 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) {
EnFirefly_SetupFlyIdle(this); EnFirefly_SetupFlyIdle(this);
return; return;
} }
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); Math_StepToF(&this->actor.speed, 3.0f, 0.3f);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->targetPitch = 0x954; this->targetPitch = 0x954;
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->maxAltitude < this->actor.world.pos.y)) { } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->maxAltitude < this->actor.world.pos.y)) {
@ -537,7 +537,7 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) {
void EnFirefly_Stunned(EnFirefly* this, PlayState* play) { void EnFirefly_Stunned(EnFirefly* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1554, 0x100); Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1554, 0x100);
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;

View file

@ -200,8 +200,8 @@ void EnFish_Respawning_SetupSlowDown(EnFish* this) {
void EnFish_Respawning_SlowDown(EnFish* this, PlayState* play) { void EnFish_Respawning_SlowDown(EnFish* this, PlayState* play) {
EnFish_SetYOffset(this); EnFish_SetYOffset(this);
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.05f, 0.3f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.05f, 0.3f, 0.0f);
this->skelAnime.playSpeed = CLAMP_MAX(this->actor.speedXZ * 1.4f + 0.8f, 2.0f); this->skelAnime.playSpeed = CLAMP_MAX(this->actor.speed * 1.4f + 0.8f, 2.0f);
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;
@ -229,7 +229,7 @@ void EnFish_Respawning_FollowChild(EnFish* this, PlayState* play) {
s32 pad; s32 pad;
EnFish_SetYOffset(this); EnFish_SetYOffset(this);
Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.08f, 0.4f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 1.8f, 0.08f, 0.4f, 0.0f);
if ((EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(80.0f)) || (this->timer < 4)) { if ((EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(80.0f)) || (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),
@ -240,7 +240,7 @@ void EnFish_Respawning_FollowChild(EnFish* this, PlayState* play) {
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->skelAnime.playSpeed = CLAMP_MAX(this->actor.speedXZ * 1.5f + 0.8f, 4.0f); this->skelAnime.playSpeed = CLAMP_MAX(this->actor.speed * 1.5f + 0.8f, 4.0f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->timer <= 0) { if (this->timer <= 0) {
@ -270,7 +270,7 @@ void EnFish_Respawning_FleePlayer(EnFish* this, PlayState* play) {
EnFish_SetYOffset(this); EnFish_SetYOffset(this);
playerClose = EnFish_CheckXZDistanceToPlayer(this, play); playerClose = EnFish_CheckXZDistanceToPlayer(this, play);
Math_SmoothStepToF(&this->actor.speedXZ, 4.2f, 0.08f, 1.4f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 4.2f, 0.08f, 1.4f, 0.0f);
if (EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(160.0f)) { if (EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(160.0f)) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
@ -296,7 +296,7 @@ void EnFish_Respawning_FleePlayer(EnFish* this, PlayState* play) {
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->skelAnime.playSpeed = CLAMP_MAX(this->actor.speedXZ * 1.5f + 0.8f, 4.0f); this->skelAnime.playSpeed = CLAMP_MAX(this->actor.speed * 1.5f + 0.8f, 4.0f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -325,7 +325,7 @@ void EnFish_Respawning_ApproachPlayer(EnFish* this, PlayState* play) {
s16 temp_a0_2; s16 temp_a0_2;
EnFish_SetYOffset(this); EnFish_SetYOffset(this);
Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 1.8f, 0.1f, 0.5f, 0.0f);
if (EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(80.0f)) { if (EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(80.0f)) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
@ -346,7 +346,7 @@ void EnFish_Respawning_ApproachPlayer(EnFish* this, PlayState* play) {
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->skelAnime.playSpeed = CLAMP_MAX((this->actor.speedXZ * 1.5f) + 0.8f, 4.0f); this->skelAnime.playSpeed = CLAMP_MAX((this->actor.speed * 1.5f) + 0.8f, 4.0f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -368,7 +368,7 @@ void EnFish_Dropped_SetupFall(EnFish* this) {
} }
void EnFish_Dropped_Fall(EnFish* this, PlayState* play) { void EnFish_Dropped_Fall(EnFish* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.1f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.1f, 0.0f);
Math_StepToAngleS(&this->actor.world.rot.x, 0x4000, 100); Math_StepToAngleS(&this->actor.world.rot.x, 0x4000, 100);
Math_StepToAngleS(&this->actor.world.rot.z, -0x4000, 100); Math_StepToAngleS(&this->actor.world.rot.z, -0x4000, 100);
this->actor.shape.rot.x = this->actor.world.rot.x; this->actor.shape.rot.x = this->actor.world.rot.x;
@ -435,7 +435,7 @@ void EnFish_Dropped_FlopOnGround(EnFish* this, PlayState* play) {
s16 frames = play->state.frames; s16 frames = play->state.frames;
s16 targetXRot; s16 targetXRot;
Math_SmoothStepToF(&this->actor.speedXZ, Rand_ZeroOne() * 0.2f, 0.1f, 0.1f, 0.0f); Math_SmoothStepToF(&this->actor.speed, Rand_ZeroOne() * 0.2f, 0.1f, 0.1f, 0.0f);
targetXRot = (s16)((((frames >> 5) & 2) | ((frames >> 2) & 1)) << 0xB) * 0.3f; targetXRot = (s16)((((frames >> 5) & 2) | ((frames >> 2) & 1)) << 0xB) * 0.3f;
@ -485,12 +485,12 @@ void EnFish_Dropped_SetupSwimAway(EnFish* this) {
void EnFish_Dropped_SwimAway(EnFish* this, PlayState* play) { void EnFish_Dropped_SwimAway(EnFish* this, PlayState* play) {
s32 pad; s32 pad;
Math_SmoothStepToF(&this->actor.speedXZ, 2.8f, 0.1f, 0.4f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 2.8f, 0.1f, 0.4f, 0.0f);
// If touching wall or not in water, turn back and slow down for one frame. // If touching wall or not in water, turn back and slow down for one frame.
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->actor.home.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->actor.home.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
this->actor.speedXZ *= 0.5f; this->actor.speed *= 0.5f;
} }
Math_StepToAngleS(&this->actor.world.rot.x, 0, 1500); Math_StepToAngleS(&this->actor.world.rot.x, 0, 1500);
@ -511,7 +511,7 @@ void EnFish_Dropped_SwimAway(EnFish* this, PlayState* play) {
Actor_SetScale(&this->actor, this->actor.scale.x * 0.982f); Actor_SetScale(&this->actor, this->actor.scale.x * 0.982f);
} }
this->skelAnime.playSpeed = CLAMP_MAX((this->actor.speedXZ * 1.5f) + 1.0f, 4.0f); this->skelAnime.playSpeed = CLAMP_MAX((this->actor.speed * 1.5f) + 1.0f, 4.0f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->timer <= 0) { if (this->timer <= 0) {
@ -555,7 +555,7 @@ void EnFish_Unique_SwimIdle(EnFish* this, PlayState* play) {
} }
EnFish_SetYOffset(this); EnFish_SetYOffset(this);
Math_SmoothStepToF(&this->actor.speedXZ, speed[0], speed[1], speed[2], 0.0f); Math_SmoothStepToF(&this->actor.speed, speed[0], speed[1], speed[2], 0.0f);
extraPlaySpeed = 0.0f; extraPlaySpeed = 0.0f;
@ -569,7 +569,7 @@ void EnFish_Unique_SwimIdle(EnFish* this, PlayState* play) {
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
playSpeed = (this->actor.speedXZ * 1.2f) + 0.2f + extraPlaySpeed; playSpeed = (this->actor.speed * 1.2f) + 0.2f + extraPlaySpeed;
this->skelAnime.playSpeed = CLAMP(playSpeed, 1.5f, 0.5); this->skelAnime.playSpeed = CLAMP(playSpeed, 1.5f, 0.5);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);

View file

@ -195,7 +195,7 @@ void EnFloormas_MakeVulnerable(EnFloormas* this) {
void EnFloormas_SetupBigDecideAction(EnFloormas* this) { void EnFloormas_SetupBigDecideAction(EnFloormas* this) {
Animation_PlayOnce(&this->skelAnime, &gWallmasterWaitAnim); Animation_PlayOnce(&this->skelAnime, &gWallmasterWaitAnim);
this->actionFunc = EnFloormas_BigDecideAction; this->actionFunc = EnFloormas_BigDecideAction;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnFloormas_SetupStand(EnFloormas* this) { void EnFloormas_SetupStand(EnFloormas* this) {
@ -212,26 +212,26 @@ void EnFloormas_SetupBigWalk(EnFloormas* this) {
this->actionTimer = Rand_S16Offset(2, 4); this->actionTimer = Rand_S16Offset(2, 4);
this->actionFunc = EnFloormas_BigWalk; this->actionFunc = EnFloormas_BigWalk;
this->actor.speedXZ = 1.5f; this->actor.speed = 1.5f;
} }
void EnFloormas_SetupBigStopWalk(EnFloormas* this) { void EnFloormas_SetupBigStopWalk(EnFloormas* this) {
Animation_PlayOnce(&this->skelAnime, &gWallmasterStopWalkAnim); Animation_PlayOnce(&this->skelAnime, &gWallmasterStopWalkAnim);
this->actionFunc = EnFloormas_BigStopWalk; this->actionFunc = EnFloormas_BigStopWalk;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnFloormas_SetupRun(EnFloormas* this) { void EnFloormas_SetupRun(EnFloormas* this) {
this->actionTimer = 0; this->actionTimer = 0;
this->actionFunc = EnFloormas_Run; this->actionFunc = EnFloormas_Run;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->skelAnime.playSpeed = 3.0f; this->skelAnime.playSpeed = 3.0f;
} }
void EnFloormas_SetupTurn(EnFloormas* this) { void EnFloormas_SetupTurn(EnFloormas* this) {
s16 rotDelta = this->actionTarget - this->actor.shape.rot.y; s16 rotDelta = this->actionTarget - this->actor.shape.rot.y;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (rotDelta > 0) { if (rotDelta > 0) {
Animation_MorphToPlayOnce(&this->skelAnime, &gFloormasterTurnAnim, -3.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gFloormasterTurnAnim, -3.0f);
} else { } else {
@ -251,7 +251,7 @@ void EnFloormas_SetupTurn(EnFloormas* this) {
void EnFloormas_SetupHover(EnFloormas* this, PlayState* play) { void EnFloormas_SetupHover(EnFloormas* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gWallmasterHoverAnim, 3.0f, 0, Animation_GetLastFrame(&gWallmasterHoverAnim), Animation_Change(&this->skelAnime, &gWallmasterHoverAnim, 3.0f, 0, Animation_GetLastFrame(&gWallmasterHoverAnim),
ANIMMODE_ONCE, -3.0f); ANIMMODE_ONCE, -3.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
EnFloormas_MakeInvulnerable(this); EnFloormas_MakeInvulnerable(this);
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, true); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, true);
@ -263,12 +263,12 @@ void EnFloormas_SetupCharge(EnFloormas* this) {
this->actionTimer = 25; this->actionTimer = 25;
this->actor.gravity = -0.15f; this->actor.gravity = -0.15f;
this->actionFunc = EnFloormas_Charge; this->actionFunc = EnFloormas_Charge;
this->actor.speedXZ = 0.5f; this->actor.speed = 0.5f;
} }
void EnFloormas_SetupLand(EnFloormas* this) { void EnFloormas_SetupLand(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 41.0f, 42.0f, ANIMMODE_ONCE, 5.0f); Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 41.0f, 42.0f, ANIMMODE_ONCE, 5.0f);
if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != EnFloormas_Charge)) { if ((this->actor.speed < 0.0f) || (this->actionFunc != EnFloormas_Charge)) {
this->actionTimer = 30; this->actionTimer = 30;
} else { } else {
this->actionTimer = 45; this->actionTimer = 45;
@ -294,7 +294,7 @@ void EnFloormas_SetupSplit(EnFloormas* this) {
this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f; this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f;
this->collider.dim.height = sCylinderInit.dim.height * 0.6f; this->collider.dim.height = sCylinderInit.dim.height * 0.6f;
this->collider.info.bumperFlags &= ~BUMP_HOOKABLE; this->collider.info.bumperFlags &= ~BUMP_HOOKABLE;
this->actor.speedXZ = 4.0f; this->actor.speed = 4.0f;
this->actor.velocity.y = 7.0f; this->actor.velocity.y = 7.0f;
// using div creates a signed check. // using div creates a signed check.
this->actor.colChkInfo.health = sColChkInfoInit.health >> 1; this->actor.colChkInfo.health = sColChkInfoInit.health >> 1;
@ -304,7 +304,7 @@ void EnFloormas_SetupSplit(EnFloormas* this) {
void EnFloormas_SetupSmWalk(EnFloormas* this) { void EnFloormas_SetupSmWalk(EnFloormas* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f); Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f);
this->actionFunc = EnFloormas_SmWalk; this->actionFunc = EnFloormas_SmWalk;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
} }
void EnFloormas_SetupSmDecideAction(EnFloormas* this) { void EnFloormas_SetupSmDecideAction(EnFloormas* this) {
@ -312,7 +312,7 @@ void EnFloormas_SetupSmDecideAction(EnFloormas* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f); Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f);
} }
this->actionFunc = EnFloormas_SmDecideAction; this->actionFunc = EnFloormas_SmDecideAction;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
} }
void EnFloormas_SetupSmShrink(EnFloormas* this, PlayState* play) { void EnFloormas_SetupSmShrink(EnFloormas* this, PlayState* play) {
@ -320,7 +320,7 @@ void EnFloormas_SetupSmShrink(EnFloormas* this, PlayState* play) {
static Vec3f accel = { 0.0f, 0.0f, 0.0f }; static Vec3f accel = { 0.0f, 0.0f, 0.0f };
Vec3f pos; Vec3f pos;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
pos.x = this->actor.world.pos.x; pos.x = this->actor.world.pos.x;
pos.y = this->actor.world.pos.y + 15.0f; pos.y = this->actor.world.pos.y + 15.0f;
@ -332,13 +332,13 @@ void EnFloormas_SetupSmShrink(EnFloormas* this, PlayState* play) {
void EnFloormas_SetupSlaveJumpAtMaster(EnFloormas* this) { void EnFloormas_SetupSlaveJumpAtMaster(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f); Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f);
this->actionFunc = EnFloormas_SmSlaveJumpAtMaster; this->actionFunc = EnFloormas_SmSlaveJumpAtMaster;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnFloormas_SetupJumpAtLink(EnFloormas* this) { void EnFloormas_SetupJumpAtLink(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f); Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f);
this->actionFunc = EnFloormas_JumpAtLink; this->actionFunc = EnFloormas_JumpAtLink;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) {
@ -347,7 +347,7 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 36.0f, 45.0f, ANIMMODE_ONCE, -3.0f); Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 36.0f, 45.0f, ANIMMODE_ONCE, -3.0f);
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
EnFloormas_MakeInvulnerable(this); EnFloormas_MakeInvulnerable(this);
if (!LINK_IS_ADULT) { if (!LINK_IS_ADULT) {
@ -397,20 +397,20 @@ void EnFloormas_SetupTakeDamage(EnFloormas* this) {
} }
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 20); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 20);
this->actionFunc = EnFloormas_TakeDamage; this->actionFunc = EnFloormas_TakeDamage;
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actor.velocity.y = 5.5f; this->actor.velocity.y = 5.5f;
} }
void EnFloormas_SetupRecover(EnFloormas* this) { void EnFloormas_SetupRecover(EnFloormas* this) {
Animation_PlayOnce(&this->skelAnime, &gWallmasterRecoverFromDamageAnim); Animation_PlayOnce(&this->skelAnime, &gWallmasterRecoverFromDamageAnim);
this->actor.velocity.y = this->actor.speedXZ = 0.0f; this->actor.velocity.y = this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnFloormas_Recover; this->actionFunc = EnFloormas_Recover;
} }
void EnFloormas_SetupFreeze(EnFloormas* this) { void EnFloormas_SetupFreeze(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.5f, 0, 20.0f, ANIMMODE_ONCE, -3.0f); Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.5f, 0, 20.0f, ANIMMODE_ONCE, -3.0f);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->actor.colChkInfo.damageEffect == 4) { if (this->actor.colChkInfo.damageEffect == 4) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 80); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 80);
} else { } else {
@ -591,7 +591,7 @@ void EnFloormas_Charge(EnFloormas* this, PlayState* play) {
this->actionTimer--; this->actionTimer--;
} }
Math_StepToF(&this->actor.speedXZ, 15.0f, SQ(this->actor.speedXZ) * (1.0f / 3.0f)); Math_StepToF(&this->actor.speed, 15.0f, SQ(this->actor.speed) * (1.0f / 3.0f));
Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1680, 0x140); Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1680, 0x140);
distFromGround = this->actor.world.pos.y - this->actor.floorHeight; distFromGround = this->actor.world.pos.y - this->actor.floorHeight;
@ -628,14 +628,14 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) {
} }
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (isOnGround) { if (isOnGround) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f); Math_StepToF(&this->actor.speed, 0.0f, 2.0f);
} }
if ((this->actor.speedXZ > 0.0f) && ((this->actor.world.pos.y - this->actor.floorHeight) < 12.0f)) { if ((this->actor.speed > 0.0f) && ((this->actor.world.pos.y - this->actor.floorHeight) < 12.0f)) {
EnFloormas_Slide(this, play); EnFloormas_Slide(this, play);
} }
@ -667,7 +667,7 @@ void EnFloormas_Split(EnFloormas* this, PlayState* play) {
this->smActionTimer = 50; this->smActionTimer = 50;
EnFloormas_SetupStand(this); EnFloormas_SetupStand(this);
} }
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
@ -745,11 +745,11 @@ void EnFloormas_JumpAtLink(EnFloormas* this, PlayState* play) {
if (this->skelAnime.curFrame < 20.0f) { if (this->skelAnime.curFrame < 20.0f) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
} else if (Animation_OnFrame(&this->skelAnime, 20.0f)) { } else if (Animation_OnFrame(&this->skelAnime, 20.0f)) {
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actor.velocity.y = 7.0f; this->actor.velocity.y = 7.0f;
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actionTimer = 0x32; this->actionTimer = 0x32;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
EnFloormas_SetupLand(this); EnFloormas_SetupLand(this);
} else if ((this->actor.yDistToPlayer < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && } else if ((this->actor.yDistToPlayer < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) &&
@ -806,7 +806,7 @@ void EnFloormas_GrabLink(EnFloormas* this, PlayState* play) {
this->actor.shape.rot.x = 0; this->actor.shape.rot.x = 0;
this->actor.velocity.y = 6.0f; this->actor.velocity.y = 6.0f;
this->actor.flags |= ACTOR_FLAG_0; this->actor.flags |= ACTOR_FLAG_0;
this->actor.speedXZ = -3.0f; this->actor.speed = -3.0f;
EnFloormas_SetupLand(this); EnFloormas_SetupLand(this);
} else { } else {
// Damage link every 20 frames // Damage link every 20 frames
@ -839,7 +839,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play) {
return; return;
} }
if (Animation_OnFrame(&this->skelAnime, 20.0f)) { if (Animation_OnFrame(&this->skelAnime, 20.0f)) {
this->actor.speedXZ = 5.0f; this->actor.speed = 5.0f;
this->actor.velocity.y = 7.0f; this->actor.velocity.y = 7.0f;
} else if (this->skelAnime.curFrame < 20.0f) { } else if (this->skelAnime.curFrame < 20.0f) {
Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primFloormas), 2, 0xE38); Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primFloormas), 2, 0xE38);
@ -849,14 +849,14 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play) {
EnFloormas_SetupSmWait(this); EnFloormas_SetupSmWait(this);
this->collider.base.ocFlags1 |= OC1_ON; this->collider.base.ocFlags1 |= OC1_ON;
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
EnFloormas_SetupLand(this); EnFloormas_SetupLand(this);
} }
if (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 5.0f && if (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 5.0f &&
fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 5.0f) { fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 5.0f) {
Math_StepToF(&this->actor.speedXZ, 0, 2.0f); Math_StepToF(&this->actor.speed, 0, 2.0f);
} }
} }
@ -950,7 +950,7 @@ void EnFloormas_TakeDamage(EnFloormas* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND); Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND);
} }
} }
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
} }
void EnFloormas_Recover(EnFloormas* this, PlayState* play) { void EnFloormas_Recover(EnFloormas* this, PlayState* play) {
@ -1025,12 +1025,12 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) {
if (this->actionFunc != EnFloormas_SmWait) { if (this->actionFunc != EnFloormas_SmWait) {
if (this->collider.base.atFlags & AT_HIT) { if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT; this->collider.base.atFlags &= ~AT_HIT;
this->actor.speedXZ *= -0.5f; this->actor.speed *= -0.5f;
if (-5.0f < this->actor.speedXZ) { if (-5.0f < this->actor.speed) {
this->actor.speedXZ = -5.0f; this->actor.speed = -5.0f;
} else { } else {
this->actor.speedXZ = this->actor.speedXZ; this->actor.speed = this->actor.speed;
} }
this->actor.velocity.y = 5.0f; this->actor.velocity.y = 5.0f;

View file

@ -224,7 +224,7 @@ void EnFr_OrientUnderwater(EnFr* this) {
this->actor.world.pos.y = sLogSpotToFromWater[this->actor.params].yDist + this->posLogSpot.y; this->actor.world.pos.y = sLogSpotToFromWater[this->actor.params].yDist + this->posLogSpot.y;
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.shape.rot.y =
RAD_TO_BINANG(sLogSpotToFromWater[this->actor.params].yaw) + 0x8000; RAD_TO_BINANG(sLogSpotToFromWater[this->actor.params].yaw) + 0x8000;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
} }
@ -418,7 +418,7 @@ void EnFr_JumpingOutOfWater(EnFr* this, PlayState* play) {
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
} else if (this->skelAnime.curFrame == 3.0f) { } else if (this->skelAnime.curFrame == 3.0f) {
this->actor.gravity = -10.0f; this->actor.gravity = -10.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 47.0f; this->actor.velocity.y = 47.0f;
} }
@ -501,7 +501,7 @@ void EnFr_JumpingBackIntoWater(EnFr* this, PlayState* play) {
if (this->skelAnime.curFrame == 6.0f) { if (this->skelAnime.curFrame == 6.0f) {
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
} else if (this->skelAnime.curFrame == 3.0f) { } else if (this->skelAnime.curFrame == 3.0f) {
this->actor.speedXZ = 6.0f; this->actor.speed = 6.0f;
this->actor.gravity = -10.0f; this->actor.gravity = -10.0f;
this->actor.velocity.y = 25.0f; this->actor.velocity.y = 25.0f;
} }

View file

@ -239,7 +239,7 @@ void EnFw_Run(EnFw* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_MAN_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_MAN_DAMAGE);
this->explosionTimer = 6; this->explosionTimer = 6;
} }
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->explosionTimer != 0) { if (this->explosionTimer != 0) {
@ -273,7 +273,7 @@ void EnFw_Run(EnFw* this, PlayState* play) {
DECR(this->damageTimer); DECR(this->damageTimer);
if ((200.0f - this->runRadius) < 0.9f) { if ((200.0f - this->runRadius) < 0.9f) {
if (DECR(this->returnToParentTimer) == 0) { if (DECR(this->returnToParentTimer) == 0) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = EnFw_TurnToParentInitPos; this->actionFunc = EnFw_TurnToParentInitPos;
return; return;
} }
@ -283,7 +283,7 @@ void EnFw_Run(EnFw* this, PlayState* play) {
Math_SmoothStepToF(&this->runRadius, 200.0f, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&this->runRadius, 200.0f, 0.3f, 100.0f, 0.0f);
if (this->turnAround) { if (this->turnAround) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 1.0f, 0.0f);
tmpAngle = (s16)(this->actor.world.rot.y ^ 0x8000); tmpAngle = (s16)(this->actor.world.rot.y ^ 0x8000);
facingDir = this->actor.shape.rot.y; facingDir = this->actor.shape.rot.y;
tmpAngle = Math_SmoothStepToF(&facingDir, tmpAngle, 0.1f, 10000.0f, 0.0f); tmpAngle = Math_SmoothStepToF(&facingDir, tmpAngle, 0.1f, 10000.0f, 0.0f);
@ -312,7 +312,7 @@ void EnFw_Run(EnFw* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_MAN_SLIDE); Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_MAN_SLIDE);
this->slideSfxTimer = 4; this->slideSfxTimer = 4;
} }
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 1.0f, 0.0f);
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
EnFw_SpawnDust(this, 8, 0.16f, 0.2f, 3, 8.0f, 20.0f, ((Rand_ZeroOne() - 0.5f) * 0.2f) + 0.3f); EnFw_SpawnDust(this, 8, 0.16f, 0.2f, 3, 8.0f, 20.0f, ((Rand_ZeroOne() - 0.5f) * 0.2f) + 0.3f);
this->slideTimer--; this->slideTimer--;
@ -321,7 +321,7 @@ void EnFw_Run(EnFw* this, PlayState* play) {
this->runDirection = -this->runDirection; this->runDirection = -this->runDirection;
} }
} else { } else {
Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 6.0f, 0.1f, 1.0f, 0.0f);
curFrame = this->skelAnime.curFrame; curFrame = this->skelAnime.curFrame;
if (curFrame == 1 || curFrame == 4) { if (curFrame == 1 || curFrame == 4) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_MAN_RUN); Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_MAN_RUN);

View file

@ -181,7 +181,7 @@ void EnFz_Init(Actor* thisx, PlayState* play) {
this->isFreezing = false; this->isFreezing = false;
this->isActive = true; this->isActive = true;
this->isDespawning = false; this->isDespawning = false;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->posOrigin.y = this->actor.world.pos.y; this->posOrigin.y = this->actor.world.pos.y;
@ -326,14 +326,14 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
this->isMoving = false; this->isMoving = false;
this->speedXZ = 0.0f; this->speedXZ = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->isFreezing) { if (this->isFreezing) {
if ((this->actor.params < 0) && (this->collider1.base.atFlags & AT_HIT)) { if ((this->actor.params < 0) && (this->collider1.base.atFlags & AT_HIT)) {
this->isMoving = false; this->isMoving = false;
this->collider1.base.acFlags &= ~AC_HIT; this->collider1.base.acFlags &= ~AC_HIT;
this->actor.speedXZ = this->speedXZ = 0.0f; this->actor.speed = this->speedXZ = 0.0f;
this->timer = 10; this->timer = 10;
EnFz_SetupDisappear(this); EnFz_SetupDisappear(this);
} else if (this->collider2.base.acFlags & AC_BOUNCED) { } else if (this->collider2.base.acFlags & AC_BOUNCED) {
@ -479,7 +479,7 @@ void EnFz_SetupAimForFreeze(EnFz* this) {
this->timer = 40; this->timer = 40;
this->actionFunc = EnFz_AimForFreeze; this->actionFunc = EnFz_AimForFreeze;
this->speedXZ = 0.0f; this->speedXZ = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnFz_AimForFreeze(EnFz* this, PlayState* play) { void EnFz_AimForFreeze(EnFz* this, PlayState* play) {
@ -556,7 +556,7 @@ void EnFz_SetupDespawn(EnFz* this, PlayState* play) {
this->speedXZ = 0.0f; this->speedXZ = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60);
this->actionFunc = EnFz_Despawn; this->actionFunc = EnFz_Despawn;
@ -574,7 +574,7 @@ void EnFz_SetupMelt(EnFz* this) {
this->isDespawning = true; this->isDespawning = true;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actionFunc = EnFz_Melt; this->actionFunc = EnFz_Melt;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->speedXZ = 0.0f; this->speedXZ = 0.0f;
} }
@ -697,7 +697,7 @@ void EnFz_Update(Actor* thisx, PlayState* play) {
} }
} }
Math_StepToF(&this->actor.speedXZ, this->speedXZ, 0.2f); Math_StepToF(&this->actor.speed, this->speedXZ, 0.2f);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
if (this->updateBgInfo) { if (this->updateBgInfo) {

View file

@ -177,7 +177,7 @@ void EnGb_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
Actor_SetScale(&this->dyna.actor, 0.01f); Actor_SetScale(&this->dyna.actor, 0.01f);
this->dyna.actor.colChkInfo.mass = 0xFF; this->dyna.actor.colChkInfo.mass = 0xFF;
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speed = 0.0f;
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.gravity = -1.0f; this->dyna.actor.gravity = -1.0f;
this->actionTimer = (s16)Rand_ZeroFloat(100.0f) + 100; this->actionTimer = (s16)Rand_ZeroFloat(100.0f) + 100;

View file

@ -257,7 +257,7 @@ void EnGe2_CaptureCharge(EnGe2* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->actor.xzDistToPlayer < 50.0f) { if (this->actor.xzDistToPlayer < 50.0f) {
EnGe2_ChangeAction(this, GE2_ACTION_CAPTURECLOSE); EnGe2_ChangeAction(this, GE2_ACTION_CAPTURECLOSE);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->timer > 0) { if (this->timer > 0) {
@ -285,7 +285,7 @@ void EnGe2_CaptureTurn(EnGe2* this, PlayState* play) {
if (this->actor.world.rot.y == this->actor.yawTowardsPlayer) { if (this->actor.world.rot.y == this->actor.yawTowardsPlayer) {
EnGe2_ChangeAction(this, GE2_ACTION_CAPTURECHARGE); EnGe2_ChangeAction(this, GE2_ACTION_CAPTURECHARGE);
this->timer = 50; this->timer = 50;
this->actor.speedXZ = 4.0f; this->actor.speed = 4.0f;
} }
} }
@ -311,7 +311,7 @@ void EnGe2_KnockedOut(EnGe2* this, PlayState* play) {
void EnGe2_TurnPlayerSpotted(EnGe2* this, PlayState* play) { void EnGe2_TurnPlayerSpotted(EnGe2* this, PlayState* play) {
s32 playerSpotted; s32 playerSpotted;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->stateFlags & GE2_STATE_TALKED) { if (this->stateFlags & GE2_STATE_TALKED) {
this->stateFlags &= ~GE2_STATE_TALKED; this->stateFlags &= ~GE2_STATE_TALKED;
@ -347,7 +347,7 @@ void EnGe2_TurnPlayerSpotted(EnGe2* this, PlayState* play) {
void EnGe2_AboutTurn(EnGe2* this, PlayState* play) { void EnGe2_AboutTurn(EnGe2* this, PlayState* play) {
s32 playerSpotted; s32 playerSpotted;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
playerSpotted = Ge2_DetectPlayerInAction(play, this); playerSpotted = Ge2_DetectPlayerInAction(play, this);
if (playerSpotted != 0) { if (playerSpotted != 0) {
@ -370,7 +370,7 @@ void EnGe2_Walk(EnGe2* this, PlayState* play) {
playerSpotted = Ge2_DetectPlayerInAction(play, this); playerSpotted = Ge2_DetectPlayerInAction(play, this);
if (playerSpotted != 0) { if (playerSpotted != 0) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGe2_ChangeAction(this, GE2_ACTION_TURNPLAYERSPOTTED); EnGe2_ChangeAction(this, GE2_ACTION_TURNPLAYERSPOTTED);
this->timer = 100; this->timer = 100;
this->playerSpottedParam = playerSpotted; this->playerSpottedParam = playerSpotted;
@ -379,10 +379,10 @@ void EnGe2_Walk(EnGe2* this, PlayState* play) {
this->walkTimer = 0; this->walkTimer = 0;
this->walkDirection += 0x8000; this->walkDirection += 0x8000;
EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN); EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} else { } else {
this->walkTimer++; this->walkTimer++;
this->actor.speedXZ = 2.0f; this->actor.speed = 2.0f;
} }
} }
@ -478,7 +478,7 @@ void EnGe2_ForceTalk(EnGe2* this, PlayState* play) {
void EnGe2_SetupCapturePlayer(EnGe2* this, PlayState* play) { void EnGe2_SetupCapturePlayer(EnGe2* this, PlayState* play) {
this->stateFlags |= GE2_STATE_CAPTURING; this->stateFlags |= GE2_STATE_CAPTURING;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGe2_ChangeAction(this, GE2_ACTION_CAPTURETURN); EnGe2_ChangeAction(this, GE2_ACTION_CAPTURETURN);
func_8002DF54(play, &this->actor, PLAYER_CSMODE_95); func_8002DF54(play, &this->actor, PLAYER_CSMODE_95);
func_80078884(NA_SE_SY_FOUND); func_80078884(NA_SE_SY_FOUND);
@ -521,7 +521,7 @@ void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) { if (Actor_ProcessTalkRequest(&this->actor, play)) {
if ((this->actor.params & 0xFF) == GE2_TYPE_PATROLLING) { if ((this->actor.params & 0xFF) == GE2_TYPE_PATROLLING) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER); EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER);
} }
this->actionFunc = EnGe2_SetActionAfterTalk; this->actionFunc = EnGe2_SetActionAfterTalk;
@ -566,7 +566,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) {
EnGe2_ChangeAction(this, GE2_ACTION_KNOCKEDOUT); EnGe2_ChangeAction(this, GE2_ACTION_KNOCKEDOUT);
this->timer = 100; this->timer = 100;
this->stateFlags |= GE2_STATE_KO; this->stateFlags |= GE2_STATE_KO;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_VO_SK_CRASH); Actor_PlaySfx(&this->actor, NA_SE_VO_SK_CRASH);
} else { } else {
this->actionFunc(this, play); this->actionFunc(this, play);
@ -612,7 +612,7 @@ void EnGe2_UpdateStunned(Actor* thisx, PlayState* play2) {
EnGe2_ChangeAction(this, GE2_ACTION_KNOCKEDOUT); EnGe2_ChangeAction(this, GE2_ACTION_KNOCKEDOUT);
this->timer = 100; this->timer = 100;
this->stateFlags |= GE2_STATE_KO; this->stateFlags |= GE2_STATE_KO;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_VO_SK_CRASH); Actor_PlaySfx(&this->actor, NA_SE_VO_SK_CRASH);
} }
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View file

@ -411,7 +411,7 @@ void EnGeldB_SetupReady(EnGeldB* this) {
Animation_MorphToLoop(&this->skelAnime, &gGerudoRedNeutralAnim, -4.0f); Animation_MorphToLoop(&this->skelAnime, &gGerudoRedNeutralAnim, -4.0f);
this->action = GELDB_READY; this->action = GELDB_READY;
this->timer = Rand_ZeroOne() * 10.0f + 5.0f; this->timer = Rand_ZeroOne() * 10.0f + 5.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
EnGeldB_SetupAction(this, EnGeldB_Ready); EnGeldB_SetupAction(this, EnGeldB_Ready);
} }
@ -490,13 +490,13 @@ void EnGeldB_Advance(EnGeldB* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer <= 40.0f) { if (this->actor.xzDistToPlayer <= 40.0f) {
Math_SmoothStepToF(&this->actor.speedXZ, -8.0f, 1.0f, 1.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, -8.0f, 1.0f, 1.5f, 0.0f);
} else if (this->actor.xzDistToPlayer > 55.0f) { } else if (this->actor.xzDistToPlayer > 55.0f) {
Math_SmoothStepToF(&this->actor.speedXZ, 8.0f, 1.0f, 1.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 8.0f, 1.0f, 1.5f, 0.0f);
} else { } else {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 6.65f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 6.65f, 0.0f);
} }
this->skelAnime.playSpeed = this->actor.speedXZ / 8.0f; this->skelAnime.playSpeed = this->actor.speed / 8.0f;
facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y; facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
facingAngletoLink = ABS(facingAngletoLink); facingAngletoLink = ABS(facingAngletoLink);
if ((this->actor.xzDistToPlayer < 150.0f) && (player->meleeWeaponState != 0) && (facingAngletoLink >= 0x1F40)) { if ((this->actor.xzDistToPlayer < 150.0f) && (player->meleeWeaponState != 0) && (facingAngletoLink >= 0x1F40)) {
@ -564,7 +564,7 @@ void EnGeldB_SetupRollForward(EnGeldB* this) {
this->invisible = true; this->invisible = true;
this->action = GELDB_ROLL_FORWARD; this->action = GELDB_ROLL_FORWARD;
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP); Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP);
EnGeldB_SetupAction(this, EnGeldB_RollForward); EnGeldB_SetupAction(this, EnGeldB_RollForward);
} }
@ -575,7 +575,7 @@ void EnGeldB_RollForward(EnGeldB* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
this->invisible = false; this->invisible = false;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (!Actor_IsFacingPlayer(&this->actor, 0x1554)) { if (!Actor_IsFacingPlayer(&this->actor, 0x1554)) {
EnGeldB_SetupReady(this); EnGeldB_SetupReady(this);
this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f;
@ -635,9 +635,9 @@ void EnGeldB_SetupCircle(EnGeldB* this) {
f32 lastFrame = Animation_GetLastFrame(&gGerudoRedSidestepAnim); f32 lastFrame = Animation_GetLastFrame(&gGerudoRedSidestepAnim);
Animation_Change(&this->skelAnime, &gGerudoRedSidestepAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, 0.0f); Animation_Change(&this->skelAnime, &gGerudoRedSidestepAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, 0.0f);
this->actor.speedXZ = Rand_CenteredFloat(12.0f); this->actor.speed = Rand_CenteredFloat(12.0f);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->skelAnime.playSpeed = -this->actor.speed * 0.5f;
this->timer = Rand_ZeroOne() * 30.0f + 30.0f; this->timer = Rand_ZeroOne() * 30.0f + 30.0f;
this->action = GELDB_CIRCLE; this->action = GELDB_CIRCLE;
this->approachRate = 0.0f; this->approachRate = 0.0f;
@ -658,35 +658,35 @@ void EnGeldB_Circle(EnGeldB* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3A98; this->actor.world.rot.y = this->actor.shape.rot.y + 0x3A98;
angleBehindLink = player->actor.shape.rot.y + 0x8000; angleBehindLink = player->actor.shape.rot.y + 0x8000;
if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) >= 0.0f) { if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) >= 0.0f) {
this->actor.speedXZ -= 0.25f; this->actor.speed -= 0.25f;
if (this->actor.speedXZ < -8.0f) { if (this->actor.speed < -8.0f) {
this->actor.speedXZ = -8.0f; this->actor.speed = -8.0f;
} }
} else if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) < 0.0f) { } else if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) < 0.0f) {
this->actor.speedXZ += 0.25f; this->actor.speed += 0.25f;
if (this->actor.speedXZ > 8.0f) { if (this->actor.speed > 8.0f) {
this->actor.speedXZ = 8.0f; this->actor.speed = 8.0f;
} }
} }
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
!Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { !Actor_TestFloorInDirection(&this->actor, play, this->actor.speed, this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->actor.speedXZ >= 0.0f) { if (this->actor.speed >= 0.0f) {
phi_v1 = this->actor.shape.rot.y + 0x3E80; phi_v1 = this->actor.shape.rot.y + 0x3E80;
} else { } else {
phi_v1 = this->actor.shape.rot.y - 0x3E80; phi_v1 = this->actor.shape.rot.y - 0x3E80;
} }
phi_v1 = this->actor.wallYaw - phi_v1; phi_v1 = this->actor.wallYaw - phi_v1;
} else { } else {
this->actor.speedXZ *= -0.8f; this->actor.speed *= -0.8f;
phi_v1 = 0; phi_v1 = 0;
} }
if (ABS(phi_v1) > 0x4000) { if (ABS(phi_v1) > 0x4000) {
this->actor.speedXZ *= -0.8f; this->actor.speed *= -0.8f;
if (this->actor.speedXZ < 0.0f) { if (this->actor.speed < 0.0f) {
this->actor.speedXZ -= 0.5f; this->actor.speed -= 0.5f;
} else { } else {
this->actor.speedXZ += 0.5f; this->actor.speed += 0.5f;
} }
} }
} }
@ -701,8 +701,8 @@ void EnGeldB_Circle(EnGeldB* this, PlayState* play) {
this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate;
this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
} }
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { if (ABS(this->approachRate) < ABS(this->actor.speed)) {
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->skelAnime.playSpeed = -this->actor.speed * 0.5f;
} else { } else {
this->skelAnime.playSpeed = -this->approachRate * 0.5f; this->skelAnime.playSpeed = -this->approachRate * 0.5f;
} }
@ -742,15 +742,15 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGerudoRedSidestepAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, 0.0f); Animation_Change(&this->skelAnime, &gGerudoRedSidestepAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, 0.0f);
sp3E = player->actor.shape.rot.y; sp3E = player->actor.shape.rot.y;
if (Math_SinS(sp3E - this->actor.shape.rot.y) > 0.0f) { if (Math_SinS(sp3E - this->actor.shape.rot.y) > 0.0f) {
this->actor.speedXZ = -10.0f; this->actor.speed = -10.0f;
} else if (Math_SinS(sp3E - this->actor.shape.rot.y) < 0.0f) { } else if (Math_SinS(sp3E - this->actor.shape.rot.y) < 0.0f) {
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
} else if (Rand_ZeroOne() > 0.5f) { } else if (Rand_ZeroOne() > 0.5f) {
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
} else { } else {
this->actor.speedXZ = -10.0f; this->actor.speed = -10.0f;
} }
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->skelAnime.playSpeed = -this->actor.speed * 0.5f;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->timer = 6; this->timer = 6;
this->approachRate = 0.0f; this->approachRate = 0.0f;
@ -769,16 +769,16 @@ void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98;
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
!Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { !Actor_TestFloorInDirection(&this->actor, play, this->actor.speed, this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->actor.speedXZ >= 0.0f) { if (this->actor.speed >= 0.0f) {
phi_v1 = this->actor.shape.rot.y + 0x3E80; phi_v1 = this->actor.shape.rot.y + 0x3E80;
} else { } else {
phi_v1 = this->actor.shape.rot.y - 0x3E80; phi_v1 = this->actor.shape.rot.y - 0x3E80;
} }
phi_v1 = this->actor.wallYaw - phi_v1; phi_v1 = this->actor.wallYaw - phi_v1;
} else { } else {
this->actor.speedXZ *= -0.8f; this->actor.speed *= -0.8f;
phi_v1 = 0; phi_v1 = 0;
} }
if (ABS(phi_v1) > 0x4000) { if (ABS(phi_v1) > 0x4000) {
@ -797,8 +797,8 @@ void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) {
this->actor.world.pos.x += Math_SinS(this->actor.yawTowardsPlayer) * this->approachRate; this->actor.world.pos.x += Math_SinS(this->actor.yawTowardsPlayer) * this->approachRate;
this->actor.world.pos.z += Math_CosS(this->actor.yawTowardsPlayer) * this->approachRate; this->actor.world.pos.z += Math_CosS(this->actor.yawTowardsPlayer) * this->approachRate;
} }
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { if (ABS(this->approachRate) < ABS(this->actor.speed)) {
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->skelAnime.playSpeed = -this->actor.speed * 0.5f;
} else { } else {
this->skelAnime.playSpeed = -this->approachRate * 0.5f; this->skelAnime.playSpeed = -this->approachRate * 0.5f;
} }
@ -828,7 +828,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) {
} }
} }
} else { } else {
if (this->actor.speedXZ >= 0.0f) { if (this->actor.speed >= 0.0f) {
this->actor.shape.rot.y += 0x4000; this->actor.shape.rot.y += 0x4000;
} else { } else {
this->actor.shape.rot.y -= 0x4000; this->actor.shape.rot.y -= 0x4000;
@ -841,7 +841,7 @@ void EnGeldB_SetupSlash(EnGeldB* this) {
this->swordCollider.base.atFlags &= ~AT_BOUNCED; this->swordCollider.base.atFlags &= ~AT_BOUNCED;
this->action = GELDB_SLASH; this->action = GELDB_SLASH;
this->spinAttackState = 0; this->spinAttackState = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH); Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH);
EnGeldB_SetupAction(this, EnGeldB_Slash); EnGeldB_SetupAction(this, EnGeldB_Slash);
} }
@ -854,7 +854,7 @@ void EnGeldB_Slash(EnGeldB* this, PlayState* play) {
angleFacingLink = ABS(angleFacingLink); angleFacingLink = ABS(angleFacingLink);
angleToLink = ABS(angleToLink); angleToLink = ABS(angleToLink);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if ((s32)this->skelAnime.curFrame == 1) { if ((s32)this->skelAnime.curFrame == 1) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_ATTACK); Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_ATTACK);
this->swordState = 1; this->swordState = 1;
@ -900,7 +900,7 @@ void EnGeldB_SetupSpinAttack(EnGeldB* this) {
this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED);
this->action = GELDB_SPIN_ATTACK; this->action = GELDB_SPIN_ATTACK;
this->spinAttackState = 0; this->spinAttackState = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGeldB_SetupAction(this, EnGeldB_SpinAttack); EnGeldB_SetupAction(this, EnGeldB_SpinAttack);
} }
@ -922,7 +922,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, PlayState* play) {
func_8002DF54(play, &this->actor, PLAYER_CSMODE_24); func_8002DF54(play, &this->actor, PLAYER_CSMODE_24);
Message_StartTextbox(play, 0x6003, &this->actor); Message_StartTextbox(play, 0x6003, &this->actor);
this->timer = 30; this->timer = 30;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_YOUNG_LAUGH); Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_YOUNG_LAUGH);
return; return;
} }
@ -934,10 +934,10 @@ void EnGeldB_SpinAttack(EnGeldB* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, false); Actor_SpawnFloorDustRing(play, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, false);
Actor_SpawnFloorDustRing(play, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, false); Actor_SpawnFloorDustRing(play, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, false);
this->swordState = 1; this->swordState = 1;
this->actor.speedXZ = 10.0f; this->actor.speed = 10.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_ATTACK); Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_ATTACK);
} else if ((s32)this->skelAnime.curFrame == 21) { } else if ((s32)this->skelAnime.curFrame == 21) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} else if ((s32)this->skelAnime.curFrame == 24) { } else if ((s32)this->skelAnime.curFrame == 24) {
this->swordState = -1; this->swordState = -1;
} }
@ -980,7 +980,7 @@ void EnGeldB_SetupRollBack(EnGeldB* this) {
this->timer = 0; this->timer = 0;
this->invisible = true; this->invisible = true;
this->action = GELDB_ROLL_BACK; this->action = GELDB_ROLL_BACK;
this->actor.speedXZ = -8.0f; this->actor.speed = -8.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP); Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP);
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupAction(this, EnGeldB_RollBack); EnGeldB_SetupAction(this, EnGeldB_RollBack);
@ -1004,7 +1004,7 @@ void EnGeldB_RollBack(EnGeldB* this, PlayState* play) {
void EnGeldB_SetupStunned(EnGeldB* this) { void EnGeldB_SetupStunned(EnGeldB* this) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->action == GELDB_SPIN_ATTACK)) { if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->action == GELDB_SPIN_ATTACK)) {
Animation_PlayOnceSetSpeed(&this->skelAnime, &gGerudoRedDamageAnim, 0.0f); Animation_PlayOnceSetSpeed(&this->skelAnime, &gGerudoRedDamageAnim, 0.0f);
@ -1019,11 +1019,11 @@ void EnGeldB_SetupStunned(EnGeldB* this) {
void EnGeldB_Stunned(EnGeldB* this, PlayState* play) { void EnGeldB_Stunned(EnGeldB* this, PlayState* play) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.speedXZ < 0.0f) { if (this->actor.speed < 0.0f) {
this->actor.speedXZ += 0.05f; this->actor.speed += 0.05f;
} }
this->invisible = false; this->invisible = false;
} }
@ -1040,7 +1040,7 @@ void EnGeldB_SetupDamaged(EnGeldB* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGerudoRedDamageAnim, -4.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gGerudoRedDamageAnim, -4.0f);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->invisible = false; this->invisible = false;
this->actor.speedXZ = -4.0f; this->actor.speed = -4.0f;
} else { } else {
this->invisible = true; this->invisible = true;
} }
@ -1055,11 +1055,11 @@ void EnGeldB_Damaged(EnGeldB* this, PlayState* play) {
s16 angleToWall; s16 angleToWall;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.speedXZ < 0.0f) { if (this->actor.speed < 0.0f) {
this->actor.speedXZ += 0.05f; this->actor.speed += 0.05f;
} }
this->invisible = false; this->invisible = false;
} }
@ -1088,7 +1088,7 @@ void EnGeldB_SetupJump(EnGeldB* this) {
this->timer = 0; this->timer = 0;
this->invisible = false; this->invisible = false;
this->action = GELDB_JUMP; this->action = GELDB_JUMP;
this->actor.speedXZ = 6.5f; this->actor.speed = 6.5f;
this->actor.velocity.y = 15.0f; this->actor.velocity.y = 15.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP); Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
@ -1105,7 +1105,7 @@ void EnGeldB_Jump(EnGeldB* this, PlayState* play) {
(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) { (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) {
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.x = 0; this->actor.shape.rot.x = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.world.pos.y = this->actor.floorHeight; this->actor.world.pos.y = this->actor.floorHeight;
if (!Actor_OtherIsTargeted(play, &this->actor)) { if (!Actor_OtherIsTargeted(play, &this->actor)) {
@ -1122,7 +1122,7 @@ void EnGeldB_SetupBlock(EnGeldB* this) {
if (this->swordState != 0) { if (this->swordState != 0) {
this->swordState = -1; this->swordState = -1;
} }
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->action = GELDB_BLOCK; this->action = GELDB_BLOCK;
this->timer = (s32)Rand_CenteredFloat(10.0f) + 10; this->timer = (s32)Rand_CenteredFloat(10.0f) + 10;
Animation_Change(&this->skelAnime, &gGerudoRedBlockAnim, 0.0f, 0.0f, lastFrame, ANIMMODE_ONCE, 0.0f); Animation_Change(&this->skelAnime, &gGerudoRedBlockAnim, 0.0f, 0.0f, lastFrame, ANIMMODE_ONCE, 0.0f);
@ -1192,13 +1192,13 @@ void EnGeldB_SetupSidestep(EnGeldB* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1);
playerRotY = player->actor.shape.rot.y; playerRotY = player->actor.shape.rot.y;
if (Math_SinS(playerRotY - this->actor.shape.rot.y) > 0.0f) { if (Math_SinS(playerRotY - this->actor.shape.rot.y) > 0.0f) {
this->actor.speedXZ = -6.0f; this->actor.speed = -6.0f;
} else if (Math_SinS(playerRotY - this->actor.shape.rot.y) < 0.0f) { } else if (Math_SinS(playerRotY - this->actor.shape.rot.y) < 0.0f) {
this->actor.speedXZ = 6.0f; this->actor.speed = 6.0f;
} else { } else {
this->actor.speedXZ = Rand_CenteredFloat(12.0f); this->actor.speed = Rand_CenteredFloat(12.0f);
} }
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->skelAnime.playSpeed = -this->actor.speed * 0.5f;
this->approachRate = 0.0f; this->approachRate = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF;
this->timer = Rand_ZeroOne() * 10.0f + 5.0f; this->timer = Rand_ZeroOne() * 10.0f + 5.0f;
@ -1217,34 +1217,34 @@ void EnGeldB_Sidestep(EnGeldB* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 1); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 1);
behindLinkAngle = player->actor.shape.rot.y + 0x8000; behindLinkAngle = player->actor.shape.rot.y + 0x8000;
if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) > 0.0f) { if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) > 0.0f) {
this->actor.speedXZ += 0.125f; this->actor.speed += 0.125f;
} else if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) <= 0.0f) { } else if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) <= 0.0f) {
this->actor.speedXZ -= 0.125f; this->actor.speed -= 0.125f;
} }
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
!Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { !Actor_TestFloorInDirection(&this->actor, play, this->actor.speed, this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->actor.speedXZ >= 0.0f) { if (this->actor.speed >= 0.0f) {
phi_v1 = this->actor.shape.rot.y + 0x3E80; phi_v1 = this->actor.shape.rot.y + 0x3E80;
} else { } else {
phi_v1 = this->actor.shape.rot.y - 0x3E80; phi_v1 = this->actor.shape.rot.y - 0x3E80;
} }
phi_v1 = this->actor.wallYaw - phi_v1; phi_v1 = this->actor.wallYaw - phi_v1;
} else { } else {
this->actor.speedXZ *= -0.8f; this->actor.speed *= -0.8f;
phi_v1 = 0; phi_v1 = 0;
} }
if (ABS(phi_v1) > 0x4000) { if (ABS(phi_v1) > 0x4000) {
this->actor.speedXZ *= -0.8f; this->actor.speed *= -0.8f;
if (this->actor.speedXZ < 0.0f) { if (this->actor.speed < 0.0f) {
this->actor.speedXZ -= 0.5f; this->actor.speed -= 0.5f;
} else { } else {
this->actor.speedXZ += 0.5f; this->actor.speed += 0.5f;
} }
} }
} }
if (this->actor.speedXZ >= 0.0f) { if (this->actor.speed >= 0.0f) {
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3E80; this->actor.world.rot.y = this->actor.shape.rot.y + 0x3E80;
} else { } else {
this->actor.world.rot.y = this->actor.shape.rot.y - 0x3E80; this->actor.world.rot.y = this->actor.shape.rot.y - 0x3E80;
@ -1260,8 +1260,8 @@ void EnGeldB_Sidestep(EnGeldB* this, PlayState* play) {
this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate;
this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
} }
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { if (ABS(this->approachRate) < ABS(this->actor.speed)) {
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->skelAnime.playSpeed = -this->actor.speed * 0.5f;
} else { } else {
this->skelAnime.playSpeed = -this->approachRate * 0.5f; this->skelAnime.playSpeed = -this->approachRate * 0.5f;
} }
@ -1317,7 +1317,7 @@ void EnGeldB_SetupDefeated(EnGeldB* this) {
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->invisible = false; this->invisible = false;
this->actor.speedXZ = -6.0f; this->actor.speed = -6.0f;
} else { } else {
this->invisible = true; this->invisible = true;
} }
@ -1329,10 +1329,10 @@ void EnGeldB_SetupDefeated(EnGeldB* this) {
void EnGeldB_Defeated(EnGeldB* this, PlayState* play) { void EnGeldB_Defeated(EnGeldB* this, PlayState* play) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
this->invisible = false; this->invisible = false;
} }
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
@ -1384,7 +1384,7 @@ void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) {
key = Item_DropCollectible(play, &this->actor.world.pos, this->keyFlag | ITEM00_SMALL_KEY); key = Item_DropCollectible(play, &this->actor.world.pos, this->keyFlag | ITEM00_SMALL_KEY);
if (key != NULL) { if (key != NULL) {
key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos); key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos);
key->actor.speedXZ = 6.0f; key->actor.speed = 6.0f;
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
@ -1640,7 +1640,7 @@ s32 EnGeldB_DodgeRanged(PlayState* play, EnGeldB* this) {
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF;
if ((ABS(angleToFacing) < 0x2000) || (ABS(angleToFacing) > 0x5FFF)) { if ((ABS(angleToFacing) < 0x2000) || (ABS(angleToFacing) > 0x5FFF)) {
EnGeldB_SetupSidestep(this, play); EnGeldB_SetupSidestep(this, play);
this->actor.speedXZ *= 3.0f; this->actor.speed *= 3.0f;
} else if (ABS(angleToFacing) < 0x5FFF) { } else if (ABS(angleToFacing) < 0x5FFF) {
EnGeldB_SetupRollBack(this); EnGeldB_SetupRollBack(this);
} }

View file

@ -119,7 +119,7 @@ void func_80A3D838(EnGm* this, PlayState* play) {
this->actor.textId = 0x3049; this->actor.textId = 0x3049;
this->updateFunc = func_80A3DFBC; this->updateFunc = func_80A3DFBC;
this->actionFunc = func_80A3DB04; this->actionFunc = func_80A3DB04;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
} }

View file

@ -654,7 +654,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) {
EnGo_SetupAction(this, EnGo_CurledUp); EnGo_SetupAction(this, EnGo_CurledUp);
} else { } else {
this->actor.shape.yOffset = 1400.0f; this->actor.shape.yOffset = 1400.0f;
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
EnGo_SetupAction(this, EnGo_GoronLinkRolling); EnGo_SetupAction(this, EnGo_GoronLinkRolling);
} }
break; break;
@ -717,7 +717,7 @@ void EnGo_StopRolling(EnGo* this, PlayState* play) {
} }
} }
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
if ((EnGo_FollowPath(this, play) == true) && (this->unk_218 == 0)) { if ((EnGo_FollowPath(this, play) == true) && (this->unk_218 == 0)) {
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,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
@ -725,7 +725,7 @@ void EnGo_StopRolling(EnGo* this, PlayState* play) {
bomb->timer = 0; bomb->timer = 0;
} }
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGo_SetupAction(this, func_80A4008C); EnGo_SetupAction(this, func_80A4008C);
} }
@ -750,7 +750,7 @@ void func_80A4008C(EnGo* this, PlayState* play) {
void EnGo_GoronLinkRolling(EnGo* this, PlayState* play) { void EnGo_GoronLinkRolling(EnGo* this, PlayState* play) {
if ((EnGo_FollowPath(this, play) == true) && Flags_GetSwitch(play, this->actor.params >> 8) && if ((EnGo_FollowPath(this, play) == true) && Flags_GetSwitch(play, this->actor.params >> 8) &&
(this->unk_218 == 0)) { (this->unk_218 == 0)) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGo_SetupAction(this, func_80A4008C); EnGo_SetupAction(this, func_80A4008C);
SET_INFTABLE(INFTABLE_109); SET_INFTABLE(INFTABLE_109);
} }
@ -924,11 +924,11 @@ void func_80A40A54(EnGo* this, PlayState* play) {
f32 float1 = ((f32)0x8000 / Animation_GetLastFrame(&gGoronAnim_010590)); f32 float1 = ((f32)0x8000 / Animation_GetLastFrame(&gGoronAnim_010590));
f32 float2 = this->skelAnime.curFrame * float1; f32 float2 = this->skelAnime.curFrame * float1;
this->actor.speedXZ = Math_SinS((s16)float2); this->actor.speed = Math_SinS((s16)float2);
if (EnGo_FollowPath(this, play) && this->unk_218 == 0) { if (EnGo_FollowPath(this, play) && this->unk_218 == 0) {
EnGo_ChangeAnim(this, ENGO_ANIM_1); EnGo_ChangeAnim(this, ENGO_ANIM_1);
this->skelAnime.curFrame = Animation_GetLastFrame(&gGoronAnim_004930); this->skelAnime.curFrame = Animation_GetLastFrame(&gGoronAnim_004930);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGo_SetupAction(this, EnGo_BiggoronActionFunc); EnGo_SetupAction(this, EnGo_BiggoronActionFunc);
} }
} }
@ -1068,7 +1068,7 @@ void EnGo_DrawRolling(EnGo* this, PlayState* play) {
Matrix_Push(); Matrix_Push();
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
Matrix_RotateZYX((s16)(play->state.frames * ((s16)this->actor.speedXZ * 1400)), 0, this->actor.shape.rot.z, Matrix_RotateZYX((s16)(play->state.frames * ((s16)this->actor.speed * 1400)), 0, this->actor.shape.rot.z,
MTXMODE_APPLY); MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go.c", 2368), gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go.c", 2368),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -906,7 +906,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) {
if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) {
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
arg2 = this->actionFunc == EnGo2_ContinueRolling ? 1.5f : this->actor.speedXZ * 1.5f; arg2 = this->actionFunc == EnGo2_ContinueRolling ? 1.5f : this->actor.speed * 1.5f;
play->damagePlayer(play, -4); play->damagePlayer(play, -4);
func_8002F71C(play, &this->actor, arg2, this->actor.yawTowardsPlayer, 6.0f); func_8002F71C(play, &this->actor, arg2, this->actor.yawTowardsPlayer, 6.0f);
@ -1110,17 +1110,17 @@ void func_80A45360(EnGo2* this, f32* alpha) {
} }
void EnGo2_RollForward(EnGo2* this) { void EnGo2_RollForward(EnGo2* this) {
f32 speedXZ = this->actor.speedXZ; f32 speedXZ = this->actor.speed;
if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
if (this->actionFunc != EnGo2_ContinueRolling) { if (this->actionFunc != EnGo2_ContinueRolling) {
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
} }
this->actor.speedXZ = speedXZ; this->actor.speed = speedXZ;
} }
void func_80A454CC(EnGo2* this) { void func_80A454CC(EnGo2* this) {
@ -1339,21 +1339,21 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) {
this->unk_211 = true; this->unk_211 = true;
this->actionFunc = func_80A46B40; this->actionFunc = func_80A46B40;
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->skelAnime.curFrame = this->skelAnime.endFrame; this->skelAnime.curFrame = this->skelAnime.endFrame;
} }
void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { void EnGo2_SetupRolling(EnGo2* this, PlayState* play) {
if ((this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || (this->actor.params & 0x1F) == GORON_CITY_LINK) { if ((this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || (this->actor.params & 0x1F) == GORON_CITY_LINK) {
this->collider.info.bumperFlags = BUMP_ON; this->collider.info.bumperFlags = BUMP_ON;
this->actor.speedXZ = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f; this->actor.speed = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f;
} else { } else {
this->actor.speedXZ = 6.0f; this->actor.speed = 6.0f;
} }
this->actor.flags |= ACTOR_FLAG_24; this->actor.flags |= ACTOR_FLAG_24;
this->animTimer = 10; this->animTimer = 10;
this->actor.shape.yOffset = 1800.0f; this->actor.shape.yOffset = 1800.0f;
this->actor.speedXZ += this->actor.speedXZ; // Speeding up this->actor.speed += this->actor.speed; // Speeding up
this->actionFunc = EnGo2_ContinueRolling; this->actionFunc = EnGo2_ContinueRolling;
} }
@ -1377,7 +1377,7 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) {
this->unk_590 = 0; this->unk_590 = 0;
this->actionFunc = EnGo2_GroundRolling; this->actionFunc = EnGo2_GroundRolling;
this->actor.shape.yOffset = 0.0f; this->actor.shape.yOffset = 0.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) { s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) {
@ -1434,7 +1434,7 @@ s32 EnGo2_IsGoronLinkReversing(EnGo2* this) {
} }
s32 EnGo2_IsRolling(EnGo2* this) { s32 EnGo2_IsRolling(EnGo2* this) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE || this->actor.speedXZ < 1.0f) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE || this->actor.speed < 1.0f) {
return false; return false;
} }
if (EnGo2_IsRollingOnGround(this, 2, 20.0 / 3.0f, 0)) { if (EnGo2_IsRollingOnGround(this, 2, 20.0 / 3.0f, 0)) {
@ -1698,7 +1698,7 @@ void EnGo2_GoronDmtBombFlowerAnimation(EnGo2* this, PlayState* play) {
f32 float1 = this->skelAnime.endFrame; f32 float1 = this->skelAnime.endFrame;
f32 float2 = this->skelAnime.curFrame * ((f32)0x8000 / float1); f32 float2 = this->skelAnime.curFrame * ((f32)0x8000 / float1);
this->actor.speedXZ = Math_SinS(float2); this->actor.speed = Math_SinS(float2);
if ((EnGo2_Orient(this, play)) && (this->waypoint == 0)) { if ((EnGo2_Orient(this, play)) && (this->waypoint == 0)) {
EnGo2_GetItemAnimation(this, play); EnGo2_GetItemAnimation(this, play);
} }
@ -1718,7 +1718,7 @@ void EnGo2_ContinueRolling(EnGo2* this, PlayState* play) {
if (((this->actor.params & 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && if (((this->actor.params & 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) &&
DECR(this->animTimer) == 0) { DECR(this->animTimer) == 0) {
this->actionFunc = EnGo2_SlowRolling; this->actionFunc = EnGo2_SlowRolling;
this->actor.speedXZ *= 0.5f; // slowdown this->actor.speed *= 0.5f; // slowdown
} }
EnGo2_GetDustData(this, 2); EnGo2_GetDustData(this, 2);
} }
@ -1746,7 +1746,7 @@ void EnGo2_SlowRolling(EnGo2* this, PlayState* play) {
EnGo2_StopRolling(this, play); EnGo2_StopRolling(this, play);
return; return;
} }
Math_ApproachF(&this->actor.speedXZ, EnGo2_GetTargetXZSpeed(this), 0.4f, 0.6f); Math_ApproachF(&this->actor.speed, EnGo2_GetTargetXZSpeed(this), 0.4f, 0.6f);
this->actor.shape.rot = this->actor.world.rot; this->actor.shape.rot = this->actor.world.rot;
} }
} }
@ -1772,11 +1772,11 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) {
void EnGo2_ReverseRolling(EnGo2* this, PlayState* play) { void EnGo2_ReverseRolling(EnGo2* this, PlayState* play) {
if (!EnGo2_IsRolling(this)) { if (!EnGo2_IsRolling(this)) {
Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.6f, 0.8f); Math_ApproachF(&this->actor.speed, 0.0f, 0.6f, 0.8f);
if (this->actor.speedXZ >= 1.0f) { if (this->actor.speed >= 1.0f) {
EnGo2_GetDustData(this, 3); EnGo2_GetDustData(this, 3);
} }
if ((s32)this->actor.speedXZ == 0) { if ((s32)this->actor.speed == 0) {
this->actor.world.rot.y ^= 0x8000; this->actor.world.rot.y ^= 0x8000;
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->reverse ^= 1; this->reverse ^= 1;
@ -1913,7 +1913,7 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) {
this->actor.shape.rot = this->actor.world.rot; this->actor.shape.rot = this->actor.world.rot;
this->animTimer = 60; this->animTimer = 60;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.speedXZ = 2.0f; this->actor.speed = 2.0f;
this->interactInfo.headRot = zeroVec; this->interactInfo.headRot = zeroVec;
this->interactInfo.torsoRot = zeroVec; this->interactInfo.torsoRot = zeroVec;
this->goronState++; this->goronState++;
@ -1936,7 +1936,7 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) {
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
} else { } else {
this->animTimer = 0; this->animTimer = 0;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if ((((this->actor.params & 0xFC00) >> 0xA) != 1) && (((this->actor.params & 0xFC00) >> 0xA) != 2) && if ((((this->actor.params & 0xFC00) >> 0xA) != 1) && (((this->actor.params & 0xFC00) >> 0xA) != 2) &&
(((this->actor.params & 0xFC00) >> 0xA) != 4) && (((this->actor.params & 0xFC00) >> 0xA) != 5) && (((this->actor.params & 0xFC00) >> 0xA) != 4) && (((this->actor.params & 0xFC00) >> 0xA) != 5) &&
(((this->actor.params & 0xFC00) >> 0xA) != 9) && (((this->actor.params & 0xFC00) >> 0xA) != 11)) { (((this->actor.params & 0xFC00) >> 0xA) != 9) && (((this->actor.params & 0xFC00) >> 0xA) != 11)) {
@ -2011,7 +2011,7 @@ s32 EnGo2_DrawRolling(EnGo2* this, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_go2.c", 2914); OPEN_DISPS(play->state.gfxCtx, "../z_en_go2.c", 2914);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
speedXZ = this->actionFunc == EnGo2_ReverseRolling ? 0.0f : this->actor.speedXZ; speedXZ = this->actionFunc == EnGo2_ReverseRolling ? 0.0f : this->actor.speed;
Matrix_RotateZYX((play->state.frames * ((s16)speedXZ * 1400)), 0, this->actor.shape.rot.z, MTXMODE_APPLY); Matrix_RotateZYX((play->state.frames * ((s16)speedXZ * 1400)), 0, this->actor.shape.rot.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go2.c", 2926), gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go2.c", 2926),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -128,7 +128,7 @@ void EnGoma_Init(Actor* thisx, PlayState* play) {
this->eggScale = 1.0f; this->eggScale = 1.0f;
this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 5.0f; this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 5.0f;
this->actionFunc = EnGoma_Debris; this->actionFunc = EnGoma_Debris;
this->actor.speedXZ = Rand_ZeroOne() * 2.3f + 1.5f; this->actor.speed = Rand_ZeroOne() * 2.3f + 1.5f;
this->actionTimer = 30; this->actionTimer = 30;
this->actor.scale.x = Rand_ZeroOne() * 0.005f + 0.01f; this->actor.scale.x = Rand_ZeroOne() * 0.005f + 0.01f;
this->actor.scale.y = Rand_ZeroOne() * 0.005f + 0.01f; this->actor.scale.y = Rand_ZeroOne() * 0.005f + 0.01f;
@ -144,7 +144,7 @@ void EnGoma_Init(Actor* thisx, PlayState* play) {
if (this->actor.params < 3) { // Spawned by boss if (this->actor.params < 3) { // Spawned by boss
this->actionFunc = EnGoma_EggFallToGround; this->actionFunc = EnGoma_EggFallToGround;
this->invincibilityTimer = 10; this->invincibilityTimer = 10;
this->actor.speedXZ = 1.5f; this->actor.speed = 1.5f;
} else if (this->actor.params == 8 || this->actor.params == 6) { } else if (this->actor.params == 8 || this->actor.params == 6) {
this->actionFunc = EnGoma_Egg; this->actionFunc = EnGoma_Egg;
this->spawnNum = sSpawnNum++; this->spawnNum = sSpawnNum++;
@ -193,7 +193,7 @@ void EnGoma_SetupFlee(EnGoma* this) {
void EnGoma_Flee(EnGoma* this, PlayState* play) { void EnGoma_Flee(EnGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachF(&this->actor.speedXZ, 20.0f / 3.0f, 0.5f, 2.0f); Math_ApproachF(&this->actor.speed, 20.0f / 3.0f, 0.5f, 2.0f);
Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) + 0x8000, Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) + 0x8000,
3, 2000); 3, 2000);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000); Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000);
@ -235,7 +235,7 @@ void EnGoma_EggFallToGround(EnGoma* this, PlayState* play) {
this->actionTimer = 3; this->actionTimer = 3;
Math_ApproachF(&this->eggScale, 0.75f, 0.5f, 1.0f); Math_ApproachF(&this->eggScale, 0.75f, 0.5f, 1.0f);
this->actor.velocity.y = 5.0f; this->actor.velocity.y = 5.0f;
this->actor.speedXZ = 2.0f; this->actor.speed = 2.0f;
} else { } else {
Math_ApproachF(&this->eggScale, 1.5f, 0.5f, 1.0f); Math_ApproachF(&this->eggScale, 1.5f, 0.5f, 1.0f);
} }
@ -259,9 +259,9 @@ void EnGoma_EggFallToGround(EnGoma* this, PlayState* play) {
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 0.05f); Math_ApproachZeroF(&this->actor.speed, 0.2f, 0.05f);
} }
this->eggPitch += (this->actor.speedXZ * 0.1f); this->eggPitch += (this->actor.speed * 0.1f);
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
} }
@ -306,7 +306,7 @@ void EnGoma_SetupHatch(EnGoma* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
EnGoma_SpawnHatchDebris(this, play); EnGoma_SpawnHatchDebris(this, play);
this->eggScale = 1.0f; this->eggScale = 1.0f;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnGoma_Hatch(EnGoma* this, PlayState* play) { void EnGoma_Hatch(EnGoma* this, PlayState* play) {
@ -328,7 +328,7 @@ void EnGoma_SetupHurt(EnGoma* this, PlayState* play) {
this->actionTimer = 10; this->actionTimer = 10;
} }
this->actor.speedXZ = 20.0f; this->actor.speed = 20.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000;
if (this->actor.params < 6) { if (this->actor.params < 6) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_BJR_DAM1); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_BJR_DAM1);
@ -341,7 +341,7 @@ void EnGoma_Hurt(EnGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f);
} }
if (this->actionTimer == 0) { if (this->actionTimer == 0) {
@ -373,7 +373,7 @@ void EnGoma_Die(EnGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f);
} }
if (this->actionTimer == 17) { if (this->actionTimer == 17) {
@ -401,7 +401,7 @@ void EnGoma_Dead(EnGoma* this, PlayState* play) {
Vec3f pos; Vec3f pos;
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f);
if (this->actionTimer == 2) { if (this->actionTimer == 2) {
pos.x = this->actor.world.pos.x; pos.x = this->actor.world.pos.x;
@ -454,7 +454,7 @@ void EnGoma_PrepareJump(EnGoma* this, PlayState* play) {
s16 targetAngle; s16 targetAngle;
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
targetAngle = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); targetAngle = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
Math_ApproachS(&this->actor.world.rot.y, targetAngle, 2, 4000); Math_ApproachS(&this->actor.world.rot.y, targetAngle, 2, 4000);
@ -477,7 +477,7 @@ void EnGoma_Land(EnGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f);
} }
if (this->actionTimer == 0) { if (this->actionTimer == 0) {
EnGoma_SetupStand(this); EnGoma_SetupStand(this);
@ -500,7 +500,7 @@ void EnGoma_SetupJump(EnGoma* this) {
void EnGoma_Jump(EnGoma* this, PlayState* play) { void EnGoma_Jump(EnGoma* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_24; this->actor.flags |= ACTOR_FLAG_24;
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.5f, 5.0f); Math_ApproachF(&this->actor.speed, 10.0f, 0.5f, 5.0f);
if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
EnGoma_SetupLand(this); EnGoma_SetupLand(this);
@ -515,7 +515,7 @@ void EnGoma_Jump(EnGoma* this, PlayState* play) {
void EnGoma_Stand(EnGoma* this, PlayState* play) { void EnGoma_Stand(EnGoma* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 2, Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 2,
3000); 3000);
@ -535,7 +535,7 @@ void EnGoma_ChasePlayer(EnGoma* this, PlayState* play) {
} }
} }
Math_ApproachF(&this->actor.speedXZ, 10.0f / 3.0f, 0.5f, 2.0f); Math_ApproachF(&this->actor.speed, 10.0f / 3.0f, 0.5f, 2.0f);
Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 2000); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 2000);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000); Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000);
@ -570,7 +570,7 @@ void EnGoma_Stunned(EnGoma* this, PlayState* play) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
} }
if (this->stunTimer == 0) { if (this->stunTimer == 0) {
@ -615,7 +615,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
if ((this->colCyl1.base.atFlags & AT_HIT) && this->actionFunc == EnGoma_Jump) { if ((this->colCyl1.base.atFlags & AT_HIT) && this->actionFunc == EnGoma_Jump) {
EnGoma_SetupLand(this); EnGoma_SetupLand(this);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
} }
@ -630,7 +630,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
if (this->actionFunc == EnGoma_Jump) { if (this->actionFunc == EnGoma_Jump) {
EnGoma_SetupLand(this); EnGoma_SetupLand(this);
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speedXZ = -5.0f; this->actor.speed = -5.0f;
} else { } else {
Matrix_RotateY(BINANG_TO_RAD_ALT(player->actor.shape.rot.y), MTXMODE_NEW); Matrix_RotateY(BINANG_TO_RAD_ALT(player->actor.shape.rot.y), MTXMODE_NEW);
Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel); Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel);

View file

@ -299,7 +299,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) {
s32 pad; s32 pad;
Vec3s* nextPointPos; Vec3s* nextPointPos;
Math_StepToF(&this->actor.speedXZ, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f);
func_8002D868(&this->actor); func_8002D868(&this->actor);
path = &play->pathList[this->actor.params & 0xFF]; path = &play->pathList[this->actor.params & 0xFF];
nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
@ -322,7 +322,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) {
nextPointPosF.x = nextPointPos->x; nextPointPosF.x = nextPointPos->x;
nextPointPosF.y = nextPointPos->y; nextPointPosF.y = nextPointPos->y;
nextPointPosF.z = nextPointPos->z; nextPointPosF.z = nextPointPos->z;
Math_StepToF(&this->actor.speedXZ, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f);
if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < SQ(5.0f)) { if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < SQ(5.0f)) {
Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff); Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff);
} else { } else {
@ -331,9 +331,9 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) {
posDiff.z = nextPointPosF.z - currentPointPos->z; posDiff.z = nextPointPosF.z - currentPointPos->z;
} }
EnGoroiwa_Vec3fNormalize(&this->actor.velocity, &posDiff); EnGoroiwa_Vec3fNormalize(&this->actor.velocity, &posDiff);
this->actor.velocity.x *= this->actor.speedXZ; this->actor.velocity.x *= this->actor.speed;
this->actor.velocity.y *= this->actor.speedXZ; this->actor.velocity.y *= this->actor.speed;
this->actor.velocity.z *= this->actor.speedXZ; this->actor.velocity.z *= this->actor.speed;
nextPointReached = true; nextPointReached = true;
nextPointReached &= Math_StepToF(&this->actor.world.pos.x, nextPointPosF.x, fabsf(this->actor.velocity.x)); nextPointReached &= Math_StepToF(&this->actor.world.pos.x, nextPointPosF.x, fabsf(this->actor.velocity.x));
nextPointReached &= Math_StepToF(&this->actor.world.pos.y, nextPointPosF.y, fabsf(this->actor.velocity.y)); nextPointReached &= Math_StepToF(&this->actor.world.pos.y, nextPointPosF.y, fabsf(this->actor.velocity.y));
@ -637,7 +637,7 @@ void EnGoroiwa_SetupMoveAndFallToGround(EnGoroiwa* this) {
EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_OC); EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_OC);
this->actor.gravity = -0.86f; this->actor.gravity = -0.86f;
this->actor.minVelocityY = -15.0f; this->actor.minVelocityY = -15.0f;
this->actor.speedXZ *= 0.15f; this->actor.speed *= 0.15f;
this->actor.velocity.y = 5.0f; this->actor.velocity.y = 5.0f;
this->rollRotSpeed = 1.0f; this->rollRotSpeed = 1.0f;
} }
@ -657,7 +657,7 @@ void EnGoroiwa_SetupWait(EnGoroiwa* this) {
static s16 waitDurations[] = { 20, 6 }; static s16 waitDurations[] = { 20, 6 };
this->actionFunc = EnGoroiwa_Wait; this->actionFunc = EnGoroiwa_Wait;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_OC); EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_OC);
this->waitTimer = waitDurations[this->actor.home.rot.z & 1]; this->waitTimer = waitDurations[this->actor.home.rot.z & 1];
this->rollRotSpeed = 0.0f; this->rollRotSpeed = 0.0f;
@ -676,7 +676,7 @@ void EnGoroiwa_SetupMoveUp(EnGoroiwa* this) {
this->actionFunc = EnGoroiwa_MoveUp; this->actionFunc = EnGoroiwa_MoveUp;
EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_AT | ENGOROIWA_ENABLE_OC); EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_AT | ENGOROIWA_ENABLE_OC);
this->rollRotSpeed = 0.0f; this->rollRotSpeed = 0.0f;
this->actor.velocity.y = fabsf(this->actor.speedXZ) * 0.1f; this->actor.velocity.y = fabsf(this->actor.speed) * 0.1f;
} }
void EnGoroiwa_MoveUp(EnGoroiwa* this, PlayState* play) { void EnGoroiwa_MoveUp(EnGoroiwa* this, PlayState* play) {
@ -690,7 +690,7 @@ void EnGoroiwa_MoveUp(EnGoroiwa* this, PlayState* play) {
} else if (EnGoroiwa_MoveUpToNextWaypoint(this, play)) { } else if (EnGoroiwa_MoveUpToNextWaypoint(this, play)) {
EnGoroiwa_NextWaypoint(this, play); EnGoroiwa_NextWaypoint(this, play);
EnGoroiwa_SetupRoll(this); EnGoroiwa_SetupRoll(this);
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} }
@ -699,7 +699,7 @@ void EnGoroiwa_SetupMoveDown(EnGoroiwa* this) {
EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_AT | ENGOROIWA_ENABLE_OC); EnGoroiwa_UpdateFlags(this, ENGOROIWA_ENABLE_AT | ENGOROIWA_ENABLE_OC);
this->rollRotSpeed = 0.3f; this->rollRotSpeed = 0.3f;
this->bounceCount = 0; this->bounceCount = 0;
this->actor.velocity.y = fabsf(this->actor.speedXZ) * -0.3f; this->actor.velocity.y = fabsf(this->actor.speed) * -0.3f;
this->stateFlags |= ENGOROIWA_RETAIN_ROT_SPEED; this->stateFlags |= ENGOROIWA_RETAIN_ROT_SPEED;
this->stateFlags &= ~ENGOROIWA_IN_WATER; this->stateFlags &= ~ENGOROIWA_IN_WATER;
} }
@ -716,7 +716,7 @@ void EnGoroiwa_MoveDown(EnGoroiwa* this, PlayState* play) {
EnGoroiwa_NextWaypoint(this, play); EnGoroiwa_NextWaypoint(this, play);
EnGoroiwa_SetupRoll(this); EnGoroiwa_SetupRoll(this);
this->stateFlags &= ~ENGOROIWA_RETAIN_ROT_SPEED; this->stateFlags &= ~ENGOROIWA_RETAIN_ROT_SPEED;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
} }

View file

@ -659,7 +659,7 @@ void func_80A5455C(EnHeishi2* this, PlayState* play) {
rotY = Rand_CenteredFloat(7000.0f) + this->actor.yawTowardsPlayer; rotY = Rand_CenteredFloat(7000.0f) + this->actor.yawTowardsPlayer;
bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0); bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0);
if (bomb != NULL) { if (bomb != NULL) {
bomb->actor.speedXZ = Rand_CenteredFloat(5.0f) + 10.0f; bomb->actor.speed = Rand_CenteredFloat(5.0f) + 10.0f;
bomb->actor.velocity.y = Rand_CenteredFloat(5.0f) + 10.0f; bomb->actor.velocity.y = Rand_CenteredFloat(5.0f) + 10.0f;
} }

View file

@ -172,7 +172,7 @@ void EnHeishi3_CatchStart(EnHeishi3* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gEnHeishiWalkAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f); Animation_Change(&this->skelAnime, &gEnHeishiWalkAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->caughtTimer = 20; this->caughtTimer = 20;
this->actionFunc = func_80A55BD4; this->actionFunc = func_80A55BD4;
this->actor.speedXZ = 2.5f; this->actor.speed = 2.5f;
} }
void func_80A55BD4(EnHeishi3* this, PlayState* play) { void func_80A55BD4(EnHeishi3* this, PlayState* play) {
@ -183,7 +183,7 @@ void func_80A55BD4(EnHeishi3* this, PlayState* play) {
} }
if (this->caughtTimer == 0) { if (this->caughtTimer == 0) {
this->actionFunc = EnHeishi3_ResetAnimationToIdle; this->actionFunc = EnHeishi3_ResetAnimationToIdle;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} else { } else {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 3000, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 3000, 0);
} }

View file

@ -186,12 +186,12 @@ void EnHintnuts_SetupRun(EnHintnuts* this) {
void EnHintnuts_SetupTalk(EnHintnuts* this) { void EnHintnuts_SetupTalk(EnHintnuts* this) {
Animation_MorphToLoop(&this->skelAnime, &gHintNutsTalkAnim, -5.0f); Animation_MorphToLoop(&this->skelAnime, &gHintNutsTalkAnim, -5.0f);
this->actionFunc = EnHintnuts_Talk; this->actionFunc = EnHintnuts_Talk;
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
} }
void EnHintnuts_SetupLeave(EnHintnuts* this, PlayState* play) { void EnHintnuts_SetupLeave(EnHintnuts* this, PlayState* play) {
Animation_MorphToLoop(&this->skelAnime, &gHintNutsRunAnim, -5.0f); Animation_MorphToLoop(&this->skelAnime, &gHintNutsRunAnim, -5.0f);
this->actor.speedXZ = 3.0f; this->actor.speed = 3.0f;
this->animFlagAndTimer = 100; this->animFlagAndTimer = 100;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->collider.base.ocFlags1 &= ~OC1_ON; this->collider.base.ocFlags1 &= ~OC1_ON;
@ -350,7 +350,7 @@ void EnHintnuts_Run(EnHintnuts* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
} }
Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f); Math_StepToF(&this->actor.speed, 7.5f, 1.0f);
if (Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) { if (Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
this->unk_196 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->unk_196 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -375,7 +375,7 @@ void EnHintnuts_Run(EnHintnuts* this, PlayState* play) {
EnHintnuts_SetupTalk(this); EnHintnuts_SetupTalk(this);
} else if (this->animFlagAndTimer == 0 && Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f && } else if (this->animFlagAndTimer == 0 && Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f &&
fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) { fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) {
this->actor.speedXZ = 0.0f; this->actor.speed = 0.0f;
if (this->actor.category == ACTORCAT_BG) { if (this->actor.category == ACTORCAT_BG) {
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_16); this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_16);
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2;

View file

@ -206,7 +206,7 @@ void func_80A591C0(EnHoll* this, PlayState* play) {
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->unk_14F = 1;
player->actor.speedXZ = 0.0f; player->actor.speed = 0.0f;
} }
} }
} else if (this->unk_14F != 0) { } else if (this->unk_14F != 0) {

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