Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename known flags documented in EnGo2 #2334

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ typedef enum LinkAge {
#define EVENTCHKINF_20 0x20
#define EVENTCHKINF_21 0x21
#define EVENTCHKINF_22 0x22
#define EVENTCHKINF_23 0x23
#define EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER 0x23
#define EVENTCHKINF_25 0x25
#define EVENTCHKINF_2A 0x2A
#define EVENTCHKINF_2B 0x2B
Expand Down Expand Up @@ -797,24 +797,24 @@ typedef enum LinkAge {
#define INFTABLE_D6 0xD6
#define INFTABLE_D8 0xD8
#define INFTABLE_D9 0xD9
#define INFTABLE_E0 0xE0
#define INFTABLE_E3 0xE3
#define INFTABLE_E6 0xE6
#define INFTABLE_EB 0xEB
#define INFTABLE_F0 0xF0
#define INFTABLE_F4 0xF4
#define INFTABLE_F8 0xF8
#define INFTABLE_TALKED_TO_DODONGOS_CAVERN_ENTRANCE_GORON 0xE0
#define INFTABLE_TALKED_TO_GC_STAIRWELL_GORON 0xE3
#define INFTABLE_TALKED_TO_LOST_WOODS_SHORTCUT_GORON 0xE6
#define INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON 0xEB
#define INFTABLE_TALKED_TO_GC_ENTRANCE_GORON 0xF0
#define INFTABLE_TALKED_TO_GC_ISLAND_GORON 0xF4
#define INFTABLE_TALKED_TO_DARUNIA_DOOR_GORON 0xF8
#define INFTABLE_FC 0xFC
#define INFTABLE_109 0x109
#define INFTABLE_OPENED_GORON_CITY_DOORS 0x109
#define INFTABLE_10A 0x10A
#define INFTABLE_10B 0x10B
#define INFTABLE_10C 0x10C
#define INFTABLE_10D 0x10D
#define INFTABLE_10E 0x10E
#define INFTABLE_TALKED_TO_GORON_LINK_ABOUT_DRAGON 0x10B
#define INFTABLE_STOPPED_GORON_LINK 0x10C
#define INFTABLE_RECEIVED_GORON_TUNIC 0x10D
#define INFTABLE_TALKED_TO_GORON_LINK_ABOUT_GORONS 0x10E
#define INFTABLE_10F 0x10F
#define INFTABLE_113 0x113
#define INFTABLE_11A 0x11A
#define INFTABLE_11E 0x11E
#define INFTABLE_RECEIVED_BOMB_BAG_UPGRADE_FROM_HOT_RODDER_GORON 0x11E
#define INFTABLE_124 0x124
#define INFTABLE_129 0x129
#define INFTABLE_12A 0x12A
Expand Down
26 changes: 13 additions & 13 deletions src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -5221,9 +5221,9 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_25)) {
retTextId = 0x3027;
} else if (Flags_GetEventChkInf(EVENTCHKINF_23)) {
} else if (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER)) {
retTextId = 0x3021;
} else if (Flags_GetInfTable(INFTABLE_E0)) {
} else if (Flags_GetInfTable(INFTABLE_TALKED_TO_DODONGOS_CAVERN_ENTRANCE_GORON)) {
retTextId = 0x302A;
} else {
retTextId = 0x3008;
Expand All @@ -5240,7 +5240,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_25)) {
retTextId = 0x3027;
} else if (Flags_GetEventChkInf(EVENTCHKINF_23)) {
} else if (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER)) {
retTextId = 0x3026;
} else {
retTextId = 0x3009;
Expand All @@ -5257,9 +5257,9 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_25)) {
retTextId = 0x3027;
} else if (Flags_GetEventChkInf(EVENTCHKINF_23)) {
} else if (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER)) {
retTextId = 0x3026;
} else if (Flags_GetInfTable(INFTABLE_EB)) {
} else if (Flags_GetInfTable(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON)) {
retTextId = 0x302B;
} else {
retTextId = 0x300A;
Expand All @@ -5276,7 +5276,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_25)) {
retTextId = 0x3027;
} else if (Flags_GetInfTable(INFTABLE_F0)) {
} else if (Flags_GetInfTable(INFTABLE_TALKED_TO_GC_ENTRANCE_GORON)) {
retTextId = 0x3015;
} else {
retTextId = 0x3014;
Expand All @@ -5293,7 +5293,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_25)) {
retTextId = 0x3027;
} else if (Flags_GetInfTable(INFTABLE_F4)) {
} else if (Flags_GetInfTable(INFTABLE_TALKED_TO_GC_ISLAND_GORON)) {
retTextId = 0x3017;
} else {
retTextId = 0x3016;
Expand All @@ -5310,7 +5310,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_25)) {
retTextId = 0x3027;
} else if (Flags_GetInfTable(INFTABLE_F8)) {
} else if (Flags_GetInfTable(INFTABLE_TALKED_TO_DARUNIA_DOOR_GORON)) {
retTextId = 0x3019;
} else {
retTextId = 0x3018;
Expand Down Expand Up @@ -5668,28 +5668,28 @@ void func_80036E50(u16 textId, s16 arg1) {
return;
case 38:
if (textId == 0x3008) {
Flags_SetInfTable(INFTABLE_E0);
Flags_SetInfTable(INFTABLE_TALKED_TO_DODONGOS_CAVERN_ENTRANCE_GORON);
}
return;
case 40:
if (textId == 0x300B) {
Flags_SetInfTable(INFTABLE_EB);
Flags_SetInfTable(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON);
}
return;
case 41:
if (textId == 0x3014) {
Flags_SetInfTable(INFTABLE_F0);
Flags_SetInfTable(INFTABLE_TALKED_TO_GC_ENTRANCE_GORON);
}
return;
case 42:
if (textId == 0x3016) {
Flags_SetInfTable(INFTABLE_F4);
Flags_SetInfTable(INFTABLE_TALKED_TO_GC_ISLAND_GORON);
}
return;
case 43:
if (textId == 0x3018) {
Flags_SetEventChkInf(EVENTCHKINF_20);
Flags_SetInfTable(INFTABLE_F8);
Flags_SetInfTable(INFTABLE_TALKED_TO_DARUNIA_DOOR_GORON);
}
return;
case 48:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) {
OnePointCutscene_Init(play, 4180, 50, NULL, CAM_ID_MAIN);

Flags_SetSwitch(play, this->switchFlag);
SET_EVENTCHKINF(EVENTCHKINF_23);
SET_EVENTCHKINF(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER);

func_808B5A78(this);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) {

if (param == 0) {
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
if (GET_INFTABLE(INFTABLE_109)) {
if (GET_INFTABLE(INFTABLE_OPENED_GORON_CITY_DOORS)) {
this->actionFunc = func_808B95AC;
this->dyna.actor.world.pos.y += 180.0f;
} else {
Expand All @@ -62,7 +62,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) {
}
}
} else {
if (GET_INFTABLE(INFTABLE_109)) {
if (GET_INFTABLE(INFTABLE_OPENED_GORON_CITY_DOORS)) {
this->dyna.actor.world.pos.x += 125.0f * Math_CosS(this->dyna.actor.world.rot.y);
this->dyna.actor.world.pos.z -= 125.0f * Math_SinS(this->dyna.actor.world.rot.y);
this->actionFunc = func_808B95AC;
Expand Down Expand Up @@ -93,7 +93,7 @@ void func_808B95B8(BgSpot18Shutter* this, PlayState* play) {
}

void func_808B9618(BgSpot18Shutter* this, PlayState* play) {
if (GET_INFTABLE(INFTABLE_109)) {
if (GET_INFTABLE(INFTABLE_OPENED_GORON_CITY_DOORS)) {
Actor_SetFocus(&this->dyna.actor, 70.0f);
if (PARAMS_GET_U(this->dyna.actor.params, 8, 1) == 0) {
this->actionFunc = func_808B9698;
Expand Down
53 changes: 28 additions & 25 deletions src/overlays/actors/ovl_En_Go/z_en_go.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) {
} else {
return 0x3041;
}
} else if (CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON) || GET_INFTABLE(INFTABLE_10D)) {
if (GET_INFTABLE(INFTABLE_10E)) {
} else if (CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON) ||
GET_INFTABLE(INFTABLE_RECEIVED_GORON_TUNIC)) {
if (GET_INFTABLE(INFTABLE_TALKED_TO_GORON_LINK_ABOUT_GORONS)) {
return 0x3038;
} else {
return 0x3037;
}
} else {
if (GET_INFTABLE(INFTABLE_109)) {
if (GET_INFTABLE(INFTABLE_OPENED_GORON_CITY_DOORS)) {
if (GET_INFTABLE(INFTABLE_10A)) {
return 0x3033;
} else {
Expand All @@ -141,49 +142,49 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) {
case 0x20:
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else if (GET_EVENTCHKINF(EVENTCHKINF_23)) {
} else if (GET_EVENTCHKINF(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER)) {
return 0x3021;
} else if (GET_INFTABLE(INFTABLE_E0)) {
} else if (GET_INFTABLE(INFTABLE_TALKED_TO_DODONGOS_CAVERN_ENTRANCE_GORON)) {
return 0x302A;
} else {
return 0x3008;
}
case 0x30:
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else if (GET_EVENTCHKINF(EVENTCHKINF_23)) {
} else if (GET_EVENTCHKINF(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER)) {
return 0x3026;
} else {
return 0x3009;
}
case 0x40:
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else if (GET_EVENTCHKINF(EVENTCHKINF_23)) {
} else if (GET_EVENTCHKINF(EVENTCHKINF_DESTROYED_DODONGOS_CAVERN_BOULDER)) {
return 0x3026;
} else {
return 0x300A;
}
case 0x50:
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else if (GET_INFTABLE(INFTABLE_F0)) {
} else if (GET_INFTABLE(INFTABLE_TALKED_TO_GC_ENTRANCE_GORON)) {
return 0x3015;
} else {
return 0x3014;
}
case 0x60:
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else if (GET_INFTABLE(INFTABLE_F4)) {
} else if (GET_INFTABLE(INFTABLE_TALKED_TO_GC_ISLAND_GORON)) {
return 0x3017;
} else {
return 0x3016;
}
case 0x70:
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else if (GET_INFTABLE(INFTABLE_F8)) {
} else if (GET_INFTABLE(INFTABLE_TALKED_TO_DARUNIA_DOOR_GORON)) {
return 0x3019;
} else {
return 0x3018;
Expand All @@ -204,32 +205,32 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) {
case TEXT_STATE_CLOSING:
switch (thisx->textId) {
case 0x3008:
SET_INFTABLE(INFTABLE_E0);
SET_INFTABLE(INFTABLE_TALKED_TO_DODONGOS_CAVERN_ENTRANCE_GORON);
talkState = NPC_TALK_STATE_IDLE;
break;
case 0x300B:
SET_INFTABLE(INFTABLE_EB);
SET_INFTABLE(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON);
talkState = NPC_TALK_STATE_IDLE;
break;
case 0x3014:
SET_INFTABLE(INFTABLE_F0);
SET_INFTABLE(INFTABLE_TALKED_TO_GC_ENTRANCE_GORON);
talkState = NPC_TALK_STATE_IDLE;
break;
case 0x3016:
SET_INFTABLE(INFTABLE_F4);
SET_INFTABLE(INFTABLE_TALKED_TO_GC_ISLAND_GORON);
talkState = NPC_TALK_STATE_IDLE;
break;
case 0x3018:
SET_INFTABLE(INFTABLE_F8);
SET_INFTABLE(INFTABLE_TALKED_TO_DARUNIA_DOOR_GORON);
talkState = NPC_TALK_STATE_IDLE;
break;
case 0x3036:
Actor_OfferGetItem(thisx, play, GI_TUNIC_GORON, xzRange, yRange);
SET_INFTABLE(INFTABLE_10D); // EnGo exclusive flag
SET_INFTABLE(INFTABLE_RECEIVED_GORON_TUNIC); // EnGo exclusive flag
talkState = NPC_TALK_STATE_ACTION;
break;
case 0x3037:
SET_INFTABLE(INFTABLE_10E);
SET_INFTABLE(INFTABLE_TALKED_TO_GORON_LINK_ABOUT_GORONS);
talkState = NPC_TALK_STATE_IDLE;
break;
case 0x3041:
Expand Down Expand Up @@ -258,7 +259,8 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) {
switch (thisx->textId) {
case 0x300A:
if (play->msgCtx.choiceIndex == 0) {
if (CUR_UPG_VALUE(UPG_STRENGTH) != 0 || GET_INFTABLE(INFTABLE_EB)) {
if (CUR_UPG_VALUE(UPG_STRENGTH) != 0 ||
GET_INFTABLE(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON)) {
thisx->textId = 0x300B;
} else {
thisx->textId = 0x300C;
Expand All @@ -271,12 +273,12 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) {
break;
case 0x3034:
if (play->msgCtx.choiceIndex == 0) {
if (GET_INFTABLE(INFTABLE_10B)) {
if (GET_INFTABLE(INFTABLE_TALKED_TO_GORON_LINK_ABOUT_DRAGON)) {
thisx->textId = 0x3033;
} else {
thisx->textId = 0x3035;
}
} else if (GET_INFTABLE(INFTABLE_10B)) {
} else if (GET_INFTABLE(INFTABLE_TALKED_TO_GORON_LINK_ABOUT_DRAGON)) {
thisx->textId = 0x3036;
} else {
thisx->textId = 0x3033;
Expand All @@ -302,7 +304,7 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) {
if (Message_ShouldAdvance(play)) {
switch (thisx->textId) {
case 0x3035:
SET_INFTABLE(INFTABLE_10B);
SET_INFTABLE(INFTABLE_TALKED_TO_GORON_LINK_ABOUT_DRAGON);
FALLTHROUGH;
case 0x3032:
case 0x3033:
Expand Down Expand Up @@ -666,7 +668,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) {
EnGo_SetupAction(this, EnGo_FireGenericActionFunc);
break;
case 0x40:
if (GET_INFTABLE(INFTABLE_EB)) {
if (GET_INFTABLE(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON)) {
EnGo_SetMovedPos(this, play);
}
Actor_SetScale(&this->actor, 0.015f);
Expand Down Expand Up @@ -754,7 +756,7 @@ void EnGo_GoronLinkRolling(EnGo* this, PlayState* play) {
(this->unk_218 == 0)) {
this->actor.speed = 0.0f;
EnGo_SetupAction(this, func_80A4008C);
SET_INFTABLE(INFTABLE_109);
SET_INFTABLE(INFTABLE_OPENED_GORON_CITY_DOORS);
}

this->actor.shape.rot = this->actor.world.rot;
Expand Down Expand Up @@ -851,7 +853,8 @@ void func_80A405CC(EnGo* this, PlayState* play) {
this->skelAnime.curFrame = lastFrame;
this->skelAnime.playSpeed = 0.0f;
this->unk_212 = Rand_S16Offset(30, 30);
if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) {
if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40) &&
!GET_INFTABLE(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON)) {
EnGo_SetupAction(this, func_80A40B1C);
} else {
EnGo_SetupAction(this, EnGo_BiggoronActionFunc);
Expand Down Expand Up @@ -941,7 +944,7 @@ void func_80A40A54(EnGo* this, PlayState* play) {
}

void func_80A40B1C(EnGo* this, PlayState* play) {
if (GET_INFTABLE(INFTABLE_EB)) {
if (GET_INFTABLE(INFTABLE_TALKED_TO_DMT_BOMB_FLOWER_GORON)) {
EnGo_ChangeAnim(this, ENGO_ANIM_3);
EnGo_SetupAction(this, func_80A40A54);
} else {
Expand Down
Loading