1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

Match En actors A-C, and a few more (#1890)

This commit is contained in:
cadmic 2024-02-24 10:00:37 -08:00 committed by GitHub
parent 7d128adf83
commit 10bae68937
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 112 additions and 80 deletions

View File

@ -456,12 +456,10 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, PlayState* play) {
}
void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) {
Player* player;
Actor_PlaySfx(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG);
if (DoorWarp1_PlayerInRange(this, play)) {
player = GET_PLAYER(play);
Player* player = GET_PLAYER(play);
Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
@ -830,12 +828,10 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) {
}
void DoorWarp1_Destination(DoorWarp1* this, PlayState* play) {
f32 alphaFrac;
f32 alphaFrac = 1.0f;
this->warpTimer++;
this->unk_194 = 5.0f;
alphaFrac = 1.0f;
this->warpTimer++;
if (this->warpTimer < 20) {
alphaFrac = this->warpTimer / 20.f;
} else if (this->warpTimer >= 60) {

View File

@ -273,19 +273,16 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
Gfx_SetupDL_25Opa(gfxCtx);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0);
initialPositions = this->initialPositions;
distanceTraveled = this->distanceTraveled;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0);
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
if (!(*distanceTraveled < 1.0f)) {
continue;
}
for (i = 0; i < 64; i++) {
if (*distanceTraveled < 1.0f) {
aux = 1.0f - SQ(*distanceTraveled);
Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))),
this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))),
@ -300,6 +297,10 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
}
initialPositions++;
distanceTraveled++;
}
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458);
}
@ -318,6 +319,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
Gfx_SetupDL_25Opa(gfxCtx);
gDPPipeSync(POLY_XLU_DISP++);
initialPositions = this->initialPositions;
distanceTraveled = this->distanceTraveled;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
if (player->unk_858 >= 0.85f) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
@ -325,16 +330,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0);
}
initialPositions = this->initialPositions;
distanceTraveled = this->distanceTraveled;
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
if (!(*distanceTraveled < 1.0f)) {
continue;
}
for (i = 0; i < 64; i++) {
if (*distanceTraveled < 1.0f) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
aux = 1.0f - SQ(*distanceTraveled);
@ -355,6 +354,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
}
initialPositions++;
distanceTraveled++;
}
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515);
}

View File

@ -13,7 +13,9 @@
void ElfMsg_Init(Actor* thisx, PlayState* play);
void ElfMsg_Destroy(Actor* thisx, PlayState* play);
void ElfMsg_Update(Actor* thisx, PlayState* play);
#if OOT_DEBUG
void ElfMsg_Draw(Actor* thisx, PlayState* play);
#endif
void ElfMsg_CallNaviCuboid(ElfMsg* this, PlayState* play);
void ElfMsg_CallNaviCylinder(ElfMsg* this, PlayState* play);
@ -27,7 +29,11 @@ ActorInit Elf_Msg_InitVars = {
/**/ ElfMsg_Init,
/**/ ElfMsg_Destroy,
/**/ ElfMsg_Update,
#if OOT_DEBUG
/**/ ElfMsg_Draw,
#else
/**/ NULL,
#endif
};
static InitChainEntry sInitChain[] = {
@ -163,6 +169,7 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) {
}
}
#if OOT_DEBUG
#include "assets/overlays/ovl_Elf_Msg/ovl_Elf_Msg.c"
void ElfMsg_Draw(Actor* thisx, PlayState* play) {
@ -191,3 +198,4 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg.c", 457);
}
#endif

View File

@ -12,7 +12,9 @@
void ElfMsg2_Init(Actor* thisx, PlayState* play);
void ElfMsg2_Destroy(Actor* thisx, PlayState* play);
void ElfMsg2_Update(Actor* thisx, PlayState* play);
#if OOT_DEBUG
void ElfMsg2_Draw(Actor* thisx, PlayState* play);
#endif
s32 ElfMsg2_GetMessageId(ElfMsg2* this);
void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play);
@ -27,7 +29,11 @@ ActorInit Elf_Msg2_InitVars = {
/**/ ElfMsg2_Init,
/**/ ElfMsg2_Destroy,
/**/ ElfMsg2_Update,
#if OOT_DEBUG
/**/ ElfMsg2_Draw,
#else
/**/ NULL,
#endif
};
static InitChainEntry sInitChain[] = {
@ -147,6 +153,7 @@ void ElfMsg2_Update(Actor* thisx, PlayState* play) {
}
}
#if OOT_DEBUG
#include "assets/overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.c"
void ElfMsg2_Draw(Actor* thisx, PlayState* play) {
@ -165,3 +172,4 @@ void ElfMsg2_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg2.c", 367);
}
#endif

View File

@ -782,7 +782,6 @@ void EnAm_TransformSwordHitbox(Actor* thisx, PlayState* play) {
void EnAm_UpdateDamage(EnAm* this, PlayState* play) {
s32 pad;
Vec3f sparkPos;
if (this->deathTimer == 0) {
if (this->blockCollider.base.acFlags & AC_BOUNCED) {
@ -810,7 +809,8 @@ void EnAm_UpdateDamage(EnAm* this, PlayState* play) {
this->dyna.actor.colChkInfo.health = 0;
}
} else if (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) {
sparkPos = this->dyna.actor.world.pos;
Vec3f sparkPos = this->dyna.actor.world.pos;
sparkPos.y += 50.0f;
CollisionCheck_SpawnShieldParticlesMetal(play, &sparkPos);
}
@ -836,8 +836,6 @@ void EnAm_Update(Actor* thisx, PlayState* play) {
EnBom* bomb;
Vec3f dustPos;
s32 i;
f32 dustPosScale;
s32 pad1;
if (this->dyna.actor.params != ARMOS_STATUE) {
EnAm_UpdateDamage(this, play);
@ -854,7 +852,8 @@ void EnAm_Update(Actor* thisx, PlayState* play) {
this->deathTimer--;
if (this->deathTimer == 0) {
dustPosScale = play->gameplayFrames * 10;
f32 dustPosScale = play->gameplayFrames * 10;
s32 pad1;
EnAm_SpawnEffects(this, play);
bomb =
@ -943,9 +942,9 @@ static Vec3f sIcePosOffsets[] = {
};
void EnAm_Draw(Actor* thisx, PlayState* play) {
s32 pad;
Vec3f sp68;
EnAm* this = (EnAm*)thisx;
Vec3f sp68;
s32 index;
OPEN_DISPS(play->state.gfxCtx, "../z_en_am.c", 1580);
@ -959,7 +958,6 @@ void EnAm_Draw(Actor* thisx, PlayState* play) {
this->iceTimer--;
if ((this->iceTimer % 4) == 0) {
s32 index;
index = this->iceTimer >> 2;

View File

@ -246,8 +246,6 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
s32 atTouched;
u16 sfxId;
Actor* hitActor;
Vec3f sp60;
Vec3f sp54;
if (DECR(this->timer) == 0) {
Actor_Kill(&this->actor);
@ -342,6 +340,9 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
if (this->hitActor != NULL) {
if (this->hitActor->update != NULL) {
Vec3f sp60;
Vec3f sp54;
Math_Vec3f_Sum(&this->unk_210, &this->unk_250, &sp60);
Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &sp54);

View File

@ -297,8 +297,6 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
EnAttackNiw* this = (EnAttackNiw*)thisx;
EnNiw* cucco;
Player* player = GET_PLAYER(play);
s32 pad;
Vec3f sp30;
PlayState* play2 = play;
this->unk_28C++;
@ -343,6 +341,9 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
}
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) {
Vec3f sp30;
s32 pad;
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
sp30.y += this->actor.yDistToWater;
EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190);

View File

@ -492,6 +492,7 @@ void EnBa_Draw(Actor* thisx, PlayState* play) {
Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY);
Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY);
if ((i == 6) || (i == 13)) {
if (mtx) {}
switch (i) {
case 13:
Collider_UpdateSpheres(i, &this->collider);

View File

@ -291,9 +291,10 @@ void EnBb_SpawnFlameTrail(PlayState* play, EnBb* this, s16 startAtZero) {
void EnBb_KillFlameTrail(EnBb* this) {
Actor* actor = &this->actor;
Actor* nextActor;
while (actor->child != NULL) {
Actor* nextActor = actor->child;
nextActor = actor->child;
if (nextActor->id == ACTOR_EN_BB) {
nextActor->parent = NULL;
@ -408,10 +409,10 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) {
void EnBb_SetupFlameTrail(EnBb* this) {
this->action = BB_FLAME_TRAIL;
this->moveMode = BBMOVE_NOCLIP;
this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
this->actor.speed = 0.0f;
this->actor.flags &= ~ACTOR_FLAG_0;
EnBb_SetupAction(this, EnBb_FlameTrail);
}

View File

@ -121,9 +121,7 @@ void func_809BC2A4(EnBdfire* this, PlayState* play) {
void func_809BC598(EnBdfire* this, PlayState* play) {
s16 quarterTurn;
Player* player = GET_PLAYER(play);
f32 distToBurn;
BossDodongo* bossDodongo;
s16 i;
bossDodongo = ((BossDodongo*)this->actor.parent);
this->unk_158 = bossDodongo->unk_1A2;
@ -164,8 +162,11 @@ void func_809BC598(EnBdfire* this, PlayState* play) {
return;
}
} else if (!player->bodyIsBurning) {
distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f;
f32 distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f;
if (this->actor.xyzDistToPlayerSq < SQ(distToBurn)) {
s16 i;
for (i = 0; i < 18; i++) {
player->bodyFlameTimers[i] = Rand_S16Offset(0, 200);
}

View File

@ -837,6 +837,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, temp_f0, temp_f0, temp_f0, 255);
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1945);
}
} else if (limbIndex == 10) {
@ -848,7 +849,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
}
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, intensity, intensity, intensity, intensity);
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1972);
} else if (limbIndex == 17 && this->actionFunc == func_809BE26C) {
if (this->unk_198 < 5) {

View File

@ -143,12 +143,12 @@ void EnBili_SetupFloatIdle(EnBili* this) {
this->actor.speed = 0.7f;
this->collider.elem.bumper.effect = 1; // Shock?
this->timer = 32;
this->collider.base.atFlags |= AT_ON;
this->collider.base.acFlags |= AC_ON;
this->actionFunc = EnBili_FloatIdle;
this->actor.home.pos.y = this->actor.world.pos.y;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->collider.base.atFlags |= AT_ON;
this->collider.base.acFlags |= AC_ON;
this->actionFunc = EnBili_FloatIdle;
}
/**

View File

@ -474,7 +474,7 @@ Gfx* EnBombf_NewMtxDList(GraphicsContext* gfxCtx, PlayState* play) {
Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(displayListHead++, MATRIX_NEW(gfxCtx, "../z_en_bombf.c", 1021),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPEndDisplayList(displayListHead);
gSPEndDisplayList(displayListHead++);
return displayList;
}
@ -482,8 +482,6 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) {
s32 pad;
EnBombf* this = (EnBombf*)thisx;
if (1) {}
OPEN_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1034);
if (thisx->params <= BOMBFLOWER_BODY) {
@ -510,5 +508,7 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) {
Collider_UpdateSpheres(0, &this->explosionCollider);
}
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1063);
}

View File

@ -272,5 +272,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gBoomerangRefDL);
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_boom.c", 604);
}

View File

@ -425,6 +425,8 @@ void EnBubble_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gBubbleDL);
}
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1226);
if (this->actionFunc != EnBubble_Disappear) {

View File

@ -859,7 +859,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) {
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
} else {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
Gfx_SetupDL_25Xlu(play2->state.gfxCtx);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->color1.a);
gDPSetEnvColor(POLY_XLU_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
@ -906,5 +906,8 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) {
EffectSsEnIce_SpawnFlyingVec3f(play, thisx, &icePos, 0x96, 0x96, 0x96, 0xFA, 0xEB, 0xF5, 0xFF, 1.3f);
}
}
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bw.c", 1521);
}

View File

@ -205,6 +205,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) {
s32 pad;
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx));
s16 i;
s16 off;
OPEN_DISPS(play->state.gfxCtx, "../z_en_bx.c", 464);
@ -226,7 +227,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) {
thisx->scale.z = thisx->scale.x = (Math_CosS(this->unk_14E) * 0.0075f) + 0.015f;
for (i = 3; i >= 0; i--) {
s16 off = (0x2000 * i);
off = (0x2000 * i);
this->unk_184[i].z = this->unk_184[i].x = (Math_CosS(this->unk_14E + off) * 0.0075f) + 0.015f;
this->unk_1B4[i].x = thisx->shape.rot.x;

View File

@ -283,11 +283,15 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
* This is used for the ground flash display lists and Arwing shadow display lists to snap onto the floor.
*/
void EnClearTag_CalculateFloorTangent(EnClearTag* this) {
f32 x;
f32 y;
f32 z;
// If there is a floor poly below the Arwing, calculate the floor tangent.
if (this->actor.floorPoly != NULL) {
f32 x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x);
f32 y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
f32 z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x);
y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
this->floorTangent.x = -Math_FAtan2F(-z * y, 1.0f);
this->floorTangent.z = Math_FAtan2F(-x * y, 1.0f);

View File

@ -285,8 +285,6 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 facingPlayer;
Vec3f pos;
s16 target;
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
@ -296,6 +294,9 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
facingPlayer = Actor_IsFacingPlayer(&this->actor, 0x2800);
if (facingPlayer) {
Vec3f pos;
s16 target;
pos.x = player->actor.world.pos.x;
pos.y = player->actor.world.pos.y + 20.0f;
pos.z = player->actor.world.pos.z;

View File

@ -7460,7 +7460,7 @@ EnCs_ChangeAnim = 0x809CD450; // type:func
EnCs_Init = 0x809CD574; // type:func
EnCs_Destroy = 0x809CD708; // type:func
EnCs_GetTalkState = 0x809CD734; // type:func
EnCs_GetTextID = 0x809CD868; // type:func
EnCs_GetTextId = 0x809CD868; // type:func
EnCs_HandleTalking = 0x809CD8EC; // type:func
EnCs_GetwaypointCount = 0x809CDA38; // type:func
EnCs_GetPathPoint = 0x809CDA4C; // type:func