1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-28 15:56:51 +00:00

improve matching (#1543)

This commit is contained in:
engineer124 2023-09-21 00:54:44 +10:00 committed by GitHub
parent a8d670fe5c
commit 72334df180
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 111 additions and 98 deletions

View file

@ -1200,9 +1200,12 @@ void EnGo_DrawEffects(EnGo* this, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_go.c", 2626); OPEN_DISPS(play->state.gfxCtx, "../z_en_go.c", 2626);
materialFlag = false; materialFlag = false;
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
if (1) {}
for (i = 0; i < EN_GO_EFFECT_COUNT; i++, dustEffect++) { for (i = 0; i < EN_GO_EFFECT_COUNT; i++, dustEffect++) {
if (dustEffect->type) { if (dustEffect->type == 0) {
continue;
}
if (!materialFlag) { if (!materialFlag) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40); gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40);
@ -1223,6 +1226,6 @@ void EnGo_DrawEffects(EnGo* this, PlayState* play) {
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[index])); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[index]));
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50); gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
} }
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_go.c", 2678); CLOSE_DISPS(play->state.gfxCtx, "../z_en_go.c", 2678);
} }

View file

@ -225,10 +225,12 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) {
materialFlag = false; materialFlag = false;
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
if (1) {}
for (i = 0; i < EN_GO2_EFFECT_COUNT; i++, dustEffect++) { for (i = 0; i < EN_GO2_EFFECT_COUNT; i++, dustEffect++) {
if (dustEffect->type) { if (dustEffect->type == 0) {
continue;
}
if (!materialFlag) { if (!materialFlag) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40); gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40);
@ -248,7 +250,6 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) {
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sDustTex[index])); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sDustTex[index]));
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50); gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
} }
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_go2_eff.c", 151); CLOSE_DISPS(play->state.gfxCtx, "../z_en_go2_eff.c", 151);
} }

View file

@ -686,8 +686,10 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
spawnPos.z = sHorseSpawns[i].pos.z; spawnPos.z = sHorseSpawns[i].pos.z;
dist = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &spawnPos); dist = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &spawnPos);
if (play->sceneId) {} if ((minDist < dist) || func_80A5BBBC(play, this, &spawnPos)) {
if (!((minDist < dist) || func_80A5BBBC(play, this, &spawnPos))) { continue;
}
minDist = dist; minDist = dist;
this->actor.world.pos.x = sHorseSpawns[i].pos.x; this->actor.world.pos.x = sHorseSpawns[i].pos.x;
this->actor.world.pos.y = sHorseSpawns[i].pos.y; this->actor.world.pos.y = sHorseSpawns[i].pos.y;
@ -701,7 +703,6 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
} }
} }
} }
}
return spawn; return spawn;
} }

View file

@ -894,19 +894,22 @@ void func_80A7B024(EnIn* this, PlayState* play) {
player->rideActor->freezeTimer = 10; player->rideActor->freezeTimer = 10;
} }
player->actor.freezeTimer = 10; player->actor.freezeTimer = 10;
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
if (1) {} if (this->interactInfo.talkState != NPC_TALK_STATE_ACTION) {
return;
}
if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && GET_INFTABLE(INFTABLE_AB)) { if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && GET_INFTABLE(INFTABLE_AB)) {
SET_EVENTCHKINF(EVENTCHKINF_1B); SET_EVENTCHKINF(EVENTCHKINF_1B);
SET_INFTABLE(INFTABLE_AB); SET_INFTABLE(INFTABLE_AB);
} }
func_80A79BAC(this, play, 0, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST)); func_80A79BAC(this, play, 0, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0); SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
SET_EVENTINF_HORSES_0F(1); SET_EVENTINF_HORSES_0F(1);
play->msgCtx.stateTimer = 4; play->msgCtx.stateTimer = 4;
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
}
} }
void EnIn_Update(Actor* thisx, PlayState* play) { void EnIn_Update(Actor* thisx, PlayState* play) {

View file

@ -215,14 +215,15 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
Message_ContinueTextbox(play, 0x6080); Message_ContinueTextbox(play, 0x6080);
this->actor.textId = 0x6080; this->actor.textId = 0x6080;
break; break;
}; }
if (this->unk_1F4 & 4) { if (this->unk_1F4 & 4) {
if (1) {}
this->unk_1F4 &= ~4; this->unk_1F4 &= ~4;
HIGH_SCORE(HS_MARATHON)++; HIGH_SCORE(HS_MARATHON)++;
} }
} }
return; break;
case 0x6081: case 0x6081:
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
this->unk_1F4 |= 4; this->unk_1F4 |= 4;
@ -230,9 +231,9 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
Message_ContinueTextbox(play, 0x607E); Message_ContinueTextbox(play, 0x607E);
this->actor.textId = 0x607E; this->actor.textId = 0x607E;
} }
return; break;
}
default:
if (Actor_TextboxIsClosing(&this->actor, play)) { if (Actor_TextboxIsClosing(&this->actor, play)) {
if (this->actor.textId == 0x607F) { if (this->actor.textId == 0x607F) {
Interface_SetSubTimer(0); Interface_SetSubTimer(0);
@ -243,6 +244,8 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
this->actionFunc = func_80AAF57C; this->actionFunc = func_80AAF57C;
func_80AAEF70(this, play); func_80AAEF70(this, play);
} }
break;
}
} }
void func_80AAF57C(EnMm2* this, PlayState* play) { void func_80AAF57C(EnMm2* this, PlayState* play) {

View file

@ -518,8 +518,12 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
} }
this->aneObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ANE); this->aneObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ANE);
if (this->aneObjectSlot >= 0) { if (this->aneObjectSlot < 0) {
return;
}
this->actionFunc(this, play); this->actionFunc(this, play);
if (this->unusedTimer2 != 0) { if (this->unusedTimer2 != 0) {
this->unusedTimer2--; this->unusedTimer2--;
} }
@ -538,10 +542,8 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4); UPDBGCHECKINFO_FLAG_4);
Collider_UpdateCylinder(thisx, &this->collider); Collider_UpdateCylinder(thisx, &this->collider);
if (1) {}
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
} }
}
} }
Gfx* EnNiwLady_EmptyDList(GraphicsContext* gfxCtx) { Gfx* EnNiwLady_EmptyDList(GraphicsContext* gfxCtx) {