//
// FollowRewardPage::onSpecialItem from 0x1004209e0 to 0x100420f1e (1342 bytes)
//
// 1 xrefs:
// > FollowRewardPage::init @ 0x1004203d5
//
// 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 FollowRewardPage::onSpecialItem(FollowRewardPage *a1, cocos2d::CCObject *a2)
{
unsigned int v2; // r15d
__m128 v3; // xmm0
GameManager *v4; // rax
bool UGV; // r12
GameManager *v6; // rax
GameManager *v7; // rax
GameManager *v8; // rax
GameManager *v9; // rax
GameManager *v10; // rax
GameStatsManager *v11; // r15
std::string::pointer v12; // r14
FLAlertLayerProtocol *v13; // rbx
std::string::pointer v14; // r8
ButtonSprite **v15; // rbx
GJRewardItem *v16; // r15
GJChestSprite *v17; // r12
__int64 v18; // rax
unsigned int *v19; // rax
_QWORD *v20; // rbx
unsigned __int64 v21; // r14
__int64 v22; // r13
RewardUnlockLayer *v23; // r14
__int128 v24; // [rsp+10h] [rbp-D0h] BYREF
void *__p; // [rsp+20h] [rbp-C0h]
__int128 v26; // [rsp+30h] [rbp-B0h] BYREF
void *data; // [rsp+40h] [rbp-A0h]
std::string v28; // [rsp+48h] [rbp-98h] BYREF
std::string v29; // [rsp+60h] [rbp-80h] BYREF
std::string v30; // [rsp+78h] [rbp-68h] BYREF
std::string v31; // [rsp+90h] [rbp-50h] BYREF
__int16 v32; // [rsp+B4h] [rbp-2Ch] BYREF
char v33; // [rsp+B6h] [rbp-2Ah]
v2 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
v3 = 0;
memset(&v31, 0, sizeof(v31));
*(_WORD *)&v28.__r_.__value_.__l.0 = 0;
*(_WORD *)&v30.__r_.__value_.__l.0 = 0;
*(_WORD *)&v29.__r_.__value_.__l.0 = 0;
switch ( v2 )
{
case 1u:
std::string::assign(&v31, "0007");
v4 = GameManager::sharedState();
UGV = GameManager::getUGV(v4, "22");
std::string::assign(&v28, "YouTube");
std::string::assign(&v30, "Subscribe to RobTop Games on YouTube\nto unlock this chest!");
std::string::assign(&v29, "Sub!");
goto LABEL_8;
case 2u:
std::string::assign(&v31, "0008");
v9 = GameManager::sharedState();
UGV = GameManager::getUGV(v9, "24");
std::string::assign(&v28, "Twitter");
std::string::assign(&v30, "Follow RobTop Games on Twitter\nto unlock this chest!");
std::string::assign(&v29, "Follow!");
goto LABEL_8;
case 3u:
std::string::assign(&v31, "0009");
v7 = GameManager::sharedState();
UGV = GameManager::getUGV(v7, "23");
std::string::assign(&v28, "Facebook");
std::string::assign(&v30, "Like Geometry Dash on Facebook\nto unlock this chest!");
std::string::assign(&v29, "Like!");
goto LABEL_8;
case 4u:
std::string::assign(&v31, "0010");
v8 = GameManager::sharedState();
UGV = GameManager::getUGV(v8, "26");
std::string::assign(&v28, "Twitch");
std::string::assign(&v30, "Follow Geometry Dash on Twitch\nto unlock this chest!");
std::string::assign(&v29, "Follow!");
goto LABEL_8;
case 5u:
std::string::assign(&v31, "0011");
v6 = GameManager::sharedState();
UGV = GameManager::getUGV(v6, "27");
std::string::assign(&v28, "Discord");
std::string::assign(&v30, "Join Geometry Dash on Discord\nto unlock this chest!");
std::string::assign(&v29, "Join!");
goto LABEL_8;
case 6u:
std::string::assign(&v31, "0024");
v10 = GameManager::sharedState();
UGV = GameManager::getUGV(v10, "32");
std::string::assign(&v28, "Reddit");
std::string::assign(&v30, "Join Geometry Dash on Reddit\nto unlock this chest!");
std::string::assign(&v29, "Join!");
LABEL_8:
if ( UGV )
{
v11 = GameStatsManager::sharedState();
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v26, v31.__r_.__value_.__l.__data_, v31.__r_.__value_.__l.__size_, 0.0);
}
else
{
data = v31.__r_.__value_.__l.__data_;
v3 = *(__m128 *)&v31.__r_.__value_.__l.0;
v26 = *(_OWORD *)&v31.__r_.__value_.__l.0;
}
v16 = GameStatsManager::unlockSpecialChest(v11, (__int64)&v26, v3);
if ( (v26 & 1) != 0 )
operator delete(data);
if ( v16 )
{
v17 = (GJChestSprite *)((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[13].~CCObject_0)(a2);
v17->m_dark = 0;
GJChestSprite::switchToState(v17, Opened, 1);
v18 = ((__int64 (__fastcall *)(GJChestSprite *))v17->getChildren)(v17);
if ( v18 )
{
v19 = *(unsigned int **)(v18 + 56);
if ( *v19 )
{
v20 = *((_QWORD **)v19 + 2);
v21 = (unsigned __int64)&v20[*v19 - 1];
do
{
v22 = *v20;
if ( !*v20 )
break;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v22 + 896LL))(*v20, 150);
v33 = -106;
v32 = -26986;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v22 + 944LL))(v22, &v32);
++v20;
}
while ( (unsigned __int64)v20 <= v21 );
}
}
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[13].copyWithZone)(a2, 0);
v23 = RewardUnlockLayer::create(v16->m_rewardType, nullptr);
((void (__fastcall *)(FollowRewardPage *, RewardUnlockLayer *, __int64))a1->addChild_0)(a1, v23, 100);
RewardUnlockLayer::showCollectReward(v23, v16);
}
goto LABEL_31;
}
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
{
v12 = v28.__r_.__value_.__l.__data_;
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_13;
LABEL_16:
__p = v30.__r_.__value_.__l.__data_;
v24 = *(_OWORD *)&v30.__r_.__value_.__l.0;
v13 = &a1->FLAlertLayerProtocol;
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_14;
goto LABEL_17;
}
v12 = v28.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_16;
LABEL_13:
sub_100006B70(&v24, v30.__r_.__value_.__l.__data_, v30.__r_.__value_.__l.__size_, 0.0);
v13 = &a1->FLAlertLayerProtocol;
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) != 0 )
{
LABEL_14:
v14 = v29.__r_.__value_.__l.__data_;
goto LABEL_18;
}
LABEL_17:
v14 = v29.__r_.__value_.__s.__data_;
LABEL_18:
v15 = (ButtonSprite **)FLAlertLayer::create_1(v13, v12, &v24, "Cancel", v14, 380.0);
if ( (v24 & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(ButtonSprite **, _QWORD))&(*v15)->m_fVertexZ)(v15, v2);
ButtonSprite::updateBGImage(v15[75], "GJ_button_02.png");
(*(void (__fastcall **)(ButtonSprite **))&(*v15)[1].m_fTextureTop)(v15);
LABEL_31:
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v29.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_33:
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_34;
goto LABEL_39;
}
}
else if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_33;
}
operator delete(v30.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_34:
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
return;
goto LABEL_35;
}
LABEL_39:
operator delete(v28.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
return;
LABEL_35:
operator delete(v31.__r_.__value_.__l.__data_);
return;
default:
goto LABEL_31;
}
}