summaryrefslogtreecommitdiff
path: root/soh
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-04-07 17:06:58 -0400
committerGitHub <noreply@github.com>2023-04-07 17:06:58 -0400
commit330da0b5ec7adebbbc368aaa0af23402cc631896 (patch)
treec47f58c9cdcee1b291c3a33732df4d3ba8104c2a /soh
parent1fa31410c263768ddfd31bb13a9ba036c438a2c4 (diff)
parent2149cd1fdd5a0202545c630588c0a37764870359 (diff)
khan -> dev
Diffstat (limited to 'soh')
-rw-r--r--soh/include/z64save.h6
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/location_access/locacc_jabujabus_belly.cpp6
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/location_access/locacc_shadow_temple.cpp41
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/setting_descriptions.cpp6
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/setting_descriptions.hpp1
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/settings.cpp3
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/settings.hpp1
-rw-r--r--soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c51
-rw-r--r--soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h7
-rw-r--r--soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c95
10 files changed, 134 insertions, 83 deletions
diff --git a/soh/include/z64save.h b/soh/include/z64save.h
index 0a3352e1c..bc563ac8a 100644
--- a/soh/include/z64save.h
+++ b/soh/include/z64save.h
@@ -697,12 +697,12 @@ typedef enum {
#define INFTABLE_F4 0xF4
#define INFTABLE_F8 0xF8
#define INFTABLE_FC 0xFC
-#define INFTABLE_109 0x109
+#define INFTABLE_GORON_CITY_DOORS_UNLOCKED 0x109
#define INFTABLE_10A 0x10A
#define INFTABLE_10B 0x10B
-#define INFTABLE_10C 0x10C
+#define INFTABLE_STOPPED_GORON_LINKS_ROLLING 0x10C
#define INFTABLE_10D 0x10D
-#define INFTABLE_10E 0x10E
+#define INFTABLE_SPOKE_TO_GORON_LINK 0x10E
#define INFTABLE_10F 0x10F
#define INFTABLE_113 0x113
#define INFTABLE_11A 0x11A
diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_jabujabus_belly.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_jabujabus_belly.cpp
index 5cb561c7e..38904488a 100644
--- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_jabujabus_belly.cpp
+++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_jabujabus_belly.cpp
@@ -215,8 +215,7 @@ void AreaTable_Init_JabuJabusBelly() {
areaTable[JABU_JABUS_BELLY_MQ_BOSS_AREA] = Area("Jabu Jabus Belly MQ Boss Area", "Jabu Jabus Belly", JABU_JABUS_BELLY, NO_DAY_NIGHT_CYCLE, {
//Events
- EventAccess(&FairyPot, {[]{return true;}}),
- EventAccess(&JabuJabusBellyClear, {[]{return true;}}),
+ EventAccess(&FairyPot, {[]{return true;}}),
}, {
//Locations
LocationAccess(JABU_JABUS_BELLY_MQ_COW, {[]{return CanPlay(EponasSong);}}),
@@ -245,7 +244,8 @@ void AreaTable_Init_JabuJabusBelly() {
Area("Jabu Jabus Belly Boss Room", "Jabu Jabus Belly", NONE, NO_DAY_NIGHT_CYCLE,
{
// Events
- EventAccess(&JabuJabusBellyClear, { [] { return JabuJabusBellyClear || CanUse(BOOMERANG); } }),
+ EventAccess(&JabuJabusBellyClear,
+ { [] { return JabuJabusBellyClear || (CanUse(BOOMERANG) && CanJumpslash); } }),
},
{
// Locations
diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_shadow_temple.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_shadow_temple.cpp
index 5d0a4e085..3ac96a5cb 100644
--- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_shadow_temple.cpp
+++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_shadow_temple.cpp
@@ -193,24 +193,25 @@ void AreaTable_Init_ShadowTemple() {
Entrance(SHADOW_TEMPLE_BOSS_ROOM, { [] { return true; } }),
});
- areaTable[SHADOW_TEMPLE_BOSS_ROOM] =
- Area("Shadow Temple Boss Room", "Shadow Temple", NONE, NO_DAY_NIGHT_CYCLE,
- {
- // Events
- EventAccess(&ShadowTempleClear, { [] {
- return ShadowTempleClear ||
- ((CanUse(LENS_OF_TRUTH) || ((Dungeon::ShadowTemple.IsVanilla() && LogicLensShadowBack) ||
- (Dungeon::ShadowTemple.IsMQ() && LogicLensShadowMQBack))) &&
- (CanUse(KOKIRI_SWORD) || CanUse(MASTER_SWORD) || CanUse(BIGGORON_SWORD)));
- } }),
- },
- {
- // Locations
- LocationAccess(SHADOW_TEMPLE_BONGO_BONGO_HEART, { [] { return ShadowTempleClear; } }),
- LocationAccess(BONGO_BONGO, { [] { return ShadowTempleClear; } }),
- },
- {
- // Exits
- Entrance(SHADOW_TEMPLE_BOSS_ENTRYWAY, { [] { return false; } }),
- });
+ areaTable[SHADOW_TEMPLE_BOSS_ROOM] = Area(
+ "Shadow Temple Boss Room", "Shadow Temple", NONE, NO_DAY_NIGHT_CYCLE,
+ {
+ // Events
+ EventAccess(&ShadowTempleClear, { [] {
+ return ShadowTempleClear ||
+ ((CanUse(LENS_OF_TRUTH) || ((Dungeon::ShadowTemple.IsVanilla() && LogicLensShadowBack) ||
+ (Dungeon::ShadowTemple.IsMQ() && LogicLensShadowMQBack))) &&
+ (CanUse(KOKIRI_SWORD) || CanUse(MASTER_SWORD) || CanUse(BIGGORON_SWORD) || LogicShadowBongo) &&
+ (CanUse(HOOKSHOT) || CanUse(BOW) || CanUse(SLINGSHOT)));
+ } }),
+ },
+ {
+ // Locations
+ LocationAccess(SHADOW_TEMPLE_BONGO_BONGO_HEART, { [] { return ShadowTempleClear; } }),
+ LocationAccess(BONGO_BONGO, { [] { return ShadowTempleClear; } }),
+ },
+ {
+ // Exits
+ Entrance(SHADOW_TEMPLE_BOSS_ENTRYWAY, { [] { return false; } }),
+ });
}
diff --git a/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.cpp b/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.cpp
index ed857e82c..eabfe7ccf 100644
--- a/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.cpp
+++ b/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.cpp
@@ -1435,6 +1435,12 @@ string_view LogicShadowStatueDesc = "Difficulty: Novice\n"
"By sending a Bombchu around the edge of the gorge,"
"you can knock down the statue without needing a\n"//
"Bow. Applies in both vanilla and MQ Shadow."; //
+string_view LogicShadowBongoDesc = "Difficulty Expert\n" //
+ "Using precise sword slashes, Bongo Bongo can be\n"//
+ "defeated without using projectiles.\n" //
+ "This trick is much more difficult when done with\n"
+ "Kokiri Sword vs Master Sword or Biggorron Sword.\n"
+ "Useful for Boss Entrance Randomizer."; //
string_view LogicChildDeadhandDesc = "Difficulty: Novice\n" //
"Requires 9 sticks or 5 jump slashes."; //
string_view LogicGtgWithoutHookshotDesc = "Difficulty: Expert\n" //
diff --git a/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.hpp b/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.hpp
index fae3ee995..e50584578 100644
--- a/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.hpp
+++ b/soh/soh/Enhancements/randomizer/3drando/setting_descriptions.hpp
@@ -431,6 +431,7 @@ extern string_view LogicShadowFireArrowEntryDesc;
extern string_view LogicShadowUmbrellaDesc;
extern string_view LogicShadowFreestandingKeyDesc;
extern string_view LogicShadowStatueDesc;
+extern string_view LogicShadowBongoDesc;
extern string_view LogicChildDeadhandDesc;
extern string_view LogicGtgWithoutHookshotDesc;
extern string_view LogicGtgFakeWallDesc;
diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp
index cba1384e6..7d61fd71f 100644
--- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp
+++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp
@@ -726,6 +726,7 @@ namespace Settings {
Option LogicShadowUmbrella = LogicTrick(" ShT Stone Umbrella\n w/ Hover Boots", LogicShadowUmbrellaDesc);
Option LogicShadowFreestandingKey = LogicTrick(" ShT Skull Vase Key\n w/ Bombchu", LogicShadowFreestandingKeyDesc);
Option LogicShadowStatue = LogicTrick(" ShT River Statue\n w/ Bombchu", LogicShadowStatueDesc);
+ Option LogicShadowBongo = LogicTrick("ShT Bongo\n w/o Projectiles", LogicShadowBongoDesc);
Option LogicChildDeadhand = LogicTrick(" BotW Deadhand\n w/o Sword", LogicChildDeadhandDesc);
Option LogicGtgWithoutHookshot = LogicTrick(" GTG West Silver Rupee\n w/o Hookshot", LogicGtgWithoutHookshotDesc);
Option LogicGtgFakeWall = LogicTrick(" GTG Invisible Wall\n w/ Hover Boots", LogicGtgFakeWallDesc);
@@ -816,6 +817,7 @@ namespace Settings {
&LogicShadowUmbrella,
&LogicShadowFreestandingKey,
&LogicShadowStatue,
+ &LogicShadowBongo,
&LogicChildDeadhand,
&LogicGtgWithoutHookshot,
&LogicGtgFakeWall,
@@ -2287,6 +2289,7 @@ namespace Settings {
LogicSpiritSunChest.SetSelectedIndex(1);
//LogicShadowFireArrowEntry.SetSelectedIndex(1);
LogicShadowUmbrella.SetSelectedIndex(1);
+ LogicShadowBongo.SetSelectedIndex(1);
LogicGtgWithoutHookshot.SetSelectedIndex(1);
}
}
diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.hpp b/soh/soh/Enhancements/randomizer/3drando/settings.hpp
index dd394b832..9905ab313 100644
--- a/soh/soh/Enhancements/randomizer/3drando/settings.hpp
+++ b/soh/soh/Enhancements/randomizer/3drando/settings.hpp
@@ -1186,6 +1186,7 @@ void UpdateSettings(std::unordered_map<RandomizerSettingKey, uint8_t> cvarSettin
extern Option LogicShadowUmbrella;
extern Option LogicShadowFreestandingKey;
extern Option LogicShadowStatue;
+ extern Option LogicShadowBongo;
extern Option LogicChildDeadhand;
extern Option LogicGtgWithoutHookshot;
extern Option LogicGtgFakeWall;
diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c
index 4df085747..8ccfd984c 100644
--- a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c
+++ b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c
@@ -268,7 +268,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
Vec3f spD4;
Vec3f spC8;
Vec3f spBC;
- u8* temp_s2;
+ u8* shadowTex;
s32 temp_x;
s32 temp_z;
s32 x;
@@ -279,8 +279,8 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
s32 l;
s16 rotY;
- temp_s2 = ALIGN16((uintptr_t)(&this->shadowTexture));
- memset(temp_s2, 0, 0x1000);
+ shadowTex = COBRA_SHADOW_TEX_PTR(this);
+ memset(shadowTex, 0, COBRA_SHADOW_TEX_SIZE);
Matrix_RotateX((M_PI / 4), MTXMODE_NEW);
rotY = !(this->dyna.actor.params & 3) ? (this->dyna.actor.shape.rot.y + 0x4000)
@@ -307,7 +307,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
for (l = 0; l < 11; l++) {
temp_x = x - 5 + l;
if (!(temp_x & ~0x3F)) {
- temp_s2[temp_z + temp_x] |= D_8089731C[k][l];
+ shadowTex[temp_z + temp_x] |= D_8089731C[k][l];
}
}
}
@@ -334,7 +334,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
for (l = 0; l < 3; l++) {
temp_x = x - 1 + l;
if (!(temp_x & ~0x3F)) {
- temp_s2[temp_z + temp_x] |= D_80897398[k][l];
+ shadowTex[temp_z + temp_x] |= D_80897398[k][l];
}
}
}
@@ -343,13 +343,13 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
}
for (i = 0; i < 0x40; i++) {
- temp_s2[0 * 0x40 + i] = 0;
- temp_s2[0x3F * 0x40 + i] = 0;
+ shadowTex[0 * 0x40 + i] = 0;
+ shadowTex[0x3F * 0x40 + i] = 0;
}
for (j = 1; j < 0x3F; j++) {
- temp_s2[j * 0x40 + 0] = 0;
- temp_s2[j * 0x40 + 0x3F] = 0;
+ shadowTex[j * 0x40 + 0] = 0;
+ shadowTex[j * 0x40 + 0x3F] = 0;
}
if (D_80897398[0][0]) {}
}
@@ -363,15 +363,15 @@ void BgJyaCobra_UpdateShadowFromTop(BgJyaCobra* this) {
s32 j;
s32 i_copy;
s32 counter;
- u8* temp_s0;
+ u8* shadowTex;
u8* sp40;
for (i = 0; i < 0x40; i++) {
sp58[i] = SQ(i - 31.5f);
}
- sp40 = temp_s0 = (u8*)ALIGN16((uintptr_t)(&this->shadowTexture));
- memset(temp_s0, 0, 0x1000);
+ sp40 = shadowTex = COBRA_SHADOW_TEX_PTR(this);
+ memset(shadowTex, 0, COBRA_SHADOW_TEX_SIZE);
for (i = 0; i != 0x40; i++) {
f32 temp_f12 = sp58[i];
@@ -388,12 +388,12 @@ void BgJyaCobra_UpdateShadowFromTop(BgJyaCobra* this) {
for (i_copy = 0x780, counter = 0; counter < 4; counter++, i_copy += 0x40) {
i = i_copy;
for (j = 4; j < 0x3C; j++) {
- if (temp_s0[i_copy + j] < D_80897518[counter]) {
- temp_s0[i_copy + j] = D_80897518[counter];
+ if (shadowTex[i_copy + j] < D_80897518[counter]) {
+ shadowTex[i_copy + j] = D_80897518[counter];
}
}
- temp_s0[i + 0x3C] = 0x20;
- temp_s0[i + 0x3] = 0x20;
+ shadowTex[i + 0x3C] = 0x20;
+ shadowTex[i + 0x3] = 0x20;
}
}
@@ -422,7 +422,7 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) {
// "(jya cobra)"
osSyncPrintf("(jya コブラ)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n", this->dyna.actor.params, this,
- &this->shadowTexture, ALIGN16((s32)(&this->shadowTexture)));
+ &this->shadowTextureBuffer, COBRA_SHADOW_TEX_PTR(this));
}
void BgJyaCobra_Destroy(Actor* thisx, PlayState* play) {
@@ -452,7 +452,7 @@ void func_80896950(BgJyaCobra* this, PlayState* play) {
if (fabsf(this->dyna.unk_150) > 0.001f) {
this->dyna.unk_150 = 0.0f;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_4;
}
}
@@ -494,7 +494,7 @@ void func_80896ABC(BgJyaCobra* this, PlayState* play) {
if (Math_ScaledStepToS(&this->unk_170, this->unk_16A * 0x2000, this->unk_16E)) {
this->unk_16C = (this->unk_16C + this->unk_16A) & 7;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_4;
this->dyna.unk_150 = 0.0f;
func_80896918(this, play);
} else {
@@ -502,7 +502,7 @@ void func_80896ABC(BgJyaCobra* this, PlayState* play) {
(this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y + this->unk_170;
}
- if (player->stateFlags2 & 0x10) {
+ if (player->stateFlags2 & PLAYER_STATE2_4) {
if (this->unk_172) {
func_80895BEC(this, play);
}
@@ -585,6 +585,11 @@ void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) {
Math_Vec3f_Copy(&sp64, &this->dyna.actor.world.pos);
}
+ // Fixes cobra statue shadow texture not updating when rotating it
+ if (this->actionFunc == func_80896ABC) {
+ gSPInvalidateTexCache(POLY_XLU_DISP++, COBRA_SHADOW_TEX_PTR(this));
+ }
+
Matrix_SetTranslateRotateYXZ(sp64.x, sp64.y, sp64.z, phi_a3);
Matrix_Scale(D_80897548[params].x, D_80897548[params].y, D_80897548[params].z, MTXMODE_APPLY);
@@ -594,9 +599,9 @@ void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gDPLoadTextureBlock(POLY_XLU_DISP++, ALIGN16((uintptr_t)(&this->shadowTexture)), G_IM_FMT_I, G_IM_SIZ_8b, 0x40, 0x40, 0,
- G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOLOD);
+ gDPLoadTextureBlock(POLY_XLU_DISP++, COBRA_SHADOW_TEX_PTR(this), G_IM_FMT_I, G_IM_SIZ_8b, COBRA_SHADOW_TEX_WIDTH,
+ COBRA_SHADOW_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPDisplayList(POLY_XLU_DISP++, sShadowDL);
diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h
index 8cc7ed0f9..053b6f3ba 100644
--- a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h
+++ b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h
@@ -8,6 +8,11 @@ struct BgJyaCobra;
typedef void (*BgJyaCobraActionFunc)(struct BgJyaCobra*, PlayState*);
+#define COBRA_SHADOW_TEX_WIDTH 64
+#define COBRA_SHADOW_TEX_HEIGHT 64
+#define COBRA_SHADOW_TEX_SIZE (COBRA_SHADOW_TEX_WIDTH * COBRA_SHADOW_TEX_HEIGHT * G_IM_SIZ_8b_BYTES)
+#define COBRA_SHADOW_TEX_PTR(this) (u8*)ALIGN16((uintptr_t)&(this)->shadowTextureBuffer)
+
typedef struct BgJyaCobra {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgJyaCobraActionFunc actionFunc;
@@ -21,7 +26,7 @@ typedef struct BgJyaCobra {
/* 0x0180 */ Vec3f unk_180;
/* 0x018C */ f32 unk_18C;
/* 0x0190 */ f32 unk_190;
- /* 0x0194 */ u8 shadowTexture[0x1010];
+ /* 0x0194 */ u8 shadowTextureBuffer[COBRA_SHADOW_TEX_SIZE / sizeof(u8) + 0xF]; // Extra space to allow aligning actual texture to 0x10
} BgJyaCobra; // size = 0x11A4
#endif
diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c
index 640b04cfa..c70a55932 100644
--- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c
+++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c
@@ -511,8 +511,18 @@ s16 EnGo2_UpdateTalkStateGoronCityLowestFloor(PlayState* play, EnGo2* this) {
}
u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) {
- if(gSaveContext.n64ddFlag) {
- return 0x3036;
+ // For rando, prioritize opening the doors in GC when Link the goron has been stopped when
+ // the doors are not opened, otherwise let him talk about the DMC exit or that gorons are saved
+ if (gSaveContext.n64ddFlag) {
+ if (!Flags_GetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING)) {
+ return 0x3030;
+ } else if (!Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) {
+ return 0x3036;
+ } else if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE)) {
+ return 0x3041;
+ } else {
+ return Flags_GetInfTable(INFTABLE_SPOKE_TO_GORON_LINK) ? 0x3038 : 0x3037;
+ }
}
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
@@ -531,29 +541,28 @@ u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) {
s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) {
switch (EnGo2_GetDialogState(this, play)) {
case TEXT_STATE_CLOSING:
- if(!gSaveContext.n64ddFlag) {
- switch (this->actor.textId) {
- case 0x3036:
+ switch (this->actor.textId) {
+ case 0x3036:
+ if (!gSaveContext.n64ddFlag) {
EnGo2_GetItem(this, play, GI_TUNIC_GORON);
this->actionFunc = EnGo2_SetupGetItem;
return NPC_TALK_STATE_ACTION;
- case 0x3037:
- gSaveContext.infTable[16] |= 0x4000;
- default:
- return NPC_TALK_STATE_IDLE;
- }
- } else {
- if (Flags_GetTreasure(play, 0x1F)) {
+ } else {
+ if (Flags_GetTreasure(play, 0x1F)) {
+ return NPC_TALK_STATE_IDLE;
+ }
+
+ Flags_SetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED);
+ EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
+ this->actionFunc = EnGo2_SetupGetItem;
+ Flags_SetTreasure(play, 0x1F);
+ return NPC_TALK_STATE_ACTION;
+ }
+ case 0x3037:
+ gSaveContext.infTable[16] |= 0x4000;
+ default:
return NPC_TALK_STATE_IDLE;
- }
-
- gSaveContext.infTable[16] |= 0x200;
- EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
- this->actionFunc = EnGo2_SetupGetItem;
- Flags_SetTreasure(play, 0x1F);
- return NPC_TALK_STATE_ACTION;
}
-
case TEXT_STATE_CHOICE:
if (Message_ShouldAdvance(play)) {
if (this->actor.textId == 0x3034) {
@@ -1210,7 +1219,9 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) {
(this->actor.params & 0x1F) == GORON_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ||
(this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) {
return true;
- } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
+ } else if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
+ (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) &&
+ CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
return true;
} else {
return false;
@@ -1267,7 +1278,9 @@ void EnGo2_SelectGoronWakingUp(EnGo2* this) {
EnGo2_BiggoronWakingUp(this);
break;
case GORON_CITY_LINK:
- if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
+ if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
+ (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) &&
+ CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
EnGo2_WakingUp(this);
break;
}
@@ -1627,7 +1640,9 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
if ((gSaveContext.infTable[16] & 0x200)) {
Path_CopyLastPoint(this->path, &this->actor.world.pos);
this->actor.home.pos = this->actor.world.pos;
- if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
+ if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
+ (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) &&
+ CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
EnGo2_GetItemAnimation(this, play);
} else {
this->actionFunc = EnGo2_CurledUp;
@@ -1855,15 +1870,36 @@ void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) {
void EnGo2_SetGetItem(EnGo2* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
+
+ // For randomizer, handle updating the states for the gorons after receiving the item based on
+ // the goron type rather then the item being received
+ if (gSaveContext.n64ddFlag) {
+ switch (this->actor.params & 0x1F) {
+ case GORON_DMT_BIGGORON:
+ // Resolves #1301. unk_13EE is used to set the opacity of the HUD. The trade sequence discussion with Biggoron
+ // sets the HUD to transparent, and it is restored at z_message_PAL:3549, but by specifically watching for
+ // trade sequence items, this leaves it transparent for non-trade sequence items (in rando) so we fix that here
+ gSaveContext.unk_13EE = 0x32;
+ return;
+ case GORON_CITY_LINK:
+ EnGo2_GetItemAnimation(this, play);
+ return;
+ case GORON_CITY_ROLLING_BIG:
+ EnGo2_RollingAnimation(this, play);
+ this->actionFunc = EnGo2_GoronRollingBigContinueRolling;
+ return;
+ }
+ this->actionFunc = func_80A46B40;
+ return;
+ }
+
switch (this->getItemId) {
case GI_CLAIM_CHECK:
Environment_ClearBgsDayCount();
EnGo2_GetItemAnimation(this, play);
return;
case GI_TUNIC_GORON:
- if (!gSaveContext.n64ddFlag) {
- gSaveContext.infTable[16] |= 0x200;
- }
+ gSaveContext.infTable[16] |= 0x200;
EnGo2_GetItemAnimation(this, play);
return;
case GI_SWORD_BGS:
@@ -1875,13 +1911,6 @@ void EnGo2_SetGetItem(EnGo2* this, PlayState* play) {
this->actionFunc = EnGo2_GoronRollingBigContinueRolling;
return;
}
-
- if (gSaveContext.n64ddFlag) {
- // Resolves #1301. unk_13EE is used to set the opacity of the HUD. The trade sequence discussion with Biggoron
- // sets the HUD to transparent, and it is restored at z_message_PAL:3549, but by specifically watching for
- // trade sequence items, this leaves it transparent for non-trade sequence items (in rando) so we fix that here
- gSaveContext.unk_13EE = 0x32;
- }
this->actionFunc = func_80A46B40;
}
}