//
// GameStatsManager::incrementChallenge from 0x412d38 to 0x412e70 (312 bytes)
//
// 1 xrefs:
// > GameStatsManager::incrementStat @ 0x41bbb2
//
// 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 GameStatsManager::incrementChallenge(GameStatsManager *a1, GJChallengeType a2, int a3)
{
int i; // r7
GJChallengeItem *Challenge; // r0
GJChallengeItem *v8; // r4
GJChallengeType m_challengeType; // r3
char **v10; // r0
char *v11; // r1
AchievementManager *v12; // r11
cocos2d::CCString *v13; // r0
char *v14; // r1
const char *CString; // r0
int v16; // [sp+24h] [bp-10h] BYREF
char *v17; // [sp+28h] [bp-Ch] BYREF
for ( i = 1; i != 4; ++i )
{
Challenge = GameStatsManager::getChallenge(a1, i);
v8 = Challenge;
if ( Challenge && !Challenge->m_canClaim )
{
if ( Challenge->m_challengeType == a2 )
GJChallengeItem::incrementCount(Challenge, a3);
if ( v8->m_canClaim )
{
sub_776584((int)&v16, (char *)&unk_939830);
sub_776584((int)&v17, "currencyOrbIcon_001.png");
m_challengeType = v8->m_challengeType;
switch ( m_challengeType )
{
case 1:
sub_7753D4((int)&v16, "Mana Orbs");
v10 = &v17;
v11 = "currencyOrbIcon_001.png";
break;
case 3:
sub_7753D4((int)&v16, "Stars/Moons");
v10 = &v17;
v11 = "GJ_starsIcon_001.png";
break;
case 2:
if ( v8->m_goal.random - v8->m_goal.seed == 1 )
v14 = "Silver Coin";
else
v14 = "Silver Coins";
sub_7753D4((int)&v16, v14);
v10 = &v17;
v11 = "GJ_coinsIcon2_001.png";
break;
default:
v10 = (char **)&v16;
v11 = "?";
break;
}
sub_7753D4((int)v10, v11);
v12 = AchievementManager::sharedState();
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Collect %i %s.",
(const char *)(v8->m_goal.random - v8->m_goal.seed),
v16);
CString = cocos2d::CCString::getCString(v13);
AchievementManager::notifyAchievement(v12, "Quest Complete!", CString, v17);
sub_774008(&v17);
sub_774008(&v16);
}
}
}
}