//
// SecretLayer3::onClick from 0x4eb698 to 0x4ebe10 (1912 bytes)
//
// 0 xrefs:
//
// 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 SecretLayer3::onClick(SecretLayer3 *a1, cocos2d::CCObject *a2)
{
int m_lockInput; // r6
cocos2d::CCArray *v5; // r5
cocos2d::CCArray *v6; // r8
GameManager *v7; // r0
GameStatsManager *v8; // r0
cocos2d::CCObject *v9; // r0
cocos2d::CCObject *v10; // r0
cocos2d::CCObject *v11; // r0
GameManager *v12; // r0
int v13; // r8
int v14; // r9
GameStatsManager *v15; // r0
cocos2d::CCObject *v16; // r0
cocos2d::CCObject *v17; // r0
cocos2d::CCObject *v18; // r0
GameManager *v19; // r0
GameStatsManager *v20; // r0
cocos2d::CCObject *v21; // r0
cocos2d::CCObject *v22; // r0
cocos2d::CCObject *v23; // r0
cocos2d::CCObject *v24; // r0
cocos2d::CCObject *v25; // r0
GameManager *v26; // r0
GameManager *v27; // r0
DialogLayer *v28; // r5
FMODAudioEngine *v29; // r11
int v30; // r2
int v31; // r3
FMODAudioEngine *v32; // r11
int v33; // r2
int v34; // r3
const cocos2d::CCPoint *v35; // r0
bool v36; // r2
cocos2d::CCNode *v37; // r7
CCCircleWave *v38; // r0
CCCircleWave_vtbl *v39; // r3
CCCircleWave *v40; // r0
CCCircleWave_vtbl *v41; // r2
GameManager *v42; // r0
_BOOL4 UGV; // r6
GameManager *v44; // r0
int v45; // r6
GameManager *v46; // r0
cocos2d::CCDelayTime *v47; // r0
cocos2d::CCSequence *v48; // r5
cocos2d::CCFiniteTimeAction *v49; // r1
cocos2d::CCAction *v50; // r0
cocos2d::CCDelayTime *v51; // r0
cocos2d::CCSequence *v52; // r6
cocos2d::CCFiniteTimeAction *v53; // r1
int v54; // [sp+4h] [bp-40h]
int v55; // [sp+4h] [bp-40h]
int v56; // [sp+4h] [bp-40h]
int v57; // [sp+4h] [bp-40h]
int v58; // [sp+4h] [bp-40h]
int v59; // [sp+4h] [bp-40h]
int v60; // [sp+4h] [bp-40h]
int v61; // [sp+4h] [bp-40h]
int v62; // [sp+4h] [bp-40h]
cocos2d::CCNode *v63; // [sp+10h] [bp-34h]
cocos2d::CCPoint *getChildByTag; // [sp+10h] [bp-34h]
cocos2d::CCNode *v65; // [sp+10h] [bp-34h]
cocos2d::CCNode *v66; // [sp+10h] [bp-34h]
cocos2d::CCPoint v67; // [sp+1Ch] [bp-28h] BYREF
_DWORD v68[2]; // [sp+24h] [bp-20h] BYREF
float v69; // [sp+2Ch] [bp-18h] BYREF
float v70; // [sp+30h] [bp-14h]
float v71; // [sp+34h] [bp-10h]
int v72; // [sp+38h] [bp-Ch]
m_lockInput = a1->m_lockInput;
if ( !a1->m_lockInput )
{
v5 = (cocos2d::CCArray *)a2->getTag(a2);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
if ( v5 == (cocos2d::CCArray *)((char *)&dword_0 + 1) )
{
v7 = GameManager::sharedState();
GameManager::setUGV(v7, "19", 1);
v8 = GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(v8, GJItem, 1) )
{
sub_776584((int)v68, "...");
sub_776584((int)&v69, "The first key is hidden in a secret gauntlet...");
LOWORD(v54) = -1;
BYTE2(v54) = -1;
v9 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v54);
cocos2d::CCArray::addObject(v6, v9);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584((int)&v69, "Only a chosen few can find it, but I will grant you this gift...");
LOWORD(v55) = -1;
BYTE2(v55) = -1;
v10 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v55);
cocos2d::CCArray::addObject(v6, v10);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584(
(int)&v69,
"Complete the Chaos Gauntlet, and the key will be yours...");
LOWORD(v56) = -1;
BYTE2(v56) = -1;
v11 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v56);
cocos2d::CCArray::addObject(v6, v11);
LABEL_9:
sub_774008(&v69);
sub_774008(v68);
LABEL_15:
v28 = DialogLayer::createWithObjects(v6, (int)byte_4);
a1->addChild_0(a1, v28, 100);
DialogLayer::updateChatPlacement(v28, Center);
DialogLayer::animateIn(v28, FromCenter);
return;
}
v12 = GameManager::sharedState();
v13 = 255;
v14 = 100;
GameManager::setUGV(v12, "14", 1);
}
else if ( v5 == (cocos2d::CCArray *)((char *)&dword_0 + 2) )
{
v15 = GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(v15, GJItem, 2) )
{
sub_776584((int)v68, "...");
sub_776584((int)&v69, "They tried to hide it from me,\nbut I have my spies.");
LOWORD(v54) = -1;
BYTE2(v54) = -1;
v16 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v54);
cocos2d::CCArray::addObject(v6, v16);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584((int)&v69, "The second key is locked away in a secret chest.");
LOWORD(v57) = -1;
BYTE2(v57) = -1;
v17 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v57);
cocos2d::CCArray::addObject(v6, v17);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584((int)&v69, "Unlock 50 secret chests to claim the key.");
LOWORD(v58) = -1;
BYTE2(v58) = -1;
v18 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v58);
cocos2d::CCArray::addObject(v6, v18);
goto LABEL_9;
}
v19 = GameManager::sharedState();
v13 = 50;
v14 = 255;
GameManager::setUGV(v19, "15", 1);
m_lockInput = 50;
}
else
{
if ( v5 != (cocos2d::CCArray *)((char *)&dword_0 + 3) )
goto LABEL_15;
v20 = GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(v20, GJItem, 3) )
{
sub_776584((int)v68, "...");
sub_776584((int)&v69, "The third key is hidden well.\nEven I have not been able to find it.");
LOWORD(v54) = -1;
BYTE2(v54) = -1;
v21 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1063675494,
0.0,
v54);
cocos2d::CCArray::addObject(v6, v21);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584(
(int)&v69,
"I suspect it is guarded by The Gatekeeper.\nRubRub's trusted pet....");
LOWORD(v59) = -1;
BYTE2(v59) = -1;
v22 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1061997773,
0.0,
v59);
cocos2d::CCArray::addObject(v6, v22);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584((int)&v69, "To claim the key you must fool him.\nI do not know how.");
LOWORD(v60) = -1;
BYTE2(v60) = -1;
v23 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1063675494,
0.0,
v60);
cocos2d::CCArray::addObject(v6, v23);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584((int)&v69, "You will find The Gatekeeper at the end of the world.");
LOWORD(v61) = -1;
BYTE2(v61) = -1;
v24 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1065353216,
0.0,
v61);
cocos2d::CCArray::addObject(v6, v24);
sub_774008(&v69);
sub_774008(v68);
sub_776584((int)v68, "...");
sub_776584((int)&v69, "Touch the ground beneath the promise, and the door will be revealed.");
LOWORD(v62) = -1;
BYTE2(v62) = -1;
v25 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)v68,
(std::string)&v69,
(std::string)15,
1061997773,
0.0,
v62);
cocos2d::CCArray::addObject(v6, v25);
sub_774008(&v69);
sub_774008(v68);
v26 = GameManager::sharedState();
GameManager::setUGV(v26, "6", 1);
goto LABEL_15;
}
v27 = GameManager::sharedState();
v13 = 0;
v14 = 200;
GameManager::setUGV(v27, "16", 1);
m_lockInput = 255;
}
a2->__vftable[13].copyWithZone(a2, nullptr);
((void (__fastcall *)(cocos2d::CCObject *, _DWORD))a2->__vftable[4].~CCObject)(a2, 0);
v29 = FMODAudioEngine::sharedEngine();
sub_776584((int)&v69, "chestClick.ogg");
FMODAudioEngine::playEffect(v29, (int)&v69, v30, v31);
sub_774008(&v69);
v32 = FMODAudioEngine::sharedEngine();
sub_776584((int)&v69, "chestOpen01.ogg");
FMODAudioEngine::playEffect(v32, (int)&v69, v33, v34);
sub_774008(&v69);
v63 = (cocos2d::CCNode *)((int (__fastcall *)(cocos2d::CCObject *))a2->__vftable[6].~CCObject_0)(a2);
v35 = (const cocos2d::CCPoint *)((int (__fastcall *)(cocos2d::CCObject *))a2->__vftable[2].acceptVisitor)(a2);
cocos2d::CCNode::convertToWorldSpace(&v67, v63, v35);
v37 = (cocos2d::CCNode *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"coinPickupEffect.plist",
nullptr,
v36);
((void (__fastcall *)(cocos2d::CCNode *, int))v37->__vftable[1].onEnter)(v37, 1);
getChildByTag = (cocos2d::CCPoint *)v37->__vftable[1].getChildByTag;
v72 = 1065353216;
v69 = (float)m_lockInput / 255.0;
v70 = (float)v14 / 255.0;
v71 = (float)v13 / 255.0;
((void (__fastcall *)(cocos2d::CCNode *, float *))getChildByTag)(v37, &v69);
a1->addChild_0(a1, v37, 1);
v37->setPosition(v37, &v67);
v38 = CCCircleWave::create((CCCircleWave *)0x41C80000, 5.0, 0.3, 0.0, 0, v54);
v39 = v38->__vftable;
v38->m_color.r = m_lockInput;
v38->m_color.b = v13;
v38->m_color.g = v14;
v65 = v38;
v39->setPosition(v38, &v67);
a1->addChild_0(a1, v65, 0);
v40 = CCCircleWave::create(5.0, 60.0, 0.3, 0);
v41 = v40->__vftable;
v40->m_color.r = m_lockInput;
v40->m_color.b = v13;
v40->m_color.g = v14;
v66 = v40;
v41->setPosition(v40, &v67);
a1->addChild_0(a1, v66, 0);
v66[1].m_uIndexInArray = 1;
v66[1].m_uUnknown = 4;
v42 = GameManager::sharedState();
UGV = GameManager::getUGV(v42, "14");
v44 = GameManager::sharedState();
v45 = UGV + GameManager::getUGV(v44, "15");
v46 = GameManager::sharedState();
if ( GameManager::getUGV(v46, "16") + v45 == 3 )
{
v47 = cocos2d::CCDelayTime::create(1.0);
v68[1] = 0;
v68[0] = SecretLayer3::revealStep1;
v48 = (cocos2d::CCSequence *)v47;
v49 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, SecretLayer3::revealStep1, 0);
v50 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v48, v49, 0);
}
else
{
a1->m_lockInput = 1;
v51 = cocos2d::CCDelayTime::create(0.5);
v70 = 0.0;
v69 = COERCE_FLOAT(SecretLayer3::showUnlockDialog);
v52 = (cocos2d::CCSequence *)v51;
v53 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, SecretLayer3::showUnlockDialog, 0);
v50 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v52, v53, 0);
}
cocos2d::CCNode::runAction(a1, v50);
}
}