From 2740bb020ed2f4d3287c1111ea79e54fd85c24df Mon Sep 17 00:00:00 2001 From: cadmic Date: Mon, 16 Sep 2024 07:51:02 -0700 Subject: [PATCH] [PAL N64] Match changes that first appear in NTSC 1.2 (#2201) --- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 8 +++++++- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 20 ++++++++++++++++--- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 17 ++++++++++++++++ .../actors/ovl_En_Torch2/z_en_torch2.c | 10 +++++++++- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 1081d2685a..dbddf628b8 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1,4 +1,5 @@ #include "z_boss_ganon2.h" +#include "versions.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" #include "overlays/actors/ovl_Demo_Gj/z_demo_gj.h" #include "overlays/actors/ovl_En_Zl3/z_en_zl3.h" @@ -1405,7 +1406,12 @@ void func_80900890(BossGanon2* this, PlayState* play) { f32 temp_f2 = -200.0f - player->actor.world.pos.x; f32 temp_f12 = -200.0f - player->actor.world.pos.z; - if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) <= 784.0f) { +#if OOT_VERSION < NTSC_1_2 + if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) <= 800.0f) +#else + if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) <= 784.0f) +#endif + { Animation_MorphToPlayOnce(&this->skelAnime, &gGanonGetUpAnim, 0.0f); this->unk_194 = Animation_GetLastFrame(&gGanonGetUpAnim); this->unk_1AC = 2; diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index db08bc13f2..d4fab125f9 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -5,6 +5,7 @@ */ #include "z_boss_sst.h" +#include "versions.h" #include "assets/objects/object_sst/object_sst.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h" @@ -51,7 +52,7 @@ typedef enum BossSstEffectMode { void BossSst_Init(Actor* thisx, PlayState* play2); void BossSst_Destroy(Actor* thisx, PlayState* play); void BossSst_UpdateHand(Actor* thisx, PlayState* play); -void BossSst_UpdateHead(Actor* thisx, PlayState* play); +void BossSst_UpdateHead(Actor* thisx, PlayState* play2); void BossSst_DrawHand(Actor* thisx, PlayState* play); void BossSst_DrawHead(Actor* thisx, PlayState* play); void BossSst_UpdateEffects(Actor* thisx, PlayState* play); @@ -2606,10 +2607,16 @@ void BossSst_UpdateHand(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base); } +#if OOT_VERSION < NTSC_1_2 + if (this->colliderJntSph.base.acFlags & AC_ON) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); + } +#else if ((sHead->actionFunc != BossSst_HeadLurk) && (sHead->actionFunc != BossSst_HeadIntro) && (this->colliderJntSph.base.acFlags & AC_ON)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } +#endif if (this->colliderJntSph.base.ocFlags1 & OC1_ON) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base); @@ -2638,8 +2645,8 @@ void BossSst_UpdateHand(Actor* thisx, PlayState* play) { BossSst_UpdateEffects(&this->actor, play); } -void BossSst_UpdateHead(Actor* thisx, PlayState* play) { - s32 pad; +void BossSst_UpdateHead(Actor* thisx, PlayState* play2) { + PlayState* play = (PlayState*)play2; BossSst* this = (BossSst*)thisx; Actor_WorldToActorCoords(&this->actor, &sHandOffsets[RIGHT], &sHands[RIGHT]->actor.world.pos); @@ -2662,12 +2669,19 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base); } +#if OOT_VERSION < NTSC_1_2 + if (this->colliderCyl.base.acFlags & AC_ON) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base); + } + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); +#else if ((this->actionFunc != BossSst_HeadLurk) && (this->actionFunc != BossSst_HeadIntro)) { if (this->colliderCyl.base.acFlags & AC_ON) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base); } CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } +#endif if (this->colliderJntSph.base.ocFlags1 & OC1_ON) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base); 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 12c21757db..efe4b7c540 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -6,6 +6,7 @@ #include "z_en_mb.h" #include "assets/objects/object_mb/object_mb.h" +#include "versions.h" /* * This actor can have three behaviors: @@ -943,6 +944,13 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, PlayState* play) { if (endCharge) { if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { +#if 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); +#else this->attackCollider.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & PLAYER_STATE2_7) { player->stateFlags2 &= ~PLAYER_STATE2_7; @@ -950,6 +958,7 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, PlayState* play) { player->av2.actionVar2 = 200; func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } +#endif } this->attack = ENMB_ATTACK_NONE; this->actor.speed = -10.0f; @@ -1012,6 +1021,13 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, PlayState* play) { if (endCharge) { if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { +#if 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); +#else this->attackCollider.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & PLAYER_STATE2_7) { player->stateFlags2 &= ~PLAYER_STATE2_7; @@ -1019,6 +1035,7 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, PlayState* play) { player->av2.actionVar2 = 200; func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } +#endif this->attack = ENMB_ATTACK_NONE; this->actor.speed = -10.0f; EnMb_SetupSpearPatrolEndCharge(this); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 287a5912f0..b3a60cf933 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -6,6 +6,7 @@ #include "z_en_torch2.h" #include "assets/objects/object_torch2/object_torch2.h" +#include "versions.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -492,7 +493,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->actor.world.pos.y = sSpawnPoint.y + 40.0f; this->actor.world.pos.x = (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.x; this->actor.world.pos.z = (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.z; - if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) { +#if OOT_VERSION < NTSC_1_2 + if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 1000.0f) +#else + if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) +#endif + { f32 sp50 = Rand_ZeroOne() * 20.0f; s16 sp4E = Rand_CenteredFloat(4000.0f); @@ -506,7 +512,9 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } else { this->actor.world.pos.y = this->actor.floorHeight; } +#if OOT_VERSION >= NTSC_1_2 Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); +#endif play->func_11D54(this, play); sActionState = ENTORCH2_ATTACK; sStickTilt = 0.0f;