Rename yDistToWater -> depthInWater (#1950)

* Rename yDistToWater -> yDistUnderWater

* yDistUnderWater -> depthInWater
This commit is contained in:
cadmic 2024-04-28 14:29:06 -07:00 committed by GitHub
parent d4d7512cb6
commit b86e1774cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 112 additions and 112 deletions

View File

@ -276,7 +276,7 @@ typedef struct Actor {
/* 0x07D */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor
/* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching
/* 0x080 */ f32 floorHeight; // Y position of the floor polygon directly below the actor
/* 0x084 */ f32 yDistToWater; // Distance to the surface of active waterbox. Negative value means above water
/* 0x084 */ f32 depthInWater; // Distance below the surface of active waterbox. Positive value means under water, negative value means above water
/* 0x088 */ u16 bgCheckFlags; // Flags indicating how the actor is interacting with collision
/* 0x08A */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player
/* 0x08C */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player

View File

@ -1358,8 +1358,8 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
waterBoxYSurface = actor->world.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, actor->world.pos.x, actor->world.pos.z, &waterBoxYSurface,
&waterBox)) {
actor->yDistToWater = waterBoxYSurface - actor->world.pos.y;
if (actor->yDistToWater < 0.0f) {
actor->depthInWater = waterBoxYSurface - actor->world.pos.y;
if (actor->depthInWater < 0.0f) {
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
} else {
if (!(actor->bgCheckFlags & BGCHECKFLAG_WATER)) {
@ -1379,7 +1379,7 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
}
} else {
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
actor->yDistToWater = BGCHECK_Y_MIN;
actor->depthInWater = BGCHECK_Y_MIN;
}
}
}
@ -1835,7 +1835,7 @@ void func_8002F850(PlayState* play, Actor* actor) {
s32 surfaceSfxOffset;
if (actor->bgCheckFlags & BGCHECKFLAG_WATER) {
if (actor->yDistToWater < 20.0f) {
if (actor->depthInWater < 20.0f) {
surfaceSfxOffset = SURFACE_SFX_OFFSET_WATER_SHALLOW;
} else {
surfaceSfxOffset = SURFACE_SFX_OFFSET_WATER_DEEP;

View File

@ -345,7 +345,7 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
s32 pad;
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
sp30.y += this->actor.yDistToWater;
sp30.y += this->actor.depthInWater;
EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190);
this->unk_2DC = 0.0f;
this->actor.gravity = 0.0f;

View File

@ -342,7 +342,7 @@ void EnBom_Update(Actor* thisx, PlayState* play2) {
}
if ((thisx->scale.x >= 0.01f) && (thisx->params != BOMB_EXPLOSION)) {
if (thisx->yDistToWater >= 20.0f) {
if (thisx->depthInWater >= 20.0f) {
EffectSsDeadSound_SpawnStationary(play, &thisx->projectedPos, NA_SE_IT_BOMB_UNEXPLOSION, true,
DEADSOUND_REPEAT_MODE_OFF, 10);
Actor_Kill(thisx);

View File

@ -114,7 +114,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) {
this->timer = 1;
this->actor.speed = 0.0f;
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
for (i = 0; i < 40; i++) {
EffectSsBubble_Spawn(play, &this->actor.world.pos, 1.0f, 5.0f, 30.0f, 0.25f);
}
@ -452,9 +452,9 @@ void EnBomChu_Update(Actor* thisx, PlayState* play2) {
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &waterY,
&waterBox)) {
this->actor.yDistToWater = waterY - this->actor.world.pos.y;
this->actor.depthInWater = waterY - this->actor.world.pos.y;
if (this->actor.yDistToWater < 0.0f) {
if (this->actor.depthInWater < 0.0f) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
EnBomChu_SpawnRipples(this, play, waterY);
}
@ -471,7 +471,7 @@ void EnBomChu_Update(Actor* thisx, PlayState* play2) {
}
} else {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER;
this->actor.yDistToWater = BGCHECK_Y_MIN;
this->actor.depthInWater = BGCHECK_Y_MIN;
}
}
}

View File

@ -452,7 +452,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
}
if ((thisx->scale.x >= 0.01f) && (thisx->params != BOMBFLOWER_EXPLOSION)) {
if (thisx->yDistToWater >= 20.0f) {
if (thisx->depthInWater >= 20.0f) {
EffectSsDeadSound_SpawnStationary(play, &thisx->projectedPos, NA_SE_IT_BOMB_UNEXPLOSION, true,
DEADSOUND_REPEAT_MODE_OFF, 10);
Actor_Kill(thisx);

View File

@ -251,7 +251,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY);
}
if (this->actor.yDistToWater > -40.0f) {
if (this->actor.depthInWater > -40.0f) {
this->aimRotX = -0x1000;
} else if (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f)) {
this->aimRotX = -0x800 - (Rand_ZeroOne() * 0x800);
@ -277,7 +277,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
this->timer--;
}
if ((this->timer == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & PLAYER_STATE1_23) &&
(this->actor.yDistToWater < -40.0f) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) {
(this->actor.depthInWater < -40.0f) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) {
EnCrow_SetupDiveAttack(this);
}
}
@ -315,7 +315,7 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
if ((this->timer == 0) || (Player_GetMask(play) == PLAYER_MASK_SKULL) || (this->collider.base.atFlags & AT_HIT) ||
(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) ||
(player->stateFlags1 & PLAYER_STATE1_23) || (this->actor.yDistToWater > -40.0f)) {
(player->stateFlags1 & PLAYER_STATE1_23) || (this->actor.depthInWater > -40.0f)) {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_ATTACK);

View File

@ -272,8 +272,8 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) {
if (floorY <= BGCHECK_Y_MIN) {
break;
}
if ((player->actor.yDistToWater != BGCHECK_Y_MIN) &&
(floorY < (player->actor.world.pos.y - player->actor.yDistToWater))) {
if ((player->actor.depthInWater != BGCHECK_Y_MIN) &&
(floorY < (player->actor.world.pos.y - player->actor.depthInWater))) {
break;
}
spawnPos.y = floorY;

View File

@ -249,9 +249,9 @@ void EnExRuppy_Sink(EnExRuppy* this, PlayState* play) {
Vec3f pos;
s32 pad;
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.yDistToWater > 15.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) {
pos = this->actor.world.pos;
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
this->actor.velocity.y = -1.0f;
this->actor.gravity = -0.2f;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 800);

View File

@ -477,7 +477,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 0.0f, 0.02f);
}
this->actor.velocity.y = 0.0f;
this->actor.world.pos.y += this->actor.yDistToWater;
this->actor.world.pos.y += this->actor.depthInWater;
this->skelAnime.playSpeed = CLAMP(this->actionTimer * 0.018f, 0.1f, 1.9f);
SkelAnime_Update(&this->skelAnime);
@ -500,7 +500,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) {
if (Rand_ZeroOne() < 0.03f) {
ripplePoint.x = this->actor.world.pos.x;
ripplePoint.y = this->actor.world.pos.y + this->actor.yDistToWater;
ripplePoint.y = this->actor.world.pos.y + this->actor.depthInWater;
ripplePoint.z = this->actor.world.pos.z;
EffectSsGRipple_Spawn(play, &ripplePoint, 20, 100, 4);
EffectSsGRipple_Spawn(play, &ripplePoint, 40, 200, 8);
@ -537,7 +537,7 @@ void EnInsect_Drown(EnInsect* this, PlayState* play) {
this->actor.shape.rot.y += 200;
Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.00005f, 0.001f));
if (this->actor.yDistToWater > 5.0f && this->actor.yDistToWater < 30.0f && Rand_ZeroOne() < 0.3f) {
if (this->actor.depthInWater > 5.0f && this->actor.depthInWater < 30.0f && Rand_ZeroOne() < 0.3f) {
EffectSsBubble_Spawn(play, &this->actor.world.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f);
}

View File

@ -443,7 +443,7 @@ void EnIshi_Fly(EnIshi* this, PlayState* play) {
}
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
contactPos.x = this->actor.world.pos.x;
contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater;
contactPos.y = this->actor.world.pos.y + this->actor.depthInWater;
contactPos.z = this->actor.world.pos.z;
EffectSsGSplash_Spawn(play, &contactPos, NULL, NULL, 0, 350);
if (type == ROCK_SMALL) {

View File

@ -440,7 +440,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) {
f32 tempX;
f32 tempY;
f32 tempZ;
f32 tempYDistToWater;
f32 tempDepthInWater;
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 30.0f, 50.0f,
@ -450,7 +450,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) {
tempY = this->actor.world.pos.y;
tempZ = this->actor.world.pos.z;
tempBgFlags = this->actor.bgCheckFlags;
tempYDistToWater = this->actor.yDistToWater;
tempDepthInWater = this->actor.depthInWater;
this->actor.world.pos.z += ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f;
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, UPDBGCHECKINFO_FLAG_2);
@ -460,7 +460,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) {
this->actor.world.pos.y = tempY;
this->actor.world.pos.z = tempZ;
this->actor.bgCheckFlags = tempBgFlags;
this->actor.yDistToWater = tempYDistToWater;
this->actor.depthInWater = tempDepthInWater;
PRINTF(VT_RST);
@ -511,13 +511,13 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) {
this->actionState = ENKANBAN_WATER;
Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER);
this->bounceX = this->bounceZ = 0;
this->actor.world.pos.y += this->actor.yDistToWater;
this->actor.world.pos.y += this->actor.depthInWater;
EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 0, (this->partCount * 20) + 300);
EffectSsGRipple_Spawn(play, &this->actor.world.pos, 150, 650, 0);
EffectSsGRipple_Spawn(play, &this->actor.world.pos, 300, 800, 5);
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
PRINTF(" WAT Y = %f\n", this->actor.yDistToWater);
PRINTF(" WAT Y = %f\n", this->actor.depthInWater);
PRINTF(" POS Y = %f\n", this->actor.world.pos.y);
PRINTF(" GROUND Y = %f\n", this->actor.floorHeight);
break;

View File

@ -394,7 +394,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
contactPos.x = this->actor.world.pos.x;
contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater;
contactPos.y = this->actor.world.pos.y + this->actor.depthInWater;
contactPos.z = this->actor.world.pos.z;
EffectSsGSplash_Spawn(play, &contactPos, NULL, NULL, 0, 400);
EffectSsGRipple_Spawn(play, &contactPos, 150, 650, 0);

View File

@ -314,7 +314,7 @@ void EnMk_Update(Actor* thisx, PlayState* play) {
if (player->currentBoots == PLAYER_BOOTS_IRON) {
this->flags |= 8;
} else if (player->stateFlags2 & PLAYER_STATE2_10) {
swimFlag = player->actor.yDistToWater;
swimFlag = player->actor.depthInWater;
if (swimFlag > 0) {
if (swimFlag >= 320) {

View File

@ -723,13 +723,13 @@ void func_80AB6F04(EnNiw* this, PlayState* play) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
this->actor.gravity = 0.0f;
if (this->actor.yDistToWater > 15.0f) {
if (this->actor.depthInWater > 15.0f) {
this->actor.world.pos.y += 2.0f;
}
if (this->timer4 == 0) {
this->timer4 = 30;
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
EffectSsGRipple_Spawn(play, &pos, 100, 500, 30);
}
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
@ -1014,12 +1014,12 @@ void EnNiw_Update(Actor* thisx, PlayState* play) {
return;
}
if ((thisx->bgCheckFlags & BGCHECKFLAG_WATER) && thisx->yDistToWater > 15.0f && this->actionFunc != func_80AB6F04 &&
if ((thisx->bgCheckFlags & BGCHECKFLAG_WATER) && thisx->depthInWater > 15.0f && this->actionFunc != func_80AB6F04 &&
thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA) {
thisx->velocity.y = 0.0f;
thisx->gravity = 0.0f;
Math_Vec3f_Copy(&pos, &thisx->world.pos);
pos.y += thisx->yDistToWater;
pos.y += thisx->depthInWater;
this->timer4 = 30;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 400);
this->timer5 = 0;

View File

@ -152,7 +152,7 @@ void EnNy_Destroy(Actor* thisx, PlayState* play) {
void func_80ABCD40(EnNy* this) {
f32 temp;
temp = (this->actor.yDistToWater > 0.0f) ? 0.7f : 1.0f;
temp = (this->actor.depthInWater > 0.0f) ? 0.7f : 1.0f;
this->unk_1E8 = 2.8f * temp;
}
@ -224,7 +224,7 @@ void EnNy_Move(EnNy* this, PlayState* play) {
f32 yawDiff;
s32 stoneTimer;
if (!(this->unk_1F0 < this->actor.yDistToWater)) {
if (!(this->unk_1F0 < this->actor.depthInWater)) {
func_8002F974(&this->actor, NA_SE_EN_NYU_MOVE - SFX_FLAG);
}
func_80ABCD40(this);
@ -238,7 +238,7 @@ void EnNy_Move(EnNy* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
yawDiff = Math_FAtan2F(this->actor.yDistToPlayer, this->actor.xzDistToPlayer);
this->actor.speed = fabsf(cosf(yawDiff) * this->unk_1E8);
if (this->unk_1F0 < this->actor.yDistToWater) {
if (this->unk_1F0 < this->actor.depthInWater) {
this->unk_1EC = sinf(yawDiff) * this->unk_1E8;
}
}
@ -252,7 +252,7 @@ void EnNy_TurnToStone(EnNy* this, PlayState* play) {
if (phi_f0 <= 0.25f) {
phi_f0 = 0.25f;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
if (!(this->unk_1F0 < this->actor.yDistToWater)) {
if (!(this->unk_1F0 < this->actor.depthInWater)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND);
}
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
@ -346,9 +346,9 @@ s32 EnNy_CollisionCheck(EnNy* this, PlayState* play) {
void func_80ABD3B8(EnNy* this, f32 arg1, f32 arg2) {
if (this->unk_1E8 == 0.0f) {
this->actor.gravity = -0.4f;
} else if (!(arg1 < this->actor.yDistToWater)) {
} else if (!(arg1 < this->actor.depthInWater)) {
this->actor.gravity = -0.4f;
} else if (arg2 < this->actor.yDistToWater) {
} else if (arg2 < this->actor.depthInWater) {
this->actor.gravity = 0.0;
if (this->unk_1EC < this->actor.velocity.y) {
this->actor.velocity.y -= 0.4f;
@ -418,7 +418,7 @@ void EnNy_SetupDie(EnNy* this, PlayState* play) {
Vec3f effectAccel = { 0.0f, 0.1f, 0.0f };
if (this->timer >= 2) {
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
for (i = 0; i < 10; i++) {
effectPos.x = Rand_CenteredFloat(30.0f) + this->actor.world.pos.x;
effectPos.y = Rand_CenteredFloat(30.0f) + this->actor.world.pos.y;
@ -453,7 +453,7 @@ void EnNy_SetupDie(EnNy* this, PlayState* play) {
void EnNy_Die(EnNy* this, PlayState* play) {
s32 i;
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
for (i = 0; i < 8; i += 1) {
this->unk_1F8[i].x += this->unk_1F8[i + 8].x;
this->unk_1F8[i].y += this->unk_1F8[i + 8].y;

View File

@ -429,7 +429,7 @@ void EnRu1_SpawnRipple(EnRu1* this, PlayState* play, s16 radiusMax, s16 life) {
Actor* thisx = &this->actor;
pos.x = this->actor.world.pos.x;
pos.y = this->actor.world.pos.y + this->actor.yDistToWater;
pos.y = this->actor.world.pos.y + this->actor.depthInWater;
pos.z = this->actor.world.pos.z;
EffectSsGRipple_Spawn(play, &pos, 100, radiusMax, life);
}
@ -452,7 +452,7 @@ void EnRu1_SpawnSplash(EnRu1* this, PlayState* play) {
Vec3f pos;
pos.x = this->actor.world.pos.x;
pos.y = this->actor.world.pos.y + this->actor.yDistToWater;
pos.y = this->actor.world.pos.y + this->actor.depthInWater;
pos.z = this->actor.world.pos.z;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 1, 0);
@ -1230,7 +1230,7 @@ s32 func_80AED624(EnRu1* this, PlayState* play) {
Actor_Kill(&this->actor);
return false;
} else if (((this->roomNum1 != curRoomNum) || (this->roomNum2 != curRoomNum)) &&
(this->actor.yDistToWater > kREG(16) + 50.0f) && (this->action != 33)) {
(this->actor.depthInWater > kREG(16) + 50.0f) && (this->action != 33)) {
this->action = 33;
this->drawConfig = 2;
this->alpha = 0xFF;
@ -1460,7 +1460,7 @@ void func_80AEE050(EnRu1* this) {
this->unk_350 = 1;
func_80AEE02C(this);
this->unk_35C = 0;
this->unk_358 = (this->actor.yDistToWater - 10.0f) * 0.5f;
this->unk_358 = (this->actor.depthInWater - 10.0f) * 0.5f;
this->unk_354 = this->actor.world.pos.y + thisx->unk_358; // thisx only used here
} else {
this->actor.gravity = 0.0f;
@ -1593,7 +1593,7 @@ void func_80AEE568(EnRu1* this, PlayState* play) {
return;
}
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
this->action = 29;
this->unk_350 = 0;
}

View File

@ -135,7 +135,7 @@ void EnSb_Destroy(Actor* thisx, PlayState* play) {
void EnSb_SpawnBubbles(PlayState* play, EnSb* this) {
s32 i;
if (this->actor.yDistToWater > 0) {
if (this->actor.depthInWater > 0) {
for (i = 0; i < 10; i++) {
EffectSsBubble_Spawn(play, &this->actor.world.pos, 10.0f, 10.0f, 30.0f, 0.25f);
}
@ -166,7 +166,7 @@ void EnSb_SetupWaitOpen(EnSb* this) {
void EnSb_SetupLunge(EnSb* this) {
f32 frameCount = Animation_GetLastFrame(&object_sb_Anim_000124);
f32 playbackSpeed = this->actor.yDistToWater > 0.0f ? 1.0f : 0.0f;
f32 playbackSpeed = this->actor.depthInWater > 0.0f ? 1.0f : 0.0f;
Animation_Change(&this->skelAnime, &object_sb_Anim_000124, playbackSpeed, 0.0f, frameCount, ANIMMODE_ONCE, 0);
this->behavior = SHELLBLADE_LUNGE;
@ -189,7 +189,7 @@ void EnSb_SetupCooldown(EnSb* this, s32 changeSpeed) {
}
this->behavior = SHELLBLADE_WAIT_CLOSED;
if (changeSpeed) {
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
this->actor.speed = -5.0f;
if (this->actor.velocity.y < 0.0f) {
this->actor.velocity.y = 2.1f;
@ -254,7 +254,7 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) {
if (this->actor.shape.rot.y == invertedYaw) {
this->actor.world.rot.y = this->attackYaw;
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
this->actor.velocity.y = 3.0f;
this->actor.speed = 5.0f;
this->actor.gravity = -0.35f;
@ -274,7 +274,7 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) {
void EnSb_Lunge(EnSb* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
if ((this->actor.velocity.y <= -0.1f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH)) {
if (!(this->actor.yDistToWater > 0.0f)) {
if (!(this->actor.depthInWater > 0.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND);
}
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
@ -295,7 +295,7 @@ void EnSb_Bounce(EnSb* this, PlayState* play) {
if (this->bouncesLeft != 0) {
this->bouncesLeft--;
this->timer = 1;
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
this->actor.velocity.y = 3.0f;
this->actor.speed = 5.0f;
this->actor.gravity = -0.35f;
@ -445,7 +445,7 @@ void EnSb_Update(Actor* thisx, PlayState* play) {
s32 pad;
if (this->isDead) {
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
this->actor.params = 4;
} else {
this->actor.params = 1;

View File

@ -450,7 +450,7 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) {
if ((this->actionState != SKB_BEHAVIOR_DYING) &&
(this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
(this->actor.yDistToWater >= 40.0f)) {
(this->actor.depthInWater >= 40.0f)) {
this->actor.colChkInfo.health = 0;
this->setColliderAT = false;
EnSkb_SetupDeath(this, play);

View File

@ -234,7 +234,7 @@ void EnTite_Idle(EnTite* this, PlayState* play) {
// Float on water surface
this->actor.gravity = 0.0f;
Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f);
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f,
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.depthInWater, 1.0f, 2.0f,
0.0f);
} else {
this->actor.gravity = -1.0f;
@ -278,7 +278,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) {
}
Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP);
} else {
this->actor.world.pos.y += this->actor.yDistToWater;
this->actor.world.pos.y += this->actor.depthInWater;
Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP_WATER);
}
this->actor.velocity.y = 8.0f;
@ -304,7 +304,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) {
if (this->actor.velocity.y < -8.0f) {
Vec3f ripplePos = this->actor.world.pos;
ripplePos.y += this->actor.yDistToWater;
ripplePos.y += this->actor.depthInWater;
this->vAttackState++; // TEKTITE_SUBMERGED
this->actor.velocity.y *= 0.75f;
attackState = this->vAttackState;
@ -330,7 +330,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) {
break;
case TEKTITE_SUBMERGED:
// Check if floated to surface
if (this->actor.yDistToWater == 0.0f) {
if (this->actor.depthInWater == 0.0f) {
this->vAttackState = TEKTITE_LANDED;
attackState = this->vAttackState;
}
@ -388,7 +388,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) {
// Float up to water surface
Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f);
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f,
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.depthInWater, 1.0f, 2.0f,
0.0f);
break;
}
@ -447,7 +447,7 @@ void EnTite_TurnTowardPlayer(EnTite* this, PlayState* play) {
}
// Calculate turn velocity and animation speed based on angle to player
if ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->actor.world.pos.y += this->actor.yDistToWater;
this->actor.world.pos.y += this->actor.depthInWater;
}
angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
if (angleToPlayer > 0) {
@ -546,7 +546,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
Vec3f ripplePos = this->actor.world.pos;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
ripplePos.y += this->actor.yDistToWater;
ripplePos.y += this->actor.depthInWater;
this->actor.gravity = 0.0f;
this->actor.velocity.y *= 0.75f;
EffectSsGRipple_Spawn(play, &ripplePos, 0, 500, 0);
@ -554,9 +554,9 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) {
} else {
// If submerged, float to surface
Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f);
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f,
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.depthInWater, 1.0f, 2.0f,
0.0f);
if (this->actor.yDistToWater != 0.0f) {
if (this->actor.depthInWater != 0.0f) {
// Do not change state until tekite has floated to surface
return;
}
@ -633,7 +633,7 @@ void EnTite_Recoil(EnTite* this, PlayState* play) {
} else {
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
this->actor.world.pos.y += this->actor.yDistToWater;
this->actor.world.pos.y += this->actor.depthInWater;
}
}
@ -704,7 +704,7 @@ void EnTite_Stunned(EnTite* this, PlayState* play) {
} else {
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
this->actor.world.pos.y += this->actor.yDistToWater;
this->actor.world.pos.y += this->actor.depthInWater;
}
}
// Play sound effect and spawn dirt effects upon landing

View File

@ -133,7 +133,7 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, PlayState* play) {
Vec3f* actorPos = &this->actor.world.pos;
pos = *actorPos;
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 400);
@ -168,7 +168,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Player* player2 = GET_PLAYER(play);
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.yDistToWater > 15.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) {
EnTuboTrap_SpawnEffectsInWater(this, play);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER);
EnTuboTrap_DropCollectible(this, play);

View File

@ -388,7 +388,7 @@ void func_80B32E34(EnWeiyer* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x200, 0x80);
if ((player->actor.yDistToWater < 50.0f) && (this->actor.yDistToWater < 20.0f) &&
if ((player->actor.depthInWater < 50.0f) && (this->actor.depthInWater < 20.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x2000)) {
func_80B327D8(this);
}
@ -523,7 +523,7 @@ void func_80B3349C(EnWeiyer* this, PlayState* play) {
if (this->unk_194 == -1) {
if (phi_a0 || (this->collider.base.atFlags & AT_HIT)) {
func_80B32538(this);
} else if (this->actor.yDistToWater < 0.0f) {
} else if (this->actor.depthInWater < 0.0f) {
this->unk_194 = 10;
EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 1, 400);
Actor_PlaySfx(&this->actor, NA_SE_EN_OCTAROCK_JUMP);
@ -584,7 +584,7 @@ void EnWeiyer_Update(Actor* thisx, PlayState* play) {
EnWeiyer* this = (EnWeiyer*)thisx;
s32 pad;
this->actor.home.pos.y = this->actor.yDistToWater + this->actor.world.pos.y - 5.0f;
this->actor.home.pos.y = this->actor.depthInWater + this->actor.world.pos.y - 5.0f;
func_80B3368C(this, play);
this->actionFunc(this, play);
this->actor.world.rot.y = this->actor.shape.rot.y;

View File

@ -60,7 +60,7 @@ void EnZo_SpawnBubble(EnZo* this, Vec3f* pos) {
continue;
}
waterSurface = this->actor.world.pos.y + this->actor.yDistToWater;
waterSurface = this->actor.world.pos.y + this->actor.depthInWater;
if (!(waterSurface <= pos->y)) {
effect->type = ENZO_EFFECT_BUBBLE;
@ -127,7 +127,7 @@ void EnZo_UpdateEffectsBubbles(EnZo* this) {
effect->pos.y += effect->vel.y;
// Bubbles turn into ripples when they reach the surface
waterSurface = this->actor.world.pos.y + this->actor.yDistToWater;
waterSurface = this->actor.world.pos.y + this->actor.depthInWater;
if (waterSurface <= effect->pos.y) {
effect->type = ENZO_EFFECT_NONE;
effect->pos.y = waterSurface;
@ -158,7 +158,7 @@ void EnZo_UpdateEffectsSplashes(EnZo* this) {
}
// Splash particles turn into ripples when they hit the surface
waterSurface = this->actor.world.pos.y + this->actor.yDistToWater;
waterSurface = this->actor.world.pos.y + this->actor.depthInWater;
if (effect->pos.y < waterSurface) {
effect->type = ENZO_EFFECT_NONE;
effect->pos.y = waterSurface;
@ -272,7 +272,7 @@ void EnZo_TreadWaterRipples(EnZo* this, f32 scale, f32 targetScale, u8 alpha) {
Vec3f pos = { 0.0f, 0.0f, 0.0f };
pos.x = this->actor.world.pos.x;
pos.y = this->actor.world.pos.y + this->actor.yDistToWater;
pos.y = this->actor.world.pos.y + this->actor.depthInWater;
pos.z = this->actor.world.pos.z;
EnZo_SpawnRipple(this, &pos, scale, targetScale, alpha);
}
@ -351,7 +351,7 @@ void EnZo_SpawnSplashes(EnZo* this) {
pos = this->actor.world.pos;
pos.x += vel.x * 6.0f;
pos.z += vel.z * 6.0f;
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
EnZo_SpawnSplash(this, &pos, &vel, 0.08f);
}
}
@ -527,7 +527,7 @@ s32 EnZo_PlayerInProximity(EnZo* this, PlayState* play) {
f32 hDist;
surfacePos.x = this->actor.world.pos.x;
surfacePos.y = this->actor.world.pos.y + this->actor.yDistToWater;
surfacePos.y = this->actor.world.pos.y + this->actor.depthInWater;
surfacePos.z = this->actor.world.pos.z;
hDist = Math_Vec3f_DistXZ(&surfacePos, &player->actor.world.pos);
@ -596,7 +596,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
if (this->actor.yDistToWater < 54.0f || (this->actor.params & 0x3F) == 8) {
if (this->actor.depthInWater < 54.0f || (this->actor.params & 0x3F) == 8) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.shape.shadowScale = 24.0f;
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_1);
@ -642,7 +642,7 @@ void EnZo_Submerged(EnZo* this, PlayState* play) {
}
void EnZo_Surface(EnZo* this, PlayState* play) {
if (this->actor.yDistToWater < 54.0f) {
if (this->actor.depthInWater < 54.0f) {
Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER);
EnZo_SpawnSplashes(this);
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_3);
@ -650,7 +650,7 @@ void EnZo_Surface(EnZo* this, PlayState* play) {
this->actionFunc = EnZo_TreadWater;
this->actor.velocity.y = 0.0f;
this->alpha = 255.0f;
} else if (this->actor.yDistToWater < 80.0f) {
} else if (this->actor.depthInWater < 80.0f) {
Math_ApproachF(&this->actor.velocity.y, 2.0f, 0.4f, 0.6f);
Math_ApproachF(&this->alpha, 255.0f, 0.3f, 10.0f);
}
@ -665,7 +665,7 @@ void EnZo_TreadWater(EnZo* this, PlayState* play) {
}
EnZo_SetAnimation(this);
Math_ApproachF(&this->actor.velocity.y, this->actor.yDistToWater < 54.0f ? -0.6f : 0.6f, 0.3f, 0.2f);
Math_ApproachF(&this->actor.velocity.y, this->actor.depthInWater < 54.0f ? -0.6f : 0.6f, 0.3f, 0.2f);
if (this->rippleTimer != 0) {
this->rippleTimer--;
if ((this->rippleTimer == 3) || (this->rippleTimer == 6)) {
@ -705,7 +705,7 @@ void EnZo_Dive(EnZo* this, PlayState* play) {
return;
}
if (this->actor.yDistToWater > 80.0f || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.depthInWater > 80.0f || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_ApproachF(&this->actor.velocity.y, -1.0f, 0.4f, 0.6f);
Math_ApproachF(&this->alpha, 0.0f, 0.3f, 10.0f);
}

View File

@ -152,7 +152,7 @@ void ObjKibako_WaterBreak(ObjKibako* this, PlayState* play) {
Vec3f velocity;
pos = *breakPos;
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 500);
for (i = 0, angle = 0; i < 12; i++, angle += 0x4E20) {
@ -187,7 +187,7 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
ObjKibako_SetupHeld(this);
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.yDistToWater > 19.0f)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 19.0f)) {
ObjKibako_WaterBreak(this, play);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK);
ObjKibako_SpawnCollectible(this, play);

View File

@ -196,7 +196,7 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) {
s32 phi_s0;
s32 i;
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 400);
for (i = 0, angle = 0; i < 15; i++, angle += 0x4E20) {
f32 sins = Math_SinS(angle);
@ -240,7 +240,7 @@ void ObjTsubo_Idle(ObjTsubo* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
ObjTsubo_SetupLiftedUp(this);
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.yDistToWater > 15.0f)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) {
ObjTsubo_WaterBreak(this, play);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN);
ObjTsubo_SpawnCollectible(this, play);

View File

@ -4585,7 +4585,7 @@ s32 Player_ActionChange_12(Player* this, PlayState* play) {
sp3C = 0;
if (func_808332B8(this)) {
if (this->actor.yDistToWater < 50.0f) {
if (this->actor.depthInWater < 50.0f) {
if ((this->ledgeClimbType < PLAYER_LEDGE_CLIMB_2) ||
(this->yDistToLedge > this->ageProperties->unk_10)) {
return 0;
@ -5317,7 +5317,7 @@ s32 func_8083A6AC(Player* this, PlayState* play) {
//! @bug `floorPitch` and `floorPitchAlt` are cleared to 0 before this function is called, because the player
//! left the ground. The angles will always be zero and therefore will always pass these checks.
//! The intention seems to be to prevent ledge hanging or vine grabbing when walking off of a steep enough slope.
if ((this->actor.yDistToWater < -80.0f) && (ABS(this->floorPitch) < 0xAAA) && (ABS(this->floorPitchAlt) < 0xAAA)) {
if ((this->actor.depthInWater < -80.0f) && (ABS(this->floorPitch) < 0xAAA) && (ABS(this->floorPitchAlt) < 0xAAA)) {
CollisionPoly* sp84;
s32 sp80;
Vec3f sp74;
@ -5816,7 +5816,7 @@ s32 func_8083B8F4(Player* this, PlayState* play) {
if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) &&
Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_FIRST_PERSON)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(func_808332B8(this) && (this->actor.yDistToWater < this->ageProperties->unk_2C))) {
(func_808332B8(this) && (this->actor.depthInWater < this->ageProperties->unk_2C))) {
this->unk_6AD = 1;
return 1;
}
@ -6131,7 +6131,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) {
if (Player_GetBottleHeld(this) >= 0) {
Player_SetupAction(play, this, Player_Action_8084ECA4, 0);
if (this->actor.yDistToWater > 12.0f) {
if (this->actor.depthInWater > 12.0f) {
this->av2.actionVar2 = 1;
}
@ -6376,7 +6376,7 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) {
if ((this->stateFlags1 & PLAYER_STATE1_10) || (this->stateFlags2 & PLAYER_STATE2_10)) {
if (this->actor.velocity.y > 0.0f) {
if (this->actor.yDistToWater < this->ageProperties->unk_30) {
if (this->actor.depthInWater < this->ageProperties->unk_30) {
this->stateFlags2 &= ~PLAYER_STATE2_10;
@ -6434,7 +6434,7 @@ void func_8083D36C(PlayState* play, Player* this) {
}
}
if (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->actor.yDistToWater < this->ageProperties->unk_2C)) {
if (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->actor.depthInWater < this->ageProperties->unk_2C)) {
if (func_8083CFA8(play, this, this->actor.velocity.y, 500)) {
Player_PlaySfx(this, NA_SE_EV_DIVE_INTO_WATER);
@ -6453,7 +6453,7 @@ void func_8083D36C(PlayState* play, Player* this) {
}
void func_8083D53C(PlayState* play, Player* this) {
if (this->actor.yDistToWater < this->ageProperties->unk_2C) {
if (this->actor.depthInWater < this->ageProperties->unk_2C) {
Audio_SetBaseFilter(0);
this->underwaterTimer = 0;
} else {
@ -6464,7 +6464,7 @@ void func_8083D53C(PlayState* play, Player* this) {
}
if ((Player_Action_80845668 != this->actionFunc) && (Player_Action_8084BDFC != this->actionFunc)) {
if (this->ageProperties->unk_2C < this->actor.yDistToWater) {
if (this->ageProperties->unk_2C < this->actor.depthInWater) {
if (!(this->stateFlags1 & PLAYER_STATE1_27) ||
(!((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) &&
(Player_Action_8084E30C != this->actionFunc) && (Player_Action_8084E368 != this->actionFunc) &&
@ -6474,7 +6474,7 @@ void func_8083D53C(PlayState* play, Player* this) {
func_8083D36C(play, this);
return;
}
} else if ((this->stateFlags1 & PLAYER_STATE1_27) && (this->actor.yDistToWater < this->ageProperties->unk_24)) {
} else if ((this->stateFlags1 & PLAYER_STATE1_27) && (this->actor.depthInWater < this->ageProperties->unk_24)) {
if ((this->skelAnime.moveFlags == 0) && (this->currentBoots != PLAYER_BOOTS_IRON)) {
func_8083CD54(play, this, this->actor.shape.rot.y);
}
@ -6534,7 +6534,7 @@ void func_8083D6EC(PlayState* play, Player* this) {
}
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
if (this->actor.yDistToWater < 50.0f) {
if (this->actor.depthInWater < 50.0f) {
f32 temp4;
temp4 = fabsf(this->bodyPartsPos[PLAYER_BODYPART_WAIST].x - this->unk_A88.x) +
@ -6549,20 +6549,20 @@ void func_8083D6EC(PlayState* play, Player* this) {
this->unk_854 = 0.0f;
ripplePos.x = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.x;
ripplePos.y = this->actor.world.pos.y + this->actor.yDistToWater;
ripplePos.y = this->actor.world.pos.y + this->actor.depthInWater;
ripplePos.z = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.z;
EffectSsGRipple_Spawn(play, &ripplePos, 100, 500, 0);
if ((this->speedXZ > 4.0f) && !func_808332B8(this) &&
((this->actor.world.pos.y + this->actor.yDistToWater) <
((this->actor.world.pos.y + this->actor.depthInWater) <
this->bodyPartsPos[PLAYER_BODYPART_WAIST].y)) {
func_8083CFA8(play, this, 20.0f,
(fabsf(this->speedXZ) * 50.0f) + (this->actor.yDistToWater * 5.0f));
(fabsf(this->speedXZ) * 50.0f) + (this->actor.depthInWater * 5.0f));
}
}
}
if (this->actor.yDistToWater > 40.0f) {
if (this->actor.depthInWater > 40.0f) {
s32 numBubbles = 0;
s32 i;
@ -6971,7 +6971,7 @@ s32 Player_ActionChange_9(Player* this, PlayState* play) {
s32 func_8083EC18(Player* this, PlayState* play, u32 wallFlags) {
if (this->yDistToLedge >= 79.0f) {
if (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->currentBoots == PLAYER_BOOTS_IRON) ||
(this->actor.yDistToWater < this->ageProperties->unk_2C)) {
(this->actor.depthInWater < this->ageProperties->unk_2C)) {
s32 sp8C = (wallFlags & WALL_FLAG_3) ? 2 : 0;
if ((sp8C != 0) || (wallFlags & WALL_FLAG_1) ||
@ -10327,7 +10327,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) {
static u8 sDiveNumberDoActions[] = { DO_ACTION_1, DO_ACTION_2, DO_ACTION_3, DO_ACTION_4,
DO_ACTION_5, DO_ACTION_6, DO_ACTION_7, DO_ACTION_8 };
sp24 = (D_80854784[CUR_UPG_VALUE(UPG_SCALE)] - this->actor.yDistToWater) / 40.0f;
sp24 = (D_80854784[CUR_UPG_VALUE(UPG_SCALE)] - this->actor.depthInWater) / 40.0f;
sp24 = CLAMP(sp24, 0, 7);
doAction = sDiveNumberDoActions[sp24];
} else if (sp1C && !(this->stateFlags2 & PLAYER_STATE2_10)) {
@ -10397,7 +10397,7 @@ s32 Player_UpdateHoverBoots(Player* this) {
canHoverOnGround =
(this->currentBoots == PLAYER_BOOTS_HOVER) &&
((this->actor.yDistToWater >= 0.0f) || (func_80838144(sFloorType) >= 0) || func_8083816C(sFloorType));
((this->actor.depthInWater >= 0.0f) || (func_80838144(sFloorType) >= 0) || func_8083816C(sFloorType));
if (canHoverOnGround && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->hoverBootsTimer != 0)) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
@ -10500,7 +10500,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
this->prevFloorSfxOffset = this->floorSfxOffset;
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
if (this->actor.yDistToWater < 20.0f) {
if (this->actor.depthInWater < 20.0f) {
this->floorSfxOffset = SURFACE_SFX_OFFSET_WATER_SHALLOW;
} else {
this->floorSfxOffset = SURFACE_SFX_OFFSET_WATER_DEEP;
@ -10529,7 +10529,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
if (sConveyorSpeed != CONVEYOR_SPEED_DISABLED) {
sIsFloorConveyor = SurfaceType_IsFloorConveyor(&play->colCtx, floorPoly, this->actor.floorBgId);
if ((!sIsFloorConveyor && (this->actor.yDistToWater > 20.0f) &&
if ((!sIsFloorConveyor && (this->actor.depthInWater > 20.0f) &&
(this->currentBoots != PLAYER_BOOTS_IRON)) ||
(sIsFloorConveyor && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))) {
sConveyorYaw = CONVEYOR_DIRECTION_TO_BINANG(
@ -11112,7 +11112,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
if (this->currentBoots == PLAYER_BOOTS_IRON) {
if (this->stateFlags1 & PLAYER_STATE1_27) {
func_80832340(play, this);
if (this->ageProperties->unk_2C < this->actor.yDistToWater) {
if (this->ageProperties->unk_2C < this->actor.depthInWater) {
this->stateFlags2 |= PLAYER_STATE2_10;
}
}
@ -11770,7 +11770,7 @@ void func_8084B000(Player* this) {
f32 phi_f18;
f32 phi_f16;
f32 phi_f14;
f32 yDistToWater;
f32 depthInWater;
phi_f14 = -5.0f;
@ -11779,7 +11779,7 @@ void func_8084B000(Player* this) {
phi_f16 += 1.0f;
}
if (this->actor.yDistToWater < phi_f16) {
if (this->actor.depthInWater < phi_f16) {
if (this->actor.velocity.y <= 0.0f) {
phi_f16 = 0.0f;
} else {
@ -11800,8 +11800,8 @@ void func_8084B000(Player* this) {
phi_f18 = phi_f16 + 0.1f;
}
yDistToWater = this->actor.yDistToWater;
if (yDistToWater > 100.0f) {
depthInWater = this->actor.depthInWater;
if (depthInWater > 100.0f) {
this->stateFlags2 |= PLAYER_STATE2_10;
}
}
@ -12977,7 +12977,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) {
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !Player_ActionChange_2(this, play) &&
!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(this->actor.yDistToWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) {
(this->actor.depthInWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) {
func_8084DBC4(play, this, -2.0f);
} else {
this->av1.actionVar1++;
@ -12989,7 +12989,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) {
if (this->unk_6C2 < 10000) {
this->av1.actionVar1++;
this->av2.actionVar2 = this->actor.yDistToWater;
this->av2.actionVar2 = this->actor.depthInWater;
Player_AnimChangeLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim);
}
} else if (!func_8083D12C(play, this, sControlInput)) {