//
// GravityEffectSprite::init from 0x412c70 to 0x412e4c (476 bytes)
//
// 1 xrefs:
// > GravityEffectSprite::create @ 0x40288e
//
// 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:38 +0000
//
int __fastcall GravityEffectSprite::init(GravityEffectSprite *this)
{
unsigned int v2; // r2
int v3; // r9
int v4; // r7
int v5; // r6
cocos2d::CCDirector *v6; // r0
cocos2d::CCDirector *v7; // r0
float v8; // s20
cocos2d::CCDirector *v9; // r0
float v10; // r0
float v11; // s19
cocos2d::CCDirector *v12; // r0
const char *v13; // r1
float v14; // s17
int v15; // r4
cocos2d::CCDirector *v16; // r0
cocos2d::CCDirector *v17; // r0
int v18; // s15
float v19; // s16
float v20; // s15
int v21; // r0
void (__fastcall *v22)(int, _DWORD); // r8
int v23; // r0
void (__fastcall *v24)(int, _DWORD); // r8
int v25; // r0
void (__fastcall *v26)(int, _DWORD); // r8
unsigned int v28; // [sp+4h] [bp-1Ch]
_BYTE v29[8]; // [sp+14h] [bp-Ch] BYREF
v3 = cocos2d::CCSprite::init(this);
if ( v3 )
{
v4 = 0;
v5 = cocos2d::CCSpriteBatchNode::create(
(cocos2d::CCSpriteBatchNode *)"gravityLine_001.png",
(const char *)&dword_14 + 2,
v2);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v5 + 36))(v5, 1);
(*(void (__fastcall **)(GravityEffectSprite *, int))(*(_DWORD *)this + 228))(this, v5);
v6 = (cocos2d::CCDirector *)(*(int (__fastcall **)(int, int, int))(*(_DWORD *)v5 + 456))(v5, 770, 1);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
v8 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v7));
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v8));
v10 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v9));
v11 = (float)(v8 * 480.0) / v10;
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v10));
v14 = (float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v12)) - 60.0) / 22.0;
do
{
v15 = cocos2d::CCSprite::create((cocos2d::CCSprite *)"gravityLine_001.png", v13);
v16 = (cocos2d::CCDirector *)(*(int (__fastcall **)(int, int))(*(_DWORD *)v5 + 228))(v5, v15);
v17 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v16);
v18 = v4++;
v19 = (float)(30.0 - (float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v17)) * 0.5))
+ (float)((float)v18 * v14);
v20 = (float)rand() * 4.6566e-10;
v21 = rand();
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v29,
v19 + (float)(v20 * v14),
(float)((float)((float)((float)v21 * 4.6566e-10) + (float)((float)v21 * 4.6566e-10)) - 1.0) * 10.0);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v15 + 92))(v15, v29);
v22 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v15 + 64);
v23 = rand();
v22(v15, (float)((float)((float)((float)v23 * 4.6566e-10) * 4.0) + 2.0) * v11);
v24 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v15 + 72);
v25 = rand();
v24(v15, (float)((float)((float)v25 * 4.6566e-10) + 2.0) * v8);
v26 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v15 + 456);
v28 = (unsigned int)(float)((float)((float)((float)rand() * 4.6566e-10) * 130.0) + 50.0);
v26(v15, (unsigned __int8)v28);
}
while ( v4 != 22 );
}
return v3;
}