//
// CurrencyRewardLayer::init from 0x14009fe60 to 0x1400a1c24 (7620 bytes)
//
// 2 xrefs:
// > CurrencyRewardLayer::create @ 0x14009fe10
// > ??> @ 0x1406c76b0
//
// 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
//
// Hidden C++ exception states: #wind=10
bool CurrencyRewardLayer::init(
CurrencyRewardLayer *a1,
int a2,
int a3,
int a4,
int a5,
CurrencySpriteType a6,
int a7,
CurrencySpriteType a8,
int a9,
cocos2d::CCPoint a10,
CurrencyRewardType a11,
float a12,
float a13)
{
float v13; // xmm3_4
CurrencySpriteType v16; // r13d
CurrencySpriteType v17; // r12d
bool result; // al
__int64 v19; // rcx
int v20; // r15d
int v21; // esi
cocos2d::CCDirector *v22; // rax
cocos2d::CCTextureCache *v23; // rax
struct cocos2d::CCTexture2D *v24; // rbx
struct cocos2d::CCSpriteBatchNode *v25; // rax
cocos2d::CCSpriteBatchNode *v26; // rax
cocos2d::CCNode *v27; // rax
GameStatsManager *v28; // rcx
GameStatsManager *v29; // rcx
GameStatsManager *v30; // rcx
GameStatsManager *v31; // rcx
const char *v32; // rbx
GameStatsManager *v33; // rcx
const char *v34; // rbx
GameStatsManager *v35; // rcx
float v36; // xmm7_4
cocos2d::CCString *v37; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v39; // rax
cocos2d::CCLabelBMFont_vtbl *v40; // rbx
const cocos2d::CCPoint *v41; // rax
cocos2d::CCLabelBMFont_vtbl *v42; // rbx
const cocos2d::CCPoint *v43; // rax
const struct cocos2d::CCSize *v44; // rax
float v45; // xmm0_4
float v46; // xmm0_4
struct cocos2d::CCSprite *v47; // rsi
const cocos2d::CCPoint *v48; // rax
struct cocos2d::CCPoint v49; // rax
struct cocos2d::CCTintTo *v50; // rbx
struct cocos2d::CCTintTo *v51; // rax
struct cocos2d::CCSequence *v52; // rax
struct cocos2d::CCRepeatForever *v53; // rax
cocos2d::ccColor3B *v54; // r8
struct cocos2d::CCParticleSystemQuad *v55; // rdi
cocos2d::CCParticleSystemQuad_vtbl *v56; // rbx
const cocos2d::CCPoint *v57; // rax
cocos2d::CCParticleSystemQuad_vtbl *v58; // rbx
__int64 v59; // rax
cocos2d::CCString *v60; // rax
const char *v61; // rax
cocos2d::CCLabelBMFont *v62; // rax
cocos2d::CCLabelBMFont_vtbl *v63; // rbx
const cocos2d::CCPoint *v64; // rax
cocos2d::CCLabelBMFont_vtbl *v65; // rbx
const cocos2d::CCPoint *v66; // rax
const struct cocos2d::CCSize *v67; // rax
float v68; // xmm0_4
float v69; // xmm0_4
struct cocos2d::CCSprite *v70; // rsi
const cocos2d::CCPoint *v71; // rax
struct cocos2d::CCPoint v72; // rax
struct cocos2d::CCTintTo *v73; // rbx
struct cocos2d::CCTintTo *v74; // rax
struct cocos2d::CCSequence *v75; // rax
struct cocos2d::CCRepeatForever *v76; // rax
cocos2d::ccColor3B *v77; // r8
struct cocos2d::CCParticleSystemQuad *v78; // rdi
cocos2d::CCParticleSystemQuad_vtbl *v79; // rbx
const cocos2d::CCPoint *v80; // rax
cocos2d::CCParticleSystemQuad_vtbl *v81; // rbx
__int64 v82; // rax
cocos2d::CCString *v83; // rax
const char *v84; // rax
cocos2d::CCLabelBMFont *v85; // rax
cocos2d::CCLabelBMFont_vtbl *v86; // rbx
const cocos2d::CCPoint *v87; // rax
cocos2d::CCLabelBMFont_vtbl *v88; // rbx
const cocos2d::CCPoint *v89; // rax
const struct cocos2d::CCSize *v90; // rax
float v91; // xmm0_4
float v92; // xmm0_4
struct cocos2d::CCSprite *v93; // rsi
const cocos2d::CCPoint *v94; // rax
struct cocos2d::CCPoint v95; // rax
struct cocos2d::CCTintTo *v96; // rbx
struct cocos2d::CCTintTo *v97; // rax
struct cocos2d::CCSequence *v98; // rax
struct cocos2d::CCRepeatForever *v99; // rax
cocos2d::ccColor3B *v100; // r8
struct cocos2d::CCParticleSystemQuad *v101; // rdi
cocos2d::CCParticleSystemQuad_vtbl *v102; // rbx
const cocos2d::CCPoint *v103; // rax
cocos2d::CCParticleSystemQuad_vtbl *v104; // rbx
__int64 v105; // rax
cocos2d::CCString *v106; // rax
const char *v107; // rax
cocos2d::CCLabelBMFont *v108; // rax
cocos2d::CCLabelBMFont_vtbl *v109; // rbx
const cocos2d::CCPoint *v110; // rax
cocos2d::CCLabelBMFont_vtbl *v111; // rbx
const cocos2d::CCPoint *v112; // rax
const struct cocos2d::CCSize *v113; // rax
float v114; // xmm0_4
float v115; // xmm0_4
struct cocos2d::CCSprite *v116; // rsi
const cocos2d::CCPoint *v117; // rax
struct cocos2d::CCPoint v118; // rax
struct cocos2d::CCParticleSystemQuad *v119; // rdi
cocos2d::CCParticleSystemQuad_vtbl *v120; // rbx
const cocos2d::CCPoint *v121; // rax
cocos2d::CCParticleSystemQuad_vtbl *v122; // rbx
__int64 v123; // rax
cocos2d::CCString *v124; // rax
const char *v125; // rax
cocos2d::CCLabelBMFont *v126; // rax
cocos2d::CCLabelBMFont_vtbl *v127; // rbx
const cocos2d::CCPoint *v128; // rax
cocos2d::CCLabelBMFont_vtbl *v129; // rbx
const cocos2d::CCPoint *v130; // rax
const struct cocos2d::CCSize *v131; // rax
float v132; // xmm0_4
float v133; // xmm0_4
CurrencySprite *v134; // rax
CurrencySprite *v135; // rdi
const cocos2d::CCPoint *v136; // rax
struct cocos2d::CCPoint v137; // rax
cocos2d::CCString *v138; // rax
const char *v139; // rax
cocos2d::CCLabelBMFont *v140; // rax
cocos2d::CCLabelBMFont_vtbl *v141; // rbx
const cocos2d::CCPoint *v142; // rax
cocos2d::CCLabelBMFont_vtbl *v143; // rbx
const cocos2d::CCPoint *v144; // rax
const struct cocos2d::CCSize *v145; // rax
float v146; // xmm0_4
float v147; // xmm0_4
CurrencySprite *v148; // rax
CurrencySprite *v149; // rdi
const cocos2d::CCPoint *v150; // rax
struct cocos2d::CCPoint v151; // rax
const struct cocos2d::CCPoint *v152; // rax
const cocos2d::CCPoint *v153; // rax
struct cocos2d::CCMoveTo *v154; // rax
struct cocos2d::CCEaseInOut *v155; // rax
cocos2d::ccColor3B *v156; // r8
__int64 v157; // rcx
cocos2d::CCArray *v158; // rax
float v159; // xmm8_4
const struct cocos2d::CCPoint *v160; // rbx
const struct cocos2d::CCPoint *v161; // rax
int v162; // edi
cocos2d::CCPoint v163; // rax
float v164; // xmm6_4
const struct cocos2d::CCPoint *v165; // rax
cocos2d::CCPoint v166; // rax
const struct cocos2d::CCPoint *v167; // rax
int v168; // esi
cocos2d::CCPoint v169; // rax
_BOOL8 v170; // rdi
_BOOL8 v171; // rsi
_BOOL8 v172; // rbx
float v173; // xmm6_4
const struct cocos2d::CCPoint *v174; // rax
cocos2d::CCPoint v175; // rax
float v176; // xmm6_4
float v177; // xmm7_4
const struct cocos2d::CCPoint *v178; // rbx
const struct cocos2d::CCPoint *v179; // rax
cocos2d::CCPoint v180; // rax
const struct cocos2d::CCPoint *v181; // rax
cocos2d::CCPoint v182; // rax
float v183; // [rsp+28h] [rbp-E0h]
__int16 v184; // [rsp+38h] [rbp-D0h] BYREF
char v185; // [rsp+3Ah] [rbp-CEh]
__int64 v186; // [rsp+40h] [rbp-C8h] BYREF
cocos2d::CCPoint v187; // [rsp+48h] [rbp-C0h] BYREF
cocos2d::CCPoint v188; // [rsp+50h] [rbp-B8h] BYREF
cocos2d::CCPoint v189; // [rsp+58h] [rbp-B0h] BYREF
int v190; // [rsp+60h] [rbp-A8h]
int v191; // [rsp+64h] [rbp-A4h]
int v192; // [rsp+68h] [rbp-A0h]
cocos2d::CCPoint v193; // [rsp+70h] [rbp-98h] BYREF
int v194; // [rsp+78h] [rbp-90h]
int v195; // [rsp+7Ch] [rbp-8Ch]
const struct cocos2d::CCPoint *v196; // [rsp+80h] [rbp-88h]
cocos2d::CCPoint v197; // [rsp+88h] [rbp-80h] BYREF
float v198; // [rsp+90h] [rbp-78h]
float v199; // [rsp+94h] [rbp-74h]
cocos2d::CCPoint v200; // [rsp+98h] [rbp-70h] BYREF
__int128 v201; // [rsp+A0h] [rbp-68h] BYREF
__int128 v202; // [rsp+B0h] [rbp-58h] BYREF
_QWORD v203[4]; // [rsp+C0h] [rbp-48h] BYREF
_QWORD v204[4]; // [rsp+E0h] [rbp-28h] BYREF
v191 = a4;
v190 = a3;
v194 = a2;
v16 = a6;
v17 = a8;
v196 = (const struct cocos2d::CCPoint *)a10;
result = cocos2d::CCLayer::init(a1);
if ( result )
{
a1->m_rewardType = a11;
a1->m_time = a13;
v20 = 0;
if ( a6 && a6 == a8 )
{
v21 = a9 + a7;
v17 = Icon;
v192 = 0;
}
else
{
v192 = a9;
v21 = a7;
}
v195 = v21;
v22 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v19);
cocos2d::CCDirector::getWinSize(v22);
v23 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
v24 = cocos2d::CCTextureCache::addImage(v23, "GJ_GameSheet03.png", 0);
v25 = cocos2d::CCSpriteBatchNode::createWithTexture(v24);
a1->m_orbBatchNode = v25;
v186 = 0x100000302LL;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v25->setBlendFunc)(
&v25->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->addChild_0(a1, a1->m_orbBatchNode, 1);
v26 = cocos2d::CCSpriteBatchNode::createWithTexture(v24);
a1->m_currencyBatchNode = v26;
a1->addChild_0(a1, v26, 2);
v27 = (cocos2d::CCNode *)cocos2d::CCNode::create();
a1->m_mainNode = v27;
v27->setContentSize(v27, &stru_1406C1960);
a1->addChild_0(a1, a1->m_mainNode, 4);
cocos2d::CCPoint::CCPoint(&v193, v198 - 40.0, (float)(v199 - 5.0) + a12);
a1->m_mainNode->setPosition_0(a1->m_mainNode, &v193);
v28 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v187 = (cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = ((__int64 (__fastcall *)(_QWORD))sub_1401D0AE0)(v187);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v28 = (GameStatsManager *)qword_1406C2EE8;
}
a1->m_orbs = GameStatsManager::getStat(v28, "14") - a2;
v29 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v187 = (cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = ((__int64 (__fastcall *)(_QWORD))sub_1401D0AE0)(v187);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v29 = (GameStatsManager *)qword_1406C2EE8;
}
a1->m_stars = GameStatsManager::getStat(v29, "6") - v190;
v30 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v187 = (cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = ((__int64 (__fastcall *)(_QWORD))sub_1401D0AE0)(v187);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v30 = (GameStatsManager *)qword_1406C2EE8;
}
a1->m_moons = GameStatsManager::getStat(v30, "28") - v191;
v31 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v187 = (cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = ((__int64 (__fastcall *)(_QWORD))sub_1401D0AE0)(v187);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v31 = (GameStatsManager *)qword_1406C2EE8;
}
a1->m_diamonds = GameStatsManager::getStat(v31, "13") - a5;
CurrencySprite::spriteTypeToStat(v204, (unsigned int)a6);
if ( v204[2] )
{
v32 = (const char *)v204;
if ( v204[3] > 0xFu )
v32 = (const char *)v204[0];
v33 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v187 = (cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = ((__int64 (__fastcall *)(_QWORD))sub_1401D0AE0)(v187);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v33 = (GameStatsManager *)qword_1406C2EE8;
}
a1->m_keys = GameStatsManager::getStat(v33, v32) - v21;
}
else
{
v16 = Icon;
}
CurrencySprite::spriteTypeToStat(v203, (unsigned int)v17);
if ( v203[2] )
{
v34 = (const char *)v203;
if ( v203[3] > 0xFu )
v34 = (const char *)v203[0];
v35 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v187 = (cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = ((__int64 (__fastcall *)(_QWORD))sub_1401D0AE0)(v187);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v35 = (GameStatsManager *)qword_1406C2EE8;
}
a1->m_shards = GameStatsManager::getStat(v35, v34) - v192;
}
else
{
v17 = Icon;
}
a1->m_rewardCount = 0;
v36 = 0.0;
if ( a2 > 0 )
{
v37 = cocos2d::CCString::createWithFormat("%i", a1->m_orbs);
CString = cocos2d::CCString::getCString(v37);
v39 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_14052A4D8);
a1->m_orbsLabel = v39;
a1->m_mainNode->addChild_0(a1->m_mainNode, v39, 10);
v40 = a1->m_orbsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v187, 1.0, 1.0);
v40->setAnchorPoint(a1->m_orbsLabel, v41);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->setScale_0)(a1->m_orbsLabel);
v184 = -106;
v185 = -1;
a1->m_orbsLabel->setColor(&a1->m_orbsLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v184);
v42 = a1->m_orbsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v187, 0.0, (float)(-30 * a1->m_rewardCount));
v42->setPosition_0(a1->m_orbsLabel, v43);
v44 = a1->m_orbsLabel->getContentSize(a1->m_orbsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v186, v44);
v45 = a1->m_orbsLabel->getScale(a1->m_orbsLabel);
*(float *)&v186 = *(float *)&v186 * v45;
v46 = a1->m_orbsLabel->getScale(a1->m_orbsLabel);
*((float *)&v186 + 1) = *((float *)&v186 + 1) * v46;
cocos2d::CCPoint::CCPoint(&v187, (float)-*(float *)&v186 * 0.5, (float)-*((float *)&v186 + 1) * 0.5);
cocos2d::CCPoint::operator+(&v193, &v189);
cocos2d::CCPoint::operator=(&a1->m_orbsPosition, &v189);
++a1->m_rewardCount;
v47 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)&xmmword_14053DCE8);
a1->m_mainNode->addChild_0(a1->m_mainNode, v47, 3);
cocos2d::CCPoint::CCPoint(&v187, 15.0, -0.5 - (float)(*((float *)&v186 + 1) * 0.5));
v48 = a1->m_orbsLabel->getPosition_0(a1->m_orbsLabel);
cocos2d::CCPoint::operator+(v48, &v189);
v47->setPosition_0(v47, &v189);
v47->getPosition_0(v47);
v49 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainNode, &v187);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_orbsPosition, v49);
a1->m_orbsSprite = v47;
v50 = cocos2d::CCTintTo::create(0.30000001, 0, 0xFFu, 0xFFu);
v51 = cocos2d::CCTintTo::create(0.30000001, 0x96u, 0xFFu, 0xFFu);
v52 = cocos2d::CCSequence::create(v50, v51, 0);
v53 = cocos2d::CCRepeatForever::create(v52);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_orbsLabel, (cocos2d::CCPoint)v53, v54, v13, v183);
v55 = cocos2d::CCParticleSystemQuad::create("keyEffect.plist", 0);
v55->setTotalParticles(v55, 8u);
v201 = xmmword_140624300;
v55->setStartColor(v55, (const cocos2d::ccColor4F *)&v201);
v201 = xmmword_1406241F0;
v55->setEndColor(v55, (const cocos2d::ccColor4F *)&v201);
v201 = 0;
v55->setStartColorVar(v55, (const cocos2d::ccColor4F *)&v201);
v201 = 0;
v55->setEndColorVar(v55, (const cocos2d::ccColor4F *)&v201);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v55->setLife)(v55);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v55->setLifeVar)(v55);
v56 = v55->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v187, 12.0, 10.0);
v56->setPosVar(v55, v57);
a1->m_mainNode->addChild_0(a1->m_mainNode, v55, 100);
v58 = v55->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v59 = (__int64)v47->getPosition_0(v47);
v58->setPosition_0(v55, (const cocos2d::CCPoint *)v59);
v55->setPositionType(v55, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v55);
}
if ( v190 > 0 )
{
v60 = cocos2d::CCString::createWithFormat("%i", a1->m_stars);
v61 = cocos2d::CCString::getCString(v60);
v62 = cocos2d::CCLabelBMFont::create(v61, (const char *)&qword_14052A4D8);
a1->m_starsLabel = v62;
a1->m_mainNode->addChild_0(a1->m_mainNode, v62, 10);
v63 = a1->m_starsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v187, 1.0, 1.0);
v63->setAnchorPoint(a1->m_starsLabel, v64);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_starsLabel->setScale_0)(a1->m_starsLabel);
v184 = -14081;
v185 = 0;
a1->m_starsLabel->setColor(&a1->m_starsLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v184);
v65 = a1->m_starsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v187, 0.0, (float)(-30 * a1->m_rewardCount));
v65->setPosition_0(a1->m_starsLabel, v66);
v67 = a1->m_starsLabel->getContentSize(a1->m_starsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v186, v67);
v68 = a1->m_starsLabel->getScale(a1->m_starsLabel);
*(float *)&v186 = *(float *)&v186 * v68;
v69 = a1->m_starsLabel->getScale(a1->m_starsLabel);
*((float *)&v186 + 1) = *((float *)&v186 + 1) * v69;
cocos2d::CCPoint::CCPoint(&v197, 0.0, (float)(-30 * a1->m_rewardCount));
cocos2d::CCPoint::operator+(&v193, &v189);
cocos2d::CCPoint::CCPoint(&v188, (float)-*(float *)&v186 * 0.5, (float)-*((float *)&v186 + 1) * 0.5);
cocos2d::CCPoint::operator+(&v189, &v187);
cocos2d::CCPoint::operator=(&a1->m_starsPosition, &v187);
++a1->m_rewardCount;
v70 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigStar_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v70->setScale_0)(v70);
a1->m_mainNode->addChild_0(a1->m_mainNode, v70, 3);
cocos2d::CCPoint::CCPoint(&v188, 15.0, -0.5 - (float)(*((float *)&v186 + 1) * 0.5));
v71 = a1->m_starsLabel->getPosition_0(a1->m_starsLabel);
cocos2d::CCPoint::operator+(v71, &v187);
v70->setPosition_0(v70, &v187);
v70->getPosition_0(v70);
v72 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainNode, &v188);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_starsPosition, v72);
a1->m_starsSprite = v70;
v73 = cocos2d::CCTintTo::create(0.30000001, 0xFFu, 0xFFu, 0);
v74 = cocos2d::CCTintTo::create(0.30000001, 0xFFu, 0xC8u, 0);
v75 = cocos2d::CCSequence::create(v73, v74, 0);
v76 = cocos2d::CCRepeatForever::create(v75);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_starsLabel, (cocos2d::CCPoint)v76, v77, v13, v183);
v78 = cocos2d::CCParticleSystemQuad::create("keyEffect.plist", 0);
v78->setTotalParticles(v78, 8u);
v201 = xmmword_140624160;
v78->setStartColor(v78, (const cocos2d::ccColor4F *)&v201);
v201 = xmmword_1406240C0;
v78->setEndColor(v78, (const cocos2d::ccColor4F *)&v201);
v201 = 0;
v78->setStartColorVar(v78, (const cocos2d::ccColor4F *)&v201);
v201 = 0;
v78->setEndColorVar(v78, (const cocos2d::ccColor4F *)&v201);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v78->setLife)(v78);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v78->setLifeVar)(v78);
v79 = v78->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v188, 12.0, 10.0);
v79->setPosVar(v78, v80);
a1->m_mainNode->addChild_0(a1->m_mainNode, v78, 100);
v81 = v78->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v82 = (__int64)v70->getPosition_0(v70);
v81->setPosition_0(v78, (const cocos2d::CCPoint *)v82);
v78->setPositionType(v78, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v78);
}
if ( v191 > 0 )
{
v83 = cocos2d::CCString::createWithFormat("%i", a1->m_moons);
v84 = cocos2d::CCString::getCString(v83);
v85 = cocos2d::CCLabelBMFont::create(v84, (const char *)&qword_14052A4D8);
a1->m_moonsLabel = v85;
a1->m_mainNode->addChild_0(a1->m_mainNode, v85, 10);
v86 = a1->m_moonsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v188, 1.0, 1.0);
v86->setAnchorPoint(a1->m_moonsLabel, v87);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_moonsLabel->setScale_0)(a1->m_moonsLabel);
v184 = -256;
v185 = -1;
a1->m_moonsLabel->setColor(&a1->m_moonsLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v184);
v88 = a1->m_moonsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v188, 0.0, (float)(-30 * a1->m_rewardCount));
v88->setPosition_0(a1->m_moonsLabel, v89);
v90 = a1->m_moonsLabel->getContentSize(a1->m_moonsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v186, v90);
v91 = a1->m_moonsLabel->getScale(a1->m_moonsLabel);
*(float *)&v186 = *(float *)&v186 * v91;
v92 = a1->m_moonsLabel->getScale(a1->m_moonsLabel);
*((float *)&v186 + 1) = *((float *)&v186 + 1) * v92;
cocos2d::CCPoint::CCPoint(&v188, 0.0, (float)(-30 * a1->m_rewardCount));
cocos2d::CCPoint::operator+(&v193, &v187);
cocos2d::CCPoint::CCPoint(&v197, (float)-*(float *)&v186 * 0.5, (float)-*((float *)&v186 + 1) * 0.5);
cocos2d::CCPoint::operator+(&v187, &v189);
cocos2d::CCPoint::operator=(&a1->m_moonsPosition, &v189);
++a1->m_rewardCount;
v93 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigMoon_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v93->setScale_0)(v93);
a1->m_mainNode->addChild_0(a1->m_mainNode, v93, 3);
cocos2d::CCPoint::CCPoint(&v188, 15.0, -0.5 - (float)(*((float *)&v186 + 1) * 0.5));
v94 = a1->m_moonsLabel->getPosition_0(a1->m_moonsLabel);
cocos2d::CCPoint::operator+(v94, &v187);
v93->setPosition_0(v93, &v187);
v93->getPosition_0(v93);
v95 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainNode, &v188);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_moonsPosition, v95);
a1->m_moonsSprite = v93;
v96 = cocos2d::CCTintTo::create(0.30000001, 0, 0xFFu, 0xFFu);
v97 = cocos2d::CCTintTo::create(0.30000001, 0, 0xC8u, 0xFFu);
v98 = cocos2d::CCSequence::create(v96, v97, 0);
v99 = cocos2d::CCRepeatForever::create(v98);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_moonsLabel, (cocos2d::CCPoint)v99, v100, v13, v183);
v101 = cocos2d::CCParticleSystemQuad::create("keyEffect.plist", 0);
v101->setTotalParticles(v101, 8u);
v201 = xmmword_140624310;
v101->setStartColor(v101, (const cocos2d::ccColor4F *)&v201);
v201 = xmmword_140624240;
v101->setEndColor(v101, (const cocos2d::ccColor4F *)&v201);
v201 = 0;
v101->setStartColorVar(v101, (const cocos2d::ccColor4F *)&v201);
v201 = 0;
v101->setEndColorVar(v101, (const cocos2d::ccColor4F *)&v201);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v101->setLife)(v101);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v101->setLifeVar)(v101);
v102 = v101->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v188, 12.0, 10.0);
v102->setPosVar(v101, v103);
a1->m_mainNode->addChild_0(a1->m_mainNode, v101, 100);
v104 = v101->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v105 = (__int64)v93->getPosition_0(v93);
v104->setPosition_0(v101, (const cocos2d::CCPoint *)v105);
v101->setPositionType(v101, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v101);
}
if ( a5 > 0 )
{
v106 = cocos2d::CCString::createWithFormat("%i", a1->m_diamonds);
v107 = cocos2d::CCString::getCString(v106);
v108 = cocos2d::CCLabelBMFont::create(v107, (const char *)&qword_14052A4D8);
a1->m_diamondsLabel = v108;
a1->m_mainNode->addChild_0(a1->m_mainNode, v108, 10);
v109 = a1->m_diamondsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v188, 1.0, 1.0);
v109->setAnchorPoint(a1->m_diamondsLabel, v110);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_diamondsLabel->setScale_0)(a1->m_diamondsLabel);
v184 = -1;
v185 = -1;
a1->m_diamondsLabel->setColor(&a1->m_diamondsLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v184);
v111 = a1->m_diamondsLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v188, 0.0, (float)(-30 * a1->m_rewardCount));
v111->setPosition_0(a1->m_diamondsLabel, v112);
v113 = a1->m_diamondsLabel->getContentSize(a1->m_diamondsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v186, v113);
v114 = a1->m_diamondsLabel->getScale(a1->m_diamondsLabel);
*(float *)&v186 = *(float *)&v186 * v114;
v115 = a1->m_diamondsLabel->getScale(a1->m_diamondsLabel);
*((float *)&v186 + 1) = *((float *)&v186 + 1) * v115;
cocos2d::CCPoint::CCPoint(&v197, 0.0, (float)(-30 * a1->m_rewardCount));
cocos2d::CCPoint::operator+(&v193, &v187);
cocos2d::CCPoint::CCPoint(&v188, (float)-*(float *)&v186 * 0.5, (float)-*((float *)&v186 + 1) * 0.5);
cocos2d::CCPoint::operator+(&v187, &v189);
cocos2d::CCPoint::operator=(&a1->m_diamondsPosition, &v189);
++a1->m_rewardCount;
v116 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigDiamond_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v116->setScale_0)(v116);
a1->m_mainNode->addChild_0(a1->m_mainNode, v116, 3);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, 15.0, -0.5 - (float)(*((float *)&v186 + 1) * 0.5));
v117 = a1->m_diamondsLabel->getPosition_0(a1->m_diamondsLabel);
cocos2d::CCPoint::operator+(v117, &v187);
v116->setPosition_0(v116, &v187);
v116->getPosition_0(v116);
v118 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainNode, (const struct cocos2d::CCPoint *)&v202);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_diamondsPosition, v118);
a1->m_diamondsSprite = v116;
v119 = cocos2d::CCParticleSystemQuad::create("keyEffect.plist", 0);
v119->setTotalParticles(v119, 8u);
v202 = xmmword_140624360;
v119->setStartColor(v119, (const cocos2d::ccColor4F *)&v202);
v202 = xmmword_140624340;
v119->setEndColor(v119, (const cocos2d::ccColor4F *)&v202);
v202 = 0;
v119->setStartColorVar(v119, (const cocos2d::ccColor4F *)&v202);
v202 = 0;
v119->setEndColorVar(v119, (const cocos2d::ccColor4F *)&v202);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v119->setLife)(v119);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v119->setLifeVar)(v119);
v120 = v119->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, 12.0, 10.0);
v120->setPosVar(v119, v121);
a1->m_mainNode->addChild_0(a1->m_mainNode, v119, 100);
v122 = v119->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v123 = (__int64)v116->getPosition_0(v116);
v122->setPosition_0(v119, (const cocos2d::CCPoint *)v123);
v119->setPositionType(v119, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v119);
}
if ( v16 > Icon )
{
v124 = cocos2d::CCString::createWithFormat("%i", a1->m_keys);
v125 = cocos2d::CCString::getCString(v124);
v126 = cocos2d::CCLabelBMFont::create(v125, (const char *)&qword_14052A4D8);
a1->m_keysLabel = v126;
a1->m_mainNode->addChild_0(a1->m_mainNode, v126, 10);
v127 = a1->m_keysLabel->__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, 1.0, 1.0);
v127->setAnchorPoint(a1->m_keysLabel, v128);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_keysLabel->setScale_0)(a1->m_keysLabel);
v184 = -1;
v185 = -1;
a1->m_keysLabel->setColor(&a1->m_keysLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v184);
v129 = a1->m_keysLabel->__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, 0.0, (float)(-30 * a1->m_rewardCount));
v129->setPosition_0(a1->m_keysLabel, v130);
a1->m_keysLabel->setTag(a1->m_keysLabel, v16);
v131 = a1->m_keysLabel->getContentSize(a1->m_keysLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v186, v131);
v132 = a1->m_keysLabel->getScale(a1->m_keysLabel);
*(float *)&v186 = *(float *)&v186 * v132;
v133 = a1->m_keysLabel->getScale(a1->m_keysLabel);
*((float *)&v186 + 1) = *((float *)&v186 + 1) * v133;
cocos2d::CCPoint::CCPoint(&v188, 0.0, (float)(-30 * a1->m_rewardCount));
cocos2d::CCPoint::operator+(&v193, &v187);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v201,
(float)-*(float *)&v186 * 0.5,
(float)-*((float *)&v186 + 1) * 0.5);
cocos2d::CCPoint::operator+(&v187, &v189);
cocos2d::CCPoint::operator=(&a1->m_keysPosition, &v189);
++a1->m_rewardCount;
*(_QWORD *)&v201 = operator new(0x2A8u);
v134 = CurrencySprite::CurrencySprite((CurrencySprite *)v201);
v135 = v134;
if ( v134 )
{
if ( CurrencySprite::init(v134, v16, 1) )
{
cocos2d::CCObject::autorelease(v135);
}
else
{
((void (__fastcall *)(CurrencySprite *, __int64))v135->~CurrencySprite)(v135, 1);
v135 = nullptr;
}
}
a1->m_mainNode->addChild_0(a1->m_mainNode, v135, 3);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, 15.0, -0.5 - (float)(*((float *)&v186 + 1) * 0.5));
v136 = a1->m_keysLabel->getPosition_0(a1->m_keysLabel);
cocos2d::CCPoint::operator+(v136, &v187);
v135->setPosition_0(v135, &v187);
((void (__fastcall *)(CurrencySprite *))v135->setScale_0)(v135);
a1->m_keysSprite = v135;
v135->getPosition_0(v135);
v137 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainNode, (const struct cocos2d::CCPoint *)&v201);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_keysPosition, v137);
}
if ( v17 > Icon )
{
v138 = cocos2d::CCString::createWithFormat("%i", a1->m_shards);
v139 = cocos2d::CCString::getCString(v138);
v140 = cocos2d::CCLabelBMFont::create(v139, (const char *)&qword_14052A4D8);
a1->m_shardsLabel = v140;
a1->m_mainNode->addChild_0(a1->m_mainNode, v140, 10);
v141 = a1->m_shardsLabel->__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, 1.0, 1.0);
v141->setAnchorPoint(a1->m_shardsLabel, v142);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_shardsLabel->setScale_0)(a1->m_shardsLabel);
v184 = -1;
v185 = -1;
a1->m_shardsLabel->setColor(&a1->m_shardsLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v184);
v143 = a1->m_shardsLabel->__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, 0.0, (float)(-30 * a1->m_rewardCount));
v143->setPosition_0(a1->m_shardsLabel, v144);
a1->m_shardsLabel->setTag(a1->m_shardsLabel, v17);
v145 = a1->m_shardsLabel->getContentSize(a1->m_shardsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v186, v145);
v146 = a1->m_shardsLabel->getScale(a1->m_shardsLabel);
*(float *)&v186 = *(float *)&v186 * v146;
v147 = a1->m_shardsLabel->getScale(a1->m_shardsLabel);
*((float *)&v186 + 1) = *((float *)&v186 + 1) * v147;
cocos2d::CCPoint::CCPoint(&v188, 0.0, (float)(-30 * a1->m_rewardCount));
cocos2d::CCPoint::operator+(&v193, &v187);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v201,
(float)-*(float *)&v186 * 0.5,
(float)-*((float *)&v186 + 1) * 0.5);
cocos2d::CCPoint::operator+(&v187, &v189);
cocos2d::CCPoint::operator=(&a1->m_shardsPosition, &v189);
++a1->m_rewardCount;
*(_QWORD *)&v201 = operator new(0x2A8u);
v148 = CurrencySprite::CurrencySprite((CurrencySprite *)v201);
v149 = v148;
if ( v148 )
{
if ( CurrencySprite::init(v148, v17, 1) )
{
cocos2d::CCObject::autorelease(v149);
}
else
{
((void (__fastcall *)(CurrencySprite *, __int64))v149->~CurrencySprite)(v149, 1);
v149 = nullptr;
}
}
a1->m_mainNode->addChild_0(a1->m_mainNode, v149, 3);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, 15.0, -0.5 - (float)(*((float *)&v186 + 1) * 0.5));
v150 = a1->m_shardsLabel->getPosition_0(a1->m_shardsLabel);
cocos2d::CCPoint::operator+(v150, &v187);
v149->setPosition_0(v149, &v187);
((void (__fastcall *)(CurrencySprite *))v149->setScale_0)(v149);
a1->m_shardsSprite = v149;
v149->getPosition_0(v149);
v151 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainNode, (const struct cocos2d::CCPoint *)&v201);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_shardsPosition, v151);
}
v152 = a1->m_mainNode->getPosition_0(a1->m_mainNode);
cocos2d::CCPoint::CCPoint(&v200, v152);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, 0.0, (float)(30 * a1->m_rewardCount + 10));
v153 = a1->m_mainNode->getPosition_0(a1->m_mainNode);
cocos2d::CCPoint::operator+(v153, &v187);
a1->m_mainNode->setPosition_0(a1->m_mainNode, &v187);
v154 = cocos2d::CCMoveTo::create(a13 * 0.5, &v200);
v155 = cocos2d::CCEaseInOut::create(v154, 2.0);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_mainNode, (cocos2d::CCPoint)v155, v156, v13, v183);
v158 = (cocos2d::CCArray *)cocos2d::CCArray::create(v157);
a1->m_objects = v158;
cocos2d::CCObject::retain(v158);
v159 = a13 * 0.2;
v160 = v196;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, v196);
cocos2d::CCPoint::CCPoint(&v188, v161);
v162 = v194;
CurrencyRewardLayer::createObjectsFull(a1, Orb, v194, nullptr, v163, 0.0);
if ( v162 <= 0 )
v164 = 0.0;
else
v164 = a13 * 0.2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, v160);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, v165);
CurrencyRewardLayer::createObjectsFull(a1, Star, v190, nullptr, v166, v164);
if ( v162 > 0 )
v36 = a13 * 0.2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, v160);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, v167);
v168 = v191;
CurrencyRewardLayer::createObjectsFull(a1, Moon, v191, nullptr, v169, v36);
cocos2d::CCPoint::CCPoint(&v188, v160);
v170 = v168 > 0;
v171 = v190 > 0;
v172 = v194 > 0;
v173 = (float)(v171 + v170 + (v194 > 0)) * v159;
cocos2d::CCPoint::CCPoint(&v197, v174);
CurrencyRewardLayer::createObjectsFull(a1, Star|Orb, a5, nullptr, v175, v173);
LOBYTE(v20) = a5 > 0;
v176 = (float)((float)((float)(v171 + v172 + v170 + v20) * v159) + 0.1) * a13;
v177 = v176;
if ( v16 == DemonKey || v16 == 16 )
v176 = v176 + 0.2;
if ( v17 == DemonKey || v17 == 16 )
v177 = v177 + 0.2;
v178 = v196;
if ( v16 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, v196);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, v179);
CurrencyRewardLayer::createObjectsFull(a1, v16, v195, nullptr, v180, v176);
}
if ( v17 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v201, v178);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v202, v181);
CurrencyRewardLayer::createObjectsFull(a1, v17, v192, nullptr, v182, v177);
}
a1->m_objectsAdded = 1;
cocos2d::CCNode::scheduleUpdate(a1);
sub_14003A830((__int64)v203);
sub_14003A830((__int64)v204);
return 1;
}
return result;
}