//
// PlayLayer::playGravityEffect from 0x402900 to 0x402b2c (556 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:47:25 +0000
//
unsigned __int8 *__fastcall PlayLayer::playGravityEffect(unsigned __int8 *this, int a2)
{
unsigned __int8 *v2; // r4
int v4; // r7
int v5; // r3
cocos2d::CCSprite *v6; // r5
int v7; // r3
int v8; // r2
float v9; // s15
char v10; // r3
int v11; // r1
const cocos2d::CCPoint *v12; // r2
cocos2d::CCSequence *v13; // r7
cocos2d::CCFiniteTimeAction *v14; // r0
cocos2d::CCAction *v15; // r0
float v16; // r1
cocos2d::CCSequence *v17; // r0
cocos2d::CCSequence *v18; // r7
cocos2d::CCFiniteTimeAction *v19; // r0
cocos2d::CCAction *v20; // r0
int v21; // [sp+8h] [bp-44h]
float v22; // [sp+Ch] [bp-40h] BYREF
float v23; // [sp+10h] [bp-3Ch]
_BYTE v24[8]; // [sp+14h] [bp-38h] BYREF
_BYTE v25[8]; // [sp+1Ch] [bp-30h] BYREF
_BYTE v26[8]; // [sp+24h] [bp-28h] BYREF
_BYTE v27[8]; // [sp+2Ch] [bp-20h] BYREF
int v28; // [sp+34h] [bp-18h]
int v29; // [sp+38h] [bp-14h]
_DWORD v30[2]; // [sp+3Ch] [bp-10h] BYREF
v2 = this;
if ( !*(this + 12208) )
{
this = (unsigned __int8 *)GameManager::sharedState((GameManager *)this);
v4 = *(this + 725);
if ( !*(this + 725) )
{
v5 = *((_DWORD *)v2 + 2983);
if ( v5 < *((_DWORD *)v2 + 2982) )
{
*((_DWORD *)v2 + 2983) = v5 + 1;
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v22);
v6 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(
*((cocos2d::CCArray **)v2 + 2985),
*((_DWORD *)v2 + 2984));
(*(void (__fastcall **)(cocos2d::CCSprite *, int))(*(_DWORD *)v6 + 264))(v6, 1);
v7 = *((_DWORD *)v2 + 2984);
if ( v7 >= *((_DWORD *)v2 + 2982) - 1 )
v8 = v4;
else
v8 = v7 + 1;
v9 = v22;
*((_DWORD *)v2 + 2984) = v8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, v9 * 0.5, v23 + 95.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v22 * 0.5, -95.0);
if ( *(_BYTE *)(*((_DWORD *)v2 + 519) + 1963) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v22 + 95.0, v23 * 0.5);
cocos2d::CCPoint::operator=(v25, v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, -95.0, v23 * 0.5);
cocos2d::CCPoint::operator=(v24, v30);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27);
if ( a2 )
{
cocos2d::CCPoint::operator=(v26, v25);
cocos2d::CCPoint::operator=(v27, v24);
v10 = 0;
LOWORD(v21) = -1;
}
else
{
cocos2d::CCPoint::operator=(v26, v24);
cocos2d::CCPoint::operator=(v27, v25);
cocos2d::CCSprite::setFlipY(v6, 1);
v10 = -1;
LOWORD(v21) = -256;
}
BYTE2(v21) = v10;
if ( *(_BYTE *)(*((_DWORD *)v2 + 519) + 1963) )
v11 = 1119092736;
else
v11 = 0;
(*(void (__fastcall **)(cocos2d::CCSprite *, int))(*(_DWORD *)v6 + 180))(v6, v11);
(*(void (__fastcall **)(unsigned __int8 *, cocos2d::CCSprite *, _DWORD))(*(_DWORD *)v2 + 232))(v2, v6, 0);
(*(void (__fastcall **)(cocos2d::CCSprite *, _BYTE *))(*(_DWORD *)v6 + 92))(v6, v26);
GravityEffectSprite::updateSpritesColor((int)v6, v21);
v13 = (cocos2d::CCSequence *)cocos2d::CCMoveTo::create((cocos2d::CCMoveTo *)0x3ECCCCCD, COERCE_FLOAT(v27), v12);
v28 = 268;
v29 = 1;
v14 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v6, 268, 1);
v15 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v13, v14, 0);
cocos2d::CCNode::runAction(v6, v15);
v17 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3ECCCCCD, v16);
v30[1] = 0;
v30[0] = PlayLayer::gravityEffectFinished;
v18 = v17;
v19 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v2, PlayLayer::gravityEffectFinished, 0);
v20 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v18, v19, 0);
return (unsigned __int8 *)cocos2d::CCNode::runAction((cocos2d::CCNode *)v2, v20);
}
}
}
return this;
}