//
// LevelPage::onSecretDoor from 0x100436b90 to 0x100437265 (1749 bytes)
//
// 1 xrefs:
// > LevelPage::addSecretDoor @ 0x10043662a
//
// 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
//
void __fastcall LevelPage::onSecretDoor(LevelPage *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // rax
GameManager *v4; // rax
cocos2d::CCDirector *v5; // rbx
cocos2d::CCScene *v6; // rax
cocos2d::CCTransitionFade *v7; // rax
GameManager *v8; // rax
cocos2d::CCSprite *v9; // rbx
__int64 v10; // rax
cocos2d::CCScaleTo *v11; // rax
cocos2d::CCEaseBounceOut *v12; // rax
cocos2d::CCFadeOut *v13; // rax
GameStatsManager *v14; // rdi
bool isItemUnlocked; // r15
cocos2d::CCArray *v16; // rbx
char *v17; // rax
char *v18; // rax
char *v19; // rax
DialogLayer *v20; // rbx
char *v21; // rax
char *v22; // rax
char *v23; // rax
cocos2d::CCDirector *v24; // rax
float v25; // [rsp+8h] [rbp-158h] BYREF
std::string v26; // [rsp+10h] [rbp-150h] BYREF
std::string v27; // [rsp+28h] [rbp-138h] BYREF
std::string v28; // [rsp+40h] [rbp-120h] BYREF
std::string v29; // [rsp+58h] [rbp-108h] BYREF
std::string v30; // [rsp+70h] [rbp-F0h] BYREF
std::string v31; // [rsp+88h] [rbp-D8h] BYREF
__int128 v32; // [rsp+A0h] [rbp-C0h] BYREF
void *v33; // [rsp+B0h] [rbp-B0h]
__int128 v34; // [rsp+B8h] [rbp-A8h] BYREF
void *v35; // [rsp+C8h] [rbp-98h]
__int128 v36; // [rsp+D0h] [rbp-90h] BYREF
void *v37; // [rsp+E0h] [rbp-80h]
__int128 v38; // [rsp+E8h] [rbp-78h] BYREF
void *v39; // [rsp+F8h] [rbp-68h]
__int128 v40; // [rsp+100h] [rbp-60h] BYREF
void *v41; // [rsp+110h] [rbp-50h]
__int128 v42; // [rsp+118h] [rbp-48h] BYREF
void *v43; // [rsp+128h] [rbp-38h]
float v44; // [rsp+134h] [rbp-2Ch]
if ( !byte_1009A4F9C )
{
v3 = GameManager::sharedState();
if ( GameManager::getUGV(v3, "7") )
{
v4 = GameManager::sharedState();
if ( GameManager::getUGV(v4, "8") )
{
byte_1009A4F9C = 1;
v5 = cocos2d::CCDirector::sharedDirector();
v6 = SecretLayer4::scene();
v7 = cocos2d::CCTransitionFade::create_1(0.5, v6);
cocos2d::CCDirector::replaceScene(v5, v7);
}
else
{
v14 = GameStatsManager::sharedState();
isItemUnlocked = GameStatsManager::isItemUnlocked(v14, GJItem, 4);
v16 = (cocos2d::CCArray *)sub_10071F9E0(v14, 12);
if ( isItemUnlocked )
{
LOBYTE(v38) = 28;
strcpy((char *)&v38 + 1, "The Gatekeeper");
v29.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
v29.__r_.__value_.__r.__words[0] = 33;
v29.__r_.__value_.__l.__size_ = 26;
strcpy(v29.__r_.__value_.__l.__data_, "The Master Emblem!");
v17 = DialogObject::create(&v38, &v29, 7, 1, 0xFFFFFF, 1.0);
sub_10071FCD0(v16, v17);
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v29.__r_.__value_.__l.__data_);
if ( (v38 & 1) != 0 )
operator delete(v39);
LOBYTE(v40) = 28;
strcpy((char *)&v40 + 1, "The Gatekeeper");
v30.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v30.__r_.__value_.__r.__words[0] = 57;
v30.__r_.__value_.__l.__size_ = 50;
strcpy(v30.__r_.__value_.__l.__data_, "Lord RubRub, I will open the gate for you.");
v18 = DialogObject::create(&v40, &v30, 7, 0, 0xFFFFFF, 0.80000001);
sub_10071FCD0(v16, v18);
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v30.__r_.__value_.__l.__data_);
if ( (v40 & 1) != 0 )
operator delete(v41);
LOBYTE(v42) = 28;
strcpy((char *)&v42 + 1, "The Gatekeeper");
strcpy((char *)&v31, " Please, come in.");
v19 = DialogObject::create(&v42, &v31, 7, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v16, v19);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v31.__r_.__value_.__l.__data_);
if ( (v42 & 1) != 0 )
operator delete(v43);
v20 = DialogLayer::createWithObjects(v16, 2);
v20->m_delegate = &a1->DialogDelegate;
((void (__fastcall *)(DialogLayer *, __int64))v20->setTag)(v20, 2);
}
else
{
LOBYTE(v32) = 28;
strcpy((char *)&v32 + 1, "The Gatekeeper");
v26.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
v26.__r_.__value_.__r.__words[0] = 33;
v26.__r_.__value_.__l.__size_ = 24;
strcpy(v26.__r_.__value_.__l.__data_, "Who disturbs my slumber?");
v21 = DialogObject::create(&v32, &v26, 7, 1, 0xFFFFFF, 1.0);
sub_10071FCD0(v16, v21);
if ( (*(_BYTE *)&v26.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v26.__r_.__value_.__l.__data_);
if ( (v32 & 1) != 0 )
operator delete(v33);
LOBYTE(v34) = 28;
strcpy((char *)&v34 + 1, "The Gatekeeper");
v27.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v27.__r_.__value_.__r.__words[0] = 65;
v27.__r_.__value_.__l.__size_ = 61;
strcpy(v27.__r_.__value_.__l.__data_, "RubRub is that you?\nI cannot see in this light.");
v22 = DialogObject::create(&v34, &v27, 7, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v16, v22);
if ( (*(_BYTE *)&v27.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v27.__r_.__value_.__l.__data_);
if ( (v34 & 1) != 0 )
operator delete(v35);
LOBYTE(v36) = 28;
strcpy((char *)&v36 + 1, "The Gatekeeper");
v28.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x48u);
v28.__r_.__value_.__r.__words[0] = 73;
v28.__r_.__value_.__l.__size_ = 65;
strcpy(v28.__r_.__value_.__l.__data_, "Show me the Master Emblem,\nand I will let you pass.");
v23 = DialogObject::create(&v36, &v28, 7, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v16, v23);
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v28.__r_.__value_.__l.__data_);
if ( (v36 & 1) != 0 )
operator delete(v37);
v20 = DialogLayer::createWithObjects(v16, 2);
}
v24 = cocos2d::CCDirector::sharedDirector();
((void (__fastcall *)(cocos2d::CCScene *, DialogLayer *, __int64))v24->m_pRunningScene->addChild_0)(
v24->m_pRunningScene,
v20,
1000);
DialogLayer::updateChatPlacement(v20, Center);
DialogLayer::animateIn(v20, FromLeft);
}
}
else if ( a1->m_secretDoor )
{
v8 = GameManager::sharedState();
GameManager::setUGV(v8, "7", 1);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("secretDoorBtn2_closed_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_secretDoor->addChild_0)(
a1->m_secretDoor,
v9,
2);
v44 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_secretDoor->getContentSize)(a1->m_secretDoor)
* 0.5;
v10 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_secretDoor->getContentSize)(a1->m_secretDoor);
sub_10028CBE0(&v25, v44, *(float *)(v10 + 4) * 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, float *))v9->setPosition)(v9, &v25);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v9->setBlendFunc)(v9, 0x100000302LL);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_secretDoor->setOpacity)(a1->m_secretDoor, 255);
((void (__fastcall *)(cocos2d::CCSprite *, float))a1->m_secretDoor->setScale)(a1->m_secretDoor, 2.0);
v11 = cocos2d::CCScaleTo::create_1(0.5, 1.0);
v12 = cocos2d::CCEaseBounceOut::create(v11);
cocos2d::CCNode::runAction(a1->m_secretDoor, v12);
v13 = cocos2d::CCFadeOut::create(0.5);
cocos2d::CCNode::runAction(v9, v13);
}
}
}