//
// SecretLayer5::init from 0x10047a040 to 0x10047b05e (4126 bytes)
//
// 2 xrefs:
// > SecretLayer5::create @ 0x10047a004
// > ??> @ 0x10093b2c0
//
// 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 __fastcall SecretLayer5::init(SecretLayer5 *a1)
{
bool v1; // bl
cocos2d::CCTextureCache *v2; // rax
cocos2d::CCSpriteFrameCache *v3; // rax
cocos2d::CCTextureCache *v4; // rax
cocos2d::CCSpriteFrameCache *v5; // rax
GameManager *v6; // rax
std::vector *p_m_soundEffects; // r15
unsigned int v8; // eax
std::__vector_base::pointer begin; // rbx
std::__vector_base::pointer end; // r15
unsigned int v11; // eax
__int64 v12; // r14
unsigned __int64 v13; // r15
unsigned __int64 v14; // r14
__int64 v15; // rax
int v16; // ecx
cocos2d::CCSprite *v17; // r15
cocos2d::CCSprite **p_m_background; // r14
cocos2d::CCSprite *v19; // rbx
cocos2d::CCSprite *v20; // rdi
cocos2d::CCLabelBMFont *v21; // rax
SecretLayer5 *v22; // rdi
cocos2d::CCLabelBMFont **p_m_messageLabel; // rbx
cocos2d::CCLabelBMFont *m_messageLabel; // r15
cocos2d::extension::CCScale9Sprite *v25; // rax
cocos2d::extension::CCScale9Sprite **p_m_inputBackground; // rbx
CCTextInputNode *v27; // rax
SecretLayer5 *v28; // rdi
CCTextInputNode **p_m_textInput; // rbx
_QWORD *v30; // rdi
CCTextInputNode *v31; // r15
cocos2d::CCSprite *v32; // rax
CCMenuItemSpriteExtra *v33; // r12
int v34; // edx
int v35; // ecx
int v36; // r8d
int v37; // r9d
cocos2d::CCDirector *v38; // rax
cocos2d::CCDirector *v39; // rax
double v40; // xmm0_8
__int64 v41; // rax
cocos2d::CCObject_vtbl *m_wraithGraySprite; // rax
cocos2d::CCObject *p_m_wraithGraySprite; // rbx
cocos2d::CCNode **p_m_wraithSprite; // r15
cocos2d::CCObject_vtbl *v45; // r12
const cocos2d::CCPoint *m_wraithSprite; // rbx
cocos2d::CCSprite *v47; // rax
cocos2d::CCSprite **p_m_eyesSprite; // r14
cocos2d::CCSprite *v49; // r13
const cocos2d::CCPoint *v50; // rbx
cocos2d::CCNode *v51; // r13
cocos2d::CCSprite *v52; // rax
const cocos2d::CCPoint *v53; // rbx
cocos2d::CCSprite **p_m_lockSprite; // r14
cocos2d::CCSprite *m_lockSprite; // rbx
cocos2d::CCSprite *v56; // rdi
CCMenuItemSpriteExtra *v57; // rax
CCMenuItemSpriteExtra **p_m_wraithButton; // rbx
CCMenuItemSpriteExtra *m_wraithButton; // r13
LoadingCircleSprite *v60; // rax
LoadingCircleSprite **p_m_circleSprite; // rbx
LoadingCircleSprite *v62; // rdi
GameManager *v63; // rax
GameManager *v64; // rax
const char *FontFile; // r15
char *m_messageArea; // r15
TextArea **p_m_messageArea; // rbx
TextArea *v68; // r15
cocos2d::CCObject_vtbl *v69; // rax
cocos2d::CCSprite *v70; // r12
__int64 v71; // r15
unsigned __int64 *v72; // r12
cocos2d::CCObject *p_m_torchFires; // r13
cocos2d::CCObject_vtbl *m_torchFires; // rbx
__int64 v75; // rax
cocos2d::CCObject_vtbl *v76; // rbx
__int64 v77; // rax
cocos2d::CCSprite *v78; // r12
__int64 v79; // r15
unsigned __int64 *v80; // r12
cocos2d::CCObject_vtbl *v81; // rbx
__int64 v82; // rax
cocos2d::CCObject_vtbl *v83; // rbx
__int64 v84; // rax
GameManager *v85; // rax
cocos2d::CCDelayTime *v86; // r15
cocos2d::CCCallFunc *v87; // rax
cocos2d::CCSequence *v88; // rax
__int16 v90; // [rsp+10h] [rbp-130h] BYREF
char v91; // [rsp+12h] [rbp-12Eh]
__int128 v92; // [rsp+28h] [rbp-118h] BYREF
void *v93; // [rsp+38h] [rbp-108h]
unsigned __int64 v94[2]; // [rsp+40h] [rbp-100h] BYREF
void *v95[3]; // [rsp+50h] [rbp-F0h] BYREF
std::string v96; // [rsp+68h] [rbp-D8h] BYREF
unsigned __int64 v97; // [rsp+84h] [rbp-BCh] BYREF
float v98; // [rsp+8Ch] [rbp-B4h]
const cocos2d::CCPoint *v99; // [rsp+90h] [rbp-B0h]
unsigned __int64 v100; // [rsp+9Ch] [rbp-A4h] BYREF
float v101; // [rsp+A4h] [rbp-9Ch] BYREF
float v102; // [rsp+A8h] [rbp-98h]
unsigned __int64 v103; // [rsp+ACh] [rbp-94h] BYREF
bool v104; // [rsp+B7h] [rbp-89h]
SecretLayer5 *v105; // [rsp+B8h] [rbp-88h]
__m256i v106; // [rsp+C0h] [rbp-80h] BYREF
__int128 v107; // [rsp+E0h] [rbp-60h]
__int128 v108; // [rsp+F0h] [rbp-50h]
int v109; // [rsp+100h] [rbp-40h]
char v110[12]; // [rsp+104h] [rbp-3Ch] BYREF
double v111; // 0:xmm0_8.8
double v112; // 0:xmm0_8.8
double v113; // 0:xmm0_8.8
double v114; // 0:xmm0_8.8
cocos2d::CCRect v115; // 0:xmm0_8.8,8:xmm1_8.8
v105 = a1;
v1 = cocos2d::CCLayer::init(a1);
if ( v1 )
{
v2 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v2, "SecretSheet.png", 0);
v3 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2(v3, "SecretSheet.plist");
v4 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v4, "TowerSheet.png", 0);
v5 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2(v5, "TowerSheet.plist");
v6 = GameManager::sharedState();
strcpy((char *)v95, " secretLoop04.ogg");
GameManager::fadeInMusic(*(__m128 *)"secretLoop04.ogg", (__int64)v6, (unsigned __int8 *)v95);
v104 = v1;
if ( ((__int64)v95[0] & 1) != 0 )
operator delete(v95[2]);
((void (__fastcall *)(SecretLayer5 *, __int64))v105->setKeypadEnabled)(v105, 1);
((void (__fastcall *)(SecretLayer5 *, __int64))v105->setKeyboardEnabled)(v105, 1);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v101);
v108 = xmmword_10081C92C;
v107 = xmmword_10081C91C;
v106 = (__m256i)ymmword_10081C8FC;
v109 = 22349;
p_m_soundEffects = &v105->m_soundEffects;
sub_100480AC0(&v105->m_soundEffects, &v106, v110, 17);
v8 = time(nullptr);
srand(v8);
begin = p_m_soundEffects->__begin_;
end = v105->m_soundEffects.__end_;
v11 = rand();
LODWORD(v100) = v11
+ (v11 + ((v11 / 0x7FFFFFFF) | ((v11 / 0x7FFFFFFF) << 31)) == 0)
+ ((v11 / 0x7FFFFFFF) | ((v11 / 0x7FFFFFFF) << 31));
v12 = end - begin;
if ( v12 >= 2 )
{
v106.i64[0] = 0;
v106.i64[1] = 0x7FFFFFFFFFFFFFFFLL;
v13 = (unsigned __int64)(end - 1);
if ( v13 > (unsigned __int64)begin )
{
v14 = v12 - 1;
do
{
v94[0] = 0;
v94[1] = v14;
v15 = sub_100480CE0(&v106, &v100, v94);
if ( v15 )
{
v16 = *begin;
*begin = begin[v15];
begin[v15] = v16;
}
++begin;
--v14;
}
while ( (unsigned __int64)begin < v13 );
}
}
v17 = cocos2d::CCSprite::create_1("GJ_gradientBG.png");
v105->m_background = v17;
sub_10028CBE0((float *)v106.i32, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v17->setAnchorPoint)(v17, &v106);
p_m_background = &v105->m_background;
((void (__fastcall *)(SecretLayer5 *, cocos2d::CCSprite *, __int64))v105->addChild_0)(
v105,
v105->m_background,
4294967293LL);
((void (__fastcall *)(cocos2d::CCSprite *, float))(*p_m_background)->setScaleX)(
*p_m_background,
(float)(v101 + 10.0) / (*p_m_background)->m_obRect.size.width);
((void (__fastcall *)(cocos2d::CCSprite *, float))(*p_m_background)->setScaleY)(
*p_m_background,
(float)(v102 + 10.0) / (*p_m_background)->m_obRect.size.height);
v19 = *p_m_background;
sub_10028CBE0((float *)v106.i32, -5.0, -5.0);
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v19->setPosition)(v19, &v106);
v20 = *p_m_background;
v106.i8[2] = 47;
v106.i16[0] = 3613;
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v20->setColor)(v20, &v106);
sub_10028CC00((__int64)v94, 0.0, 0.0, (__m128)0x42200000u, (__m128)0x42200000u);
sub_10028CBE0((float *)&v100, v101 * 0.5, (float)(v102 * 0.5) + 55.0);
v21 = cocos2d::CCLabelBMFont::create_3(" ", "bigFont.fnt");
v22 = v105;
v105->m_messageLabel = v21;
((void (__fastcall *)(SecretLayer5 *, cocos2d::CCLabelBMFont *))v22->addChild)(v22, v21);
p_m_messageLabel = &v105->m_messageLabel;
m_messageLabel = v105->m_messageLabel;
sub_10028CBE0((float *)&v97, 0.0, 43.0);
sub_10028CCE0((double *)v106.i64, &v100, &v97);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __m256i *))m_messageLabel->setPosition)(m_messageLabel, &v106);
HIBYTE(v90) = 32;
v91 = 0;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))(*p_m_messageLabel)->setString)(
*p_m_messageLabel,
(char *)&v90 + 1);
v115.size = (cocos2d::CCSize)1058642330LL;
cocos2d::CCLabelBMFont::limitLabelWidth(v105->m_messageLabel, 320.0, 0.60000002, 0.0);
*(double *)&v115.origin = sub_10028D180((__m128 *)&v106, v94);
v25 = cocos2d::extension::CCScale9Sprite::create_2("square02b_small.png", v115);
v105->m_inputBackground = v25;
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v25->setOpacity)(v25, 100);
sub_10028CBF0((float *)&v97, 200.0, 40.0);
p_m_inputBackground = &v105->m_inputBackground;
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, unsigned __int64 *))v105->m_inputBackground->setContentSize)(
v105->m_inputBackground,
&v97);
((void (__fastcall *)(SecretLayer5 *, cocos2d::extension::CCScale9Sprite *, __int64))v105->addChild_0)(
v105,
*p_m_inputBackground,
4294967294LL);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, unsigned __int64 *))(*p_m_inputBackground)->setPosition)(
*p_m_inputBackground,
&v100);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, void *))(*p_m_inputBackground)->setColor)(
*p_m_inputBackground,
&unk_10081C940);
v27 = CCTextInputNode::create(180.0, 50.0, "...", "Thonburi", 24, "bigFont.fnt");
v28 = v105;
v105->m_textInput = v27;
((void (__fastcall *)(SecretLayer5 *, CCTextInputNode *, __int64))v28->addChild_0)(v28, v27, 20);
p_m_textInput = &v105->m_textInput;
v30 = &v105->m_textInput->__vftable;
v30[68] = &v105->TextInputDelegate;
(*(void (__fastcall **)(_QWORD *, unsigned __int64 *))(*v30 + 184LL))(v30, &v100);
CCTextInputNode::setMaxLabelScale(*p_m_textInput, 0.69999999);
CCTextInputNode::setMaxLabelWidth(*p_m_textInput, 180.0);
((void (__fastcall *)(cocos2d::CCTextFieldTTF *, _QWORD))(*p_m_textInput)->m_textField->setVisible)(
(*p_m_textInput)->m_textField,
0);
v31 = *p_m_textInput;
(*p_m_textInput)->m_maxLabelLength = 100;
v96.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x68u);
v96.__r_.__value_.__r.__words[0] = 105;
v96.__r_.__value_.__l.__size_ = 97;
strcpy(
v96.__r_.__value_.__l.__data_,
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
CCTextInputNode::setAllowedChars((std::string *)v31, &v96);
if ( (*(_BYTE *)&v96.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v96.__r_.__value_.__l.__data_);
SecretLayer5::updateSearchLabel(v105, "");
v32 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v33 = CCMenuItemSpriteExtra::create(
v32,
nullptr,
v105,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SecretLayer5::onBack);
CCMenuItemSpriteExtra::setSizeMult(v33, 1.5);
v99 = (const cocos2d::CCPoint *)sub_100792C50((_DWORD)v33, 0, v34, v35, v36, v37);
((void (__fastcall *)(SecretLayer5 *, const cocos2d::CCPoint *, __int64))v105->addChild_0)(v105, v99, 1);
v38 = cocos2d::CCDirector::sharedDirector();
v98 = sub_100484D90(v38);
v39 = cocos2d::CCDirector::sharedDirector();
v40 = sub_100484D70(v39);
sub_10028CBE0((float *)v106.i32, v98 + 24.0, *(float *)&v40 + -23.0);
(*(void (__fastcall **)(const cocos2d::CCPoint *, __m256i *))(*(_QWORD *)v99 + 184LL))(v99, &v106);
if ( PlatformToolbox::isControllerConnected() )
GameToolbox::addBackButton(v105, v33);
strcpy(v106.i8, ",GJ_secretLock4_001.png");
v41 = CCSpriteWithHue::createWithSpriteFrameName(&v106);
v105->m_wraithSprite = (CCSpriteWithHue *)v41;
if ( (v106.i8[0] & 1) != 0 )
operator delete((void *)v106.i64[2]);
strcpy(v106.i8, ",GJ_secretLock4_001.png");
m_wraithGraySprite = (cocos2d::CCObject_vtbl *)CCSpriteGrayscale::createWithSpriteFrameName(&v106);
v105->m_wraithGraySprite = (CCSpriteGrayscale *)m_wraithGraySprite;
if ( (v106.i8[0] & 1) != 0 )
{
operator delete((void *)v106.i64[2]);
m_wraithGraySprite = (cocos2d::CCObject_vtbl *)v105->m_wraithGraySprite;
}
v106.i8[2] = -1;
v106.i16[0] = 25800;
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *, __m256i *))m_wraithGraySprite->copyWithZone + 118))(
m_wraithGraySprite,
&v106);
((void (__fastcall *)(CCSpriteWithHue *, CCSpriteGrayscale *, __int64))v105->m_wraithSprite->addChild_0)(
v105->m_wraithSprite,
v105->m_wraithGraySprite,
1);
p_m_wraithGraySprite = (cocos2d::CCObject *)&v105->m_wraithGraySprite;
((void (__fastcall *)(CCSpriteGrayscale *, _QWORD))v105->m_wraithGraySprite->setOpacity)(
v105->m_wraithGraySprite,
0);
p_m_wraithSprite = &v105->m_wraithSprite;
v45 = p_m_wraithGraySprite->__vftable;
m_wraithSprite = (const cocos2d::CCPoint *)v105->m_wraithSprite;
sub_10028CBE0((float *)&v103, 0.0, 0.0);
*(cocos2d::CCPoint *)&v111 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v106, m_wraithSprite);
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *, __m256i *, double))v45->copyWithZone + 23))(v45, &v106, v111);
v47 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock4_eyes_001.png");
v105->m_eyesSprite = v47;
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v47->setBlendFunc)(v47, 0x100000302LL);
p_m_eyesSprite = &v105->m_eyesSprite;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *, __int64))(*p_m_wraithSprite)->addChild_0)(
*p_m_wraithSprite,
v105->m_eyesSprite,
2);
v49 = *p_m_eyesSprite;
v50 = (const cocos2d::CCPoint *)*p_m_wraithSprite;
sub_10028CBE0((float *)&v103, 0.0, 0.0);
*(cocos2d::CCPoint *)&v112 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v106, v50);
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *, double))v49->setPosition)(v49, &v106, v112);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))(*p_m_eyesSprite)->setOpacity)(*p_m_eyesSprite, 0);
cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock2_2_001.png");
v51 = cocos2d::CCNode::create();
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock2_2_001.png");
v105->m_lockSprite = v52;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *, __int64))v51->addChild_0)(v51, v52, 0xFFFFFFFFLL);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCNode *, __int64))(*p_m_wraithSprite)->addChild_0)(
*p_m_wraithSprite,
v51,
4294967294LL);
v53 = (const cocos2d::CCPoint *)*p_m_wraithSprite;
sub_10028CBE0((float *)&v103, 0.0, -30.0);
*(cocos2d::CCPoint *)&v113 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v106, v53);
((void (__fastcall *)(cocos2d::CCNode *, __m256i *, double))v51->setPosition)(v51, &v106, v113);
p_m_lockSprite = &v105->m_lockSprite;
m_lockSprite = v105->m_lockSprite;
sub_10028CBE0((float *)v106.i32, 0.0, 25.0);
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))m_lockSprite->setPosition)(m_lockSprite, &v106);
v56 = *p_m_lockSprite;
v106.i8[2] = -103;
v106.i16[0] = 18286;
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v56->setColor)(v56, &v106);
((void (__fastcall *)(cocos2d::CCNode *, float))(*p_m_wraithSprite)->setScale)(*p_m_wraithSprite, 1.2);
v57 = CCMenuItemSpriteExtra::create(
*p_m_wraithSprite,
nullptr,
v105,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SecretLayer5::onSubmit);
v105->m_wraithButton = v57;
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v99 + 440LL))(v99, v57);
p_m_wraithButton = &v105->m_wraithButton;
m_wraithButton = v105->m_wraithButton;
sub_10028CBE0((float *)&v103, v101 * 0.5, (float)(0.5 * v102) + -25.0);
*(cocos2d::CCPoint *)&v114 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v106, v99);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __m256i *, double))m_wraithButton->setPosition)(
m_wraithButton,
&v106,
v114);
CCMenuItemSpriteExtra::setSizeMult(*p_m_wraithButton, 0.69999999);
v60 = LoadingCircleSprite::create(0.5);
v105->m_circleSprite = v60;
((void (__fastcall *)(LoadingCircleSprite *, float))v60->setScale)(v60, 0.5);
p_m_circleSprite = &v105->m_circleSprite;
((void (__fastcall *)(SecretLayer5 *, LoadingCircleSprite *, __int64))v105->addChild_0)(
v105,
v105->m_circleSprite,
28);
((void (__fastcall *)(LoadingCircleSprite *, _QWORD))(*p_m_circleSprite)->setOpacity)(*p_m_circleSprite, 0);
((void (__fastcall *)(LoadingCircleSprite *, unsigned __int64 *))(*p_m_circleSprite)->setPosition)(
*p_m_circleSprite,
&v100);
((void (__fastcall *)(LoadingCircleSprite *, __int64))(*p_m_circleSprite)->setBlendFunc)(
*p_m_circleSprite,
0x100000302LL);
v62 = *p_m_circleSprite;
v106.i8[2] = -1;
v106.i16[0] = 25800;
((void (__fastcall *)(LoadingCircleSprite *, __m256i *))v62->setColor)(v62, &v106);
v63 = GameManager::sharedState();
GameManager::loadFont(v63, 19);
LOWORD(v92) = 8194;
BYTE2(v92) = 0;
v64 = GameManager::sharedState();
FontFile = GameManager::getFontFile(v64, 19);
sub_10028CBE0((float *)v106.i32, 0.5, 1.0);
m_messageArea = TextArea::create(&v92, (__int64)FontFile, (double *)v106.i64, 0, 1.0, 533.33331, 20.0);
v105->m_messageArea = (TextArea *)m_messageArea;
if ( (v92 & 1) != 0 )
{
operator delete(v93);
m_messageArea = (char *)v105->m_messageArea;
}
sub_10028CBE0((float *)v106.i32, 0.5, 0.5);
(*(void (__fastcall **)(char *, __m256i *))(*(_QWORD *)m_messageArea + 280LL))(m_messageArea, &v106);
((void (__fastcall *)(TextArea *, float))v105->m_messageArea->setScale)(v105->m_messageArea, 0.75);
p_m_messageArea = &v105->m_messageArea;
((void (__fastcall *)(SecretLayer5 *, TextArea *, __int64))v105->addChild_0)(v105, v105->m_messageArea, 3);
v68 = *p_m_messageArea;
sub_10028CBE0((float *)&v103, 0.0, 60.0);
sub_10028CCE0((double *)v106.i64, &v100, &v103);
((void (__fastcall *)(TextArea *, __m256i *))v68->setPosition)(v68, &v106);
v69 = (cocos2d::CCObject_vtbl *)sub_10071F9E0(v68, &v106);
v105->m_torchFires = (cocos2d::CCArray *)v69;
cocos2d::CCObject::retain((cocos2d::CCObject *)v69);
v70 = cocos2d::CCSprite::createWithSpriteFrameName("towerTorchInner_001.png");
v106.i8[2] = -103;
v106.i16[0] = 23160;
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v70->setColor)(v70, &v106);
((void (__fastcall *)(SecretLayer5 *, cocos2d::CCSprite *, __int64))v105->addChild_0)(v105, v70, 4);
sub_10028CBE0((float *)v106.i32, (float)(v101 * 0.5) + -195.0, (float)(v102 * 0.5) + 4.0);
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v70->setPosition)(v70, &v106);
v71 = sub_10071F9E0(v70, &v106);
v72 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v70->getPosition)(v70);
sub_10028CBE0((float *)&v103, 0.0, 33.0);
sub_10028CCE0((double *)v106.i64, v72, &v103);
LevelAreaLayer::addTorch(v105, (cocos2d::CCPoint)1065353216LL, (int)&v106, 33.0, 2, 4, 1, (cocos2d::CCArray *)1);
p_m_torchFires = (cocos2d::CCObject *)&v105->m_torchFires;
m_torchFires = (cocos2d::CCObject_vtbl *)v105->m_torchFires;
v75 = sub_1007200C0(v71, 0);
sub_10071FCD0(m_torchFires, v75);
v76 = p_m_torchFires->__vftable;
v77 = sub_1007200C0(v71, 1);
sub_10071FCD0(v76, v77);
v78 = cocos2d::CCSprite::createWithSpriteFrameName("towerTorchInner_001.png");
v106.i8[2] = -103;
v106.i16[0] = 23160;
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v78->setColor)(v78, &v106);
((void (__fastcall *)(SecretLayer5 *, cocos2d::CCSprite *, __int64))v105->addChild_0)(v105, v78, 4);
sub_10028CBE0((float *)v106.i32, (float)(v101 * 0.5) + 195.0, (float)(0.5 * v102) + 4.0);
((void (__fastcall *)(cocos2d::CCSprite *, __m256i *))v78->setPosition)(v78, &v106);
v79 = sub_10071F9E0(v78, &v106);
v80 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v78->getPosition)(v78);
sub_10028CBE0((float *)&v103, 0.0, 33.0);
sub_10028CCE0((double *)v106.i64, v80, &v103);
LevelAreaLayer::addTorch(v105, (cocos2d::CCPoint)1065353216LL, (int)&v106, 33.0, 2, 4, 1, (cocos2d::CCArray *)1);
v81 = p_m_torchFires->__vftable;
v82 = sub_1007200C0(v79, 0);
sub_10071FCD0(v81, v82);
v83 = p_m_torchFires->__vftable;
v84 = sub_1007200C0(v79, 1);
sub_10071FCD0(v83, v84);
cocos2d::CCNode::scheduleUpdate(v105);
GameLevelManager::sharedState()->m_GJOnlineRewardDelegate = &v105->GJOnlineRewardDelegate;
v85 = GameManager::sharedState();
if ( !GameManager::getUGV(v85, "38") )
{
v105->m_uiLocked = 1;
v86 = cocos2d::CCDelayTime::create(1.2);
v87 = cocos2d::CCCallFunc::create(v105, (cocos2d::SEL_CallFunc)(unsigned __int64)SecretLayer5::showFirstDialog);
v88 = sub_1003B5760(v86, v87, 0);
cocos2d::CCNode::runAction(v105, v88);
((void (__fastcall *)(CCTextInputNode *, _QWORD))v105->m_textInput->setTouchEnabled)(v105->m_textInput, 0);
}
return v104;
}
return v1;
}