//
// GJBaseGameLayer::spawnParticleTrigger from 0x9aeec8 to 0x9af280 (952 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::spawnParticleTrigger @ 0x9af3e0
// > GJBaseGameLayer::destroyObject @ 0x9c230c
// > ??> @ 0x9ac78
//
// This function is hookable on this platform (idp: arm, 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 12:58:14 +0000
//
__int64 __fastcall GJBaseGameLayer::spawnParticleTrigger(GJBaseGameLayer *a1, int a2, __int64 a3, float a4, float a5)
{
float v7; // s8
cocos2d::CCObject *Group; // x21
__int64 MainObject; // x0
__int64 v11; // x0
unsigned int v12; // w20
ParticleGameObject *v13; // x0
ParticleGameObject *v14; // x19
__int64 v16; // x1
char v17; // w0
__int64 (__fastcall *v18)(GJBaseGameLayer *, __int64 *, char *, _QWORD, _QWORD, _QWORD, __int64); // x24
__int64 v19; // x0
__int64 v20; // x1
unsigned int ObjectZLayer; // w25
unsigned int ObjectZOrder; // w0
cocos2d::CCParticleSystemQuad *v23; // x24
const cocos2d::CCPoint *v24; // x0
long double v25; // q0
long double v26; // q0
void (__fastcall *v27)(cocos2d::CCParticleSystemQuad *, float); // x25
float v28; // s0
void (__fastcall *v29)(cocos2d::CCParticleSystemQuad *, float); // x25
float v30; // s0
void (__fastcall *v31)(cocos2d::CCParticleSystemQuad *, float); // x25
float v32; // s0
int v33; // [xsp+A4h] [xbp+A4h]
char v35[8]; // [xsp+B8h] [xbp+B8h] BYREF
float v36; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v37; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v38; // [xsp+D8h] [xbp+D8h] BYREF
__int64 v39; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v40; // [xsp+E8h] [xbp+E8h]
void *v41; // [xsp+F0h] [xbp+F0h]
v7 = a5;
if ( a5 == 0.0 )
v7 = 1.0;
Group = GJBaseGameLayer::getGroup(a1, a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35);
MainObject = GJBaseGameLayer::tryGetMainObject((cocos2d::CCDictionary **)a1, a2);
if ( MainObject )
{
v33 = 1;
v11 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)MainObject + 192LL))(MainObject);
cocos2d::CCPoint::operator=(v35, v11);
}
else
{
v33 = 0;
}
v12 = 0;
while ( v12 < (unsigned int)cocos2d::CCArray::count(Group) )
{
v13 = (ParticleGameObject *)cocos2d::CCArray::objectAtIndex(Group, v12);
v14 = v13;
if ( *((_DWORD *)v13 + 257) != 2065 )
goto LABEL_7;
ParticleGameObject::updateParticleStruct(v13);
v39 = 0;
v16 = *(_QWORD *)a1;
v17 = *((_BYTE *)v14 + 1448);
v40 = 0;
v41 = nullptr;
v18 = *(__int64 (__fastcall **)(GJBaseGameLayer *, __int64 *, char *, _QWORD, _QWORD, _QWORD, __int64))(v16 + 1504);
if ( (v17 & 1) != 0 )
{
std::string::__init(&v39, *((void **)v14 + 183), *((_QWORD *)v14 + 182));
}
else
{
v19 = *((_QWORD *)v14 + 181);
v20 = *((_QWORD *)v14 + 182);
v41 = *((void **)v14 + 183);
v39 = v19;
v40 = v20;
}
ObjectZLayer = GameObject::getObjectZLayer(v14);
ObjectZOrder = GameObject::getObjectZOrder(v14);
v23 = (cocos2d::CCParticleSystemQuad *)v18(a1, &v39, (char *)v14 + 1480, ObjectZLayer, ObjectZOrder, 0, 1);
if ( (v39 & 1) != 0 )
operator delete(v41);
if ( v23 )
{
if ( v33 )
{
v24 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(ParticleGameObject *))(*(_QWORD *)v14 + 192LL))(v14);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, v24);
if ( a4 != 0.0 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, (const cocos2d::CCPoint *)v35);
rotateCCPoint(&v36, (float *)&v38, -a4);
}
cocos2d::CCPoint::operator-(&v37, &v36, v35, v25);
cocos2d::CCPoint::operator*(&v37, v7);
cocos2d::CCPoint::operator+(&v38, a3);
*(__n128 *)&v26 = cocos2d::CCPoint::operator=(&v36, &v38);
(*(void (__fastcall **)(cocos2d::CCParticleSystemQuad *, float *, long double))(*(_QWORD *)v23 + 184LL))(
v23,
&v36,
v26);
}
else
{
(*(void (__fastcall **)(cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)v23 + 184LL))(v23, a3);
}
if ( *((_BYTE *)v14 + 809) || *((_BYTE *)v14 + 1768) )
(*(void (__fastcall **)(GJBaseGameLayer *, ParticleGameObject *))(*(_QWORD *)a1 + 1488LL))(a1, v14);
ParticleGameObject::applyParticleSettings(v14, v23);
if ( (*(float (__fastcall **)(cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v23 + 920LL))(v23) < 0.0 )
(*(void (__fastcall **)(cocos2d::CCParticleSystemQuad *, float))(*(_QWORD *)v23 + 928LL))(v23, 0.0);
++v12;
v27 = *(void (__fastcall **)(cocos2d::CCParticleSystemQuad *, float))(*(_QWORD *)v23 + 360LL);
v28 = (*(float (__fastcall **)(ParticleGameObject *))(*(_QWORD *)v14 + 368LL))(v14);
v27(v23, a4 + v28);
v29 = *(void (__fastcall **)(cocos2d::CCParticleSystemQuad *, float))(*(_QWORD *)v23 + 128LL);
v30 = (*(float (__fastcall **)(ParticleGameObject *))(*(_QWORD *)v14 + 136LL))(v14);
v29(v23, v7 * v30);
v31 = *(void (__fastcall **)(cocos2d::CCParticleSystemQuad *, float))(*(_QWORD *)v23 + 144LL);
v32 = (*(float (__fastcall **)(ParticleGameObject *))(*(_QWORD *)v14 + 152LL))(v14);
v31(v23, v7 * v32);
(*(void (__fastcall **)(ParticleGameObject *, __int64))(*(_QWORD *)v14 + 344LL))(v14, 1);
cocos2d::CCParticleSystem::resumeSystem(v23);
}
else
{
LABEL_7:
++v12;
}
}
return _stack_chk_guard;
}