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