//
// GameStatsManager::incrementChallenge from 0x10032f988 to 0x10032fb6c (484 bytes)
//
// 3 xrefs:
// > GameStatsManager::incrementStat @ 0x10032c394
// > GameStatsManager::incrementStat @ 0x10032c3ac
// > GameStatsManager::incrementStat @ 0x10032c410
//
// 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 GameStatsManager::incrementChallenge(GameStatsManager *a1, GJChallengeType a2, int a3)
{
int i; // w22
GJChallengeItem *Challenge; // x0
GJChallengeItem *v8; // x25
GJChallengeType m_challengeType; // w8
std::string *v10; // x0
const std::string::value_type *v11; // x1
const std::string::value_type *v12; // x1
AchievementManager *v13; // x28
std::string *v14; // x9
cocos2d::CCString *v15; // x0
const char *CString; // x2
void **v17; // x3
void *__p[2]; // [xsp+10h] [xbp-80h] BYREF
char v19; // [xsp+27h] [xbp-69h]
std::string v20; // [xsp+28h] [xbp-68h] BYREF
for ( i = 1; i != 4; ++i )
{
Challenge = GameStatsManager::getChallenge(a1, i);
if ( Challenge )
{
v8 = Challenge;
if ( !Challenge->m_canClaim && Challenge->m_challengeType == a2 )
{
GJChallengeItem::incrementCount(Challenge, a3);
if ( v8->m_canClaim )
{
sub_100009900(&v20, "");
sub_100009900(__p, "currencyOrbIcon_001.png");
m_challengeType = v8->m_challengeType;
switch ( m_challengeType )
{
case 3:
std::string::assign(&v20, "Stars/Moons");
v10 = (std::string *)__p;
v11 = "GJ_starsIcon_001.png";
break;
case 2:
if ( v8->m_goal.random - v8->m_goal.seed == 1 )
v12 = "Silver Coin";
else
v12 = "Silver Coins";
std::string::assign(&v20, v12);
v10 = (std::string *)__p;
v11 = "GJ_coinsIcon2_001.png";
break;
case 1:
std::string::assign(&v20, "Mana Orbs");
v10 = (std::string *)__p;
v11 = "currencyOrbIcon_001.png";
break;
default:
v10 = &v20;
v11 = "?";
break;
}
std::string::assign(v10, v11);
v13 = AchievementManager::sharedState();
v14 = &v20;
if ( (v20.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v14 = (std::string *)v20.__r_.__value_.__r.__words[0];
v15 = (cocos2d::CCString *)sub_100268F4C(
"Collect %i %s.",
v8->m_goal.random - v8->m_goal.seed,
(const char *)v14);
CString = cocos2d::CCString::getCString(v15);
if ( v19 >= 0 )
v17 = __p;
else
v17 = (void **)__p[0];
AchievementManager::notifyAchievement(v13, "Quest Complete!", CString, (const char *)v17);
if ( v19 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v20.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v20.__r_.__value_.__l.__data_);
}
}
}
}
}