//
// OptionsLayer::onSecretVault from 0x1000ed188 to 0x1000ed308 (384 bytes)
//
// 1 xrefs:
// > OptionsLayer::customSetup @ 0x1000ecbe0
//
// 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 OptionsLayer::onSecretVault(OptionsLayer *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // x0
cocos2d::CCDirector *v4; // x19
cocos2d::CCScene *v5; // x0
cocos2d::CCTransitionFade *v6; // x0
int m_lastVaultDialog; // w8
int v8; // w8
char *v9; // x0
DialogLayer *v10; // x20
std::string __p; // [xsp+0h] [xbp-60h] BYREF
void *v12[2]; // [xsp+20h] [xbp-40h] BYREF
char v13; // [xsp+37h] [xbp-29h]
std::string v14; // [xsp+38h] [xbp-28h] BYREF
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "12") < 10 )
{
sub_100009900(&v14, "zzz");
m_lastVaultDialog = a1->m_lastVaultDialog;
if ( m_lastVaultDialog < 0 )
v8 = llroundf(vcvts_n_f32_s32(rand(), 0x1Fu) * 10.0);
else
v8 = m_lastVaultDialog + 1;
if ( v8 > 10 )
v8 = 0;
a1->m_lastVaultDialog = v8;
if ( (unsigned int)v8 <= 0xA )
std::string::assign(&v14, off_100784AB0[v8]);
sub_100009900(v12, "The Guard");
if ( SHIBYTE(v14.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__p, v14.__r_.__value_.__l.__data_, v14.__r_.__value_.__l.__size_);
else
__p = v14;
v9 = DialogObject::create((__int64)v12, (__int64)&__p, 1, 0, 0xFFFFFF, 1.0);
v10 = DialogLayer::create((DialogObject *)v9, 1);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v13 < 0 )
operator delete(v12[0]);
((void (__fastcall *)(OptionsLayer *, DialogLayer *, __int64))a1->addChild_0)(a1, v10, 100);
DialogLayer::updateChatPlacement(v10, Center);
DialogLayer::animateInRandomSide(v10);
if ( SHIBYTE(v14.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v14.__r_.__value_.__l.__data_);
}
else
{
v4 = cocos2d::CCDirector::sharedDirector();
v5 = SecretLayer::scene();
v6 = cocos2d::CCTransitionFade::create_1(0.5, v5);
cocos2d::CCDirector::replaceScene(v4, v6);
}
}