From 19621c6a3f6802652232cbe213f7929063061566 Mon Sep 17 00:00:00 2001 From: cadmic Date: Wed, 25 Sep 2024 20:11:38 -0700 Subject: [PATCH] [ntsc-1.0/1.1] Match actor changes introduced in PAL 1.0 (#2227) --- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 3 + .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 3 + .../actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 8 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 11 +++ .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 13 +++- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 3 + src/overlays/actors/ovl_En_Dha/z_en_dha.c | 9 +++ .../actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 7 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 10 +++ src/overlays/actors/ovl_En_Horse/z_en_horse.c | 13 ++++ src/overlays/actors/ovl_En_In/z_en_in.c | 11 +++ src/overlays/actors/ovl_En_Kz/z_en_kz.c | 77 ++++++++++++++++++- src/overlays/actors/ovl_En_Ma3/z_en_ma3.c | 4 + src/overlays/actors/ovl_En_Mb/z_en_mb.c | 28 ++++++- .../z_en_okarina_effect.c | 8 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 6 ++ src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 + 17 files changed, 202 insertions(+), 14 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 19458d56b1..812a97f51f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -5,6 +5,7 @@ */ #include "z_bg_hidan_hamstep.h" +#include "versions.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" #include "quake.h" @@ -379,9 +380,11 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Rumble_Request(SQ(100.0f), 255, 20, 150); func_808884C8(this, play); +#if OOT_VERSION >= PAL_1_0 if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 5) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } +#endif PRINTF("B(%d)\n", this->dyna.actor.params); } diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index d8d6de0665..3e346641eb 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -5,6 +5,7 @@ */ #include "z_bg_mori_hineri.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_box/object_box.h" #include "assets/objects/object_mori_hineri1/object_mori_hineri1.h" @@ -203,7 +204,9 @@ void func_808A3E54(BgMoriHineri* this, PlayState* play) { this->moriHineriObjectSlot = objectSlot; this->dyna.actor.params ^= 1; sSubCamId = SUB_CAM_ID_DONE; +#if OOT_VERSION >= PAL_1_0 Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); +#endif } else { this->dyna.actor.draw = NULL; this->actionFunc = func_808A3D58; diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 78c7ede03d..ef0e25f404 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -5,6 +5,7 @@ */ #include "z_bg_treemouth.h" +#include "versions.h" #include "assets/objects/object_spot04_objects/object_spot04_objects.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -235,7 +236,12 @@ void BgTreemouth_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (!IS_CUTSCENE_LAYER || LINK_IS_ADULT) { +#if OOT_VERSION < PAL_1_0 + if (!IS_CUTSCENE_LAYER) +#else + if (!IS_CUTSCENE_LAYER || LINK_IS_ADULT) +#endif + { if (GET_EVENTCHKINF(EVENTCHKINF_07)) { alpha = 2150; } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index a7e7888e3a..64c60412e6 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -847,6 +847,9 @@ void DemoEffect_UpdateTriforceSpot(DemoEffect* this, PlayState* play) { */ void DemoEffect_UpdateLightRingShrinking(DemoEffect* this, PlayState* play) { if (this->lightRing.timer < this->lightRing.timerIncrement) { +#if OOT_VERSION < PAL_1_0 + this->lightRing.timer = 0; +#endif Actor_Kill(&this->actor); this->lightRing.timer = 0; } else { @@ -960,10 +963,18 @@ void DemoEffect_InitCreationFireball(DemoEffect* this, PlayState* play) { Actor* parent = this->actor.parent; this->actor.world.rot.y = parent->shape.rot.y; + this->fireBall.timer = FRAMERATE_CONST(50, 42); this->actor.speed = FRAMERATE_CONST(1.5f, 1.8f); + +#if OOT_VERSION < PAL_1_0 + this->actor.gravity = -0.03f; + this->actor.minVelocityY = -1.5f; +#else this->actor.minVelocityY = FRAMERATE_CONST(-1.5f, -2.5f); this->actor.gravity = FRAMERATE_CONST(-0.03f, -0.05f); +#endif + this->updateFunc = DemoEffect_UpdateCreationFireball; } diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index f46760673e..063173c306 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -1,4 +1,5 @@ #include "z_demo_kankyo.h" +#include "versions.h" #include "z64cutscene_commands.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_efc_star_field/object_efc_star_field.h" @@ -14,7 +15,7 @@ void DemoKankyo_Draw(Actor* thisx, PlayState* play); void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play); void DemoKankyo_UpdateClouds(DemoKankyo* this, PlayState* play); void DemoKankyo_UpdateRock(DemoKankyo* this, PlayState* play); -void DemoKankyo_DoNothing2(DemoKankyo* this, PlayState* play); +void DemoKankyo_UpdateWarpIn(DemoKankyo* this, PlayState* play); void DemoKankyo_UpdateDoorOfTime(DemoKankyo* this, PlayState* play); void DemoKankyo_DoNothing(DemoKankyo* this, PlayState* play); void DemoKankyo_KillDoorOfTimeCollision(DemoKankyo* this, PlayState* play); @@ -355,7 +356,7 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { } } gSaveContext.cutsceneTrigger = 1; - DemoKankyo_SetupAction(this, DemoKankyo_DoNothing2); + DemoKankyo_SetupAction(this, DemoKankyo_UpdateWarpIn); break; case DEMOKANKYO_BLUE_RAIN: case DEMOKANKYO_SPARKLES: @@ -367,7 +368,11 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { void DemoKankyo_DoNothing(DemoKankyo* this, PlayState* play) { } -void DemoKankyo_DoNothing2(DemoKankyo* this, PlayState* play) { +void DemoKankyo_UpdateWarpIn(DemoKankyo* this, PlayState* play) { +#if OOT_VERSION < PAL_1_0 + Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif DemoKankyo_SetupAction(this, DemoKankyo_DoNothing); } @@ -798,8 +803,10 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { this->unk_150[i].unk_22++; } } else { +#if OOT_VERSION >= PAL_1_0 Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP_OUT - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif if (func_800BB2B4(&camPos, &sWarpRoll, &sWarpFoV, sWarpInCameraPoints, &this->unk_150[i].unk_20, &this->unk_150[i].unk_1C) != 0) { this->unk_150[i].unk_22++; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 93675ba319..b05855a7cb 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -5,6 +5,7 @@ */ #include "z_en_bw.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_bw/object_bw.h" @@ -137,7 +138,9 @@ void EnBw_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; +#if OOT_VERSION >= PAL_1_0 this->actor.colChkInfo.mass = MASS_HEAVY; +#endif this->actor.focus.pos = this->actor.world.pos; func_809CE9A8(this); this->color1.a = this->color1.r = 255; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 15bb64753c..5bdbf42d31 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -5,6 +5,7 @@ */ #include "z_en_dha.h" +#include "versions.h" #include "overlays/actors/ovl_En_Dh/z_en_dh.h" #include "assets/objects/object_dh/object_dh.h" @@ -245,7 +246,9 @@ void EnDha_Wait(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } if (this->actor.home.rot.z != 0) { @@ -285,7 +288,9 @@ void EnDha_Wait(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } this->actor.home.rot.z = 1; @@ -306,7 +311,9 @@ void EnDha_TakeDamage(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } Math_SmoothStepToS(&this->limbAngleX[1], 0, 1, 2000, 0); @@ -344,7 +351,9 @@ void EnDha_Die(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } Math_SmoothStepToS(&this->limbAngleX[1], 0, 1, 0x7D0, 0); diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 2bfee096dc..f6eaf076b5 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -240,7 +240,12 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { this->targetVtx[3].z = targetZ - 24.0f; SkelAnime_Update(&this->skelAnime); - if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) { +#if OOT_VERSION < PAL_1_0 + if (this->targetQuad.base.acFlags & AC_HIT) +#else + if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) +#endif + { this->targetQuad.base.acFlags &= ~AC_HIT; dx = fabsf(targetX - this->targetQuad.elem.acDmgInfo.hitPos.x); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index cf6f0aa275..8554c808aa 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -572,7 +572,11 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { u8 dialogState = this->dialogState; switch (EnGo2_GetDialogState(this, play)) { +#if OOT_VERSION < PAL_1_0 + case TEXT_STATE_CLOSING: +#else case TEXT_STATE_DONE: +#endif if (this->actor.textId == 0x305E) { if (!gSaveContext.save.info.playerData.bgsFlag) { EnGo2_GetItem(this, play, GI_SWORD_BIGGORON); @@ -1790,7 +1794,9 @@ void EnGo2_ReverseRolling(EnGo2* this, PlayState* play) { void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { +#if OOT_VERSION >= PAL_1_0 this->actor.parent = NULL; +#endif this->actionFunc = EnGo2_SetGetItem; } else { Actor_OfferGetItem(&this->actor, play, this->getItemId, this->actor.xzDistToPlayer + 1.0f, @@ -1980,9 +1986,13 @@ void EnGo2_Update(Actor* thisx, PlayState* play) { EnGo2_RollForward(this); Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius * 0.6f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); +#if OOT_VERSION < PAL_1_0 + func_80A44AB0(this, play); +#else if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { func_80A44AB0(this, play); } +#endif this->actionFunc(this, play); if (this->unk_211 == true) { func_80034F54(play, this->unk_226, this->unk_24A, 18); diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 44dc68f52a..6760bdda2a 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -5,6 +5,7 @@ */ #include "z_en_horse.h" +#include "versions.h" #include "overlays/actors/ovl_En_In/z_en_in.h" #include "assets/objects/object_horse/object_horse.h" #include "assets/objects/object_hni/object_hni.h" @@ -699,8 +700,10 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) { this->actor.world.rot.y = sHorseSpawns[i].angle; this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); spawn = true; +#if OOT_VERSION >= PAL_1_0 SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &this->actor.projectedPos, &this->actor.projectedW); +#endif } } } @@ -1738,8 +1741,10 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) { if (R_EPONAS_SONG_PLAYED && this->type == HORSE_EPONA) { R_EPONAS_SONG_PLAYED = false; if (EnHorse_Spawn(this, play) != 0) { +#if OOT_VERSION >= PAL_1_0 Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif this->stateFlags &= ~ENHORSE_INACTIVE; gSaveContext.save.info.horseData.sceneId = play->sceneId; @@ -1814,8 +1819,10 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { R_EPONAS_SONG_PLAYED = false; if (!func_80A5BBBC(play, this, &this->actor.world.pos)) { if (EnHorse_Spawn(this, play)) { +#if OOT_VERSION >= PAL_1_0 Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif this->followTimer = 0; EnHorse_SetFollowAnimation(this, play); Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor); @@ -1928,6 +1935,12 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { this->skin.skelAnime.playSpeed = 1.0f; this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; +#if OOT_VERSION < PAL_1_0 + if (this->stateFlags & ENHORSE_DRAW) { + Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } +#endif } else if (this->stateFlags & ENHORSE_TURNING_TO_PLAYER) { this->actor.world.rot.y += this->followPlayerTurnSpeed; this->actor.shape.rot.y = this->actor.world.rot.y; diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 1525d4779c..351d61fb72 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -1,4 +1,5 @@ #include "z_en_in.h" +#include "versions.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "assets/objects/object_in/object_in.h" @@ -933,6 +934,15 @@ void EnIn_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actionFunc != func_80A7A304) { func_80A79AB4(this, play); +#if OOT_VERSION < PAL_1_0 + Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, + ((this->actor.attentionRangeType == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, + EnIn_GetTextId, EnIn_UpdateTalkState); + if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { + this->unk_1FA = this->unk_1F8; + this->unk_1F8 = Message_GetState(&play->msgCtx); + } +#else if ((gSaveContext.subTimerSeconds < 6) && (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (Actor_TalkOfferAccepted(&this->actor, play)) {} @@ -945,6 +955,7 @@ void EnIn_Update(Actor* thisx, PlayState* play) { this->unk_1F8 = Message_GetState(&play->msgCtx); } } +#endif func_80A795C8(this, play); } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index bae3ee5818..9160bc41b1 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -5,6 +5,7 @@ */ #include "z_en_kz.h" +#include "versions.h" #include "assets/objects/object_kz/object_kz.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) @@ -120,6 +121,27 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { s16 talkState = NPC_TALK_STATE_TALKING; switch (Message_GetState(&play->msgCtx)) { + case TEXT_STATE_NONE: + case TEXT_STATE_DONE_HAS_NEXT: + break; +#if OOT_VERSION < PAL_1_0 + case TEXT_STATE_CLOSING: + talkState = NPC_TALK_STATE_IDLE; + switch (this->actor.textId) { + case 0x4012: + SET_INFTABLE(INFTABLE_139); + FALLTHROUGH; + case 0x401B: + talkState = NPC_TALK_STATE_ACTION; + break; + case 0x401F: + SET_INFTABLE(INFTABLE_139); + break; + } + break; +#else + case TEXT_STATE_CLOSING: + break; case TEXT_STATE_DONE: talkState = NPC_TALK_STATE_IDLE; switch (this->actor.textId) { @@ -135,6 +157,7 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { break; } break; +#endif case TEXT_STATE_DONE_FADING: if (this->actor.textId != 0x4014) { if (this->actor.textId == 0x401B && !this->sfxPlayed) { @@ -154,7 +177,9 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { } if (this->actor.textId == 0x4014) { if (play->msgCtx.choiceIndex == 0) { +#if OOT_VERSION >= PAL_1_0 EnKz_SetupGetItem(this, play); +#endif talkState = NPC_TALK_STATE_ACTION; } else { this->actor.textId = 0x4016; @@ -167,9 +192,13 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { talkState = NPC_TALK_STATE_ACTION; } break; - case TEXT_STATE_NONE: - case TEXT_STATE_DONE_HAS_NEXT: - case TEXT_STATE_CLOSING: +#if OOT_VERSION < PAL_1_0 + case TEXT_STATE_DONE: + if (Message_ShouldAdvance(play)) { + talkState = NPC_TALK_STATE_ITEM_GIVEN; + } + break; +#endif case TEXT_STATE_SONG_DEMO_DONE: case TEXT_STATE_8: case TEXT_STATE_9: @@ -206,6 +235,7 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera return true; } +#if OOT_VERSION >= PAL_1_0 if (*talkState != NPC_TALK_STATE_IDLE) { *talkState = updateTalkState(play, thisx); return false; @@ -219,12 +249,20 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera } thisx->flags |= ACTOR_FLAG_ATTENTION_ENABLED; +#endif Actor_GetScreenPos(play, thisx, &x, &y); if (!((x >= -30) && (x < 361) && (y >= -10) && (y < 241))) { return false; } +#if OOT_VERSION < PAL_1_0 + if (*talkState != NPC_TALK_STATE_IDLE) { + *talkState = updateTalkState(play, thisx); + return false; + } +#endif + xzDistToPlayer = thisx->xzDistToPlayer; thisx->xzDistToPlayer = Math_Vec3f_DistXZ(&thisx->home.pos, &player->actor.world.pos); if (Actor_OfferTalk(thisx, play, interactRange) == 0) { @@ -239,6 +277,17 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera void func_80A9CB18(EnKz* this, PlayState* play) { Player* player = GET_PLAYER(play); + f32 yaw; + +#if OOT_VERSION < PAL_1_0 + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos); + yaw -= this->actor.shape.rot.y; + if (fabsf(yaw) > 1820.0f) { + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + return; + } + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; +#endif if (EnKz_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, 340.0f, EnKz_GetTextId, EnKz_UpdateTalkState)) { @@ -259,11 +308,15 @@ void func_80A9CB18(EnKz* this, PlayState* play) { this->actor.textId = 0x4014; this->sfxPlayed = false; player->actor.textId = this->actor.textId; +#if OOT_VERSION >= PAL_1_0 this->isTrading = true; +#endif return; } +#if OOT_VERSION >= PAL_1_0 this->isTrading = false; +#endif if (GET_INFTABLE(INFTABLE_139)) { this->actor.textId = CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A; player->actor.textId = this->actor.textId; @@ -420,6 +473,9 @@ void EnKz_StopMweep(EnKz* this, PlayState* play) { void EnKz_Wait(EnKz* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { +#if OOT_VERSION < PAL_1_0 + this->interactInfo.talkState = NPC_TALK_STATE_IDLE; +#endif this->actionFunc = EnKz_SetupGetItem; EnKz_SetupGetItem(this, play); } else { @@ -437,7 +493,11 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_TALKING; this->actionFunc = EnKz_StartTimer; } else { +#if OOT_VERSION < PAL_1_0 + getItemId = func_8002F368(play) == EXCH_ITEM_PRESCRIPTION ? GI_EYEBALL_FROG : GI_TUNIC_ZORA; +#else getItemId = this->isTrading == true ? GI_EYEBALL_FROG : GI_TUNIC_ZORA; +#endif yRange = fabsf(this->actor.yDistToPlayer) + 1.0f; xzRange = this->actor.xzDistToPlayer + 1.0f; Actor_OfferGetItem(&this->actor, play, getItemId, xzRange, yRange); @@ -445,7 +505,12 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { } void EnKz_StartTimer(EnKz* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { +#if OOT_VERSION < PAL_1_0 + if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN) +#else + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) +#endif + { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEBALL_FROG) { Interface_SetSubTimer(180); CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE); @@ -467,9 +532,13 @@ void EnKz_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelanime); EnKz_UpdateEyes(this); Actor_MoveXZGravity(&this->actor); +#if OOT_VERSION < PAL_1_0 + func_80A9CB18(this, play); +#else if (this->actionFunc != EnKz_StartTimer) { func_80A9CB18(this, play); } +#endif this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 7df5129426..27f0d1174a 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -335,6 +335,7 @@ void EnMa3_Update(Actor* thisx, PlayState* play) { EnMa3_UpdateEyes(this); this->actionFunc(this, play); func_80AA2E54(this, play); + #if !OOT_PAL_N64 Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 150.0f, EnMa3_GetTextId, EnMa3_UpdateTalkState); @@ -342,6 +343,8 @@ void EnMa3_Update(Actor* thisx, PlayState* play) { EnMa3_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 150.0f, EnMa3_GetTextId, EnMa3_UpdateTalkState); #endif + +#if OOT_VERSION >= PAL_1_0 if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->isNotSinging) { // Turn on singing @@ -353,6 +356,7 @@ void EnMa3_Update(Actor* thisx, PlayState* play) { Audio_ToggleMalonSinging(true); this->isNotSinging = true; } +#endif } s32 EnMa3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index e92cd0e387..6318e1ea04 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -605,7 +605,9 @@ void EnMb_Stunned(EnMb* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attack = ENMB_ATTACK_NONE; } @@ -714,17 +716,21 @@ void EnMb_ClubWaitAfterAttack(EnMb* this, PlayState* play) { * Slow down, charge again if the player is near, or resume walking. */ void EnMb_SpearPatrolEndCharge(EnMb* this, PlayState* play) { +#if OOT_VERSION >= PAL_1_0 Player* player = GET_PLAYER(play); +#endif f32 lastFrame; s16 relYawFromPlayer; s16 yawPlayerToWaypoint; +#if OOT_VERSION >= PAL_1_0 if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } +#endif if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f); @@ -945,12 +951,17 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, PlayState* play) { if (endCharge) { if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { -#if OOT_VERSION < NTSC_1_2 +#if OOT_VERSION < PAL_1_0 + player->stateFlags2 &= ~PLAYER_STATE2_7; + this->attackCollider.base.atFlags &= ~AT_HIT; + player->actor.parent = NULL; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#elif OOT_VERSION < NTSC_1_2 player->stateFlags2 &= ~PLAYER_STATE2_7; this->attackCollider.base.atFlags &= ~AT_HIT; player->actor.parent = NULL; player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); #else this->attackCollider.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & PLAYER_STATE2_7) { @@ -1022,12 +1033,17 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, PlayState* play) { if (endCharge) { if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { -#if OOT_VERSION < NTSC_1_2 +#if OOT_VERSION < PAL_1_0 + this->attackCollider.base.atFlags &= ~AT_HIT; + player->stateFlags2 &= ~PLAYER_STATE2_7; + player->actor.parent = NULL; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#elif OOT_VERSION < NTSC_1_2 this->attackCollider.base.atFlags &= ~AT_HIT; player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); #else this->attackCollider.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & PLAYER_STATE2_7) { @@ -1316,7 +1332,9 @@ void EnMb_SpearDead(EnMb* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attack = ENMB_ATTACK_NONE; } @@ -1399,7 +1417,9 @@ void EnMb_CheckColliding(EnMb* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); } this->damageEffect = this->actor.colChkInfo.damageEffect; diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 9d8edf6a1e..777c6651f6 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -6,6 +6,7 @@ #include "z_en_okarina_effect.h" #include "terminal.h" +#include "versions.h" #include "z64frame_advance.h" @@ -38,8 +39,13 @@ void EnOkarinaEffect_Destroy(Actor* thisx, PlayState* play) { EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; play->envCtx.precipitation[PRECIP_SOS_MAX] = 0; +#if OOT_VERSION < PAL_1_0 + if ((gWeatherMode == WEATHER_MODE_CLEAR) && (play->envCtx.stormRequest == STORM_REQUEST_START)) +#else if ((gWeatherMode != WEATHER_MODE_RAIN) && (gWeatherMode != WEATHER_MODE_HEAVY_RAIN) && - (play->envCtx.stormRequest == STORM_REQUEST_START)) { + (play->envCtx.stormRequest == STORM_REQUEST_START)) +#endif + { play->envCtx.stormRequest = STORM_REQUEST_STOP; Environment_StopStormNatureAmbience(play); } diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 908a0d93d0..5e9e95ad3d 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -6,6 +6,7 @@ #include "z_en_weather_tag.h" #include "terminal.h" +#include "versions.h" #define FLAGS ACTOR_FLAG_4 @@ -140,8 +141,13 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, PlayState* play, u8 s if (play->envCtx.stormRequest == STORM_REQUEST_NONE && ((play->envCtx.lightMode != LIGHT_MODE_TIME) || (play->envCtx.lightConfig != 1 && !play->envCtx.changeLightEnabled))) { +#if OOT_VERSION >= PAL_1_0 gInterruptSongOfStorms = false; +#endif if (gWeatherMode != weatherMode) { +#if OOT_VERSION < PAL_1_0 + gInterruptSongOfStorms = false; +#endif gWeatherMode = weatherMode; if (play->envCtx.stormRequest == STORM_REQUEST_NONE) { play->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED; diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 8d2e130c1c..acb8b32bbe 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1267,7 +1267,9 @@ void EnWf_UpdateDamage(EnWf* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) { this->damageEffect = this->actor.colChkInfo.damageEffect; Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.elem, true); +#if OOT_VERSION >= PAL_1_0 this->slashStatus = 0; +#endif if ((this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_STUN) || (this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_UNDEF)) {