//
// SecretRewardsLayer::showDialogMechanic from 0x100637e30 to 0x100638f8c (4444 bytes)
//
// 1 xrefs:
// > SecretRewardsLayer::onShop @ 0x1006328b5
//
// 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 __fastcall SecretRewardsLayer::showDialogMechanic(SecretRewardsLayer *a1)
{
__int64 v1; // rsi
cocos2d::CCArray *v3; // r12
GameStatsManager *v4; // rax
GameManager *v5; // rax
char *v6; // rax
char *v7; // rax
char *v8; // rax
char *v9; // rax
char *v10; // rax
char v11; // r15
char *v12; // rax
char *v13; // rax
void *v14; // rdi
char *v15; // rax
cocos2d::CCString *v16; // rax
const char *v17; // r15
size_t v18; // rax
std::string::size_type v19; // r12
char *v20; // r13
char *v21; // rax
char *v22; // rax
char *v23; // rax
cocos2d::CCString *v24; // rax
const char *CString; // r15
size_t v26; // rax
std::string::size_type v27; // r12
char *data; // r13
char *v29; // rax
char *v30; // rax
char *v31; // rax
size_t v32; // r14
char *v33; // rax
char *v34; // rax
char *v35; // rax
size_t v36; // r14
char *v37; // rax
char *v38; // rax
GameManager *v39; // rax
int m_mechanicDialogIndex; // eax
int v41; // ecx
DialogLayer *v42; // r14
std::string v43; // [rsp+0h] [rbp-3C0h] BYREF
std::string v44; // [rsp+18h] [rbp-3A8h] BYREF
std::string v45; // [rsp+30h] [rbp-390h] BYREF
std::string v46; // [rsp+48h] [rbp-378h] BYREF
std::string v47; // [rsp+60h] [rbp-360h] BYREF
std::string v48; // [rsp+78h] [rbp-348h] BYREF
std::string v49; // [rsp+90h] [rbp-330h] BYREF
std::string v50; // [rsp+A8h] [rbp-318h] BYREF
std::string v51; // [rsp+C0h] [rbp-300h] BYREF
std::string v52; // [rsp+D8h] [rbp-2E8h] BYREF
std::string v53; // [rsp+F0h] [rbp-2D0h] BYREF
std::string v54; // [rsp+108h] [rbp-2B8h] BYREF
std::string v55; // [rsp+120h] [rbp-2A0h] BYREF
std::string v56; // [rsp+138h] [rbp-288h] BYREF
std::string v57; // [rsp+150h] [rbp-270h] BYREF
std::string v58; // [rsp+168h] [rbp-258h] BYREF
std::string v59; // [rsp+180h] [rbp-240h] BYREF
__int128 v60; // [rsp+198h] [rbp-228h] BYREF
void *v61; // [rsp+1A8h] [rbp-218h]
__int128 v62; // [rsp+1B0h] [rbp-210h] BYREF
void *v63; // [rsp+1C0h] [rbp-200h]
__int128 v64; // [rsp+1C8h] [rbp-1F8h] BYREF
void *v65; // [rsp+1D8h] [rbp-1E8h]
__int128 v66; // [rsp+1E0h] [rbp-1E0h] BYREF
void *v67; // [rsp+1F0h] [rbp-1D0h]
__int128 v68; // [rsp+1F8h] [rbp-1C8h] BYREF
void *v69; // [rsp+208h] [rbp-1B8h]
__int128 v70; // [rsp+210h] [rbp-1B0h] BYREF
void *v71; // [rsp+220h] [rbp-1A0h]
__int128 v72; // [rsp+228h] [rbp-198h] BYREF
void *v73; // [rsp+238h] [rbp-188h]
__int128 v74; // [rsp+240h] [rbp-180h] BYREF
void *v75; // [rsp+250h] [rbp-170h]
__int128 v76; // [rsp+258h] [rbp-168h] BYREF
void *v77; // [rsp+268h] [rbp-158h]
__int128 v78; // [rsp+270h] [rbp-150h] BYREF
void *v79; // [rsp+280h] [rbp-140h]
__int128 v80; // [rsp+288h] [rbp-138h] BYREF
void *v81; // [rsp+298h] [rbp-128h]
__int128 v82; // [rsp+2A0h] [rbp-120h] BYREF
void *v83; // [rsp+2B0h] [rbp-110h]
__int128 v84; // [rsp+2B8h] [rbp-108h] BYREF
void *v85; // [rsp+2C8h] [rbp-F8h]
__int128 v86; // [rsp+2D0h] [rbp-F0h] BYREF
void *v87; // [rsp+2E0h] [rbp-E0h]
__int128 v88; // [rsp+2E8h] [rbp-D8h] BYREF
void *v89; // [rsp+2F8h] [rbp-C8h]
__int128 v90; // [rsp+300h] [rbp-C0h] BYREF
void *v91; // [rsp+310h] [rbp-B0h]
__int128 v92; // [rsp+318h] [rbp-A8h] BYREF
void *v93; // [rsp+328h] [rbp-98h]
__int128 v94; // [rsp+330h] [rbp-90h] BYREF
void *v95; // [rsp+340h] [rbp-80h]
__int128 v96; // [rsp+348h] [rbp-78h] BYREF
void *v97; // [rsp+358h] [rbp-68h]
std::string v98; // [rsp+360h] [rbp-60h] BYREF
std::string __dst; // [rsp+378h] [rbp-48h] BYREF
cocos2d::CCArray *v100; // [rsp+390h] [rbp-30h]
v3 = (cocos2d::CCArray *)sub_10071F9E0(a1, v1);
v4 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v4, "13") >= 2000 )
{
v5 = GameManager::sharedState();
if ( GameManager::getUGV(v5, "36") )
{
LOBYTE(v60) = 24;
strcpy((char *)&v60 + 1, "The Mechanic");
v43.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v43.__r_.__value_.__r.__words[0] = 65;
v43.__r_.__value_.__l.__size_ = 56;
strcpy(v43.__r_.__value_.__l.__data_, "Now that's an impressive collection of Diamonds!");
v6 = DialogObject::create(&v60, &v43, 39, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v6);
if ( (*(_BYTE *)&v43.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v43.__r_.__value_.__l.__data_);
if ( (v60 & 1) != 0 )
operator delete(v61);
LOBYTE(v62) = 24;
strcpy((char *)&v62 + 1, "The Mechanic");
v44.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x28u);
v44.__r_.__value_.__r.__words[0] = 41;
v44.__r_.__value_.__l.__size_ = 35;
strcpy(v44.__r_.__value_.__l.__data_, "If anyone asks I didn't let you in.");
v7 = DialogObject::create(&v62, &v44, 37, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v7);
if ( (*(_BYTE *)&v44.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v44.__r_.__value_.__l.__data_);
if ( (v62 & 1) != 0 )
operator delete(v63);
LOBYTE(v64) = 24;
strcpy((char *)&v64 + 1, "The Mechanic");
v45.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x48u);
v45.__r_.__value_.__r.__words[0] = 73;
v45.__r_.__value_.__l.__size_ = 67;
strcpy(v45.__r_.__value_.__l.__data_, "Scratch keeps trying to sneak past my security...");
v8 = DialogObject::create(&v64, &v45, 50, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v8);
if ( (*(_BYTE *)&v45.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v45.__r_.__value_.__l.__data_);
if ( (v64 & 1) != 0 )
operator delete(v65);
LOBYTE(v66) = 24;
strcpy((char *)&v66 + 1, "The Mechanic");
v46.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v46.__r_.__value_.__r.__words[0] = 49;
v46.__r_.__value_.__l.__size_ = 41;
strcpy(v46.__r_.__value_.__l.__data_, "I CAN'T SEE!?");
v9 = DialogObject::create(&v66, &v46, 44, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v9);
if ( (*(_BYTE *)&v46.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v46.__r_.__value_.__l.__data_);
if ( (v66 & 1) != 0 )
operator delete(v67);
LOBYTE(v68) = 24;
strcpy((char *)&v68 + 1, "The Mechanic");
v47.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v47.__r_.__value_.__r.__words[0] = 65;
v47.__r_.__value_.__l.__size_ = 61;
strcpy(v47.__r_.__value_.__l.__data_, "Ah sorry, my goggles were off.\nCome in.");
v10 = DialogObject::create(&v68, &v47, 51, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v10);
if ( (*(_BYTE *)&v47.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v47.__r_.__value_.__l.__data_);
v11 = 1;
if ( (v68 & 1) != 0 )
operator delete(v69);
goto LABEL_101;
}
}
switch ( a1->m_mechanicDialogIndex )
{
case 0:
LOBYTE(v70) = 24;
strcpy((char *)&v70 + 1, "The Mechanic");
v48.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v48.__r_.__value_.__r.__words[0] = 49;
v48.__r_.__value_.__l.__size_ = 44;
strcpy(v48.__r_.__value_.__l.__data_, "I'm in the middle of a job.\nCome back later.");
v12 = DialogObject::create(&v70, &v48, 38, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v12);
if ( (*(_BYTE *)&v48.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v48.__r_.__value_.__l.__data_);
if ( (v70 & 1) != 0 )
operator delete(v71);
LOBYTE(v72) = 24;
strcpy((char *)&v72 + 1, "The Mechanic");
v49.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v49.__r_.__value_.__r.__words[0] = 65;
v49.__r_.__value_.__l.__size_ = 57;
strcpy(v49.__r_.__value_.__l.__data_, "Can never get any peace and quiet in this game...");
v13 = DialogObject::create(&v72, &v49, 37, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v13);
if ( (*(_BYTE *)&v49.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v49.__r_.__value_.__l.__data_);
if ( (v72 & 1) != 0 )
{
v14 = v73;
goto LABEL_84;
}
goto LABEL_98;
case 1:
LOBYTE(v74) = 24;
strcpy((char *)&v74 + 1, "The Mechanic");
v50.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
v50.__r_.__value_.__r.__words[0] = 33;
v50.__r_.__value_.__l.__size_ = 30;
strcpy(v50.__r_.__value_.__l.__data_, "You again!? What now!?");
v29 = DialogObject::create(&v74, &v50, 46, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v29);
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v50.__r_.__value_.__l.__data_);
if ( (v74 & 1) != 0 )
operator delete(v75);
LOBYTE(v76) = 24;
strcpy((char *)&v76 + 1, "The Mechanic");
v51.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x28u);
v51.__r_.__value_.__r.__words[0] = 41;
v51.__r_.__value_.__l.__size_ = 32;
strcpy(v51.__r_.__value_.__l.__data_, "I'm busy go bother someone else.");
v30 = DialogObject::create(&v76, &v51, 51, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v30);
if ( (*(_BYTE *)&v51.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v51.__r_.__value_.__l.__data_);
if ( (v76 & 1) != 0 )
operator delete(v77);
LOBYTE(v78) = 24;
strcpy((char *)&v78 + 1, "The Mechanic");
v52.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x50u);
v52.__r_.__value_.__r.__words[0] = 81;
v52.__r_.__value_.__l.__size_ = 78;
strcpy(
v52.__r_.__value_.__l.__data_,
"You take one job then all of a sudden you're bugfixing the whole game.");
v31 = DialogObject::create(&v78, &v52, 37, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v31);
if ( (*(_BYTE *)&v52.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v52.__r_.__value_.__l.__data_);
if ( (v78 & 1) != 0 )
{
v14 = v79;
goto LABEL_84;
}
goto LABEL_98;
case 2:
LOBYTE(v80) = 24;
strcpy((char *)&v80 + 1, "The Mechanic");
v53.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x48u);
v53.__r_.__value_.__r.__words[0] = 73;
v53.__r_.__value_.__l.__size_ = 65;
strcpy(v53.__r_.__value_.__l.__data_, "Hmm so if I push here... maybe...");
v21 = DialogObject::create(&v80, &v53, 45, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v21);
if ( (*(_BYTE *)&v53.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v53.__r_.__value_.__l.__data_);
if ( (v80 & 1) != 0 )
operator delete(v81);
LOBYTE(v82) = 24;
strcpy((char *)&v82 + 1, "The Mechanic");
v54.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
v54.__r_.__value_.__r.__words[0] = 33;
v54.__r_.__value_.__l.__size_ = 27;
strcpy(v54.__r_.__value_.__l.__data_, "No, still broken...");
v22 = DialogObject::create(&v82, &v54, 49, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v22);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v54.__r_.__value_.__l.__data_);
if ( (v82 & 1) != 0 )
{
v14 = v83;
goto LABEL_84;
}
goto LABEL_98;
case 3:
LOBYTE(v84) = 24;
strcpy((char *)&v84 + 1, "The Mechanic");
v55.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v55.__r_.__value_.__r.__words[0] = 65;
v55.__r_.__value_.__l.__size_ = 62;
strcpy(v55.__r_.__value_.__l.__data_, "I have enough work as it is, can't go around helping everyone.");
v23 = DialogObject::create(&v84, &v55, 51, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v23);
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v55.__r_.__value_.__l.__data_);
v100 = v3;
if ( (v84 & 1) != 0 )
operator delete(v85);
LOBYTE(v86) = 24;
strcpy((char *)&v86 + 1, "The Mechanic");
v24 = (cocos2d::CCString *)sub_1007AB580(
"Collect %i Diamonds so I know you're legit, then we can talk.",
*(_BYTE *)&v43.__r_.__value_.__l.0);
CString = cocos2d::CCString::getCString(v24);
v26 = strlen(CString);
if ( v26 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(COERCE_DOUBLE(1065353216));
v27 = v26;
if ( v26 >= 0x17 )
{
v36 = 26;
if ( (v26 | 7) != 0x17 )
v36 = (v26 | 7) + 1;
data = (char *)operator new(v36);
v98.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
v98.__r_.__value_.__r.__words[0] = v36 | 1;
v98.__r_.__value_.__l.__size_ = v27;
}
else
{
v98.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v26);
data = v98.__r_.__value_.__s.__data_;
if ( !v26 )
goto LABEL_89;
}
memmove(data, CString, v27);
LABEL_89:
data[v27] = 0;
v37 = DialogObject::create(&v86, &v98, 37, 0, 0xFFFFFF, 1.0);
v3 = v100;
sub_10071FCD0(v100, v37);
if ( (*(_BYTE *)&v98.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v98.__r_.__value_.__l.__data_);
if ( (v86 & 1) != 0 )
operator delete(v87);
LOBYTE(v88) = 24;
strcpy((char *)&v88 + 1, "The Mechanic");
v56.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v56.__r_.__value_.__r.__words[0] = 57;
v56.__r_.__value_.__l.__size_ = 53;
strcpy(v56.__r_.__value_.__l.__data_, "Who ordered this thing it doesn't even fit...");
v38 = DialogObject::create(&v88, &v56, 49, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v38);
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v56.__r_.__value_.__l.__data_);
if ( (v88 & 1) != 0 )
operator delete(v89);
v39 = GameManager::sharedState();
GameManager::setUGV(v39, "36", 1);
LABEL_98:
m_mechanicDialogIndex = a1->m_mechanicDialogIndex;
v41 = m_mechanicDialogIndex + 1;
v11 = 0;
if ( m_mechanicDialogIndex >= 4 )
v41 = 0;
a1->m_mechanicDialogIndex = v41;
LABEL_101:
v42 = DialogLayer::createWithObjects(v3, 4);
((void (__fastcall *)(SecretRewardsLayer *, DialogLayer *, __int64))a1->addChild_0)(a1, v42, 100);
((void (__fastcall *)(DialogLayer *, __int64))v42->setTag)(v42, 4);
if ( v11 )
v42->m_delegate = &a1->DialogDelegate;
DialogLayer::updateChatPlacement(v42, Center);
DialogLayer::animateInRandomSide(v42);
return;
case 4:
LOBYTE(v90) = 24;
strcpy((char *)&v90 + 1, "The Mechanic");
v57.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v57.__r_.__value_.__r.__words[0] = 49;
v57.__r_.__value_.__l.__size_ = 42;
strcpy(v57.__r_.__value_.__l.__data_, "Scanning user...");
v15 = DialogObject::create(&v90, &v57, 49, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v15);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
v100 = v3;
if ( (v90 & 1) != 0 )
operator delete(v91);
LOBYTE(v92) = 24;
strcpy((char *)&v92 + 1, "The Mechanic");
v16 = (cocos2d::CCString *)sub_1007AB580(
"Scan complete.\nDiamonds: %i, Required: %i",
*(_BYTE *)&v43.__r_.__value_.__l.0);
v17 = cocos2d::CCString::getCString(v16);
v18 = strlen(v17);
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(COERCE_DOUBLE(1065353216));
v19 = v18;
if ( v18 >= 0x17 )
{
v32 = 26;
if ( (v18 | 7) != 0x17 )
v32 = (v18 | 7) + 1;
v20 = (char *)operator new(v32);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v20;
__dst.__r_.__value_.__r.__words[0] = v32 | 1;
__dst.__r_.__value_.__l.__size_ = v19;
}
else
{
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v18);
v20 = __dst.__r_.__value_.__s.__data_;
if ( !v18 )
{
LABEL_72:
v20[v19] = 0;
v33 = DialogObject::create(&v92, &__dst, 45, 0, 0xFFFFFF, 1.0);
v3 = v100;
sub_10071FCD0(v100, v33);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (v92 & 1) != 0 )
operator delete(v93);
LOBYTE(v94) = 24;
strcpy((char *)&v94 + 1, "The Mechanic");
v58.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v58.__r_.__value_.__r.__words[0] = 49;
v58.__r_.__value_.__l.__size_ = 40;
strcpy(v58.__r_.__value_.__l.__data_, "Hey who are you trying to fool?!");
v34 = DialogObject::create(&v94, &v58, 46, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v34);
if ( (*(_BYTE *)&v58.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v58.__r_.__value_.__l.__data_);
if ( (v94 & 1) != 0 )
operator delete(v95);
LOBYTE(v96) = 24;
strcpy((char *)&v96 + 1, "The Mechanic");
v59.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x60u);
v59.__r_.__value_.__r.__words[0] = 97;
v59.__r_.__value_.__l.__size_ = 92;
strcpy(
v59.__r_.__value_.__l.__data_,
"Come back when you have\ncollected more Diamonds...");
v35 = DialogObject::create(&v96, &v59, 50, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v3, v35);
if ( (*(_BYTE *)&v59.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v59.__r_.__value_.__l.__data_);
if ( (v96 & 1) != 0 )
{
v14 = v97;
LABEL_84:
operator delete(v14);
}
goto LABEL_98;
}
}
memmove(v20, v17, v19);
goto LABEL_72;
default:
goto LABEL_98;
}
}