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

True match GoronMerchantShopManager_Main #687

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Changes from 1 commit
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
60 changes: 31 additions & 29 deletions src/manager/goronMerchantShopManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,43 @@ typedef struct {
u16 y;
} GoronShopSpawnData;

inline static void CheckGoronKakera() {
if (CheckGlobalFlag(GORON_KAKERA_L) == 0 || CheckGlobalFlag(GORON_KAKERA_M) == 0 ||
CheckGlobalFlag(GORON_KAKERA_R) == 0)
return;

if (CheckGlobalFlag(GORON_KAKERA_LV2) == 0) {
if (CheckGlobalFlag(LV1_CLEAR) == 0)
return;
SetGlobalFlag(GORON_KAKERA_LV2);
} else if (CheckGlobalFlag(GORON_KAKERA_LV3) == 0) {
if (CheckGlobalFlag(LV2_CLEAR) == 0)
return;
SetGlobalFlag(GORON_KAKERA_LV3);
} else if (CheckGlobalFlag(GORON_KAKERA_LV4) == 0) {
if (CheckGlobalFlag(LV3_CLEAR) == 0)
return;
SetGlobalFlag(GORON_KAKERA_LV4);
} else if (CheckGlobalFlag(GORON_KAKERA_LV5) == 0) {
if (CheckGlobalFlag(LV4_CLEAR) == 0)
return;
SetGlobalFlag(GORON_KAKERA_LV5);
} else
return;
ClearGlobalFlag(GORON_KAKERA_L);
ClearGlobalFlag(GORON_KAKERA_M);
ClearGlobalFlag(GORON_KAKERA_R);
return;
}

void GoronMerchantShopManager_Main(GoronMerchantShopManager* this) {
static const GoronShopSpawnData shopSpawnData[3] = { { 0x6e, 0x3, 0x210, 0x210 },
tonyjih marked this conversation as resolved.
Show resolved Hide resolved
{ 0x71, 0x2, 0x220, 0x210 },
{ 0x73, 0x3, 0x230, 0x210 } };
s32 uVar2;

const GoronShopSpawnData* spawnData;
s32 count;

if (super->action == 0) {
super->action++;
if (CheckGlobalFlag(GORON_KAKERA_L) != 0 && CheckGlobalFlag(GORON_KAKERA_M) != 0 &&
CheckGlobalFlag(GORON_KAKERA_R) != 0) {
if (CheckGlobalFlag(GORON_KAKERA_LV2) == 0) {
if (CheckGlobalFlag(LV1_CLEAR) != 0) {
SetGlobalFlag(GORON_KAKERA_LV2);
goto clearGlobalFlags;
}
} else if (CheckGlobalFlag(GORON_KAKERA_LV3) == 0) {
if (CheckGlobalFlag(LV2_CLEAR) != 0) {
SetGlobalFlag(GORON_KAKERA_LV3);
goto clearGlobalFlags;
}
} else if (CheckGlobalFlag(GORON_KAKERA_LV4) == 0) {
if (CheckGlobalFlag(LV3_CLEAR) != 0) {
SetGlobalFlag(GORON_KAKERA_LV4);
goto clearGlobalFlags;
}
} else if (CheckGlobalFlag(GORON_KAKERA_LV5) == 0 && CheckGlobalFlag(LV4_CLEAR) != 0) {
SetGlobalFlag(GORON_KAKERA_LV5);
clearGlobalFlags:
ClearGlobalFlag(GORON_KAKERA_L);
ClearGlobalFlag(GORON_KAKERA_M);
ClearGlobalFlag(GORON_KAKERA_R);
}
}
CheckGoronKakera();
this->itemActive[2] = 0;
this->itemActive[1] = 0;
this->itemActive[0] = 0;
Expand Down
Loading