//
// SecretLayer2::onSecretLevel from 0x100498d10 to 0x100498e80 (368 bytes)
//
// 1 xrefs:
// > SecretLayer2::init @ 0x100496bb3
//
// This function is hookable on this platform (idp: pc, 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:30:50 +0000
//
__int64 __fastcall SecretLayer2::onSecretLevel(__int64 a1, __m128 a2)
{
__int64 v2; // rax
__int64 v3; // rax
__int64 MainLevel; // rbx
__int64 v5; // r14
_DWORD *v6; // rax
char *v7; // rax
char *v9; // rax
__int64 v10; // r14
std::string v11; // [rsp+0h] [rbp-40h] BYREF
std::string v12; // [rsp+18h] [rbp-28h] BYREF
v2 = GameStatsManager::sharedState();
if ( (int)GameStatsManager::getStat(v2, "13", a2) < 200 )
{
v12.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)26;
strcpy(v12.__r_.__value_.__s.__data_, "The Keymaster");
v11.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v11.__r_.__value_.__r.__words[0] = 57;
v11.__r_.__value_.__l.__size_ = 52;
strcpy(v11.__r_.__value_.__l.__data_, "You are not prepared.\nCollect more diamonds...");
v9 = DialogObject::create(&v12, &v11, 2, 0, 0xFFFFFF, 1.0);
v10 = DialogLayer::create((__int64)v9, 2u);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v11.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v12.__r_.__value_.__l.__data_);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v10, 100);
DialogLayer::updateChatPlacement(v10, 0);
return DialogLayer::animateInRandomSide(v10);
}
else
{
v3 = GameLevelManager::sharedState(*(double *)a2.i64);
MainLevel = GameLevelManager::getMainLevel(v3, 3001, 0);
*(_DWORD *)(GameManager::sharedState() + 708) = 12;
v5 = cocos2d::CCDirector::sharedDirector();
v6 = PlayLayer::scene(MainLevel, 0);
v7 = cocos2d::CCTransitionFade::create_1((__int64)v6, 0.5);
return cocos2d::CCDirector::replaceScene(v5, v7);
}
}