//
// EndLevelLayer::playStarEffect from 0x1002f7894 to 0x1002f7bdc (840 bytes)
//
// 2 xrefs:
// > EndLevelLayer::showLayer @ 0x1002f780c
// > EndLevelLayer::showLayer @ 0x1002f7858
//
// 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 EndLevelLayer::playStarEffect(EndLevelLayer *a1, float a2)
{
float32x2_t v2; // x29
float32x2_t v3; // x30
float32x2_t v4; // d8
float32x2_t v5; // d9
PlayLayer *m_playLayer; // x8
cocos2d::CCDirector *v9; // x0
cocos2d::CCNode *v10; // x20
PlayLayer *v11; // x10
GJGameLevel *m_level; // x9
int m_levelLength; // w8
int v14; // w9
bool v15; // zf
const char *v16; // x0
__int64 v17; // x8
int v18; // w22
cocos2d::CCSprite *v19; // x19
__n128 v20; // q0
__n128 v21; // q1
cocos2d::CCString *v22; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v24; // x22
__n128 v25; // q0
__n128 v26; // q1
__n128 v27; // q0
__n128 v28; // q1
float32x2_t *v29; // x23
__n128 v30; // q0
__n128 v31; // q1
double v32; // d0
char v33; // w21
cocos2d::CCScaleTo *v34; // x0
cocos2d::CCDelayTime *v35; // x0
__int64 v36; // x1
__int64 v37; // x2
__int64 v38; // x3
__int64 v39; // x4
__int64 v40; // x5
__int64 v41; // x6
__int64 v42; // x7
cocos2d::CCSequence *v43; // x0
cocos2d::CCDelayTime *v44; // x0
__int64 v45; // x1
__int64 v46; // x2
__int64 v47; // x3
__int64 v48; // x4
__int64 v49; // x5
__int64 v50; // x6
__int64 v51; // x7
cocos2d::CCSequence *v52; // x0
cocos2d::CCDelayTime *v53; // x20
char v54; // w0
__int64 v55; // x1
__int64 v56; // x2
__int64 v57; // x3
__int64 v58; // x4
__int64 v59; // x5
__int64 v60; // x6
__int64 v61; // x7
cocos2d::CCSequence *v62; // x20
cocos2d::CCDelayTime *v63; // x21
char v64; // w0
__int64 v65; // x1
__int64 v66; // x2
__int64 v67; // x3
__int64 v68; // x4
__int64 v69; // x5
__int64 v70; // x6
__int64 v71; // x7
cocos2d::CCSequence *v72; // x21
float32x2_t v73; // [xsp+18h] [xbp-68h] BYREF
float32x2_t v74[12]; // [xsp+20h] [xbp-60h] BYREF
cocos2d::SEL_CallFunc v75; // 0:x1.16
m_playLayer = a1->m_playLayer;
if ( m_playLayer && m_playLayer->m_endLayerStars )
{
v74[2] = v5;
v74[3] = v4;
v74[10] = v2;
v74[11] = v3;
v9 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v9);
v10 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCNode *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v10,
10);
v11 = a1->m_playLayer;
m_level = v11->m_level;
m_levelLength = m_level->m_levelLength;
if ( v11->m_endLayerStars )
{
v14 = m_level->m_stars.random - m_level->m_stars.seed;
if ( m_levelLength == 5 )
a1->m_moons = v14;
else
a1->m_stars = v14;
}
v15 = m_levelLength == 5;
if ( m_levelLength == 5 )
v16 = "GJ_bigMoon_001.png";
else
v16 = "GJ_bigStar_001.png";
v17 = 668;
if ( v15 )
v17 = 672;
v18 = *(_DWORD *)((char *)&a1->GJDropDownLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v17);
v19 = cocos2d::CCSprite::createWithSpriteFrameName(v16);
((void (__fastcall *)(cocos2d::CCSprite *, float))v19->setScale)(v19, 0.8);
v20 = ((__n128 (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v10->addChild)(v10, v19);
v20.n128_u32[0] = 15.0;
v21.n128_u32[0] = 0;
sub_100022980(v20, v21, v74);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v19->setPosition)(v19, v74);
v22 = (cocos2d::CCString *)sub_100268F4C("+%i", v18);
CString = cocos2d::CCString::getCString(v22);
v24 = cocos2d::CCLabelBMFont::create_1(CString, "bigFont.fnt");
v25.n128_u32[0] = 1.0;
v26.n128_u32[0] = 0.5;
sub_100022980(v25, v26, v74);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v24->setAnchorPoint)(v24, v74);
v27 = ((__n128 (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v10->addChild)(v10, v24);
v27.n128_u32[0] = -2.0;
v28.n128_u32[0] = -16.0;
sub_100022980(v27, v28, v74);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v24->setPosition)(v24, v74);
v29 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v19->getPosition)(v19);
v30.n128_u32[0] = -20.0;
v31.n128_u32[0] = 0;
sub_100022980(v30, v31, &v73);
*(float32x2_t *)&v32 = sub_1000229DC(v29, &v73, v74);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v24->setPosition)(v24, v74, v32);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v24->setScale)(v24, 0.7);
v24->m_eObjType = 4;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCPoint *))v10->setPosition)(v10, &a1->m_starsPosition);
((void (__fastcall *)(cocos2d::CCNode *, float))v10->setScale)(v10, 3.0);
v75.ptr = (void (*)(void))EndLevelLayer::starEnterFinished;
v75.adj = 0;
v33 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, v75);
v34 = cocos2d::CCScaleTo::create_1(0.3, 1.0);
LOBYTE(v29) = (unsigned __int8)cocos2d::CCEaseBounceOut::create(v34);
v35 = cocos2d::CCDelayTime::create(a2);
v43 = sub_10018A494(v35, v36, v37, v38, v39, v40, v41, v42, (char)v29);
cocos2d::CCNode::runAction(v10, v43);
v44 = cocos2d::CCDelayTime::create(a2 + 0.2);
v52 = sub_10018A494(v44, v45, v46, v47, v48, v49, v50, v51, v33);
cocos2d::CCNode::runAction(v10, v52);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))v19->setOpacity)(v19, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v24->setOpacity)(v24, 0);
v53 = cocos2d::CCDelayTime::create(a2);
v54 = (unsigned __int8)cocos2d::CCFadeIn::create(0.3);
v62 = sub_10018A494(v53, v55, v56, v57, v58, v59, v60, v61, v54);
v63 = cocos2d::CCDelayTime::create(a2);
v64 = (unsigned __int8)cocos2d::CCFadeIn::create(0.3);
v72 = sub_10018A494(v63, v65, v66, v67, v68, v69, v70, v71, v64);
cocos2d::CCNode::runAction(v19, v62);
cocos2d::CCNode::runAction(v24, v72);
}
}