//
// SecretRewardsLayer::init from 0x100383140 to 0x100384a14 (6356 bytes)
//
// 1 xrefs:
// > SecretRewardsLayer::create @ 0x1003830f4
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:03:32 +0000
//
bool __fastcall SecretRewardsLayer::init(__int64 a1, char a2)
{
_BOOL8 v4; // x21
void *v5; // x0
_DWORD *v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
__int64 UGV; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x19
void *v15; // x0
void *v16; // x19
__int64 v17; // x19
__int64 v18; // x0
void *v19; // x21
unsigned __int8 *v20; // x19
void *v21; // x0
void *v22; // x19
__int64 v23; // x1
__int64 v24; // x2
__int64 v25; // x3
__int64 v26; // x4
__int64 v27; // x5
__int64 v28; // x6
__int64 v29; // x7
__int64 v30; // x21
__int64 v31; // x0
float v32; // s8
__int64 v33; // x0
float v34; // s0
__int64 isControllerConnected; // x0
int v36; // w0
int Stat; // w0
void *v38; // x0
const char *CString; // x0
__int64 v40; // x21
__int64 v41; // x21
void *v42; // x0
__int64 v43; // x21
float32x2_t *v44; // x22
double v45; // d0
__int64 v46; // x0
int v47; // w0
int v48; // w0
void *v49; // x0
const char *v50; // x0
__int64 v51; // x19
__int64 v52; // x0
__int64 v53; // x19
void *v54; // x0
__int64 v55; // x19
float32x2_t *v56; // x21
double v57; // d0
void *v58; // x19
float *v59; // x19
_QWORD *v60; // x22
_QWORD *v61; // x24
__int64 v62; // x0
unsigned __int64 i; // x25
float v64; // s12
unsigned int v65; // w19
void *v66; // x21
__int64 v67; // x0
__int64 v68; // x23
__int64 v69; // x28
int v70; // w21
void *v71; // x0
__int64 v72; // x0
void *v73; // x19
__int64 v74; // x19
void *v75; // x0
char *v76; // x0
void *v77; // x0
char *v78; // x0
int isSpecialChestUnlocked; // w21
void *v80; // x0
const std::string::value_type *v81; // x0
std::string *v82; // x0
__int64 v83; // x21
float v84; // s12
void *v85; // x0
_QWORD *v86; // x26
_WORD *v87; // x19
float v88; // s14
__int64 v89; // x0
__int64 v90; // x0
void *v91; // x21
double v92; // d0
std::string *v93; // x0
void *v94; // x19
float32x2_t *v95; // x21
double v96; // d0
__int64 v97; // x0
__int64 v98; // x0
__int64 v99; // x21
__int64 v100; // x0
int v101; // w26
void *v102; // x0
const char *v103; // x0
__int64 v104; // x28
float32x2_t *v105; // x19
double v106; // d0
int v107; // w8
__int64 v108; // x0
__int64 v109; // x19
void *v110; // x19
double v111; // d0
__int64 v112; // x21
__int64 v113; // x21
void *v114; // x19
__int64 v115; // x21
_QWORD *v116; // x24
_WORD *v117; // x23
float v118; // s8
float v119; // s0
float v120; // s8
__int64 v121; // x0
__int64 v122; // x0
__int64 v123; // x0
__int64 v124; // x0
void *v125; // x21
double v126; // d0
void *v127; // x23
float32x2_t *v128; // x21
double v129; // d0
__int64 v130; // x0
__int64 v131; // x21
void *v132; // x21
__int64 v133; // x19
__int64 v134; // x21
const std::string::value_type *v135; // x1
std::string *v136; // x0
void *v137; // x25
char *v138; // x27
float v139; // s0
unsigned int j; // w23
std::string *p_p; // x0
void *v142; // x27
double v143; // d0
void *v144; // x0
__int64 v145; // x19
float v146; // s8
__int64 v147; // x0
float v148; // s0
__int64 v149; // x19
__int64 v150; // x0
float v151; // s8
__int64 v152; // x0
float v153; // s0
__int64 v154; // x19
__int64 v155; // x0
float v156; // s8
__int64 v157; // x1
float v158; // s9
void *v159; // x0
void *v160; // x0
__int64 v161; // x23
__int64 v162; // x0
float v163; // s0
unsigned __int8 *v164; // x22
void *v165; // x0
__int64 v166; // x21
__int64 v167; // x0
float v168; // s0
int TotalPages; // w0
int v170; // w19
char v172; // [xsp+20h] [xbp-190h]
_BOOL4 v173; // [xsp+24h] [xbp-18Ch]
float32x2_t v174; // [xsp+28h] [xbp-188h] BYREF
std::string v175; // [xsp+30h] [xbp-180h] BYREF
float32x2_t v176; // [xsp+48h] [xbp-168h] BYREF
float32x2_t v177; // [xsp+50h] [xbp-160h] BYREF
float32x2_t v178; // [xsp+58h] [xbp-158h] BYREF
std::string __str; // [xsp+60h] [xbp-150h] BYREF
void *v180[2]; // [xsp+78h] [xbp-138h] BYREF
char v181; // [xsp+8Fh] [xbp-121h]
_QWORD v182[2]; // [xsp+90h] [xbp-120h] BYREF
char v183; // [xsp+A7h] [xbp-109h]
_QWORD v184[2]; // [xsp+A8h] [xbp-108h] BYREF
char v185; // [xsp+BFh] [xbp-F1h]
std::string __p; // [xsp+C0h] [xbp-F0h] BYREF
std::string v187; // [xsp+D8h] [xbp-D8h] BYREF
float32x2_t v188; // [xsp+F0h] [xbp-C0h] BYREF
void *v189[2]; // [xsp+F8h] [xbp-B8h] BYREF
char v190; // [xsp+10Fh] [xbp-A1h]
__int64 v191; // [xsp+110h] [xbp-A0h] BYREF
v4 = cocos2d::CCLayer::init((_WORD *)a1);
if ( !v4 )
return v4;
*(_BYTE *)(a1 + 584) = 1;
v5 = cocos2d::CCTextureCache::sharedTextureCache();
v6 = cocos2d::CCTextureCache::addImage((__int64)v5, "TreasureRoomSheet.png");
v7 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v6);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v7, "TreasureRoomSheet.plist");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1072LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 1);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8, &v191);
v10 = GameManager::sharedState(v9);
UGV = GameManager::getUGV(v10, "10");
if ( (_DWORD)UGV )
*(_DWORD *)(a1 + 568) = 4;
v12 = GameManager::sharedState(UGV);
v13 = GameManager::getUGV(v12, "21");
if ( (_DWORD)v13 )
*(_DWORD *)(a1 + 572) = 3;
v14 = GameManager::sharedState(v13);
sub_100009900(v189, "secretLoop.mp3");
GameManager::fadeInMusic(v14, v189);
v173 = v4;
if ( v190 < 0 )
operator delete(v189[0]);
v172 = a2;
v15 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 424) = v15;
(*(void (__fastcall **)(__int64, void *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v15, 0);
v16 = cocos2d::CCSprite::create((__int64)"GJ_gradientBG.png");
*(_QWORD *)(a1 + 560) = v16;
sub_1000262BC((float *)&v187, 0.0, 0.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v16 + 296LL))(v16, &v187);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 464LL))(a1, *(_QWORD *)(a1 + 560), 4294967293LL);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 560) + 128LL))(
*(_QWORD *)(a1 + 560),
(float)(*(float *)&v191 + 10.0) / *(float *)(*(_QWORD *)(a1 + 560) + 432LL));
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 560) + 144LL))(
*(_QWORD *)(a1 + 560),
(float)(*((float *)&v191 + 1) + 10.0) / *(float *)(*(_QWORD *)(a1 + 560) + 436LL));
v17 = *(_QWORD *)(a1 + 560);
sub_1000262BC((float *)&v187, -5.0, -5.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v17 + 184LL))(v17, &v187);
v18 = *(_QWORD *)(a1 + 560);
v187.__r_.__value_.__s.__data_[2] = 75;
LOWORD(v187.__r_.__value_.__l.__data_) = 70;
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v18 + 960LL))(v18, &v187);
v19 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"treasureRoomSpiderweb_001.png");
sub_1000262BC((float *)&v187, 1.0, 1.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v19 + 296LL))(v19, &v187);
sub_1000262BC((float *)&v187, *(float *)&v191 + 5.0, *((float *)&v191 + 1) + 5.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v19 + 184LL))(v19, &v187);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v19 + 912LL))(v19, 63);
v187.__r_.__value_.__s.__data_[2] = 0;
LOWORD(v187.__r_.__value_.__l.__data_) = 0;
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v19 + 960LL))(v19, &v187);
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v19, 0xFFFFFFFFLL);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v19 + 160LL))(v19, 1.1);
v20 = (unsigned __int8 *)cocos2d::CCSprite::createWithSpriteFrameName((__int64)"treasureRoomSpiderweb_001.png");
sub_1000262BC((float *)&v187, 0.0, 1.0);
(*(void (__fastcall **)(unsigned __int8 *, std::string *))(*(_QWORD *)v20 + 296LL))(v20, &v187);
sub_1000262BC((float *)&v187, -5.0, *((float *)&v191 + 1) + 5.0);
(*(void (__fastcall **)(unsigned __int8 *, std::string *))(*(_QWORD *)v20 + 184LL))(v20, &v187);
(*(void (__fastcall **)(unsigned __int8 *, __int64))(*(_QWORD *)v20 + 912LL))(v20, 63);
cocos2d::CCSprite::setFlipX(v20, 1);
v187.__r_.__value_.__s.__data_[2] = 0;
LOWORD(v187.__r_.__value_.__l.__data_) = 0;
(*(void (__fastcall **)(unsigned __int8 *, std::string *))(*(_QWORD *)v20 + 960LL))(v20, &v187);
(*(void (__fastcall **)(__int64, unsigned __int8 *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v20, 0xFFFFFFFFLL);
(*(void (__fastcall **)(unsigned __int8 *, float))(*(_QWORD *)v20 + 160LL))(v20, 1.1);
v21 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_arrow_03_001.png");
*(_QWORD *)(a1 + 528) = v21;
v22 = CCMenuItemSpriteExtra::create((__int64)v21, 0, a1, (__int64)SecretRewardsLayer::onBack, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v22, 1.6);
v30 = sub_100270434((__int64)v22, v23, v24, v25, v26, v27, v28, v29, 0);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v30, 1);
v31 = cocos2d::CCDirector::sharedDirector();
v32 = sub_100207EA8(v31) + 24.0;
v33 = cocos2d::CCDirector::sharedDirector();
v34 = sub_100207E98(v33);
sub_1000262BC((float *)&v187, v32, v34 + -23.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v30 + 184LL))(v30, &v187);
isControllerConnected = PlatformToolbox::isControllerConnected();
if ( (_DWORD)isControllerConnected )
isControllerConnected = GameToolbox::addBackButton(a1, (__int64)v22);
v36 = GameStatsManager::sharedState(isControllerConnected);
Stat = GameStatsManager::getStat(v36, "21");
v38 = sub_1003065B0("%i", Stat);
CString = (const char *)cocos2d::CCString::getCString((__int64)v38);
v40 = cocos2d::CCLabelBMFont::create_1(CString, "bigFont.fnt");
*(_QWORD *)(a1 + 472) = v40;
sub_1000262BC((float *)&v187, *(float *)&v191 + -55.0, *((float *)&v191 + 1) + -18.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v40 + 184LL))(v40, &v187);
v41 = *(_QWORD *)(a1 + 472);
sub_1000262BC((float *)&v187, 1.0, 0.5);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v41 + 296LL))(v41, &v187);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 472) + 160LL))(*(_QWORD *)(a1 + 472), 0.6);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 456LL))(a1, *(_QWORD *)(a1 + 472));
v42 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_bigKey_001.png");
*(_QWORD *)(a1 + 488) = v42;
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v42, 3);
v43 = *(_QWORD *)(a1 + 488);
v44 = (float32x2_t *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 472) + 192LL))(*(_QWORD *)(a1 + 472));
sub_1000262BC((float *)&__p, 25.0, -0.5);
*(float32x2_t *)&v45 = sub_100026318(v44, (float32x2_t *)&__p, (float32x2_t *)&v187);
v46 = (*(__int64 (__fastcall **)(__int64, std::string *, double))(*(_QWORD *)v43 + 184LL))(v43, &v187, v45);
v47 = GameStatsManager::sharedState(v46);
v48 = GameStatsManager::getStat(v47, "43");
v49 = sub_1003065B0("%i", v48);
v50 = (const char *)cocos2d::CCString::getCString((__int64)v49);
v51 = cocos2d::CCLabelBMFont::create_1(v50, "bigFont.fnt");
*(_QWORD *)(a1 + 480) = v51;
v52 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 472) + 192LL))(*(_QWORD *)(a1 + 472));
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v51 + 184LL))(v51, v52);
v53 = *(_QWORD *)(a1 + 480);
sub_1000262BC((float *)&v187, 1.0, 0.5);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v53 + 296LL))(v53, &v187);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 480) + 160LL))(*(_QWORD *)(a1 + 480), 0.6);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 456LL))(a1, *(_QWORD *)(a1 + 480));
v54 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_bigGoldKey_001.png");
*(_QWORD *)(a1 + 496) = v54;
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v54, 3);
v55 = *(_QWORD *)(a1 + 496);
v56 = (float32x2_t *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 480) + 192LL))(*(_QWORD *)(a1 + 480));
sub_1000262BC((float *)&__p, 25.0, -0.5);
*(float32x2_t *)&v57 = sub_100026318(v56, (float32x2_t *)&__p, (float32x2_t *)&v187);
(*(void (__fastcall **)(__int64, std::string *, double))(*(_QWORD *)v55 + 184LL))(v55, &v187, v57);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 480) + 344LL))(*(_QWORD *)(a1 + 480), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 496) + 344LL))(*(_QWORD *)(a1 + 496), 0);
v58 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"treasureRoomLabel_001.png");
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 424) + 464LL))(*(_QWORD *)(a1 + 424), v58, 2);
sub_1000262BC((float *)&v187, *(float *)&v191 * 0.5, *((float *)&v191 + 1) + -42.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v58 + 184LL))(v58, &v187);
v59 = (float *)cocos2d::CCSprite::createWithSpriteFrameName((__int64)"treasureRoomGround_001.png");
(*(void (__fastcall **)(__int64, float *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v59, 2);
sub_1000262BC((float *)&v187, 0.0, 1.0);
(*(void (__fastcall **)(float *, std::string *))(*(_QWORD *)v59 + 296LL))(v59, &v187);
sub_1000262BC((float *)&v187, -10.0, 35.0);
(*(void (__fastcall **)(float *, std::string *))(*(_QWORD *)v59 + 184LL))(v59, &v187);
(*(void (__fastcall **)(float *, __int64))(*(_QWORD *)v59 + 1080LL))(v59, 0x100000302LL);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v59 + 160LL))(v59, (float)(*(float *)&v191 + 20.0) / v59[108]);
(*(void (__fastcall **)(float *, __int64))(*(_QWORD *)v59 + 912LL))(v59, 150);
v60 = sub_1002E736C();
v61 = sub_1002E736C();
v62 = cocos2d::CCDictionary::create(v61);
*(_QWORD *)(a1 + 464) = v62;
cocos2d::CCObject::retain(v62);
for ( i = 0; i != 9; ++i )
{
v64 = (float)(unsigned int)i / 3.0;
v65 = vcvtms_s32_f32(v64);
if ( (unsigned int)sub_1002E757C((__int64)v60) < v65 + 1 )
{
v66 = cocos2d::CCLayer::create();
v67 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v66 + 456LL))(v66, v67);
sub_1002E74E0((__int64)v60);
sub_1002E74E0((__int64)v61);
}
v68 = sub_1002E75A0((__int64)v60, v65);
v69 = sub_1002E75A0((__int64)v61, v65);
v70 = (unsigned __int8)i - 3 * ((1431655766 * (unsigned __int64)(unsigned __int8)i) >> 32);
if ( i <= 5 && !v70 )
{
v71 = sub_1003065B0("tier%ilabel_001.png", (int)(float)(floorf(v64) + 1.0));
v72 = cocos2d::CCString::getCString((__int64)v71);
v73 = cocos2d::CCSprite::createWithSpriteFrameName(v72);
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)v68 + 464LL))(v68, v73, 2);
sub_1000262BC((float *)&v187, *(float *)&v191 * 0.5, (float)(*((float *)&v191 + 1) * 0.5) + 70.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v73 + 184LL))(v73, &v187);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v73 + 160LL))(v73, 0.8);
}
sub_1000262BC(
(float *)&v188,
(float)(*(float *)&v191 * 0.5) + (float)((float)(v70 - 1) * 100.0),
(float)(*((float *)&v191 + 1) * 0.5) + 10.0);
if ( i <= 5 )
v74 = (unsigned int)(i + 3);
else
v74 = 2;
v75 = sub_1003065B0("chest_0%i_price_001.png", v74);
v76 = (char *)cocos2d::CCString::getCString((__int64)v75);
sub_100009900(&v187, v76);
v77 = sub_1003065B0("chest_0%i_02_001.png", v74);
v78 = (char *)cocos2d::CCString::getCString((__int64)v77);
sub_100009900(&__p, v78);
if ( i <= 2 )
{
isSpecialChestUnlocked = 0;
v174.i8[2] = -126;
v174.i16[0] = 14446;
LABEL_27:
v84 = 0.8;
goto LABEL_28;
}
memset(&v174, 100, 3);
if ( i < 6 )
{
isSpecialChestUnlocked = 0;
goto LABEL_27;
}
v174.i8[2] = -76;
v174.i16[0] = 100;
v80 = sub_1003065B0("chestSpecial_0%i_price_001.png", v70 + 1);
v81 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v80);
v82 = std::string::assign(&v187, v81);
if ( v70 )
{
if ( v70 == 1 )
{
v83 = GameStatsManager::sharedState(v82);
sub_100009900(v182, "0005");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v83, v182);
v84 = 1.0;
if ( (v183 & 0x80000000) == 0 )
goto LABEL_28;
v85 = (void *)v182[0];
}
else
{
v113 = GameStatsManager::sharedState(v82);
sub_100009900(v180, "0006");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v113, v180);
v84 = 1.0;
if ( (v181 & 0x80000000) == 0 )
goto LABEL_28;
v85 = v180[0];
}
}
else
{
v112 = GameStatsManager::sharedState(v82);
sub_100009900(v184, "0004");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v112, v184);
v84 = 1.0;
if ( (v185 & 0x80000000) == 0 )
goto LABEL_28;
v85 = (void *)v184[0];
}
operator delete(v85);
LABEL_28:
v86 = GJChestSprite::create(v74);
(*(void (__fastcall **)(_QWORD *, float))(*v86 + 160LL))(v86, 0.6);
v87 = CCMenuItemSpriteExtra::create((__int64)v86, 0, a1, (__int64)sub_100384BA0, 0);
sub_100009900(&__str, "chestClick.ogg");
std::string::operator=((std::string *)(v87 + 220), &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
sub_1000262C4((float *)&v178, 60.0, 48.0);
(*(void (__fastcall **)(_WORD *, float32x2_t *))(*(_QWORD *)v87 + 320LL))(v87, &v178);
v88 = *(float *)(*(__int64 (__fastcall **)(_WORD *))(*(_QWORD *)v87 + 328LL))(v87);
v89 = (*(__int64 (__fastcall **)(_WORD *))(*(_QWORD *)v87 + 328LL))(v87);
sub_1000262BC((float *)&v178, v88 * 0.5, *(float *)(v89 + 4) * 0.5);
(*(void (__fastcall **)(_QWORD *, float32x2_t *))(*v86 + 184LL))(v86, &v178);
(*(void (__fastcall **)(__int64, _WORD *))(*(_QWORD *)v69 + 456LL))(v69, v87);
v87[204] = 256;
cocos2d::CCNode::convertToNodeSpace(v69, (__int64)&v188, &v178);
(*(void (__fastcall **)(_WORD *, float32x2_t *))(*(_QWORD *)v87 + 184LL))(v87, &v178);
v90 = (*(__int64 (__fastcall **)(_WORD *, unsigned __int64))(*(_QWORD *)v87 + 72LL))(v87, i);
if ( isSpecialChestUnlocked )
SecretRewardsLayer::switchToOpenedState(v90, v87);
v91 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"chestPlatform_01_001.png");
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)v68 + 464LL))(v68, v91, 2);
sub_1000262BC((float *)&v177, 0.0, -34.0);
*(float32x2_t *)&v92 = sub_100026318(&v188, &v177, &v178);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v91 + 184LL))(v91, &v178, v92);
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v91 + 960LL))(v91, &v174);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v91 + 912LL))(v91, 200);
if ( (v187.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v93 = &v187;
else
v93 = (std::string *)v187.__r_.__value_.__r.__words[0];
v94 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v93);
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)v68 + 464LL))(v68, v94, 2);
v95 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v91 + 192LL))(v91);
sub_1000262BC((float *)&v177, 0.0, -20.0);
*(float32x2_t *)&v96 = sub_100026318(v95, &v177, &v178);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v94 + 184LL))(v94, &v178, v96);
v97 = (*(__int64 (__fastcall **)(void *, float))(*(_QWORD *)v94 + 160LL))(v94, v84);
if ( i > 5 )
{
if ( i == 6 )
{
sub_1000262BC(
(float *)&v178,
(float)(*(float *)&v191 * 0.5) + 10.0,
(float)(*((float *)&v191 + 1) * 0.5) + 72.0);
v108 = cocos2d::CCLabelBMFont::create_1(" ", "bigFont.fnt");
*(_QWORD *)(a1 + 440) = v108;
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v108 + 184LL))(v108, &v178);
v109 = *(_QWORD *)(a1 + 440);
sub_1000262BC((float *)&v177, 1.0, 0.5);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v109 + 296LL))(v109, &v177);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 440) + 160LL))(*(_QWORD *)(a1 + 440), 0.5);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v68 + 456LL))(v68, *(_QWORD *)(a1 + 440));
v110 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"chest03_small_001.png");
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v68 + 456LL))(v68, v110);
sub_1000262BC((float *)&v176, 22.0, 0.0);
*(float32x2_t *)&v111 = sub_100026318(&v178, &v176, &v177);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v110 + 184LL))(v110, &v177, v111);
SecretRewardsLayer::updateUnlockedLabel(a1);
}
}
else
{
v98 = GameStatsManager::sharedState(v97);
v99 = GameStatsManager::countUnlockedSecretChests(v98, i + 3);
v100 = GameStatsManager::sharedState(v99);
v101 = GameStatsManager::countSecretChests(v100, i + 3);
v102 = sub_1003065B0("%i / %i", v99, v101);
v103 = (const char *)cocos2d::CCString::getCString((__int64)v102);
v104 = cocos2d::CCLabelBMFont::create_1(v103, "bigFont.fnt");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v68 + 456LL))(v68, v104);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v104 + 160LL))(v104, 0.4);
v105 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v94 + 192LL))(v94);
sub_1000262BC((float *)&v177, 0.0, -35.0);
*(float32x2_t *)&v106 = sub_100026318(v105, &v177, &v178);
(*(void (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v104 + 184LL))(v104, &v178, v106);
if ( (int)v99 >= v101 )
v107 = 65280;
else
v107 = 7043771;
v178.i16[0] = v107;
v178.i8[2] = BYTE2(v107);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v104 + 1072LL))(v104, &v178);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 464), v104, i + 3);
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( SHIBYTE(v187.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v187.__r_.__value_.__l.__data_);
}
sub_1000262BC((float *)&v188, *(float *)&v191 * 0.5, (float)(*((float *)&v191 + 1) * 0.5) + 12.0);
v114 = cocos2d::CCLayer::create();
sub_1002E74E0((__int64)v60);
v115 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v114 + 456LL))(v114, v115);
v116 = GJChestSprite::create(9);
(*(void (__fastcall **)(_QWORD *, float))(*v116 + 160LL))(v116, 0.72);
v117 = CCMenuItemSpriteExtra::create((__int64)v116, 0, a1, (__int64)SecretRewardsLayer::onGoldChest, 0);
sub_100009900(&v175, "chestClick.ogg");
std::string::operator=((std::string *)(v117 + 220), &v175);
if ( SHIBYTE(v175.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v175.__r_.__value_.__l.__data_);
v118 = (*(float (__fastcall **)(_QWORD *))(*v116 + 168LL))(v116) * 100.0;
v119 = (*(float (__fastcall **)(_QWORD *))(*v116 + 168LL))(v116);
sub_1000262C4((float *)&v187, v118, v119 * 80.0);
(*(void (__fastcall **)(_WORD *, std::string *))(*(_QWORD *)v117 + 320LL))(v117, &v187);
v120 = *(float *)(*(__int64 (__fastcall **)(_WORD *))(*(_QWORD *)v117 + 328LL))(v117) * 0.5;
v121 = (*(__int64 (__fastcall **)(_WORD *))(*(_QWORD *)v117 + 328LL))(v117);
sub_1000262BC((float *)&v187, v120, *(float *)(v121 + 4) * 0.5);
(*(void (__fastcall **)(_QWORD *, std::string *))(*v116 + 184LL))(v116, &v187);
(*(void (__fastcall **)(__int64, _WORD *))(*(_QWORD *)v115 + 456LL))(v115, v117);
v117[204] = 256;
cocos2d::CCNode::convertToNodeSpace(v115, (__int64)&v188, &v187);
v122 = (*(__int64 (__fastcall **)(_WORD *, std::string *))(*(_QWORD *)v117 + 184LL))(v117, &v187);
v123 = GameStatsManager::sharedState(v122);
v124 = sub_1003DCA04(v123);
if ( !(_DWORD)v124 )
SecretRewardsLayer::switchToOpenedState(v124, v117);
v125 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"chestPlatform_01_001.png");
(*(void (__fastcall **)(void *, void *, __int64))(*(_QWORD *)v114 + 464LL))(v114, v125, 2);
sub_1000262BC((float *)&__p, 0.0, -40.8);
*(float32x2_t *)&v126 = sub_100026318(&v188, (float32x2_t *)&__p, (float32x2_t *)&v187);
(*(void (__fastcall **)(void *, std::string *, double))(*(_QWORD *)v125 + 184LL))(v125, &v187, v126);
qmemcpy(&v187, "\\Pg", 3);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v125 + 960LL))(v125, &v187);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v125 + 912LL))(v125, 200);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v125 + 160LL))(v125, 1.2);
v127 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"chest_09_price_001.png");
(*(void (__fastcall **)(void *, void *, __int64))(*(_QWORD *)v114 + 464LL))(v114, v127, 2);
v128 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v125 + 192LL))(v125);
sub_1000262BC((float *)&__p, 0.0, -24.0);
*(float32x2_t *)&v129 = sub_100026318(v128, (float32x2_t *)&__p, (float32x2_t *)&v187);
(*(void (__fastcall **)(void *, std::string *, double))(*(_QWORD *)v127 + 184LL))(v127, &v187, v129);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v127 + 160LL))(v127, 0.96);
sub_1000262BC((float *)&v178, *(float *)&v191 * 0.5, (float)(*((float *)&v191 + 1) * 0.5) + 72.0);
v130 = cocos2d::CCLabelBMFont::create_1(" ", "bigFont.fnt");
*(_QWORD *)(a1 + 456) = v130;
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v130 + 184LL))(v130, &v178);
v131 = *(_QWORD *)(a1 + 456);
sub_1000262BC((float *)&v187, 0.5, 0.5);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v131 + 296LL))(v131, &v187);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 456) + 160LL))(*(_QWORD *)(a1 + 456), 0.5);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v114 + 456LL))(v114, *(_QWORD *)(a1 + 456));
sub_1003850CC(a1);
v132 = cocos2d::CCLayer::create();
sub_1002E74E0((__int64)v60);
v133 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v132 + 456LL))(v132, v133);
v134 = 1;
while ( 2 )
{
sub_100009900(&v187, "shopRope2_001.png");
sub_100009900(&__p, "shopRope2_2_001.png");
switch ( (_DWORD)v134 )
{
case 2:
std::string::assign(&v187, "shopRope3_001.png");
v135 = "shopRope3_2_001.png";
goto LABEL_64;
case 3:
std::string::assign(&v187, "shopRope4_001.png");
v135 = "shopRope4_2_001.png";
LABEL_64:
std::string::assign(&__p, v135);
break;
case 4:
std::string::assign(&v187, "shopRope5_001.png");
v135 = "shopRope5_2_001.png";
goto LABEL_64;
}
if ( (v187.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v136 = &v187;
else
v136 = (std::string *)v187.__r_.__value_.__r.__words[0];
v137 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v136);
v138 = (char *)CCMenuItemSpriteExtra::create((__int64)v137, 0, a1, (__int64)SecretRewardsLayer::onShop, 0);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v138 + 72LL))(v138, v134);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v133 + 456LL))(v133, v138);
CCMenuItemSpriteExtra::setSizeMult((__int64)v138, 1.5);
sub_1000262BC(
(float *)&v176,
(float)((float)((float)(unsigned int)(v134 - 1) * 70.0) + -105.0) + (float)(*(float *)&v191 * 0.5),
*((float *)&v191 + 1) + -100.0);
cocos2d::CCNode::convertToNodeSpace(v133, (__int64)&v176, &v177);
(*(void (__fastcall **)(char *, float32x2_t *))(*(_QWORD *)v138 + 184LL))(v138, &v177);
sub_1002B0300((__int64)v138, 1);
sub_1000262BC((float *)&v177, 0.0, -15.0);
sub_10002630C(v138 + 468, (double *)&v177);
*(_QWORD *)(v138 + 476) = 0x3E99999A3E99999ALL;
sub_1000262BC((float *)&v177, 25.0, 76.0);
if ( (_DWORD)v134 == 3 )
{
v139 = v177.f32[0] + -3.5;
LABEL_72:
v177.f32[0] = v139;
}
else if ( (_DWORD)v134 == 2 )
{
v139 = v177.f32[0] + -2.25;
goto LABEL_72;
}
for ( j = 0; j != 6; ++j )
{
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v142 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)p_p);
(*(void (__fastcall **)(void *, void *))(*(_QWORD *)v137 + 456LL))(v137, v142);
sub_1000262BC((float *)&v174, 0.0, (float)j * 20.5);
*(float32x2_t *)&v143 = sub_100026318(&v177, &v174, &v176);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v142 + 184LL))(v142, &v176, v143);
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( SHIBYTE(v187.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v187.__r_.__value_.__l.__data_);
v134 = (unsigned int)(v134 + 1);
if ( (_DWORD)v134 != 5 )
continue;
break;
}
v144 = BoomScrollLayer::create((__int64)v60, 0, 1, 0, 0);
*(_QWORD *)(a1 + 544) = v144;
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 424) + 456LL))(*(_QWORD *)(a1 + 424), v144);
v145 = *(_QWORD *)(a1 + 544);
v146 = *(float *)&v191 * 0.5;
v147 = cocos2d::CCDirector::sharedDirector();
v148 = sub_100207EA0(v147);
sub_1000262BC((float *)&v187, v146, v148 + 10.0);
BoomScrollLayer::setPagesIndicatorPosition(v145, (double *)&v187);
v149 = *(_QWORD *)(a1 + 544);
*(_DWORD *)(v149 + 540) = 1063675494;
*(_BYTE *)(v149 + 608) = 1;
v150 = cocos2d::CCDirector::sharedDirector();
v151 = sub_100207EB0(v150);
v152 = cocos2d::CCDirector::sharedDirector();
v153 = sub_100207E98(v152);
sub_1000262CC((float *)&v187, 0.0, 0.0, v151, v153);
sub_1000264EC((_QWORD *)(v149 + 612), (__int64)&v187);
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 544) + 504LL) + 408LL) = a1 + 416;
v154 = cocos2d::CCMenu::create();
v155 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v154 + 1024LL))(v154, 4294967167LL);
v156 = (float)(*((float *)&v191 + 1) * 0.5) + -30.0;
if ( *(_BYTE *)(AppDelegate::get(v155, v157) + 37) )
v158 = 49.0;
else
v158 = 24.0;
v159 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_arrow_01_001.png");
v160 = CCMenuItemSpriteExtra::create((__int64)v159, 0, a1, (__int64)sub_10038528C, 0);
*(_QWORD *)(a1 + 512) = v160;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v154 + 456LL))(v154, v160);
v161 = *(_QWORD *)(a1 + 512);
v162 = cocos2d::CCDirector::sharedDirector();
v163 = sub_100207EA8(v162);
sub_1000262BC((float *)&__p, v158 + v163, v156);
cocos2d::CCNode::convertToNodeSpace(v154, (__int64)&__p, &v187);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v161 + 184LL))(v161, &v187);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 512) + 72LL))(*(_QWORD *)(a1 + 512), 0);
CCMenuItemSpriteExtra::setSizeMult(*(_QWORD *)(a1 + 512), 2.0);
v164 = (unsigned __int8 *)cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v164, 1);
v165 = CCMenuItemSpriteExtra::create((__int64)v164, 0, a1, (__int64)sub_10038528C, 0);
*(_QWORD *)(a1 + 520) = v165;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v154 + 456LL))(v154, v165);
v166 = *(_QWORD *)(a1 + 520);
v167 = cocos2d::CCDirector::sharedDirector();
v168 = sub_100207EB0(v167);
sub_1000262BC((float *)&__p, v168 - v158, v156);
cocos2d::CCNode::convertToNodeSpace(v154, (__int64)&__p, &v187);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v166 + 184LL))(v166, &v187);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 520) + 72LL))(*(_QWORD *)(a1 + 520), 1);
CCMenuItemSpriteExtra::setSizeMult(*(_QWORD *)(a1 + 520), 2.0);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v154, 10);
if ( (v172 & 1) != 0 )
{
TotalPages = BoomScrollLayer::getTotalPages(*(_QWORD *)(a1 + 544));
v170 = TotalPages - 1;
BoomScrollLayer::instantMoveToPage(*(_QWORD *)(a1 + 544), TotalPages - 2);
BoomScrollLayer::instantMoveToPage(*(_QWORD *)(a1 + 544), v170);
}
return v173;
}