//
// SecretLayer3::onClick from 0x10030f0c4 to 0x10030f970 (2220 bytes)
//
// 3 xrefs:
// > SecretLayer3::init @ 0x10030e75c
// > SecretLayer3::init @ 0x10030e800
// > SecretLayer3::init @ 0x10030e8a4
//
// 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 SecretLayer3::onClick(SecretLayer3 *a1, cocos2d::CCObject *a2)
{
int v4; // w22
cocos2d::CCArray *v5; // x20
GameManager *v6; // x0
GameStatsManager *v7; // x0
unsigned __int32 v8; // w22
const char *v9; // x20
GameStatsManager *v10; // x0
GameStatsManager *v11; // x0
GameManager *v12; // x0
FMODAudioEngine *v13; // x20
FMODAudioEngine *v14; // x20
cocos2d::CCNode *v15; // x20
const cocos2d::CCPoint *v16; // x0
cocos2d::CCParticleSystemQuad *v17; // x20
int8x8_t v18; // d2
CCCircleWave *v19; // x20
CCCircleWave *v20; // x20
GameManager *v21; // x0
GameManager *v22; // x0
GameManager *v23; // x0
void (*v24)(void); // x21
float v25; // s0
cocos2d::CCDelayTime *v26; // x22
char v27; // w0
__int64 v28; // x1
__int64 v29; // x2
__int64 v30; // x3
__int64 v31; // x4
__int64 v32; // x5
__int64 v33; // x6
__int64 v34; // x7
cocos2d::CCSequence *v35; // x0
void *v36; // x0
GameManager *v37; // x0
DialogLayer *v38; // x20
float32x2_t v39; // [xsp+18h] [xbp-298h] BYREF
float v40; // [xsp+20h] [xbp-290h]
int v41; // [xsp+24h] [xbp-28Ch]
_BYTE v42[8]; // [xsp+28h] [xbp-288h] BYREF
void *v43[2]; // [xsp+30h] [xbp-280h] BYREF
char v44; // [xsp+47h] [xbp-269h]
void *__p[2]; // [xsp+48h] [xbp-268h] BYREF
char v46; // [xsp+5Fh] [xbp-251h]
void *v47[2]; // [xsp+60h] [xbp-250h] BYREF
char v48; // [xsp+77h] [xbp-239h]
void *v49[2]; // [xsp+78h] [xbp-238h] BYREF
char v50; // [xsp+8Fh] [xbp-221h]
void *v51[2]; // [xsp+90h] [xbp-220h] BYREF
char v52; // [xsp+A7h] [xbp-209h]
void *v53[2]; // [xsp+A8h] [xbp-208h] BYREF
char v54; // [xsp+BFh] [xbp-1F1h]
void *v55[2]; // [xsp+C0h] [xbp-1F0h] BYREF
char v56; // [xsp+D7h] [xbp-1D9h]
void *v57[2]; // [xsp+D8h] [xbp-1D8h] BYREF
char v58; // [xsp+EFh] [xbp-1C1h]
void *v59[2]; // [xsp+F0h] [xbp-1C0h] BYREF
char v60; // [xsp+107h] [xbp-1A9h]
void *v61[2]; // [xsp+108h] [xbp-1A8h] BYREF
char v62; // [xsp+11Fh] [xbp-191h]
void *v63[2]; // [xsp+120h] [xbp-190h] BYREF
char v64; // [xsp+137h] [xbp-179h]
void *v65[2]; // [xsp+138h] [xbp-178h] BYREF
char v66; // [xsp+14Fh] [xbp-161h]
void *v67[2]; // [xsp+150h] [xbp-160h] BYREF
char v68; // [xsp+167h] [xbp-149h]
_QWORD v69[2]; // [xsp+168h] [xbp-148h] BYREF
char v70; // [xsp+17Fh] [xbp-131h]
void *v71[2]; // [xsp+180h] [xbp-130h] BYREF
char v72; // [xsp+197h] [xbp-119h]
void *v73[2]; // [xsp+198h] [xbp-118h] BYREF
char v74; // [xsp+1AFh] [xbp-101h]
void *v75[2]; // [xsp+1B0h] [xbp-100h] BYREF
char v76; // [xsp+1C7h] [xbp-E9h]
void *v77[2]; // [xsp+1C8h] [xbp-E8h] BYREF
char v78; // [xsp+1DFh] [xbp-D1h]
void *v79[2]; // [xsp+1E0h] [xbp-D0h] BYREF
char v80; // [xsp+1F7h] [xbp-B9h]
_QWORD v81[2]; // [xsp+1F8h] [xbp-B8h] BYREF
char v82; // [xsp+20Fh] [xbp-A1h]
void *v83[2]; // [xsp+210h] [xbp-A0h] BYREF
char v84; // [xsp+227h] [xbp-89h]
void *v85[2]; // [xsp+228h] [xbp-88h] BYREF
char v86; // [xsp+23Fh] [xbp-71h]
void *v87[2]; // [xsp+240h] [xbp-70h] BYREF
char v88; // [xsp+257h] [xbp-59h]
void *v89[2]; // [xsp+258h] [xbp-58h] BYREF
char v90; // [xsp+26Fh] [xbp-41h]
cocos2d::SEL_CallFunc v91; // 0:x1.16
if ( a1->m_lockInput )
return;
v4 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
v5 = (cocos2d::CCArray *)sub_10024A15C();
if ( v4 == 3 )
{
v11 = GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(v11, GJItem, 3) )
{
v8 = 51455;
v9 = "16";
goto LABEL_11;
}
sub_100009900(v65, "...");
sub_100009900(v63, "The third key is hidden well.\nEven I have not been able to find it.");
DialogObject::create((__int64)v65, (__int64)v63, 15, 0, 0xFFFFFF, 0.9);
sub_10024A2D0((__int64)v5);
if ( v64 < 0 )
operator delete(v63[0]);
if ( v66 < 0 )
operator delete(v65[0]);
sub_100009900(v61, "...");
sub_100009900(
v59,
"I suspect it is guarded by The Gatekeeper.\nRubRub's trusted pet....");
DialogObject::create((__int64)v61, (__int64)v59, 15, 0, 0xFFFFFF, 0.8);
sub_10024A2D0((__int64)v5);
if ( v60 < 0 )
operator delete(v59[0]);
if ( v62 < 0 )
operator delete(v61[0]);
sub_100009900(v57, "...");
sub_100009900(v55, "To claim the key you must fool him.\nI do not know how.");
DialogObject::create((__int64)v57, (__int64)v55, 15, 0, 0xFFFFFF, 0.9);
sub_10024A2D0((__int64)v5);
if ( v56 < 0 )
operator delete(v55[0]);
if ( v58 < 0 )
operator delete(v57[0]);
sub_100009900(v53, "...");
sub_100009900(v51, "You will find The Gatekeeper at the end of the world.");
DialogObject::create((__int64)v53, (__int64)v51, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v52 < 0 )
operator delete(v51[0]);
if ( v54 < 0 )
operator delete(v53[0]);
sub_100009900(v49, "...");
sub_100009900(v47, "Touch the ground beneath the promise, and the door will be revealed.");
DialogObject::create((__int64)v49, (__int64)v47, 15, 0, 0xFFFFFF, 0.8);
sub_10024A2D0((__int64)v5);
if ( v48 < 0 )
operator delete(v47[0]);
if ( v50 < 0 )
operator delete(v49[0]);
v37 = GameManager::sharedState();
GameManager::setUGV(v37, "6", 1);
goto LABEL_65;
}
if ( v4 == 2 )
{
v10 = GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(v10, GJItem, 2) )
{
v8 = 3342130;
v9 = "15";
goto LABEL_11;
}
sub_100009900(v77, "...");
sub_100009900(v75, "They tried to hide it from me,\nbut I have my spies.");
DialogObject::create((__int64)v77, (__int64)v75, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v76 < 0 )
operator delete(v75[0]);
if ( v78 < 0 )
operator delete(v77[0]);
sub_100009900(v73, "...");
sub_100009900(v71, "The second key is locked away in a secret chest.");
DialogObject::create((__int64)v73, (__int64)v71, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v72 < 0 )
operator delete(v71[0]);
if ( v74 < 0 )
operator delete(v73[0]);
sub_100009900(v69, "...");
sub_100009900(v67, "Unlock 50 secret chests to claim the key.");
DialogObject::create((__int64)v69, (__int64)v67, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v68 < 0 )
operator delete(v67[0]);
if ( v70 < 0 )
{
v36 = (void *)v69[0];
LABEL_64:
operator delete(v36);
}
LABEL_65:
v38 = DialogLayer::createWithObjects(v5, 4);
((void (__fastcall *)(SecretLayer3 *, DialogLayer *, __int64))a1->addChild_0)(a1, v38, 100);
DialogLayer::updateChatPlacement(v38, Center);
DialogLayer::animateIn(v38, FromCenter);
return;
}
if ( v4 != 1 )
goto LABEL_65;
v6 = GameManager::sharedState();
GameManager::setUGV(v6, "19", 1);
v7 = GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(v7, GJItem, 1) )
{
sub_100009900(v89, "...");
sub_100009900(v87, "The first key is hidden in a secret gauntlet...");
DialogObject::create((__int64)v89, (__int64)v87, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v88 < 0 )
operator delete(v87[0]);
if ( v90 < 0 )
operator delete(v89[0]);
sub_100009900(v85, "...");
sub_100009900(v83, "Only a chosen few can find it, but I will grant you this gift...");
DialogObject::create((__int64)v85, (__int64)v83, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v84 < 0 )
operator delete(v83[0]);
if ( v86 < 0 )
operator delete(v85[0]);
sub_100009900(v81, "...");
sub_100009900(v79, "Complete the Chaos Gauntlet, and the key will be yours...");
DialogObject::create((__int64)v81, (__int64)v79, 15, 0, 0xFFFFFF, 1.0);
sub_10024A2D0((__int64)v5);
if ( v80 < 0 )
operator delete(v79[0]);
if ( (v82 & 0x80000000) == 0 )
goto LABEL_65;
v36 = (void *)v81[0];
goto LABEL_64;
}
v8 = 16737280;
v9 = "14";
LABEL_11:
v12 = GameManager::sharedState();
GameManager::setUGV(v12, v9, 1);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[13].copyWithZone)(a2, 0);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[4].~CCObject)(a2, 0);
v13 = FMODAudioEngine::sharedEngine();
sub_100009900(__p, "chestClick.ogg");
FMODAudioEngine::playEffect_1((__int64)v13, (__int64)__p);
if ( v46 < 0 )
operator delete(__p[0]);
v14 = FMODAudioEngine::sharedEngine();
sub_100009900(v43, "chestOpen01.ogg");
FMODAudioEngine::playEffect_1((__int64)v14, (__int64)v43);
if ( v44 < 0 )
operator delete(v43[0]);
v15 = (cocos2d::CCNode *)((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[6].~CCObject_0)(a2);
v16 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[2].acceptVisitor)(a2);
cocos2d::CCNode::convertToWorldSpace(v15, v16);
v17 = cocos2d::CCParticleSystemQuad::create("coinPickupEffect.plist", 0);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v17->setAutoRemoveOnFinish)(v17, 1);
v18.i32[0] = v8;
v18.i32[1] = v8 >> 8;
v39 = vdiv_f32(vcvt_f32_u32((uint32x2_t)vand_s8(v18, (int8x8_t)0xFF000000FFLL)), (float32x2_t)vdup_n_s32(0x437F0000u));
v40 = (float)HIWORD(v8) / 255.0;
v41 = 1065353216;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float32x2_t *))v17->setStartColor)(v17, &v39);
((void (__fastcall *)(SecretLayer3 *, cocos2d::CCParticleSystemQuad *, __int64))a1->addChild_0)(a1, v17, 1);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, _BYTE *))v17->setPosition)(v17, v42);
v19 = CCCircleWave::create(25.0, 5.0, 0.3, 0, 0);
v19->m_color = (cocos2d::ccColor3B)v8;
((void (__fastcall *)(CCCircleWave *, _BYTE *))v19->setPosition)(v19, v42);
((void (__fastcall *)(SecretLayer3 *, CCCircleWave *, _QWORD))a1->addChild_0)(a1, v19, 0);
v20 = CCCircleWave::create_1(5.0, 60.0, 0.3, 0);
v20->m_color = (cocos2d::ccColor3B)v8;
((void (__fastcall *)(CCCircleWave *, _BYTE *))v20->setPosition)(v20, v42);
((void (__fastcall *)(SecretLayer3 *, CCCircleWave *, _QWORD))a1->addChild_0)(a1, v20, 0);
*(_QWORD *)&v20->m_circleMode = 0x400000001LL;
v21 = GameManager::sharedState();
LODWORD(v20) = GameManager::getUGV(v21, "14");
v22 = GameManager::sharedState();
LODWORD(v20) = GameManager::getUGV(v22, "15") + (_DWORD)v20;
v23 = GameManager::sharedState();
if ( (_DWORD)v20 + GameManager::getUGV(v23, "16") == 3 )
{
v24 = (void (*)(void))SecretLayer3::revealStep1;
v25 = 1.0;
}
else
{
a1->m_lockInput = 1;
v24 = (void (*)(void))SecretLayer3::showUnlockDialog;
v25 = 0.5;
}
v26 = cocos2d::CCDelayTime::create(v25);
v91.ptr = v24;
v91.adj = 0;
v27 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, v91);
v35 = sub_10018A494(v26, v28, v29, v30, v31, v32, v33, v34, v27);
cocos2d::CCNode::runAction(a1, v35);
}