//
// GameStatsManager::createSecretChestItems from 0x41b818 to 0x41b90a (242 bytes)
//
// 1 xrefs:
// > GameStatsManager::init @ 0x4205d2
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GameStatsManager::createSecretChestItems(GameStatsManager *a1)
{
cocos2d::CCDictionary *v2; // r0
cocos2d::CCDictionary *v3; // r0
cocos2d::CCDictionary *m_allTreasureRoomChests; // r3
cocos2d::CCDictElement *m_pElements; // r3
cocos2d::CCDictElement *next; // r5
cocos2d::CCObject *m_pObject; // r9
cocos2d::CCDictElement *v8; // r2
cocos2d::CCArray *m_nTag; // r8
unsigned int i; // r7
_DWORD *v11; // r3
cocos2d::CCObject *v12; // r0
cocos2d::CCDictionary *m_allTreasureRoomChestItems; // [sp+4h] [bp-10h]
std::string v14; // [sp+8h] [bp-Ch] BYREF
if ( !a1->m_allTreasureRoomChestItems )
{
v2 = cocos2d::CCDictionary::create();
a1->m_allTreasureRoomChestItems = v2;
cocos2d::CCObject::retain(v2);
v3 = cocos2d::CCDictionary::create();
a1->m_allTreasureRoomChests = v3;
cocos2d::CCObject::retain(v3);
GameStatsManager::createSecretChestRewards(a1);
m_allTreasureRoomChests = a1->m_allTreasureRoomChests;
if ( m_allTreasureRoomChests )
{
m_pElements = m_allTreasureRoomChests->m_pElements;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
while ( m_pElements )
{
m_pObject = m_pElements->m_pObject;
if ( m_pObject )
{
m_nTag = (cocos2d::CCArray *)m_pObject[1].m_nTag;
if ( m_nTag )
{
for ( i = 0; i < cocos2d::CCArray::count(m_nTag); ++i )
{
v11 = (_DWORD *)cocos2d::CCArray::objectAtIndex(m_nTag, i);
if ( v11[13] == 9 )
{
GameStatsManager::getItemKey((GameStatsManager *)&v14, (int)a1, v11[15], v11[14]);
cocos2d::CCDictionary::objectForKey(a1->m_allTreasureRoomChestItems, &v14);
m_allTreasureRoomChestItems = a1->m_allTreasureRoomChestItems;
v12 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)m_pObject[1].__vftable);
cocos2d::CCDictionary::setObject((int)m_allTreasureRoomChestItems, v12);
sub_774008(&v14);
}
}
}
}
if ( next )
v8 = (cocos2d::CCDictElement *)next->hh.next;
else
v8 = nullptr;
m_pElements = next;
next = v8;
}
}
}
}