//
// DailyLevelPage::claimLevelReward from 0x100232390 to 0x10023250f (383 bytes)
//
// 1 xrefs:
// > DailyLevelNode::onClaimReward @ 0x1002333c5
//
// 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 DailyLevelPage::claimLevelReward(
DailyLevelPage *a1,
DailyLevelNode *a2,
GJGameLevel *a3,
cocos2d::CCPoint a4)
{
__int64 v4; // rax
float v5; // xmm2_4
GameStatsManager *v7; // rax
GJRewardItem *v8; // rax
GJRewardItem *v9; // r12
RewardUnlockLayer *v10; // r13
GameStatsManager *v11; // rax
int BonusDiamonds; // r13d
CurrencyRewardLayer *v13; // rax
GameLevelManager *v14; // rax
GameLevelManager *v15; // rax
unsigned int v16; // r14d
unsigned int v17; // eax
int v18; // ecx
int v19; // r8d
int v20; // r9d
cocos2d::CCAction *v21; // rax
_QWORD v22[6]; // [rsp+0h] [rbp-30h] BYREF
v22[0] = v4;
v7 = GameStatsManager::sharedState();
v8 = GameStatsManager::completedDailyLevel(v7, a3);
if ( v8 )
{
v9 = v8;
v10 = RewardUnlockLayer::create(v8->m_rewardType, nullptr);
((void (__fastcall *)(DailyLevelPage *, RewardUnlockLayer *, __int64, double))a1->addChild_0)(
a1,
v10,
100,
*(double *)&a4);
RewardUnlockLayer::showCollectReward(v10, v9);
}
else
{
v11 = GameStatsManager::sharedState();
BonusDiamonds = GameStatsManager::getBonusDiamonds(v11, a3->m_stars.random - a3->m_stars.seed);
sub_10028CC60(v22);
v13 = CurrencyRewardLayer::create(0, 0, 0, BonusDiamonds, Icon, 0, Icon, 0, 0, (CurrencyRewardType)v22, 1.0, v5);
((void (__fastcall *)(DailyLevelPage *, CurrencyRewardLayer *, __int64))a1->addChild_0)(a1, v13, 14);
}
DailyLevelPage::exitDailyNode(a1, a2, 0.0);
v14 = GameLevelManager::sharedState();
if ( GameLevelManager::getDailyID(v14, a1->m_type) <= a3->m_dailyID.random - a3->m_dailyID.seed )
{
DailyLevelPage::createDailyNode(a1, nullptr, 0, 0.5, 0);
}
else
{
a1->m_downloadStarted = 1;
v15 = GameLevelManager::sharedState();
GameLevelManager::downloadLevel(v15, a1->m_downloadLevelID, 0, 0);
v16 = (unsigned int)cocos2d::CCDelayTime::create(0.5);
v17 = (unsigned int)cocos2d::CCCallFunc::create(
a1,
(cocos2d::SEL_CallFunc)(unsigned __int64)DailyLevelPage::createNodeIfLoaded);
v21 = (cocos2d::CCAction *)sub_1003B5760(v16, v17, 0, v18, v19, v20);
cocos2d::CCNode::runAction(a1, v21);
}
}