//
// AchievementBar::init from 0x7d76b4 to 0x7d8e50 (6044 bytes)
//
// 2 xrefs:
// > AchievementBar::create @ 0x7d8edc
// > ??> @ 0x54918
//
// 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
//
bool AchievementBar::init(AchievementBar *a1, const char *a2, const char *a3, const char *a4, bool a5)
{
cocos2d::CCDirector *v8; // x0
const cocos2d::_ccColor4B *v9; // x1
cocos2d::CCLayerColor *v10; // x0
AchievementBar_vtbl *v11; // x2
cocos2d::CCLayerColor *m_layerColor; // x19
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
char *v14; // x1
cocos2d::extension::CCScale9Sprite *v15; // x19
cocos2d::extension::CCScale9Sprite *v16; // x21
void (__fastcall *setContentSize)(cocos2d::extension::CCScale9Sprite *__hidden, const cocos2d::CCSize *); // x19
cocos2d::CCSprite *v18; // x0
cocos2d::CCSprite_vtbl *v19; // x1
cocos2d::extension::CCScale9Sprite *v20; // x19
void (__fastcall *v21)(cocos2d::extension::CCScale9Sprite *__hidden, const cocos2d::CCSize *); // x22
cocos2d::extension::CCScale9Sprite *v22; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v24)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
__int64 v25; // x0
cocos2d::CCArray *v26; // x0
__int64 v27; // x20
__int64 v28; // x3
unsigned __int64 v29; // x19
__int64 v30; // x26
const std::string *v31; // x1
cocos2d::CCObject *v32; // x0
void *v33; // x0
char *v34; // x0
unsigned int *v35; // x1
int v36; // w2
unsigned int *v37; // x1
int v38; // w2
char *v39; // x0
void *v40; // x0
cocos2d::CCString *v41; // x0
char *CString; // x22
cocos2d::CCString *v43; // x0
int v44; // w25
_DWORD *v45; // x26
unsigned __int64 v46; // x20
size_t v47; // x2
int v48; // w19
__int64 v49; // x20
char *v50; // x0
_DWORD *v51; // x20
unsigned __int64 v52; // x19
unsigned __int64 v53; // x26
size_t v54; // x2
int v55; // w2
_DWORD *v56; // x4
__int64 v57; // x19
UnlockType v58; // w19
cocos2d::CCString *v59; // x0
const char *v60; // x26
GJItemIcon *v61; // x22
cocos2d::CCNode *v62; // x25
float v63; // s8
char *v64; // x1
cocos2d::CCLabelBMFont *v65; // x19
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x20
cocos2d::CCLabelBMFont_vtbl *v67; // x1
long double v68; // q0
void (__fastcall *v69)(cocos2d::CCLabelBMFont *__hidden, float); // x20
float *v70; // x0
void (__fastcall *v71)(cocos2d::CCLabelBMFont *__hidden, float); // x20
char *v72; // x1
TextArea *v73; // x20
void *v74; // x0
void (__fastcall *v75)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
void (__fastcall *v76)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCLabelBMFont_vtbl *v77; // x1
float height; // s9
float v79; // s2
void (__fastcall *v80)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
float v81; // s8
float v82; // s9
float v83; // s8
float v84; // s9
float x; // s10
float v86; // s8
float v87; // s1
void (__fastcall *v88)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
float v89; // s10
float width; // s9
float v91; // s9
float v92; // s8
float v93; // s0
float m_maxWidth; // s1
float v95; // s0
void (__fastcall *v96)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x19
void (__fastcall *v97)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x19
float *v98; // x0
char *v99; // x1
char *v100; // x0
cocos2d::CCSprite **p_bottom; // x20
unsigned int *p_opacityModifyRGB; // x19
int v103; // w0
void (__fastcall *setScale)(cocos2d::CCSprite *__hidden, float); // x19
float *v105; // x0
float v106; // s8
char *v107; // x20
unsigned __int64 v108; // x26
size_t v109; // x2
int v110; // w19
__int64 v111; // x26
unsigned int *v112; // x26
unsigned int v113; // w20
int v114; // w1
unsigned int *v115; // x3
int v116; // w1
unsigned int *v117; // x3
int v118; // w1
unsigned int *v119; // x1
int v120; // w2
unsigned int *v121; // x1
int v122; // w2
unsigned int *v123; // x1
int v124; // w2
unsigned int *v125; // x1
int v126; // w2
unsigned int *p_data; // x3
int data; // w1
char *v129; // x20
unsigned __int64 v130; // x26
size_t v131; // x2
int v132; // w19
__int64 v133; // x26
int v134; // w19
int v135; // w19
int v136; // w19
int v137; // w19
int v138; // w19
int v139; // w19
int v140; // w19
int v141; // w19
int v142; // w19
unsigned __int64 v143; // [xsp+90h] [xbp+90h]
char *v144; // [xsp+90h] [xbp+90h]
char *v145; // [xsp+90h] [xbp+90h]
cocos2d::CCSprite *v146; // [xsp+A8h] [xbp+A8h]
bool v148; // [xsp+C3h] [xbp+C3h]
_BOOL4 v149; // [xsp+C4h] [xbp+C4h]
cocos2d::CCArray *v150; // [xsp+C8h] [xbp+C8h]
cocos2d::CCArray *v151; // [xsp+C8h] [xbp+C8h]
cocos2d::CCArray *v152; // [xsp+C8h] [xbp+C8h]
float v153; // [xsp+C8h] [xbp+C8h]
cocos2d::CCArray *v154; // [xsp+C8h] [xbp+C8h]
int v155; // [xsp+C8h] [xbp+C8h]
cocos2d::CCArray *v156; // [xsp+C8h] [xbp+C8h]
int v157; // [xsp+C8h] [xbp+C8h]
cocos2d::ccColor3B v158; // [xsp+E0h] [xbp+E0h]
cocos2d::ccColor3B v159; // [xsp+E8h] [xbp+E8h]
float v160; // [xsp+F0h] [xbp+F0h]
cocos2d::extension::CCScale9Sprite *v161; // [xsp+F8h] [xbp+F8h] BYREF
cocos2d::CCPoint v162; // [xsp+100h] [xbp+100h] BYREF
__int64 v163; // [xsp+108h] [xbp+108h] BYREF
void *v164; // [xsp+110h] [xbp+110h] BYREF
void *v165; // [xsp+118h] [xbp+118h] BYREF
void *v166; // [xsp+120h] [xbp+120h] BYREF
void *v167; // [xsp+128h] [xbp+128h] BYREF
void *v168; // [xsp+130h] [xbp+130h] BYREF
void *v169; // [xsp+138h] [xbp+138h] BYREF
void *v170; // [xsp+140h] [xbp+140h] BYREF
void *v171; // [xsp+148h] [xbp+148h] BYREF
__int64 v172; // [xsp+150h] [xbp+150h] BYREF
__int64 v173; // [xsp+158h] [xbp+158h] BYREF
__int64 v174; // [xsp+160h] [xbp+160h] BYREF
__int64 v175; // [xsp+168h] [xbp+168h] BYREF
__int64 v176; // [xsp+170h] [xbp+170h] BYREF
__int64 v177; // [xsp+178h] [xbp+178h] BYREF
__int64 v178; // [xsp+180h] [xbp+180h] BYREF
__int64 v179; // [xsp+188h] [xbp+188h] BYREF
__int64 v180; // [xsp+190h] [xbp+190h] BYREF
__int64 v181; // [xsp+198h] [xbp+198h] BYREF
__int64 v182; // [xsp+1A0h] [xbp+1A0h] BYREF
__int64 v183; // [xsp+1A8h] [xbp+1A8h] BYREF
__int64 v184; // [xsp+1B0h] [xbp+1B0h] BYREF
__int64 v185; // [xsp+1B8h] [xbp+1B8h] BYREF
__int64 v186; // [xsp+1C0h] [xbp+1C0h] BYREF
__int64 v187; // [xsp+1C8h] [xbp+1C8h] BYREF
__int64 v188; // [xsp+1D0h] [xbp+1D0h] BYREF
__int64 v189; // [xsp+1D8h] [xbp+1D8h] BYREF
char *v190; // [xsp+1E0h] [xbp+1E0h] BYREF
cocos2d::CCPoint v191; // [xsp+1E8h] [xbp+1E8h] BYREF
char *v192; // [xsp+1F0h] [xbp+1F0h] BYREF
cocos2d::CCRect v193; // [xsp+1F8h] [xbp+1F8h] BYREF
cocos2d::CCRect v194; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
cocos2d::CCRect v195; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v149 = a5;
v148 = cocos2d::CCNodeRGBA::init(a1);
if ( !v148 )
return v148;
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
v193.origin.x = 0.0;
v10 = (cocos2d::CCLayerColor *)cocos2d::CCLayerColor::create((cocos2d::CCLayerColor *)&v193, v9, 0.0);
v11 = a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_layerColor = v10;
((void (__fastcall *)(AchievementBar *))v11->addChild)(a1);
m_layerColor = a1->m_layerColor;
setPosition = m_layerColor->setPosition;
cocos2d::CCPoint::CCPoint(&v193.origin, v160 * 0.5, 40.0);
setPosition(m_layerColor, &v193.origin);
if ( v149 )
v14 = "GJ_square02.png";
else
v14 = "GJ_square01.png";
sub_D153B8((int)&v161, v14);
v15 = v161;
cocos2d::CCRect::CCRect(&v193, 0.0, 0.0, 80.0, 80.0);
v16 = (cocos2d::extension::CCScale9Sprite *)cocos2d::extension::CCScale9Sprite::create(v15, (const char *)&v193, v194);
setContentSize = v16->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v193, 300.0, 80.0);
setContentSize(v16, (const cocos2d::CCSize *)&v193);
a1->m_layerColor->addChild_0(a1->m_layerColor, v16, 1);
a1->m_bg = v16;
v18 = cocos2d::CCSprite::createWithSpriteFrameName("achievementGlow_001.png");
v19 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_achievementGlowSprite = v18;
((void (__fastcall *)(float))v19->setScale)(4.0);
a1->m_layerColor->addChild_0(a1->m_layerColor, a1->m_achievementGlowSprite, -1);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_achievementGlowSprite->setBlendFunc)(
a1->m_achievementGlowSprite,
0x100000302LL);
cocos2d::CCPoint::CCPoint(&v162, 40.0, 40.0);
cocos2d::CCRect::CCRect(&v193, 0.0, 0.0, 80.0, 80.0);
v20 = (cocos2d::extension::CCScale9Sprite *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02b_001.png",
(const char *)&v193,
v195);
v21 = v20->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v193, 300.0, 80.0);
v21(v20, (const cocos2d::CCSize *)&v193);
a1->m_layerColor->addChild_0(a1->m_layerColor, v20, 100);
v22 = v16;
getPosition = v16->getPosition;
v24 = v20->setPosition;
v25 = (__int64)getPosition(v22);
v24(v20, (const cocos2d::CCPoint *)v25);
v20->setOpacity(v20, 0);
cocos2d::extension::CCScale9Sprite::setBlendAdditive(v20, 1);
a1->m_bg2 = v20;
v146 = cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png");
if ( v149 )
{
v61 = (GJItemIcon *)cocos2d::CCSprite::createWithSpriteFrameName(a4);
setScale = v61->setScale;
v105 = (float *)v61->getContentSize(v61);
setScale(v61, 30.0 / *v105);
v153 = 0.0;
v60 = a3;
goto LABEL_51;
}
if ( a4 )
{
v26 = (cocos2d::CCArray *)sub_D153B8((int)&v163, (char *)a4);
v150 = (cocos2d::CCArray *)cocos2d::CCArray::create(v26);
v27 = sub_D168E0((int)&v163, "_", 0, 1u);
v28 = v27;
v29 = 0;
v30 = *(_QWORD *)(v163 - 24);
while ( 1 )
{
sub_D14F84(&v192, &v163, v29, v28);
if ( v30 != v29 || *((_QWORD *)v192 - 3) )
{
sub_D153B8((int)&v193, v192);
v32 = (cocos2d::CCObject *)cocos2d::CCString::create((cocos2d::CCString *)&v193, v31);
cocos2d::CCArray::addObject(v150, v32);
v33 = (void *)(*(_QWORD *)&v193.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v193.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v37 = (unsigned int *)(*(_QWORD *)&v193.origin - 8LL);
do
v38 = __ldaxr(v37);
while ( __stlxr(v38 - 1, v37) );
}
else
{
v38 = *(_DWORD *)(*(_QWORD *)&v193.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v193.origin - 8LL) = v38 - 1;
}
if ( v38 <= 0 )
operator delete(v33);
}
}
if ( v27 == -1 )
break;
v29 = v27 + 1;
v27 = sub_D168E0((int)&v163, "_", (int)v27 + 1, 1u);
v34 = v192 - 24;
if ( v192 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(v192 - 8);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *((_DWORD *)v192 - 2);
*((_DWORD *)v192 - 2) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v34);
}
v28 = v27 - v29;
if ( *(_QWORD *)(v163 - 24) < v29 )
sub_D13C5C(
"%s: __pos (which is %zu) > this->size() (which is %zu)",
"basic_string::substr",
v29,
*(_QWORD *)(v163 - 24));
}
v39 = v192 - 24;
if ( v192 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v125 = (unsigned int *)(v192 - 8);
do
v126 = __ldaxr(v125);
while ( __stlxr(v126 - 1, v125) );
}
else
{
v126 = *((_DWORD *)v192 - 2);
*((_DWORD *)v192 - 2) = v126 - 1;
}
if ( v126 <= 0 )
operator delete(v39);
}
v40 = (void *)(v163 - 24);
if ( (__int64 *)(v163 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v123 = (unsigned int *)(v163 - 8);
do
v124 = __ldaxr(v123);
while ( __stlxr(v124 - 1, v123) );
}
else
{
v124 = *(_DWORD *)(v163 - 8);
*(_DWORD *)(v163 - 8) = v124 - 1;
}
if ( v124 <= 0 )
operator delete(v40);
}
if ( (unsigned int)cocos2d::CCArray::count(v150) > 1 )
{
v41 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v150, 0);
CString = (char *)cocos2d::CCString::getCString(v41);
v43 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v150, 1u);
v44 = cocos2d::CCString::intValue(v43);
sub_D153B8((int)&v164, CString);
sub_D153B8((int)&v165, "ship");
v45 = v164;
v151 = (cocos2d::CCArray *)v165;
v46 = *((_QWORD *)v164 - 3);
v143 = *((_QWORD *)v165 - 3);
if ( v143 > v46 )
v47 = *((_QWORD *)v164 - 3);
else
v47 = *((_QWORD *)v165 - 3);
v48 = memcmp(v164, v165, v47);
if ( !v48 )
{
v48 = 0x7FFFFFFF;
v49 = v46 - v143;
if ( v49 <= 0x7FFFFFFF )
{
if ( v49 >= (__int64)0xFFFFFFFF80000000LL )
v48 = v49;
else
v48 = 0x80000000;
}
}
if ( &v151[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_data = (unsigned int *)&v151[-1].data;
do
data = __ldaxr(p_data);
while ( __stlxr(data - 1, p_data) );
}
else
{
data = (int)v151[-1].data;
LODWORD(v151[-1].data) = data - 1;
}
if ( data <= 0 )
operator delete(&v151[-1].m_unknown2);
v45 = v164;
}
v50 = (char *)(v45 - 6);
if ( v45 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v112 = v45 - 2;
do
v113 = __ldaxr(v112);
while ( __stlxr(v113 - 1, v112) );
v114 = v113;
}
else
{
v114 = *(v45 - 2);
*(v45 - 2) = v114 - 1;
}
if ( v114 <= 0 )
operator delete(v50);
}
if ( !v48 )
{
v58 = 4;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Unlocked new %s!", "Ship");
goto LABEL_79;
}
sub_D153B8((int)&v166, CString);
sub_D153B8((int)&v167, "ball");
v51 = v167;
v152 = (cocos2d::CCArray *)v166;
v52 = *((_QWORD *)v166 - 3);
v53 = *((_QWORD *)v167 - 3);
if ( v53 > v52 )
v54 = *((_QWORD *)v166 - 3);
else
v54 = *((_QWORD *)v167 - 3);
v55 = memcmp(v166, v167, v54);
v56 = v152;
if ( !v55 )
{
v55 = 0x7FFFFFFF;
v57 = v52 - v53;
if ( v57 <= 0x7FFFFFFF )
{
if ( v57 >= (__int64)0xFFFFFFFF80000000LL )
v55 = v57;
else
v55 = 0x80000000;
}
}
if ( v51 - 6 != (_DWORD *)&qword_124B6B0 )
{
v117 = v51 - 2;
if ( &pthread_create )
{
do
v118 = __ldaxr(v117);
while ( __stlxr(v118 - 1, v117) );
}
else
{
v118 = *(v51 - 2);
*(v51 - 2) = v118 - 1;
}
if ( v118 <= 0 )
{
v157 = v55;
operator delete(v51 - 6);
v56 = v166;
v55 = v157;
}
else
{
v56 = v166;
}
}
if ( v56 - 6 == (_DWORD *)&qword_124B6B0 )
goto LABEL_47;
v115 = v56 - 2;
if ( &pthread_create )
{
do
v116 = __ldaxr(v115);
while ( __stlxr(v116 - 1, v115) );
}
else
{
v116 = *(v56 - 2);
*(v56 - 2) = v116 - 1;
}
if ( v116 > 0 )
{
LABEL_47:
if ( v55 )
{
LABEL_84:
sub_D153B8((int)&v168, CString);
sub_D153B8((int)&v169, "bird");
v107 = (char *)v168;
v144 = (char *)v169;
v108 = *((_QWORD *)v168 - 3);
v154 = *((cocos2d::CCArray **)v169 - 3);
if ( (unsigned __int64)v154 > v108 )
v109 = *((_QWORD *)v168 - 3);
else
v109 = *((_QWORD *)v169 - 3);
v110 = memcmp(v168, v169, v109);
if ( !v110 )
{
v110 = 0x7FFFFFFF;
v111 = v108 - (_QWORD)v154;
if ( v111 <= 0x7FFFFFFF )
{
if ( v111 >= (__int64)0xFFFFFFFF80000000LL )
v110 = v111;
else
v110 = 0x80000000;
}
}
if ( v144 - 24 != (char *)&qword_124B6B0 )
{
sub_7D7670(v144 - 24);
v107 = (char *)v168;
}
if ( v107 - 24 != (char *)&qword_124B6B0 )
sub_7D7670(v107 - 24);
if ( v110 )
{
sub_D153B8((int)&v170, CString);
sub_D153B8((int)&v171, "dart");
v129 = (char *)v170;
v145 = (char *)v171;
v130 = *((_QWORD *)v170 - 3);
v156 = *((cocos2d::CCArray **)v171 - 3);
if ( (unsigned __int64)v156 > v130 )
v131 = *((_QWORD *)v170 - 3);
else
v131 = *((_QWORD *)v171 - 3);
v132 = memcmp(v170, v171, v131);
if ( !v132 )
{
v132 = 0x7FFFFFFF;
v133 = v130 - (_QWORD)v156;
if ( v133 <= 0x7FFFFFFF )
{
if ( v133 >= (__int64)0xFFFFFFFF80000000LL )
v132 = v133;
else
v132 = 0x80000000;
}
}
if ( v145 - 24 != (char *)&qword_124B6B0 )
{
sub_7D7670(v145 - 24);
v129 = (char *)v170;
}
if ( v129 - 24 != (char *)&qword_124B6B0 )
sub_7D7670(v129 - 24);
if ( v132 )
{
sub_D153B8((int)&v172, CString);
sub_D153B8((int)&v173, "robot");
v134 = sub_D17014(&v172, &v173);
if ( (__int64 *)(v173 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v173 - 24));
if ( (__int64 *)(v172 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v172 - 24));
if ( v134 )
{
sub_D153B8((int)&v174, CString);
sub_D153B8((int)&v175, "spider");
v135 = sub_D17014(&v174, &v175);
if ( (__int64 *)(v175 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v175 - 24));
if ( (__int64 *)(v174 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v174 - 24));
if ( v135 )
{
sub_D153B8((int)&v176, CString);
sub_D153B8((int)&v177, "death");
v136 = sub_D17014(&v176, &v177);
if ( (__int64 *)(v177 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v177 - 24));
if ( (__int64 *)(v176 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v176 - 24));
if ( v136 )
{
sub_D153B8((int)&v178, CString);
sub_D153B8((int)&v179, "special");
v137 = sub_D17014(&v178, &v179);
if ( (__int64 *)(v179 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v179 - 24));
if ( (__int64 *)(v178 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v178 - 24));
if ( v137 )
{
sub_D153B8((int)&v180, CString);
sub_D153B8((int)&v181, "color");
v138 = sub_D17014(&v180, &v181);
if ( (__int64 *)(v181 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v181 - 24));
if ( (__int64 *)(v180 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v180 - 24));
if ( v138 )
{
sub_D153B8((int)&v182, CString);
sub_D153B8((int)&v183, "color2");
v139 = sub_D17014(&v182, &v183);
if ( (__int64 *)(v183 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v183 - 24));
if ( (__int64 *)(v182 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v182 - 24));
if ( v139 )
{
sub_D153B8((int)&v184, CString);
sub_D153B8((int)&v185, "swing");
v140 = sub_D17014(&v184, &v185);
if ( (__int64 *)(v185 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v185 - 24));
if ( (__int64 *)(v184 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v184 - 24));
if ( v140 )
{
sub_D153B8((int)&v186, CString);
sub_D153B8((int)&v187, "jetpack");
v141 = sub_D17014(&v186, &v187);
if ( (__int64 *)(v187 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v187 - 24));
if ( (__int64 *)(v186 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v186 - 24));
if ( v141 )
{
sub_D153B8((int)&v188, CString);
sub_D153B8((int)&v189, "shipfire");
v142 = sub_D17014(&v188, &v189);
if ( (__int64 *)(v189 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v189 - 24));
if ( (__int64 *)(v188 - 24) != &qword_124B6B0 )
sub_7D7670((void *)(v188 - 24));
if ( v142 )
{
v58 = 1;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Icon");
}
else
{
v58 = GJItem|Col2;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Ship Fire");
}
}
else
{
v58 = GJItem|Col1;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Jetpack");
}
}
else
{
v58 = GJItem|0x1;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Swing");
}
}
else
{
v58 = Col2;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Secondary Color");
}
}
else
{
v58 = Col1;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Main Color");
}
}
else
{
v58 = Streak;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Trail");
}
}
else
{
v58 = Death;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Death Effect");
}
}
else
{
v58 = 9;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Spider");
}
}
else
{
v58 = 8;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Robot");
}
}
else
{
v58 = Dart;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"Wave");
}
}
else
{
v58 = Bird;
v153 = -8.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlocked new %s!",
"UFO");
}
LABEL_79:
*(_WORD *)&v159.r = -1;
v159.b = -1;
*(_WORD *)&v158.r = -20561;
v60 = cocos2d::CCString::getCString(v59);
v158.b = -81;
v61 = GJItemIcon::create(v58, v44, v158, v159, 0, 0, 1, (cocos2d::ccColor3B)&unk_FFFFFF);
if ( v61 )
goto LABEL_51;
goto LABEL_50;
}
}
else
{
v155 = v55;
operator delete(v56 - 6);
if ( v155 )
goto LABEL_84;
}
v58 = 5;
v153 = 0.0;
v59 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Unlocked new %s!", "Ball");
goto LABEL_79;
}
}
v60 = nullptr;
v153 = 0.0;
LABEL_50:
v61 = (GJItemIcon *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_achImage_001.png");
LABEL_51:
v61->setPosition(v61, &v162);
a1->m_layerColor->addChild_0(a1->m_layerColor, v61, 3);
a1->m_achievementSprite = v61;
v62 = cocos2d::CCNode::create();
a1->m_layerColor->addChild_0(a1->m_layerColor, v62, 2);
if ( v149 )
{
v63 = 0.8;
v64 = "goldFont.fnt";
}
else
{
v63 = 0.7;
v64 = "bigFont.fnt";
}
sub_D153B8((int)&v190, v64);
v65 = cocos2d::CCLabelBMFont::create();
v62->addChild(v62, v65);
setAnchorPoint = v65->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v193.origin, 0.0, 0.5);
setAnchorPoint(v65, &v193.origin);
v65->setScale(v65, v63);
v67 = v65->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_titleLabel = v65;
*(float *)&v68 = v67->getContentSize(v65)->width;
if ( *(float *)&v68 > 200.0 )
{
v69 = v65->setScale;
v70 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v65->getContentSize)(v65, *(float *)&v68);
v69(v65, 200.0 / *v70);
}
v71 = v65->setScale;
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, long double))v65->getScale)(v65, v68) < v63 )
v65->getScale(v65);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v71)(v65);
v72 = (char *)a3;
if ( v60 )
v72 = (char *)v60;
sub_D153B8((int)&v191, v72);
cocos2d::CCPoint::CCPoint(&v193.origin, 0.0, 1.0);
v73 = (TextArea *)TextArea::create((__int64)&v191, "chatFont.fnt", &v193.origin, 0, 1.0, 200.0, 20.0);
v74 = (void *)(*(_QWORD *)&v191 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v191 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v121 = (unsigned int *)(*(_QWORD *)&v191 - 8LL);
do
v122 = __ldaxr(v121);
while ( __stlxr(v122 - 1, v121) );
}
else
{
v122 = *(_DWORD *)(*(_QWORD *)&v191 - 8LL);
*(_DWORD *)(*(_QWORD *)&v191 - 8LL) = v122 - 1;
}
if ( v122 <= 0 )
operator delete(v74);
}
v62->addChild(v62, v73);
v75 = v73->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v193.origin, 0.0, 0.5);
v75(v73, &v193.origin);
v76 = v73->setPosition;
cocos2d::CCPoint::CCPoint(&v193.origin, 0.0, 5.0);
v76(v73, &v193.origin);
v77 = v65->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v73->m_height = 16.0;
a1->m_achievementDescription = v73;
height = v77->getContentSize(v65)->height;
v79 = v73->getContentSize(v73)->height + 17.0;
v80 = v65->setPosition;
v81 = height * 0.5;
v82 = height + v79;
v83 = -(float)(v81 - (float)(v82 * 0.5));
v84 = -(float)((float)(v79 * 0.5) - (float)(v82 * 0.5));
cocos2d::CCPoint::CCPoint(&v191, 0.0, 1.0);
x = v191.x;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v192, 0.0, 1.0);
v86 = (float)(v83 + *((float *)&v192 + 1)) + 2.0;
v87 = 0.0;
if ( v149 )
v87 = 2.5;
cocos2d::CCPoint::CCPoint(&v193.origin, x, v86 + v87);
v80(v65, &v193.origin);
v88 = v73->setPosition;
cocos2d::CCPoint::CCPoint(&v191, 0.0, -1.0);
v89 = v191.x + 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v192, 0.0, -1.0);
cocos2d::CCPoint::CCPoint(&v193.origin, v89, (float)((float)(15.0 - v84) + *((float *)&v192 + 1)) - 1.0);
v88(v73, &v193.origin);
v146->setScale(v146, 1.0);
if ( !v149 )
v61->setScale(v61, 1.0);
width = v146->m_obRect.size.width;
v91 = width * v146->getScale(v146);
v92 = v65->getContentSize(v65)->width;
v93 = v65->getScale(v65);
m_maxWidth = v73->m_maxWidth;
if ( (float)(v92 * v93) >= m_maxWidth )
{
v106 = v65->getContentSize(v65)->width;
v95 = (float)(v106 * v65->getScale(v65)) + 5.0;
}
else
{
v95 = m_maxWidth + 5.0;
}
v96 = v61->setPosition;
cocos2d::CCPoint::CCPoint(
&v193.origin,
-(float)((float)((float)((float)(v95 + (float)(v91 * 0.5)) + 30.0) * 0.5) - (float)(v91 * 0.5)),
v153);
v96(v61, &v193.origin);
v97 = v62->setPosition;
v98 = (float *)v61->getPosition(v61);
cocos2d::CCPoint::CCPoint(&v193.origin, *v98 + 30.0, 0.0);
v97(v62, &v193.origin);
v99 = v190;
v100 = v190 - 24;
a1->m_unkUnused = 1118568448;
if ( v100 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v119 = (unsigned int *)(v99 - 8);
do
v120 = __ldaxr(v119);
while ( __stlxr(v120 - 1, v119) );
}
else
{
v120 = *((_DWORD *)v99 - 2);
*((_DWORD *)v99 - 2) = v120 - 1;
}
if ( v120 <= 0 )
operator delete(v100);
}
p_bottom = &v161[-1]._bottom;
if ( &v161[-1]._bottom != (cocos2d::CCSprite **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_opacityModifyRGB = (unsigned int *)&v161[-1]._opacityModifyRGB;
do
v103 = __ldaxr(p_opacityModifyRGB);
while ( __stlxr(v103 - 1, p_opacityModifyRGB) );
}
else
{
v103 = *(_DWORD *)&v161[-1]._opacityModifyRGB;
*(_DWORD *)&v161[-1]._opacityModifyRGB = v103 - 1;
}
if ( v103 <= 0 )
operator delete(p_bottom);
}
return v148;
}