Skip to content

Commit

Permalink
Fix manager to no longer give repeating items. Opt to fishing passes …
Browse files Browse the repository at this point in the history
…instead. (#18)
  • Loading branch information
PhlexPlexico authored Feb 2, 2024
1 parent dbd63f7 commit 505a540
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
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

0 comments on commit 505a540

Please sign in to comment.