//
// GJShopLayer::didPurchaseItem from 0x6117dc to 0x611b26 (842 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'GJShopLayer::didPurchaseItem @ 0x611b70
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:54:52 +0000
//
cocos2d::CCArray *__fastcall GJShopLayer::didPurchaseItem(cocos2d::CCDictionary **this, GJStoreItem *a2)
{
FMODAudioEngine *v4; // r5
GameStatsManager *v5; // r0
CCCounterLabel *v6; // r5
GameStatsManager *v7; // r8
char *v8; // r1
int Stat; // r0
cocos2d::CCArray *result; // r0
cocos2d::CCArray *v11; // r8
int v12; // r5
cocos2d::CCArray *v13; // r8
unsigned int i; // r5
int v15; // r10
cocos2d::CCArray *v16; // r8
cocos2d::CCObject *v17; // r0
cocos2d::CCObject *v18; // r0
cocos2d::CCObject *v19; // r0
cocos2d::CCObject *v20; // r0
cocos2d::CCObject *v21; // r0
int v22; // r2
cocos2d::CCDirector *v23; // r4
int v24; // [sp+4h] [bp-28h]
int v25; // [sp+4h] [bp-28h]
int v26; // [sp+4h] [bp-28h]
int v27; // [sp+4h] [bp-28h]
int v28; // [sp+4h] [bp-28h]
int v29; // [sp+Ch] [bp-20h] BYREF
int v30; // [sp+10h] [bp-1Ch]
int v31; // [sp+14h] [bp-18h]
int v32; // [sp+18h] [bp-14h] BYREF
int v33; // [sp+1Ch] [bp-10h]
char *v34; // [sp+20h] [bp-Ch]
v32 = 0;
v33 = 0;
v34 = nullptr;
v4 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine((FMODAudioEngine *)this);
std::string::__init(&v32, "buyItem03.ogg", 0xDu);
FMODAudioEngine::playEffect(v4, (int)&v32);
v5 = (GameStatsManager *)std::string::~string((int)&v32);
v6 = *(this + 83);
v7 = (GameStatsManager *)GameStatsManager::sharedState(v5);
GJStoreItem::getCurrencyKey((GJStoreItem *)&v32, (int)a2);
if ( (v32 & 1) != 0 )
v8 = v34;
else
v8 = (char *)&v32 + 1;
Stat = GameStatsManager::getStat(v7, v8);
CCCounterLabel::setTargetCount(v6, Stat);
std::string::~string((int)&v32);
result = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(
*(this + 84),
*((_DWORD *)a2 + 66) - *((_DWORD *)a2 + 67));
v11 = result;
if ( result )
{
v12 = (*(int (__fastcall **)(cocos2d::CCArray *))(*(_DWORD *)result + 536))(result);
(*(void (__fastcall **)(cocos2d::CCArray *, _DWORD))(*(_DWORD *)v11 + 528))(v11, 0);
GJItemIcon::darkenStoreItem(v12, *(this + 85));
result = (cocos2d::CCArray *)(*(int (__fastcall **)(int))(*(_DWORD *)v12 + 244))(v12);
v13 = result;
if ( result )
{
for ( i = 0; ; ++i )
{
result = (cocos2d::CCArray *)cocos2d::CCArray::count(v13);
if ( i >= (unsigned int)result )
break;
v15 = cocos2d::CCArray::objectAtIndex(v13, i);
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v15 + 32))(v15) == 1234 )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v15 + 172))(v15, 0);
}
}
}
if ( *((_DWORD *)a2 + 72) - *((_DWORD *)a2 + 73) == 12 && *((_DWORD *)a2 + 69) - *((_DWORD *)a2 + 70) == 4 )
{
v29 = 0;
v30 = 0;
v31 = 0;
v16 = (cocos2d::CCArray *)cocos2d::CCArray::create(result);
std::string::__init(&v29, "Scratch", 7u);
v32 = 0;
v33 = 0;
v34 = nullptr;
std::string::__init(&v32, "Ah the shiny thing, excellent choice.", 0x2Du);
LOWORD(v24) = -1;
BYTE2(v24) = -1;
v17 = (cocos2d::CCObject *)DialogObject::create((int)&v29, (int)&v32, 10, 1065353216, 0, v24);
cocos2d::CCArray::addObject(v16, v17);
std::string::~string((int)&v32);
std::string::~string((int)&v29);
v29 = 0;
v30 = 0;
v31 = 0;
std::string::__init(&v29, "Scratch", 7u);
v32 = 0;
v33 = 0;
v34 = nullptr;
std::string::__init(
&v32,
"I found it a while ago.\nYea... 'Found' is a good word...",
0x50u);
LOWORD(v25) = -1;
BYTE2(v25) = -1;
v18 = (cocos2d::CCObject *)DialogObject::create((int)&v29, (int)&v32, 13, 1065353216, 0, v25);
cocos2d::CCArray::addObject(v16, v18);
std::string::~string((int)&v32);
std::string::~string((int)&v29);
v29 = 0;
v30 = 0;
v31 = 0;
std::string::__init(&v29, "Scratch", 7u);
v32 = 0;
v33 = 0;
v34 = nullptr;
std::string::__init(&v32, "Not sure what it does. If anyone asks you didnt buy it here.", 0x42u);
LOWORD(v26) = -1;
BYTE2(v26) = -1;
v19 = (cocos2d::CCObject *)DialogObject::create((int)&v29, (int)&v32, 11, 1065353216, 0, v26);
cocos2d::CCArray::addObject(v16, v19);
std::string::~string((int)&v32);
std::string::~string((int)&v29);
v29 = 0;
v30 = 0;
v31 = 0;
std::string::__init(&v29, "Scratch", 7u);
v32 = 0;
v33 = 0;
v34 = nullptr;
std::string::__init(&v32, "I mean, buy it where?", 0x1Bu);
LOWORD(v27) = -1;
BYTE2(v27) = -1;
v20 = (cocos2d::CCObject *)DialogObject::create((int)&v29, (int)&v32, 13, 1065353216, 0, v27);
cocos2d::CCArray::addObject(v16, v20);
std::string::~string((int)&v32);
std::string::~string((int)&v29);
v29 = 0;
v30 = 0;
v31 = 0;
std::string::__init(&v29, "Scratch", 7u);
v32 = 0;
v33 = 0;
v34 = nullptr;
std::string::__init(&v32, "...", 0x15u);
LOWORD(v28) = -1;
BYTE2(v28) = -1;
v21 = (cocos2d::CCObject *)DialogObject::create((int)&v29, (int)&v32, 8, 1065353216, 0, v28);
cocos2d::CCArray::addObject(v16, v21);
std::string::~string((int)&v32);
std::string::~string((int)&v29);
v23 = DialogLayer::createWithObjects(v16, (cocos2d::CCArray *)((char *)&dword_0 + 2), v22);
(*((void (__fastcall **)(cocos2d::CCDictionary **, cocos2d::CCDirector *, int))*this + 58))(this, v23, 100);
DialogLayer::updateChatPlacement(v23, 0);
return (cocos2d::CCArray *)DialogLayer::animateInRandomSide(v23);
}
return result;
}