//
// LevelPage::onSecretDoor from 0x513a2c to 0x513e44 (1048 bytes)
//
// 0 xrefs:
//
// 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:51:35 +0000
//
GameManager *__fastcall LevelPage::onSecretDoor(GameManager *this, cocos2d::CCObject *a2)
{
GameManager *v2; // r6
GameManager *v3; // r0
GameManager *v4; // r0
const char *v5; // r1
cocos2d::CCNode *v6; // r5
void (__fastcall *v7)(cocos2d::CCNode *, _DWORD *); // r7
float v8; // s17
int v9; // r0
float v10; // r2
cocos2d::CCEaseBounceOut *v11; // r0
cocos2d::CCActionInterval *v12; // r1
cocos2d::CCAction *v13; // r0
float v14; // r1
cocos2d::CCAction *v15; // r0
GameManager *v16; // r0
cocos2d::CCDirector *UGV; // r0
SecretLayer4 *v18; // r4
float v19; // r0
cocos2d::CCScene *v20; // r2
cocos2d::CCScene *v21; // r0
int v22; // r0
cocos2d::CCArray *isItemUnlocked; // r8
cocos2d::CCArray *v24; // r9
cocos2d::CCObject *v25; // r0
cocos2d::CCObject *v26; // r0
cocos2d::CCObject *v27; // r0
cocos2d::CCObject *v28; // r0
cocos2d::CCObject *v29; // r0
int v30; // r2
cocos2d::CCDirector *v31; // r0
cocos2d::CCDirector *v32; // r4
int v33; // r3
int v34; // r0
int v35; // [sp+4h] [bp-30h]
int v36; // [sp+4h] [bp-30h]
int v37; // [sp+4h] [bp-30h]
int v38; // [sp+4h] [bp-30h]
_DWORD v39[2]; // [sp+Ch] [bp-28h] BYREF
int v40; // [sp+14h] [bp-20h] BYREF
int v41; // [sp+18h] [bp-1Ch]
int v42; // [sp+1Ch] [bp-18h]
int v43; // [sp+20h] [bp-14h] BYREF
int v44; // [sp+24h] [bp-10h]
int v45; // [sp+28h] [bp-Ch]
v2 = this;
if ( !s_didClick )
{
v3 = (GameManager *)GameManager::sharedState(this);
this = (GameManager *)GameManager::getUGV(v3, (char *)&a1i2r3e45s789g[9]);
if ( this )
{
v16 = (GameManager *)GameManager::sharedState(this);
UGV = (cocos2d::CCDirector *)GameManager::getUGV(v16, (char *)&a1i2r3e45s789g[10]);
if ( UGV )
{
s_didClick = 1;
v18 = (SecretLayer4 *)cocos2d::CCDirector::sharedDirector(UGV);
v19 = COERCE_FLOAT(SecretLayer4::scene(v18));
v21 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create((cocos2d::CCTransitionFade *)0x3F000000, v19, v20);
return (GameManager *)cocos2d::CCDirector::replaceScene(v18, v21);
}
else
{
v22 = GameStatsManager::sharedState(nullptr);
isItemUnlocked = (cocos2d::CCArray *)GameStatsManager::isItemUnlocked(v22, 12, 4);
v24 = (cocos2d::CCArray *)cocos2d::CCArray::create(isItemUnlocked);
v40 = 0;
v41 = 0;
v42 = 0;
std::string::__init(&v40, "The Gatekeeper", 0xEu);
v43 = 0;
v44 = 0;
v45 = 0;
if ( isItemUnlocked )
{
std::string::__init(&v43, "The Master Emblem!", 0x1Au);
LOWORD(v35) = -1;
BYTE2(v35) = -1;
v28 = (cocos2d::CCObject *)DialogObject::create(&v40, &v43, 7, 1065353216, 1, v35);
cocos2d::CCArray::addObject(v24, v28);
std::string::~string((int)&v43);
std::string::~string((int)&v40);
v40 = 0;
v41 = 0;
v42 = 0;
std::string::__init(&v40, "The Gatekeeper", 0xEu);
v43 = 0;
v44 = 0;
v45 = 0;
std::string::__init(&v43, "Lord RubRub, I will open the gate for you.", 0x32u);
LOWORD(v38) = -1;
BYTE2(v38) = -1;
v29 = (cocos2d::CCObject *)DialogObject::create(&v40, &v43, 7, 1061997773, 0, v38);
cocos2d::CCArray::addObject(v24, v29);
std::string::~string((int)&v43);
std::string::~string((int)&v40);
v40 = 0;
v41 = 0;
v42 = 0;
std::string::__init(&v40, "The Gatekeeper", 0xEu);
v43 = 0;
v44 = 0;
v45 = 0;
std::string::__init(&v43, "Please, come in.", 0x10u);
}
else
{
std::string::__init(&v43, "Who disturbs my slumber?", 0x18u);
LOWORD(v35) = -1;
BYTE2(v35) = -1;
v25 = (cocos2d::CCObject *)DialogObject::create(&v40, &v43, 7, 1065353216, 1, v35);
cocos2d::CCArray::addObject(v24, v25);
std::string::~string((int)&v43);
std::string::~string((int)&v40);
v40 = 0;
v41 = 0;
v42 = 0;
std::string::__init(&v40, "The Gatekeeper", 0xEu);
v43 = 0;
v44 = 0;
v45 = 0;
std::string::__init(&v43, "RubRub is that you?\nI cannot see in this light.", 0x3Du);
LOWORD(v36) = -1;
BYTE2(v36) = -1;
v26 = (cocos2d::CCObject *)DialogObject::create(&v40, &v43, 7, 1065353216, 0, v36);
cocos2d::CCArray::addObject(v24, v26);
std::string::~string((int)&v43);
std::string::~string((int)&v40);
v40 = 0;
v41 = 0;
v42 = 0;
std::string::__init(&v40, "The Gatekeeper", 0xEu);
v43 = 0;
v44 = 0;
v45 = 0;
std::string::__init(&v43, "Show me the Master Emblem,\nand I will let you pass.", 0x41u);
}
LOWORD(v37) = -1;
BYTE2(v37) = -1;
v27 = (cocos2d::CCObject *)DialogObject::create(&v40, &v43, 7, 1065353216, 0, v37);
cocos2d::CCArray::addObject(v24, v27);
std::string::~string((int)&v43);
std::string::~string((int)&v40);
v31 = (cocos2d::CCDirector *)DialogLayer::createWithObjects(
v24,
(cocos2d::CCArray *)((char *)&dword_0 + 2),
v30);
v32 = v31;
if ( isItemUnlocked )
{
v33 = *(_DWORD *)v31;
*((_DWORD *)v31 + 122) = (char *)v2 + 316;
v31 = (cocos2d::CCDirector *)(*(int (__fastcall **)(cocos2d::CCDirector *, int))(v33 + 36))(v31, 2);
}
v34 = cocos2d::CCDirector::sharedDirector(v31);
(*(void (__fastcall **)(_DWORD, cocos2d::CCDirector *, int))(**(_DWORD **)(v34 + 220) + 232))(
*(_DWORD *)(v34 + 220),
v32,
1000);
DialogLayer::updateChatPlacement(v32, 0);
return (GameManager *)DialogLayer::animateIn(v32, 2);
}
}
else if ( *((_DWORD *)v2 + 100) )
{
v4 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::setUGV(v4, (char *)&a1i2r3e45s789g[9], (_BYTE *)&dword_0 + 1);
v6 = (cocos2d::CCNode *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"secretDoorBtn2_closed_001.png",
v5);
(*(void (__fastcall **)(_DWORD, cocos2d::CCNode *, int))(**((_DWORD **)v2 + 100) + 232))(
*((_DWORD *)v2 + 100),
v6,
2);
v7 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v6 + 92);
v8 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v2 + 100) + 164))(*((_DWORD *)v2 + 100));
v9 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)v2 + 100) + 164))(*((_DWORD *)v2 + 100));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v8 * 0.5, *(float *)(v9 + 4) * 0.5);
v7(v6, v39);
v39[0] = 770;
v39[1] = 1;
(*(void (__fastcall **)(cocos2d::CCNode *, int, int))(*(_DWORD *)v6 + 540))(v6, 770, 1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)v2 + 100) + 456))(*((_DWORD *)v2 + 100), 255);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)v2 + 100) + 80))(*((_DWORD *)v2 + 100), 0x40000000);
v11 = (cocos2d::CCEaseBounceOut *)cocos2d::CCScaleTo::create(COERCE_COCOS2D_CCSCALETO_(0.5), 1.0, v10);
v13 = (cocos2d::CCAction *)cocos2d::CCEaseBounceOut::create(v11, v12);
cocos2d::CCNode::runAction(*((cocos2d::CCNode **)v2 + 100), v13);
v15 = (cocos2d::CCAction *)cocos2d::CCFadeOut::create(COERCE_COCOS2D_CCFADEOUT_(0.5), v14);
return (GameManager *)cocos2d::CCNode::runAction(v6, v15);
}
}
return this;
}