//
// GJBaseGameLayer::lightningFlash from 0x598110 to 0x598212 (258 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::checkpointActivated @ 0x598300
// > GJBaseGameLayer::lightningFlash @ 0x5983d8
// > GJBaseGameLayer::teleportPlayer @ 0x5b85c4
//
// 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:53:10 +0000
//
int __fastcall GJBaseGameLayer::lightningFlash(int a1, int a2, int a3, int a4, int a5, int a6, int a7, char a8, int a9)
{
GameManager *v11; // r0
int result; // r0
cocos2d::CCLightning *v13; // r4
float v14; // r1
cocos2d::CCSequence *v15; // r9
unsigned int v16; // r2
cocos2d::CCHide *v17; // r8
int v18; // r0
cocos2d::CCAction *v19; // r0
cocos2d::CCHide *v20; // r7
cocos2d::CCFiniteTimeAction *v21; // r0
int v22; // [sp+4h] [bp-28h] BYREF
_BYTE v23[8]; // [sp+Ch] [bp-20h] BYREF
_BYTE v24[8]; // [sp+14h] [bp-18h] BYREF
_BYTE v25[8]; // [sp+1Ch] [bp-10h] BYREF
v22 = a4;
v11 = (GameManager *)cocos2d::CCPoint::operator-(v23, a3, a2);
result = GameManager::sharedState(v11);
if ( !*(_BYTE *)(result + 725) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, (const cocos2d::CCPoint *)v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (const cocos2d::CCPoint *)&unk_D2C400);
v13 = cocos2d::CCLightning::lightningWithStrikePoint(
(const cocos2d::CCPoint *)v24,
(const cocos2d::CCPoint *)v25,
a6);
(*(void (__fastcall **)(cocos2d::CCLightning *, int))(*(_DWORD *)v13 + 92))(v13, a2);
(*(void (__fastcall **)(cocos2d::CCLightning *, int *))(*(_DWORD *)v13 + 488))(v13, &v22);
*((_DWORD *)v13 + 76) = a5;
*((_BYTE *)v13 + 308) = 1;
*((_BYTE *)v13 + 309) = 1;
*((_DWORD *)v13 + 79) = a9;
if ( a7 )
*((_DWORD *)v13 + 72) = a7;
result = (*(int (__fastcall **)(_DWORD, cocos2d::CCLightning *, _DWORD))(**(_DWORD **)(a1 + 2436) + 232))(
*(_DWORD *)(a1 + 2436),
v13,
0);
}
if ( a8 )
{
(*(void (**)(void))(**(_DWORD **)(a1 + 10792) + 172))();
if ( a7 )
{
v20 = (cocos2d::CCHide *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3DA3D70A, v14);
v21 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCHide::create(v20);
v19 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v20, v21, 0);
}
else
{
v15 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3DA3D70A, v14);
v17 = (cocos2d::CCHide *)cocos2d::CCBlink::create((cocos2d::CCBlink *)0x3DF5C28F, COERCE_FLOAT(1), v16);
v18 = cocos2d::CCHide::create(v17);
v19 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v15, v17, v18, 0);
}
return cocos2d::CCNode::runAction(*(cocos2d::CCNode **)(a1 + 10792), v19);
}
return result;
}