//
// ChallengesPage::claimItem from 0x908c88 to 0x908e0c (388 bytes)
//
// 2 xrefs:
// > ChallengeNode::onClaimReward @ 0x908e70
// > ??> @ 0xc2370
//
// 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 ChallengesPage::claimItem(ChallengesPage *a1, ChallengeNode *a2, GJChallengeItem *a3, cocos2d::CCPoint a4)
{
cocos2d::CCPoint *v4; // x3
int m_position; // w22
GameStatsManager *v8; // x0
CurrencyRewardLayer *m_currencyRewardLayer; // x23
const cocos2d::CCPoint *v10; // x1
float v11; // s2
float v12; // s3
GameStatsManager *v13; // x0
CurrencyRewardLayer *v14; // x0
cocos2d::CCPoint *v15; // [xsp+58h] [xbp+48h]
int v16; // [xsp+58h] [xbp+48h]
cocos2d::CCPoint v17; // [xsp+60h] [xbp+50h] BYREF
cocos2d::CCPoint v18; // 0:s0.4,4:s1.4
v15 = v4;
m_position = a3->m_position;
v8 = GameStatsManager::sharedState();
GameStatsManager::completedChallenge(v8, a3);
m_currencyRewardLayer = a1->m_currencyRewardLayer;
v10 = v15;
v16 = a3->m_reward.random - a3->m_reward.seed;
cocos2d::CCPoint::CCPoint(&v17, v10);
v18.x = 0.0;
if ( m_currencyRewardLayer )
{
CurrencyRewardLayer::createObjects(m_currencyRewardLayer, Star|Orb, v16, v18, v11);
}
else
{
v18.y = 1.0;
v14 = CurrencyRewardLayer::create(0, 0, 0, v16, Icon, 0, Icon, 0, v18, (CurrencyRewardType)&v17, v11, v12);
a1->m_currencyRewardLayer = v14;
v14->m_delegate = &a1->CurrencyRewardDelegate;
a1->addChild_0(a1, a1->m_currencyRewardLayer, 14);
}
ChallengesPage::exitNodeAtSlot(a1, m_position, 0.0);
v13 = GameStatsManager::sharedState();
GameStatsManager::processChallengeQueue(v13, m_position);
ChallengesPage::createChallengeNode(a1, m_position, 0, 0.5, 1);
ChallengesPage::updateTimers(a1, 0.0);
ChallengesPage::updateDots(a1);
}