//
// LevelPage::onTheTower from 0x4086f4 to 0x408960 (620 bytes)
//
// 2 xrefs:
// > LevelPage::onPlay @ 0x408e20
// > LevelPage::dialogClosed @ 0x4090ec
//
// 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 LevelPage::onTheTower(LevelPage *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // r0
cocos2d::CCArray *v4; // r8
cocos2d::CCObject *v5; // r0
cocos2d::CCObject *v6; // r0
cocos2d::CCObject *v7; // r0
cocos2d::CCObject *v8; // r0
cocos2d::CCObject *v9; // r0
GameManager *v10; // r0
DialogLayer *v11; // r0
DialogLayer *v12; // r4
cocos2d::CCDirector *v13; // r0
cocos2d::CCDirector *v14; // r4
cocos2d::CCScene *v15; // r0
cocos2d::CCTransitionFade *v16; // r0
char v17; // [sp+14h] [bp-10h] BYREF
_BYTE v18[4]; // [sp+18h] [bp-Ch] BYREF
v3 = GameManager::sharedState();
if ( GameManager::getUGV(v3, "28") )
{
v14 = cocos2d::CCDirector::sharedDirector();
v15 = LevelAreaLayer::scene();
v16 = cocos2d::CCTransitionFade::create(0.5, v15);
cocos2d::CCDirector::replaceScene(v14, v16);
GameManager::sharedState()->m_sceneEnum = 9;
}
else
{
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);
sub_776584((int)&v17, "Scratch");
sub_776584((int)v18, "Where do you think you're going?");
v5 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v17,
(std::string)v18,
(std::string)10,
1065353216,
0.0,
255);
cocos2d::CCArray::addObject(v4, v5);
sub_774008(v18);
sub_774008(&v17);
sub_776584((int)&v17, "Scratch");
sub_776584((int)v18, "There's nothing over there, that place has been abandoned for years.");
v6 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v17,
(std::string)v18,
(std::string)13,
1065353216,
0.0,
255);
cocos2d::CCArray::addObject(v4, v6);
sub_774008(v18);
sub_774008(&v17);
sub_776584((int)&v17, "Scratch");
sub_776584((int)v18, "...");
v7 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v17,
(std::string)v18,
(std::string)8,
1065353216,
0.0,
255);
cocos2d::CCArray::addObject(v4, v7);
sub_774008(v18);
sub_774008(&v17);
sub_776584((int)&v17, "Scratch");
sub_776584((int)v18, "We can take a quick look if you want, but we can't stay long.");
v8 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v17,
(std::string)v18,
(std::string)13,
1065353216,
0.0,
255);
cocos2d::CCArray::addObject(v4, v8);
sub_774008(v18);
sub_774008(&v17);
sub_776584((int)&v17, "Scratch");
sub_776584((int)v18, "RubRub is always watching....");
v9 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v17,
(std::string)v18,
(std::string)12,
1065353216,
0.0,
255);
cocos2d::CCArray::addObject(v4, v9);
sub_774008(v18);
sub_774008(&v17);
v10 = GameManager::sharedState();
GameManager::setUGV(v10, "28", 1);
v11 = DialogLayer::createWithObjects(v4, (int)&dword_0 + 2);
v11->m_delegate = &a1->DialogDelegate;
v12 = v11;
v13 = cocos2d::CCDirector::sharedDirector();
v13->m_pRunningScene->addChild_0(v13->m_pRunningScene, v12, 1000);
v12->setTag(v12, 1);
v12->m_delegate = &a1->DialogDelegate;
v12->m_noRemove = 1;
DialogLayer::updateChatPlacement(v12, Center);
DialogLayer::animateInRandomSide(v12);
}
}