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

Fix Swamp Manager to no longer give repeating items #18

Merged
merged 1 commit into from
Feb 2, 2024
Merged
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
2 changes: 1 addition & 1 deletion code/include/game/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace game::act {
// Npc For Curiosity Shop Owner
NpcEnFsn = 0x0157,
// Npc For Boat Photography
NpcSwampPhotographer = 0x0158,
EnShn = 0x0158,
// NPC Postman
NpcEnPm = 0x0166,
// Goht
Expand Down
5 changes: 3 additions & 2 deletions code/include/rnd/savefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "z3d/z3DVec.h"

// Increment the version number whenever the ExtSaveData structure is changed
#define EXTSAVEDATA_VERSION 11
#define EXTSAVEDATA_VERSION 12
#define SAVEFILE_SCENES_DISCOVERED_IDX_COUNT 4
#define SAVEFILE_SPOILER_ITEM_MAX 512

Expand Down Expand Up @@ -74,7 +74,8 @@ namespace rnd {
BitField<30, 1, u64> enGoGivenItem;
BitField<31, 1, u64> enBoss02GivenItem;
BitField<32, 1, u64> enGinkoManGivenItem;
BitField<33, 31, u64> unused;
BitField<33, 31, u64> enShnGivenItem;
BitField<34, 30, u64> unused;
};
GivenItemRegister givenItemChecks;
union FairyCollectRegister {
Expand Down
9 changes: 7 additions & 2 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,11 @@ namespace rnd {
}
} else if (actorId == game::act::Id::NpcEnBjt) {
getItemId = incomingNegative ? -0x01 : 0x01;
} else if (actorId == game::act::Id::NpcSwampPhotographer) {
getItemId = incomingNegative ? -0xBA : 0xBA;
} else if (actorId == game::act::Id::EnShn) {
if (gExtSaveData.givenItemChecks.enShnGivenItem == 1)
getItemId = incomingNegative ? -0x02 : 0x02;
else
getItemId = incomingNegative ? -0xBA : 0xBA;
} else if (actorId == game::act::Id::NpcInvisibleGuard) {
if (gExtSaveData.givenItemChecks.enStoneHeishiGivenItem > 0) {
getItemId = incomingNegative ? -0xBA : 0xBA;
Expand Down Expand Up @@ -478,6 +481,8 @@ namespace rnd {
saveData.anonymous_117 = saveData.anonymous_117 | 8;
gExtSaveData.givenItemChecks.enGinkoManGivenItem = 2;
}
} else if (storedActorId == game::act::Id::EnShn) {
gExtSaveData.givenItemChecks.enShnGivenItem = 1;
}
}

Expand Down
Loading