//
// SecretLayer2::showCompletedLevel from 0x1403e3910 to 0x1403e45bf (3247 bytes)
//
// 2 xrefs:
// > SecretLayer2::init @ 0x1403e371b
// > ??> @ 0x1406d7f40
//
// 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=1
void SecretLayer2::showCompletedLevel(SecretLayer2 *a1)
{
cocos2d::CCArray *v2; // rbx
char *v3; // rax
char *v4; // rax
char *v5; // rax
char *v6; // rax
char *v7; // rax
char *v8; // rax
char *v9; // rax
__int128 v10; // xmm0
char *v11; // rax
char *v12; // rax
char *v13; // rax
char *v14; // rax
char *v15; // rax
DialogLayer *DialogLayer; // rax
CCLightFlash *v17; // rsi
DialogDelegate *v18; // rcx
__int64 v19; // rcx
cocos2d::CCDirector *v20; // rax
cocos2d::CCGridBase_vtbl *v21; // rbx
__int64 v22; // rax
_BOOL8 v23; // rdx
float v24; // xmm1_4
double v25; // xmm0_8
cocos2d::CCGridBase_vtbl *v26; // rbx
__int64 v27; // rax
struct cocos2d::CCMoveTo *v28; // rax
struct cocos2d::CCEaseElasticOut *v29; // rax
cocos2d::ccColor3B *v30; // r8
float v31; // xmm6_4
struct cocos2d::CCFadeTo *v32; // rax
cocos2d::ccColor3B *v33; // r8
float v34; // [rsp+20h] [rbp-60h]
float v35; // [rsp+20h] [rbp-60h]
_WORD v36[8]; // [rsp+30h] [rbp-50h] BYREF
__int64 v37; // [rsp+40h] [rbp-40h]
__int64 v38; // [rsp+48h] [rbp-38h]
__int128 v39; // [rsp+50h] [rbp-30h] BYREF
__int64 v40; // [rsp+60h] [rbp-20h]
__int64 v41; // [rsp+68h] [rbp-18h]
__int128 *v42; // [rsp+A8h] [rbp+28h] BYREF
__int16 v43; // [rsp+B0h] [rbp+30h] BYREF
char v44; // [rsp+B2h] [rbp+32h]
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 5;
v41 = 15;
strcpy((char *)&v39, "Huh!?");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v3 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 1, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v3);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x40u);
v40 = 48;
v41 = 63;
strcpy((char *)v39, "My level... You beat it?");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v4 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v4);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x40u);
v40 = 61;
v41 = 63;
strcpy((char *)v39, "I guess I underestimated you.\nIt will not happen again.");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v5 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v5);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x40u);
v40 = 51;
v41 = 63;
strcpy((char *)v39, "... Why are you still here?");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v6 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v6);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x30u);
v40 = 45;
v41 = 47;
strcpy((char *)v39, "Ah of course, you want a prize.");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v7 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v7);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x20u);
v40 = 27;
v41 = 31;
strcpy((char *)v39, "RubRub always gives prizes.");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v8 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v8);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x50u);
v40 = 68;
v41 = 79;
strcpy((char *)v39, "Uhm... Not sure what to...");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v9 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v9);
v42 = &v39;
v43 = -1;
v44 = -1;
v10 = 0;
v40 = 10;
v41 = 15;
*(_QWORD *)&v10 = 0x6F6E6B204920684FLL;
v39 = v10;
WORD4(v39) = 8567;
BYTE10(v39) = 0;
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v11 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v11);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x40u);
v40 = 49;
v41 = 63;
strcpy((char *)v39, "I left an old chest down in the basement.");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v12 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v12);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x30u);
v40 = 38;
v41 = 47;
strcpy((char *)v39, "You can have that as a reward!");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v13 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v13);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x40u);
v40 = 59;
v41 = 63;
strcpy((char *)v39, "Take the door on the right, I will open it for you.");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v14 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v14);
v42 = &v39;
v43 = -1;
v44 = -1;
v39 = 0;
v40 = 0;
v41 = 15;
*(_QWORD *)&v39 = sub_14003AA10(0x80u);
v40 = 126;
v41 = 127;
strcpy(
(char *)v39,
"Grab the chest and come back...\n"
"DONT TOUCH ANYTHING!");
v36[7] = 0;
v37 = 13;
v38 = 15;
strcpy((char *)v36, "The Keymaster");
v15 = DialogObject::create((__int64)v36, (__int64)&v39, 2, 1.0, 0, (__int64)&v43);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v15);
DialogLayer = DialogLayer::createDialogLayer(nullptr, v2, 2);
v17 = (CCLightFlash *)DialogLayer;
v18 = &a1->DialogDelegate;
if ( !a1 )
v18 = nullptr;
DialogLayer->m_delegate = v18;
a1->addChild_0(a1, DialogLayer, 100);
v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v19);
cocos2d::CCDirector::getWinSize(v20);
v21 = v17[1].m_pGrid->cocos2d::CCNode::__vftable;
cocos2d::CCPoint::CCPoint(1.9431574e-19, *(float *)&v42 * 0.5);
((void (__fastcall *)(cocos2d::CCGridBase *, __int64))v21[1].calculateVertexPoints)(v17[1].m_pGrid, v22);
LOBYTE(v23) = 1;
v17->setVisible(v17, v23);
v24 = sub_14003CF30();
*(float *)&v17[1].m_pCamera = v24;
v17[1].m_pGrid->cocos2d::CCNode::__vftable[2].~CCGridBase(v17[1].m_pGrid);
v25 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v42);
v26 = v17[1].m_pGrid->cocos2d::CCNode::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v25, -191.0);
((void (__fastcall *)(cocos2d::CCGridBase *, __int64))v26[1].calculateVertexPoints)(v17[1].m_pGrid, v27);
v28 = cocos2d::CCMoveTo::create(0.5, (const struct cocos2d::CCPoint *)&v42);
v29 = cocos2d::CCEaseElasticOut::create(v28, 0.60000002);
cocos2d::CCNode::runAction((CCLightFlash *)v17[1].m_pGrid, (cocos2d::CCPoint)v29, v30, 1.0, v34);
v31 = (float)(*(unsigned __int8 (__fastcall **)(int *))(*(_QWORD *)&v17[1].m_uOrderOfArrival + 32LL))(&v17[1].m_uOrderOfArrival);
if ( v31 > 0.0 )
{
(*(void (__fastcall **)(int *, _QWORD))(*(_QWORD *)&v17[1].m_uOrderOfArrival + 40LL))(&v17[1].m_uOrderOfArrival, 0);
v32 = cocos2d::CCFadeTo::create(0.14, (int)v31);
cocos2d::CCNode::runAction(v17, (cocos2d::CCPoint)v32, v33, 1.0, v35);
}
}