//
// LevelPage::onSecretDoor from 0x8c6a90 to 0x8c70f0 (1632 bytes)
//
// 3 xrefs:
// > ??> @ 0xea8c8
// > LevelPage::addSecretDoor @ 0x8c6404
// > ??> @ 0x1547168
//
// 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 12:56:34 +0000
//
__int64 __fastcall LevelPage::onSecretDoor(LevelPage *this, cocos2d::CCObject *a2)
{
GameManager *v4; // x0
GameManager *UGV; // x0
GameManager *v6; // x0
GameManager *v7; // x0
const char *v8; // x1
cocos2d::CCNode *v9; // x20
void (__fastcall *v10)(cocos2d::CCNode *, char *); // x23
__int64 v11; // x0
cocos2d::CCScaleTo *v12; // x0
cocos2d::CCEaseBounceOut *v13; // x0
cocos2d::CCActionInterval *v14; // x1
cocos2d::CCAction *v15; // x0
cocos2d::CCFadeOut *v16; // x0
cocos2d::CCAction *v17; // x0
GameManager *v18; // x0
GameStatsManager *v19; // x0
__int64 v20; // x0
cocos2d::CCArray *isItemUnlocked; // x0
int v22; // w20
cocos2d::CCArray *v23; // x24
cocos2d::CCObject *v24; // x0
cocos2d::CCObject *v25; // x0
cocos2d::CCObject *v26; // x0
int v27; // w2
cocos2d::CCDirector *v28; // x0
__int64 v29; // x2
cocos2d::CCDirector *v30; // x20
cocos2d::CCDirector *v31; // x0
__int64 v32; // x0
cocos2d::CCObject *v33; // x0
cocos2d::CCObject *v34; // x0
cocos2d::CCObject *v35; // x0
int v36; // w2
SecretLayer4 *v37; // x20
cocos2d::CCTransitionFade *v38; // x0
cocos2d::CCScene *v39; // x1
cocos2d::CCScene *v40; // x0
float v41; // [xsp+50h] [xbp+50h]
char v42[8]; // [xsp+70h] [xbp+70h] BYREF
__int64 v43; // [xsp+78h] [xbp+78h] BYREF
__int64 v44; // [xsp+80h] [xbp+80h]
void *v45; // [xsp+88h] [xbp+88h]
__int64 v46; // [xsp+90h] [xbp+90h] BYREF
__int64 v47; // [xsp+98h] [xbp+98h]
void *v48; // [xsp+A0h] [xbp+A0h]
if ( !s_didClick )
{
v4 = (GameManager *)GameManager::sharedState(nullptr);
UGV = (GameManager *)(unsigned __int8)GameManager::getUGV(v4, "7");
if ( (_BYTE)UGV )
{
v18 = (GameManager *)GameManager::sharedState(UGV);
v19 = (GameStatsManager *)(unsigned __int8)GameManager::getUGV(v18, "8");
if ( (_BYTE)v19 )
{
s_didClick = (unsigned __int8)&dword_0 + 1;
v37 = (SecretLayer4 *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)((char *)&dword_0 + 1));
v38 = (cocos2d::CCTransitionFade *)SecretLayer4::scene(v37);
v40 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create(v38, 0.5, v39);
cocos2d::CCDirector::replaceScene(v37, v40);
}
else
{
v20 = GameStatsManager::sharedState(v19);
isItemUnlocked = (cocos2d::CCArray *)GameStatsManager::isItemUnlocked(v20, 12, 4);
v22 = (unsigned __int8)isItemUnlocked;
v43 = 0;
v44 = 0;
v23 = (cocos2d::CCArray *)cocos2d::CCArray::create(isItemUnlocked);
if ( v22 )
{
v45 = nullptr;
std::string::__init(&v43, "The Gatekeeper", 0xEu);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "The Master Emblem!", 0x1Au);
v24 = (cocos2d::CCObject *)DialogObject::create(&v43, &v46, 7, 1, 0xFFFFFF, 1.0);
cocos2d::CCArray::addObject(v23, v24);
if ( (v46 & 1) != 0 )
operator delete(v48);
if ( (v43 & 1) != 0 )
operator delete(v45);
v43 = 0;
v44 = 0;
v45 = nullptr;
std::string::__init(&v43, "The Gatekeeper", 0xEu);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "Lord RubRub, I will open the gate for you.", 0x32u);
v25 = (cocos2d::CCObject *)DialogObject::create(&v43, &v46, 7, 0, 0xFFFFFF, 0.8);
cocos2d::CCArray::addObject(v23, v25);
if ( (v46 & 1) != 0 )
operator delete(v48);
if ( (v43 & 1) != 0 )
operator delete(v45);
v43 = 0;
v44 = 0;
v45 = nullptr;
std::string::__init(&v43, "The Gatekeeper", 0xEu);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "Please, come in.", 0x10u);
v26 = (cocos2d::CCObject *)DialogObject::create(&v43, &v46, 7, 0, 0xFFFFFF, 1.0);
cocos2d::CCArray::addObject(v23, v26);
if ( (v46 & 1) != 0 )
operator delete(v48);
if ( (v43 & 1) != 0 )
operator delete(v45);
v28 = (cocos2d::CCDirector *)DialogLayer::createWithObjects(
v23,
(cocos2d::CCArray *)((char *)&dword_0 + 2),
v27);
v29 = *(_QWORD *)v28;
*((_QWORD *)v28 + 78) = (char *)this + 408;
v30 = v28;
v31 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(cocos2d::CCDirector *, __int64))(v29 + 72))(v28, 2);
}
else
{
v45 = nullptr;
std::string::__init(&v43, "The Gatekeeper", 0xEu);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "Who disturbs my slumber?", 0x18u);
v33 = (cocos2d::CCObject *)DialogObject::create(&v43, &v46, 7, 1, 0xFFFFFF, 1.0);
cocos2d::CCArray::addObject(v23, v33);
if ( (v46 & 1) != 0 )
operator delete(v48);
if ( (v43 & 1) != 0 )
operator delete(v45);
v43 = 0;
v44 = 0;
v45 = nullptr;
std::string::__init(&v43, "The Gatekeeper", 0xEu);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "RubRub is that you?\nI cannot see in this light.", 0x3Du);
v34 = (cocos2d::CCObject *)DialogObject::create(&v43, &v46, 7, 0, 0xFFFFFF, 1.0);
cocos2d::CCArray::addObject(v23, v34);
if ( (v46 & 1) != 0 )
operator delete(v48);
if ( (v43 & 1) != 0 )
operator delete(v45);
v43 = 0;
v44 = 0;
v45 = nullptr;
std::string::__init(&v43, "The Gatekeeper", 0xEu);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "Show me the Master Emblem,\nand I will let you pass.", 0x41u);
v35 = (cocos2d::CCObject *)DialogObject::create(&v43, &v46, 7, 0, 0xFFFFFF, 1.0);
cocos2d::CCArray::addObject(v23, v35);
if ( (v46 & 1) != 0 )
operator delete(v48);
if ( (v43 & 1) != 0 )
operator delete(v45);
v31 = (cocos2d::CCDirector *)DialogLayer::createWithObjects(
v23,
(cocos2d::CCArray *)((char *)&dword_0 + 2),
v36);
v30 = v31;
}
v32 = cocos2d::CCDirector::sharedDirector(v31);
(*(void (__fastcall **)(_QWORD, cocos2d::CCDirector *, __int64))(**(_QWORD **)(v32 + 272) + 464LL))(
*(_QWORD *)(v32 + 272),
v30,
1000);
DialogLayer::updateChatPlacement(v30, 0);
DialogLayer::animateIn(v30, 2);
}
}
else
{
v6 = *((GameManager **)this + 71);
if ( v6 )
{
v7 = (GameManager *)GameManager::sharedState(v6);
GameManager::setUGV(v7, "7", 1u);
v9 = (cocos2d::CCNode *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"secretDoorBtn2_closed_001.png",
v8);
(*(void (__fastcall **)(_QWORD, cocos2d::CCNode *, __int64))(**((_QWORD **)this + 71) + 464LL))(
*((_QWORD *)this + 71),
v9,
2);
v10 = *(void (__fastcall **)(cocos2d::CCNode *, char *))(*(_QWORD *)v9 + 184LL);
v41 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 71) + 328LL))(*((_QWORD *)this + 71))
* 0.5;
v11 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 71) + 328LL))(*((_QWORD *)this + 71));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, v41, *(float *)(v11 + 4) * 0.5);
v10(v9, v42);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)v9 + 1080LL))(v9, 0x100000302LL);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 71) + 912LL))(
*((_QWORD *)this + 71),
0xFFFFFFFFLL);
v12 = (cocos2d::CCScaleTo *)(*(__int64 (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 71) + 160LL))(
*((_QWORD *)this + 71),
2.0);
v13 = (cocos2d::CCEaseBounceOut *)cocos2d::CCScaleTo::create(v12, 0.5, 1.0);
v15 = (cocos2d::CCAction *)cocos2d::CCEaseBounceOut::create(v13, v14);
v16 = (cocos2d::CCFadeOut *)cocos2d::CCNode::runAction(*((cocos2d::CCNode **)this + 71), v15);
v17 = (cocos2d::CCAction *)cocos2d::CCFadeOut::create(v16, 0.5);
cocos2d::CCNode::runAction(v9, v17);
}
}
}
return _stack_chk_guard;
}