//
// DailyLevelPage::claimLevelReward from 0x1001baacc to 0x1001bac20 (340 bytes)
//
// 1 xrefs:
// > DailyLevelNode::onClaimReward @ 0x1001bba0c
//
// 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; // x3
__int64 *v5; // x22
GameStatsManager *v9; // x0
GJRewardItem *v10; // x0
GJRewardItem *v11; // x23
RewardUnlockLayer *v12; // x22
GameStatsManager *v13; // x0
int BonusDiamonds; // w23
float v15; // s2
float v16; // s3
CurrencyRewardLayer *v17; // x0
GameLevelManager *v18; // x0
__int64 v19; // [xsp+18h] [xbp-38h] BYREF
cocos2d::CCPoint v20; // 0:s0.4,4:s1.4
v5 = v4;
v9 = GameStatsManager::sharedState();
v10 = GameStatsManager::completedDailyLevel(v9, a3);
if ( v10 )
{
v11 = v10;
v12 = RewardUnlockLayer::create(v10->m_rewardType, nullptr);
((void (__fastcall *)(DailyLevelPage *, RewardUnlockLayer *, __int64))a1->addChild_0)(a1, v12, 100);
RewardUnlockLayer::showCollectReward(v12, v11);
}
else
{
v13 = GameStatsManager::sharedState();
BonusDiamonds = GameStatsManager::getBonusDiamonds(v13, a3->m_stars.random - a3->m_stars.seed);
sub_1000229B8(&v19, v5);
v20.x = 0.0;
v20.y = 1.0;
v17 = CurrencyRewardLayer::create(0, 0, 0, BonusDiamonds, Icon, 0, Icon, 0, v20, (CurrencyRewardType)&v19, v15, v16);
((void (__fastcall *)(DailyLevelPage *, CurrencyRewardLayer *, __int64))a1->addChild_0)(a1, v17, 14);
}
DailyLevelPage::exitDailyNode(a1, a2, 0.0);
v18 = GameLevelManager::sharedState();
if ( GameLevelManager::getDailyID(v18, a1->m_type) <= a3->m_dailyID.random - a3->m_dailyID.seed )
DailyLevelPage::createDailyNode(a1, nullptr, 0, 0.5, 0);
else
DailyLevelPage::downloadAndCreateNode(a1);
}