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 HP fish override (thanks @HylianFreddy!) #22

Merged
merged 1 commit into from
Feb 4, 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: 2 additions & 0 deletions code/include/game/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ namespace game::act {
NpcEnBjt = 0x020C,
// [4] Bombers
NpcBombers = 0x020F,
// Keaton
EnKitan = 0x021B,
// [6] Sheikah Hint Stone (MM3D)
NpcHintStone = 0x0241,
// [6] New in MM3D. Shows up as sparkles and spawns an ice platform (actor 0x13E) when hit.
Expand Down
11 changes: 7 additions & 4 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace rnd {
rItemOverrides[0].value.getItemId = 0x26;
rItemOverrides[0].value.looksLikeItemId = 0x26;
rItemOverrides[1].key.scene = 0x6F;
rItemOverrides[1].key.type = ItemOverride_Type::OVR_CHEST;
rItemOverrides[1].key.type = ItemOverride_Type::OVR_COLLECTABLE;
rItemOverrides[1].value.getItemId = 0x60;
rItemOverrides[1].value.looksLikeItemId = 0x60;
rItemOverrides[2].key.scene = 0x12;
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace rnd {
// Only override heart pieces and keys
u32 collectibleType = actor->params & 0xFF;
// XXX: AFAIK These are correct. Heart piece was checked.
if (collectibleType != 0x06 && collectibleType != 0x11) {
if (collectibleType != 0x06 && collectibleType != 0x11 && collectibleType != 0x0A) {
return (ItemOverride_Key){.all = 0};
}
retKey.scene = scene;
Expand Down Expand Up @@ -416,6 +416,8 @@ namespace rnd {
getItemId = incomingNegative ? -0x01 : 0x01;
} else if (getItemId == static_cast<s16>(rnd::GetItemID::GI_MASK_CAPTAINS_HAT)) {
gExtSaveData.givenItemChecks.enOskGivenItem = 1;
} else if (actorId == game::act::Id::EnKitan) {
getItemId = incomingNegative ? -0xBA : 0xBA;
}

return getItemId;
Expand Down Expand Up @@ -680,8 +682,9 @@ namespace rnd {
player->get_item_id = (s16)GetItemID::GI_FISHING_HOLE_PASS;
return;
}
} else if (override.key.type != ItemOverride_Type::OVR_CHEST && override.value.getItemId == 0x60 ||
(override.value.getItemId > 0x69 && override.value.getItemId < 0x71)) {
} else if (override.key.type != ItemOverride_Type::OVR_CHEST &&
(override.value.getItemId == 0x60 ||
(override.value.getItemId > 0x69 && override.value.getItemId < 0x71))) {
switch (override.value.getItemId) {
case 0x60:
if (gExtSaveData.givenItemChecks.bottleMilkGiven == 0) {
Expand Down
Loading