//
// SecretRewardsLayer::showDialog03 from 0x1403d9790 to 0x1403daa59 (4809 bytes)
//
// 2 xrefs:
// > SecretRewardsLayer::onShop @ 0x1403d6829
// > ??> @ 0x1406d7dfc
//
// 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
//
// Hidden C++ exception states: #wind=4
void SecretRewardsLayer::showDialog03(SecretRewardsLayer *a1)
{
float v1; // xmm0_4
cocos2d::CCArray *v3; // rsi
GameStatsManager *v4; // rcx
GameManager *v5; // rcx
char v6; // r14
char *v7; // rax
char *v8; // rax
char *v9; // rax
char *v10; // rax
int m_potborDialogIndex; // ecx
int v12; // ecx
int v13; // ecx
int v14; // ecx
cocos2d::CCString *v15; // rax
const char *v16; // rax
size_t v17; // r8
char *v18; // rax
char *v19; // rax
int v20; // r8d
cocos2d::CCString *v21; // rax
const char *CString; // rax
size_t v23; // r8
char *v24; // rax
char *v25; // rax
char *v26; // rax
GameManager *v27; // rcx
char *v28; // rax
char *v29; // rax
char *v30; // rax
char *v31; // rax
char *v32; // rax
char *v33; // rax
char *v34; // rax
char *v35; // rax
DialogLayer *DialogLayer; // rsi
DialogDelegate *v37; // rcx
cocos2d::CCDirector *v38; // rax
cocos2d::CCLayer_vtbl *v39; // rbx
const cocos2d::CCPoint *v40; // rax
__int128 v41; // [rsp+30h] [rbp-50h] BYREF
__int64 v42; // [rsp+40h] [rbp-40h]
__int64 v43; // [rsp+48h] [rbp-38h]
__int128 v44; // [rsp+50h] [rbp-30h] BYREF
__int64 v45; // [rsp+60h] [rbp-20h]
__int64 v46; // [rsp+68h] [rbp-18h]
__int128 *v47; // [rsp+A8h] [rbp+28h]
__int16 v48; // [rsp+B0h] [rbp+30h] BYREF
char v49; // [rsp+B2h] [rbp+32h]
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v4 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v47 = (__int128 *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v47);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v4 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::getStat(v4, "13") >= 200 )
{
v5 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v47 = (__int128 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v47);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getUGV(v5, (const char *)&word_140543238) )
{
v6 = 1;
v48 = -1;
v49 = -1;
v41 = 0;
v42 = 0;
v43 = 15;
*(_QWORD *)&v41 = sub_14003AA10(0x30u);
v42 = 36;
v43 = 47;
strcpy((char *)v41, "You found all the diamonds!?");
v44 = 0;
v45 = 6;
v46 = 15;
strcpy((char *)&v44, "Potbor");
v7 = DialogObject::create((__int64)&v44, (__int64)&v41, 21, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v7);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x80u);
v45 = 113;
v46 = 127;
strcpy(
(char *)v44,
"Just need to check: \n"
" 1, 2, 3, 200. Yup, all there!");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v8 = DialogObject::create((__int64)&v41, (__int64)&v44, 22, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v8);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x30u);
v45 = 32;
v46 = 47;
strcpy((char *)v44, "My first customer, how exciting!");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v9 = DialogObject::create((__int64)&v41, (__int64)&v44, 20, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v9);
v47 = &v44;
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 21;
v46 = 31;
strcpy((char *)v44, "...");
v1 = 0.0;
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v10 = DialogObject::create((__int64)&v41, (__int64)&v44, 19, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v10);
goto LABEL_28;
}
}
v6 = 0;
m_potborDialogIndex = a1->m_potborDialogIndex;
if ( !m_potborDialogIndex )
{
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 21;
v46 = 31;
strcpy((char *)v44, "Oh, a customer!");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v33 = DialogObject::create((__int64)&v41, (__int64)&v44, 21, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v33);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 30;
v46 = 31;
strcpy((char *)v44, "I never had a customer before.");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v34 = DialogObject::create((__int64)&v41, (__int64)&v44, 22, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v34);
v47 = &v44;
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x40u);
v45 = 48;
v46 = 63;
strcpy((char *)v44, "... Not sure what to do.");
v1 = 0.0;
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v20 = 19;
goto LABEL_25;
}
v12 = m_potborDialogIndex - 1;
if ( !v12 )
{
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 24;
v46 = 31;
strcpy((char *)v44, "Let me check the manual.");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v31 = DialogObject::create((__int64)&v41, (__int64)&v44, 24, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v31);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x60u);
v45 = 80;
v46 = 95;
strcpy((char *)v44, "The Shopkeepers handbook: \nYou give stuff, they pay money.");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v32 = DialogObject::create((__int64)&v41, (__int64)&v44, 22, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v32);
v47 = &v44;
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x40u);
v45 = 49;
v46 = 63;
strcpy((char *)v44, "... Sounds simple enough.");
goto LABEL_22;
}
v13 = v12 - 1;
if ( !v13 )
{
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x40u);
v45 = 55;
v46 = 63;
strcpy((char *)v44, "Page 2: Refund policy\nNo refunds!");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v28 = DialogObject::create((__int64)&v41, (__int64)&v44, 25, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v28);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x60u);
v45 = 90;
v46 = 95;
strcpy((char *)v44, "Page 3: Shopkeeper etiquette\n... Probably not important.");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v29 = DialogObject::create((__int64)&v41, (__int64)&v44, 20, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v29);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x50u);
v45 = 76;
v46 = 79;
strcpy((char *)v44, "Page 4: Self destruct mechanism\nThe page is missing...");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v30 = DialogObject::create((__int64)&v41, (__int64)&v44, 22, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v30);
v47 = &v44;
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x30u);
v45 = 43;
v46 = 47;
strcpy((char *)v44, "Not sure if I should be worried about this.");
LABEL_22:
v1 = 0.0;
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v20 = 23;
LABEL_25:
v35 = DialogObject::create((__int64)&v41, (__int64)&v44, v20, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v35);
goto LABEL_26;
}
v14 = v13 - 1;
if ( !v14 )
{
v48 = -1;
v49 = -1;
v21 = cocos2d::CCString::createWithFormat("Page 394: Customer must have %i diamonds.", 200);
CString = cocos2d::CCString::getCString(v21);
v41 = 0;
v42 = 0;
v43 = 0;
v23 = -1;
do
++v23;
while ( CString[v23] );
sub_14003A930(&v41, CString, v23);
v44 = 0;
v45 = 6;
v46 = 15;
strcpy((char *)&v44, "Potbor");
v24 = DialogObject::create((__int64)&v44, (__int64)&v41, 24, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v24);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 17;
v46 = 31;
strcpy((char *)v44, "What's a diamond?");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v25 = DialogObject::create((__int64)&v41, (__int64)&v44, 22, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v25);
v47 = &v44;
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 21;
v46 = 31;
strcpy((char *)v44, "...");
v1 = 0.0;
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v26 = DialogObject::create((__int64)&v41, (__int64)&v44, 20, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v26);
v27 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v47 = (__int128 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v47);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v27 = (GameManager *)qword_1406C2ED8;
}
GameManager::setUGV(v27, (const char *)&word_140543238, 1);
goto LABEL_26;
}
if ( v14 == 1 )
{
v48 = -1;
v49 = -1;
v15 = cocos2d::CCString::createWithFormat(
"You must collect %i Diamonds before I can let you in the Shop!",
200);
v16 = cocos2d::CCString::getCString(v15);
v41 = 0;
v42 = 0;
v43 = 0;
v17 = -1;
do
++v17;
while ( v16[v17] );
sub_14003A930(&v41, v16, v17);
v44 = 0;
v45 = 6;
v46 = 15;
strcpy((char *)&v44, "Potbor");
v18 = DialogObject::create((__int64)&v44, (__int64)&v41, 25, 0.80000001, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v18);
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x30u);
v45 = 47;
v46 = 47;
strcpy((char *)v44, "It says so in the handbook...");
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v19 = DialogObject::create((__int64)&v41, (__int64)&v44, 23, 1.0, 0, (__int64)&v48);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v19);
v47 = &v44;
v48 = -1;
v49 = -1;
v44 = 0;
v45 = 0;
v46 = 15;
*(_QWORD *)&v44 = sub_14003AA10(0x20u);
v45 = 21;
v46 = 31;
strcpy((char *)v44, "...");
v1 = 0.0;
v41 = 0;
v42 = 6;
v43 = 15;
strcpy((char *)&v41, "Potbor");
v20 = 20;
goto LABEL_25;
}
LABEL_26:
if ( ++a1->m_potborDialogIndex > 4 )
a1->m_potborDialogIndex = 0;
LABEL_28:
DialogLayer = DialogLayer::createDialogLayer(nullptr, v3, 2);
a1->addChild_0(a1, DialogLayer, 100);
DialogLayer->setTag(DialogLayer, 2);
if ( v6 )
{
v37 = &a1->DialogDelegate;
DialogLayer->m_delegate = &a1->DialogDelegate;
}
v38 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v37);
cocos2d::CCDirector::getWinSize(v38);
v39 = DialogLayer->m_mainLayer->__vftable;
cocos2d::CCPoint::CCPoint(v1, *(float *)&v47 * 0.5);
v39->setPosition_0(DialogLayer->m_mainLayer, v40);
DialogLayer::animateInRandomSide(DialogLayer);
}