//
// PlayerObject::postCollision from 0x10021ea64 to 0x10021ff0c (5288 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::checkCollisions @ 0x1001e7ee8
//
// 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 __fastcall PlayerObject::postCollision(PlayerObject *a1, float a2, bool a3)
{
int v3; // w2
_BOOL4 v4; // w20
float v7; // s0
float v8; // s1
float v9; // s12
_BOOL4 m_holdingLeft; // w22
_BOOL4 m_holdingRight; // w8
int v12; // w21
GameObject *m_lastGroundObject; // x0
GameObject *m_currentSlope2; // x0
GameObject *v15; // x8
_BOOL4 m_isOnSlope; // w8
GameObject *m_currentSlope; // x9
double m_totalTime; // d1
_BOOL4 m_isUpsideDown; // w8
float m_slopeVelocity; // s0
char v21; // w9
_BOOL4 m_maybeIsBoosted; // w10
double v23; // d1
double v24; // d2
bool v25; // nf
double v26; // d1
float v27; // s9
float m_slopeAngle; // s11
float v29; // s0
float v30; // s10
double m_platformerXVelocity; // d13
double v32; // d2
double v33; // d0
double m_currentSlopeYVelocity; // d0
double v35; // d1
float v36; // s9
__int64 v37; // x0
float v38; // s10
__int64 v39; // x0
char v40; // w21
double m_collidedTopMinY; // d0
double v42; // d1
float v43; // s10
GameObject *v44; // x0
bool v45; // cc
__int64 v46; // x0
GameObject *v47; // x0
_BOOL4 v48; // w0
float v49; // s0
_BOOL4 v50; // w0
float v51; // s9
__n128 v52; // q1
__n128 v53; // q0
GJBaseGameLayer *m_gameLayer; // x21
__int64 v55; // x0
float v56; // s9
unsigned int v57; // w23
float v58; // s11
float v59; // s11
double v60; // d0
cocos2d::CCArray *v61; // x0
cocos2d::ccArray *data; // x8
__int64 num; // x9
int v64; // w25
int v65; // w24
cocos2d::CCObject **arr; // x8
unsigned __int64 v67; // x26
unsigned __int64 v68; // x27
__int64 v69; // x22
float v70; // s9
__n128 v71; // q1
__n128 v72; // q0
cocos2d::CCArray *v73; // x21
__int64 v74; // x22
__int64 v75; // x0
__int64 v76; // x0
float v77; // s9
float m_vehicleSize; // s10
float v79; // s11
float *v80; // x0
cocos2d::CCArray *v81; // x21
__int64 v82; // x22
__int64 v83; // x0
GameObject *v84; // x8
GameObject *m_preLastGroundObject; // x9
GameObject *v86; // x21
char v87; // w22
__int64 *LastPosition; // x0
float v89; // s0
float v90; // s9
float v91; // s10
double v92; // d0
float32x2_t *v93; // x21
__n128 v94; // q1
__n128 v95; // q0
float v96; // s1
double v97; // d2
double m_collidedLeftMaxX; // d3
double v99; // d0
double v100; // d0
GameObject *v101; // x0
__int64 *v102; // x0
float v103; // s0
float v104; // s1
float v105; // s2
char v106; // w23
unsigned int v107; // w0
GameObject *v108; // x21
char v109; // w8
float v110; // s0
float v111; // s10
__int64 v112; // x0
double v113; // d0
__int64 v114; // x0
float v115; // s9
float v116; // s0
float v117; // s9
float v118; // s9
float v119; // s0
bool v120; // w8
GameObject *m_collidedObject; // x9
GameObject *v122; // x0
__int64 *v123; // x0
float v124; // s0
int v125; // w21
unsigned int v126; // w0
GameObject *v127; // x1
double m_yVelocityRelated; // d0
double m_groundYVelocity; // d1
float v130; // s2
float v131; // s0
double m_scaleXRelated3; // d0
char v133; // w8
float v134; // s1
float v135; // s0
float v136; // s2
float v137; // s1
double v138; // d0
float v139; // s0
double m_scaleXRelated5; // d0
double m_scaleXRelated4; // d1
float v142; // s2
GameObject *m_collidingWithLeft; // x8
GameManager *v144; // x0
double m_collidedRightMinX; // d3
GJBaseGameLayer *v146; // x21
__int64 v147; // x0
float v148; // s9
unsigned int v149; // w23
float v150; // s11
float v151; // s11
double v152; // d0
cocos2d::CCArray *v153; // x0
cocos2d::ccArray *v154; // x8
__int64 v155; // x9
int v156; // w25
int v157; // w24
cocos2d::CCObject **v158; // x8
unsigned __int64 v159; // x26
unsigned __int64 v160; // x27
__int64 v161; // x22
float v162; // s0
double m_scaleXRelated2; // d0
double m_yVelocity; // d0
GJBaseGameLayer *v165; // x0
GJBaseGameLayer *v166; // x0
GJBaseGameLayer *v167; // x0
GJBaseGameLayer *v168; // x0
GJBaseGameLayer *v169; // x0
unsigned __int32 v170; // s9
__n128 v171; // q1
__n128 v172; // q0
GameManager *v173; // x0
GameManager *v174; // x0
float v175; // s1
float v176; // s2
float v177; // s3
float v178; // s1
float v179; // s2
float v180; // s3
float32x2_t v181[2]; // [xsp+0h] [xbp-C0h] BYREF
float32x2_t v182; // [xsp+10h] [xbp-B0h] BYREF
float v183; // [xsp+18h] [xbp-A8h]
float v184; // [xsp+1Ch] [xbp-A4h]
float32x4_t v185; // [xsp+20h] [xbp-A0h] BYREF
__int64 v186; // [xsp+30h] [xbp-90h] BYREF
float v187; // [xsp+38h] [xbp-88h]
float v188; // [xsp+3Ch] [xbp-84h]
cocos2d::CCPoint ScalePosDelta; // 0:kr00_8.8
cocos2d::CCRect v190; // 0:kr10_16.16
cocos2d::CCRect v191; // 0:kr20_16.16
cocos2d::CCRect v192; // 0:s1.4,4:s2.4,8:s3.4,12:s4.4
v4 = a3;
v7 = a2 * 4.0;
v8 = 1.0;
if ( a3 )
v8 = 0.5;
if ( a1->m_enableImpulseFix )
v9 = v7;
else
v9 = v8;
m_holdingLeft = a1->m_holdingLeft;
m_holdingRight = a1->m_holdingRight;
v12 = !m_holdingLeft && m_holdingRight;
if ( m_holdingLeft && m_holdingRight )
{
m_holdingLeft = a1->m_leftPressedFirst;
v12 = !m_holdingLeft;
}
m_lastGroundObject = a1->m_lastGroundObject;
if ( m_lastGroundObject && GameObject::getGroupDisabled(m_lastGroundObject) )
a1->m_lastGroundObject = nullptr;
m_currentSlope2 = a1->m_currentSlope2;
if ( m_currentSlope2 && GameObject::getGroupDisabled(m_currentSlope2) )
a1->m_currentSlope2 = nullptr;
v15 = a1->m_lastGroundObject;
if ( v15 )
a1->m_isOnIce = v15->m_isIceBlock;
m_isOnSlope = a1->m_isOnSlope;
if ( m_isOnSlope )
{
m_currentSlope = a1->m_currentSlope;
if ( m_currentSlope )
{
if ( !a1->m_maybeUpsideDownSlope )
a1->m_isOnIce = m_currentSlope->m_isIceBlock;
}
}
if ( m_isOnSlope != a1->m_wasOnSlope )
{
if ( a1->m_isDart )
{
PlayerObject::placeStreakPoint(a1);
LOBYTE(m_isOnSlope) = a1->m_isOnSlope;
}
if ( !m_isOnSlope )
{
m_totalTime = a1->m_totalTime;
a1->m_slopeEndTime = m_totalTime;
m_isUpsideDown = a1->m_isUpsideDown;
m_slopeVelocity = a1->m_slopeVelocity;
if ( m_isUpsideDown )
{
if ( m_slopeVelocity >= 0.0 || a1->m_yVelocity <= m_slopeVelocity || !a1->m_isCurrentSlopeTop )
{
if ( m_slopeVelocity > 0.0 && a1->m_yVelocity < m_slopeVelocity )
{
v21 = !a1->m_isCurrentSlopeTop;
LABEL_40:
m_maybeIsBoosted = a1->m_maybeIsBoosted;
if ( m_maybeIsBoosted && !a1->m_isShip && !a1->m_isBird && !a1->m_isDart && !a1->m_isSwing )
v21 &= a1->m_isBall;
if ( (v21 & 1) != 0 )
{
v23 = m_totalTime - a1->m_slopeStartTime;
v24 = fmax(v23 * 10.0, 0.400000006);
v25 = v23 < 0.100000001;
v26 = 1.0;
if ( v25 )
v26 = v24;
v27 = v26 * m_slopeVelocity;
m_slopeAngle = a1->m_slopeAngle;
v29 = cosf(m_slopeAngle);
if ( a1->m_isPlatformer )
{
v30 = v29;
m_platformerXVelocity = a1->m_platformerXVelocity;
v32 = fabs(m_platformerXVelocity * tanf(m_slopeAngle)) * 1.10000002;
v33 = -v32;
if ( v27 >= 0.0 )
v33 = v32;
v27 = v33;
if ( !PlayerObject::isBoostValid(a1, v27)
|| ((m_holdingLeft | v12) & 1) == 0
|| fabs(m_platformerXVelocity) < (float)((float)(v30 * 5.0) + -1.0) )
{
goto LABEL_71;
}
}
else if ( !PlayerObject::isBoostValid(a1, v27) )
{
goto LABEL_71;
}
PlayerObject::boostPlayer(a1, v27);
LABEL_71:
if ( a1->m_maybeSlopeForce > 0.0
&& (m_holdingLeft && a1->m_isSlidingRight || (v12 & 1) != 0 && !a1->m_isSlidingRight) )
{
a1->m_isSliding = 0;
a1->m_maybeSlopeForce = 0.0;
a1->m_isMoving = 1;
}
a1->m_slopeVelocity = 0.0;
a1->m_currentSlope = nullptr;
*(_OWORD *)&a1->m_slopeRotation = 0u;
goto LABEL_78;
}
if ( m_isUpsideDown )
{
if ( m_slopeVelocity <= 0.0 )
goto LABEL_71;
}
else if ( m_slopeVelocity >= 0.0 )
{
goto LABEL_71;
}
if ( !m_maybeIsBoosted
&& !a1->m_jumpBuffered
&& !a1->m_stateRingJump
&& a1->m_isCurrentSlopeTop == m_isUpsideDown )
{
a1->m_isOnGround2 = 0;
m_currentSlopeYVelocity = a1->m_currentSlopeYVelocity;
if ( !m_isUpsideDown )
m_currentSlopeYVelocity = -m_currentSlopeYVelocity;
v35 = (double)(int)m_currentSlopeYVelocity;
if ( m_currentSlopeYVelocity != v35 )
m_currentSlopeYVelocity = round((m_currentSlopeYVelocity - v35) * 1000.0) / 1000.0 + v35;
a1->m_yVelocity = m_currentSlopeYVelocity;
a1->m_isOnGround = 0;
PlayerObject::runRotateAction(a1, 0, v3);
}
goto LABEL_71;
}
LABEL_38:
v21 = 0;
goto LABEL_40;
}
}
else if ( (m_slopeVelocity >= 0.0 || a1->m_yVelocity <= m_slopeVelocity || !a1->m_isCurrentSlopeTop)
&& (m_slopeVelocity <= 0.0 || a1->m_yVelocity >= m_slopeVelocity || a1->m_isCurrentSlopeTop) )
{
goto LABEL_38;
}
v21 = 1;
goto LABEL_40;
}
}
LABEL_78:
if ( a1->m_collidedTopMinY == 0.0 || a1->m_collidedBottomMaxY == 0.0 || a1->m_disablePlayerSqueeze )
goto LABEL_132;
if ( a1->m_isPlatformer )
v36 = 0.8;
else
v36 = 0.7;
v37 = ((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_100022B98(&v186, v37);
v38 = a1->m_collidedTopMinY - a1->m_collidedBottomMaxY;
v39 = ((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
if ( v38 == 0.0 )
goto LABEL_85;
m_collidedTopMinY = a1->m_collidedTopMinY;
v42 = *(float *)(v39 + 4);
if ( !a1->m_isUpsideDown )
{
if ( m_collidedTopMinY >= v42 || m_collidedTopMinY >= a1->m_lastPosition.y )
goto LABEL_92;
LABEL_85:
v40 = 1;
goto LABEL_93;
}
if ( m_collidedTopMinY > v42 && m_collidedTopMinY > a1->m_lastPosition.y )
goto LABEL_85;
LABEL_92:
v40 = 0;
LABEL_93:
v43 = fabsf(v38);
if ( a1->m_isPlatformer
&& (v44 = a1->m_currentSlope) != nullptr
&& (v43 <= v188 ? (v45 = v43 < (float)(v36 * v188)) : (v45 = 1),
!v45
&& (v46 = ((__int64 (__fastcall *)(GameObject *))v44->getObjectRect)(v44),
sub_100022B98(&v185, v46),
sub_100022CB0((float *)&v186, v185.f32))) )
{
v47 = a1->m_currentSlope;
if ( !v47->m_slopeUphill
|| (v48 = GameObject::slopeFloorTop(v47), v49 = -1.0, v48)
&& (v47 = a1->m_currentSlope, v49 = 1.0, !v47->m_slopeUphill) )
{
v50 = GameObject::slopeFloorTop(v47);
v49 = 1.0;
if ( v50 )
v49 = -1.0;
}
a1->m_platformerXVelocity = 0.0;
v51 = a1->m_lastPosition.x + (float)(v49 * a2);
v52.n128_u32[0] = *(_DWORD *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4);
v53.n128_f32[0] = v51;
sub_100022980(v53, v52, &v182);
((void (__fastcall *)(PlayerObject *, float32x2_t *))a1->setPosition)(a1, &v182);
}
else if ( (v40 & 1) == 0 && v43 < (float)(v36 * v188) )
{
if ( a1->m_isPlatformer )
{
m_gameLayer = a1->m_gameLayer;
v55 = ((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_100022B98(&v185, v55);
v185 = vaddq_f32(v185, (float32x4_t)xmmword_10063A790);
v56 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4);
v57 = 1;
while ( 1 )
{
v58 = ceilf(vcvts_n_f32_u32(v57, 1u));
sub_100022B98(&v182, (__int64)&v185);
v59 = (v57 & 1) != 0 ? v58 * 3.0 : -(float)(v58 * 3.0);
v182.f32[0] = v59 + v182.f32[0];
v60 = sub_100022B98(v181, (__int64)&v182);
v190.origin.x = *(float *)&v60;
v190.origin.y = v175;
v190.size.width = v176;
v190.size.height = v177;
v61 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v190, (bool)v181);
if ( !v61 )
break;
data = v61->data;
num = data->num;
if ( !(_DWORD)num )
break;
v64 = 0;
v65 = 0;
arr = data->arr;
v67 = (unsigned __int64)&arr[num - 1];
v68 = (unsigned __int64)(arr + 1);
do
{
v69 = *(_QWORD *)(v68 - 8);
if ( !v69 )
break;
if ( *(float *)((*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v69 + 192LL))(*(_QWORD *)(v68 - 8)) + 4) >= v56 )
{
v65 |= *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v69 + 192LL))(v69) + 4) <= v56;
v64 = 1;
}
else
{
v65 = 1;
}
if ( (v65 & v64 & 1) != 0 )
break;
v45 = v68 > v67;
v68 += 8LL;
}
while ( !v45 );
if ( (v65 & 1) == 0 || (v64 & 1) == 0 )
break;
if ( ++v57 == 9 )
goto LABEL_126;
}
v70 = v59 + *(float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v71.n128_u32[0] = *(_DWORD *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4);
v72.n128_f32[0] = v70;
sub_100022980(v72, v71, v181);
((void (__fastcall *)(PlayerObject *, float32x2_t *))a1->setPosition)(a1, v181);
}
else
{
LABEL_126:
if ( !a1->m_ignoreDamage )
{
if ( !a1->m_playEffects )
((void (__fastcall *)(PlayerObject *, cocos2d::CCPoint *))a1->setPosition)(a1, &a1->m_lastPosition);
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = 1;
}
else
{
v174 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v174->m_playLayer->destroyPlayer)(
v174->m_playLayer,
a1,
0);
}
}
}
}
LABEL_132:
if ( !a1->m_ignoreDamage )
{
if ( cocos2d::CCDictionary::count(a1->m_collisionLogTop) )
{
if ( cocos2d::CCDictionary::count(a1->m_collisionLogBottom) )
{
v73 = cocos2d::CCDictionary::allKeys(a1->m_collisionLogTop);
if ( (unsigned int)sub_10024A36C(v73) )
{
v74 = 0;
do
{
v75 = sub_10024A388(v73, v74);
if ( cocos2d::CCDictionary::objectForKey(a1->m_collisionLogBottom, *(int *)(v75 + 56)) )
goto LABEL_168;
v74 = (unsigned int)(v74 + 1);
}
while ( (unsigned int)v74 < (unsigned int)sub_10024A36C(v73) );
}
}
}
}
if ( !a1->m_isPlatformer )
{
LABEL_150:
if ( a1->m_isPlatformer )
{
v84 = a1->m_currentSlope2;
if ( v84 )
a1->m_preLastGroundObject = v84;
if ( (a1->m_lastGroundObject || a1->m_preLastGroundObject)
&& ((m_preLastGroundObject = a1->m_preLastGroundObject, a1->m_isOnGround2) || m_preLastGroundObject)
&& (m_preLastGroundObject ? (v86 = a1->m_preLastGroundObject) : (v86 = a1->m_lastGroundObject),
!v86->m_isNonStickX) )
{
LastPosition = (__int64 *)GameObject::getLastPosition(v86);
v89 = sub_1000229B8(&v186, LastPosition);
((void (__fastcall *)(float32x4_t *__return_ptr, GameObject *, float))v86->getRealPosition)(&v185, v86, v89);
v90 = 0.0;
if ( v86->m_isScaleStick )
{
ScalePosDelta = GameObject::getScalePosDelta(v86);
v90 = v182.f32[0];
v91 = v185.f32[0];
if ( v91 > *(float *)((__int64 (__fastcall *)(PlayerObject *, float, float))a1->getPosition)(
a1,
ScalePosDelta.x,
ScalePosDelta.y) )
v90 = -v90;
}
if ( a1->m_isSideways )
{
v92 = (float)(v90 + (float)(v185.f32[1] - *((float *)&v186 + 1)));
a1->m_scaleXRelated = v92;
a1->m_scaleXRelated2 = v92;
v93 = (float32x2_t *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v95.n128_u64[0] = *(_QWORD *)&a1->m_scaleXRelated;
v94.n128_f32[0] = v95.n128_f64[0];
v95.n128_u32[0] = 0;
}
else
{
v99 = (float)(v90 + (float)(v185.f32[0] - *(float *)&v186));
a1->m_scaleXRelated = v99;
a1->m_scaleXRelated2 = v99;
v93 = (float32x2_t *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v95.n128_u64[0] = *(_QWORD *)&a1->m_scaleXRelated;
v95.n128_f32[0] = v95.n128_f64[0];
v94.n128_u32[0] = 0;
}
sub_100022980(v95, v94, v181);
*(float32x2_t *)&v100 = sub_1000229DC(v93, v181, &v182);
((void (__fastcall *)(PlayerObject *, float32x2_t *, double))a1->setPosition)(a1, &v182, v100);
a1->m_physDeltaRelated = a1->m_physDeltaRelated + (float)(a2 / 60.0);
v87 = 1;
}
else
{
v87 = 0;
}
PlayerObject::performSlideCheck(a1);
if ( !a1->m_isOnGround2 )
a1->m_preLastGroundObject = nullptr;
}
else
{
v87 = 0;
}
v101 = a1->m_lastGroundObject;
if ( !v101
|| a1->m_currentSlope2
|| v101->m_isNonStickY
|| (v102 = (__int64 *)GameObject::getLastPosition(v101),
v103 = sub_1000229B8(&v186, v102),
((void (__fastcall *)(float32x4_t *__return_ptr, float))a1->m_lastGroundObject->getRealPosition)(&v185, v103),
GameObject::getScalePosDelta(a1->m_lastGroundObject),
v104 = v185.f32[0],
v105 = *(float *)&v186,
v185.f32[0] == *(float *)&v186)
&& v185.f32[1] == *((float *)&v186 + 1)
&& v182.f32[1] == 0.0 )
{
v106 = 0;
}
else
{
if ( !a1->m_isSideways )
{
v104 = v185.f32[1];
v105 = *((float *)&v186 + 1);
}
if ( !a1->m_isUpsideDown && v105 > (float)(v182.f32[1] + v104)
|| (v106 = 0, a1->m_isUpsideDown) && v105 < (float)(v104 - v182.f32[1]) )
{
v106 = 1;
}
}
v107 = cocos2d::CCDictionary::count(a1->m_collisionLogBottom);
if ( (v106 & 1) == 0 && v107 )
goto LABEL_219;
a1->m_isCollidingWithSlope = 0;
v108 = a1->m_lastGroundObject;
a1->m_lastGroundObject = nullptr;
v109 = v106 ^ 1;
if ( !v108 )
v109 = 1;
if ( (v109 & 1) != 0 )
{
LABEL_219:
v122 = a1->m_currentSlope2;
if ( !v122 )
goto LABEL_225;
if ( v122->m_isNonStickY )
goto LABEL_225;
v123 = (__int64 *)GameObject::getLastPosition(v122);
v124 = sub_1000229B8(&v186, v123);
((void (__fastcall *)(float32x4_t *__return_ptr, float))a1->m_currentSlope2->getRealPosition)(&v185, v124);
if ( v185.f32[0] == *(float *)&v186 && v185.f32[1] == *((float *)&v186 + 1) )
goto LABEL_225;
if ( a1->m_isUpsideDown )
{
if ( *((float *)&v186 + 1) >= v185.f32[1] )
{
LABEL_225:
v125 = 0;
goto LABEL_226;
}
}
else if ( *((float *)&v186 + 1) <= v185.f32[1] )
{
goto LABEL_225;
}
v125 = 1;
LABEL_226:
v126 = cocos2d::CCDictionary::count(a1->m_collisionLogBottom);
if ( (v125 & 1) != 0 || !v126 )
{
a1->m_isCollidingWithSlope = 0;
v127 = a1->m_currentSlope2;
a1->m_currentSlope2 = nullptr;
if ( v125 )
{
a1->m_isCollidingWithSlope = 1;
PlayerObject::collidedWithSlope(a1, 0.0, v127, 1);
}
}
m_yVelocityRelated = a1->m_yVelocityRelated;
if ( m_yVelocityRelated != 0.0 && a1->m_stateBoostX <= 0 )
{
m_groundYVelocity = a1->m_groundYVelocity;
v130 = m_yVelocityRelated - m_groundYVelocity;
if ( fabsf(v130) > (float)(v9 * 0.5) )
{
if ( m_yVelocityRelated > 5.0 && !a1->m_isUpsideDown && m_groundYVelocity < m_yVelocityRelated )
{
if ( m_yVelocityRelated > 20.0 )
m_yVelocityRelated = 20.0;
if ( m_yVelocityRelated < -20.0 )
m_yVelocityRelated = -20.0;
a1->m_yVelocityRelated = m_yVelocityRelated;
if ( a1->m_yVelocity > m_yVelocityRelated )
goto LABEL_253;
goto LABEL_252;
}
if ( m_yVelocityRelated < -5.0 && a1->m_isUpsideDown && m_groundYVelocity > m_yVelocityRelated )
{
if ( m_yVelocityRelated > 20.0 )
m_yVelocityRelated = 20.0;
if ( m_yVelocityRelated < -20.0 )
m_yVelocityRelated = -20.0;
a1->m_yVelocityRelated = m_yVelocityRelated;
if ( a1->m_yVelocity < m_yVelocityRelated )
goto LABEL_253;
LABEL_252:
v131 = m_yVelocityRelated;
PlayerObject::boostPlayer(a1, v131);
LABEL_253:
a1->m_currentSlope2 = nullptr;
a1->m_lastGroundObject = nullptr;
}
}
}
if ( !a1->m_isPlatformer )
goto LABEL_325;
m_scaleXRelated3 = a1->m_scaleXRelated3;
if ( m_scaleXRelated3 != 0.0 && !a1->m_isOnGround2 )
{
v133 = a1->m_stateBoostY > 0 ? 1 : v87;
if ( (v133 & 1) == 0 && a1->m_physDeltaRelated > 0.0500000007 )
{
v134 = m_scaleXRelated3 - a1->m_scaleXRelated2;
if ( fabsf(v134) > (float)(v9 * 0.5) )
{
v135 = m_scaleXRelated3 * 0.899999976 / a2;
v136 = v135 + v135;
if ( !a1->m_collidingBetweenSteps )
{
v136 = v135;
v135 = v135 * 0.5;
}
if ( v4 )
v137 = v135;
else
v137 = v136;
v138 = a1->m_platformerXVelocity + v137;
a1->m_platformerXVelocity = v138;
if ( fabsf(v137) >= 2.0 )
{
a1->m_maybeHasStopped = 1;
v139 = v138;
a1->m_xVelocityRelated = v139;
}
a1->m_scaleXRelatedTime = 0.0;
}
}
}
m_scaleXRelated5 = a1->m_scaleXRelated5;
if ( m_scaleXRelated5 == 0.0
|| a1->m_maybeStateForce2 > 0
|| (m_scaleXRelated4 = a1->m_scaleXRelated4,
v142 = m_scaleXRelated5 - m_scaleXRelated4,
fabsf(v142) <= (float)(v9 * 0.5)) )
{
LABEL_321:
if ( !cocos2d::CCDictionary::count(a1->m_collisionLogLeft) )
a1->m_collidingWithLeft = nullptr;
if ( !cocos2d::CCDictionary::count(a1->m_collisionLogRight) )
a1->m_collidingWithRight = nullptr;
LABEL_325:
a1->m_collidedObject = nullptr;
m_scaleXRelated2 = a1->m_scaleXRelated2;
if ( m_scaleXRelated2 == 0.0 )
{
if ( a1->m_scaleXRelated3 != 0.0 )
{
if ( a1->m_totalTime - a1->m_scaleXRelatedTime >= 0.0333333351 )
a1->m_scaleXRelated3 = 0.0;
LABEL_331:
a1->m_yVelocityRelated = a1->m_groundYVelocity;
*(_OWORD *)&a1->m_scaleXRelated2 = 0u;
a1->m_scaleXRelated5 = a1->m_scaleXRelated4;
a1->m_scaleXRelated4 = 0.0;
if ( (v87 & 1) == 0 )
a1->m_physDeltaRelated = 0.0;
if ( a1->m_isOnGround2 )
a1->m_maybeHasStopped = 0;
if ( a1->m_isOnSlope || a1->m_wasOnSlope )
goto LABEL_337;
a1->m_collidingWithSlopeId = 0;
m_yVelocity = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
{
if ( m_yVelocity > 2.0 && a1->m_fallSpeed < 2.0 )
{
v165 = a1->m_gameLayer;
if ( v165 )
{
GJBaseGameLayer::gameEventTriggered(v165, FallSpeedLow, 0, a1->m_uniqueID);
m_yVelocity = a1->m_yVelocity;
}
}
if ( m_yVelocity > 7.0 && a1->m_fallSpeed < 7.0 )
{
v166 = a1->m_gameLayer;
if ( v166 )
{
GJBaseGameLayer::gameEventTriggered(v166, FallSpeedMed, 0, a1->m_uniqueID);
m_yVelocity = a1->m_yVelocity;
}
}
if ( m_yVelocity <= 14.0 || a1->m_fallSpeed >= 14.0 )
goto LABEL_337;
}
else
{
if ( m_yVelocity < -2.0 && a1->m_fallSpeed > -2.0 )
{
v167 = a1->m_gameLayer;
if ( v167 )
{
GJBaseGameLayer::gameEventTriggered(v167, FallSpeedLow, 0, a1->m_uniqueID);
m_yVelocity = a1->m_yVelocity;
}
}
if ( m_yVelocity < -7.0 && a1->m_fallSpeed > -7.0 )
{
v168 = a1->m_gameLayer;
if ( v168 )
{
GJBaseGameLayer::gameEventTriggered(v168, FallSpeedMed, 0, a1->m_uniqueID);
m_yVelocity = a1->m_yVelocity;
}
}
if ( m_yVelocity >= -14.0 || a1->m_fallSpeed <= -14.0 )
goto LABEL_337;
}
v169 = a1->m_gameLayer;
if ( v169 )
GJBaseGameLayer::gameEventTriggered(v169, FallSpeedHigh, 0, a1->m_uniqueID);
LABEL_337:
a1->m_fallSpeed = a1->m_yVelocity;
--a1->m_reverseRelated;
return;
}
}
else
{
a1->m_scaleXRelatedTime = a1->m_totalTime;
}
a1->m_scaleXRelated3 = m_scaleXRelated2;
a1->m_collidingBetweenSteps = v4;
goto LABEL_331;
}
m_collidingWithLeft = a1->m_collidingWithLeft;
if ( m_scaleXRelated5 > 5.0 && m_collidingWithLeft && m_scaleXRelated4 < m_scaleXRelated5 )
{
if ( m_scaleXRelated5 > 50.0 )
m_scaleXRelated5 = 50.0;
if ( m_scaleXRelated5 < -50.0 )
m_scaleXRelated5 = -50.0;
a1->m_scaleXRelated5 = m_scaleXRelated5;
}
else
{
if ( m_scaleXRelated5 >= -5.0 || !a1->m_collidingWithRight || m_scaleXRelated4 <= m_scaleXRelated5 )
goto LABEL_321;
if ( m_scaleXRelated5 > 50.0 )
m_scaleXRelated5 = 50.0;
if ( m_scaleXRelated5 < -50.0 )
m_scaleXRelated5 = -50.0;
a1->m_scaleXRelated5 = m_scaleXRelated5;
if ( !m_collidingWithLeft )
goto LABEL_318;
}
if ( a1->m_platformerXVelocity <= m_scaleXRelated5 )
{
LABEL_319:
a1->m_platformerXVelocity = m_scaleXRelated5;
a1->m_affectedByForces = 1;
a1->m_isAccelerating = 1;
goto LABEL_320;
}
if ( !a1->m_collidingWithRight )
{
LABEL_320:
a1->m_collidingWithLeft = nullptr;
a1->m_collidingWithRight = nullptr;
goto LABEL_321;
}
LABEL_318:
if ( a1->m_platformerXVelocity >= m_scaleXRelated5 )
goto LABEL_319;
goto LABEL_320;
}
v110 = 5.0;
if ( a1->m_isPlatformer )
v110 = 10.0;
if ( v108->m_isExtraSticky )
v110 = 20.0;
v111 = v110 * a2;
v112 = ((__int64 (__fastcall *)(GameObject *))v108->getObjectRect)(v108);
v113 = sub_100022B98(&v186, v112);
v114 = ((__int64 (__fastcall *)(PlayerObject *, double))a1->getObjectRect)(a1, v113);
sub_100022B98(&v185, v114);
sub_100022B98(&v182, (__int64)&v186);
if ( a1->m_isSideways )
{
v183 = v111 + v183;
if ( a1->m_isUpsideDown )
{
v115 = sub_100022C40((__int64)&v186);
v116 = sub_100022C30(v185.f32);
goto LABEL_199;
}
v118 = sub_100022C40((__int64)&v185);
v119 = sub_100022C30((float *)&v186);
}
else
{
v184 = v111 + v184;
if ( a1->m_isUpsideDown )
{
v115 = sub_100022C58((__int64)&v186);
v116 = sub_100022C48((__int64)&v185);
LABEL_199:
v117 = v115 - v116;
if ( a1->m_isSideways )
v182.f32[0] = v182.f32[0] - v111;
else
v182.f32[1] = v182.f32[1] - v111;
goto LABEL_212;
}
v118 = sub_100022C58((__int64)&v185);
v119 = sub_100022C48((__int64)&v186);
}
v117 = v118 - v119;
LABEL_212:
if ( sub_100022CB0(v185.f32, (float *)&v182) )
{
v120 = 0;
}
else
{
m_collidedObject = a1->m_collidedObject;
v120 = m_collidedObject == nullptr;
if ( m_collidedObject )
v108 = a1->m_collidedObject;
}
if ( v117 < v111 && !v120 )
{
a1->m_isCollidingWithSlope = 1;
sub_100022B98(v181, (__int64)&unk_10086CC00);
PlayerObject::collidedWithObject(a1, 0.0, v108, v192, (bool)v181);
}
goto LABEL_219;
}
if ( a1->m_collidedLeftMaxX != 0.0 && a1->m_collidedRightMinX != 0.0 )
{
v76 = ((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_100022B98(&v186, v76);
v77 = v187;
m_vehicleSize = a1->m_vehicleSize;
v79 = a1->m_collidedRightMinX - a1->m_collidedLeftMaxX;
v80 = (float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
if ( v79 != 0.0 )
{
v96 = fabsf(v79);
v97 = *v80;
if ( a1->m_platformerXVelocity >= 0.0 )
{
m_collidedRightMinX = a1->m_collidedRightMinX;
if ( m_collidedRightMinX < v97 && m_collidedRightMinX < a1->m_lastPosition.x )
goto LABEL_143;
}
else
{
m_collidedLeftMaxX = a1->m_collidedLeftMaxX;
if ( m_collidedLeftMaxX > v97 && m_collidedLeftMaxX > a1->m_lastPosition.x )
goto LABEL_143;
}
if ( v96 < (float)(v77 + (float)(m_vehicleSize * -5.0)) )
{
if ( a1->m_isPlatformer )
{
v146 = a1->m_gameLayer;
v147 = ((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_100022B98(&v185, v147);
v185 = vaddq_f32(v185, (float32x4_t)xmmword_10063A7A0);
v148 = *(float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v149 = 1;
while ( 1 )
{
v150 = ceilf(vcvts_n_f32_u32(v149, 1u));
sub_100022B98(&v182, (__int64)&v185);
v151 = (v149 & 1) != 0 ? v150 * 3.0 : -(float)(v150 * 3.0);
v182.f32[1] = v151 + v182.f32[1];
v152 = sub_100022B98(v181, (__int64)&v182);
v191.origin.x = *(float *)&v152;
v191.origin.y = v178;
v191.size.width = v179;
v191.size.height = v180;
v153 = GJBaseGameLayer::staticObjectsInRect(v146, v191, (bool)v181);
if ( !v153 )
break;
v154 = v153->data;
v155 = v154->num;
if ( !(_DWORD)v155 )
break;
v156 = 0;
v157 = 0;
v158 = v154->arr;
v159 = (unsigned __int64)&v158[v155 - 1];
v160 = (unsigned __int64)(v158 + 1);
do
{
v161 = *(_QWORD *)(v160 - 8);
if ( !v161 )
break;
v162 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v161 + 192LL))(*(_QWORD *)(v160 - 8));
if ( v162 >= v148 )
{
v157 |= *(float *)((*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v161 + 192LL))(v161, v162) + 4) <= v148;
v156 = 1;
}
else
{
v157 = 1;
}
if ( (v157 & v156 & 1) != 0 )
break;
v45 = v160 > v159;
v160 += 8LL;
}
while ( !v45 );
if ( (v157 & 1) == 0 || (v156 & 1) == 0 )
break;
if ( ++v149 == 9 )
goto LABEL_304;
}
v170 = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v171.n128_f32[0] = v151 + *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4);
v172.n128_u32[0] = v170;
sub_100022980(v172, v171, v181);
((void (__fastcall *)(PlayerObject *, float32x2_t *))a1->setPosition)(a1, v181);
}
else
{
LABEL_304:
if ( !a1->m_playEffects )
((void (__fastcall *)(PlayerObject *, cocos2d::CCPoint *))a1->setPosition)(a1, &a1->m_lastPosition);
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = !a1->m_ignoreDamage;
}
else
{
v173 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v173->m_playLayer->destroyPlayer)(
v173->m_playLayer,
a1,
0);
}
}
}
}
}
LABEL_143:
if ( a1->m_ignoreDamage )
goto LABEL_150;
if ( !cocos2d::CCDictionary::count(a1->m_collisionLogLeft) )
goto LABEL_150;
if ( !cocos2d::CCDictionary::count(a1->m_collisionLogRight) )
goto LABEL_150;
v81 = cocos2d::CCDictionary::allKeys(a1->m_collisionLogLeft);
if ( !(unsigned int)sub_10024A36C(v81) )
goto LABEL_150;
v82 = 0;
while ( 1 )
{
v83 = sub_10024A388(v81, v82);
if ( cocos2d::CCDictionary::objectForKey(a1->m_collisionLogRight, *(int *)(v83 + 56)) )
break;
v82 = (unsigned int)(v82 + 1);
if ( (unsigned int)v82 >= (unsigned int)sub_10024A36C(v81) )
goto LABEL_150;
}
LABEL_168:
((void (__fastcall *)(PlayerObject *, cocos2d::CCPoint *))a1->setPosition)(a1, &a1->m_lastPosition);
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = 1;
}
else
{
v144 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v144->m_playLayer->destroyPlayer)(
v144->m_playLayer,
a1,
0);
}
}