Fix check tracker performance changes.

Move Mysterious Shuffle functionality to `hook_handlers.cpp` when applicable.
This commit is contained in:
Malkierian 2024-05-07 13:07:33 -07:00
parent d10b68516c
commit cfd93f160d
11 changed files with 81 additions and 157 deletions

View File

@ -24,7 +24,7 @@ void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getItemEntry);
void Randomizer_DrawMysteryItem(PlayState* play, GetItemEntry getItemEntry); void Randomizer_DrawMysteryItem(PlayState* play, GetItemEntry getItemEntry);
#define GET_ITEM_MYSTERY \ #define GET_ITEM_MYSTERY \
{ ITEM_NONE, 0, 0, 0, 0, 0, 0, 0, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_JUNK, Randomizer_DrawMysteryItem } { ITEM_NONE_FE, 0, 0, 0, 0, 0, 0, ITEM_NONE_FE, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_JUNK, NULL, MOD_RANDOMIZER, (CustomDrawFunc)Randomizer_DrawMysteryItem }
#ifdef __cplusplus #ifdef __cplusplus
}; };
#endif #endif

View File

@ -33,6 +33,8 @@ extern "C" {
#include "src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h" #include "src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h"
#include "src/overlays/actors/ovl_En_Ge1/z_en_ge1.h" #include "src/overlays/actors/ovl_En_Ge1/z_en_ge1.h"
#include "adult_trade_shuffle.h" #include "adult_trade_shuffle.h"
#include "draw.h"
extern SaveContext gSaveContext; extern SaveContext gSaveContext;
extern PlayState* gPlayState; extern PlayState* gPlayState;
} }
@ -357,13 +359,21 @@ void EnExItem_WaitForObjectRandomized(EnExItem* enExItem, PlayState* play) {
void EnItem00_DrawRandomizedItem(EnItem00* enItem00, PlayState* play) { void EnItem00_DrawRandomizedItem(EnItem00* enItem00, PlayState* play) {
f32 mtxScale = CVarGetFloat(CVAR_ENHANCEMENT("TimeSavers.SkipGetItemAnimationScale"), 10.0f); f32 mtxScale = CVarGetFloat(CVAR_ENHANCEMENT("TimeSavers.SkipGetItemAnimationScale"), 10.0f);
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
EnItem00_CustomItemsParticles(&enItem00->actor, play, enItem00->itemEntry); GetItemEntry randoItem = enItem00->itemEntry;
GetItemEntry_Draw(play, enItem00->itemEntry); if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
randoItem = GET_ITEM_MYSTERY;
}
EnItem00_CustomItemsParticles(&enItem00->actor, play, randoItem);
GetItemEntry_Draw(play, randoItem);
} }
void ItemBHeart_DrawRandomizedItem(ItemBHeart* itemBHeart, PlayState* play) { void ItemBHeart_DrawRandomizedItem(ItemBHeart* itemBHeart, PlayState* play) {
EnItem00_CustomItemsParticles(&itemBHeart->actor, play, itemBHeart->sohItemEntry); GetItemEntry randoItem = itemBHeart->sohItemEntry;
GetItemEntry_Draw(play, itemBHeart->sohItemEntry); if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
randoItem = GET_ITEM_MYSTERY;
}
EnItem00_CustomItemsParticles(&itemBHeart->actor, play, randoItem);
GetItemEntry_Draw(play, randoItem);
} }
void ItemBHeart_UpdateRandomizedItem(Actor* actor, PlayState* play) { void ItemBHeart_UpdateRandomizedItem(Actor* actor, PlayState* play) {
@ -378,14 +388,18 @@ void ItemBHeart_UpdateRandomizedItem(Actor* actor, PlayState* play) {
} }
void ItemEtcetera_DrawRandomizedItem(ItemEtcetera* itemEtcetera, PlayState* play) { void ItemEtcetera_DrawRandomizedItem(ItemEtcetera* itemEtcetera, PlayState* play) {
EnItem00_CustomItemsParticles(&itemEtcetera->actor, play, itemEtcetera->sohItemEntry); GetItemEntry randoItem = itemEtcetera->sohItemEntry;
if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
randoItem = GET_ITEM_MYSTERY;
}
EnItem00_CustomItemsParticles(&itemEtcetera->actor, play, randoItem);
func_8002EBCC(&itemEtcetera->actor, play, 0); func_8002EBCC(&itemEtcetera->actor, play, 0);
func_8002ED80(&itemEtcetera->actor, play, 0); func_8002ED80(&itemEtcetera->actor, play, 0);
GetItemEntry_Draw(play, itemEtcetera->sohItemEntry); GetItemEntry_Draw(play, randoItem);
} }
void ItemEtcetera_DrawRandomizedItemThroughLens(ItemEtcetera* itemEtcetera, PlayState* play) { void ItemEtcetera_DrawRandomizedItemThroughLens(ItemEtcetera* itemEtcetera, PlayState* play) {
if (play->actorCtx.lensActive) { if (play->actorCtx.lensActive) { // todo [Rando] mysterious shuffle for chest minigame key shuffle
ItemEtcetera_DrawRandomizedItem(itemEtcetera, play); ItemEtcetera_DrawRandomizedItem(itemEtcetera, play);
} }
} }
@ -1160,10 +1174,14 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) {
} }
void EnSi_DrawRandomizedItem(EnSi* enSi, PlayState* play) { void EnSi_DrawRandomizedItem(EnSi* enSi, PlayState* play) {
GetItemEntry randoItem = enSi->sohGetItemEntry;
if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
randoItem = GET_ITEM_MYSTERY;
}
func_8002ED80(&enSi->actor, play, 0); func_8002ED80(&enSi->actor, play, 0);
func_8002EBCC(&enSi->actor, play, 0); func_8002EBCC(&enSi->actor, play, 0);
EnItem00_CustomItemsParticles(&enSi->actor, play, enSi->sohGetItemEntry); EnItem00_CustomItemsParticles(&enSi->actor, play, randoItem);
GetItemEntry_Draw(play, enSi->sohGetItemEntry); GetItemEntry_Draw(play, randoItem);
} }
u32 EnDns_RandomizerPurchaseableCheck(EnDns* enDns) { u32 EnDns_RandomizerPurchaseableCheck(EnDns* enDns) {

View File

@ -11,7 +11,7 @@
#include <soh/Enhancements/randomizer/randomizerTypes.h> #include <soh/Enhancements/randomizer/randomizerTypes.h>
#include "soh/Enhancements/randomizer/randomizer_check_objects.h" #include "soh/Enhancements/randomizer/randomizer_check_objects.h"
#include "soh/Enhancements/randomizer/randomizer_check_tracker.h" #include "soh/Enhancements/randomizer/randomizer_check_tracker.h"
#include "soh/Enhancements/randomizer/randomizer_tricks.h" #include "soh/Enhancements/randomizer/tricks.h"
#include <soh/Enhancements/custom-message/CustomMessageManager.h> #include <soh/Enhancements/custom-message/CustomMessageManager.h>
#include "soh/Enhancements/item-tables/ItemTableTypes.h" #include "soh/Enhancements/item-tables/ItemTableTypes.h"
#include "../custom-message/CustomMessageTypes.h" #include "../custom-message/CustomMessageTypes.h"

View File

@ -1092,12 +1092,12 @@ bool ShouldHideArea(RandomizerCheckArea rcArea) {
return true; return true;
} }
bool ShouldShowCheck(RandomizerCheckObject check) { bool ShouldShowCheck(RandomizerCheck check) {
return ( return (
IsVisibleInCheckTracker(check) && IsVisibleInCheckTracker(check) &&
(checkSearch.Filters.Size == 0 || (checkSearch.Filters.Size == 0 ||
checkSearch.PassFilter(RandomizerCheckObjects::GetRCAreaName(Rando::StaticData::GetLocation(check)->GetArea()).c_str()) || checkSearch.PassFilter(RandomizerCheckObjects::GetRCAreaName(Rando::StaticData::GetLocation(check)->GetArea()).c_str()) ||
checkSearch.PassFilter(Rando::StaticData::GetLocation(check)->GetShortName().c_str()) checkSearch.PassFilter(Rando::StaticData::GetLocation(check)->GetShortName().c_str()))
); );
} }
@ -1244,7 +1244,7 @@ void LoadSettings() {
fishsanityAgeSplit = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FISHSANITY_AGE_SPLIT); fishsanityAgeSplit = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FISHSANITY_AGE_SPLIT);
} }
bool IsCheckShuffled(RandomizerCheckObject rcObj) { bool IsCheckShuffled(RandomizerCheck rc) {
Rando::Location* loc = Rando::StaticData::GetLocation(rc); Rando::Location* loc = Rando::StaticData::GetLocation(rc);
if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LOGIC_RULES) != RO_LOGIC_VANILLA) { if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LOGIC_RULES) != RO_LOGIC_VANILLA) {
return return
@ -1307,8 +1307,10 @@ bool IsCheckShuffled(RandomizerCheckObject rcObj) {
return false; return false;
} }
bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) { bool IsVisibleInCheckTracker(RandomizerCheck rc) {
return IsCheckShuffled(rcObj) || (rcObj.rcType == RCTYPE_SKULL_TOKEN && alwaysShowGS) || (rcObj.rcType == RCTYPE_SHOP && (showShops && (!hideShopRightChecks))); auto loc = Rando::StaticData::GetLocation(rc);
return IsCheckShuffled(rc) || (loc->GetRCType() == RCTYPE_SKULL_TOKEN && alwaysShowGS) ||
(loc->GetRCType() == RCTYPE_SHOP && (showShops && (!hideShopRightChecks)));
} }
void UpdateInventoryChecks() { void UpdateInventoryChecks() {
@ -1501,7 +1503,7 @@ void DrawLocation(RandomizerCheck rc) {
//Draw the extra info //Draw the extra info
txt = ""; txt = "";
bool mystery = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && OTRGlobals::Instance->gRandomizer->merchantPrices.contains(rcObj.rc); bool mystery = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && itemLoc->IsAddedToPool();
if (checkData.hintItem != 0) { if (checkData.hintItem != 0) {
// TODO hints // TODO hints
@ -1534,7 +1536,7 @@ void DrawLocation(RandomizerCheck rc) {
} else if (!mystery) { } else if (!mystery) {
txt = itemLoc->GetPlacedItem().GetName().GetForLanguage(gSaveContext.language); txt = itemLoc->GetPlacedItem().GetName().GetForLanguage(gSaveContext.language);
} }
if (!IsVisibleInCheckTracker(rcObj) && status == RCSHOW_IDENTIFIED && !mystery) { if (!IsVisibleInCheckTracker(rc) && status == RCSHOW_IDENTIFIED && !mystery) {
txt += fmt::format(" - {}", gSaveContext.checkTrackerData[rc].price); txt += fmt::format(" - {}", gSaveContext.checkTrackerData[rc].price);
} }
} else { } else {

View File

@ -47,7 +47,7 @@ void DefaultCheckData(RandomizerCheck rc);
void Teardown(); void Teardown();
void UpdateAllOrdering(); void UpdateAllOrdering();
bool IsVisibleInCheckTracker(RandomizerCheck rc); bool IsVisibleInCheckTracker(RandomizerCheck rc);
bool IsCheckShuffled(RandomizerCheck check); bool IsCheckShuffled(RandomizerCheck rc);
void InitTrackerData(bool isDebug); void InitTrackerData(bool isDebug);
RandomizerCheckArea GetCheckArea(); RandomizerCheckArea GetCheckArea();
void UpdateCheck(uint32_t, RandomizerCheckTrackerData); void UpdateCheck(uint32_t, RandomizerCheckTrackerData);

View File

@ -2445,8 +2445,8 @@ extern "C" ItemObtainability Randomizer_GetItemObtainabilityFromRandomizerCheck(
return OTRGlobals::Instance->gRandomizer->GetItemObtainabilityFromRandomizerCheck(randomizerCheck); return OTRGlobals::Instance->gRandomizer->GetItemObtainabilityFromRandomizerCheck(randomizerCheck);
} }
extern "C" bool Randomizer_IsCheckShuffled(RandomizerCheck randomizerCheck) { extern "C" bool Randomizer_IsCheckShuffled(RandomizerCheck rc) {
return CheckTracker::IsCheckShuffled(RandomizerCheckObjects::GetAllRCObjects().find(randomizerCheck)->second); return CheckTracker::IsCheckShuffled(rc);
} }
extern "C" GetItemEntry GetItemMystery() { extern "C" GetItemEntry GetItemMystery() {

View File

@ -1361,23 +1361,7 @@ static const Vtx customDropVtx[] = {
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...). * Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
*/ */
void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) { void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
if (IS_RANDO && (this->getItemId != GI_NONE || this->actor.params == ITEM00_SMALL_KEY)) { if (this->actor.params == ITEM00_BOMBCHU) {
RandomizerCheck randoCheck =
Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->ogParams);
GetItemEntry giEntry = this->randoGiEntry;
if (randoCheck != RC_UNKNOWN_CHECK) {
this->randoGiEntry = Randomizer_GetItemFromKnownCheck(randoCheck, GI_NONE);
giEntry = (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(randoCheck))
? GetItemMystery() : this->randoGiEntry;
giEntry.getItemFrom = ITEM_FROM_FREESTANDING;
}
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
EnItem00_CustomItemsParticles(&this->actor, play, giEntry);
GetItemEntry_Draw(play, giEntry);
} else if (this->actor.params == ITEM00_BOMBCHU) {
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
@ -1457,24 +1441,7 @@ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) {
* Draw Function used for the Piece of Heart type of En_Item00. * Draw Function used for the Piece of Heart type of En_Item00.
*/ */
void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) { void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) {
if (IS_RANDO) { s32 pad;
RandomizerCheck randoCheck =
Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->ogParams);
GetItemEntry giEntry = this->randoGiEntry;
if (randoCheck != RC_UNKNOWN_CHECK) {
this->randoGiEntry = Randomizer_GetItemFromKnownCheck(randoCheck, GI_NONE);
giEntry = (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(randoCheck))
? GetItemMystery() : this->randoGiEntry;
giEntry.getItemFrom = ITEM_FROM_FREESTANDING;
}
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
EnItem00_CustomItemsParticles(&this->actor, play, giEntry);
GetItemEntry_Draw(play, giEntry);
} else {
s32 pad;
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);

View File

@ -2089,42 +2089,56 @@ void DemoEffect_DrawGetItem(Actor* thisx, PlayState* play) {
} }
if (IS_RANDO && (play->sceneNum != SCENE_TEMPLE_OF_TIME || this->actor.params == DEMO_EFFECT_LIGHTARROW)) { if (IS_RANDO && (play->sceneNum != SCENE_TEMPLE_OF_TIME || this->actor.params == DEMO_EFFECT_LIGHTARROW)) {
GetItemEntry getItemEntry = GET_ITEM_NONE; GetItemEntry getItemEntry = GET_ITEM_NONE;
if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(RC_BARINADE)) RandomizerCheck rc = RC_MAX;
getItemEntry = GetItemMystery(); RandomizerGet rg = RG_NONE;
switch (this->actor.params) { switch (this->actor.params) {
case DEMO_EFFECT_JEWEL_KOKIRI: case DEMO_EFFECT_JEWEL_KOKIRI:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_QUEEN_GOHMA, RG_KOKIRI_EMERALD); rc = RC_QUEEN_GOHMA;
rg = RG_KOKIRI_EMERALD;
break; break;
case DEMO_EFFECT_JEWEL_GORON: case DEMO_EFFECT_JEWEL_GORON:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KING_DODONGO, RG_GORON_RUBY); rc = RC_KING_DODONGO;
rg = RG_GORON_RUBY;
break; break;
case DEMO_EFFECT_JEWEL_ZORA: case DEMO_EFFECT_JEWEL_ZORA:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_BARINADE, RG_ZORA_SAPPHIRE); rc = RC_BARINADE;
rg = RG_ZORA_SAPPHIRE;
break; break;
case DEMO_EFFECT_MEDAL_FOREST: case DEMO_EFFECT_MEDAL_FOREST:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_PHANTOM_GANON, RG_FOREST_MEDALLION); rc = RC_PHANTOM_GANON;
rg = RG_FOREST_MEDALLION;
break; break;
case DEMO_EFFECT_MEDAL_FIRE: case DEMO_EFFECT_MEDAL_FIRE:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_VOLVAGIA, RG_FIRE_MEDALLION); rc = RC_VOLVAGIA;
rg = RG_FIRE_MEDALLION;
break; break;
case DEMO_EFFECT_MEDAL_WATER: case DEMO_EFFECT_MEDAL_WATER:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MORPHA, RG_WATER_MEDALLION); rc = RC_MORPHA;
rg = RG_WATER_MEDALLION;
break; break;
case DEMO_EFFECT_MEDAL_SPIRIT: case DEMO_EFFECT_MEDAL_SPIRIT:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_TWINROVA, RG_SPIRIT_MEDALLION); rc = RC_TWINROVA;
rg = RG_SPIRIT_MEDALLION;
break; break;
case DEMO_EFFECT_MEDAL_SHADOW: case DEMO_EFFECT_MEDAL_SHADOW:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_BONGO_BONGO, RG_SHADOW_MEDALLION); rc = RC_BONGO_BONGO;
rg = RG_SHADOW_MEDALLION;
break; break;
case DEMO_EFFECT_MEDAL_LIGHT: case DEMO_EFFECT_MEDAL_LIGHT:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GIFT_FROM_SAGES, RG_LIGHT_MEDALLION); rc = RC_GIFT_FROM_SAGES;
rg = RG_LIGHT_MEDALLION;
break; break;
case DEMO_EFFECT_LIGHTARROW: case DEMO_EFFECT_LIGHTARROW:
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_TOT_LIGHT_ARROWS_CUTSCENE, RG_LIGHT_ARROWS); rc = RC_TOT_LIGHT_ARROWS_CUTSCENE;
rg = RG_LIGHT_ARROWS;
break; break;
} }
getItemEntry = Randomizer_GetItemFromKnownCheck(rc, rg);
if (getItemEntry.getItemId != GI_NONE) { if (getItemEntry.getItemId != GI_NONE) {
if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(rc)) {
getItemEntry = GetItemMystery();
}
this->getItem.drawId = getItemEntry.gid; this->getItem.drawId = getItemEntry.gid;
func_8002EBCC(thisx, play, 0); func_8002EBCC(thisx, play, 0);
func_8002ED80(thisx, play, 0); func_8002ED80(thisx, play, 0);

View File

@ -155,50 +155,6 @@ void EnSi_Draw(Actor* thisx, PlayState* play) {
if (this->actionFunc != func_80AFB950) { if (this->actionFunc != func_80AFB950) {
func_8002ED80(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0);
func_8002EBCC(&this->actor, play, 0); func_8002EBCC(&this->actor, play, 0);
if (!IS_RANDO) { GetItem_Draw(play, GID_SKULL_TOKEN_2);
GetItem_Draw(play, GID_SKULL_TOKEN_2);
} else {
RandomizerCheck check = Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->actor.params);
getItem = (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(check)) ? GetItemMystery() : Randomizer_GetItemFromKnownCheck(check, GI_SKULL_TOKEN);
EnItem00_CustomItemsParticles(&this->actor, play, getItem);
if (getItem.itemId != ITEM_SKULL_TOKEN) {
f32 mtxScale = 1.5f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
}
GetItemEntry_Draw(play, getItem);
}
}
}
void EnSi_Reset() {
textId = 0xB4;
giveItemId = ITEM_SKULL_TOKEN;
}
void Randomizer_UpdateSkullReward(EnSi* this, PlayState* play) {
Player* player = GET_PLAYER(play);
getItem = Randomizer_GetItemFromActor(this->actor.id, play->sceneNum, this->actor.params, GI_SKULL_TOKEN);
getItemId = getItem.getItemId;
if (getItemId == RG_ICE_TRAP) {
textId = 0xF8;
} else {
textId = getItem.textId;
giveItemId = getItem.itemId;
}
player->getItemEntry = getItem;
}
void Randomizer_GiveSkullReward(EnSi* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (getItem.modIndex == MOD_NONE) {
// RANDOTOD: Move this into Item_Give() or some other more central location
if (getItem.getItemId == GI_SWORD_BGS) {
gSaveContext.bgsFlag = true;
}
Item_Give(play, giveItemId);
} else if (getItem.modIndex == MOD_RANDOMIZER) {
Randomizer_Item_Give(play, getItem);
} }
} }

View File

@ -93,23 +93,18 @@ void ItemBHeart_Draw(Actor* thisx, PlayState* play) {
actorIt = actorIt->next; actorIt = actorIt->next;
} }
if (IS_RANDO) { if (flag) {
RandomizerCheck check = Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->actor.params); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
GetItemEntry_Draw(play, (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(check)) ? GetItemMystery() : Randomizer_GetItemFromKnownCheck(check, GI_HEART_CONTAINER_2)); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gGiHeartBorderDL);
gSPDisplayList(POLY_XLU_DISP++, gGiHeartContainerDL);
} else { } else {
if (flag) { Gfx_SetupDL_25Opa(play->state.gfxCtx);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gGiHeartBorderDL);
gSPDisplayList(POLY_XLU_DISP++, gGiHeartBorderDL); gSPDisplayList(POLY_OPA_DISP++, gGiHeartContainerDL);
gSPDisplayList(POLY_XLU_DISP++, gGiHeartContainerDL);
} else {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gGiHeartBorderDL);
gSPDisplayList(POLY_OPA_DISP++, gGiHeartContainerDL);
}
} }
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);

View File

@ -207,16 +207,6 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, PlayState* play) {
func_8002EBCC(&this->actor, play, 0); func_8002EBCC(&this->actor, play, 0);
func_8002ED80(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0);
if(IS_RANDO && play->sceneNum == SCENE_TREASURE_BOX_SHOP) {
RandomizerCheck check = RC_MAX;
GetItemEntry randoGetItem = GetChestGameRandoGetItem(this->actor.room, this->giDrawId, play); //TODO Rando: add mysterious shuffle when chest minigame keys get shuffled
EnItem00_CustomItemsParticles(&this->actor, play, randoGetItem);
if (randoGetItem.itemId != ITEM_NONE) {
GetItemEntry_Draw(play, randoGetItem);
return;
}
}
GetItem_Draw(play, this->giDrawId); GetItem_Draw(play, this->giDrawId);
} }
} }
@ -225,24 +215,6 @@ void ItemEtcetera_Draw(Actor* thisx, PlayState* play) {
ItemEtcetera* this = (ItemEtcetera*)thisx; ItemEtcetera* this = (ItemEtcetera*)thisx;
s32 type = this->actor.params & 0xFF; s32 type = this->actor.params & 0xFF;
if (IS_RANDO) {
GetItemEntry randoGetItem = (GetItemEntry)GET_ITEM_NONE;
if (type == ITEM_ETC_ARROW_FIRE) {
randoGetItem = (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(RC_LH_SUN)) ? GetItemMystery() : Randomizer_GetItemFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE);
} else if (type == ITEM_ETC_LETTER) {
randoGetItem = (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && Randomizer_IsCheckShuffled(RC_LH_UNDERWATER_ITEM)) ? GetItemMystery() : Randomizer_GetItemFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO);
}
EnItem00_CustomItemsParticles(&this->actor, play, randoGetItem);
if (randoGetItem.itemId != ITEM_NONE) {
func_8002EBCC(&this->actor, play, 0);
func_8002ED80(&this->actor, play, 0);
GetItemEntry_Draw(play, randoGetItem);
return;
}
}
func_8002EBCC(&this->actor, play, 0); func_8002EBCC(&this->actor, play, 0);
func_8002ED80(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0);
GetItem_Draw(play, this->giDrawId); GetItem_Draw(play, this->giDrawId);