Rename yDistTo variables (#286)

* Change yDistTo to yDirDistTo.

* Run format.sh.

* Apply suggestions from code review

Fix comments in header file.

* Added "Surface" to yDirDistToWater.

* Update names in sellnuts and skb.

* Actually fix skb

* Rename yDirDistToWaterSurface to depthInWater.

* Rename yDirDistToPlayer to playerHeightRel.

* Apply suggestions from code review

Fix capitalization in header file comments.

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* Fix Jenkins (Obj_Aqua).

* Fix Jenkins (Obj_Etcetera).

* Fix Jenkins (En_Thiefbird).

* Fix misformatted files in current master.

* Fix Jenkins and run format.sh.

* Fix misformatted file in current master (z_debug).

* Update PR to include new actors.

* Update PR to include elforg, po_sisters, wf.

* update actorfixer.py with variable name changes.

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
rylieb
2021-11-02 21:29:20 -03:00
committed by GitHub
co-authored by Anghelo Carvajal
parent 7bda32153c
commit b37e3db802
35 changed files with 122 additions and 119 deletions
+2 -2
View File
@@ -172,12 +172,12 @@ typedef struct Actor {
/* 0x085 */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor
/* 0x086 */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching
/* 0x088 */ f32 floorHeight; // Y position of the floor polygon directly below the actor
/* 0x08C */ f32 yDistToWater; // Distance to the surface of active waterbox. Negative value means above water
/* 0x08C */ f32 depthInWater; // Directed distance to the surface of active waterbox. Negative value means water is below.
/* 0x090 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags
/* 0x092 */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player
/* 0x094 */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player in the x,y,z axis
/* 0x098 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane
/* 0x09C */ f32 yDistToPlayer; // Dist is negative if the actor is above the player
/* 0x09C */ f32 playerHeightRel; // Directed distance is negative if the player is below.
/* 0x0A0 */ CollisionCheckInfo colChkInfo; // Variables related to the Collision Check system
/* 0x0BC */ ActorShape shape; // Variables related to the physical shape of the actor
/* 0x0EC */ Vec3f projectedPos; // Position of the actor in projected space
+4 -4
View File
@@ -480,10 +480,10 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (!((sp38 != 0) && (this->actor.xzDistToPlayer <= 60.0f) && (this->actor.yDistToPlayer >= -100.0f) &&
(this->actor.yDistToPlayer <= 100.0f)) &&
!((sp38 == 0) && (this->actor.xzDistToPlayer <= 30.0f) && (this->actor.yDistToPlayer >= -50.0f) &&
(this->actor.yDistToPlayer <= 50.0f))) {
if (!((sp38 != 0) && (this->actor.xzDistToPlayer <= 60.0f) && (this->actor.playerHeightRel >= -100.0f) &&
(this->actor.playerHeightRel <= 100.0f)) &&
!((sp38 == 0) && (this->actor.xzDistToPlayer <= 30.0f) && (this->actor.playerHeightRel >= -50.0f) &&
(this->actor.playerHeightRel <= 50.0f))) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
return;
}
@@ -128,7 +128,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
s32 dooranaType = GET_DOORANA_TYPE(this);
s8 pad[4];
s32 entranceIndex;
f32 yDist;
f32 playerHeightRel;
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f) != 0) {
if ((this->actor.targetMode != 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0) &&
@@ -166,8 +166,9 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
} else {
if ((func_801690CC(globalCtx) == 0) && ((player->stateFlags1 & 0x08800000) == 0) &&
(this->actor.xzDistToPlayer <= 20.0f) && (yDist = this->actor.yDistToPlayer, (yDist >= -50.0f)) &&
(yDist <= 15.0f)) {
(this->actor.xzDistToPlayer <= 20.0f) &&
(playerHeightRel = this->actor.playerHeightRel, (playerHeightRel >= -50.0f)) &&
(playerHeightRel <= 15.0f)) {
player->stateFlags1 |= 0x80000000;
this->actor.targetMode = 1;
@@ -192,7 +193,7 @@ void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) {
}
}
if ((this->actor.yDistToPlayer <= 0.0f) && (this->actor.xzDistToPlayer > 20.0f)) {
if ((this->actor.playerHeightRel <= 0.0f) && (this->actor.xzDistToPlayer > 20.0f)) {
player = GET_PLAYER(globalCtx);
player->actor.world.pos.x = (Math_SinS(this->actor.yawTowardsPlayer) * 20.0f) + this->actor.world.pos.x;
player->actor.world.pos.z = (Math_CosS(this->actor.yawTowardsPlayer) * 20.0f) + this->actor.world.pos.z;
@@ -99,7 +99,7 @@ void func_809CCE98(EnBji01* this, GlobalContext* globalCtx) {
void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x444);
if (this->actor.params == ENBJI01_PARAMS_DEFAULT) {
if ((this->actor.xzDistToPlayer <= 60.0f) && (this->actor.yDistToPlayer <= 10.0f)) {
if ((this->actor.xzDistToPlayer <= 60.0f) && (this->actor.playerHeightRel <= 10.0f)) {
this->actor.flags |= 0x10000;
} else {
this->actor.flags &= ~0x10000;
@@ -172,7 +172,7 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
} else {
this->textId = 0x5F1;
}
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.yDistToPlayer, 0);
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
break;
case PLAYER_FORM_HUMAN:
this->textId = 0x5F7;
@@ -224,8 +224,8 @@ void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) {
}
if (phi_v1 && ((this->actor.xzDistToPlayer > 160.0f) || (this->actor.params != ENDEKUNUTS_GET_FF00_0)) &&
(((this->actor.params == ENDEKUNUTS_GET_FF00_0) && (fabsf(this->actor.yDistToPlayer) < 120.0f)) ||
((this->actor.params == ENDEKUNUTS_GET_FF00_2) && (this->actor.yDistToPlayer > -60.0f)) ||
(((this->actor.params == ENDEKUNUTS_GET_FF00_0) && (fabsf(this->actor.playerHeightRel) < 120.0f)) ||
((this->actor.params == ENDEKUNUTS_GET_FF00_2) && (this->actor.playerHeightRel > -60.0f)) ||
(this->actor.params == ENDEKUNUTS_GET_FF00_1)) &&
((this->unk_190 == 0) || (this->actor.xzDistToPlayer < 480.0f))) {
this->skelAnime.playSpeed = 1.0f;
+8 -8
View File
@@ -928,11 +928,11 @@ void func_8098B464(EnDg* this, GlobalContext* globalCtx) {
Vec3f sp2C;
sp2C.x = this->actor.world.pos.x;
sp2C.y = this->actor.world.pos.y + this->actor.yDistToWater;
sp2C.y = this->actor.world.pos.y + this->actor.depthInWater;
sp2C.z = this->actor.world.pos.z + 20.0f;
EffectSsGSplash_Spawn(globalCtx, &sp2C, NULL, NULL, 0, 800);
EffectSsGRipple_Spawn(globalCtx, &sp2C, 100, 500, 30);
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = -3.0f;
this->unk_284 = 10;
@@ -954,7 +954,7 @@ void func_8098B560(EnDg* this, GlobalContext* globalCtx) {
f32 sp34;
sp54.x = this->actor.world.pos.x;
sp54.y = this->actor.world.pos.y + this->actor.yDistToWater;
sp54.y = this->actor.world.pos.y + this->actor.depthInWater;
sp54.z = this->actor.world.pos.z + 20.0f;
sp48.x = (Math_SinS(this->actor.world.rot.y) * 50.0f) + this->actor.world.pos.x;
sp48.y = this->actor.home.pos.y + 100.0f;
@@ -969,9 +969,9 @@ void func_8098B560(EnDg* this, GlobalContext* globalCtx) {
EffectSsGRipple_Spawn(globalCtx, &sp54, 100, 500, 30);
}
if (this->actor.yDistToWater > 15.0f) {
if (this->actor.depthInWater > 15.0f) {
this->actor.velocity.y = 0.5f;
} else if (this->actor.yDistToWater < 10.0f) {
} else if (this->actor.depthInWater < 10.0f) {
this->actor.velocity.y = -0.5f;
}
@@ -1015,7 +1015,7 @@ void func_8098B88C(EnDg* this, GlobalContext* globalCtx) {
Vec3f sp34;
sp34.x = this->actor.world.pos.x;
sp34.y = this->actor.world.pos.y + this->actor.yDistToWater;
sp34.y = this->actor.world.pos.y + this->actor.depthInWater;
sp34.z = this->actor.world.pos.z + 20.0f;
if (DECR(this->unk_284) == 0) {
@@ -1023,9 +1023,9 @@ void func_8098B88C(EnDg* this, GlobalContext* globalCtx) {
EffectSsGRipple_Spawn(globalCtx, &sp34, 100, 500, 30);
}
if (this->actor.yDistToWater > 15.0f) {
if (this->actor.depthInWater > 15.0f) {
this->actor.velocity.y = 1.0f;
} else if (this->actor.yDistToWater < 10.0f) {
} else if (this->actor.depthInWater < 10.0f) {
this->actor.velocity.y = -1.0f;
}
@@ -1372,10 +1372,10 @@ void EnDinofos_Update(Actor* thisx, GlobalContext* globalCtx2) {
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, 30.0f, 60.0f, 0x5D);
if (this->actionFunc != func_8089C7B8) {
if ((this->actor.yDistToWater > 0.0f) && (this->actor.yDistToWater < 10.0f)) {
if ((this->actor.depthInWater > 0.0f) && (this->actor.depthInWater < 10.0f)) {
if (!((globalCtx->gameplayFrames % 4) & 1)) {
Math_Vec3f_Copy(&sp30, &this->unk_2D4[1 + (globalCtx->gameplayFrames % 4)]);
sp30.y = this->actor.world.pos.y + this->actor.yDistToWater;
sp30.y = this->actor.world.pos.y + this->actor.depthInWater;
EffectSsGRipple_Spawn(globalCtx, &sp30, 100, 320, 0);
}
}
+1 -1
View File
@@ -536,7 +536,7 @@ void func_80A724B8(EnDno* this, GlobalContext* globalCtx) {
}
void func_80A7256C(EnDno* this, GlobalContext* globalCtx) {
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.yDistToPlayer, -1);
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, -1);
}
void func_80A72598(EnDno* this, GlobalContext* globalCtx) {
+1 -1
View File
@@ -458,7 +458,7 @@ void EnDnq_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
this->unk_394 = this->actor.xzDistToPlayer;
func_80A52C6C(this, globalCtx);
func_8013C964(&this->actor, globalCtx, this->unk_390, fabsf(this->actor.yDistToPlayer) + 1.0f, 0,
func_8013C964(&this->actor, globalCtx, this->unk_390, fabsf(this->actor.playerHeightRel) + 1.0f, 0,
this->unk_37C & 7);
this->actor.xzDistToPlayer = this->unk_394;
Actor_SetHeight(&this->actor, 46.0f);
@@ -595,7 +595,7 @@ void func_80877500(EnDodongo* this, GlobalContext* globalCtx) {
temp_v1 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x1F4);
if (this->actor.xzDistToPlayer < (100.0f * this->unk_334)) {
if ((ABS_ALT(temp_v1) < 0x1388) && (this->actor.yDistToPlayer < 60.0f) &&
if ((ABS_ALT(temp_v1) < 0x1388) && (this->actor.playerHeightRel < 60.0f) &&
!(player->stateFlags1 & 0x800000)) {
func_808777A8(this);
}
@@ -434,7 +434,7 @@ void EnElforg_FreeFloating(EnElforg* this, GlobalContext* globalCtx) {
EnElforg_MoveToTarget(this, &this->actor.home.pos);
}
scaledYDistance = this->actor.yDistToPlayer - (this->actor.shape.yOffset * this->actor.scale.y);
scaledYDistance = this->actor.playerHeightRel - (this->actor.shape.yOffset * this->actor.scale.y);
if (!func_801233E4(globalCtx)) {
if ((this->actor.xzDistToPlayer < 30.0f) && (scaledYDistance < 12.0f) && (scaledYDistance > -68.0f)) {
EnElforg_SetupFairyCollected(this, globalCtx);
@@ -412,7 +412,7 @@ void EnFirefly_Die(EnFirefly* this, GlobalContext* globalCtx) {
void EnFirefly_SetupDiveAttack(EnFirefly* this) {
this->timer = Rand_S16Offset(70, 100);
this->skelAnime.playSpeed = 1.0f;
this->targetPitch = ((this->actor.yDistToPlayer > 0.0f) ? -0xC00 : 0xC00) + 0x1554;
this->targetPitch = ((this->actor.playerHeightRel > 0.0f) ? -0xC00 : 0xC00) + 0x1554;
this->actionFunc = EnFirefly_DiveAttack;
}
+3 -3
View File
@@ -161,7 +161,7 @@ void func_80BCF354(EnHg* this) {
void func_80BCF398(EnHg* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.health == 1) {
if ((this->actor.xzDistToPlayer < 200.0f && this->actor.yDistToPlayer < 40.0f) &&
if ((this->actor.xzDistToPlayer < 200.0f && this->actor.playerHeightRel < 40.0f) &&
!func_800EE29C(globalCtx, 0x1E3)) {
func_80BCF468(this);
}
@@ -353,7 +353,7 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (this->actor.colChkInfo.health == 1 && !(fabsf(this->actor.yDistToPlayer) >= 80.0f)) {
if (this->actor.colChkInfo.health == 1 && !(fabsf(this->actor.playerHeightRel) >= 80.0f)) {
if (player->stateFlags2 & 0x08000000) {
if (!D_80BD00C8) {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
@@ -372,7 +372,7 @@ void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
func_80BCF88C(this);
}
} else {
if (this->actor.xzDistToPlayer < 60.0f && fabsf(this->actor.yDistToPlayer) < 40.0f) {
if (this->actor.xzDistToPlayer < 60.0f && fabsf(this->actor.playerHeightRel) < 40.0f) {
if ((this->actionFunc != func_80BCF8A0) && (this->actionFunc != func_80BCF95C)) {
if (!(gSaveContext.weekEventReg[0x3D] & 2)) {
gSaveContext.weekEventReg[0x3D] |= 2;
+4 -4
View File
@@ -251,7 +251,7 @@ void EnHoll_VerticalBgCoverIdle(EnHoll* this, GlobalContext* globalCtx) {
f32 playerDistFromCentralPlane;
if ((this->actor.xzDistToPlayer < EN_HOLL_RADIUS) &&
(playerDistFromCentralPlane = fabsf(this->actor.yDistToPlayer),
(playerDistFromCentralPlane = fabsf(this->actor.playerHeightRel),
playerDistFromCentralPlane < EN_HOLL_ACTIVATION_PLANE_DISTANCE_VERTICAL)) {
if (playerDistFromCentralPlane < EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) {
globalCtx->bgCoverAlpha = 255;
@@ -260,7 +260,7 @@ void EnHoll_VerticalBgCoverIdle(EnHoll* this, GlobalContext* globalCtx) {
}
if (playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) {
s32 enHollId = EN_HOLL_GET_ID_CAST(this);
s32 playerSide = (this->actor.yDistToPlayer > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
this->actor.room = globalCtx->doorCtx.transitionActorList[enHollId].sides[playerSide].room;
@@ -279,12 +279,12 @@ void EnHoll_VerticalBgCoverIdle(EnHoll* this, GlobalContext* globalCtx) {
void EnHoll_VerticalIdle(EnHoll* this, GlobalContext* globalCtx) {
if (this->actor.xzDistToPlayer < EN_HOLL_RADIUS) {
f32 playerDistFromCentralPlane = fabsf(this->actor.yDistToPlayer);
f32 playerDistFromCentralPlane = fabsf(this->actor.playerHeightRel);
if (playerDistFromCentralPlane < EN_HOLL_ACTIVATION_PLANE_DISTANCE_VERTICAL &&
playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) {
s32 enHollId = EN_HOLL_GET_ID_CAST(this);
s32 playerSide = (this->actor.yDistToPlayer > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
this->actor.room = globalCtx->doorCtx.transitionActorList[enHollId].sides[playerSide].room;
if ((this->actor.room != globalCtx->roomCtx.currRoom.num) &&
@@ -765,7 +765,7 @@ void EnMinislime_Update(Actor* thisx, GlobalContext* globalCtx) {
player = GET_PLAYER(globalCtx);
vec1.x = this->actor.world.pos.x;
vec1.z = this->actor.world.pos.z;
vec1.y = player->actor.world.pos.y + player->actor.yDistToWater;
vec1.y = player->actor.world.pos.y + player->actor.depthInWater;
EffectSsGRipple_Spawn(globalCtx, &vec1, 500, 720, 0);
}
}
@@ -261,8 +261,8 @@ s32 func_80A68DD4(EnMushi2* this, GlobalContext* globalCtx) {
s32 pad2;
f32 sp24;
if ((this->actor.xzDistToPlayer < 32.0f) && (this->actor.yDistToPlayer > -10.0f) &&
(this->actor.yDistToPlayer < 31.0f)) {
if ((this->actor.xzDistToPlayer < 32.0f) && (this->actor.playerHeightRel > -10.0f) &&
(this->actor.playerHeightRel < 31.0f)) {
player = GET_PLAYER(globalCtx);
sp2E = BINANG_ROT180(this->actor.yawTowardsPlayer);
sp24 = Math_SinS(sp2E);
@@ -533,14 +533,14 @@ void func_80A697C4(EnMushi2* this, GlobalContext* globalCtx) {
if (func_800CA1E8(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C,
&sp30)) {
this->actor.yDistToWater = sp2C - this->actor.world.pos.y;
if (this->actor.yDistToWater >= 1.0f) {
this->actor.depthInWater = sp2C - this->actor.world.pos.y;
if (this->actor.depthInWater >= 1.0f) {
this->unk_30C |= 0x20;
} else {
this->unk_30C &= ~0x20;
}
} else {
this->actor.yDistToWater = BGCHECK_Y_MIN;
this->actor.depthInWater = BGCHECK_Y_MIN;
this->unk_30C &= ~0x20;
}
}
@@ -966,7 +966,7 @@ void func_80A6AB08(EnMushi2* this, GlobalContext* globalCtx) {
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
func_80A69424(this, globalCtx);
Math_StepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 2.8f);
Math_StepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.depthInWater, 2.8f);
this->skelAnime.playSpeed = this->unk_368 * 0.018f;
this->skelAnime.playSpeed = CLAMP(this->skelAnime.playSpeed, 0.1f, 1.9f);
@@ -992,7 +992,7 @@ void func_80A6AB08(EnMushi2* this, GlobalContext* globalCtx) {
Vec3f sp3C;
sp3C.x = this->actor.world.pos.x;
sp3C.y = this->actor.world.pos.y + this->actor.yDistToWater;
sp3C.y = this->actor.world.pos.y + this->actor.depthInWater;
sp3C.z = this->actor.world.pos.z;
EffectSsGRipple_Spawn(globalCtx, &sp3C, 40, 200, 4);
}
@@ -1030,7 +1030,7 @@ void func_80A6AE7C(EnMushi2* this, GlobalContext* globalCtx) {
func_80A69424(this, globalCtx);
temp_f2 = this->actor.scale.x - (1.0f / 20000.0f);
Actor_SetScale(&this->actor, CLAMP_MIN(temp_f2, 0.001f));
if ((this->actor.flags & 0x40) && (this->actor.yDistToWater > 5.0f) && (this->actor.yDistToWater < 30.0f) &&
if ((this->actor.flags & 0x40) && (this->actor.depthInWater > 5.0f) && (this->actor.depthInWater < 30.0f) &&
((Rand_Next() & 0x1FF) < this->unk_368)) {
EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -5.0f, 5.0f, 5.0f,
((Rand_ZeroOne() * 4.0f) + 2.0f) * this->actor.scale.x);
+4 -4
View File
@@ -523,13 +523,13 @@ void EnNiw_Swimming(EnNiw* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 0x20) {
// still touching 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->unkTimer250 == 0) {
this->unkTimer250 = 30;
Math_Vec3f_Copy(&ripplePos, &this->actor.world.pos);
ripplePos.y += this->actor.yDistToWater;
ripplePos.y += this->actor.depthInWater;
EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 30);
}
@@ -858,12 +858,12 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = EnNiw_LandBeforeIdle;
return;
} else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f) &&
} else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 15.0f) &&
(this->unknownState28E != 6)) {
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
pos.y += this->actor.yDistToWater;
pos.y += this->actor.depthInWater;
this->unkTimer250 = 30;
EffectSsGSplash_Spawn(globalCtx, &pos, 0, 0, 0, 400);
this->unkTimer252 = 0;
+6 -6
View File
@@ -387,7 +387,7 @@ void func_80B5C154(EnOt* this, GlobalContext* globalCtx) {
this->unk_38C = 12;
gSaveContext.weekEventReg[32] |= 1;
}
func_800B8A1C(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.yDistToPlayer);
func_800B8A1C(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
this->actionFunc = func_80B5C1CC;
}
@@ -397,7 +397,7 @@ void func_80B5C1CC(EnOt* this, GlobalContext* globalCtx) {
func_80B5C244(this, globalCtx);
func_80B5C244(this->unk_360, globalCtx);
} else {
func_800B8A1C(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.yDistToPlayer);
func_800B8A1C(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
}
}
@@ -611,7 +611,7 @@ void func_80B5CB0C(EnOt* this, GlobalContext* globalCtx) {
void func_80B5CBA0(EnOt* this, GlobalContext* globalCtx) {
this->actor.flags |= 0x10000;
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.yDistToPlayer, 0);
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
this->actionFunc = func_80B5CBEC;
}
@@ -622,7 +622,7 @@ void func_80B5CBEC(EnOt* this, GlobalContext* globalCtx) {
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
this->actor.world.rot.y = this->actor.shape.rot.y;
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.yDistToPlayer, 0);
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
}
}
@@ -698,7 +698,7 @@ void func_80B5CEC8(EnOt* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
if (this->unk_32C & 0x800) {
this->actor.flags |= 0x10000;
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.yDistToPlayer, 0);
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
} else {
this->actor.flags &= ~0x10000;
if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) {
@@ -707,7 +707,7 @@ void func_80B5CEC8(EnOt* this, GlobalContext* globalCtx) {
}
if (!(gSaveContext.weekEventReg[84] & 0x10) && (ENOT_GET_C000(&this->actor) == 1)) {
if ((fabsf(this->actor.xzDistToPlayer) <= 130.0f) && (fabsf(this->actor.yDistToPlayer) <= 130.0f)) {
if ((fabsf(this->actor.xzDistToPlayer) <= 130.0f) && (fabsf(this->actor.playerHeightRel) <= 130.0f)) {
player->unk_B2B = 29;
}
@@ -273,10 +273,10 @@ void EnPametfrog_ChangeColliderThaw(EnPametfrog* this, GlobalContext* globalCtx)
void EnPametfrog_JumpWaterEffects(EnPametfrog* this, GlobalContext* globalCtx) {
Vec3f pos;
if (this->actor.yDistToWater > 0.0f) {
if (this->actor.depthInWater > 0.0f) {
pos.x = this->actor.world.pos.x;
pos.z = this->actor.world.pos.z;
pos.y = this->actor.world.pos.y + this->actor.yDistToWater;
pos.y = this->actor.world.pos.y + this->actor.depthInWater;
EffectSsGRipple_Spawn(globalCtx, &pos, 150, 550, 0);
pos.y += 8.0f;
EffectSsGSplash_Spawn(globalCtx, &pos, NULL, NULL, 0, 550);
@@ -286,10 +286,10 @@ void EnPametfrog_JumpWaterEffects(EnPametfrog* this, GlobalContext* globalCtx) {
void EnPametfrog_IdleWaterEffects(EnPametfrog* this, GlobalContext* globalCtx) {
Vec3f pos;
if ((this->actor.yDistToWater > 0.0f) && ((globalCtx->gameplayFrames % 14) == 0)) {
if ((this->actor.depthInWater > 0.0f) && ((globalCtx->gameplayFrames % 14) == 0)) {
pos.x = this->actor.world.pos.x;
pos.z = this->actor.world.pos.z;
pos.y = this->actor.world.pos.y + this->actor.yDistToWater;
pos.y = this->actor.world.pos.y + this->actor.depthInWater;
EffectSsGRipple_Spawn(globalCtx, &pos, 150, 550, 0);
}
}
@@ -344,7 +344,7 @@ void func_80B1ACB8(EnPoSisters* this, GlobalContext* globalCtx) {
}
}
if ((this->actor.xzDistToPlayer < 600.0f) && (fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f)) {
if ((this->actor.xzDistToPlayer < 600.0f) && (fabsf(this->actor.playerHeightRel + 5.0f) < 30.0f)) {
func_80B1AE28(this);
} else if ((this->unk_192 == 0) && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f)) {
func_80B1AB5C(this);
@@ -377,7 +377,7 @@ void func_80B1AE3C(EnPoSisters* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C);
}
if ((this->actor.xzDistToPlayer < 320.0f) && (fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f)) {
if ((this->actor.xzDistToPlayer < 320.0f) && (fabsf(this->actor.playerHeightRel + 5.0f) < 30.0f)) {
func_80B1AF8C(this);
} else if (this->actor.xzDistToPlayer > 720.0f) {
func_80B1AC40(this);

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