//
// SecretRewardsLayer::showDialog01 from 0x5874c8 to 0x587f44 (2684 bytes)
//
// 1 xrefs:
// > SecretRewardsLayer::onShop @ 0x5897b8
//
// 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 SecretRewardsLayer::showDialog01(SecretRewardsLayer *a1)
{
cocos2d::CCArray *v2; // r4
GameStatsManager *v3; // r0
GameManager *v4; // r0
cocos2d::CCObject *v5; // r0
cocos2d::CCObject *v6; // r0
cocos2d::CCObject *v7; // r0
cocos2d::CCObject *v8; // r0
cocos2d::CCObject *v9; // r0
cocos2d::CCObject *v10; // r0
cocos2d::CCObject *v11; // r0
cocos2d::CCObject *v12; // r0
cocos2d::CCObject *v13; // r0
cocos2d::CCObject *v14; // r0
cocos2d::CCObject *v15; // r0
cocos2d::CCObject *v16; // r0
cocos2d::CCObject *v17; // r0
cocos2d::CCObject *v18; // r0
cocos2d::CCObject *v19; // r0
cocos2d::CCString *v20; // r0
char *CString; // r0
cocos2d::CCObject *v22; // r0
cocos2d::CCString *v23; // r0
char *v24; // r0
cocos2d::CCObject *v25; // r0
cocos2d::CCObject *v26; // r0
cocos2d::CCObject *v27; // r0
cocos2d::CCObject *v28; // r0
GameManager *v29; // r0
cocos2d::CCString *v30; // r0
char *v31; // r0
cocos2d::CCObject *v32; // r0
cocos2d::CCObject *v33; // r0
cocos2d::CCObject *v34; // r0
int v35; // r5
int v36; // r3
DialogLayer *v37; // r6
cocos2d::CCObject *v38; // r0
cocos2d::CCObject *v39; // r0
cocos2d::CCObject *v40; // r0
cocos2d::CCObject *v41; // r0
int v42; // [sp+4h] [bp-20h]
int v43; // [sp+4h] [bp-20h]
int v44; // [sp+4h] [bp-20h]
int v45; // [sp+4h] [bp-20h]
int v46; // [sp+4h] [bp-20h]
int v47; // [sp+4h] [bp-20h]
int v48; // [sp+4h] [bp-20h]
int v49; // [sp+4h] [bp-20h]
int v50; // [sp+4h] [bp-20h]
int v51; // [sp+4h] [bp-20h]
int v52; // [sp+4h] [bp-20h]
int v53; // [sp+4h] [bp-20h]
int v54; // [sp+4h] [bp-20h]
int v55; // [sp+4h] [bp-20h]
int v56; // [sp+4h] [bp-20h]
int v57; // [sp+4h] [bp-20h]
int v58; // [sp+4h] [bp-20h]
int v59; // [sp+4h] [bp-20h]
int v60; // [sp+4h] [bp-20h]
int v61; // [sp+4h] [bp-20h]
int v62; // [sp+4h] [bp-20h]
char v63; // [sp+14h] [bp-10h] BYREF
_BYTE v64[4]; // [sp+18h] [bp-Ch] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "13") >= 500 && (v4 = GameManager::sharedState(), GameManager::getUGV(v4, "10")) )
{
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Oh, the diamonds.\nYou found them.");
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v38 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)10,
1065353216,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v38);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Alright come in, quickly before someone sees you.");
LOWORD(v60) = -1;
BYTE2(v60) = -1;
v39 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)13,
1065353216,
0.0,
v60);
cocos2d::CCArray::addObject(v2, v39);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "You never know who might be watching.");
LOWORD(v61) = -1;
BYTE2(v61) = -1;
v40 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v61);
cocos2d::CCArray::addObject(v2, v40);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "...");
LOWORD(v62) = -1;
BYTE2(v62) = -1;
v41 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)9,
1065353216,
0.0,
v62);
cocos2d::CCArray::addObject(v2, v41);
sub_774008(v64);
sub_774008(&v63);
v35 = 1;
}
else
{
switch ( a1->m_scratchDialogIndex )
{
case 0:
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Uhm, there is no rope.");
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v5 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v5);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Just... Pretend this never happened.");
LOWORD(v43) = -1;
BYTE2(v43) = -1;
v6 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)9,
1065353216,
0.0,
v43);
cocos2d::CCArray::addObject(v2, v6);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "...");
LOWORD(v44) = -1;
BYTE2(v44) = -1;
v7 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v44);
cocos2d::CCArray::addObject(v2, v7);
goto LABEL_10;
case 1:
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "I'm gonna need you to stop doing that.");
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v8 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)13,
1065353216,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v8);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "If RubRub sees this I am in BIG trouble.");
LOWORD(v45) = -1;
BYTE2(v45) = -1;
v9 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v45);
cocos2d::CCArray::addObject(v2, v9);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "I hate that guy...");
LOWORD(v46) = -1;
BYTE2(v46) = -1;
v10 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)12,
1065353216,
0.0,
v46);
cocos2d::CCArray::addObject(v2, v10);
goto LABEL_10;
case 2:
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Finally, I thought you wou...");
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v11 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)10,
1065353216,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v11);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Wait, You're not the delivery guy.");
LOWORD(v47) = -1;
BYTE2(v47) = -1;
v12 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)11,
1065353216,
0.0,
v47);
cocos2d::CCArray::addObject(v2, v12);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "How am I supposed to run a shop if I don't have any merchandise?");
LOWORD(v48) = -1;
BYTE2(v48) = -1;
v13 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)12,
1065353216,
0.0,
v48);
cocos2d::CCArray::addObject(v2, v13);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "I mean, what shop?");
LOWORD(v49) = -1;
BYTE2(v49) = -1;
v14 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)13,
1065353216,
0.0,
v49);
cocos2d::CCArray::addObject(v2, v14);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "...");
LOWORD(v50) = -1;
BYTE2(v50) = -1;
v15 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v50);
cocos2d::CCArray::addObject(v2, v15);
goto LABEL_10;
case 3:
sub_776584((int)&v63, "Scratch");
sub_776584(
(int)v64,
"Look, I can't let you in.\nNot without the... stuff.");
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v16 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v16);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "I'm not even supposed to be here.\nI'm just a glitch in the code.");
LOWORD(v51) = -1;
BYTE2(v51) = -1;
v17 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)13,
1065353216,
0.0,
v51);
cocos2d::CCArray::addObject(v2, v17);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Did you hear something?");
LOWORD(v52) = -1;
BYTE2(v52) = -1;
v18 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v52);
cocos2d::CCArray::addObject(v2, v18);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "...");
LOWORD(v53) = -1;
BYTE2(v53) = -1;
v19 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)9,
1065353216,
0.0,
v53);
cocos2d::CCArray::addObject(v2, v19);
goto LABEL_10;
case 4:
sub_776584((int)&v63, "Scratch");
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Alright, alright. If you collect\n"
"%i Diamonds I will let you in.",
(const char *)&stru_1EC.st_size);
CString = (char *)cocos2d::CCString::getCString(v20);
sub_776584((int)v64, CString);
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v22 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)10,
1065353216,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v22);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Usually the limit is %i, but you look a bit scary.",
(const char *)&stru_3DC.st_info);
v24 = (char *)cocos2d::CCString::getCString(v23);
sub_776584((int)v64, v24);
LOWORD(v54) = -1;
BYTE2(v54) = -1;
v25 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)13,
1065353216,
0.0,
v54);
cocos2d::CCArray::addObject(v2, v25);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Just, get out of here before someone sees you.");
LOWORD(v55) = -1;
BYTE2(v55) = -1;
v26 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)11,
1065353216,
0.0,
v55);
cocos2d::CCArray::addObject(v2, v26);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Do you smell burning chicken?");
LOWORD(v56) = -1;
BYTE2(v56) = -1;
v27 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v56);
cocos2d::CCArray::addObject(v2, v27);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "...");
LOWORD(v57) = -1;
BYTE2(v57) = -1;
v28 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)9,
1065353216,
0.0,
v57);
cocos2d::CCArray::addObject(v2, v28);
sub_774008(v64);
sub_774008(&v63);
v29 = GameManager::sharedState();
GameManager::setUGV(v29, "10", 1);
break;
case 5:
sub_776584((int)&v63, "Scratch");
v30 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Collect %i Diamonds and I will let you in.",
(const char *)&stru_1EC.st_size);
v31 = (char *)cocos2d::CCString::getCString(v30);
sub_776584((int)v64, v31);
LOWORD(v42) = -1;
BYTE2(v42) = -1;
v32 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)10,
1061997773,
0.0,
v42);
cocos2d::CCArray::addObject(v2, v32);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "Now go away, RubRub might be watching.");
LOWORD(v58) = -1;
BYTE2(v58) = -1;
v33 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)8,
1065353216,
0.0,
v58);
cocos2d::CCArray::addObject(v2, v33);
sub_774008(v64);
sub_774008(&v63);
sub_776584((int)&v63, "Scratch");
sub_776584((int)v64, "...");
LOWORD(v59) = -1;
BYTE2(v59) = -1;
v34 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v63,
(std::string)v64,
(std::string)9,
1065353216,
0.0,
v59);
cocos2d::CCArray::addObject(v2, v34);
LABEL_10:
sub_774008(v64);
sub_774008(&v63);
break;
default:
break;
}
v35 = 0;
v36 = a1->m_scratchDialogIndex + 1;
if ( v36 > 5 )
a1->m_scratchDialogIndex = 0;
else
a1->m_scratchDialogIndex = v36;
}
v37 = DialogLayer::createWithObjects(v2, (int)&dword_0 + 2);
a1->addChild_0(a1, v37, 100);
v37->setTag(v37, 1);
if ( v35 )
v37->m_delegate = &a1->DialogDelegate;
DialogLayer::updateChatPlacement(v37, Center);
DialogLayer::animateInRandomSide(v37);
}