//
// GJShopLayer::init from 0xa7ee38 to 0xa80284 (5196 bytes)
//
// 2 xrefs:
// > GJShopLayer::create @ 0xa8039c
// > ??> @ 0x76240
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:00:31 +0000
//
__int64 __fastcall GJShopLayer::init(__int64 a1, unsigned int a2)
{
__int64 v4; // x0
cocos2d::CCTouchDispatcher *v5; // x0
__int64 *v6; // x0
cocos2d::CCTextureCache *v7; // x24
char *v8; // x1
cocos2d::CCSpriteFrameCache *v9; // x0
cocos2d::CCSpriteFrameCache *v10; // x24
char *v11; // x1
cocos2d::CCDirector *v12; // x0
cocos2d::CCDirector *v13; // x0
cocos2d::CCSprite *v14; // x0
float *v15; // x19
void (__fastcall *v16)(float *, __int64 *); // x22
void (__fastcall *v17)(float *, __int64 *); // x22
cocos2d::CCSprite *v18; // x0
__int64 v19; // x20
void (__fastcall *v20)(__int64, __int64 *); // x22
__int64 v21; // x0
__int64 v22; // x3
__int64 v23; // x20
__int64 (__fastcall *v24)(__int64, __int64 *); // x22
cocos2d::CCDelayTime *v25; // x0
cocos2d::CCNode *v26; // x20
cocos2d::CCSequence *v27; // x22
cocos2d::CCFiniteTimeAction *v28; // x0
cocos2d::CCAction *v29; // x0
cocos2d::CCSprite *v30; // x0
cocos2d::CCSprite *v31; // x20
void (__fastcall *v32)(cocos2d::CCSprite *, __int64 *); // x21
const char *v33; // x1
__int64 v34; // x19
void (__fastcall *v35)(__int64, __int64 *); // x20
const char *v36; // x1
__int64 v37; // x0
__int64 v38; // x20
__int64 v39; // x0
cocos2d::CCMenu *v40; // x20
cocos2d::CCDirector **v41; // x19
__int64 (__fastcall *v42)(cocos2d::CCDirector **, __int64 *); // x21
cocos2d::CCDirector *v43; // x0
cocos2d::CCDirector *ScreenLeft; // x0
float v45; // s0
float v46; // s8
cocos2d::CCDirector *v47; // x0
float v48; // s0
PlatformToolbox *v49; // x0
unsigned __int64 isControllerConnected; // x0
cocos2d::CCMenuItem *v51; // x2
int v52; // w4
int v53; // w5
int v54; // w6
int v55; // w7
FMODAudioEngine *v56; // x19
GameStatsManager *v57; // x0
GameStatsManager *v58; // x0
int Stat; // w0
__int64 v60; // x0
__int64 v61; // x3
__int64 v62; // x19
void (__fastcall *v63)(__int64, __int64 *); // x20
__int64 v64; // x19
void (__fastcall *v65)(__int64, __int64 *); // x20
const char *v66; // x1
size_t v67; // x0
cocos2d::CCSprite *v68; // x0
__int64 v69; // x21
void (__fastcall *v70)(__int64, __int64 *); // x20
__int64 v71; // x19
bool v72; // w2
cocos2d::CCParticleSystem *v73; // x19
void (__fastcall *v74)(cocos2d::CCParticleSystem *, __int64 *); // x2
void (__fastcall *v75)(cocos2d::CCParticleSystem *, __int64 *); // x2
void (__fastcall *v76)(cocos2d::CCParticleSystem *, __int64 *); // x2
void (__fastcall *v77)(cocos2d::CCParticleSystem *, __int64 *); // x2
void (__fastcall *v78)(cocos2d::CCParticleSystem *, __int64 *); // x20
void (__fastcall *v79)(cocos2d::CCParticleSystem *, __int64); // x20
__int64 v80; // x0
cocos2d::CCArray *v81; // x0
cocos2d::CCArray *v82; // x0
cocos2d::CCArray *v83; // x20
GameManager *v84; // x0
int UGV; // w21
unsigned int v86; // w19
cocos2d::CCDictionary *v87; // x0
cocos2d::CCObject *v88; // x1
int v89; // w0
__int64 v90; // x19
cocos2d::CCMenu *v91; // x0
cocos2d::CCMenuItem *v92; // x1
__int64 v93; // x19
cocos2d::CCSprite *v94; // x0
__int64 (__fastcall *v95)(cocos2d::CCSprite *); // x1
void (__fastcall *v96)(__int64, __int64 *); // x20
__int64 v97; // x21
cocos2d::CCObject *v98; // x0
const char *v99; // x1
cocos2d::CCArray *v100; // x0
unsigned int i; // w24
_DWORD *v102; // x19
GameStatsManager *v103; // x0
int v104; // w21
unsigned int v105; // w20
unsigned int v106; // w21
GameStatsManager *v107; // x0
_BOOL4 isStoreItemUnlocked; // w28
__int64 StoreItem; // x20
cocos2d::CCObject *v110; // x22
const char *v111; // x2
cocos2d::CCLabelBMFont *v112; // x0
__int64 v113; // x21
void (__fastcall *v114)(__int64, __int64 *); // x25
float *v115; // x0
const char *v116; // x1
size_t v117; // x0
cocos2d::CCSprite *v118; // x0
__int64 v119; // x25
__int64 v120; // x20
float v121; // s8
float v122; // s0
float v123; // s1
__int64 v124; // x19
__int64 v125; // x0
__int64 v126; // x19
GameStatsManager *v127; // x0
const char *v128; // x1
size_t v129; // x0
float v130; // s0
void (__fastcall *v131)(float *, __int64 *, float); // x3
const char *v132; // x1
size_t v133; // x0
void (__fastcall *v134)(float *, __int64 *); // x3
void (__fastcall *v135)(cocos2d::CCSprite *, __int64 *); // x3
void (__fastcall *v136)(float *, __int64 *); // x3
char v137; // [xsp+0h] [xbp+0h]
cocos2d::CCArray *v138; // [xsp+98h] [xbp+98h]
char *v139; // [xsp+A8h] [xbp+A8h]
void (__fastcall *v140)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
GameStatsManager *v141; // [xsp+B0h] [xbp+B0h]
unsigned __int8 v142; // [xsp+C3h] [xbp+C3h]
GJItemIcon *v144; // [xsp+C8h] [xbp+C8h]
GameManager *v145; // [xsp+C8h] [xbp+C8h]
GJItemIcon *v146; // [xsp+C8h] [xbp+C8h]
GJItemIcon *v147; // [xsp+C8h] [xbp+C8h]
__int64 v148; // [xsp+E0h] [xbp+E0h] BYREF
float v149[2]; // [xsp+E8h] [xbp+E8h] BYREF
float v150; // [xsp+F0h] [xbp+F0h] BYREF
float v151; // [xsp+F4h] [xbp+F4h]
__int64 v152; // [xsp+F8h] [xbp+F8h] BYREF
float v153; // [xsp+100h] [xbp+100h]
float v154; // [xsp+104h] [xbp+104h]
char *v155[2]; // [xsp+108h] [xbp+108h] BYREF
void *v156; // [xsp+118h] [xbp+118h]
char *v157[2]; // [xsp+120h] [xbp+120h] BYREF
void *v158; // [xsp+130h] [xbp+130h]
char *v159[2]; // [xsp+138h] [xbp+138h] BYREF
cocos2d::CCSprite *v160; // [xsp+148h] [xbp+148h]
__int64 v161; // [xsp+150h] [xbp+150h] BYREF
size_t v162; // [xsp+158h] [xbp+158h]
void *v163; // [xsp+160h] [xbp+160h]
unsigned __int64 v164[2]; // [xsp+168h] [xbp+168h] BYREF
char *v165; // [xsp+178h] [xbp+178h]
unsigned __int64 v166[2]; // [xsp+180h] [xbp+180h] BYREF
char *v167; // [xsp+190h] [xbp+190h]
char *v168[2]; // [xsp+198h] [xbp+198h] BYREF
cocos2d::CCSprite *v169; // [xsp+1A8h] [xbp+1A8h]
__int64 v170[2]; // [xsp+1B0h] [xbp+1B0h] BYREF
void *v171; // [xsp+1C0h] [xbp+1C0h]
__int64 v172[2]; // [xsp+1C8h] [xbp+1C8h] BYREF
void *v173; // [xsp+1D8h] [xbp+1D8h]
__int64 v174; // [xsp+1E0h] [xbp+1E0h] BYREF
size_t v175; // [xsp+1E8h] [xbp+1E8h]
void *v176; // [xsp+1F0h] [xbp+1F0h]
v142 = cocos2d::CCLayer::init((cocos2d::CCLayer *)a1);
if ( !v142 )
return v142;
v4 = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v142);
v5 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 160LL))(v4);
cocos2d::CCTouchDispatcher::registerForcePrio(v5, (cocos2d::CCObject *)a1, 2, 0);
v155[0] = nullptr;
*(_DWORD *)(a1 + 456) = a2;
v155[1] = nullptr;
v156 = nullptr;
std::string::__init((__int64 *)v155, "shopBG_001.png", 0xEu);
v157[0] = nullptr;
v157[1] = nullptr;
v158 = nullptr;
std::string::__init((__int64 *)v157, "storeDesk_001.png", 0x11u);
v159[0] = nullptr;
v159[1] = nullptr;
v160 = nullptr;
std::string::__init((__int64 *)v159, "shopSign_001.png", 0x10u);
std::string::assign((__int64 *)(a1 + 464), "GJ_ShopSheet01");
v161 = 0;
v162 = 0;
v163 = nullptr;
std::string::__init(&v161, "shop.mp3", 8u);
v6 = (__int64 *)(unsigned int)(*(_DWORD *)(a1 + 456) - 1);
switch ( *(_DWORD *)(a1 + 456) )
{
case 1:
std::string::assign((__int64 *)v159, "shopSign2_001.png");
v6 = std::string::assign(&v161, "secretShop.mp3");
break;
case 2:
std::string::assign((__int64 *)v159, "shopSign3_001.png");
v6 = std::string::assign(&v161, "shop3.ogg");
break;
case 3:
std::string::assign((__int64 *)(a1 + 464), "GJ_ShopSheet02");
std::string::assign((__int64 *)v155, "shopBG_02_001.png");
std::string::assign((__int64 *)v157, "storeDesk_02_001.png");
std::string::assign((__int64 *)v159, "shopSign4_001.png");
v6 = std::string::assign(&v161, "shop4.mp3");
break;
case 4:
std::string::assign((__int64 *)(a1 + 464), "GJ_ShopSheet03");
std::string::assign((__int64 *)v155, "shopBG_03_001.png");
std::string::assign((__int64 *)v157, "storeDesk_03_001.png");
std::string::assign((__int64 *)v159, "shopSign5_001.png");
v6 = std::string::assign(&v161, "shop5.ogg");
break;
default:
break;
}
v7 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)v6);
std::operator+(".png", a1 + 464, v164);
v8 = (char *)v164 + 1;
if ( (v164[0] & 1) != 0 )
v8 = v165;
cocos2d::CCTextureCache::addImage(v7, v8, 0);
v9 = (cocos2d::CCSpriteFrameCache *)LOBYTE(v164[0]);
if ( (v164[0] & 1) != 0 )
operator delete(v165);
v10 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v9);
std::operator+(".plist", a1 + 464, v166);
v11 = (char *)v166 + 1;
if ( (v166[0] & 1) != 0 )
v11 = v167;
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v10, v11);
if ( (v166[0] & 1) != 0 )
operator delete(v167);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1072LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1000LL))(a1, 1);
v12 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1104LL))(a1, 1);
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize(&v148, v13);
if ( *(_DWORD *)(a1 + 456) == 2 )
{
v128 = (char *)v155 + 1;
if ( ((__int64)v155[0] & 1) != 0 )
v128 = (const char *)v156;
v146 = (GJItemIcon *)v128;
v170[0] = 0;
v170[1] = 0;
v171 = nullptr;
v129 = strlen(v128);
std::string::__init(v170, v146, v129);
v15 = (float *)CCSpriteWithHue::createWithSpriteFrameName((char *)v170);
if ( (v170[0] & 1) != 0 )
operator delete(v171);
v130 = CCSpriteWithHue::setHueDegrees((CCSpriteWithHue *)v15, -110.0);
v131 = *(void (__fastcall **)(float *, __int64 *, float))(*(_QWORD *)v15 + 960LL);
LOWORD(v152) = 240;
BYTE2(v152) = -16;
v131(v15, &v152, v130);
}
else
{
v14 = (cocos2d::CCSprite *)((char *)v155 + 1);
if ( ((__int64)v155[0] & 1) != 0 )
v14 = (cocos2d::CCSprite *)v156;
v15 = (float *)cocos2d::CCSprite::createWithSpriteFrameName(v14, (const char *)LOBYTE(v155[0]));
}
v16 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v15 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, 0.0, 0.0);
v16(v15, &v152);
(*(void (__fastcall **)(__int64, float *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v15, 4294967294LL);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v15 + 128LL))(v15, (float)(*(float *)&v148 + 5.0) / v15[108]);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v15 + 144LL))(
v15,
(float)(*((float *)&v148 + 1) + 5.0) / v15[109]);
v17 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, -2.5, -2.5);
v17(v15, &v152);
v18 = (cocos2d::CCSprite *)((char *)v159 + 1);
if ( ((__int64)v159[0] & 1) != 0 )
v18 = v160;
v19 = cocos2d::CCSprite::createWithSpriteFrameName(v18, (const char *)LOBYTE(v159[0]));
v20 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v152,
(float)(*(float *)&v148 * 0.5) + -70.0,
*((float *)&v148 + 1) - 38.0);
v20(v19, &v152);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v19);
v21 = AnimatedShopKeeper::create(a2);
v22 = *(_QWORD *)a1;
*(_QWORD *)(a1 + 512) = v21;
(*(void (__fastcall **)(__int64, __int64, __int64))(v22 + 464))(a1, v21, 3);
v23 = *(_QWORD *)(a1 + 512);
v24 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, (float)((float)(*(float *)&v148 * 0.5) + 100.0) + 0.0, 230.0);
v25 = (cocos2d::CCDelayTime *)v24(v23, &v152);
v26 = *(cocos2d::CCNode **)(a1 + 512);
v27 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v25, 0.1);
v28 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(
*(_QWORD *)(a1 + 512),
AnimatedShopKeeper::startAnimating,
0);
v29 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v27, v28, 0);
cocos2d::CCNode::runAction(v26, v29);
if ( *(_DWORD *)(a1 + 456) == 2 )
{
v132 = (char *)v157 + 1;
if ( ((__int64)v157[0] & 1) != 0 )
v132 = (const char *)v158;
v147 = (GJItemIcon *)v132;
v172[0] = 0;
v172[1] = 0;
v173 = nullptr;
v133 = strlen(v132);
std::string::__init(v172, v147, v133);
v31 = CCSpriteWithHue::createWithSpriteFrameName((char *)v172);
if ( (v172[0] & 1) != 0 )
operator delete(v173);
CCSpriteWithHue::setHueDegrees(v31, -120.0);
}
else
{
v30 = (cocos2d::CCSprite *)((char *)v157 + 1);
if ( ((__int64)v157[0] & 1) != 0 )
v30 = (cocos2d::CCSprite *)v158;
v31 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(v30, (const char *)LOBYTE(v157[0]));
}
(*(void (__fastcall **)(__int64, cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v31, 1);
v32 = *(void (__fastcall **)(cocos2d::CCSprite *, __int64 *))(*(_QWORD *)v31 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, *(float *)&v148 * 0.5, 95.0);
v32(v31, &v152);
(*(void (__fastcall **)(cocos2d::CCSprite *, float))(*(_QWORD *)v31 + 128LL))(v31, 0.96);
if ( a2 == 1 )
{
v134 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v15 + 960LL);
LOWORD(v152) = -256;
BYTE2(v152) = -1;
v134(v15, &v152);
v135 = *(void (__fastcall **)(cocos2d::CCSprite *, __int64 *))(*(_QWORD *)v31 + 960LL);
LOWORD(v152) = -256;
BYTE2(v152) = -1;
v135(v31, &v152);
}
else if ( a2 == 3 )
{
v136 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v15 + 960LL);
LOWORD(v152) = -20561;
BYTE2(v152) = -81;
v136(v15, &v152);
}
else if ( a2 )
{
if ( a2 == 2 )
{
v34 = cocos2d::CCMenu::create((cocos2d::CCMenu *)((char *)&dword_0 + 2));
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v34, 0xFFFFFFFFLL);
v35 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v34 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, *(float *)&v148 - 40.0, *((float *)&v148 + 1) - 60.0);
v35(v34, &v152);
v37 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"communityCreditsBtn_001.png", v36);
v38 = CCMenuItemSpriteExtra::create(v37, 0, a1, (__int64)GJShopLayer::onCommunityCredits, 0);
CCMenuItemSpriteExtra::setSizeMult(v38, 1.2);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v34 + 456LL))(v34, v38);
}
}
else
{
v90 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"plushies_001.png", v33);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v90 + 160LL))(v90, 1.1);
v91 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v90, 0, a1, (__int64)GJShopLayer::onPlushies, 0);
*((_BYTE *)v91 + 408) = 0;
*((_BYTE *)v91 + 409) = 1;
v93 = cocos2d::CCMenu::createWithItem(v91, v92);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v93, 0);
v94 = v31;
v95 = *(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v31 + 192LL);
v96 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v93 + 184LL);
v97 = v95(v94);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v150, -130.0, 120.0);
cocos2d::CCPoint::operator+(&v152, v97);
v96(v93, &v152);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v93 + 1272LL))(v93, 0);
}
v39 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_03_001.png", v33);
v40 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v39, 0, a1, (__int64)GJShopLayer::onBack, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v40, 1.6);
v41 = (cocos2d::CCDirector **)cocos2d::CCMenu::create(v40, nullptr);
(*(void (__fastcall **)(__int64, cocos2d::CCDirector **, __int64))(*(_QWORD *)a1 + 464LL))(a1, v41, 1);
v42 = *((__int64 (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v41 + 23);
v43 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v41);
ScreenLeft = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenLeft(v43);
v46 = v45 + 24.0;
v47 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenLeft);
cocos2d::CCDirector::getScreenTop(v47);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, v46, v48 - 23.0);
v49 = (PlatformToolbox *)v42(v41, &v152);
isControllerConnected = (unsigned __int8)PlatformToolbox::isControllerConnected(v49);
if ( (_BYTE)isControllerConnected )
isControllerConnected = GameToolbox::addBackButton((GameToolbox *)a1, v40, v51);
v56 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine((FMODAudioEngine *)isControllerConnected);
v174 = 0;
v175 = 0;
v176 = nullptr;
if ( (v161 & 1) != 0 )
{
std::string::__init(&v174, v163, v162);
}
else
{
v174 = v161;
v175 = v162;
v176 = v163;
}
FMODAudioEngine::playMusic(v56, (char *)&v174, 1u, 0, v52, v53, v54, v55, 0.0, v137);
if ( (v174 & 1) != 0 )
{
operator delete(v176);
v57 = (GameStatsManager *)*(unsigned int *)(a1 + 456);
if ( (_DWORD)v57 != 4 )
goto LABEL_34;
LABEL_84:
v127 = (GameStatsManager *)GameStatsManager::sharedState(v57);
Stat = GameStatsManager::getStat(v127, "29");
goto LABEL_35;
}
v57 = (GameStatsManager *)*(unsigned int *)(a1 + 456);
if ( (_DWORD)v57 == 4 )
goto LABEL_84;
LABEL_34:
v58 = (GameStatsManager *)GameStatsManager::sharedState(v57);
Stat = GameStatsManager::getStat(v58, (const char *)&word_1217DE8);
LABEL_35:
v60 = CCCounterLabel::create(Stat, (cocos2d *)"bigFont.fnt", 0);
v61 = *(_QWORD *)a1;
*(_QWORD *)(a1 + 440) = v60;
(*(void (__fastcall **)(__int64, __int64, __int64))(v61 + 464))(a1, v60, 3);
v62 = *(_QWORD *)(a1 + 440);
v63 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v62 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, *(float *)&v148 - 34.0, *((float *)&v148 + 1) - 15.0);
v63(v62, &v152);
v64 = *(_QWORD *)(a1 + 440);
v65 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v64 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, 1.0, 0.5);
v65(v64, &v152);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 440) + 160LL))(*(_QWORD *)(a1 + 440), 0.6);
if ( *(_DWORD *)(a1 + 456) == 4 )
v66 = "currencyDiamondIcon_001.png";
else
v66 = "currencyOrbIcon_001.png";
v144 = (GJItemIcon *)v66;
v168[0] = nullptr;
v168[1] = nullptr;
v169 = nullptr;
v67 = strlen(v66);
std::string::__init((__int64 *)v168, v144, v67);
v68 = (cocos2d::CCSprite *)((char *)v168 + 1);
if ( ((__int64)v168[0] & 1) != 0 )
v68 = v169;
v69 = cocos2d::CCSprite::createWithSpriteFrameName(v68, (const char *)LOBYTE(v168[0]));
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v69, 3);
v70 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v69 + 184LL);
v71 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 440) + 192LL))(*(_QWORD *)(a1 + 440));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v150, 13.0, -0.5);
cocos2d::CCPoint::operator+(&v152, v71);
v70(v69, &v152);
v73 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v72);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64))(*(_QWORD *)v73 + 1504LL))(v73, 8);
v74 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64 *))(*(_QWORD *)v73 + 1360LL);
v152 = 0x3F48C8C900000000LL;
v153 = 1.0;
v154 = 1.0;
v74(v73, &v152);
v75 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64 *))(*(_QWORD *)v73 + 1392LL);
v152 = 0;
v153 = 0.58824;
v154 = 1.0;
v75(v73, &v152);
v76 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64 *))(*(_QWORD *)v73 + 1376LL);
v152 = 0;
v153 = 0.0;
v154 = 0.0;
v76(v73, &v152);
v77 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64 *))(*(_QWORD *)v73 + 1408LL);
v152 = 0;
v153 = 0.0;
v154 = 0.0;
v77(v73, &v152);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, float))(*(_QWORD *)v73 + 976LL))(v73, 1.0);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, float))(*(_QWORD *)v73 + 992LL))(v73, 0.2);
v78 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64 *))(*(_QWORD *)v73 + 960LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, 12.0, 10.0);
v78(v73, &v152);
(*(void (__fastcall **)(__int64, cocos2d::CCParticleSystem *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v73, 100);
v79 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64))(*(_QWORD *)v73 + 184LL);
v80 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v69 + 192LL))(v69);
v79(v73, v80);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64))(*(_QWORD *)v73 + 1568LL))(v73, 2);
v81 = (cocos2d::CCArray *)cocos2d::CCParticleSystem::resetSystem(v73);
v141 = (GameStatsManager *)cocos2d::CCArray::create(v81);
v82 = (cocos2d::CCArray *)GameStatsManager::sharedState(v141);
v83 = *((cocos2d::CCArray **)v82 + 58);
v145 = (GameManager *)cocos2d::CCArray::create(v82);
v84 = (GameManager *)GameManager::sharedState(v145);
UGV = (unsigned __int8)GameManager::getUGV(v84, "7");
v86 = 0;
while ( 1 )
{
v87 = (cocos2d::CCDictionary *)cocos2d::CCArray::count(v83);
if ( v86 >= (unsigned int)v87 )
break;
v88 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v83, v86);
v89 = *(_DWORD *)(a1 + 456);
if ( v89 != *((_DWORD *)v88 + 91) || !UGV && v89 == 1 && *((_DWORD *)v88 + 79) - *((_DWORD *)v88 + 80) == 20 )
{
++v86;
}
else
{
cocos2d::CCArray::addObject(v145, v88);
++v86;
}
}
v98 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v87);
*(_QWORD *)(a1 + 448) = v98;
cocos2d::CCObject::retain(v98);
v100 = (cocos2d::CCArray *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"playerSquare_001.png",
v99);
v138 = (cocos2d::CCArray *)cocos2d::CCArray::create(v100);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v145); ++i )
{
v102 = (_DWORD *)cocos2d::CCArray::objectAtIndex(v145, i);
v103 = (GameStatsManager *)(unsigned int)v102[85];
v104 = v102[86];
v105 = v102[82] - v102[83];
v170[0] = 0;
v106 = (_DWORD)v103 - v104;
v107 = (GameStatsManager *)GameStatsManager::sharedState(v103);
isStoreItemUnlocked = GameStatsManager::isStoreItemUnlocked(v107, (const char *)(unsigned int)(v102[79] - v102[80]));
GJItemIcon::unlockedColorForType((GJItemIcon *)a2);
StoreItem = GJItemIcon::createStoreItem(v106, v105, isStoreItemUnlocked);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)StoreItem + 160LL))(StoreItem, 1.1);
v110 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(StoreItem, 0, a1, (__int64)GJShopLayer::onSelectItem, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v110, 2.0);
cocos2d::CCArray::addObject(v141, v110);
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v110 + 72LL))(
v110,
(unsigned int)(v102[79] - v102[80]));
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)StoreItem + 72LL))(StoreItem, v106);
if ( v106 - 8 > 1 && v106 != 1 )
{
cocos2d::CCArray::addObject(v138, v110);
if ( isStoreItemUnlocked )
{
LABEL_55:
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v110 + 1056LL))(v110, 0);
GJItemIcon::darkenStoreItem(StoreItem, (GJItemIcon *)*(unsigned int *)(a1 + 456));
goto LABEL_56;
}
}
else if ( isStoreItemUnlocked )
{
goto LABEL_55;
}
GameToolbox::pointsToString((GameToolbox *)(unsigned int)(v102[88] - v102[89]), (unsigned __int64 *)v172);
v112 = (cocos2d::CCLabelBMFont *)((char *)v172 + 1);
if ( (v172[0] & 1) != 0 )
v112 = (cocos2d::CCLabelBMFont *)v173;
v113 = cocos2d::CCLabelBMFont::create(v112, "bigFont.fnt", v111);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)StoreItem + 456LL))(StoreItem, v113);
v114 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v113 + 184LL);
v115 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)StoreItem + 328LL))(StoreItem);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, (float)(*v115 * 0.5) + -4.0, -6.5);
v114(v113, &v152);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v113 + 160LL))(v113, 0.35);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v113 + 72LL))(v113, 1234);
if ( a2 == 4 )
v116 = "currencyDiamondIcon_001.png";
else
v116 = "currencyOrbIcon_001.png";
v139 = (char *)v116;
v174 = 0;
v175 = 0;
v176 = nullptr;
v117 = strlen(v116);
std::string::__init(&v174, v139, v117);
v118 = (cocos2d::CCSprite *)((char *)&v174 + 1);
if ( (v174 & 1) != 0 )
v118 = (cocos2d::CCSprite *)v176;
v119 = cocos2d::CCSprite::createWithSpriteFrameName(v118, (const char *)(unsigned __int8)v174);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)StoreItem + 456LL))(StoreItem, v119);
v140 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v119 + 184LL);
v120 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v113 + 192LL))(v113);
v121 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v113 + 328LL))(v113);
v122 = (float)((float)(v121 * 0.5) * (*(float (__fastcall **)(__int64))(*(_QWORD *)v113 + 168LL))(v113)) + 6.0;
if ( a2 == 4 )
v123 = 1.0;
else
v123 = 0.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v150, v122 + v123, -0.5);
cocos2d::CCPoint::operator+(&v152, v120);
v140(v119, &v152);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v119 + 160LL))(v119, 0.5);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v119 + 72LL))(v119, 1234);
if ( (v174 & 1) != 0 )
operator delete(v176);
if ( (v172[0] & 1) != 0 )
operator delete(v173);
LABEL_56:
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 448), v110, v102[79] - v102[80]);
if ( (v170[0] & 1) != 0 )
operator delete(nullptr);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v149, *(float *)&v148 * 0.5, 93.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v152, (const cocos2d::CCPoint *)v149);
v124 = ListButtonBar::create(v141, (const cocos2d::CCPoint *)&v152, 4, 2, 1u, 25.0, 15.0, 60.0, 221.0);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v124, 100);
v125 = *(_QWORD *)(v124 + 320);
*(_BYTE *)(v124 + 344) = 1;
*(_DWORD *)(v125 + 540) = 1058642330;
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(v124 + 320) + 1000LL))(*(_QWORD *)(v124 + 320));
ListButtonBar::goToPage((cocos2d::CCArray ***)v124, 0);
*(_BYTE *)(*(_QWORD *)(v124 + 320) + 608LL) = 1;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v150, 406.0, 200.0);
v126 = *(_QWORD *)(v124 + 320);
cocos2d::CCRect::CCRect(
(cocos2d::CCRect *)&v152,
v149[0] - (float)(v150 * 0.5),
v149[1] - (float)(v151 * 0.5),
v150,
v151);
cocos2d::CCRect::operator=(v126 + 612, &v152);
if ( ((__int64)v168[0] & 1) != 0 )
operator delete(v169);
if ( (v161 & 1) != 0 )
operator delete(v163);
if ( ((__int64)v159[0] & 1) != 0 )
operator delete(v160);
if ( ((__int64)v157[0] & 1) != 0 )
operator delete(v158);
if ( ((__int64)v155[0] & 1) != 0 )
operator delete(v156);
return v142;
}