//
// PlayLayer::playGravityEffect from 0x1000b9370 to 0x1000b9681 (785 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008b73e0
//
// 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 PlayLayer::playGravityEffect(PlayLayer *a1, bool a2)
{
int m_activeGravityEffects; // eax
cocos2d::CCSprite *v4; // r14
int m_gravityEffectIndex; // ecx
int v6; // esi
__int64 v7; // rsi
int v8; // r15d
cocos2d::CCSprite_vtbl *v9; // rax
__int64 v10; // xmm0_8
__int64 v11; // rax
__int64 v12; // r15
unsigned int v13; // r12d
__int64 v14; // rax
unsigned int v15; // r15d
unsigned int v16; // eax
int v17; // ecx
int v18; // r8d
int v19; // r9d
cocos2d::CCAction *v20; // rax
unsigned int v21; // r14d
unsigned int v22; // eax
int v23; // ecx
int v24; // r8d
int v25; // r9d
cocos2d::CCAction *v26; // rax
int v27; // [rsp-5Ch] [rbp-5Ch] BYREF
int v28; // [rsp-54h] [rbp-54h] BYREF
cocos2d::CCPoint v29; // [rsp-4Ch] [rbp-4Ch] BYREF
int v30; // [rsp-44h] [rbp-44h] BYREF
float v31; // [rsp-3Ch] [rbp-3Ch] BYREF
float v32; // [rsp-38h] [rbp-38h]
__int16 v33; // [rsp-34h] [rbp-34h] BYREF
char v34; // [rsp-32h] [rbp-32h]
double v35; // 0:xmm0_8.8
if ( a1->m_disableGravityEffect )
return;
if ( GameManager::sharedState()->m_performanceMode )
return;
m_activeGravityEffects = a1->m_activeGravityEffects;
if ( m_activeGravityEffects >= a1->m_totalGravityEffects )
return;
a1->m_activeGravityEffects = m_activeGravityEffects + 1;
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v35 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v31);
v4 = (cocos2d::CCSprite *)sub_1007200C0(a1->m_gravityEffects, (unsigned int)a1->m_gravityEffectIndex);
((void (__fastcall *)(cocos2d::CCSprite *, __int64, double))v4->removeFromParentAndCleanup)(v4, 1, v35);
m_gravityEffectIndex = a1->m_gravityEffectIndex;
v6 = 0;
if ( m_gravityEffectIndex < a1->m_totalGravityEffects - 1 )
v6 = m_gravityEffectIndex + 1;
a1->m_gravityEffectIndex = v6;
sub_10028CBE0(&v27, v31 * 0.5, v32 + 95.0);
sub_10028CBE0(&v28, v31 * 0.5, -95.0);
if ( a1->m_player1->m_isSideways )
{
sub_10028CBE0(&v30, v31 + 95.0, v32 * 0.5);
sub_10028CC90();
sub_10028CBE0(&v30, -95.0, 0.5 * v32);
sub_10028CC90();
}
sub_10028CC30(&v30);
sub_10028CC30(&v29);
if ( a2 )
{
sub_10028CC90();
v7 = (__int64)&v27;
sub_10028CC90();
v8 = 0xFFFF;
v9 = v4->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_player1->m_isSideways )
{
LABEL_10:
v10 = 1119092736;
goto LABEL_13;
}
}
else
{
sub_10028CC90();
sub_10028CC90();
v7 = 1;
cocos2d::CCSprite::setFlipY(v4, 1);
v8 = 16776960;
v9 = v4->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_player1->m_isSideways )
goto LABEL_10;
}
v10 = 0;
LABEL_13:
((void (__fastcall *)(cocos2d::CCSprite *, __int64, double))v9->setRotation)(v4, v7, *(double *)&v10);
((void (__fastcall *)(PlayLayer *, cocos2d::CCSprite *, _QWORD))a1->addChild_0)(a1, v4, 0);
((void (__fastcall *)(cocos2d::CCSprite *, int *))v4->setPosition)(v4, &v30);
v34 = BYTE2(v8);
v33 = v8;
v11 = ((__int64 (__fastcall *)(cocos2d::CCSprite *, __int64))v4->getChildByTag)(v4, 1);
if ( v11 )
{
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 472LL))(v11);
if ( (unsigned int)sub_100720070(v12) )
{
v13 = 0;
do
{
v14 = sub_1007200C0(v12, v13);
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v14 + 944LL))(v14, &v33);
++v13;
}
while ( v13 < (unsigned int)sub_100720070(v12) );
}
}
v15 = (unsigned int)cocos2d::CCMoveTo::create(0.40000001, &v29);
v16 = (unsigned int)cocos2d::CCCallFunc::create(v4, (cocos2d::SEL_CallFunc)0x209uLL);
v20 = (cocos2d::CCAction *)sub_1003B5760(v15, v16, 0, v17, v18, v19);
cocos2d::CCNode::runAction(v4, v20);
v21 = (unsigned int)cocos2d::CCDelayTime::create(0.40000001);
v22 = (unsigned int)cocos2d::CCCallFunc::create(
a1,
(cocos2d::SEL_CallFunc)(unsigned __int64)PlayLayer::gravityEffectFinished);
v26 = (cocos2d::CCAction *)sub_1003B5760(v21, v22, 0, v23, v24, v25);
cocos2d::CCNode::runAction(a1, v26);
}