//
// LevelAreaLayer::addGodRay from 0x1402c5f20 to 0x1402c62bd (925 bytes)
//
// 7 xrefs:
// > LevelAreaLayer::init @ 0x1402c4d24
// > LevelAreaLayer::init @ 0x1402c4d8c
// > LevelAreaLayer::init @ 0x1402c4dde
// > LevelAreaLayer::init @ 0x1402c4e49
// > LevelAreaLayer::init @ 0x1402c4ea3
// > LevelAreaLayer::init @ 0x1402c4ef8
// > ??> @ 0x1406d2b40
//
// 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
//
void LevelAreaLayer::addGodRay(
LevelAreaLayer *a1,
float a2,
float a3,
float a4,
float a5,
float a6,
cocos2d::CCPoint a7)
{
cocos2d::CCDirector *v8; // rax
CCLightFlash *v9; // rsi
float v10; // xmm0_4
CCLightFlash_vtbl *v11; // rbx
const cocos2d::CCPoint *v12; // rax
cocos2d::CCArray *m_lightStripArray; // rax
cocos2d::CCNode *m_mainLayer; // rax
CCLightFlash_vtbl *v15; // rax
float v16; // xmm8_4
struct cocos2d::CCFadeTo *v17; // rax
struct cocos2d::CCEaseInOut *v18; // rdi
struct cocos2d::CCFadeTo *v19; // rax
struct cocos2d::CCEaseInOut *v20; // rbx
int v21; // eax
struct cocos2d::CCDelayTime *v22; // rax
struct cocos2d::CCSequence *v23; // rax
struct cocos2d::CCRepeatForever *v24; // rax
cocos2d::ccColor3B *v25; // r8
CCLightFlash *v26; // r14
cocos2d::CCArray *v27; // rbx
__int64 v28; // rax
cocos2d::CCNode *v29; // rdi
_QWORD *v30; // rax
struct cocos2d::CCFadeTo *v31; // rax
struct cocos2d::CCEaseInOut *v32; // rbx
struct cocos2d::CCFadeTo *v33; // rax
struct cocos2d::CCEaseInOut *v34; // rax
struct cocos2d::CCSequence *v35; // rax
struct cocos2d::CCRepeatForever *v36; // rax
cocos2d::ccColor3B *v37; // r8
float v38; // [rsp+20h] [rbp-98h]
float v39; // [rsp+20h] [rbp-98h]
__int64 v40; // [rsp+C0h] [rbp+8h] BYREF
__int16 v41; // [rsp+C8h] [rbp+10h] BYREF
char v42; // [rsp+CAh] [rbp+12h]
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v8);
v9 = (CCLightFlash *)cocos2d::CCSprite::createWithSpriteFrameName("godray01_001.png");
v10 = ((float (__fastcall *)(CCLightFlash *, cocos2d::CCPoint))v9->setPosition_0)(v9, a7);
v11 = v9->__vftable;
cocos2d::CCPoint::CCPoint(v10, 1.0);
v11->setAnchorPoint(v9, v12);
((void (__fastcall *)(CCLightFlash *))v9->setScaleY)(v9);
((void (__fastcall *)(CCLightFlash *))v9->setScaleX)(v9);
v41 = -14081;
m_lightStripArray = v9->m_lightStripArray;
v42 = 0;
((void (__fastcall *)(cocos2d::CCArray **, __int16 *))m_lightStripArray->__vftable)(&v9->m_lightStripArray, &v41);
m_mainLayer = v9->m_mainLayer;
v40 = 0x100000302LL;
((void (__fastcall *)(cocos2d::CCNode **, __int64))m_mainLayer->__vftable)(&v9->m_mainLayer, 0x100000302LL);
v15 = v9->__vftable;
HIDWORD(v9[1].m_pGrid) = 1050253722;
HIDWORD(v9[1].m_pChildren) = 1050253722;
((void (__fastcall *)(CCLightFlash *))v15[1]._setZOrder)(v9);
((void (__fastcall *)(CCLightFlash *))v9->setRotation)(v9);
(*(void (__fastcall **)(cocos2d::CCArray **, _QWORD))&v9->m_lightStripArray->m_unknown2)(
&v9->m_lightStripArray,
(unsigned int)(int)a2);
a1->addChild_1(a1, v9);
v16 = a5;
v17 = cocos2d::CCFadeTo::create(a5, (int)a3);
v18 = cocos2d::CCEaseInOut::create(v17, 2.0);
v19 = cocos2d::CCFadeTo::create(v16, (int)a4);
v20 = cocos2d::CCEaseInOut::create(v19, 2.0);
v21 = rand();
v22 = cocos2d::CCDelayTime::create((float)v21 / 32767.0);
v23 = cocos2d::CCSequence::create(v18, v20, v22, 0);
v24 = cocos2d::CCRepeatForever::create(v23);
cocos2d::CCNode::runAction(v9, (cocos2d::CCPoint)v24, v25, a4, v38);
v26 = (CCLightFlash *)cocos2d::CCSprite::createWithSpriteFrameName("towerShine.png");
((void (__fastcall *)(CCLightFlash *, cocos2d::CCPoint))v26->setPosition_0)(v26, a7);
a1->addChild_0(a1, v26, 4);
((void (__fastcall *)(CCLightFlash *))v26->setScaleX)(v26);
((void (__fastcall *)(CCLightFlash *))v26->setScaleY)(v26);
v27 = v26->m_lightStripArray;
v28 = (*(__int64 (__fastcall **)(cocos2d::CCArray **))&v9->m_lightStripArray->m_uID)(&v9->m_lightStripArray);
((void (__fastcall *)(cocos2d::CCArray **, __int64))v27->__vftable)(&v26->m_lightStripArray, v28);
v29 = v26->m_mainLayer;
v30 = (_QWORD *)(*(__int64 (__fastcall **)(cocos2d::CCNode **, __int64 *))&v9->m_mainLayer->m_uID)(
&v9->m_mainLayer,
&v40);
((void (__fastcall *)(cocos2d::CCNode **, _QWORD))v29->__vftable)(&v26->m_mainLayer, *v30);
(*(void (__fastcall **)(cocos2d::CCArray **, _QWORD))&v26->m_lightStripArray->m_unknown2)(
&v26->m_lightStripArray,
(unsigned int)(int)(float)(a2 * 0.89999998));
cocos2d::CCArray::addObject(a1->m_godRays, v26);
v31 = cocos2d::CCFadeTo::create(v16, (int)(float)(a3 * 0.89999998));
v32 = cocos2d::CCEaseInOut::create(v31, 2.0);
v33 = cocos2d::CCFadeTo::create(v16, (int)(float)(a4 * 0.89999998));
v34 = cocos2d::CCEaseInOut::create(v33, 2.0);
v35 = cocos2d::CCSequence::create(v32, v34, 0);
v36 = cocos2d::CCRepeatForever::create(v35);
cocos2d::CCNode::runAction(v26, (cocos2d::CCPoint)v36, v37, a4, v39);
}