speedXZ -> speed (#1186)

* speedXZ to speed

* brackets
This commit is contained in:
engineer124 2023-03-03 09:07:51 -05:00 committed by GitHub
parent cc8772a896
commit e8f3039264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
187 changed files with 1746 additions and 1747 deletions

View File

@ -67,7 +67,7 @@ void EnMs_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.015f);
this->actor.colChkInfo.mass = 0xFF;
this->actionFunc = func_80952734;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.gravity = -1.0f;
}

View File

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

View File

@ -1125,8 +1125,8 @@ void Actor_UpdatePos(Actor* actor) {
* It is recommended to not call this function directly and use `Actor_MoveWithGravity` instead
*/
void Actor_UpdateVelocityWithGravity(Actor* actor) {
actor->velocity.x = actor->speedXZ * Math_SinS(actor->world.rot.y);
actor->velocity.z = actor->speedXZ * Math_CosS(actor->world.rot.y);
actor->velocity.x = actor->speed * Math_SinS(actor->world.rot.y);
actor->velocity.z = actor->speed * Math_CosS(actor->world.rot.y);
actor->velocity.y += actor->gravity;
if (actor->velocity.y < actor->terminalVelocity) {
@ -1150,11 +1150,11 @@ void Actor_MoveWithGravity(Actor* actor) {
* It is recommended to not call this function directly and use `Actor_MoveWithoutGravity` instead
*/
void Actor_UpdateVelocityWithoutGravity(Actor* actor) {
f32 horizontalSpeed = 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) * horizontalSpeed;
actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ;
actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed;
actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ;
actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speed;
actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ;
}
/**
@ -1174,11 +1174,11 @@ void Actor_MoveWithoutGravity(Actor* actor) {
* It is recommended to not call this function directly and use `Actor_MoveWithoutGravityReverse` instead
*/
void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor) {
f32 horizontalSpeed = 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) * horizontalSpeed;
actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speedXZ;
actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed;
actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ;
actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speed;
actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ;
}
/**
@ -1193,7 +1193,7 @@ void Actor_MoveWithoutGravityReverse(Actor* actor) {
* Sets horizontal speed and Y velocity using the `speed` argument and current pitch
*/
void Actor_SetSpeeds(Actor* actor, f32 speed) {
actor->speedXZ = Math_CosS(actor->world.rot.x) * speed;
actor->speed = Math_CosS(actor->world.rot.x) * speed;
actor->velocity.y = -Math_SinS(actor->world.rot.x) * speed;
}
@ -3607,7 +3607,7 @@ Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3) {
((itemAction->id == ACTOR_EN_ARROW) && (func_800BC188(itemAction->params) & arg3))) {
f32 speedXZ;
if ((itemAction->speedXZ <= 0.0f) && (GET_PLAYER(play)->unk_D57 != 0)) {
if ((itemAction->speed <= 0.0f) && (GET_PLAYER(play)->unk_D57 != 0)) {
if (itemAction->id == ACTOR_ARMS_HOOK) {
speedXZ = 20.0f;
} else if (itemAction->id == ACTOR_EN_BOOM) {
@ -3624,7 +3624,7 @@ Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3) {
}
}
} else {
speedXZ = itemAction->speedXZ;
speedXZ = itemAction->speed;
}
if (func_800BC1B4(actor, itemAction, arg2, speedXZ)) {
@ -3644,7 +3644,7 @@ Actor* func_800BC444(PlayState* play, Actor* actor, f32 arg2) {
while (explosive != NULL) {
if (((explosive->id == ACTOR_EN_BOM) || (explosive->id == ACTOR_EN_BOM_CHU) ||
(explosive->id == ACTOR_EN_BOMBF))) {
if (func_800BC1B4(actor, explosive, arg2, explosive->speedXZ)) {
if (func_800BC1B4(actor, explosive, arg2, explosive->speed)) {
break;
}
}

View File

@ -207,8 +207,8 @@ s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget) {
s32 reachedEnd = false;
Vec3f curPointPos;
Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = enHy->actor.speedXZ * 400.0f;
Math_SmoothStepToF(&enHy->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = enHy->actor.speed * 400.0f;
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) &&
SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) {
enHy->curPoint++;
@ -225,8 +225,8 @@ s32 EnHy_MoveBackwards(EnHy* enHy, f32 speedTarget) {
s32 reachedEnd = false;
Vec3f curPointPos;
Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = enHy->actor.speedXZ * 400.0f;
Math_SmoothStepToF(&enHy->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = enHy->actor.speed * 400.0f;
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) &&
SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) {
enHy->curPoint--;

View File

@ -219,7 +219,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
this->unk152 = 15;
this->unk14C = 35;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
@ -346,7 +346,7 @@ void func_800A640C(EnItem00* this, PlayState* play) {
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->unk14C == 0) {
if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) &&
@ -406,7 +406,7 @@ void func_800A6780(EnItem00* this, PlayState* play) {
if (this->actor.params == ITEM00_RECOVERY_HEART) {
if (this->actor.velocity.y < 0.0f) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = -0.4f;
if (this->actor.velocity.y < -1.5f) {
this->actor.velocity.y = -1.5f;
@ -447,7 +447,7 @@ void func_800A6780(EnItem00* this, PlayState* play) {
if (this->actor.bgCheckFlags & 3) {
this->actionFunc = func_800A640C;
this->actor.shape.rot.z = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
}
@ -684,7 +684,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
this->unk152 = 15;
this->unk14C = 35;
this->actor.shape.rot.z = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
@ -951,7 +951,7 @@ Actor* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, u32 params) {
} else {
spawnedActor->velocity.y = -2.0f;
}
spawnedActor->speedXZ = 2.0f;
spawnedActor->speed = 2.0f;
spawnedActor->gravity = -0.9f;
spawnedActor->world.rot.y = randPlusMinusPoint5Scaled(0x10000);
Actor_SetScale(spawnedActor, 0.0f);
@ -1002,7 +1002,7 @@ Actor* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s32 params) {
if (spawnedActor != NULL) {
if (param8000 == 0) {
spawnedActor->velocity.y = 0.0f;
spawnedActor->speedXZ = 0.0f;
spawnedActor->speed = 0.0f;
if (param10000 != 0) {
spawnedActor->gravity = 0.0f;
} else {
@ -1195,7 +1195,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP
spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
if ((spawnedActor != 0) && (dropId != (u8)ITEM00_NO_DROP)) {
spawnedActor->actor.velocity.y = 8.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.speed = 2.0f;
spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
Actor_SetScale(&spawnedActor->actor, 0.0f);

View File

@ -492,7 +492,7 @@ s32 Player_IsGoronOrDeku(Player* player) {
s32 func_801234D4(PlayState* play) {
Player* player = GET_PLAYER(play);
return (player->stateFlags2 & PLAYER_STATE2_8) || player->actor.speedXZ != 0.0f ||
return (player->stateFlags2 & PLAYER_STATE2_8) || (player->actor.speed != 0.0f) ||
((player->transformation != PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000)) ||
((player->transformation == PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000) &&
(!(player->actor.bgCheckFlags & 1) || (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER)));

View File

@ -762,7 +762,7 @@ s32 SubS_WeightPathing_Move(Actor* actor, Path* path, s32* waypoint, f32* progre
}
while (true) {
if (!SubS_WeightPathing_ComputePoint(path, *waypoint, &point, *progress, direction) ||
((s32)(actor->speedXZ * 10000.0f) == 0)) {
((s32)(actor->speed * 10000.0f) == 0)) {
return false;
}
dist = Math_Vec3f_DistXZ(&actor->world.pos, &point);

View File

@ -238,7 +238,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
Actor_MoveWithGravity(&this->actor);
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff);
Math_Vec3f_Sum(&this->unk1E0, &prevFrameDiff, &this->unk1E0);
this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speedXZ, -this->actor.velocity.y);
this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speed, -this->actor.velocity.y);
sp60.x = this->unk1EC.x - (this->unk1E0.x - this->unk1EC.x);
sp60.y = this->unk1EC.y - (this->unk1E0.y - this->unk1EC.y);
sp60.z = this->unk1EC.z - (this->unk1E0.z - this->unk1EC.z);

View File

@ -148,7 +148,7 @@ s32 func_80BC3B00(BgF40Block* this) {
}
}
if (Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &sp28, this->dyna.actor.speedXZ) <= 0.0f) {
if (Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &sp28, this->dyna.actor.speed) <= 0.0f) {
this->unk_168 = 6;
this->unk_160 = this->unk_164;
return true;
@ -182,26 +182,26 @@ s32 func_80BC3D08(BgF40Block* this, PlayState* play, s32 arg2) {
if (arg2 != 0) {
sp48.x =
(D_80BC4620[this->unk_168].x * ((800.0f * this->dyna.actor.scale.x) - (this->dyna.actor.speedXZ * 0.5f))) +
(D_80BC4620[this->unk_168].x * ((800.0f * this->dyna.actor.scale.x) - (this->dyna.actor.speed * 0.5f))) +
this->dyna.actor.world.pos.x;
sp48.y =
(D_80BC4620[this->unk_168].y * ((800.0f * this->dyna.actor.scale.y) - (this->dyna.actor.speedXZ * 0.5f))) +
(D_80BC4620[this->unk_168].y * ((800.0f * this->dyna.actor.scale.y) - (this->dyna.actor.speed * 0.5f))) +
this->dyna.actor.world.pos.y;
sp48.z =
(D_80BC4620[this->unk_168].z * ((800.0f * this->dyna.actor.scale.z) - (this->dyna.actor.speedXZ * 0.5f))) +
(D_80BC4620[this->unk_168].z * ((800.0f * this->dyna.actor.scale.z) - (this->dyna.actor.speed * 0.5f))) +
this->dyna.actor.world.pos.z;
sp3C.x = (D_80BC4620[this->unk_168].x * this->dyna.actor.speedXZ) + sp48.x;
sp3C.y = (D_80BC4620[this->unk_168].y * this->dyna.actor.speedXZ) + sp48.y;
sp3C.z = (D_80BC4620[this->unk_168].z * this->dyna.actor.speedXZ) + sp48.z;
sp3C.x = (D_80BC4620[this->unk_168].x * this->dyna.actor.speed) + sp48.x;
sp3C.y = (D_80BC4620[this->unk_168].y * this->dyna.actor.speed) + sp48.y;
sp3C.z = (D_80BC4620[this->unk_168].z * this->dyna.actor.speed) + sp48.z;
} else {
sp3C.x = (D_80BC4620[this->unk_168].x * 800.0f * this->dyna.actor.scale.x) + this->dyna.actor.world.pos.x;
sp3C.y = (D_80BC4620[this->unk_168].y * 800.0f * this->dyna.actor.scale.y) + this->dyna.actor.world.pos.y;
sp3C.z = (D_80BC4620[this->unk_168].z * 800.0f * this->dyna.actor.scale.z) + this->dyna.actor.world.pos.z;
sp48.x = sp3C.x - (D_80BC4620[this->unk_168].x * this->dyna.actor.speedXZ * 1.5f);
sp48.y = sp3C.y - (D_80BC4620[this->unk_168].y * this->dyna.actor.speedXZ * 1.5f);
sp48.z = sp3C.z - (D_80BC4620[this->unk_168].z * this->dyna.actor.speedXZ * 1.5f);
sp48.x = sp3C.x - (D_80BC4620[this->unk_168].x * this->dyna.actor.speed * 1.5f);
sp48.y = sp3C.y - (D_80BC4620[this->unk_168].y * this->dyna.actor.speed * 1.5f);
sp48.z = sp3C.z - (D_80BC4620[this->unk_168].z * this->dyna.actor.speed * 1.5f);
}
if (BgCheck_AnyLineTest1(&play->colCtx, &sp48, &sp3C, &sp30, &sp54, true)) {
@ -240,11 +240,11 @@ void BgF40Block_Init(Actor* thisx, PlayState* play) {
if (this->path != NULL) {
if (Flags_GetSwitch(play, BGF40BLOCK_GET_SWITCHFLAG(&this->dyna.actor))) {
this->actionFunc = func_80BC4530;
this->dyna.actor.speedXZ = 40.0f;
this->dyna.actor.speed = 40.0f;
func_80BC3A2C(this, play);
} else {
this->actionFunc = func_80BC4380;
this->dyna.actor.speedXZ = 20.0f;
this->dyna.actor.speed = 20.0f;
func_80BC3980(this, play);
}
} else {
@ -272,7 +272,7 @@ void func_80BC41AC(BgF40Block* this, PlayState* play) {
void func_80BC4228(BgF40Block* this, PlayState* play) {
if (func_80BC3B00(this)) {
this->dyna.actor.speedXZ = 20.0f;
this->dyna.actor.speed = 20.0f;
if (this->unk_160 < (this->path->count - 1)) {
this->unk_164 = this->unk_160 + 1;
} else {
@ -332,7 +332,7 @@ void func_80BC43CC(BgF40Block* this, PlayState* play) {
void func_80BC4448(BgF40Block* this, PlayState* play) {
if (func_80BC3B00(this)) {
this->dyna.actor.speedXZ = 40.0f;
this->dyna.actor.speed = 40.0f;
if (this->unk_160 > 0) {
this->unk_164 = this->unk_160 - 1;
} else {

View File

@ -137,7 +137,7 @@ void BgIkanaDharma_Destroy(Actor* thisx, PlayState* play) {
void BgIkanaDharma_SetupWaitForHit(BgIkanaDharma* this) {
this->actionFunc = BgIkanaDharma_WaitForHit;
this->dyna.actor.speedXZ = 0.0f;
this->dyna.actor.speed = 0.0f;
}
void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) {
@ -157,7 +157,7 @@ void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) {
tempAngle1 = BINANG_ADD(this->dyna.actor.yawTowardsPlayer, 0x8000);
tempAngle2 = (BINANG_SUB(player->actor.shape.rot.y, tempAngle1) >> 1);
this->dyna.actor.world.rot.y = tempAngle1 + tempAngle2 + 0xF000;
this->dyna.actor.speedXZ = 20.0f;
this->dyna.actor.speed = 20.0f;
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH);
BgIkanaDharma_SetupStartCutscene(this);
} else if ((this->dyna.actor.flags & ACTOR_FLAG_40) == ACTOR_FLAG_40 && sFirstHitBgIkanaDharma == NULL &&

View File

@ -314,7 +314,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) {
player->stateFlags1 |= PLAYER_STATE1_20;
this->unk_161 = 1;
}
} else if (player->actor.speedXZ != 0.0f) {
} else if (player->actor.speed != 0.0f) {
this->unk_164 = CLAMP_MIN(this->unk_164, 2.0f);
}
}

View File

@ -710,10 +710,10 @@ void func_809DAB78(Boss02* this, PlayState* play) {
this->unk_0168 = 2000.0f;
if (this->unk_0195 != 0) {
this->actor.speedXZ = this->unk_01A8 * D_809DF5B0 * 1.25f;
this->actor.speed = this->unk_01A8 * D_809DF5B0 * 1.25f;
this->skelAnime.playSpeed = 2.0f;
} else {
this->actor.speedXZ = this->unk_01A8 * D_809DF5B0;
this->actor.speed = this->unk_01A8 * D_809DF5B0;
}
Actor_UpdateVelocityWithoutGravity(&this->actor);
@ -947,7 +947,7 @@ void func_809DAB78(Boss02* this, PlayState* play) {
case 21:
this->unk_01A8 = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_0146[0] == 0) {
this->unk_0146[0] = 3;
@ -969,13 +969,13 @@ void func_809DAB78(Boss02* this, PlayState* play) {
spCC = player->actor.world.pos.x - this->actor.world.pos.x;
spC4 = player->actor.world.pos.z - this->actor.world.pos.z;
if (sqrtf(SQ(spCC) + SQ(spC4)) < (400.0f * D_809DF5B0)) {
this->actor.speedXZ = 15.0f * D_809DF5B0;
this->actor.speed = 15.0f * D_809DF5B0;
}
spCC = this->actor.world.pos.x;
spC4 = this->actor.world.pos.z;
if (sqrtf(SQ(spCC) + SQ(spC4)) < (400.0f * D_809DF5B0)) {
this->actor.speedXZ = 15.0f * D_809DF5B0;
this->actor.speed = 15.0f * D_809DF5B0;
}
if (otherTwinmold->unk_0144 >= 10) {
@ -998,7 +998,7 @@ void func_809DAB78(Boss02* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
this->unk_0144 = 23;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_0170 = this->unk_017C;
this->unk_016C = 30;
this->unk_0170.y = this->actor.floorHeight;
@ -1958,7 +1958,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
temp_a0_5->world.pos.x *= phi_f0_2;
temp_a0_5->world.pos.z *= phi_f0_2;
temp_a0_5->speedXZ *= phi_f0_2;
temp_a0_5->speed *= phi_f0_2;
temp_a0_5->velocity.x *= phi_f0_2;
temp_a0_5->velocity.y *= phi_f0_2;

View File

@ -581,7 +581,7 @@ void func_809E34B8(Boss03* this, PlayState* play) {
Math_ApproachS(&this->bodyYRot, bodyYRotTarget, 5, 0x100);
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & 8)) {
@ -669,7 +669,7 @@ void Boss03_ChasePlayer(Boss03* this, PlayState* play) {
Math_ApproachS(&this->bodyYRot, bodyYRotTarget, 5, 0x100);
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
Actor_MoveWithoutGravityReverse(&this->actor);
@ -765,7 +765,7 @@ void Boss03_CatchPlayer(Boss03* this, PlayState* play) {
-0.5f,
5, 0x100);
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
Actor_MoveWithoutGravityReverse(&this->actor);
Math_ApproachS(&this->actor.shape.rot.x, this->actor.world.rot.x, 2, this->unk_274 * 2);
@ -873,7 +873,7 @@ void Boss03_ChewPlayer(Boss03* this, PlayState* play) {
switch (this->unk_242) {
case 0:
Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 1.0f);
if (sqrtf(SQ(xDiff) + SQ(zDiff)) < 100.0f) {
this->unk_242 = 1;
Animation_MorphToLoop(&this->skelAnime, &gGyorgBackingUpAnim, -15.0f);
@ -881,7 +881,7 @@ void Boss03_ChewPlayer(Boss03* this, PlayState* play) {
break;
case 1:
Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f);
Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 0.5f);
Math_ApproachF(&this->actor.world.pos.y, 200.0f, 0.05f, 5.0f);
break;
}
@ -995,7 +995,7 @@ void Boss03_PrepareCharge(Boss03* this, PlayState* play) {
}
// Turns back slowly
Math_ApproachF(&this->actor.speedXZ, -3.0f, 1.0f, 0.5f);
Math_ApproachF(&this->actor.speed, -3.0f, 1.0f, 0.5f);
Actor_MoveWithoutGravityReverse(&this->actor);
}
@ -1032,11 +1032,11 @@ void Boss03_Charge(Boss03* this, PlayState* play) {
this->actor.shape.rot = this->actor.world.rot;
Math_ApproachF(&this->actor.speedXZ, 25.0f, 1.0f, 3.0f);
Math_ApproachF(&this->actor.speed, 25.0f, 1.0f, 3.0f);
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
Actor_MoveWithoutGravityReverse(&this->actor);
if (this->actor.speedXZ >= 20.0f) {
if (this->actor.speed >= 20.0f) {
// Jump over platform
if (this->unk_242 == 1) {
if (sqrtf(SQXZ(this->actor.world.pos)) < 700.0f) {
@ -1068,7 +1068,7 @@ void Boss03_SetupJumpOverPlatform(Boss03* this, PlayState* play) {
this->actionFunc = Boss03_JumpOverPlatform;
this->actor.gravity = -2.0f;
this->actor.velocity.y = 30.0f;
this->actor.speedXZ = 25.0f;
this->actor.speed = 25.0f;
Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_JUMP_OLD);
}
@ -1171,7 +1171,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
case 1:
player->actor.world.pos.z = 0.0f;
player->actor.world.pos.x = 0.0f;
player->actor.speedXZ = 0.0f;
player->actor.speed = 0.0f;
this->subCamEye.x = 100.0f;
this->subCamEye.y = 540.0f;
@ -1210,7 +1210,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
}
if (this->csTimer > 50) {
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, 0.1f);
Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, 0.1f);
}
if (this->unk_242 < 2) {
@ -1225,7 +1225,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
} else {
this->unk_278 = 0.0f;
bubblesToSpawnNum = 1;
if ((this->actor.speedXZ == 0.0f) && (this->csTimer > 230)) {
if ((this->actor.speed == 0.0f) && (this->csTimer > 230)) {
this->csState = 3;
this->csTimer = 0;
}
@ -1243,7 +1243,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
case 3:
Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_PREATTACK_OLD - SFX_FLAG);
sp5A = 0x1970;
Math_ApproachF(&this->actor.speedXZ, 15.0f, 1.0f, 2.0f);
Math_ApproachF(&this->actor.speed, 15.0f, 1.0f, 2.0f);
if (this->csTimer > 20) {
this->csState = 4;
this->csTimer = 0;
@ -1276,14 +1276,14 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
this->csState = 5;
this->csTimer = 0;
this->unk_2D5 = false;
this->actor.speedXZ = -200.0f;
this->actor.speed = -200.0f;
Actor_MoveWithoutGravityReverse(&this->actor);
this->actor.world.pos.y = this->waterHeight - 150.0f;
Play_DisableMotionBlur();
case 5:
SkelAnime_Update(&this->skelAnime);
this->actor.speedXZ = 20.0f;
this->actor.speed = 20.0f;
Actor_MoveWithoutGravityReverse(&this->actor);
player->actor.shape.rot.y = -0x1470;
player->actor.world.rot.y = player->actor.shape.rot.y;
@ -1301,7 +1301,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
this->csState = 6;
this->csTimer = 0;
this->actor.gravity = -1.5f;
this->actor.speedXZ = 20.0f;
this->actor.speed = 20.0f;
Audio_QueueSeqCmd(NA_BGM_BOSS | 0x8000);
Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_JUMP_OLD);
@ -1326,7 +1326,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
this->bubbleEffectSpawnCount = 2;
this->actor.gravity = 0.0f;
Math_ApproachZeroF(&this->actor.velocity.y, 1.0f, 1.0f);
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.5f);
Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.5f);
} else {
if (1) {}
if (1) {}
@ -1382,7 +1382,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
if ((this->csState == 2) || (this->csState == 3)) {
Actor_MoveWithoutGravityReverse(&this->actor);
phi_f2 = this->actor.speedXZ * 0.02f;
phi_f2 = this->actor.speed * 0.02f;
phi_f2 = CLAMP_MAX(phi_f2, 0.12f);
sp5C = Math_SinS(this->unk_240 * sp5A) * phi_f2;
@ -1544,7 +1544,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
this->unk_242 = 1;
this->actor.gravity = -2.0f;
this->actor.velocity.y = 25.0f;
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
this->actor.world.rot.y = this->unk_2BE + 0x8000;
this->unk_240 = 0;
Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_DEAD_JUMP2_OLD);
@ -1565,7 +1565,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
if (this->actor.world.pos.y < PLATFORM_HEIGHT + (100.0f * sp64)) {
this->actor.world.pos.y = PLATFORM_HEIGHT + (100.0f * sp64);
this->actor.velocity.y = ((Rand_ZeroFloat(10.0f) + 7.5f) * sp64) + 7.5f;
this->actor.speedXZ = ((Rand_ZeroFloat(5.0f) + 2.5f) * sp64) + 2.5f;
this->actor.speed = ((Rand_ZeroFloat(5.0f) + 2.5f) * sp64) + 2.5f;
if (Rand_ZeroOne() < 0.5f) {
this->shapeRotTargetX =
@ -1778,7 +1778,7 @@ void Boss03_Stunned(Boss03* this, PlayState* play) {
this->actor.shape.rot.x = this->actor.world.rot.x;
Math_ApproachF(&this->actor.world.pos.y, 100.0f, 0.05f, 5.0f);
Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f);
Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 1.5f);
Actor_MoveWithoutGravityReverse(&this->actor);
}
@ -2511,13 +2511,13 @@ void Boss03_SeaweedUpdate(Actor* thisx, PlayState* play) {
yDiff = player->actor.world.pos.y - this->seaweedSegmentPositions[i].y;
zDiff = player->actor.world.pos.z - this->seaweedSegmentPositions[i].z;
distanceBetweenSeaweedAndDisturbance = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff));
disturbanceFactor = player->actor.speedXZ * 3.0f + 70.0f;
disturbanceFactor = player->actor.speed * 3.0f + 70.0f;
// Player is standing on ground
if (player->actor.bgCheckFlags & 1) {
maxBendSpeed = 0;
} else {
maxBendSpeed = player->actor.speedXZ * 16.0f;
maxBendSpeed = player->actor.speed * 16.0f;
if (maxBendSpeed > 0x1000) {
maxBendSpeed = 0x1000;
} else if (maxBendSpeed < 0x100) {
@ -2550,8 +2550,8 @@ void Boss03_SeaweedUpdate(Actor* thisx, PlayState* play) {
break;
}
maxBendSpeed = sGyorgBossInstance->actor.speedXZ * 16.0f;
disturbanceFactor = sGyorgBossInstance->actor.speedXZ * 5.0f + 150.0f;
maxBendSpeed = sGyorgBossInstance->actor.speed * 16.0f;
disturbanceFactor = sGyorgBossInstance->actor.speed * 5.0f + 150.0f;
if (maxBendSpeed > 0x1000) {
maxBendSpeed = 0x1000;
} else if (maxBendSpeed < 0x100) {

View File

@ -431,7 +431,7 @@ void func_809ECD18(Boss04* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 0x200);
this->actor.world.pos.y = (this->actor.floorHeight + KREG(17) + 160.0f) + (Math_SinS(this->unk_1F4 * 512) * 10.0f);
Math_ApproachF(&this->actor.speedXZ, this->unk_6D4, 1.0f, 0.5f);
Math_ApproachF(&this->actor.speed, this->unk_6D4, 1.0f, 0.5f);
if (this->unk_1F8 == 0) {
this->unk_1F8 = Rand_ZeroFloat(100.0f) + 50.0f;
@ -460,7 +460,7 @@ void func_809ECEF4(Boss04* this) {
this->unk_1F8 = 0;
this->unk_1F6 = 1;
this->unk_1FA = 60;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = -3.0f;
}
@ -477,7 +477,7 @@ void func_809ECF58(Boss04* this, PlayState* play) {
this->actor.world.rot.y = BINANG_ROT180((s16)Rand_ZeroFloat(8000.0f) + this->actor.world.rot.y);
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.bgCheckFlags & 8) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
@ -496,7 +496,7 @@ void func_809ECF58(Boss04* this, PlayState* play) {
if (this->unk_6F4 == 0) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 5, 0x1000);
if (this->unk_1FA == 0) {
Math_ApproachF(&this->actor.speedXZ, 20.0f, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, 20.0f, 1.0f, 1.0f);
sp3C.x = this->actor.world.pos.x;
sp3C.y = this->actor.floorHeight + 2.0f;
sp3C.z = this->actor.world.pos.z;
@ -517,7 +517,7 @@ void func_809ED224(Boss04* this) {
this->actionFunc = func_809ED2A0;
this->unk_1F8 = 60;
this->unk_1FA = 100;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2D0 = 10000.0f;
this->unk_2C8 = 200;
Actor_PlaySfx(&this->actor, NA_SE_EN_ME_DEAD);

View File

@ -313,7 +313,7 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) {
break;
case 4:
this->actor.speedXZ =
this->actor.speed =
play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->urot.z * 0.005493164f;
if (this->unk_3EC < this->unk_3E8->count) {
if (func_80C16818(this)) {

View File

@ -90,15 +90,15 @@ void func_80AB1FDC(DmChar09* this, PlayState* play) {
phi_fv0 = this->speed;
phi_fa0 = this->speed * 0.16f;
}
Math_StepToF(&thisx->speedXZ, phi_fv0, phi_fa0);
if ((thisx->speedXZ + 0.05f) < sp54) {
Math_Vec3f_Scale(&thisx->velocity, thisx->speedXZ / sp54);
Math_StepToF(&thisx->speed, phi_fv0, phi_fa0);
if ((thisx->speed + 0.05f) < sp54) {
Math_Vec3f_Scale(&thisx->velocity, thisx->speed / sp54);
thisx->world.pos.x += thisx->velocity.x;
thisx->world.pos.y += thisx->velocity.y;
thisx->world.pos.z += thisx->velocity.z;
} else {
this->unk_21C += this->unk_220;
thisx->speedXZ *= 0.4f;
thisx->speed *= 0.4f;
phi_a1 = true;
if (((this->unk_21C >= this->unk_218) && (this->unk_220 > 0)) ||
((this->unk_21C <= 0) && (this->unk_220 < 0))) {

View File

@ -278,7 +278,7 @@ void func_80BA1CF8(ElfMsg6* this, PlayState* play) {
if ((this->actor.textId == 0x224) && CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) {
this->actor.textId = 0x25B;
} else if (func_80BA1C00(this) && (player->actor.speedXZ > 1.0f)) {
} else if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) {
player->tatlTextId = -this->actor.textId;
ActorCutscene_SetIntentToPlay(0x7C);
sp20->elfMsg = &this->actor;
@ -319,7 +319,7 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) {
return;
}
if (func_80BA1C00(this) && (player->actor.speedXZ > 1.0f)) {
if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) {
player->tatlTextId = -this->actor.textId;
ActorCutscene_SetIntentToPlay(0x7C);
sp20->elfMsg = &this->actor;

View File

@ -129,10 +129,10 @@ static InitChainEntry sInitChain[] = {
};
void func_80BECBE0(EnAkindonuts* this, s16 arg1) {
f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speedXZ;
f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speed;
this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * sp24;
this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speedXZ;
this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speed;
this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * sp24;
if (arg1) {
@ -1561,9 +1561,9 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) {
if (this->unk_334 >= 3) {
sp32 = true;
}
Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 1.5f, 0.2f, 1.0f);
} else {
Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f);
}
func_80BECBE0(this, sp32);

View File

@ -265,21 +265,21 @@ void EnAm_ApplyEnemyTexture(EnAm* this, PlayState* play) {
void func_808B0208(EnAm* this, PlayState* play) {
// If the armos is against a wall, rotate and turn away from it
if ((this->actor.speedXZ > 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed > 0.0f) && (this->actor.bgCheckFlags & 8)) {
this->actor.world.rot.y = (this->actor.wallYaw * 2) - this->actor.world.rot.y;
this->actor.world.pos.x += this->actor.speedXZ * 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.x += this->actor.speed * Math_SinS(this->actor.world.rot.y);
this->actor.world.pos.z += this->actor.speed * Math_CosS(this->actor.world.rot.y);
}
SkelAnime_Update(&this->skelAnime);
if (Animation_OnFrame(&this->skelAnime, 8.0f) != 0) {
this->actor.speedXZ = this->speed;
this->actor.speed = this->speed;
this->actor.velocity.y = 12.0f;
} else if (this->skelAnime.curFrame > 11.0f) {
if (!(this->actor.bgCheckFlags & 1)) {
this->skelAnime.curFrame = 11.0f;
} else {
Math_ScaledStepToS(&this->actor.world.rot.y, this->armosYaw, 0x1F40);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.bgCheckFlags & 2) {
EnAm_SpawnEffects(this, play);
}
@ -293,7 +293,7 @@ void func_808B0208(EnAm* this, PlayState* play) {
void func_808B0358(EnAm* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
this->explodeTimer = 3;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->speed = 6.0f;
this->actionFunc = func_808B03C0;
@ -382,7 +382,7 @@ void EnAm_TakeDamage(EnAm* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gArmosTakeDamageAnim, 1.0f, 4.0f,
Animation_GetLastFrame(&gArmosTakeDamageAnim) - 6, ANIMMODE_ONCE, 0.0f);
func_800BE504(&this->actor, &this->enemyCollider);
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gArmosTakeDamageAnim) - 10);
Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE);
this->enemyCollider.base.acFlags &= ~AC_ON;
@ -391,7 +391,7 @@ void EnAm_TakeDamage(EnAm* this, PlayState* play) {
}
void func_808B07A8(EnAm* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (SkelAnime_Update(&this->skelAnime)) {
if (this->actor.colChkInfo.health == 0) {
func_808B0820(this);
@ -407,7 +407,7 @@ void func_808B0820(EnAm* this) {
this->explodeTimer = 64;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.flags |= ACTOR_FLAG_10;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->speed = 6.0f;
this->actionFunc = func_808B0894;
}
@ -451,12 +451,12 @@ void func_808B0894(EnAm* this, PlayState* play) {
void func_808B0AD0(EnAm* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gArmosPushedBackAnim, 1.0f, 0.0f, 8.0f, ANIMMODE_ONCE, 0.0f);
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = -6.0f;
this->actor.speed = -6.0f;
this->actionFunc = func_808B0B4C;
}
void func_808B0B4C(EnAm* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (SkelAnime_Update(&this->skelAnime)) {
func_808B0358(this);
}

View File

@ -225,7 +225,7 @@ void func_8088A7D8(PlayState* play, EnArrow* this) {
this->actionFunc = func_8088B6B0;
Animation_PlayOnce(&this->arrow.skelAnime, &gameplay_keep_Anim_012860);
this->actor.world.rot.y += (s32)(0x6000 * (Rand_ZeroOne() - 0.5f)) + 0x8000;
this->actor.speedXZ *= 0.02f + (0.02f * Rand_ZeroOne());
this->actor.speed *= 0.02f + (0.02f * Rand_ZeroOne());
this->actor.gravity = -1.5f;
this->unk_260 = 50;
this->unk_263 = 1;
@ -375,7 +375,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
if (this->actor.params == ENARROW_8) {
R_TRANS_FADE_FLASH_ALPHA_STEP = -1;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_FIRE1, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, this->actor.speedXZ == 0.0f);
this->actor.world.pos.z, 0, 0, 0, this->actor.speed == 0.0f);
sp82 = NA_SE_IT_DEKU;
} else {
sp82 = NA_SE_IT_SLING_REFLECT;
@ -396,7 +396,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
Math_Vec3f_Diff(&sp7C->world.pos, &this->actor.world.pos, &this->unk_268);
sp7C->flags |= ACTOR_FLAG_8000;
this->collider.base.atFlags &= ~AT_HIT;
this->actor.speedXZ *= 0.5f;
this->actor.speed *= 0.5f;
this->actor.velocity.y *= 0.5f;
} else {
this->unk_261 |= 1;
@ -424,9 +424,9 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
func_8088AA98(this, play);
if (this->actor.params == ENARROW_7) {
if (this->bubble.unk_149 == 0) {
sp78 = sqrtf(SQ(this->actor.speedXZ) + SQ(this->actor.velocity.y));
sp74 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
temp_f12_2 = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
sp78 = sqrtf(SQ(this->actor.speed) + SQ(this->actor.velocity.y));
sp74 = Math_SinS(this->actor.world.rot.y) * this->actor.speed;
temp_f12_2 = Math_CosS(this->actor.world.rot.y) * this->actor.speed;
this->actor.prevPos.x = this->actor.world.pos.x - (sp74 * (10.0f / sp78));
this->actor.prevPos.y = this->actor.world.pos.y - (this->actor.velocity.y * (10.0f / sp78));
@ -456,7 +456,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos);
if (this->actor.speedXZ == 0.0f) {
if (this->actor.speed == 0.0f) {
this->actor.velocity.y -= 1.0f;
if (this->actor.velocity.y < this->actor.terminalVelocity) {
this->actor.velocity.y = this->actor.terminalVelocity;
@ -474,7 +474,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
}
if (this->actor.params < ENARROW_6) {
this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speedXZ, -this->actor.velocity.y);
this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speed, -this->actor.velocity.y);
}
}
@ -641,7 +641,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
&this->actor, this->actor.projectedPos.z < 160.0f ? 0 : 1);
} else if (this->actor.params == ENARROW_7) {
s32 spA4 = 255 - (s32)(this->bubble.unk_144 * 4.0f);
f32 spA0 = (this->actor.speedXZ * 0.1f) + 1.0f;
f32 spA0 = (this->actor.speed * 0.1f) + 1.0f;
f32 sp9C = (1.0f / spA0);
OPEN_DISPS(play->state.gfxCtx);
@ -659,7 +659,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
MTXMODE_APPLY);
Matrix_Translate(0.0f, 0.0f, 460.0f, MTXMODE_APPLY);
if (this->actor.speedXZ == 0.0f) {
if (this->actor.speed == 0.0f) {
func_800B8118(&this->actor, play, MTXMODE_NEW);
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_06F380);
@ -687,7 +687,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
return;
} else if (this->actor.speedXZ != 0.0f) {
} else if (this->actor.speed != 0.0f) {
u8 sp63 = (Math_CosS(this->unk_260 * 5000) * 127.5f) + 127.5f;
f32 sp5C;
@ -710,7 +710,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
Matrix_Push();
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
if (this->actor.speedXZ == 0.0f) {
if (this->actor.speed == 0.0f) {
phi_v0 = 0;
} else {
phi_v0 = (play->gameplayFrames % 256) * 4000;

View File

@ -213,7 +213,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) {
Vec3f flightTarget;
s32 pad;
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
// randomTargetCenterOffset is set in _Init, only needs to be set once
// but the view is moving, so now we need to re-calculate the spot in space
@ -314,7 +314,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRotY, 2, this->rotStep, 0);
Math_SmoothStepToS(&this->actor.world.rot.x, this->targetRotX, 2, this->rotStep, 0);
Math_ApproachF(&this->rotStep, 10000.0f, 1.0f, 1000.0f);
Math_ApproachF(&this->actor.speedXZ, this->targetXZSpeed, 0.9f, 1.0f);
Math_ApproachF(&this->actor.speed, this->targetXZSpeed, 0.9f, 1.0f);
if (this->actor.gravity == -2.0f && this->unkTimer25A == 0 &&
(this->actor.bgCheckFlags & 8 || this->randomAngleChangeTimer == 0)) {

View File

@ -437,9 +437,9 @@ s32 func_80A95534(PlayState* play, ActorPathing* actorPathing) {
this->unk_36C = actorPathing->distSqToCurPointXZ;
}
}
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_36C, 0.8f, 2.0f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, this->unk_36C, 0.8f, 2.0f, 0.0f);
actorPathing->moveFunc = SubS_ActorPathing_MoveWithGravity;
if (actorPathing->distSqToCurPointXZ <= this->actor.speedXZ) {
if (actorPathing->distSqToCurPointXZ <= this->actor.speed) {
ret = true;
}
return ret;
@ -454,11 +454,11 @@ s32 func_80A9565C(PlayState* play, ActorPathing* actorPathing) {
actorPathing->moveFunc = func_80A94A90;
this->unk_374 |= 0x2000;
temp_f0 = func_80A954AC(this);
if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speedXZ)) || (temp_f0 <= 0.0f)) {
if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speed)) || (temp_f0 <= 0.0f)) {
ret = true;
} else {
this->unk_39E = this->actor.world.rot.x =
Math_Atan2S(-this->actor.velocity.y, Math_CosS(-this->actor.world.rot.x) * this->actor.speedXZ);
Math_Atan2S(-this->actor.velocity.y, Math_CosS(-this->actor.world.rot.x) * this->actor.speed);
}
return ret;
}
@ -474,10 +474,10 @@ s32 func_80A95730(PlayState* play, ActorPathing* actorPathing) {
this->actor.gravity = 0.0f;
temp_f0 = func_80A954AC(this);
if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speedXZ)) || (temp_f0 <= 0.0f)) {
if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speed)) || (temp_f0 <= 0.0f)) {
ret = true;
} else {
sp40 = SQ(this->actor.speedXZ) / actorPathing->distSqToCurPoint;
sp40 = SQ(this->actor.speed) / actorPathing->distSqToCurPoint;
sp34 = ABS(actorPathing->rotToCurPoint.x - this->actor.world.rot.x);
sp3C = (s32)(sp34 * sp40) + 0xAAA;
@ -521,12 +521,12 @@ s32 func_80A958B0(PlayState* play, ActorPathing* actorPathing) {
} else {
Math_SmoothStepToF(&this->unk_36C, 26.0f, 0.5f, 1.0f, 0.01f);
}
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_36C, 0.8f, 2.0f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, this->unk_36C, 0.8f, 2.0f, 0.0f);
temp1 = func_80A954AC(this);
if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speedXZ)) || (temp1 <= 0.0f)) {
if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speed)) || (temp1 <= 0.0f)) {
ret = true;
} else {
sp3C = SQ(this->actor.speedXZ) / actorPathing->distSqToCurPoint;
sp3C = SQ(this->actor.speed) / actorPathing->distSqToCurPoint;
sp30 = ABS(actorPathing->rotToCurPoint.x - this->actor.world.rot.x);
sp2C = (s32)(sp30 * sp3C) + 0xAAA;
sp30 = ABS(actorPathing->rotToCurPoint.y - this->actor.world.rot.y);
@ -608,7 +608,7 @@ void func_80A95DA0(EnAz* this, PlayState* play) {
SubS_ActorPathing_Init(play, &this->actor.world.pos, &this->actor, sp40, play->setupPathList,
BEAVER_GET_PARAM_FF(&this->actor), 0, 0, 1, 1);
this->unk_36C = 4.0f;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
this->actor.gravity = 0.0f;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_SWIM_WITH_SPINNING_TAIL,
&this->animIndex);
@ -665,7 +665,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_IDLE, &this->animIndex);
this->unk_374 &= ~0x1000;
this->actor.gravity = -1.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 3, 0x1000, 0x100);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1038, 0x100);
if (this->actor.bgCheckFlags & 1) {
@ -1510,7 +1510,7 @@ void func_80A97EAC(EnAz* this, PlayState* play) {
SubS_ActorPathing_Init(play, &this->actor.world.pos, &this->actor, &this->unk_300, play->setupPathList,
BEAVER_GET_PARAM_FF(&this->actor), 0, 0, 1, 0);
this->unk_36C = 8.0f;
this->actor.speedXZ = 8.0f;
this->actor.speed = 8.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 6.0f;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_SWIM_WITH_SPINNING_TAIL,
@ -1554,7 +1554,7 @@ void func_80A97F9C(EnAz* this, PlayState* play) {
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
func_80A979DC(this, play);
} else {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) {
@ -1798,7 +1798,7 @@ void EnAz_Draw(Actor* thisx, PlayState* play2) {
CLOSE_DISPS(play->state.gfxCtx);
}
OPEN_DISPS(play->state.gfxCtx);
if ((this->actor.depthInWater >= 28.0f) && (this->actor.speedXZ > 0.5f)) {
if ((this->actor.depthInWater >= 28.0f) && (this->actor.speed > 0.5f)) {
Matrix_Translate(this->unk_3B4.x, this->unk_3B4.y, this->unk_3B4.z, MTXMODE_NEW);
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY);

View File

@ -320,8 +320,8 @@ s32 EnBaba_MoveForward(EnBaba* this, f32 speedTarget) {
s32 reachedEnd = false;
Vec3f point;
Math_SmoothStepToF(&this->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = this->actor.speedXZ * 400.0f;
Math_SmoothStepToF(&this->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = this->actor.speed * 400.0f;
if (SubS_CopyPointFromPath(this->path, this->waypoint, &point) &&
SubS_MoveActorToPoint(&this->actor, &point, rotStep)) {
this->waypoint++;
@ -485,7 +485,7 @@ void EnBaba_HandleSchedule(EnBaba* this, PlayState* play) {
this->animIndex = BOMB_SHOP_LADY_ANIM_KNOCKED_OVER;
// Ouch
this->textId = 0x2A30;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Enemy_StartFinishingBlow(play, &this->actor);
this->stateFlags |= BOMB_SHOP_LADY_STATE_KNOCKED_OVER;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);

View File

@ -244,17 +244,17 @@ void EnBaguo_Roll(EnBaguo* this, PlayState* play) {
this->timer = 100;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnBaguo_Idle;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
if (!this->bouncedFlag && this->collider.base.atFlags & AT_BOUNCED) {
this->zRollDirection ^= 1;
this->bouncedFlag = 1;
this->actor.speedXZ = -7.0f;
this->actor.speed = -7.0f;
}
Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f);
Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f);
Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 0.5f);
Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 0.5f);
this->actor.world.rot.x += (s16)this->currentRotation.x;
if (this->currentRotation.z != 0.0f) {
@ -272,7 +272,7 @@ void EnBaguo_Roll(EnBaguo* this, PlayState* play) {
void EnBaguo_SetupRetreatUnderground(EnBaguo* this) {
this->action = NEJIRON_ACTION_RETREATING;
this->actionFunc = EnBaguo_RetreatUnderground;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play) {
@ -330,7 +330,7 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, PlayState* play) {
if (i || this->actor.colChkInfo.damageEffect == NEJIRON_DMGEFF_KILL) {
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->action = NEJIRON_ACTION_EXPLODING;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.shape.shadowScale = 0.0f;
for (i = 0; i < ARRAY_COUNT(this->effects); i++) {

View File

@ -203,7 +203,7 @@ void EnBat_SetupPerch(EnBat* this) {
this->collider.dim.worldSphere.center.x = this->actor.focus.pos.x;
this->collider.dim.worldSphere.center.y = this->actor.focus.pos.y;
this->collider.dim.worldSphere.center.z = this->actor.focus.pos.z;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnBat_Perch;
}
@ -214,7 +214,7 @@ void EnBat_Perch(EnBat* this, PlayState* play) {
void EnBat_SetupFlyIdle(EnBat* this) {
this->timer = 100;
this->collider.base.acFlags |= AC_ON;
this->actor.speedXZ = 3.5f;
this->actor.speed = 3.5f;
this->actionFunc = EnBat_FlyIdle;
}
@ -262,7 +262,7 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) {
void EnBat_SetupDiveAttack(EnBat* this) {
this->collider.base.atFlags |= AT_ON;
this->timer = 300;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
sNumberAttacking++;
this->actionFunc = EnBat_DiveAttack;
}
@ -317,7 +317,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) {
void EnBat_SetupDie(EnBat* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_1;
Enemy_StartFinishingBlow(play, &this->actor);
this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x);
this->actor.speed *= Math_CosS(this->actor.world.rot.x);
this->actor.bgCheckFlags &= ~1;
this->actor.velocity.y = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD);
@ -343,7 +343,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40);
if (this->actor.flags & ACTOR_FLAG_8000) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
this->collider.base.acFlags &= ~AC_ON;
@ -352,7 +352,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) {
}
void EnBat_Die(EnBat* 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;
if (!(this->actor.flags & ACTOR_FLAG_8000)) { // Carried by arrow
@ -397,7 +397,7 @@ void EnBat_SetupStunned(EnBat* this) {
if (this->actionFunc != EnBat_Stunned) {
this->actor.shape.yOffset = 700.0f;
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.pos.y += 13.0f;
}
Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE);

View File

@ -216,7 +216,7 @@ void EnBb_UpdateStateForFlying(EnBb* this) {
Math_StepToF(&this->flameScaleY, 0.8f, 0.1f);
Math_StepToF(&this->flameScaleX, 1.0f, 0.1f);
EnBb_CheckForWall(this);
Math_StepToF(&this->actor.speedXZ, this->maxSpeed, 0.5f);
Math_StepToF(&this->actor.speed, this->maxSpeed, 0.5f);
Math_ApproachS(&this->actor.shape.rot.y, this->targetYRotation, 5, 0x3E8);
this->actor.world.rot.y = this->actor.shape.rot.y;
}
@ -309,7 +309,7 @@ void EnBb_SetupDown(EnBb* this) {
this->collider.base.atFlags |= AT_ON;
this->timer = 140;
this->collider.base.acFlags |= AC_ON;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
this->flameScaleY = 0.0f;
this->flameScaleX = 0.0f;
this->actor.gravity = -2.0f;
@ -363,11 +363,11 @@ void EnBb_SetupDead(EnBb* this, PlayState* play) {
func_800BE568(&this->actor, &this->collider);
this->timer = 15;
this->actor.shape.rot.x += 0x4E20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_BUBLE_DEAD);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x70);
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->bodyPartDrawStatus = BB_BODY_PART_DRAW_STATUS_DEAD;
this->actor.gravity = -1.5f;
@ -422,12 +422,12 @@ void EnBb_SetupDamage(EnBb* this) {
this->drawDmgEffScale = 0.4f;
} else if (this->actor.colChkInfo.damageEffect == EN_BB_DMGEFF_STUN) {
Actor_SetColorFilter(&this->actor, 0, 255, 0, 20);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else if (this->actor.colChkInfo.damageEffect == EN_BB_DMGEFF_HOOKSHOT) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20);
this->actor.speedXZ = 7.0f;
this->actor.speed = 7.0f;
}
this->actor.gravity = -1.0f;
@ -435,14 +435,14 @@ void EnBb_SetupDamage(EnBb* this) {
}
void EnBb_Damage(EnBb* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ < 0.1f)) {
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) {
EnBb_SetupDown(this);
}
}
void EnBb_SetupFrozen(EnBb* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}
@ -472,7 +472,7 @@ void EnBb_SetupWaitForRevive(EnBb* this) {
this->actor.shape.rot.x = 0;
this->actor.world.pos.y += 50.0f;
this->timer = 200;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
this->actionFunc = EnBb_WaitForRevive;

View File

@ -273,7 +273,7 @@ void EnBbfall_SetupWaitForPlayer(EnBbfall* this) {
this->actor.colChkInfo.health = sColChkInfoInit.health;
this->actor.colorFilterTimer = 0;
this->isBgCheckCollisionEnabled = false;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
@ -323,7 +323,7 @@ void EnBbfall_SetupFly(EnBbfall* this) {
this->flameOpacity = 255;
this->isBgCheckCollisionEnabled = true;
this->actor.bgCheckFlags &= ~1;
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->actor.gravity = -1.0f;
this->actionFunc = EnBbfall_Fly;
}
@ -372,7 +372,7 @@ void EnBbfall_SetupDown(EnBbfall* this) {
this->timer = 200;
this->flameOpacity = 0;
this->collider.base.acFlags |= AC_ON;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
this->flameScaleY = 0.0f;
this->flameScaleX = 0.0f;
this->actor.gravity = -2.0f;
@ -430,11 +430,11 @@ void EnBbfall_SetupDead(EnBbfall* this, PlayState* play) {
func_800BE5CC(&this->actor, &this->collider, 0);
this->timer = 15;
this->actor.shape.rot.x += 0x4E20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_BUBLE_DEAD);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x70);
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->bodyPartDrawStatus = BBFALL_BODY_PART_DRAW_STATUS_DEAD;
this->actor.gravity = -1.5f;
@ -488,20 +488,20 @@ void EnBbfall_SetupDamage(EnBbfall* this) {
this->drawDmgEffScale = 0.4f;
} else if (this->actor.colChkInfo.damageEffect == EN_BBFALL_DMGEFF_STUN) {
Actor_SetColorFilter(&this->actor, 0, 255, 0, 20);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else if (this->actor.colChkInfo.damageEffect == EN_BBFALL_DMGEFF_HOOKSHOT) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20);
this->actor.speedXZ = 7.0f;
this->actor.speed = 7.0f;
}
this->actionFunc = EnBbfall_Damage;
}
void EnBbfall_Damage(EnBbfall* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ < 0.1f)) {
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) {
if (EnBbfall_IsTouchingLava(this, play)) {
EnBbfall_SetupSinkIntoLava(this);
} else {
@ -511,7 +511,7 @@ void EnBbfall_Damage(EnBbfall* this, PlayState* play) {
}
void EnBbfall_SetupFrozen(EnBbfall* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}

View File

@ -173,7 +173,7 @@ void EnBee_FlyIdle(EnBee* this, PlayState* play) {
}
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &nextPos), 1, 0x7D0, 0);
Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.3f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.0f, 0.3f, 1.0f);
if ((this->attackDelayTimer == 0) && (this->actor.params != BEE_BEHAVIOR_IDLE)) {
EnBee_SetupAttack(this);
@ -227,7 +227,7 @@ void EnBee_Attack(EnBee* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &nextPos), 1, 0x1388, 0);
Math_ApproachF(&this->actor.world.pos.y, nextPos.y, 0.3f, 3.0f);
Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f);
Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 1.0f);
}
void EnBee_UpdateDamage(EnBee* this, PlayState* play) {
@ -238,7 +238,7 @@ void EnBee_UpdateDamage(EnBee* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
Enemy_StartFinishingBlow(play, &this->actor);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_CUTBODY);
this->actor.colChkInfo.health = 0;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT);

View File

@ -52,7 +52,7 @@ void func_80C22DEC(EnBh* this, PlayState* play) {
s16 yRot;
s16 zRot;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
xDiff = this->pos.x - this->actor.world.pos.x;
yDiff = this->pos.y - this->actor.world.pos.y;
zDiff = this->pos.z - this->actor.world.pos.z;

View File

@ -408,7 +408,7 @@ void func_80A282C8(EnBigpamet* this, PlayState* play) {
void func_80A28378(EnBigpamet* this) {
this->actor.parent->params = GEKKO_INIT_SNAPPER;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80A283A0;
}
@ -421,7 +421,7 @@ void func_80A283A0(EnBigpamet* this, PlayState* play) {
void func_80A283F0(EnBigpamet* this) {
Animation_PlayLoop(&this->skelAnime2, &object_tl_Anim_00823C);
this->actor.speedXZ = 1.0f;
this->actor.speed = 1.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.params = ENBIGPAMET_1;
this->actionFunc = func_80A2844C;
@ -435,7 +435,7 @@ void func_80A2844C(EnBigpamet* this, PlayState* play) {
0x400);
this->actor.world.rot.y = this->actor.shape.rot.y;
} else if (this->actor.parent->params == GEKKO_JUMP_ON_SNAPPER) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else if (this->actor.parent->params == GEKKO_ON_SNAPPER) {
func_80A28E40(this);
}
@ -446,7 +446,7 @@ void func_80A284E4(EnBigpamet* this) {
this->unk_29E = 0;
this->unk_2A8 = 1.0f;
this->unk_2A4 = 1.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_B_PAMET_VOICE);
Actor_PlaySfx(this->actor.parent, NA_SE_EN_FROG_VOICE1);
this->actionFunc = func_80A2855C;
@ -468,7 +468,7 @@ void func_80A2855C(EnBigpamet* this, PlayState* play) {
void func_80A28618(EnBigpamet* this) {
this->actor.draw = func_80A2966C;
this->unk_2A8 = 0.5f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_ON);
this->actionFunc = func_80A2866C;
}
@ -499,7 +499,7 @@ void func_80A28708(EnBigpamet* this, PlayState* play) {
}
void func_80A28760(EnBigpamet* this) {
this->actor.speedXZ = 15.0f;
this->actor.speed = 15.0f;
if (this->actor.bgCheckFlags & 8) {
s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.wallYaw;
@ -561,7 +561,7 @@ void func_80A28970(EnBigpamet* this) {
this->actor.shape.rot.z = 0;
this->collider.base.atFlags &= ~AT_ON;
this->collider.info.bumper.dmgFlags = 0xF7CFFFFF;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80A289C8;
}
@ -618,7 +618,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) {
this->collider.base.acFlags &= ~AC_ON;
this->actor.velocity.y = 22.0f;
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
if ((this->actor.draw == func_80A2966C) && (this->actionFunc != func_80A28DC0)) {
this->actor.draw = EnBigpamet_Draw;
@ -659,7 +659,7 @@ void func_80A28D0C(EnBigpamet* this, PlayState* play) {
void func_80A28D80(EnBigpamet* this) {
this->actor.draw = func_80A2966C;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.shape.rot.x = 0;
this->actor.shape.rot.z = 0;
this->unk_2A8 = 0.0f;
@ -681,7 +681,7 @@ void func_80A28DC0(EnBigpamet* this, PlayState* play) {
void func_80A28E40(EnBigpamet* this) {
Animation_MorphToPlayOnce(&this->skelAnime2, &object_tl_Anim_000440, -2.0f);
this->actor.flags |= ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80A28E98;
}

View File

@ -482,7 +482,7 @@ void EnBigpo_SetupWarpOut(EnBigpo* this) {
this->rotVelocity = 0x2000;
this->idleTimer = 32;
this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR);
this->actionFunc = EnBigpo_WarpingOut;
}
@ -556,7 +556,7 @@ void EnBigpo_IdleFlying(EnBigpo* this, PlayState* play) {
this->hoverHeightCycleTimer = (this->hoverHeightCycleTimer == 0) ? 40 : (this->hoverHeightCycleTimer - 1);
Math_StepToF(&this->savedHeight, player->actor.world.pos.y + 100.0f, 1.5f);
this->actor.world.pos.y = (sin_rad(this->hoverHeightCycleTimer * (M_PI / 20)) * 10.0f) + this->savedHeight;
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.2f);
Math_StepToF(&this->actor.speed, 3.0f, 0.2f);
func_800B9010(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->unk208 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -580,7 +580,7 @@ void EnBigpo_SetupSpinUp(EnBigpo* this) {
this->collider.base.atFlags |= AT_ON;
this->rotVelocity = 0x800;
this->actionFunc = EnBigpo_SpinningUp;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnBigpo_SpinningUp(EnBigpo* this, PlayState* play) {
@ -603,7 +603,7 @@ void EnBigpo_SpinAttack(EnBigpo* this, PlayState* play) {
s16 yawDiff;
SkelAnime_Update(&this->skelAnime);
Math_StepToF(&this->actor.speedXZ, 10.0f, 1.0f);
Math_StepToF(&this->actor.speed, 10.0f, 1.0f);
Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 0.3f, 7.5f, 1.0f);
EnBigpo_UpdateSpin(this);
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
@ -628,7 +628,7 @@ void EnBigpo_SpinningDown(EnBigpo* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 100.0f, 0.3f, 5.0f, 1.0f);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
if (Math_ScaledStepToS(&this->rotVelocity, 0, 0x200)) {
// spin down complete, re-allow hittable
this->collider.base.colType = COLTYPE_HIT3;
@ -649,14 +649,14 @@ void EnBigpo_HitStun(EnBigpo* this) {
this->collider.base.acFlags &= ~AC_ON;
func_800BE504(&this->actor, &this->collider);
this->actionFunc = EnBigpo_CheckHealth;
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
}
/*
* check if just damaged or dead
*/
void EnBigpo_CheckHealth(EnBigpo* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (SkelAnime_Update(&this->skelAnime)) {
if (this->actor.colChkInfo.health == 0) {
EnBigpo_SetupDeath(this);
@ -668,7 +668,7 @@ void EnBigpo_CheckHealth(EnBigpo* this, PlayState* play) {
void EnBigpo_SetupDeath(EnBigpo* this) {
this->idleTimer = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.hintId = TATL_HINT_ID_NONE;
this->collider.base.ocFlags1 &= ~OC1_ON;

View File

@ -1020,11 +1020,11 @@ void EnBigslime_SetupMoveOnCeiling(EnBigslime* this) {
this->actor.velocity.y = 20.0f;
if (this->subCamId != SUB_CAM_ID_DONE) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->ceilingMoveTimer = 20;
} else {
this->ceilingMoveTimer = 320;
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
}
this->wavySurfaceTimer = 0;
@ -1051,7 +1051,7 @@ void EnBigslime_MoveOnCeiling(EnBigslime* this, PlayState* play) {
} else if ((this->actor.xzDistToPlayer < 250.0f) || (this->ceilingMoveTimer == 0)) {
EnBigslime_SetupDrop(this);
} else {
this->actor.speedXZ = (fabsf(Math_SinS(pitch)) * 3.0f) + 5.0f;
this->actor.speed = (fabsf(Math_SinS(pitch)) * 3.0f) + 5.0f;
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 0x800, 0x80);
this->gekkoRot.y = this->actor.world.rot.y;
}
@ -1060,7 +1060,7 @@ void EnBigslime_MoveOnCeiling(EnBigslime* this, PlayState* play) {
void EnBigslime_SetupDrop(EnBigslime* this) {
this->actor.velocity.y = 0.0f;
this->ceilingDropTimer = 30;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnBigslime_Drop;
}
@ -1818,7 +1818,7 @@ void EnBigslime_SetupFreeze(EnBigslime* this) {
s32 i;
s32 j;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->freezeTimer = 40;
if (this->actor.bgCheckFlags & 1) {
this->actor.velocity.y = 0.0f;
@ -2026,7 +2026,7 @@ void EnBigslime_FrozenFall(EnBigslime* this, PlayState* play) {
void EnBigslime_SetupJumpGekko(EnBigslime* this) {
Animation_PlayLoop(&this->skelAnime, &gGekkoJumpForwardAnim);
this->actor.speedXZ = 8.0f;
this->actor.speed = 8.0f;
this->jumpTimer = 100;
this->actor.world.rot.y = this->gekkoRot.y;
this->gekkoYaw = this->actor.yawTowardsPlayer + 0x8000;
@ -2050,9 +2050,9 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) {
}
if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
this->actor.speedXZ = 8.0f;
this->actor.speed = 8.0f;
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
if (Math_SmoothStepToS(&this->actor.world.rot.y, this->gekkoYaw, 5, 0x1000, 0x80) == 0) {
@ -2087,7 +2087,7 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) {
void EnBigslime_SetupIdleLookAround(EnBigslime* this) {
Animation_PlayOnce(&this->skelAnime, &gGekkoNervousIdleAnim);
this->idleTimer = 60;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) {
this->gekkoYaw = this->gekkoRot.y + (Rand_Next() >> 20) + 0x2000;
} else {
@ -2144,7 +2144,7 @@ void EnBigslime_IdleNoticePlayer(EnBigslime* this, PlayState* play) {
void EnBigslime_SetupThrowMinislime(EnBigslime* this) {
Animation_PlayOnce(&this->skelAnime, &gGekkoWindupPunchAnim);
EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_HOLD_SLIME);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnBigslime_ThrowMinislime;
}
@ -2168,7 +2168,7 @@ void EnBigslime_SetupDamageGekko(EnBigslime* this, s32 isNotFrozen) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGekkoDamagedAnim, -3.0f);
this->gekkoCollider.base.acFlags &= ~AC_ON;
this->damageSpinTimer = 20;
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
this->actor.gravity = -2.0f;
this->actor.velocity.y = 0.0f;
if (isNotFrozen) {
@ -2192,7 +2192,7 @@ void EnBigslime_DamageGekko(EnBigslime* this, PlayState* play) {
this->damageSpinTimer--;
damageSpinTimer = CLAMP_MAX(this->damageSpinTimer, 10);
this->gekkoRot.y += 0x300 * damageSpinTimer;
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (this->damageSpinTimer == 0) {
EnBigslime_SetupCutscene(this);
}
@ -2205,7 +2205,7 @@ void EnBigslime_SetupStunGekko(EnBigslime* this) {
}
this->actionFunc = EnBigslime_StunGekko;
this->skelAnime.playSpeed = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnBigslime_StunGekko(EnBigslime* this, PlayState* play) {
@ -2227,7 +2227,7 @@ void EnBigslime_SetupCutsceneFormBigslime(EnBigslime* this) {
this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actionFunc = EnBigslime_CutsceneFormBigslime;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnBigslime_CutsceneFormBigslime(EnBigslime* this, PlayState* play) {
@ -2245,7 +2245,7 @@ void EnBigslime_SetupFormBigslime(EnBigslime* this) {
this->gekkoRot.x = 0x4000 - this->actor.world.rot.x;
this->formBigslimeTimer = 0;
this->wavySurfaceTimer = 0;
this->actor.speedXZ = 25.0f;
this->actor.speed = 25.0f;
this->gekkoRot.y = this->actor.world.rot.y;
this->formBigslimeCutsceneTimer = 2;
@ -2281,7 +2281,7 @@ void EnBigslime_FormBigslime(EnBigslime* this, PlayState* play) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_PlayLoop(&this->skelAnime, &gGekkoSwimForwardAnim);
this->formBigslimeCutsceneTimer--;
Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_COMBINE);
@ -2324,7 +2324,7 @@ void EnBigslime_SetupCutsceneDefeat(EnBigslime* this, PlayState* play) {
Animation_GetLastFrame(&gGekkoDamagedAnim.common), ANIMMODE_ONCE_INTERP, 0.0f);
this->gekkoCollider.base.acFlags &= ~AC_ON;
this->defeatTimer = 60;
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
this->actor.gravity = -2.0f;
this->actor.velocity.y = 0.0f;
EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_DEAD);
@ -2363,7 +2363,7 @@ void EnBigslime_CutsceneDefeat(EnBigslime* this, PlayState* play) {
this->defeatTimer--;
defeatTimer = CLAMP_MAX(this->defeatTimer, 10);
this->gekkoRot.y += 0x300 * defeatTimer;
if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f)) {
if (Math_StepToF(&this->actor.speed, 0.0f, 0.5f)) {
EnBigslime_SetupGekkoDespawn(this, play);
} else {
// Continue for the camera to follow Gekko as it spins in defeat
@ -2533,7 +2533,7 @@ void EnBigslime_SetupCutscene(EnBigslime* this) {
ActorCutscene_SetIntentToPlay(this->cutscene);
this->actionFuncStored = this->actionFunc;
this->actionFunc = EnBigslime_PlayCutscene;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnBigslime_PlayCutscene(EnBigslime* this, PlayState* play) {

View File

@ -209,7 +209,7 @@ void func_80871058(EnBom* this, PlayState* play) {
this->actor.velocity.y = -this->actor.velocity.y;
}
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) {
s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y);
if (ABS_ALT(yDiff) > 0x4000) {
@ -219,12 +219,12 @@ void func_80871058(EnBom* this, PlayState* play) {
Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND);
Actor_MoveWithGravity(&this->actor);
this->actor.speedXZ *= 0.7f;
this->actor.speed *= 0.7f;
this->actor.bgCheckFlags &= ~8;
}
if (!(this->actor.bgCheckFlags & 1)) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f);
Math_StepToF(&this->actor.speed, 0.0f, 0.08f);
} else {
Vec3f* sp58;
u32 sp54 = func_800C99D4(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
@ -251,33 +251,33 @@ void func_80871058(EnBom* this, PlayState* play) {
Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 1.0f, 700.0f);
}
sp40 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
sp3C = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
sp40 = Math_SinS(this->actor.world.rot.y) * this->actor.speed;
sp3C = Math_CosS(this->actor.world.rot.y) * this->actor.speed;
Actor_GetSlopeDirection(this->actor.floorPoly, &slopeNormal, &downwardSlopeYaw);
sp40 += 3.0f * slopeNormal.x;
sp3C += 3.0f * slopeNormal.z;
sp38 = sqrtf(SQ(sp40) + SQ(sp3C));
if ((sp38 < this->actor.speedXZ) ||
if ((sp38 < this->actor.speed) ||
(SurfaceType_GetSlope(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1)) {
if (sp38 > 16.0f) {
this->actor.speedXZ = 16.0f;
this->actor.speed = 16.0f;
} else {
this->actor.speedXZ = sp38;
this->actor.speed = sp38;
}
this->actor.world.rot.y = Math_Atan2S_XY(sp3C, sp40);
}
if (!Math_StepToF(&this->actor.speedXZ, 0.0f, sp58->x)) {
if (!Math_StepToF(&this->actor.speed, 0.0f, sp58->x)) {
s16 temp = this->actor.world.rot.y;
s32 pad;
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->actor.shape.rot.y)) > 0x4000) {
temp = BINANG_ROT180(temp);
}
Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speedXZ * 100.0f);
this->unk_1FA += (s16)(this->actor.speedXZ * 800.0f);
Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speed * 100.0f);
this->unk_1FA += (s16)(this->actor.speed * 800.0f);
}
if (this->actor.bgCheckFlags & 2) {
@ -444,7 +444,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) {
if (this->unk_1FC != 0) {
this->unk_1FC--;
Math_ApproachZeroF(&thisx->speedXZ, 1.0f, 1.0f);
Math_ApproachZeroF(&thisx->speed, 1.0f, 1.0f);
Actor_MoveWithGravity(thisx);
Actor_UpdateBgCheckInfo(play, thisx, 35.0f, 10.0f, 36.0f, 4);
if (this->unk_1FC == 0) {

View File

@ -184,7 +184,7 @@ void EnBomChu_WaitForRelease(EnBomChu* this, PlayState* play) {
func_800B8EF4(play, &this->actor);
this->isMoving = true;
this->actor.speedXZ = 8.0f;
this->actor.speed = 8.0f;
this->movingSpeed = 8.0f;
EnBomChu_SetupMove(this);
}
@ -233,7 +233,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
bgIdUpDown = bgIdSide = BGCHECK_SCENE;
isFloorPolyValid = false;
this->actor.speedXZ = this->movingSpeed;
this->actor.speed = this->movingSpeed;
lineLength = 2.0f * this->movingSpeed;
if ((this->timer == 0) || (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) {
@ -259,7 +259,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
isFloorPolyValid = EnBomChu_UpdateFloorPoly(this, polySide, play);
Math_Vec3f_Copy(&this->actor.world.pos, &posSide);
this->actor.floorBgId = bgIdSide;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
if (this->actor.floorPoly != polyUpDown) {
isFloorPolyValid = EnBomChu_UpdateFloorPoly(this, polyUpDown, play);
@ -269,7 +269,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
this->actor.floorBgId = bgIdUpDown;
}
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
lineLength *= 3.0f;
Math_Vec3f_Copy(&posA, &posB);
@ -316,8 +316,8 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) {
func_800B8F98(&this->actor, NA_SE_IT_BOMBCHU_MOVE - SFX_FLAG);
}
if (this->actor.speedXZ != 0.0f) {
this->movingSpeed = this->actor.speedXZ;
if (this->actor.speed != 0.0f) {
this->movingSpeed = this->actor.speed;
}
}
@ -336,7 +336,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) {
}
this->timer = 1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.depthInWater > 0.0f) {
for (i = 0; i < 40; i++) {
@ -441,7 +441,7 @@ void EnBomChu_HandleNonSceneCollision(EnBomChu* this, PlayState* play) {
isFloorPolyValid = EnBomChu_UpdateFloorPoly(this, poly, play);
Math_Vec3f_Copy(&this->actor.world.pos, &originalWorldPos);
this->actor.floorBgId = bgId;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (isFloorPolyValid) {
EnBomChu_UpdateRotation(this);

View File

@ -322,7 +322,7 @@ void func_80C0520C(EnBombers2* this, PlayState* play) {
if ((fabsf(this->unk_29C.x - this->actor.world.pos.x) < 3.0f) &&
(fabsf(this->unk_29C.z - this->actor.world.pos.z) < 3.0f)) {
this->unk_2B6 = this->actor.yawTowardsPlayer;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) < 100.0f) {
func_801477B4(play);
this->talkState = TEXT_STATE_5;

View File

@ -168,7 +168,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) {
} else if ((this->colliderCylinder.base.acFlags & AC_HIT) &&
((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x13828) ||
((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x200) &&
(player->transformation == PLAYER_FORM_GORON) && (player->actor.speedXZ > 15.0f)))) {
(player->transformation == PLAYER_FORM_GORON) && (player->actor.speed > 15.0f)))) {
this->colliderCylinder.base.acFlags &= ~AC_HIT;
if (this->colliderCylinder.base.ac->category != ACTORCAT_BOSS) {
bombf = (EnBombf*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOMBF, this->actor.world.pos.x,
@ -233,11 +233,11 @@ void func_808AEE3C(EnBombf* this, PlayState* play) {
this->unk_204 = 1.0f;
if (!(this->actor.bgCheckFlags & 1)) {
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);
return;
}
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 & 2) {
func_800B8EF4(play, &this->actor);
if (this->actor.velocity.y < -6.0f) {
@ -345,7 +345,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
this->actor.velocity.y = -this->actor.velocity.y;
}
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) {
s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y);
if (ABS_ALT(yDiff) > 0x4000) {
@ -357,7 +357,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
DREG(6) = 1;
Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 10.0f, 0.0f, 0x1F);
DREG(6) = 0;
this->actor.speedXZ *= 0.7f;
this->actor.speed *= 0.7f;
this->actor.bgCheckFlags &= ~8;
}

View File

@ -215,7 +215,7 @@ s32 func_80C012FC(EnBomjimb* this, PlayState* play) {
if (!Play_InCsMode(play) && (this->actor.xzDistToPlayer < 40.0f) &&
(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 50.0f) && (play->msgCtx.msgLength == 0)) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
func_80C02740(this, play);
return true;
}
@ -368,7 +368,7 @@ void func_80C01A24(EnBomjimb* this, PlayState* play) {
if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) {
((EnNiw*)this->unk_2E4)->unk2BC.z = 90000.0f;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2E4 = NULL;
this->actor.gravity = -2.0f;
func_80C02108(this);
@ -380,7 +380,7 @@ void func_80C01A24(EnBomjimb* this, PlayState* play) {
}
if (this->unk_2C0 != 0) {
Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.5f, 2.0f);
Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f);
}
if ((this->unk_2C0 != 0) && !(this->actor.bgCheckFlags & 1)) {
@ -395,13 +395,13 @@ void func_80C01B40(EnBomjimb* this) {
}
void func_80C01B74(EnBomjimb* this, PlayState* play) {
Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.5f, 2.0f);
Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f);
if ((this->collider.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) {
((EnNiw*)this->unk_2E4)->unk2BC.z = 90000.0f;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2E4 = NULL;
this->actor.gravity = -2.0f;
func_80C02108(this);
@ -419,7 +419,7 @@ void func_80C01C18(EnBomjimb* this, PlayState* play) {
this->unk_294.z = this->unk_2E4->world.pos.z;
}
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2CA = 2;
this->actionFunc = func_80C01CD0;
}
@ -553,7 +553,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) {
return;
}
Math_ApproachF(&this->actor.speedXZ, 8.0f, 0.5f, 2.0f);
Math_ApproachF(&this->actor.speed, 8.0f, 0.5f, 2.0f);
Math_Vec3f_Copy(&sp74, &this->actor.world.pos);
sp74.x += Math_SinS(this->actor.world.rot.y) * 50.0f;
@ -611,7 +611,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) {
void func_80C0250C(EnBomjimb* this) {
func_80C0113C(this, 15, 1.0f);
this->unk_2D4 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2D6 = BINANG_ROT180(this->actor.yawTowardsPlayer);
func_80C012E0(this);
this->unk_2CA = 6;
@ -640,7 +640,7 @@ void func_80C02570(EnBomjimb* this, PlayState* play) {
void func_80C0267C(EnBomjimb* this) {
func_80C012E0(this);
func_80C0113C(this, 8, 1.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->unk_2AE = 40;
this->unk_2C2 = 0;

View File

@ -241,7 +241,7 @@ void func_8091C794(EnButte* this, PlayState* play) {
s16 yaw;
func_8091C524(this);
Math_SmoothStepToF(&this->actor.speedXZ, sp4C->unk_04, sp4C->unk_08, sp4C->unk_0C, 0.0f);
Math_SmoothStepToF(&this->actor.speed, sp4C->unk_04, sp4C->unk_08, sp4C->unk_0C, 0.0f);
if (this->unk_24F == 1) {
distSq = SQ(100.0f);
@ -276,9 +276,8 @@ void func_8091C794(EnButte* this, PlayState* play) {
func_8091C6B4(this);
playSpeed =
(((this->actor.speedXZ * 0.5f) + (Rand_ZeroOne() * 0.2f)) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) +
((1.0f - Math_SinS(this->unk_256)) * 0.3f) + sp38;
playSpeed = (((this->actor.speed * 0.5f) + (Rand_ZeroOne() * 0.2f)) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) +
((1.0f - Math_SinS(this->unk_256)) * 0.3f) + sp38;
this->skelAnime.playSpeed = CLAMP(playSpeed, 0.2f, 1.5f);
SkelAnime_Update(&this->skelAnime);
@ -318,7 +317,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) {
s16 yaw;
func_8091C5EC(this);
Math_SmoothStepToF(&this->actor.speedXZ, sp5C->unk_04, sp5C->unk_08, sp5C->unk_0C, 0.0f);
Math_SmoothStepToF(&this->actor.speed, sp5C->unk_04, sp5C->unk_08, sp5C->unk_0C, 0.0f);
sp40 = 0.0f;
if ((this->unk_24E != 0) && (this->unk_24C < 12)) {
@ -344,7 +343,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) {
func_8091C6B4(this);
playSpeed = ((this->actor.speedXZ * 0.5f) + (Rand_ZeroOne() * 0.2f) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) +
playSpeed = ((this->actor.speed * 0.5f) + (Rand_ZeroOne() * 0.2f) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) +
((1.0f - Math_SinS(this->unk_256)) * 0.3f) + sp40;
this->skelAnime.playSpeed = CLAMP(playSpeed, 0.2f, 1.5f);
SkelAnime_Update(&this->skelAnime);
@ -356,7 +355,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) {
distSq = Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z);
if ((player->heldItemAction != PLAYER_IA_STICK) || !(fabsf(player->actor.speedXZ) < 1.8f) || (this->unk_252 > 0) ||
if ((player->heldItemAction != PLAYER_IA_STICK) || !(fabsf(player->actor.speed) < 1.8f) || (this->unk_252 > 0) ||
!(distSq < SQ(320.0f))) {
func_8091C748(this);
} else if ((distSq > SQ(240.0f)) &&

View File

@ -549,7 +549,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) {
player->actor.world.pos.z = -950.0f;
}
player->actor.speedXZ = 0.0f;
player->actor.speed = 0.0f;
if (this->activeTimer == 0) {
this->cameraState = 1;
}
@ -578,7 +578,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) {
player->actor.world.pos.z = -950.0f;
}
player->actor.speedXZ = 0.0f;
player->actor.speed = 0.0f;
if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) {
mainCam = Play_GetCamera(play, CAM_ID_MAIN);
mainCam->eye = this->subCamEye;

View File

@ -117,10 +117,10 @@ void func_80AFDE00(EnColMan* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.params == EN_COL_MAN_HEART_PIECE) {
this->actor.params = EN_COL_MAN_RECOVERY_HEART;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
this->actor.velocity.y = 8.0f;
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
}
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_56_02)) {
@ -164,7 +164,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) {
if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) {
if (!this->hasSetRandomValues) {
this->actor.world.rot.y = randPlusMinusPoint5Scaled(30000.0f);
this->actor.speedXZ = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f);
this->actor.speed = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f);
this->actor.velocity.y = 12.0f + BREG(57) + Rand_ZeroFloat(5.0f);
this->hasSetRandomValues = true;
Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_ROCK);

View File

@ -163,7 +163,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
onInitialAnimFrame = 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.parent != NULL) && (this->actor.parent->home.rot.z == 0)) {
this->actor.home.pos.x = this->actor.parent->world.pos.x;
@ -233,7 +233,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
void EnCrow_SetupDiveAttack(EnCrow* this) {
this->timer = 300;
this->actionFunc = EnCrow_DiveAttack;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
this->skelAnime.playSpeed = 2.0f;
}
@ -295,7 +295,7 @@ void EnCrow_CheckIfFrozen(EnCrow* this, PlayState* play) {
void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) {
f32 scale;
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;
Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f);
this->actor.shape.yOffset = 0.0f;
@ -325,7 +325,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40);
if (this->actor.flags & ACTOR_FLAG_8000) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
this->collider.base.acFlags &= ~AC_ON;
@ -335,7 +335,7 @@ void EnCrow_SetupDamaged(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;
if (!(this->actor.flags & ACTOR_FLAG_8000)) {
@ -385,7 +385,7 @@ void EnCrow_Die(EnCrow* this, PlayState* play) {
void EnCrow_SetupTurnAway(EnCrow* this) {
this->timer = 100;
this->pitchTarget = -0x1000;
this->actor.speedXZ = 3.5f;
this->actor.speed = 3.5f;
this->yawTarget = this->actor.yawTowardsPlayer + 0x8000;
this->skelAnime.playSpeed = 2.0f;
if (this->actor.colChkInfo.damageEffect == GUAY_DMGEFF_STUN) {

View File

@ -838,7 +838,7 @@ void EnDekubaba_SetupPrunedSomersaultDie(EnDekubaba* this) {
this->actor.gravity = -0.8f;
this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000;
this->actor.speedXZ = this->size * 3.0f;
this->actor.speed = this->size * 3.0f;
this->collider.base.acFlags &= ~AC_ON;
this->actor.flags |= ACTOR_FLAG_10 | ACTOR_FLAG_20;
this->actionFunc = EnDekubaba_PrunedSomersaultDie;
@ -851,7 +851,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) {
f32 deltaY;
f32 deltaZ;
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) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
@ -865,7 +865,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) {
this->actor.scale.z = 0.0f;
this->actor.scale.y = 0.0f;
this->actor.scale.x = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f),
(s32)(this->size * 5.0f), 15, HAHEN_OBJECT_DEFAULT, 10, NULL);

View File

@ -411,7 +411,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) {
this->unk_18C = 1;
}
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_192, 1, 0xE38, 0xB6)) {
if (this->actor.bgCheckFlags & 0x20) {
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -435,7 +435,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) {
(fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f)) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.flags &= ~ACTOR_FLAG_20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
func_808BDC9C(this);
} else if (this->unk_190 == 0) {
func_808BE1CC(this);
@ -445,7 +445,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) {
void func_808BE1CC(EnDekunuts* this) {
Animation_PlayLoop(&this->skelAnime, &gDekuScrubPantingAnim);
this->unk_190 = 3;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_18D != 0) {
this->unk_18D--;
}
@ -468,7 +468,7 @@ void func_808BE22C(EnDekunuts* this, PlayState* play) {
void func_808BE294(EnDekunuts* this, s32 arg1) {
Animation_MorphToPlayOnce(&this->skelAnime, &gDekuScrubDamageAnim, -3.0f);
if (this->actor.params == ENDEKUNUTS_GET_FF00_0) {
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
if (arg1 != 0) {
func_800BE504(&this->actor, &this->collider);
}
@ -483,14 +483,14 @@ void func_808BE294(EnDekunuts* this, s32 arg1) {
}
void func_808BE358(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)) {
func_808BE484(this);
}
}
void func_808BE3A8(EnDekunuts* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}
@ -520,7 +520,7 @@ void func_808BE3FC(EnDekunuts* this, PlayState* play) {
void func_808BE484(EnDekunuts* this) {
Animation_PlayOnce(&this->skelAnime, &gDekuScrubDieAnim);
this->actionFunc = func_808BE4D4;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD);
}

View File

@ -338,15 +338,15 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) {
if ((this->index == ENDG_INDEX_SWAMP_SPIDER_HOUSE) ||
((this->index == ENDG_INDEX_ROMANI_RANCH) && (play->sceneId == SCENE_OMOYA))) {
Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f);
} else if (this->index == ENDG_INDEX_ROMANI_RANCH) {
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
} else if (play->sceneId == SCENE_CLOCKTOWER) {
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
} else if (sRacetrackDogInfo[this->index].textId & 0x11) {
Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f);
} else {
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
}
} else {
Actor_Kill(&this->actor);
@ -355,7 +355,7 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) {
void EnDg_SpawnFloorDustRing(EnDg* this, PlayState* play) {
s16 curFrame = this->skelAnime.curFrame;
s16 mod = (this->actor.speedXZ > 6.0f) ? 2 : 3;
s16 mod = (this->actor.speed > 6.0f) ? 2 : 3;
Vec3f pos;
if (((this->index + curFrame) % mod) == 0) {
@ -492,7 +492,7 @@ void EnDg_TryPickUp(EnDg* this, PlayState* play) {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN);
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (Player_GetMask(play) == PLAYER_MASK_TRUTH) {
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, play, 100.0f);
@ -620,7 +620,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
case PLAYER_FORM_ZORA:
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
if ((this->behavior != DOG_BEHAVIOR_ZORA) && (player->actor.speedXZ > 1.0f)) {
if ((this->behavior != DOG_BEHAVIOR_ZORA) && (player->actor.speed > 1.0f)) {
this->behavior = DOG_BEHAVIOR_ZORA;
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_ApproachPlayer;
@ -634,7 +634,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
case PLAYER_FORM_GORON:
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
if ((this->behavior != DOG_BEHAVIOR_GORON) && (player->actor.speedXZ > 1.0f)) {
if ((this->behavior != DOG_BEHAVIOR_GORON) && (player->actor.speed > 1.0f)) {
this->behavior = DOG_BEHAVIOR_GORON;
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS);
this->timer = 50;
@ -649,7 +649,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
case PLAYER_FORM_DEKU:
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
if ((this->behavior != DOG_BEHAVIOR_DEKU) && (player->actor.speedXZ > 1.0f)) {
if ((this->behavior != DOG_BEHAVIOR_DEKU) && (player->actor.speed > 1.0f)) {
this->behavior = DOG_BEHAVIOR_DEKU;
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_ApproachPlayerToAttack;
@ -733,7 +733,7 @@ void EnDg_BackAwayFromGoron(EnDg* this, PlayState* play) {
}
this->actor.world.rot.y = this->actor.shape.rot.y;
Math_ApproachF(&this->actor.speedXZ, -1.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, -1.5f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
}
@ -760,18 +760,18 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.y, yRotation, 4, 0x3E8, 1);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (player->actor.speedXZ != 0.0f) {
Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 0.2f, 1.0f);
if (player->actor.speed != 0.0f) {
Math_ApproachF(&this->actor.speed, player->actor.speed, 0.2f, 1.0f);
} else {
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
}
} else {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK);
this->actionFunc = EnDg_BarkAtGoron;
}
if (this->actor.speedXZ > 7.0f) {
this->actor.speedXZ = 7.0f;
if (this->actor.speed > 7.0f) {
this->actor.speed = 7.0f;
}
Actor_MoveWithGravity(&this->actor);
@ -811,7 +811,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer < 70.0f) {
Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 1.0f);
Math_ApproachZeroF(&this->actor.speed, 0.2f, 1.0f);
if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
s16 yawDiff = ABS_ALT(player->actor.shape.rot.y - this->actor.shape.rot.y);
@ -827,7 +827,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) {
}
} else {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00);
Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f);
}
Actor_MoveWithGravity(&this->actor);
@ -841,7 +841,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) {
*/
void EnDg_RunAfterAttacking(EnDg* this, PlayState* play) {
this->dogFlags &= ~DOG_FLAG_BOUNCED;
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.1f, 0.5f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.1f, 0.5f);
Actor_MoveWithGravity(&this->actor);
if (DECR(this->attackTimer) == 0) {
this->attackTimer = 20;
@ -893,7 +893,7 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
this->dogFlags |= DOG_FLAG_BOUNCED;
this->collider.base.atFlags &= ~AT_BOUNCED;
this->actor.speedXZ *= -1.0f;
this->actor.speed *= -1.0f;
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_RunAfterAttacking;
return;
@ -919,9 +919,9 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = 1.2f;
this->actor.velocity.y = 2.0f * rand + 3.0f;
this->actor.speedXZ = 8.0f + rand;
this->actor.speed = 8.0f + rand;
} else if (curFrame > 20) {
Math_ApproachF(&this->actor.speedXZ, 2.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 2.5f, 0.2f, 1.0f);
}
if (curFrame > 23) {
@ -949,7 +949,7 @@ void EnDg_WalkToPlayer(EnDg* this, PlayState* play) {
} else {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00);
this->actor.world.rot.y = this->actor.shape.rot.y;
Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
}
@ -996,12 +996,12 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) {
this->actionFunc = EnDg_SitNextToPlayer;
} else if (player->stateFlags3 & PLAYER_STATE3_20000000) {
if ((this->actor.xzDistToPlayer > 40.0f) && (player->linearVelocity == 0.0f)) {
Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 1.5f, 0.2f, 1.0f);
} else {
Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, player->actor.speed, 0.2f, 1.0f);
}
} else {
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
}
EnDg_CheckForBremenMaskMarch(this, play);
@ -1033,7 +1033,7 @@ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) {
}
this->actor.world.rot.y = this->actor.shape.rot.y;
Math_ApproachF(&this->actor.speedXZ, -1.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, -1.0f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
EnDg_PlaySfxWalk(this);
EnDg_PlaySfxGrowl(this, 4.0f);
@ -1059,7 +1059,7 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) {
}
this->actor.world.rot.y = this->actor.shape.rot.y;
Math_ApproachF(&this->actor.speedXZ, -2.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, -2.0f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
}
@ -1110,7 +1110,7 @@ void EnDg_SetupSwim(EnDg* this, PlayState* play) {
this->actionFunc = EnDg_Swim;
}
Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
}
@ -1183,13 +1183,13 @@ void EnDg_Swim(EnDg* this, PlayState* play) {
this->timer = Rand_S16Offset(60, 60);
Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
this->actionFunc = EnDg_IdleMove;
}
Math_SmoothStepToS(&this->actor.world.rot.y, yRotation, 4, 0x3E8, 1);
this->actor.shape.rot.y = this->actor.world.rot.y;
Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
}
@ -1230,9 +1230,9 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_IdleMove;
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f);
} else {
Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f);
}
Actor_MoveWithGravity(&this->actor);
@ -1266,7 +1266,7 @@ void EnDg_Thrown(EnDg* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK);
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = -3.0f;
if (player->transformation == PLAYER_FORM_HUMAN) {
EnDg_TryPickUp(this, play);

View File

@ -593,7 +593,7 @@ void func_8089B7B0(EnDinofos* this) {
Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_002E40, -4.0f);
this->unk_290 = (s32)Rand_ZeroFloat(20.0f) + 40;
this->unk_292 = 30;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
func_8089AD70(this);
this->actionFunc = func_8089B834;
@ -625,9 +625,9 @@ void func_8089B8B0(EnDinofos* this, PlayState* play) {
phi_f0 = 70.0f;
}
if (this->actor.xzDistToPlayer <= phi_f0) {
this->actor.speedXZ = -3.5f;
this->actor.speed = -3.5f;
} else {
this->actor.speedXZ = 3.5f;
this->actor.speed = 3.5f;
}
}
@ -650,9 +650,9 @@ void func_8089B98C(EnDinofos* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer <= phi_f0) {
Math_StepToF(&this->actor.speedXZ, -7.0f, 0.5f);
Math_StepToF(&this->actor.speed, -7.0f, 0.5f);
} else {
Math_StepToF(&this->actor.speedXZ, 7.0f, 0.5f);
Math_StepToF(&this->actor.speed, 7.0f, 0.5f);
}
if (this->actor.xzDistToPlayer < 80.0f) {
@ -674,7 +674,7 @@ void func_8089B98C(EnDinofos* this, PlayState* play) {
void func_8089BAC0(EnDinofos* this) {
if (this->actionFunc != func_8089BB60) {
Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_000580, -4.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) > 0) {
this->unk_28C = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
@ -701,20 +701,20 @@ void func_8089BBB4(EnDinofos* this, PlayState* play) {
s16 rotY = player->actor.shape.rot.y - this->actor.shape.rot.y;
if (ABS_ALT(rotY) > 0x7800) {
if (Rand_ZeroOne() < 0.5f) {
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else {
this->actor.speedXZ = -6.0f;
this->actor.speed = -6.0f;
}
} else if (rotY >= 0) {
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else {
this->actor.speedXZ = -6.0f;
this->actor.speed = -6.0f;
}
if (this->actionFunc == func_8089D1E0) {
this->skelAnime.playSpeed = this->actor.speedXZ * 0.166666671634f;
this->skelAnime.playSpeed = this->actor.speed * 0.166666671634f;
} else {
Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * 0.166666671634f, 0.0f,
Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speed * 0.166666671634f, 0.0f,
0.0f, ANIMMODE_LOOP, -4.0f);
}
@ -734,7 +734,7 @@ void func_8089BD28(EnDinofos* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8);
if (!func_8089AE00(this, play)) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.speedXZ >= 0.0f) {
if (this->actor.speed >= 0.0f) {
phi_v0 = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
} else {
phi_v0 = BINANG_SUB(this->actor.shape.rot.y, 0x4000);
@ -742,23 +742,23 @@ void func_8089BD28(EnDinofos* this, PlayState* play) {
phi_v0 = this->actor.wallYaw - phi_v0;
if (ABS_ALT(phi_v0) > 0x4000) {
this->actor.speedXZ *= -0.8f;
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ -= 0.5f;
this->actor.speed *= -0.8f;
if (this->actor.speed < 0.0f) {
this->actor.speed -= 0.5f;
} else {
this->actor.speedXZ += 0.5f;
this->actor.speed += 0.5f;
}
}
}
phi_v0 = BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y);
if ((phi_v0 >= 0) && (phi_v0 < 0x7800)) {
this->actor.speedXZ += 0.125f;
this->actor.speed += 0.125f;
} else if ((phi_v0 < 0) && (phi_v0 > -0x7800)) {
this->actor.speedXZ -= 0.125f;
this->actor.speed -= 0.125f;
}
if (this->actor.speedXZ > 0.0f) {
if (this->actor.speed > 0.0f) {
this->skelAnime.playSpeed = 1.0f;
} else {
this->skelAnime.playSpeed = -1.0f;
@ -804,7 +804,7 @@ void func_8089C024(EnDinofos* this, s32 arg1) {
}
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_290 = arg1;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_8089C0DC;
@ -825,13 +825,13 @@ void func_8089C0DC(EnDinofos* this, PlayState* play) {
void func_8089C164(EnDinofos* this) {
if (this->unk_290 == 2) {
this->actor.speedXZ = -10.0f;
this->actor.speed = -10.0f;
this->actor.velocity.y = 9.0f;
this->colliderJntSph.base.acFlags |= AC_ON;
} else {
this->actor.velocity.y = 12.5f;
if (this->unk_290 == 0) {
this->actor.speedXZ = 4.5f;
this->actor.speed = 4.5f;
}
}
@ -849,7 +849,7 @@ void func_8089C1F8(EnDinofos* this, PlayState* play) {
void func_8089C244(EnDinofos* this) {
this->actor.bgCheckFlags &= ~1;
this->actor.speedXZ = 8.0f;
this->actor.speed = 8.0f;
this->actor.velocity.y = 16.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP);
this->unk_290 = 0;
@ -880,13 +880,13 @@ void func_8089C398(EnDinofos* this) {
this->skelAnime.endFrame = Animation_GetLastFrame(&object_dinofos_Anim_0025B4);
}
if (this->actor.speedXZ < 0.0f) {
if (this->actor.speed < 0.0f) {
this->unk_290 = 1;
} else {
this->unk_290 = 0;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
func_8089AD70(this);
Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK);
this->actionFunc = func_8089C44C;
@ -909,7 +909,7 @@ void func_8089C4F8(EnDinofos* this) {
Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_CRY);
this->unk_290 = 0;
this->unk_292 = -1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_8089C56C;
}
@ -941,14 +941,14 @@ void func_8089C690(EnDinofos* this) {
if (this->actionFunc != func_8089C2A8) {
this->actor.world.rot.y = this->actor.shape.rot.y;
} else {
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
}
this->actionFunc = func_8089C724;
}
void func_8089C724(EnDinofos* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
}
if (SkelAnime_Update(&this->skelAnime)) {
@ -957,7 +957,7 @@ void func_8089C724(EnDinofos* this, PlayState* play) {
}
void func_8089C784(EnDinofos* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}
@ -989,7 +989,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) {
Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00D21C);
func_800BE5CC(&this->actor, &this->colliderJntSph, arg1);
this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y);
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}
@ -1001,7 +1001,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) {
}
void func_8089C938(EnDinofos* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
if (this->actor.colChkInfo.health == 0) {
if (this->actor.cutscene == -1) {
@ -1021,18 +1021,18 @@ void func_8089C938(EnDinofos* this, PlayState* play) {
void func_8089CA14(EnDinofos* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001040, -5.0f);
this->colliderJntSph.base.acFlags |= AC_ON;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_8089CA74;
}
void func_8089CA74(EnDinofos* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (SkelAnime_Update(&this->skelAnime)) {
func_8089CB10(this, play);
} else if (!func_8089AE00(this, play) && Animation_OnFrame(&this->skelAnime, 12.0f)) {
this->actor.speedXZ = 8.0f;
this->actor.speed = 8.0f;
}
}
@ -1042,7 +1042,7 @@ void func_8089CB10(EnDinofos* this, PlayState* play) {
Animation_PlayLoop(&this->skelAnime, &object_dinofos_Anim_0013C0);
this->unk_290 = 20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->colliderJntSph.base.atFlags |= AT_ON;
func_8089AD70(this);
@ -1130,7 +1130,7 @@ void func_8089CFAC(EnDinofos* this) {
Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00ABD0);
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_DEAD);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_8089D018;
}
@ -1163,11 +1163,11 @@ void func_8089D018(EnDinofos* this, PlayState* play) {
void func_8089D11C(EnDinofos* this, s16 arg1) {
if (arg1 >= 0) {
this->actor.speedXZ = -15.0f;
this->actor.speed = -15.0f;
} else {
this->actor.speedXZ = 15.0f;
this->actor.speed = 15.0f;
}
Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f,
Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speed * (1.0f / 7.5f), 0.0f, 0.0f,
ANIMMODE_LOOP, -4.0f);
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
this->unk_292 = 10;
@ -1178,10 +1178,10 @@ void func_8089D11C(EnDinofos* this, s16 arg1) {
void func_8089D1E0(EnDinofos* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8);
Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f);
Math_StepToF(&this->actor.speed, 0.0f, 2.0f);
this->skelAnime.playSpeed =
(1.0f + fabsf(this->actor.speedXZ * (1.0f / 15.0f))) * ((this->actor.speedXZ >= 0.0f) ? 1.0f : -1.0f);
(1.0f + fabsf(this->actor.speed * (1.0f / 15.0f))) * ((this->actor.speed >= 0.0f) ? 1.0f : -1.0f);
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
SkelAnime_Update(&this->skelAnime);
if (this->unk_292 != 0) {

View File

@ -779,21 +779,21 @@ s32 EnDno_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath)
thisx->gravity = 0.0f;
temp_v0 = thisx->yawTowardsPlayer - thisx->world.rot.y;
if ((temp_v0 <= 0x4000) && (temp_v0 >= -0x4000)) {
Math_SmoothStepToF(&thisx->speedXZ, 15.0f, 0.8f, 1.0f, 0.01f);
Math_SmoothStepToF(&thisx->speed, 15.0f, 0.8f, 1.0f, 0.01f);
} else {
if (thisx->xzDistToPlayer <= 80.0f) {
Math_SmoothStepToF(&thisx->speedXZ, 8.0f, 0.5f, 0.5f, 0.01f);
Math_SmoothStepToF(&thisx->speed, 8.0f, 0.5f, 0.5f, 0.01f);
} else if (thisx->xzDistToPlayer <= 360.0f) {
Math_SmoothStepToF(&thisx->speedXZ, 7.0f, 0.5f, 0.5f, 0.01f);
Math_SmoothStepToF(&thisx->speed, 7.0f, 0.5f, 0.5f, 0.01f);
} else {
Math_SmoothStepToF(&thisx->speedXZ, 3.5f, 0.5f, 0.5f, 0.01f);
Math_SmoothStepToF(&thisx->speed, 3.5f, 0.5f, 0.5f, 0.01f);
}
}
if (actorPath->distSqToCurPoint < SQ(thisx->speedXZ)) {
if (actorPath->distSqToCurPoint < SQ(thisx->speed)) {
ret = true;
} else {
sp38 = thisx->speedXZ / sqrtf(actorPath->distSqToCurPointXZ);
sp38 = thisx->speed / sqrtf(actorPath->distSqToCurPointXZ);
sp2C = ABS(actorPath->rotToCurPoint.x - thisx->world.rot.x);
temp_v0_2 = sp2C;
temp_v0_2 *= sp38;
@ -810,11 +810,11 @@ s32 EnDno_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath)
s32 EnDno_ActorPathing_Move(PlayState* play, ActorPathing* actorPath) {
Actor* thisx = actorPath->actor;
EnDno* this = (EnDno*)thisx;
f32 sp24 = Math_CosS(-thisx->world.rot.x) * thisx->speedXZ;
f32 sp24 = Math_CosS(-thisx->world.rot.x) * thisx->speed;
f32 sp20 = gFramerateDivisorHalf;
thisx->velocity.x = Math_SinS(thisx->world.rot.y) * sp24;
thisx->velocity.y = Math_SinS(-thisx->world.rot.x) * thisx->speedXZ;
thisx->velocity.y = Math_SinS(-thisx->world.rot.x) * thisx->speed;
thisx->velocity.z = Math_CosS(thisx->world.rot.y) * sp24;
this->unk_334.x += (this->actor.velocity.x * sp20) + this->actor.colChkInfo.displacement.x;
@ -864,7 +864,7 @@ void func_80A730A0(EnDno* this, PlayState* play) {
func_800B9010(&this->actor, NA_SE_EV_BUTLER_FRY - SFX_FLAG);
if (this->actorPath.flags & ACTOR_PATHING_REACHED_END_PERMANENT) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->actorPath.curPoint);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.x = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.velocity.z = 0.0f;
@ -876,7 +876,7 @@ void func_80A73244(EnDno* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_8000000;
this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->unk_328 = 2;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Flags_UnsetSwitch(play, EN_DNO_GET_RACE_STARTED_SWITCH_FLAG(&this->actor));
gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP;
this->unk_44E = 0;

View File

@ -536,7 +536,7 @@ s32 func_80877278(EnDodongo* this, PlayState* play) {
void func_808773C4(EnDodongo* this) {
Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_004C20, -4.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->timer = Rand_S16Offset(30, 50);
this->actionFunc = func_80877424;
}
@ -556,7 +556,7 @@ void func_80877424(EnDodongo* this, PlayState* play) {
void func_80877494(EnDodongo* this) {
Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_008B1C, -4.0f);
this->actor.speedXZ = this->unk_334 * 1.5f;
this->actor.speed = this->unk_334 * 1.5f;
this->timer = Rand_S16Offset(50, 70);
this->actionFunc = func_80877500;
}
@ -616,7 +616,7 @@ void func_808777A8(EnDodongo* this) {
Sphere16* sph;
Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0028F0, -4.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
for (i = 0; i < ARRAY_COUNT(this->collider3Elements); i++) {
sph = &this->collider3.elements[i].dim.worldSphere;
@ -696,7 +696,7 @@ void func_80877DE0(EnDodongo* this) {
this->actor.flags |= ACTOR_FLAG_10;
this->timer = 25;
this->actionFunc = func_80877E60;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void func_80877E60(EnDodongo* this, PlayState* play) {
@ -849,7 +849,7 @@ void func_80878424(EnDodongo* this, PlayState* play) {
void func_80878594(EnDodongo* this) {
this->actionFunc = func_808785B0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void func_808785B0(EnDodongo* this, PlayState* play) {
@ -874,7 +874,7 @@ void func_8087864C(EnDodongo* this) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DAMAGE);
this->timer = 0;
this->unk_304 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->actionFunc = func_808786C8;
}
@ -895,7 +895,7 @@ void func_80878724(EnDodongo* this) {
this->unk_304 = 0;
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DEAD);
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->actionFunc = func_808787B0;
}

View File

@ -345,9 +345,9 @@ void EnDragon_RetreatOrIdle(EnDragon* this, PlayState* play) {
EnDragon_SetupExtend(this);
} else if ((this->timer != 0) && (fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 101.0f) &&
(fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 101.0f)) {
this->actor.speedXZ = -100.0f;
this->actor.speed = -100.0f;
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 4.0f) &&
(fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 4.0f)) {
@ -388,12 +388,12 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_APPEAR - SFX_FLAG);
extendedPos.x += Math_SinS(this->actor.world.rot.y) * -530.0f;
extendedPos.z += Math_CosS(this->actor.world.rot.y) * -530.0f;
this->actor.speedXZ = 40.0f;
this->actor.speed = 40.0f;
Math_SmoothStepToS(&this->jawZRotation, 0xFA0, 5, 0xBB8, 0x14);
if ((fabsf(this->actor.world.pos.x - extendedPos.x) < 51.0f) &&
(fabsf(this->actor.world.pos.z - extendedPos.z) < 51.0f)) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Math_ApproachF(&this->actor.world.pos.x, extendedPos.x, 0.3f, 50.0f);
Math_ApproachF(&this->actor.world.pos.z, extendedPos.z, 0.3f, 50.0f);
if ((fabsf(this->actor.world.pos.x - extendedPos.x) < 4.0f) &&
@ -513,7 +513,7 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) {
pos.z += Math_CosS(this->actor.world.rot.y) * -930.0f;
Math_Vec3f_Copy(&this->actor.world.pos, &pos);
this->jawZRotation = 0x1450;
this->actor.speedXZ = 60.0f;
this->actor.speed = 60.0f;
}
this->grabTimer++;
@ -655,7 +655,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) {
if ((this->timer != 0) && (fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 121.0f) &&
(fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 121.0f)) {
this->actor.speedXZ = -120.0f;
this->actor.speed = -120.0f;
if (((this->pythonIndex & 1) == 0) && (Rand_ZeroOne() < 0.5f)) {
//! @bug: !play->gameplayFrames is 0 essentially all the time, so this code never runs.
if (((!play->gameplayFrames) & 0x1F)) {
@ -667,7 +667,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) {
return;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 20.0f) &&
(fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 20.0f)) {
Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, 300.0f);
@ -754,7 +754,7 @@ void EnDragon_UpdateDamage(EnDragon* this, PlayState* play) {
if ((this->action == DEEP_PYTHON_ACTION_EXTEND) && (this->grabWaitTimer == 0) &&
(player->invincibilityTimer == 0) && (this->collider.elements[0].info.ocElemFlags & OCELEM_HIT) &&
(!(func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp30) >= 0.0f) || (sp30 != 1))) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->action = DEEP_PYTHON_ACTION_GRAB;
this->actor.flags |= ACTOR_FLAG_100000;
this->actionFunc = EnDragon_SetupGrab;

View File

@ -233,7 +233,7 @@ void func_8088C9CC(EnElf* this, PlayState* play) {
this->unk_244 = 2;
this->unk_248 = 0x400;
this->unk_254 = 2.0f;
this->actor.speedXZ = 1.5f;
this->actor.speed = 1.5f;
this->unk_26C = func_8088C920;
this->unk_25C = (s32)Rand_ZeroFloat(8.0f) + 4;
} else {
@ -558,9 +558,9 @@ void func_8088D9BC(EnElf* this, PlayState* play) {
Vec3f* vec = &this->unk_224;
if (this->fairyFlags & 0x4000) {
Math_SmoothStepToF(&this->actor.speedXZ, 5.0f, 0.5f, 1.0f, 0.01f);
Math_SmoothStepToF(&this->actor.speed, 5.0f, 0.5f, 1.0f, 0.01f);
} else {
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_254, 0.2f, 0.5f, 0.01f);
Math_SmoothStepToF(&this->actor.speed, this->unk_254, 0.2f, 0.5f, 0.01f);
}
switch (this->unk_244) {
@ -606,7 +606,7 @@ void func_8088DB4C(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) {
xzVelocity = sqrtf(SQ(xVelTarget) + SQ(zVelTarget));
clampedXZ = CLAMP(xzVelocity, arg2, arg3);
this->actor.speedXZ = clampedXZ;
this->actor.speed = clampedXZ;
if ((xzVelocity != clampedXZ) && (xzVelocity != 0.0f)) {
xzVelocity = clampedXZ / xzVelocity;
@ -976,7 +976,7 @@ void func_8088E850(EnElf* this, PlayState* play) {
if (arrowPointedActor != NULL) {
func_8088DB4C(this, &nextPos, 0.0f, 30.0f, 0.2f);
if (this->actor.speedXZ >= 5.0f) {
if (this->actor.speed >= 5.0f) {
func_8088F5F4(this, play, 0x10);
}
} else {
@ -1299,7 +1299,7 @@ void func_8088FA38(EnElf* this, PlayState* play) {
refPos = this->actor.focus.pos;
func_8088DB4C(this, &refPos, 0, 30.0f, 0.2f);
if (this->actor.speedXZ >= 5.0f) {
if (this->actor.speed >= 5.0f) {
func_8088F5F4(this, play, 0x10);
}

View File

@ -55,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = {
};
void EnElforg_InitializeParams(EnElforg* this) {
this->actor.speedXZ = 1.0f;
this->actor.speed = 1.0f;
this->targetSpeedXZ = 1.0f;
this->actor.velocity.y = 0.0f;
this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x10000);
@ -189,22 +189,22 @@ void EnElforg_SpawnSparkles(EnElforg* this, PlayState* play, s32 life) {
void EnElforg_ApproachTargetYPosition(EnElforg* this, Vec3f* targetPos) {
f32 yDifference = targetPos->y - this->actor.world.pos.y;
if (fabsf(yDifference) < this->actor.speedXZ) {
if (fabsf(yDifference) < this->actor.speed) {
this->actor.world.pos.y = targetPos->y;
} else if (yDifference > 0.0f) {
this->actor.world.pos.y += this->actor.speedXZ;
this->actor.world.pos.y += this->actor.speed;
} else {
this->actor.world.pos.y -= this->actor.speedXZ;
this->actor.world.pos.y -= this->actor.speed;
}
}
void EnElforg_ApproachTargetSpeedXZ(EnElforg* this) {
if (this->actor.speedXZ > this->targetSpeedXZ) {
this->actor.speedXZ *= 0.9f;
} else if (this->actor.speedXZ < (this->targetSpeedXZ - 0.1f)) {
this->actor.speedXZ += 0.1f;
if (this->actor.speed > this->targetSpeedXZ) {
this->actor.speed *= 0.9f;
} else if (this->actor.speed < (this->targetSpeedXZ - 0.1f)) {
this->actor.speed += 0.1f;
} else {
this->actor.speedXZ = this->targetSpeedXZ;
this->actor.speed = this->targetSpeedXZ;
}
}
@ -292,7 +292,7 @@ void EnElforg_TurnInFairy(EnElforg* this, PlayState* play) {
// flying towards the fountain's center.
SkelAnime_Update(&this->skelAnime);
this->actor.shape.yOffset *= 0.9f;
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
EnElforg_ApproachTargetYPosition(this, &player->bodyPartsPos[PLAYER_BODYPART_WAIST]);
xzDistToPlayer = this->actor.xzDistToPlayer;

View File

@ -71,12 +71,12 @@ void EnEstone_Init(Actor* thisx, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->actor.params == ENESTONE_TYPE_LARGE) {
this->actor.speedXZ = Rand_ZeroFloat(5.0f) + 2.0f;
this->actor.speed = Rand_ZeroFloat(5.0f) + 2.0f;
this->scale = (Rand_ZeroFloat(1.0f) * 0.005f) + 0.005f;
this->actor.velocity.y = Rand_ZeroFloat(10.0f) + 15.0f;
this->actor.gravity = -2.0f;
} else {
this->actor.speedXZ = Rand_ZeroFloat(3.0f) + 1.0f;
this->actor.speed = Rand_ZeroFloat(3.0f) + 1.0f;
this->scale = (Rand_ZeroFloat(1.0f) * 0.003f) + 0.003f;
this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 7.0f;
this->actor.gravity = -1.0f;
@ -139,7 +139,7 @@ void EnEstone_Active(EnEstone* this, PlayState* play) {
velocity.y = this->actor.floorHeight;
Actor_SpawnFloorDustRing(play, &this->actor, &velocity, 0.0f, 10, 6.0f, 50, 30, true);
this->actor.velocity.y = this->actor.gravity = 0.0f;
this->actor.speedXZ *= 0.3f;
this->actor.speed *= 0.3f;
this->actor.shape.shadowScale = 0.0f;
this->inactive = true;
this->timer = 50;

View File

@ -499,7 +499,7 @@ void EnFall_MoonsTear_Initialize(EnFall* this) {
}
this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
this->actor.world.rot.x = Math_Vec3f_Pitch(&this->actor.world.pos, &this->actor.home.pos);
this->actor.speedXZ = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos) / 82.0f;
this->actor.speed = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos) / 82.0f;
this->actor.shape.rot.x = this->actor.world.rot.x;
this->actor.shape.rot.y = this->actor.world.rot.y;
}
@ -516,7 +516,7 @@ void EnFall_MoonsTear_Fall(EnFall* this, PlayState* play) {
}
if (this->actor.draw != NULL) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ) <= 0.0f) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speed) <= 0.0f) {
Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_1);
SET_WEEKEVENTREG(WEEKEVENTREG_74_80);
SET_WEEKEVENTREG(WEEKEVENTREG_74_20);

View File

@ -347,7 +347,7 @@ void EnFamos_UpdateFlipStatus(EnFamos* this) {
*/
void EnFamos_SetupStillIdle(EnFamos* this) {
this->actionFunc = EnFamos_StillIdle;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnFamos_StillIdle(EnFamos* this, PlayState* play) {
@ -376,7 +376,7 @@ void EnFamos_SetupPathingIdle(EnFamos* this) {
Math_Vec3s_ToVec3f(&this->targetDest, &this->pathPoints[this->currentPathNode]);
this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest);
this->actionFunc = EnFamos_PathingIdle;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnFamos_PathingIdle(EnFamos* this, PlayState* play) {
@ -399,7 +399,7 @@ void EnFamos_SetupTurnHome(EnFamos* this) {
this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->calmPos);
Math_Vec3f_Copy(&this->targetDest, &this->calmPos);
this->actionFunc = EnFamos_TurnHome;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnFamos_TurnHome(EnFamos* this, PlayState* play) {
@ -439,9 +439,9 @@ void EnFamos_ReturnHome(EnFamos* this, PlayState* play) {
EnFamos_SetupStillIdle(this);
}
} else if (distanceToHome < 40.0f) {
Math_StepToF(&this->actor.speedXZ, 0.5f, 0.3f);
Math_StepToF(&this->actor.speed, 0.5f, 0.3f);
} else {
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f);
Math_StepToF(&this->actor.speed, 3.0f, 0.3f);
}
}
@ -451,7 +451,7 @@ void EnFamos_ReturnHome(EnFamos* this, PlayState* play) {
void EnFamos_SetupAlert(EnFamos* this) {
this->actor.world.rot.y = this->actor.shape.rot.y;
this->stateTimer = 8;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->isCalm == true) {
this->isCalm = false;
@ -498,7 +498,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) {
abovePlayerPos.y = player->actor.world.pos.y + 100.0f;
abovePlayerPos.z = player->actor.world.pos.z;
this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &abovePlayerPos);
Math_StepToF(&this->actor.speedXZ, 6.0f, 0.5f);
Math_StepToF(&this->actor.speed, 6.0f, 0.5f);
surfaceType = func_800C9B18(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
if ((this->actor.xzDistToPlayer < 30.0f) && (this->actor.floorHeight > BGCHECK_Y_MIN) && // close enough
@ -514,7 +514,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) {
void EnFamos_SetupAttackAim(EnFamos* this) {
Animation_PlayOnce(&this->skelAnime, &gFamosShakeAnim);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_VOICE);
this->actionFunc = EnFamos_AttackAim;
}
@ -537,7 +537,7 @@ void EnFamos_Attack(EnFamos* this, PlayState* play) {
s32 hitFloor;
u32 surfaceType;
Math_StepToF(&this->actor.speedXZ, 20.0f, 2.0f);
Math_StepToF(&this->actor.speed, 20.0f, 2.0f);
this->stateTimer--;
if (this->stateTimer == 0) {
this->emblemCollider.base.acFlags &= ~AC_ON;
@ -585,7 +585,7 @@ void EnFamos_SetupFinishAttack(EnFamos* this) {
SkelAnime_Update(&this->skelAnime);
this->emblemCollider.base.acFlags |= AC_ON;
this->stateTimer = 3;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION);
this->actionFunc = EnFamos_FinishAttack;
}
@ -604,12 +604,12 @@ void EnFamos_FinishAttack(EnFamos* this, PlayState* play) {
void EnFamos_SetupAttackRebound(EnFamos* this) {
this->actor.world.rot.x = 0x4000;
this->actionFunc = EnFamos_AttackRebound;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnFamos_AttackRebound(EnFamos* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 5.0f, 0.3f);
if (this->actor.speedXZ > 1.0f) {
Math_StepToF(&this->actor.speed, 5.0f, 0.3f);
if (this->actor.speed > 1.0f) {
if (ABS_ALT(this->flipRot) > 0x4000) {
func_800B9010(&this->actor, NA_SE_EN_FAMOS_FLOAT_REVERSE - SFX_FLAG);
} else {
@ -618,7 +618,7 @@ void EnFamos_AttackRebound(EnFamos* this, PlayState* play) {
}
if ((this->baseHeight < this->actor.world.pos.y) || (this->actor.bgCheckFlags & 0x10)) { // touching ceiling
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
EnFamos_SetupChase(this);
}
}
@ -629,7 +629,7 @@ void EnFamos_AttackRebound(EnFamos* this, PlayState* play) {
void EnFamos_SetupScanForPlayer(EnFamos* this) {
this->stateTimer = 60;
this->actionFunc = EnFamos_ScanForPlayer;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnFamos_ScanForPlayer(EnFamos* this, PlayState* play) {
@ -651,7 +651,7 @@ void EnFamos_ScanForPlayer(EnFamos* this, PlayState* play) {
void EnFamos_SetupDeathSlam(EnFamos* this) {
this->emblemCollider.base.acFlags &= ~AC_ON;
this->stateTimer = 20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20);
this->flippedTimer = -1;
this->actor.world.pos.y = this->actor.floorHeight - 60.0f;
@ -681,7 +681,7 @@ void EnFamos_SetupDeathExplosion(EnFamos* this) {
}
void EnFamos_DeathExplosion(EnFamos* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f);
Math_StepToF(&this->actor.speed, 3.0f, 0.3f);
if (this->actor.colorFilterTimer == 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, false, 4);
}
@ -712,7 +712,7 @@ void EnFamos_SetupDeathFade(EnFamos* this) {
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.shape.shadowDraw = NULL;
this->actionFunc = EnFamos_DeathFade;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnFamos_DeathFade(EnFamos* this, PlayState* play) {

View File

@ -212,7 +212,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) {
this->actor.world.rot.y = Math_Vec3f_Yaw(&ac->world.pos, &this->actor.world.pos);
this->actor.shape.rot = this->actor.world.rot;
this->actor.velocity.y = 10.0f;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->actor.gravity = -0.8f;
this->bounceCounter = 1;
this->timer = 0;
@ -263,7 +263,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) {
this->actor.world.rot.y = Math_Vec3f_Yaw(&ac->world.pos, &this->actor.world.pos);
this->actor.shape.rot = this->actor.world.rot;
this->actor.velocity.y = 10.0f;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->actor.gravity = -0.8f;
this->bounceCounter = 1;
this->timer = 0;

View File

@ -215,7 +215,7 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) {
EnFirefly_SetupPerch(this);
} else {
if (distFromHome * 0.05f < 1.0f) {
this->actor.speedXZ *= distFromHome * 0.05f;
this->actor.speed *= distFromHome * 0.05f;
}
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
@ -274,7 +274,7 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) {
void EnFirefly_SetupFlyIdle(EnFirefly* this) {
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);
this->pitchTarget = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554;
this->skelAnime.playSpeed = 1.0f;
@ -291,7 +291,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
}
isSkelAnimeUpdated = 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 (!EnFirefly_ReturnToPerch(this, play) && !EnFirefly_SeekTorch(this, play)) {
if (isSkelAnimeUpdated) {
@ -372,7 +372,7 @@ void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) {
}
if (this->actor.flags & ACTOR_FLAG_8000) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
this->actionFunc = EnFirefly_Fall;
@ -381,7 +381,7 @@ void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) {
// Fall to the ground after being hit
void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
this->actor.colorFilterTimer = 40;
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
@ -398,7 +398,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
void EnFirefly_SetupDie(EnFirefly* this) {
this->timer = 15;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnFirefly_Die;
}
@ -434,7 +434,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) {
this->timer--;
}
Math_StepToF(&this->actor.speedXZ, 4.0f, 0.5f);
Math_StepToF(&this->actor.speed, 4.0f, 0.5f);
if (this->actor.bgCheckFlags & 8) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
@ -480,7 +480,7 @@ void EnFirefly_SetupRebound(EnFirefly* this) {
this->actor.world.rot.x = 0x7000;
this->timer = 18;
this->skelAnime.playSpeed = 1.0f;
this->actor.speedXZ = 2.5f;
this->actor.speed = 2.5f;
this->actionFunc = EnFirefly_Rebound;
}
@ -489,7 +489,7 @@ void EnFirefly_Rebound(EnFirefly* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
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) {
this->timer--;
}
@ -521,7 +521,7 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) {
return;
}
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f);
Math_StepToF(&this->actor.speed, 3.0f, 0.3f);
if (this->actor.bgCheckFlags & 1) {
this->pitchTarget = 0x954;
@ -550,7 +550,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) {
if (this->actionFunc != EnFirefly_Stunned) {
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
this->auraType = KEESE_AURA_NONE;
@ -586,7 +586,7 @@ void EnFirefly_Stunned(EnFirefly* this, PlayState* play) {
void EnFirefly_SetupPerch(EnFirefly* this) {
this->timer = 1;
this->actionFunc = EnFirefly_Perch;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
// When perching, sit on collision and flap at random intervals
@ -611,7 +611,7 @@ void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) {
this->actor.shape.rot.x = 0x1554;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->timer = 50;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->actionFunc = EnFirefly_DisturbDiveAttack;
}

View File

@ -278,12 +278,12 @@ void func_8091DF68(Actor* thisx, PlayState* play) {
EnFish* this = THIS;
func_8091DD48(this);
Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 0.05f, 0.3f, 0.0f);
Math_SmoothStepToF(&thisx->speed, 0.0f, 0.05f, 0.3f, 0.0f);
if ((thisx->speedXZ * 1.4f) + 0.8f > 2.0f) {
if ((thisx->speed * 1.4f) + 0.8f > 2.0f) {
this->skelAnime.playSpeed = 2.0f;
} else {
this->skelAnime.playSpeed = (thisx->speedXZ * 1.4f) + 0.8f;
this->skelAnime.playSpeed = (thisx->speed * 1.4f) + 0.8f;
}
this->unk_270 >>= 1;
@ -327,7 +327,7 @@ void func_8091E128(Actor* thisx, PlayState* play) {
EnFish* this = THIS;
func_8091DD48(this);
Math_SmoothStepToF(&thisx->speedXZ, 1.8f, 0.08f, 0.4f, 0.0f);
Math_SmoothStepToF(&thisx->speed, 1.8f, 0.08f, 0.4f, 0.0f);
if ((func_8091D630(&thisx->world.pos, &thisx->home.pos) > SQ(80.0f)) || (this->unk_240 < 4)) {
this->unk_270 = this->unk_264;
@ -342,10 +342,10 @@ void func_8091E128(Actor* thisx, PlayState* play) {
this->unk_24C = 0.0f;
}
if ((thisx->speedXZ * 1.5f) + 0.8f > 4.0f) {
if ((thisx->speed * 1.5f) + 0.8f > 4.0f) {
this->skelAnime.playSpeed = 4.0f;
} else {
this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 0.8f;
this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 0.8f;
}
if (this->unk_240 <= 0) {
@ -378,7 +378,7 @@ void func_8091E34C(Actor* thisx, PlayState* play2) {
s32 pad;
func_8091DD48(this);
Math_SmoothStepToF(&thisx->speedXZ, 4.2f, 0.08f, 1.4f, 0.0f);
Math_SmoothStepToF(&thisx->speed, 4.2f, 0.08f, 1.4f, 0.0f);
if (func_8091D630(&thisx->world.pos, &thisx->home.pos) > SQ(160.0f)) {
this->unk_270 = this->unk_264;
@ -418,10 +418,10 @@ void func_8091E34C(Actor* thisx, PlayState* play2) {
this->unk_24C = 0.0f;
}
if ((thisx->speedXZ * 1.5f) + 0.8f > 4.0f) {
if ((thisx->speed * 1.5f) + 0.8f > 4.0f) {
this->skelAnime.playSpeed = 4.0f;
} else {
this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 0.8f;
this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 0.8f;
}
if ((this->unk_240 <= 0) || (!sp3C && (sp38 == 0))) {
@ -453,7 +453,7 @@ void func_8091E658(Actor* thisx, PlayState* play) {
s16 sp32;
func_8091DD48(this);
Math_SmoothStepToF(&thisx->speedXZ, 1.8f, 0.1f, 0.5f, 0.0f);
Math_SmoothStepToF(&thisx->speed, 1.8f, 0.1f, 0.5f, 0.0f);
if (func_8091D630(&thisx->world.pos, &thisx->home.pos) > SQ(80.0f)) {
this->unk_270 = this->unk_264;
@ -475,10 +475,10 @@ void func_8091E658(Actor* thisx, PlayState* play) {
this->unk_24C = 1.2f;
}
if ((thisx->speedXZ * 1.5f) + 0.8f > 4.0f) {
if ((thisx->speed * 1.5f) + 0.8f > 4.0f) {
this->skelAnime.playSpeed = 4.0f;
} else {
this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 0.8f;
this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 0.8f;
}
if (this->unk_240 <= 0) {
@ -502,7 +502,7 @@ void func_8091E810(EnFish* this) {
void func_8091E880(Actor* thisx, PlayState* play) {
EnFish* this = THIS;
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);
this->unk_26E = 0x43;
this->unk_272 = 0x43;
this->unk_268 = 0x4000;
@ -563,7 +563,7 @@ void func_8091EAF0(Actor* thisx, PlayState* play) {
s32 sp40 = play->state.frames;
s16 phi_v1;
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);
phi_v1 = (s16)((((sp40 >> 5) & 2) | ((sp40 >> 2) & 1)) << 0xB) * 0.3f;
if (sp40 & 4) {
phi_v1 *= -1;
@ -625,12 +625,12 @@ void func_8091ED70(Actor* thisx, PlayState* play) {
func_8091D840(thisx, play, 2, 25.0f);
}
Math_SmoothStepToF(&thisx->speedXZ, 2.8f, 0.1f, 0.4f, 0.0f);
Math_SmoothStepToF(&thisx->speed, 2.8f, 0.1f, 0.4f, 0.0f);
if ((thisx->bgCheckFlags & 8) || !(thisx->bgCheckFlags & 0x20)) {
sp2E = Math_Vec3f_Yaw(&thisx->world.pos, &thisx->home.pos);
thisx->home.rot.y = Rand_S16Offset(-100, 100) + sp2E;
thisx->speedXZ *= 0.5f;
thisx->speed *= 0.5f;
}
this->unk_268 = 0;
@ -651,10 +651,10 @@ void func_8091ED70(Actor* thisx, PlayState* play) {
func_8091D728(this);
}
if ((thisx->speedXZ * 1.5f) + 1.0f > 4.8f) {
if ((thisx->speed * 1.5f) + 1.0f > 4.8f) {
this->skelAnime.playSpeed = 4.8f;
} else {
this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 1.0f;
this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 1.0f;
}
if (this->unk_240 <= 0) {
@ -700,14 +700,14 @@ void func_8091EFE8(Actor* thisx, PlayState* play) {
}
if (this->unk_277 == 0) {
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 (this->unk_240 < 6) {
this->actor.speedXZ *= 0.75f;
this->actor.speed *= 0.75f;
}
}
if ((this->actor.bgCheckFlags & 8) && !(this->actor.bgCheckFlags & 0x20)) {
this->actor.speedXZ *= 0.5f;
this->actor.speed *= 0.5f;
}
if (((Rand_Next() >> 0x1B) == 0) || ((this->actor.bgCheckFlags & 8) && ((Rand_Next() >> 0x1E) == 0)) ||
@ -760,10 +760,10 @@ void func_8091EFE8(Actor* thisx, PlayState* play) {
}
this->actor.velocity.y *= 0.8f;
if ((this->actor.speedXZ * 1.5f) + 1.0f > 4.8f) {
if ((this->actor.speed * 1.5f) + 1.0f > 4.8f) {
this->skelAnime.playSpeed = 4.8f;
} else {
this->skelAnime.playSpeed = (this->actor.speedXZ * 1.5f) + 1.0f;
this->skelAnime.playSpeed = (this->actor.speed * 1.5f) + 1.0f;
}
}
@ -804,7 +804,7 @@ void func_8091F3BC(Actor* thisx, PlayState* play) {
func_8091DD48(this);
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 2.0f);
Math_SmoothStepToF(&this->actor.speedXZ, sp3C->x, sp3C->y, sp3C->z, 0.0f);
Math_SmoothStepToF(&this->actor.speed, sp3C->x, sp3C->y, sp3C->z, 0.0f);
this->unk_24C = 0.0f;
if (func_8091D630(&this->actor.world.pos, &this->actor.home.pos) > SQ(15.0f)) {
@ -820,7 +820,7 @@ void func_8091F3BC(Actor* thisx, PlayState* play) {
phi_f0 = 0.0f;
}
temp_f2 = this->actor.speedXZ + 0.4f + phi_f0;
temp_f2 = this->actor.speed + 0.4f + phi_f0;
this->skelAnime.playSpeed = CLAMP(temp_f2, 0.5f, 1.6f);
if (this->unk_240 <= 0) {

View File

@ -235,7 +235,7 @@ void func_80B287F4(EnFish2* this, s32 arg1) {
if (arg1 == 0) {
this->unk_338 = 410.0f - this->unk_2C4;
}
Math_ApproachF(&this->unk_350->speedXZ, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f);
Math_ApproachF(&this->unk_350->speed, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f);
}
Math_Vec3f_Copy(&sp2C, &this->unk_350->world.pos);
this->unk_34A = Math_Vec3f_Yaw(&this->actor.world.pos, &sp2C);
@ -377,14 +377,14 @@ void func_80B28C14(EnFish2* this, PlayState* play) {
}
if (this->unk_2B4 == 0) {
Math_ApproachF(&this->actor.speedXZ, (D_80B2B380[0] - this->unk_330) * 400.0f, 0.3f, 0.3f);
if (this->actor.speedXZ > 3.0f) {
this->actor.speedXZ = 3.0f;
} else if (this->actor.speedXZ < 1.5f) {
this->actor.speedXZ = 1.5f;
Math_ApproachF(&this->actor.speed, (D_80B2B380[0] - this->unk_330) * 400.0f, 0.3f, 0.3f);
if (this->actor.speed > 3.0f) {
this->actor.speed = 3.0f;
} else if (this->actor.speed < 1.5f) {
this->actor.speed = 1.5f;
}
} else {
Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 0.3f);
Math_ApproachZeroF(&this->actor.speed, 0.3f, 0.3f);
}
if ((D_80B2B2E8 == 0) && (D_80B2B2E0 != 2)) {
@ -448,7 +448,7 @@ void func_80B29194(EnFish2* this) {
}
this->unk_2C4 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_2C8 == 0) {
this->unk_34C = 400;
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_324);
@ -463,12 +463,12 @@ void func_80B29194(EnFish2* this) {
void func_80B29250(EnFish2* this, PlayState* play) {
if (!func_80B28478(this)) {
Math_ApproachF(&this->actor.speedXZ, (D_80B2B380[0] - this->unk_330) * 1000.0f, 0.3f, 0.3f);
Math_ApproachF(&this->actor.speed, (D_80B2B380[0] - this->unk_330) * 1000.0f, 0.3f, 0.3f);
if (this->actor.speedXZ > 4.0f) {
this->actor.speedXZ = 4.0f;
} else if (this->actor.speedXZ < 2.0f) {
this->actor.speedXZ = 2.0f;
if (this->actor.speed > 4.0f) {
this->actor.speed = 4.0f;
} else if (this->actor.speed < 2.0f) {
this->actor.speed = 2.0f;
}
func_80B287F4(this, 0);
@ -492,12 +492,12 @@ void func_80B293C4(EnFish2* this, PlayState* play) {
if (func_80B28478(this) == 0) {
func_80B287F4(this, 1);
Math_ApproachF(&this->actor.speedXZ, (*D_80B2B380 - this->unk_330) * 1000.0f, 0.3f, 0.3f);
Math_ApproachF(&this->actor.speed, (*D_80B2B380 - this->unk_330) * 1000.0f, 0.3f, 0.3f);
if (this->actor.speedXZ > 3.0f) {
this->actor.speedXZ = 3.0f;
} else if (this->actor.speedXZ < 1.0f) {
this->actor.speedXZ = 1.0f;
if (this->actor.speed > 3.0f) {
this->actor.speed = 3.0f;
} else if (this->actor.speed < 1.0f) {
this->actor.speed = 1.0f;
}
if (this->unk_2CC <= currentFrame) {
@ -526,7 +526,7 @@ void func_80B2951C(EnFish2* this) {
}
this->unk_2B4 = 10;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
Actor_Kill(this->unk_350);
this->unk_350 = NULL;
D_80B2B2F4 = &this->actor;
@ -542,7 +542,7 @@ void func_80B295A4(EnFish2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &play->view.eye), 1, 0x1388, 0);
Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 0.3f);
Math_ApproachZeroF(&this->actor.speed, 0.3f, 0.3f);
if (this->unk_2B4 != 0) {
Math_Vec3f_Copy(&sp60, &this->unk_318);
sp60.x += randPlusMinusPoint5Scaled(100.0f);
@ -576,7 +576,7 @@ void func_80B29778(EnFish2* this) {
}
this->actionFunc = func_80B297FC;
this->unk_324.y = this->unk_2D4;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void func_80B297FC(EnFish2* this, PlayState* play) {
@ -605,7 +605,7 @@ void func_80B297FC(EnFish2* this, PlayState* play) {
if ((fabsf(this->actor.world.pos.x - this->unk_324.x) < 2.0f) &&
(this->actor.world.pos.y < (this->unk_2D4 + 3.0f)) &&
(fabsf(this->actor.world.pos.z - this->unk_324.z) < 2.0f)) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_34A = BINANG_ROT180(this->actor.home.rot.y);
this->unk_2C4++;
this->actor.velocity.y = 0.0f;
@ -770,8 +770,8 @@ void func_80B29EE4(EnFish2* this, PlayState* play) {
this->unk_2C4++;
}
this->unk_338 = 410.0f - this->unk_2C4;
Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.3f, 0.3f);
Math_ApproachF(&this->unk_350->speedXZ, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f);
Math_ApproachF(&this->actor.speed, 2.0f, 0.3f, 0.3f);
Math_ApproachF(&this->unk_350->speed, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f);
func_80B289DC(this, play);
Math_Vec3f_Copy(&sp2C, &this->unk_350->world.pos);
this->unk_34A = Math_Vec3f_Yaw(&this->actor.world.pos, &sp2C);
@ -887,7 +887,7 @@ void func_80B2A498(EnFish2* this, PlayState* play) {
temp_v0 = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_COL_MAN, sp80.x, sp80.y, sp80.z, 0,
this->actor.world.rot.y, 0, 0);
if (temp_v0 != NULL) {
temp_v0->speedXZ = 4.0f;
temp_v0->speed = 4.0f;
temp_v0->velocity.y = 15.0f;
Actor_PlaySfx(&this->actor, NA_SE_SY_PIECE_OF_HEART);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_81_10);

View File

@ -1574,7 +1574,7 @@ void EnFishing_DrawLureHook(PlayState* play, Vec3f* pos, Vec3f* refPos, u8 hookI
Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_NEW);
if ((player->actor.speedXZ == 0.0f) && (D_809101B4 == 0.0f)) {
if ((player->actor.speed == 0.0f) && (D_809101B4 == 0.0f)) {
Math_ApproachF(&sLureHookRotY[hookIndex], ry, 0.1f, 0.3f);
} else {
sLureHookRotY[hookIndex] = ry;
@ -1785,7 +1785,7 @@ void EnFishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot)
sLurePos = sReelLinePos[LINE_SEG_COUNT - 1];
sLureRot.x = sReelLineRot[LINE_SEG_COUNT - 2].x + M_PI;
if ((player->actor.speedXZ == 0.0f) && (D_80917200 == 0)) {
if ((player->actor.speed == 0.0f) && (D_80917200 == 0)) {
Math_ApproachF(&sLureRot.y, sReelLineRot[LINE_SEG_COUNT - 2].y, 0.1f, 0.2f);
} else {
sLureRot.y = sReelLineRot[LINE_SEG_COUNT - 2].y;
@ -2871,9 +2871,9 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->actor.uncullZoneScale = 50.0f;
if (this->unk_148 == 0) {
sp118 = (player->actor.speedXZ * 0.15f) + 0.25f;
sp118 = (player->actor.speed * 0.15f) + 0.25f;
} else {
sp118 = (player->actor.speedXZ * 0.3f) + 0.25f;
sp118 = (player->actor.speed * 0.3f) + 0.25f;
}
if ((D_80917200 != 0) || (sSubCamId != SUB_CAM_ID_DONE) ||
@ -3018,7 +3018,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
case 10:
this->unk_1AC = this->actor.home.pos;
Math_ApproachF(&this->actor.speedXZ, 2.0f, 1.0f, 0.5f);
Math_ApproachF(&this->actor.speed, 2.0f, 1.0f, 0.5f);
Math_ApproachF(&this->unk_1A8, 4096.0f, 1.0f, 256.0f);
if (sp124 < 40.0f) {
@ -3040,7 +3040,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
case 11:
this->unk_1AC = this->actor.home.pos;
Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 0.05f);
Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 0.05f);
Math_ApproachF(&this->unk_1A8, 0.0f, 1.0f, 256.0f);
if (sp124 >= 40.0f) {
@ -3070,7 +3070,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
break;
case 0:
Math_ApproachF(&this->actor.speedXZ, 1.0f, 1.0f, 0.05f);
Math_ApproachF(&this->actor.speed, 1.0f, 1.0f, 0.05f);
Math_ApproachF(&this->unk_1A8, 0.0f, 1.0f, 256.0f);
if (this->unk_172[0] == 0) {
@ -3107,14 +3107,14 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
if ((this->actor.xzDistToPlayer < (250.0f * sp118)) || (this->unk_172[1] != 0)) {
Math_ApproachF(&this->unk_1A8, 8192.0f, 1.0f, 768.0f);
Math_ApproachF(&this->actor.speedXZ, 4.2f, 1.0f, 0.75);
Math_ApproachF(&this->actor.speed, 4.2f, 1.0f, 0.75);
this->unk_188 = 1.2f;
this->unk_18C = 4000.0f;
this->unk_172[0] = 20;
} else {
this->unk_188 = 1.0f;
this->unk_18C = 2000.0f;
Math_ApproachF(&this->actor.speedXZ, 1.5f, 1.0f, 0.1f);
Math_ApproachF(&this->actor.speed, 1.5f, 1.0f, 0.1f);
}
if ((this->unk_172[0] == 0) || (sp124 < 50.0f)) {
@ -3136,7 +3136,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
Math_ApproachS(&this->unk_15E, 0, 0x14, 0x20);
if ((this->actor.xzDistToPlayer < (250.0f * sp118)) || (this->unk_172[1] != 0)) {
Math_ApproachF(&this->actor.speedXZ, 3.0f, 1.0f, 0.75);
Math_ApproachF(&this->actor.speed, 3.0f, 1.0f, 0.75);
this->unk_188 = 1.0f;
this->unk_172[0] = 20;
this->unk_18C = 4000.0f;
@ -3150,12 +3150,12 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
} else if (sp124 > 50.0f) {
this->unk_188 = 0.8f;
this->unk_18C = 1500.0f;
Math_ApproachF(&this->actor.speedXZ, 1.0f, 1.0f, 0.1f);
Math_ApproachF(&this->actor.speed, 1.0f, 1.0f, 0.1f);
Math_ApproachF(&this->unk_1A8, 2048.0f, 1.0f, 128.0f);
} else {
this->unk_188 = 0.4f;
this->unk_18C = 500.0f;
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.02f);
Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.02f);
Math_ApproachF(&this->unk_1A8, 0.0f, 1.0f, 256.0f);
}
@ -3184,11 +3184,11 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
Math_ApproachS(&this->unk_15E, -0x1000, 0x14, 0x100);
if (this->actor.world.pos.y < (WATER_SURFACE_Y(play) - 20.0f)) {
Math_ApproachF(&this->actor.speedXZ, 0.5f, 1.0f, 0.1f);
Math_ApproachF(&this->actor.speed, 0.5f, 1.0f, 0.1f);
} else {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.01f);
Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.01f);
if ((this->actor.speedXZ == 0.0f) || (this->actor.world.pos.y > (WATER_SURFACE_Y(play) - 5.0f))) {
if ((this->actor.speed == 0.0f) || (this->actor.world.pos.y > (WATER_SURFACE_Y(play) - 5.0f))) {
this->unk_1AC.x = Rand_ZeroFloat(300.0f);
this->unk_1AC.z = Rand_ZeroFloat(300.0f);
this->unk_1AC.y = this->actor.floorHeight + 10.0f;
@ -3222,7 +3222,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
if (sp124 > 40.0f) {
this->unk_188 = 0.7f;
this->unk_18C = 1200.0f;
Math_ApproachF(&this->actor.speedXZ, 0.5f, 1.0f, 0.01f);
Math_ApproachF(&this->actor.speed, 0.5f, 1.0f, 0.01f);
Math_ApproachF(&this->unk_1A8, 2048.0f, 1.0f, 128.0f);
} else {
this->unk_150 = -1;
@ -3285,7 +3285,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->unk_18C = 500.0f;
this->unk_172[0] = Rand_ZeroFloat(10.0f) + 2.0f;
}
Math_ApproachF(&this->actor.speedXZ, -0.2f, 1.0f, 0.1f);
Math_ApproachF(&this->actor.speed, -0.2f, 1.0f, 0.1f);
this->unk_156 = 1;
} else {
if (this->unk_156 != 0) {
@ -3293,7 +3293,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->unk_1A8 = 0.0f;
this->unk_18C = 3000.0f;
}
Math_ApproachF(&this->actor.speedXZ, 3.0f, 1.0f, 0.15f);
Math_ApproachF(&this->actor.speed, 3.0f, 1.0f, 0.15f);
this->unk_156 = 0;
}
@ -3377,7 +3377,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->unk_1AC.z = sLurePos.z + sp100.z;
this->unk_1AC.y = sLurePos.y - 10.0f;
this->unk_1A8 = 4096.0f;
Math_ApproachF(&this->actor.speedXZ, this->unk_180 * 0.8f, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, this->unk_180 * 0.8f, 1.0f, 1.0f);
if ((D_8090CD14 != 3) || (sLurePos.y > (WATER_SURFACE_Y(play) + 5.0f)) ||
(sqrtf(SQ(sLurePos.x) + SQ(sLurePos.z)) > 800.0f)) {
@ -3402,7 +3402,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->unk_149 = 50;
sp134 = 2;
this->unk_1AC = sLurePos;
Math_ApproachF(&this->actor.speedXZ, this->unk_180, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, this->unk_180, 1.0f, 1.0f);
if ((D_8090CD14 != 3) || (this->unk_172[0] == 0) || (sLurePos.y > (WATER_SURFACE_Y(play) + 5.0f)) ||
(sqrtf(SQ(sLurePos.x) + SQ(sLurePos.z)) > 800.0f)) {
@ -3467,7 +3467,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
case -3:
this->unk_149 = 50;
this->unk_1AC = sLurePos;
Math_ApproachF(&this->actor.speedXZ, 2.0f, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, 2.0f, 1.0f, 1.0f);
if ((D_8090CD14 != 3) || (this->unk_172[0] == 0) || (sLurePos.y > (WATER_SURFACE_Y(play) + 5.0f)) ||
(sqrtf(SQ(sLurePos.x) + SQ(sLurePos.z)) > 800.0f)) {
@ -3641,17 +3641,17 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
D_8091726C = 0.0f;
this->unk_188 = 1.6f;
this->unk_18C = 6000.0f;
Math_ApproachF(&this->actor.speedXZ, 7.5f, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, 7.5f, 1.0f, 1.0f);
Math_ApproachS(&this->unk_168, 0x4E20, 2, 0xFA0);
} else {
if ((D_80917274 == 0) && (D_80917206 == 2)) {
this->unk_188 = 1.0f;
this->unk_18C = 2000.0f;
Math_ApproachF(&this->actor.speedXZ, 3.0f, 1.0f, 0.2f);
Math_ApproachF(&this->actor.speed, 3.0f, 1.0f, 0.2f);
} else {
this->unk_188 = 1.4f;
this->unk_18C = 5000.0f;
Math_ApproachF(&this->actor.speedXZ, 5.0f, 1.0f, 0.5f);
Math_ApproachF(&this->actor.speed, 5.0f, 1.0f, 0.5f);
}
if (this->unk_148 == 0) {
@ -3676,7 +3676,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
D_8091726C = 1.3f - (this->unk_1A4 * 0.00899f * 1.4f);
}
Math_ApproachF(&this->actor.speedXZ, 2.0f, 1.0f, 0.5f);
Math_ApproachF(&this->actor.speed, 2.0f, 1.0f, 0.5f);
if (this->unk_172[1] == 0) {
this->unk_14A = 0;
@ -3697,7 +3697,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
}
if (D_80917274 || (D_80917206 != 2)) {
if (this->actor.speedXZ < 3.0f) {
if (this->actor.speed < 3.0f) {
if (D_809171FE & 8) {
sp100.x = -0.8f;
} else {
@ -3720,11 +3720,11 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
if ((SQ(sp10C.x) + SQ(sp10C.y) + SQ(sp10C.z)) > SQ(20.0f)) {
Math_ApproachF(&this->actor.world.pos.x, sReelLinePos[LINE_SEG_COUNT - 2].x, 0.2f,
2.0f * (this->actor.speedXZ * 1.5f));
2.0f * (this->actor.speed * 1.5f));
Math_ApproachF(&this->actor.world.pos.y, sReelLinePos[LINE_SEG_COUNT - 2].y, 0.2f,
2.0f * (this->actor.speedXZ * 1.5f) * 5.0f * 0.1f);
2.0f * (this->actor.speed * 1.5f) * 5.0f * 0.1f);
Math_ApproachF(&this->actor.world.pos.z, sReelLinePos[LINE_SEG_COUNT - 2].z, 0.2f,
2.0f * (this->actor.speedXZ * 1.5f));
2.0f * (this->actor.speed * 1.5f));
}
if (CHECK_BTN_ALL(input->cur.button, BTN_A) || (input->rel.stick_y < -30)) {
@ -3955,7 +3955,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
D_8090CF18 = 3;
}
Math_ApproachF(&this->actor.speedXZ, 5.0f, 1.0f, 1.0f);
Math_ApproachF(&this->actor.speed, 5.0f, 1.0f, 1.0f);
if (sp124 < 20.0f) {
Math_ApproachS(&this->unk_168, 0x4E20, 2, 0xFA0);
@ -4014,7 +4014,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
spF6 = -0x1F40;
}
if (this->actor.speedXZ >= 3.2f) {
if (this->actor.speed >= 3.2f) {
Math_ApproachS(&this->unk_166, spF6, 2, 0x4E20);
} else {
Math_ApproachS(&this->unk_166, spF6, 3, 0xBB8);
@ -4050,7 +4050,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
Math_ApproachS(&this->unk_15A, this->unk_160, spF0, spEE);
Math_ApproachS(&this->unk_15C, this->unk_162, spFA, 0x2000);
if (this->actor.speedXZ <= 0.5f) {
if (this->actor.speed <= 0.5f) {
Math_ApproachS(&this->actor.shape.rot.x, 0, 10, this->unk_170);
Math_ApproachS(&this->unk_170, 0x500, 1, 0x20);
} else {
@ -4081,14 +4081,14 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
if ((this->actor.world.pos.y < WATER_SURFACE_Y(play)) &&
(this->actor.world.pos.y > (WATER_SURFACE_Y(play) - 10.0f)) && !(this->unk_154 & 1) &&
(this->actor.speedXZ > 0.0f)) {
(this->actor.speed > 0.0f)) {
Vec3f pos = this->actor.world.pos;
pos.y = WATER_SURFACE_Y(play);
EnFishing_SpawnRipple(&this->actor.projectedPos, play->specialEffects, &pos, 80.0f, 500.0f, 150, 90);
}
if ((this->actor.speedXZ > 0.0f) || (this->unk_150 == 5)) {
if ((this->actor.speed > 0.0f) || (this->unk_150 == 5)) {
f32 velocityY = this->actor.velocity.y;
spD8 = this->unk_1A4 * 0.1f;
@ -5133,7 +5133,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
if ((D_809171FC != 0) && (D_8090CD4C == 0) && (player->actor.world.pos.z > 1360.0f) &&
(fabsf(player->actor.world.pos.x) < 25.0f)) {
player->actor.world.pos.z = 1360.0f;
player->actor.speedXZ = 0.0f;
player->actor.speed = 0.0f;
if (D_8090CD50 == 0) {
D_8090CD4C = 10;
@ -5306,7 +5306,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
// fallthrough
case 11:
player->actor.world.pos.z = 1360.0f;
player->actor.speedXZ = 0.0f;
player->actor.speed = 0.0f;
if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) {
Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN);
@ -5455,7 +5455,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
}
if ((player->actor.floorHeight < (WATER_SURFACE_Y(play) - 3.0f)) &&
(player->actor.world.pos.y < (player->actor.floorHeight + 3.0f)) && (player->actor.speedXZ > 1.0f) &&
(player->actor.world.pos.y < (player->actor.floorHeight + 3.0f)) && (player->actor.speed > 1.0f) &&
((play->gameplayFrames % 2) == 0)) {
Vec3f pos;
@ -5466,7 +5466,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
}
if ((player->actor.floorHeight < WATER_SURFACE_Y(play)) &&
(player->actor.floorHeight > (WATER_SURFACE_Y(play) - 10.0f)) && (player->actor.speedXZ >= 4.0f) &&
(player->actor.floorHeight > (WATER_SURFACE_Y(play) - 10.0f)) && (player->actor.speed >= 4.0f) &&
((play->gameplayFrames % 4) == 0)) {
s16 i;

View File

@ -259,7 +259,7 @@ void func_808D0A48(EnFloormas* this, PlayState* play) {
void func_808D0B08(EnFloormas* this) {
Animation_PlayOnce(&this->skelAnime, &gWallmasterIdleAnim);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_808D0B50;
}
@ -301,7 +301,7 @@ void func_808D0CE4(EnFloormas* this) {
}
this->unk_18E = Rand_S16Offset(2, 4);
this->actor.speedXZ = 1.5f;
this->actor.speed = 1.5f;
this->actionFunc = func_808D0D70;
}
@ -334,7 +334,7 @@ void func_808D0D70(EnFloormas* this, PlayState* play) {
void func_808D0ECC(EnFloormas* this) {
Animation_PlayOnce(&this->skelAnime, &gWallmasterStopWalkAnim);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_808D0F14;
}
@ -346,7 +346,7 @@ void func_808D0F14(EnFloormas* this, PlayState* play) {
void func_808D0F50(EnFloormas* this) {
this->unk_18E = 0;
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->skelAnime.playSpeed = 3.0f;
this->actionFunc = func_808D0F80;
}
@ -370,7 +370,7 @@ void func_808D0F80(EnFloormas* this, PlayState* play) {
void func_808D108C(EnFloormas* this) {
s16 sp36 = this->unk_190 - this->actor.shape.rot.y;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (sp36 > 0) {
Animation_MorphToPlayOnce(&this->skelAnime, &gFloormasterTurnAnim, -3.0f);
} else {
@ -419,7 +419,7 @@ void func_808D11BC(EnFloormas* this, PlayState* play) {
void func_808D1380(EnFloormas* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gWallmasterHoverAnim, 3.0f, 0.0f, Animation_GetLastFrame(&gWallmasterHoverAnim),
ANIMMODE_ONCE, -3.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = 0.0f;
func_808D08D0(this);
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, 1);
@ -460,7 +460,7 @@ void func_808D14DC(EnFloormas* this, PlayState* play) {
void func_808D161C(EnFloormas* this) {
this->unk_18E = 25;
this->actor.gravity = -0.15f;
this->actor.speedXZ = 0.5f;
this->actor.speed = 0.5f;
this->actionFunc = func_808D1650;
}
@ -471,7 +471,7 @@ void func_808D1650(EnFloormas* this, PlayState* play) {
this->unk_18E--;
}
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);
temp_f0_2 = this->actor.world.pos.y - this->actor.floorHeight;
@ -492,7 +492,7 @@ void func_808D1650(EnFloormas* this, PlayState* play) {
void func_808D1740(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 41.0f, 42.0f, ANIMMODE_ONCE, 5.0f);
if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != func_808D1650)) {
if ((this->actor.speed < 0.0f) || (this->actionFunc != func_808D1650)) {
this->unk_18E = 30;
} else {
this->unk_18E = 45;
@ -519,14 +519,14 @@ void func_808D17EC(EnFloormas* this, PlayState* play) {
}
if (this->actor.bgCheckFlags & 8) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
if (sp24 != 0) {
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)) {
func_808D14DC(this, play);
}
@ -575,7 +575,7 @@ void func_808D19D4(EnFloormas* this) {
this->actor.flags &= ~ACTOR_FLAG_400;
this->actor.flags |= ACTOR_FLAG_200;
this->actor.colChkInfo.health = 1;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
this->actor.velocity.y = 7.0f;
this->actionFunc = func_808D1B44;
}
@ -587,7 +587,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) {
this->unk_194 = 50;
func_808D0C14(this);
}
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
}
if (this->actor.bgCheckFlags & 2) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
@ -596,7 +596,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) {
void func_808D1BCC(EnFloormas* this) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f);
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->actionFunc = func_808D1C1C;
}
@ -624,7 +624,7 @@ void func_808D1D0C(EnFloormas* this) {
if (this->actionFunc != func_808D1C1C) {
Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f);
}
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->actionFunc = func_808D1D6C;
}
@ -667,7 +667,7 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) {
void func_808D1ED4(EnFloormas* this, PlayState* play) {
Vec3f sp34;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
sp34.x = this->actor.world.pos.x;
sp34.y = this->actor.world.pos.y + 15.0f;
@ -686,7 +686,7 @@ void func_808D1F7C(EnFloormas* this, PlayState* play) {
void func_808D1FD4(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_808D2040;
}
@ -697,11 +697,11 @@ void func_808D2040(EnFloormas* this, PlayState* play) {
if (this->skelAnime.curFrame < 20.0f) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
} else if (Animation_OnFrame(&this->skelAnime, 20.0f)) {
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->actor.velocity.y = 7.0f;
} else if (this->actor.bgCheckFlags & 2) {
this->unk_18E = 50;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
func_808D1740(this);
} else if ((this->actor.playerHeightRel < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) &&
@ -716,7 +716,7 @@ void func_808D217C(EnFloormas* this, Player* player) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 36.0f, 45.0f, ANIMMODE_ONCE, -3.0f);
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
func_808D08D0(this);
ptr = &D_808D3900[GET_PLAYER_FORM];
@ -759,7 +759,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) {
this->actor.shape.rot.x = 0;
this->actor.velocity.y = 6.0f;
this->actor.flags |= ACTOR_FLAG_1;
this->actor.speedXZ = -3.0f;
this->actor.speed = -3.0f;
func_808D1740(this);
} else if ((this->unk_190 % 20) == 0) {
Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset);
@ -770,7 +770,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) {
void func_808D2484(EnFloormas* this) {
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_808D24F0;
}
@ -791,7 +791,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) {
}
if (Animation_OnFrame(&this->skelAnime, 20.0f)) {
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->actor.velocity.y = 7.0f;
} else if (this->skelAnime.curFrame < 20.0f) {
Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, phi_s1), 2, 0xE38);
@ -801,14 +801,14 @@ void func_808D24F0(EnFloormas* this, PlayState* play) {
func_808D2A20(this);
this->collider.base.ocFlags1 |= OC1_ON;
} else if (this->actor.bgCheckFlags & 2) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
func_808D1740(this);
}
if ((fabsf(this->actor.world.pos.x - phi_s1->world.pos.x) < 5.0f) &&
(fabsf(this->actor.world.pos.z - phi_s1->world.pos.z) < 5.0f)) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f);
Math_StepToF(&this->actor.speed, 0.0f, 2.0f);
}
}
@ -817,7 +817,7 @@ void func_808D2700(EnFloormas* this) {
this->unk_18E = 0;
this->unk_194 = 1500;
this->actor.params = ENFLOORMAS_GET_7FFF_40;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
func_808D08D0(this);
this->actionFunc = func_808D2764;
}
@ -924,7 +924,7 @@ void func_808D2B18(EnFloormas* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gWallmasterDamageAnim, -3.0f);
func_800BE504(&this->actor, &this->collider);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20);
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
this->actor.velocity.y = 5.5f;
if (this->actor.params == ENFLOORMAS_GET_7FFF_40) {
EnFloormas* parent = (EnFloormas*)this->actor.parent;
@ -960,12 +960,12 @@ void func_808D2C08(EnFloormas* this, PlayState* play) {
}
}
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
}
void func_808D2CDC(EnFloormas* this) {
Animation_PlayOnce(&this->skelAnime, &gWallmasterRecoverFromDamageAnim);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_808D2D30;
@ -978,7 +978,7 @@ void func_808D2D30(EnFloormas* this, PlayState* play) {
}
void func_808D2D6C(EnFloormas* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}
@ -1085,8 +1085,8 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) {
if (this->actionFunc != func_808D2AA8) {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
this->actor.speedXZ *= -0.5f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, -5.0f);
this->actor.speed *= -0.5f;
this->actor.speed = CLAMP_MAX(this->actor.speed, -5.0f);
this->actor.velocity.y = 5.0f;
func_808D1740(this);
}

View File

@ -156,7 +156,7 @@ void func_80ACE51C(EnFuMato* this, PlayState* play) {
}
}
this->dyna.actor.speedXZ = 2.0f;
this->dyna.actor.speed = 2.0f;
this->dyna.actor.shape.rot.y = Math_Vec3f_Yaw(&this->dyna.actor.world.pos, &this->dyna.actor.parent->world.pos);
Actor_MoveWithGravity(&this->dyna.actor);

View File

@ -188,7 +188,7 @@ void EnFz_Init(Actor* thisx, PlayState* play) {
this->unk_BCE = 0;
this->unk_BD7 = 1;
this->unk_BD8 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.uncullZoneScale = 400.0f;
this->unk_BAC = this->actor.world.pos.y;
this->unk_BB4 = this->actor.world.pos.y;
@ -364,7 +364,7 @@ void func_80932C98(EnFz* this, PlayState* play) {
this->actor.bgCheckFlags &= ~0x8;
this->unk_BCD = 0;
this->unk_BBC = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
}
@ -405,7 +405,7 @@ void func_80932C98(EnFz* this, PlayState* play) {
this->unk_BCD = 0;
this->unk_BBC = 0.0f;
this->collider1.base.acFlags &= ~AC_HIT;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_BCA = 10;
func_809330D4(this);
} else if (this->collider2.base.acFlags & AC_BOUNCED) {
@ -572,7 +572,7 @@ void func_809333D8(EnFz* this, PlayState* play) {
void func_80933414(EnFz* this) {
this->unk_BD6 = 1;
this->unk_BBC = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_BCA = 40;
this->actionFunc = func_80933444;
}
@ -649,7 +649,7 @@ void func_809336C0(EnFz* this, PlayState* play) {
this->unk_BBC = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_BCC = 1;
this->unk_BCE = 0;
this->unk_BD8 = 1;
@ -672,7 +672,7 @@ void func_80933790(EnFz* this) {
this->unk_BCE = 0;
this->unk_BD8 = 1;
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_BBC = 0.0f;
this->actionFunc = func_809337D4;
}
@ -821,7 +821,7 @@ void EnFz_Update(Actor* thisx, PlayState* play) {
}
}
Math_StepToF(&this->actor.speedXZ, this->unk_BBC, 0.2f);
Math_StepToF(&this->actor.speed, this->unk_BBC, 0.2f);
Actor_MoveWithGravity(&this->actor);
if (this->unk_BCC != 0) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, 5);

View File

@ -202,7 +202,7 @@ void EnGe1_SetupPath(EnGe1* this, PlayState* play) {
this->picto.actor.world.rot.y = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &nextPoint);
this->picto.actor.world.rot.x = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &nextPoint);
this->picto.actor.speedXZ = 15.0f;
this->picto.actor.speed = 15.0f;
}
} else {
this->path = NULL;

View File

@ -104,7 +104,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) {
this->picto.actor.terminalVelocity = -9.0f;
this->picto.actor.gravity = -1.0f;
this->picto.actor.speedXZ = 1.5f;
this->picto.actor.speed = 1.5f;
this->actionFunc = EnGe2_Walk;
this->picto.validationFunc = EnGe2_ValidatePictograph;
@ -121,7 +121,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) {
Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, 0.0f);
this->actionFunc = EnGe2_GuardStationary;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->picto.actor.uncullZoneForward = 4000.0f;
break;
@ -263,7 +263,7 @@ void EnGe2_SetupBlownAwayPath(EnGe2* this, PlayState* play) {
this->picto.actor.world.rot.y = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &nextPoint);
this->picto.actor.world.rot.x = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &nextPoint);
this->picto.actor.speedXZ = 15.0f;
this->picto.actor.speed = 15.0f;
}
} else {
this->path = NULL;
@ -328,7 +328,7 @@ s32 EnGe2_FollowPathWithoutGravity(EnGe2* this) {
pitchTarget = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &point);
Math_SmoothStepToS(&this->picto.actor.world.rot.y, yawTarget, 0xA, 0x3E8, 0x64);
Math_SmoothStepToS(&this->picto.actor.world.rot.x, pitchTarget, 6, 0x7D0, 0xC8);
this->picto.actor.speedXZ = 15.0f;
this->picto.actor.speed = 15.0f;
Actor_MoveWithoutGravityReverse(&this->picto.actor);
@ -392,7 +392,7 @@ void EnGe2_CapturePlayer(EnGe2* this, PlayState* play) {
}
void EnGe2_SetupCapturePlayer(EnGe2* this) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->actionFunc = EnGe2_CapturePlayer;
Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f);
@ -430,7 +430,7 @@ void EnGe2_SetupCharge(EnGe2* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGerudoPurpleChargingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleChargingAnim), 0, -8.0f);
this->timer = 50;
this->picto.actor.speedXZ = 4.0f;
this->picto.actor.speed = 4.0f;
this->actionFunc = EnGe2_Charge;
}
}
@ -439,7 +439,7 @@ void EnGe2_SetupLookAround(EnGe2* this) {
Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f);
this->timer = 60;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->actionFunc = EnGe2_LookAround;
}
@ -479,20 +479,20 @@ void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) {
f32 visionRange = gSaveContext.save.isNight ? 200.0f : 280.0f;
if (player->csMode == 0x1A) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->actionFunc = EnGe2_SetupCharge;
Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f);
this->stateFlags |= GERUDO_PURPLE_STATE_CAPTURING;
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_80_08)) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->actionFunc = EnGe2_TurnToPlayerFast;
Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f);
} else if (EnGe2_LookForPlayer(play, &this->picto.actor, &this->picto.actor.focus.pos,
this->picto.actor.shape.rot.y, 0x1800, visionRange, this->verticalDetectRange)) {
if ((GERUDO_PURPLE_GET_EXIT(&this->picto.actor) != GERUDO_PURPLE_EXIT_NONE) && !Play_InCsMode(play)) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
func_800B7298(play, &this->picto.actor, 0x1A);
func_801000A4(NA_SE_SY_FOUND);
Message_StartTextbox(play, 0x1194, &this->picto.actor);
@ -504,14 +504,14 @@ void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) {
if ((this->collider.info.acHitInfo != NULL) &&
(this->collider.info.acHitInfo->toucher.dmgFlags & DMG_DEKU_NUT)) {
Actor_SetColorFilter(&this->picto.actor, 0, 120, 0, 400);
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->actionFunc = EnGe2_Stunned;
this->stateFlags |= GERUDO_PURPLE_STATE_STUNNED;
} else {
Animation_Change(&this->skelAnime, &gGerudoPurpleFallingToGroundAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGerudoPurpleFallingToGroundAnim), 2, -8.0f);
this->timer = 200;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->actionFunc = EnGe2_KnockedOut;
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_DEAD);
this->picto.actor.flags &= ~ACTOR_FLAG_1;
@ -566,7 +566,7 @@ void EnGe2_LookAround(EnGe2* this, PlayState* play) {
void EnGe2_Walk(EnGe2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
this->picto.actor.speedXZ = 1.5f;
this->picto.actor.speed = 1.5f;
switch (EnGe2_FollowPath(this)) {
case GERUDO_PURPLE_PATHSTATUS_END:
@ -634,7 +634,7 @@ void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) {
switch (this->csAction) {
case ENGE2_CSACTION_BEEHIVE_RUN_AWAY:
EnGe2_FollowPath(this);
this->picto.actor.speedXZ = 5.0f;
this->picto.actor.speed = 5.0f;
if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) {
Actor_PlaySfx(&this->picto.actor, NA_SE_EV_PIRATE_WALK);
@ -708,7 +708,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) {
this->stateFlags &= ~GERUDO_PURPLE_STATE_KO;
this->stateFlags &= ~GERUDO_PURPLE_STATE_PATH_REVERSE;
this->picto.actor.flags |= ACTOR_FLAG_20;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
}
this->actionFunc(this, play);

View File

@ -228,7 +228,7 @@ s32 func_80BB18FC(EnGeg* this, Actor* actor) {
if ((sp24 < 150.0f) && (fabsf(sp20) < 5.0f)) {
this->unk_230 |= 0x20;
actor->speedXZ = 0.0f;
actor->speed = 0.0f;
actor->velocity.y = 0.0f;
this->actor.child = actor;
actor->parent = &this->actor;
@ -741,13 +741,13 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) {
if ((this->actor.xzDistToPlayer < 150.0f) && (fabsf(this->actor.playerHeightRel) < 10.0f) &&
(this->actor.bgCheckFlags & 1)) {
this->unk_4AC = 2;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_230 &= ~1;
this->actor.shape.yOffset = 0.0f;
func_80BB2020(this, play);
this->actionFunc = func_80BB2E00;
} else {
this->actor.speedXZ = 5.0f;
this->actor.speed = 5.0f;
Actor_MoveWithGravity(&this->actor);
}
@ -841,7 +841,7 @@ void func_80BB3318(EnGeg* this, PlayState* play) {
func_800AEF44(Effect_GetByIndex(this->unk_4DC));
Actor_Kill(&this->actor);
} else {
Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 10.0f, 0.2f, 1.0f);
Actor_MoveWithGravity(&this->actor);
}
@ -1058,7 +1058,7 @@ void func_80BB3BE0(EnGeg* this, PlayState* play) {
}
void func_80BB3CB4(EnGeg* this, PlayState* play) {
f32 sp24 = play->state.frames * this->actor.speedXZ * 1400.0f;
f32 sp24 = play->state.frames * this->actor.speed * 1400.0f;
OPEN_DISPS(play->state.gfxCtx);

View File

@ -192,17 +192,17 @@ void func_80B3B120(EnGg2* this, PlayState* play) {
if (func_80B3B648(this, this->unk_1D8, this->unk_1DC) != 0) {
if (this->unk_1DC >= (this->unk_1D8->count - 2)) {
this->actionFunc = func_80B3AE60;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
this->unk_1DC++;
}
}
Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f);
}
}
void func_80B3B21C(EnGg2* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
this->unk_2E4 = ActorCutscene_GetAdditionalCutscene(this->unk_2E4);
this->actionFunc = func_80B3B5D4;
@ -256,7 +256,7 @@ void func_80B3B294(EnGg2* this, PlayState* play) {
}
}
}
Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f);
}
void func_80B3B4B0(EnGg2* this, PlayState* play) {

View File

@ -821,7 +821,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) {
}
if (ABS_ALT(sp36) < 0x2AAA) {
Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.2f, 0.5f);
Math_ApproachF(&this->actor.speed, 3.0f, 0.2f, 0.5f);
}
Actor_MoveWithGravity(&this->actor);
}

View File

@ -1770,7 +1770,7 @@ void func_80A153FC(EnGo* this, PlayState* play) {
func_80A118F8(this->unk_3F8, this->actor.world.pos);
this->actor.shape.rot.x = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_COLD);
@ -1809,8 +1809,8 @@ void func_80A153FC(EnGo* this, PlayState* play) {
func_800AEF44(Effect_GetByIndex(this->unk_3E8));
}
this->actor.speedXZ = 4.0f;
this->actor.shape.rot.x += (s16)(this->actor.speedXZ * 546.0f);
this->actor.speed = 4.0f;
this->actor.shape.rot.x += (s16)(this->actor.speed * 546.0f);
Actor_MoveWithGravity(&this->actor);
}
}

View File

@ -358,7 +358,7 @@ s32 func_8093F34C(EnGoroiwa* this) {
f32 x;
f32 z;
Math_StepToF(&this->actor.speedXZ, D_80942DFC[this->unk_1E4], 0.3f);
Math_StepToF(&this->actor.speed, D_80942DFC[this->unk_1E4], 0.3f);
Actor_UpdateVelocityWithGravity(&this->actor);
temp_v0 = &this->unk_1D0[this->unk_1D8];
this->actor.velocity.y *= 0.97f;
@ -368,7 +368,7 @@ s32 func_8093F34C(EnGoroiwa* this) {
tempX = x - this->actor.world.pos.x;
tempZ = z - this->actor.world.pos.z;
if (SQ(this->actor.speedXZ + 1.0f) < (SQ(tempX) + SQ(tempZ))) {
if (SQ(this->actor.speed + 1.0f) < (SQ(tempX) + SQ(tempZ))) {
this->actor.world.pos.x += this->actor.velocity.x;
this->actor.world.pos.y += this->actor.velocity.y;
this->actor.world.pos.z += this->actor.velocity.z;
@ -393,12 +393,12 @@ s32 func_8093F498(EnGoroiwa* this) {
sp2C.y = temp_v0->y;
sp2C.z = temp_v0->z;
Math_StepToF(&this->actor.speedXZ, D_80942DFC[this->unk_1E4], 0.3f);
Math_StepToF(&this->actor.speed, D_80942DFC[this->unk_1E4], 0.3f);
Math_Vec3f_Diff(&sp2C, &this->actor.world.pos, &this->actor.velocity);
temp_f0 = Math3D_Vec3fMagnitude(&this->actor.velocity);
if ((this->actor.speedXZ + 1.0f) < temp_f0) {
Math_Vec3f_Scale(&this->actor.velocity, this->actor.speedXZ / temp_f0);
if ((this->actor.speed + 1.0f) < temp_f0) {
Math_Vec3f_Scale(&this->actor.velocity, this->actor.speed / temp_f0);
this->actor.world.pos.x += this->actor.velocity.x;
this->actor.world.pos.y += this->actor.velocity.y;
this->actor.world.pos.z += this->actor.velocity.z;
@ -894,7 +894,7 @@ void func_80940E38(EnGoroiwa* this, PlayState* play) {
if (this->actor.flags & ACTOR_FLAG_40) {
if (this->actor.xzDistToPlayer < 1000.0f) {
sp5C = (1000.0f - this->actor.xzDistToPlayer) * 0.0012f * (this->actor.speedXZ * 0.1f);
sp5C = (1000.0f - this->actor.xzDistToPlayer) * 0.0012f * (this->actor.speed * 0.1f);
if (Rand_ZeroOne() < sp5C) {
this->unk_1CE += 20000;
sp46 = (s32)Rand_ZeroFloat(20000.0f) + this->unk_1CE;
@ -1049,7 +1049,7 @@ s32 func_8094156C(EnGoroiwa* this, PlayState* play) {
temp2 = Math_SinS(ptr->unk_1E);
temp3 = Math_SinS(this->actor.world.rot.y);
ptr->unk_0C = ((1.0f / D_80942DFC[this->unk_1E4]) * (temp3 * 14.0f * this->actor.speedXZ)) +
ptr->unk_0C = ((1.0f / D_80942DFC[this->unk_1E4]) * (temp3 * 14.0f * this->actor.speed)) +
(temp2 * (temp + 5.0f));
ptr->unk_10 = (Rand_ZeroOne() * 11.0f) + 20.0f;
@ -1057,7 +1057,7 @@ s32 func_8094156C(EnGoroiwa* this, PlayState* play) {
temp = Rand_ZeroOne();
temp2 = Math_CosS(ptr->unk_1E);
temp3 = Math_CosS(this->actor.world.rot.y);
ptr->unk_14 = ((1.0f / D_80942DFC[this->unk_1E4]) * ((temp3 * 14.0f) * this->actor.speedXZ)) +
ptr->unk_14 = ((1.0f / D_80942DFC[this->unk_1E4]) * ((temp3 * 14.0f) * this->actor.speed)) +
(temp2 * (temp + 5.0f));
ptr->unk_1C = 0;
@ -1218,7 +1218,7 @@ void func_80941DB4(EnGoroiwa* this) {
func_8093EAB0(this, 6);
this->actor.gravity = -0.86f;
this->actor.terminalVelocity = -15.0f;
this->actor.speedXZ *= 0.15f;
this->actor.speed *= 0.15f;
this->actor.velocity.y = 5.0f;
this->unk_1C4 = 1.0f;
}
@ -1237,7 +1237,7 @@ void func_80941EB4(EnGoroiwa* this) {
static s16 D_80942EAC[] = { 20, 6, 20 };
this->actionFunc = func_80941F10;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
func_8093EAB0(this, 6);
this->unk_1C8 = D_80942EAC[this->actor.home.rot.z & 3];
this->unk_1C4 = 0.0f;
@ -1257,7 +1257,7 @@ void func_80941F54(EnGoroiwa* this) {
this->actionFunc = func_80941FA4;
func_8093EAB0(this, 7);
this->unk_1C4 = 0.0f;
this->actor.velocity.y = fabsf(this->actor.speedXZ) * 0.1f;
this->actor.velocity.y = fabsf(this->actor.speed) * 0.1f;
}
void func_80941FA4(EnGoroiwa* this, PlayState* play) {
@ -1273,7 +1273,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play) {
} else if (func_8093F5EC(this)) {
func_8093FC00(this);
func_809419D0(this);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
}
}
@ -1283,7 +1283,7 @@ void func_80942084(EnGoroiwa* this) {
func_8093EAB0(this, 7);
this->unk_1C4 = 0.3f;
this->unk_1CA = 0;
this->actor.velocity.y = fabsf(this->actor.speedXZ) * -0.3f;
this->actor.velocity.y = fabsf(this->actor.speed) * -0.3f;
this->unk_1E5 |= 0x10;
this->unk_1E5 &= ~0x20;
}
@ -1302,7 +1302,7 @@ void func_809420F0(EnGoroiwa* this, PlayState* play) {
func_8093FC00(this);
func_809419D0(this);
this->unk_1E5 &= ~0x10;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
}
}
@ -1441,7 +1441,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) {
}
if ((ENGOROIWA_GET_3000(&this->actor) == ENGOROIWA_3000_2) && (this->actor.bgCheckFlags & 1) &&
(this->actionFunc == func_80941A10) && (this->actor.speedXZ > 2.0f)) {
(this->actionFunc == func_80941A10) && (this->actor.speed > 2.0f)) {
Math_StepToF(&this->actor.scale.x, 0.16f,
(this->actor.xzDistToPlayer < 400.0f) ? this->unk_1E0 * 1.4f : this->unk_1E0);

View File

@ -397,11 +397,11 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.z, this->targetRot.z, 5, 0x3E8, 5);
this->targetRot.z *= 0.8f;
if (this->waitTimer != 0) {
Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 0.5f);
Math_ApproachZeroF(&this->actor.speed, 0.2f, 0.5f);
} else {
this->targetRot.z = (this->actor.world.rot.y - this->targetRot.y) * 0.2f;
targetSpeed = (this->index * 0.1f) + 4.0f;
Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.7f);
Math_ApproachF(&this->actor.speed, targetSpeed, 0.4f, 0.7f);
Math_ApproachF(&this->rotationalVelocity, 2000.0f, 1.0f, 50.0f);
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRot.y, 5, this->rotationalVelocity, 5);
if (this->timer == 0) {
@ -464,7 +464,7 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) {
rotationSpeed = this->index + 70;
targetSpeed = (this->index * 0.05f) + 4.0f;
this->targetRot.y = Math_Atan2S(diffX, diffZ);
Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.8f);
Math_ApproachF(&this->actor.speed, targetSpeed, 0.4f, 0.8f);
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRot.y, rotationSpeed, 0xFA0, 0xA);
}
}
@ -478,7 +478,7 @@ void EnGrasshopper_SetupBank(EnGrasshopper* this) {
this->targetBankRot.y = this->actor.world.rot.y + 0x8000;
this->action = EN_GRASSHOPPER_ACTION_BANK;
this->bankState = EN_GRASSHOPPER_BANK_STATE_BANKING;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
this->actionFunc = EnGrasshopper_Bank;
}
@ -531,7 +531,7 @@ void EnGrasshopper_Bounced(EnGrasshopper* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG);
targetSpeed = (this->index * 0.05f) + 7.0f;
Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.8f);
Math_ApproachF(&this->actor.speed, targetSpeed, 0.4f, 0.8f);
Math_SmoothStepToS(&this->actor.world.rot.z, this->targetRot.z, 5, 0x3E8, 5);
this->targetRot.z *= 0.8f;
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRot.y, 5, this->rotationalVelocity, 5);
@ -603,7 +603,7 @@ void EnGrasshopper_SetupAttack(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_ATTACK);
this->approachSpeed = 0.0f;
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xFA0, 0xA);
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->baseFlyHeight = this->actor.world.pos.y;
this->collider.elements[0].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD);
this->collider.elements[1].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD);
@ -675,7 +675,7 @@ void EnGrasshopper_SetupWaitAfterAttack(EnGrasshopper* this) {
Math_ApproachF(&this->actor.world.pos.y, this->targetPosY, 0.1f, 10.0f);
this->action = EN_GRASSHOPPER_ACTION_WAIT_AFTER_ATTACK;
this->waitTimer = 20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->collider.elements[1].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD);
this->actionFunc = EnGrasshopper_WaitAfterAttack;
}
@ -697,7 +697,7 @@ void EnGrasshopper_SetupDamaged(EnGrasshopper* this, PlayState* play) {
Vec3f damagedVelocity;
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_DAMAGE);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.flags |= ACTOR_FLAG_1;
this->approachSpeed = 0.0f;
this->collider.elements[1].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD);
@ -727,7 +727,7 @@ void EnGrasshopper_Damaged(EnGrasshopper* this, PlayState* play) {
void EnGrasshopper_SetupDead(EnGrasshopper* this, PlayState* play) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_DEAD);
this->actor.flags |= ACTOR_FLAG_8000000;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->approachSpeed = 0.0f;
this->actor.velocity.y = 5.0f;
this->actor.gravity = -0.5f;
@ -768,7 +768,7 @@ void EnGrasshopper_Dead(EnGrasshopper* this, PlayState* play) {
void EnGrasshopper_SetupFall(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_FALL);
this->action = EN_GRASSHOPPER_ACTION_FALL;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->approachSpeed = 0.0f;
this->actionFunc = EnGrasshopper_Fall;
}

View File

@ -186,7 +186,7 @@ void func_80B22040(EnHakurock* this, PlayState* play) {
void func_80B220A8(EnHakurock* this) {
this->actor.params = EN_HAKUROCK_TYPE_BOULDER;
this->actor.draw = func_80B228F4;
this->actor.speedXZ = Rand_ZeroFloat(3.5f) + 2.5f;
this->actor.speed = Rand_ZeroFloat(3.5f) + 2.5f;
this->actor.velocity.y = Rand_ZeroFloat(4.5f) + 18.0f;
Actor_SetScale(&this->actor, (Rand_ZeroFloat(5.0f) + 15.0f) * 0.001f);
this->actor.world.rot.y = ((s32)Rand_Next() >> 0x12) + this->actor.parent->shape.rot.y + 0x8000;

View File

@ -191,7 +191,7 @@ void EnHg_ChasePlayer(EnHg* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
this->actor.speedXZ = 1.6f;
this->actor.speed = 1.6f;
if (!(player->stateFlags2 & PLAYER_STATE2_8000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) {
if (((this->skelAnime.curFrame > 9.0f) && (this->skelAnime.curFrame < 16.0f)) ||
((this->skelAnime.curFrame > 44.0f) && (this->skelAnime.curFrame < 51.0f))) {

View File

@ -316,7 +316,7 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) {
Actor_Kill(&this->actor);
}
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
this->actor.gravity = -2.0f;
this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_20C);
@ -360,7 +360,7 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play) {
if (this->unk_220 == 2) {
if (this->unk_22C <= sp58) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
func_80BDB1B4(this, 6);
}

View File

@ -182,7 +182,7 @@ void func_80C1FE20(EnHintSkb* this, PlayState* play) {
void func_80C1FE30(EnHintSkb* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actor.speedXZ = 1.6f;
this->actor.speed = 1.6f;
this->actionFunc = func_80C1FE80;
}
@ -199,7 +199,7 @@ void func_80C1FE80(EnHintSkb* this, PlayState* play) {
void func_80C1FF30(EnHintSkb* this) {
this->collider.base.atFlags &= ~AT_BOUNCED;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
this->actionFunc = func_80C1FF88;
}
@ -242,7 +242,7 @@ void func_80C200B8(EnHintSkb* this, PlayState* play) {
void func_80C2011C(EnHintSkb* this) {
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE);
this->actionFunc = func_80C2016C;
@ -250,10 +250,10 @@ void func_80C2011C(EnHintSkb* this) {
void func_80C2016C(EnHintSkb* this, PlayState* play) {
if (this->actor.bgCheckFlags & 2) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else if (this->actor.bgCheckFlags & 1) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.05f;
if (this->actor.speed < 0.0f) {
this->actor.speed += 0.05f;
}
}
@ -276,12 +276,12 @@ void func_80C20274(EnHintSkb* this) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8);
this->actor.gravity = -1.0f;
this->actor.speedXZ = 1.0f;
this->actor.speed = 1.0f;
} else {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -4.0f;
this->actor.speed = -4.0f;
}
}
Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE);
@ -295,14 +295,14 @@ void func_80C20334(EnHintSkb* this, PlayState* play) {
for (i = 0; i < 10; i++) {
func_80C215E4(play, this, &this->actor.world.pos);
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.05f;
} else if (this->actor.speedXZ != 0.0f) {
this->actor.speedXZ -= 0.05f;
if (this->actor.speed < 0.0f) {
this->actor.speed += 0.05f;
} else if (this->actor.speed != 0.0f) {
this->actor.speed -= 0.05f;
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 2500, 0);
}
@ -319,7 +319,7 @@ void func_80C20484(EnHintSkb* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
this->unk_3E8 |= 4;
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -6.0f;
this->actor.speed = -6.0f;
}
this->actionFunc = func_80C204F0;
}
@ -335,7 +335,7 @@ void func_80C204F0(EnHintSkb* this, PlayState* play) {
void func_80C20540(EnHintSkb* this) {
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE);
this->actionFunc = func_80C20590;
@ -363,7 +363,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) {
void func_80C2066C(EnHintSkb* this) {
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
this->actionFunc = func_80C2069C;
}
@ -388,7 +388,7 @@ void func_80C2069C(EnHintSkb* this, PlayState* play) {
void func_80C2075C(EnHintSkb* this) {
this->unk_3E0 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80C2077C;
}
@ -401,7 +401,7 @@ void func_80C2077C(EnHintSkb* this, PlayState* play) {
this->unk_3E6 = 0x1147;
if (this->skelAnime.animation == &object_skb_Anim_00697C) {
play->msgCtx.msgMode = 0x44;
this->actor.speedXZ = 2.4f;
this->actor.speed = 2.4f;
this->actor.gravity = -1.0f;
this->actor.velocity.y = 3.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8);
@ -455,7 +455,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) {
if (this->actor.bgCheckFlags & 2) {
s32 i;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
for (i = 0; i < 10; i++) {
func_80C215E4(play, this, &this->actor.world.pos);

File diff suppressed because it is too large Load Diff

View File

@ -120,11 +120,11 @@ f32 func_808DE728(EnHorseLinkChild* this) {
f32 phi_fv1;
if (this->unk_148 == 2) {
phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speedXZ * (1.0f / 2.0f);
phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speed * (1.0f / 2.0f);
} else if (this->unk_148 == 3) {
phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speedXZ * (1.0f / 3.0f);
phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speed * (1.0f / 3.0f);
} else if (this->unk_148 == 4) {
phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speedXZ * (1.0f / 5.0f);
phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speed * (1.0f / 5.0f);
} else {
phi_fv1 = D_808DFF18[this->unk_148];
}
@ -142,7 +142,7 @@ void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f);
this->unk_144 = 1;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 70.0f;
@ -186,7 +186,7 @@ void func_808DE9A8(EnHorseLinkChild* this) {
}
void func_808DEA0C(EnHorseLinkChild* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (SkelAnime_Update(&this->skin.skelAnime)) {
func_808DE9A8(this);
}
@ -194,7 +194,7 @@ void func_808DEA0C(EnHorseLinkChild* this, PlayState* play) {
void func_808DEA54(EnHorseLinkChild* this, s32 arg1) {
this->unk_144 = 2;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if ((arg1 != 0) && (arg1 != 1)) {
arg1 = 0;
@ -237,7 +237,7 @@ void func_808DEB14(EnHorseLinkChild* this, PlayState* play) {
void func_808DECA0(EnHorseLinkChild* this) {
this->unk_144 = 1;
this->unk_148 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_Change(&this->skin.skelAnime, D_808DFEC0[this->unk_148], func_808DE728(this), 0.0f,
Animation_GetLastFrame(D_808DFEC0[this->unk_148]), ANIMMODE_ONCE, -5.0f);
}
@ -268,14 +268,14 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) {
if ((temp_fv0 < 1000.0f) && (temp_fv0 >= 300.0f)) {
phi_v0 = 4;
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else if ((temp_fv0 < 300.0f) && (temp_fv0 >= 150.0f)) {
phi_v0 = 3;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
} else if ((temp_fv0 < 150.0f) && (temp_fv0 >= 70.0f)) {
phi_v0 = 2;
this->unk_1E8 = 0;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
} else {
func_808DEA54(this, 1);
return;
@ -295,7 +295,7 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) {
void func_808DEFE8(EnHorseLinkChild* this) {
this->unk_144 = 3;
this->unk_148 = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_Change(&this->skin.skelAnime, D_808DFEC0[this->unk_148], func_808DE728(this), 0.0f,
Animation_GetLastFrame(D_808DFEC0[this->unk_148]), ANIMMODE_ONCE, -5.0f);
}
@ -353,16 +353,16 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) {
if (Math3D_Distance(&player->actor.world.pos, &this->actor.home.pos) > 250.0f) {
if (sp44 >= 300.0f) {
sp48 = 4;
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else if ((sp44 < 300.0f) && (sp44 >= 150.0f)) {
sp48 = 3;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
} else if ((sp44 < 150.0f) && (sp44 >= 70.0f)) {
sp48 = 2;
this->unk_1E8 = 0;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_148 == 0) {
sp48 = (sp4C == 1) ? 1 : 0;
} else {
@ -371,16 +371,16 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) {
}
} else if (sp50 < 200.0f) {
sp48 = 4;
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else if (sp50 < 300.0f) {
sp48 = 3;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
} else if (sp50 < 400.0f) {
sp48 = 2;
this->unk_1E8 = 0;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_148 == 0) {
sp48 = (sp4C == 1) ? 1 : 0;
} else {
@ -388,7 +388,7 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) {
}
}
} else {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_148 == 0) {
sp48 = (sp4C == 1) ? 1 : 0;
} else {
@ -432,7 +432,7 @@ void func_808DF620(EnHorseLinkChild* this, PlayState* play) {
return;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
sp36 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
if ((Math_CosS(sp36) < 0.7071f) && (this->unk_148 == 2)) {
@ -455,7 +455,7 @@ void func_808DF788(EnHorseLinkChild* this) {
this->unk_144 = 4;
this->unk_148 = 2;
this->unk_1E0 = 0;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
Animation_Change(&this->skin.skelAnime, D_808DFEC0[this->unk_148], func_808DE728(this), 0.0f,
Animation_GetLastFrame(D_808DFEC0[this->unk_148]), ANIMMODE_ONCE, -5.0f);
}
@ -488,25 +488,25 @@ void func_808DF838(EnHorseLinkChild* this, PlayState* play) {
if (this->unk_1E0 == 0) {
if (phi_fv0 >= 300.0f) {
phi_v0 = 4;
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else if (phi_fv0 >= 150.0f) {
phi_v0 = 3;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
} else {
phi_v0 = 2;
this->unk_1E8 = 0;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
}
} else if (phi_fv0 >= 300.0f) {
phi_v0 = 4;
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
} else if (phi_fv0 >= 150.0f) {
phi_v0 = 3;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
} else if (phi_fv0 >= 70.0f) {
phi_v0 = 2;
this->unk_1E8 = 0;
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
} else {
func_808DF560(this);
return;

View File

@ -375,7 +375,7 @@ void EnIk_SetupIdle(EnIk* this) {
Animation_Change(&this->skelAnime, &gIronKnuckleEndHorizontalAttackAnim, 1.0f, frameCount, frameCount,
ANIMMODE_ONCE, this->timer);
this->actionFunc = EnIk_Idle;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnIk_Idle(EnIk* this, PlayState* play) {
@ -397,7 +397,7 @@ void EnIk_Idle(EnIk* this, PlayState* play) {
void EnIk_SetupWalk(EnIk* this) {
Animation_MorphToLoop(&this->skelAnime, &gIronKnuckleWalkAnim, -4.0f);
this->actor.speedXZ = 0.9f;
this->actor.speed = 0.9f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnIk_WalkTowardsPlayer;
}
@ -425,7 +425,7 @@ void EnIk_WalkTowardsPlayer(EnIk* this, PlayState* play) {
void EnIk_SetupRun(EnIk* this) {
Animation_MorphToLoop(&this->skelAnime, &gIronKnuckleRunAnim, -4.0f);
Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_VOICE);
this->actor.speedXZ = 2.5f;
this->actor.speed = 2.5f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnIk_RunTowardsPlayer;
}
@ -454,7 +454,7 @@ void EnIk_SetupVerticalAttack(EnIk* this) {
s32 pad;
f32 playbackSpeed;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->drawArmorFlags) {
playbackSpeed = 1.5f;
} else {
@ -488,11 +488,11 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) {
if ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 23.0f)) {
this->colliderQuad.base.atFlags |= AT_ON;
if (this->drawArmorFlags) {
this->actor.speedXZ = sin_rad((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f;
this->actor.speed = sin_rad((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f;
}
} else {
this->colliderQuad.base.atFlags &= ~AT_ON;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
if ((this->drawArmorFlags) && (this->skelAnime.curFrame < 13.0f)) {
@ -525,7 +525,7 @@ void EnIk_TakeOutAxe(EnIk* this, PlayState* play) {
}
void EnIk_SetupHorizontalDoubleAttack(EnIk* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_Change(&this->skelAnime, &gIronKnuckleHorizontalAttackAnim, (this->drawArmorFlags) ? 1.3f : 1.0f, 0.0f,
Animation_GetLastFrame(&gIronKnuckleHorizontalAttackAnim.common), ANIMMODE_ONCE_INTERP,
(this->drawArmorFlags) ? 4.0f : 10.0f);
@ -551,12 +551,12 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) {
} else {
phi_f2 = this->skelAnime.curFrame - 1.0f;
}
this->actor.speedXZ = sin_rad((M_PI / 8) * phi_f2) * 4.5f;
this->actor.speed = sin_rad((M_PI / 8) * phi_f2) * 4.5f;
}
this->colliderQuad.base.atFlags |= AT_ON;
} else {
this->colliderQuad.base.atFlags &= ~AT_ON;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
if (SkelAnime_Update(&this->skelAnime)) {
EnIk_SetupEndHorizontalAttack(this);
@ -566,7 +566,7 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) {
void EnIk_SetupSingleHorizontalAttack(EnIk* this) {
f32 playSpeed;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->drawArmorFlags) {
this->actor.world.rot.z = 0x1000;
playSpeed = 1.3f;
@ -611,7 +611,7 @@ void EnIk_EndHorizontalAttack(EnIk* this, PlayState* play) {
}
void EnIk_SetupBlock(EnIk* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_Change(&this->skelAnime, &gIronKnuckleBlockAnim, 2.0f, 0.0f,
Animation_GetLastFrame(&gIronKnuckleBlockAnim), ANIMMODE_ONCE, -2.0f);
this->timer = 20;
@ -634,7 +634,7 @@ void EnIk_SetupReactToAttack(EnIk* this, s32 arg1) {
if (arg1) {
func_800BE504(&this->actor, &this->colliderCylinder);
}
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
temp_v0 = (this->actor.world.rot.y - this->actor.shape.rot.y) + 0x8000;
if (ABS_ALT(temp_v0) <= 0x4000) {
Animation_MorphToPlayOnce(&this->skelAnime, &gIronKnuckleFrontHitAnim, -4.0f);
@ -645,7 +645,7 @@ void EnIk_SetupReactToAttack(EnIk* this, s32 arg1) {
}
void EnIk_ReactToAttack(EnIk* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
if (this->subCamId != SUB_CAM_ID_DONE) {
Play_SetCameraAtEye(play, this->subCamId, &this->actor.focus.pos, &Play_GetCamera(play, this->subCamId)->eye);
}
@ -664,7 +664,7 @@ void EnIk_ReactToAttack(EnIk* this, PlayState* play) {
}
void EnIk_SetupDie(EnIk* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_MorphToPlayOnce(&this->skelAnime, &gIronKnuckleDeathAnim, -4.0f);
this->timer = 24;
Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_DEAD);
@ -705,7 +705,7 @@ void EnIk_Die(EnIk* this, PlayState* play) {
void EnIk_SetupFrozen(EnIk* this) {
this->invincibilityFrames = 0;
this->actionFunc = EnIk_Frozen;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
void EnIk_Frozen(EnIk* this, PlayState* play) {
@ -724,7 +724,7 @@ void EnIk_Frozen(EnIk* this, PlayState* play) {
void EnIk_SetupCutscene(EnIk* this) {
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.colChkInfo.health != 0) {
func_800BE504(&this->actor, &this->colliderCylinder);
}

View File

@ -287,8 +287,8 @@ void func_808F3690(EnIn* this, PlayState* play) {
s16 sp36;
Vec3f sp28;
Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f);
sp36 = this->actor.speedXZ * 400.0f;
Math_SmoothStepToF(&this->actor.speed, 1.0f, 0.4f, 1000.0f, 0.0f);
sp36 = this->actor.speed * 400.0f;
if (SubS_CopyPointFromPath(this->path, this->unk244, &sp28) && SubS_MoveActorToPoint(&this->actor, &sp28, sp36)) {
this->unk244++;
if (this->unk244 >= this->path->count) {

View File

@ -181,9 +181,9 @@ void func_8091AC78(EnInsect* this) {
void func_8091ACC4(EnInsect* this, PlayState* play) {
f32 temp_f2;
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);
temp_f2 = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f);
temp_f2 = (Rand_ZeroOne() * 0.8f) + (this->actor.speed * 1.2f);
if (temp_f2 < 0.0f) {
this->skelAnime.playSpeed = 0.0f;
} else {
@ -218,7 +218,7 @@ void func_8091AE5C(EnInsect* this, PlayState* play) {
s32 pad;
f32 temp_f0;
Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, 1.5f, 0.1f, 0.5f, 0.0f);
if ((EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(40.0f)) ||
(this->unk_312 < 4)) {
@ -231,7 +231,7 @@ void func_8091AE5C(EnInsect* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
temp_f0 = this->actor.speedXZ * 1.4f;
temp_f0 = this->actor.speed * 1.4f;
this->skelAnime.playSpeed = CLAMP(temp_f0, 0.7f, 1.9f);
SkelAnime_Update(&this->skelAnime);
@ -261,7 +261,7 @@ void func_8091B07C(EnInsect* this, PlayState* play) {
s16 yaw;
s32 sp38 = this->actor.xzDistToPlayer < 40.0f;
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 ((EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(160.0f)) ||
(this->unk_312 < 4)) {
@ -284,7 +284,7 @@ void func_8091B07C(EnInsect* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
speed = this->actor.speedXZ * 1.6f;
speed = this->actor.speed * 1.6f;
this->skelAnime.playSpeed = CLAMP(speed, 0.8f, 1.9f);
SkelAnime_Update(&this->skelAnime);
@ -299,7 +299,7 @@ void func_8091B274(EnInsect* this) {
this->unk_312 = 200;
Actor_SetScale(&this->actor, 0.001f);
this->actor.draw = NULL;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->skelAnime.playSpeed = 0.3f;
this->actionFunc = func_8091B2D8;
this->unk_30C &= ~0x100;
@ -336,7 +336,7 @@ void func_8091B440(EnInsect* this, PlayState* play) {
s32 pad[2];
Vec3f sp34;
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);
Math_StepToS(&this->actor.shape.rot.x, 0x2AAA, 0x160);
Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.0002f, 0.001f));
@ -373,9 +373,9 @@ void func_8091B670(EnInsect* this, PlayState* play) {
Vec3f sp40;
if (this->unk_312 > 80) {
Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f);
Math_StepToF(&this->actor.speed, 0.6f, 0.08f);
} else {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f);
Math_StepToF(&this->actor.speed, 0.0f, 0.02f);
}
this->actor.velocity.y = 0.0f;
@ -417,7 +417,7 @@ void func_8091B670(EnInsect* this, PlayState* play) {
void func_8091B928(EnInsect* this) {
this->unk_312 = 100;
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.terminalVelocity = -0.8f;
this->actor.gravity = -0.04f;
this->unk_30C &= ~1;

View File

@ -1078,13 +1078,13 @@ void func_80B447C0(EnInvadepoh* this, PlayState* play) {
void func_80B44A90(EnInvadepoh* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
this->actor.velocity.y *= 0.3f;
this->actor.speedXZ *= 0.8f;
this->actor.speed *= 0.8f;
} else if (this->actor.bgCheckFlags & 8) {
this->actor.velocity.y *= 0.8f;
this->actor.speedXZ *= 0.3f;
this->actor.speed *= 0.3f;
} else {
this->actor.velocity.y *= 0.8f;
this->actor.speedXZ *= 0.8f;
this->actor.speed *= 0.8f;
}
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 40.0f, 0.0f, 5);
@ -1151,7 +1151,7 @@ s32 func_80B44C80(EnInvadepoh* this, PlayState* play) {
temp_f0_3 = temp_f0 - this->actor.world.pos.x;
temp_f0_2 = temp_f2 - this->actor.world.pos.z;
if (this->actor.speedXZ > 0.0f) {
if (this->actor.speed > 0.0f) {
if (Math3D_AngleBetweenVectors(&sp6C, &sp60, &sp44) != 0) {
sp40 = 1;
} else if (sp44 <= 0.0f) {
@ -2309,7 +2309,7 @@ void func_80B47D30(Actor* thisx, PlayState* play) {
if (D_80B4E940 == 3) {
if ((this->actionFunc == func_80B477B4) || (this->actionFunc == func_80B47600)) {
thisx->speedXZ = 0.0f;
thisx->speed = 0.0f;
thisx->velocity.y = 0.0f;
thisx->gravity = 0.0f;
func_80B47830(this);
@ -2320,8 +2320,8 @@ void func_80B47D30(Actor* thisx, PlayState* play) {
} else if (this->collider.base.acFlags & AC_HIT) {
Actor* acAttached = this->collider.base.ac;
thisx->speedXZ = acAttached->speedXZ * 0.5f;
thisx->speedXZ = CLAMP(thisx->speedXZ, -60.0f, 60.0f);
thisx->speed = acAttached->speed * 0.5f;
thisx->speed = CLAMP(thisx->speed, -60.0f, 60.0f);
thisx->world.rot.y = acAttached->world.rot.y;
thisx->gravity = 0.0f;
thisx->velocity.y = acAttached->velocity.y * 0.5f;
@ -2564,11 +2564,11 @@ void func_80B487B4(EnInvadepoh* this) {
void func_80B48848(EnInvadepoh* this, PlayState* play) {
s32 pad;
Math_StepToF(&this->actor.speedXZ, 1.6f, 0.1f);
if (func_80B44B84(this, play, this->actor.speedXZ, 50.0f)) {
Math_StepToF(&this->actor.speed, 1.6f, 0.1f);
if (func_80B44B84(this, play, this->actor.speed, 50.0f)) {
func_80B44514(this);
this->behaviorInfo.unk4C = 0xC8;
this->actor.speedXZ *= 0.25f;
this->actor.speed *= 0.25f;
} else {
Math_StepToS(&this->behaviorInfo.unk4C, 0x7D0, 0x46);
}
@ -2628,8 +2628,8 @@ void func_80B48AD4(EnInvadepoh* this, PlayState* play) {
s16 temp_v1;
s32 temp_v1_3;
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
if (func_80B44B84(this, play, this->actor.speedXZ, 50.0f)) {
Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
if (func_80B44B84(this, play, this->actor.speed, 50.0f)) {
func_80B44514(this);
}
@ -2687,7 +2687,7 @@ void func_80B48AD4(EnInvadepoh* this, PlayState* play) {
void func_80B48DE4(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f);
this->behaviorInfo.unk4C = 0;
substruct->unk30 = 0.05f;
@ -2836,13 +2836,13 @@ void func_80B49454(EnInvadepoh* this, PlayState* play) {
Math_Vec3f_Sum(&D_80B4EDD0[this->unk3AC], &this->actor.home.pos, &sp30);
if (Math3D_Vec3fDistSq(&this->actor.world.pos, &sp30) < SQ(400.0f)) {
this->actor.speedXZ *= 0.8f;
this->actor.speed *= 0.8f;
} else {
Math_StepToF(&this->actor.speedXZ, 170.0f, 21.0f);
this->actor.speedXZ *= 0.98f;
Math_StepToF(&this->actor.speed, 170.0f, 21.0f);
this->actor.speed *= 0.98f;
}
if (func_80B450C0(&this->actor.world.pos.x, &this->actor.world.pos.z, sp30.x, sp30.z, this->actor.speedXZ)) {
this->actor.speedXZ = 0.0f;
if (func_80B450C0(&this->actor.world.pos.x, &this->actor.world.pos.z, sp30.x, sp30.z, this->actor.speed)) {
this->actor.speed = 0.0f;
}
if (sp30.y < this->actor.world.pos.y) {
Math_StepToF(&this->actor.gravity, -12.0f, 7.0f);
@ -2877,9 +2877,9 @@ void func_80B49670(EnInvadepoh* this, PlayState* play) {
sp30.z = this->actor.home.pos.z;
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 0xA, 0xBB8, 0x64);
if ((play->gameplayFrames % 64) < 14) {
Math_StepToF(&this->actor.speedXZ, 5.0f, 1.0f);
Math_StepToF(&this->actor.speed, 5.0f, 1.0f);
} else {
this->actor.speedXZ *= 0.97f;
this->actor.speed *= 0.97f;
}
if (sp30.y < this->actor.world.pos.y) {
this->actor.gravity = -0.5f;
@ -2910,7 +2910,7 @@ void func_80B497EC(EnInvadepoh* this, PlayState* play) {
sp30.y = this->actor.home.pos.y + D_80B4E934.y + 400.0f;
sp30.z = this->actor.home.pos.z + D_80B4E934.z;
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 4, 0x1F40, 0x64);
Math_StepToF(&this->actor.speedXZ, 70.0f, 3.0f);
Math_StepToF(&this->actor.speed, 70.0f, 3.0f);
if (sp30.y < this->actor.world.pos.y) {
this->actor.gravity = -2.0f;
} else {
@ -2935,7 +2935,7 @@ void func_80B49904(EnInvadepoh* this) {
}
void func_80B4994C(EnInvadepoh* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 150.0f, 4.0f);
Math_StepToF(&this->actor.speed, 150.0f, 4.0f);
this->actor.velocity.y *= 0.95f;
Actor_MoveWithGravity(&this->actor);
if (this->actionTimer > 0) {
@ -2950,7 +2950,7 @@ void func_80B499BC(EnInvadepoh* this) {
this->scaleTarget = 0.2f;
this->scaleStep = 0.01f;
this->unk3AA = 3000;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80B49A00;
}
@ -2962,7 +2962,7 @@ void func_80B49A00(EnInvadepoh* this, PlayState* play) {
sp30.y = this->actor.home.pos.y + 800.0f;
sp30.z = this->actor.home.pos.z;
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 4, 0x1F40, 0x64);
Math_StepToF(&this->actor.speedXZ, 30.0f, 3.0f);
Math_StepToF(&this->actor.speed, 30.0f, 3.0f);
this->actor.velocity.y *= 0.98f;
if (sp30.y < this->actor.world.pos.y) {
this->actor.gravity = -0.5f;
@ -3234,11 +3234,11 @@ void func_80B4A614(EnInvadepoh* this) {
void func_80B4A67C(EnInvadepoh* this, PlayState* play) {
s32 pad;
Math_StepToF(&this->actor.speedXZ, 5.0f, 1.0f);
if (func_80B44B84(this, play, this->actor.speedXZ, 50.0f)) {
Math_StepToF(&this->actor.speed, 5.0f, 1.0f);
if (func_80B44B84(this, play, this->actor.speed, 50.0f)) {
func_80B44640(this);
this->behaviorInfo.unk4C = 0x5DC;
this->actor.speedXZ *= 0.5f;
this->actor.speed *= 0.5f;
} else {
Math_StepToS(&this->behaviorInfo.unk4C, 0x190, 0x32);
}
@ -3539,7 +3539,7 @@ void func_80B4B430(EnInvadepoh* this) {
}
void func_80B4B484(EnInvadepoh* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 1.1f, 0.5f);
Math_StepToF(&this->actor.speed, 1.1f, 0.5f);
if (func_80B44C80(this, play)) {
func_80B44690(this);
}
@ -3566,17 +3566,17 @@ void func_80B4B564(EnInvadepoh* this, PlayState* play) {
Vec3f sp28;
f32 temp_f0;
Math_StepToF(&this->actor.speedXZ, 3.8f, 0.45f);
Math_StepToF(&this->actor.speed, 3.8f, 0.45f);
if (this->unk3BC >= 0) {
Math_Vec3s_ToVec3f(&sp28, &this->pathPoints[this->unk3BC]);
temp_f0 = Math3D_Vec3fDistSq(&this->actor.world.pos, &sp28);
if (temp_f0 < SQ(80.0f)) {
this->actor.speedXZ *= 0.85f;
this->actor.speed *= 0.85f;
} else if (temp_f0 < SQ(150.0f)) {
this->actor.speedXZ *= 0.93f;
this->actor.speed *= 0.93f;
} else if (temp_f0 < SQ(250.0f)) {
this->actor.speedXZ *= 0.96f;
this->actor.speed *= 0.96f;
}
if (this->pathIndex == this->unk3BC || temp_f0 < SQ(50.0f)) {
this->actionTimer = 0;
@ -3607,7 +3607,7 @@ void func_80B4B724(EnInvadepoh* this) {
void func_80B4B768(EnInvadepoh* this, PlayState* play) {
s32 pad;
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
Math_SmoothStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &D_80B5040C->actor), 5, 0x1388,
0x64);
func_80B44E90(this, play);
@ -3625,7 +3625,7 @@ void func_80B4B820(EnInvadepoh* this) {
}
void func_80B4B864(EnInvadepoh* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 0.5f, 1.0f);
Math_StepToF(&this->actor.speed, 0.5f, 1.0f);
func_80B44E90(this, play);
if (this->animPlayFlag) {
func_80B4B510(this);

View File

@ -554,8 +554,8 @@ void func_8095E95C(EnIshi* this, PlayState* play) {
void func_8095EA70(EnIshi* this) {
f32 sp24;
this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
this->actor.velocity.z = Math_CosS(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.speed;
if (!ENISHI_GET_1(&this->actor)) {
sp24 = Rand_ZeroOne() - 0.9f;
D_8095F690 = sp24 * 11000.0f;

View File

@ -434,7 +434,7 @@ void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, PlayState* play) {
this->actionFunc = EnJg_Walk;
}
} else if (this->animIndex == EN_JG_ANIM_WALK) {
Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 0.0f, 0.2f, 1.0f);
EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, play);
}
}
@ -459,10 +459,10 @@ void EnJg_Walk(EnJg* this, PlayState* play) {
this->actionFunc = EnJg_AlternateTalkOrWalkInPlace;
} else {
this->currentPoint++;
Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f);
}
} else {
Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f);
}
}
@ -903,7 +903,7 @@ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->flags |= FLAG_LOOKING_AT_PLAYER;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->textId == 0xDAC) {
this->action = EN_JG_ACTION_FIRST_THAW;

View File

@ -254,7 +254,7 @@ s32 func_80968CB8(EnJs* this) {
return true;
}
Math_StepToF(&this->actor.speedXZ, this->unk_2B4, 0.5f);
Math_StepToF(&this->actor.speed, this->unk_2B4, 0.5f);
return false;
}
@ -667,7 +667,7 @@ void func_80969B5C(EnJs* this, PlayState* play) {
}
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->actionFunc = func_80969898;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2B4 = 0.0f;
func_80969AA0(this, play);
} else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, play)) {

View File

@ -492,7 +492,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) {
player->actor.world.pos.z = this->picto.actor.home.pos.z - 30.0f;
}
player->actor.speedXZ = 0.0f;
player->actor.speed = 0.0f;
this->picto.actor.world.pos.x = this->picto.actor.home.pos.x;
this->picto.actor.world.pos.z = this->picto.actor.home.pos.z;
Message_StartTextbox(play, D_80B8A8D0[sp54], &this->picto.actor);
@ -681,7 +681,7 @@ void func_80B86804(EnKaizoku* this, PlayState* play) {
this->unk_2D8 = 0;
this->action = KAIZOKU_ACTION_0;
this->actionFunc = func_80B868B8;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
}
void func_80B868B8(EnKaizoku* this, PlayState* play) {
@ -888,7 +888,7 @@ void func_80B86B74(EnKaizoku* this, PlayState* play) {
}
void func_80B872A4(EnKaizoku* this) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_0);
this->action = KAIZOKU_ACTION_1;
this->actionFunc = func_80B872F4;
@ -928,13 +928,13 @@ void func_80B874D8(EnKaizoku* this, PlayState* play) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_3);
if (Math_SinS(player->actor.shape.rot.y - this->picto.actor.shape.rot.y) > 0.0f) {
this->picto.actor.speedXZ = -10.0f;
this->picto.actor.speed = -10.0f;
} else if (Math_SinS(player->actor.shape.rot.y - this->picto.actor.shape.rot.y) < 0.0f) {
this->picto.actor.speedXZ = 10.0f;
this->picto.actor.speed = 10.0f;
} else if (Rand_ZeroOne() > 0.5f) {
this->picto.actor.speedXZ = 10.0f;
this->picto.actor.speed = 10.0f;
} else {
this->picto.actor.speedXZ = -10.0f;
this->picto.actor.speed = -10.0f;
}
this->skelAnime.playSpeed = 1.0f;
@ -952,17 +952,17 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) {
this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer + 0x3A98;
if ((this->picto.actor.bgCheckFlags & 8) ||
!Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speedXZ,
!Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed,
this->picto.actor.shape.rot.y + 0x4000)) {
if (this->picto.actor.bgCheckFlags & 8) {
if (this->picto.actor.speedXZ >= 0.0f) {
if (this->picto.actor.speed >= 0.0f) {
var_v0 = this->picto.actor.shape.rot.y + 0x4000;
} else {
var_v0 = this->picto.actor.shape.rot.y - 0x4000;
}
var_v0 = this->picto.actor.wallYaw - var_v0;
} else {
this->picto.actor.speedXZ *= -0.8f;
this->picto.actor.speed *= -0.8f;
var_v0 = 0;
}
@ -1006,7 +1006,7 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) {
}
}
} else {
if (this->picto.actor.speedXZ >= 0.0f) {
if (this->picto.actor.speed >= 0.0f) {
this->picto.actor.shape.rot.y += 0x4000;
} else {
this->picto.actor.shape.rot.y -= 0x4000;
@ -1021,7 +1021,7 @@ void func_80B87900(EnKaizoku* this) {
this->swordState = -1;
}
this->unk_2D8 = 0;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->unk_2B2 = Rand_S16Offset(10, 10);
this->bodyCollider.base.acFlags |= AC_HARD;
this->lookTimer = 12;
@ -1089,7 +1089,7 @@ void func_80B8798C(EnKaizoku* this, PlayState* play) {
void func_80B87C7C(EnKaizoku* this) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8);
this->picto.actor.speedXZ = 6.5f;
this->picto.actor.speed = 6.5f;
this->picto.actor.velocity.y = 15.0f;
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP);
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y;
@ -1126,7 +1126,7 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) {
this->swordCollider.info.elemType = ELEMTYPE_UNK2;
this->picto.actor.shape.rot.x = 0;
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y = this->picto.actor.yawTowardsPlayer;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->picto.actor.velocity.y = 0.0f;
this->picto.actor.world.pos.y = this->picto.actor.floorHeight;
func_80B87F70(this);
@ -1135,7 +1135,7 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) {
void func_80B87E28(EnKaizoku* this) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8);
this->picto.actor.speedXZ = -8.0f;
this->picto.actor.speed = -8.0f;
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP);
this->bodyCollider.info.elemType = ELEMTYPE_UNK4;
this->bodyCollider.base.colType = COLTYPE_NONE;
@ -1166,7 +1166,7 @@ void func_80B87F70(EnKaizoku* this) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_9);
this->unk_2D0 = 0;
this->swordCollider.base.atFlags &= ~AT_BOUNCED;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
AudioSfx_StopByPosAndId(&this->picto.actor.projectedPos, NA_SE_EN_PIRATE_BREATH);
this->action = KAIZOKU_ACTION_9;
this->actionFunc = func_80B87FDC;
@ -1182,7 +1182,7 @@ void func_80B87FDC(EnKaizoku* this, PlayState* play2) {
curFrame = this->skelAnime.curFrame;
sp2E = ABS_ALT(player->actor.shape.rot.y - this->picto.actor.shape.rot.y);
sp2C = ABS_ALT(this->picto.actor.yawTowardsPlayer - this->picto.actor.shape.rot.y);
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
if (Animation_OnFrame(&this->skelAnime, 1.0f)) {
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK);
@ -1233,7 +1233,7 @@ void func_80B87FDC(EnKaizoku* this, PlayState* play2) {
void func_80B88214(EnKaizoku* this) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8);
this->unk_2B2 = 0;
this->picto.actor.speedXZ = 10.0f;
this->picto.actor.speed = 10.0f;
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y = this->picto.actor.yawTowardsPlayer;
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP);
this->action = KAIZOKU_ACTION_5;
@ -1245,7 +1245,7 @@ void func_80B88278(EnKaizoku* this, PlayState* play) {
this->unk_2D8 = 0;
if (this->frameCount <= curFrame) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
if (!Actor_IsFacingPlayer(&this->picto.actor, 0x1554)) {
func_80B872A4(this);
this->unk_2B2 = Rand_ZeroOne() * 5.0f + 5.0f;
@ -1274,11 +1274,11 @@ void func_80B88378(EnKaizoku* this, PlayState* play) {
Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 1, 0x2EE, 0);
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y;
if (this->picto.actor.xzDistToPlayer <= 40.0f) {
Math_ApproachF(&this->picto.actor.speedXZ, -8.0f, 1.0f, 1.5f);
Math_ApproachF(&this->picto.actor.speed, -8.0f, 1.0f, 1.5f);
} else if (this->picto.actor.xzDistToPlayer > 55.0f) {
Math_ApproachF(&this->picto.actor.speedXZ, 8.0f, 1.0f, 1.5f);
Math_ApproachF(&this->picto.actor.speed, 8.0f, 1.0f, 1.5f);
} else {
Math_ApproachZeroF(&this->picto.actor.speedXZ, 2.0f, 6.65f);
Math_ApproachZeroF(&this->picto.actor.speed, 2.0f, 6.65f);
}
this->skelAnime.playSpeed = 1.0f;
@ -1375,7 +1375,7 @@ void func_80B88910(EnKaizoku* this) {
this->unk_2D0 = 0;
this->action = KAIZOKU_ACTION_11;
this->actionFunc = func_80B88964;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
}
void func_80B88964(EnKaizoku* this, PlayState* play) {
@ -1400,10 +1400,10 @@ void func_80B88964(EnKaizoku* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
this->swordState = 1;
this->picto.actor.speedXZ = 10.0f;
this->picto.actor.speed = 10.0f;
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK);
} else if (Animation_OnFrame(&this->skelAnime, 21.0f)) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
} else if (Animation_OnFrame(&this->skelAnime, 24.0f)) {
this->swordState = -1;
}
@ -1453,7 +1453,7 @@ void func_80B88964(EnKaizoku* this, PlayState* play) {
void func_80B88CD8(EnKaizoku* this) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_3);
this->picto.actor.speedXZ = randPlusMinusPoint5Scaled(12.0f);
this->picto.actor.speed = randPlusMinusPoint5Scaled(12.0f);
this->skelAnime.playSpeed = 1.0f;
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y;
this->unk_2B2 = Rand_ZeroOne() * 30.0f + 30.0f;
@ -1474,39 +1474,39 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) {
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y + 0x4000;
sp2A = player->actor.shape.rot.y + 0x8000;
if (Math_SinS(sp2A - this->picto.actor.shape.rot.y) >= 0.0f) {
this->picto.actor.speedXZ -= 0.25f;
if (this->picto.actor.speedXZ < -8.0f) {
this->picto.actor.speedXZ = -8.0f;
this->picto.actor.speed -= 0.25f;
if (this->picto.actor.speed < -8.0f) {
this->picto.actor.speed = -8.0f;
}
} else if (Math_SinS((sp2A - this->picto.actor.shape.rot.y)) < 0.0f) {
this->picto.actor.speedXZ += 0.25f;
if (this->picto.actor.speedXZ > 8.0f) {
this->picto.actor.speedXZ = 8.0f;
this->picto.actor.speed += 0.25f;
if (this->picto.actor.speed > 8.0f) {
this->picto.actor.speed = 8.0f;
}
}
if ((this->picto.actor.bgCheckFlags & 8) ||
!Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speedXZ,
!Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed,
this->picto.actor.shape.rot.y + 0x4000)) {
if (this->picto.actor.bgCheckFlags & 8) {
if (this->picto.actor.speedXZ >= 0.0f) {
if (this->picto.actor.speed >= 0.0f) {
yaw = this->picto.actor.shape.rot.y + 0x4000;
} else {
yaw = this->picto.actor.shape.rot.y - 0x4000;
}
yaw = this->picto.actor.wallYaw - yaw;
} else {
this->picto.actor.speedXZ *= -0.8f;
this->picto.actor.speed *= -0.8f;
yaw = 0;
}
if (ABS_ALT(yaw) > 0x4000) {
this->picto.actor.speedXZ *= -0.8f;
if (this->picto.actor.speedXZ < 0.0f) {
this->picto.actor.speedXZ -= 0.5f;
this->picto.actor.speed *= -0.8f;
if (this->picto.actor.speed < 0.0f) {
this->picto.actor.speed -= 0.5f;
} else {
this->picto.actor.speedXZ += 0.5f;
this->picto.actor.speed += 0.5f;
}
}
}
@ -1551,7 +1551,7 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) {
// EnKaizoku_SetupStunned
void func_80B891B8(EnKaizoku* this) {
if (this->picto.actor.bgCheckFlags & 1) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
}
if (this->action == KAIZOKU_ACTION_11) {
@ -1586,12 +1586,12 @@ void func_80B89280(EnKaizoku* this, PlayState* play) {
}
if (this->picto.actor.bgCheckFlags & 2) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
}
if (this->picto.actor.bgCheckFlags & 1) {
if (this->picto.actor.speedXZ < 0.0f) {
this->picto.actor.speedXZ += 0.05f;
if (this->picto.actor.speed < 0.0f) {
this->picto.actor.speed += 0.05f;
}
}
@ -1619,7 +1619,7 @@ void func_80B893CC(EnKaizoku* this, PlayState* play) {
Math_Vec3f_Copy(&this->unk_3C4, &sp34);
this->lookTimer = 0;
this->unk_2D8 = 0;
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_5);
if (((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
@ -1674,7 +1674,7 @@ void func_80B8960C(EnKaizoku* this, PlayState* play) {
(this->unk_2B8 == 0)) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
this->unk_2D8 = 1;
func_800B7298(play, &this->picto.actor, 0x7B);
Enemy_StartFinishingBlow(play, &this->picto.actor);
@ -1693,11 +1693,11 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) {
Player* player;
if (this->picto.actor.bgCheckFlags & 2) {
this->picto.actor.speedXZ = 0.0f;
this->picto.actor.speed = 0.0f;
}
if (this->picto.actor.bgCheckFlags & 1) {
Math_SmoothStepToF(&this->picto.actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
Math_SmoothStepToF(&this->picto.actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
}
if ((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||

View File

@ -185,7 +185,7 @@ void func_80AD7018(EnKame* this, PlayState* play) {
void func_80AD70A0(EnKame* this) {
Animation_MorphToPlayOnce(&this->skelAnime1, &object_tl_Anim_004210, -5.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80AD70EC;
}
@ -207,7 +207,7 @@ void func_80AD70EC(EnKame* this, PlayState* play) {
void func_80AD71B4(EnKame* this) {
Animation_MorphToLoop(&this->skelAnime1, &object_tl_Anim_00823C, -5.0f);
this->actor.speedXZ = 0.5f;
this->actor.speed = 0.5f;
this->unk_29E = Animation_GetLastFrame(&object_tl_Anim_00823C) * ((s32)Rand_ZeroFloat(5.0f) + 3);
this->unk_2A4 = this->actor.shape.rot.y;
this->collider.base.acFlags |= (AC_HARD | AC_ON);
@ -246,7 +246,7 @@ void func_80AD73A8(EnKame* this) {
this->unk_29E = 0;
this->unk_2AC = 1.0f;
this->unk_2A8 = 1.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->unk_2A0 == 0) {
Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_VOICE);
}
@ -278,7 +278,7 @@ void func_80AD7424(EnKame* this, PlayState* play) {
}
void func_80AD7568(EnKame* this) {
this->actor.speedXZ = this->unk_2A6 * (5.0f / 7552);
this->actor.speed = this->unk_2A6 * (5.0f / 7552);
this->actor.shape.rot.z = this->unk_2A6 * 0.11016949f;
}
@ -287,7 +287,7 @@ void func_80AD75A8(EnKame* this, PlayState* play) {
static Color_RGBA8 D_80AD8E58 = { 180, 180, 180, 255 };
static Vec3f D_80AD8E5C = { 0.0f, 0.75f, 0.0f };
if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ >= 3.0f)) {
if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 3.0f)) {
if ((play->gameplayFrames % 2) == 0) {
u32 temp_v0 = func_800C9BB8(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
@ -312,7 +312,7 @@ void func_80AD76CC(EnKame* this) {
this->unk_2AC = 0.5f;
func_80AD7568(this);
this->unk_29E = 15;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_ON);
this->unk_2BC.y = this->actor.home.pos.y - 100.0f;
} else {
@ -401,7 +401,7 @@ void func_80AD7948(EnKame* this, PlayState* play) {
void func_80AD7B18(EnKame* this) {
this->actor.draw = EnKame_Draw;
Animation_MorphToPlayOnce(&this->skelAnime1, &object_tl_Anim_0031DC, -3.0f);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk_2AC = 0.1f;
this->unk_2A8 = 1.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@ -434,7 +434,7 @@ void func_80AD7C54(EnKame* this) {
}
this->actor.draw = EnKame_Draw;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT);
@ -460,7 +460,7 @@ void func_80AD7DA4(EnKame* this) {
this->collider.base.acFlags |= AC_ON;
this->collider.base.acFlags &= ~AC_HARD;
this->collider.base.colType = COLTYPE_HIT6;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80AD7E0C;
}
@ -498,7 +498,7 @@ void func_80AD7F10(EnKame* this, PlayState* play) {
}
void func_80AD7FA4(EnKame* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->actor.velocity.y > 0.0f) {
this->actor.velocity.y = 0.0f;
}
@ -545,7 +545,7 @@ void func_80AD8148(EnKame* this, PlayState* play) {
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.atFlags &= ~(AC_HARD | AC_HIT);
this->actor.velocity.y = 15.0f;
this->actor.speedXZ = 1.5f;
this->actor.speed = 1.5f;
if (play != NULL) {
Enemy_StartFinishingBlow(play, &this->actor);
if (this->actor.draw == func_80AD8D64) {
@ -581,7 +581,7 @@ void func_80AD825C(EnKame* this, PlayState* play) {
void func_80AD8364(EnKame* this) {
this->unk_29E = 20;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = func_80AD8388;
}

View File

@ -359,10 +359,10 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
if ((hitItem->toucher.dmgFlags & 0x10) || (hitItem->toucher.dmgFlags & 8) ||
(hitItem->toucher.dmgFlags & 0x80000000)) {
piece->actor.velocity.y = Rand_ZeroFloat(3.0f) + 6.0f;
piece->actor.speedXZ = Rand_ZeroFloat(4.0f) + 6.0f;
piece->actor.speed = Rand_ZeroFloat(4.0f) + 6.0f;
} else {
piece->actor.velocity.y = Rand_ZeroFloat(2.0f) + 3.0f;
piece->actor.speedXZ = Rand_ZeroFloat(2.0f) + 3.0f;
piece->actor.speed = Rand_ZeroFloat(2.0f) + 3.0f;
}
if (piece->partCount >= 4) {
@ -499,7 +499,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
if (!(this->actor.bgCheckFlags & 1)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND);
}
this->actor.speedXZ *= -0.5f;
this->actor.speed *= -0.5f;
}
if (this->actor.bgCheckFlags & 0x40) {
@ -539,12 +539,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
if (this->unk_197 != 0) {
if (this->unk_197 > 0) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else if ((this->floorRot.x > 0.1f) || (this->floorRot.z > 0.1f)) {
this->airTimer = 10;
if (this->actor.bgCheckFlags & 8) {
this->actionState = ENKANBAN_GROUND;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
goto nextCase;
} else {
Vec3f spC8;
@ -556,14 +556,14 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
Math_ApproachF(&this->actor.velocity.z, spC8.z, 0.5f, (KREG(21) * 0.01f) + 0.3f);
this->actor.world.rot.y = Math_Atan2S(spC8.x, spC8.z);
this->unk_198 = 1;
this->actor.speedXZ = sqrtf(SQXZ(this->actor.velocity));
this->actor.speed = sqrtf(SQXZ(this->actor.velocity));
}
} else {
this->unk_198 = 0;
Math_ApproachZeroF(&this->actor.speedXZ, 1, 0.1f);
Math_ApproachZeroF(&this->actor.speed, 1, 0.1f);
}
} else {
this->actor.speedXZ *= 0.7f;
this->actor.speed *= 0.7f;
}
if (this->spinRot.x == 0) {
@ -687,38 +687,38 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
s16 rippleDelay;
s32 rippleScale;
if ((player->actor.speedXZ > 0.0f) && (player->actor.world.pos.y < this->actor.world.pos.y) &&
if ((player->actor.speed > 0.0f) && (player->actor.world.pos.y < this->actor.world.pos.y) &&
(this->actor.xyzDistToPlayerSq < SQ(50.0f))) {
Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 1.0f, 0.2f);
if (this->actor.speedXZ > 1.0f) {
this->actor.speedXZ = 1.0f;
Math_ApproachF(&this->actor.speed, player->actor.speed, 1.0f, 0.2f);
if (this->actor.speed > 1.0f) {
this->actor.speed = 1.0f;
}
if (Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 1,
0x1000, 0) > 0) {
this->spinVel.y = this->actor.speedXZ * 1000.0f;
this->spinVel.y = this->actor.speed * 1000.0f;
} else {
this->spinVel.y = this->actor.speedXZ * -1000.0f;
this->spinVel.y = this->actor.speed * -1000.0f;
}
}
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
Actor_MoveWithGravity(&this->actor);
if (this->actor.speedXZ != 0.0f) {
if (this->actor.speed != 0.0f) {
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, 5);
if (this->actor.bgCheckFlags & 8) {
this->actor.speedXZ *= -0.5f;
this->actor.speed *= -0.5f;
if (this->spinVel.y > 0) {
this->spinVel.y = -2000;
} else {
this->spinVel.y = 2000;
}
}
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.15f);
Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.15f);
}
this->actor.shape.rot.y += this->spinVel.y;
Math_ApproachS(&this->spinVel.y, 0, 1, 0x3A);
@ -728,9 +728,9 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
Math_ApproachZeroF(&this->floorRot.x, 0.5f, 0.2f);
Math_ApproachZeroF(&this->floorRot.z, 0.5f, 0.2f);
if (fabsf(this->actor.speedXZ) > 1.0f) {
if (fabsf(this->actor.speed) > 1.0f) {
rippleDelay = 0;
} else if (fabsf(this->actor.speedXZ) > 0.5f) {
} else if (fabsf(this->actor.speed) > 0.5f) {
rippleDelay = 3;
} else {
rippleDelay = 7;
@ -756,12 +756,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->bounceX = Rand_ZeroFloat(10.0f) + 6.0f;
this->bounceZ = Rand_ZeroFloat(10.0f) + 6.0f;
this->actor.velocity.y = 2.0f + hammerStrength;
this->actor.speedXZ = Rand_ZeroFloat(1.0f);
this->actor.speed = Rand_ZeroFloat(1.0f);
} else {
this->bounceX = Rand_ZeroFloat(7.0f) + 3.0f;
this->bounceZ = Rand_ZeroFloat(7.0f) + 3.0f;
this->actor.velocity.y = 3.0f + hammerStrength;
this->actor.speedXZ = Rand_ZeroFloat(1.5f);
this->actor.speed = Rand_ZeroFloat(1.5f);
}
this->spinVel.y = randPlusMinusPoint5Scaled(0x1800);
@ -801,12 +801,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->bounceX = Rand_ZeroFloat(10.0f) + 6.0f;
this->bounceZ = Rand_ZeroFloat(10.0f) + 6.0f;
this->actor.velocity.y = 2.5f + bombStrength;
this->actor.speedXZ = 3.0f + bombStrength;
this->actor.speed = 3.0f + bombStrength;
} else {
this->bounceX = Rand_ZeroFloat(7.0f) + 3.0f;
this->bounceZ = Rand_ZeroFloat(7.0f) + 3.0f;
this->actor.velocity.y = 5.0f + bombStrength;
this->actor.speedXZ = 4.0f + bombStrength;
this->actor.speed = 4.0f + bombStrength;
}
this->spinVel.y = randPlusMinusPoint5Scaled(0x1800);

View File

@ -380,7 +380,7 @@ void EnKarebaba_SetupDying(EnKarebaba* this) {
this->actor.gravity = -0.8f;
this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
} else {
this->timer = 3;
}
@ -401,13 +401,13 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) {
this->timer--;
if (this->timer == 0) {
this->actor.gravity = -0.8f;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
EnKarebaba_SpawnIceEffects(this, play);
}
} else {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f);
Math_StepToF(&this->actor.speed, 0.0f, 0.1f);
if (this->timer == 0) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
@ -417,7 +417,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) {
this->actor.scale.z = 0.0f;
this->actor.scale.y = 0.0f;
this->actor.scale.x = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10,
NULL);

View File

@ -512,8 +512,8 @@ void EnKusa_LiftedUp(EnKusa* this, PlayState* play) {
if (Actor_HasNoParent(&this->actor, play)) {
this->actor.room = play->roomCtx.curRoom.num;
EnKusa_SetupFall(this);
this->actor.velocity.x = this->actor.speedXZ * Math_SinS(this->actor.world.rot.y);
this->actor.velocity.z = this->actor.speedXZ * Math_CosS(this->actor.world.rot.y);
this->actor.velocity.x = this->actor.speed * Math_SinS(this->actor.world.rot.y);
this->actor.velocity.z = this->actor.speed * Math_CosS(this->actor.world.rot.y);
this->actor.colChkInfo.mass = 80;
this->actor.gravity = -0.1f;
EnKusa_UpdateVelY(this);

View File

@ -1038,7 +1038,7 @@ void func_80A5D9C8(EnKusa2* this, PlayState* play) {
this->actor.colChkInfo.mass = 80;
this->actor.home.rot.y = this->actor.world.rot.y;
this->actor.velocity.y = 12.5f;
this->actor.speedXZ += 3.0f;
this->actor.speed += 3.0f;
Actor_MoveWithGravity(&this->actor);
func_80A5BAFC(this, play);
func_80A5CD0C(this);
@ -1137,10 +1137,10 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) {
Math_StepToF(&this->actor.scale.x, 0.4f, 0.032f);
this->unk_1C4 += 0x4650;
this->actor.scale.z = this->actor.scale.x;
this->actor.speedXZ = fabsf(Math_CosS(this->unk_1C4) + 0.5f) * 1.5f;
this->actor.speed = fabsf(Math_CosS(this->unk_1C4) + 0.5f) * 1.5f;
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ = 0.0f;
if (this->actor.speed < 0.0f) {
this->actor.speed = 0.0f;
}
Actor_MoveWithGravity(&this->actor);
@ -1165,7 +1165,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) {
if (this->unk_1C8 <= 0) {
func_80A5CD0C(this);
func_80A5BB40(this, play, 4);
this->actor.speedXZ += 4.0f;
this->actor.speed += 4.0f;
this->actor.velocity.y = (Rand_ZeroOne() * 4.0f) + 15.0f;
func_80A5E1D8(this);
} else if (this->actor.bgCheckFlags & 1) {
@ -1174,7 +1174,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) {
func_80A5CD0C(this);
func_80A5BB40(this, play, 2);
this->actor.velocity.y = (Rand_ZeroOne() * 6.0f) + 7.0f;
this->actor.speedXZ += 2.0f;
this->actor.speed += 2.0f;
if (this->actor.yawTowardsPlayer < this->actor.world.rot.y) {
sp20 = 10000;
} else {
@ -1201,7 +1201,7 @@ void func_80A5E210(EnKusa2* this, PlayState* play) {
Math_StepToF(&this->actor.gravity, -4.0f, 0.5f);
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ *= 0.4f;
this->actor.speed *= 0.4f;
if (this->actor.bgCheckFlags & 2) {
func_80A5D178(this);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_KUSAMUSHI_HIDE);
@ -1253,7 +1253,7 @@ void func_80A5E418(EnKusa2* this) {
this->actor.velocity.y *= 0.25f;
this->actor.velocity.z *= 0.1f;
this->actor.draw = func_80A5EA48;
this->actor.speedXZ *= 0.1f;
this->actor.speed *= 0.1f;
this->actor.gravity *= 0.25f;
this->unk_1CC = Rand_S16Offset(-800, 1600);
this->actionFunc = func_80A5E4BC;

View File

@ -674,7 +674,7 @@ void func_80AEACF8(EnLiftNuts* this, PlayState* play) {
}
void func_80AEAEAC(EnLiftNuts* this) {
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
func_80AE9AC4(this, 1);
func_80AE9B4C(1, 1);
@ -685,7 +685,7 @@ void func_80AEAF14(EnLiftNuts* this, PlayState* play) {
f32 dist;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 10, 0x1000, 0x500);
dist = Math_Vec3f_StepTo(&this->actor.world.pos, &this->vec_1D8, this->actor.speedXZ);
dist = Math_Vec3f_StepTo(&this->actor.world.pos, &this->vec_1D8, this->actor.speed);
this->actor.world.pos.y += this->actor.gravity;
if (dist == 0.0f) {
@ -739,7 +739,7 @@ void func_80AEB148(EnLiftNuts* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->stateFlags3 & PLAYER_STATE3_200) {
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
SET_EVENTINF(EVENTINF_34);
Interface_StartTimer(4, 0);
func_80AE9B4C(1, 2);
@ -749,7 +749,7 @@ void func_80AEB148(EnLiftNuts* this, PlayState* play) {
}
void func_80AEB1C8(EnLiftNuts* this) {
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
SET_EVENTINF(EVENTINF_34);
Interface_StartTimer(4, 0);
func_80AE9B4C(1, 2);

View File

@ -151,17 +151,17 @@ void EnLookNuts_Patrol(EnLookNuts* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (Play_InCsMode(play)) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
return;
}
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
}
if (D_80A6862C != 0) {
Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 1.0f);
Math_ApproachZeroF(&this->actor.speed, 0.3f, 1.0f);
return;
}
@ -207,7 +207,7 @@ void EnLookNuts_StandAndWait(EnLookNuts* this, PlayState* play) {
s16 randOffset;
SkelAnime_Update(&this->skelAnime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 1.0f);
Math_ApproachZeroF(&this->actor.speed, 0.3f, 1.0f);
if (!Play_InCsMode(play) && (D_80A6862C == 0) && (this->eventTimer == 0)) {
this->eventTimer = 10;
switch (this->waitTimer) {
@ -276,10 +276,10 @@ void EnLookNuts_RunToPlayer(EnLookNuts* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
}
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0);
if ((this->actor.xzDistToPlayer < 70.0f) || (this->eventTimer == 0)) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
EnLookNuts_SetupSendPlayerToSpawn(this);
}
}

View File

@ -260,7 +260,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) {
sAnimIndex = 13;
}
} else {
this->actor.speedXZ = 2.7f;
this->actor.speed = 2.7f;
EnMa4_ChangeAnim(this, 9);
sAnimIndex = 9;
}
@ -279,7 +279,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, sp2E, 5, 0x3000, 0x100);
} else {
if ((D_80AC0254 == 0) && ((Rand_Next() % 4) == 0)) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
D_80AC0254 = 2;
EnMa4_ChangeAnim(this, 3);
sAnimIndex = 3;
@ -309,14 +309,14 @@ void EnMa4_SetupWait(EnMa4* this) {
if ((this->state != MA4_STATE_AFTERHORSEBACKGAME) && (this->state != MA4_STATE_AFTERDESCRIBETHEMCS)) {
if (this->type != MA4_TYPE_ALIENS_WON) {
EnMa4_ChangeAnim(this, 9);
this->actor.speedXZ = 2.7f;
this->actor.speed = 2.7f;
} else {
EnMa4_ChangeAnim(this, 15);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
} else {
EnMa4_ChangeAnim(this, 1);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
}
this->actor.gravity = -0.2f;

View File

@ -99,7 +99,7 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) {
this->frogIndex = MINIFROG_YELLOW;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnMinifrog_Idle;
this->jumpState = MINIFROG_STATE_GROUND;
this->flags = 0;

View File

@ -240,7 +240,7 @@ void EnMinislime_SetupFall(EnMinislime* this, PlayState* play) {
this->collider.base.atFlags |= AT_ON;
this->collider.base.acFlags |= AC_ON;
this->collider.base.ocFlags1 |= OC1_ON;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = -2.0f;
if (this->actionFunc != EnMinislime_GekkoThrow) {
this->actor.scale.x = 0.095f;
@ -269,7 +269,7 @@ void EnMinislime_SetupBreakFromBigslime(EnMinislime* this) {
this->actor.world.rot.y = Actor_WorldYawTowardActor(this->actor.parent, &this->actor);
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.speedXZ = Math_CosS(this->actor.world.rot.x) * 15.0f;
this->actor.speed = Math_CosS(this->actor.world.rot.x) * 15.0f;
velY = Math_SinS(this->actor.world.rot.x) * 15.0f;
this->actor.bgCheckFlags &= ~1;
this->actor.velocity.y = velY + 2.0f;
@ -300,7 +300,7 @@ void EnMinislime_BreakFromBigslime(EnMinislime* this, PlayState* play) {
void EnMinislime_SetupIceArrowDamage(EnMinislime* this) {
this->collider.base.atFlags &= ~AT_ON;
this->frozenTimer = 80;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->frozenScale = 0.1f;
this->actionFunc = EnMinislime_IceArrowDamage;
}
@ -354,7 +354,7 @@ void EnMinislime_SetupFireArrowDamage(EnMinislime* this) {
this->actor.shape.rot.z = 0;
this->actor.world.rot.x = 0;
this->collider.base.acFlags &= ~AC_ON;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnMinislime_FireArrowDamage;
}
@ -385,7 +385,7 @@ void EnMinislime_SetupGrowAndShrink(EnMinislime* this) {
this->actor.shape.rot.y = 0;
this->actor.shape.rot.z = 0;
this->actor.world.rot.x = 0;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
this->growShrinkTimer = 42;
this->actor.scale.x = 0.19f;
@ -425,8 +425,8 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) {
this->idleTimer--;
speedXZ = sin_rad(this->idleTimer * (M_PI / 10));
this->actor.speedXZ = speedXZ * 1.5f;
this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 0.0f);
this->actor.speed = speedXZ * 1.5f;
this->actor.speed = CLAMP_MIN(this->actor.speed, 0.0f);
Math_StepToF(&this->actor.scale.x, ((0.14f * speedXZ) + 1.5f) * 0.1f, 0.010000001f);
Math_StepToF(&this->actor.scale.y, ((cos_rad(this->idleTimer * (M_PI / 10)) * 0.07f) + 0.75f) * 0.1f, 0.010000001f);
Math_StepToF(&this->actor.scale.z, 0.3f - this->actor.scale.x, 0.010000001f);
@ -451,7 +451,7 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) {
}
void EnMinislime_SetupBounce(EnMinislime* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->bounceTimer = (this->actionFunc == EnMinislime_GrowAndShrink) ? 1 : 4;
Actor_PlaySfx(&this->actor, NA_SE_EN_SLIME_JUMP1);
this->actionFunc = EnMinislime_Bounce;
@ -466,7 +466,7 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) {
if (this->bounceTimer == 0) {
this->actor.gravity = -2.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = 1.0f;
this->actor.speed = 1.0f;
this->actor.velocity.y = 12.0f;
this->actor.shape.rot.y = this->actor.world.rot.y;
}
@ -490,7 +490,7 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) {
void EnMinislime_SetupMoveToBigslime(EnMinislime* this) {
this->actor.gravity = 0.0f;
this->actor.speedXZ = 15.0f;
this->actor.speed = 15.0f;
this->actor.shape.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &this->actor.parent->home.pos);
this->actor.shape.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.parent->home.pos);
this->actor.world.rot.x = -this->actor.shape.rot.x;
@ -517,7 +517,7 @@ void EnMinislime_MoveToBigslime(EnMinislime* this, PlayState* play) {
EnMinislime_SetupDisappear(this);
} else if ((this->actor.scale.x > 0.0f) && (this->actor.world.pos.y > (GBT_ROOM_5_MAX_Y - 100.0f))) {
this->actor.params = MINISLIME_SETUP_DISAPPEAR;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
Actor_SetScale(&this->actor, 0.0f);
}
}
@ -526,7 +526,7 @@ void EnMinislime_SetupKnockback(EnMinislime* this) {
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 |= OC1_ON;
this->knockbackTimer = 30;
this->actor.speedXZ = 20.0f;
this->actor.speed = 20.0f;
func_800BE504(&this->actor, &this->collider);
this->actionFunc = EnMinislime_Knockback;
}
@ -535,7 +535,7 @@ void EnMinislime_Knockback(EnMinislime* this, PlayState* play) {
f32 sqrtFrozenTimer;
this->knockbackTimer--;
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
sqrtFrozenTimer = sqrtf(this->knockbackTimer);
this->actor.scale.x = ((cos_rad(this->knockbackTimer * (M_PI / 3)) * (0.05f * sqrtFrozenTimer)) + 1.0f) * 0.15f;
this->actor.scale.z = this->actor.scale.x;
@ -556,7 +556,7 @@ void EnMinislime_SetupDefeatIdle(EnMinislime* this) {
this->idleTimer = 20;
this->collider.base.atFlags &= ~(AT_ON | AT_HIT);
this->collider.base.acFlags &= ~(AC_ON | AC_HIT);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
if (this->frozenAlpha > 20) {
EnMinislime_AddIceShardEffect(this);
}
@ -625,7 +625,7 @@ void EnMinislime_Despawn(EnMinislime* this, PlayState* play) {
}
void EnMinislime_SetupMoveToGekko(EnMinislime* this) {
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->collider.base.acFlags &= ~AC_ON;
@ -657,7 +657,7 @@ void EnMinislime_SetupGekkoThrow(EnMinislime* this) {
this->collider.base.acFlags |= AC_ON;
this->collider.base.ocFlags1 |= OC1_ON;
xzDistToPlayer = CLAMP_MIN(this->actor.xzDistToPlayer, 200.0f);
this->actor.speedXZ = 17.5f;
this->actor.speed = 17.5f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.gravity = -1.0f;
this->actor.velocity.y = ((xzDistToPlayer - 200.0f) * 0.01f) + 3.0f;

View File

@ -256,15 +256,15 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
s32 sp20;
this->unk_14E--;
if ((this->actor.params == 1) && (this->actor.bgCheckFlags & 1) && (this->actor.speedXZ > 2.5f) &&
if ((this->actor.params == 1) && (this->actor.bgCheckFlags & 1) && (this->actor.speed > 2.5f) &&
((play->gameplayFrames % 3) == 0)) {
func_80A4E22C(this, play);
}
if (this->unk_14E > 0) {
Math_StepToF(&this->actor.speedXZ, 5.0f, 0.7f);
Math_StepToF(&this->actor.speed, 5.0f, 0.7f);
sp20 = false;
} else {
sp20 = Math_StepToF(&this->actor.speedXZ, 0.0f, 0.7f);
sp20 = Math_StepToF(&this->actor.speed, 0.0f, 0.7f);
}
if ((player->stateFlags3 & 0x100) || (Player_GetMask(play) == PLAYER_MASK_STONE)) {
Math_ScaledStepToS(&this->unk_150, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x400);
@ -274,7 +274,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
Math_ScaledStepToS(&this->unk_150, this->actor.yawTowardsPlayer, 0x400);
}
this->actor.shape.rot.y =
(s32)(sin_rad(this->unk_14E * ((2 * M_PI) / 15)) * (614.4f * this->actor.speedXZ)) + this->unk_150;
(s32)(sin_rad(this->unk_14E * ((2 * M_PI) / 15)) * (614.4f * this->actor.speed)) + this->unk_150;
func_800B9010(&this->actor, NA_SE_EN_KUROSUKE_MOVE - SFX_FLAG);
if (sp20) {
this->unk_14B &= ~2;
@ -289,7 +289,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
void func_80A4E58C(EnMkk* this) {
this->unk_14B |= 1;
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->actor.velocity.y = 5.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_KUROSUKE_ATTACK);
this->collider.base.atFlags |= AT_ON;
@ -316,7 +316,7 @@ void func_80A4E67C(EnMkk* this) {
Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD);
this->alpha = 254;
func_800BE568(&this->actor, &this->collider);
this->actor.speedXZ = 7.0f;
this->actor.speed = 7.0f;
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.velocity.y = 5.0f;
this->actor.gravity = -1.3f;
@ -379,16 +379,16 @@ void func_80A4E84C(EnMkk* this) {
this->unk_154.y = this->actor.world.pos.y;
this->unk_154.x = this->actor.world.pos.x -
10.0f * Math_SinS(this->actor.shape.rot.y +
(s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5))));
(s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
this->unk_154.z = this->actor.world.pos.z -
10.0f * Math_CosS(this->actor.shape.rot.y +
(s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5))));
(s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
this->unk_160.x = this->unk_154.x -
12.0f * Math_SinS(this->actor.shape.rot.y -
(s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5))));
(s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
this->unk_160.z = this->unk_154.z -
12.0f * Math_CosS(this->actor.shape.rot.y -
(s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5))));
(s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
}
}
@ -483,7 +483,7 @@ void func_80A4EF74(EnMkk* this, PlayState* play) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
Math_Vec3f_Copy(&this->unk_154, &this->actor.world.pos);
Math_Vec3f_Copy(&this->unk_160, &this->actor.world.pos);
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
func_80A4EDF0(this);
} else {

View File

@ -130,37 +130,37 @@ void func_80965DB4(EnMm* this, PlayState* play) {
this->actor.velocity.y = 0.0f;
}
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) {
angle = BINANG_SUB(this->actor.world.rot.y, BINANG_ROT180(this->actor.wallYaw));
this->actor.world.rot.y += BINANG_SUB(0x8000, (s16)(angle * 2));
this->actor.speedXZ *= 0.5f;
this->actor.speed *= 0.5f;
CollisionCheck_SpawnShieldParticles(play, &this->actor.world.pos);
Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND);
}
if (!(this->actor.bgCheckFlags & 1)) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f);
Math_StepToF(&this->actor.speed, 0.0f, 0.08f);
} else {
temp_f14 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
temp_f12 = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
temp_f14 = Math_SinS(this->actor.world.rot.y) * this->actor.speed;
temp_f12 = Math_CosS(this->actor.world.rot.y) * this->actor.speed;
Actor_GetSlopeDirection(this->actor.floorPoly, &slopeNormal, &downwardSlopeYaw);
temp_f14 += 3.0f * slopeNormal.x;
temp_f12 += 3.0f * slopeNormal.z;
temp_f2 = sqrtf(SQ(temp_f14) + SQ(temp_f12));
if ((temp_f2 < this->actor.speedXZ) ||
if ((temp_f2 < this->actor.speed) ||
(SurfaceType_GetSlope(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1)) {
this->actor.speedXZ = CLAMP_MAX(temp_f2, 16.0f);
this->actor.speed = CLAMP_MAX(temp_f2, 16.0f);
this->actor.world.rot.y = Math_Atan2S_XY(temp_f12, temp_f14);
}
if (!Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f)) {
if (!Math_StepToF(&this->actor.speed, 0.0f, 1.0f)) {
direction = this->actor.world.rot.y;
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->actor.shape.rot.y)) > 0x4000) {
direction = BINANG_ROT180(direction);
}
Math_ScaledStepToS(&this->actor.shape.rot.y, direction, this->actor.speedXZ * 100.0f);
this->unk_190 += (s16)(this->actor.speedXZ * 800.0f);
Math_ScaledStepToS(&this->actor.shape.rot.y, direction, this->actor.speed * 100.0f);
this->unk_190 += (s16)(this->actor.speed * 800.0f);
}
if (this->actor.bgCheckFlags & 2) {

View File

@ -69,7 +69,7 @@ void EnMs_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.015f);
this->actor.colChkInfo.mass = MASS_IMMOVABLE; // Eating Magic Beans all day will do that to you
this->actionFunc = EnMs_Wait;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.gravity = -1.0f;
}

View File

@ -275,9 +275,9 @@ s32 func_80A68DD4(EnMushi2* this, PlayState* play) {
}
void func_80A68ED8(EnMushi2* this) {
this->actor.velocity.x = this->actor.speedXZ * this->unk_328.x;
this->actor.velocity.y = this->actor.speedXZ * this->unk_328.y;
this->actor.velocity.z = this->actor.speedXZ * this->unk_328.z;
this->actor.velocity.x = this->actor.speed * this->unk_328.x;
this->actor.velocity.y = this->actor.speed * this->unk_328.y;
this->actor.velocity.z = this->actor.speed * this->unk_328.z;
Actor_UpdatePos(&this->actor);
}
@ -797,7 +797,7 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) {
s32 pad;
s32 sp20 = false;
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
this->actor.velocity.y -= this->actor.velocity.y * D_80A6BA14[ENMUSHI2_GET_3(&this->actor)];
Actor_MoveWithGravity(&this->actor);
func_80A69424(this, play);
@ -853,11 +853,11 @@ void func_80A6A5C0(EnMushi2* this, PlayState* play) {
EnMushi2* this2 = this;
func_80A69D3C(this);
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_35C, 0.1f, 0.5f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, this->unk_35C, 0.1f, 0.5f, 0.0f);
if (this->unk_354 < SQ(40.0f)) {
f32 temp = 1.0f - ((SQ(40.0f) - this->unk_354) * (1.0f / (10.0f * SQ(40.0f))));
this->actor.speedXZ *= temp;
this->actor.speed *= temp;
}
func_80A68ED8(this);
@ -866,7 +866,7 @@ void func_80A6A5C0(EnMushi2* this, PlayState* play) {
func_80A69388(this);
}
this->skelAnime.playSpeed = this->actor.speedXZ * 1.6f;
this->skelAnime.playSpeed = this->actor.speed * 1.6f;
this2->skelAnime.playSpeed = CLAMP(this2->skelAnime.playSpeed, 0.1f, 1.9f);
if ((this->unk_36A <= 0) || func_80A68BA0(this)) {
@ -896,7 +896,7 @@ void func_80A6A794(EnMushi2* this) {
void func_80A6A824(EnMushi2* this, PlayState* play) {
EnMushi2* this2 = this;
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_35C, 0.1f, 0.5f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, this->unk_35C, 0.1f, 0.5f, 0.0f);
func_80A68ED8(this);
func_80A697C4(this, play);
@ -904,7 +904,7 @@ void func_80A6A824(EnMushi2* this, PlayState* play) {
func_80A69388(this);
}
this->skelAnime.playSpeed = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f);
this->skelAnime.playSpeed = (Rand_ZeroOne() * 0.8f) + (this->actor.speed * 1.2f);
this2->skelAnime.playSpeed = CLAMP(this2->skelAnime.playSpeed, 0.0f, 1.9f);
if ((this->unk_36A <= 0) || func_80A68BA0(this)) {
@ -963,9 +963,9 @@ void func_80A6AB08(EnMushi2* this, PlayState* play) {
s16 temp;
if (this->unk_368 > 80) {
Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f);
Math_StepToF(&this->actor.speed, 0.6f, 0.08f);
} else {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f);
Math_StepToF(&this->actor.speed, 0.0f, 0.02f);
}
Actor_MoveWithGravity(&this->actor);
@ -1025,8 +1025,8 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play) {
this->actor.shape.rot.x -= 0x1F4;
this->actor.shape.rot.y += 0xC8;
this->actor.speedXZ += (Rand_ZeroOne() - 0.5f) * 0.16f;
this->actor.speedXZ *= 0.9f;
this->actor.speed += (Rand_ZeroOne() - 0.5f) * 0.16f;
this->actor.speed *= 0.9f;
this->actor.world.rot.y += (s16)((Rand_ZeroOne() - 0.5f) * 2000.0f);
this->actor.gravity = -0.04f - (Rand_ZeroOne() * 0.02f);
this->actor.velocity.y *= 0.95f;
@ -1058,7 +1058,7 @@ void func_80A6B0D8(EnMushi2* this, PlayState* play) {
s32 pad[2];
f32 temp_f2;
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.4f, 1.2f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.4f, 1.2f, 0.0f);
temp_f2 = this->actor.scale.x - 0.0002f;
Actor_SetScale(&this->actor, CLAMP_MIN(temp_f2, 0.001f));
@ -1077,11 +1077,11 @@ void func_80A6B0D8(EnMushi2* this, PlayState* play) {
}
this->actor.velocity.x =
(this->actor.speedXZ * this->unk_328.x) + (-0.01f * this->unk_31C.x) + (this->unk_310.x * temp_f2);
(this->actor.speed * this->unk_328.x) + (-0.01f * this->unk_31C.x) + (this->unk_310.x * temp_f2);
this->actor.velocity.y =
(this->actor.speedXZ * this->unk_328.y) + (-0.01f * this->unk_31C.y) + (this->unk_310.y * temp_f2);
(this->actor.speed * this->unk_328.y) + (-0.01f * this->unk_31C.y) + (this->unk_310.y * temp_f2);
this->actor.velocity.z =
(this->actor.speedXZ * this->unk_328.z) + (-0.01f * this->unk_31C.z) + (this->unk_310.z * temp_f2);
(this->actor.speed * this->unk_328.z) + (-0.01f * this->unk_31C.z) + (this->unk_310.z * temp_f2);
if ((this->actor.flags & ACTOR_FLAG_40) && (this->unk_368 > 20) && (Rand_ZeroOne() < 0.15f)) {
Vec3f sp48;

View File

@ -207,8 +207,8 @@ void EnNeoReeba_ChooseAction(EnNeoReeba* this, PlayState* play) {
if (this->actionTimer == 0) {
if ((distToPlayer < 140.0f) && (fabsf(this->actor.playerHeightRel) < 100.0f)) {
this->targetPos = player->actor.world.pos;
this->targetPos.x += 10.0f * player->actor.speedXZ * Math_SinS(player->actor.world.rot.y);
this->targetPos.z += 10.0f * player->actor.speedXZ * Math_CosS(player->actor.world.rot.y);
this->targetPos.x += 10.0f * player->actor.speed * Math_SinS(player->actor.world.rot.y);
this->targetPos.z += 10.0f * player->actor.speed * Math_CosS(player->actor.world.rot.y);
EnNeoReeba_SetupMove(this);
} else {
EnNeoReeba_SetupReturnHome(this);
@ -273,19 +273,19 @@ void EnNeoReeba_SetupMove(EnNeoReeba* this) {
this->actionTimer = 60;
this->actionFunc = EnNeoReeba_Move;
this->skelAnime.playSpeed = 2.0f;
this->actor.speedXZ = 14.0f;
this->actor.speed = 14.0f;
}
void EnNeoReeba_Move(EnNeoReeba* this, PlayState* play) {
f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speedXZ);
f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speed);
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 4.0f, 0xFA,
0xA, 1);
if (remainingDist < 2.0f) {
EnNeoReeba_SetupChooseAction(this);
} else if (remainingDist < 40.0f && this->actor.speedXZ > 3.0f) {
this->actor.speedXZ -= 2.0f;
} else if (remainingDist < 40.0f && this->actor.speed > 3.0f) {
this->actor.speed -= 2.0f;
}
if (this->sfxTimer == 0) {
@ -304,18 +304,18 @@ void EnNeoReeba_Move(EnNeoReeba* this, PlayState* play) {
void EnNeoReeba_SetupReturnHome(EnNeoReeba* this) {
this->actionFunc = EnNeoReeba_ReturnHome;
this->actor.speedXZ = 6.0f;
this->actor.speed = 6.0f;
}
void EnNeoReeba_ReturnHome(EnNeoReeba* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ);
f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->actor.home.pos, this->actor.speed);
if (remainingDist < 2.0f) {
EnNeoReeba_SetupChooseAction(this);
} else if (remainingDist < 40.0f && this->actor.speedXZ > 3.0f) {
this->actor.speedXZ -= 1.0f;
} else if (remainingDist < 40.0f && this->actor.speed > 3.0f) {
this->actor.speed -= 1.0f;
}
if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 200.0f ||
@ -333,7 +333,7 @@ void EnNeoReeba_SetupBounce(EnNeoReeba* this) {
}
void EnNeoReeba_Bounce(EnNeoReeba* this, PlayState* play) {
if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speedXZ) < 2.0f) {
if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speed) < 2.0f) {
EnNeoReeba_SetupChooseAction(this);
}

View File

@ -160,7 +160,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->niwState = NIW_STATE_HELD;
this->actionFunc = EnNiw_Held;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->unk2BC.z = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
@ -372,7 +372,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
this->heldTimer = 30;
this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->niwState = NIW_STATE_HELD;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actionFunc = EnNiw_Held;
return;
} else {
@ -415,7 +415,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
} else {
this->unkIdleTimer = 4;
if (this->actor.bgCheckFlags & 1) { // hit floor
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 3.5f; // hopping up and down
}
}
@ -476,7 +476,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) {
this->actor.shape.rot.z = 0;
rotZ = this->actor.shape.rot.z;
this->actor.velocity.y = 8.0f;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
this->actor.gravity = -2.0f;
this->niwState = NIW_STATE_FALLING;
this->unk2EC = 0;
@ -497,7 +497,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) { // hit floor
this->unk2EC = 1;
this->hoppingTimer = 80; // hop timer
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.velocity.y = 4.0f;
} else {
return; // wait until back on floor
@ -526,7 +526,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->niwState = NIW_STATE_HELD;
this->actionFunc = EnNiw_Held;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
if (this->hoppingTimer > 5) {
Actor_LiftActor(&this->actor, play);
@ -544,7 +544,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) {
EnNiw_SpawnAttackNiw(this, play); // spawn attack niw
}
this->actor.speedXZ = 2.0f;
this->actor.speed = 2.0f;
if (this->actor.bgCheckFlags & 0x20) { // touching water
this->actor.gravity = 0.0f;
if (this->actor.depthInWater > 15.0f) {
@ -559,16 +559,16 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) {
}
if (this->actor.bgCheckFlags & 8) { // hit a wall
this->actor.velocity.y = 10.0f; // fly up in straight line
this->actor.speedXZ = 1.0f;
this->actor.speed = 1.0f;
}
} else {
this->actor.gravity = -2.0f;
if (this->actor.bgCheckFlags & 8) { // hit a wall
this->actor.velocity.y = 10.0f; // fly up in straight line
this->actor.speedXZ = 1.0f;
this->actor.speed = 1.0f;
this->actor.gravity = 0.0f;
} else {
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
}
if (this->actor.bgCheckFlags & 1) { // hit floor
@ -646,7 +646,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, PlayState* play) {
void EnNiw_CuccoStorm(EnNiw* this, PlayState* play) {
EnNiw_SpawnAttackNiw(this, play);
if (this->cuccoStormTimer == 1) { // not countdown to 0? mistype?
this->actor.speedXZ = 3.0f;
this->actor.speed = 3.0f;
this->isRunningRight = Rand_ZeroFloat(1.99f);
this->generalTimer1 = 0;
this->unkTimer24E = this->generalTimer1;
@ -662,7 +662,7 @@ void EnNiw_SetupRunAway(EnNiw* this) {
this->isRunningRight = Rand_ZeroFloat(1.99f);
this->niwState = NIW_STATE_RUNNING;
this->actionFunc = EnNiw_RunAway;
this->actor.speedXZ = 4.0f;
this->actor.speed = 4.0f;
}
void EnNiw_RunAway(EnNiw* this, PlayState* play) {
@ -678,7 +678,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) {
this->unk2A4.z = this->unk2B0.z = this->actor.world.pos.z;
this->generalTimer2 = this->generalTimer1 = this->unk298 = 0;
this->unk300 = this->unk304 = 0;
this->actor.speedXZ = 0;
this->actor.speed = 0;
this->targetLimbRots[8] = 0;
this->targetLimbRots[6] = 0;
this->targetLimbRots[5] = 0;
@ -746,7 +746,7 @@ void EnNiw_CheckRage(EnNiw* this, PlayState* play) {
this->actionFunc = EnNiw_Trigger;
this->unk304 = 0.0f;
this->unk300 = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
} else {
this->iframeTimer = 10;
@ -857,7 +857,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) {
this->actor.world.pos.y = this->actor.home.pos.y + 300.0f;
}
this->actor.speedXZ = 0.0f;
this->actor.speed = 0.0f;
this->actor.gravity = -2.0f;
Math_Vec3f_Copy(&this->unk2A4, &this->actor.home.pos);
Math_Vec3f_Copy(&this->unk2B0, &this->actor.home.pos);

View File

@ -57,7 +57,7 @@ void EnNutsball_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f);
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->actor.shape.rot.y = 0;
this->actor.speedXZ = 10.0f;
this->actor.speed = 10.0f;
if (this->actor.params == 2) {
this->timer = 1;
this->timerThreshold = 0;

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