//
// GJDifficultySprite::updateFeatureState from 0x1402a5270 to 0x1402a582f (1471 bytes)
//
// 5 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x1400af7ed
// > GJRateLevelLayer::onFeature @ 0x1402f594a
// > LevelInfoLayer::updateLabelValues @ 0x1402ffb86
// > RateStarsLayer::onFeature @ 0x1403ca901
// > ??> @ 0x1406d2084
//
// 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
//
// Hidden C++ exception states: #wind=3
void GJDifficultySprite::updateFeatureState(GJDifficultySprite *a1, GJFeatureState a2)
{
cocos2d::CCParticleSystemQuad *v3; // rsi
GJFeatureState m_featureState; // eax
const char *v5; // rcx
struct cocos2d::CCSprite *v6; // rdi
cocos2d::CCSprite_vtbl *v7; // rbx
const cocos2d::CCSize *v8; // rax
const cocos2d::CCPoint *v9; // rax
double v10; // xmm0_8
cocos2d::CCParticleSystemQuad_vtbl *v11; // rbx
const cocos2d::CCSize *v12; // rax
const cocos2d::CCPoint *v13; // rax
__int64 v14; // rbx
_QWORD v15[3]; // [rsp+28h] [rbp-E0h] BYREF
__int64 v16; // [rsp+40h] [rbp-C8h]
_QWORD v17[3]; // [rsp+48h] [rbp-C0h] BYREF
__int64 v18; // [rsp+60h] [rbp-A8h]
__int64 v19; // [rsp+68h] [rbp-A0h]
cocos2d::ParticleStruct v20; // [rsp+78h] [rbp-90h] BYREF
if ( a2 != a1->m_featureState )
{
a1->m_featureState = a2;
a1->removeAllChildren(a1);
if ( a1->m_featureState )
{
*(_OWORD *)&v15[1] = 0;
v3 = nullptr;
v15[1] = sub_14003AA10(0x20u);
v16 = 23;
v17[0] = 31;
strcpy((char *)v15[1], "GJ_featuredCoin_001.png");
m_featureState = a1->m_featureState;
switch ( m_featureState )
{
case Mythic:
v16 = 20;
memmove((void *)v15[1], "GJ_epicCoin3_001.png", 0x14u);
*(_BYTE *)(v15[1] + 20LL) = 0;
break;
case Legendary:
v16 = 20;
memmove((void *)v15[1], "GJ_epicCoin2_001.png", 0x14u);
*(_BYTE *)(v15[1] + 20LL) = 0;
break;
case Epic:
v16 = 19;
memmove((void *)v15[1], "GJ_epicCoin_001.png", 0x13u);
*(_BYTE *)(v15[1] + 19LL) = 0;
break;
}
v5 = (const char *)&v15[1];
if ( v17[0] > 0xFu )
v5 = (const char *)v15[1];
v6 = cocos2d::CCSprite::createWithSpriteFrameName(v5);
a1->addChild_0(a1, v6, -2);
v7 = v6->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->getContentSize(a1);
v8 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(2.6361448e23, v8->width * 0.5);
v7->setPosition_0(v6, v9);
if ( a1->m_featureState == Mythic )
{
*(_OWORD *)&v17[1] = 0;
v18 = 0;
v19 = 15;
v17[1] = sub_14003AA10(0xB0u);
v18 = 170;
v19 = 175;
strcpy(
(char *)v17[1],
"30a-1a1.3a0.2a20a90a0a10a5a20a20a0a0a8a0a0a0a4a1a0a0a0a0a1a0a1a0a1a0a1a1a0a0a0a0a0.784314a0a1a0a1a0a0.27a0a0.2"
"7a0a0a0a0a0a0a0a0a2a1a0a0a0a0a0a0a0.25a0a0a0a0a0a0a0a0a0a0a0");
if ( v18 )
{
sub_140063B90((__int64)&v20);
GameToolbox::particleStringToStruct(&v17[1], (__int64)&v20);
v3 = GameToolbox::particleFromStruct(&v20, nullptr, 0);
sub_14003A830((__int64)&v20.sFrame);
}
v10 = ((double (__fastcall *)(GJDifficultySprite *, cocos2d::CCParticleSystemQuad *, __int64))a1->addChild_0)(
a1,
v3,
0xFFFFFFFFLL);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v3->setScale_0)(v3);
cocos2d::CCParticleSystem::resetSystem(v3);
v11 = v3->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->getContentSize(a1);
v12 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(*(float *)&v10, v12->width * 0.5);
v11->setPosition_0(v3, v13);
v14 = 5;
do
{
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v3->update)(v3);
--v14;
}
while ( v14 );
sub_14003A830((__int64)&v17[1]);
}
sub_14003A830((__int64)&v15[1]);
}
}
}