1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 23:10:22 +00:00

Actor struct cleanup (#208)

* cleanup a few things

* fix mistake

* yawTowardsLink

* run format

* pr suggestion
This commit is contained in:
fig02 2020-06-14 00:09:51 -04:00 committed by GitHub
parent 06fc61c83d
commit 1c98ac27eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 292 additions and 303 deletions

View file

@ -167,7 +167,7 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (BgBdanObjects_GetContactRu1(this, 0)) {
if (this->dyna.actor.xzDistanceFromLink < 250.0f) {
if (this->dyna.actor.xzDistFromLink < 250.0f) {
BgBdanObjects_SetContactRu1(this, 1);
this->unk_16A = 0x14;
func_800800F8(globalCtx, 0xBFE, -0x63, &this->dyna.actor, 0);
@ -322,7 +322,7 @@ void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) {
void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) {
if (func_8004356C(&this->dyna.actor)) {
if (this->dyna.actor.xzDistanceFromLink < 120.0f) {
if (this->dyna.actor.xzDistFromLink < 120.0f) {
this->actionFunc = func_8086C7D0;
func_800800F8(globalCtx, 0xC12, -0x63, &this->dyna.actor, 0);
}

View file

@ -260,7 +260,7 @@ void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) {
if (this->unk_1C8 <= 0.1f) {
func_8086D730(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->actor.waterSurfaceDist, 0x78, 0x14, 0xA);
func_800AA000(this->actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
}
}
}
@ -322,7 +322,7 @@ void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) {
if (this->unk_1C8 <= 0.6f) {
func_8086D9F8(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->actor.waterSurfaceDist, 0x78, 0x14, 0xA);
func_800AA000(this->actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
}
}
@ -337,7 +337,7 @@ void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) {
if (this->unk_1C8 <= 0.1f) {
func_8086DB24(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->actor.waterSurfaceDist, 0x78, 0x14, 0xA);
func_800AA000(this->actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
}
}
}

View file

@ -140,8 +140,8 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) {
}
sp5C.x += 80.0f + Math_Rand_ZeroOne() * 10.0f;
sp50.x -= 80.0f + Math_Rand_ZeroOne() * 10.0f;
sp5C.y = this->dyna.actor.unk_80 + 20.0f + Math_Rand_ZeroOne();
sp50.y = this->dyna.actor.unk_80 + 20.0f + Math_Rand_ZeroOne();
sp5C.y = this->dyna.actor.groundY + 20.0f + Math_Rand_ZeroOne();
sp50.y = this->dyna.actor.groundY + 20.0f + Math_Rand_ZeroOne();
func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1);
func_80033480(globalCtx, &sp50, 20.0f, 1, sp4C * 135.0f, 60, 1);
@ -155,7 +155,7 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) {
sp5C = this->dyna.actor.posRot.pos;
sp5C.z += 560.0f + Math_Rand_ZeroOne() * 5.0f;
sp5C.x += (Math_Rand_ZeroOne() - 0.5f) * 160.0f;
sp5C.y = Math_Rand_ZeroOne() * 3.0f + (this->dyna.actor.unk_80 + 20.0f);
sp5C.y = Math_Rand_ZeroOne() * 3.0f + (this->dyna.actor.groundY + 20.0f);
func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1);
func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908);

View file

@ -117,8 +117,8 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->velocity.y = 0.5f;
}
thisx->unk_80 = thisx->initPosRot.pos.y - 225.0f;
this->unk_16A = (thisx->unk_80 + 50.0f) - 25.0f;
thisx->groundY = thisx->initPosRot.pos.y - 225.0f;
this->unk_16A = (thisx->groundY + 50.0f) - 25.0f;
this->colliderCylinder.dim.radius = 10;
this->colliderCylinder.dim.height = 40;
@ -335,7 +335,7 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) {
vector.y = (this->dyna.actor.posRot.pos.y + 1.0f) + 25.0f;
vector.z = this->dyna.actor.posRot.pos.z;
tempf20 = this->dyna.actor.unk_80;
tempf20 = this->dyna.actor.groundY;
for (i = 0; i < 3; i++) {
temp =

View file

@ -79,8 +79,8 @@ void func_808933BC(BgJyaAmishutter* this) {
}
void func_808933CC(BgJyaAmishutter* this) {
if (this->actor.xzDistanceFromLink < 60.0f) {
if (fabsf(this->actor.yDistanceFromLink) < 30.0f) {
if (this->actor.xzDistFromLink < 60.0f) {
if (fabsf(this->actor.yDistFromLink) < 30.0f) {
func_80893428(this);
}
}
@ -104,7 +104,7 @@ void func_808934B0(BgJyaAmishutter* this) {
}
void func_808934C0(BgJyaAmishutter* this) {
if (this->actor.xzDistanceFromLink > 300.0f) {
if (this->actor.xzDistFromLink > 300.0f) {
func_808934FC(this);
}
}

View file

@ -85,7 +85,7 @@ void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
u32 openGrotto = false;
if ((this->actor.params & 0x200) == 0) {
// opening with song of storms
if (this->actor.waterSurfaceDist < 40000.0f && Flags_GetEnv(globalCtx, 5)) {
if (this->actor.xyzDistFromLinkSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) {
openGrotto = true;
this->actor.flags &= ~0x10;
}
@ -129,8 +129,8 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
DoorAna_SetupAction(this, DoorAna_GrabLink);
} else {
if (!func_8008E988(globalCtx) && !(player->stateFlags1 & 0x8800000) &&
this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink &&
this->actor.yDistanceFromLink <= 15.0f) {
this->actor.xzDistFromLink <= 15.0f && -50.0f <= this->actor.yDistFromLink &&
this->actor.yDistFromLink <= 15.0f) {
player->stateFlags1 |= 0x80000000;
this->actor.unk_1F = 1;
} else {
@ -145,10 +145,10 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) {
Player* player;
if (this->actor.yDistanceFromLink <= 0.0f && 15.0f < this->actor.xzDistanceFromLink) {
if (this->actor.yDistFromLink <= 0.0f && 15.0f < this->actor.xzDistFromLink) {
player = PLAYER;
player->actor.posRot.pos.x = Math_Sins(this->actor.rotTowardsLinkY) * 15.0f + this->actor.posRot.pos.x;
player->actor.posRot.pos.z = Math_Coss(this->actor.rotTowardsLinkY) * 15.0f + this->actor.posRot.pos.z;
player->actor.posRot.pos.x = Math_Sins(this->actor.yawTowardsLink) * 15.0f + this->actor.posRot.pos.x;
player->actor.posRot.pos.z = Math_Coss(this->actor.yawTowardsLink) * 15.0f + this->actor.posRot.pos.z;
}
}

View file

@ -151,7 +151,7 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
// "...all I can do is look at Death Mountain."
}
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if (func_8002F194(&this->actor, globalCtx) != 0) {
if (this->actor.textId == 0x5056) { // "To get a good view..."
EnAni_SetupAction(this, func_809B04F0);
@ -160,14 +160,14 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
} else {
EnAni_SetupAction(this, func_809B04F0);
}
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistanceFromLink < 150.0f &&
-80.0f < this->actor.yDistanceFromLink) {
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistFromLink < 150.0f &&
-80.0f < this->actor.yDistFromLink) {
if (gSaveContext.itemGetInf[1] & 0x20) {
EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..."
} else {
EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento."
}
} else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistanceFromLink < 350.0f) {
} else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistFromLink < 350.0f) {
EnAni_SetText(this, globalCtx, textId);
}
}
@ -177,7 +177,7 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) {
s16 yawDiff;
u16 textId;
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if (func_8002F194(&this->actor, globalCtx) != 0) {
if (this->actor.textId == 0x5056) { // "To get a good view..."
EnAni_SetupAction(this, func_809B0524);
@ -186,14 +186,14 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) {
} else {
EnAni_SetupAction(this, func_809B0524);
}
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistanceFromLink < 150.0f &&
-80.0f < this->actor.yDistanceFromLink) {
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistFromLink < 150.0f &&
-80.0f < this->actor.yDistFromLink) {
if ((gSaveContext.itemGetInf[1] & 0x20) != 0) {
EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..."
} else {
EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento."
}
} else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistanceFromLink < 350.0f) {
} else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistFromLink < 350.0f) {
if ((gSaveContext.eventChkInf[2] & 0x8000) == 0) {
textId = 0x5052; // "...Something is happening on Death Mountain!"
} else {

View file

@ -53,7 +53,7 @@ void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) {
this->anubis =
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.rotTowardsLinkY, 0, 0);
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, 0);
if (this->anubis != NULL) {
this->actionFunc = EnAnubiceTag_ManageAnubis;
@ -79,12 +79,12 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) {
return;
}
if (this->actor.xzDistanceFromLink < (200.0f + this->triggerRange)) {
if (this->actor.xzDistFromLink < (200.0f + this->triggerRange)) {
if (anubis->unk_260 == 0) {
if (anubis->unk_262 == 0) {
anubis->unk_25E = 1;
offset.x = -Math_Sins(this->actor.rotTowardsLinkY) * this->actor.xzDistanceFromLink;
offset.z = -Math_Coss(this->actor.rotTowardsLinkY) * this->actor.xzDistanceFromLink;
offset.x = -Math_Sins(this->actor.yawTowardsLink) * this->actor.xzDistFromLink;
offset.z = -Math_Coss(this->actor.yawTowardsLink) * this->actor.xzDistFromLink;
Math_SmoothScaleMaxF(&anubis->actor.posRot.pos.x, (this->actor.posRot.pos.x + offset.x), 0.3f, 10.0f);
Math_SmoothScaleMaxF(&anubis->actor.posRot.pos.z, (this->actor.posRot.pos.z + offset.z), 0.3f, 10.0f);
return;

View file

@ -41,7 +41,7 @@ void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx) {
EnArowTrap* this = THIS;
if (this->actor.xzDistanceFromLink <= 400) {
if (this->actor.xzDistFromLink <= 400) {
this->attackTimer--;
if (this->attackTimer == 0) {

View file

@ -163,7 +163,7 @@ void func_809DF494(EnCow* this, GlobalContext* globalCtx) {
SkelAnime_GetFrameCount(&D_060001CC.genericHeader), 2, 1.0f);
}
if ((this->actor.xzDistanceFromLink < 150.0f) && (!(this->unk_276 & 2))) {
if ((this->actor.xzDistFromLink < 150.0f) && (!(this->unk_276 & 2))) {
this->unk_276 |= 2;
if (this->skelAnime.animCurrentSeg == &D_060001CC) {
this->unk_278 = 0;
@ -252,8 +252,8 @@ void func_809DF96C(EnCow* this, GlobalContext* globalCtx) {
this->unk_276 &= ~0x4;
DREG(53) = 0;
} else {
if ((this->actor.xzDistanceFromLink < 150.0f) &&
(ABS((s16)(this->actor.rotTowardsLinkY - this->actor.shape.rot.y)) < 0x61A8)) {
if ((this->actor.xzDistFromLink < 150.0f) &&
(ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x61A8)) {
DREG(53) = 0;
this->actionFunc = func_809DF8FC;
this->actor.flags |= 0x10000;
@ -279,8 +279,8 @@ void func_809DFA84(EnCow* this, GlobalContext* globalCtx) {
SkelAnime_GetFrameCount(&D_06004348.genericHeader), 2, 1.0f);
}
if ((this->actor.xzDistanceFromLink < 150.0f) &&
(ABS((s16)(this->actor.rotTowardsLinkY - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) {
if ((this->actor.xzDistFromLink < 150.0f) &&
(ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) {
this->unk_276 |= 2;
if (this->skelAnime.animCurrentSeg == &D_06004348) {
this->unk_278 = 0;
@ -311,7 +311,7 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
this->actionFunc(this, globalCtx);
if ((thisx->xzDistanceFromLink < 150.0f) &&
if ((thisx->xzDistFromLink < 150.0f) &&
(ABS(Math_Vec3f_Yaw(&thisx->posRot.pos, &player->actor.posRot.pos)) < 0xC000)) {
targetX = Math_Vec3f_Pitch(&thisx->posRot2.pos, &player->actor.posRot2.pos);
targetY = Math_Vec3f_Yaw(&thisx->posRot2.pos, &player->actor.posRot2.pos) - thisx->shape.rot.y;

View file

@ -140,7 +140,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
} else {
playerPos.y += 56.0f;
}
if (this->actor.xzDistanceFromLink <= 100.0f) {
if (this->actor.xzDistFromLink <= 100.0f) {
this->unk_1D0.y = 0;
this->unk_1D0.z = this->unk_1D0.y;
this->unk_1D6.x = this->unk_1D0.y;

View file

@ -351,16 +351,16 @@ void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) {
return;
}
if (this->actor.xzDistanceFromLink > 400.0f) {
if (this->actor.xzDistFromLink > 400.0f) {
if (this->nextBehavior != DOG_SIT && this->nextBehavior != DOG_SIT_2) {
this->nextBehavior = DOG_BOW;
}
gSaveContext.dogParams = 0;
speed = 0.0f;
} else if (this->actor.xzDistanceFromLink > 100.0f) {
} else if (this->actor.xzDistFromLink > 100.0f) {
this->nextBehavior = DOG_RUN;
speed = 4.0f;
} else if (this->actor.xzDistanceFromLink < 40.0f) {
} else if (this->actor.xzDistFromLink < 40.0f) {
if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) {
this->nextBehavior = DOG_BOW;
}
@ -372,16 +372,16 @@ void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) {
Math_SmoothScaleMaxF(&this->actor.speedXZ, speed, 0.6f, 1.0f);
if (!(this->actor.xzDistanceFromLink > 400.0f)) {
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY, 10, 1000, 1);
if (!(this->actor.xzDistFromLink > 400.0f)) {
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 10, 1000, 1);
this->actor.shape.rot = this->actor.posRot.rot;
}
}
void EnDog_RunAway(EnDog* this, GlobalContext* globalCtx) {
if (this->actor.xzDistanceFromLink < 200.0f) {
if (this->actor.xzDistFromLink < 200.0f) {
Math_SmoothScaleMaxF(&this->actor.speedXZ, 4.0f, 0.6f, 1.0f);
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, (this->actor.rotTowardsLinkY ^ 0x8000), 10, 1000, 1);
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, (this->actor.yawTowardsLink ^ 0x8000), 10, 1000, 1);
} else {
this->actionFunc = EnDog_FaceLink;
}
@ -394,12 +394,12 @@ void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) {
f32 absAngleDiff;
// if the dog is more than 200 units away from Link, turn to face him then wait
if (200.0f <= this->actor.xzDistanceFromLink) {
if (200.0f <= this->actor.xzDistFromLink) {
this->nextBehavior = DOG_WALK;
Math_SmoothScaleMaxF(&this->actor.speedXZ, 1.0f, 0.6f, 1.0f);
rotTowardLink = this->actor.rotTowardsLinkY;
rotTowardLink = this->actor.yawTowardsLink;
prevRotY = this->actor.posRot.rot.y;
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, rotTowardLink, 10, 1000, 1);
@ -419,10 +419,10 @@ void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) {
}
void EnDog_Wait(EnDog* this, GlobalContext* globalCtx) {
this->unusedAngle = (this->actor.rotTowardsLinkY - this->actor.shape.rot.y);
this->unusedAngle = (this->actor.yawTowardsLink - this->actor.shape.rot.y);
// If another dog is following Link and he gets within 200 units of waiting dog, run away
if ((gSaveContext.dogParams != 0) && (this->actor.xzDistanceFromLink < 200.0f)) {
if ((gSaveContext.dogParams != 0) && (this->actor.xzDistFromLink < 200.0f)) {
this->nextBehavior = DOG_RUN;
this->actionFunc = EnDog_RunAway;
}

View file

@ -225,10 +225,10 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
this->actionFunc = EnDs_Talk;
}
} else {
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
this->actor.textId = 0x5048;
if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistanceFromLink < 200.0f)) {
if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistFromLink < 200.0f)) {
func_8002F298(this, globalCtx, 100.0f, 8);
this->unk_1E8 |= 1;
}

View file

@ -347,10 +347,10 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) {
this->actor.velocity.y = 0.0f;
EnFloormas_MakeInvulnerable(this);
if (LINK_IS_CHILD) {
yDelta = CLAMP(-this->actor.yDistanceFromLink, 20.0f, 30.0f);
yDelta = CLAMP(-this->actor.yDistFromLink, 20.0f, 30.0f);
xzDelta = -10.0f;
} else {
yDelta = CLAMP(-this->actor.yDistanceFromLink, 25.0f, 45.0f);
yDelta = CLAMP(-this->actor.yDistFromLink, 25.0f, 45.0f);
xzDelta = -70.0f;
}
this->actor.posRot.pos.y = player->actor.posRot.pos.y + yDelta;
@ -424,7 +424,7 @@ void EnFloormas_SetupFreeze(EnFloormas* this) {
void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) {
if (this->actor.scale.x > 0.004f) {
// split
this->actor.shape.rot.y = this->actor.rotTowardsLinkY + 0x8000;
this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000;
EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedB);
EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedA);
EnFloormas_SetupSplit(this);
@ -439,11 +439,11 @@ void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
// within 400 units of link and within 90 degrees rotation of him
if (this->actor.xzDistanceFromLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) {
this->actionTarget = this->actor.rotTowardsLinkY;
if (this->actor.xzDistFromLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) {
this->actionTarget = this->actor.yawTowardsLink;
EnFloormas_SetupTurn(this);
// within 280 units of link and within 45 degrees rotation of him
} else if (this->actor.xzDistanceFromLink < 280.0f && func_8002E084(&this->actor, 0x2000)) {
} else if (this->actor.xzDistFromLink < 280.0f && func_8002E084(&this->actor, 0x2000)) {
EnFloormas_SetupHover(this, globalCtx);
} else {
EnFloormas_SetupStand(this);
@ -478,15 +478,15 @@ void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK);
}
if ((this->actor.xzDistanceFromLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) {
if ((this->actor.xzDistFromLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) {
EnFloormas_SetupRun(this);
} else if (this->actor.bgCheckFlags & 8) {
// set target rotation to the colliding wall's rotation
this->actionTarget = this->actor.wallPolyRot;
EnFloormas_SetupTurn(this);
} else if ((this->actor.xzDistanceFromLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) {
} else if ((this->actor.xzDistFromLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) {
// set target rotation to link.
this->actionTarget = this->actor.rotTowardsLinkY;
this->actionTarget = this->actor.yawTowardsLink;
EnFloormas_SetupTurn(this);
} else if (this->actionTimer == 0) {
EnFloormas_SetupBigStopWalk(this);
@ -507,12 +507,12 @@ void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK);
}
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 3, 0x71C);
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C);
if ((this->actor.xzDistanceFromLink < 280.0f) && func_8002E084(&this->actor, 0x2000) &&
if ((this->actor.xzDistFromLink < 280.0f) && func_8002E084(&this->actor, 0x2000) &&
!(this->actor.bgCheckFlags & 8)) {
EnFloormas_SetupHover(this, globalCtx);
} else if (this->actor.xzDistanceFromLink > 400.0f) {
} else if (this->actor.xzDistFromLink > 400.0f) {
EnFloormas_SetupBigWalk(this);
}
}
@ -553,7 +553,7 @@ void EnFloormas_Hover(EnFloormas* this, GlobalContext* globalCtx) {
}
this->actor.shape.rot.x += 0x140;
this->actor.posRot.pos.y += 10.0f;
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 3, 2730);
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 2730);
Math_ApproxS(&this->zOffset, 1200, 100);
}
@ -563,7 +563,7 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) {
pos.x = this->actor.posRot.pos.x;
pos.z = this->actor.posRot.pos.z;
pos.y = this->actor.unk_80;
pos.y = this->actor.groundY;
pos2.y = 2.0f;
pos2.x = Math_Sins(this->actor.shape.rot.y + 0x6000) * 7.0f;
@ -591,9 +591,9 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) {
Math_ApproxF(&this->actor.speedXZ, 15.0f, SQ(this->actor.speedXZ) * (1.0f / 3.0f));
Math_ApproxUpdateScaledS(&this->actor.shape.rot.x, -0x1680, 0x140);
distFromGround = this->actor.posRot.pos.y - this->actor.unk_80;
distFromGround = this->actor.posRot.pos.y - this->actor.groundY;
if (distFromGround < 10.0f) {
this->actor.posRot.pos.y = this->actor.unk_80 + 10.0f;
this->actor.posRot.pos.y = this->actor.groundY + 10.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
}
@ -632,7 +632,7 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) {
Math_ApproxF(&this->actor.speedXZ, 0.0f, 2.0f);
}
if ((this->actor.speedXZ > 0.0f) && ((this->actor.posRot.pos.y - this->actor.unk_80) < 12.0f)) {
if ((this->actor.speedXZ > 0.0f) && ((this->actor.posRot.pos.y - this->actor.groundY) < 12.0f)) {
EnFloormas_Slide(this, globalCtx);
}
@ -685,8 +685,8 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) {
} else if (this->actor.bgCheckFlags & 8) {
this->actionTarget = this->actor.wallPolyRot;
EnFloormas_SetupTurn(this);
} else if (this->actor.xzDistanceFromLink < 120.0f) {
Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0x38E);
} else if (this->actor.xzDistFromLink < 120.0f) {
Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, this->actor.yawTowardsLink + 0x8000, 0x38E);
}
}
@ -720,8 +720,8 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
EnFloormas_SetupSlaveJumpAtMaster(this);
}
} else {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 3, 0x71C);
if (this->actor.xzDistanceFromLink < 80.0f) {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C);
if (this->actor.xzDistFromLink < 80.0f) {
EnFloormas_SetupJumpAtLink(this);
}
}
@ -740,7 +740,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (this->skelAnime.animCurrentFrame < 20.0f) {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 2, 0xE38);
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38);
} else if (func_800A56C8(&this->skelAnime, 20.0f)) {
this->actor.speedXZ = 5.0f;
this->actor.velocity.y = 7.0f;
@ -749,7 +749,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
EnFloormas_SetupLand(this);
} else if ((this->actor.yDistanceFromLink < -10.0f) && this->collider.base.maskA & 2 &&
} else if ((this->actor.yDistFromLink < -10.0f) && this->collider.base.maskA & 2 &&
(&player->actor == this->collider.base.oc)) {
globalCtx->unk_11D4C(globalCtx, player);
EnFloormas_SetupGrabLink(this, player);
@ -776,10 +776,10 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) {
}
if (LINK_IS_CHILD) {
yDelta = CLAMP(-this->actor.yDistanceFromLink, 20.0f, 30.0f);
yDelta = CLAMP(-this->actor.yDistFromLink, 20.0f, 30.0f);
xzDelta = -10.0f;
} else {
yDelta = CLAMP(-this->actor.yDistanceFromLink, 25.0f, 45.0f);
yDelta = CLAMP(-this->actor.yDistFromLink, 25.0f, 45.0f);
xzDelta = -30.0f;
}

View file

@ -110,9 +110,9 @@ s32 func_80A1D94C(EnFu* this, GlobalContext* globalCtx, u16 textID, EnFuActionFu
return true;
}
this->actor.textId = textID;
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if ((ABS(yawDiff) < 0x2301) && (this->actor.xzDistanceFromLink < 100.0f)) {
if ((ABS(yawDiff) < 0x2301) && (this->actor.xzDistFromLink < 100.0f)) {
func_8002F2CC(&this->actor, globalCtx, 100.0f);
} else {
this->behaviorFlags |= FU_RESET_LOOK_ANGLE;
@ -217,7 +217,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) {
static s16 yawDiff;
Player* player = PLAYER;
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if ((gSaveContext.eventChkInf[5] & 0x800)) {
func_80A1D94C(this, globalCtx, 0x508E, func_80A1DBA0);
} else if (player->stateFlags2 & 0x1000000) {
@ -228,7 +228,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) {
} else if (func_8002F194(&this->actor, globalCtx) != 0) {
this->actionFunc = func_80A1DBA0;
} else if (ABS(yawDiff) < 0x2301) {
if (this->actor.xzDistanceFromLink < 100.0f) {
if (this->actor.xzDistFromLink < 100.0f) {
this->actor.textId = 0x5034;
func_8002F2CC(&this->actor, globalCtx, 100.0f);
player->stateFlags2 |= 0x800000;

View file

@ -132,7 +132,7 @@ void func_80A5046C(EnGuest* this) {
void func_80A50518(EnGuest* this, GlobalContext* globalCtx) {
if (func_8002F194(&this->actor, globalCtx) != 0) {
this->actionFunc = func_80A5057C;
} else if (this->actor.xzDistanceFromLink < 100.0f) {
} else if (this->actor.xzDistFromLink < 100.0f) {
func_8002F2CC(&this->actor, globalCtx, 100.0f);
}
}

View file

@ -405,9 +405,9 @@ void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) {
player->actor.textId = 0x200F; // "I don't want that!"
}
} else {
yawDiffTemp = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiffTemp = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiff = ABS(yawDiffTemp);
if (!(120.0f < this->actor.xzDistanceFromLink) && (yawDiff < 0x4300)) {
if (!(120.0f < this->actor.xzDistFromLink) && (yawDiff < 0x4300)) {
func_8002F298(&this->actor, globalCtx, 100.0f, 1);
}
}
@ -653,7 +653,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) {
pos.x = Math_Rand_CenteredFloat(20.0f) + this->unk_274.x;
pos.y = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f);
pos.z = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f);
rotY = Math_Rand_CenteredFloat(7000.0f) + thisx->rotTowardsLinkY;
rotY = Math_Rand_CenteredFloat(7000.0f) + thisx->yawTowardsLink;
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0);
if (bomb != NULL) {
bomb->actor.speedXZ = Math_Rand_CenteredFloat(5.0f) + 10.0f;
@ -733,8 +733,8 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
}
if (((this->initParams != 2) && (this->initParams != 5)) ||
((yawDiff = ABS((s16)(this->actor.rotTowardsLinkY - this->actor.shape.rot.y)),
!(this->actor.xzDistanceFromLink > 120.0f)) &&
((yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)),
!(this->actor.xzDistFromLink > 120.0f)) &&
(yawDiff < 0x4300))) {
func_8002F2F4(&this->actor, globalCtx);
}

View file

@ -102,7 +102,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx)
player = PLAYER;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiffNew = ABS(yawDiff);
if (yawDiffNew < 0x4300) {
if (gSaveContext.nightFlag == 0) {
@ -117,7 +117,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx)
sightRange = 100.0f;
}
}
if ((this->actor.xzDistanceFromLink < sightRange) &&
if ((this->actor.xzDistFromLink < sightRange) &&
(fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) && (sPlayerCaught == 0)) {
sPlayerCaught = 1;
func_8010B680(globalCtx, 0x702D, &this->actor); // "Hey you! Stop! You, kid, over there!"
@ -174,7 +174,7 @@ void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) {
this->actionFunc = EnHeishi3_ResetAnimationToIdle;
this->actor.speedXZ = 0.0f;
} else {
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY, 5, 3000, 0);
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 5, 3000, 0);
}
}

View file

@ -209,7 +209,7 @@ void EnHintnuts_SetupFreeze(EnHintnuts* this) {
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060029BC);
this->actor.flags &= ~1;
func_8003426C(&this->actor, 0, 0xFF, 0, 100);
this->actor.unk_114 = 1;
this->actor.dmgEffectTimer = 1;
this->animFlagAndTimer = 0;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT);
if (sPuzzleCounter == -3) {
@ -247,20 +247,19 @@ void EnHintnuts_Wait(EnHintnuts* this, GlobalContext* globalCtx) {
boundedCurrentFrame = boundedCurrentFrameTemp;
}
this->collider.dim.height = (((boundedCurrentFrame - 9.0f) * 9.0f) + 5.0f);
if (!hasSlowPlaybackSpeed && (this->actor.xzDistanceFromLink < 120.0f)) {
if (!hasSlowPlaybackSpeed && (this->actor.xzDistFromLink < 120.0f)) {
EnHintnuts_SetupBurrow(this);
} else if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (this->actor.xzDistanceFromLink < 120.0f) {
if (this->actor.xzDistFromLink < 120.0f) {
EnHintnuts_SetupBurrow(this);
} else if ((this->animFlagAndTimer == 0) && (320.0f < this->actor.xzDistanceFromLink)) {
} else if ((this->animFlagAndTimer == 0) && (320.0f < this->actor.xzDistFromLink)) {
EnHintnuts_SetupLookAround(this);
} else {
EnHintnuts_SetupStand(this);
}
}
if (hasSlowPlaybackSpeed && 160.0f < this->actor.xzDistanceFromLink &&
fabsf(this->actor.yDistanceFromLink) < 120.0f &&
((this->animFlagAndTimer == 0) || (this->actor.xzDistanceFromLink < 480.0f))) {
if (hasSlowPlaybackSpeed && 160.0f < this->actor.xzDistFromLink && fabsf(this->actor.yDistFromLink) < 120.0f &&
((this->animFlagAndTimer == 0) || (this->actor.xzDistFromLink < 480.0f))) {
this->skelAnime.animPlaybackSpeed = 1.0f;
}
}
@ -270,7 +269,7 @@ void EnHintnuts_LookAround(EnHintnuts* this, GlobalContext* globalCtx) {
if (func_800A56C8(&this->skelAnime, 0.0f) != 0 && this->animFlagAndTimer != 0) {
this->animFlagAndTimer--;
}
if ((this->actor.xzDistanceFromLink < 120.0f) || (this->animFlagAndTimer == 0)) {
if ((this->actor.xzDistFromLink < 120.0f) || (this->animFlagAndTimer == 0)) {
EnHintnuts_SetupBurrow(this);
}
}
@ -281,9 +280,9 @@ void EnHintnuts_Stand(EnHintnuts* this, GlobalContext* globalCtx) {
this->animFlagAndTimer--;
}
if (!(this->animFlagAndTimer & 0x1000)) {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 2, 0xE38);
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38);
}
if (this->actor.xzDistanceFromLink < 120.0f || this->animFlagAndTimer == 0x1000) {
if (this->actor.xzDistFromLink < 120.0f || this->animFlagAndTimer == 0x1000) {
EnHintnuts_SetupBurrow(this);
} else if (this->animFlagAndTimer == 0) {
EnHintnuts_SetupThrowScrubProjectile(this);
@ -293,8 +292,8 @@ void EnHintnuts_Stand(EnHintnuts* this, GlobalContext* globalCtx) {
void EnHintnuts_ThrowNut(EnHintnuts* this, GlobalContext* globalCtx) {
Vec3f nutPos;
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 2, 0xE38);
if (this->actor.xzDistanceFromLink < 120.0f) {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38);
if (this->actor.xzDistFromLink < 120.0f) {
EnHintnuts_SetupBurrow(this);
} else if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnHintnuts_SetupStand(this);
@ -330,10 +329,10 @@ void EnHintnuts_Burrow(EnHintnuts* this, GlobalContext* globalCtx) {
void EnHintnuts_BeginRun(EnHintnuts* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
this->unk_196 = this->actor.rotTowardsLinkY + 0x8000;
this->unk_196 = this->actor.yawTowardsLink + 0x8000;
EnHintnuts_SetupRun(this);
}
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 2, 0xE38);
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38);
}
void EnHintnuts_BeginFreeze(EnHintnuts* this, GlobalContext* globalCtx) {
@ -349,7 +348,7 @@ void EnHintnuts_CheckProximity(EnHintnuts* this, GlobalContext* globalCtx) {
} else {
this->actor.flags &= ~0x10000;
}
if (this->actor.xzDistanceFromLink < 130.0f) {
if (this->actor.xzDistFromLink < 130.0f) {
this->actor.textId = this->textIdCopy;
func_8002F2F4(&this->actor, globalCtx);
}
@ -379,15 +378,15 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) {
this->unk_196 = this->actor.wallPolyRot;
} else if (this->animFlagAndTimer == 0) {
diffRotInit = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos);
diffRot = diffRotInit - this->actor.rotTowardsLinkY;
diffRot = diffRotInit - this->actor.yawTowardsLink;
if (ABS(diffRot) >= 0x2001) {
this->unk_196 = diffRotInit;
} else {
phi_f0 = (0.0f <= (f32)diffRot) ? 1.0f : -1.0f;
this->unk_196 = (s16)((phi_f0 * -8192.0f) + (f32)this->actor.rotTowardsLinkY);
this->unk_196 = (s16)((phi_f0 * -8192.0f) + (f32)this->actor.yawTowardsLink);
}
} else {
this->unk_196 = (s16)(this->actor.rotTowardsLinkY + 0x8000);
this->unk_196 = (s16)(this->actor.yawTowardsLink + 0x8000);
}
}
@ -410,7 +409,7 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) {
void EnHintnuts_Talk(EnHintnuts* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 0x3, 0x400, 0x100);
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x3, 0x400, 0x100);
if (func_8010BDBC(&globalCtx->msgCtx) == 5) {
EnHintnuts_SetupLeave(this, globalCtx);
}
@ -429,7 +428,7 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 8) {
temp_a1 = this->actor.wallPolyRot;
} else {
temp_a1 = this->actor.rotTowardsLinkY - func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) - 0x8000;
temp_a1 = this->actor.yawTowardsLink - func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) - 0x8000;
if (ABS(temp_a1) >= 0x4001) {
temp_a1 = func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000;
} else {
@ -452,7 +451,7 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) {
}
void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) {
this->actor.unk_114 = 1;
this->actor.dmgEffectTimer = 1;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (func_800A56C8(&this->skelAnime, 0.0f) != 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT);
@ -473,7 +472,7 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) {
this->actor.flags |= 1;
this->actor.flags &= ~0x10;
this->actor.colChkInfo.health = sColChkInfoInit.health;
this->actor.unk_114 = 0;
this->actor.dmgEffectTimer = 0;
EnHintnuts_SetupWait(this);
}
}

View file

@ -176,7 +176,7 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal
Player* player = PLAYER;
s16 sp32;
s16 sp30;
f32 xzDistanceFromLink;
f32 xzDistFromLink;
f32 yaw;
if (func_8002F194(&this->actor, globalCtx) != 0) {
@ -191,7 +191,7 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal
yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &player->actor.posRot.pos);
yaw -= this->actor.shape.rot.y;
if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistanceFromLink < 265.0f)) {
if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistFromLink < 265.0f)) {
this->actor.flags &= ~1;
return 0;
}
@ -203,13 +203,13 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal
return 0;
}
xzDistanceFromLink = this->actor.xzDistanceFromLink;
this->actor.xzDistanceFromLink = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos);
xzDistFromLink = this->actor.xzDistFromLink;
this->actor.xzDistFromLink = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos);
if (func_8002F2CC(&this->actor, globalCtx, unkf) == 0) {
this->actor.xzDistanceFromLink = xzDistanceFromLink;
this->actor.xzDistFromLink = xzDistFromLink;
return 0;
}
this->actor.xzDistanceFromLink = xzDistanceFromLink;
this->actor.xzDistFromLink = xzDistFromLink;
this->actor.textId = callback1(globalCtx, this);
return 0;
@ -415,8 +415,8 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) {
this->actionFunc = EnKz_StartTimer;
} else {
getItemID = this->isTrading == true ? GI_FROG : GI_TUNIC_ZORA;
yRange = fabsf(this->actor.yDistanceFromLink) + 1.0f;
xzRange = this->actor.xzDistanceFromLink + 1.0f;
yRange = fabsf(this->actor.yDistFromLink) + 1.0f;
xzRange = this->actor.xzDistFromLink + 1.0f;
func_8002F434(&this->actor, globalCtx, getItemID, xzRange, yRange);
}
}

View file

@ -342,7 +342,7 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
this->unk_1E8.unk_00 = 1;
this->actor.flags |= 0x10000;
this->actionFunc = func_80AA106C;
} else if (this->actor.xzDistanceFromLink < 30.0f + (f32)this->collider.dim.radius) {
} else if (this->actor.xzDistFromLink < 30.0f + (f32)this->collider.dim.radius) {
player->stateFlags2 |= 0x800000;
}
}

View file

@ -267,7 +267,7 @@ void func_80AA204C(EnMa2* this, GlobalContext* globalCtx) {
player->stateFlags2 |= 0x2000000;
func_8010BD58(globalCtx, 0x23);
this->actionFunc = func_80AA20E4;
} else if (this->actor.xzDistanceFromLink < 30.0f + (f32)this->collider.dim.radius) {
} else if (this->actor.xzDistFromLink < 30.0f + (f32)this->collider.dim.radius) {
player->stateFlags2 |= 0x800000;
}
}

View file

@ -101,14 +101,14 @@ void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) {
s16 yawDiff;
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
EnMs_SetOfferText(&this->actor, globalCtx);
if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated
this->actionFunc = EnMs_Talk;
return;
}
if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range
if ((this->actor.xzDistFromLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range
func_8002F2CC(&this->actor, globalCtx, 90.0f);
}
}

View file

@ -172,7 +172,7 @@ void func_80AEAC54(EnRu1* this, GlobalContext* globalCtx) {
Collider_CylinderUpdate(thisx, collider2);
if (this->unk_34C != 0) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider2);
} else if (thisx->xzDistanceFromLink > 32.0f) {
} else if (thisx->xzDistFromLink > 32.0f) {
this->unk_34C = 1;
}
}
@ -444,7 +444,7 @@ void func_80AEB4A8(EnRu1* this, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
Actor* thisx = &this->actor;
sp24.x = thisx->posRot.pos.x;
sp24.y = thisx->posRot.pos.y + thisx->unk_84;
sp24.y = thisx->posRot.pos.y + thisx->waterY;
sp24.z = thisx->posRot.pos.z;
func_80029444(globalCtx, &sp24, 100, arg2, arg3);
}
@ -471,7 +471,7 @@ void func_80AEB680(EnRu1* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor;
pos.x = thisx->posRot.pos.x;
pos.y = thisx->posRot.pos.y + thisx->unk_84;
pos.y = thisx->posRot.pos.y + thisx->waterY;
pos.z = thisx->posRot.pos.z;
func_8002949C(globalCtx, &pos, 0, 0, 1, 0);
@ -1017,19 +1017,19 @@ void func_80AECC84(EnRu1* this, GlobalContext* globalCtx) {
void func_80AECCB0(EnRu1* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor;
Vec3f* pos;
s16 rotTowardsLinkY;
s16 yawTowardsLink;
f32 spawnX;
f32 spawnY;
f32 spawnZ;
s32 pad[2];
rotTowardsLinkY = thisx->rotTowardsLinkY;
yawTowardsLink = thisx->yawTowardsLink;
pos = &thisx->posRot.pos;
spawnX = ((kREG(1) + 12.0f) * Math_Sins(rotTowardsLinkY)) + pos->x;
spawnX = ((kREG(1) + 12.0f) * Math_Sins(yawTowardsLink)) + pos->x;
spawnY = pos->y;
spawnZ = ((kREG(1) + 12.0f) * Math_Coss(rotTowardsLinkY)) + pos->z;
spawnZ = ((kREG(1) + 12.0f) * Math_Coss(yawTowardsLink)) + pos->z;
this->unk_278 = Actor_SpawnAttached(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, spawnY, spawnZ,
0, rotTowardsLinkY, 0, 5);
0, yawTowardsLink, 0, 5);
}
void func_80AECDA0(EnRu1* this, GlobalContext* globalCtx) {
@ -1118,8 +1118,8 @@ void func_80AED0C8(EnRu1* this, GlobalContext* globalCtx) {
void func_80AED0D8(EnRu1* this, GlobalContext* globalCtx) {
this->action = 17;
this->drawConfig = 1;
this->actor.posRot.rot.y = this->actor.rotTowardsLinkY;
this->actor.shape.rot.y = this->actor.rotTowardsLinkY;
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.y = this->actor.yawTowardsLink;
func_80AECCB0(this, globalCtx);
}
@ -1159,7 +1159,7 @@ void func_80AED218(EnRu1* this, UNK_TYPE arg1) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002990, 1.0f, 0, SkelAnime_GetFrameCount(&D_06002990.genericHeader),
2, -8.0f);
this->action = 21;
this->unk_27C = this->actor.xzDistanceFromLink;
this->unk_27C = this->actor.xzDistFromLink;
}
}
@ -1257,7 +1257,7 @@ s32 func_80AED624(EnRu1* this, GlobalContext* globalCtx) {
Actor_Kill(thisx);
return 0;
} else if (((this->roomNum1 != curRoomNum) || (this->roomNum2 != curRoomNum)) &&
(thisx->unk_84 > kREG(16) + 50.0f) && (this->action != 33)) {
(thisx->waterY > kREG(16) + 50.0f) && (this->action != 33)) {
this->action = 33;
this->drawConfig = 2;
this->unk_2A8 = 0xFF;
@ -1486,7 +1486,7 @@ void func_80AEE050(EnRu1* this) {
this->unk_350 = 1;
func_80AEE02C(this);
this->unk_35C = 0;
this->unk_358 = (this->actor.unk_84 - 10.0f) * 0.5f;
this->unk_358 = (this->actor.waterY - 10.0f) * 0.5f;
this->unk_354 = this->actor.posRot.pos.y + thisx->unk_358; // thisx only used here
} else {
this->actor.gravity = 0.0f;
@ -1615,7 +1615,7 @@ void func_80AEE568(EnRu1* this, GlobalContext* globalCtx) {
func_8002F580(this, globalCtx);
this->action = 27;
func_80AEADD8(this);
} else if (thisx->unk_84 > 0.0f) {
} else if (thisx->waterY > 0.0f) {
this->action = 29;
this->unk_350 = 0;
}

View file

@ -107,7 +107,7 @@ void EnSb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnSb_SpawnBubbles(GlobalContext* globalCtx, EnSb* this) {
s32 i;
if (this->actor.unk_84 > 0) {
if (this->actor.waterY > 0) {
for (i = 0; i < 10; i++) {
func_800293E4(globalCtx, &this->actor.posRot.pos, 10.0f, 10.0f, 30.0f, 0.25f);
}
@ -138,7 +138,7 @@ void EnSb_SetupWaitOpen(EnSb* this) {
void EnSb_SetupLunge(EnSb* this) {
f32 frames = SkelAnime_GetFrameCount(&D_06000124.genericHeader);
f32 playbackSpeed = this->actor.unk_84 > 0.0f ? 1.0f : 0.0f;
f32 playbackSpeed = this->actor.waterY > 0.0f ? 1.0f : 0.0f;
SkelAnime_ChangeAnim(&this->skelAnime, &D_06000124, playbackSpeed, 0.0f, frames, 2, 0);
this->behavior = SHELLBLADE_LUNGE;
@ -161,7 +161,7 @@ void EnSb_SetupCooldown(EnSb* this, s32 changeSpeed) {
}
this->behavior = SHELLBLADE_WAIT_CLOSED;
if (changeSpeed) {
if (this->actor.unk_84 > 0.0f) {
if (this->actor.waterY > 0.0f) {
this->actor.speedXZ = -5.0f;
if (this->actor.velocity.y < 0.0f) {
this->actor.velocity.y = 2.1f;
@ -179,9 +179,9 @@ void EnSb_SetupCooldown(EnSb* this, s32 changeSpeed) {
void EnSb_WaitClosed(EnSb* this, GlobalContext* globalCtx) {
// always face toward link
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 0xA, 0x7D0, 0x0);
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0);
if ((this->actor.xzDistanceFromLink <= 160.0f) && (this->actor.xzDistanceFromLink > 40.0f)) {
if ((this->actor.xzDistFromLink <= 160.0f) && (this->actor.xzDistFromLink > 40.0f)) {
EnSb_SetupOpen(this);
}
}
@ -193,8 +193,8 @@ void EnSb_Open(EnSb* this, GlobalContext* globalCtx) {
this->timer = 15;
EnSb_SetupWaitOpen(this);
} else {
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 0xA, 0x7D0, 0x0);
if ((this->actor.xzDistanceFromLink > 160.0f) || (this->actor.xzDistanceFromLink <= 40.0f)) {
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0);
if ((this->actor.xzDistFromLink > 160.0f) || (this->actor.xzDistFromLink <= 40.0f)) {
EnSb_SetupWaitClosed(this);
}
}
@ -203,9 +203,9 @@ void EnSb_Open(EnSb* this, GlobalContext* globalCtx) {
void EnSb_WaitOpen(EnSb* this, GlobalContext* globalCtx) {
s16 timer = this->timer;
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 0xA, 0x7D0, 0x0);
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0);
if ((this->actor.xzDistanceFromLink > 160.0f) || (this->actor.xzDistanceFromLink <= 40.0f)) {
if ((this->actor.xzDistFromLink > 160.0f) || (this->actor.xzDistFromLink <= 40.0f)) {
EnSb_SetupWaitClosed(this);
}
@ -213,7 +213,7 @@ void EnSb_WaitOpen(EnSb* this, GlobalContext* globalCtx) {
this->timer = timer - 1;
} else {
this->timer = 0;
this->attackYaw = this->actor.rotTowardsLinkY;
this->attackYaw = this->actor.yawTowardsLink;
this->actionFunc = EnSb_TurnAround;
}
}
@ -226,7 +226,7 @@ void EnSb_TurnAround(EnSb* this, GlobalContext* globalCtx) {
if (this->actor.shape.rot.y == invertedYaw) {
this->actor.posRot.rot.y = this->attackYaw;
if (this->actor.unk_84 > 0.0f) {
if (this->actor.waterY > 0.0f) {
this->actor.velocity.y = 3.0f;
this->actor.speedXZ = 5.0f;
this->actor.gravity = -0.35f;
@ -246,7 +246,7 @@ void EnSb_TurnAround(EnSb* this, GlobalContext* globalCtx) {
void EnSb_Lunge(EnSb* this, GlobalContext* globalCtx) {
Math_ApproxF(&this->actor.speedXZ, 0.0f, 0.2f);
if ((this->actor.velocity.y <= -0.1f) || ((this->actor.bgCheckFlags & 2))) {
if (!(this->actor.unk_84 > 0.0f)) {
if (!(this->actor.waterY > 0.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
}
this->actor.bgCheckFlags = this->actor.bgCheckFlags & ~2;
@ -267,7 +267,7 @@ void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) {
if (this->bouncesLeft != 0) {
this->bouncesLeft--;
this->timer = 1;
if (this->actor.unk_84 > 0.0f) {
if (this->actor.waterY > 0.0f) {
this->actor.velocity.y = 3.0f;
this->actor.speedXZ = 5.0f;
this->actor.gravity = -0.35f;
@ -361,7 +361,7 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) {
case 15: // explosions, arrow, hammer, ice arrow, light arrow, spirit arrow, shadow arrow
if (EnSb_IsVulnerable(this)) {
hitY = this->collider.body.bumper.unk_06.y - this->actor.posRot.pos.y;
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) {
Actor_ApplyDamage(&this->actor);
func_8003426C(&this->actor, 0x4000, 0xFF, 0x2000, 0x50);
@ -379,7 +379,7 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) {
case 13: // all sword damage
if (EnSb_IsVulnerable(this)) {
hitY = this->collider.body.bumper.unk_06.y - this->actor.posRot.pos.y;
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) {
Actor_ApplyDamage(&this->actor);
func_8003426C(&this->actor, 0x4000, 0xFF, 0x2000, 0x50);
@ -417,7 +417,7 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
if (this->isDead) {
if (this->actor.unk_84 > 0.0f) {
if (this->actor.waterY > 0.0f) {
this->actor.params = 4;
} else {
this->actor.params = 1;
@ -461,7 +461,7 @@ void EnSb_Draw(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL,
EnSb_PostLimbDraw, &this->actor);
if (this->fire != 0) {
this->actor.unk_114++;
this->actor.dmgEffectTimer++;
fireDecr = this->fire - 1;
// this is intended to draw flames after being burned, but the condition is never met to run this code
// fire gets set to 4 when burned, decrements to 3 and fails the "& 1" check and never stores the decrement

View file

@ -8,7 +8,6 @@ void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx);
void EnSkj_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnSkj_Update(Actor* thisx, GlobalContext* globalCtx);
void EnSkj_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
const ActorInit En_Skj_InitVars = {
ACTOR_EN_SKJ,

View file

@ -229,7 +229,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) {
s16 v0;
s16 v1;
if (this->actor.waterSurfaceDist > 10000.f) {
if (this->actor.xyzDistFromLinkSq > 10000.f) {
return 0;
}
@ -237,7 +237,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) {
v0 -= this->h_21E;
v0 -= this->headRot;
v1 = this->actor.rotTowardsLinkY - v0;
v1 = this->actor.yawTowardsLink - v0;
if (ABS(v1) < 0x1554) {
return 1;
} else {
@ -263,7 +263,7 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) {
continue;
}
dy = prop->posRot.pos.y - this->actor.unk_80;
dy = prop->posRot.pos.y - this->actor.groundY;
dxz = func_8002DB8C(&this->actor, prop);
if (dxz > 40.f || dy > 10.f) {
prop = prop->next;
@ -282,7 +282,7 @@ void EnTk_CheckCurrentSpot(EnTk* this) {
f32 dy;
if (this->currentSpot != NULL) {
dy = this->currentSpot->posRot.pos.y - this->actor.unk_80;
dy = this->currentSpot->posRot.pos.y - this->actor.groundY;
dxz = func_8002DB8C(&this->actor, this->currentSpot);
if (dxz > 40.f || dy > 10.f) {
this->currentSpot = NULL;
@ -538,7 +538,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
if (this->h_1E0 != 0) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
v1 = this->actor.rotTowardsLinkY - v1;
v1 = this->actor.yawTowardsLink - v1;
if (this->h_1E0 == 2) {
EnTk_DigAnim(this, globalCtx);
@ -552,7 +552,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
} else if (EnTk_CheckFacingPlayer(this) != 0) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
v1 = this->actor.rotTowardsLinkY - v1;
v1 = this->actor.yawTowardsLink - v1;
this->actionCountdown = 0;
func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.f, func_80B1C54C,
@ -560,7 +560,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
} else if (func_8002F194(&this->actor, globalCtx) != 0) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
v1 = this->actor.rotTowardsLinkY - v1;
v1 = this->actor.yawTowardsLink - v1;
this->actionCountdown = 0;
this->h_1E0 = 1;

View file

@ -138,7 +138,7 @@ void EnTuboTrap_SpawnWaterFragments(EnTuboTrap* this, GlobalContext* globalCtx)
actorPos = &this->actor.posRot.pos;
spC8 = *actorPos;
spC8.y += this->actor.unk_84;
spC8.y += this->actor.waterY;
func_8002949C(globalCtx, &spC8, 0, 0, 0, 400);
@ -177,7 +177,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
s32 pad;
Player* player = PLAYER;
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.unk_84 > 15.0f)) {
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.waterY > 15.0f)) {
EnTuboTrap_SpawnWaterFragments(this, globalCtx);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_BOMB_DROP_WATER);
EnTuboTrap_DropCollectible(this, globalCtx);
@ -239,7 +239,7 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) {
osSyncPrintf("\n\n");
}
if (this->actor.xzDistanceFromLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) {
if (this->actor.xzDistFromLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) {
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this, ACTORTYPE_ENEMY);
this->actor.flags |= 1;
targetHeight = 40.0f + -10.0f * gSaveContext.linkAge;
@ -261,7 +261,7 @@ void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx) {
if (fabsf(this->actor.posRot.pos.y - this->targetY) < 10.0f) {
this->actor.speedXZ = 10.0f;
this->actor.posRot.rot.y = this->actor.rotTowardsLinkY;
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actionFunc = EnTuboTrap_Fly;
}
}

View file

@ -132,7 +132,7 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) {
this->timer = 0x82;
this->actor.velocity.y = 0.0f;
this->actor.posRot.pos.y = player->actor.posRot.pos.y;
this->actor.unk_80 = player->actor.unk_80;
this->actor.groundY = player->actor.groundY;
this->actor.draw = EnWallmas_Draw;
this->actionFunc = EnWallmas_WaitToDrop;
}
@ -147,7 +147,7 @@ void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) {
this->unk_2c4 = player->actor.posRot.pos.y;
this->actor.posRot.pos.y = player->actor.posRot.pos.y + 300.0f;
this->actor.posRot.rot.y = player->actor.shape.rot.y + 0x8000;
this->actor.unk_80 = player->actor.unk_80;
this->actor.groundY = player->actor.groundY;
this->actor.flags |= 1;
this->actor.flags &= ~0x20;
this->actionFunc = EnWallmas_Drop;
@ -234,7 +234,7 @@ void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->unk_2c4 = this->actor.yDistanceFromLink;
this->unk_2c4 = this->actor.yDistFromLink;
func_8002DF38(globalCtx, &this->actor, 0x25);
func_800800F8(globalCtx, 0x251C, 0x270F, &this->actor, 0);
}
@ -272,7 +272,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
player = PLAYER;
playerPos = &player->actor.posRot.pos;
this->actor.posRot.pos = *playerPos;
this->actor.unk_80 = player->actor.unk_80;
this->actor.groundY = player->actor.groundY;
this->actor.floorPoly = player->actor.floorPoly;
if (this->timer != 0) {
@ -298,8 +298,8 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (!func_8008E988(globalCtx) && (player->stateFlags2 & 0x10) == 0 && (player->invincibilityTimer >= 0) &&
(this->actor.xzDistanceFromLink < 30.0f) && (this->actor.yDistanceFromLink < -5.0f) &&
(-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) {
(this->actor.xzDistFromLink < 30.0f) && (this->actor.yDistFromLink < -5.0f) &&
(-(f32)(player->unk_4DA + 0xA) < this->actor.yDistFromLink)) {
EnWallmas_SetupTakePlayer(this, globalCtx);
}
}
@ -315,7 +315,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) {
EnWallmas_SetupWalk(this);
}
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0xB6);
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 0xB6);
}
void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) {
@ -323,7 +323,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) {
EnWallmas_SetupJumpToCeiling(this);
}
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.rotTowardsLinkY + 0x8000), 0xB6);
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.yawTowardsLink + 0x8000), 0xB6);
if ((func_800A56C8(&this->skelAnime, 0.0f) != 0) || (func_800A56C8(&this->skelAnime, 12.0f) != 0) ||
(func_800A56C8(&this->skelAnime, 24.0f) != 0) || (func_800A56C8(&this->skelAnime, 36.0f) != 0)) {
@ -349,7 +349,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_UP);
}
if (this->actor.yDistanceFromLink < -900.0f) {
if (this->actor.yDistFromLink < -900.0f) {
if (this->actor.params == WMT_FLAG) {
Actor_Kill(&this->actor);
return;
@ -571,7 +571,7 @@ void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) {
func_80094044(globalCtx->state.gfxCtx);
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0x00, 0x00, 0x00, 0xFF);
func_80038A28(this->actor.floorPoly, this->actor.posRot.pos.x, this->actor.unk_80, this->actor.posRot.pos.z, &mf);
func_80038A28(this->actor.floorPoly, this->actor.posRot.pos.x, this->actor.groundY, this->actor.posRot.pos.z, &mf);
Matrix_Mult(&mf, MTXMODE_NEW);
if ((this->actionFunc != EnWallmas_WaitToDrop) && (this->actionFunc != EnWallmas_ReturnToCeiling) &&

View file

@ -192,7 +192,7 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) {
func_800F5C64(0x51);
} else {
if (1) {}; // necessary to match
rotDiff = ABS(this->actor.rotTowardsLinkY - this->actor.shape.rot.y);
rotDiff = ABS(this->actor.yawTowardsLink - this->actor.shape.rot.y);
if (rotDiff < 0x238E) {
if (!(player->actor.posRot.pos.y < this->actor.posRot.pos.y)) {
func_8002F2F4(this, globalCtx);

View file

@ -124,7 +124,7 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
} else {
this->collider.base.acFlags &= ~0x2;
if (this->actor.xzDistanceFromLink < 800.0f) {
if (this->actor.xzDistFromLink < 800.0f) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
}