//
// GJBaseGameLayer::triggerAreaEffectAnimation from 0x861664 to 0x861874 (528 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::triggerAreaEffect @ 0x898c80
// > ??> @ 0x7bca8
//
// 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 GJBaseGameLayer::triggerAreaEffectAnimation(GJBaseGameLayer *a1, EnterEffectObject *a2)
{
int v3; // w22
int m_targetGroupID; // w20
std::vector *p_m_tintEffectInstances; // x26
std::vector *p_m_moveEffectInstances; // x24
int v8; // w0
std::vector *p_m_rotateEffectInstances; // x0
EnterEffectInstance *m_start; // x19
EnterEffectInstance *m_finish; // x21
float m_totalTime; // s0
cocos2d::CCArray *Group; // x0
cocos2d::ccArray *data; // x1
EnterEffectObject **arr; // x21
EnterEffectObject **v16; // x24
EnterEffectObject *v17; // x20
std::vector *p_m_scaleEffectInstances; // x0
EnterEffectInstance *v19; // x19
EnterEffectInstance *v20; // x22
float v21; // s0
v3 = 1;
m_targetGroupID = a2->m_targetGroupID;
if ( a2->m_useEffectID )
{
p_m_tintEffectInstances = &a1->m_gameState.m_tintEffectInstances;
p_m_moveEffectInstances = &a1->m_gameState.m_moveEffectInstances;
v8 = -1;
LABEL_3:
switch ( v8 )
{
case 0:
p_m_rotateEffectInstances = &a1->m_gameState.m_rotateEffectInstances;
goto LABEL_5;
case 1:
p_m_rotateEffectInstances = &a1->m_gameState.m_scaleEffectInstances;
goto LABEL_5;
case 2:
p_m_rotateEffectInstances = &a1->m_gameState.m_fadeEffectInstances;
LABEL_5:
if ( p_m_rotateEffectInstances )
goto LABEL_6;
goto LABEL_12;
case 3:
p_m_rotateEffectInstances = p_m_tintEffectInstances;
if ( !p_m_tintEffectInstances )
return;
goto LABEL_6;
default:
goto LABEL_13;
}
while ( 1 )
{
LABEL_13:
p_m_rotateEffectInstances = p_m_moveEffectInstances;
if ( p_m_moveEffectInstances )
{
LABEL_6:
m_start = p_m_rotateEffectInstances->m_start;
m_finish = p_m_rotateEffectInstances->m_finish;
if ( m_finish != p_m_rotateEffectInstances->m_start )
{
do
{
if ( m_targetGroupID == m_start->m_gameObject->m_effectID )
{
m_totalTime = a1->m_gameState.m_totalTime;
EnterEffectInstance::loadTransitions(m_start, a2, m_totalTime);
if ( m_targetGroupID > 0 )
break;
}
++m_start;
}
while ( m_finish != m_start );
}
if ( v3 == 5 )
return;
}
else if ( v3 == 5 )
{
return;
}
LABEL_12:
v8 = ++v3 - 2;
if ( (unsigned int)(v3 - 2) <= 3 )
goto LABEL_3;
}
}
Group = GJBaseGameLayer::getGroup(a1, m_targetGroupID);
if ( Group )
{
data = Group->data;
if ( data->num )
{
arr = (EnterEffectObject **)data->arr;
v16 = &arr[data->num - 1];
if ( arr <= v16 )
{
v17 = *arr;
if ( *arr )
{
if ( v17->m_unk390 == 45 )
goto LABEL_29;
while ( v16 >= ++arr )
{
v17 = *arr;
if ( !*arr )
break;
if ( v17->m_unk390 == 45 )
{
LABEL_29:
switch ( v17->m_objectID )
{
case 0xBBE:
p_m_scaleEffectInstances = &a1->m_gameState.m_moveEffectInstances;
goto LABEL_31;
case 0xBBF:
p_m_scaleEffectInstances = &a1->m_gameState.m_rotateEffectInstances;
goto LABEL_31;
case 0xBC0:
p_m_scaleEffectInstances = &a1->m_gameState.m_scaleEffectInstances;
goto LABEL_31;
case 0xBC1:
p_m_scaleEffectInstances = &a1->m_gameState.m_fadeEffectInstances;
goto LABEL_31;
case 0xBC2:
p_m_scaleEffectInstances = &a1->m_gameState.m_tintEffectInstances;
LABEL_31:
if ( p_m_scaleEffectInstances )
{
v19 = p_m_scaleEffectInstances->m_start;
v20 = p_m_scaleEffectInstances->m_finish;
if ( v20 != p_m_scaleEffectInstances->m_start )
{
do
{
if ( v17 == v19->m_gameObject )
{
v21 = a1->m_gameState.m_totalTime;
EnterEffectInstance::loadTransitions(v19, a2, v21);
}
++v19;
}
while ( v20 != v19 );
}
}
break;
default:
continue;
}
}
}
}
}
}
}
}