//
// LevelAreaLayer::init from 0x6a4a20 to 0x6a528c (2156 bytes)
//
// 1 xrefs:
// > LevelAreaLayer::create @ 0x6a38f4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:56:29 +0000
//
int __fastcall LevelAreaLayer::init(cocos2d::CCNode **this)
{
GameManager *v2; // r0
GameManager *v3; // r11
FMODAudioEngine *v4; // r5
cocos2d::CCArray *v5; // r0
cocos2d::CCObject *v6; // r0
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCTextureCache *v8; // r0
cocos2d::CCSpriteFrameCache *v9; // r0
cocos2d::CCSpriteFrameCache *v10; // r0
cocos2d::CCDirector *v11; // r0
const char *v12; // r1
int v13; // r0
cocos2d::CCMenu *v14; // r7
int v15; // r6
cocos2d::CCDirector *v16; // r0
int (__fastcall *v17)(int, _DWORD *); // r9
cocos2d::CCDirector *v18; // r0
float v19; // s16
cocos2d::CCDirector *v20; // r0
float v21; // r0
PlatformToolbox *v22; // r0
GameManager *isControllerConnected; // r0
cocos2d::CCMenuItem *v24; // r2
GameManager *v25; // r0
cocos2d::CCSprite *BGTexture; // r0
const char *v27; // r1
float *v28; // r6
int v29; // r0
void (__fastcall *v30)(float *, _DWORD *); // r5
void (__fastcall *v31)(float *, _DWORD *); // r5
void (__fastcall *v32)(float *, _DWORD *); // r3
cocos2d::CCNode *v33; // r6
int v34; // r3
int v35; // r3
unsigned __int8 v36; // r2
cocos2d::CCEaseInOut *v37; // r0
float v38; // r2
cocos2d::CCSequence *v39; // r10
unsigned __int8 v40; // r2
cocos2d::CCEaseInOut *v41; // r0
float v42; // r2
cocos2d::CCFiniteTimeAction *v43; // r0
cocos2d::CCRepeatForever *v44; // r0
cocos2d::CCActionInterval *v45; // r1
cocos2d::CCAction *v46; // r0
const char *v47; // r1
cocos2d::CCNode *v48; // r0
cocos2d::CCNode *v49; // r3
int v50; // r6
void (__fastcall *v51)(int, _DWORD *); // r9
const char *v52; // r1
int v53; // r6
int v54; // r0
unsigned __int8 *v55; // r7
const cocos2d::CCPoint *v56; // r9
int v57; // r10
int v58; // r1
int v59; // r10
const char *v60; // r1
float *v61; // r6
void (__fastcall *v62)(float *, _DWORD *); // r7
float v63; // r1
void (__fastcall *v64)(float *, _DWORD *); // r2
float *v65; // r6
void (__fastcall *v66)(float *, _DWORD *); // r9
void (__fastcall *v67)(float *, _DWORD *); // r3
int v68; // r8
void (__fastcall *v69)(int, _DWORD *); // r9
int v70; // r10
const cocos2d::CCPoint *v71; // r2
cocos2d::CCEaseInOut *v72; // r0
float v73; // r2
cocos2d::CCSequence *v74; // r8
const cocos2d::CCPoint *v75; // r2
cocos2d::CCEaseInOut *v76; // r0
float v77; // r2
cocos2d::CCFiniteTimeAction *v78; // r0
cocos2d::CCRepeatForever *v79; // r0
cocos2d::CCActionInterval *v80; // r1
cocos2d::CCAction *v81; // r0
int v82; // r5
void (__fastcall *v83)(int, _DWORD *); // r9
void (__fastcall *v84)(int, _DWORD *); // r9
int v85; // r6
float *v86; // r0
int v87; // r5
float v88; // s15
int v89; // r0
GameManager *v90; // r0
GameManager *v91; // r0
int UGV; // r0
float v93; // r1
cocos2d::CCSequence *v94; // r0
cocos2d::CCSequence *v95; // r5
cocos2d::CCFiniteTimeAction *v96; // r0
cocos2d::CCAction *v97; // r0
void (__fastcall *v99)(cocos2d::CCNode *, _DWORD *); // [sp+14h] [bp-68h]
void (__fastcall *v100)(unsigned __int8 *, _DWORD *); // [sp+14h] [bp-68h]
float v101; // [sp+20h] [bp-5Ch] BYREF
float v102; // [sp+24h] [bp-58h]
int v103; // [sp+28h] [bp-54h]
int v104; // [sp+2Ch] [bp-50h]
_BYTE v105[8]; // [sp+30h] [bp-4Ch] BYREF
_BYTE v106[8]; // [sp+38h] [bp-44h] BYREF
_BYTE *(__fastcall *v107)(_BYTE *, cocos2d::CCObject *); // [sp+40h] [bp-3Ch]
int v108; // [sp+44h] [bp-38h]
_DWORD v109[2]; // [sp+48h] [bp-34h] BYREF
_DWORD v110[2]; // [sp+50h] [bp-2Ch] BYREF
int v111; // [sp+58h] [bp-24h] BYREF
int v112; // [sp+5Ch] [bp-20h]
int v113; // [sp+60h] [bp-1Ch]
_DWORD v114[4]; // [sp+64h] [bp-18h] BYREF
v2 = (GameManager *)cocos2d::CCLayer::init((cocos2d::CCLayer *)this);
v3 = v2;
if ( v2 )
{
v111 = 0;
v112 = 0;
v113 = 0;
v4 = (FMODAudioEngine *)GameManager::sharedState(v2);
std::string::__init(&v111, "tower01.mp3", 0xBu);
GameManager::fadeInMusic(v4, (unsigned __int8 *)&v111);
v5 = (cocos2d::CCArray *)std::string::~string((int)&v111);
v6 = (cocos2d::CCObject *)cocos2d::CCArray::create(v5);
*(this + 81) = v6;
v7 = (cocos2d::CCTextureCache *)cocos2d::CCObject::retain(v6);
v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v7);
v9 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCTextureCache::addImage(v8, "TowerSheet.png", 0);
v10 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v9);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v10, "TowerSheet.plist");
(*((void (__fastcall **)(cocos2d::CCNode **, int))*this + 134))(this, 1);
v11 = (cocos2d::CCDirector *)(*((int (__fastcall **)(cocos2d::CCNode **, int))*this + 136))(this, 1);
cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v101);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_03_001.png", v12);
v107 = LevelAreaLayer::onBack;
v108 = 0;
v14 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v13, 0, (int)this, (int)LevelAreaLayer::onBack, 0);
CCMenuItemSpriteExtra::setSizeMult((int)v14, 1.6);
v15 = cocos2d::CCMenu::create(v14, nullptr);
v16 = (cocos2d::CCDirector *)(*((int (__fastcall **)(cocos2d::CCNode **, int, int))*this + 58))(this, v15, 1);
v17 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v15 + 92);
v18 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v16);
v19 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v18));
v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v19));
v21 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v20));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v114, v19 + 24.0, v21 - 23.0);
v22 = (PlatformToolbox *)v17(v15, v114);
isControllerConnected = (GameManager *)PlatformToolbox::isControllerConnected(v22);
if ( isControllerConnected )
isControllerConnected = (GameManager *)GameToolbox::addBackButton((GameToolbox *)this, v14, v24);
v25 = (GameManager *)GameManager::sharedState(isControllerConnected);
BGTexture = (cocos2d::CCSprite *)GameManager::getBGTexture(v25, (_BYTE *)&dword_14 + 3);
v28 = (float *)cocos2d::CCSprite::create(BGTexture, v27);
v114[0] = 9729;
v114[1] = 9729;
v114[2] = 10497;
v114[3] = 10497;
v29 = (*(int (__fastcall **)(float *))(*(_DWORD *)v28 + 536))(v28);
cocos2d::CCTexture2D::setTexParameters(v29, v114);
(*((void (__fastcall **)(cocos2d::CCNode **, float *, int))*this + 58))(this, v28, -3);
v30 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v28 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, 0.0);
v30(v28, v110);
(*(void (__fastcall **)(float *, _DWORD))(*(_DWORD *)v28 + 80))(v28, v101 / v28[86]);
v31 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v28 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, -50.0);
v31(v28, v110);
v32 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v28 + 480);
LOWORD(v110[0]) = 15360;
BYTE2(v110[0]) = -76;
v32(v28, v110);
v109[0] = -1761607936;
v110[0] = 16776960;
v33 = (cocos2d::CCNode *)cocos2d::CCLayerGradient::create(v109, v110);
v34 = *(_DWORD *)v33;
v103 = 770;
v104 = 1;
v99 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(v34 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, 1.0);
v99(v33, v110);
(*(void (__fastcall **)(cocos2d::CCNode *, int, int))(*(_DWORD *)v33 + 644))(v33, v103, v104);
v35 = *(_DWORD *)v33;
*((_BYTE *)v33 + 457) = 1;
(*(void (__fastcall **)(cocos2d::CCNode *, int))(v35 + 72))(v33, 1060320051);
(*(void (__fastcall **)(cocos2d::CCNode *))(*(_DWORD *)v33 + 648))(v33);
(*((void (__fastcall **)(cocos2d::CCNode **, cocos2d::CCNode *, int))*this + 58))(this, v33, 2);
v37 = (cocos2d::CCEaseInOut *)cocos2d::CCFadeTo::create((cocos2d::CCFadeTo *)0x40400000, COERCE_FLOAT(255), v36);
v39 = (cocos2d::CCSequence *)cocos2d::CCEaseInOut::create(v37, (cocos2d::CCActionInterval *)0x40000000, v38);
v41 = (cocos2d::CCEaseInOut *)cocos2d::CCFadeTo::create((cocos2d::CCFadeTo *)0x40400000, COERCE_FLOAT(150), v40);
v43 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCEaseInOut::create(v41, (cocos2d::CCActionInterval *)0x40000000, v42);
v44 = (cocos2d::CCRepeatForever *)cocos2d::CCSequence::create(v39, v43, 0);
v46 = (cocos2d::CCAction *)cocos2d::CCRepeatForever::create(v44, v45);
cocos2d::CCNode::runAction(v33, v46);
v48 = (cocos2d::CCNode *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"theTower_01_001.png",
v47);
v49 = *this;
*(this + 80) = v48;
(*((void (__fastcall **)(cocos2d::CCNode **, cocos2d::CCNode *, int))v49 + 58))(this, v48, 1);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 80) + 80))(*(this + 80), 1065353216);
v50 = (int)*(this + 80);
v51 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v50 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, v101 * 0.5, v102 * 0.5);
v51(v50, v110);
v53 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", v52);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v53 + 64))(v53, 0x40000000);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v53 + 72))(v53, 1074580685);
v109[0] = LevelAreaLayer::onClickDoor;
v109[1] = 0;
v54 = CCMenuItemSpriteExtra::create(v53, 0, (int)this, (int)LevelAreaLayer::onClickDoor, 0);
v111 = 0;
v112 = 0;
v113 = 0;
v55 = (unsigned __int8 *)v54;
std::string::__init(&v111, "door02.ogg", 0xAu);
std::string::operator=(v55 + 328, (unsigned __int8 *)&v111);
std::string::~string((int)&v111);
v56 = (const cocos2d::CCPoint *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v55, nullptr);
(*((void (__fastcall **)(cocos2d::CCNode **, const cocos2d::CCPoint *, int))*this + 58))(this, v56, 10);
v100 = *(void (__fastcall **)(unsigned __int8 *, _DWORD *))(*(_DWORD *)v55 + 92);
v57 = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 80) + 96))(*(this + 80));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v105, 0.0, -75.0);
v58 = v57;
v59 = 0;
cocos2d::CCPoint::operator+(v106, v58, v105);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v110, v56);
v100(v55, v110);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v53 + 456))(v53, 0);
while ( 1 )
{
v61 = (float *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"godray01_001.png", v60);
(*(void (__fastcall **)(float *, void *))(*(_DWORD *)v61 + 480))(v61, &unk_BEF93C);
(*((void (__fastcall **)(cocos2d::CCNode **, float *, int))*this + 58))(this, v61, -1);
(*(void (__fastcall **)(float *, _DWORD))(*(_DWORD *)v61 + 64))(v61, v102 / v61[86]);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v61 + 72))(v61, 1077936128);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v61 + 180))(v61, 1119092736);
v62 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v61 + 92);
v63 = v59 ? v101 : 0.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, v63, v102 * 0.5);
v62(v61, v110);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v61 + 456))(v61, 125);
v64 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v61 + 480);
LOWORD(v110[0]) = 0;
BYTE2(v110[0]) = 50;
v64(v61, v110);
if ( v59 )
break;
v59 = 1;
}
v65 = (float *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"godray01_001.png", v60);
(*(void (__fastcall **)(float *, void *))(*(_DWORD *)v65 + 480))(v65, &unk_BEF93C);
(*((void (__fastcall **)(cocos2d::CCNode **, float *, int))*this + 58))(this, v65, -1);
(*(void (__fastcall **)(float *, _DWORD))(*(_DWORD *)v65 + 64))(v65, v101 / v65[86]);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v65 + 72))(v65, 1065353216);
v66 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v65 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, v101 * 0.5, 0.0);
v66(v65, v110);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v65 + 456))(v65, 125);
v67 = *(void (__fastcall **)(float *, _DWORD *))(*(_DWORD *)v65 + 480);
LOBYTE(v110[0]) = 0;
*(_WORD *)((char *)v110 + 1) = 12800;
v67(v65, v110);
v68 = (int)*(this + 80);
v69 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v68 + 92);
v70 = (*(int (__fastcall **)(int))(*(_DWORD *)v68 + 96))(v68);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, -2.0);
cocos2d::CCPoint::operator+(v110, v70, v106);
v69(v68, v110);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, 4.0);
v72 = (cocos2d::CCEaseInOut *)cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x40000000, COERCE_FLOAT(v110), v71);
v74 = (cocos2d::CCSequence *)cocos2d::CCEaseInOut::create(v72, (cocos2d::CCActionInterval *)0x40000000, v73);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 0.0, -4.0);
v76 = (cocos2d::CCEaseInOut *)cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x40000000, COERCE_FLOAT(v110), v75);
v78 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCEaseInOut::create(v76, (cocos2d::CCActionInterval *)0x40000000, v77);
v79 = (cocos2d::CCRepeatForever *)cocos2d::CCSequence::create(v74, v78, 0);
v81 = (cocos2d::CCAction *)cocos2d::CCRepeatForever::create(v79, v80);
cocos2d::CCNode::runAction(*(this + 80), v81);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v105, v101 * 0.5, (float)(v102 * 0.5) + 13.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, 0.0);
cocos2d::CCPoint::operator+(v110, v105, v106);
LevelAreaLayer::addGodRay(this, 50.0, 0.0, 125.0, (cocos2d::CCFadeTo *)0x40A00000, COERCE_INT(4.0), (int)v110);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, 10.0);
cocos2d::CCPoint::operator+(v110, v105, v106);
LevelAreaLayer::addGodRay(this, 25.0, 125.0, 0.0, COERCE_COCOS2D_CCFADETO_(3.0), 1075838976, (int)v110);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, 20.0);
cocos2d::CCPoint::operator+(v110, v105, v106);
LevelAreaLayer::addGodRay(this, 125.0, 25.0, 125.0, COERCE_COCOS2D_CCFADETO_(4.0), COERCE_INT(3.0), (int)v110);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, -20.0);
cocos2d::CCPoint::operator+(v110, v105, v106);
LevelAreaLayer::addGodRay(this, 75.0, 0.0, 100.0, (cocos2d::CCFadeTo *)0x40C00000, 1075838976, (int)v110);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, -10.0);
cocos2d::CCPoint::operator+(v110, v105, v106);
LevelAreaLayer::addGodRay(this, 0.0, 100.0, 25.0, (cocos2d::CCFadeTo *)0x40A00000, 1080033280, (int)v110);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, 0.0, 10.0);
cocos2d::CCPoint::operator+(v110, v105, v106);
LevelAreaLayer::addGodRay(this, 0.0, 75.0, 25.0, (cocos2d::CCFadeTo *)0x40900000, 1075838976, (int)v110);
v111 = 0;
v112 = 0;
v113 = 0;
std::string::__init(
&v111,
"60a-1a8a2a6a90a90a0a2a45a70a0a0a0a0a0a0a1a0a0a0a1a0a0.886275a0a0a0a0a0.7a1a0a0a0a1a0a0.552941a0a0a0a0a0.7a2a0a2a0a"
"0a0a0a0a0a0a0a2a1a0a0a0a0a0a0a0a0a0a0a0a0a0a0",
0x9Fu);
v82 = GameToolbox::particleFromString((unsigned __int8 *)&v111, 0, 0);
std::string::~string((int)&v111);
(*((void (__fastcall **)(cocos2d::CCNode **, int, _DWORD))*this + 58))(this, v82, 0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v82 + 180))(v82, 1106247680);
v83 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v82 + 480);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 100.0, 40.0);
v83(v82, v110);
v84 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v82 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v106, -100.0, 60.0);
v85 = 20;
cocos2d::CCPoint::operator+(v110, v105, v106);
v84(v82, v110);
do
{
(*(void (__fastcall **)(int, int))(*(_DWORD *)v82 + 20))(v82, 1045220557);
--v85;
}
while ( v85 );
v86 = (float *)(*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 80) + 164))(*(this + 80));
v87 = (int)*(this + 80);
v88 = *v86;
v89 = (*(int (__fastcall **)(int))(*(_DWORD *)v87 + 164))(v87);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v110,
(float)(v88 * 0.5) + 35.0,
(float)(*(float *)(v89 + 4) * 0.5) - 69.5);
v90 = (GameManager *)LevelAreaLayer::addTorch(v87, (int)v110, 1, 0.4, 6, 0, 0, nullptr);
v91 = (GameManager *)GameManager::sharedState(v90);
UGV = GameManager::getUGV(v91, "29");
if ( UGV )
{
return UGV;
}
else
{
*((_BYTE *)this + 328) = 1;
v94 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3F99999A, v93);
v110[1] = 0;
v110[0] = LevelAreaLayer::showDialog;
v95 = v94;
v96 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, LevelAreaLayer::showDialog, 0);
v97 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v95, v96, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)this, v97);
}
}
return (int)v3;
}