//
// GravityEffectSprite::init from 0x31ff90 to 0x32016c (476 bytes)
//
// 1 xrefs:
// > GravityEffectSprite::create @ 0x314a7a
//
// 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 GravityEffectSprite::init(GravityEffectSprite *a1)
{
_BOOL4 v2; // r9
int v3; // r7
cocos2d::CCSpriteBatchNode *v4; // r6
cocos2d::CCDirector *v5; // r0
float v6; // s20
cocos2d::CCDirector *v7; // r0
float v8; // s19
cocos2d::CCDirector *v9; // r0
const char *v10; // r1
float v11; // s17
cocos2d::CCNode *v12; // r4
cocos2d::CCDirector *v13; // r0
int v14; // s15
float v15; // s16
float v16; // s15
int v17; // r0
void (__fastcall *setScaleX)(cocos2d::CCNode *__hidden, float); // r8
int v19; // r0
void (__fastcall *setScaleY)(cocos2d::CCNode *__hidden, float); // r8
int v21; // r0
void (__fastcall *v22)(cocos2d::CCNode *__hidden); // r8
unsigned int v24; // [sp+4h] [bp-1Ch]
cocos2d::CCPoint v25; // [sp+14h] [bp-Ch] BYREF
v2 = cocos2d::CCSprite::init(a1);
if ( v2 )
{
v3 = 0;
v4 = cocos2d::CCSpriteBatchNode::create("gravityLine_001.png", (unsigned int)&dword_14 + 2);
v4->setTag(v4, 1);
a1->addChild(a1, v4);
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, int, int))v4->setBlendFunc)(v4, 770, 1);
v5 = cocos2d::CCDirector::sharedDirector();
v6 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v5));
v7 = cocos2d::CCDirector::sharedDirector();
v8 = (float)(v6 * 480.0) / COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v7));
v9 = cocos2d::CCDirector::sharedDirector();
v11 = (float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v9)) - 60.0) / 22.0;
do
{
v12 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"gravityLine_001.png", v10);
v4->addChild(v4, v12);
v13 = cocos2d::CCDirector::sharedDirector();
v14 = v3++;
v15 = (float)(30.0 - (float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v13)) * 0.5))
+ (float)((float)v14 * v11);
v16 = (float)rand() * 4.6566e-10;
v17 = rand();
cocos2d::CCPoint::CCPoint(
&v25,
v15 + (float)(v16 * v11),
(float)((float)((float)((float)v17 * 4.6566e-10) + (float)((float)v17 * 4.6566e-10)) - 1.0) * 10.0);
v12->setPosition(v12, &v25);
setScaleX = v12->setScaleX;
v19 = rand();
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))setScaleX)(
v12,
(float)((float)((float)((float)v19 * 4.6566e-10) * 4.0) + 2.0) * v8);
setScaleY = v12->setScaleY;
v21 = rand();
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))setScaleY)(
v12,
(float)((float)((float)v21 * 4.6566e-10) + 2.0) * v6);
v22 = v12->__vftable[1].~CCNode_0;
v24 = (unsigned int)(float)((float)((float)((float)rand() * 4.6566e-10) * 130.0) + 50.0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v22)(v12, (unsigned __int8)v24);
}
while ( v3 != 22 );
}
return v2;
}