1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-29 08:16:11 +00:00

Improve Matches: Part 4 (#1545)

* more improvements

* small cleanup

* PR Review
This commit is contained in:
engineer124 2023-09-25 01:51:03 +10:00 committed by GitHub
parent fefeb369dd
commit 873c55faad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 421 additions and 408 deletions

View file

@ -200,50 +200,54 @@ void ArrowFire_Draw(Actor* thisx, PlayState* play2) {
stateFrames = play->state.frames; stateFrames = play->state.frames;
arrow = (EnArrow*)this->actor.parent; arrow = (EnArrow*)this->actor.parent;
if (1) {}
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {
if (1) {}
transform = (arrow->hitFlags & 2) ? &this->actor : &arrow->actor;
OPEN_DISPS(play->state.gfxCtx, "../z_arrow_fire.c", 618);
Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(BINANG_TO_RAD(transform->shape.rot.y), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD(transform->shape.rot.x), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD(transform->shape.rot.z), MTXMODE_APPLY);
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
// Draw red effect over the screen when arrow hits
if (this->unk_15C > 0) {
POLY_XLU_DISP = Gfx_SetupDL_57(POLY_XLU_DISP);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0, 0,
(s32)(150.0f * this->unk_15C) & 0xFF);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
}
// Draw fire on the arrow if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); return;
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, this->alpha); }
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128);
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY); if (this->timer >= 255) {
if (this->timer != 0) { return;
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); }
} else {
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY); transform = (arrow->hitFlags & 2) ? &this->actor : &arrow->actor;
}
Matrix_Scale(this->radius * 0.2f, this->unk_158 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY); OPEN_DISPS(play->state.gfxCtx, "../z_arrow_fire.c", 618);
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_arrow_fire.c", 666), Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Matrix_RotateY(BINANG_TO_RAD(transform->shape.rot.y), MTXMODE_APPLY);
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL); Matrix_RotateX(BINANG_TO_RAD(transform->shape.rot.x), MTXMODE_APPLY);
gSPDisplayList(POLY_XLU_DISP++, Matrix_RotateZ(BINANG_TO_RAD(transform->shape.rot.z), MTXMODE_APPLY);
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 255 - (stateFrames * 2) % 256, 0, 64, 32, Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
1, 255 - stateFrames % 256, 511 - (stateFrames * 10) % 512, 64, 64));
gSPDisplayList(POLY_XLU_DISP++, sModelDL); // Draw red effect over the screen when arrow hits
if (this->unk_15C > 0) {
CLOSE_DISPS(play->state.gfxCtx, "../z_arrow_fire.c", 682); POLY_XLU_DISP = Gfx_SetupDL_57(POLY_XLU_DISP);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0, 0,
(s32)(150.0f * this->unk_15C) & 0xFF);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
}
// Draw fire on the arrow
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128);
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY);
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
} else {
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
} }
Matrix_Scale(this->radius * 0.2f, this->unk_158 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY);
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_arrow_fire.c", 666),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL);
gSPDisplayList(POLY_XLU_DISP++,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 255 - (stateFrames * 2) % 256, 0, 64, 32, 1,
255 - stateFrames % 256, 511 - (stateFrames * 10) % 512, 64, 64));
gSPDisplayList(POLY_XLU_DISP++, sModelDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_arrow_fire.c", 682);
} }

View file

@ -199,50 +199,53 @@ void ArrowIce_Draw(Actor* thisx, PlayState* play) {
u32 stateFrames = play->state.frames; u32 stateFrames = play->state.frames;
EnArrow* arrow = (EnArrow*)this->actor.parent; EnArrow* arrow = (EnArrow*)this->actor.parent;
if (1) {} if ((arrow == NULL) || (arrow->actor.update == NULL)) {
return;
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { }
if (1) {}
transform = (arrow->hitFlags & 2) ? &this->actor : &arrow->actor;
OPEN_DISPS(play->state.gfxCtx, "../z_arrow_ice.c", 610);
Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(BINANG_TO_RAD(transform->shape.rot.y), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD(transform->shape.rot.x), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD(transform->shape.rot.z), MTXMODE_APPLY);
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
// Draw blue effect over the screen when arrow hits
if (this->unk_164 > 0) {
POLY_XLU_DISP = Gfx_SetupDL_57(POLY_XLU_DISP);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF,
(s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
}
// Draw ice on the arrow if (this->timer >= 255) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); return;
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, this->alpha); }
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128);
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY); transform = (arrow->hitFlags & 2) ? &this->actor : &arrow->actor;
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); OPEN_DISPS(play->state.gfxCtx, "../z_arrow_ice.c", 610);
} else {
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
} Matrix_RotateY(BINANG_TO_RAD(transform->shape.rot.y), MTXMODE_APPLY);
Matrix_Scale(this->radius * 0.2f, this->unk_160 * 3.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD(transform->shape.rot.x), MTXMODE_APPLY);
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD(transform->shape.rot.z), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_arrow_ice.c", 660), Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL); // Draw blue effect over the screen when arrow hits
gSPDisplayList(POLY_XLU_DISP++, if (this->unk_164 > 0) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 511 - (stateFrames * 5) % 512, 0, 128, 32, POLY_XLU_DISP = Gfx_SetupDL_57(POLY_XLU_DISP);
1, 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF,
gSPDisplayList(POLY_XLU_DISP++, sModelDL); (s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
CLOSE_DISPS(play->state.gfxCtx, "../z_arrow_ice.c", 676); gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
}
// Draw ice on the arrow
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128);
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY);
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
} else {
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
} }
Matrix_Scale(this->radius * 0.2f, this->unk_160 * 3.0f, this->radius * 0.2f, MTXMODE_APPLY);
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_arrow_ice.c", 660),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL);
gSPDisplayList(POLY_XLU_DISP++,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1,
511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16));
gSPDisplayList(POLY_XLU_DISP++, sModelDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_arrow_ice.c", 676);
} }

View file

@ -197,50 +197,53 @@ void ArrowLight_Draw(Actor* thisx, PlayState* play) {
EnArrow* arrow = (EnArrow*)this->actor.parent; EnArrow* arrow = (EnArrow*)this->actor.parent;
Actor* transform; Actor* transform;
if (1) {} if ((arrow == NULL) || (arrow->actor.update == NULL)) {
return;
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { }
if (1) {}
transform = (arrow->hitFlags & 2) ? &this->actor : &arrow->actor;
OPEN_DISPS(play->state.gfxCtx, "../z_arrow_light.c", 598);
Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(BINANG_TO_RAD(transform->shape.rot.y), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD(transform->shape.rot.x), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD(transform->shape.rot.z), MTXMODE_APPLY);
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
// Draw yellow effect over the screen when arrow hits
if (this->unk_164 > 0) {
POLY_XLU_DISP = Gfx_SetupDL_57(POLY_XLU_DISP);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF,
(s32)(40.0f * this->unk_164) & 0xFF, 0, (s32)(150.0f * this->unk_164) & 0xFF);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
}
// Draw light on the arrow if (this->timer >= 255) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); return;
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->alpha); }
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 128);
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY); transform = (arrow->hitFlags & 2) ? &this->actor : &arrow->actor;
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); OPEN_DISPS(play->state.gfxCtx, "../z_arrow_light.c", 598);
} else {
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
} Matrix_RotateY(BINANG_TO_RAD(transform->shape.rot.y), MTXMODE_APPLY);
Matrix_Scale(this->radius * 0.2f, this->unk_160 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD(transform->shape.rot.x), MTXMODE_APPLY);
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD(transform->shape.rot.z), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_arrow_light.c", 648), Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL); // Draw yellow effect over the screen when arrow hits
gSPDisplayList(POLY_XLU_DISP++, if (this->unk_164 > 0) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1, POLY_XLU_DISP = Gfx_SetupDL_57(POLY_XLU_DISP);
511 - (stateFrames * 10) % 512, 511 - (stateFrames * 30) % 512, 8, 16)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF, (s32)(40.0f * this->unk_164) & 0xFF,
gSPDisplayList(POLY_XLU_DISP++, sModelDL); 0, (s32)(150.0f * this->unk_164) & 0xFF);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
CLOSE_DISPS(play->state.gfxCtx, "../z_arrow_light.c", 664); gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
}
// Draw light on the arrow
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 128);
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY);
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
} else {
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
} }
Matrix_Scale(this->radius * 0.2f, this->unk_160 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY);
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_arrow_light.c", 648),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL);
gSPDisplayList(POLY_XLU_DISP++,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1,
511 - (stateFrames * 10) % 512, 511 - (stateFrames * 30) % 512, 8, 16));
gSPDisplayList(POLY_XLU_DISP++, sModelDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_arrow_light.c", 664);
} }

View file

@ -100,10 +100,11 @@ void BgGndDarkmeiro_Destroy(Actor* thisx, PlayState* play2) {
PlayState* play = play2; PlayState* play = play2;
BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx; BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx;
if ((this->dyna.actor.params & 0xFF) == 1) { if ((this->dyna.actor.params & 0xFF) != 1) {
if (1) {} return;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
} }
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
} }
void BgGndDarkmeiro_Noop(BgGndDarkmeiro* this, PlayState* play) { void BgGndDarkmeiro_Noop(BgGndDarkmeiro* this, PlayState* play) {

View file

@ -51,10 +51,11 @@ void BgGndFiremeiro_Destroy(Actor* thisx, PlayState* play2) {
PlayState* play = play2; PlayState* play = play2;
BgGndFiremeiro* this = (BgGndFiremeiro*)thisx; BgGndFiremeiro* this = (BgGndFiremeiro*)thisx;
if (this->dyna.actor.params == 0) { if (this->dyna.actor.params != 0) {
if (1) {} return;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
} }
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
} }
void BgGndFiremeiro_Sink(BgGndFiremeiro* this, PlayState* play) { void BgGndFiremeiro_Sink(BgGndFiremeiro* this, PlayState* play) {

View file

@ -298,15 +298,16 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
z = (88.0f - spBC.z) * 0.64f + 0.5f; z = (88.0f - spBC.z) * 0.64f + 0.5f;
for (k = 0; k < 11; k++) { for (k = 0; k < 11; k++) {
temp_z = z - 5 + k; temp_z = z - 5 + k;
if (!(temp_z & ~0x3F)) { if (temp_z & ~0x3F) {
temp_z *= 0x40; continue;
for (l = 0; l < 11; l++) { }
temp_x = x - 5 + l; temp_z *= 0x40;
if (!(temp_x & ~0x3F)) { for (l = 0; l < 11; l++) {
shadowTex[temp_z + temp_x] |= D_8089731C[k][l]; temp_x = x - 5 + l;
} if (temp_x & ~0x3F) {
if (1) {} continue;
} }
shadowTex[temp_z + temp_x] |= D_8089731C[k][l];
} }
} }
} }
@ -326,14 +327,16 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
z = (s32)(((88.0f - spBC.z) * 0.64f) + 0.5f); z = (s32)(((88.0f - spBC.z) * 0.64f) + 0.5f);
for (k = 0; k < 3; k++) { for (k = 0; k < 3; k++) {
temp_z = z - 1 + k; temp_z = z - 1 + k;
if (!(temp_z & ~0x3F)) { if (temp_z & ~0x3F) {
temp_z *= 0x40; continue;
for (l = 0; l < 3; l++) { }
temp_x = x - 1 + l; temp_z *= 0x40;
if (!(temp_x & ~0x3F)) { for (l = 0; l < 3; l++) {
shadowTex[temp_z + temp_x] |= D_80897398[k][l]; temp_x = x - 1 + l;
} if (temp_x & ~0x3F) {
continue;
} }
shadowTex[temp_z + temp_x] |= D_80897398[k][l];
} }
} }
} }
@ -348,7 +351,6 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
shadowTex[j * 0x40 + 0] = 0; shadowTex[j * 0x40 + 0] = 0;
shadowTex[j * 0x40 + 0x3F] = 0; shadowTex[j * 0x40 + 0x3F] = 0;
} }
if (D_80897398[0][0]) {}
} }
/* /*

View file

@ -137,23 +137,19 @@ void BgSpot00Hanebasi_Destroy(Actor* thisx, PlayState* play) {
void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, PlayState* play) { void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, PlayState* play) {
BgSpot00Hanebasi* child = (BgSpot00Hanebasi*)this->dyna.actor.child; BgSpot00Hanebasi* child = (BgSpot00Hanebasi*)this->dyna.actor.child;
if (IS_CUTSCENE_LAYER || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || if (!IS_CUTSCENE_LAYER && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
!CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) || GET_EVENTCHKINF(EVENTCHKINF_80)) { CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !GET_EVENTCHKINF(EVENTCHKINF_80)) {
if (this->dyna.actor.shape.rot.x != 0) { return;
if (CutsceneFlags_Get(play, 0) || (!IS_CUTSCENE_LAYER && IS_DAY)) { }
this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall;
this->destAngle = 0;
child->destAngle = 0;
return;
}
if (this) {} // required to match if ((this->dyna.actor.shape.rot.x != 0) && (CutsceneFlags_Get(play, 0) || (!IS_CUTSCENE_LAYER && IS_DAY))) {
} this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall;
if ((this->dyna.actor.shape.rot.x == 0) && !IS_CUTSCENE_LAYER && !LINK_IS_ADULT && !IS_DAY) { this->destAngle = 0;
this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall; child->destAngle = 0;
this->destAngle = -0x4000; } else if ((this->dyna.actor.shape.rot.x == 0) && !IS_CUTSCENE_LAYER && !LINK_IS_ADULT && !IS_DAY) {
child->destAngle = -0xFE0; this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall;
} this->destAngle = -0x4000;
child->destAngle = -0xFE0;
} }
} }

View file

@ -932,7 +932,6 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) {
} else if (this->unk_224 > 1.7f) { } else if (this->unk_224 > 1.7f) {
phi_s0_3 = 3; phi_s0_3 = 3;
sp90 = 1; sp90 = 1;
if (play) {}
magma2DrawMode = 0; magma2DrawMode = 0;
} else if (this->unk_224 > 1.4f) { } else if (this->unk_224 > 1.4f) {
phi_s0_3 = 7; phi_s0_3 = 7;
@ -1025,9 +1024,10 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) {
this->collider.elements[0].dim.scale = (this->actionFunc == BossDodongo_Inhale) ? 0.0f : 1.0f; this->collider.elements[0].dim.scale = (this->actionFunc == BossDodongo_Inhale) ? 0.0f : 1.0f;
for (i = 6; i < 19; i++) { for (i = 6; i < 19; i++) {
if (i != 12) { if (i == 12) {
this->collider.elements[i].dim.scale = (this->actionFunc == BossDodongo_Roll) ? 0.0f : 1.0f; continue;
} }
this->collider.elements[i].dim.scale = (this->actionFunc == BossDodongo_Roll) ? 0.0f : 1.0f;
} }
if (this->unk_244 != 0) { if (this->unk_244 != 0) {

View file

@ -1914,8 +1914,6 @@ void BossGoma_Update(Actor* thisx, PlayState* play) {
this->sfxFaintTimer--; this->sfxFaintTimer--;
} }
if (1) {}
this->eyeState = EYESTATE_IRIS_FOLLOW_BONUS_IFRAMES; this->eyeState = EYESTATE_IRIS_FOLLOW_BONUS_IFRAMES;
this->actionFunc(this, play); this->actionFunc(this, play);
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
@ -1937,15 +1935,17 @@ void BossGoma_Update(Actor* thisx, PlayState* play) {
BossGoma_UpdateEyeEnvColor(this); BossGoma_UpdateEyeEnvColor(this);
BossGoma_UpdateTailLimbsScale(this); BossGoma_UpdateTailLimbsScale(this);
if (!this->disableGameplayLogic) { if (this->disableGameplayLogic) {
BossGoma_UpdateHit(this, play); return;
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); }
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if (this->actionFunc != BossGoma_FloorStunned && this->actionFunc != BossGoma_FloorDamaged && BossGoma_UpdateHit(this, play);
(this->actionFunc != BossGoma_FloorMain || this->timer == 0)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
if (this->actionFunc != BossGoma_FloorStunned && this->actionFunc != BossGoma_FloorDamaged &&
(this->actionFunc != BossGoma_FloorMain || this->timer == 0)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
} }
} }

View file

@ -920,7 +920,6 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f); Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f);
for (indS1 = 0; indS1 < 40; indS1++) { for (indS1 = 0; indS1 < 40; indS1++) {
if (sMorphaTent2->tentSpawnPos) {}
indT5 = Rand_ZeroFloat(20.9f); indT5 = Rand_ZeroFloat(20.9f);
indS0 = sTentSpawnIndex[indT5]; indS0 = sTentSpawnIndex[indT5];
spFC.x = 0; spFC.x = 0;
@ -930,16 +929,17 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
Matrix_MultVec3f(&spFC, &spF0); Matrix_MultVec3f(&spFC, &spF0);
spF0.x = player->actor.world.pos.x + spF0.x; spF0.x = player->actor.world.pos.x + spF0.x;
spF0.z = player->actor.world.pos.z + spF0.z; spF0.z = player->actor.world.pos.z + spF0.z;
if ((fabsf(spF0.x - sTentSpawnPos[indS0].x) <= 320) && if (!(fabsf(spF0.x - sTentSpawnPos[indS0].x) <= 320) ||
(fabsf(spF0.z - sTentSpawnPos[indS0].y) <= 320) && !(fabsf(spF0.z - sTentSpawnPos[indS0].y) <= 320) ||
((sMorphaTent2 == NULL) || (sMorphaTent2->tentSpawnPos != indS0))) { ((sMorphaTent2 != NULL) && (sMorphaTent2->tentSpawnPos == indS0))) {
this->targetPos.x = sTentSpawnPos[indS0].x; continue;
this->targetPos.z = sTentSpawnPos[indS0].y;
this->tentSpawnPos = indS0;
this->timers[0] = (s16)Rand_ZeroFloat(20.0f) + 30;
this->work[MO_TENT_ACTION_STATE] = MO_TENT_DESPAWN;
break;
} }
this->targetPos.x = sTentSpawnPos[indS0].x;
this->targetPos.z = sTentSpawnPos[indS0].y;
this->tentSpawnPos = indS0;
this->timers[0] = (s16)Rand_ZeroFloat(20.0f) + 30;
this->work[MO_TENT_ACTION_STATE] = MO_TENT_DESPAWN;
break;
} }
} }
if ((this == sMorphaTent1) && (sMorphaCore->hitCount >= 3) && (sMorphaTent2 == NULL)) { if ((this == sMorphaTent1) && (sMorphaCore->hitCount >= 3) && (sMorphaTent2 == NULL)) {

View file

@ -2863,9 +2863,6 @@ void BossTw_Update(Actor* thisx, PlayState* play) {
this->blastTailPos[this->work[TAIL_IDX]] = this->actor.world.pos; this->blastTailPos[this->work[TAIL_IDX]] = this->actor.world.pos;
if (1) {}
if (1) {}
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (this->timers[i] != 0) { if (this->timers[i] != 0) {
this->timers[i]--; this->timers[i]--;
@ -2890,68 +2887,62 @@ void BossTw_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play); this->actionFunc(this, play);
if (this->actionFunc != BossTw_Wait) { if (this->actionFunc == BossTw_Wait) {
this->collider.dim.radius = 45; return;
}
if (this->actionFunc == BossTw_Spin) { this->collider.dim.radius = 45;
this->collider.dim.radius *= 2;
}
this->collider.dim.height = 120; if (this->actionFunc == BossTw_Spin) {
this->collider.dim.yShift = -30; this->collider.dim.radius *= 2;
}
if (this->work[INVINC_TIMER] == 0) { this->collider.dim.height = 120;
if (this->collider.base.acFlags & AC_HIT) { this->collider.dim.yShift = -30;
this->collider.base.acFlags &= ~AC_HIT;
}
Collider_UpdateCylinder(&this->actor, &this->collider); if (this->work[INVINC_TIMER] == 0) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); if (this->collider.base.acFlags & AC_HIT) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); this->collider.base.acFlags &= ~AC_HIT;
} }
if (this->actor.params == TW_KOTAKE) { Collider_UpdateCylinder(&this->actor, &this->collider);
this->workf[OUTR_CRWN_TX_X2] += 1.0f; CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
this->workf[OUTR_CRWN_TX_Y2] -= 7.0f; CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
this->workf[INNR_CRWN_TX_Y1] += 1.0f; }
} else {
this->workf[OUTR_CRWN_TX_X2] += 0.0f;
this->workf[INNR_CRWN_TX_X2] += 0.0f;
this->workf[OUTR_CRWN_TX_Y2] += -15.0f;
this->workf[INNR_CRWN_TX_Y2] += -10.0f;
}
if (((this->work[CS_TIMER_2] % 32) == 0) && (Rand_ZeroOne() < 0.3f)) { if (this->actor.params == TW_KOTAKE) {
this->work[BLINK_IDX] = 4; this->workf[OUTR_CRWN_TX_X2] += 1.0f;
} this->workf[OUTR_CRWN_TX_Y2] -= 7.0f;
this->workf[INNR_CRWN_TX_Y1] += 1.0f;
} else {
this->workf[OUTR_CRWN_TX_X2] += 0.0f;
this->workf[INNR_CRWN_TX_X2] += 0.0f;
this->workf[OUTR_CRWN_TX_Y2] += -15.0f;
this->workf[INNR_CRWN_TX_Y2] += -10.0f;
}
this->eyeTexIdx = D_8094A900[this->work[BLINK_IDX]]; if (((this->work[CS_TIMER_2] % 32) == 0) && (Rand_ZeroOne() < 0.3f)) {
this->work[BLINK_IDX] = 4;
}
if (this->work[BLINK_IDX] != 0) { this->eyeTexIdx = D_8094A900[this->work[BLINK_IDX]];
this->work[BLINK_IDX]--;
}
if (this->actionFunc != BossTw_MergeCS && this->unk_5F8 != 0) { if (this->work[BLINK_IDX] != 0) {
Vec3f pos; this->work[BLINK_IDX]--;
Vec3f velocity = { 0.0f, 0.0f, 0.0f }; }
Vec3f accel = { 0.0f, 0.0f, 0.0f };
if (this->scepterAlpha > 0.0f) { if ((this->actionFunc == BossTw_MergeCS) || (this->unk_5F8 == 0)) {
for (i = 0; i <= 0; i++) { return;
pos = this->scepterFlamePos[0]; }
pos.x += Rand_CenteredFloat(70.0f);
pos.y += Rand_CenteredFloat(70.0f); {
pos.z += Rand_CenteredFloat(70.0f); Vec3f pos;
accel.y = 0.4f; Vec3f velocity = { 0.0f, 0.0f, 0.0f };
accel.x = Rand_CenteredFloat(0.5f); Vec3f accel = { 0.0f, 0.0f, 0.0f };
accel.z = Rand_CenteredFloat(0.5f);
BossTw_AddDotEffect(play, &pos, &velocity, &accel, (s16)Rand_ZeroFloat(2.0f) + 8,
this->actor.params, 37);
}
}
if (this->scepterAlpha > 0.0f) {
for (i = 0; i <= 0; i++) { for (i = 0; i <= 0; i++) {
pos = this->crownPos; pos = this->scepterFlamePos[0];
pos.x += Rand_CenteredFloat(70.0f); pos.x += Rand_CenteredFloat(70.0f);
pos.y += Rand_CenteredFloat(70.0f); pos.y += Rand_CenteredFloat(70.0f);
pos.z += Rand_CenteredFloat(70.0f); pos.z += Rand_CenteredFloat(70.0f);
@ -2962,6 +2953,17 @@ void BossTw_Update(Actor* thisx, PlayState* play) {
37); 37);
} }
} }
for (i = 0; i <= 0; i++) {
pos = this->crownPos;
pos.x += Rand_CenteredFloat(70.0f);
pos.y += Rand_CenteredFloat(70.0f);
pos.z += Rand_CenteredFloat(70.0f);
accel.y = 0.4f;
accel.x = Rand_CenteredFloat(0.5f);
accel.z = Rand_CenteredFloat(0.5f);
BossTw_AddDotEffect(play, &pos, &velocity, &accel, (s16)Rand_ZeroFloat(2.0f) + 8, this->actor.params, 37);
}
} }
} }

View file

@ -3285,201 +3285,202 @@ void BossVa_UpdateEffects(PlayState* play) {
BossVa* refActor; BossVa* refActor;
for (i = 0; i < BOSS_VA_EFFECT_COUNT; i++, effect++) { for (i = 0; i < BOSS_VA_EFFECT_COUNT; i++, effect++) {
if (effect->type != VA_NONE) { if (effect->type == VA_NONE) {
effect->timer--; continue;
}
effect->pos.x += effect->velocity.x;
effect->pos.y += effect->velocity.y;
effect->pos.z += effect->velocity.z;
effect->velocity.x += effect->accel.x;
effect->velocity.y += effect->accel.y;
effect->velocity.z += effect->accel.z;
if ((effect->type == VA_LARGE_SPARK) || (effect->type == VA_SMALL_SPARK)) {
refActor = effect->parent;
effect->rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x2000;
effect->rot.y += (s16)(Rand_ZeroOne() * 0x2710) + 0x2000;
if ((effect->mode == SPARK_TETHER) || (effect->mode == SPARK_UNUSED)) {
pitch = effect->rot.x - Math_Vec3f_Pitch(&refActor->actor.world.pos, &GET_BODY(refActor)->unk_1D8);
spAC = Math_SinS(refActor->actor.world.rot.y);
effect->pos.x = refActor->actor.world.pos.x - (effect->offset.x * spAC);
spB0 = Math_CosS(refActor->actor.world.rot.y);
effect->pos.z = refActor->actor.world.pos.z - (effect->offset.x * spB0);
spB0 = Math_CosS(-pitch);
effect->pos.y = (effect->offset.y * spB0) + refActor->actor.world.pos.y;
} else if ((effect->mode == SPARK_BARI) || (effect->mode == SPARK_BODY)) {
effect->pos.x = effect->offset.x + refActor->actor.world.pos.x;
effect->pos.y = effect->offset.y + refActor->actor.world.pos.y;
effect->pos.z = effect->offset.z + refActor->actor.world.pos.z;
} else {
spB6 = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
effect->pos.x = player->bodyPartsPos[spB6].x + Rand_CenteredFloat(10.0f);
effect->pos.y = player->bodyPartsPos[spB6].y + Rand_CenteredFloat(15.0f);
effect->pos.z = player->bodyPartsPos[spB6].z + Rand_CenteredFloat(10.0f);
}
if (effect->timer < 100) { effect->timer--;
effect->primColor[3] -= 50;
if (effect->primColor[3] < 0) { effect->pos.x += effect->velocity.x;
effect->primColor[3] = 0; effect->pos.y += effect->velocity.y;
effect->timer = 0; effect->pos.z += effect->velocity.z;
effect->type = VA_NONE;
} effect->velocity.x += effect->accel.x;
} effect->velocity.y += effect->accel.y;
effect->velocity.z += effect->accel.z;
if ((effect->type == VA_LARGE_SPARK) || (effect->type == VA_SMALL_SPARK)) {
refActor = effect->parent;
effect->rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x2000;
effect->rot.y += (s16)(Rand_ZeroOne() * 0x2710) + 0x2000;
if ((effect->mode == SPARK_TETHER) || (effect->mode == SPARK_UNUSED)) {
pitch = effect->rot.x - Math_Vec3f_Pitch(&refActor->actor.world.pos, &GET_BODY(refActor)->unk_1D8);
spAC = Math_SinS(refActor->actor.world.rot.y);
effect->pos.x = refActor->actor.world.pos.x - (effect->offset.x * spAC);
spB0 = Math_CosS(refActor->actor.world.rot.y);
effect->pos.z = refActor->actor.world.pos.z - (effect->offset.x * spB0);
spB0 = Math_CosS(-pitch);
effect->pos.y = (effect->offset.y * spB0) + refActor->actor.world.pos.y;
} else if ((effect->mode == SPARK_BARI) || (effect->mode == SPARK_BODY)) {
effect->pos.x = effect->offset.x + refActor->actor.world.pos.x;
effect->pos.y = effect->offset.y + refActor->actor.world.pos.y;
effect->pos.z = effect->offset.z + refActor->actor.world.pos.z;
} else {
spB6 = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
effect->pos.x = player->bodyPartsPos[spB6].x + Rand_CenteredFloat(10.0f);
effect->pos.y = player->bodyPartsPos[spB6].y + Rand_CenteredFloat(15.0f);
effect->pos.z = player->bodyPartsPos[spB6].z + Rand_CenteredFloat(10.0f);
} }
if (effect->type == VA_BLAST_SPARK) { if (effect->timer < 100) {
effect->rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x4000; effect->primColor[3] -= 50;
if (effect->timer < 100) { if (effect->primColor[3] < 0) {
effect->primColor[3] -= 50; effect->primColor[3] = 0;
if (effect->primColor[3] < 0) { effect->timer = 0;
effect->primColor[3] = 0; effect->type = VA_NONE;
effect->timer = 0;
effect->type = VA_NONE;
}
} }
} }
}
if (effect->type == VA_SPARK_BALL) { if (effect->type == VA_BLAST_SPARK) {
refActor2 = effect->parent; effect->rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x4000;
if (effect->timer < 100) {
effect->rot.z += (s16)(Rand_ZeroOne() * 0x2710) + 0x24A8; effect->primColor[3] -= 50;
effect->pos.x = effect->offset.x + refActor2->actor.world.pos.x; if (effect->primColor[3] < 0) {
effect->pos.y = effect->primColor[3] = 0;
refActor2->actor.world.pos.y + 310.0f + (refActor2->actor.shape.yOffset * refActor2->actor.scale.y); effect->timer = 0;
effect->pos.z = effect->offset.z + refActor2->actor.world.pos.z; effect->type = VA_NONE;
effect->mode = (effect->mode + 1) & 7;
if (effect->timer < 100) {
effect->primColor[3] -= 50;
if (effect->primColor[3] < 0) {
effect->primColor[3] = 0;
effect->timer = 0;
effect->type = VA_NONE;
}
} }
} }
}
if (effect->type == VA_ZAP_CHARGE) { if (effect->type == VA_SPARK_BALL) {
effect->mode = (effect->mode + 1) & 7; refActor2 = effect->parent;
effect->primColor[3] -= 20;
if (effect->primColor[3] <= 0) { effect->rot.z += (s16)(Rand_ZeroOne() * 0x2710) + 0x24A8;
effect->pos.x = effect->offset.x + refActor2->actor.world.pos.x;
effect->pos.y =
refActor2->actor.world.pos.y + 310.0f + (refActor2->actor.shape.yOffset * refActor2->actor.scale.y);
effect->pos.z = effect->offset.z + refActor2->actor.world.pos.z;
effect->mode = (effect->mode + 1) & 7;
if (effect->timer < 100) {
effect->primColor[3] -= 50;
if (effect->primColor[3] < 0) {
effect->primColor[3] = 0; effect->primColor[3] = 0;
effect->timer = 0; effect->timer = 0;
effect->type = VA_NONE; effect->type = VA_NONE;
} }
} }
}
if (effect->type == VA_BLOOD) { if (effect->type == VA_ZAP_CHARGE) {
if (effect->mode < BLOOD_SPOT) { effect->mode = (effect->mode + 1) & 7;
Vec3f checkPos; effect->primColor[3] -= 20;
CollisionPoly* groundPoly; if (effect->primColor[3] <= 0) {
f32 floorY; effect->primColor[3] = 0;
effect->timer = 0;
checkPos = effect->pos; effect->type = VA_NONE;
checkPos.y -= effect->velocity.y + 4.0f; }
floorY = BgCheck_EntityRaycastDown1(&play->colCtx, &groundPoly, &checkPos); }
if ((groundPoly != NULL) && (effect->pos.y <= floorY)) {
effect->mode = BLOOD_SPOT;
effect->pos.y = floorY + 1.0f;
if (sCsState <= DEATH_SHELL_BURST) {
effect->timer = 80;
} else {
effect->timer = 60000;
}
effect->accel = effect->velocity = sZeroVec; if (effect->type == VA_BLOOD) {
} if (effect->mode < BLOOD_SPOT) {
if (!effect->timer) { Vec3f checkPos;
effect->type = VA_NONE; CollisionPoly* groundPoly;
} f32 floorY;
} else {
if (effect->timer < 20) { checkPos = effect->pos;
effect->envColor[3] = effect->timer * 5; checkPos.y -= effect->velocity.y + 4.0f;
effect->primColor[3] = effect->timer * 10; floorY = BgCheck_EntityRaycastDown1(&play->colCtx, &groundPoly, &checkPos);
} else if (effect->timer > 50000) { if ((groundPoly != NULL) && (effect->pos.y <= floorY)) {
effect->timer++; effect->mode = BLOOD_SPOT;
effect->pos.y = floorY + 1.0f;
if (sCsState <= DEATH_SHELL_BURST) {
effect->timer = 80;
} else {
effect->timer = 60000;
} }
}
effect->accel = effect->velocity = sZeroVec;
}
if (!effect->timer) { if (!effect->timer) {
effect->type = VA_NONE; effect->type = VA_NONE;
} }
} else {
if (effect->timer < 20) {
effect->envColor[3] = effect->timer * 5;
effect->primColor[3] = effect->timer * 10;
} else if (effect->timer > 50000) {
effect->timer++;
}
} }
if (effect->type == VA_GORE) { if (!effect->timer) {
if (effect->mode == GORE_PERMANENT) { effect->type = VA_NONE;
Vec3f checkPos; }
CollisionPoly* groundPoly; }
f32 floorY;
checkPos = effect->pos;
checkPos.y -= effect->velocity.y + 4.0f;
effect->rot.x += 0x1770;
floorY = BgCheck_EntityRaycastDown1(&play->colCtx, &groundPoly, &checkPos);
if ((groundPoly != NULL) && (effect->pos.y <= floorY)) {
effect->mode = GORE_FLOOR;
effect->timer = 30;
effect->pos.y = floorY + 1.0f;
effect->accel = effect->velocity = sZeroVec;
effect->rot.x = -0x4000;
}
if (!effect->timer) { if (effect->type == VA_GORE) {
effect->type = VA_NONE; if (effect->mode == GORE_PERMANENT) {
} Vec3f checkPos;
CollisionPoly* groundPoly;
f32 floorY;
checkPos = effect->pos;
checkPos.y -= effect->velocity.y + 4.0f;
effect->rot.x += 0x1770;
floorY = BgCheck_EntityRaycastDown1(&play->colCtx, &groundPoly, &checkPos);
if ((groundPoly != NULL) && (effect->pos.y <= floorY)) {
effect->mode = GORE_FLOOR;
effect->timer = 30;
effect->pos.y = floorY + 1.0f;
effect->accel = effect->velocity = sZeroVec;
effect->rot.x = -0x4000;
}
} else if (effect->mode == GORE_FADING) { if (!effect->timer) {
if (effect->timer == 0) { effect->type = VA_NONE;
effect->type = VA_NONE; }
if (1) {}
}
} else { } else if (effect->mode == GORE_FADING) {
Math_SmoothStepToF(&effect->scaleMod, 0.075f, 1.0f, 0.005f, 0.0f); if (effect->timer == 0) {
Math_SmoothStepToF(&effect->vaGorePulseRate, 0.0f, 0.6f, 0.005f, 0.0013f); effect->type = VA_NONE;
if ((play->gameplayFrames % 4) == 0) { if (1) {}
Math_SmoothStepToS(&effect->primColor[0], 95, 1, 1, 0); }
}
} else {
Math_SmoothStepToF(&effect->scaleMod, 0.075f, 1.0f, 0.005f, 0.0f);
Math_SmoothStepToF(&effect->vaGorePulseRate, 0.0f, 0.6f, 0.005f, 0.0013f);
if ((play->gameplayFrames % 4) == 0) {
Math_SmoothStepToS(&effect->primColor[0], 95, 1, 1, 0);
} }
effect->vaGorePulse += effect->vaGorePulseRate;
} }
effect->vaGorePulse += effect->vaGorePulseRate;
}
if (effect->type == VA_TUMOR) { if (effect->type == VA_TUMOR) {
s16 yaw; s16 yaw;
refActor = effect->parent; refActor = effect->parent;
effect->rot.z += 0x157C; effect->rot.z += 0x157C;
effect->envColor[3] = (s16)(Math_SinS(effect->rot.z) * 50.0f) + 80; effect->envColor[3] = (s16)(Math_SinS(effect->rot.z) * 50.0f) + 80;
Math_SmoothStepToF(&effect->scale, effect->scaleMod, 1.0f, 0.01f, 0.005f); Math_SmoothStepToF(&effect->scale, effect->scaleMod, 1.0f, 0.01f, 0.005f);
effect->pos.x = effect->offset.x + refActor->actor.world.pos.x; effect->pos.x = effect->offset.x + refActor->actor.world.pos.x;
effect->pos.y = effect->offset.y + refActor->actor.world.pos.y; effect->pos.y = effect->offset.y + refActor->actor.world.pos.y;
effect->pos.z = effect->offset.z + refActor->actor.world.pos.z; effect->pos.z = effect->offset.z + refActor->actor.world.pos.z;
switch (effect->mode) { switch (effect->mode) {
case TUMOR_UNUSED: case TUMOR_UNUSED:
if (effect->timer == 0) { if (effect->timer == 0) {
yaw = Math_Vec3f_Yaw(&refActor->actor.world.pos, &effect->pos); yaw = Math_Vec3f_Yaw(&refActor->actor.world.pos, &effect->pos);
effect->type = VA_NONE; effect->type = VA_NONE;
BossVa_BloodSplatter(play, effect, yaw, effect->scale * 4500.0f, 1); BossVa_BloodSplatter(play, effect, yaw, effect->scale * 4500.0f, 1);
BossVa_Gore(play, effect, yaw, effect->scale * 1.2f); BossVa_Gore(play, effect, yaw, effect->scale * 1.2f);
} }
break; break;
case TUMOR_BODY: case TUMOR_BODY:
case TUMOR_ARM: case TUMOR_ARM:
if (refActor->burst) { if (refActor->burst) {
effect->type = VA_NONE; effect->type = VA_NONE;
yaw = Math_Vec3f_Yaw(&refActor->actor.world.pos, &effect->pos); yaw = Math_Vec3f_Yaw(&refActor->actor.world.pos, &effect->pos);
BossVa_BloodSplatter(play, effect, yaw, effect->scale * 4500.0f, 1); BossVa_BloodSplatter(play, effect, yaw, effect->scale * 4500.0f, 1);
BossVa_Gore(play, effect, yaw, effect->scale * 1.2f); BossVa_Gore(play, effect, yaw, effect->scale * 1.2f);
} }
break; break;
}
if (1) {}
} }
} }
} }