//
// GravityEffectSprite::init from 0x14051b5e0 to 0x14051b902 (802 bytes)
//
// 3 xrefs:
// > PlayLayer::init @ 0x140503e50
// > ??> @ 0x1407d6030
// > ??> @ 0x14092aef0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:33:35 +0000
//
bool __fastcall GravityEffectSprite::init(cocos2d::CCSprite *a1)
{
bool result; // al
struct cocos2d::CCSpriteBatchNode *v3; // rsi
__int64 v4; // rcx
cocos2d::CCDirector *v5; // rax
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
__int64 v8; // rcx
cocos2d::CCDirector *v9; // rax
int v10; // ebp
float v11; // xmm8_4
struct cocos2d::CCSprite *v12; // rdi
float v13; // xmm7_4
__int64 v14; // rcx
cocos2d::CCDirector *v15; // rax
float v16; // xmm6_4
int v17; // eax
__int64 v18; // rbx
__int64 v19; // rbx
__int64 v20; // rbx
int v21; // eax
__int64 v22; // [rsp+D8h] [rbp+10h] BYREF
result = cocos2d::CCSprite::init(a1);
if ( result )
{
v3 = cocos2d::CCSpriteBatchNode::create("gravityLine_001.png", 0x16u);
(*(void (__fastcall **)(struct cocos2d::CCSpriteBatchNode *, __int64))(*(_QWORD *)v3 + 64LL))(v3, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *, struct cocos2d::CCSpriteBatchNode *))(*(_QWORD *)a1 + 464LL))(a1, v3);
v22 = 0x100000302LL;
(**((void (__fastcall ***)(__int64, __int64))v3 + 40))((__int64)v3 + 320, 0x100000302LL);
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getContentScaleFactor(v5);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getScreenRight(v7);
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
v10 = 0;
v11 = (float)(cocos2d::CCDirector::getScreenRight(v9) - 60.0) / 22.0;
do
{
v12 = cocos2d::CCSprite::create("gravityLine_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSpriteBatchNode *, struct cocos2d::CCSprite *))(*(_QWORD *)v3 + 464LL))(
v3,
v12);
v13 = (float)rand();
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v14);
v16 = (float)(30.0 - (float)(cocos2d::CCDirector::getScreenRight(v15) * 0.5)) + (float)((float)v10 * v11);
v17 = rand();
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v22,
(float)((float)((float)v17 / 32767.0) * v11) + v16,
(float)((float)((float)(v13 / 32767.0) + (float)(v13 / 32767.0)) - 1.0) * 10.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64 *))(*(_QWORD *)v12 + 184LL))(v12, &v22);
v18 = *(_QWORD *)v12;
rand();
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(v18 + 120))(v12);
v19 = *(_QWORD *)v12;
rand();
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(v19 + 136))(v12);
v20 = *((_QWORD *)v12 + 40);
v21 = rand();
(*(void (__fastcall **)(__int64, _QWORD))(v20 + 40))(
(__int64)v12 + 320,
(unsigned int)(int)(float)((float)((float)((float)v21 / 32767.0) * 130.0) + 50.0));
++v10;
}
while ( v10 < 22 );
return 1;
}
return result;
}