//
// OptionsLayer::onSecretVault from 0x8f725c to 0x8f7578 (796 bytes)
//
// 3 xrefs:
// > ??> @ 0x90d18
// > OptionsLayer::customSetup @ 0x8f43f8
// > ??> @ 0x1543df0
//
// 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:57:01 +0000
//
__int64 __fastcall OptionsLayer::onSecretVault(OptionsLayer *this, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // x0
cocos2d::CCDirector *Stat; // x0
SecretLayer *v5; // x20
cocos2d::CCTransitionFade *v6; // x0
cocos2d::CCScene *v7; // x1
cocos2d::CCScene *v8; // x0
char v10; // cf
char v11; // zf
int v12; // w0
unsigned int v13; // w0
DialogLayer *v14; // x0
int v15; // w2
DialogLayer *v16; // x21
__int64 v17; // [xsp+30h] [xbp+30h] BYREF
size_t v18; // [xsp+38h] [xbp+38h]
void *v19; // [xsp+40h] [xbp+40h]
__int64 v20[2]; // [xsp+48h] [xbp+48h] BYREF
void *v21; // [xsp+58h] [xbp+58h]
__int64 v22; // [xsp+60h] [xbp+60h] BYREF
size_t v23; // [xsp+68h] [xbp+68h]
void *v24; // [xsp+70h] [xbp+70h]
v3 = (GameStatsManager *)GameStatsManager::sharedState(_stack_chk_guard);
Stat = (cocos2d::CCDirector *)GameStatsManager::getStat(v3, (const char *)&word_120A570);
if ( (int)Stat <= 9 )
{
v17 = 0;
v18 = 0;
v19 = nullptr;
std::string::__init(&v17, "zzz", 3u);
v12 = *((_DWORD *)this + 166);
if ( v12 < 0 )
v13 = llroundf((float)((float)rand() * 4.6566e-10) * 10.0);
else
v13 = v12 + 1;
*((_DWORD *)this + 166) = v13;
if ( !(!v11 & v10) )
{
switch ( v13 )
{
case 0u:
goto LABEL_7;
case 1u:
std::string::assign(&v17, "No!");
break;
case 2u:
std::string::assign(&v17, "It's a secret...");
break;
case 3u:
std::string::assign(&v17, "Stop it!");
break;
case 4u:
std::string::assign(&v17, "Not allowed!");
break;
case 5u:
std::string::assign(&v17, "Why u click?");
break;
case 6u:
std::string::assign(&v17, "Nothing to see here...");
break;
case 7u:
std::string::assign(&v17, "Don't touch!");
break;
case 8u:
std::string::assign(&v17, "Just, stop.");
break;
case 9u:
std::string::assign(&v17, "No one seems to be home.");
break;
case 0xAu:
std::string::assign(&v17, "zzzZZZ...");
break;
default:
*((_DWORD *)this + 166) = 0;
LABEL_7:
std::string::assign(&v17, "Go away!");
break;
}
}
v20[0] = 0;
v20[1] = 0;
v21 = nullptr;
std::string::__init(v20, "The Guard", 9u);
v22 = 0;
v23 = 0;
v24 = nullptr;
if ( (v17 & 1) != 0 )
{
std::string::__init(&v22, v19, v18);
}
else
{
v22 = v17;
v23 = v18;
v24 = v19;
}
v14 = (DialogLayer *)DialogObject::create(v20, &v22, 1, 0, 0xFFFFFF, 1.0);
v16 = (DialogLayer *)DialogLayer::create(v14, (DialogObject *)((char *)&dword_0 + 1), v15);
if ( (v22 & 1) != 0 )
operator delete(v24);
if ( (v20[0] & 1) != 0 )
operator delete(v21);
(*(void (__fastcall **)(OptionsLayer *, DialogLayer *, __int64))(*(_QWORD *)this + 464LL))(this, v16, 100);
DialogLayer::updateChatPlacement(v16, 0);
DialogLayer::animateInRandomSide(v16);
if ( (v17 & 1) != 0 )
operator delete(v19);
}
else
{
v5 = (SecretLayer *)cocos2d::CCDirector::sharedDirector(Stat);
v6 = (cocos2d::CCTransitionFade *)SecretLayer::scene(v5);
v8 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create(v6, 0.5, v7);
cocos2d::CCDirector::replaceScene(v5, v8);
}
return _stack_chk_guard;
}