//
// CurrencyRewardLayer::init from 0x9106d4 to 0x9123d8 (7428 bytes)
//
// 2 xrefs:
// > CurrencyRewardLayer::create @ 0x912590
// > ??> @ 0xb0598
//
// 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
//
// local variable allocation has failed, the output may be wrong!
bool CurrencyRewardLayer::init(
CurrencyRewardLayer *a1,
int a2,
int a3,
int a4,
int a5,
CurrencySpriteType a6,
int a7,
CurrencySpriteType a8,
int a9,
cocos2d::CCPoint a10,
const cocos2d::CCPoint *a11,
float a12,
float a13)
{
float x; // s8
float y; // s9
int v21; // w1
cocos2d::CCDirector *v22; // x0
cocos2d::CCTextureCache *v23; // x0
cocos2d::CCTexture2D *v24; // x21
cocos2d::CCSpriteBatchNode *v25; // x0
cocos2d::CCSpriteBatchNode_vtbl *v26; // x2
cocos2d::CCSpriteBatchNode *v27; // x0
cocos2d::CCNode *v28; // x0
cocos2d::CCNode_vtbl *v29; // x2
GameStatsManager *v30; // x0
GameStatsManager *v31; // x0
GameStatsManager *v32; // x0
GameStatsManager *v33; // x0
cocos2d::CCString *v34; // x0
cocos2d::CCLabelBMFont *v35; // x0
cocos2d::CCNode *m_mainNode; // x3
cocos2d::CCLabelBMFont *m_orbsLabel; // x28
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v39; // x0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCLabelBMFont *v41; // x28
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
const cocos2d::CCSize *v43; // x0
float v44; // s0
cocos2d::CCLabelBMFont *v45; // x0
float (__fastcall *getScale)(cocos2d::CCNode *__hidden); // x1
float v47; // s0
float v48; // s0
float v49; // s1
cocos2d::CCSprite *v50; // x28
cocos2d::CCNode *v51; // x21
const cocos2d::CCPoint *v52; // x0
cocos2d::CCSequence *v53; // x21
cocos2d::CCTintTo *v54; // x0
cocos2d::CCActionInterval *v55; // x0
cocos2d::CCRepeatForever *v56; // x0
bool v57; // w2
cocos2d::CCParticleSystem *v58; // x21
void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *setEndColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *setStartColorVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *setEndColorVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v63)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x20
__int64 v64; // x0
cocos2d::CCString *v65; // x0
cocos2d::CCLabelBMFont *v66; // x0
cocos2d::CCNode *v67; // x3
cocos2d::CCLabelBMFont *m_starsLabel; // x28
void (__fastcall *v69)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v70; // x0
void (__fastcall *v71)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x2
cocos2d::CCLabelBMFont *v72; // x28
void (__fastcall *v73)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
const cocos2d::CCSize *v74; // x0
float v75; // s0
cocos2d::CCLabelBMFont *v76; // x0
float (__fastcall *v77)(cocos2d::CCNode *__hidden); // x1
float v78; // s0
int m_rewardCount; // w1
float v80; // s0
float v81; // s1
cocos2d::CCSprite *v82; // x28
cocos2d::CCNode *v83; // x21
const cocos2d::CCPoint *v84; // x0
cocos2d::CCSequence *v85; // x21
cocos2d::CCTintTo *v86; // x0
cocos2d::CCActionInterval *v87; // x0
cocos2d::CCRepeatForever *v88; // x0
bool v89; // w2
cocos2d::CCParticleSystem *v90; // x21
void (__fastcall *v91)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v92)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v93)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v94)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v95)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x20
__int64 v96; // x0
cocos2d::CCString *v97; // x0
cocos2d::CCLabelBMFont *v98; // x0
cocos2d::CCNode *v99; // x3
cocos2d::CCLabelBMFont *m_moonsLabel; // x28
void (__fastcall *v101)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v102; // x0
void (__fastcall *v103)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCLabelBMFont *v104; // x28
void (__fastcall *v105)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
const cocos2d::CCSize *v106; // x0
float v107; // s0
cocos2d::CCLabelBMFont *v108; // x0
float (__fastcall *v109)(cocos2d::CCNode *__hidden); // x1
float v110; // s0
int v111; // w1
float v112; // s0
float v113; // s1
cocos2d::CCSprite *v114; // x28
cocos2d::CCNode *v115; // x21
const cocos2d::CCPoint *v116; // x0
cocos2d::CCSequence *v117; // x21
cocos2d::CCTintTo *v118; // x0
cocos2d::CCActionInterval *v119; // x0
cocos2d::CCRepeatForever *v120; // x0
bool v121; // w2
cocos2d::CCParticleSystem *v122; // x21
void (__fastcall *v123)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v124)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v125)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v126)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v127)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x20
__int64 v128; // x0
cocos2d::CCString *v129; // x0
cocos2d::CCLabelBMFont *v130; // x0
cocos2d::CCNode *v131; // x3
cocos2d::CCLabelBMFont *m_diamondsLabel; // x28
void (__fastcall *v133)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v134; // x0
void (__fastcall *v135)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCLabelBMFont *v136; // x28
void (__fastcall *v137)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
const cocos2d::CCSize *v138; // x0
float v139; // s0
cocos2d::CCLabelBMFont *v140; // x0
float (__fastcall *v141)(cocos2d::CCNode *__hidden); // x1
float v142; // s0
int v143; // w1
float v144; // s0
float v145; // s1
cocos2d::CCSprite *v146; // x28
cocos2d::CCNode *v147; // x21
const cocos2d::CCPoint *v148; // x0
bool v149; // w2
cocos2d::CCParticleSystem *v150; // x21
void (__fastcall *v151)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v152)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v153)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v154)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v155)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x20
__int64 v156; // x0
cocos2d::CCString *v157; // x0
cocos2d::CCLabelBMFont *v158; // x0
cocos2d::CCNode *v159; // x3
cocos2d::CCLabelBMFont *m_keysLabel; // x28
void (__fastcall *v161)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v162; // x0
void (__fastcall *v163)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCLabelBMFont *v164; // x28
void (__fastcall *v165)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
const cocos2d::CCSize *v166; // x0
float v167; // s0
cocos2d::CCLabelBMFont *v168; // x0
float (__fastcall *v169)(cocos2d::CCNode *__hidden); // x1
float v170; // s0
int v171; // w1
float v172; // s0
float v173; // s1
CurrencySprite *v174; // x28
void (__fastcall *setScale)(CCSpritePlus *__hidden, float); // x21
long double v176; // q0
CurrencySprite_vtbl *v177; // x1
cocos2d::CCNode *v178; // x21
const cocos2d::CCPoint *v179; // x0
cocos2d::CCString *v180; // x0
cocos2d::CCLabelBMFont *v181; // x0
cocos2d::CCNode *v182; // x3
cocos2d::CCLabelBMFont *m_shardsLabel; // x28
void (__fastcall *v184)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v185; // x0
void (__fastcall *v186)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCLabelBMFont *v187; // x28
void (__fastcall *v188)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
const cocos2d::CCSize *v189; // x0
float v190; // s0
cocos2d::CCLabelBMFont *v191; // x0
float (__fastcall *v192)(cocos2d::CCNode *__hidden); // x1
float v193; // s0
int v194; // w1
float v195; // s0
float v196; // s1
CurrencySprite *v197; // x25
const cocos2d::CCPoint *v198; // x28
void (__fastcall *v199)(CCSpritePlus *__hidden, float); // x21
long double v200; // q0
CurrencySprite_vtbl *v201; // x1
cocos2d::CCNode *v202; // x21
const cocos2d::CCPoint *v203; // x0
const cocos2d::CCPoint *v204; // x0
cocos2d::CCNode *v205; // x25
cocos2d::CCMoveTo *v206; // x0
cocos2d::CCEaseInOut *v207; // x0
cocos2d::CCAction *v208; // x0
cocos2d::CCArray *v209; // x0
float v210; // s8
float v211; // s2
float v212; // s2
float v213; // s2
int v214; // w28
float v215; // s2
float v216; // s8
float v217; // s9
float v218; // s2
char *v219; // x0
char *v220; // x0
GameStatsManager *v222; // x0
float v223; // s2
unsigned int *v224; // x1
int v225; // w2
GameStatsManager *v226; // x0
unsigned int *v227; // x1
int v228; // w2
const cocos2d::CCPoint *v229; // [xsp+88h] [xbp+88h]
const cocos2d::CCPoint *v230; // [xsp+88h] [xbp+88h]
const cocos2d::CCPoint *v231; // [xsp+88h] [xbp+88h]
const cocos2d::CCPoint *v232; // [xsp+88h] [xbp+88h]
const cocos2d::CCPoint *v233; // [xsp+88h] [xbp+88h]
void (__fastcall *v234)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [xsp+90h] [xbp+90h]
void (__fastcall *v235)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [xsp+90h] [xbp+90h]
void (__fastcall *v236)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [xsp+90h] [xbp+90h]
void (__fastcall *v237)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [xsp+90h] [xbp+90h]
void (__fastcall *v238)(CCSpritePlus *__hidden, const cocos2d::CCPoint *); // [xsp+90h] [xbp+90h]
void (__fastcall *v239)(CCSpritePlus *__hidden, const cocos2d::CCPoint *); // [xsp+90h] [xbp+90h]
__int64 v240; // [xsp+90h] [xbp+90h]
void (__fastcall *setPosVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // [xsp+98h] [xbp+98h]
void (__fastcall *v242)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // [xsp+98h] [xbp+98h]
void (__fastcall *v243)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // [xsp+98h] [xbp+98h]
void (__fastcall *v244)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // [xsp+98h] [xbp+98h]
void (__fastcall *v245)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+98h] [xbp+98h]
int v246; // [xsp+A0h] [xbp+A0h]
bool v247; // [xsp+A7h] [xbp+A7h]
float v250; // [xsp+B8h] [xbp+B8h]
float v251; // [xsp+BCh] [xbp+BCh]
cocos2d::CCPoint v252; // [xsp+C0h] [xbp+C0h] BYREF
char *v253; // [xsp+C8h] [xbp+C8h] BYREF
char *v254; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCSize v255; // [xsp+D8h] [xbp+D8h] BYREF
cocos2d::CCPoint v256; // [xsp+E0h] [xbp+E0h] BYREF
cocos2d::CCPoint v257; // [xsp+E8h] [xbp+E8h] BYREF
cocos2d::CCPoint v258; // [xsp+F0h] [xbp+F0h] BYREF
cocos2d::CCPoint v259; // [xsp+F8h] [xbp+F8h] BYREF
float v260; // [xsp+100h] [xbp+100h]
float v261; // [xsp+104h] [xbp+104h]
CurrencyRewardType v262; // [xsp+120h] [xbp+120h]
cocos2d::CCPoint v263; // 0:kr08_8.8
cocos2d::CCPoint v264; // 0:kr10_8.8
cocos2d::CCPoint v265; // 0:kr18_8.8
cocos2d::CCPoint v266; // 0:kr20_8.8
cocos2d::CCPoint v267; // 0:kr28_8.8
cocos2d::CCPoint v268; // 0:kr30_8.8
cocos2d::CCPoint v269; // 0:s0.4,4:s1.4
cocos2d::CCPoint v270; // 0:s0.4,4:s1.4
cocos2d::CCPoint v271; // 0:s0.4,4:s1.4
cocos2d::CCPoint v272; // 0:s0.4,4:s1.4
cocos2d::CCPoint v273; // 0:s0.4,4:s1.4
cocos2d::CCPoint v274; // 0:s0.4,4:s1.4
x = a10.x;
y = a10.y;
v246 = a7;
v247 = cocos2d::CCLayer::init(a1);
if ( v247 )
{
a1->m_rewardType = v262;
a1->m_time = y;
if ( a6 == a8 && a6 )
{
v21 = a9;
a8 = Icon;
a9 = 0;
v246 = a7 + v21;
}
v22 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v22);
v23 = cocos2d::CCTextureCache::sharedTextureCache();
v24 = cocos2d::CCTextureCache::addImage(v23, "GJ_GameSheet03.png", 0);
v25 = cocos2d::CCSpriteBatchNode::createWithTexture(v24, (unsigned int)&off_18 + 5);
v26 = v25->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_orbBatchNode = v25;
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, __int64))v26->setBlendFunc)(v25, 0x100000302LL);
a1->addChild_0(a1, a1->m_orbBatchNode, 1);
v27 = cocos2d::CCSpriteBatchNode::createWithTexture(v24, (unsigned int)&off_18 + 5);
a1->m_currencyBatchNode = v27;
a1->addChild_0(a1, v27, 2);
v28 = cocos2d::CCNode::create();
v29 = v28->__vftable;
a1->m_mainNode = v28;
v29->setContentSize(v28, &stru_1243298);
a1->addChild_0(a1, a1->m_mainNode, 4);
cocos2d::CCPoint::CCPoint(&v252, v250 - 40.0, (float)(v251 - 5.0) + x);
a1->m_mainNode->setPosition(a1->m_mainNode, &v252);
v30 = GameStatsManager::sharedState();
a1->m_orbs = GameStatsManager::getStat(v30, "14") - a2;
v31 = GameStatsManager::sharedState();
a1->m_stars = GameStatsManager::getStat(v31, "6") - a3;
v32 = GameStatsManager::sharedState();
a1->m_moons = GameStatsManager::getStat(v32, "28") - a4;
v33 = GameStatsManager::sharedState();
a1->m_diamonds = GameStatsManager::getStat(v33, "13") - a5;
CurrencySprite::spriteTypeToStat(a6, (__int64)&v253);
if ( *((_QWORD *)v253 - 3) )
{
v222 = GameStatsManager::sharedState();
a1->m_keys = GameStatsManager::getStat(v222, v253) - v246;
}
else
{
a6 = Icon;
}
CurrencySprite::spriteTypeToStat(a8, (__int64)&v254);
if ( *((_QWORD *)v254 - 3) )
{
v226 = GameStatsManager::sharedState();
a1->m_shards = GameStatsManager::getStat(v226, v254) - a9;
}
else
{
a8 = Icon;
}
a1->m_rewardCount = 0;
if ( a2 > 0 )
{
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_orbs);
cocos2d::CCString::getCString(v34);
v35 = cocos2d::CCLabelBMFont::create();
m_mainNode = a1->m_mainNode;
a1->m_orbsLabel = v35;
m_mainNode->addChild_0(m_mainNode, v35, 10);
m_orbsLabel = a1->m_orbsLabel;
setAnchorPoint = m_orbsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v259, 1.0, 1.0);
setAnchorPoint(m_orbsLabel, &v259);
a1->m_orbsLabel->setScale(a1->m_orbsLabel, 0.6);
v39 = a1->m_orbsLabel;
setColor = v39->setColor;
LOWORD(v259.x) = -106;
BYTE2(v259.x) = -1;
setColor(v39, (const cocos2d::ccColor3B *)&v259);
v41 = a1->m_orbsLabel;
setPosition = v41->setPosition;
cocos2d::CCPoint::CCPoint(&v259, 0.0, (float)(-30 * a1->m_rewardCount));
setPosition(v41, &v259);
v43 = a1->m_orbsLabel->getContentSize(a1->m_orbsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v257, v43);
v44 = a1->m_orbsLabel->getScale(a1->m_orbsLabel);
v45 = a1->m_orbsLabel;
getScale = v45->getScale;
v257.x = v44 * v257.x;
v47 = getScale(v45);
v257.y = v47 * v257.y;
cocos2d::CCPoint::CCPoint(&v258, (float)-v257.x * 0.5, (float)-v257.y * 0.5);
cocos2d::CCPoint::operator+(&v259, &v252, &v258);
cocos2d::CCPoint::operator=(&a1->m_orbsPosition, v48, v49);
++a1->m_rewardCount;
v50 = cocos2d::CCSprite::createWithSpriteFrameName("currencyOrbIcon_001.png");
a1->m_mainNode->addChild_0(a1->m_mainNode, v50, 3);
v234 = v50->setPosition;
v229 = a1->m_orbsLabel->getPosition(a1->m_orbsLabel);
cocos2d::CCPoint::CCPoint(&v258, 15.0, -0.5 - (float)(v257.y * 0.5));
cocos2d::CCPoint::operator+(&v259, v229, &v258);
v234(v50, &v259);
v51 = a1->m_mainNode;
v52 = v50->getPosition(v50);
v263 = cocos2d::CCNode::convertToWorldSpace(v51, v52);
cocos2d::CCPoint::operator=(&a1->m_orbsPosition, v263.x, v263.y);
a1->m_orbsSprite = v50;
v53 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(0.3, 0, 0xFFu, 0xFFu);
v54 = cocos2d::CCTintTo::create(0.3, 0x96u, 0xFFu, 0xFFu);
v55 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v53, v54, 0);
v56 = cocos2d::CCRepeatForever::create(v55);
cocos2d::CCNode::runAction(a1->m_orbsLabel, v56);
v58 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v57);
v58->setTotalParticles(v58, 8u);
setStartColor = v58->setStartColor;
v259.x = 0.0;
v259.y = 0.78431;
v260 = 1.0;
v261 = 1.0;
setStartColor(v58, (const cocos2d::ccColor4F *)&v259);
setEndColor = v58->setEndColor;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.58824;
v261 = 1.0;
setEndColor(v58, (const cocos2d::ccColor4F *)&v259);
setStartColorVar = v58->setStartColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
setStartColorVar(v58, (const cocos2d::ccColor4F *)&v259);
setEndColorVar = v58->setEndColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
setEndColorVar(v58, (const cocos2d::ccColor4F *)&v259);
v58->setLife(v58, 1.0);
v58->setLifeVar(v58, 0.2);
setPosVar = v58->setPosVar;
cocos2d::CCPoint::CCPoint(&v259, 12.0, 10.0);
setPosVar(v58, &v259);
a1->m_mainNode->addChild_0(a1->m_mainNode, v58, 100);
v63 = v58->setPosition;
v64 = (__int64)v50->getPosition(v50);
v63(v58, (const cocos2d::CCPoint *)v64);
v58->setPositionType(v58, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v58);
}
if ( a3 > 0 )
{
v65 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_stars);
cocos2d::CCString::getCString(v65);
v66 = cocos2d::CCLabelBMFont::create();
v67 = a1->m_mainNode;
a1->m_starsLabel = v66;
v67->addChild_0(v67, v66, 10);
m_starsLabel = a1->m_starsLabel;
v69 = m_starsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v259, 1.0, 1.0);
v69(m_starsLabel, &v259);
a1->m_starsLabel->setScale(a1->m_starsLabel, 0.6);
v70 = a1->m_starsLabel;
v71 = v70->setColor;
LOBYTE(v259.x) = -1;
*(_WORD *)((char *)&v259.x + 1) = 200;
v71(v70, (const cocos2d::ccColor3B *)&v259);
v72 = a1->m_starsLabel;
v73 = v72->setPosition;
cocos2d::CCPoint::CCPoint(&v259, 0.0, (float)(-30 * a1->m_rewardCount));
v73(v72, &v259);
v74 = a1->m_starsLabel->getContentSize(a1->m_starsLabel);
cocos2d::CCSize::CCSize(&v255, v74);
v75 = a1->m_starsLabel->getScale(a1->m_starsLabel);
v76 = a1->m_starsLabel;
v77 = v76->getScale;
v255.width = v75 * v255.width;
v78 = v77(v76);
m_rewardCount = a1->m_rewardCount;
v255.height = v78 * v255.height;
cocos2d::CCPoint::CCPoint(&v256, 0.0, (float)(-30 * m_rewardCount));
cocos2d::CCPoint::operator+(&v257, &v252, &v256);
cocos2d::CCPoint::CCPoint(&v258, (float)-v255.width * 0.5, (float)-v255.height * 0.5);
cocos2d::CCPoint::operator+(&v259, &v257, &v258);
cocos2d::CCPoint::operator=(&a1->m_starsPosition, v80, v81);
++a1->m_rewardCount;
v82 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigStar_001.png");
v82->setScale(v82, 0.5);
a1->m_mainNode->addChild_0(a1->m_mainNode, v82, 3);
v235 = v82->setPosition;
v230 = a1->m_starsLabel->getPosition(a1->m_starsLabel);
cocos2d::CCPoint::CCPoint(&v258, 15.0, -0.5 - (float)(v255.height * 0.5));
cocos2d::CCPoint::operator+(&v259, v230, &v258);
v235(v82, &v259);
v83 = a1->m_mainNode;
v84 = v82->getPosition(v82);
v264 = cocos2d::CCNode::convertToWorldSpace(v83, v84);
cocos2d::CCPoint::operator=(&a1->m_starsPosition, v264.x, v264.y);
a1->m_starsSprite = v82;
v85 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(0.3, 0xFFu, 0xFFu, 0);
v86 = cocos2d::CCTintTo::create(0.3, 0xFFu, 0xC8u, 0);
v87 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v85, v86, 0);
v88 = cocos2d::CCRepeatForever::create(v87);
cocos2d::CCNode::runAction(a1->m_starsLabel, v88);
v90 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v89);
v90->setTotalParticles(v90, 8u);
v91 = v90->setStartColor;
v259.x = 1.0;
v259.y = 1.0;
v260 = 0.0;
v261 = 1.0;
v91(v90, (const cocos2d::ccColor4F *)&v259);
v92 = v90->setEndColor;
v259.y = 0.0;
v260 = 0.0;
v259.x = 0.78431;
v261 = 1.0;
v92(v90, (const cocos2d::ccColor4F *)&v259);
v93 = v90->setStartColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
v93(v90, (const cocos2d::ccColor4F *)&v259);
v94 = v90->setEndColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
v94(v90, (const cocos2d::ccColor4F *)&v259);
v90->setLife(v90, 1.0);
v90->setLifeVar(v90, 0.2);
v242 = v90->setPosVar;
cocos2d::CCPoint::CCPoint(&v259, 12.0, 10.0);
v242(v90, &v259);
a1->m_mainNode->addChild_0(a1->m_mainNode, v90, 100);
v95 = v90->setPosition;
v96 = (__int64)v82->getPosition(v82);
v95(v90, (const cocos2d::CCPoint *)v96);
v90->setPositionType(v90, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v90);
}
if ( a4 > 0 )
{
v97 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_moons);
cocos2d::CCString::getCString(v97);
v98 = cocos2d::CCLabelBMFont::create();
v99 = a1->m_mainNode;
a1->m_moonsLabel = v98;
v99->addChild_0(v99, v98, 10);
m_moonsLabel = a1->m_moonsLabel;
v101 = m_moonsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v259, 1.0, 1.0);
v101(m_moonsLabel, &v259);
a1->m_moonsLabel->setScale(a1->m_moonsLabel, 0.6);
v102 = a1->m_moonsLabel;
v103 = v102->setColor;
LOWORD(v259.x) = -256;
BYTE2(v259.x) = -1;
v103(v102, (const cocos2d::ccColor3B *)&v259);
v104 = a1->m_moonsLabel;
v105 = v104->setPosition;
cocos2d::CCPoint::CCPoint(&v259, 0.0, (float)(-30 * a1->m_rewardCount));
v105(v104, &v259);
v106 = a1->m_moonsLabel->getContentSize(a1->m_moonsLabel);
cocos2d::CCSize::CCSize(&v255, v106);
v107 = a1->m_moonsLabel->getScale(a1->m_moonsLabel);
v108 = a1->m_moonsLabel;
v109 = v108->getScale;
v255.width = v107 * v255.width;
v110 = v109(v108);
v111 = a1->m_rewardCount;
v255.height = v110 * v255.height;
cocos2d::CCPoint::CCPoint(&v256, 0.0, (float)(-30 * v111));
cocos2d::CCPoint::operator+(&v257, &v252, &v256);
cocos2d::CCPoint::CCPoint(&v258, (float)-v255.width * 0.5, (float)-v255.height * 0.5);
cocos2d::CCPoint::operator+(&v259, &v257, &v258);
cocos2d::CCPoint::operator=(&a1->m_moonsPosition, v112, v113);
++a1->m_rewardCount;
v114 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigMoon_001.png");
v114->setScale(v114, 0.5);
a1->m_mainNode->addChild_0(a1->m_mainNode, v114, 3);
v236 = v114->setPosition;
v231 = a1->m_moonsLabel->getPosition(a1->m_moonsLabel);
cocos2d::CCPoint::CCPoint(&v258, 15.0, -0.5 - (float)(v255.height * 0.5));
cocos2d::CCPoint::operator+(&v259, v231, &v258);
v236(v114, &v259);
v115 = a1->m_mainNode;
v116 = v114->getPosition(v114);
v265 = cocos2d::CCNode::convertToWorldSpace(v115, v116);
cocos2d::CCPoint::operator=(&a1->m_moonsPosition, v265.x, v265.y);
a1->m_moonsSprite = v114;
v117 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(0.3, 0, 0xFFu, 0xFFu);
v118 = cocos2d::CCTintTo::create(0.3, 0, 0xC8u, 0xFFu);
v119 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v117, v118, 0);
v120 = cocos2d::CCRepeatForever::create(v119);
cocos2d::CCNode::runAction(a1->m_moonsLabel, v120);
v122 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v121);
v122->setTotalParticles(v122, 8u);
v123 = v122->setStartColor;
v259.y = 1.0;
v259.x = 0.0;
v260 = 1.0;
v261 = 1.0;
v123(v122, (const cocos2d::ccColor4F *)&v259);
v124 = v122->setEndColor;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.78431;
v261 = 1.0;
v124(v122, (const cocos2d::ccColor4F *)&v259);
v125 = v122->setStartColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
v125(v122, (const cocos2d::ccColor4F *)&v259);
v126 = v122->setEndColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
v126(v122, (const cocos2d::ccColor4F *)&v259);
v122->setLife(v122, 1.0);
v122->setLifeVar(v122, 0.2);
v243 = v122->setPosVar;
cocos2d::CCPoint::CCPoint(&v259, 12.0, 10.0);
v243(v122, &v259);
a1->m_mainNode->addChild_0(a1->m_mainNode, v122, 100);
v127 = v122->setPosition;
v128 = (__int64)v114->getPosition(v114);
v127(v122, (const cocos2d::CCPoint *)v128);
v122->setPositionType(v122, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v122);
}
if ( a5 > 0 )
{
v129 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_diamonds);
cocos2d::CCString::getCString(v129);
v130 = cocos2d::CCLabelBMFont::create();
v131 = a1->m_mainNode;
a1->m_diamondsLabel = v130;
v131->addChild_0(v131, v130, 10);
m_diamondsLabel = a1->m_diamondsLabel;
v133 = m_diamondsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v259, 1.0, 1.0);
v133(m_diamondsLabel, &v259);
a1->m_diamondsLabel->setScale(a1->m_diamondsLabel, 0.6);
v134 = a1->m_diamondsLabel;
v135 = v134->setColor;
LOWORD(v259.x) = -1;
BYTE2(v259.x) = -1;
v135(v134, (const cocos2d::ccColor3B *)&v259);
v136 = a1->m_diamondsLabel;
v137 = v136->setPosition;
cocos2d::CCPoint::CCPoint(&v259, 0.0, (float)(-30 * a1->m_rewardCount));
v137(v136, &v259);
v138 = a1->m_diamondsLabel->getContentSize(a1->m_diamondsLabel);
cocos2d::CCSize::CCSize(&v255, v138);
v139 = a1->m_diamondsLabel->getScale(a1->m_diamondsLabel);
v140 = a1->m_diamondsLabel;
v141 = v140->getScale;
v255.width = v139 * v255.width;
v142 = v141(v140);
v143 = a1->m_rewardCount;
v255.height = v142 * v255.height;
cocos2d::CCPoint::CCPoint(&v256, 0.0, (float)(-30 * v143));
cocos2d::CCPoint::operator+(&v257, &v252, &v256);
cocos2d::CCPoint::CCPoint(&v258, (float)-v255.width * 0.5, (float)-v255.height * 0.5);
cocos2d::CCPoint::operator+(&v259, &v257, &v258);
cocos2d::CCPoint::operator=(&a1->m_diamondsPosition, v144, v145);
++a1->m_rewardCount;
v146 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigDiamond_001.png");
v146->setScale(v146, 0.5);
a1->m_mainNode->addChild_0(a1->m_mainNode, v146, 3);
v237 = v146->setPosition;
v232 = a1->m_diamondsLabel->getPosition(a1->m_diamondsLabel);
cocos2d::CCPoint::CCPoint(&v258, 15.0, -0.5 - (float)(v255.height * 0.5));
cocos2d::CCPoint::operator+(&v259, v232, &v258);
v237(v146, &v259);
v147 = a1->m_mainNode;
v148 = v146->getPosition(v146);
v266 = cocos2d::CCNode::convertToWorldSpace(v147, v148);
cocos2d::CCPoint::operator=(&a1->m_diamondsPosition, v266.x, v266.y);
a1->m_diamondsSprite = v146;
v150 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v149);
v150->setTotalParticles(v150, 8u);
v151 = v150->setStartColor;
v259.x = 1.0;
v259.y = 1.0;
v260 = 1.0;
v261 = 1.0;
v151(v150, (const cocos2d::ccColor4F *)&v259);
v152 = v150->setEndColor;
v259.y = 1.0;
v259.x = 0.58824;
v260 = 1.0;
v261 = 1.0;
v152(v150, (const cocos2d::ccColor4F *)&v259);
v153 = v150->setStartColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
v153(v150, (const cocos2d::ccColor4F *)&v259);
v154 = v150->setEndColorVar;
v259.x = 0.0;
v259.y = 0.0;
v260 = 0.0;
v261 = 0.0;
v154(v150, (const cocos2d::ccColor4F *)&v259);
v150->setLife(v150, 1.0);
v150->setLifeVar(v150, 0.2);
v244 = v150->setPosVar;
cocos2d::CCPoint::CCPoint(&v259, 12.0, 10.0);
v244(v150, &v259);
a1->m_mainNode->addChild_0(a1->m_mainNode, v150, 100);
v155 = v150->setPosition;
v156 = (__int64)v146->getPosition(v146);
v155(v150, (const cocos2d::CCPoint *)v156);
v150->setPositionType(v150, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v150);
}
if ( a6 > Icon )
{
v157 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_keys);
cocos2d::CCString::getCString(v157);
v158 = cocos2d::CCLabelBMFont::create();
v159 = a1->m_mainNode;
a1->m_keysLabel = v158;
v159->addChild_0(v159, v158, 10);
m_keysLabel = a1->m_keysLabel;
v161 = m_keysLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v259, 1.0, 1.0);
v161(m_keysLabel, &v259);
a1->m_keysLabel->setScale(a1->m_keysLabel, 0.6);
v162 = a1->m_keysLabel;
v163 = v162->setColor;
LOWORD(v259.x) = -1;
BYTE2(v259.x) = -1;
v163(v162, (const cocos2d::ccColor3B *)&v259);
v164 = a1->m_keysLabel;
v165 = v164->setPosition;
cocos2d::CCPoint::CCPoint(&v259, 0.0, (float)(-30 * a1->m_rewardCount));
v165(v164, &v259);
a1->m_keysLabel->setTag(a1->m_keysLabel, a6);
v166 = a1->m_keysLabel->getContentSize(a1->m_keysLabel);
cocos2d::CCSize::CCSize(&v255, v166);
v167 = a1->m_keysLabel->getScale(a1->m_keysLabel);
v168 = a1->m_keysLabel;
v169 = v168->getScale;
v255.width = v167 * v255.width;
v170 = v169(v168);
v171 = a1->m_rewardCount;
v255.height = v170 * v255.height;
cocos2d::CCPoint::CCPoint(&v256, 0.0, (float)(-30 * v171));
cocos2d::CCPoint::operator+(&v257, &v252, &v256);
cocos2d::CCPoint::CCPoint(&v258, (float)-v255.width * 0.5, (float)-v255.height * 0.5);
cocos2d::CCPoint::operator+(&v259, &v257, &v258);
cocos2d::CCPoint::operator=(&a1->m_keysPosition, v172, v173);
++a1->m_rewardCount;
v174 = CurrencySprite::create(a6, 1);
a1->m_mainNode->addChild_0(a1->m_mainNode, v174, 3);
v238 = v174->setPosition;
v233 = a1->m_keysLabel->getPosition(a1->m_keysLabel);
cocos2d::CCPoint::CCPoint(&v258, 15.0, -0.5 - (float)(v255.height * 0.5));
cocos2d::CCPoint::operator+(&v259, v233, &v258);
v238(v174, &v259);
setScale = v174->setScale;
if ( (unsigned __int8)isSpecialCurrencyType(a6) )
LODWORD(v176) = 1059481190;
else
LODWORD(v176) = 0.5;
setScale(v174, v176);
v177 = v174->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_keysSprite = v174;
v178 = a1->m_mainNode;
v179 = v177->getPosition(v174);
v267 = cocos2d::CCNode::convertToWorldSpace(v178, v179);
cocos2d::CCPoint::operator=(&a1->m_keysPosition, v267.x, v267.y);
}
if ( a8 > Icon )
{
v180 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_shards);
cocos2d::CCString::getCString(v180);
v181 = cocos2d::CCLabelBMFont::create();
v182 = a1->m_mainNode;
a1->m_shardsLabel = v181;
v182->addChild_0(v182, v181, 10);
m_shardsLabel = a1->m_shardsLabel;
v184 = m_shardsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v259, 1.0, 1.0);
v184(m_shardsLabel, &v259);
a1->m_shardsLabel->setScale(a1->m_shardsLabel, 0.6);
v185 = a1->m_shardsLabel;
v186 = v185->setColor;
LOWORD(v259.x) = -1;
BYTE2(v259.x) = -1;
v186(v185, (const cocos2d::ccColor3B *)&v259);
v187 = a1->m_shardsLabel;
v188 = v187->setPosition;
cocos2d::CCPoint::CCPoint(&v259, 0.0, (float)(-30 * a1->m_rewardCount));
v188(v187, &v259);
a1->m_shardsLabel->setTag(a1->m_shardsLabel, a8);
v189 = a1->m_shardsLabel->getContentSize(a1->m_shardsLabel);
cocos2d::CCSize::CCSize(&v255, v189);
v190 = a1->m_shardsLabel->getScale(a1->m_shardsLabel);
v191 = a1->m_shardsLabel;
v192 = v191->getScale;
v255.width = v190 * v255.width;
v193 = v192(v191);
v194 = a1->m_rewardCount;
v255.height = v193 * v255.height;
cocos2d::CCPoint::CCPoint(&v256, 0.0, (float)(-30 * v194));
cocos2d::CCPoint::operator+(&v257, &v252, &v256);
cocos2d::CCPoint::CCPoint(&v258, (float)-v255.width * 0.5, (float)-v255.height * 0.5);
cocos2d::CCPoint::operator+(&v259, &v257, &v258);
cocos2d::CCPoint::operator=(&a1->m_shardsPosition, v195, v196);
++a1->m_rewardCount;
v197 = CurrencySprite::create(a8, 1);
a1->m_mainNode->addChild_0(a1->m_mainNode, v197, 3);
v239 = v197->setPosition;
v198 = a1->m_shardsLabel->getPosition(a1->m_shardsLabel);
cocos2d::CCPoint::CCPoint(&v258, 15.0, -0.5 - (float)(v255.height * 0.5));
cocos2d::CCPoint::operator+(&v259, v198, &v258);
v239(v197, &v259);
v199 = v197->setScale;
if ( (unsigned __int8)isSpecialCurrencyType(a8) )
LODWORD(v200) = 1059481190;
else
LODWORD(v200) = 0.5;
v199(v197, v200);
v201 = v197->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_shardsSprite = v197;
v202 = a1->m_mainNode;
v203 = v201->getPosition(v197);
v268 = cocos2d::CCNode::convertToWorldSpace(v202, v203);
cocos2d::CCPoint::operator=(&a1->m_shardsPosition, v268.x, v268.y);
}
v204 = a1->m_mainNode->getPosition(a1->m_mainNode);
cocos2d::CCPoint::CCPoint(&v257, v204);
v205 = a1->m_mainNode;
v245 = v205->setPosition;
v240 = (__int64)v205->getPosition(v205);
cocos2d::CCPoint::CCPoint(&v258, 0.0, (float)(30 * (a1->m_rewardCount - 1) + 40));
cocos2d::CCPoint::operator+(&v259, v240, &v258);
v245(v205, &v259);
v206 = cocos2d::CCMoveTo::create(y * 0.5, &v257);
v207 = cocos2d::CCEaseInOut::create(v206, 2.0);
v208 = cocos2d::CCNode::runAction(a1->m_mainNode, v207);
v209 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v208);
a1->m_objects = v209;
cocos2d::CCObject::retain(v209);
v210 = y * 0.2;
cocos2d::CCPoint::CCPoint(&v259, a11);
v269.x = 0.0;
CurrencyRewardLayer::createObjects(a1, Orb, a2, v269, v211);
cocos2d::CCPoint::CCPoint(&v259, a11);
v270.x = 0.0;
if ( a2 > 0 )
v270.x = y * 0.2;
CurrencyRewardLayer::createObjects(a1, Star, a3, v270, v212);
cocos2d::CCPoint::CCPoint(&v259, a11);
v271.x = 0.0;
if ( a2 > 0 )
v271.x = y * 0.2;
CurrencyRewardLayer::createObjects(a1, Moon, a4, v271, v213);
cocos2d::CCPoint::CCPoint(&v259, a11);
v214 = (a2 > 0) + (a3 > 0) + (a4 > 0);
v272.x = (float)v214 * v210;
CurrencyRewardLayer::createObjects(a1, Star|Orb, a5, v272, v215);
if ( a5 > 0 )
++v214;
v216 = (float)((float)((float)v214 * v210) + 0.1) * y;
v217 = v216;
if ( (unsigned __int8)isSpecialCurrencyType(a6) )
v217 = v216 + 0.2;
if ( (unsigned __int8)isSpecialCurrencyType(a8) )
v216 = v216 + 0.2;
if ( a6 )
{
cocos2d::CCPoint::CCPoint(&v259, a11);
v274.x = v217;
CurrencyRewardLayer::createObjects(a1, a6, v246, v274, v223);
}
if ( a8 )
{
cocos2d::CCPoint::CCPoint(&v259, a11);
v273.x = v216;
CurrencyRewardLayer::createObjects(a1, a8, a9, v273, v218);
}
a1->m_objectsAdded = 1;
cocos2d::CCNode::scheduleUpdate(a1);
v219 = v254 - 24;
if ( v254 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v227 = (unsigned int *)(v254 - 8);
do
v228 = __ldaxr(v227);
while ( __stlxr(v228 - 1, v227) );
}
else
{
v228 = *((_DWORD *)v254 - 2);
*((_DWORD *)v254 - 2) = v228 - 1;
}
if ( v228 <= 0 )
operator delete(v219);
}
v220 = v253 - 24;
if ( v253 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v224 = (unsigned int *)(v253 - 8);
do
v225 = __ldaxr(v224);
while ( __stlxr(v225 - 1, v224) );
}
else
{
v225 = *((_DWORD *)v253 - 2);
*((_DWORD *)v253 - 2) = v225 - 1;
}
if ( v225 <= 0 )
operator delete(v220);
}
}
return v247;
}