//
// GauntletSelectLayer::onPlay from 0x10025547c to 0x10025585c (992 bytes)
//
// 1 xrefs:
// > GauntletSelectLayer::setupGauntlets @ 0x100254ffc
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:01:33 +0000
//
__int64 __fastcall GauntletSelectLayer::onPlay(__int64 result, __int64 a2)
{
_QWORD *v2; // x19
__int64 v4; // x0
__int64 v5; // x20
__int64 v6; // x0
__int64 isItemUnlocked; // x0
__int64 v8; // x0
__int64 v9; // x22
__int64 v10; // x0
__int64 hasCompletedMapPack; // x0
__int64 v12; // x0
__int64 v13; // x19
__int64 v14; // x19
__int64 v15; // x0
__int64 v16; // x0
void *v17; // x0
__int64 v18; // x0
__int64 v19; // x20
char *v20; // x0
char *v21; // x0
char *v22; // x0
void *v23; // x20
__int64 v24; // x19
__int64 v25; // x0
__int64 v26; // x21
float *v27; // x22
char v28; // w0
__int64 v29; // x1
__int64 v30; // x2
__int64 v31; // x3
__int64 v32; // x4
__int64 v33; // x5
__int64 v34; // x6
__int64 v35; // x7
__int64 v36; // x0
__int64 v37; // x0
__int64 v38; // x0
__int64 v39; // x20
__int64 v40; // x21
void *v41[2]; // [xsp+18h] [xbp-C8h] BYREF
char v42; // [xsp+2Fh] [xbp-B1h]
void *v43[2]; // [xsp+30h] [xbp-B0h] BYREF
char v44; // [xsp+47h] [xbp-99h]
void *v45[2]; // [xsp+48h] [xbp-98h] BYREF
char v46; // [xsp+5Fh] [xbp-81h]
void *__p[2]; // [xsp+60h] [xbp-80h] BYREF
char v48; // [xsp+77h] [xbp-69h]
void *v49[2]; // [xsp+78h] [xbp-68h] BYREF
char v50; // [xsp+8Fh] [xbp-51h]
void *v51[2]; // [xsp+90h] [xbp-50h] BYREF
char v52; // [xsp+A7h] [xbp-39h]
void *v53[2]; // [xsp+A8h] [xbp-38h] BYREF
char v54; // [xsp+BFh] [xbp-21h]
if ( (*(_BYTE *)(result + 473) & 1) == 0 )
{
v2 = (_QWORD *)result;
if ( (*(_BYTE *)(result + 504) & 1) == 0 && (*(_BYTE *)(result + 513) & 1) == 0 )
{
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v5 = v4;
if ( (_DWORD)v4 == 8
&& (v6 = GameStatsManager::sharedState(v4),
isItemUnlocked = GameStatsManager::isItemUnlocked(v6, 12, 5),
(isItemUnlocked & 1) == 0) )
{
v19 = sub_1002E736C(isItemUnlocked);
sub_100009900(v53, "...");
sub_100009900(v51, "It's no use, that Gauntlet is locked.");
v20 = DialogObject::create((__int64)v53, (__int64)v51, 2, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v19, v20);
if ( v52 < 0 )
operator delete(v51[0]);
if ( v54 < 0 )
operator delete(v53[0]);
sub_100009900(v49, "...");
sub_100009900(__p, "The Demon Guardian was the only one who could open it.");
v21 = DialogObject::create((__int64)v49, (__int64)__p, 2, 0, 0xFFFFFF, 0.8);
sub_1002E74E0(v19, v21);
if ( v48 < 0 )
operator delete(__p[0]);
if ( v50 < 0 )
operator delete(v49[0]);
sub_100009900(v45, "...");
sub_100009900(v43, "Not sure what happened to him. He always was a bit crazy.");
v22 = DialogObject::create((__int64)v45, (__int64)v43, 2, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v19, v22);
if ( v44 < 0 )
operator delete(v43[0]);
if ( v46 < 0 )
operator delete(v45[0]);
v23 = DialogLayer::createWithObjects(v19, 2);
(*(void (__fastcall **)(_QWORD *, void *, __int64))(*v2 + 464LL))(v2, v23, 100);
DialogLayer::updateChatPlacement((__int64)v23, 0);
return DialogLayer::animateInRandomSide((__int64)v23);
}
else
{
v8 = GameLevelManager::sharedState();
v9 = sub_1000B9308(v8, v5);
v10 = GameStatsManager::sharedState(v9);
if ( (sub_1003D4EC4(v10, v5) & 1) != 0 )
{
hasCompletedMapPack = GJMapPack::hasCompletedMapPack(v9);
if ( (_DWORD)hasCompletedMapPack
&& (v12 = GameStatsManager::sharedState(hasCompletedMapPack),
hasCompletedMapPack = sub_1003D44A0(v12, v5),
(hasCompletedMapPack & 1) == 0) )
{
cocos2d::CCDictionary::objectForKey_1(v2[62], (unsigned int)v5);
v26 = v25;
v27 = cocos2d::CCDelayTime::create(0.5);
v28 = (unsigned __int8)cocos2d::CCCallFunc::create(v26, (__int64)sub_100255B44, 0);
v36 = sub_10021D420((__int64)v27, v29, v30, v31, v32, v33, v34, v35, v28);
cocos2d::CCNode::runAction(v26, v36);
v38 = GameStatsManager::sharedState(v37);
result = sub_1003D4ECC(v38, v5);
if ( result )
{
v39 = result;
v40 = RewardUnlockLayer::create(*(unsigned int *)(result + 64), 0);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v2 + 464LL))(v2, v40, 100);
return RewardUnlockLayer::showCollectReward(v40, v39);
}
}
else
{
*((_BYTE *)v2 + 473) = 1;
v13 = GameManager::sharedState(hasCompletedMapPack);
*(_DWORD *)(v13 + 1084) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v14 = cocos2d::CCDirector::sharedDirector();
v15 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v16 = GauntletLayer::scene(v15);
v17 = (void *)cocos2d::CCTransitionFade::create_1(v16, 0.5);
return cocos2d::CCDirector::replaceScene(v14, v17);
}
}
else
{
result = sub_10039560C();
if ( (_DWORD)result )
{
if ( (v2[64] & 1) == 0 )
{
*((_BYTE *)v2 + 512) = 1;
v18 = GameManager::sharedState(result);
*(_QWORD *)(v18 + 1296) = v2 + 53;
*(_DWORD *)(GameManager::sharedState(v18) + 1716) = v5;
*((_DWORD *)v2 + 127) = v5;
return nullsub_166();
}
}
else
{
sub_100009900(v41, "The Gauntlet cannot be unlocked right now.\nPlease try again later.");
v24 = FLAlertLayer::create_1(0, "Unlock Gauntlet", v41, "OK", 0, 380.0);
if ( v42 < 0 )
operator delete(v41[0]);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v24 + 1312LL))(v24);
}
}
}
}
}
return result;
}