//
// SecretRewardsLayer::showDialogDiamond from 0x1403dbcf0 to 0x1403dc9a1 (3249 bytes)
//
// 2 xrefs:
// > SecretRewardsLayer::onShop @ 0x1403d676b
// > ??> @ 0x1406d7e14
//
// 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::showDialogDiamond(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
int m_diamondDialogIndex; // ecx
int v11; // ecx
int v12; // ecx
cocos2d::CCString *v13; // rax
const char *v14; // rax
size_t v15; // r8
char *v16; // rax
int v17; // r8d
char *v18; // rax
cocos2d::CCString *v19; // rax
const char *CString; // rax
size_t v21; // r8
char *v22; // rax
GameManager *v23; // rcx
char *v24; // rax
char *v25; // rax
char *v26; // rax
DialogLayer *DialogLayer; // rsi
DialogDelegate *v28; // rcx
cocos2d::CCDirector *v29; // rax
cocos2d::CCLayer_vtbl *v30; // rbx
const cocos2d::CCPoint *v31; // rax
__int128 v32; // [rsp+30h] [rbp-50h] BYREF
__int64 v33; // [rsp+40h] [rbp-40h]
__int64 v34; // [rsp+48h] [rbp-38h]
__int128 v35; // [rsp+50h] [rbp-30h] BYREF
__int64 v36; // [rsp+60h] [rbp-20h]
__int64 v37; // [rsp+68h] [rbp-18h]
__int128 *v38; // [rsp+A8h] [rbp+28h]
__int16 v39; // [rsp+B0h] [rbp+30h] BYREF
char v40; // [rsp+B2h] [rbp+32h]
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v4 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v38 = (__int128 *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v38);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v4 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::getStat(v4, "13") >= 1000 )
{
v5 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v38 = (__int128 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v38);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getUGV(v5, (const char *)&word_14055A538) )
{
v6 = 1;
v39 = -1;
v40 = -1;
v32 = 0;
v33 = 0;
v34 = 15;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 29;
v34 = 31;
strcpy((char *)v32, "ShINe! sHiMmer!");
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x20u);
v36 = 18;
v37 = 31;
strcpy((char *)v35, "Diamond Shopkeeper");
v7 = DialogObject::create((__int64)&v35, (__int64)&v32, 43, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v7);
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x30u);
v36 = 40;
v37 = 47;
strcpy((char *)v35, "YOU! ShiNy! sParKLe!");
v32 = 0;
v33 = 0;
v34 = 15;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
strcpy((char *)v32, "Diamond Shopkeeper");
v8 = DialogObject::create((__int64)&v32, (__int64)&v35, 41, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v8);
v38 = &v35;
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x20u);
v36 = 29;
v37 = 31;
strcpy((char *)v35, "...");
v32 = 0;
v33 = 0;
v34 = 15;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
v1 = 4.3600866e27;
strcpy((char *)v32, "Diamond Shopkeeper");
v9 = DialogObject::create((__int64)&v32, (__int64)&v35, 48, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v9);
goto LABEL_25;
}
}
v6 = 0;
m_diamondDialogIndex = a1->m_diamondDialogIndex;
if ( !m_diamondDialogIndex )
{
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x40u);
v36 = 57;
v37 = 63;
strcpy((char *)v35, "gLiTz sCraPe sParKLe TwiNkLe...");
v32 = 0;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
strcpy((char *)v32, "Diamond Shopkeeper");
v25 = DialogObject::create((__int64)&v32, (__int64)&v35, 42, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v25);
v38 = &v35;
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x20u);
v36 = 30;
v37 = 31;
strcpy((char *)v35, "....");
v32 = 0;
v33 = 0;
v34 = 15;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
v1 = 4.3600866e27;
strcpy((char *)v32, "Diamond Shopkeeper");
v17 = 40;
goto LABEL_22;
}
v11 = m_diamondDialogIndex - 1;
if ( !v11 )
{
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x40u);
v36 = 63;
v37 = 63;
strcpy((char *)v35, "gRasP sHinEe tWinKleR... cLiNk!");
v32 = 0;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
strcpy((char *)v32, "Diamond Shopkeeper");
v24 = DialogObject::create((__int64)&v32, (__int64)&v35, 43, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v24);
v38 = &v35;
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x40u);
v36 = 56;
v37 = 63;
strcpy((char *)v35, "bRinG ShiNy!");
v32 = 0;
v33 = 0;
v34 = 15;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
v1 = 4.3600866e27;
strcpy((char *)v32, "Diamond Shopkeeper");
v17 = 41;
LABEL_22:
v26 = DialogObject::create((__int64)&v32, (__int64)&v35, v17, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v26);
goto LABEL_23;
}
v12 = v11 - 1;
if ( !v12 )
{
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x40u);
v36 = 57;
v37 = 63;
strcpy((char *)v35, "sHimMeR glOrP... cRyStAl sHine!");
v32 = 0;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
strcpy((char *)v32, "Diamond Shopkeeper");
v18 = DialogObject::create((__int64)&v32, (__int64)&v35, 42, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v18);
v38 = &v32;
v39 = -1;
v40 = -1;
v19 = cocos2d::CCString::createWithFormat(
"%i... bRinG ShiNy!",
1000);
CString = cocos2d::CCString::getCString(v19);
v32 = 0;
v33 = 0;
v34 = 0;
v21 = -1;
do
++v21;
while ( CString[v21] );
sub_14003A930(&v32, CString, v21);
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x20u);
v36 = 18;
v37 = 31;
v1 = 4.3600866e27;
strcpy((char *)v35, "Diamond Shopkeeper");
v22 = DialogObject::create((__int64)&v35, (__int64)&v32, 41, 1.0, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v22);
v23 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v38 = (__int128 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v38);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v23 = (GameManager *)qword_1406C2ED8;
}
GameManager::setUGV(v23, (const char *)&word_14055A538, 1);
goto LABEL_23;
}
if ( v12 == 1 )
{
v39 = -1;
v40 = -1;
v13 = cocos2d::CCString::createWithFormat("%i... gLiSten gLoRp sPaRkle?", 1000);
v14 = cocos2d::CCString::getCString(v13);
v32 = 0;
v33 = 0;
v34 = 0;
v15 = -1;
do
++v15;
while ( v14[v15] );
sub_14003A930(&v32, v14, v15);
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x20u);
v36 = 18;
v37 = 31;
strcpy((char *)v35, "Diamond Shopkeeper");
v16 = DialogObject::create((__int64)&v35, (__int64)&v32, 47, 0.80000001, 0, (__int64)&v39);
cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v16);
v38 = &v35;
v39 = -1;
v40 = -1;
v35 = 0;
v36 = 0;
v37 = 15;
*(_QWORD *)&v35 = sub_14003AA10(0x50u);
v36 = 66;
v37 = 79;
strcpy((char *)v35, "..... sHiNY?");
v32 = 0;
v33 = 0;
v34 = 15;
*(_QWORD *)&v32 = sub_14003AA10(0x20u);
v33 = 18;
v34 = 31;
v1 = 4.3600866e27;
strcpy((char *)v32, "Diamond Shopkeeper");
v17 = 48;
goto LABEL_22;
}
LABEL_23:
if ( ++a1->m_diamondDialogIndex > 3 )
a1->m_diamondDialogIndex = 0;
LABEL_25:
DialogLayer = DialogLayer::createDialogLayer(nullptr, v3, 4);
a1->addChild_0(a1, DialogLayer, 100);
DialogLayer->setTag(DialogLayer, 3);
if ( v6 )
{
v28 = &a1->DialogDelegate;
DialogLayer->m_delegate = &a1->DialogDelegate;
}
v29 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v28);
cocos2d::CCDirector::getWinSize(v29);
v30 = DialogLayer->m_mainLayer->__vftable;
cocos2d::CCPoint::CCPoint(v1, *(float *)&v38 * 0.5);
v30->setPosition_0(DialogLayer->m_mainLayer, v31);
DialogLayer::animateInRandomSide(DialogLayer);
}