setup shop model overrides

This commit is contained in:
gymnast86
2026-04-28 03:55:51 -07:00
parent 05e5023354
commit cbead7bbb0
2 changed files with 57 additions and 0 deletions
+25
View File
@@ -11,6 +11,11 @@
#include "m_Do/m_Do_lib.h"
#include <cstring>
#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();
}
+32
View File
@@ -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 &current.angle;
}
@@ -46,6 +51,33 @@ int CheckShopItemCreateHeap(fopAc_ac_c* i_this) {
daShopItem_c* a_this2 = static_cast<daShopItem_c*>(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(),