1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-12 12:03:48 +00:00

Rename item get flags for Forest Stage upgrades (#2333)

* Rename item get flags for Forest Stage upgrades

* Fix Jenkins build error

* Document shared flag bug

* Rename shared flag

* Massive documenting comments

* GDI - remove one trailing whitespace
This commit is contained in:
Jordan Longstaff 2024-12-12 10:43:58 -05:00 committed by GitHub
parent c780c4e147
commit c57dff4f78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 7 deletions

View file

@ -699,8 +699,11 @@ typedef enum LinkAge {
#define ITEMGETINF_1B 0x1B #define ITEMGETINF_1B 0x1B
#define ITEMGETINF_1C 0x1C #define ITEMGETINF_1C 0x1C
#define ITEMGETINF_1D 0x1D #define ITEMGETINF_1D 0x1D
#define ITEMGETINF_1E 0x1E #define ITEMGETINF_FOREST_STAGE_STICK_UPGRADE 0x1E
#define ITEMGETINF_1F 0x1F // This flag is shared by two events; It is set when obtaining the Deku Nut upgrade at the Forest Stage and when obtaining Poachers Saw.
// This will make obtaining the Deku Nut upgrade impossible if Poachers Saw is obtained first.
// This flag is never read for the Poachers Saw event, so the overlap only causes an issue for the Deku Nut Upgrade. It will not prevent obtaining Poachers Saw.
#define ITEMGETINF_FOREST_STAGE_NUT_UPGRADE 0x1F
#define ITEMGETINF_23 0x23 #define ITEMGETINF_23 0x23
#define ITEMGETINF_24 0x24 #define ITEMGETINF_24 0x24
#define ITEMGETINF_25 0x25 #define ITEMGETINF_25 0x25

View file

@ -1828,7 +1828,8 @@ u8 Item_Give(PlayState* play, u8 item) {
} }
} else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) {
if (item == ITEM_POACHERS_SAW) { if (item == ITEM_POACHERS_SAW) {
SET_ITEMGETINF(ITEMGETINF_1F); //! @bug Setting this shared flag makes getting the Deku Nut upgrade impossible
SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE);
} }
temp = INV_CONTENT(item); temp = INV_CONTENT(item);

View file

@ -156,7 +156,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) {
delay = 0; delay = 0;
switch (Player_GetMask(play)) { switch (Player_GetMask(play)) {
case PLAYER_MASK_SKULL: case PLAYER_MASK_SKULL:
if (!GET_ITEMGETINF(ITEMGETINF_1E)) { if (!GET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_STICK_UPGRADE)) {
reaction = DNT_SIGNAL_CELEBRATE; reaction = DNT_SIGNAL_CELEBRATE;
this->prize = DNT_PRIZE_STICK; this->prize = DNT_PRIZE_STICK;
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_SARIA_THEME); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_SARIA_THEME);
@ -164,7 +164,8 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) {
} }
FALLTHROUGH; FALLTHROUGH;
case PLAYER_MASK_TRUTH: case PLAYER_MASK_TRUTH:
if (!GET_ITEMGETINF(ITEMGETINF_1F) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { if (!GET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE) &&
(Player_GetMask(play) != PLAYER_MASK_SKULL)) {
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->prize = DNT_PRIZE_NUTS; this->prize = DNT_PRIZE_NUTS;

View file

@ -282,7 +282,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) {
PRINTF("\n"); PRINTF("\n");
PRINTF("\n"); PRINTF("\n");
PRINTF("\n"); PRINTF("\n");
SET_ITEMGETINF(ITEMGETINF_1F); SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE);
} else { } else {
// "stick" // "stick"
PRINTF("\n"); PRINTF("\n");
@ -291,7 +291,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) {
PRINTF("\n"); PRINTF("\n");
PRINTF("\n"); PRINTF("\n");
PRINTF("\n"); PRINTF("\n");
SET_ITEMGETINF(ITEMGETINF_1E); SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_STICK_UPGRADE);
} }
this->actor.textId = 0; this->actor.textId = 0;
if ((this->stage != NULL) && (this->stage->actor.update != NULL)) { if ((this->stage != NULL) && (this->stage->actor.update != NULL)) {