//
// GJBaseGameLayer::getAreaObjectValue from 0x1001f65a4 to 0x1001f67a8 (516 bytes)
//
// 6 xrefs:
// > GJBaseGameLayer::processAreaTransformGroupAction @ 0x1001f4e5c
// > GJBaseGameLayer::processAreaRotateGroupAction @ 0x1001f5258
// > GJBaseGameLayer::processAreaMoveGroupAction @ 0x1001f5604
// > GJBaseGameLayer::processAreaFadeGroupAction @ 0x1001f5c08
// > GJBaseGameLayer::processAreaTintGroupAction @ 0x1001f5dcc
// > GJBaseGameLayer::processAreaTintGroupAction @ 0x1001f6008
//
// 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
//
float __fastcall GJBaseGameLayer::getAreaObjectValue(
GJBaseGameLayer *a1,
EnterEffectInstance *a2,
GameObject *a3,
cocos2d::CCPoint *a4,
bool *a5)
{
__n128 v10; // q0
__n128 v11; // q1
int m_directionType; // w8
float y; // s1
float x; // s2
float m_offsetVariance; // s3
float v16; // s4
float v17; // s0
__int64 v18; // x8
float v19; // s0
_BOOL4 m_reversed; // w8
bool v21; // cc
bool v22; // w9
float v23; // s2
float v24; // s3
float m_offsetYVariance; // s3
char v26; // w10
bool v27; // w8
float m_lengthVariance; // s2
float v29; // s3
float m_deadzone; // s2
float v31; // s1
float result; // s0
cocos2d::CCPoint v33; // [xsp+0h] [xbp-40h] BYREF
cocos2d::CCPoint v34; // [xsp+8h] [xbp-38h] BYREF
((void (__fastcall *)(cocos2d::CCPoint *__return_ptr, GameObject *))a3->getRealPosition)(&v34, a3);
m_directionType = a2->m_gameObject->m_directionType;
if ( m_directionType == 2 )
{
y = v34.y;
x = a4->y;
goto LABEL_5;
}
if ( m_directionType == 1 )
{
y = v34.x;
x = a4->x;
LABEL_5:
m_offsetVariance = a2->m_offsetVariance;
v16 = 0.0;
if ( m_offsetVariance != 0.0 )
v16 = m_offsetVariance * a1->m_varianceValues.__elems_[a3->m_varianceIndex + 1];
v17 = (float)(y - x) + v16;
v18 = 52;
if ( v17 < 0.0 )
v18 = 48;
v19 = v17 * *(float *)((char *)&a2->m_enterEffectAnimMap.__tree_.__begin_node_ + v18);
m_reversed = a2->m_reversed;
v21 = x > y;
v22 = x >= y;
goto LABEL_15;
}
v23 = a2->m_offsetVariance;
v11.n128_u32[0] = 0;
v24 = 0.0;
if ( v23 != 0.0 )
v24 = v23 * a1->m_varianceValues.__elems_[a3->m_varianceIndex + 1];
v10.n128_f32[0] = a4->x + v24;
m_offsetYVariance = a2->m_offsetYVariance;
if ( m_offsetYVariance != 0.0 )
v11.n128_f32[0] = m_offsetYVariance * a1->m_varianceValues.__elems_[a3->m_varianceIndex + 2];
v11.n128_f32[0] = a4->y + v11.n128_f32[0];
sub_100022980(v10, v11, &v33);
v19 = cocos2d::ccpDistance(&v34, &v33);
m_reversed = a2->m_reversed;
v22 = a4->x >= v34.x;
v21 = a4->x > v34.y;
LABEL_15:
v26 = !v21;
if ( m_reversed )
v27 = v22;
else
v27 = v26;
*a5 = v27;
m_lengthVariance = a2->m_lengthVariance;
v29 = 0.0;
if ( m_lengthVariance != 0.0 )
v29 = m_lengthVariance * a1->m_varianceValues.__elems_[a3->m_varianceIndex];
m_deadzone = a2->m_deadzone;
v31 = v19 / (float)(int)(float)(a2->m_length + v29);
if ( m_deadzone != 0.0 )
{
result = 1.0;
v31 = (float)(v31 - m_deadzone) / (float)(1.0 - m_deadzone);
if ( v31 >= 1.0 )
goto LABEL_31;
result = 0.0;
if ( v31 <= 0.0 )
goto LABEL_31;
goto LABEL_30;
}
if ( v31 >= 1.0 || (result = 0.0, v31 > 0.0) )
{
result = 1.0;
if ( v31 < 1.0 )
LABEL_30:
result = v31;
}
LABEL_31:
if ( a2->m_gameObject->m_inbound )
return 1.0 - result;
return result;
}