//
// CurrencyRewardLayer::init from 0x4d21d4 to 0x4d36be (5354 bytes)
//
// 1 xrefs:
// > CurrencyRewardLayer::create @ 0x4d3814
//
// 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 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)
{
CurrencySpriteType v14; // r5
cocos2d::CCDirector *v15; // r0
cocos2d::CCTextureCache *v16; // r0
cocos2d::CCTexture2D *v17; // r6
cocos2d::CCSpriteBatchNode *v18; // r0
cocos2d::CCSpriteBatchNode_vtbl *v19; // r3
cocos2d::CCSpriteBatchNode *v20; // r0
CurrencyRewardLayer_vtbl *v21; // r3
cocos2d::CCNode *v22; // r0
cocos2d::CCNode_vtbl *v23; // r3
GameStatsManager *v24; // r0
GameStatsManager *v25; // r0
GameStatsManager *v26; // r0
GameStatsManager *v27; // r0
GameStatsManager *v28; // r0
GameStatsManager *v29; // r0
cocos2d::CCString *v30; // r0
cocos2d::CCLabelBMFont *v31; // r0
cocos2d::CCLabelBMFont *m_orbsLabel; // r7
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v34; // r0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
cocos2d::CCLabelBMFont *v36; // r6
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCSize *v38; // r0
float v39; // s14
cocos2d::CCLabelBMFont *v40; // r0
float (__fastcall *getScale)(cocos2d::CCNode *__hidden); // r3
float v42; // r0
int v43; // r2
bool v44; // r3
cocos2d::CCSprite *v45; // r6
void (__fastcall *v46)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v47; // r11
cocos2d::CCNode *m_mainNode; // r9
const cocos2d::CCPoint *v49; // r0
int v50; // r2
bool v51; // r3
cocos2d::CCSequence *v52; // r7
cocos2d::CCTintTo *v53; // r0
cocos2d::CCActionInterval *v54; // r0
cocos2d::CCRepeatForever *v55; // r0
bool v56; // r2
cocos2d::CCParticleSystem *v57; // r7
void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *setEndColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *setStartColorVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r2
void (__fastcall *setEndColorVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r3
void (__fastcall *setPosVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v63)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v64; // r0
cocos2d::CCString *v65; // r0
cocos2d::CCLabelBMFont *v66; // r0
cocos2d::CCLabelBMFont *m_starsLabel; // r7
void (__fastcall *v68)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v69; // r0
void (__fastcall *v70)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r3
cocos2d::CCLabelBMFont *v71; // r6
void (__fastcall *v72)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCSize *v73; // r0
float v74; // s14
cocos2d::CCLabelBMFont *v75; // r0
float (__fastcall *v76)(cocos2d::CCNode *__hidden); // r3
float v77; // r0
int v78; // r2
int v79; // r2
bool v80; // r3
cocos2d::CCSprite *v81; // r6
void (__fastcall *v82)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v83; // r11
cocos2d::CCNode *v84; // r9
const cocos2d::CCPoint *v85; // r0
int v86; // r2
bool v87; // r3
cocos2d::CCSequence *v88; // r7
cocos2d::CCTintTo *v89; // r0
cocos2d::CCActionInterval *v90; // r0
cocos2d::CCRepeatForever *v91; // r0
bool v92; // r2
cocos2d::CCParticleSystem *v93; // r7
void (__fastcall *v94)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *v95)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *v96)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r2
void (__fastcall *v97)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r3
void (__fastcall *v98)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v99)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v100; // r0
cocos2d::CCString *v101; // r0
cocos2d::CCLabelBMFont *v102; // r0
cocos2d::CCLabelBMFont *m_moonsLabel; // r7
void (__fastcall *v104)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v105; // r0
void (__fastcall *v106)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
cocos2d::CCLabelBMFont *v107; // r6
void (__fastcall *v108)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCSize *v109; // r0
float v110; // s14
cocos2d::CCLabelBMFont *v111; // r0
float (__fastcall *v112)(cocos2d::CCNode *__hidden); // r3
float v113; // r0
int v114; // r2
int v115; // r2
bool v116; // r3
cocos2d::CCSprite *v117; // r6
void (__fastcall *v118)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v119; // r11
cocos2d::CCNode *v120; // r9
const cocos2d::CCPoint *v121; // r0
int v122; // r2
bool v123; // r3
cocos2d::CCSequence *v124; // r7
cocos2d::CCTintTo *v125; // r0
cocos2d::CCActionInterval *v126; // r0
cocos2d::CCRepeatForever *v127; // r0
bool v128; // r2
cocos2d::CCParticleSystem *v129; // r7
void (__fastcall *v130)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *v131)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *v132)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r2
void (__fastcall *v133)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r3
void (__fastcall *v134)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v135)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v136; // r0
cocos2d::CCString *v137; // r0
cocos2d::CCLabelBMFont *v138; // r0
cocos2d::CCLabelBMFont *m_diamondsLabel; // r7
void (__fastcall *v140)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v141; // r0
void (__fastcall *v142)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
cocos2d::CCLabelBMFont *v143; // r6
void (__fastcall *v144)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCSize *v145; // r0
float v146; // s14
cocos2d::CCLabelBMFont *v147; // r0
float (__fastcall *v148)(cocos2d::CCNode *__hidden); // r3
float v149; // r0
int v150; // r2
int v151; // r2
bool v152; // r3
cocos2d::CCSprite *v153; // r6
void (__fastcall *v154)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v155; // r11
cocos2d::CCNode *v156; // r9
const cocos2d::CCPoint *v157; // r0
int v158; // r2
bool v159; // r3
bool v160; // r2
cocos2d::CCParticleSystem *v161; // r7
void (__fastcall *v162)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *v163)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r9
void (__fastcall *v164)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r2
void (__fastcall *v165)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r3
void (__fastcall *v166)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v167)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v168; // r0
cocos2d::CCString *v169; // r0
cocos2d::CCLabelBMFont *v170; // r0
cocos2d::CCLabelBMFont *m_keysLabel; // r7
void (__fastcall *v172)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v173; // r0
void (__fastcall *v174)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
cocos2d::CCLabelBMFont *v175; // r6
void (__fastcall *v176)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCSize *v177; // r0
float v178; // s14
cocos2d::CCLabelBMFont *v179; // r0
float (__fastcall *v180)(cocos2d::CCNode *__hidden); // r3
float v181; // r0
int v182; // r2
int v183; // r2
bool v184; // r3
CurrencySprite *v185; // r6
void (__fastcall *v186)(CCSpritePlus *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v187; // r11
void (__fastcall *setScale)(CCSpritePlus *__hidden, float); // r8
float v189; // r1
CurrencySprite_vtbl *v190; // r3
cocos2d::CCNode *v191; // r8
const cocos2d::CCPoint *v192; // r0
int v193; // r2
bool v194; // r3
cocos2d::CCString *v195; // r0
cocos2d::CCLabelBMFont *v196; // r0
cocos2d::CCLabelBMFont *m_shardsLabel; // r7
void (__fastcall *v198)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
void (*v199)(void); // r2
cocos2d::CCLabelBMFont *v200; // r6
void (__fastcall *v201)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCSize *v202; // r0
float v203; // s14
cocos2d::CCLabelBMFont *v204; // r0
float (__fastcall *v205)(cocos2d::CCNode *__hidden); // r3
float v206; // r0
int v207; // r2
int v208; // r2
bool v209; // r3
CurrencySprite *v210; // r6
void (__fastcall *v211)(CCSpritePlus *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v212; // r11
void (__fastcall *v213)(CCSpritePlus *__hidden, float); // r8
float v214; // r1
CurrencySprite_vtbl *v215; // r3
cocos2d::CCNode *v216; // r8
const cocos2d::CCPoint *v217; // r0
int v218; // r2
bool v219; // r3
const cocos2d::CCPoint *v220; // r0
cocos2d::CCNode *v221; // r6
void (__fastcall *v222)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v223; // r10
cocos2d::CCMoveTo *v224; // r0
cocos2d::CCEaseInOut *v225; // r0
cocos2d::CCAction *v226; // r0
cocos2d::CCArray *v227; // r0
float v228; // s19
float v229; // s15
float v230; // s15
int v231; // r6
float v232; // s16
float v233; // s18
float v235; // [sp+4h] [bp-78h]
float v236; // [sp+4h] [bp-78h]
float v237; // [sp+4h] [bp-78h]
float v238; // [sp+4h] [bp-78h]
float v239; // [sp+4h] [bp-78h]
_BOOL4 v243; // [sp+18h] [bp-64h]
char *v244; // [sp+24h] [bp-58h] BYREF
char *v245; // [sp+28h] [bp-54h] BYREF
cocos2d::CCSize v246; // [sp+2Ch] [bp-50h] BYREF
int v247; // [sp+34h] [bp-48h]
int v248; // [sp+38h] [bp-44h]
cocos2d::CCPoint v249; // [sp+3Ch] [bp-40h] BYREF
cocos2d::CCSize v250; // [sp+44h] [bp-38h] BYREF
cocos2d::CCPoint v251; // [sp+4Ch] [bp-30h] BYREF
cocos2d::CCPoint v252; // [sp+54h] [bp-28h] BYREF
cocos2d::CCPoint v253; // [sp+5Ch] [bp-20h] BYREF
cocos2d::CCPoint v254[2]; // [sp+64h] [bp-18h] BYREF
cocos2d::CCPoint v255; // 0:r3.4,4:^0.4
cocos2d::CCPoint v256; // 0:r3.4,4:^0.4
cocos2d::CCPoint v257; // 0:r3.4,4:^0.4
cocos2d::CCPoint v258; // 0:r3.4,4:^0.4
cocos2d::CCPoint v259; // 0:r3.4,4:^0.4
cocos2d::CCPoint v260; // 0:r3.4,4:^0.4
v14 = a6;
v243 = cocos2d::CCLayer::init(a1);
if ( v243 )
{
a1->m_time = a12;
a1->m_rewardType = LODWORD(a10.y);
if ( a6 && a6 == a8 )
{
a7 += a9;
a9 = 0;
a8 = Icon;
}
v15 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v246, v15);
v16 = cocos2d::CCTextureCache::sharedTextureCache();
v17 = cocos2d::CCTextureCache::addImage(v16, "GJ_GameSheet03.png", 0);
v18 = cocos2d::CCSpriteBatchNode::createWithTexture(v17, (unsigned int)&dword_1C + 1);
a1->m_orbBatchNode = v18;
v19 = v18->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v247 = 770;
v248 = 1;
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, int, int))v19->setBlendFunc)(v18, 770, 1);
a1->addChild_0(a1, a1->m_orbBatchNode, 1);
v20 = cocos2d::CCSpriteBatchNode::createWithTexture(v17, (unsigned int)&dword_1C + 1);
v21 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_currencyBatchNode = v20;
v21->addChild_0(a1, v20, 2);
v22 = cocos2d::CCNode::create();
v23 = v22->__vftable;
a1->m_mainNode = v22;
v23->setContentSize(v22, &stru_AC6D5C);
a1->addChild_0(a1, a1->m_mainNode, 4);
cocos2d::CCPoint::CCPoint(&v249, v246.width - 40.0, (float)(v246.height - 5.0) + *(float *)&a11);
a1->m_mainNode->setPosition(a1->m_mainNode, &v249);
v24 = GameStatsManager::sharedState();
a1->m_orbs = GameStatsManager::getStat(v24, "14") - a2;
v25 = GameStatsManager::sharedState();
a1->m_stars = GameStatsManager::getStat(v25, "6") - a3;
v26 = GameStatsManager::sharedState();
a1->m_moons = GameStatsManager::getStat(v26, "28") - a4;
v27 = GameStatsManager::sharedState();
a1->m_diamonds = GameStatsManager::getStat(v27, "13") - a5;
CurrencySprite::spriteTypeToStat((int)&v244, a6);
if ( *((_DWORD *)v244 - 3) )
{
v28 = GameStatsManager::sharedState();
a1->m_keys = GameStatsManager::getStat(v28, v244) - a7;
}
else
{
v14 = Icon;
}
CurrencySprite::spriteTypeToStat((int)&v245, a8);
if ( *((_DWORD *)v245 - 3) )
{
v29 = GameStatsManager::sharedState();
a1->m_shards = GameStatsManager::getStat(v29, v245) - a9;
}
else
{
a8 = Icon;
}
a1->m_rewardCount = 0;
if ( a2 > 0 )
{
v30 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a1->m_orbs);
cocos2d::CCString::getCString(v30);
v31 = cocos2d::CCLabelBMFont::create();
a1->m_orbsLabel = v31;
a1->m_mainNode->addChild_0(a1->m_mainNode, v31, 10);
m_orbsLabel = a1->m_orbsLabel;
setAnchorPoint = m_orbsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(v254, 1.0, 1.0);
setAnchorPoint(m_orbsLabel, v254);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_orbsLabel->setScale)(a1->m_orbsLabel, 1058642330);
v34 = a1->m_orbsLabel;
setColor = v34->setColor;
LOWORD(v254[0].x) = -106;
BYTE2(v254[0].x) = -1;
setColor(v34, (const cocos2d::ccColor3B *)v254);
v36 = a1->m_orbsLabel;
setPosition = v36->setPosition;
cocos2d::CCPoint::CCPoint(v254, 0.0, (float)(-30 * a1->m_rewardCount));
setPosition(v36, v254);
v38 = a1->m_orbsLabel->getContentSize(a1->m_orbsLabel);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v252, v38);
v39 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->getScale)(a1->m_orbsLabel));
v40 = a1->m_orbsLabel;
getScale = v40->getScale;
v252.x = v252.x * v39;
v42 = getScale(v40);
v252.y = v42 * v252.y;
cocos2d::CCPoint::CCPoint(&v253, -(float)(v252.x * 0.5), -(float)(v252.y * 0.5));
cocos2d::CCPoint::operator+(v254, &v249, &v253);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_orbsPosition, COERCE_FLOAT(v254), v43, v44);
++a1->m_rewardCount;
v45 = cocos2d::CCSprite::createWithSpriteFrameName("currencyOrbIcon_001.png");
a1->m_mainNode->addChild_0(a1->m_mainNode, v45, 3);
v46 = v45->setPosition;
v47 = a1->m_orbsLabel->getPosition(a1->m_orbsLabel);
cocos2d::CCPoint::CCPoint(&v253, 15.0, -0.5 - (float)(v252.y * 0.5));
cocos2d::CCPoint::operator+(v254, v47, &v253);
v46(v45, v254);
m_mainNode = a1->m_mainNode;
v49 = v45->getPosition(v45);
cocos2d::CCNode::convertToWorldSpace(v254, m_mainNode, v49);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_orbsPosition, COERCE_FLOAT(v254), v50, v51);
a1->m_orbsSprite = v45;
v52 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(0.3, 0, 0xFFu, 0xFFu);
v53 = cocos2d::CCTintTo::create(0.3, 0x96u, 0xFFu, 0xFFu);
v54 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v52, v53, 0);
v55 = cocos2d::CCRepeatForever::create(v54);
cocos2d::CCNode::runAction(a1->m_orbsLabel, v55);
v57 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v56);
v57->setTotalParticles(v57, 8u);
setStartColor = v57->setStartColor;
memset(v254, 0, sizeof(v254));
v254[1].y = 1.0;
v254[1].x = 1.0;
v254[0].y = 0.78431;
setStartColor(v57, (const cocos2d::ccColor4F *)v254);
setEndColor = v57->setEndColor;
memset(v254, 0, sizeof(v254));
v254[1].y = 1.0;
v254[1].x = 0.58824;
setEndColor(v57, (const cocos2d::ccColor4F *)v254);
setStartColorVar = v57->setStartColorVar;
memset(v254, 0, sizeof(v254));
setStartColorVar(v57, (const cocos2d::ccColor4F *)v254);
setEndColorVar = v57->setEndColorVar;
memset(v254, 0, sizeof(v254));
setEndColorVar(v57, (const cocos2d::ccColor4F *)v254);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v57->setLife)(v57, 1065353216);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v57->setLifeVar)(v57, 1045220557);
setPosVar = v57->setPosVar;
cocos2d::CCPoint::CCPoint(v254, 12.0, 10.0);
setPosVar(v57, v254);
a1->m_mainNode->addChild_0(a1->m_mainNode, v57, 100);
v63 = v57->setPosition;
v64 = (int)v45->getPosition(v45);
v63(v57, (const cocos2d::CCPoint *)v64);
v57->setPositionType(v57, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v57);
}
if ( a3 > 0 )
{
v65 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a1->m_stars);
cocos2d::CCString::getCString(v65);
v66 = cocos2d::CCLabelBMFont::create();
a1->m_starsLabel = v66;
a1->m_mainNode->addChild_0(a1->m_mainNode, v66, 10);
m_starsLabel = a1->m_starsLabel;
v68 = m_starsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(v254, 1.0, 1.0);
v68(m_starsLabel, v254);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_starsLabel->setScale)(a1->m_starsLabel, 1058642330);
v69 = a1->m_starsLabel;
v70 = v69->setColor;
LOWORD(v254[0].x) = -14081;
BYTE2(v254[0].x) = 0;
v70(v69, (const cocos2d::ccColor3B *)v254);
v71 = a1->m_starsLabel;
v72 = v71->setPosition;
cocos2d::CCPoint::CCPoint(v254, 0.0, (float)(-30 * a1->m_rewardCount));
v72(v71, v254);
v73 = a1->m_starsLabel->getContentSize(a1->m_starsLabel);
cocos2d::CCSize::CCSize(&v250, v73);
v74 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_starsLabel->getScale)(a1->m_starsLabel));
v75 = a1->m_starsLabel;
v76 = v75->getScale;
v250.width = v250.width * v74;
v77 = v76(v75);
v78 = -30 * a1->m_rewardCount;
v250.height = v250.height * v77;
cocos2d::CCPoint::CCPoint(&v251, 0.0, (float)v78);
cocos2d::CCPoint::operator+(&v252, &v249, &v251);
cocos2d::CCPoint::CCPoint(&v253, -(float)(v250.width * 0.5), -(float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, &v252, &v253);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_starsPosition, COERCE_FLOAT(v254), v79, v80);
++a1->m_rewardCount;
v81 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigStar_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v81->setScale)(v81, 1056964608);
a1->m_mainNode->addChild_0(a1->m_mainNode, v81, 3);
v82 = v81->setPosition;
v83 = a1->m_starsLabel->getPosition(a1->m_starsLabel);
cocos2d::CCPoint::CCPoint(&v253, 15.0, -0.5 - (float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, v83, &v253);
v82(v81, v254);
v84 = a1->m_mainNode;
v85 = v81->getPosition(v81);
cocos2d::CCNode::convertToWorldSpace(v254, v84, v85);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_starsPosition, COERCE_FLOAT(v254), v86, v87);
a1->m_starsSprite = v81;
v88 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(0.3, 0xFFu, 0xFFu, 0);
v89 = cocos2d::CCTintTo::create(0.3, 0xFFu, 0xC8u, 0);
v90 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v88, v89, 0);
v91 = cocos2d::CCRepeatForever::create(v90);
cocos2d::CCNode::runAction(a1->m_starsLabel, v91);
v93 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v92);
v93->setTotalParticles(v93, 8u);
v94 = v93->setStartColor;
memset(v254, 0, sizeof(v254));
v254[1].y = 1.0;
v254[0].x = 1.0;
v254[0].y = 1.0;
v94(v93, (const cocos2d::ccColor4F *)v254);
v95 = v93->setEndColor;
memset(v254, 0, sizeof(v254));
v254[1].y = 1.0;
v254[0].x = 0.78431;
v95(v93, (const cocos2d::ccColor4F *)v254);
v96 = v93->setStartColorVar;
memset(v254, 0, sizeof(v254));
v96(v93, (const cocos2d::ccColor4F *)v254);
v97 = v93->setEndColorVar;
memset(v254, 0, sizeof(v254));
v97(v93, (const cocos2d::ccColor4F *)v254);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v93->setLife)(v93, 1065353216);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v93->setLifeVar)(v93, 1045220557);
v98 = v93->setPosVar;
cocos2d::CCPoint::CCPoint(v254, 12.0, 10.0);
v98(v93, v254);
a1->m_mainNode->addChild_0(a1->m_mainNode, v93, 100);
v99 = v93->setPosition;
v100 = (int)v81->getPosition(v81);
v99(v93, (const cocos2d::CCPoint *)v100);
v93->setPositionType(v93, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v93);
}
if ( a4 > 0 )
{
v101 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a1->m_moons);
cocos2d::CCString::getCString(v101);
v102 = cocos2d::CCLabelBMFont::create();
a1->m_moonsLabel = v102;
a1->m_mainNode->addChild_0(a1->m_mainNode, v102, 10);
m_moonsLabel = a1->m_moonsLabel;
v104 = m_moonsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(v254, 1.0, 1.0);
v104(m_moonsLabel, v254);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_moonsLabel->setScale)(a1->m_moonsLabel, 1058642330);
v105 = a1->m_moonsLabel;
v106 = v105->setColor;
LOWORD(v254[0].x) = -256;
BYTE2(v254[0].x) = -1;
v106(v105, (const cocos2d::ccColor3B *)v254);
v107 = a1->m_moonsLabel;
v108 = v107->setPosition;
cocos2d::CCPoint::CCPoint(v254, 0.0, (float)(-30 * a1->m_rewardCount));
v108(v107, v254);
v109 = a1->m_moonsLabel->getContentSize(a1->m_moonsLabel);
cocos2d::CCSize::CCSize(&v250, v109);
v110 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_moonsLabel->getScale)(a1->m_moonsLabel));
v111 = a1->m_moonsLabel;
v112 = v111->getScale;
v250.width = v250.width * v110;
v113 = v112(v111);
v114 = -30 * a1->m_rewardCount;
v250.height = v250.height * v113;
cocos2d::CCPoint::CCPoint(&v251, 0.0, (float)v114);
cocos2d::CCPoint::operator+(&v252, &v249, &v251);
cocos2d::CCPoint::CCPoint(&v253, -(float)(v250.width * 0.5), -(float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, &v252, &v253);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_moonsPosition, COERCE_FLOAT(v254), v115, v116);
++a1->m_rewardCount;
v117 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigMoon_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v117->setScale)(v117, 1056964608);
a1->m_mainNode->addChild_0(a1->m_mainNode, v117, 3);
v118 = v117->setPosition;
v119 = a1->m_moonsLabel->getPosition(a1->m_moonsLabel);
cocos2d::CCPoint::CCPoint(&v253, 15.0, -0.5 - (float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, v119, &v253);
v118(v117, v254);
v120 = a1->m_mainNode;
v121 = v117->getPosition(v117);
cocos2d::CCNode::convertToWorldSpace(v254, v120, v121);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_moonsPosition, COERCE_FLOAT(v254), v122, v123);
a1->m_moonsSprite = v117;
v124 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(0.3, 0, 0xFFu, 0xFFu);
v125 = cocos2d::CCTintTo::create(0.3, 0, 0xC8u, 0xFFu);
v126 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v124, v125, 0);
v127 = cocos2d::CCRepeatForever::create(v126);
cocos2d::CCNode::runAction(a1->m_moonsLabel, v127);
v129 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v128);
v129->setTotalParticles(v129, 8u);
v130 = v129->setStartColor;
memset(v254, 0, sizeof(v254));
v254[1].y = 1.0;
v254[0].y = 1.0;
v254[1].x = 1.0;
v130(v129, (const cocos2d::ccColor4F *)v254);
v131 = v129->setEndColor;
memset(v254, 0, sizeof(v254));
v254[1].y = 1.0;
v254[1].x = 0.78431;
v131(v129, (const cocos2d::ccColor4F *)v254);
v132 = v129->setStartColorVar;
memset(v254, 0, sizeof(v254));
v132(v129, (const cocos2d::ccColor4F *)v254);
v133 = v129->setEndColorVar;
memset(v254, 0, sizeof(v254));
v133(v129, (const cocos2d::ccColor4F *)v254);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v129->setLife)(v129, 1065353216);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v129->setLifeVar)(v129, 1045220557);
v134 = v129->setPosVar;
cocos2d::CCPoint::CCPoint(v254, 12.0, 10.0);
v134(v129, v254);
a1->m_mainNode->addChild_0(a1->m_mainNode, v129, 100);
v135 = v129->setPosition;
v136 = (int)v117->getPosition(v117);
v135(v129, (const cocos2d::CCPoint *)v136);
v129->setPositionType(v129, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v129);
}
if ( a5 > 0 )
{
v137 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a1->m_diamonds);
cocos2d::CCString::getCString(v137);
v138 = cocos2d::CCLabelBMFont::create();
a1->m_diamondsLabel = v138;
a1->m_mainNode->addChild_0(a1->m_mainNode, v138, 10);
m_diamondsLabel = a1->m_diamondsLabel;
v140 = m_diamondsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(v254, 1.0, 1.0);
v140(m_diamondsLabel, v254);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_diamondsLabel->setScale)(
a1->m_diamondsLabel,
1058642330);
v141 = a1->m_diamondsLabel;
v142 = v141->setColor;
LOWORD(v254[0].x) = -1;
BYTE2(v254[0].x) = -1;
v142(v141, (const cocos2d::ccColor3B *)v254);
v143 = a1->m_diamondsLabel;
v144 = v143->setPosition;
cocos2d::CCPoint::CCPoint(v254, 0.0, (float)(-30 * a1->m_rewardCount));
v144(v143, v254);
v145 = a1->m_diamondsLabel->getContentSize(a1->m_diamondsLabel);
cocos2d::CCSize::CCSize(&v250, v145);
v146 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_diamondsLabel->getScale)(a1->m_diamondsLabel));
v147 = a1->m_diamondsLabel;
v148 = v147->getScale;
v250.width = v250.width * v146;
v149 = v148(v147);
v150 = -30 * a1->m_rewardCount;
v250.height = v250.height * v149;
cocos2d::CCPoint::CCPoint(&v251, 0.0, (float)v150);
cocos2d::CCPoint::operator+(&v252, &v249, &v251);
cocos2d::CCPoint::CCPoint(&v253, -(float)(v250.width * 0.5), -(float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, &v252, &v253);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_diamondsPosition, COERCE_FLOAT(v254), v151, v152);
++a1->m_rewardCount;
v153 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigDiamond_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v153->setScale)(v153, 1056964608);
a1->m_mainNode->addChild_0(a1->m_mainNode, v153, 3);
v154 = v153->setPosition;
v155 = a1->m_diamondsLabel->getPosition(a1->m_diamondsLabel);
cocos2d::CCPoint::CCPoint(&v253, 15.0, -0.5 - (float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, v155, &v253);
v154(v153, v254);
v156 = a1->m_mainNode;
v157 = v153->getPosition(v153);
cocos2d::CCNode::convertToWorldSpace(v254, v156, v157);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_diamondsPosition, COERCE_FLOAT(v254), v158, v159);
a1->m_diamondsSprite = v153;
v161 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"keyEffect.plist",
nullptr,
v160);
v161->setTotalParticles(v161, 8u);
v162 = v161->setStartColor;
v254[1].y = 1.0;
v254[0].x = 1.0;
v254[0].y = 1.0;
v254[1].x = 1.0;
v162(v161, (const cocos2d::ccColor4F *)v254);
v163 = v161->setEndColor;
v254[1].y = 1.0;
v254[0].y = 1.0;
v254[0].x = 0.58824;
v254[1].x = 1.0;
v163(v161, (const cocos2d::ccColor4F *)v254);
v164 = v161->setStartColorVar;
memset(v254, 0, sizeof(v254));
v164(v161, (const cocos2d::ccColor4F *)v254);
v165 = v161->setEndColorVar;
memset(v254, 0, sizeof(v254));
v165(v161, (const cocos2d::ccColor4F *)v254);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v161->setLife)(v161, 1065353216);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v161->setLifeVar)(v161, 1045220557);
v166 = v161->setPosVar;
cocos2d::CCPoint::CCPoint(v254, 12.0, 10.0);
v166(v161, v254);
a1->m_mainNode->addChild_0(a1->m_mainNode, v161, 100);
v167 = v161->setPosition;
v168 = (int)v153->getPosition(v153);
v167(v161, (const cocos2d::CCPoint *)v168);
v161->setPositionType(v161, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v161);
}
if ( v14 > Icon )
{
v169 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a1->m_keys);
cocos2d::CCString::getCString(v169);
v170 = cocos2d::CCLabelBMFont::create();
a1->m_keysLabel = v170;
a1->m_mainNode->addChild_0(a1->m_mainNode, v170, 10);
m_keysLabel = a1->m_keysLabel;
v172 = m_keysLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(v254, 1.0, 1.0);
v172(m_keysLabel, v254);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_keysLabel->setScale)(a1->m_keysLabel, 1058642330);
v173 = a1->m_keysLabel;
v174 = v173->setColor;
LOWORD(v254[0].x) = -1;
BYTE2(v254[0].x) = -1;
v174(v173, (const cocos2d::ccColor3B *)v254);
v175 = a1->m_keysLabel;
v176 = v175->setPosition;
cocos2d::CCPoint::CCPoint(v254, 0.0, (float)(-30 * a1->m_rewardCount));
v176(v175, v254);
a1->m_keysLabel->setTag(a1->m_keysLabel, v14);
v177 = a1->m_keysLabel->getContentSize(a1->m_keysLabel);
cocos2d::CCSize::CCSize(&v250, v177);
v178 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_keysLabel->getScale)(a1->m_keysLabel));
v179 = a1->m_keysLabel;
v180 = v179->getScale;
v250.width = v250.width * v178;
v181 = v180(v179);
v182 = -30 * a1->m_rewardCount;
v250.height = v250.height * v181;
cocos2d::CCPoint::CCPoint(&v251, 0.0, (float)v182);
cocos2d::CCPoint::operator+(&v252, &v249, &v251);
cocos2d::CCPoint::CCPoint(&v253, -(float)(v250.width * 0.5), -(float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, &v252, &v253);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_keysPosition, COERCE_FLOAT(v254), v183, v184);
++a1->m_rewardCount;
v185 = CurrencySprite::create(v14, 1);
a1->m_mainNode->addChild_0(a1->m_mainNode, v185, 3);
v186 = v185->setPosition;
v187 = a1->m_keysLabel->getPosition(a1->m_keysLabel);
cocos2d::CCPoint::CCPoint(&v253, 15.0, -0.5 - (float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, v187, &v253);
v186(v185, v254);
setScale = v185->setScale;
if ( isSpecialCurrencyType(v14) )
v189 = 0.65;
else
v189 = 0.5;
((void (__fastcall *)(CurrencySprite *, _DWORD))setScale)(v185, LODWORD(v189));
v190 = v185->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_keysSprite = v185;
v191 = a1->m_mainNode;
v192 = v190->getPosition(v185);
cocos2d::CCNode::convertToWorldSpace(v254, v191, v192);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_keysPosition, COERCE_FLOAT(v254), v193, v194);
}
if ( a8 > Icon )
{
v195 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a1->m_shards);
cocos2d::CCString::getCString(v195);
v196 = cocos2d::CCLabelBMFont::create();
a1->m_shardsLabel = v196;
a1->m_mainNode->addChild_0(a1->m_mainNode, v196, 10);
m_shardsLabel = a1->m_shardsLabel;
v198 = m_shardsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(v254, 1.0, 1.0);
v198(m_shardsLabel, v254);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_shardsLabel->setScale)(a1->m_shardsLabel, 1058642330);
v199 = (void (*)(void))a1->m_shardsLabel->setColor;
LOBYTE(v254[0].x) = -1;
*(_WORD *)((char *)&v254[0].x + 1) = -1;
v199();
v200 = a1->m_shardsLabel;
v201 = v200->setPosition;
cocos2d::CCPoint::CCPoint(v254, 0.0, (float)(-30 * a1->m_rewardCount));
v201(v200, v254);
a1->m_shardsLabel->setTag(a1->m_shardsLabel, a8);
v202 = a1->m_shardsLabel->getContentSize(a1->m_shardsLabel);
cocos2d::CCSize::CCSize(&v250, v202);
v203 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_shardsLabel->getScale)(a1->m_shardsLabel));
v204 = a1->m_shardsLabel;
v205 = v204->getScale;
v250.width = v250.width * v203;
v206 = v205(v204);
v207 = -30 * a1->m_rewardCount;
v250.height = v250.height * v206;
cocos2d::CCPoint::CCPoint(&v251, 0.0, (float)v207);
cocos2d::CCPoint::operator+(&v252, &v249, &v251);
cocos2d::CCPoint::CCPoint(&v253, -(float)(v250.width * 0.5), -(float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, &v252, &v253);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_shardsPosition, COERCE_FLOAT(v254), v208, v209);
++a1->m_rewardCount;
v210 = CurrencySprite::create(a8, 1);
a1->m_mainNode->addChild_0(a1->m_mainNode, v210, 3);
v211 = v210->setPosition;
v212 = a1->m_shardsLabel->getPosition(a1->m_shardsLabel);
cocos2d::CCPoint::CCPoint(&v253, 15.0, -0.5 - (float)(v250.height * 0.5));
cocos2d::CCPoint::operator+(v254, v212, &v253);
v211(v210, v254);
v213 = v210->setScale;
if ( isSpecialCurrencyType(a8) )
v214 = 0.65;
else
v214 = 0.5;
((void (__fastcall *)(CurrencySprite *, _DWORD))v213)(v210, LODWORD(v214));
v215 = v210->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_shardsSprite = v210;
v216 = a1->m_mainNode;
v217 = v215->getPosition(v210);
cocos2d::CCNode::convertToWorldSpace(v254, v216, v217);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_shardsPosition, COERCE_FLOAT(v254), v218, v219);
}
v220 = a1->m_mainNode->getPosition(a1->m_mainNode);
cocos2d::CCPoint::CCPoint(&v252, v220);
v221 = a1->m_mainNode;
v222 = v221->setPosition;
v223 = (int)v221->getPosition(v221);
cocos2d::CCPoint::CCPoint(&v253, 0.0, (float)(30 * (a1->m_rewardCount - 1) + 40));
cocos2d::CCPoint::operator+(v254, v223, &v253);
v222(v221, v254);
v224 = cocos2d::CCMoveTo::create(a12 * 0.5, &v252);
v225 = cocos2d::CCEaseInOut::create(v224, 2.0);
v226 = cocos2d::CCNode::runAction(a1->m_mainNode, v225);
v227 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v226);
a1->m_objects = v227;
cocos2d::CCObject::retain(v227);
v228 = a12 * 0.2;
cocos2d::CCPoint::CCPoint(v254, (const cocos2d::CCPoint *)LODWORD(a10.x));
v255.y = 0.0;
LODWORD(v255.x) = v254;
CurrencyRewardLayer::createObjects(a1, Orb, a2, v255, v235);
cocos2d::CCPoint::CCPoint(v254, (const cocos2d::CCPoint *)LODWORD(a10.x));
v229 = 0.0;
LODWORD(v256.x) = v254;
if ( a2 > 0 )
v229 = a12 * 0.2;
v256.y = v229;
CurrencyRewardLayer::createObjects(a1, Star, a3, v256, v236);
cocos2d::CCPoint::CCPoint(v254, (const cocos2d::CCPoint *)LODWORD(a10.x));
v230 = 0.0;
LODWORD(v257.x) = v254;
if ( a2 > 0 )
v230 = a12 * 0.2;
v257.y = v230;
CurrencyRewardLayer::createObjects(a1, Moon, a4, v257, v237);
cocos2d::CCPoint::CCPoint(v254, (const cocos2d::CCPoint *)LODWORD(a10.x));
v231 = (a4 > 0) + (a3 > 0) + (a2 > 0);
LODWORD(v258.x) = v254;
v258.y = v228 * (float)v231;
CurrencyRewardLayer::createObjects(a1, Star|Orb, a5, v258, v238);
if ( a5 > 0 )
++v231;
v232 = (float)((float)(v228 * (float)v231) + 0.1) * a12;
if ( isSpecialCurrencyType(v14) )
v233 = v232 + 0.2;
else
v233 = (float)((float)(v228 * (float)v231) + 0.1) * a12;
if ( isSpecialCurrencyType(a8) )
v232 = v232 + 0.2;
if ( v14 )
{
cocos2d::CCPoint::CCPoint(v254, (const cocos2d::CCPoint *)LODWORD(a10.x));
v259.y = v233;
LODWORD(v259.x) = v254;
CurrencyRewardLayer::createObjects(a1, v14, a7, v259, v239);
}
if ( a8 )
{
cocos2d::CCPoint::CCPoint(v254, (const cocos2d::CCPoint *)LODWORD(a10.x));
v260.y = v232;
LODWORD(v260.x) = v254;
CurrencyRewardLayer::createObjects(a1, a8, a9, v260, v239);
}
a1->m_objectsAdded = 1;
cocos2d::CCNode::scheduleUpdate(a1);
sub_774008(&v245);
sub_774008(&v244);
}
return v243;
}