//
// EndLevelLayer::playStarEffect from 0x1401356e0 to 0x140135a78 (920 bytes)
//
// 5 xrefs:
// > EndLevelLayer::showLayer @ 0x140134d72
// > EndLevelLayer::showLayer @ 0x140134e41
// > ??> @ 0x1406711c0
// > ??> @ 0x1406711d0
// > ??> @ 0x1406c9f00
//
// 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 EndLevelLayer::playStarEffect(EndLevelLayer *a1, float a2)
{
float v2; // xmm3_4
PlayLayer *m_playLayer; // rax
cocos2d::CCDirector *v5; // rax
CCLightFlash *v6; // r15
PlayLayer *v7; // rcx
GJGameLevel *m_level; // rdx
int m_levelLength; // r8d
int v10; // eax
int *p_m_moons; // rdi
int v12; // edi
const char *v13; // rcx
CCLightFlash *v14; // r14
CCLightFlash_vtbl *v15; // rbx
const cocos2d::CCPoint *v16; // rax
cocos2d::CCString *v17; // rax
const char *CString; // rax
CCLightFlash *v19; // rsi
CCLightFlash_vtbl *v20; // rbx
const cocos2d::CCPoint *v21; // rax
CCLightFlash_vtbl *v22; // rbx
const cocos2d::CCPoint *v23; // rax
__int64 v24; // rax
__int64 v25; // rdi
struct cocos2d::CCScaleTo *v26; // rax
struct cocos2d::CCEaseBounceOut *v27; // rbx
struct cocos2d::CCDelayTime *v28; // rax
struct cocos2d::CCSequence *v29; // rax
cocos2d::ccColor3B *v30; // r8
struct cocos2d::CCDelayTime *v31; // rax
struct cocos2d::CCSequence *v32; // rax
cocos2d::ccColor3B *v33; // r8
struct cocos2d::CCDelayTime *v34; // rbx
struct cocos2d::CCFadeIn *v35; // rax
struct cocos2d::CCSequence *v36; // rdi
struct cocos2d::CCDelayTime *v37; // rbx
struct cocos2d::CCFadeIn *v38; // rax
struct cocos2d::CCSequence *v39; // rbx
cocos2d::ccColor3B *v40; // r8
cocos2d::ccColor3B *v41; // r8
float v42; // [rsp+20h] [rbp-48h]
float v43; // [rsp+20h] [rbp-48h]
float v44; // [rsp+20h] [rbp-48h]
float v45; // [rsp+20h] [rbp-48h]
cocos2d::CCPoint v46; // [rsp+70h] [rbp+8h] BYREF
cocos2d::CCPoint v47; // [rsp+88h] [rbp+20h] BYREF
m_playLayer = a1->m_playLayer;
if ( m_playLayer && m_playLayer->m_endLayerStars )
{
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v5);
v6 = (CCLightFlash *)cocos2d::CCNode::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v6, 10);
v7 = a1->m_playLayer;
m_level = v7->m_level;
m_levelLength = m_level->m_levelLength;
if ( v7->m_endLayerStars )
{
v10 = m_level->m_stars.random - m_level->m_stars.seed;
if ( m_levelLength == 5 )
{
p_m_moons = &a1->m_moons;
a1->m_moons = v10;
}
else
{
p_m_moons = &a1->m_stars;
a1->m_stars = v10;
}
}
else
{
p_m_moons = &a1->m_stars;
if ( m_levelLength == 5 )
p_m_moons = &a1->m_moons;
}
v12 = *p_m_moons;
v13 = "GJ_bigStar_001.png";
if ( m_levelLength == 5 )
v13 = "GJ_bigMoon_001.png";
v14 = (CCLightFlash *)cocos2d::CCSprite::createWithSpriteFrameName(v13);
((void (__fastcall *)(CCLightFlash *))v14->setScale_0)(v14);
v6->addChild_1(v6, v14);
v15 = v14->__vftable;
cocos2d::CCPoint::CCPoint(&v46, 15.0, 0.0);
v15->setPosition_0(v14, v16);
v17 = cocos2d::CCString::createWithFormat("+%i", v12);
CString = cocos2d::CCString::getCString(v17);
v19 = (CCLightFlash *)cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_14052A4D8);
v20 = v19->__vftable;
cocos2d::CCPoint::CCPoint(&v46, 1.0, 0.5);
v20->setAnchorPoint(v19, v21);
v6->addChild_1(v6, v19);
v22 = v19->__vftable;
cocos2d::CCPoint::CCPoint(&v46, -2.0, -16.0);
v22->setPosition_0(v19, v23);
cocos2d::CCPoint::CCPoint(&v47, -20.0, 0.0);
v24 = (__int64)v14->getPosition_0(v14);
cocos2d::CCPoint::operator+(v24, &v46);
v19->setPosition_0(v19, &v46);
((void (__fastcall *)(CCLightFlash *))v19->setScale_0)(v19);
v19->m_eObjType = 4;
v6->setPosition_0(v6, &a1->m_starsPosition);
((void (__fastcall *)(CCLightFlash *))v6->setScale_0)(v6);
v25 = cocos2d::CCCallFunc::create(a1, EndLevelLayer::starEnterFinished);
v26 = cocos2d::CCScaleTo::create(0.30000001, 1.0);
v27 = cocos2d::CCEaseBounceOut::create(v26);
v28 = cocos2d::CCDelayTime::create(a2);
v29 = cocos2d::CCSequence::create(v28, v27, 0);
cocos2d::CCNode::runAction(v6, (cocos2d::CCPoint)v29, v30, v2, v42);
v31 = cocos2d::CCDelayTime::create(a2 + 0.2);
v32 = cocos2d::CCSequence::create(v31, v25, 0);
cocos2d::CCNode::runAction(v6, (cocos2d::CCPoint)v32, v33, v2, v43);
(*(void (__fastcall **)(cocos2d::CCArray **, _QWORD))&v14->m_lightStripArray->m_unknown2)(
&v14->m_lightStripArray,
0);
(*(void (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)&v19[1].m_uID + 40LL))(&v19[1].m_uID, 0);
v34 = cocos2d::CCDelayTime::create(a2);
v35 = cocos2d::CCFadeIn::create(0.30000001);
v36 = cocos2d::CCSequence::create(v34, v35, 0);
v37 = cocos2d::CCDelayTime::create(a2);
v38 = cocos2d::CCFadeIn::create(0.30000001);
v39 = cocos2d::CCSequence::create(v37, v38, 0);
cocos2d::CCNode::runAction(v14, (cocos2d::CCPoint)v36, v40, v2, v44);
cocos2d::CCNode::runAction(v19, (cocos2d::CCPoint)v39, v41, v2, v45);
}
}