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