mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-25 17:48:50 -05:00
Merge branch 'get-item-rework' into get-item-rework-rando-next
This commit is contained in:
commit
cc31479772
@ -452,7 +452,9 @@ u32 Actor_TextboxIsClosing(Actor* actor, GlobalContext* globalCtx);
|
||||
s8 func_8002F368(GlobalContext* globalCtx);
|
||||
void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* x, s16* y);
|
||||
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx);
|
||||
s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId);
|
||||
s32 GiveItemEntryWithoutActor(GlobalContext* globalCtx, GetItemEntry getItemEntry);
|
||||
s32 GiveItemEntryFromActor(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry, f32 xzRange, f32 yRange);
|
||||
void GiveItemEntryFromActorWithFixedRange(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry);
|
||||
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange);
|
||||
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId);
|
||||
void func_8002F580(Actor* actor, GlobalContext* globalCtx);
|
||||
|
@ -1618,15 +1618,6 @@ extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 tableID, s16 getItemID) {
|
||||
return ItemTableManager::Instance->RetrieveItemEntry(tableID, getItemID);
|
||||
}
|
||||
|
||||
extern "C" s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) {
|
||||
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(OTRGlobals::Instance->gRandomizer->GetCheckFromActor(sceneNum, actorId, actorParams))) {
|
||||
OTRGlobals::Instance->getItemModIndex = MOD_NONE;
|
||||
} else {
|
||||
OTRGlobals::Instance->getItemModIndex = MOD_RANDOMIZER;
|
||||
}
|
||||
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemId(ogId, actorId, actorParams, sceneNum);
|
||||
}
|
||||
|
||||
extern "C" GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) {
|
||||
s16 getItemModIndex;
|
||||
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(
|
||||
@ -1639,15 +1630,6 @@ extern "C" GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId
|
||||
return ItemTable_RetrieveEntry(getItemModIndex, itemID);
|
||||
}
|
||||
|
||||
extern "C" s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
|
||||
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(randomizerCheck)) {
|
||||
OTRGlobals::Instance->getItemModIndex = MOD_NONE;
|
||||
} else {
|
||||
OTRGlobals::Instance->getItemModIndex = MOD_RANDOMIZER;
|
||||
}
|
||||
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId);
|
||||
}
|
||||
|
||||
extern "C" GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
|
||||
s16 getItemModIndex;
|
||||
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(randomizerCheck)) {
|
||||
@ -1661,11 +1643,11 @@ extern "C" GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomi
|
||||
|
||||
extern "C" bool Randomizer_ObtainedFreestandingIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId, Actor* actor) {
|
||||
return gSaveContext.n64ddFlag && (actor->parent != NULL) &&
|
||||
Randomizer_GetItemIdFromKnownCheck(randomizerCheck, ogId) == GI_ICE_TRAP;
|
||||
Randomizer_GetItemFromKnownCheck(randomizerCheck, ogId).getItemId == RG_ICE_TRAP;
|
||||
}
|
||||
|
||||
extern "C" bool Randomizer_ItemIsIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId) {
|
||||
return gSaveContext.n64ddFlag && Randomizer_GetItemIdFromKnownCheck(randomizerCheck, ogId) == GI_ICE_TRAP;
|
||||
return gSaveContext.n64ddFlag && Randomizer_GetItemFromKnownCheck(randomizerCheck, ogId).getItemId == RG_ICE_TRAP;
|
||||
}
|
||||
|
||||
extern "C" CustomMessageEntry Randomizer_GetCustomGetItemMessage(Player* player) {
|
||||
|
@ -98,17 +98,14 @@ u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
|
||||
RandomizerCheck Randomizer_GetCheckFromActor(s16 actorId, s16 actorParams, s16 sceneNum);
|
||||
void Randomizer_LoadHintLocations(const char* spoilerFileName);
|
||||
void Randomizer_LoadItemLocations(const char* spoilerFileName, bool silent);
|
||||
s16 Randomizer_GetItemModelFromId(s16 itemId);
|
||||
s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId);
|
||||
s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
||||
s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
||||
s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId); // TODO: Remove me
|
||||
GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
||||
GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
||||
bool Randomizer_ObtainedFreestandingIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId, Actor* actor);
|
||||
bool Randomizer_ItemIsIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId);
|
||||
int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx);
|
||||
GetItemEntry ItemTable_Retrieve(int16_t getItemID);
|
||||
GetItemEntry ItemTable_RetrieveEntry(s16 modIndex, s16 getItemId);
|
||||
GetItemEntry ItemTable_RetrieveEntry(s16 modIndex, s16 getItemID);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1955,15 +1955,16 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId) {
|
||||
s32 GiveItemEntryWithoutActor(GlobalContext* globalCtx, GetItemEntry getItemEntry) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
|
||||
if (((player->heldActor != NULL) && ((getItemId > GI_NONE) && (getItemId < GI_MAX)) ||
|
||||
(gSaveContext.n64ddFlag && (getItemId > RG_NONE) && (getItemId < RG_MAX))) ||
|
||||
if (((player->heldActor != NULL) && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX)) ||
|
||||
(gSaveContext.n64ddFlag && (getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))) ||
|
||||
(!(player->stateFlags1 & 0x20000800))) {
|
||||
if ((getItemId != GI_NONE)) {
|
||||
player->getItemId = getItemId;
|
||||
if ((getItemEntry.getItemId != GI_NONE)) {
|
||||
player->getItemEntry = getItemEntry;
|
||||
player->getItemId = getItemEntry.getItemId;
|
||||
player->interactRangeActor = &player->actor;
|
||||
player->getItemDirection = player->actor.shape.rot.y;
|
||||
// Player state 26 = Player is frozen
|
||||
@ -1978,6 +1979,38 @@ s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 GiveItemEntryFromActor(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry, f32 xzRange, f32 yRange) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->targetActor)) &&
|
||||
((!gSaveContext.n64ddFlag && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX))) ||
|
||||
(gSaveContext.n64ddFlag && ((getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))))) ||
|
||||
(!(player->stateFlags1 & 0x20000800))) {
|
||||
if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) {
|
||||
s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y;
|
||||
s32 absYawDiff = ABS(yawDiff);
|
||||
|
||||
if ((getItemEntry.getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) {
|
||||
player->getItemEntry = getItemEntry;
|
||||
player->getItemId = getItemEntry.getItemId;
|
||||
player->interactRangeActor = actor;
|
||||
player->getItemDirection = absYawDiff;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void GiveItemEntryFromActorWithFixedRange(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry) {
|
||||
GiveItemEntryFromActor(actor, globalCtx, getItemEntry, 50.0f, 10.0f);
|
||||
}
|
||||
|
||||
// TODO: Rename to GiveItemIdFromActor or similar
|
||||
// If you're doing something for randomizer, you're probably looking for GiveItemEntryFromActor
|
||||
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
@ -2002,6 +2035,8 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Rename to GiveItemIdFromActorWithFixedRange or similar
|
||||
// If you're doing something for randomizer, you're probably looking for GiveItemEntryFromActorWithFixedRange
|
||||
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) {
|
||||
func_8002F434(actor, globalCtx, getItemId, 50.0f, 10.0f);
|
||||
}
|
||||
|
@ -512,8 +512,11 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
getItemId = getItem.getItemId;
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
GET_PLAYER(globalCtx)->getItemEntry = getItem;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
} else {
|
||||
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
|
||||
}
|
||||
}
|
||||
|
||||
EnItem00_SetupAction(this, func_8001E5C8);
|
||||
@ -668,10 +671,15 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
|
||||
if (this->getItemId != GI_NONE) {
|
||||
if (!Actor_HasParent(&this->actor, globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 50.0f, 80.0f);
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemEntry.getItemId, 50.0f, 80.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 50.0f, 80.0f);
|
||||
}
|
||||
this->unk_15A++;
|
||||
} else {
|
||||
this->getItemId = GI_NONE;
|
||||
@ -884,12 +892,13 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
params = &this->actor.params;
|
||||
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
} else {
|
||||
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
GET_PLAYER(globalCtx)->getItemEntry = getItem;
|
||||
getItemId = getItem.getItemId;
|
||||
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
|
||||
}
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
}
|
||||
|
||||
switch (*params) {
|
||||
|
@ -201,8 +201,8 @@ void GivePlayerRandoRewardSongOfTime(GlobalContext* globalCtx, RandomizerCheck c
|
||||
|
||||
if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F) && gSaveContext.nextTransition == 0xFF) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_SONG_OF_TIME);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
|
||||
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
|
||||
player->pendingFlag.flagID = 0x1F;
|
||||
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
||||
}
|
||||
@ -216,8 +216,8 @@ void GivePlayerRandoRewardNocturne(GlobalContext* globalCtx, RandomizerCheck che
|
||||
gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
|
||||
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL &&
|
||||
!Player_InBlockingCsMode(globalCtx, player) && !Flags_GetEventChkInf(0xAA)) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
|
||||
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
|
||||
Flags_SetEventChkInf(0xAA);
|
||||
}
|
||||
}
|
||||
@ -228,8 +228,8 @@ void GivePlayerRandoRewardRequiem(GlobalContext* globalCtx, RandomizerCheck chec
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL &&
|
||||
!Player_InBlockingCsMode(globalCtx, player)) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_SONG_OF_TIME);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
|
||||
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
|
||||
Flags_SetEventChkInf(0xAC);
|
||||
}
|
||||
}
|
||||
@ -243,8 +243,7 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi
|
||||
!Flags_GetTreasure(globalCtx, 0x1E) && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
|
||||
globalCtx->sceneLoadFlag == 0) {
|
||||
GetItemEntry getItem = Randomizer_GetItemFromKnownCheck(check, GI_ARROW_LIGHT);
|
||||
if (player->pendingFlag.flagType == FLAG_NONE && GiveItemWithoutActor(globalCtx, getItem.getItemId)) {
|
||||
player->getItemEntry = getItem;
|
||||
if (player->pendingFlag.flagType == FLAG_NONE && GiveItemEntryWithoutActor(globalCtx, getItem)) {
|
||||
player->pendingFlag.flagID = 0x1E;
|
||||
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
||||
}
|
||||
@ -254,11 +253,11 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi
|
||||
void GivePlayerRandoRewardSariaGift(GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
if (gSaveContext.entranceIndex == 0x05E0) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_ZELDAS_LULLABY);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);
|
||||
|
||||
if ((!Flags_GetEventChkInf(0xC1) || (player->getItemId == getItemId && getItemId != GI_ICE_TRAP)) &&
|
||||
if ((!Flags_GetEventChkInf(0xC1) || (player->getItemId == getItemEntry.getItemId && getItemEntry.getItemId != GI_ICE_TRAP)) &&
|
||||
player != NULL && !Player_InBlockingCsMode(globalCtx, player)) {
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
|
||||
Flags_SetEventChkInf(0xC1);
|
||||
}
|
||||
}
|
||||
|
@ -507,9 +507,9 @@ void GiveLinkDungeonItem(GetItemID getItemId) {
|
||||
}
|
||||
|
||||
void GiveLinksPocketMedallion() {
|
||||
RandomizerGet getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LINKS_POCKET, RG_NONE);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LINKS_POCKET, RG_NONE);
|
||||
|
||||
GiveLinkDungeonReward(getItemId);
|
||||
GiveLinkDungeonReward(getItemEntry.getItemId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,14 +70,14 @@ const ActorInit Bg_Dy_Yoseizo_InitVars = {
|
||||
|
||||
void GivePlayerRandoRewardGreatFairy(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
GetItemID getItemId = Randomizer_GetRandomizedItemId(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum);
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum);
|
||||
|
||||
if (this->actor.parent == GET_PLAYER(globalCtx) && !Flags_GetTreasure(globalCtx, this->fountainType + 1) &&
|
||||
!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
Flags_SetTreasure(globalCtx, this->fountainType + 1);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (!Flags_GetTreasure(globalCtx, this->fountainType + 1)) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -899,13 +899,13 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_ZELDAS_LULLABY);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);
|
||||
|
||||
if (impa->parent != NULL && impa->parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) {
|
||||
func_8002F434(impa, globalCtx, getItemId, 75.0f, 50.0f);
|
||||
GiveItemEntryFromActor(impa, globalCtx, getItemEntry, 75.0f, 50.0f);
|
||||
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
gSaveContext.eventChkInf[5] |= 0x200;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
|
@ -462,13 +462,13 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) {
|
||||
GetItemID getItemId = Randomizer_GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
|
||||
if (this->actor.parent != NULL && this->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
if (adult) {
|
||||
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
|
||||
|
@ -126,11 +126,11 @@ void func_809B0558(EnAni* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
gSaveContext.itemGetInf[1] |= 0x20;
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 200.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -140,11 +140,11 @@ void func_809B05F0(EnAni* this, GlobalContext* globalCtx) {
|
||||
EnAni_SetupAction(this, func_809B0558);
|
||||
}
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 200.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,6 +177,7 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, GlobalContext* globalCtx) {
|
||||
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
this->getItemId = sGetItemIds[this->prizeIndex];
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
|
||||
if ((this->getItemId == GI_BOMB_BAG_30) && (CUR_CAPACITY(UPG_BOMB_BAG) == 30)) {
|
||||
this->getItemId = GI_BOMB_BAG_40;
|
||||
@ -185,22 +186,27 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
switch (this->prizeIndex) {
|
||||
case EXITEM_BOMB_BAG_BOWLING:
|
||||
this->getItemId =
|
||||
Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20);
|
||||
this->getItemId = this->getItemEntry.getItemId;
|
||||
break;
|
||||
case EXITEM_HEART_PIECE_BOWLING:
|
||||
this->getItemId =
|
||||
Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE);
|
||||
this->getItemId = this->getItemEntry.getItemId;
|
||||
break;
|
||||
case EXITEM_BOMBCHUS_BOWLING:
|
||||
this->getItemId = Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10);
|
||||
this->getItemId = this->getItemEntry.getItemId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
player->stateFlags1 &= ~0x20000000;
|
||||
this->actor.parent = NULL;
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
player->stateFlags1 |= 0x20000000;
|
||||
this->actionFunc = EnBomBowlPit_WaitTillPrizeGiven;
|
||||
}
|
||||
@ -209,7 +215,11 @@ void EnBomBowlPit_WaitTillPrizeGiven(EnBomBowlPit* this, GlobalContext* globalCt
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnBomBowlPit_Reset;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ typedef struct EnBomBowlPit {
|
||||
/* 0x01D4 */ Vec3f unk_1D4; // camera eye (maxsteps)
|
||||
/* 0x01E0 */ EnExItem* exItem;
|
||||
/* 0x01E4 */ char unk_1E4[0x3520];
|
||||
/* */ GetItemEntry getItemEntry;
|
||||
} EnBomBowlPit; // size = 0x3704
|
||||
|
||||
#endif
|
||||
|
@ -447,41 +447,42 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
|
||||
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
|
||||
Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
||||
sItem = Randomizer_GetRandomizedItem(this->dyna.actor.params >> 5 & 0x7F, this->dyna.actor.id, this->dyna.actor.params, globalCtx->sceneNum);
|
||||
GetItemEntry blueRupeeEntry = ItemTable_RetrieveEntry(MOD_NONE, GI_RUPEE_BLUE);
|
||||
GetItemEntry blueRupee = ItemTable_RetrieveEntry(MOD_NONE, GI_RUPEE_BLUE);
|
||||
|
||||
// RANDOTODO treasure chest game rando
|
||||
if (Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) {
|
||||
if (gSaveContext.n64ddFlag && globalCtx->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) {
|
||||
if((this->dyna.actor.params & 0xF) < 2) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1B)) {
|
||||
sItem = blueRupeeEntry;
|
||||
sItem = blueRupee;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 2 && (this->dyna.actor.params & 0xF) < 4) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1C)) {
|
||||
sItem = blueRupeeEntry;
|
||||
sItem = blueRupee;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 4 && (this->dyna.actor.params & 0xF) < 6) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1D)) {
|
||||
sItem = blueRupeeEntry;
|
||||
sItem = blueRupee;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 6 && (this->dyna.actor.params & 0xF) < 8) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1E)) {
|
||||
sItem = blueRupeeEntry;
|
||||
sItem = blueRupee;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 8 && (this->dyna.actor.params & 0xF) < 10) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1F)) {
|
||||
sItem = blueRupeeEntry;
|
||||
sItem = blueRupee;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F554(&this->dyna.actor, globalCtx, 0 - sItem.getItemId);
|
||||
player->getItemEntry = sItem;
|
||||
// Chests need to have a negative getItemId in order to not immediately give their item
|
||||
// when approaching.
|
||||
sItem.getItemId = 0 - sItem.getItemId;
|
||||
GiveItemEntryFromActorWithFixedRange(&this->dyna.actor, globalCtx, sItem);
|
||||
}
|
||||
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||
EnBox_SetupAction(this, EnBox_Open);
|
||||
|
@ -453,7 +453,12 @@ void func_809EEA00(EnDivingGame* this, GlobalContext* globalCtx) {
|
||||
if ((this->unk_292 == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx))) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.parent = NULL;
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 90.0f, 10.0f);
|
||||
}
|
||||
this->actionFunc = func_809EEA90;
|
||||
}
|
||||
}
|
||||
@ -463,7 +468,12 @@ void func_809EEA90(EnDivingGame* this, GlobalContext* globalCtx) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_809EEAF8;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 90.0f, 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,8 @@ void EnDns_Talk(EnDns* this, GlobalContext* globalCtx) {
|
||||
void func_809EFDD0(EnDns* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.params == 0x9) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, Randomizer_GetRandomizedItemId(GI_STICK_UPGRADE_30, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f);
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_STICK_UPGRADE_30, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 130.0f, 100.0f);
|
||||
} else if (CUR_UPG_VALUE(UPG_STICKS) < 2) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_STICK_UPGRADE_20, 130.0f, 100.0f);
|
||||
} else {
|
||||
@ -379,14 +380,20 @@ void func_809EFDD0(EnDns* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
} else if (this->actor.params == 0xA) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, Randomizer_GetRandomizedItemId(GI_NUT_UPGRADE_40, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f);
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_NUT_UPGRADE_40, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 130.0f, 100.0f);
|
||||
} else if (CUR_UPG_VALUE(UPG_NUTS) < 2) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_NUT_UPGRADE_30, 130.0f, 100.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_NUT_UPGRADE_40, 130.0f, 100.0f);
|
||||
}
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetRandomizedItemId(this->dnsItemEntry->getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum) : this->dnsItemEntry->getItemId, 130.0f, 100.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, this->dnsItemEntry->getItemId, 130.0f, 100.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(this->dnsItemEntry->getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 130.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,13 +139,15 @@ void EnDntDemo_Judge(EnDntDemo* this, GlobalContext* globalCtx) {
|
||||
switch (Player_GetMask(globalCtx)) {
|
||||
case PLAYER_MASK_SKULL:
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GiveItemWithoutActor(globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_DEKU_THEATER_SKULL_MASK, GI_STICK_UPGRADE_30));
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DEKU_THEATER_SKULL_MASK, GI_STICK_UPGRADE_30);
|
||||
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
break;
|
||||
case PLAYER_MASK_TRUTH:
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1E)) {
|
||||
GiveItemWithoutActor(globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_DEKU_THEATER_MASK_OF_TRUTH, GI_NUT_UPGRADE_40));
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DEKU_THEATER_MASK_OF_TRUTH, GI_NUT_UPGRADE_40);
|
||||
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
}
|
||||
break;
|
||||
|
@ -548,7 +548,12 @@ void func_809FEC70(EnDu* this, GlobalContext* globalCtx) {
|
||||
EnDu_SetupAction(this, func_809FECE4);
|
||||
} else {
|
||||
f32 xzRange = this->actor.xzDistToPlayer + 1.0f;
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GC_DARUNIAS_JOY, GI_BRACELET) : GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GC_DARUNIAS_JOY, GI_BRACELET);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,6 +399,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) {
|
||||
this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f;
|
||||
}
|
||||
} else {
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
s32 getItemId;
|
||||
|
||||
this->actor.draw = NULL;
|
||||
@ -406,7 +407,8 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GET_PLAYER(globalCtx)->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11);
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
} else {
|
||||
if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) {
|
||||
getItemId = GI_BULLET_BAG_40;
|
||||
@ -414,24 +416,28 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) {
|
||||
getItemId = GI_BULLET_BAG_50;
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
this->actionFunc = EnExItem_TargetPrizeGive;
|
||||
}
|
||||
}
|
||||
|
||||
void EnExItem_TargetPrizeGive(EnExItem* this, GlobalContext* globalCtx) {
|
||||
s32 getItemId;
|
||||
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnExItem_TargetPrizeFinish;
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40;
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40;
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -602,6 +602,7 @@ void EnFr_Idle(EnFr* this, GlobalContext* globalCtx) {
|
||||
player->actor.world.pos.z = this->actor.world.pos.z; // z = -1220.0f
|
||||
player->currentYaw = player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
this->reward = GI_NONE;
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
this->actionFunc = EnFr_Activate;
|
||||
} else if (EnFr_IsAboveAndWithin30DistXZ(player, this)) {
|
||||
player->unk_6A8 = &this->actor;
|
||||
@ -837,6 +838,7 @@ s32 EnFr_IsFrogSongComplete(EnFr* this, GlobalContext* globalCtx) {
|
||||
void EnFr_OcarinaMistake(EnFr* this, GlobalContext* globalCtx) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->reward = GI_NONE;
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
func_80078884(NA_SE_SY_OCARINA_ERROR);
|
||||
Audio_OcaSetInstrument(0);
|
||||
sEnFrPointers.flags = 12;
|
||||
@ -945,6 +947,7 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) {
|
||||
songIndex = this->songIndex;
|
||||
this->actionFunc = EnFr_Deactivate;
|
||||
this->reward = GI_NONE;
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
if ((songIndex >= FROG_ZL) && (songIndex <= FROG_SOT)) {
|
||||
if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) {
|
||||
gSaveContext.eventChkInf[13] |= sSongIndex[songIndex];
|
||||
@ -962,7 +965,8 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
this->reward = GI_HEART_PIECE;
|
||||
} else {
|
||||
this->reward = Randomizer_GetItemIdFromKnownCheck(RC_ZR_FROGS_IN_THE_RAIN, GI_HEART_PIECE);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZR_FROGS_IN_THE_RAIN, GI_HEART_PIECE);
|
||||
this->reward = this->getItemEntry.getItemId;
|
||||
}
|
||||
} else {
|
||||
this->reward = GI_RUPEE_BLUE;
|
||||
@ -973,7 +977,8 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
this->reward = GI_HEART_PIECE;
|
||||
} else {
|
||||
this->reward = Randomizer_GetItemIdFromKnownCheck(RC_ZR_FROGS_OCARINA_GAME, GI_HEART_PIECE);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZR_FROGS_OCARINA_GAME, GI_HEART_PIECE);
|
||||
this->reward = this->getItemEntry.getItemId;
|
||||
}
|
||||
} else {
|
||||
this->reward = GI_RUPEE_PURPLE;
|
||||
@ -1024,7 +1029,11 @@ void EnFr_Deactivate(EnFr* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc = EnFr_Idle;
|
||||
} else {
|
||||
this->actionFunc = EnFr_GiveReward;
|
||||
func_8002F434(&this->actor, globalCtx, this->reward, 30.0f, 100.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->reward, 30.0f, 100.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 30.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1033,7 +1042,11 @@ void EnFr_GiveReward(EnFr* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnFr_SetIdle;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->reward, 30.0f, 100.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->reward, 30.0f, 100.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 30.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,7 @@ typedef struct EnFr {
|
||||
/* 0x03AA */ s16 xyAngleButterfly; // Butterfly Travels along random angles in the x-y plane
|
||||
/* 0x03AC */ Vec3f posButterfly; // Position/Coordinates of the Butterfly
|
||||
/* 0x03B8 */ Vec3f posButterflyLight; // Used in Lights_PointNoGlowSetInfo()
|
||||
/* */ GetItemEntry getItemEntry;
|
||||
} EnFr; // size = 0x03C4
|
||||
|
||||
typedef struct {
|
||||
|
@ -154,8 +154,8 @@ void GivePlayerRandoRewardSongOfStorms(EnFu* windmillGuy, GlobalContext* globalC
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
windmillGuy->actionFunc = func_80A1DBD4;
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_SONG_OF_STORMS);
|
||||
func_8002F434(&windmillGuy->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_STORMS);
|
||||
GiveItemEntryFromActor(&windmillGuy->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,12 @@ void func_80A2FA50(EnGb* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_80A2FB40(EnGb* this, GlobalContext* globalCtx) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->dyna.actor, globalCtx, GI_BOTTLE, 100.0f, 10.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE);
|
||||
GiveItemEntryFromActor(&this->dyna.actor, globalCtx, getItemEntry, 100.0f, 10.0f);
|
||||
}
|
||||
this->actionFunc = func_80A2FBB0;
|
||||
}
|
||||
}
|
||||
@ -363,7 +368,12 @@ void func_80A2FBB0(EnGb* this, GlobalContext* globalCtx) {
|
||||
this->dyna.actor.parent = NULL;
|
||||
this->actionFunc = func_80A2FC0C;
|
||||
} else {
|
||||
func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->dyna.actor, globalCtx, GI_BOTTLE, 100.0f, 10.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE);
|
||||
GiveItemEntryFromActor(&this->dyna.actor, globalCtx, getItemEntry, 100.0f, 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -502,6 +502,7 @@ void EnGe1_SetupWait_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
s32 getItemId;
|
||||
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
@ -533,21 +534,28 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(
|
||||
RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId != GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnGe1_BeginGiveItem_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
s32 getItemId;
|
||||
|
||||
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
|
||||
@ -567,18 +575,23 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_GF_HBA_1500_POINTS,
|
||||
CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId != GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void EnGe1_TalkWinPrize_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
||||
|
@ -457,7 +457,12 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnGe2_SetActionAfterTalk;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -466,7 +471,12 @@ void EnGe2_GiveCard(EnGe2* this, GlobalContext* globalCtx) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
this->actionFunc = EnGe2_WaitTillCardGiven;
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,12 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnGe3_Wait;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,7 +156,12 @@ void EnGe3_GiveCard(EnGe3* this, GlobalContext* globalCtx) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
this->actionFunc = EnGe3_WaitTillCardGiven;
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -947,6 +947,7 @@ void func_80A40B1C(EnGo* this, GlobalContext* globalCtx) {
|
||||
void EnGo_GetItem(EnGo* this, GlobalContext* globalCtx) {
|
||||
f32 xzDist;
|
||||
f32 yDist;
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
s32 getItemId;
|
||||
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
@ -957,7 +958,12 @@ void EnGo_GetItem(EnGo* this, GlobalContext* globalCtx) {
|
||||
this->unk_20C = 0;
|
||||
if ((this->actor.params & 0xF0) == 0x90) {
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) {
|
||||
getItemId = gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS) : GI_SWORD_BGS;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_SWORD_BGS;
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
this->unk_20C = 1;
|
||||
}
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEDROPS) {
|
||||
@ -982,7 +988,11 @@ void EnGo_GetItem(EnGo* this, GlobalContext* globalCtx) {
|
||||
|
||||
yDist = fabsf(this->actor.yDistToPlayer) + 1.0f;
|
||||
xzDist = this->actor.xzDistToPlayer + 1.0f;
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, xzDist, yDist);
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, xzDist, yDist);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, xzDist, yDist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,6 +287,13 @@ void EnGo2_GetItem(EnGo2* this, GlobalContext* globalCtx, s32 getItemId) {
|
||||
fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
|
||||
void EnGo2_GetItemEntry(EnGo2* this, GlobalContext* globalCtx, GetItemEntry getItemEntry) {
|
||||
this->getItemId = getItemEntry.getItemId;
|
||||
this->getItemEntry = getItemEntry;
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, this->actor.xzDistToPlayer + 1.0f,
|
||||
fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
|
||||
s32 EnGo2_GetDialogState(EnGo2* this, GlobalContext* globalCtx) {
|
||||
s16 dialogState = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
@ -335,8 +342,6 @@ u16 EnGo2_GetTextIdGoronCityRollingBig(GlobalContext* globalCtx, EnGo2* this) {
|
||||
}
|
||||
|
||||
s16 EnGo2_GetStateGoronCityRollingBig(GlobalContext* globalCtx, EnGo2* this) {
|
||||
s32 bombBagUpgrade;
|
||||
|
||||
switch (Message_GetState(&globalCtx->msgCtx)) {
|
||||
case TEXT_STATE_CLOSING:
|
||||
return 2;
|
||||
@ -345,11 +350,10 @@ s16 EnGo2_GetStateGoronCityRollingBig(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (this->actor.textId == 0x3012) {
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
if(!gSaveContext.n64ddFlag) {
|
||||
bombBagUpgrade = CUR_CAPACITY(UPG_BOMB_BAG) == 30 ? GI_BOMB_BAG_40 : GI_BOMB_BAG_30;
|
||||
EnGo2_GetItem(this, globalCtx, CUR_CAPACITY(UPG_BOMB_BAG) == 30 ? GI_BOMB_BAG_40 : GI_BOMB_BAG_30);
|
||||
} else {
|
||||
bombBagUpgrade = Randomizer_GetItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40);
|
||||
EnGo2_GetItemEntry(this, globalCtx, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40));
|
||||
}
|
||||
EnGo2_GetItem(this, globalCtx, bombBagUpgrade);
|
||||
Message_CloseTextbox(globalCtx);
|
||||
gSaveContext.infTable[17] |= 0x4000;
|
||||
return 2;
|
||||
@ -543,7 +547,7 @@ s16 EnGo2_GetStateGoronCityLink(GlobalContext* globalCtx, EnGo2* this) {
|
||||
}
|
||||
|
||||
gSaveContext.infTable[16] |= 0x200;
|
||||
EnGo2_GetItem(this, globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
|
||||
EnGo2_GetItemEntry(this, globalCtx, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
return 2;
|
||||
@ -622,7 +626,7 @@ s16 EnGo2_GetStateGoronDmtBiggoron(GlobalContext* globalCtx, EnGo2* this) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
EnGo2_GetItem(this, globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS));
|
||||
EnGo2_GetItemEntry(this, globalCtx, Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS));
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else {
|
||||
EnGo2_GetItem(this, globalCtx, GI_SWORD_BGS);
|
||||
@ -1575,6 +1579,7 @@ void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->unk_216 = this->actor.shape.rot.z;
|
||||
this->unk_26E = 1;
|
||||
this->path = Path_GetByIndex(globalCtx, (this->actor.params & 0x3E0) >> 5, 0x1F);
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
switch (this->actor.params & 0x1F) {
|
||||
case GORON_CITY_ENTRANCE:
|
||||
case GORON_CITY_ISLAND:
|
||||
@ -1814,8 +1819,11 @@ void EnGo2_SetupGetItem(EnGo2* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnGo2_SetGetItem;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, this->actor.xzDistToPlayer + 1.0f,
|
||||
fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,7 @@ typedef struct EnGo2 {
|
||||
/* 0x0598 */ char unk_598[0x02];
|
||||
/* 0x059A */ s16 camId;
|
||||
/* 0x059C */ s16 unk_59C;
|
||||
/* */ GetItemEntry getItemEntry;
|
||||
} EnGo2; // size = 0x05A0
|
||||
|
||||
#endif
|
||||
|
@ -659,7 +659,18 @@ s16 func_80A70058(GlobalContext* globalCtx, Actor* thisx) {
|
||||
gSaveContext.dogParams = 0;
|
||||
break;
|
||||
case 0x709F:
|
||||
func_80A6F7CC(this, globalCtx, (gSaveContext.infTable[25] & 2) ? GI_RUPEE_BLUE : gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_MARKET_LOST_DOG, GI_HEART_PIECE) : GI_HEART_PIECE);
|
||||
if (gSaveContext.infTable[25] & 2) { // Already brought the lost dog back
|
||||
func_80A6F7CC(this, globalCtx, GI_RUPEE_BLUE);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_80A6F7CC(this, globalCtx, GI_HEART_PIECE);
|
||||
} else {
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_LOST_DOG, GI_HEART_PIECE);
|
||||
// The follownig line and last arguments of GiveItemEntryFromActor are copied from func_80A6F7CC
|
||||
this->unkGetItemId = this->getItemEntry.getItemId;
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
}
|
||||
this->actionFunc = func_80A714C4;
|
||||
break;
|
||||
}
|
||||
@ -883,6 +894,7 @@ void EnHy_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
this->actionFunc = EnHy_InitImpl;
|
||||
}
|
||||
|
||||
@ -1050,8 +1062,11 @@ void func_80A714C4(EnHy* this, GlobalContext* globalCtx) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_80A71530;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f,
|
||||
fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ typedef struct EnHy {
|
||||
/* 0x0270 */ Vec3s jointTable[16];
|
||||
/* 0x02D0 */ Vec3s morphTable[16];
|
||||
/* 0x0330 */ u16 unk_330;
|
||||
/* */ GetItemEntry getItemEntry;
|
||||
} EnHy; // size = 0x0334
|
||||
|
||||
#endif
|
||||
|
@ -454,6 +454,7 @@ void EnKz_Wait(EnKz* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) {
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
s32 getItemId;
|
||||
f32 xzRange;
|
||||
f32 yRange;
|
||||
@ -465,18 +466,24 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (this->isTrading) {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_ZD_TRADE_PRESCRIPTION, GI_FROG);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_TRADE_PRESCRIPTION, GI_FROG);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_PRESCRIPTION);
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_ZD_KING_ZORA_THAWED, GI_TUNIC_ZORA);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_KING_ZORA_THAWED, GI_TUNIC_ZORA);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
} else {
|
||||
getItemId = this->isTrading ? GI_FROG : GI_TUNIC_ZORA;
|
||||
}
|
||||
yRange = fabsf(this->actor.yDistToPlayer) + 1.0f;
|
||||
xzRange = this->actor.xzDistToPlayer + 1.0f;
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, xzRange, yRange);
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, xzRange, yRange);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, xzRange, yRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,11 +338,11 @@ void func_80AA0EA0(EnMa1* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = func_80AA0EFC;
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(RC_HC_MALON_EGG, GI_WEIRD_EGG);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 120.0f, 10.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_WEIRD_EGG, 120.0f, 10.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_HC_MALON_EGG, GI_WEIRD_EGG);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 120.0f, 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -357,7 +357,7 @@ void func_80AA0EFC(EnMa1* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardMalon(EnMa1* malon, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_EPONAS_SONG);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_EPONAS_SONG);
|
||||
// Prevents flag from getting set if we weren't able to get the item (i.e. Player is holding shield
|
||||
// when closing the textbox).
|
||||
if (malon->actor.parent != NULL && malon->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
@ -367,7 +367,7 @@ void GivePlayerRandoRewardMalon(EnMa1* malon, GlobalContext* globalCtx, Randomiz
|
||||
// (confirmed via breakpoints in a vanilla save).
|
||||
malon->actionFunc = func_80AA0D88;
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
func_8002F434(&malon->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GiveItemEntryFromActor(&malon->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
}
|
||||
// make malon sing again after giving the item.
|
||||
malon->unk_1E8.unk_00 = 0;
|
||||
|
@ -211,14 +211,24 @@ void func_80AACFA0(EnMk* this, GlobalContext* globalCtx) {
|
||||
gSaveContext.itemGetInf[1] |= 1;
|
||||
} else {
|
||||
// not sure when/how/if this is getting called
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AAD014(EnMk* this, GlobalContext* globalCtx) {
|
||||
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_80AACFA0;
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
this->flags |= 1;
|
||||
|
@ -89,6 +89,7 @@ void EnNiwLady_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
osSyncPrintf("\n\n");
|
||||
this->actionFunc = func_80AB9F24;
|
||||
thisx->uncullZoneForward = 600.0f;
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
}
|
||||
|
||||
void EnNiwLady_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@ -305,12 +306,12 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||
if (!(gSaveContext.itemGetInf[0] & 0x1000)) {
|
||||
this->actor.parent = NULL;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 itemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_ANJU_AS_CHILD, GI_BOTTLE);
|
||||
func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 50.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
this->getItemId = GI_BOTTLE;
|
||||
func_8002F434(&this->actor, globalCtx, GI_BOTTLE, 100.0f, 50.0f);
|
||||
} else {
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_CHILD, GI_BOTTLE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 100.0f, 50.0f);
|
||||
}
|
||||
|
||||
this->actionFunc = func_80ABAC00;
|
||||
@ -395,11 +396,12 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.parent = NULL;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 itemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||
func_8002F434(&this->actor, globalCtx, itemId, 200.0f, 100.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f);
|
||||
} else {
|
||||
// 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->actionFunc = func_80ABAC00;
|
||||
@ -457,14 +459,18 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (getItemId == GI_POCKET_EGG) {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, 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);
|
||||
} else {
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
|
||||
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
|
||||
}
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||
if (this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ typedef struct EnNiwLady {
|
||||
/* 0x0284 */ s32 getItemId;
|
||||
/* 0x0288 */ struct_80034A14_arg1 unk_288;
|
||||
/* 0x02B0 */ ColliderCylinder collider;
|
||||
/* 0x02FC */ GetItemEntry getItemEntry;
|
||||
} EnNiwLady; // size = 0x02FC
|
||||
|
||||
#endif
|
||||
|
@ -327,8 +327,8 @@ void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx,
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
GiveItemEntryFromActor(&song->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -618,14 +618,12 @@ void func_80AF67D0(EnSa* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSaria(EnSa* saria, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
GetItemID getItemId =
|
||||
Randomizer_GetItemIdFromKnownCheck(check, RG_SARIAS_SONG);
|
||||
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SARIAS_SONG);
|
||||
if (saria->actor.parent != NULL && saria->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
func_8002F434(&saria->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GiveItemEntryFromActor(&saria->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1035,8 +1035,12 @@ void EnSkj_SariaSongTalk(EnSkj* this, GlobalContext* globalCtx) {
|
||||
EnSkj_SetupWaitInRange(this);
|
||||
} else {
|
||||
func_80AFFE24(this);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this),
|
||||
EnSkj_GetItemYRange(this));
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1050,7 +1054,12 @@ void func_80AFFE44(EnSkj* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
EnSkj_SetupPostSariasSong(this);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1527,11 +1536,12 @@ void EnSkj_WonOcarinaMiniGame(EnSkj* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnSkj_WaitToGiveReward(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3
|
||||
? Randomizer_GetItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE)
|
||||
: sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum],
|
||||
26.0f, 26.0f);
|
||||
if (gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 26.0f, 26.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
|
||||
}
|
||||
|
||||
this->actionFunc = EnSkj_GiveOcarinaGameReward;
|
||||
}
|
||||
@ -1542,11 +1552,12 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnSkj_FinishOcarinaGameRound;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3
|
||||
? Randomizer_GetItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE)
|
||||
: sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum],
|
||||
26.0f, 26.0f);
|
||||
if (gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 26.0f, 26.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,27 +239,29 @@ void EnSth_ParentRewardObtainedWait(EnSth* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnSth_GivePlayerItem(EnSth* this, GlobalContext* globalCtx) {
|
||||
u16 getItemId = sGetItemIds[this->actor.params];
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
switch (getItemId) {
|
||||
case GI_RUPEE_GOLD:
|
||||
break;
|
||||
case GI_WALLET_ADULT:
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_10_GOLD_SKULLTULA_REWARD, GI_WALLET_ADULT);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_10_GOLD_SKULLTULA_REWARD, GI_WALLET_ADULT);
|
||||
break;
|
||||
case GI_STONE_OF_AGONY:
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_20_GOLD_SKULLTULA_REWARD, GI_STONE_OF_AGONY);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_20_GOLD_SKULLTULA_REWARD, GI_STONE_OF_AGONY);
|
||||
break;
|
||||
case GI_WALLET_GIANT:
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_30_GOLD_SKULLTULA_REWARD, GI_WALLET_GIANT);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_30_GOLD_SKULLTULA_REWARD, GI_WALLET_GIANT);
|
||||
break;
|
||||
case GI_BOMBCHUS_10:
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_40_GOLD_SKULLTULA_REWARD, GI_BOMBCHUS_10);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_40_GOLD_SKULLTULA_REWARD, GI_BOMBCHUS_10);
|
||||
break;
|
||||
case GI_HEART_PIECE:
|
||||
getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_50_GOLD_SKULLTULA_REWARD, GI_HEART_PIECE);
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_50_GOLD_SKULLTULA_REWARD, GI_HEART_PIECE);
|
||||
break;
|
||||
}
|
||||
getItemId = getItemEntry.getItemId;
|
||||
} else {
|
||||
switch (this->actor.params) {
|
||||
case 1:
|
||||
@ -277,7 +279,11 @@ void EnSth_GivePlayerItem(EnSth* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void EnSth_GiveReward(EnSth* this, GlobalContext* globalCtx) {
|
||||
|
@ -169,6 +169,7 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->blinkFunc = EnSyatekiMan_BlinkWait;
|
||||
this->actor.colChkInfo.cylRadius = 100;
|
||||
this->actionFunc = EnSyatekiMan_Start;
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
}
|
||||
|
||||
void EnSyatekiMan_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@ -336,7 +337,8 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
if (!LINK_IS_ADULT) {
|
||||
if(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1E)) {
|
||||
this->getItemId = Randomizer_GetItemIdFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50);
|
||||
this->getItemId = this->getItemEntry.getItemId;
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
} else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x2000)) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Pachinko ☆☆☆☆☆ %d\n" VT_RST,
|
||||
@ -351,7 +353,8 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
} else {
|
||||
if(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
this->getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50);
|
||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50);
|
||||
this->getItemId = this->getItemEntry.getItemId;
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x4000)) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Bow ☆☆☆☆☆ %d\n" VT_RST,
|
||||
@ -371,7 +374,11 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
||||
this->getItemId = GI_RUPEE_PURPLE;
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
this->actionFunc = EnSyatekiMan_GivePrize;
|
||||
break;
|
||||
case SYATEKI_RESULT_ALMOST:
|
||||
@ -400,7 +407,11 @@ void EnSyatekiMan_GivePrize(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnSyatekiMan_FinishPrize;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ typedef struct EnSyatekiMan {
|
||||
/* 0x0220 */ Actor* tempGallery;
|
||||
/* 0x0224 */ EnSyatekiManOtherFunc blinkFunc; // Seems to be part of a blink system with unk_20C and unk_20E, but it's unused.
|
||||
/* 0x0228 */ s16 csCam;
|
||||
/* */ GetItemEntry getItemEntry;
|
||||
} EnSyatekiMan; // size = 0x022C
|
||||
|
||||
#endif
|
||||
|
@ -876,7 +876,12 @@ void func_80B15E80(EnTa* this, GlobalContext* globalCtx) {
|
||||
} else if (this->unk_2E0 & 2) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_MILK, 10000.0f, 50.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_MILK_BOTTLE, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_MILK_BOTTLE, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
this->unk_2E0 |= 1;
|
||||
}
|
||||
@ -886,7 +891,12 @@ void func_80B15F54(EnTa* this, GlobalContext* globalCtx) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->unk_2E0 &= ~0x2;
|
||||
func_80B13AA0(this, func_80B15E80, func_80B16938);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE) : GI_MILK_BOTTLE, 10000.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_MILK_BOTTLE, 10000.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -292,14 +292,12 @@ void GivePlayerRandoRewardSheikSong(EnXc* sheik, GlobalContext* globalCtx, Rando
|
||||
if (!(gSaveContext.eventChkInf[5] & sheikType)) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, ogSongId);
|
||||
if (check == RC_SHEIK_AT_TEMPLE && !Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
if (func_8002F434(&sheik->actor, globalCtx, getItemEntry.getItemId, 10000.0f, 100.0f)) {
|
||||
player->getItemEntry = getItemEntry;
|
||||
if (GiveItemEntryFromActor(&sheik->actor, globalCtx, getItemEntry, 10000.0f, 100.0f)) {
|
||||
player->pendingFlag.flagID = 0x1F;
|
||||
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
||||
}
|
||||
} else if (check != RC_SHEIK_AT_TEMPLE) {
|
||||
if (func_8002F434(&sheik->actor, globalCtx, getItemEntry.getItemId, 10000.0f, 100.0f)) {
|
||||
player->getItemEntry = getItemEntry;
|
||||
if (GiveItemEntryFromActor(&sheik->actor, globalCtx, getItemEntry, 10000.0f, 100.0f)) {
|
||||
player->pendingFlag.flagID = 0x55;
|
||||
player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF;
|
||||
}
|
||||
|
@ -233,8 +233,8 @@ void GivePlayerRandoRewardZeldaChild(EnZl4* zelda, GlobalContext* globalCtx, Ran
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1E) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA) && Actor_TextboxIsClosing(&zelda->actor, globalCtx) &&
|
||||
(globalCtx->msgCtx.textId == 0x703C || globalCtx->msgCtx.textId == 0x703D)) {
|
||||
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
func_8002F434(&zelda->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
GiveItemEntryFromActor(&zelda->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
|
||||
} else if (Flags_GetTreasure(globalCtx, 0x1E) && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.eventChkInf[4] |= 1;
|
||||
|
@ -5002,6 +5002,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
||||
(Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE)) &&
|
||||
Message_ShouldAdvance(globalCtx)) {
|
||||
s32 getItemId;
|
||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
|
||||
Message_CloseTextbox(globalCtx);
|
||||
|
||||
@ -5056,9 +5057,12 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
||||
if (D_80B7E078 >= Fishing_GetMinimumRequiredScore()) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x400;
|
||||
sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1;
|
||||
getItemId = gSaveContext.n64ddFlag ?
|
||||
Randomizer_GetItemIdFromKnownCheck(RC_LH_CHILD_FISHING, GI_HEART_PIECE) :
|
||||
GI_HEART_PIECE;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_CHILD_FISHING, GI_HEART_PIECE);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -5066,9 +5070,12 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
||||
if (D_80B7E078 >= Fishing_GetMinimumRequiredScore()) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x800;
|
||||
sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1;
|
||||
getItemId = gSaveContext.n64ddFlag ?
|
||||
Randomizer_GetItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD) :
|
||||
GI_SCALE_GOLD;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_SCALE_GOLD;
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5078,7 +5085,11 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
this->actor.parent = NULL;
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
this->unk_15C = 23;
|
||||
}
|
||||
break;
|
||||
@ -5142,9 +5153,8 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_GOLD, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
Randomizer_GetItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD), 2000.0f,
|
||||
1000.0f);
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 2000.0f, 1000.0f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -59,11 +59,11 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Flags_SetCollectible(globalCtx, 0x1F);
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = Randomizer_GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 40.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_CONTAINER_2, 30.0f, 40.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 30.0f, 40.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,11 +133,11 @@ void func_80B85824(ItemEtcetera* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 50.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 30.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -156,11 +156,11 @@ void func_80B858B4(ItemEtcetera* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
if (0) {} // Necessary to match
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 50.0f);
|
||||
} else {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 30.0f, 50.0f);
|
||||
}
|
||||
|
||||
if ((globalCtx->gameplayFrames & 0xD) == 0) {
|
||||
|
@ -190,11 +190,12 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc = ItemOcarina_StartSoTCutscene;
|
||||
this->actor.draw = NULL;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
gSaveContext.n64ddFlag
|
||||
? Randomizer_GetItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT)
|
||||
: GI_OCARINA_OOT,
|
||||
30.0f, 50.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_OCARINA_OOT, 30.0f, 50.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 30.0f, 50.0f);
|
||||
}
|
||||
|
||||
if ((globalCtx->gameplayFrames & 13) == 0) {
|
||||
EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f);
|
||||
|
Loading…
Reference in New Issue
Block a user