//
// SecretLayer4::init from 0x140585340 to 0x1405864a2 (4450 bytes)
//
// 5 xrefs:
// > LevelPage::onSecretDoor @ 0x140446598
// > LevelPage::onSecretDoor @ 0x14044659f
// > LevelPage::onSecretDoor @ 0x140446589
// > ??> @ 0x1407e26b8
// > ??> @ 0x14092ca38
//
// This function is hookable on this platform (idp: pc, 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:34:28 +0000
//
// Hidden C++ exception states: #wind=8
bool __fastcall SecretLayer4::init(__int64 a1)
{
bool result; // al
__int64 v3; // rcx
cocos2d::CCTextureCache *v4; // rax
__int64 v5; // rdx
__int64 v6; // rcx
cocos2d::CCSpriteFrameCache *v7; // rax
__int64 v8; // rcx
__int64 v9; // rdx
__int64 v10; // rdx
__int64 v11; // rcx
__int64 v12; // rax
__int64 v13; // rcx
cocos2d::CCObject *v14; // rax
__int64 v15; // rdx
__int64 v16; // rcx
__int64 v17; // r8
__int64 v18; // rbx
cocos2d::CCString *v19; // rax
__int64 v20; // rcx
int v21; // ebx
__int64 v22; // r8
unsigned __int64 v23; // rdx
void *v24; // r8
struct cocos2d::CCObject *v25; // rbx
__int64 v26; // rbx
cocos2d::CCString *v27; // rax
__int64 v28; // rcx
int v29; // ebx
__int64 v30; // r8
unsigned __int64 v31; // rdx
void *v32; // r8
struct cocos2d::CCObject *v33; // rbx
__int64 v34; // rbx
cocos2d::CCString *v35; // rax
__int64 v36; // rcx
int v37; // ebx
__int64 v38; // r8
unsigned __int64 v39; // rdx
void *v40; // r8
struct cocos2d::CCObject *v41; // rbx
__int64 v42; // rbx
cocos2d::CCString *v43; // rax
__int64 v44; // rcx
int v45; // ebx
__int64 v46; // r8
unsigned __int64 v47; // rdx
void *v48; // r8
struct cocos2d::CCObject *v49; // rbx
__int64 v50; // rbx
cocos2d::CCString *v51; // rax
__int64 v52; // rcx
int v53; // ebx
__int64 v54; // r8
unsigned __int64 v55; // rdx
void *v56; // r8
struct cocos2d::CCObject *v57; // rbx
__int64 v58; // rbx
cocos2d::CCString *v59; // rax
__int64 v60; // rcx
int v61; // ebx
__int64 v62; // r8
unsigned __int64 v63; // rdx
void *v64; // r8
struct cocos2d::CCObject *v65; // rbx
__int64 v66; // rbx
cocos2d::CCString *v67; // rax
__int64 v68; // rcx
int v69; // ebx
unsigned __int64 v70; // rdx
void *v71; // r8
struct cocos2d::CCObject *v72; // rbx
__int64 v73; // rcx
__int64 v74; // rbx
struct cocos2d::CCFiniteTimeAction *v75; // rax
struct cocos2d::CCAction *v76; // rax
struct cocos2d::CCSprite *v77; // rdi
__int64 v78; // rbx
__int64 v79; // rax
__int64 v80; // rbx
__int64 v81; // rax
struct cocos2d::CCLabelBMFont *v82; // rdi
__int64 v83; // rbx
__int64 v84; // rax
struct cocos2d::CCLabelBMFont *v85; // rax
__int64 v86; // rax
_QWORD *Message; // rax
__int64 v88; // rax
_QWORD *v89; // rbx
__int64 v90; // rdx
__int64 v91; // rdx
__int64 v92; // rcx
char *v93; // rax
__int64 v94; // rcx
__int64 v95; // rcx
int v96; // eax
cocos2d::CCObject *v97; // rdi
struct cocos2d::CCMenu *v98; // r15
__int64 v99; // rbx
__int64 v100; // rcx
cocos2d::CCDirector *v101; // rax
float v102; // xmm6_4
__int64 v103; // rcx
cocos2d::CCDirector *v104; // rax
float v105; // xmm0_4
__int64 v106; // rax
__int64 v107; // rcx
__int64 v108; // rdx
__int64 v109; // rcx
__int64 v110; // rsi
__int64 v111; // rbx
__int64 v112; // rax
struct cocos2d::CCSprite *v113; // rdi
__int64 v114; // rbx
__int64 v115; // rax
cocos2d::CCObject *v116; // rax
__int64 v117; // rdi
__int64 v118; // rbx
__int64 v119; // rax
__int64 v120; // rax
__int64 v121; // rcx
__int64 v122; // rcx
__int64 v123; // r15
__int64 v124; // rcx
__int64 v125; // rbx
cocos2d::CCSprite *v126; // rsi
void **v127; // rdi
void (__fastcall **v128)(void **, _QWORD); // rbx
__int64 v129; // rax
__int64 v130; // rbx
float v131; // xmm6_4
float *v132; // rax
__int64 v133; // rax
void (__fastcall **v134)(void **, _QWORD); // rbx
__int64 v135; // rax
__int64 v136; // rax
__int64 v137; // [rsp+38h] [rbp-D0h] BYREF
void *v138; // [rsp+40h] [rbp-C8h] BYREF
_QWORD v139[3]; // [rsp+48h] [rbp-C0h] BYREF
__int64 v140; // [rsp+60h] [rbp-A8h]
__int64 v141; // [rsp+68h] [rbp-A0h]
__int64 v142; // [rsp+70h] [rbp-98h] BYREF
_QWORD *v143; // [rsp+78h] [rbp-90h] BYREF
char Src[15]; // [rsp+80h] [rbp-88h] BYREF
char v145; // [rsp+8Fh] [rbp-79h]
__int64 v146; // [rsp+90h] [rbp-78h]
__int64 v147; // [rsp+98h] [rbp-70h]
_QWORD *v148; // [rsp+A0h] [rbp-68h] BYREF
char v149[8]; // [rsp+A8h] [rbp-60h] BYREF
_BYTE v150[16]; // [rsp+B0h] [rbp-58h] BYREF
void *Block[2]; // [rsp+C0h] [rbp-48h] BYREF
__int64 v152; // [rsp+D0h] [rbp-38h]
unsigned __int64 v153; // [rsp+D8h] [rbp-30h]
result = cocos2d::CCLayer::init((cocos2d::CCLayer *)a1);
if ( result )
{
v4 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v3);
cocos2d::CCTextureCache::addImage(v4, "SecretSheet.png", 0);
v7 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v6, v5);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v7, "SecretSheet.plist");
v143 = &v139[1];
*(_OWORD *)&v139[1] = 0;
v140 = 0;
v141 = 0;
v139[1] = sub_14003D460(0x20u);
v140 = 16;
v141 = 31;
strcpy((char *)v139[1], "secretLoop03.mp3");
if ( !qword_14090BFD0 )
{
v138 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v138);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
GameManager::fadeInMusic(v8, (__int64)&v139[1]);
LOBYTE(v9) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v9);
LOBYTE(v10) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1008LL))(a1, v10);
v12 = cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize(v12, v139);
v14 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v13);
*(_QWORD *)(a1 + 480) = v14;
cocos2d::CCObject::retain(v14);
v18 = AchievementManager::sharedState(v16, v15, v17);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret01");
v19 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v18 + 352), Block);
v21 = cocos2d::CCString::intValue(v19);
v23 = v153;
if ( v153 > 0xF )
{
v24 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v24 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v24 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v24);
}
if ( v21 < 100 )
{
v25 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v20, v23);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v25 + 64LL))(v25, 1);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v25, 1);
}
v26 = AchievementManager::sharedState(v20, v23, v22);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret02");
v27 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v26 + 352), Block);
v29 = cocos2d::CCString::intValue(v27);
v31 = v153;
if ( v153 > 0xF )
{
v32 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v32 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v32 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v32);
}
if ( v29 < 100 )
{
v33 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v28, v31);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v33 + 64LL))(v33, 2);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v33, 2);
}
v34 = AchievementManager::sharedState(v28, v31, v30);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret03");
v35 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v34 + 352), Block);
v37 = cocos2d::CCString::intValue(v35);
v39 = v153;
if ( v153 > 0xF )
{
v40 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v40 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v40 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v40);
}
if ( v37 < 100 )
{
v41 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v36, v39);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v41 + 64LL))(v41, 3);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v41, 3);
}
v42 = AchievementManager::sharedState(v36, v39, v38);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret04");
v43 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v42 + 352), Block);
v45 = cocos2d::CCString::intValue(v43);
v47 = v153;
if ( v153 > 0xF )
{
v48 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v48 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v48 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v48);
}
if ( v45 < 100 )
{
v49 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v44, v47);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v49 + 64LL))(v49, 4);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v49, 4);
}
v50 = AchievementManager::sharedState(v44, v47, v46);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret05");
v51 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v50 + 352), Block);
v53 = cocos2d::CCString::intValue(v51);
v55 = v153;
if ( v153 > 0xF )
{
v56 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v56 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v56 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v56);
}
if ( v53 < 100 )
{
v57 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v52, v55);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v57 + 64LL))(v57, 5);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v57, 5);
}
v58 = AchievementManager::sharedState(v52, v55, v54);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret06");
v59 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v58 + 352), Block);
v61 = cocos2d::CCString::intValue(v59);
v63 = v153;
if ( v153 > 0xF )
{
v64 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v64 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v64 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v64);
}
if ( v61 < 100 )
{
v65 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v60, v63);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v65 + 64LL))(v65, 6);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v65, 6);
}
v66 = AchievementManager::sharedState(v60, v63, v62);
*(_OWORD *)Block = 0;
v152 = 0;
v153 = 0;
Block[0] = sub_14003D460(0x20u);
v152 = 24;
v153 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret07");
v67 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v66 + 352), Block);
v69 = cocos2d::CCString::intValue(v67);
v70 = v153;
if ( v153 > 0xF )
{
v71 = Block[0];
if ( v153 + 1 >= 0x1000 )
{
v71 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v71 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v71);
}
v152 = 0;
v153 = 15;
LOBYTE(Block[0]) = 0;
if ( v69 < 100 )
{
v72 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v68, v70);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v72 + 64LL))(v72, 7);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v72, 7);
}
v73 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v138 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v138);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v73 = qword_14090BFD0;
}
if ( !GameManager::getUGV(v73, "9") )
{
v74 = cocos2d::CCCallFunc::create(a1, SecretLayer4::showFirstDialog);
v75 = cocos2d::CCDelayTime::create(0.80000001);
v76 = cocos2d::CCSequence::create(v75, v74, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)a1, v76);
*(_DWORD *)(a1 + 436) = 30;
}
v77 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v78 = *(_QWORD *)v77;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v138, 0.0, 0.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v78 + 288))(v77, v79);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(
a1,
v77,
4294967293LL);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v77 + 120LL))(v77);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v77 + 136LL))(v77);
v80 = *(_QWORD *)v77;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v138, -5.0, -5.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v80 + 184))(v77, v81);
strcpy((char *)&v137, "K\n");
(**((void (__fastcall ***)(__int64, __int64 *))v77 + 40))((__int64)v77 + 320, &v137);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v150, 0.0, 0.0, 40.0, 40.0);
v82 = cocos2d::CCLabelBMFont::create("Chamber of Time", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v82 + 160LL))(v82);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *))(*(_QWORD *)a1 + 464LL))(a1, v82);
v83 = *(_QWORD *)v82;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v138, *(float *)v139 * 0.5, *((float *)v139 + 1) - 24.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v83 + 184))(v82, v84);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v142,
*(float *)v139 * 0.5,
(float)(*((float *)v139 + 1) * 0.5) + 50.0);
v85 = cocos2d::CCLabelBMFont::create(" ", (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 464) = v85;
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *))(*(_QWORD *)a1 + 464LL))(a1, v85);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v138, 0.0, 43.0);
cocos2d::CCPoint::operator+(&v142, &v143, v86);
(*(void (__fastcall **)(_QWORD, _QWORD **))(**(_QWORD **)(a1 + 464) + 184LL))(*(_QWORD *)(a1 + 464), &v143);
Message = (_QWORD *)SecretLayer4::getMessage(a1, &v139[1]);
SecretLayer2::updateMessageLabel(a1, Message);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, (const struct cocos2d::CCRect *)v150);
v89 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v88);
LOBYTE(v90) = 100;
(*(void (__fastcall **)(_QWORD *, __int64))(v89[40] + 40LL))(v89 + 40, v90);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v149, 200.0, 40.0);
(*(void (__fastcall **)(_QWORD *, char *))(*v89 + 312LL))(v89, v149);
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v89, 4294967294LL);
(*(void (__fastcall **)(_QWORD *, __int64 *))(*v89 + 184LL))(v89, &v142);
(*(void (__fastcall **)(_QWORD *, void *))v89[40])(v89 + 40, &unk_14070464C);
v93 = CCTextInputNode::create(v92, v91, (__int64)"...");
*(_QWORD *)(a1 + 456) = v93;
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v93, 20);
*(_QWORD *)(*(_QWORD *)(a1 + 456) + 600LL) = a1 + 408;
(*(void (__fastcall **)(_QWORD, __int64 *))(**(_QWORD **)(a1 + 456) + 184LL))(*(_QWORD *)(a1 + 456), &v142);
v94 = *(_QWORD *)(a1 + 456);
*(_DWORD *)(v94 + 564) = 1060320051;
CCTextInputNode::refreshLabel(v94);
v95 = *(_QWORD *)(a1 + 456);
*(_DWORD *)(v95 + 560) = 1127481344;
CCTextInputNode::refreshLabel(v95);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 456) + 592LL) + 336LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 456) + 592LL),
0);
*(_DWORD *)(*(_QWORD *)(a1 + 456) + 608LL) = 100;
*(_OWORD *)&v139[1] = 0;
v140 = 0;
v141 = 0;
v139[1] = sub_14003D460(0x70u);
v140 = 97;
v141 = 111;
strcpy(
(char *)v139[1],
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 456), (void **)&v139[1]);
SecretLayer2::updateSearchLabel(a1, &byte_1406ED6E0);
v96 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v97 = CCMenuItemSpriteExtra::create(v96, 0, a1, (__int64)SecretLayer4::onBack);
*((_DWORD *)v97 + 93) = 1069547520;
v98 = cocos2d::CCMenu::create(v97, 0);
(*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v98, 1);
v99 = *(_QWORD *)v98;
v101 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v100);
v102 = cocos2d::CCDirector::getScreenTop(v101) - 23.0;
v104 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v103);
v105 = cocos2d::CCDirector::getScreenLeft(v104) + 24.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v138, v105, v102);
(*(void (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v99 + 184))(v98, v106);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v107) + 209) )
GameToolbox::addBackButton(a1, (__int64)v97);
v110 = cocos2d::CCNode::create(v109, v108);
v111 = *(_QWORD *)v110;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v138, 80.0, 80.0);
(*(void (__fastcall **)(__int64, __int64))(v111 + 312))(v110, v112);
v113 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock3_001.png");
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *))(*(_QWORD *)v110 + 464LL))(v110, v113);
v114 = *(_QWORD *)v113;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v138, 40.0, 40.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v114 + 184))(v113, v115);
v116 = CCMenuItemSpriteExtra::create(v110, 0, a1, (__int64)SecretLayer4::onSubmit);
*(_QWORD *)(a1 + 472) = v116;
(*(void (__fastcall **)(struct cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v98 + 464LL))(v98, v116);
v117 = **(_QWORD **)(a1 + 472);
v118 = *(_QWORD *)(a1 + 472);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v138,
*(float *)v139 * 0.5,
(float)(*((float *)v139 + 1) * 0.5) - 20.0);
cocos2d::CCNode::convertToNodeSpace(v98, &v143, v119);
(*(void (__fastcall **)(__int64, __int64))(v117 + 184))(v118, v120);
*(_DWORD *)(*(_QWORD *)(a1 + 472) + 372LL) = 1065353216;
v148 = &v139[1];
*(_OWORD *)&v139[1] = 0;
v140 = 4;
v141 = 15;
strcpy((char *)&v139[1], "0003");
v121 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
Block[0] = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v121 = qword_14090BFE0;
}
if ( !GameStatsManager::isSpecialChestUnlocked(v121, &v139[1]) )
{
v123 = cocos2d::CCMenu::create(v122);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v123, 10);
Block[0] = &v139[1];
*(_OWORD *)&v139[1] = 0;
v140 = 4;
v141 = 15;
strcpy((char *)&v139[1], "0003");
v148 = &v139[1];
v124 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v138 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v138);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v124 = qword_14090BFE0;
}
v125 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v124 + 368), &v139[1]);
sub_14003D310((__int64)&v139[1]);
v126 = GJChestSprite::create(*(_DWORD *)(v125 + 64));
GJChestSprite::switchToState(v126, 2, 0);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v126 + 160LL))(v126);
v127 = (void **)CCMenuItemSpriteExtra::create((int)v126, 0, a1, (__int64)SecretLayer4::onChest01);
v145 = 0;
v146 = 14;
v147 = 15;
strcpy(Src, "chestClick.ogg");
Block[0] = Src;
if ( v127 + 56 != (void **)Src )
sub_1400405A0(v127 + 56, Src, 0xEu);
sub_14003D310((__int64)Src);
v128 = (void (__fastcall **)(void **, _QWORD))*v127;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)Block, 60.000004, 48.0);
v128[39](v127, v129);
v130 = *(_QWORD *)v126;
v131 = *(float *)((*((__int64 (__fastcall **)(void **))*v127 + 40))(v127) + 4) * 0.5;
v132 = (float *)(*((__int64 (__fastcall **)(void **))*v127 + 40))(v127);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, *v132 * 0.5, v131);
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(v130 + 184))(v126, v133);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v123 + 464LL))(v123, v127);
v134 = (void (__fastcall **)(void **, _QWORD))*v127;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, *(float *)v139 - 60.0, 60.0);
cocos2d::CCNode::convertToNodeSpace(v123, &v148, v135);
v134[23](v127, v136);
}
return 1;
}
return result;
}