1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-20 13:55:26 +00:00

Match En actors D-G (#1889)

* Match entity actors D-G

* Remove SET_EN_GOROIWA_SPEED

* Actually match z_en_elf.c

* GET_EN_GOROIWA_SPEED -> EN_GOROIWA_SPEED
This commit is contained in:
cadmic 2024-02-26 18:55:30 -08:00 committed by GitHub
parent c86bf5011b
commit 1da87b1e7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 160 additions and 98 deletions

View file

@ -296,8 +296,6 @@ void EnDh_SetupAttack(EnDh* this) {
} }
void EnDh_Attack(EnDh* this, PlayState* play) { void EnDh_Attack(EnDh* this, PlayState* play) {
s32 pad;
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
this->actionState++; this->actionState++;
} else if ((this->actor.xzDistToPlayer > 100.0f) || !Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360)) { } else if ((this->actor.xzDistToPlayer > 100.0f) || !Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360)) {
@ -336,6 +334,8 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
break; break;
case 3: case 3:
if ((this->actor.xzDistToPlayer <= 100.0f) && (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360))) { if ((this->actor.xzDistToPlayer <= 100.0f) && (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360))) {
s32 pad;
Animation_Change(&this->skelAnime, &object_dh_Anim_004658, 1.0f, 20.0f, Animation_Change(&this->skelAnime, &object_dh_Anim_004658, 1.0f, 20.0f,
Animation_GetLastFrame(&object_dh_Anim_004658), ANIMMODE_ONCE, -6.0f); Animation_GetLastFrame(&object_dh_Anim_004658), ANIMMODE_ONCE, -6.0f);
this->actionState = 0; this->actionState = 0;

View file

@ -125,6 +125,8 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, PlayState* play) {
} }
s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) { s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
s32 rupeesNeeded;
if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) { if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) {
// Failed. // Failed.
gSaveContext.timerState = TIMER_STATE_OFF; gSaveContext.timerState = TIMER_STATE_OFF;
@ -138,7 +140,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
this->actionFunc = func_809EE048; this->actionFunc = func_809EE048;
return true; return true;
} else { } else {
s32 rupeesNeeded = 5; rupeesNeeded = 5;
if (GET_EVENTCHKINF(EVENTCHKINF_38)) { if (GET_EVENTCHKINF(EVENTCHKINF_38)) {
rupeesNeeded = 10; rupeesNeeded = 10;

View file

@ -77,6 +77,7 @@ static u16 sStartingTextIds[] = {
0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD, 0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD,
}; };
#if OOT_DEBUG
static char* sItemDebugTxt[] = { static char* sItemDebugTxt[] = {
"デクの実売り ", // "Deku Nuts" "デクの実売り ", // "Deku Nuts"
"デクの棒売り ", // "Deku Sticks" "デクの棒売り ", // "Deku Sticks"
@ -90,6 +91,7 @@ static char* sItemDebugTxt[] = {
"デクの棒持てる数を増やす", // "Deku Stick Upgrade" "デクの棒持てる数を増やす", // "Deku Stick Upgrade"
"デクの実持てる数を増やす", // "Deku Nut Upgrade" "デクの実持てる数を増やす", // "Deku Nut Upgrade"
}; };
#endif
static DnsItemEntry sItemDekuNuts = { 20, 5, GI_DEKU_NUTS_5_2, EnDns_CanBuyDekuNuts, EnDns_PayForDekuNuts }; static DnsItemEntry sItemDekuNuts = { 20, 5, GI_DEKU_NUTS_5_2, EnDns_CanBuyDekuNuts, EnDns_PayForDekuNuts };
static DnsItemEntry sItemDekuSticks = { 15, 1, GI_DEKU_STICKS_1, EnDns_CanBuyDekuSticks, EnDns_PayPrice }; static DnsItemEntry sItemDekuSticks = { 15, 1, GI_DEKU_STICKS_1, EnDns_CanBuyDekuSticks, EnDns_PayPrice };

View file

@ -216,16 +216,23 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) {
f32 dz; f32 dz;
Vec3f scoreAccel = { 0.0f, 0.0f, 0.0f }; Vec3f scoreAccel = { 0.0f, 0.0f, 0.0f };
Vec3f scoreVel = { 0.0f, 0.0f, 0.0f }; Vec3f scoreVel = { 0.0f, 0.0f, 0.0f };
s32 pad;
this->targetVtx[0].x = this->targetVtx[1].x = this->targetVtx[2].x = this->targetVtx[3].x = targetX; this->targetVtx[0].x = targetX;
this->targetVtx[0].y = targetY - 24.0f;
this->targetVtx[0].z = targetZ + 24.0f;
this->targetVtx[1].y = this->targetVtx[0].y = targetY - 24.0f; this->targetVtx[1].x = targetX;
this->targetVtx[1].y = targetY - 24.0f;
this->targetVtx[1].z = targetZ - 24.0f;
this->targetVtx[2].z = this->targetVtx[0].z = targetZ + 24.0f; this->targetVtx[2].x = targetX;
this->targetVtx[2].y = targetY + 24.0f;
this->targetVtx[2].z = targetZ + 24.0f;
this->targetVtx[3].z = this->targetVtx[1].z = targetZ - 24.0f; this->targetVtx[3].x = targetX;
this->targetVtx[3].y = targetY + 24.0f;
this->targetVtx[3].y = this->targetVtx[2].y = targetY + 24.0f; this->targetVtx[3].z = targetZ - 24.0f;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) { if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) {

View file

@ -362,13 +362,15 @@ void func_809FE4A4(EnDu* this, PlayState* play) {
void func_809FE638(EnDu* this, PlayState* play) { void func_809FE638(EnDu* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & PLAYER_STATE1_29)) { if (player->stateFlags1 & PLAYER_STATE1_29) {
OnePointCutscene_Init(play, 3330, -99, &this->actor, CAM_ID_MAIN); return;
player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF;
Audio_PlayFanfare(NA_BGM_APPEAR);
EnDu_SetupAction(this, func_809FE6CC);
this->unk_1E2 = 0x32;
} }
OnePointCutscene_Init(play, 3330, -99, &this->actor, CAM_ID_MAIN);
player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF;
Audio_PlayFanfare(NA_BGM_APPEAR);
EnDu_SetupAction(this, func_809FE6CC);
this->unk_1E2 = 0x32;
} }
void func_809FE6CC(EnDu* this, PlayState* play) { void func_809FE6CC(EnDu* this, PlayState* play) {
@ -527,11 +529,13 @@ void func_809FEC14(EnDu* this, PlayState* play) {
} }
void func_809FEC70(EnDu* this, PlayState* play) { void func_809FEC70(EnDu* this, PlayState* play) {
f32 xzRange;
if (Actor_HasParent(&this->actor, play)) { if (Actor_HasParent(&this->actor, play)) {
this->actor.parent = NULL; this->actor.parent = NULL;
EnDu_SetupAction(this, func_809FECE4); EnDu_SetupAction(this, func_809FECE4);
} else { } else {
f32 xzRange = this->actor.xzDistToPlayer + 1.0f; xzRange = this->actor.xzDistToPlayer + 1.0f;
Actor_OfferGetItem(&this->actor, play, GI_GORONS_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); Actor_OfferGetItem(&this->actor, play, GI_GORONS_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f);
} }

View file

@ -93,8 +93,8 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play) {
static u8 D_809FFC50[] = { 0x02, 0x01, 0x01, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, static u8 D_809FFC50[] = { 0x02, 0x01, 0x01, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01,
0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x02, 0x00 }; 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x02, 0x00 };
EnDyExtra* this = (EnDyExtra*)thisx; EnDyExtra* this = (EnDyExtra*)thisx;
s32 pad;
GraphicsContext* gfxCtx = play->state.gfxCtx; GraphicsContext* gfxCtx = play->state.gfxCtx;
s32 pad;
Vtx* vertices = SEGMENTED_TO_VIRTUAL(gGreatFairySpiralBeamVtx); Vtx* vertices = SEGMENTED_TO_VIRTUAL(gGreatFairySpiralBeamVtx);
s32 i; s32 i;
u8 unk[3]; u8 unk[3];

View file

@ -48,7 +48,8 @@ void EnEg_Init(Actor* thisx, PlayState* play) {
} }
void func_809FFDC8(EnEg* this, PlayState* play) { void func_809FFDC8(EnEg* this, PlayState* play) {
if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) { if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) &&
(!OOT_DEBUG || kREG(0) == 0)) {
// Void the player out // Void the player out
Play_TriggerRespawn(play); Play_TriggerRespawn(play);
gSaveContext.respawnFlag = -2; gSaveContext.respawnFlag = -2;

View file

@ -304,9 +304,9 @@ void EnEiyer_SetupDie(EnEiyer* this) {
} }
void EnEiyer_SetupDead(EnEiyer* this) { void EnEiyer_SetupDead(EnEiyer* this) {
this->actor.colorFilterParams |= 0x2000;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.colorFilterParams |= 0x2000;
this->actionFunc = EnEiyer_Dead; this->actionFunc = EnEiyer_Dead;
} }

View file

@ -808,7 +808,6 @@ void func_80A03AB0(EnElf* this, PlayState* play) {
void EnElf_UpdateLights(EnElf* this, PlayState* play) { void EnElf_UpdateLights(EnElf* this, PlayState* play) {
s16 glowLightRadius; s16 glowLightRadius;
Player* player;
glowLightRadius = 100; glowLightRadius = 100;
@ -817,7 +816,8 @@ void EnElf_UpdateLights(EnElf* this, PlayState* play) {
} }
if (this->fairyFlags & 0x20) { if (this->fairyFlags & 0x20) {
player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.world.pos.x, Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.world.pos.x,
(s16)(player->actor.world.pos.y) + 60.0f, player->actor.world.pos.z, 255, 255, 255, (s16)(player->actor.world.pos.y) + 60.0f, player->actor.world.pos.z, 255, 255, 255,
200); 200);
@ -1379,9 +1379,15 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
if (player->naviTextId == 0) { if (player->naviTextId == 0) {
if (player->unk_664 == NULL) { if (player->unk_664 == NULL) {
#if OOT_DEBUG
if (((gSaveContext.save.info.playerData.naviTimer >= 600) && if (((gSaveContext.save.info.playerData.naviTimer >= 600) &&
(gSaveContext.save.info.playerData.naviTimer <= 3000)) || (gSaveContext.save.info.playerData.naviTimer <= 3000)) ||
(nREG(89) != 0)) { (nREG(89) != 0))
#else
if ((gSaveContext.save.info.playerData.naviTimer >= 600) &&
(gSaveContext.save.info.playerData.naviTimer <= 3000))
#endif
{
player->naviTextId = QuestHint_GetNaviTextId(play); player->naviTextId = QuestHint_GetNaviTextId(play);
if (player->naviTextId == 0x15F) { if (player->naviTextId == 0x15F) {
@ -1417,6 +1423,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
this->actionFunc(this, play); this->actionFunc(this, play);
thisx->shape.rot.y = this->unk_2BC; thisx->shape.rot.y = this->unk_2BC;
#if OOT_DEBUG
// `gSaveContext.save.info.sceneFlags[127].chest` (like in the debug string) instead of `HIGH_SCORE(HS_HBA)` // `gSaveContext.save.info.sceneFlags[127].chest` (like in the debug string) instead of `HIGH_SCORE(HS_HBA)`
// matches too, but, with how the `SaveContext` struct is currently defined, it is an out-of-bounds read in the // matches too, but, with how the `SaveContext` struct is currently defined, it is an out-of-bounds read in the
// `sceneFlags` array. It is theorized the original `room_inf` (currently `sceneFlags`) was an array of length // `sceneFlags` array. It is theorized the original `room_inf` (currently `sceneFlags`) was an array of length
@ -1426,6 +1433,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
if ((nREG(81) != 0) && (HIGH_SCORE(HS_HBA) != 0)) { if ((nREG(81) != 0) && (HIGH_SCORE(HS_HBA) != 0)) {
LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_elf.c", 2595); LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_elf.c", 2595);
} }
#endif
if (!Play_InCsMode(play)) { if (!Play_InCsMode(play)) {
if (gSaveContext.save.info.playerData.naviTimer < 25800) { if (gSaveContext.save.info.playerData.naviTimer < 25800) {
@ -1535,7 +1543,7 @@ void EnElf_Draw(Actor* thisx, PlayState* play) {
gDPSetRenderMode(dListHead++, G_RM_PASS, G_RM_ZB_CLD_SURF2); gDPSetRenderMode(dListHead++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
} }
gSPEndDisplayList(dListHead++); gSPEndDisplayList(dListHead);
gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b, gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b,
(u8)(envAlpha * alphaScale)); (u8)(envAlpha * alphaScale));
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,

View file

@ -338,9 +338,9 @@ void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play) {
} }
void EnEncount2_DrawEffects(Actor* thisx, PlayState* play) { void EnEncount2_DrawEffects(Actor* thisx, PlayState* play) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
EnEncount2* this = (EnEncount2*)thisx; EnEncount2* this = (EnEncount2*)thisx;
EnEncount2Effect* effect = this->effects; EnEncount2Effect* effect = this->effects;
GraphicsContext* gfxCtx = play->state.gfxCtx;
s16 i; s16 i;
s32 objectSlot; s32 objectSlot;

View file

@ -315,6 +315,7 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, PlayState* play) {
f32 distToBlowUp = 50.0f; f32 distToBlowUp = 50.0f;
s16 explosionScale; s16 explosionScale;
s16 explosionScaleStep; s16 explosionScaleStep;
s32 pad;
if (this->type == 2) { if (this->type == 2) {
distToBlowUp = 30.0f; distToBlowUp = 30.0f;

View file

@ -773,11 +773,11 @@ void EnFd_Draw(Actor* thisx, PlayState* play) {
if (this->actionFunc != EnFd_Reappear && !(this->fadeAlpha < 0.9f)) { if (this->actionFunc != EnFd_Reappear && !(this->fadeAlpha < 0.9f)) {
if (1) {} if (1) {}
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
clampedHealth = CLAMP(thisx->colChkInfo.health - 1, 0, 23); clampedHealth = CLAMP(thisx->colChkInfo.health - 1, 0, 23) / 8;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primColors[clampedHealth / 8].r, primColors[clampedHealth / 8].g, gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primColors[clampedHealth].r, primColors[clampedHealth].g,
primColors[clampedHealth / 8].b, (u8)this->fadeAlpha); primColors[clampedHealth].b, (u8)this->fadeAlpha);
gDPSetEnvColor(POLY_XLU_DISP++, envColors[clampedHealth / 8].r, envColors[clampedHealth / 8].g, gDPSetEnvColor(POLY_XLU_DISP++, envColors[clampedHealth].r, envColors[clampedHealth].g,
envColors[clampedHealth / 8].b, (u8)this->fadeAlpha); envColors[clampedHealth].b, (u8)this->fadeAlpha);
gSPSegment(POLY_XLU_DISP++, 0x8, gSPSegment(POLY_XLU_DISP++, 0x8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0,
0xFF - (u8)(frames * 6), 8, 0x40)); 0xFF - (u8)(frames * 6), 8, 0x40));
@ -875,9 +875,10 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) {
static void* dustTextures[] = { static void* dustTextures[] = {
gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex, gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex,
}; };
s32 materialFlag;
s16 i; s16 i;
s16 idx; s16 idx;
s16 pad;
s16 materialFlag;
EnFdEffect* eff = this->effects; EnFdEffect* eff = this->effects;
OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969); OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969);

View file

@ -287,8 +287,8 @@ void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) {
this->skelAnime.playSpeed = 3.0f; this->skelAnime.playSpeed = 3.0f;
this->actor.shape.rot.x = 0x1554; this->actor.shape.rot.x = 0x1554;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.speed = 3.0f;
this->timer = 50; this->timer = 50;
this->actor.speed = 3.0f;
this->actionFunc = EnFirefly_DisturbDiveAttack; this->actionFunc = EnFirefly_DisturbDiveAttack;
} }

View file

@ -472,11 +472,11 @@ void EnFish_Dropped_FlopOnGround(EnFish* this, PlayState* play) {
void EnFish_Dropped_SetupSwimAway(EnFish* this) { void EnFish_Dropped_SetupSwimAway(EnFish* this) {
this->actor.home.pos = this->actor.world.pos; this->actor.home.pos = this->actor.world.pos;
this->actor.flags |= ACTOR_FLAG_4;
this->timer = 200;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.minVelocityY = 0.0f; this->actor.minVelocityY = 0.0f;
this->actor.shape.yOffset = 0.0f; this->actor.shape.yOffset = 0.0f;
this->actor.flags |= ACTOR_FLAG_4;
this->timer = 200;
EnFish_SetInWaterAnimation(this); EnFish_SetInWaterAnimation(this);
this->actionFunc = EnFish_Dropped_SwimAway; this->actionFunc = EnFish_Dropped_SwimAway;
this->unk_250 = UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2; this->unk_250 = UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2;
@ -624,6 +624,8 @@ void EnFish_UpdateCutscene(EnFish* this, PlayState* play) {
f32 lerp; f32 lerp;
s32 bgId; s32 bgId;
if (play) {}
if (cue == NULL) { if (cue == NULL) {
// "Warning : DEMO ended without dousa (action) 3 termination being called" // "Warning : DEMO ended without dousa (action) 3 termination being called"
PRINTF("Warning : dousa 3 消滅 が呼ばれずにデモが終了した(%s %d)(arg_data 0x%04x)\n", "../z_en_sakana.c", 1169, PRINTF("Warning : dousa 3 消滅 が呼ばれずにデモが終了した(%s %d)(arg_data 0x%04x)\n", "../z_en_sakana.c", 1169,

View file

@ -256,6 +256,8 @@ void EnFz_Damaged(EnFz* this, PlayState* play, Vec3f* vec, s32 numEffects, f32 u
f32 scale; f32 scale;
s32 life; s32 life;
accel.x = accel.z = 0.0f;
accel.y = -1.0f;
primColor.r = 155; primColor.r = 155;
primColor.g = 255; primColor.g = 255;
primColor.b = 255; primColor.b = 255;
@ -263,8 +265,6 @@ void EnFz_Damaged(EnFz* this, PlayState* play, Vec3f* vec, s32 numEffects, f32 u
envColor.r = 200; envColor.r = 200;
envColor.g = 200; envColor.g = 200;
envColor.b = 200; envColor.b = 200;
accel.x = accel.z = 0.0f;
accel.y = -1.0f;
for (i = 0; i < numEffects; i++) { for (i = 0; i < numEffects; i++) {
scale = Rand_CenteredFloat(0.3f) + 0.6f; scale = Rand_CenteredFloat(0.3f) + 0.6f;
@ -476,10 +476,10 @@ void EnFz_MoveTowardsPlayer(EnFz* this, PlayState* play) {
void EnFz_SetupAimForFreeze(EnFz* this) { void EnFz_SetupAimForFreeze(EnFz* this) {
this->state = 1; this->state = 1;
this->timer = 40;
this->actionFunc = EnFz_AimForFreeze;
this->speedXZ = 0.0f; this->speedXZ = 0.0f;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
this->timer = 40;
this->actionFunc = EnFz_AimForFreeze;
} }
void EnFz_AimForFreeze(EnFz* this, PlayState* play) { void EnFz_AimForFreeze(EnFz* this, PlayState* play) {
@ -547,16 +547,16 @@ void EnFz_BlowSmoke(EnFz* this, PlayState* play) {
void EnFz_SetupDespawn(EnFz* this, PlayState* play) { void EnFz_SetupDespawn(EnFz* this, PlayState* play) {
this->state = 0; this->state = 0;
this->speedXZ = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.speed = 0.0f;
this->updateBgInfo = true; this->updateBgInfo = true;
this->isFreezing = false; this->isFreezing = false;
this->isDespawning = true; this->isDespawning = true;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->isActive = false; this->isActive = false;
this->timer = 60; this->timer = 60;
this->speedXZ = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.speed = 0.0f;
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60);
this->actionFunc = EnFz_Despawn; this->actionFunc = EnFz_Despawn;
@ -573,9 +573,9 @@ void EnFz_SetupMelt(EnFz* this) {
this->isFreezing = false; this->isFreezing = false;
this->isDespawning = true; this->isDespawning = true;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->actionFunc = EnFz_Melt;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
this->speedXZ = 0.0f; this->speedXZ = 0.0f;
this->actionFunc = EnFz_Melt;
} }
void EnFz_Melt(EnFz* this, PlayState* play) { void EnFz_Melt(EnFz* this, PlayState* play) {
@ -859,10 +859,10 @@ void EnFz_UpdateIceSmoke(EnFz* this, PlayState* play) {
} }
void EnFz_DrawEffects(EnFz* this, PlayState* play) { void EnFz_DrawEffects(EnFz* this, PlayState* play) {
EnFzEffect* effect = this->effects;
s16 i; s16 i;
GraphicsContext* gfxCtx = play->state.gfxCtx; GraphicsContext* gfxCtx = play->state.gfxCtx;
u8 materialFlag = 0; u8 materialFlag = 0;
EnFzEffect* effect = this->effects;
OPEN_DISPS(gfxCtx, "../z_en_fz.c", 1384); OPEN_DISPS(gfxCtx, "../z_en_fz.c", 1384);
@ -872,7 +872,7 @@ void EnFz_DrawEffects(EnFz* this, PlayState* play) {
if (effect->type > 0) { if (effect->type > 0) {
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
if (!materialFlag) { if (materialFlag == 0) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamStartDL)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamStartDL));
materialFlag++; materialFlag++;
} }

View file

@ -391,14 +391,14 @@ void EnGanonMant_Draw(Actor* thisx, PlayState* play) {
f32 diffHalfDist; f32 diffHalfDist;
f32 yDiff; f32 yDiff;
f32 yaw; f32 yaw;
Vec3f* rightPos;
Vec3f* leftPos;
s16 strandIdx;
Vec3f midpoint;
s16 nextStrandIdx;
if (this->updateHasRun) { if (this->updateHasRun) {
// Only run this if update has run since last draw // Only run this if update has run since last draw
Vec3f* rightPos;
Vec3f* leftPos;
s16 strandIdx;
Vec3f midpoint;
s16 nextStrandIdx;
// Choose endpoints // Choose endpoints
if (this->attachRightArmTimer != 0.0f) { if (this->attachRightArmTimer != 0.0f) {

View file

@ -183,6 +183,8 @@ void EnGb_Init(Actor* thisx, PlayState* play) {
this->actionTimer = (s16)Rand_ZeroFloat(100.0f) + 100; this->actionTimer = (s16)Rand_ZeroFloat(100.0f) + 100;
for (i = 0; i < ARRAY_COUNT(sCagedSoulPositions); i++) { for (i = 0; i < ARRAY_COUNT(sCagedSoulPositions); i++) {
s32 pad;
this->cagedSouls[i].infoIdx = (s32)Rand_ZeroFloat(30.0f) % 3; this->cagedSouls[i].infoIdx = (s32)Rand_ZeroFloat(30.0f) % 3;
this->cagedSouls[i].unk_14.x = this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x = this->cagedSouls[i].translation.x =
sCagedSoulPositions[i].x + this->dyna.actor.world.pos.x; sCagedSoulPositions[i].x + this->dyna.actor.world.pos.x;
@ -280,6 +282,8 @@ void func_80A2F83C(EnGb* this, PlayState* play) {
} }
} }
if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) { if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) {
s32 pad;
switch (func_8002F368(play)) { switch (func_8002F368(play)) {
case EXCH_ITEM_NONE: case EXCH_ITEM_NONE:
func_80A2F180(this); func_80A2F180(this);
@ -294,9 +298,7 @@ void func_80A2F83C(EnGb* this, PlayState* play) {
this->actionFunc = func_80A2FA50; this->actionFunc = func_80A2FA50;
break; break;
} }
return; } else if (this->dyna.actor.xzDistToPlayer < 100.0f) {
}
if (this->dyna.actor.xzDistToPlayer < 100.0f) {
Actor_OfferTalkExchangeEquiCylinder(&this->dyna.actor, play, 100.0f, EXCH_ITEM_BOTTLE_POE); Actor_OfferTalkExchangeEquiCylinder(&this->dyna.actor, play, 100.0f, EXCH_ITEM_BOTTLE_POE);
} }
} }
@ -440,7 +442,6 @@ void EnGb_Draw(Actor* thisx, PlayState* play) {
void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) { void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) {
f32 temp_f20; f32 temp_f20;
s16 rot;
s32 i; s32 i;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
@ -499,12 +500,14 @@ void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) {
this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y + temp_f20; this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y + temp_f20;
this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z; this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z;
} else if (i == 1) { } else if (i == 1) {
rot = this->dyna.actor.world.rot.y - 0x4000; s16 rot = this->dyna.actor.world.rot.y - 0x4000;
this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x + Math_SinS(rot) * temp_f20; this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x + Math_SinS(rot) * temp_f20;
this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z + Math_CosS(rot) * temp_f20; this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z + Math_CosS(rot) * temp_f20;
this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y; this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y;
} else { } else {
rot = this->dyna.actor.world.rot.y + 0x4000; s16 rot = this->dyna.actor.world.rot.y + 0x4000;
this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x + Math_SinS(rot) * temp_f20; this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x + Math_SinS(rot) * temp_f20;
this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z + Math_CosS(rot) * temp_f20; this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z + Math_CosS(rot) * temp_f20;
this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y; this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y;

View file

@ -112,8 +112,8 @@ void EnGe2_ChangeAction(EnGe2* this, s32 i) {
} }
void EnGe2_Init(Actor* thisx, PlayState* play) { void EnGe2_Init(Actor* thisx, PlayState* play) {
s32 pad;
EnGe2* this = (EnGe2*)thisx; EnGe2* this = (EnGe2*)thisx;
s16 params = this->actor.params;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, 22); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, 22);
@ -133,7 +133,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) {
this->actor.world.rot.z = 0; this->actor.world.rot.z = 0;
this->actor.shape.rot.z = 0; this->actor.shape.rot.z = 0;
switch (this->actor.params & 0xFF) { switch (thisx->params & 0xFF) {
case GE2_TYPE_PATROLLING: case GE2_TYPE_PATROLLING:
EnGe2_ChangeAction(this, GE2_ACTION_WALK); EnGe2_ChangeAction(this, GE2_ACTION_WALK);
if (EnGe2_CheckCarpentersFreed()) { if (EnGe2_CheckCarpentersFreed()) {
@ -156,6 +156,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) {
break; break;
default: default:
ASSERT(0, "0", "../z_en_ge2.c", 418); ASSERT(0, "0", "../z_en_ge2.c", 418);
break;
} }
this->stateFlags = 0; this->stateFlags = 0;
@ -165,7 +166,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) {
this->actor.minVelocityY = -4.0f; this->actor.minVelocityY = -4.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->walkDirection = this->actor.world.rot.y; this->walkDirection = this->actor.world.rot.y;
this->walkDuration = ((this->actor.params & 0xFF00) >> 8) * 10; this->walkDuration = ((thisx->params & 0xFF00) >> 8) * 10;
} }
void EnGe2_Destroy(Actor* thisx, PlayState* play) { void EnGe2_Destroy(Actor* thisx, PlayState* play) {

View file

@ -274,7 +274,6 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) {
Actor* thisx = &this->actor; Actor* thisx = &this->actor;
s16 angleToWall; s16 angleToWall;
s16 angleToLink; s16 angleToLink;
Actor* bomb;
angleToWall = thisx->wallYaw - thisx->shape.rot.y; angleToWall = thisx->wallYaw - thisx->shape.rot.y;
angleToWall = ABS(angleToWall); angleToWall = ABS(angleToWall);
@ -306,22 +305,29 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) {
EnGeldB_SetupRollBack(this); EnGeldB_SetupRollBack(this);
return true; return true;
} }
} else if ((bomb = Actor_FindNearby(play, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f)) != NULL) { } else {
thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; Actor* bomb = Actor_FindNearby(play, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f);
if (((thisx->bgCheckFlags & BGCHECKFLAG_WALL) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) {
if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) && if (bomb != NULL) {
((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) { thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer;
EnGeldB_SetupJump(this); if (((thisx->bgCheckFlags & BGCHECKFLAG_WALL) && (angleToWall < 0x2EE0)) ||
return true; (bomb->id == ACTOR_EN_BOM_CHU)) {
if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) &&
((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) {
EnGeldB_SetupJump(this);
return true;
} else {
EnGeldB_SetupSidestep(this, play);
return true;
}
} else { } else {
EnGeldB_SetupSidestep(this, play); EnGeldB_SetupRollBack(this);
return true; return true;
} }
} else {
EnGeldB_SetupRollBack(this);
return true;
} }
} else if (arg2) { }
if (arg2) {
if (angleToLink >= 0x1B58) { if (angleToLink >= 0x1B58) {
EnGeldB_SetupSidestep(this, play); EnGeldB_SetupSidestep(this, play);
return true; return true;

View file

@ -79,6 +79,7 @@ ActorInit En_GirlA_InitVars = {
/**/ NULL, /**/ NULL,
}; };
#if OOT_DEBUG
static char* sShopItemDescriptions[] = { static char* sShopItemDescriptions[] = {
"デクの実×5 ", // "Deku nut x5" "デクの実×5 ", // "Deku nut x5"
"×30 ", // "Arrow x30" "×30 ", // "Arrow x30"
@ -131,6 +132,7 @@ static char* sShopItemDescriptions[] = {
"赤クスリ ", // "Red medicine" "赤クスリ ", // "Red medicine"
"赤クスリ " // "Red medicine" "赤クスリ " // "Red medicine"
}; };
#endif
static s16 sMaskShopItems[8] = { static s16 sMaskShopItems[8] = {
ITEM_MASK_KEATON, ITEM_MASK_SPOOKY, ITEM_MASK_SKULL, ITEM_MASK_BUNNY_HOOD, ITEM_MASK_KEATON, ITEM_MASK_SPOOKY, ITEM_MASK_SKULL, ITEM_MASK_BUNNY_HOOD,
@ -895,12 +897,11 @@ void EnGirlA_Noop(EnGirlA* this, PlayState* play) {
void EnGirlA_SetItemDescription(PlayState* play, EnGirlA* this) { void EnGirlA_SetItemDescription(PlayState* play, EnGirlA* this) {
ShopItemEntry* tmp = &shopItemEntries[this->actor.params]; ShopItemEntry* tmp = &shopItemEntries[this->actor.params];
s32 params = this->actor.params; s32 params = this->actor.params;
s32 maskId;
s32 isMaskFreeToBorrow;
if ((this->actor.params >= SI_KEATON_MASK) && (this->actor.params <= SI_MASK_OF_TRUTH)) { if ((this->actor.params >= SI_KEATON_MASK) && (this->actor.params <= SI_MASK_OF_TRUTH)) {
maskId = this->actor.params - SI_KEATON_MASK; s32 maskId = this->actor.params - SI_KEATON_MASK;
isMaskFreeToBorrow = false; s32 isMaskFreeToBorrow = false;
switch (this->actor.params) { switch (this->actor.params) {
case SI_KEATON_MASK: case SI_KEATON_MASK:
if (GET_ITEMGETINF(ITEMGETINF_38)) { if (GET_ITEMGETINF(ITEMGETINF_38)) {

View file

@ -397,13 +397,13 @@ void EnGoma_SetupDead(EnGoma* this) {
} }
void EnGoma_Dead(EnGoma* this, PlayState* play) { void EnGoma_Dead(EnGoma* this, PlayState* play) {
Vec3f accel;
Vec3f pos;
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f);
if (this->actionTimer == 2) { if (this->actionTimer == 2) {
Vec3f accel;
Vec3f pos;
pos.x = this->actor.world.pos.x; pos.x = this->actor.world.pos.x;
pos.y = (this->actor.world.pos.y + 5.0f) - 10.0f; pos.y = (this->actor.world.pos.y + 5.0f) - 10.0f;
pos.z = this->actor.world.pos.z; pos.z = this->actor.world.pos.z;
@ -604,7 +604,6 @@ void EnGoma_LookAtPlayer(EnGoma* this, PlayState* play) {
} }
void EnGoma_UpdateHit(EnGoma* this, PlayState* play) { void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
static Vec3f sShieldKnockbackVel = { 0.0f, 0.0f, 20.0f };
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (this->hurtTimer != 0) { if (this->hurtTimer != 0) {
@ -632,6 +631,8 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.speed = -5.0f; this->actor.speed = -5.0f;
} else { } else {
static Vec3f sShieldKnockbackVel = { 0.0f, 0.0f, 20.0f };
Matrix_RotateY(BINANG_TO_RAD_ALT(player->actor.shape.rot.y), MTXMODE_NEW); Matrix_RotateY(BINANG_TO_RAD_ALT(player->actor.shape.rot.y), MTXMODE_NEW);
Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel); Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel);
this->invincibilityTimer = 5; this->invincibilityTimer = 5;

View file

@ -84,7 +84,13 @@ static ColliderJntSphInit sJntSphInit = {
static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY }; static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY };
static f32 sUnused[] = { 10.0f, 9.2f }; static f32 sSpeeds[] = { 10.0f, 9.2f };
#if OOT_DEBUG
#define EN_GOROIWA_SPEED(this) (R_EN_GOROIWA_SPEED * 0.01f)
#else
#define EN_GOROIWA_SPEED(this) sSpeeds[(this)->isInKokiri]
#endif
void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { void EnGoroiwa_UpdateCollider(EnGoroiwa* this) {
static f32 yOffsets[] = { 0.0f, 59.5f }; static f32 yOffsets[] = { 0.0f, 59.5f };
@ -129,10 +135,14 @@ s32 EnGoroiwa_Vec3fNormalize(Vec3f* ret, Vec3f* a) {
void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) {
if (play->sceneId == SCENE_KOKIRI_FOREST) { if (play->sceneId == SCENE_KOKIRI_FOREST) {
this->isInKokiri = true; this->isInKokiri = true;
#if OOT_DEBUG
R_EN_GOROIWA_SPEED = 920; R_EN_GOROIWA_SPEED = 920;
#endif
} else { } else {
this->isInKokiri = false; this->isInKokiri = false;
#if OOT_DEBUG
R_EN_GOROIWA_SPEED = 1000; R_EN_GOROIWA_SPEED = 1000;
#endif
} }
} }
@ -242,11 +252,13 @@ s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) {
Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint;
if (nextPointPos->x == currentPointPos->x && nextPointPos->z == currentPointPos->z) { if (nextPointPos->x == currentPointPos->x && nextPointPos->z == currentPointPos->z) {
#if OOT_DEBUG
if (nextPointPos->y == currentPointPos->y) { if (nextPointPos->y == currentPointPos->y) {
// "Error: Invalid path data (points overlap)" // "Error: Invalid path data (points overlap)"
PRINTF("Error : レールデータ不正(点が重なっている)"); PRINTF("Error : レールデータ不正(点が重なっている)");
PRINTF("(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 559, this->actor.params); PRINTF("(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 559, this->actor.params);
} }
#endif
if (nextPointPos->y > currentPointPos->y) { if (nextPointPos->y > currentPointPos->y) {
return 1; return 1;
@ -299,7 +311,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) {
s32 pad; s32 pad;
Vec3s* nextPointPos; Vec3s* nextPointPos;
Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); Math_StepToF(&this->actor.speed, EN_GOROIWA_SPEED(this), 0.3f);
Actor_UpdateVelocityXZGravity(&this->actor); Actor_UpdateVelocityXZGravity(&this->actor);
path = &play->pathList[this->actor.params & 0xFF]; path = &play->pathList[this->actor.params & 0xFF];
nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
@ -322,7 +334,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) {
nextPointPosF.x = nextPointPos->x; nextPointPosF.x = nextPointPos->x;
nextPointPosF.y = nextPointPos->y; nextPointPosF.y = nextPointPos->y;
nextPointPosF.z = nextPointPos->z; nextPointPosF.z = nextPointPos->z;
Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); Math_StepToF(&this->actor.speed, EN_GOROIWA_SPEED(this), 0.3f);
if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < SQ(5.0f)) { if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < SQ(5.0f)) {
Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff); Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff);
} else { } else {
@ -346,7 +358,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) {
Path* path = &play->pathList[this->actor.params & 0xFF]; Path* path = &play->pathList[this->actor.params & 0xFF];
Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
Math_StepToF(&this->actor.velocity.y, (R_EN_GOROIWA_SPEED * 0.01f) * 0.5f, 0.18f); Math_StepToF(&this->actor.velocity.y, EN_GOROIWA_SPEED(this) * 0.5f, 0.18f);
this->actor.world.pos.x = nextPointPos->x; this->actor.world.pos.x = nextPointPos->x;
this->actor.world.pos.z = nextPointPos->z; this->actor.world.pos.z = nextPointPos->z;
return Math_StepToF(&this->actor.world.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y)); return Math_StepToF(&this->actor.world.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y));
@ -435,7 +447,6 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) {
Vec3f rollAxis; Vec3f rollAxis;
Vec3f unitRollAxis; Vec3f unitRollAxis;
MtxF mtx; MtxF mtx;
Vec3f unusedDiff;
if (this->stateFlags & ENGOROIWA_RETAIN_ROT_SPEED) { if (this->stateFlags & ENGOROIWA_RETAIN_ROT_SPEED) {
rollAngleDiff = this->prevRollAngleDiff; rollAngleDiff = this->prevRollAngleDiff;
@ -446,6 +457,8 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) {
rollAngleDiff *= this->rollRotSpeed; rollAngleDiff *= this->rollRotSpeed;
rollAxisPtr = &rollAxis; rollAxisPtr = &rollAxis;
if (this->stateFlags & ENGOROIWA_RETAIN_ROT_SPEED) { if (this->stateFlags & ENGOROIWA_RETAIN_ROT_SPEED) {
Vec3f unusedDiff;
/* /*
* EnGoroiwa_GetPrevWaypointDiff has no side effects and its result goes unused, * EnGoroiwa_GetPrevWaypointDiff has no side effects and its result goes unused,
* its result was probably meant to be used instead of the actor's velocity in the * its result was probably meant to be used instead of the actor's velocity in the

View file

@ -139,9 +139,15 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) {
void func_80A4E470(EnGs* this, PlayState* play) { void func_80A4E470(EnGs* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
#if OOT_DEBUG
bREG(15) = 0; bREG(15) = 0;
#endif
if (this->actor.xzDistToPlayer <= 100.0f) { if (this->actor.xzDistToPlayer <= 100.0f) {
#if OOT_DEBUG
bREG(15) = 1; bREG(15) = 1;
#endif
if (this->unk_19D == 0) { if (this->unk_19D == 0) {
player->stateFlags2 |= PLAYER_STATE2_23; player->stateFlags2 |= PLAYER_STATE2_23;
if (player->stateFlags2 & PLAYER_STATE2_24) { if (player->stateFlags2 & PLAYER_STATE2_24) {
@ -285,19 +291,6 @@ void func_80A4EB3C(EnGs* this, PlayState* play) {
} }
void func_80A4ED34(EnGs* this, PlayState* play) { void func_80A4ED34(EnGs* this, PlayState* play) {
static Color_RGBA8 flashRed = { 255, 50, 50, 0 };
static Color_RGBA8 flashBlue = { 50, 50, 255, 0 };
static Color_RGBA8 baseWhite = { 255, 255, 255, 0 };
static Vec3f dustAccel = { 0.0f, -0.3f, 0.0f };
static Color_RGBA8 dustPrim = { 200, 200, 200, 128 };
static Color_RGBA8 dustEnv = { 100, 100, 100, 0 };
static Vec3f bomb2Velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f bomb2Accel = { 0.0f, 0.0f, 0.0f };
u8 i;
Vec3f dustPos;
Vec3f dustVelocity;
Vec3f bomb2Pos;
if (this->unk_19F == 0) { if (this->unk_19F == 0) {
this->unk_200 = 40; this->unk_200 = 40;
this->unk_19F++; this->unk_19F++;
@ -312,6 +305,10 @@ void func_80A4ED34(EnGs* this, PlayState* play) {
} }
if (this->unk_19F == 2) { if (this->unk_19F == 2) {
static Color_RGBA8 flashRed = { 255, 50, 50, 0 };
static Color_RGBA8 flashBlue = { 50, 50, 255, 0 };
static Color_RGBA8 baseWhite = { 255, 255, 255, 0 };
this->unk_200--; this->unk_200--;
Color_RGBA8_Copy(&this->flashColor, &baseWhite); Color_RGBA8_Copy(&this->flashColor, &baseWhite);
if ((this->unk_200 < 80) && ((this->unk_200 % 20) < 8)) { if ((this->unk_200 < 80) && ((this->unk_200 % 20) < 8)) {
@ -337,7 +334,15 @@ void func_80A4ED34(EnGs* this, PlayState* play) {
} }
if (this->unk_19F == 3) { if (this->unk_19F == 3) {
u8 i;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
static Vec3f dustAccel = { 0.0f, -0.3f, 0.0f };
static Color_RGBA8 dustPrim = { 200, 200, 200, 128 };
static Color_RGBA8 dustEnv = { 100, 100, 100, 0 };
Vec3f dustPos;
Vec3f dustVelocity;
dustVelocity.x = Rand_CenteredFloat(15.0f); dustVelocity.x = Rand_CenteredFloat(15.0f);
dustVelocity.y = Rand_ZeroFloat(-1.0f); dustVelocity.y = Rand_ZeroFloat(-1.0f);
dustVelocity.z = Rand_CenteredFloat(15.0f); dustVelocity.z = Rand_CenteredFloat(15.0f);
@ -362,6 +367,10 @@ void func_80A4ED34(EnGs* this, PlayState* play) {
if (this->unk_19F == 4) { if (this->unk_19F == 4) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1);
if (this->actor.bgCheckFlags & (BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) { if (this->actor.bgCheckFlags & (BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) {
static Vec3f bomb2Velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f bomb2Accel = { 0.0f, 0.0f, 0.0f };
Vec3f bomb2Pos;
bomb2Pos.x = this->actor.world.pos.x; bomb2Pos.x = this->actor.world.pos.x;
bomb2Pos.y = this->actor.world.pos.y; bomb2Pos.y = this->actor.world.pos.y;
bomb2Pos.z = this->actor.world.pos.z; bomb2Pos.z = this->actor.world.pos.z;

View file

@ -7505,7 +7505,7 @@ EnDaikuKakariko_PostLimbDraw = 0x809D0D30; // type:func
EnDaikuKakariko_Draw = 0x809D0DAC; // type:func EnDaikuKakariko_Draw = 0x809D0DAC; // type:func
EnDekubaba_Init = 0x809D1180; // type:func EnDekubaba_Init = 0x809D1180; // type:func
EnDekubaba_Destroy = 0x809D13C4; // type:func EnDekubaba_Destroy = 0x809D13C4; // type:func
EnDekubaba_DisableHitboxes = 0x809D13F0; // type:func EnDekubaba_DisableACColliderElems = 0x809D13F0; // type:func
EnDekubaba_SetupWait = 0x809D1478; // type:func EnDekubaba_SetupWait = 0x809D1478; // type:func
EnDekubaba_SetupGrow = 0x809D16E0; // type:func EnDekubaba_SetupGrow = 0x809D16E0; // type:func
EnDekubaba_SetupRetract = 0x809D1810; // type:func EnDekubaba_SetupRetract = 0x809D1810; // type:func