//
// GravityEffectSprite::init from 0x100122dec to 0x100122ff0 (516 bytes)
//
// 2 xrefs:
// > GravityEffectSprite::create @ 0x100116038
// > ??> @ 0x100790820
//
// 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
//
bool __fastcall GravityEffectSprite::init(GravityEffectSprite *a1)
{
_BOOL4 v2; // w19
cocos2d::CCSpriteBatchNode *v3; // x21
cocos2d::CCDirector *v4; // x0
float v5; // s8
cocos2d::CCDirector *v6; // x0
float v7; // s10
cocos2d::CCDirector *v8; // x0
unsigned int v9; // w23
float v10; // s15
cocos2d::CCSprite *v11; // x22
cocos2d::CCDirector *v12; // x0
float v13; // s9
float v14; // s9
__n128 v15; // q1
__n128 v16; // q0
unsigned int v17; // w0
unsigned int v18; // w0
unsigned int v19; // w0
int v21; // [xsp+8h] [xbp-78h] BYREF
v2 = cocos2d::CCSprite::init(a1);
if ( v2 )
{
v3 = cocos2d::CCSpriteBatchNode::create("gravityLine_001.png", 0x16u);
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, __int64))v3->setTag)(v3, 1);
((void (__fastcall *)(GravityEffectSprite *, cocos2d::CCSpriteBatchNode *))a1->addChild)(a1, v3);
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, __int64))v3->setBlendFunc)(v3, 0x100000302LL);
v4 = cocos2d::CCDirector::sharedDirector();
v5 = sub_1001765E4(v4);
v6 = cocos2d::CCDirector::sharedDirector();
v7 = (float)(v5 * 480.0) / sub_1001768E0(v6);
v8 = cocos2d::CCDirector::sharedDirector();
v9 = 0;
v10 = (float)(sub_1001768E0(v8) + -60.0) / 22.0;
do
{
v11 = cocos2d::CCSprite::create("gravityLine_001.png");
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, cocos2d::CCSprite *))v3->addChild)(v3, v11);
v12 = cocos2d::CCDirector::sharedDirector();
v13 = (float)((float)(sub_1001768E0(v12) * -0.5) + 30.0) + (float)((float)v9 * v10);
v14 = v13 + (float)(vcvts_n_f32_s32(rand(), 0x1Fu) * v10);
v15.n128_f32[0] = (float)((float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 2.0) + -1.0) * 10.0;
v16.n128_f32[0] = v14;
sub_100022980(v16, v15, &v21);
((void (__fastcall *)(cocos2d::CCSprite *, int *))v11->setPosition)(v11, &v21);
v17 = rand();
((void (__fastcall *)(cocos2d::CCSprite *, float))v11->setScaleX)(
v11,
v7 * (float)((float)(vcvts_n_f32_s32(v17, 0x1Fu) * 4.0) + 2.0));
v18 = rand();
((void (__fastcall *)(cocos2d::CCSprite *, float))v11->setScaleY)(
v11,
v5 * (float)(vcvts_n_f32_s32(v18, 0x1Fu) + 2.0));
v19 = rand();
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))v11->setOpacity)(
v11,
(unsigned int)(int)(float)((float)(vcvts_n_f32_s32(v19, 0x1Fu) * 130.0) + 50.0));
++v9;
}
while ( v9 != 22 );
}
return v2;
}