//
// SecretLayer2::onSecretLevel from 0x10030baec to 0x10030bc14 (296 bytes)
//
// 1 xrefs:
// > SecretLayer2::init @ 0x10030a040
//
// 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 SecretLayer2::onSecretLevel(SecretLayer2 *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // x0
GameLevelManager *v4; // x0
GJGameLevel *MainLevel; // x19
cocos2d::CCDirector *v6; // x20
cocos2d::CCScene *v7; // x0
cocos2d::CCTransitionFade *v8; // x0
char *v9; // x0
DialogLayer *v10; // x20
void *__p[2]; // [xsp+0h] [xbp-40h] BYREF
char v12; // [xsp+17h] [xbp-29h]
void *v13[2]; // [xsp+18h] [xbp-28h] BYREF
char v14; // [xsp+2Fh] [xbp-11h]
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "13") < 200 )
{
sub_100009900(v13, "The Keymaster");
sub_100009900(__p, "You are not prepared.\nCollect more diamonds...");
v9 = DialogObject::create((__int64)v13, (__int64)__p, 2, 0, 0xFFFFFF, 1.0);
v10 = DialogLayer::create((DialogObject *)v9, 2);
if ( v12 < 0 )
operator delete(__p[0]);
if ( v14 < 0 )
operator delete(v13[0]);
((void (__fastcall *)(SecretLayer2 *, DialogLayer *, __int64))a1->addChild_0)(a1, v10, 100);
DialogLayer::updateChatPlacement(v10, Center);
DialogLayer::animateInRandomSide(v10);
}
else
{
v4 = GameLevelManager::sharedState();
MainLevel = GameLevelManager::getMainLevel(v4, 3001, 0);
GameManager::sharedState()->m_sceneEnum = 12;
v6 = cocos2d::CCDirector::sharedDirector();
v7 = PlayLayer::scene(MainLevel, 0, 0);
v8 = cocos2d::CCTransitionFade::create_1(0.5, v7);
cocos2d::CCDirector::replaceScene(v6, v8);
}
}