//
// PlayerObject::collidedWithSlopeInternal from 0x6374a8 to 0x638594 (4332 bytes)
//
// 3 xrefs:
// > PlayerObject::handleRotatedCollisionInternal @ 0x63872c
// > PlayerObject::collidedWithSlope @ 0x6389a4
// > ??> @ 0x9e5f8
//
// 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 PlayerObject::collidedWithSlopeInternal(PlayerObject *a1, float a2, GameObject *a3, bool a4)
{
unsigned int v4; // w23
const cocos2d::CCRect *v8; // x0
const cocos2d::CCRect *v9; // x0
unsigned int m_slopeUphill; // w22
double m_platformerXVelocity; // d0
bool v12; // w0
unsigned int v13; // w28
bool v14; // w27
const cocos2d::CCPoint *LastPosition; // x0
unsigned __int64 v16; // kr00_8
double v17; // d0
float v18; // s0
float v19; // s10
float v20; // s12
float v21; // s0
float m_slopeRotation; // s0
float v23; // s11
float v24; // s11
const cocos2d::CCPoint *v25; // x0
float v26; // s0
float v27; // s13
float v28; // s0
float v29; // s14
float v30; // s11
float v31; // s1
unsigned int v32; // w25
double v33; // d0
float v34; // s0
float v35; // s15
_BOOL4 v36; // w2
_BOOL4 v37; // w0
int v38; // w2
_BOOL4 v39; // w23
float v40; // s12
_BOOL4 m_isPlatformer; // w0
float v42; // s0
int m_uniqueID; // w2
char *v44; // x0
float height; // s0
int v46; // w1
double v47; // d9
int v48; // w0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x2
const cocos2d::CCPoint *v50; // x0
void (__fastcall *v51)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x24
const cocos2d::CCPoint *v52; // x0
_BOOL4 v53; // w0
double v54; // d0
double v55; // d0
double v56; // d0
int v57; // w0
float v58; // s15
float v59; // s15
_BOOL4 m_isBall; // w0
float v61; // s9
double v62; // d0
float v63; // s0
float v64; // s0
float m_slopeVelocity; // s10
float v66; // s10
float v67; // s11
float v68; // w25
__int64 v69; // x0
char *v70; // x0
float v71; // s1
float v72; // s0
float v73; // s0
float v74; // s0
_BOOL4 v75; // w0
bool v76; // w0
bool isFlying; // w0
_BOOL4 v78; // w0
bool v79; // w0
int v80; // w0
bool v81; // w0
void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x20
const cocos2d::CCPoint *v83; // x0
double m_yVelocity; // d0
double v85; // d1
GameManager *v86; // x0
bool v87; // w0
float v88; // s12
double v89; // d0
float v90; // s0
GameObject *m_currentSlope2; // x0
_BOOL4 m_isSideways; // w1
bool v93; // w0
const cocos2d::CCPoint *v94; // x0
float x; // s0
float y; // s1
int v97; // [xsp+A0h] [xbp+A0h]
_BOOL4 v98; // [xsp+B4h] [xbp+B4h]
_BOOL4 v99; // [xsp+B8h] [xbp+B8h]
float SlopeAngle; // [xsp+BCh] [xbp+BCh]
const cocos2d::CCPoint *v101; // [xsp+C0h] [xbp+C0h]
float v102; // [xsp+C0h] [xbp+C0h]
int v103; // [xsp+C0h] [xbp+C0h]
_BOOL4 m_isUpsideDown; // [xsp+C0h] [xbp+C0h]
int v105; // [xsp+C0h] [xbp+C0h]
int v106; // [xsp+C0h] [xbp+C0h]
int v107; // [xsp+C0h] [xbp+C0h]
int v108; // [xsp+C0h] [xbp+C0h]
int v109; // [xsp+D0h] [xbp+D0h]
unsigned int v110; // [xsp+D4h] [xbp+D4h]
int m_wasOnSlope; // [xsp+D4h] [xbp+D4h]
int m_isGoingLeft; // [xsp+D8h] [xbp+D8h]
unsigned int v113; // [xsp+DCh] [xbp+DCh]
int v114; // [xsp+E0h] [xbp+E0h]
float v115; // [xsp+E0h] [xbp+E0h]
unsigned __int64 v116; // [xsp+F0h] [xbp+F0h] BYREF
__int64 v117; // [xsp+F8h] [xbp+F8h] BYREF
cocos2d::CCPoint v118; // [xsp+100h] [xbp+100h] BYREF
cocos2d::CCPoint v119; // [xsp+108h] [xbp+108h] BYREF
cocos2d::CCPoint v120; // [xsp+110h] [xbp+110h] BYREF
cocos2d::CCRect v121; // [xsp+118h] [xbp+118h] BYREF
cocos2d::CCRect v122; // [xsp+128h] [xbp+128h] BYREF
cocos2d::CCRect v123; // [xsp+138h] [xbp+138h] BYREF
v4 = a4;
if ( !a4 && PlayerObject::preSlopeCollision(a1, a2, a3) )
return;
v8 = a1->getObjectRect(a1);
cocos2d::CCRect::CCRect(&v121, v8);
v9 = a3->getObjectRect(a3);
cocos2d::CCRect::CCRect(&v122, v9);
m_slopeUphill = a3->m_slopeUphill;
if ( a1->m_isPlatformer )
{
m_platformerXVelocity = a1->m_platformerXVelocity;
if ( m_platformerXVelocity >= 0.0 )
m_slopeUphill ^= 1u;
m_isGoingLeft = m_platformerXVelocity < 0.0;
}
else
{
if ( !a1->m_isGoingLeft )
m_slopeUphill ^= 1u;
m_isGoingLeft = a1->m_isGoingLeft;
}
v12 = GameObject::slopeFloorTop(a3);
v13 = v12;
v14 = v12;
a3->getRealPosition(a3);
LastPosition = GameObject::getLastPosition(a3);
cocos2d::CCPoint::operator-(&v116, &v123, LastPosition);
if ( a1->m_isSideways )
v16 = __PAIR64__(v116, HIDWORD(v116));
else
v16 = v116;
v17 = a1->m_playerSpeed * a1->m_speedMultiplier;
if ( *(float *)&v16 > v17 * a2 )
{
if ( a1->m_isUpsideDown )
{
v113 = (unsigned __int8)m_slopeUphill ^ 1;
m_slopeUphill = v113;
}
else if ( m_slopeUphill )
{
m_slopeUphill = 0;
v113 = 1;
}
else
{
m_slopeUphill = 1;
v113 = 0;
}
v114 = 1;
}
else
{
v114 = 0;
v113 = 0;
}
if ( a1->m_isUpsideDown != a1->m_isSideways )
m_slopeUphill = (unsigned __int8)m_slopeUphill ^ 1;
if ( !a1->m_wasOnSlope )
{
v18 = v122.size.width / v17;
v19 = v122.size.height / v18;
LABEL_14:
v20 = (float)m_slopeUphill;
goto LABEL_15;
}
m_slopeVelocity = a1->m_slopeVelocity;
if ( (float)(m_slopeVelocity * (float)PlayerObject::flipMod(a1)) > 0.0
&& m_slopeUphill
&& a1->m_isCurrentSlopeTop == v13
&& a1->m_isUpsideDown == v13 )
{
return;
}
v66 = v122.size.width / (a1->m_playerSpeed * a1->m_speedMultiplier);
v19 = v122.size.height / v66;
if ( !a1->m_wasOnSlope )
goto LABEL_14;
v67 = a1->m_slopeVelocity;
if ( (float)(v67 * (float)PlayerObject::flipMod(a1)) > 0.0 && a1->m_currentSlopeYVelocity > v19 )
return;
if ( !a1->m_wasOnSlope )
goto LABEL_14;
v20 = (float)(int)(4 * m_slopeUphill);
LABEL_15:
v101 = GameObject::getLastPosition(a3);
((void (__fastcall *)(cocos2d::CCRect *__return_ptr, GameObject *))a3->getRealPosition)(&v123, a3);
cocos2d::CCPoint::operator-(&v117, v101, &v123);
if ( a1->m_isSideways )
v21 = *(float *)&v117;
else
v21 = *((float *)&v117 + 1);
if ( a1->m_isUpsideDown )
{
if ( v21 < 0.0 )
{
v110 = 1;
goto LABEL_141;
}
if ( !v4 )
{
v110 = 0;
m_slopeRotation = a1->m_slopeRotation;
v23 = (float)(v121.size.height * 0.5) / cosf(m_slopeRotation);
LABEL_21:
v24 = (float)(v23 + a1->getPosition(a1)->y) + v20;
goto LABEL_22;
}
}
else
{
v110 = 1;
if ( v21 > 0.0 )
goto LABEL_141;
if ( !v4 )
{
v110 = 0;
v74 = a1->m_slopeRotation;
v23 = (float)(v121.size.height * 0.5) / cosf(v74);
goto LABEL_144;
}
}
v110 = 0;
LABEL_141:
v71 = fabsf(v21);
if ( a1->m_isPlatformer )
{
v72 = a2 * 10.0;
if ( v71 <= (float)(a2 * 10.0) )
goto LABEL_143;
}
else
{
v72 = a2 * 5.0;
if ( (float)(a2 * 5.0) >= v71 )
goto LABEL_143;
}
v71 = v72;
LABEL_143:
m_isUpsideDown = a1->m_isUpsideDown;
v20 = v20 + v71;
v73 = a1->m_slopeRotation;
v23 = (float)(v121.size.height * 0.5) / cosf(v73);
if ( m_isUpsideDown )
goto LABEL_21;
LABEL_144:
v24 = (float)(a1->getPosition(a1)->y - v23) - v20;
LABEL_22:
if ( a1->m_wasOnSlope )
{
if ( a1->m_isUpsideDown )
{
if ( v24 < v122.origin.y )
return;
}
else if ( v24 > (float)(v122.origin.y + v122.size.height) )
{
return;
}
}
else
{
cocos2d::CCRect::CCRect(&v123, v122.origin.x, v122.origin.y + 1.0, v122.size.width, v122.size.height - 2.0);
if ( !(unsigned __int8)cocos2d::CCRect::intersectsRect(&v121, &v123) )
return;
}
v25 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v118, v25);
cocos2d::CCRect::getMinY(&v122);
v27 = v26;
cocos2d::CCRect::getMaxY(&v122);
v29 = v28;
SlopeAngle = GameObject::getSlopeAngle(a3);
v30 = (float)(v121.size.height / cosf(SlopeAngle)) * 0.5;
if ( !a1->m_wasOnSlope || a1->m_collidingWithSlopeId == a3->m_uniqueID || a1->m_isCurrentSlopeTop == v13 )
{
v32 = 0;
v31 = 0.0;
}
else if ( a1->m_isPlatformer )
{
v31 = 0.0;
v32 = 1;
}
else
{
v32 = 1;
v31 = a1->m_vehicleSize * 20.0;
}
v102 = v31;
GameObject::slopeYPos(a3, v118.x);
v34 = v33;
if ( !v13 )
{
v35 = (float)(v34 + v30) - v102;
if ( (float)((float)(v29 + (float)(v121.size.height * 0.5)) - v102) > v35 )
{
v98 = 0;
}
else
{
v35 = (float)(v29 + (float)(v121.size.height * 0.5)) - v102;
v98 = 1;
}
if ( v35 > v27 )
{
v99 = 0;
}
else
{
v35 = v27;
v99 = 1;
}
v36 = a1->m_isUpsideDown;
if ( !a1->m_isUpsideDown )
goto LABEL_35;
LABEL_157:
if ( m_slopeUphill )
{
if ( v32 )
{
LABEL_159:
v20 = 0.0;
v75 = 0;
goto LABEL_160;
}
if ( PlayerObject::isFlying(a1) && !a1->m_isPlatformer )
{
v36 = a1->m_isUpsideDown;
goto LABEL_159;
}
v20 = 0.0;
}
else
{
if ( PlayerObject::isFlying(a1) && a1->m_jumpBuffered )
{
v20 = 2.0;
if ( !a1->m_wasOnSlope )
v20 = 1.0;
}
if ( v32 )
{
v36 = a1->m_isUpsideDown;
v75 = 0;
goto LABEL_160;
}
PlayerObject::isFlying(a1);
}
v36 = a1->m_isUpsideDown;
v75 = !a1->m_isOnSlope;
LABEL_160:
if ( v36 )
{
v38 = 1;
if ( v118.y >= v35 )
{
v38 = 0;
if ( v75 )
v38 = v118.y < (float)(v35 + v20);
}
}
else
{
v38 = 1;
if ( v118.y <= v35 )
{
v38 = 0;
if ( v75 )
v38 = v118.y > (float)(v35 - v20);
}
}
if ( a1->m_jumpBuffered )
{
m_wasOnSlope = 0;
v109 = 0;
}
else
{
m_wasOnSlope = 0;
if ( !a1->m_isPlatformer )
{
v106 = v38;
isFlying = PlayerObject::isFlying(a1);
v38 = v106;
if ( isFlying || a1->m_isBall )
{
m_wasOnSlope = 0;
if ( m_slopeUphill )
m_wasOnSlope = a1->m_wasOnSlope;
}
if ( a1->m_jumpBuffered )
goto LABEL_176;
}
v105 = v38;
v76 = PlayerObject::isFlying(a1);
v38 = v105;
if ( v76 && m_slopeUphill )
v109 = 1;
else
LABEL_176:
v109 = 0;
}
if ( !v38
|| (v107 = v38, v81 = PlayerObject::isFlying(a1), v38 = v107, v81)
|| a1->m_isBall
|| a1->m_isPlatformer
|| a1->m_stateHitHead > 0 )
{
v103 = 0;
v39 = 1;
goto LABEL_52;
}
if ( !PlayerObject::isSafeMode(a1, 0.1) && !PlayerObject::isSafeFlip(a1, 0.1) )
{
if ( a1->m_isUpsideDown )
v78 = (float)(v118.y + 2.0) < v35;
else
v78 = (float)(v118.y - 2.0) > v35;
if ( v78 )
{
if ( !a1->m_ignoreDamage )
goto LABEL_190;
v103 = 0;
v39 = 1;
LABEL_183:
if ( !a3->m_slopeIsHazard )
{
if ( !v32 )
{
if ( !a1->m_isDart )
goto LABEL_192;
v38 = 1;
if ( a1->m_stateDartSlide > 0 )
goto LABEL_53;
}
if ( a1->m_isPlatformer )
goto LABEL_192;
v38 = 1;
if ( a1->m_stateHitHead > 0 )
goto LABEL_53;
}
if ( !a1->m_ignoreDamage )
{
LABEL_190:
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = 1;
}
else
{
v86 = GameManager::sharedState();
v86->m_playLayer->destroyPlayer(v86->m_playLayer, a1, nullptr);
}
return;
}
LABEL_192:
v38 = 1;
goto LABEL_53;
}
LABEL_226:
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 0;
return;
}
setPosition = a1->setPosition;
v83 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v123.origin, v83->x, v35);
setPosition(a1, &v123.origin);
if ( a1->m_isUpsideDown )
{
m_yVelocity = a1->m_yVelocity;
v85 = 2.0;
if ( m_yVelocity >= 2.0 )
goto LABEL_225;
}
else
{
m_yVelocity = a1->m_yVelocity;
v85 = -2.0;
if ( m_yVelocity <= -2.0 )
{
LABEL_225:
PlayerObject::setYVelocity(a1, m_yVelocity, 18);
goto LABEL_226;
}
}
m_yVelocity = v85;
goto LABEL_225;
}
v35 = (float)(v34 - v30) + v102;
if ( (float)((float)(v27 - (float)(v121.size.height * 0.5)) + v102) < v35 )
{
v98 = 0;
}
else
{
v35 = (float)(v27 - (float)(v121.size.height * 0.5)) + v102;
v98 = 1;
}
if ( v35 < v29 )
{
v99 = 0;
}
else
{
v35 = v29;
v99 = 1;
}
v36 = a1->m_isUpsideDown;
if ( !a1->m_isUpsideDown )
goto LABEL_157;
LABEL_35:
if ( m_slopeUphill <= v32
|| a1->m_isOnSlope
|| a1->m_maybeIsBoosted && (v79 = PlayerObject::isFlying(a1), v36 = a1->m_isUpsideDown, !v79) )
{
v37 = 0;
}
else
{
v37 = !a1->m_isShip || !a1->m_jumpBuffered;
}
if ( m_slopeUphill < v4 )
v37 = 1;
if ( m_slopeUphill < v110 )
v37 = 1;
if ( v36 )
{
v38 = 1;
if ( v118.y <= v35 )
{
v38 = 0;
if ( v37 && v118.y > (float)(v35 - v20) )
{
v38 = 1;
if ( a1->m_isBird )
v38 = a1->m_yVelocity >= 0.0;
}
}
}
else
{
v38 = 1;
if ( v118.y >= v35 )
{
v38 = 0;
if ( v37 && v118.y < (float)(v35 + v20) )
{
v38 = 1;
if ( a1->m_isBird )
v38 = a1->m_yVelocity <= 0.0;
}
}
}
if ( a1->m_jumpBuffered
&& (v108 = v38, v87 = PlayerObject::isFlying(a1), v38 = v108, v87)
&& (!m_slopeUphill || a1->m_isPlatformer) )
{
v109 = 0;
v39 = 0;
v103 = 1;
m_wasOnSlope = v32 & a1->m_isPlatformer ^ 1;
}
else
{
v103 = 0;
v39 = 0;
v109 = 0;
m_wasOnSlope = 0;
}
LABEL_52:
if ( v38 )
goto LABEL_183;
LABEL_53:
if ( a1->m_isSideways
&& (v68 = *(float *)&a3->m_uniqueID,
v97 = v38,
v69 = sub_62116C(&a1->m_rotateObjectsRelated._M_h._M_buckets, SLODWORD(v68)),
v38 = v97,
v69) )
{
v123.origin.x = v68;
v70 = std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[](
(char **)&a1->m_rotateObjectsRelated,
(int *)&v123);
v38 = v97;
v40 = v35 - *((double *)v70 + 1);
}
else
{
v40 = v35;
}
if ( !a1->m_wasOnSlope )
{
m_isPlatformer = a1->m_isPlatformer;
goto LABEL_57;
}
if ( a1->m_unk3d0 == v35 || a1->m_isSideways && a1->m_blackOrbRelated == v40 )
{
m_isPlatformer = a1->m_isPlatformer;
if ( !a1->m_isPlatformer || fabs(a1->m_platformerXVelocity) >= 0.100000001 )
goto LABEL_131;
if ( *((float *)&v16 + 1) == 0.0 )
goto LABEL_130;
}
else
{
m_isPlatformer = a1->m_isPlatformer;
if ( *((float *)&v16 + 1) == 0.0 )
{
if ( !a1->m_isPlatformer )
goto LABEL_58;
goto LABEL_130;
}
}
if ( v98 && a1->m_unk3e0 )
goto LABEL_284;
if ( !v99 )
{
LABEL_57:
if ( !m_isPlatformer )
{
LABEL_58:
if ( !m_slopeUphill || !a1->m_isDart || !a1->m_jumpBuffered )
goto LABEL_62;
goto LABEL_61;
}
goto LABEL_130;
}
if ( a1->m_unk3e1 )
{
LABEL_284:
if ( !a1->m_isDashing )
{
if ( !m_isPlatformer || fabs(a1->m_platformerXVelocity) > 0.100000001 )
goto LABEL_131;
goto LABEL_130;
}
goto LABEL_57;
}
if ( !m_isPlatformer )
goto LABEL_58;
LABEL_130:
if ( v38 )
{
cocos2d::CCRect::CCRect(
&v123,
v121.origin.x - 2.0,
v121.origin.y - 10.0,
v121.size.width + 4.0,
v121.size.height + 20.0);
v38 = (unsigned __int8)cocos2d::CCRect::intersectsRect(&v122, &v123);
goto LABEL_58;
}
LABEL_131:
if ( !m_slopeUphill )
return;
if ( !a1->m_isDart )
return;
v38 = 0;
if ( !a1->m_jumpBuffered )
return;
LABEL_61:
if ( a1->m_isUpsideDown == v13 )
return;
LABEL_62:
if ( !v38 )
return;
a1->m_currentSlope = a3;
v42 = GameObject::getSlopeAngle(a3);
m_uniqueID = a3->m_uniqueID;
a1->m_currentPotentialSlope = a1->m_currentSlope;
a1->m_slopeAngleRadians = v42;
LODWORD(v123.origin.x) = m_uniqueID;
v44 = std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[](
(__int64)&a1->m_potentialSlopeMap,
(int *)&v123);
height = v121.size.height;
v46 = a3->m_uniqueID;
*(_QWORD *)v44 = a3;
a1->m_unk3e0 = v98;
a1->m_unk3e1 = v99;
a1->m_unk3d0 = v35;
a1->m_isCurrentSlopeTop = v14;
v47 = a1->m_slopeRotation;
a1->m_collidingWithSlopeId = v46;
a1->m_slopeFlipGravityRelated = m_slopeUphill;
a1->m_blackOrbRelated = v40;
a1->unk_584 = (float)(v30 - (float)(height * 0.5));
v48 = PlayerObject::flipMod(a1);
if ( m_slopeUphill < v13 || v13 < ((unsigned __int8)m_slopeUphill ^ 1u) )
v48 = -v48;
getPosition = a1->getPosition;
a1->m_slopeRotation = (float)((float)((float)(SlopeAngle * 57.296)
* (float)((((((v48 ^ -v114) + v114) ^ -m_isGoingLeft) + m_isGoingLeft)
^ -a1->m_isSideways)
+ a1->m_isSideways))
* 0.017453);
v50 = getPosition(a1);
cocos2d::CCPoint::CCPoint(&v119, v50);
v51 = a1->setPosition;
v52 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v123.origin, v52->x, v35);
v51(a1, &v123.origin);
v53 = a1->m_wasOnSlope;
a1->m_isOnSlope = 1;
if ( !v53 )
{
v54 = a1->m_yVelocity;
a1->m_slopeStartTime = a1->m_totalTime;
a1->m_yVelocityBeforeSlope = v54;
}
a1->m_maybeUpsideDownSlope = v39;
if ( m_wasOnSlope )
goto LABEL_73;
if ( v39 )
{
v55 = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
{
if ( v55 >= 0.0 )
goto LABEL_72;
}
else if ( v55 <= 0.0 )
{
LABEL_72:
PlayerObject::setYVelocity(a1, v55, 20);
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 0;
PlayerObject::updateCollide(a1, (PlayerCollisionDirection)0, a3);
goto LABEL_73;
}
v55 = 0.0;
goto LABEL_72;
}
v88 = a1->m_yVelocity;
PlayerObject::hitGround(a1, a3, 0);
if ( a1->m_isUpsideDown )
{
if ( v88 >= -5.0 )
goto LABEL_262;
goto LABEL_261;
}
if ( v88 > 5.0 )
LABEL_261:
PlayerObject::setYVelocity(a1, v88, 100);
LABEL_262:
if ( a1->m_isPlatformer && fabsf(a1->m_slopeAngleRadians * 57.296) > 40.0 && v88 < -5.0 )
{
v89 = a1->m_platformerXVelocity;
if ( v89 > 0.0 )
a1->m_platformerXVelocity = v89 * 0.5;
}
PlayerObject::updateCollide(a1, (PlayerCollisionDirection)1, a3);
a1->m_currentSlope2 = a3;
v90 = GameObject::getSlopeAngle(a3);
m_currentSlope2 = a1->m_currentSlope2;
m_isSideways = a1->m_isSideways;
a1->m_slopeAngle = v90;
v93 = m_currentSlope2->m_slopeUphill;
a1->m_slopeSlidingMaybeRotated = v93;
if ( m_isSideways )
a1->m_slopeSlidingMaybeRotated = !v93;
if ( v90 >= 1.0 && a1->m_slopeSlidingMaybeRotated )
a1->m_maybeSlidingTime = 3;
v94 = GameObject::getLastPosition(a3);
cocos2d::CCPoint::CCPoint(&v120, v94);
a3->getRealPosition(a3);
x = v123.origin.x;
y = v120.x;
if ( v123.origin.x != v120.x || v123.origin.y != v120.y )
{
if ( !a1->m_isUpsideDown )
{
y = v120.y;
x = v123.origin.y;
if ( v120.y >= v123.origin.y )
goto LABEL_73;
goto LABEL_276;
}
if ( v123.origin.x < v120.x )
LABEL_276:
a1->m_groundYVelocity = (float)((float)(x - y) / a2);
}
LABEL_73:
if ( v109 )
{
v56 = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
{
if ( v56 >= 2.0 )
{
if ( !v103 )
goto LABEL_79;
LABEL_77:
if ( v56 <= -2.0 )
goto LABEL_79;
goto LABEL_78;
}
}
else if ( v56 <= -2.0 )
{
if ( !v103 )
goto LABEL_79;
goto LABEL_216;
}
v80 = PlayerObject::flipMod(a1);
PlayerObject::setYVelocity(a1, (float)((float)v80 * -2.0), 21);
}
if ( !v103 )
goto LABEL_79;
v56 = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
goto LABEL_77;
LABEL_216:
if ( v56 < 2.0 )
{
LABEL_78:
v57 = PlayerObject::flipMod(a1);
PlayerObject::setYVelocity(a1, (float)((float)v57 + (float)v57), 22);
}
LABEL_79:
v58 = 0.8 / SlopeAngle;
a1->m_currentSlopeYVelocity = v19;
if ( (float)(0.8 / SlopeAngle) >= 1.1 )
v58 = 1.1;
v59 = v58 * (float)(v19 * 1.4);
if ( m_slopeUphill > v113 )
v59 = -v59;
a1->m_slopeVelocity = v59;
a1->m_slopeVelocity = a1->m_slopeVelocity * (float)PlayerObject::flipMod(a1);
if ( v39 && a1->m_isPlatformer && a1->m_isBird )
a1->m_jumpBuffered = 0;
if ( PlayerObject::isFlying(a1) )
{
m_isBall = a1->m_isBall;
}
else
{
m_isBall = a1->m_isBall;
if ( !a1->m_isBall )
goto LABEL_247;
}
a1->m_slopeVelocity = a1->m_slopeVelocity * 0.75;
if ( !m_isBall )
{
LABEL_247:
PlayerObject::updateSlopeRotation(a1, a2);
return;
}
v61 = v47;
v62 = a1->m_slopeRotation;
if ( v61 != v62 )
{
v63 = v62;
v64 = 1.0 / cosf(v63);
if ( v64 > 2.0 )
v64 = (float)((float)(v64 - 1.0) * 0.7) + 1.0;
v115 = v64;
PlayerObject::stopRotation(a1, 1, 1);
PlayerObject::runBallRotation(a1, v115);
}
}