1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 14:20:11 +00:00

Actor Struct Changes (and a few related things) (#617)

* reformat header

* type -> category

* done for now i think

* some more stuff

* first -> head

* focus

* flag comment

* ground -> floor

* remove asm, name wrapper funcs

* name func, format

* review

* targetPriority, format

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0305ec2c2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0305ec2c2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* comment

* review

* feet flags

* horse shadow
This commit is contained in:
fig02 2021-01-18 16:04:04 -05:00 committed by GitHub
parent 20206fba0d
commit 00a5edea71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
697 changed files with 8157 additions and 7942 deletions

View file

@ -79,7 +79,7 @@ extern AnimationHeader D_06001578;
const ActorInit En_GeldB_InitVars = {
ACTOR_EN_GELDB,
ACTORTYPE_ENEMY,
ACTORCAT_ENEMY,
FLAGS,
OBJECT_GELDB,
sizeof(EnGeldB),
@ -212,7 +212,7 @@ static DamageTable sDamageTable = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, -3000, ICHAIN_STOP),
};
@ -230,11 +230,11 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
thisx->colChkInfo.damageTable = &sDamageTable;
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Teardrop, 0.0f);
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFeet, 0.0f);
this->actor.colChkInfo.mass = MASS_HEAVY;
thisx->colChkInfo.health = 20;
thisx->colChkInfo.unk_10 = 50;
thisx->colChkInfo.unk_12 = 100;
thisx->colChkInfo.cylRadius = 50;
thisx->colChkInfo.cylHeight = 100;
thisx->naviEnemyId = 0x54;
this->keyFlag = thisx->params & 0xFF00;
thisx->params &= 0xFF;
@ -283,9 +283,9 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
s16 angleToLink;
Actor* bomb;
angleToWall = thisx->wallPolyRot - thisx->shape.rot.y;
angleToWall = thisx->wallYaw - thisx->shape.rot.y;
angleToWall = ABS(angleToWall);
angleToLink = thisx->yawTowardsLink - thisx->shape.rot.y;
angleToLink = thisx->yawTowardsPlayer - thisx->shape.rot.y;
angleToLink = ABS(angleToLink);
if (func_800354B4(globalCtx, thisx, 100.0f, 0x2710, 0x3E80, thisx->shape.rot.y)) {
@ -298,25 +298,25 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
}
}
if (func_800354B4(globalCtx, thisx, 100.0f, 0x5DC0, 0x2AA8, thisx->shape.rot.y)) {
thisx->shape.rot.y = thisx->posRot.rot.y = thisx->yawTowardsLink;
if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToLink < 90.0f)) {
thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer;
if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToPlayer < 90.0f)) {
EnGeldB_SetupJump(this);
return true;
} else if (player->swordAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, globalCtx);
return true;
} else if ((thisx->xzDistToLink < 90.0f) && (globalCtx->gameplayFrames & 1)) {
} else if ((thisx->xzDistToPlayer < 90.0f) && (globalCtx->gameplayFrames & 1)) {
EnGeldB_SetupBlock(this);
return true;
} else {
EnGeldB_SetupRollBack(this);
return true;
}
} else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORTYPE_EXPLOSIVES, 80.0f)) != NULL) {
thisx->shape.rot.y = thisx->posRot.rot.y = thisx->yawTowardsLink;
} else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f)) != NULL) {
thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer;
if (((thisx->bgCheckFlags & 8) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) {
if ((bomb->id == ACTOR_EN_BOM_CHU) && (func_8002DB48(thisx, bomb) < 80.0f) &&
((s16)(thisx->shape.rot.y - (bomb->posRot.rot.y - 0x8000)) < 0x3E80)) {
if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) &&
((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) {
EnGeldB_SetupJump(this);
return true;
} else {
@ -334,7 +334,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
} else {
s16 angleToFacingLink = player->actor.shape.rot.y - thisx->shape.rot.y;
if ((thisx->xzDistToLink <= 45.0f) && !func_80033AB8(globalCtx, thisx) &&
if ((thisx->xzDistToPlayer <= 45.0f) && !func_80033AB8(globalCtx, thisx) &&
((globalCtx->gameplayFrames & 7) || (ABS(angleToFacingLink) < 0x38E0))) {
EnGeldB_SetupSlash(this);
return true;
@ -349,7 +349,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
void EnGeldB_SetupWait(EnGeldB* this) {
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_0600ADF8, 0.0f);
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 120.0f;
this->actor.world.pos.y = this->actor.home.pos.y + 120.0f;
this->timer = 10;
this->invisible = true;
this->actionState = GELDB_WAIT;
@ -360,21 +360,21 @@ void EnGeldB_SetupWait(EnGeldB* this) {
}
void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) {
if ((this->invisible && !Flags_GetSwitch(globalCtx, this->actor.initPosRot.rot.z)) ||
this->actor.xzDistToLink > 300.0f) {
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.posRot.pos.y = this->actor.groundY + 120.0f;
if ((this->invisible && !Flags_GetSwitch(globalCtx, this->actor.home.rot.z)) ||
this->actor.xzDistToPlayer > 300.0f) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.world.pos.y = this->actor.floorHeight + 120.0f;
} else {
this->invisible = false;
this->actor.shape.unk_10 = 90.0f;
this->actor.shape.shadowScale = 90.0f;
func_800F5ACC(0x38);
}
if (this->actor.bgCheckFlags & 2) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
this->skelAnime.playSpeed = 1.0f;
this->actor.posRot.pos.y = this->actor.groundY;
this->actor.world.pos.y = this->actor.floorHeight;
this->actor.flags |= 1;
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.focus.pos = this->actor.world.pos;
this->actor.bgCheckFlags &= ~2;
this->actor.velocity.y = 0.0f;
func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
@ -391,7 +391,7 @@ void EnGeldB_SetupFlee(EnGeldB* this) {
this->timer = 20;
this->invisible = false;
this->actionState = GELDB_WAIT;
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupAction(this, EnGeldB_Flee);
}
@ -405,7 +405,7 @@ void EnGeldB_Flee(EnGeldB* this, GlobalContext* globalCtx) {
func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
}
if (SkelAnime_Update(&this->skelAnime)) {
Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.groundY + 300.0f, 1.0f, 20.5f, 0.0f);
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 300.0f, 1.0f, 20.5f, 0.0f);
this->timer--;
if (this->timer == 0) {
Actor_Kill(&this->actor);
@ -418,7 +418,7 @@ void EnGeldB_SetupReady(EnGeldB* this) {
this->actionState = GELDB_READY;
this->timer = Rand_ZeroOne() * 10.0f + 5.0f;
this->actor.speedXZ = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
EnGeldB_SetupAction(this, EnGeldB_Ready);
}
@ -429,14 +429,14 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (this->lookTimer != 0) {
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->headRot.y;
angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headRot.y;
if (ABS(angleToLink) > 0x2000) {
this->lookTimer--;
return;
}
this->lookTimer = 0;
}
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y;
angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if (!EnGeldB_DodgeRanged(globalCtx, this)) {
if (this->unkTimer != 0) {
this->unkTimer--;
@ -449,12 +449,12 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) {
return;
}
angleToLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
if ((this->actor.xzDistToLink < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupCircle(this);
} else if (--this->timer == 0) {
if (func_8002E084(&this->actor, 30 * 0x10000 / 360)) {
if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) &&
if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) &&
(Rand_ZeroOne() < 0.3f)) {
if (func_80033AB8(globalCtx, &this->actor) || (Rand_ZeroOne() > 0.5f) ||
(ABS(angleToLink) < 0x38E0)) {
@ -495,11 +495,11 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
f32 playSpeed;
if (!EnGeldB_DodgeRanged(globalCtx, this)) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x2EE, 0);
this->actor.posRot.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToLink <= 40.0f) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer <= 40.0f) {
Math_SmoothStepToF(&this->actor.speedXZ, -8.0f, 1.0f, 1.5f, 0.0f);
} else if (this->actor.xzDistToLink > 55.0f) {
} else if (this->actor.xzDistToPlayer > 55.0f) {
Math_SmoothStepToF(&this->actor.speedXZ, 8.0f, 1.0f, 1.5f, 0.0f);
} else {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 6.65f, 0.0f);
@ -507,8 +507,8 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
this->skelAnime.playSpeed = this->actor.speedXZ * 0.125f;
facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
facingAngletoLink = ABS(facingAngletoLink);
if ((this->actor.xzDistToLink < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
if ((this->actor.xzDistToPlayer < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (Rand_ZeroOne() > 0.7f) {
EnGeldB_SetupCircle(this);
return;
@ -525,9 +525,9 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
} else {
EnGeldB_SetupReady(this);
}
} else if (this->actor.xzDistToLink < 90.0f) {
} else if (this->actor.xzDistToPlayer < 90.0f) {
if (!func_80033AB8(globalCtx, &this->actor) &&
(Rand_ZeroOne() > 0.03f || (this->actor.xzDistToLink <= 45.0f && facingAngletoLink < 0x38E0))) {
(Rand_ZeroOne() > 0.03f || (this->actor.xzDistToPlayer <= 45.0f && facingAngletoLink < 0x38E0))) {
EnGeldB_SetupSlash(this);
} else if (func_80033AB8(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) {
EnGeldB_SetupRollBack(this);
@ -536,7 +536,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
}
}
if (!EnGeldB_ReactToPlayer(globalCtx, this, 0)) {
if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) &&
if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) &&
func_8002E084(&this->actor, 0x71C)) {
if (func_80033A84(globalCtx, &this->actor)) {
if (Rand_ZeroOne() > 0.5f) {
@ -567,7 +567,7 @@ void EnGeldB_SetupRollForward(EnGeldB* this) {
this->timer = 0;
this->invisible = true;
this->actionState = GELDB_ROLL_FORWARD;
this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = 10.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP);
EnGeldB_SetupAction(this, EnGeldB_RollForward);
@ -610,9 +610,9 @@ void EnGeldB_Pivot(EnGeldB* this, GlobalContext* globalCtx) {
f32 playSpeed;
if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) {
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y;
angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
turnRate = (angleToLink > 0) ? ((angleToLink * 0.25f) + 2000.0f) : ((angleToLink * 0.25f) - 2000.0f);
this->actor.posRot.rot.y = this->actor.shape.rot.y += turnRate;
this->actor.world.rot.y = this->actor.shape.rot.y += turnRate;
if (angleToLink > 0) {
playSpeed = turnRate * 0.5f;
playSpeed = CLAMP_MAX(playSpeed, 1.0f);
@ -639,7 +639,7 @@ void EnGeldB_SetupCircle(EnGeldB* this) {
Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814),
ANIMMODE_LOOP_INTERP, 0.0f);
this->actor.speedXZ = Rand_CenteredFloat(12.0f);
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
this->timer = Rand_ZeroOne() * 30.0f + 30.0f;
this->actionState = GELDB_CIRCLE;
@ -656,9 +656,9 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
s32 prevKeyFrame;
Player* player = PLAYER;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1);
if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) {
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3A98;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3A98;
angleBehindLink = player->actor.shape.rot.y + 0x8000;
if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) >= 0.0f) {
this->actor.speedXZ -= 0.25f;
@ -679,7 +679,7 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
} else {
phi_v1 = this->actor.shape.rot.y - 0x3E80;
}
phi_v1 = this->actor.wallPolyRot - phi_v1;
phi_v1 = this->actor.wallYaw - phi_v1;
} else {
this->actor.speedXZ *= -0.8f;
phi_v1 = 0;
@ -693,16 +693,16 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
}
}
}
if (this->actor.xzDistToLink <= 45.0f) {
if (this->actor.xzDistToPlayer <= 45.0f) {
Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f);
} else if (this->actor.xzDistToLink > 40.0f) {
} else if (this->actor.xzDistToPlayer > 40.0f) {
Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f);
} else {
Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f);
}
if (this->approachRate != 0.0f) {
this->actor.posRot.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate;
this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate;
this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
}
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) {
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
@ -724,7 +724,7 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_BREATH);
}
if ((Math_CosS(angleBehindLink - this->actor.shape.rot.y) < -0.85f) &&
!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink <= 45.0f)) {
!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) {
EnGeldB_SetupSlash(this);
} else if (--this->timer == 0) {
if (func_80033AB8(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) {
@ -753,7 +753,7 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.speedXZ = -10.0f;
}
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->timer = 6;
this->approachRate = 0.0f;
this->unkFloat = 0.0f;
@ -769,7 +769,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
s32 lastKeyFrame;
s32 nextKeyFrame;
this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x3A98;
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98;
if ((this->actor.bgCheckFlags & 8) ||
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & 8) {
@ -778,7 +778,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
} else {
phi_v1 = this->actor.shape.rot.y - 0x3E80;
}
phi_v1 = this->actor.wallPolyRot - phi_v1;
phi_v1 = this->actor.wallYaw - phi_v1;
} else {
this->actor.speedXZ *= -0.8f;
phi_v1 = 0;
@ -788,16 +788,16 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
return;
}
}
if (this->actor.xzDistToLink <= 45.0f) {
if (this->actor.xzDistToPlayer <= 45.0f) {
Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f);
} else if (this->actor.xzDistToLink > 40.0f) {
} else if (this->actor.xzDistToPlayer > 40.0f) {
Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f);
} else {
Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f);
}
if (this->approachRate != 0.0f) {
this->actor.posRot.pos.x += Math_SinS(this->actor.yawTowardsLink) * this->approachRate;
this->actor.posRot.pos.z += Math_CosS(this->actor.yawTowardsLink) * this->approachRate;
this->actor.world.pos.x += Math_SinS(this->actor.yawTowardsPlayer) * this->approachRate;
this->actor.world.pos.z += Math_CosS(this->actor.yawTowardsPlayer) * this->approachRate;
}
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) {
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
@ -818,9 +818,9 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
}
this->timer--;
if (this->timer == 0) {
this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
if (!EnGeldB_DodgeRanged(globalCtx, this)) {
if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink <= 70.0f)) {
if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) {
EnGeldB_SetupSlash(this);
} else {
EnGeldB_SetupRollBack(this);
@ -848,7 +848,7 @@ void EnGeldB_SetupSlash(EnGeldB* this) {
void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s16 angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
s16 angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y;
s16 angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
angleFacingLink = ABS(angleFacingLink);
angleToLink = ABS(angleToLink);
@ -871,16 +871,16 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) {
if (angleToLink > 0x4000) {
this->lookTimer = 20;
}
} else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToLink >= 120.0f)) {
} else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToPlayer >= 120.0f)) {
EnGeldB_SetupReady(this);
this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f;
} else {
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (Rand_ZeroOne() > 0.7f) {
EnGeldB_SetupSidestep(this, globalCtx);
} else if (angleFacingLink <= 0x2710) {
if (angleToLink > 0x3E80) {
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupCircle(this);
} else {
EnGeldB_ReactToPlayer(globalCtx, this, 1);
@ -915,7 +915,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
} else if (this->swordCollider.base.atFlags & AT_HIT) {
this->swordCollider.base.atFlags &= ~AT_HIT;
if (&player->actor == this->swordCollider.base.at) {
func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f);
func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f);
this->spinAttackState = 2;
func_8002DF54(globalCtx, &this->actor, 0x18);
func_8010B680(globalCtx, 0x6003, &this->actor);
@ -927,7 +927,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
}
}
if ((s32)this->skelAnime.curFrame < 9) {
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
} else if ((s32)this->skelAnime.curFrame == 13) {
func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
@ -946,21 +946,21 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
this->lookTimer = 46;
} else if (this->spinAttackState != 0) {
EnGeldB_SetupRollBack(this);
} else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToLink >= 120.0f)) {
} else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToPlayer >= 120.0f)) {
EnGeldB_SetupReady(this);
this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f;
} else {
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (Rand_ZeroOne() > 0.7f) {
EnGeldB_SetupSidestep(this, globalCtx);
} else {
angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
angleFacingLink = ABS(angleFacingLink);
if (angleFacingLink <= 0x2710) {
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y;
angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
angleToLink = ABS(angleToLink);
if (angleToLink > 0x3E80) {
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupCircle(this);
} else {
EnGeldB_ReactToPlayer(globalCtx, this, 1);
@ -980,14 +980,14 @@ void EnGeldB_SetupRollBack(EnGeldB* this) {
this->actionState = GELDB_ROLL_BACK;
this->actor.speedXZ = -8.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP);
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupAction(this, EnGeldB_RollBack);
}
void EnGeldB_RollBack(EnGeldB* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink < 170.0f) &&
(this->actor.xzDistToLink > 140.0f) && (Rand_ZeroOne() < 0.2f)) {
if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) &&
(this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) {
EnGeldB_SetupSpinAttack(this);
} else if (globalCtx->gameplayFrames & 1) {
EnGeldB_SetupSidestep(this, globalCtx);
@ -1025,7 +1025,7 @@ void EnGeldB_Stunned(EnGeldB* this, GlobalContext* globalCtx) {
}
this->invisible = false;
}
if ((this->actor.dmgEffectTimer == 0) && (this->actor.bgCheckFlags & 1)) {
if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) {
if (this->actor.colChkInfo.health == 0) {
EnGeldB_SetupDefeated(this);
} else {
@ -1043,7 +1043,7 @@ void EnGeldB_SetupDamaged(EnGeldB* this) {
this->invisible = true;
}
this->lookTimer = 0;
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DAMAGE);
this->actionState = GELDB_DAMAGED;
EnGeldB_SetupAction(this, EnGeldB_Damaged);
@ -1061,14 +1061,14 @@ void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) {
}
this->invisible = false;
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x1194, 0);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0);
if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0) &&
SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
angleToWall = this->actor.wallPolyRot - this->actor.shape.rot.y;
if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToLink < 90.0f)) {
angleToWall = this->actor.wallYaw - this->actor.shape.rot.y;
if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 90.0f)) {
EnGeldB_SetupJump(this);
} else if (!EnGeldB_DodgeRanged(globalCtx, this)) {
if ((this->actor.xzDistToLink <= 45.0f) && !func_80033AB8(globalCtx, &this->actor) &&
if ((this->actor.xzDistToPlayer <= 45.0f) && !func_80033AB8(globalCtx, &this->actor) &&
(globalCtx->gameplayFrames & 7)) {
EnGeldB_SetupSlash(this);
} else {
@ -1087,22 +1087,22 @@ void EnGeldB_SetupJump(EnGeldB* this) {
this->actor.speedXZ = 6.5f;
this->actor.velocity.y = 15.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP);
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
EnGeldB_SetupAction(this, EnGeldB_Jump);
}
void EnGeldB_Jump(EnGeldB* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1);
if (this->actor.velocity.y >= 5.0f) {
func_800355B8(globalCtx, &this->rightFootPos);
func_800355B8(globalCtx, &this->leftFootPos);
}
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 3)) {
this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.x = 0;
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.posRot.pos.y = this->actor.groundY;
this->actor.world.pos.y = this->actor.floorHeight;
if (!func_80033AB8(globalCtx, &this->actor)) {
EnGeldB_SetupSlash(this);
} else {
@ -1137,9 +1137,9 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) {
this->skelAnime.playSpeed = 1.0f;
}
if (SkelAnime_Update(&this->skelAnime)) {
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToLink < 40.0f) &&
(ABS(this->actor.yDistToLink) < 50.0f)) {
angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToPlayer < 40.0f) &&
(ABS(this->actor.yDistToPlayer) < 50.0f)) {
if (func_800354B4(globalCtx, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, globalCtx);
@ -1166,7 +1166,7 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) {
EnGeldB_SetupSpinDodge(this, globalCtx);
} else if (!EnGeldB_DodgeRanged(globalCtx, this)) {
if ((globalCtx->gameplayFrames & 1)) {
if ((this->actor.xzDistToLink < 100.0f) && (Rand_ZeroOne() > 0.7f)) {
if ((this->actor.xzDistToPlayer < 100.0f) && (Rand_ZeroOne() > 0.7f)) {
EnGeldB_SetupJump(this);
} else {
EnGeldB_SetupRollBack(this);
@ -1185,7 +1185,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814),
ANIMMODE_LOOP_INTERP, 0.0f);
player = PLAYER;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1);
linkAngle = player->actor.shape.rot.y;
if (Math_SinS(linkAngle - this->actor.shape.rot.y) > 0.0f) {
this->actor.speedXZ = -6.0f;
@ -1196,7 +1196,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) {
}
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
this->approachRate = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF;
this->timer = Rand_ZeroOne() * 10.0f + 5.0f;
this->actionState = GELDB_SIDESTEP;
EnGeldB_SetupAction(this, EnGeldB_Sidestep);
@ -1210,7 +1210,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
s32 prevKeyFrame;
f32 playSpeed;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xBB8, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 1);
behindLinkAngle = player->actor.shape.rot.y + 0x8000;
if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) > 0.0f) {
this->actor.speedXZ += 0.125f;
@ -1226,7 +1226,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
} else {
phi_v1 = this->actor.shape.rot.y - 0x3E80;
}
phi_v1 = this->actor.wallPolyRot - phi_v1;
phi_v1 = this->actor.wallYaw - phi_v1;
} else {
this->actor.speedXZ *= -0.8f;
phi_v1 = 0;
@ -1241,20 +1241,20 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
}
}
if (this->actor.speedXZ >= 0.0f) {
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3E80;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3E80;
} else {
this->actor.posRot.rot.y = this->actor.shape.rot.y - 0x3E80;
this->actor.world.rot.y = this->actor.shape.rot.y - 0x3E80;
}
if (this->actor.xzDistToLink <= 45.0f) {
if (this->actor.xzDistToPlayer <= 45.0f) {
Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f);
} else if (this->actor.xzDistToLink > 40.0f) {
} else if (this->actor.xzDistToPlayer > 40.0f) {
Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f);
} else {
Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f);
}
if (this->approachRate != 0.0f) {
this->actor.posRot.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate;
this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate;
this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
}
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) {
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
@ -1280,11 +1280,11 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
Player* player2 = PLAYER;
s16 angleFacingPlayer2 = player2->actor.shape.rot.y - this->actor.shape.rot.y;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
if ((this->actor.xzDistToLink <= 45.0f) && (!func_80033AB8(globalCtx, &this->actor)) &&
this->actor.world.rot.y = this->actor.shape.rot.y;
if ((this->actor.xzDistToPlayer <= 45.0f) && (!func_80033AB8(globalCtx, &this->actor)) &&
(!(globalCtx->gameplayFrames & 3) || (ABS(angleFacingPlayer2) < 0x38E0))) {
EnGeldB_SetupSlash(this);
} else if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) &&
} else if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) &&
!(globalCtx->gameplayFrames & 1)) {
if (func_80033AB8(globalCtx, &this->actor) || (Rand_ZeroOne() > 0.5f) ||
(ABS(angleFacingPlayer2) < 0x38E0)) {
@ -1310,7 +1310,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
void EnGeldB_SetupDefeated(EnGeldB* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001E10, -4.0f);
this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
if (this->actor.bgCheckFlags & 1) {
this->invisible = false;
this->actor.speedXZ = -6.0f;
@ -1344,7 +1344,7 @@ void func_80A391D8(EnGeldB* this, GlobalContext* globalCtx) {
this->headRot.y = Math_SinS(this->lookTimer * 0x1068) * 8920.0f;
} else if (this->actionState != GELDB_STUNNED) {
if ((this->actionState != GELDB_SLASH) && (this->actionState != GELDB_SPIN_ATTACK)) {
Math_SmoothStepToS(&this->headRot.y, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F4, 0);
Math_SmoothStepToS(&this->headRot.y, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, 0x1F4, 0);
this->headRot.y = CLAMP(this->headRot.y, -0x256F, 0x256F);
} else {
this->headRot.y = 0;
@ -1377,11 +1377,9 @@ void func_80A392D8(EnGeldB* this, GlobalContext* globalCtx) {
func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8);
if (Actor_ApplyDamage(&this->actor) == 0) {
if (this->keyFlag != 0) {
key =
Item_DropCollectible(globalCtx, &this->actor.posRot.pos, this->keyFlag | ITEM00_SMALL_KEY);
key = Item_DropCollectible(globalCtx, &this->actor.world.pos, this->keyFlag | ITEM00_SMALL_KEY);
if (key != NULL) {
key->actor.posRot.rot.y =
Math_Vec3f_Yaw(&key->actor.posRot.pos, &this->actor.initPosRot.pos);
key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos);
key->actor.speedXZ = 6.0f;
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
@ -1404,16 +1402,16 @@ void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80A392D8(this, globalCtx);
if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) {
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D);
this->actionFunc(this, globalCtx);
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.posRot2.pos.y += 40.0f;
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 40.0f;
func_80A391D8(this, globalCtx);
}
Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base);
if ((this->actionState >= GELDB_READY) && (this->spinAttackState < 2) &&
((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) {
((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base);
}
if ((this->actionState == GELDB_BLOCK) && (this->skelAnime.curFrame == 0.0f)) {
@ -1488,7 +1486,7 @@ void EnGeldB_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
EffectBlure_AddVertex(Effect_GetByIndex(this->blureIdx), &swordTip, &swordHilt);
}
} else {
func_8002BDB0(&this->actor, limbIndex, 19, &footOffset, 22, &footOffset);
Actor_SetFeetPos(&this->actor, limbIndex, 19, &footOffset, 22, &footOffset);
}
if (limbIndex == 19) {
Matrix_MultVec3f(&footOffset, &this->rightFootPos);
@ -1560,7 +1558,7 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (this->spinAttackState == 2) {
Animation_Change(&this->skelAnime, &D_06000F5C, 0.5f, 0.0f, 12.0f, ANIMMODE_ONCE_INTERP, 4.0f);
this->spinAttackState++;
thisx->posRot.rot.y = thisx->shape.rot.y = thisx->yawTowardsLink;
thisx->world.rot.y = thisx->shape.rot.y = thisx->yawTowardsPlayer;
} else {
this->timer--;
if (this->timer == 0) {
@ -1596,7 +1594,7 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->iceTimer != 0) {
thisx->dmgEffectTimer++;
thisx->colorFilterTimer++;
this->iceTimer--;
if ((this->iceTimer % 4) == 0) {
s32 iceIndex = this->iceTimer >> 2;
@ -1617,11 +1615,11 @@ s32 EnGeldB_DodgeRanged(GlobalContext* globalCtx, EnGeldB* this) {
s16 pad18;
f32 dist;
angleToFacing = func_8002DA78(&this->actor, actor) - this->actor.shape.rot.y;
this->actor.posRot.rot.y = (u16)this->actor.shape.rot.y & 0xFFFF;
dist = func_8002DB6C(&this->actor, &actor->posRot.pos);
angleToFacing = Actor_WorldYawTowardActor(&this->actor, actor) - this->actor.shape.rot.y;
this->actor.world.rot.y = (u16)this->actor.shape.rot.y & 0xFFFF;
dist = Actor_WorldDistXYZToPoint(&this->actor, &actor->world.pos);
//! @bug
// func_8002DB6C already sqrtfs the distance, so this actually checks for a
// Actor_WorldDistXYZToPoint already sqrtfs the distance, so this actually checks for a
// distance of 360000. Also it's a double calculation because no f on sqrt.
if ((ABS(angleToFacing) < 0x2EE0) && (sqrt(dist) < 600.0)) {
if (actor->id == ACTOR_ARMS_HOOK) {
@ -1630,7 +1628,7 @@ s32 EnGeldB_DodgeRanged(GlobalContext* globalCtx, EnGeldB* this) {
EnGeldB_SetupBlock(this);
}
} else {
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF;
if ((ABS(angleToFacing) < 0x2000) || (ABS(angleToFacing) > 0x5FFF)) {
EnGeldB_SetupSidestep(this, globalCtx);
this->actor.speedXZ *= 3.0f;