//
// GJDifficultySprite::updateFeatureState from 0x1002e5a38 to 0x1002e5c40 (520 bytes)
//
// 3 xrefs:
// > RateStarsLayer::onFeature @ 0x100080998
// > GJRateLevelLayer::onFeature @ 0x1001b17e0
// > GJDifficultySprite::updateFeatureStateFromLevel @ 0x1002e5a30
//
// 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 GJDifficultySprite::updateFeatureState(GJDifficultySprite *a1, GJFeatureState a2)
{
unsigned __int32 v3; // w8
std::string *v4; // x0
cocos2d::CCSprite *v5; // x20
float v6; // s8
__int64 v7; // x0
__n128 v8; // q0
__n128 v9; // q1
cocos2d::CCParticleSystemQuad *v10; // x20
float v11; // s8
__int64 v12; // x0
__n128 v13; // q0
__n128 v14; // q1
int v15; // w19
int v16; // [xsp+8h] [xbp-58h] BYREF
void *__p[2]; // [xsp+10h] [xbp-50h] BYREF
char v18; // [xsp+27h] [xbp-39h]
std::string v19; // [xsp+28h] [xbp-38h] BYREF
if ( a1->m_featureState != a2 )
{
a1->m_featureState = a2;
((void (__fastcall *)(GJDifficultySprite *))a1->removeAllChildren)(a1);
if ( a1->m_featureState )
{
sub_100009900(&v19, "GJ_featuredCoin_001.png");
v3 = a1->m_featureState - 2;
if ( v3 < 3 )
std::string::assign(&v19, off_1007E55D8[v3]);
if ( (v19.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v4 = &v19;
else
v4 = (std::string *)v19.__r_.__value_.__r.__words[0];
v5 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v4);
((void (__fastcall *)(GJDifficultySprite *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v5, 4294967294LL);
v6 = *(float *)((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1);
v7 = ((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1);
v8.n128_f32[0] = v6 * 0.5;
v9.n128_f32[0] = *(float *)(v7 + 4) * 0.5;
sub_100022980(v8, v9, __p);
((void (__fastcall *)(cocos2d::CCSprite *, void **))v5->setPosition)(v5, __p);
if ( a1->m_featureState == Mythic )
{
sub_100009900(
__p,
"30a-1a1.3a0.2a20a90a0a10a5a20a20a0a0a8a0a0a0a4a1a0a0a0a0a1a0a1a0a1a0a1a1a0a0a0a0a0.784314a0a1a0a1a0a0.27a0a0.2"
"7a0a0a0a0a0a0a0a0a2a1a0a0a0a0a0a0a0.25a0a0a0a0a0a0a0a0a0a0a0");
v10 = GameToolbox::particleFromString((__int64)__p, nullptr, 0);
((void (__fastcall *)(GJDifficultySprite *, cocos2d::CCParticleSystemQuad *, __int64))a1->addChild_0)(
a1,
v10,
0xFFFFFFFFLL);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v10->setScale)(v10, 0.9);
cocos2d::CCParticleSystem::resetSystem(v10);
v11 = *(float *)((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1);
v12 = ((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1);
v13.n128_f32[0] = v11 * 0.5;
v14.n128_f32[0] = *(float *)(v12 + 4) * 0.5;
sub_100022980(v13, v14, &v16);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, int *))v10->setPosition)(v10, &v16);
v15 = 5;
do
{
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v10->update)(v10, 0.15);
--v15;
}
while ( v15 );
if ( v18 < 0 )
operator delete(__p[0]);
}
if ( SHIBYTE(v19.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v19.__r_.__value_.__l.__data_);
}
}
}