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

three more matches in BgJyaCobra (#758)

* two matches

* cleanup and formatting

* Update assets/xml/overlays/ovl_Bg_Jya_Cobra.xml

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* no more extract

* format

* owl exterminators

* new match

* new match

* small thing

* whoops

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
petrie911 2021-04-09 18:02:16 -05:00 committed by GitHub
parent 99fbbd8390
commit ab05eb9776
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 320 additions and 894 deletions

View file

@ -22,21 +22,19 @@ extern Gfx D_06010C20[];
extern UNK_TYPE D_0601167C;
extern Gfx D_060117D0[];
Vtx D_80897270[] = {
VTX(-800, 0, -800, 0, 2048, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(800, 0, -800, 2048, 2048, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(800, 0, 800, 2048, 0, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(-800, 0, 800, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF),
static Vtx sShadowVtx[4] = {
VTX(-800, 0, -800, 0, 2048, 255, 255, 255, 255),
VTX(800, 0, -800, 2048, 2048, 255, 255, 255, 255),
VTX(800, 0, 800, 2048, 0, 255, 255, 255, 255),
VTX(-800, 0, 800, 0, 0, 255, 255, 255, 255),
};
Gfx D_808972B0[] = {
static Gfx sShadowDL[] = {
gsDPPipeSync(),
gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetRenderMode(AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_DEC | FORCE_BL |
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1),
G_RM_AA_ZB_XLU_DECAL2),
gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_DECAL2),
gsSPClearGeometryMode(G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(D_80897270, 4, 0),
gsSPVertex(sShadowVtx, 4, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSPEndDisplayList(),
};
@ -53,13 +51,13 @@ const ActorInit Bg_Jya_Cobra_InitVars = {
(ActorFunc)BgJyaCobra_Draw,
};
s16 D_80897308[] = { 0, 0, 0, 0 };
static s16 D_80897308[] = { 0, 0, 0, 0 };
u8 D_80897310[] = { 1, 0, 1, 0 };
static u8 D_80897310[] = { true, false, true, false };
s16 D_80897314[] = { -0x4000, 0000, 0x4000, 0000 };
static s16 D_80897314[] = { -0x4000, 0000, 0x4000, 0000 };
u8 D_8089731C[11][11] = {
static u8 D_8089731C[11][11] = {
{ 0x00, 0x00, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x00, 0x00 },
{ 0x00, 0x20, 0x80, 0xA0, 0xA3, 0xA3, 0xA3, 0xA0, 0x80, 0x20, 0x00 },
{ 0x20, 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80, 0x20 },
@ -73,13 +71,13 @@ u8 D_8089731C[11][11] = {
{ 0x00, 0x00, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x00, 0x00 },
};
u8 D_80897398[3][3] = {
static u8 D_80897398[3][3] = {
{ 0x20, 0x80, 0x20 },
{ 0x80, 0xA0, 0x80 },
{ 0x20, 0x80, 0x20 },
};
Vec3f D_808973A4[] = {
static Vec3f D_808973A4[] = {
{ -6.0f, 100.0f, 7.6f },
{ -12.6f, 69.200005f, -10.0f },
{ -9.0f, 43.0f, -1.0f },
@ -108,25 +106,25 @@ Vec3f D_808973A4[] = {
{ 0.0f, 101.4f, 5.0f },
};
Vec3f D_808974DC[] = {
static Vec3f D_808974DC[] = {
{ 12.0f, 21.300001f, -2.5f }, { 30.0f, 21.300001f, -2.5f }, { -15.0f, 21.300001f, -2.5f },
{ -30.0f, 21.300001f, -2.5f }, { 12.0f, 21.300001f, -2.5f },
};
s32 D_80897518[] = { 0x80, 0xA0, 0xA0, 0x80 };
static s32 D_80897518[] = { 0x80, 0xA0, 0xA0, 0x80 };
InitChainEntry D_80897528[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
Vec3s D_80897538 = { 0, -0x4000, 0 };
static Vec3s D_80897538 = { 0, -0x4000, 0 };
Vec3s D_80897540 = { 0, 0x4000, 0 };
static Vec3s D_80897540 = { 0, 0x4000, 0 };
Vec3f D_80897548[] = {
static Vec3f D_80897548[] = {
{ 0.1f, 0.1f, 0.1f },
{ 0.072f, 0.072f, 0.072f },
{ 0.1f, 0.1f, 0.132f },
@ -164,62 +162,52 @@ void BgJyaCobra_SpawnRay(BgJyaCobra* this, GlobalContext* globalCtx) {
}
}
#ifdef NON_MATCHING
// minor register and stack diffs
void func_80895A70(BgJyaCobra* this) {
s32 pad;
BgJyaBigmirror* temp_v1;
MirRay* phi_v0;
Vec3f sp28;
MirRay* temp;
temp_v1 = (BgJyaBigmirror*)this->dyna.actor.parent;
BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent;
MirRay* mirRay;
switch (this->dyna.actor.params & 3) {
case 0:
temp = (MirRay*)this->dyna.actor.child;
if (this->dyna.actor.child != NULL) {
phi_v0 = temp;
if (phi_v0->actor.update == NULL) {
this->dyna.actor.child = NULL;
return;
}
} else {
mirRay = (MirRay*)this->dyna.actor.child;
if (mirRay == NULL) {
return;
}
if (this->dyna.actor.child->update == NULL) {
this->dyna.actor.child = NULL;
return;
}
break;
case 1:
phi_v0 = (MirRay*)temp_v1->lightBeams[1];
if (phi_v0 == NULL) {
mirRay = (MirRay*)mirror->lightBeams[1];
if (mirRay == NULL) {
return;
}
break;
case 2:
phi_v0 = (MirRay*)temp_v1->lightBeams[2];
if (phi_v0 == NULL) {
mirRay = (MirRay*)mirror->lightBeams[2];
if (mirRay == NULL) {
return;
}
break;
}
if (this->unk_18C <= 0.0f) {
phi_v0->unLit = 1;
return;
}
mirRay->unLit = 1;
} else {
Vec3f sp28;
phi_v0->unLit = 0;
Math_Vec3f_Copy(&phi_v0->sourcePt, &this->unk_180);
Matrix_RotateY(this->dyna.actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_NEW);
Matrix_RotateX(D_80897308[this->dyna.actor.params & 3] * (M_PI / 0x8000), MTXMODE_APPLY);
sp28.x = 0.0f;
sp28.y = 0.0;
sp28.z = this->unk_190 * 2800.0f;
Matrix_MultVec3f(&sp28, &phi_v0->poolPt);
Math_Vec3f_Sum(&phi_v0->sourcePt, &phi_v0->poolPt, &phi_v0->poolPt);
mirRay->unLit = 0;
Math_Vec3f_Copy(&mirRay->sourcePt, &this->unk_180);
Matrix_RotateY(this->dyna.actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_NEW);
Matrix_RotateX(D_80897308[this->dyna.actor.params & 3] * (M_PI / 0x8000), MTXMODE_APPLY);
sp28.x = 0.0f;
sp28.y = 0.0;
sp28.z = this->unk_190 * 2800.0f;
Matrix_MultVec3f(&sp28, &mirRay->poolPt);
Math_Vec3f_Sum(&mirRay->sourcePt, &mirRay->poolPt, &mirRay->poolPt);
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895A70.s")
#endif
void func_80895BEC(BgJyaCobra* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
@ -232,22 +220,20 @@ void func_80895BEC(BgJyaCobra* this, GlobalContext* globalCtx) {
player->actor.world.pos.z = this->dyna.actor.world.pos.z + sp2C.z;
}
#ifdef NON_MATCHING
// Small stack diffs
void func_80895C74(BgJyaCobra* this, GlobalContext* globalCtx) {
s16 phi_v0;
s32 params = this->dyna.actor.params;
BgJyaBigmirror* parent = (BgJyaBigmirror*)this->dyna.actor.parent;
s16 params = this->dyna.actor.params;
BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent;
f32 phi_f0;
if ((params & 3) == 2 && parent != NULL &&
(!(parent->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) ||
!(parent->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) {
if ((params & 3) == 2 && mirror != NULL &&
(!(mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) ||
!(mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) {
Math_StepToF(&this->unk_18C, 0.0f, 0.05f);
} else {
this->unk_18C = 1.0f;
if (D_80897310[(params & 3)] != 0) {
phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[(params & 3)];
if (D_80897310[params & 3]) {
phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[params & 3];
phi_v0 = ABS(phi_v0);
if (phi_v0 < 0x2000 && phi_v0 != -0x8000) {
this->unk_18C += (phi_v0 - 0x2000) * (3.0f / 0x4000);
@ -262,7 +248,7 @@ void func_80895C74(BgJyaCobra* this, GlobalContext* globalCtx) {
this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f;
this->unk_180.z = this->dyna.actor.world.pos.z;
if (!(params & 3)) {
if ((params & 3) == 0) {
this->unk_190 = 0.1f;
} else if ((params & 3) == 1) {
phi_f0 = 0.1f;
@ -271,8 +257,8 @@ void func_80895C74(BgJyaCobra* this, GlobalContext* globalCtx) {
phi_f0 = 0.34f;
} else {
phi_v0 = this->dyna.actor.shape.rot.y - 0x4000;
if (phi_v0 < 0x500 && phi_v0 > -0x500 && parent != NULL &&
(parent->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED)) {
if (phi_v0 < 0x500 && phi_v0 > -0x500 && mirror != NULL &&
(mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED)) {
phi_f0 = 0.34f;
}
}
@ -291,9 +277,6 @@ void func_80895C74(BgJyaCobra* this, GlobalContext* globalCtx) {
Math_StepToF(&this->unk_190, phi_f0, 0.04f);
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895C74.s")
#endif
#ifdef NON_MATCHING
// Repeatedly calculates temp_z * 0x40 for temp_s2[temp_z] rather than calculating it once when temp_z is assigned.
@ -315,22 +298,22 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
s32 j;
s32 k;
s32 l;
s16 rotY;
temp_s2 = (u8(*)[0x40])ALIGN16((s32)(&this->shadowTexture));
Lib_MemSet((u8*)temp_s2, 0x1000, 0);
Matrix_RotateX((M_PI / 4), MTXMODE_NEW);
Matrix_RotateY((!(this->dyna.actor.params & 3) ? (s16)(this->dyna.actor.shape.rot.y + 0x4000)
: (s16)(this->dyna.actor.shape.rot.y - 0x4000)) *
(M_PI / 0x8000),
MTXMODE_APPLY);
rotY = !(this->dyna.actor.params & 3) ? (this->dyna.actor.shape.rot.y + 0x4000)
: (this->dyna.actor.shape.rot.y - 0x4000);
Matrix_RotateY(rotY * (M_PI / 0x8000), MTXMODE_APPLY);
Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY);
for (i = 0; i < 25; i++) {
Math_Vec3f_Diff(&D_808973A4[i + 1], &D_808973A4[i], &spD4);
spD4.x *= 0.5f;
spD4.y *= 0.5f;
spD4.z *= 0.5f;
spD4.x *= 1 / 2.0f;
spD4.y *= 1 / 2.0f;
spD4.z *= 1 / 2.0f;
for (j = 0; j < 2; j++) {
spC8.x = D_808973A4[i].x + (spD4.x * j);
spC8.y = D_808973A4[i].y + (spD4.y * j);
@ -354,9 +337,9 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
for (i = 0; i < 4; i++) {
Math_Vec3f_Diff(&D_808974DC[i + 1], &D_808974DC[i], &spD4);
spD4.x = spD4.x * 0.2f;
spD4.y = spD4.y * 0.2f;
spD4.z = spD4.z * 0.2f;
spD4.x *= 1 / 5.0f;
spD4.y *= 1 / 5.0f;
spD4.z *= 1 / 5.0f;
for (j = 0; j < 5; j++) {
spC8.x = D_808974DC[i].x + (spD4.x * j);
spC8.y = D_808974DC[i].y + (spD4.y * j);
@ -392,61 +375,54 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromSide.s")
#endif
#ifdef NON_MATCHING
// minor register and stack diffs
/*
* Updates the shadow with light coming from above the mirror
*/
void BgJyaCobra_UpdateShadowFromTop(BgJyaCobra* this) {
f32 sp58[0x40];
f32 temp_f12;
f32 temp_f2;
u8* temp_s0;
s32 i_copy;
u8* phi_a3;
s32 counter;
s32 i;
s32 j;
s32 i_copy;
s32 counter;
u8* temp_s0;
u8* sp40;
for (i = 0; i < 0x40; i++) {
sp58[i] = SQ(i - 31.5f);
}
temp_s0 = (u8*)ALIGN16((s32)(&this->shadowTexture));
phi_a3 = temp_s0;
sp40 = temp_s0 = (u8*)ALIGN16((u32)(&this->shadowTexture));
Lib_MemSet(temp_s0, 0x1000, 0);
for (i = 0; i != 0x40; i++) {
temp_f12 = sp58[i];
for (j = 0; j < 0x40; j++) {
temp_f2 = (sp58[j] * 0.5f) + temp_f12;
f32 temp_f12 = sp58[i];
for (j = 0; j < 0x40; j++, sp40++) {
f32 temp_f2 = (sp58[j] * 0.5f) + temp_f12;
if (temp_f2 < 300.0f) {
*phi_a3 |= CLAMP_MAX(640 - (s32)(temp_f2 * 2.0f), 166);
*sp40 |= CLAMP_MAX(640 - (s32)(temp_f2 * 2.0f), 166);
}
phi_a3++;
}
}
for (counter = 0, i = 0x780; counter < 4; counter++, i += 0x40) {
i_copy = i;
for (i_copy = 0x780, counter = 0; counter < 4; counter++, i_copy += 0x40) {
i = i_copy;
for (j = 4; j < 0x3C; j++) {
if (temp_s0[i + j] < D_80897518[counter]) {
temp_s0[i + j] = D_80897518[counter];
if (temp_s0[i_copy + j] < D_80897518[counter]) {
temp_s0[i_copy + j] = D_80897518[counter];
}
}
temp_s0[i_copy + 0x3C] = 0x20;
temp_s0[i_copy + 0x3] = 0x20;
temp_s0[i + 0x3C] = 0x20;
temp_s0[i + 0x3] = 0x20;
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromTop.s")
#endif
void BgJyaCobra_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
BgJyaCobra_InitDynapoly(this, globalCtx, &D_0601167C, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, D_80897528);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
if (!(this->dyna.actor.params & 3) && Flags_GetSwitch(globalCtx, ((s32)this->dyna.actor.params >> 8) & 0x3F)) {
this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0;
}
@ -477,10 +453,10 @@ void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80896918(BgJyaCobra* this, GlobalContext* globalCtx) {
this->actionFunc = &func_80896950;
this->actionFunc = func_80896950;
this->unk_168 = 0;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y =
(s16)((this->unk_16C << 0xD) + this->dyna.actor.home.rot.y);
(this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y;
}
void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) {
@ -502,84 +478,72 @@ void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) {
}
void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx) {
Player* player;
Player* player = PLAYER;
s32 phi_a3;
s16 temp2;
player = PLAYER;
this->actionFunc = func_80896ABC;
temp2 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
phi_a3 = (s16)(this->dyna.actor.shape.rot.y - this->dyna.unk_158);
phi_a3 = ABS(phi_a3);
if (temp2 > 0) {
if (phi_a3 > 0x4000) {
this->unk_16A = 1;
} else {
this->unk_16A = -1;
}
this->unk_16A = (phi_a3 > 0x4000) ? 1 : -1;
} else {
if (phi_a3 > 0x4000) {
this->unk_16A = -1;
} else {
this->unk_16A = 1;
}
this->unk_16A = (phi_a3 > 0x4000) ? -1 : 1;
}
this->unk_174.x = player->actor.world.pos.x - this->dyna.actor.world.pos.x;
this->unk_174.y = player->actor.world.pos.y - this->dyna.actor.world.pos.y;
this->unk_174.z = player->actor.world.pos.z - this->dyna.actor.world.pos.z;
this->unk_170 = this->unk_16E = 0;
this->unk_172 = 1;
this->unk_172 = true;
}
void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) {
s16 temp_v0;
Player* player;
Player* player = PLAYER;
player = PLAYER;
temp_v0 = (s16)((this->unk_16C << 0xD) + this->dyna.actor.home.rot.y) - this->dyna.actor.world.rot.y;
temp_v0 = (s16)((this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y) - this->dyna.actor.world.rot.y;
if (ABS(temp_v0) < 7424) {
Math_StepToS(&this->unk_16E, 106, 4);
} else {
Math_StepToS(&this->unk_16E, 21, 10);
}
if (Math_ScaledStepToS(&this->unk_170, (s16)(this->unk_16A << 0xd), this->unk_16E) != 0) {
if (Math_ScaledStepToS(&this->unk_170, this->unk_16A * 0x2000, this->unk_16E)) {
this->unk_16C = (this->unk_16C + this->unk_16A) & 7;
player->stateFlags2 &= ~0x10;
this->dyna.unk_150 = 0.0f;
func_80896918(this, globalCtx);
} else {
temp_v0 = (this->unk_16C << 0xD) + this->dyna.actor.home.rot.y + this->unk_170;
this->dyna.actor.world.rot.y = temp_v0;
this->dyna.actor.shape.rot.y = temp_v0;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y =
(this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y + this->unk_170;
}
if (player->stateFlags2 & 0x10) {
if (this->unk_172 != 0) {
if (this->unk_172) {
func_80895BEC(this, globalCtx);
}
} else if (fabsf(this->dyna.unk_150) < 0.001f) {
this->unk_172 = 0;
this->unk_172 = false;
}
this->dyna.unk_150 = 0.0f;
func_8002F974(&this->dyna.actor, 0x200A);
func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
}
void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgJyaCobra* this = THIS;
s32 params;
this->actionFunc(this, globalCtx);
func_80895C74(this, globalCtx);
func_80895A70(this);
params = this->dyna.actor.params & 3;
if (params == 0 || params == 2) {
if ((this->dyna.actor.params & 3) == 0 || (this->dyna.actor.params & 3) == 2) {
BgJyaCobra_UpdateShadowFromSide(this);
}
}
@ -617,15 +581,13 @@ void func_80896D78(BgJyaCobra* this, GlobalContext* globalCtx) {
}
void BgJyaCobra_DrawShadow(BgJyaCobra* this, GlobalContext* globalCtx) {
u32 pad;
s16 params;
s32 pad;
s16 params = this->dyna.actor.params & 3;
Vec3f sp64;
Vec3s* phi_a3;
if (1) {}
params = this->dyna.actor.params & 3;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 966);
func_80094044(globalCtx->state.gfxCtx);
@ -635,18 +597,16 @@ void BgJyaCobra_DrawShadow(BgJyaCobra* this, GlobalContext* globalCtx) {
sp64.y = this->dyna.actor.world.pos.y;
sp64.z = this->dyna.actor.world.pos.z;
phi_a3 = &D_80897538;
} else {
} else if (params == 2) {
sp64.x = this->dyna.actor.world.pos.x + 70.0f;
sp64.y = this->dyna.actor.world.pos.y;
sp64.z = this->dyna.actor.world.pos.z;
phi_a3 = &D_80897540;
} else { // params == 1
phi_a3 = &this->dyna.actor.shape.rot;
if (params == 2) {
sp64.x = this->dyna.actor.world.pos.x + 70.0f;
sp64.y = this->dyna.actor.world.pos.y;
sp64.z = this->dyna.actor.world.pos.z;
phi_a3 = &D_80897540;
// params == 1
} else {
Math_Vec3f_Copy(&sp64, &this->dyna.actor.world.pos);
}
Math_Vec3f_Copy(&sp64, &this->dyna.actor.world.pos);
}
func_800D1694(sp64.x, sp64.y, sp64.z, phi_a3);
Matrix_Scale(D_80897548[params].x, D_80897548[params].y, D_80897548[params].z, MTXMODE_APPLY);
@ -660,7 +620,7 @@ void BgJyaCobra_DrawShadow(BgJyaCobra* this, GlobalContext* globalCtx) {
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPDisplayList(POLY_XLU_DISP++, D_808972B0);
gSPDisplayList(POLY_XLU_DISP++, sShadowDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 1006);
}

View file

@ -42,8 +42,7 @@ void BgSstFloor_Init(BgSstFloor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
CollisionHeader_GetVirtual(&gBongoDrumCol, &colHeader);
this->dyna.bgId =
DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
}
void BgSstFloor_Destroy(BgSstFloor* thisx, GlobalContext* globalCtx) {
@ -112,10 +111,9 @@ void BgSstFloor_Update(BgSstFloor* thisx, GlobalContext* globalCtx) {
this->drumHeight = sinf(this->drumPhase * (M_PI / 2)) * (-this->drumAmp);
Math_StepToS(&this->drumAmp, 0, 5);
colHeader->vtxList[1].y = colHeader->vtxList[0].y = colHeader->vtxList[2].y =
colHeader->vtxList[3].y = colHeader->vtxList[4].y = colHeader->vtxList[7].y =
colHeader->vtxList[9].y = colHeader->vtxList[11].y = colHeader->vtxList[13].y =
this->dyna.actor.home.pos.y + this->drumHeight;
colHeader->vtxList[1].y = colHeader->vtxList[0].y = colHeader->vtxList[2].y = colHeader->vtxList[3].y =
colHeader->vtxList[4].y = colHeader->vtxList[7].y = colHeader->vtxList[9].y = colHeader->vtxList[11].y =
colHeader->vtxList[13].y = this->dyna.actor.home.pos.y + this->drumHeight;
if (this->drumPhase != 0) {
this->drumPhase--;

View file

@ -1799,7 +1799,8 @@ void BossSst_HandGrab(BossSst* this, GlobalContext* globalCtx) {
this->timer--;
}
this->actor.world.rot.y = ((1.0f - sinf(this->timer * (M_PI / 60.0f))) * (this->vParity * 0x2000)) + this->targetYaw;
this->actor.world.rot.y =
((1.0f - sinf(this->timer * (M_PI / 60.0f))) * (this->vParity * 0x2000)) + this->targetYaw;
this->actor.shape.rot.y = this->actor.world.rot.y - (this->vParity * 0x4000);
if (this->timer < 5) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.5f, 25.0f, 5.0f);

View file

@ -317,36 +317,36 @@ static ColliderCylinderInit sCylinderInitHand = {
static CollisionCheckInfoInit sColChkInfoInit = { 36, 100, 100, 200 };
static DamageTable sDamageTable = {
/* Deku nut */ DMG_ENTRY(0 , 0x0),
/* Deku stick */ DMG_ENTRY(2 , 0x0),
/* Slingshot */ DMG_ENTRY(1 , 0x0),
/* Explosive */ DMG_ENTRY(2 , 0x0),
/* Boomerang */ DMG_ENTRY(0 , 0x0),
/* Normal arrow */ DMG_ENTRY(2 , 0x0),
/* Hammer swing */ DMG_ENTRY(2 , 0x0),
/* Hookshot */ DMG_ENTRY(2 , 0x0),
/* Kokiri sword */ DMG_ENTRY(1 , 0x0),
/* Master sword */ DMG_ENTRY(2 , 0x0),
/* Giant's Knife */ DMG_ENTRY(4 , 0x0),
/* Fire arrow */ DMG_ENTRY(2 , 0x0),
/* Ice arrow */ DMG_ENTRY(4 , 0x3),
/* Light arrow */ DMG_ENTRY(2 , 0x0),
/* Unk arrow 1 */ DMG_ENTRY(4 , 0x0),
/* Unk arrow 2 */ DMG_ENTRY(2 , 0x0),
/* Unk arrow 3 */ DMG_ENTRY(2 , 0x0),
/* Fire magic */ DMG_ENTRY(0 , 0x0),
/* Ice magic */ DMG_ENTRY(4 , 0x3),
/* Light magic */ DMG_ENTRY(4 , 0x4),
/* Shield */ DMG_ENTRY(0 , 0x0),
/* Mirror Ray */ DMG_ENTRY(0 , 0x0),
/* Kokiri spin */ DMG_ENTRY(1 , 0x0),
/* Giant spin */ DMG_ENTRY(4 , 0x0),
/* Master spin */ DMG_ENTRY(2 , 0x0),
/* Kokiri jump */ DMG_ENTRY(2 , 0x0),
/* Giant jump */ DMG_ENTRY(8 , 0x0),
/* Master jump */ DMG_ENTRY(4 , 0x0),
/* Unknown 1 */ DMG_ENTRY(0 , 0x0),
/* Unblockable */ DMG_ENTRY(0 , 0x0),
/* Hammer jump */ DMG_ENTRY(4 , 0x0),
/* Unknown 2 */ DMG_ENTRY(0 , 0x0),
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(2, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(2, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(2, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(2, 0x0),
/* Ice arrow */ DMG_ENTRY(4, 0x3),
/* Light arrow */ DMG_ENTRY(2, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(4, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(2, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(2, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(4, 0x3),
/* Light magic */ DMG_ENTRY(4, 0x4),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(4, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(8, 0x0),
/* Master jump */ DMG_ENTRY(4, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(4, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
};

View file

@ -106,7 +106,7 @@ static ColliderCylinderInit sOwlCylinderInit = {
{ 30, 40, 0, { 0, 0, 0 } },
};
InitChainEntry sOwlInitChain[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 25, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 2000, ICHAIN_CONTINUE),
@ -119,7 +119,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 owlType;
s32 switchFlag;
Actor_ProcessInitChain(&this->actor, sOwlInitChain);
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 36.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C0E8, &D_060015CC, this->jointTable, this->morphTable, 21);
SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &D_060100B0, &D_0600C8A0, this->jointTable2, this->morphTable2,
@ -251,12 +251,10 @@ void EnOwl_Destroy(Actor* thisx, GlobalContext* globalCtx) {
* Rotates this to the player instance
*/
void EnOwl_LookAtLink(EnOwl* this, GlobalContext* globalCtx) {
s16 yaw;
Player* player = PLAYER;
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos);
this->actor.world.rot.y = yaw;
this->actor.shape.rot.y = yaw;
this->actor.shape.rot.y = this->actor.world.rot.y =
Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos);
}
/**
@ -268,7 +266,7 @@ s32 EnOwl_CheckInitTalk(EnOwl* this, GlobalContext* globalCtx, u16 textId, f32 t
s32 timer;
f32 distCheck;
if (func_8002F194(&this->actor, globalCtx) != 0) {
if (func_8002F194(&this->actor, globalCtx)) {
if (this->actor.params == 0xFFF) {
this->actionFlags |= 0x40;
timer = -100;
@ -290,7 +288,6 @@ s32 EnOwl_CheckInitTalk(EnOwl* this, GlobalContext* globalCtx, u16 textId, f32 t
this->actor.flags |= 0x10000;
func_8002F1C4(&this->actor, globalCtx, targetDist, distCheck, 0);
}
return false;
}
}
@ -303,7 +300,6 @@ s32 func_80ACA558(EnOwl* this, GlobalContext* globalCtx, u16 textId) {
if (this->actor.xzDistToPlayer < 120.0f) {
func_8002F1C4(&this->actor, globalCtx, 350.0f, 1000.0f, 0);
}
return false;
}
}
@ -315,9 +311,8 @@ void func_80ACA5C8(EnOwl* this) {
}
void func_80ACA62C(EnOwl* this, GlobalContext* globalCtx) {
s32 switchFlag;
s32 switchFlag = this->actor.params & 0x3F;
switchFlag = this->actor.params & 0x3F;
if (switchFlag < 0x20) {
Flags_SetSwitch(globalCtx, switchFlag);
osSyncPrintf(VT_FGCOL(CYAN) " Actor_Environment_sw = %d\n" VT_RST, Flags_GetSwitch(globalCtx, switchFlag));
@ -353,7 +348,7 @@ void func_80ACA71C(EnOwl* this) {
void func_80ACA76C(EnOwl* this, GlobalContext* globalCtx) {
func_8002DF54(globalCtx, &this->actor, 8);
if (func_8002F334(&this->actor, globalCtx) != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
Audio_SetBGM(0x110000FF);
func_80ACA62C(this, globalCtx);
this->actor.flags &= ~0x10000;
@ -363,7 +358,7 @@ void func_80ACA76C(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACA7E0(EnOwl* this, GlobalContext* globalCtx) {
func_8002DF54(globalCtx, &this->actor, 8);
if (func_8002F334(&this->actor, globalCtx) != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
Audio_SetBGM(0x110000FF);
if ((this->unk_3EE & 0x3F) == 0) {
func_80ACA62C(this, globalCtx);
@ -377,7 +372,7 @@ void func_80ACA7E0(EnOwl* this, GlobalContext* globalCtx) {
}
void EnOwl_ConfirmKokiriMessage(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x2065);
@ -393,7 +388,7 @@ void EnOwl_ConfirmKokiriMessage(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitOutsideKokiri(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x2064, 360.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x2064, 360.0f, 0)) {
// Sets BGM
func_800F5C64(0x5A);
@ -404,7 +399,7 @@ void EnOwl_WaitOutsideKokiri(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACA998(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x2069);
@ -421,7 +416,7 @@ void func_80ACA998(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACAA54(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x206A);
this->actionFunc = func_80ACA998;
this->actionFlags |= 2;
@ -430,7 +425,7 @@ void func_80ACAA54(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACAAC0(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x2069);
this->actionFunc = func_80ACAA54;
this->actionFlags &= ~2;
@ -441,14 +436,14 @@ void func_80ACAAC0(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitHyruleCastle(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x2068, 540.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x2068, 540.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACAAC0;
}
}
void func_80ACAB88(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
// obtained zelda's letter
@ -471,7 +466,7 @@ void func_80ACAB88(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACAC6C(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x206A);
this->actionFunc = func_80ACAB88;
this->actionFlags |= 2;
@ -482,14 +477,14 @@ void func_80ACAC6C(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitKakariko(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x206C, 480.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x206C, 480.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACAC6C;
}
}
void func_80ACAD34(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x206F);
@ -507,7 +502,7 @@ void func_80ACAD34(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACADF0(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x206A);
this->actionFunc = func_80ACAD34;
this->actionFlags |= 2;
@ -518,14 +513,14 @@ void func_80ACADF0(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitGerudo(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x206F, 360.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x206F, 360.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACADF0;
}
}
void func_80ACAEB8(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x2071);
@ -543,7 +538,7 @@ void func_80ACAEB8(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACAF74(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x206A);
this->actionFunc = func_80ACAEB8;
this->actionFlags |= 2;
@ -554,7 +549,7 @@ void func_80ACAF74(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitLakeHylia(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x2071, 360.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x2071, 360.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACAF74;
}
@ -563,7 +558,7 @@ void EnOwl_WaitLakeHylia(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACB03C(EnOwl* this, GlobalContext* globalCtx) {
func_8002DF54(globalCtx, &this->actor, 8);
if (func_8002F334(&this->actor, globalCtx) != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
Audio_SetBGM(0x110000FF);
func_80ACA62C(this, globalCtx);
this->actor.flags &= ~0x10000;
@ -585,14 +580,14 @@ void EnOwl_WaitZoraRiver(EnOwl* this, GlobalContext* globalCtx) {
textId = 0x4002;
}
if (EnOwl_CheckInitTalk(this, globalCtx, textId, 360.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, textId, 360.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACB03C;
}
}
void func_80ACB148(EnOwl* this, GlobalContext* globalCtx) {
if (func_8002F334(&this->actor, globalCtx) != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
Audio_SetBGM(0x110000FF);
func_80ACA5C8(this);
this->actionFunc = func_80ACC30C;
@ -601,16 +596,10 @@ void func_80ACB148(EnOwl* this, GlobalContext* globalCtx) {
}
void EnOwl_WaitHyliaShortcut(EnOwl* this, GlobalContext* globalCtx) {
u16 textId;
u16 textId = (gSaveContext.infTable[25] & 0x20) ? 0x4004 : 0x4003;
// Spoke to Owl in Lake Hylia
if (gSaveContext.infTable[25] & 0x20) {
textId = 0x4004;
} else {
textId = 0x4003;
}
EnOwl_LookAtLink(this, globalCtx);
if (func_80ACA558(this, globalCtx, textId) != 0) {
if (func_80ACA558(this, globalCtx, textId)) {
gSaveContext.infTable[25] |= 0x20;
func_800F5C64(0x5A);
this->actionFunc = func_80ACB148;
@ -618,7 +607,7 @@ void EnOwl_WaitHyliaShortcut(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACB22C(EnOwl* this, GlobalContext* globalCtx) {
if (func_8002F334(&this->actor, globalCtx) != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
Audio_SetBGM(0x110000FF);
func_80ACA5C8(this);
this->actionFunc = func_80ACC30C;
@ -626,7 +615,7 @@ void func_80ACB22C(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACB274(EnOwl* this, GlobalContext* globalCtx) {
if (func_8002F334(&this->actor, globalCtx) != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
Audio_SetBGM(0x110000FF);
this->actionFunc = EnOwl_WaitDeathMountainShortcut;
}
@ -636,13 +625,13 @@ void EnOwl_WaitDeathMountainShortcut(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (!gSaveContext.magicAcquired) {
if (func_80ACA558(this, globalCtx, 0x3062) != 0) {
if (func_80ACA558(this, globalCtx, 0x3062)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACB274;
return;
}
} else {
if (func_80ACA558(this, globalCtx, 0x3063) != 0) {
if (func_80ACA558(this, globalCtx, 0x3063)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACB22C;
}
@ -650,7 +639,7 @@ void EnOwl_WaitDeathMountainShortcut(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACB344(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x607A);
@ -666,14 +655,14 @@ void func_80ACB344(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACB3E0(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x6079, 360.0f, 2) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x6079, 360.0f, 2)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACB344;
}
}
void func_80ACB440(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x10C1);
@ -690,7 +679,7 @@ void func_80ACB440(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACB4FC(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x10C2);
this->actionFunc = func_80ACB440;
this->actionFlags |= 2;
@ -701,14 +690,14 @@ void func_80ACB4FC(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitLWPreSaria(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x10C0, 190.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x10C0, 190.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACB4FC;
}
}
void func_80ACB5C4(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case OWL_REPEAT:
func_8010B720(globalCtx, 0x10C5);
@ -726,7 +715,7 @@ void func_80ACB5C4(EnOwl* this, GlobalContext* globalCtx) {
}
void func_80ACB680(EnOwl* this, GlobalContext* globalCtx) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx) != 0) {
if (func_8010BDBC(&globalCtx->msgCtx) == 5 && func_80106BC8(globalCtx)) {
func_8010B720(globalCtx, 0x10C6);
this->actionFunc = func_80ACB5C4;
this->actionFlags |= 2;
@ -737,7 +726,7 @@ void func_80ACB680(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitLWPostSaria(EnOwl* this, GlobalContext* globalCtx) {
EnOwl_LookAtLink(this, globalCtx);
if (EnOwl_CheckInitTalk(this, globalCtx, 0x10C4, 360.0f, 0) != 0) {
if (EnOwl_CheckInitTalk(this, globalCtx, 0x10C4, 360.0f, 0)) {
func_800F5C64(0x5A);
this->actionFunc = func_80ACB680;
}
@ -745,43 +734,40 @@ void EnOwl_WaitLWPostSaria(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACB748(EnOwl* this, GlobalContext* globalCtx) {
static Vec3f D_80ACD62C = { 0.0f, 0.0f, 0.0f };
f32 unkf2;
f32 xyzDist;
u32 owlType;
f32 dist;
f32 weight;
s32 owlType = (this->actor.params & 0xFC0) >> 6;
owlType = (this->actor.params & 0xFC0) >> 6;
xyzDist = Math3D_Vec3f_DistXYZ(&this->eye, &globalCtx->view.eye) / 45.0f;
dist = Math3D_Vec3f_DistXYZ(&this->eye, &globalCtx->view.eye) / 45.0f;
this->eye.x = globalCtx->view.eye.x;
this->eye.y = globalCtx->view.eye.y;
this->eye.z = globalCtx->view.eye.z;
xyzDist = xyzDist;
if (xyzDist > 1.0f) {
xyzDist = 1.0f;
weight = dist;
if (weight > 1.0f) {
weight = 1.0f;
}
switch (owlType) {
case 7:
unkf2 = xyzDist * 2.f;
func_800F436C(&D_80ACD62C, NA_SE_EV_FLYING_AIR - SFX_FLAG, unkf2);
func_800F436C(&D_80ACD62C, NA_SE_EV_FLYING_AIR - SFX_FLAG, weight * 2.0f);
if ((globalCtx->csCtx.frames > 324) ||
((globalCtx->csCtx.frames >= 142 && (globalCtx->csCtx.frames <= 266)))) {
func_800F4414(&D_80ACD62C, NA_SE_EN_OWL_FLUTTER, unkf2);
func_800F4414(&D_80ACD62C, NA_SE_EN_OWL_FLUTTER, weight * 2.0f);
}
if (globalCtx->csCtx.frames == 85) {
func_800F436C(&D_80ACD62C, NA_SE_EV_PASS_AIR, unkf2);
func_800F436C(&D_80ACD62C, NA_SE_EV_PASS_AIR, weight * 2.0f);
}
break;
case 8:
case 9:
unkf2 = xyzDist * 2.f;
func_800F436C(&D_80ACD62C, NA_SE_EV_FLYING_AIR - SFX_FLAG, unkf2);
func_800F436C(&D_80ACD62C, NA_SE_EV_FLYING_AIR - SFX_FLAG, weight * 2.0f);
if ((globalCtx->csCtx.frames >= 420) ||
((0xC1 < globalCtx->csCtx.frames && (globalCtx->csCtx.frames <= 280)))) {
func_800F4414(&D_80ACD62C, NA_SE_EN_OWL_FLUTTER, unkf2);
func_800F4414(&D_80ACD62C, NA_SE_EN_OWL_FLUTTER, weight * 2.0f);
}
if (globalCtx->csCtx.frames == 217) {
func_800F436C(&D_80ACD62C, NA_SE_EV_PASS_AIR, unkf2);
func_800F436C(&D_80ACD62C, NA_SE_EV_PASS_AIR, weight * 2.0f);
}
break;
}
@ -816,8 +802,6 @@ void func_80ACB994(EnOwl* this, GlobalContext* globalCtx) {
}
void EnOwl_WaitDefault(EnOwl* this, GlobalContext* globalCtx) {
u16 angle;
if (globalCtx->csCtx.state != CS_STATE_IDLE && (globalCtx->csCtx.npcActions[7] != NULL)) {
if (this->unk_40A != globalCtx->csCtx.npcActions[7]->action) {
this->actionFlags |= 4;
@ -1035,30 +1019,32 @@ void func_80ACC390(EnOwl* this) {
this->unk_3FE--;
this->actor.shape.rot.z = Math_SinS(this->unk_3FE * 0x333) * 1000.0f;
} else {
this->unk_410 = &func_80ACC460;
this->unk_410 = func_80ACC460;
this->unk_3FE = 6;
Animation_Change(this->curSkelAnime, &D_060015CC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060015CC), 2, 5.0f);
Animation_Change(this->curSkelAnime, &D_060015CC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060015CC),
ANIMMODE_ONCE, 5.0f);
}
}
void func_80ACC460(EnOwl* this) {
if (SkelAnime_Update(this->curSkelAnime) != 0) {
if (SkelAnime_Update(this->curSkelAnime)) {
if (this->unk_3FE > 0) {
this->unk_3FE--;
Animation_Change(this->curSkelAnime, this->curSkelAnime->animation, 1.0f, 0.0f,
Animation_GetLastFrame(this->curSkelAnime->animation), 2, 0.0f);
Animation_GetLastFrame(this->curSkelAnime->animation), ANIMMODE_ONCE, 0.0f);
} else {
this->unk_3FE = 0xA0;
this->unk_410 = func_80ACC390;
Animation_Change(this->curSkelAnime, &D_0600C1C4, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600C1C4), 0, 5.0f);
Animation_Change(this->curSkelAnime, &D_0600C1C4, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600C1C4),
ANIMMODE_LOOP, 5.0f);
}
}
}
void func_80ACC540(EnOwl* this) {
if (SkelAnime_Update(this->curSkelAnime) != 0) {
if (SkelAnime_Update(this->curSkelAnime)) {
Animation_Change(this->curSkelAnime, this->curSkelAnime->animation, 1.0f, 0.0f,
Animation_GetLastFrame(this->curSkelAnime->animation), 2, 0.0f);
Animation_GetLastFrame(this->curSkelAnime->animation), ANIMMODE_ONCE, 0.0f);
this->actionFlags |= 1;
} else {
this->actionFlags &= ~1;
@ -1066,10 +1052,7 @@ void func_80ACC540(EnOwl* this) {
}
s32 func_80ACC5CC(EnOwl* this) {
s32 phi_v1;
s32 ret;
phi_v1 = (this->actionFlags & 2) ? 0x20 : 0;
s32 phi_v1 = (this->actionFlags & 2) ? 0x20 : 0;
if (phi_v1 == (this->unk_3EE & 0x3F)) {
return true;
@ -1316,7 +1299,7 @@ s32 EnOwl_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** gfx, V
default:
break;
}
return 0;
return false;
}
void EnOwl_PostLimbUpdate(GlobalContext* globalCtx, s32 limbIndex, Gfx** gfx, Vec3s* rot, void* thisx) {
@ -1352,9 +1335,10 @@ void EnOwl_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
void EnOwl_ChangeMode(EnOwl* this, EnOwlActionFunc actionFunc, OwlFunc arg2, SkelAnime* skelAnime,
AnimationHeader* animation, f32 transitionRate) {
AnimationHeader* animation, f32 morphFrames) {
this->curSkelAnime = skelAnime;
Animation_Change(this->curSkelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), 2, transitionRate);
Animation_Change(this->curSkelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE,
morphFrames);
this->actionFunc = actionFunc;
this->unk_410 = arg2;
}
@ -1371,13 +1355,10 @@ void func_80ACD130(EnOwl* this, GlobalContext* globalCtx, s32 idx) {
}
f32 func_80ACD1C4(GlobalContext* globalCtx, s32 idx) {
f32 ret;
f32 ret = func_8006F93C(globalCtx->csCtx.npcActions[idx]->endFrame, globalCtx->csCtx.npcActions[idx]->startFrame,
globalCtx->csCtx.frames);
ret = func_8006F93C(globalCtx->csCtx.npcActions[idx]->endFrame, globalCtx->csCtx.npcActions[idx]->startFrame,
globalCtx->csCtx.frames);
if (ret > 1.0f) {
ret = 1.0f;
}
ret = CLAMP_MAX(ret, 1.0f);
return ret;
}
@ -1397,10 +1378,8 @@ void func_80ACD220(EnOwl* this, Vec3f* arg1, f32 arg2) {
void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) {
Vec3f pos;
s32 angle;
f32 t;
f32 phi_f2;
f32 t = func_80ACD1C4(globalCtx, 7);
t = func_80ACD1C4(globalCtx, 7);
pos.x = globalCtx->csCtx.npcActions[7]->startPos.x;
pos.y = globalCtx->csCtx.npcActions[7]->startPos.y;
pos.z = globalCtx->csCtx.npcActions[7]->startPos.z;
@ -1411,7 +1390,8 @@ void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) {
angle = (s16)((t * angle) + this->actor.world.rot.z);
angle = (u16)angle;
if (this->actionFlags & 4) {
phi_f2 = globalCtx->csCtx.npcActions[7]->urot.x;
f32 phi_f2 = globalCtx->csCtx.npcActions[7]->urot.x;
phi_f2 *= 10.0f * (360.0f / 0x10000);
if (phi_f2 < 0.0f) {
phi_f2 += 360.0f;
@ -1423,27 +1403,24 @@ void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) {
this->actor.draw = &EnOwl_Draw;
this->actionFlags &= ~4;
this->actor.speedXZ = 0.0f;
return;
} else {
pos.x -= Math_SinS(angle) * this->unk_3F8;
pos.z += Math_CosS(angle) * this->unk_3F8;
func_80ACD220(this, &pos, 1.0f);
}
pos.x -= Math_SinS(angle) * this->unk_3F8;
pos.z += Math_CosS(angle) * this->unk_3F8;
func_80ACD220(this, &pos, 1.0f);
}
void func_80ACD4D4(EnOwl* this, GlobalContext* globalCtx) {
Vec3f pos;
Vec3f endPosf;
f32 temp_ret;
CsCmdActorAction* actorCmd;
f32 temp_ret = func_80ACD1C4(globalCtx, 7);
temp_ret = func_80ACD1C4(globalCtx, 7);
pos.x = globalCtx->csCtx.npcActions[7]->startPos.x;
pos.y = globalCtx->csCtx.npcActions[7]->startPos.y;
pos.z = globalCtx->csCtx.npcActions[7]->startPos.z;
actorCmd = globalCtx->csCtx.npcActions[7];
endPosf.x = actorCmd->endPos.x;
endPosf.y = actorCmd->endPos.y;
endPosf.z = actorCmd->endPos.z;
endPosf.x = globalCtx->csCtx.npcActions[7]->endPos.x;
endPosf.y = globalCtx->csCtx.npcActions[7]->endPos.y;
endPosf.z = globalCtx->csCtx.npcActions[7]->endPos.z;
pos.x = (endPosf.x - pos.x) * temp_ret + pos.x;
pos.y = (endPosf.y - pos.y) * temp_ret + pos.y;
pos.z = (endPosf.z - pos.z) * temp_ret + pos.z;

View file

@ -9052,8 +9052,8 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) {
0x4000) &&
((globalCtx->sceneNum != SCENE_DDAN) || (gSaveContext.eventChkInf[11] & 1)) &&
((globalCtx->sceneNum != SCENE_NIGHT_SHOP) || (gSaveContext.eventChkInf[2] & 0x20))) {
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, this->giObjectSegment, 160, 120,
144, 24, 20);
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, this->giObjectSegment, 160, 120, 144,
24, 20);
}
}
gSaveContext.showTitleCard = true;