//
// CreatorLayer::onTreasureRoom from 0x493f70 to 0x49421a (682 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:49:40 +0000
//
int __fastcall CreatorLayer::onTreasureRoom(CreatorLayer *this, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // r0
GameManager *Stat; // r10
GameManager *v5; // r0
cocos2d::CCDirector *UGV; // r0
cocos2d::CCDirector *v7; // r4
bool v8; // r1
float v9; // r0
cocos2d::CCScene *v10; // r2
cocos2d::CCScene *v11; // r0
cocos2d::CCArray *v13; // r10
cocos2d::CCObject *v14; // r0
cocos2d::CCObject *v15; // r0
cocos2d::CCObject *v16; // r0
int v17; // r2
_DWORD *v18; // r0
_DWORD *v19; // r4
const char *v20; // r1
__int16 *v21; // r2
cocos2d::CCString *v22; // r0
char *CString; // r0
DialogLayer *v24; // r0
int v25; // r2
DialogLayer *v26; // r9
int v27; // [sp+4h] [bp-2Ch]
int v28; // [sp+4h] [bp-2Ch]
int v29; // [sp+4h] [bp-2Ch]
int v30[3]; // [sp+8h] [bp-28h] BYREF
int v31; // [sp+14h] [bp-1Ch] BYREF
int v32; // [sp+18h] [bp-18h]
int v33; // [sp+1Ch] [bp-14h]
int v34; // [sp+20h] [bp-10h] BYREF
int v35; // [sp+24h] [bp-Ch]
int v36; // [sp+28h] [bp-8h]
v3 = (GameStatsManager *)GameStatsManager::sharedState(this);
Stat = (GameManager *)GameStatsManager::getStat(v3, "21");
v5 = (GameManager *)GameManager::sharedState(Stat);
UGV = (cocos2d::CCDirector *)GameManager::getUGV(v5, (char *)&a1i2r3e45s789g[7]);
if ( UGV )
{
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(UGV);
v9 = COERCE_FLOAT(SecretRewardsLayer::scene(nullptr, v8));
v11 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create((cocos2d::CCTransitionFade *)0x3F000000, v9, v10);
return cocos2d::CCDirector::replaceScene(v7, v11);
}
else if ( (int)Stat <= 4 )
{
memset(v30, 0, sizeof(v30));
std::string::__init(v30, "Bring me 5 keys,\nand I will let you pass.", 0x3Fu);
v20 = (const char *)(5 - (_DWORD)Stat);
if ( (int)Stat > 0 )
{
if ( v20 == (_BYTE *)&dword_0 + 1 )
v21 = (__int16 *)&unk_B6B226;
else
v21 = &a1i2r3e45s789g[8];
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Collect %i more key%s,\n"
"and I will let you pass.",
v20,
v21);
CString = (char *)cocos2d::CCString::getCString(v22);
std::string::assign(v30, CString);
}
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "The Keymaster", 0xDu);
std::string::basic_string(&v34, (int)v30);
LOWORD(v27) = -1;
BYTE2(v27) = -1;
v24 = (DialogLayer *)DialogObject::create(&v31, &v34, 2, 1065353216, 0, v27);
v26 = (DialogLayer *)DialogLayer::create(v24, (DialogObject *)((char *)&dword_0 + 2), v25);
std::string::~string((int)&v34);
std::string::~string((int)&v31);
(*(void (__fastcall **)(CreatorLayer *, DialogLayer *, int))(*(_DWORD *)this + 232))(this, v26, 100);
DialogLayer::updateChatPlacement(v26, 0);
DialogLayer::animateInRandomSide(v26);
return std::string::~string((int)v30);
}
else
{
v31 = 0;
v32 = 0;
v33 = 0;
v13 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);
std::string::__init(&v31, "The Keymaster", 0xDu);
v34 = 0;
v35 = 0;
v36 = 0;
std::string::__init(&v34, "Well, well, well.\nLook who it is.", 0x27u);
LOWORD(v27) = -1;
BYTE2(v27) = -1;
v14 = (cocos2d::CCObject *)DialogObject::create(&v31, &v34, 2, 1065353216, 0, v27);
cocos2d::CCArray::addObject(v13, v14);
std::string::~string((int)&v34);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "The Keymaster", 0xDu);
v34 = 0;
v35 = 0;
v36 = 0;
std::string::__init(&v34, "I see you have the keys.\nBut what comes next?", 0x3Bu);
LOWORD(v28) = -1;
BYTE2(v28) = -1;
v15 = (cocos2d::CCObject *)DialogObject::create(&v31, &v34, 2, 1065353216, 0, v28);
cocos2d::CCArray::addObject(v13, v15);
std::string::~string((int)&v34);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "The Keymaster", 0xDu);
v34 = 0;
v35 = 0;
v36 = 0;
std::string::__init(&v34, "The door is open.\nTime to find out...", 0x45u);
LOWORD(v29) = -1;
BYTE2(v29) = -1;
v16 = (cocos2d::CCObject *)DialogObject::create(&v31, &v34, 2, 1065353216, 0, v29);
cocos2d::CCArray::addObject(v13, v16);
std::string::~string((int)&v34);
std::string::~string((int)&v31);
v18 = (_DWORD *)DialogLayer::createWithObjects(v13, (cocos2d::CCArray *)((char *)&dword_0 + 2), v17);
v18[122] = (char *)this + 320;
v19 = v18;
(*(void (__fastcall **)(_DWORD *, _DWORD))(*v18 + 36))(v18, 0);
(*(void (__fastcall **)(CreatorLayer *, _DWORD *, int))(*(_DWORD *)this + 232))(this, v19, 100);
DialogLayer::updateChatPlacement(v19, 0);
return DialogLayer::animateIn(v19, 2);
}
}