//
// SecretLayer2::onDoor from 0x1003a863c to 0x1003a87b8 (380 bytes)
//
// 1 xrefs:
// > SecretLayer2::init @ 0x1003a6cb0
//
// 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 11:03:50 +0000
//
void __fastcall SecretLayer2::onDoor(_DWORD *a1)
{
__int64 v2; // x0
__int64 v3; // x19
__int64 v4; // x0
char *v5; // x0
int v6; // w8
int v7; // w8
char *v8; // x0
__int64 v9; // x20
std::string __p; // [xsp+0h] [xbp-60h] BYREF
void *v11[2]; // [xsp+20h] [xbp-40h] BYREF
char v12; // [xsp+37h] [xbp-29h]
std::string v13; // [xsp+38h] [xbp-28h] BYREF
v2 = GameManager::sharedState(a1);
if ( (unsigned int)GameManager::getUGV(v2, "4") )
{
v3 = cocos2d::CCDirector::sharedDirector();
v4 = sub_1003A9254();
v5 = cocos2d::CCTransitionFade::create_1(v4, 0.5);
cocos2d::CCDirector::replaceScene(v3, v5);
}
else
{
sub_100009900(&v13, "Not allowed");
v6 = a1[123];
if ( v6 < 0 )
v7 = llroundf(vcvts_n_f32_s32(rand(), 0x1Fu) * 10.0);
else
v7 = v6 + 1;
if ( v7 > 10 )
v7 = 0;
a1[123] = v7;
if ( (unsigned int)v7 <= 0xA )
std::string::assign(&v13, off_100946EF8[v7]);
sub_100009900(v11, "The Keymaster");
if ( SHIBYTE(v13.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__p, v13.__r_.__value_.__l.__data_, v13.__r_.__value_.__l.__size_);
else
__p = v13;
v8 = DialogObject::create((__int64)v11, (__int64)&__p, 2, 0, 0xFFFFFF, 1.0);
v9 = DialogLayer::create((__int64)v8, 2);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v12 < 0 )
operator delete(v11[0]);
(*(void (__fastcall **)(_DWORD *, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v9, 100);
DialogLayer::updateChatPlacement(v9, 0);
DialogLayer::animateInRandomSide(v9);
if ( SHIBYTE(v13.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v13.__r_.__value_.__l.__data_);
}
}