//
// PlayerObject::collidedWithSlopeInternal from 0x14038f810 to 0x140390bb3 (5027 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215e73
// > PlayerObject::postCollision @ 0x14038eb57
// > PlayerObject::handleRotatedCollisionInternal @ 0x14038f1d3
// > ??> @ 0x1406d611c
//
// 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
//
// Hidden C++ exception states: #wind=5
void PlayerObject::collidedWithSlopeInternal(PlayerObject *a1, float a2, GameObject *a3, bool a4)
{
const struct cocos2d::CCRect *v8; // rax
const struct cocos2d::CCRect *v9; // rax
bool m_slopeUphill; // al
unsigned __int8 v11; // r15
int m_slopeDirection; // ecx
char v13; // r13
__int64 v14; // rax
float v15; // xmm0_4
char m_isUpsideDown; // cl
bool m_wasOnSlope; // dl
int v18; // eax
char m_isCurrentSlopeTop; // al
float v20; // xmm2_4
int v21; // eax
float v22; // xmm10_4
__int64 v23; // rax
float v24; // xmm0_4
bool v25; // bl
bool v26; // al
bool v27; // r14
bool v28; // cl
float v29; // xmm0_4
bool m_isPlatformer; // al
float v31; // xmm1_4
float v32; // xmm0_4
float v33; // xmm6_4
float v34; // xmm6_4
const cocos2d::CCPoint *v35; // rax
float v36; // xmm0_4
bool *p_m_wasOnSlope; // rbx
const struct cocos2d::CCRect *v38; // rax
float MinY; // xmm7_4
float MaxY; // xmm9_4
const struct cocos2d::CCRect *v41; // rax
float v42; // xmm12_4
float v43; // xmm8_4
char v44; // r13
float v45; // xmm6_4
bool v46; // cl
float height; // xmm4_4
float v48; // xmm0_4
float v49; // xmm0_4
float v50; // xmm6_4
float v51; // xmm2_4
float v52; // xmm1_4
float v53; // xmm7_4
float v54; // xmm0_4
bool v55; // al
bool v56; // cf
bool v57; // bl
char v58; // r12
char v59; // r14
bool v60; // al
bool v61; // cc
double m_gameModeChangedTime; // xmm2_8
double v63; // xmm0_8
double m_lastFlipTime; // xmm2_8
bool v65; // cf
bool v66; // zf
__int64 v67; // rcx
PlayerObject_vtbl *v68; // rbx
const cocos2d::CCPoint *v69; // rax
const cocos2d::CCPoint *v70; // rax
int v71; // r8d
double m_yVelocity; // xmm1_8
double v73; // xmm1_8
float v74; // xmm7_4
unsigned int m_uniqueID; // r8d
std::_Vector_val>>>>>::pointer Myfirst; // rdx
__int64 v77; // rcx
bool v78; // r13
const struct cocos2d::CCRect *v79; // rax
const struct cocos2d::CCRect *v80; // rax
float m_slopeRotation; // xmm9_4
int v82; // r13d
int v83; // ecx
int v84; // eax
int v85; // ecx
int v86; // eax
float x; // xmm11_4
double v88; // xmm0_8
PlayerObject_vtbl *v89; // rbx
const cocos2d::CCPoint *v90; // rax
const cocos2d::CCPoint *v91; // rax
int v92; // r8d
float v93; // xmm6_4
int v94; // r8d
double m_platformerXVelocity; // xmm0_8
const struct cocos2d::CCRect *v96; // rax
float v97; // xmm0_4
bool v98; // cl
float v99; // xmm0_4
float y; // xmm1_4
bool v101; // cc
float v102; // xmm8_4
double v103; // xmm1_8
double v104; // xmm1_8
int v105; // eax
int v106; // eax
float v107; // xmm2_4
float v108; // xmm0_4
float v109; // xmm1_4
float v110; // xmm0_4
bool *p_m_isBall; // rax
double v112; // xmm1_8
float v113; // xmm1_4
bool v114; // [rsp+30h] [rbp-D0h]
bool v115; // [rsp+31h] [rbp-CFh]
char v116; // [rsp+32h] [rbp-CEh]
char v117; // [rsp+33h] [rbp-CDh]
bool v118; // [rsp+34h] [rbp-CCh]
bool v119; // [rsp+38h] [rbp-C8h]
bool v120; // [rsp+3Ch] [rbp-C4h]
void *v121; // [rsp+40h] [rbp-C0h] BYREF
cocos2d::CCPoint v122; // [rsp+48h] [rbp-B8h] BYREF
cocos2d::CCRect v123; // [rsp+50h] [rbp-B0h] BYREF
cocos2d::CCRect v124; // [rsp+60h] [rbp-A0h] BYREF
cocos2d::CCRect v125; // [rsp+70h] [rbp-90h] BYREF
float v126; // [rsp+80h] [rbp-80h] BYREF
float v127; // [rsp+84h] [rbp-7Ch]
cocos2d::CCPoint v128; // [rsp+88h] [rbp-78h] BYREF
cocos2d::CCRect v129; // [rsp+90h] [rbp-70h] BYREF
cocos2d::CCRect v130; // [rsp+A0h] [rbp-60h] BYREF
_DWORD v131[44]; // [rsp+B0h] [rbp-50h] BYREF
int v133; // [rsp+1B8h] [rbp+B8h] BYREF
if ( !a4 && PlayerObject::preSlopeCollision(a1, a2, a3) )
return;
v8 = a1->getObjectRect_0(a1);
cocos2d::CCRect::CCRect(&v124, v8);
v9 = a3->getObjectRect_0(a3);
cocos2d::CCRect::CCRect(&v123, v9);
m_slopeUphill = a3->m_slopeUphill;
v11 = !m_slopeUphill;
if ( !a1->m_isPlatformer )
{
if ( !a1->m_isGoingLeft )
goto LABEL_5;
LABEL_11:
v117 = 1;
v11 = m_slopeUphill;
goto LABEL_6;
}
if ( a1->m_platformerXVelocity < 0.0 )
goto LABEL_11;
LABEL_5:
v117 = 0;
LABEL_6:
m_slopeDirection = a3->m_slopeDirection;
v13 = m_slopeDirection == 1 || ((m_slopeDirection - 3) & 0xFFFFFFFC) == 0 && m_slopeDirection != 4;
v114 = v13;
v119 = 0;
v116 = 0;
v14 = ((__int64 (__fastcall *)(GameObject *, void **))a3->getRealPosition)(a3, &v121);
cocos2d::CCPoint::operator-(v14, &v126, &a3->m_lastPosition);
if ( a1->m_isSideways )
{
v15 = v127;
v128.x = v126;
}
else
{
v15 = v126;
v128.x = v127;
}
if ( v15 > a1->m_playerSpeed * a1->m_speedMultiplier * a2 )
{
if ( a1->m_isUpsideDown )
{
v119 = v11 == 0;
}
else if ( v11 )
{
v119 = 1;
}
v116 = 1;
v11 ^= 1u;
}
m_isUpsideDown = a1->m_isUpsideDown;
if ( m_isUpsideDown != a1->m_isSideways )
v11 = v11 == 0;
m_wasOnSlope = a1->m_wasOnSlope;
if ( m_wasOnSlope )
{
v18 = -1;
if ( !m_isUpsideDown )
v18 = 1;
if ( (float)((float)v18 * a1->m_slopeVelocity) > 0.0 )
{
if ( v11 )
{
m_isCurrentSlopeTop = a1->m_isCurrentSlopeTop;
if ( m_isCurrentSlopeTop == v13 && m_isCurrentSlopeTop == m_isUpsideDown )
return;
}
}
}
v20 = v123.size.height / (float)(v123.size.width / (a1->m_playerSpeed * a1->m_speedMultiplier));
*(float *)&v121 = v20;
if ( m_wasOnSlope )
{
v21 = -1;
if ( !m_isUpsideDown )
v21 = 1;
if ( (float)((float)v21 * a1->m_slopeVelocity) > 0.0 && a1->m_currentSlopeYVelocity > v20 )
return;
}
v22 = (float)v11;
if ( m_wasOnSlope )
v22 = (float)(4 * v11);
v23 = ((__int64 (__fastcall *)(GameObject *, cocos2d::CCRect *, __int64, __int64))a3->getRealPosition)(
a3,
&v125,
0xFFFFFFFFLL,
1);
cocos2d::CCPoint::operator-(&a3->m_lastPosition, v131, v23);
if ( a1->m_isSideways )
v24 = *(float *)v131;
else
v24 = *(float *)&v131[1];
v25 = a1->m_isUpsideDown;
v27 = true;
if ( v25 || (v26 = 0, v24 <= 0.0) )
{
v26 = a1->m_isUpsideDown;
if ( !v25 || (v26 = a1->m_isUpsideDown, v24 >= 0.0) )
v27 = false;
}
v28 = a1->m_isUpsideDown;
if ( a4 || (v28 = v26, v27) )
{
v25 = v28;
v29 = fabs(v24);
m_isPlatformer = a1->m_isPlatformer;
if ( m_isPlatformer )
v31 = 10.0;
else
v31 = 5.0;
if ( (float)(v31 * a2) <= v29 )
{
if ( m_isPlatformer )
v32 = 10.0;
else
v32 = 5.0;
v29 = v32 * a2;
}
v22 = v22 + v29;
}
v33 = v124.size.height * 0.5;
v34 = v33 / cosf(a1->m_slopeRotation);
v35 = a1->getPosition_0(a1);
if ( v25 )
v36 = (float)(v34 + v35->y) + v22;
else
v36 = (float)(v35->y - v34) - v22;
p_m_wasOnSlope = &a1->m_wasOnSlope;
if ( a1->m_wasOnSlope )
{
if ( a1->m_isUpsideDown )
{
if ( v123.origin.y > v36 )
return;
}
else if ( v36 > (float)(v123.origin.y + v123.size.height) )
{
return;
}
}
else
{
p_m_wasOnSlope = &a1->m_wasOnSlope;
cocos2d::CCRect::CCRect(&v130, v123.origin.x, v123.origin.y + 1.0, v123.size.width, v123.size.height - 2.0);
if ( !cocos2d::CCRect::intersectsRect(&v124, v38) )
return;
}
a1->getPosition_0(a1);
cocos2d::CCPoint::CCPoint(&v122);
MinY = cocos2d::CCRect::getMinY(&v123);
MaxY = cocos2d::CCRect::getMaxY(&v123);
v41 = a3->getObjectRect_0(a3);
cocos2d::CCRect::CCRect(&v125, v41);
v125.origin.x = atanf(v125.size.height / v125.size.width);
v42 = (float)(v124.size.height / cosf(v125.origin.x)) * 0.5;
v43 = 0.0;
if ( !*p_m_wasOnSlope || a1->m_collidingWithSlopeId == a3->m_uniqueID || a1->m_isCurrentSlopeTop == v13 )
{
v44 = 0;
}
else
{
v44 = 1;
if ( !a1->m_isPlatformer )
v43 = a1->m_vehicleSize * 20.0;
}
v45 = GameObject::slopeYPos(a3, v122.x);
v115 = 0;
v46 = v114;
height = v124.size.height;
v48 = v124.size.height * 0.5;
if ( v114 )
{
v53 = (float)(MinY - v48) + v43;
v50 = (float)(v45 - v42) + v43;
v54 = v50;
if ( v53 >= v50 )
v50 = v53;
LOBYTE(v133) = v53 >= v54;
if ( v50 >= MaxY )
{
v50 = MaxY;
v115 = 1;
LOBYTE(v133) = v53 >= v54;
}
v46 = v114;
}
else
{
v49 = (float)(v48 + MaxY) - v43;
v50 = (float)(v45 + v42) - v43;
v51 = v50;
if ( v50 >= v49 )
v50 = v49;
v52 = v50;
LOBYTE(v133) = v51 >= v49;
if ( MinY >= v50 )
v50 = MinY;
v115 = MinY >= v52;
}
v118 = 0;
v120 = 0;
if ( a1->m_isUpsideDown )
{
if ( !v46 )
goto LABEL_131;
LABEL_89:
if ( v44 || !v11 || a1->m_isOnSlope )
goto LABEL_100;
if ( a1->m_maybeIsBoosted )
{
if ( a1->m_isShip )
{
LABEL_98:
if ( !a1->m_jumpBuffered )
goto LABEL_99;
LABEL_100:
v55 = 0;
if ( !v11 )
{
v55 = a4;
if ( v27 )
v55 = 1;
}
LABEL_103:
if ( a1->m_isUpsideDown )
{
if ( v122.y > v50 )
goto LABEL_116;
if ( !v55 || v122.y <= (float)(v50 - v22) )
goto LABEL_115;
if ( !a1->m_isBird )
goto LABEL_116;
v56 = a1->m_yVelocity < 0.0;
}
else
{
if ( v50 > v122.y )
goto LABEL_116;
if ( !v55 || (float)(v50 + v22) <= v122.y )
goto LABEL_115;
if ( !a1->m_isBird )
{
LABEL_116:
v57 = 1;
LABEL_117:
if ( a1->m_jumpBuffered
&& (a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing)
&& (!v11 || a1->m_isPlatformer) )
{
v58 = 1;
if ( !a1->m_isPlatformer || !v44 )
{
v59 = 1;
goto LABEL_129;
}
}
else
{
v58 = 0;
}
v59 = 0;
LABEL_129:
if ( !v57 )
goto LABEL_214;
goto LABEL_203;
}
v56 = a1->m_yVelocity > 0.0;
}
if ( v56 )
{
LABEL_115:
v57 = 0;
goto LABEL_117;
}
goto LABEL_116;
}
if ( !a1->m_isBird && !a1->m_isDart && !a1->m_isSwing )
goto LABEL_100;
}
if ( !a1->m_isShip )
{
LABEL_99:
v55 = 1;
goto LABEL_103;
}
goto LABEL_98;
}
if ( !v46 )
goto LABEL_89;
LABEL_131:
v118 = 1;
if ( v11 )
{
v22 = 0.0;
}
else if ( (a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing) && a1->m_jumpBuffered )
{
v22 = (float)(a1->m_wasOnSlope + 1);
}
v60 = !v44
&& (!a1->m_isShip && !a1->m_isBird && !a1->m_isDart && !a1->m_isSwing || !v11 || a1->m_isPlatformer)
&& !a1->m_isOnSlope;
if ( !a1->m_isUpsideDown )
{
if ( v122.y > v50 )
goto LABEL_158;
if ( v60 )
{
v61 = v122.y <= (float)(v50 - v22);
goto LABEL_156;
}
LABEL_157:
v57 = 0;
goto LABEL_159;
}
if ( v50 > v122.y )
goto LABEL_158;
if ( !v60 )
goto LABEL_157;
v61 = (float)(v50 + v22) <= v122.y;
LABEL_156:
if ( v61 )
goto LABEL_157;
LABEL_158:
v57 = 1;
LABEL_159:
if ( !a1->m_jumpBuffered
&& !a1->m_isPlatformer
&& (a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing || a1->m_isBall)
&& v11
&& a1->m_wasOnSlope )
{
v59 = 1;
}
else
{
v59 = 0;
if ( a1->m_jumpBuffered )
goto LABEL_175;
}
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing )
v120 = v11 != 0;
LABEL_175:
if ( !v57 )
{
v58 = 0;
goto LABEL_214;
}
if ( a1->m_isShip
|| a1->m_isBird
|| a1->m_isDart
|| a1->m_isSwing
|| a1->m_isBall
|| a1->m_isPlatformer
|| a1->m_stateHitHead > 0 )
{
goto LABEL_202;
}
m_gameModeChangedTime = a1->m_gameModeChangedTime;
if ( m_gameModeChangedTime != 0.0 && (v63 = a1->m_totalTime - m_gameModeChangedTime, v63 < 0.1000000014901161)
|| (m_lastFlipTime = a1->m_lastFlipTime, m_lastFlipTime != 0.0)
&& (v63 = a1->m_totalTime - m_lastFlipTime, v63 < 0.1000000014901161) )
{
v68 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v69 = a1->getPosition_0(a1);
cocos2d::CCPoint::CCPoint(*(float *)&v63, v69->x);
v68->setPosition_0(a1, v70);
m_yVelocity = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
v73 = fmax(m_yVelocity, 2.0);
else
v73 = fmin(m_yVelocity, -2.0);
PlayerObject::setYVelocity(a1, v73, v71);
goto LABEL_201;
}
if ( a1->m_isUpsideDown )
{
v65 = v50 < (float)(v122.y + 2.0);
v66 = v50 == (float)(v122.y + 2.0);
}
else
{
v65 = (float)(v122.y - 2.0) < v50;
v66 = (float)(v122.y - 2.0) == v50;
}
v57 = !v65 && !v66;
if ( v65 || v66 )
{
LABEL_201:
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 0;
return;
}
if ( !a1->m_ignoreDamage )
{
if ( !a1->m_maybeCanRunIntoBlocks )
{
v67 = qword_1406C2ED8;
if ( qword_1406C2ED8 )
{
LABEL_195:
(*(void (__fastcall **)(_QWORD, PlayerObject *, _QWORD))(**(_QWORD **)(v67 + 520) + 1128LL))(
*(_QWORD *)(v67 + 520),
a1,
0);
return;
}
LABEL_194:
v121 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v121);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v67 = qword_1406C2ED8;
goto LABEL_195;
}
LABEL_196:
a1->m_maybeIsColliding = 1;
return;
}
LABEL_202:
v58 = 0;
LABEL_203:
if ( (a3->m_slopeIsHazard
|| (v44 || a1->m_isDart && a1->m_stateDartSlide <= 0) && !a1->m_isPlatformer && a1->m_stateHitHead <= 0)
&& !a1->m_ignoreDamage )
{
if ( !a1->m_maybeCanRunIntoBlocks )
{
v67 = qword_1406C2ED8;
if ( qword_1406C2ED8 )
goto LABEL_195;
goto LABEL_194;
}
goto LABEL_196;
}
LABEL_214:
v74 = v50;
if ( !a1->m_isSideways )
goto LABEL_223;
m_uniqueID = a3->m_uniqueID;
Myfirst = a1->m_rotateObjectsRelated._Vec._Mypair._Myval2._Myfirst;
v77 = *((_QWORD *)Myfirst
+ 2
* ((0x100000001B3LL
* (((unsigned __int64)m_uniqueID >> 24)
^ (0x100000001B3LL
* (BYTE2(m_uniqueID)
^ (0x100000001B3LL
* ((0x100000001B3LL * ((unsigned __int8)m_uniqueID ^ 0xCBF29CE484222325uLL)) ^ BYTE1(m_uniqueID)))))))
& a1->m_rotateObjectsRelated._Mask)
+ 1);
if ( (std::_List_val>>::_Nodeptr)v77 != a1->m_rotateObjectsRelated._List._Mypair._Myval2._Myhead )
{
if ( m_uniqueID == *(_DWORD *)(v77 + 16) )
goto LABEL_221;
while ( v77 != *((_QWORD *)Myfirst
+ 2
* ((0x100000001B3LL
* (((unsigned __int64)(unsigned int)a3->m_uniqueID >> 24)
^ (0x100000001B3LL
* ((unsigned __int8)BYTE2(a3->m_uniqueID)
^ (0x100000001B3LL
* ((0x100000001B3LL * ((unsigned __int8)m_uniqueID ^ 0xCBF29CE484222325uLL))
^ (unsigned __int8)BYTE1(a3->m_uniqueID)))))))
& a1->m_rotateObjectsRelated._Mask)) )
{
v77 = *(_QWORD *)(v77 + 8);
if ( m_uniqueID == *(_DWORD *)(v77 + 16) )
goto LABEL_221;
}
}
v77 = 0;
LABEL_221:
if ( v77 )
{
LODWORD(v129.origin.x) = a3->m_uniqueID;
v74 = v50 - *(double *)(*(_QWORD *)sub_1403A43C0(&a1->m_rotateObjectsRelated, &v130, &v129) + 32LL);
height = v124.size.height;
}
LABEL_223:
if ( !a1->m_wasOnSlope )
{
LABEL_230:
v78 = v133;
goto LABEL_231;
}
if ( (a1->m_unk3d0 == v50 || a1->m_isSideways && a1->m_blackOrbRelated == v74)
&& (!a1->m_isPlatformer || fabs(a1->m_platformerXVelocity) >= 0.1000000014901161) )
{
v57 = 0;
goto LABEL_230;
}
if ( v128.x == 0.0 )
goto LABEL_230;
v78 = v133;
if ( ((_BYTE)v133 && a1->m_unk3e0 || v115 && a1->m_unk3e1)
&& !a1->m_isDashing
&& (!a1->m_isPlatformer || fabs(a1->m_platformerXVelocity) > 0.1000000014901161) )
{
v57 = 0;
}
LABEL_231:
if ( a1->m_isPlatformer && v57 )
{
cocos2d::CCRect::CCRect(&v130, v124.origin.x - 2.0, v124.origin.y - 10.0, v124.size.width + 4.0, height + 20.0);
if ( !cocos2d::CCRect::intersectsRect(&v123, v79) )
v57 = 0;
}
if ( v11 && a1->m_isDart && a1->m_jumpBuffered && v114 == a1->m_isUpsideDown || !v57 )
return;
a1->m_currentSlope = a3;
v80 = a3->getObjectRect_0(a3);
cocos2d::CCRect::CCRect(&v129, v80);
a1->m_slopeAngleRadians = atanf(v129.size.height / v129.size.width);
a1->m_currentPotentialSlope = a1->m_currentSlope;
v133 = a3->m_uniqueID;
*(_QWORD *)(*(_QWORD *)sub_14024E530((__int64)&a1->m_potentialSlopeMap, (__int64)&v130, (unsigned __int8 *)&v133)
+ 24LL) = a3;
a1->unk_584 = (float)(v42 - (float)(v124.size.height * 0.5));
a1->m_isCurrentSlopeTop = v114;
a1->m_unk3d0 = v50;
a1->m_blackOrbRelated = v74;
a1->m_collidingWithSlopeId = a3->m_uniqueID;
a1->m_slopeFlipGravityRelated = v11;
m_slopeRotation = a1->m_slopeRotation;
a1->m_unk3e0 = v78;
a1->m_unk3e1 = v115;
v82 = -1;
v83 = -1;
if ( !a1->m_isUpsideDown )
v83 = 1;
if ( !v114 )
{
if ( v11 )
goto LABEL_256;
goto LABEL_255;
}
if ( !v11 )
LABEL_255:
v83 = -v83;
LABEL_256:
v84 = -v83;
if ( !v116 )
v84 = v83;
v85 = -v84;
if ( !v117 )
v85 = v84;
v86 = -v85;
if ( !a1->m_isSideways )
v86 = v85;
x = v125.origin.x;
a1->m_slopeRotation = (float)((float)((float)v86 * (float)(v125.origin.x * 57.29578)) * 0.017453292);
a1->getPosition_0(a1);
v88 = cocos2d::CCPoint::CCPoint(&v128);
v89 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v90 = a1->getPosition_0(a1);
cocos2d::CCPoint::CCPoint(*(float *)&v88, v90->x);
v89->setPosition_0(a1, v91);
a1->m_isOnSlope = 1;
if ( !a1->m_wasOnSlope )
{
a1->m_slopeStartTime = a1->m_totalTime;
a1->m_yVelocityBeforeSlope = a1->m_yVelocity;
}
a1->m_maybeUpsideDownSlope = v118;
if ( v59 )
goto LABEL_292;
if ( v118 )
{
v103 = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
v104 = fmax(v103, 0.0);
else
v104 = fmin(v103, 0.0);
PlayerObject::setYVelocity(a1, v104, v92);
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 0;
PlayerObject::updateCollide(a1, (PlayerCollisionDirection)0, a3);
goto LABEL_292;
}
v93 = a1->m_yVelocity;
PlayerObject::hitGround(a1, a3, 0);
if ( !a1->m_isUpsideDown )
{
if ( v93 <= 5.0 )
goto LABEL_271;
goto LABEL_270;
}
if ( v93 < -5.0 )
LABEL_270:
PlayerObject::setYVelocity(a1, v93, v94);
LABEL_271:
if ( a1->m_isPlatformer && fabs(a1->m_slopeAngleRadians * 57.29578) > 40.0 && v93 < -5.0 )
{
m_platformerXVelocity = a1->m_platformerXVelocity;
if ( m_platformerXVelocity > 0.0 )
a1->m_platformerXVelocity = m_platformerXVelocity * 0.5;
}
PlayerObject::updateCollide(a1, (PlayerCollisionDirection)1, a3);
a1->m_currentSlope2 = a3;
v96 = a3->getObjectRect_0(a3);
cocos2d::CCRect::CCRect(&v130, v96);
v97 = atanf(v130.size.height / v130.size.width);
a1->m_slopeAngle = v97;
v98 = a1->m_currentSlope2->m_slopeUphill;
a1->m_slopeSlidingMaybeRotated = v98;
if ( a1->m_isSideways )
{
v98 = !v98;
a1->m_slopeSlidingMaybeRotated = v98;
}
if ( v98 && v97 >= 1.0 )
a1->m_maybeSlidingTime = 3;
cocos2d::CCPoint::CCPoint(&v129.origin);
((void (__fastcall *)(GameObject *, cocos2d::CCRect *))a3->getRealPosition)(a3, &v125);
v99 = v125.origin.x;
y = v129.origin.x;
if ( v125.origin.x != v129.origin.x || v125.origin.y != v129.origin.y )
{
if ( a1->m_isUpsideDown )
{
v101 = v129.origin.x <= v125.origin.x;
}
else
{
y = v129.origin.y;
v99 = v125.origin.y;
v101 = v125.origin.y <= v129.origin.y;
}
if ( !v101 )
{
v102 = a2;
a1->m_groundYVelocity = (float)((float)(v99 - y) / a2);
goto LABEL_293;
}
}
LABEL_292:
v102 = a2;
LABEL_293:
if ( !v120 )
goto LABEL_300;
if ( a1->m_isUpsideDown )
{
if ( a1->m_yVelocity >= 2.0 )
goto LABEL_300;
v105 = -1;
}
else
{
if ( a1->m_yVelocity <= -2.0 )
goto LABEL_300;
v105 = 1;
}
PlayerObject::setYVelocity(a1, (float)((float)v105 * -2.0), v92);
LABEL_300:
if ( !v58 )
goto LABEL_307;
if ( a1->m_isUpsideDown )
{
if ( a1->m_yVelocity <= -2.0 )
goto LABEL_307;
v106 = -1;
}
else
{
if ( a1->m_yVelocity >= 2.0 )
goto LABEL_307;
v106 = 1;
}
PlayerObject::setYVelocity(a1, (float)((float)v106 + (float)v106), v92);
LABEL_307:
v107 = *(float *)&v121;
a1->m_currentSlopeYVelocity = *(float *)&v121;
v108 = fminf(1.1, 0.80000001 / x) * (float)(v107 * 1.4);
v109 = v108;
if ( v11 && !v119 )
v109 = v108 * -1.0;
if ( !a1->m_isUpsideDown )
v82 = 1;
v110 = (float)v82 * v109;
a1->m_slopeVelocity = v110;
if ( a1->m_isPlatformer && v118 && a1->m_isBird )
a1->m_jumpBuffered = 0;
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing )
{
p_m_isBall = &a1->m_isBall;
}
else
{
p_m_isBall = &a1->m_isBall;
if ( !a1->m_isBall )
{
LABEL_324:
PlayerObject::updateSlopeRotation(a1, v102);
return;
}
}
a1->m_slopeVelocity = v110 * 0.75;
if ( !*p_m_isBall )
goto LABEL_324;
v112 = a1->m_slopeRotation;
if ( m_slopeRotation != v112 )
{
v113 = 1.0 / cosf(v112);
if ( v113 > 2.0 )
v113 = (float)((float)(v113 - 1.0) * 0.69999999) + 1.0;
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
PlayerObject::runBallRotation(a1, v113);
}
}