//
// LevelPage::onTheTower from 0x100423a70 to 0x100423f2e (1214 bytes)
//
// 4 xrefs:
// > LevelPage::onPlay @ 0x1004223f9
// > LevelPage::dialogClosed @ 0x100424eaf
// > sub_100424EC0 @ 0x100424f46
// > LevelPage::updateDynamicPage @ 0x100420830
//
// 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:16 +0000
//
__int64 __fastcall LevelPage::onTheTower(__int64 a1)
{
__int64 v2; // rdi
__int64 v3; // rbx
__int64 v4; // rax
char *v5; // rax
__int64 result; // rax
__int64 v7; // r14
char *v8; // rax
char *v9; // rax
char *v10; // rax
char *v11; // rax
char *v12; // rax
__int64 v13; // rax
__int64 v14; // rdi
char *v15; // r14
__int64 v16; // rbx
__int64 v17; // rax
std::string v18; // [rsp+8h] [rbp-108h] BYREF
std::string v19; // [rsp+20h] [rbp-F0h] BYREF
std::string v20; // [rsp+38h] [rbp-D8h] BYREF
std::string v21; // [rsp+50h] [rbp-C0h] BYREF
std::string v22; // [rsp+68h] [rbp-A8h] BYREF
std::string v23; // [rsp+80h] [rbp-90h] BYREF
std::string v24; // [rsp+98h] [rbp-78h] BYREF
std::string v25; // [rsp+B0h] [rbp-60h] BYREF
std::string v26; // [rsp+C8h] [rbp-48h] BYREF
std::string v27[2]; // [rsp+E0h] [rbp-30h] BYREF
v2 = GameManager::sharedState();
if ( (unsigned __int8)GameManager::getUGV(v2, "28") )
{
v3 = cocos2d::CCDirector::sharedDirector(v2, "28");
v4 = LevelAreaLayer::scene(v2, (__int64)"28");
v5 = cocos2d::CCTransitionFade::create_1(v4, 0.5);
cocos2d::CCDirector::replaceScene(v3, v5);
result = GameManager::sharedState();
*(_DWORD *)(result + 708) = 9;
}
else
{
v7 = sub_1007FE900(v2);
v22.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14;
strcpy(v22.__r_.__value_.__s.__data_, "Scratch");
v18.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v18.__r_.__value_.__r.__words[0] = 49;
v18.__r_.__value_.__l.__size_ = 40;
strcpy(v18.__r_.__value_.__l.__data_, "Where do you think you're going?");
v8 = DialogObject::create(&v22, &v18, 10, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v7, v8);
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v18.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v22.__r_.__value_.__l.__data_);
v23.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14;
strcpy(v23.__r_.__value_.__s.__data_, "Scratch");
v19.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x50u);
v19.__r_.__value_.__r.__words[0] = 81;
v19.__r_.__value_.__l.__size_ = 76;
strcpy(
v19.__r_.__value_.__l.__data_,
"There's nothing over there, that place has been abandoned for years.");
v9 = DialogObject::create(&v23, &v19, 13, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v7, v9);
if ( (*(_BYTE *)&v19.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v19.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v23.__r_.__value_.__l.__data_);
v24.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14;
strcpy(v24.__r_.__value_.__s.__data_, "Scratch");
strcpy((char *)&v25, "*...");
v10 = DialogObject::create(&v24, &v25, 8, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v7, v10);
if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v25.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v24.__r_.__value_.__l.__data_);
v26.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14;
strcpy(v26.__r_.__value_.__s.__data_, "Scratch");
v20.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x50u);
v20.__r_.__value_.__r.__words[0] = 81;
v20.__r_.__value_.__l.__size_ = 75;
strcpy(v20.__r_.__value_.__l.__data_, "We can take a quick look if you want, but we can't stay long.");
v11 = DialogObject::create(&v26, &v20, 13, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v7, v11);
if ( (*(_BYTE *)&v20.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v20.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v26.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v26.__r_.__value_.__l.__data_);
v27[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14;
strcpy(v27[0].__r_.__value_.__s.__data_, "Scratch");
v21.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v21.__r_.__value_.__r.__words[0] = 57;
v21.__r_.__value_.__l.__size_ = 55;
strcpy(v21.__r_.__value_.__l.__data_, "RubRub is always watching....");
v12 = DialogObject::create(v27, &v21, 12, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v7, v12);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v21.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v27[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v27[0].__r_.__value_.__l.__data_);
v13 = GameManager::sharedState();
GameManager::setUGV(v13, "28");
v14 = v7;
v15 = DialogLayer::createWithObjects(v7, 2u);
v16 = a1 + 408;
*((_QWORD *)v15 + 78) = v16;
v17 = cocos2d::CCDirector::sharedDirector(v14, 2);
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(v17 + 272) + 464LL))(
*(_QWORD *)(v17 + 272),
v15,
1000);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v15 + 72LL))(v15, 1);
*((_QWORD *)v15 + 78) = v16;
v15[640] = 1;
DialogLayer::updateChatPlacement((__int64)v15, 0);
return DialogLayer::animateInRandomSide((__int64)v15);
}
return result;
}