mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 11:22:17 -05:00
Fix: Goron Link's text in randomizer and have Big rolling goron continue rolling (#2670)
* fix link the gorons text ids in rando * document goron link flags * check for fire temple clear instead of medallion for link goron * stop goron link from shivering after opening doors and have big rolling goron resume rolling after giving check * remove unneeded rando check * add comments
This commit is contained in:
parent
5f708251a6
commit
ad60ad7c2b
@ -682,12 +682,12 @@ typedef enum {
|
|||||||
#define INFTABLE_F4 0xF4
|
#define INFTABLE_F4 0xF4
|
||||||
#define INFTABLE_F8 0xF8
|
#define INFTABLE_F8 0xF8
|
||||||
#define INFTABLE_FC 0xFC
|
#define INFTABLE_FC 0xFC
|
||||||
#define INFTABLE_109 0x109
|
#define INFTABLE_GORON_CITY_DOORS_UNLOCKED 0x109
|
||||||
#define INFTABLE_10A 0x10A
|
#define INFTABLE_10A 0x10A
|
||||||
#define INFTABLE_10B 0x10B
|
#define INFTABLE_10B 0x10B
|
||||||
#define INFTABLE_10C 0x10C
|
#define INFTABLE_STOPPED_GORON_LINKS_ROLLING 0x10C
|
||||||
#define INFTABLE_10D 0x10D
|
#define INFTABLE_10D 0x10D
|
||||||
#define INFTABLE_10E 0x10E
|
#define INFTABLE_SPOKE_TO_GORON_LINK 0x10E
|
||||||
#define INFTABLE_10F 0x10F
|
#define INFTABLE_10F 0x10F
|
||||||
#define INFTABLE_113 0x113
|
#define INFTABLE_113 0x113
|
||||||
#define INFTABLE_11A 0x11A
|
#define INFTABLE_11A 0x11A
|
||||||
|
@ -511,8 +511,18 @@ s16 EnGo2_UpdateTalkStateGoronCityLowestFloor(PlayState* play, EnGo2* this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) {
|
u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) {
|
||||||
if(gSaveContext.n64ddFlag) {
|
// 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;
|
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)) {
|
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) {
|
s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) {
|
||||||
switch (EnGo2_GetDialogState(this, play)) {
|
switch (EnGo2_GetDialogState(this, play)) {
|
||||||
case TEXT_STATE_CLOSING:
|
case TEXT_STATE_CLOSING:
|
||||||
if(!gSaveContext.n64ddFlag) {
|
|
||||||
switch (this->actor.textId) {
|
switch (this->actor.textId) {
|
||||||
case 0x3036:
|
case 0x3036:
|
||||||
|
if (!gSaveContext.n64ddFlag) {
|
||||||
EnGo2_GetItem(this, play, GI_TUNIC_GORON);
|
EnGo2_GetItem(this, play, GI_TUNIC_GORON);
|
||||||
this->actionFunc = EnGo2_SetupGetItem;
|
this->actionFunc = EnGo2_SetupGetItem;
|
||||||
return NPC_TALK_STATE_ACTION;
|
return NPC_TALK_STATE_ACTION;
|
||||||
case 0x3037:
|
|
||||||
gSaveContext.infTable[16] |= 0x4000;
|
|
||||||
default:
|
|
||||||
return NPC_TALK_STATE_IDLE;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (Flags_GetTreasure(play, 0x1F)) {
|
if (Flags_GetTreasure(play, 0x1F)) {
|
||||||
return NPC_TALK_STATE_IDLE;
|
return NPC_TALK_STATE_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gSaveContext.infTable[16] |= 0x200;
|
Flags_SetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED);
|
||||||
EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
|
EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
|
||||||
this->actionFunc = EnGo2_SetupGetItem;
|
this->actionFunc = EnGo2_SetupGetItem;
|
||||||
Flags_SetTreasure(play, 0x1F);
|
Flags_SetTreasure(play, 0x1F);
|
||||||
return NPC_TALK_STATE_ACTION;
|
return NPC_TALK_STATE_ACTION;
|
||||||
}
|
}
|
||||||
|
case 0x3037:
|
||||||
|
gSaveContext.infTable[16] |= 0x4000;
|
||||||
|
default:
|
||||||
|
return NPC_TALK_STATE_IDLE;
|
||||||
|
}
|
||||||
case TEXT_STATE_CHOICE:
|
case TEXT_STATE_CHOICE:
|
||||||
if (Message_ShouldAdvance(play)) {
|
if (Message_ShouldAdvance(play)) {
|
||||||
if (this->actor.textId == 0x3034) {
|
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_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ||
|
||||||
(this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) {
|
(this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) {
|
||||||
return true;
|
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;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -1267,7 +1278,9 @@ void EnGo2_SelectGoronWakingUp(EnGo2* this) {
|
|||||||
EnGo2_BiggoronWakingUp(this);
|
EnGo2_BiggoronWakingUp(this);
|
||||||
break;
|
break;
|
||||||
case GORON_CITY_LINK:
|
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);
|
EnGo2_WakingUp(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1627,7 +1640,9 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
|
|||||||
if ((gSaveContext.infTable[16] & 0x200)) {
|
if ((gSaveContext.infTable[16] & 0x200)) {
|
||||||
Path_CopyLastPoint(this->path, &this->actor.world.pos);
|
Path_CopyLastPoint(this->path, &this->actor.world.pos);
|
||||||
this->actor.home.pos = 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);
|
EnGo2_GetItemAnimation(this, play);
|
||||||
} else {
|
} else {
|
||||||
this->actionFunc = EnGo2_CurledUp;
|
this->actionFunc = EnGo2_CurledUp;
|
||||||
@ -1855,15 +1870,36 @@ void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) {
|
|||||||
void EnGo2_SetGetItem(EnGo2* this, PlayState* play) {
|
void EnGo2_SetGetItem(EnGo2* this, PlayState* play) {
|
||||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
||||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
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) {
|
switch (this->getItemId) {
|
||||||
case GI_CLAIM_CHECK:
|
case GI_CLAIM_CHECK:
|
||||||
Environment_ClearBgsDayCount();
|
Environment_ClearBgsDayCount();
|
||||||
EnGo2_GetItemAnimation(this, play);
|
EnGo2_GetItemAnimation(this, play);
|
||||||
return;
|
return;
|
||||||
case GI_TUNIC_GORON:
|
case GI_TUNIC_GORON:
|
||||||
if (!gSaveContext.n64ddFlag) {
|
|
||||||
gSaveContext.infTable[16] |= 0x200;
|
gSaveContext.infTable[16] |= 0x200;
|
||||||
}
|
|
||||||
EnGo2_GetItemAnimation(this, play);
|
EnGo2_GetItemAnimation(this, play);
|
||||||
return;
|
return;
|
||||||
case GI_SWORD_BGS:
|
case GI_SWORD_BGS:
|
||||||
@ -1875,13 +1911,6 @@ void EnGo2_SetGetItem(EnGo2* this, PlayState* play) {
|
|||||||
this->actionFunc = EnGo2_GoronRollingBigContinueRolling;
|
this->actionFunc = EnGo2_GoronRollingBigContinueRolling;
|
||||||
return;
|
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;
|
this->actionFunc = func_80A46B40;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user