mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-23 07:21:19 +00:00
speedXZ -> speed (#1477)
* speedXZ -> speed * += * revert arg in player function * anon review * engineer review * forgot one * last review * revert decimal
This commit is contained in:
parent
4a9873775c
commit
92e03cf747
171 changed files with 1771 additions and 1773 deletions
|
@ -496,7 +496,7 @@ void EnPeehat_Ground_SetStateSeekPlayer(EnPeehat* this) {
|
|||
void EnPeehat_Ground_StateSeekPlayer(EnPeehat* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 3.0f, 1.0f, 0.25f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speed, 3.0f, 1.0f, 0.25f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 80.0f, 1.0f, 3.0f, 0.0f);
|
||||
if (this->seekPlayerTimer <= 0) {
|
||||
EnPeehat_Ground_SetStateLanding(this);
|
||||
|
@ -537,7 +537,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) {
|
|||
if (this->actor.parent != NULL && this->actor.parent->update == NULL) {
|
||||
this->actor.parent = NULL;
|
||||
}
|
||||
this->actor.speedXZ = speedXZ;
|
||||
this->actor.speed = speedXZ;
|
||||
if (this->actor.world.pos.y - this->actor.floorHeight >= 70.0f) {
|
||||
Math_SmoothStepToF(&this->actor.velocity.y, -1.3f, 1.0f, 0.5f, 0.0f);
|
||||
} else {
|
||||
|
@ -598,7 +598,7 @@ void EnPeehat_Ground_SetStateLanding(EnPeehat* this) {
|
|||
|
||||
void EnPeehat_Ground_StateLanding(EnPeehat* this, PlayState* play) {
|
||||
Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 50.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 50, 0);
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
EnPeehat_Ground_SetStateGround(this);
|
||||
|
@ -625,7 +625,7 @@ void EnPeehat_Flying_SetStateLanding(EnPeehat* this) {
|
|||
|
||||
void EnPeehat_Flying_StateLanding(EnPeehat* this, PlayState* play) {
|
||||
Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 50.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 50, 0);
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
EnPeehat_Flying_SetStateGround(this);
|
||||
|
@ -646,7 +646,7 @@ void EnPeehat_Flying_StateLanding(EnPeehat* this, PlayState* play) {
|
|||
|
||||
void EnPeehat_Ground_SetStateHover(EnPeehat* this) {
|
||||
Animation_PlayLoop(&this->skelAnime, &gPeehatFlyingAnim);
|
||||
this->actor.speedXZ = Rand_ZeroOne() * 0.5f + 2.5f;
|
||||
this->actor.speed = Rand_ZeroOne() * 0.5f + 2.5f;
|
||||
this->unk_2D4 = Rand_ZeroOne() * 10 + 10;
|
||||
this->state = PEAHAT_STATE_15;
|
||||
EnPeehat_SetupAction(this, EnPeehat_Ground_StateHover);
|
||||
|
@ -665,7 +665,7 @@ void EnPeehat_Ground_StateHover(EnPeehat* this, PlayState* play) {
|
|||
this->unk_2E0 += ((0.0f <= cos) ? cos : -cos) + 0.07f;
|
||||
this->unk_2D4--;
|
||||
if (this->unk_2D4 <= 0) {
|
||||
this->actor.speedXZ = Rand_ZeroOne() * 0.5f + 2.5f;
|
||||
this->actor.speed = Rand_ZeroOne() * 0.5f + 2.5f;
|
||||
this->unk_2D4 = Rand_ZeroOne() * 10.0f + 10.0f;
|
||||
this->unk_2F4 = (Rand_ZeroOne() - 0.5f) * 1000.0f;
|
||||
}
|
||||
|
@ -694,7 +694,7 @@ void EnPeehat_Ground_StateHover(EnPeehat* this, PlayState* play) {
|
|||
|
||||
void EnPeehat_Ground_SetStateReturnHome(EnPeehat* this) {
|
||||
this->state = PEAHAT_STATE_RETURN_HOME;
|
||||
this->actor.speedXZ = 2.5f;
|
||||
this->actor.speed = 2.5f;
|
||||
EnPeehat_SetupAction(this, EnPeehat_Ground_StateReturnHome);
|
||||
}
|
||||
|
||||
|
@ -732,7 +732,7 @@ void EnPeehat_Ground_StateReturnHome(EnPeehat* this, PlayState* play) {
|
|||
void EnPeehat_SetStateAttackRecoil(EnPeehat* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gPeehatRecoilAnim, -4.0f);
|
||||
this->state = PEAHAT_STATE_ATTACK_RECOIL;
|
||||
this->actor.speedXZ = -9.0f;
|
||||
this->actor.speed = -9.0f;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
EnPeehat_SetupAction(this, EnPeehat_StateAttackRecoil);
|
||||
}
|
||||
|
@ -740,8 +740,8 @@ void EnPeehat_SetStateAttackRecoil(EnPeehat* this) {
|
|||
void EnPeehat_StateAttackRecoil(EnPeehat* this, PlayState* play) {
|
||||
this->bladeRot += this->bladeRotVel;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->actor.speedXZ += 0.5f;
|
||||
if (this->actor.speedXZ == 0.0f) {
|
||||
this->actor.speed += 0.5f;
|
||||
if (this->actor.speed == 0.0f) {
|
||||
// Is PEAHAT_TYPE_LARVA
|
||||
if (this->actor.params > 0) {
|
||||
Vec3f zeroVec = { 0, 0, 0 };
|
||||
|
@ -768,7 +768,7 @@ void EnPeehat_StateAttackRecoil(EnPeehat* this, PlayState* play) {
|
|||
void EnPeehat_SetStateBoomerangStunned(EnPeehat* this) {
|
||||
this->state = PEAHAT_STATE_STUNNED;
|
||||
if (this->actor.floorHeight < this->actor.world.pos.y) {
|
||||
this->actor.speedXZ = -9.0f;
|
||||
this->actor.speed = -9.0f;
|
||||
}
|
||||
this->bladeRotVel = 0;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
|
@ -778,7 +778,7 @@ void EnPeehat_SetStateBoomerangStunned(EnPeehat* this) {
|
|||
}
|
||||
|
||||
void EnPeehat_StateBoomerangStunned(EnPeehat* this, PlayState* play) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight, 1.0f, 8.0f, 0.0f);
|
||||
if (this->actor.colorFilterTimer == 0) {
|
||||
EnPeehat_Ground_SetStateRise(this);
|
||||
|
@ -788,7 +788,7 @@ void EnPeehat_StateBoomerangStunned(EnPeehat* this, PlayState* play) {
|
|||
void EnPeehat_Adult_SetStateDie(EnPeehat* this) {
|
||||
this->bladeRotVel = 0;
|
||||
this->isStateDieFirstUpdate = 1;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.speed = 0.0f;
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8);
|
||||
this->state = PEAHAT_STATE_DYING;
|
||||
this->scaleShift = 0.0f;
|
||||
|
@ -803,7 +803,7 @@ void EnPeehat_Adult_StateDie(EnPeehat* this, PlayState* play) {
|
|||
Animation_MorphToPlayOnce(&this->skelAnime, &gPeehatRecoilAnim, -4.0f);
|
||||
this->bladeRotVel = 4000;
|
||||
this->unk_2D4 = 14;
|
||||
this->actor.speedXZ = 0;
|
||||
this->actor.speed = 0;
|
||||
this->actor.velocity.y = 6;
|
||||
this->isStateDieFirstUpdate = 0;
|
||||
this->actor.shape.rot.z = this->actor.shape.rot.x = 0;
|
||||
|
@ -827,8 +827,8 @@ void EnPeehat_Adult_StateDie(EnPeehat* this, PlayState* play) {
|
|||
func_80033480(play, &pos, 80.0f, 1, 150, 100, 1);
|
||||
EnPeehat_SpawnDust(play, this, &pos, 75.0f, 2, 1.05f, 2.0f);
|
||||
}
|
||||
if (this->actor.speedXZ < 0) {
|
||||
this->actor.speedXZ += 0.25f;
|
||||
if (this->actor.speed < 0) {
|
||||
this->actor.speed += 0.25f;
|
||||
}
|
||||
this->unk_2D4--;
|
||||
if (this->unk_2D4 <= 0) {
|
||||
|
@ -925,7 +925,7 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) {
|
|||
EnPeehat_Adult_CollisionCheck(this, play);
|
||||
}
|
||||
if (thisx->colChkInfo.damageEffect != PEAHAT_DMG_EFF_LIGHT_ICE_ARROW) {
|
||||
if (thisx->speedXZ != 0.0f || thisx->velocity.y != 0.0f) {
|
||||
if (thisx->speed != 0.0f || thisx->velocity.y != 0.0f) {
|
||||
Actor_MoveForward(thisx);
|
||||
Actor_UpdateBgCheckInfo(play, thisx, 25.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
|
||||
}
|
||||
|
@ -1067,7 +1067,7 @@ void EnPeehat_Draw(Actor* thisx, PlayState* play) {
|
|||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnPeehat_OverrideLimbDraw,
|
||||
EnPeehat_PostLimbDraw, this);
|
||||
if (this->actor.speedXZ != 0.0f || this->actor.velocity.y != 0.0f) {
|
||||
if (this->actor.speed != 0.0f || this->actor.velocity.y != 0.0f) {
|
||||
Matrix_MultVec3f(&D_80AD285C[0], &this->colQuad.dim.quad[1]);
|
||||
Matrix_MultVec3f(&D_80AD285C[1], &this->colQuad.dim.quad[0]);
|
||||
Matrix_MultVec3f(&D_80AD285C[2], &this->colQuad.dim.quad[3]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue