//
// ForceBlockGameObject::calculateForceToTarget from 0x883c88 to 0x883f74 (748 bytes)
//
// 2 xrefs:
// > PlayerObject::touchedObject @ 0x766344
// > ??> @ 0x43e70
//
// 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:55:57 +0000
//
__int64 __usercall ForceBlockGameObject::calculateForceToTarget@(
ForceBlockGameObject *this@,
GameObject *a2@,
__int64 a3@)
{
float v5; // s9
const cocos2d::CCRect *v7; // x0
float ObjectRadius; // s10
__int64 v9; // x1
float v10; // s8
char v11; // w0
float v12; // s1
float v13; // s8
__int64 v14; // x0
float v15; // s9
float v16; // s0
long double v17; // q0
cocos2d *v18; // x0
float v19; // s0
long double v21; // q0
double v22; // d8
double v23; // d8
const cocos2d::CCPoint *v24; // x2
cocos2d *v25; // x0
float v26; // s0
float v27; // s0
float v28[2]; // [xsp+68h] [xbp+68h] BYREF
__int64 x; // [xsp+70h] [xbp+70h] BYREF
__int64 v30; // [xsp+78h] [xbp+78h] BYREF
__int64 v31; // [xsp+80h] [xbp+80h] BYREF
_BYTE v32[8]; // [xsp+88h] [xbp+88h] BYREF
float v33; // [xsp+90h] [xbp+90h]
float v34; // [xsp+94h] [xbp+94h]
v5 = *((float *)this + 460);
v7 = (const cocos2d::CCRect *)(*(__int64 (__fastcall **)(ForceBlockGameObject *))(*(_QWORD *)this + 1328LL))(this);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v32, v7);
if ( *((float *)this + 225) <= 0.0 )
{
if ( v33 < v34 )
{
ObjectRadius = v34 * 0.5;
if ( (float)(v34 * 0.5) > 0.0 )
goto LABEL_4;
goto LABEL_22;
}
ObjectRadius = v33 * 0.5;
}
else
{
ObjectRadius = GameObject::getObjectRadius(this);
}
if ( ObjectRadius > 0.0 )
goto LABEL_4;
LABEL_22:
ObjectRadius = 1.0;
LABEL_4:
v9 = *(_QWORD *)this;
if ( *((_BYTE *)this + 1852) )
{
(*(void (__fastcall **)(__int64 *__return_ptr, ForceBlockGameObject *))(v9 + 1360))(&v30, this);
v21 = ((long double (__fastcall *)(GameObject *))*(_QWORD *)(*(_QWORD *)a2 + 1360LL))(a2);
cocos2d::CCPoint::operator-(&x, &v30, &v31, v21);
v22 = atan2f(*((float *)&x + 1), *(float *)&x);
if ( (*(unsigned __int8 (__fastcall **)(ForceBlockGameObject *))(*(_QWORD *)this + 1432LL))(this) )
v23 = v22 + 0.0;
else
v23 = v22 + 3.14159265;
v13 = v23;
}
else
{
v10 = 90.0 - (*(float (__fastcall **)(ForceBlockGameObject *))(v9 + 384))(this);
v11 = (*(__int64 (__fastcall **)(ForceBlockGameObject *))(*(_QWORD *)this + 1432LL))(this);
v12 = 0.0;
if ( v11 )
v12 = 180.0;
v13 = (float)(v10 + v12) * 0.017453;
}
v14 = *((unsigned __int8 *)this + 1853);
if ( *((_BYTE *)this + 1853) )
{
if ( *((_BYTE *)this + 1852) )
{
(*(void (__fastcall **)(__int64 *__return_ptr, ForceBlockGameObject *))(*(_QWORD *)this + 1360LL))(&v30, this);
(*(void (__fastcall **)(GameObject *))(*(_QWORD *)a2 + 1360LL))(a2);
v25 = (cocos2d *)cocos2d::ccpDistance((cocos2d *)&v30, (const cocos2d::CCPoint *)&v31, v24);
if ( ObjectRadius > v26 )
v27 = 1.0 - (float)(v26 / ObjectRadius);
else
v27 = 0.0;
v14 = cocos2d::clampf(v25, v27, 0.0, 1.0);
}
else
{
v15 = cosf(v13);
v16 = sinf(v13);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v15, v16);
(*(void (__fastcall **)(__int64 *__return_ptr, ForceBlockGameObject *))(*(_QWORD *)this + 1360LL))(&v30, this);
v17 = ((long double (__fastcall *)(GameObject *))*(_QWORD *)(*(_QWORD *)a2 + 1360LL))(a2);
v18 = (cocos2d *)cocos2d::CCPoint::operator-(&x, &v30, &v31, v17);
v14 = cocos2d::clampf(
v18,
(float)((float)(ObjectRadius
+ (float)((float)(*((float *)&x + 1) * v28[1]) + (float)(v28[0] * *(float *)&x)))
/ ObjectRadius)
* 0.5,
0.0,
1.0);
}
v5 = *((float *)this + 461) + (float)((float)(*((float *)this + 462) - *((float *)this + 461)) * v19);
}
cocos2d::ccpForAngle(&v31, (cocos2d *)v14, v13);
cocos2d::CCPoint::operator*(&v31, v5);
return a3;
}