//
// SecretLayer5::init from 0x1403f4030 to 0x1403f51c3 (4499 bytes)
//
// 4 xrefs:
// > LevelAreaInnerLayer::onOnlineVault @ 0x1402c8634
// > LevelAreaInnerLayer::onOnlineVault @ 0x1402c8625
// > ??> @ 0x1405d53d8
// > ??> @ 0x1406d81f8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=7
bool SecretLayer5::init(SecretLayer5 *a1)
{
int v2; // r15d
bool result; // al
cocos2d::CCTextureCache *v4; // rax
__int64 v5; // rcx
cocos2d::CCSpriteFrameCache *v6; // rax
cocos2d::CCTextureCache *v7; // rax
__int64 v8; // rcx
cocos2d::CCSpriteFrameCache *v9; // rax
__int64 v10; // rcx
_BOOL8 v11; // rdx
_BOOL8 v12; // rdx
__int64 v13; // rcx
cocos2d::CCDirector *v14; // rax
__m128i si128; // xmm0
std::vector *p_m_soundEffects; // rsi
std::_Vector_val>::pointer Myfirst; // rcx
std::_Vector_val>::pointer v18; // rbx
unsigned __int64 v19; // r12
std::_Vector_val>::pointer Mylast; // rdi
std::_Simple_types::value_type *v21; // rbx
unsigned int v22; // eax
unsigned int v23; // eax
unsigned __int64 i; // rdx
cocos2d::CCSprite *v25; // rax
cocos2d::CCSprite_vtbl *v26; // rbx
const cocos2d::CCPoint *v27; // rax
float v28; // xmm0_4
cocos2d::CCSprite *m_background; // rbx
cocos2d::CCSprite_vtbl *v30; // rdi
const cocos2d::CCPoint *v31; // rax
double v32; // xmm0_8
cocos2d::CCLabelBMFont *v33; // rax
float v34; // xmm0_4
struct cocos2d::CCRect *v35; // rax
struct cocos2d::extension::CCScale9Sprite *v36; // rax
__int64 v37; // rdx
const char *v38; // r9
CCTextInputNode *v39; // rax
CCTextInputNode *m_textInput; // rcx
CCTextInputNode *v41; // rcx
std::string *p_m_allowedChars; // rcx
void **v43; // rdx
struct cocos2d::CCSprite *v44; // rax
CCMenuItemSpriteExtra *v45; // rdi
struct cocos2d::CCMenu *v46; // rsi
cocos2d::CCMenu_vtbl *v47; // rbx
__int64 v48; // rcx
cocos2d::CCDirector *v49; // rax
__int64 v50; // rcx
cocos2d::CCDirector *v51; // rax
float v52; // xmm0_4
const cocos2d::CCPoint *v53; // rax
__int64 v54; // rcx
void *v55; // rcx
void *v56; // rcx
float v57; // xmm0_4
CCSpriteGrayscale *m_wraithGraySprite; // rbx
CCSpriteGrayscale_vtbl *v59; // rdi
struct cocos2d::CCPoint v60; // rax
struct cocos2d::CCSprite *v61; // rax
float v62; // xmm0_4
cocos2d::CCSprite *m_eyesSprite; // rbx
cocos2d::CCSprite_vtbl *v64; // rdi
struct cocos2d::CCPoint v65; // rax
__int64 v66; // rdx
__int64 v67; // rcx
__int64 v68; // rdi
cocos2d::CCSprite *v69; // rax
float v70; // xmm0_4
__int64 v71; // rbx
struct cocos2d::CCPoint v72; // rax
float v73; // xmm0_4
cocos2d::CCSprite *m_lockSprite; // rbx
cocos2d::CCSprite_vtbl *v75; // rdi
const cocos2d::CCPoint *v76; // rax
CCMenuItemSpriteExtra *v77; // rax
float v78; // xmm0_4
CCMenuItemSpriteExtra *m_wraithButton; // rbx
CCMenuItemSpriteExtra_vtbl *v80; // rdi
struct cocos2d::CCPoint v81; // rax
LoadingCircleSprite *v82; // rax
GameManager *v83; // rcx
GameManager *v84; // rsi
cocos2d::CCString *v85; // rax
const char *CString; // rbx
cocos2d::CCTextureCache *v87; // rax
cocos2d::CCString *v88; // rax
const char *v89; // rbx
cocos2d::CCTextureCache *v90; // rax
cocos2d::CCString *v91; // rax
char *v92; // rbx
const struct cocos2d::CCPoint *v93; // rax
char *v94; // rax
__int64 v95; // rbx
__int64 v96; // rax
float v97; // xmm0_4
__int64 v98; // rcx
cocos2d::CCArray *v99; // rax
struct cocos2d::CCSprite *v100; // rsi
cocos2d::CCSprite_vtbl *v101; // rbx
int v102; // eax
double v103; // xmm0_8
const cocos2d::CCPoint *v104; // rax
__int64 v105; // rcx
cocos2d::CCArray *v106; // rdi
__int64 v107; // rax
struct cocos2d::CCObject *v108; // rax
struct cocos2d::CCObject *v109; // rax
__int64 v110; // rax
GameManager *v111; // rcx
__int64 v112; // rbx
struct cocos2d::CCDelayTime *v113; // rax
struct cocos2d::CCSequence *v114; // rax
cocos2d::ccColor3B *v115; // r8
int v116; // [rsp+20h] [rbp-E0h]
float v117; // [rsp+20h] [rbp-E0h]
__int64 v118; // [rsp+40h] [rbp-C0h] BYREF
void **v119; // [rsp+48h] [rbp-B8h] BYREF
float v120; // [rsp+50h] [rbp-B0h]
char v121[8]; // [rsp+58h] [rbp-A8h] BYREF
void *v122[2]; // [rsp+60h] [rbp-A0h] BYREF
size_t Size; // [rsp+70h] [rbp-90h]
unsigned __int64 v124; // [rsp+78h] [rbp-88h]
cocos2d::CCSize v125; // [rsp+80h] [rbp-80h] BYREF
void *v126; // [rsp+88h] [rbp-78h]
__int128 v127; // [rsp+90h] [rbp-70h] BYREF
__int64 v128; // [rsp+A0h] [rbp-60h]
__int64 v129; // [rsp+A8h] [rbp-58h]
cocos2d::CCRect v130; // [rsp+B0h] [rbp-50h] BYREF
void *Block[2]; // [rsp+C0h] [rbp-40h] BYREF
__int64 v132; // [rsp+D0h] [rbp-30h]
unsigned __int64 v133; // [rsp+D8h] [rbp-28h]
_OWORD Src[4]; // [rsp+E0h] [rbp-20h] BYREF
int v135; // [rsp+120h] [rbp+20h]
int v136; // [rsp+130h] [rbp+30h] BYREF
_DWORD v137[1251]; // [rsp+134h] [rbp+34h]
v2 = 0;
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v4 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v4, "SecretSheet.png", 0);
v6 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v5);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v6, "SecretSheet.plist");
v7 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v7, "TowerSheet.png", 0);
v9 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v8);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v9, "TowerSheet.plist");
v119 = Block;
*(_OWORD *)Block = 0;
v132 = 0;
v133 = 15;
Block[0] = sub_14003AA10(0x20u);
v132 = 16;
v133 = 31;
strcpy((char *)Block[0], "secretLoop04.ogg");
if ( !qword_1406C2ED8 )
{
v118 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v118);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
}
GameManager::fadeInMusic(v10, (__int64)Block);
LOBYTE(v11) = 1;
a1->setKeypadEnabled(a1, v11);
LOBYTE(v12) = 1;
a1->setKeyboardEnabled(a1, v12);
v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v13);
cocos2d::CCDirector::getWinSize(v14);
Src[0] = _mm_load_si128((const __m128i *)&xmmword_140624040);
Src[1] = _mm_load_si128((const __m128i *)&xmmword_140624020);
si128 = _mm_load_si128((const __m128i *)&xmmword_140624030);
Src[2] = si128;
Src[3] = _mm_load_si128((const __m128i *)&xmmword_140624010);
v135 = 22349;
p_m_soundEffects = &a1->m_soundEffects;
Myfirst = a1->m_soundEffects._Mypair._Myval2._Myfirst;
if ( (unsigned __int64)(a1->m_soundEffects._Mypair._Myval2._Myend - Myfirst) >= 0x11 )
{
v19 = a1->m_soundEffects._Mypair._Myval2._Mylast - Myfirst;
if ( v19 >= 0x11 )
{
v21 = Myfirst + 17;
memmove(Myfirst, Src, 0x44u);
a1->m_soundEffects._Mypair._Myval2._Mylast = v21;
}
else
{
memmove(Myfirst, Src, 4 * v19);
Mylast = a1->m_soundEffects._Mypair._Myval2._Mylast;
memmove(Mylast, (char *)Src + 4 * v19, 4 * (17 - v19));
a1->m_soundEffects._Mypair._Myval2._Mylast = &Mylast[17 - v19];
}
}
else
{
sub_1400847D0((__int64)&a1->m_soundEffects, 0x11u);
v18 = p_m_soundEffects->_Mypair._Myval2._Myfirst;
memmove(p_m_soundEffects->_Mypair._Myval2._Myfirst, Src, 0x44u);
a1->m_soundEffects._Mypair._Myval2._Mylast = v18 + 17;
}
v22 = time64(nullptr);
srand(v22);
v23 = rand();
v137[1248] = -1;
v137[0] = v23;
for ( i = 1; i < 0x270; ++i )
{
v23 = i + 1812433253 * (v23 ^ (v23 >> 30));
v137[i] = v23;
}
v136 = 624;
sub_1403F8010(p_m_soundEffects->_Mypair._Myval2._Myfirst, a1->m_soundEffects._Mypair._Myval2._Mylast, &v136);
v25 = cocos2d::CCSprite::create("GJ_gradientBG.png");
a1->m_background = v25;
v26 = v25->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)si128.m128i_i32, 0.0);
v26->setAnchorPoint(a1->m_background, v27);
a1->addChild_0(a1, a1->m_background, -3);
((void (*)(void))a1->m_background->setScaleX)();
v28 = ((float (*)(void))a1->m_background->setScaleY)();
m_background = a1->m_background;
v30 = m_background->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v28, -5.0);
v30->setPosition_0(m_background, v31);
LOWORD(v118) = 3613;
BYTE2(v118) = 47;
a1->m_background->setColor(&a1->m_background->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v118);
v32 = cocos2d::CCRect::CCRect(&v130, 0.0, 0.0, 40.0, 40.0);
cocos2d::CCPoint::CCPoint(*(float *)&v32, v120 * 0.5);
v33 = cocos2d::CCLabelBMFont::create(" ", (const char *)&qword_14052A4D8);
a1->m_messageLabel = v33;
v34 = ((float (__fastcall *)(SecretLayer5 *, cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v33);
cocos2d::CCPoint::CCPoint(v34, 0.0);
cocos2d::CCPoint::operator+(v121, &v118);
a1->m_messageLabel->setPosition_0(a1->m_messageLabel, (const cocos2d::CCPoint *)&v118);
*(_OWORD *)Block = 0;
v132 = 1;
v133 = 15;
LOWORD(Block[0]) = (unsigned __int8)asc_140518984[0];
v119 = Block;
a1->m_messageLabel->setString(&a1->m_messageLabel->cocos2d::CCLabelProtocol, (const char *)Block);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_messageLabel, 320.0, 0.60000002, 0.0);
sub_14003A830((__int64)Block);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, &v130);
v36 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v35);
a1->m_inputBackground = v36;
LOBYTE(v37) = 100;
v36->setOpacity(&v36->cocos2d::CCRGBAProtocol, v37);
cocos2d::CCSize::CCSize(&v125, 200.0, 40.0);
a1->m_inputBackground->setContentSize(a1->m_inputBackground, &v125);
a1->addChild_0(a1, a1->m_inputBackground, -2);
a1->m_inputBackground->setPosition_0(a1->m_inputBackground, (const cocos2d::CCPoint *)v121);
a1->m_inputBackground->setColor(&a1->m_inputBackground->cocos2d::CCRGBAProtocol, &stru_140529C1C);
v39 = CCTextInputNode::create(180.0, 50.0, "...", v38, v116, (const char *)&qword_14052A4D8);
a1->m_textInput = v39;
a1->addChild_0(a1, v39, 20);
a1->m_textInput->m_delegate = &a1->TextInputDelegate;
a1->m_textInput->setPosition_0(a1->m_textInput, (const cocos2d::CCPoint *)v121);
m_textInput = a1->m_textInput;
m_textInput->m_maxLabelScale = 0.69999999;
CCTextInputNode::refreshLabel(m_textInput);
v41 = a1->m_textInput;
v41->m_maxLabelWidth = 180.0;
CCTextInputNode::refreshLabel(v41);
a1->m_textInput->m_textField->setVisible(a1->m_textInput->m_textField, 0);
a1->m_textInput->m_maxLabelLength = 100;
*(_OWORD *)v122 = 0;
Size = 0;
v124 = 15;
v122[0] = sub_14003AA10(0x70u);
Size = 97;
v124 = 111;
strcpy(
(char *)v122[0],
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
v119 = v122;
p_m_allowedChars = &a1->m_textInput->m_allowedChars;
if ( p_m_allowedChars != (std::string *)v122 )
{
v43 = v122;
if ( v124 > 0xF )
v43 = (void **)v122[0];
sub_14003CCE0((void **)p_m_allowedChars, v43, Size);
}
sub_14003A830((__int64)v122);
SecretLayer5::updateSearchLabel(a1, byte_140518980);
v44 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v45 = CCMenuItemSpriteExtra::create(v44, nullptr, a1, (cocos2d::SEL_MenuHandler *)SecretLayer5::onBack);
HIDWORD(v45->m_pfnSelector.adj) = 1069547520;
v46 = cocos2d::CCMenu::create(v45, 0);
a1->addChild_0(a1, v46, 1);
v47 = v46->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v49 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v48);
cocos2d::CCDirector::getScreenTop(v49);
v51 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v50);
v52 = cocos2d::CCDirector::getScreenLeft(v51) + 24.0;
cocos2d::CCPoint::CCPoint(v52, v52);
v47->setPosition_0(v46, v53);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v54) + 197) )
GameToolbox::addBackButton(a1, v45);
*(_OWORD *)Block = 0;
v132 = 0;
v133 = 15;
Block[0] = sub_14003AA10(0x20u);
v132 = 22;
v133 = 31;
strcpy((char *)Block[0], "GJ_secretLock4_001.png");
a1->m_wraithSprite = sub_140048500((__int64)Block);
if ( v133 > 0xF )
{
v55 = Block[0];
if ( v133 + 1 >= 0x1000 )
{
v55 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v55 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v55);
}
*(_OWORD *)Block = 0;
v132 = 0;
v133 = 15;
Block[0] = sub_14003AA10(0x20u);
v132 = 22;
v133 = 31;
strcpy((char *)Block[0], "GJ_secretLock4_001.png");
a1->m_wraithGraySprite = (CCSpriteGrayscale *)CCSpriteGrayscale::createWithSpriteFrameName((__int64)Block);
if ( v133 > 0xF )
{
v56 = Block[0];
if ( v133 + 1 >= 0x1000 )
{
v56 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v56 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v56);
}
LOWORD(v118) = 25800;
BYTE2(v118) = -1;
a1->m_wraithGraySprite->setColor(
&a1->m_wraithGraySprite->cocos2d::CCRGBAProtocol,
(const cocos2d::ccColor3B *)&v118);
a1->m_wraithSprite->addChild_0(a1->m_wraithSprite, a1->m_wraithGraySprite, 1);
v57 = ((float (__fastcall *)(cocos2d::CCRGBAProtocol *, _QWORD))a1->m_wraithGraySprite->setOpacity)(
&a1->m_wraithGraySprite->cocos2d::CCRGBAProtocol,
0);
m_wraithGraySprite = a1->m_wraithGraySprite;
v59 = m_wraithGraySprite->CCSpriteWithHue::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v57, 0.0);
v60 = cocos2d::CCNode::convertToNodeSpace(a1->m_wraithSprite, (const struct cocos2d::CCPoint *)&v118);
((void (__fastcall *)(CCSpriteGrayscale *, struct cocos2d::CCPoint))v59->setPosition_0)(m_wraithGraySprite, v60);
v61 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock4_eyes_001.png");
a1->m_eyesSprite = v61;
v118 = 0x100000302LL;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v61->setBlendFunc)(
&v61->cocos2d::CCTextureProtocol,
0x100000302LL);
v62 = ((float (__fastcall *)(CCSpriteWithHue *, cocos2d::CCSprite *, __int64))a1->m_wraithSprite->addChild_0)(
a1->m_wraithSprite,
a1->m_eyesSprite,
2);
m_eyesSprite = a1->m_eyesSprite;
v64 = m_eyesSprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v62, 0.0);
v65 = cocos2d::CCNode::convertToNodeSpace(a1->m_wraithSprite, (const struct cocos2d::CCPoint *)&v118);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v64->setPosition_0)(m_eyesSprite, v65);
a1->m_eyesSprite->setOpacity(&a1->m_eyesSprite->cocos2d::CCRGBAProtocol, 0);
cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock2_2_001.png");
v68 = cocos2d::CCNode::create(v67, v66);
v69 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock2_2_001.png");
a1->m_lockSprite = v69;
(*(void (__fastcall **)(__int64, cocos2d::CCSprite *, __int64))(*(_QWORD *)v68 + 440LL))(v68, v69, 0xFFFFFFFFLL);
v70 = ((float (__fastcall *)(CCSpriteWithHue *, __int64, __int64))a1->m_wraithSprite->addChild_0)(
a1->m_wraithSprite,
v68,
4294967294LL);
v71 = *(_QWORD *)v68;
cocos2d::CCPoint::CCPoint(v70, 0.0);
v72 = cocos2d::CCNode::convertToNodeSpace(a1->m_wraithSprite, (const struct cocos2d::CCPoint *)&v118);
v73 = (*(float (__fastcall **)(__int64, struct cocos2d::CCPoint))(v71 + 184))(v68, v72);
m_lockSprite = a1->m_lockSprite;
v75 = m_lockSprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v73, 0.0);
v75->setPosition_0(m_lockSprite, v76);
LOWORD(v118) = 18286;
BYTE2(v118) = -103;
a1->m_lockSprite->setColor(&a1->m_lockSprite->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v118);
((void (__fastcall *)(CCSpriteWithHue *))a1->m_wraithSprite->setScale_0)(a1->m_wraithSprite);
v77 = CCMenuItemSpriteExtra::create(
a1->m_wraithSprite,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)SecretLayer5::onSubmit);
a1->m_wraithButton = v77;
v78 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v46->addChild_1)(v46, v77);
m_wraithButton = a1->m_wraithButton;
v80 = m_wraithButton->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v78, v120 * 0.5);
v81 = cocos2d::CCNode::convertToNodeSpace(v46, (const struct cocos2d::CCPoint *)&v118);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v80->setPosition_0)(m_wraithButton, v81);
HIDWORD(a1->m_wraithButton->m_pfnSelector.adj) = 1060320051;
v82 = LoadingCircleSprite::create(0.5);
a1->m_circleSprite = v82;
((void (__fastcall *)(LoadingCircleSprite *))v82->setScale_0)(v82);
a1->addChild_0(a1, a1->m_circleSprite, 28);
a1->m_circleSprite->setOpacity(&a1->m_circleSprite->cocos2d::CCRGBAProtocol, 0);
a1->m_circleSprite->setPosition_0(a1->m_circleSprite, (const cocos2d::CCPoint *)v121);
v118 = 0x100000302LL;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))a1->m_circleSprite->setBlendFunc)(
&a1->m_circleSprite->cocos2d::CCTextureProtocol,
0x100000302LL);
LOWORD(v118) = 25800;
BYTE2(v118) = -1;
a1->m_circleSprite->setColor(&a1->m_circleSprite->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v118);
v83 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v119 = (void **)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v119);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v83 = (GameManager *)qword_1406C2ED8;
}
v84 = v83;
if ( v83->m_loadedFont != 19 )
{
if ( v83->m_loadedFont )
{
v85 = cocos2d::CCString::createWithFormat("gjFont%02d.png", v83->m_loadedFont);
CString = cocos2d::CCString::getCString(v85);
v87 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v87, CString);
}
v88 = cocos2d::CCString::createWithFormat("gjFont%02d.png", 19);
v89 = cocos2d::CCString::getCString(v88);
v90 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v90, v89, 0);
v83 = (GameManager *)qword_1406C2ED8;
v84->m_loadedFont = 19;
}
v119 = (void **)&v127;
v127 = 0;
v128 = 1;
v129 = 15;
LOWORD(v127) = (unsigned __int8)asc_140518984[0];
if ( !v83 )
{
v126 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v126);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v83 = (GameManager *)qword_1406C2ED8;
}
GameManager::loadFont(v83, 19);
v91 = cocos2d::CCString::createWithFormat("gjFont%02d.fnt", 19);
v92 = (char *)cocos2d::CCString::getCString(v91);
cocos2d::CCPoint::CCPoint(0.0, 0.5);
v94 = TextArea::create((__int64)&v127, v92, 1.0, 533.33331, v93, 1101004800, 0);
a1->m_messageArea = (TextArea *)v94;
v95 = *(_QWORD *)v94;
cocos2d::CCPoint::CCPoint(20.0, 0.5);
(*(void (__fastcall **)(TextArea *, __int64))(v95 + 272))(a1->m_messageArea, v96);
((void (__fastcall *)(TextArea *))a1->m_messageArea->setScale_0)(a1->m_messageArea);
v97 = ((float (__fastcall *)(SecretLayer5 *, TextArea *, __int64))a1->addChild_0)(a1, a1->m_messageArea, 3);
cocos2d::CCPoint::CCPoint(v97, 0.0);
cocos2d::CCPoint::operator+(v121, &v118);
a1->m_messageArea->setPosition_0(a1->m_messageArea, (const cocos2d::CCPoint *)&v118);
v99 = (cocos2d::CCArray *)cocos2d::CCArray::create(v98);
a1->m_torchFires = v99;
cocos2d::CCObject::retain(v99);
LOWORD(v118) = 23160;
do
{
v100 = cocos2d::CCSprite::createWithSpriteFrameName("towerTorchInner_001.png");
LOWORD(v118) = 23160;
BYTE2(v118) = -103;
v100->setColor(&v100->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v118);
a1->addChild_0(a1, v100, 4);
v101 = v100->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v102 = 195;
if ( !v2 )
v102 = -195;
v103 = cocos2d::CCPoint::CCPoint(v120 * 0.5, (float)v102 + (float)(v120 * 0.5));
v101->setPosition_0(v100, v104);
v106 = (cocos2d::CCArray *)cocos2d::CCArray::create(v105);
cocos2d::CCPoint::CCPoint(*(float *)&v103, 0.0);
v107 = (__int64)v100->getPosition_0(v100);
cocos2d::CCPoint::operator+(v107, &v119);
LevelAreaLayer::addTorch(a1, (cocos2d::CCPoint)&v119, 2, 1.0, 4, 1, 1, v106);
v108 = cocos2d::CCArray::objectAtIndex(v106, 0);
cocos2d::CCArray::addObject(a1->m_torchFires, v108);
v109 = cocos2d::CCArray::objectAtIndex(v106, 1u);
cocos2d::CCArray::addObject(a1->m_torchFires, v109);
++v2;
}
while ( v2 < 2 );
cocos2d::CCNode::scheduleUpdate(a1);
v110 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
Block[0] = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v110 = qword_1406C2EC0;
}
*(_QWORD *)(v110 + 864) = &a1->GJOnlineRewardDelegate;
v111 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Block[0] = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v111 = (GameManager *)qword_1406C2ED8;
}
if ( !GameManager::getUGV(v111, (const char *)&word_14055A53C) )
{
a1->m_uiLocked = 1;
v112 = cocos2d::CCCallFunc::create(a1, SecretLayer5::showFirstDialog);
v113 = cocos2d::CCDelayTime::create(1.2);
v114 = cocos2d::CCSequence::create(v113, v112, 0);
cocos2d::CCNode::runAction((CCLightFlash *)a1, (cocos2d::CCPoint)v114, v115, 1.0, v117);
a1->m_textInput->setTouchEnabled(a1->m_textInput, 0);
}
return 1;
}
return result;
}