diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 8e30bea28..3a687f41d 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -343,8 +343,8 @@ bool EnCow_HasBeenMilked(EnCow* this, GlobalContext* globalCtx) { void EnCow_GivePlayerRandomizedItem(EnCow* this, GlobalContext* globalCtx) { if (!EnCow_HasBeenMilked(this, globalCtx)) { CowInfo cowInfo = EnCow_GetInfo(this, globalCtx); - GetItemID itemId = Randomizer_GetItemIdFromKnownCheck(cowInfo.randomizerCheck, GI_MILK); - func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 100.0f); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(cowInfo.randomizerCheck, GI_MILK); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 10000.0f, 100.0f); } else { // once we've gotten the rando reward from the cow, // return them to the their default action function diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 97e58b30a..331677c6d 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -94,8 +94,10 @@ void EnDs_GiveOddPotion(EnDs* this, GlobalContext* globalCtx) { } else { u32 itemId = GI_ODD_POTION; if (gSaveContext.n64ddFlag) { - itemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_TRADE_ODD_MUSHROOM, GI_ODD_POTION); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_ODD_MUSHROOM, GI_ODD_POTION); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 10000.0f, 50.0f); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_ODD_MUSHROOM); + return; } func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 50.0f); } @@ -107,8 +109,10 @@ void EnDs_TalkAfterBrewOddPotion(EnDs* this, GlobalContext* globalCtx) { this->actionFunc = EnDs_GiveOddPotion; u32 itemId = GI_ODD_POTION; if (gSaveContext.n64ddFlag) { - itemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_TRADE_ODD_MUSHROOM, GI_ODD_POTION); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_ODD_MUSHROOM, GI_ODD_POTION); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 10000.0f, 50.0f); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_ODD_MUSHROOM); + return; } func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 50.0f); } diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index c61fe5f15..565982642 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -954,7 +954,7 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) { if (!gSaveContext.n64ddFlag) { this->reward = GI_RUPEE_PURPLE; } else { - this->reward = Randomizer_GetItemIdFromKnownCheck(EnFr_RandomizerCheckFromSongIndex(songIndex), GI_RUPEE_PURPLE); + this->getItemEntry = Randomizer_GetItemFromKnownCheck(EnFr_RandomizerCheckFromSongIndex(songIndex), GI_RUPEE_PURPLE); } } else { this->reward = GI_RUPEE_BLUE; diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index c7fcf97e0..389b1b145 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -967,17 +967,21 @@ void EnGo_GetItem(EnGo* this, GlobalContext* globalCtx) { this->unk_20C = 1; } if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEDROPS) { - getItemId = GI_CLAIM_CHECK; if (gSaveContext.n64ddFlag) { - getItemId = Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_EYEDROPS, GI_CLAIM_CHECK); + getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_EYEDROPS, GI_CLAIM_CHECK); + getItemId = getItemEntry.getItemId; Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_EYEDROPS); + } else { + getItemId = GI_CLAIM_CHECK; } } if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_SWORD_BROKEN) { - getItemId = GI_PRESCRIPTION; if (gSaveContext.n64ddFlag) { - getItemId = Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_BROKEN_SWORD, GI_PRESCRIPTION); + getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_BROKEN_SWORD, GI_PRESCRIPTION); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_SWORD_BROKEN); + getItemId = getItemEntry.getItemId; + } else { + getItemId = GI_PRESCRIPTION; } } } diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 2d71d6418..175335a0d 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -657,12 +657,14 @@ s16 EnGo2_GetStateGoronDmtBiggoron(GlobalContext* globalCtx, EnGo2* this) { if (Message_ShouldAdvance(globalCtx)) { if ((this->actor.textId == 0x3054) || (this->actor.textId == 0x3055)) { if (globalCtx->msgCtx.choiceIndex == 0) { - u32 getItemId = GI_PRESCRIPTION; if (gSaveContext.n64ddFlag) { - getItemId = Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_BROKEN_SWORD, GI_PRESCRIPTION); + GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_BROKEN_SWORD, GI_PRESCRIPTION); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_SWORD_BROKEN); + EnGo2_GetItemEntry(this, globalCtx, getItemEntry); + } else { + u32 getItemId = GI_PRESCRIPTION; + EnGo2_GetItem(this, globalCtx, getItemId); } - EnGo2_GetItem(this, globalCtx, getItemId); this->actionFunc = EnGo2_SetupGetItem; return 2; } @@ -1895,12 +1897,14 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, GlobalContext* globalCtx) { this->unk_26E = 2; this->skelAnime.playSpeed = 0.0f; this->skelAnime.curFrame = this->skelAnime.endFrame; - u32 getItemId = GI_CLAIM_CHECK; if (gSaveContext.n64ddFlag) { - getItemId = Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_EYEDROPS, GI_CLAIM_CHECK); + GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_EYEDROPS, GI_CLAIM_CHECK); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_EYEDROPS); + EnGo2_GetItemEntry(this, globalCtx, getItemEntry); + } else { + u32 getItemId = GI_CLAIM_CHECK; + EnGo2_GetItem(this, globalCtx, getItemId); } - EnGo2_GetItem(this, globalCtx, getItemId); this->actionFunc = EnGo2_SetupGetItem; this->goronState = 0; } diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index b3c008a50..743550697 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -177,12 +177,14 @@ void func_80A6E740(EnHs* this, GlobalContext* globalCtx) { this->actor.parent = NULL; func_80A6E3A0(this, func_80A6E630); } else { - s32 itemId = GI_ODD_MUSHROOM; if (gSaveContext.n64ddFlag) { - itemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TRADE_COJIRO, GI_ODD_MUSHROOM); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TRADE_COJIRO, GI_ODD_MUSHROOM); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_COJIRO); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 10000.0f, 50.0f); + } else { + s32 itemId = GI_ODD_MUSHROOM; + func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 50.0f); } - func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 50.0f); } this->unk_2A8 |= 1; @@ -193,12 +195,14 @@ void func_80A6E7BC(EnHs* this, GlobalContext* globalCtx) { switch (globalCtx->msgCtx.choiceIndex) { case 0: func_80A6E3A0(this, func_80A6E740); - s32 itemId = GI_ODD_MUSHROOM; if (gSaveContext.n64ddFlag) { - itemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TRADE_COJIRO, GI_ODD_MUSHROOM); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TRADE_COJIRO, GI_ODD_MUSHROOM); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_COJIRO); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 10000.0f, 50.0f); + } else { + s32 itemId = GI_ODD_MUSHROOM; + func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 50.0f); } - func_8002F434(&this->actor, globalCtx, itemId, 10000.0f, 50.0f); break; case 1: Message_ContinueTextbox(globalCtx, 0x10B4); diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 2763be734..ff1502e4b 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1230,12 +1230,14 @@ void func_80A99504(EnKo* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = func_80A99560; } else { - s32 itemId = GI_SAW; if (gSaveContext.n64ddFlag) { - itemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TRADE_ODD_POTION, GI_SAW); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TRADE_ODD_POTION, GI_SAW); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_ODD_POTION); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 120.0f, 10.0f); + } else { + s32 itemId = GI_SAW; + func_8002F434(&this->actor, globalCtx, itemId, 120.0f, 10.0f); } - func_8002F434(&this->actor, globalCtx, itemId, 120.0f, 10.0f); } } diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index f334c98e4..db22509e6 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -99,24 +99,28 @@ void func_80AACA94(EnMk* this, GlobalContext* globalCtx) { gSaveContext.eventInf[1] &= ~1; } } else { - s32 getItemID = GI_EYEDROPS; if (gSaveContext.n64ddFlag) { - getItemID = Randomizer_GetItemIdFromKnownCheck(RC_LH_TRADE_FROG, GI_EYEDROPS); + GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_TRADE_FROG, GI_EYEDROPS); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_FROG); + GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f); + } else { + s32 getItemID = GI_EYEDROPS; + func_8002F434(&this->actor, globalCtx, getItemID, 10000.0f, 50.0f); } - func_8002F434(&this->actor, globalCtx, getItemID, 10000.0f, 50.0f); } } void func_80AACB14(EnMk* this, GlobalContext* globalCtx) { if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actionFunc = func_80AACA94; - s32 getItemID = GI_EYEDROPS; if (gSaveContext.n64ddFlag) { - getItemID = Randomizer_GetItemIdFromKnownCheck(RC_LH_TRADE_FROG, GI_EYEDROPS); + GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_TRADE_FROG, GI_EYEDROPS); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_FROG); + GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f); + } else { + s32 getItemID = GI_EYEDROPS; + func_8002F434(&this->actor, globalCtx, getItemID, 10000.0f, 50.0f); } - func_8002F434(&this->actor, globalCtx, getItemID, 10000.0f, 50.0f); } } diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 817523fbb..eeaff6c33 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -460,11 +460,12 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { if (getItemId == GI_POCKET_EGG) { // TODO: get-item-rework Adult trade sequence - this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); - GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f); + this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); + GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f); } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO); + GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f); } } } diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index c6ca4cad7..af994bbf3 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -314,12 +314,14 @@ void func_80B20768(EnToryo* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->unk_1E4 = 5; } else { - s32 itemId = GI_SWORD_BROKEN; if (gSaveContext.n64ddFlag) { - itemId = Randomizer_GetItemIdFromKnownCheck(RC_GV_TRADE_SAW, GI_SWORD_BROKEN); + GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_GV_TRADE_SAW, GI_SWORD_BROKEN); Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_SAW); + GiveItemEntryFromActor(&this->actor, globalCtx, itemEntry, 100.0f, 10.0f); + } else { + s32 itemId = GI_SWORD_BROKEN; + func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 10.0f); } - func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 10.0f); } return; } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 97e0f5072..15ac7d1a3 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -10890,8 +10890,8 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { Collider_ResetQuadAT(globalCtx, &this->shieldQuad.base); if (this->pendingIceTrap) { - GiveItemWithoutActor(globalCtx, RG_ICE_TRAP); this->getItemEntry = ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP); + GiveItemEntryWithoutActor(globalCtx, this->getItemEntry); } }