//
// GJBaseGameLayer::processAreaMoveGroupAction from 0x47db60 to 0x47df28 (968 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x496a9e
//
// 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::processAreaMoveGroupAction(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
EnterEffectInstance *a3,
cocos2d::CCPoint a4,
int a5,
int a6,
int a7,
int a8,
int a9,
bool a10,
bool a11)
{
EnterEffectObject *m_gameObject; // r11
cocos2d::CCArray *num; // r4
float m_relativeFade; // s19
cocos2d::ccArray *data; // r3
GameObject **arr; // r9
char *v18; // r3
cocos2d::CCArray *v19; // r10
GameObject *v20; // r5
int m_outerSectionIndex; // r3
int m_middleSectionIndex; // r3
_BOOL4 v23; // r0
float AreaObjectValue; // s14
int m_xyMode; // r3
float *v26; // r3
float v27; // s18
float v28; // s17
float y; // s16
float v30; // s18
float v31; // s16
float m_moveDistanceVariance; // s15
bool v33; // zf
float v34; // s17
float EasedAreaValue; // s21
int v36; // r2
int v37; // r2
float Length; // r0
cocos2d::CCPoint *v39; // r3
cocos2d::CCPoint *p_m_anglePosition; // r1
cocos2d::CCArray *TargetGroup; // r8
cocos2d::ccArray *v42; // r2
unsigned int v43; // r3
cocos2d::CCObject **v44; // r2
unsigned int v45; // r8
GameObject **v46; // r12
GameObject *v47; // r1
GameObject *v48; // t1
int v49; // [sp+Ch] [bp-48h]
cocos2d::CCPoint *x_low; // [sp+10h] [bp-44h]
GameObject **v51; // [sp+14h] [bp-40h]
_BOOL4 v52; // [sp+18h] [bp-3Ch]
int v53; // [sp+1Ch] [bp-38h]
GameObject **v54; // [sp+28h] [bp-2Ch]
bool v55; // [sp+33h] [bp-21h] BYREF
cocos2d::CCPoint v56; // [sp+34h] [bp-20h] BYREF
cocos2d::CCPoint v57; // [sp+3Ch] [bp-18h] BYREF
cocos2d::CCPoint v58; // [sp+44h] [bp-10h] BYREF
m_gameObject = a3->m_gameObject;
num = a2;
x_low = (cocos2d::CCPoint *)LODWORD(a4.x);
m_relativeFade = m_gameObject->m_relativeFade;
if ( m_relativeFade <= 0.0 )
m_relativeFade = 0.0;
a1->m_areaMovedCount += cocos2d::CCArray::count(a2);
if ( num )
{
data = num->data;
num = (cocos2d::CCArray *)data->num;
if ( data->num )
{
arr = (GameObject **)data->arr;
v18 = (char *)&num[19173961].m_uID + 3;
num = nullptr;
v51 = &arr[(_DWORD)v18];
v19 = nullptr;
v49 = a8;
v53 = 4 * a8 - (_DWORD)arr;
while ( 1 )
{
if ( arr > v51 )
goto LABEL_10;
v20 = *arr;
if ( !*arr )
goto LABEL_10;
if ( v20->m_isActivated )
break;
m_outerSectionIndex = v20->m_outerSectionIndex;
if ( m_outerSectionIndex <= a5 && m_outerSectionIndex >= SLODWORD(a4.y) )
{
m_middleSectionIndex = v20->m_middleSectionIndex;
if ( m_middleSectionIndex <= a7 && m_middleSectionIndex >= a6 )
break;
}
LABEL_26:
++arr;
++v49;
}
v23 = GJBaseGameLayer::resetAreaObjectValues(a1, *arr, 1);
v55 = 0;
v52 = v23;
AreaObjectValue = GJBaseGameLayer::getAreaObjectValue(a1, a3, v20, x_low, &v55);
if ( AreaObjectValue >= 1.0 )
{
if ( m_gameObject->m_easeOutEnabled )
*(int *)((char *)a3->m_easeIndices.m_start + (unsigned int)arr + v53) = 0;
goto LABEL_23;
}
m_xyMode = a3->m_gameObject->m_xyMode;
if ( a3->m_gameObject->m_xyMode )
{
v26 = (float *)(&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v20->m_varianceIndex);
v27 = a3->m_moveX + (float)(a3->m_moveXVariance * v26[675]);
v28 = a3->m_moveY + (float)(a3->m_moveYVariance * v26[676]);
if ( v27 != 0.0 || v28 != 0.0 )
{
y = 1.0 - GJBaseGameLayer::getEasedAreaValue(a1, v20, a3, AreaObjectValue, v55, v49);
v30 = v27 * y;
LABEL_20:
v31 = v28 * y;
goto LABEL_21;
}
LABEL_45:
v31 = 0.0;
v30 = 0.0;
LABEL_21:
if ( (_BYTE)a9 )
{
TargetGroup = GJBaseGameLayer::getTargetGroup(a1, a3->m_targetGroupIndex, v20->m_uniqueID);
num = (cocos2d::CCArray *)((char *)&num->data + cocos2d::CCArray::count(TargetGroup) - 53);
if ( a3->m_gameObject->m_dontEditAreaParent )
v20->m_unk508 = 1;
if ( TargetGroup )
{
v42 = TargetGroup->data;
v43 = v42->num;
if ( v42->num )
{
v44 = v42->arr;
v45 = (unsigned int)(&v44[v43] + 0x3FFFFFFF);
v46 = (GameObject **)v44;
while ( (unsigned int)v46 <= v45 )
{
v48 = *v46++;
v47 = v48;
if ( !v48 )
break;
if ( !v47->m_unk508 )
{
v54 = v46;
GJBaseGameLayer::moveAreaObject(a1, v47, v30, v31);
v46 = v54;
}
}
}
}
v20->m_unk508 = 0;
}
else
{
GJBaseGameLayer::moveAreaObject(a1, v20, v30, v31);
}
LABEL_23:
if ( v52 )
a1->updateObjectSection(a1, v20);
v19 = (cocos2d::CCArray *)((char *)v19 + 1);
goto LABEL_26;
}
m_moveDistanceVariance = a3->m_moveDistanceVariance;
v33 = m_moveDistanceVariance == 0.0;
if ( m_moveDistanceVariance == 0.0 )
m_moveDistanceVariance = 0.0;
else
m_xyMode = v20->m_varianceIndex;
if ( !v33 )
m_moveDistanceVariance = m_moveDistanceVariance * a1->m_varianceValues.__elems_[m_xyMode + 10];
v34 = a3->m_moveDistance + m_moveDistanceVariance;
if ( v34 == 0.0 )
goto LABEL_45;
EasedAreaValue = GJBaseGameLayer::getEasedAreaValue(a1, v20, a3, AreaObjectValue, v55, v49);
cocos2d::CCPoint::CCPoint(&v56);
if ( m_gameObject->m_relative )
{
v20->getRealPosition(&v57, v20);
cocos2d::CCPoint::operator-(&v58, &v57, x_low);
cocos2d::CCPoint::operator=((PlayerObject *)&v56, COERCE_FLOAT(&v58), v37, (bool)&v58);
Length = cocos2d::CCPoint::getLength(&v56);
if ( Length < m_relativeFade )
v34 = v34 * (float)(Length * (float)(1.0 / m_relativeFade));
if ( Length <= 0.0 )
goto LABEL_44;
cocos2d::CCPoint::CCPoint(&v58, v56.x / Length, v56.y / Length);
p_m_anglePosition = &v58;
}
else
{
LOBYTE(v39) = m_gameObject->m_startAngle;
if ( (_BYTE)v39 )
{
p_m_anglePosition = &m_gameObject->m_anglePosition;
}
else
{
cocos2d::ccpForAngle(
&v58,
(float)((float)(a3->m_moveAngle
+ (float)(a3->m_moveAngleVariance * a1->m_varianceValues.__elems_[v20->m_varianceIndex + 11]))
- 90.0)
* 0.017453);
v39 = &v58;
p_m_anglePosition = &v58;
}
}
cocos2d::CCPoint::operator=((PlayerObject *)&v56, *(float *)&p_m_anglePosition, v36, (bool)v39);
LABEL_44:
y = v56.y;
v28 = v34 * (float)(1.0 - EasedAreaValue);
v30 = v28 * v56.x;
goto LABEL_20;
}
}
v19 = num;
LABEL_10:
a1->m_areaMovedCount += (int)num;
a1->m_areaMovedCountTotal += (int)v19 + (_DWORD)num;
}