diff --git a/src/d/actor/d_a_shop_item.cpp b/src/d/actor/d_a_shop_item.cpp index 09f99c1ca7..0a98dc9868 100644 --- a/src/d/actor/d_a_shop_item.cpp +++ b/src/d/actor/d_a_shop_item.cpp @@ -11,6 +11,11 @@ #include "m_Do/m_Do_lib.h" #include +#if TARGET_PC +#include "d/d_item_data.h" +#include "dusk/randomizer/game/verify_item_functions.h" +#endif + const char* daShopItem_c::getShopArcname() { switch (m_itemNo) { case dItemNo_NONE_e: @@ -88,6 +93,26 @@ const char* daShopItem_c::getShopArcname() { return NULL; } +#if TARGET_PC + // Override the item model with whichever item is randomized to this shop item + if (randomizer_IsActive()) { + u8 randoItem{0}; + switch (mShopItemID) { + // Sera's Shop Slingshot + case SHOP_ITEMNO_PACHINKO: + randoItem = randomizer_getItemAtLocation("Sera Shop Slingshot"); + break; + default: + break; + } + + if (randoItem) { + randoItem = verifyProgressiveItem(randoItem); + return dItem_data::getArcName(randoItem); + } + } +#endif + return mData[mShopItemID].get_arcName(); } diff --git a/src/d/d_a_shop_item_static.cpp b/src/d/d_a_shop_item_static.cpp index 902e09a9c4..1cf39a1629 100644 --- a/src/d/d_a_shop_item_static.cpp +++ b/src/d/d_a_shop_item_static.cpp @@ -7,6 +7,11 @@ #include "d/d_a_shop_item_static.h" +#if TARGET_PC +#include "dusk/randomizer/game/verify_item_functions.h" +#include "d/d_item_data.h" +#endif + csXyz* daShopItem_c::getRotateP() { return ¤t.angle; } @@ -46,6 +51,33 @@ int CheckShopItemCreateHeap(fopAc_ac_c* i_this) { daShopItem_c* a_this2 = static_cast(i_this); u8 a_ShopItemID = a_this2->getShopItemID(); +#if TARGET_PC + // In randomizer, create the model for the randomized shop item + if (randomizer_IsActive()) { + u8 randoItem{0}; + switch (a_ShopItemID) { + // Sera Shop Slingshot + case daShopItem_c::SHOP_ITEMNO_PACHINKO: + randoItem = randomizer_getItemAtLocation("Sera Shop Slingshot"); + break; + default: + break; + } + + if (randoItem) { + randoItem = verifyProgressiveItem(randoItem); + return a_this1->CreateItemHeap(dItem_data::getArcName(randoItem), + dItem_data::getBmdName(randoItem), + dItem_data::getBtkName(randoItem), + dItem_data::getBpkName(randoItem), + dItem_data::getBckName(randoItem), + dItem_data::getBxaName(randoItem), + dItem_data::getBrkName(randoItem), + dItem_data::getBtpName(randoItem)); + } + } +#endif + return a_this1->CreateItemHeap(daShopItem_c::mData[a_ShopItemID].get_arcName(), daShopItem_c::mData[a_ShopItemID].get_bmdName(), daShopItem_c::mData[a_ShopItemID].get_btk1Name(),