// // PlayerObject::postCollision from 0x34c648 to 0x34d9a6 (4958 bytes) // // 1 xrefs: // > GJBaseGameLayer::checkCollisions @ 0x493ba4 // // 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::postCollision(PlayerObject *a1, float a2, bool a3) { _BOOL4 v4; // r7 float v6; // s17 _BOOL4 m_holdingLeft; // r9 _BOOL4 m_holdingRight; // r6 GameObject *m_lastGroundObject; // r0 GameObject *m_currentSlope2; // r0 GameObject *v11; // r3 _BOOL4 m_isIceBlock; // r3 _BOOL4 m_isOnSlope; // r3 GameObject *m_currentSlope; // r2 _BOOL4 v15; // r2 float *p_m_slopeVelocity; // r8 float m_slopeVelocity; // s14 _BOOL4 v18; // r5 double *p_m_currentSlopeYVelocity; // r10 float ModifiedSlopeYVel; // r0 float m_slopeAngle; // r5 float v22; // s16 float v23; // s19 double v24; // d6 double v25; // d7 double *p_m_collidedTopMinY; // r6 _BOOL4 m_disablePlayerSqueeze; // r5 float v28; // s19 const cocos2d::CCRect *v29; // r0 double v30; // d7 float v31; // s16 const cocos2d::CCPoint *v32; // r0 float v33; // s16 double y; // d6 double v35; // d7 GameObject *v36; // r0 const cocos2d::CCRect *v37; // r0 GameObject *v38; // r0 int v39; // r3 GameObject *v40; // r0 void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r6 float v42; // s16 const cocos2d::CCPoint *v43; // r0 int v44; // r8 const cocos2d::CCRect *v45; // r0 const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // r3 float v47; // s19 float v48; // s16 cocos2d::CCArray *v49; // r0 void (__fastcall *v50)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r5 float x; // s15 const cocos2d::CCPoint *v52; // r0 cocos2d::ccArray *data; // r3 cocos2d::CCObject **arr; // r6 cocos2d::CCObject **v55; // r11 int v56; // r5 int v57; // r1 int v58; // r3 int v59; // t1 _BOOL4 m_maybeCanRunIntoBlocks; // r5 GameManager *v61; // r0 unsigned int m_ignoreDamage; // r5 int v63; // r0 double *p_m_collidedLeftMaxX; // r5 double *p_m_collidedRightMinX; // r6 const cocos2d::CCRect *v66; // r0 float m_vehicleSize; // s20 float width; // s19 float v69; // s14 float v70; // s16 const cocos2d::CCPoint *v71; // r0 double v72; // d7 int v73; // r8 const cocos2d::CCRect *v74; // r0 const cocos2d::CCPoint *(__fastcall *v75)(cocos2d::CCNode *__hidden); // r3 float v76; // s19 float v77; // s16 cocos2d::CCArray *v78; // r0 void (__fastcall *v79)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r5 float v80; // r6 const cocos2d::CCPoint *v81; // r0 cocos2d::ccArray *v82; // r3 cocos2d::CCObject **v83; // r6 int v84; // r2 cocos2d::CCObject **v85; // r11 int v86; // r5 int v87; // r3 int v88; // t1 _BOOL4 v89; // r5 GameManager *v90; // r0 unsigned int v91; // r5 int v92; // r0 GameObject *m_isPlatformer; // r5 double *p_m_scaleXRelated2; // r10 GameObject *v95; // r3 const cocos2d::CCPoint *LastPosition; // r0 float v97; // s19 float v98; // s16 _BOOL4 m_isSideways; // r2 float v100; // s14 float v101; // s15 double *p_m_scaleXRelated; // r8 void (__fastcall *v103)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r9 const cocos2d::CCPoint *(__fastcall *v104)(cocos2d::CCNode *__hidden); // r3 double v105; // d7 int v106; // r0 float v107; // r2 float v108; // s15 float v109; // r1 int v110; // r11 float v111; // s15 GameObject *v112; // r0 GameObject *m_isNonStickY; // r8 const cocos2d::CCPoint *v114; // r0 float v115; // s15 float v116; // s14 GameObject *m_collidedObject; // r6 GameObject *v118; // r0 _BOOL4 v119; // r6 const cocos2d::CCPoint *v120; // r0 GameObject *v121; // r2 double *p_m_yVelocityRelated; // r9 double *p_m_yVelocity; // r6 double *p_m_groundYVelocity; // r8 double m_yVelocityRelated; // d7 double v126; // d5 float v127; // s12 _BOOL4 m_isUpsideDown; // r3 double v129; // d6 float v130; // s15 double m_scaleXRelated3; // d7 float v132; // s12 float v133; // s14 double v134; // d6 float v135; // s12 double m_scaleXRelated5; // d7 double m_scaleXRelated4; // d5 float v138; // s12 GameObject *m_collidingWithLeft; // r2 double v140; // d7 double *p_m_scaleXRelated3; // r3 double v142; // r2 double *p_m_fallSpeed; // r5 _BOOL4 m_wasOnSlope; // r3 _BOOL4 v145; // r2 double v146; // d6 double v147; // d10 int v148; // r0 int v149; // r0 cocos2d::CCArray *v150; // r6 _BOOL4 v151; // r5 GameManager *v152; // r0 float *v153; // r0 cocos2d::CCArray *v154; // r6 float v155; // s16 const cocos2d::CCRect *v156; // r0 float v157; // s16 const cocos2d::CCRect *v158; // r0 _BOOL4 v159; // r3 float v160; // s19 float v161; // r0 _BOOL4 v162; // r9 float v163; // s19 float v164; // r0 float v165; // r3 float v166; // r3 int v167; // [sp+0h] [bp-64h] bool v168; // [sp+4h] [bp-60h] GJBaseGameLayer *m_gameLayer; // [sp+8h] [bp-5Ch] GJBaseGameLayer *v170; // [sp+8h] [bp-5Ch] int v171; // [sp+10h] [bp-54h] int v172; // [sp+10h] [bp-54h] int v173; // [sp+14h] [bp-50h] int v174; // [sp+14h] [bp-50h] cocos2d::CCRect v175; // [sp+1Ch] [bp-48h] BYREF cocos2d::CCRect v176; // [sp+2Ch] [bp-38h] BYREF cocos2d::CCRect v177; // [sp+3Ch] [bp-28h] BYREF cocos2d::CCRect v178; // [sp+4Ch] [bp-18h] BYREF cocos2d::CCRect v179; // 0:kr00_16.16 cocos2d::CCRect v180; // 0:kr10_16.16 v4 = a3; if ( a1->m_enableImpulseFix ) { v6 = a2 * 4.0; } else { v6 = 0.5; if ( !a3 ) v6 = 1.0; } m_holdingLeft = a1->m_holdingLeft; m_holdingRight = a1->m_holdingRight; if ( a1->m_holdingLeft && a1->m_holdingRight ) { if ( a1->m_leftPressedFirst ) m_holdingRight = 0; else m_holdingLeft = 0; } 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; v11 = a1->m_lastGroundObject; if ( v11 ) { m_isIceBlock = v11->m_isIceBlock; if ( m_isIceBlock ) LOBYTE(m_isIceBlock) = 1; a1->m_isOnIce = m_isIceBlock; } m_isOnSlope = a1->m_isOnSlope; if ( a1->m_isOnSlope ) { m_currentSlope = a1->m_currentSlope; if ( m_currentSlope ) { if ( !a1->m_maybeUpsideDownSlope ) { v15 = m_currentSlope->m_isIceBlock; if ( v15 ) LOBYTE(v15) = 1; a1->m_isOnIce = v15; } } } if ( a1->m_wasOnSlope != m_isOnSlope ) { if ( a1->m_isDart ) PlayerObject::placeStreakPoint(a1); if ( !a1->m_isOnSlope ) { p_m_slopeVelocity = &a1->m_slopeVelocity; m_slopeVelocity = a1->m_slopeVelocity; a1->m_slopeEndTime = a1->m_totalTime; if ( m_slopeVelocity < 0.0 && a1->m_yVelocity > m_slopeVelocity && a1->m_isCurrentSlopeTop ) v18 = 1; else v18 = m_slopeVelocity > 0.0 && a1->m_yVelocity < m_slopeVelocity && !a1->m_isCurrentSlopeTop; p_m_currentSlopeYVelocity = &a1->m_currentSlopeYVelocity; if ( (!a1->m_maybeIsBoosted || PlayerObject::isFlying(a1) || a1->m_isBall) && v18 ) { ModifiedSlopeYVel = PlayerObject::getModifiedSlopeYVel(a1); m_slopeAngle = a1->m_slopeAngle; v22 = ModifiedSlopeYVel; v23 = cosf(m_slopeAngle); if ( a1->m_isPlatformer ) { v24 = fabs(tanf(m_slopeAngle) * a1->m_platformerXVelocity) * 1.10000002; v25 = -1.0; if ( v22 >= 0.0 ) v25 = 1.0; v22 = v24 * v25; } if ( PlayerObject::isBoostValid(a1, v22) && (!a1->m_isPlatformer || (m_holdingLeft || m_holdingRight) && fabs(a1->m_platformerXVelocity) >= (float)((float)(v23 * 5.0) - 1.0)) ) { PlayerObject::boostPlayer(a1, v22); } } else { if ( a1->m_isUpsideDown ) { if ( *p_m_slopeVelocity <= 0.0 ) goto LABEL_49; } else if ( *p_m_slopeVelocity >= 0.0 ) { goto LABEL_49; } if ( !a1->m_maybeIsBoosted && !a1->m_jumpBuffered && !a1->m_stateRingJump && a1->m_isCurrentSlopeTop == a1->m_isUpsideDown ) { a1->m_isOnGround2 = 0; v147 = *p_m_currentSlopeYVelocity; v148 = PlayerObject::flipMod(a1); PlayerObject::setYVelocity(a1, -v147 * (double)v148, 17); a1->m_isOnGround = 0; PlayerObject::runRotateAction(a1, 0, 14); } } LABEL_49: if ( a1->m_maybeSlopeForce > 0.0 ) { if ( m_holdingLeft ) { if ( !a1->m_isSlidingRight && !m_holdingRight ) goto LABEL_50; } else if ( !m_holdingRight || a1->m_isSlidingRight ) { goto LABEL_50; } a1->m_isSliding = 0; a1->m_maybeSlopeForce = 0.0; a1->m_isMoving = 1; } LABEL_50: *p_m_currentSlopeYVelocity = 0.0; *p_m_slopeVelocity = 0.0; a1->m_slopeRotation = 0.0; a1->m_currentSlope = nullptr; } } p_m_collidedTopMinY = &a1->m_collidedTopMinY; if ( a1->m_collidedTopMinY != 0.0 && a1->m_collidedBottomMaxY != 0.0 ) { m_disablePlayerSqueeze = a1->m_disablePlayerSqueeze; if ( !a1->m_disablePlayerSqueeze ) { v28 = 0.8; if ( !a1->m_isPlatformer ) v28 = 0.7; v29 = a1->getObjectRect(a1); cocos2d::CCRect::CCRect(&v175, v29); v30 = *p_m_collidedTopMinY - a1->m_collidedBottomMaxY; v32 = a1->getPosition(a1); v31 = v30; v33 = fabsf(v31); if ( v33 == 0.0 ) { m_disablePlayerSqueeze = 1; } else { y = v32->y; v35 = *p_m_collidedTopMinY; if ( a1->m_isUpsideDown ) { if ( *p_m_collidedTopMinY > y ) m_disablePlayerSqueeze = v35 > a1->m_lastPosition.y; } else if ( *p_m_collidedTopMinY < y ) { m_disablePlayerSqueeze = v35 < a1->m_lastPosition.y; } else { m_disablePlayerSqueeze = a1->m_isUpsideDown; } } if ( a1->m_isPlatformer && (v36 = a1->m_currentSlope) != nullptr && v33 >= (float)(v175.size.height * v28) && v33 <= v175.size.height && (v37 = v36->getObjectRect(v36), cocos2d::CCRect::CCRect(&v178, v37), cocos2d::CCRect::intersectsRect(&v175, &v178)) ) { v38 = a1->m_currentSlope; if ( v38->m_slopeUphill && !GameObject::slopeFloorTop(v38) || (v40 = a1->m_currentSlope, !v40->m_slopeUphill) && GameObject::slopeFloorTop(v40) ) { v39 = -1; } else { v39 = 1; } a1->m_platformerXVelocity = 0.0; setPosition = a1->setPosition; v42 = a1->m_lastPosition.x + (float)((float)v39 * a2); v43 = a1->getPosition(a1); cocos2d::CCPoint::CCPoint(&v177.origin, v42, v43->y); setPosition(a1, &v177.origin); } else if ( !m_disablePlayerSqueeze && v33 < (float)(v28 * v175.size.height) ) { if ( a1->m_isPlatformer ) { v44 = 1; m_gameLayer = a1->m_gameLayer; v45 = a1->getObjectRect(a1); cocos2d::CCRect::CCRect(&v176, v45); getPosition = a1->getPosition; v176.origin.x = v176.origin.x + 1.0; v176.origin.y = v176.origin.y - 1.0; v176.size.width = v176.size.width - 2.0; v176.size.height = v176.size.height + 2.0; v47 = getPosition(a1)->y; while ( 2 ) { v48 = ceilf((float)v44 * 0.5) * 3.0; cocos2d::CCRect::CCRect(&v177, &v176); if ( (v44 & 1) == 0 ) v48 = -v48; v177.origin.x = v177.origin.x + v48; cocos2d::CCRect::CCRect(&v178, &v177); LODWORD(v179.origin.x) = &v178; v179.origin.y = 0.0; v179.size.width = v165; LODWORD(v179.size.height) = v167; v49 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v179, v168); if ( !v49 || (data = v49->data, !data->num) ) { LABEL_85: v50 = a1->setPosition; x = a1->getPosition(a1)->x; v52 = a1->getPosition(a1); cocos2d::CCPoint::CCPoint(&v178.origin, v48 + x, v52->y); v50(a1, &v178.origin); goto LABEL_101; } arr = data->arr; v55 = &arr[data->num] + 0x3FFFFFFF; v56 = 0; v57 = 0; while ( arr <= v55 ) { v59 = (int)*arr++; v58 = v59; if ( !v59 ) break; v173 = v57; v171 = v58; v149 = (*(int (__fastcall **)(int))(*(_DWORD *)v58 + 96))(v58); v57 = v173; if ( *(float *)(v149 + 4) < v47 ) { if ( v173 ) goto LABEL_94; v56 = 1; } else { if ( *(float *)((*(int (__fastcall **)(int))(*(_DWORD *)v171 + 96))(v171) + 4) <= v47 || v56 ) goto LABEL_94; v57 = 1; } } if ( !v57 || !v56 ) goto LABEL_85; LABEL_94: if ( ++v44 != 9 ) continue; break; } } if ( !a1->m_ignoreDamage ) { if ( !a1->m_playEffects ) a1->setPosition(a1, &a1->m_lastPosition); m_maybeCanRunIntoBlocks = a1->m_maybeCanRunIntoBlocks; if ( a1->m_maybeCanRunIntoBlocks ) { a1->m_maybeIsColliding = 1; } else { v61 = GameManager::sharedState(); v61->m_playLayer->destroyPlayer(v61->m_playLayer, a1, (GameObject *)m_maybeCanRunIntoBlocks); } } } } } LABEL_101: m_ignoreDamage = a1->m_ignoreDamage; if ( !a1->m_ignoreDamage && cocos2d::CCDictionary::count(a1->m_collisionLogTop) && cocos2d::CCDictionary::count(a1->m_collisionLogBottom) ) { v150 = cocos2d::CCDictionary::allKeys(a1->m_collisionLogTop); while ( m_ignoreDamage < cocos2d::CCArray::count(v150) ) { v63 = cocos2d::CCArray::objectAtIndex(v150, m_ignoreDamage); if ( cocos2d::CCDictionary::objectForKey(a1->m_collisionLogBottom, *(_DWORD *)(v63 + 52)) ) { LABEL_313: a1->setPosition(a1, &a1->m_lastPosition); v151 = a1->m_maybeCanRunIntoBlocks; if ( a1->m_maybeCanRunIntoBlocks ) { a1->m_maybeIsColliding = 1; } else { v152 = GameManager::sharedState(); v152->m_playLayer->destroyPlayer(v152->m_playLayer, a1, (GameObject *)v151); } return; } ++m_ignoreDamage; } } if ( a1->m_isPlatformer ) { p_m_collidedLeftMaxX = &a1->m_collidedLeftMaxX; if ( a1->m_collidedLeftMaxX != 0.0 ) { p_m_collidedRightMinX = &a1->m_collidedRightMinX; if ( a1->m_collidedRightMinX != 0.0 ) { v66 = a1->getObjectRect(a1); cocos2d::CCRect::CCRect(&v175, v66); m_vehicleSize = a1->m_vehicleSize; width = v175.size.width; v69 = *p_m_collidedRightMinX - *p_m_collidedLeftMaxX; v70 = fabsf(v69); v71 = a1->getPosition(a1); if ( v70 != 0.0 ) { v72 = v71->x; if ( a1->m_platformerXVelocity < 0.0 ) { if ( *p_m_collidedLeftMaxX > v72 && *p_m_collidedLeftMaxX > a1->m_lastPosition.x ) goto LABEL_140; } else if ( *p_m_collidedRightMinX < v72 && *p_m_collidedRightMinX < a1->m_lastPosition.x ) { goto LABEL_140; } if ( v70 < (float)(width - (float)(m_vehicleSize * 5.0)) ) { if ( a1->m_isPlatformer ) { v73 = 1; v170 = a1->m_gameLayer; v74 = a1->getObjectRect(a1); cocos2d::CCRect::CCRect(&v176, v74); v75 = a1->getPosition; v176.origin.x = v176.origin.x - 1.0; v176.origin.y = v176.origin.y + 1.0; v176.size.width = v176.size.width + 2.0; v176.size.height = v176.size.height - 2.0; v76 = v75(a1)->x; while ( 2 ) { v77 = ceilf((float)v73 * 0.5) * 3.0; cocos2d::CCRect::CCRect(&v177, &v176); if ( (v73 & 1) == 0 ) v77 = -v77; v177.origin.y = v177.origin.y + v77; cocos2d::CCRect::CCRect(&v178, &v177); LODWORD(v180.origin.x) = &v178; v180.origin.y = 0.0; v180.size.width = v166; LODWORD(v180.size.height) = v167; v78 = GJBaseGameLayer::staticObjectsInRect(v170, v180, v168); if ( !v78 || (v82 = v78->data, !v82->num) ) { LABEL_126: v79 = a1->setPosition; v80 = a1->getPosition(a1)->x; v81 = a1->getPosition(a1); cocos2d::CCPoint::CCPoint(&v178.origin, v80, v77 + v81->y); v79(a1, &v178.origin); goto LABEL_140; } v83 = v82->arr; v84 = 0; v85 = &v83[v82->num] + 0x3FFFFFFF; v86 = 0; while ( v83 <= v85 ) { v88 = (int)*v83++; v87 = v88; if ( !v88 ) break; v174 = v84; v172 = v87; v153 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v87 + 96))(v87); v84 = v174; if ( *v153 < v76 ) { if ( v174 ) goto LABEL_135; v86 = 1; } else { if ( *(float *)((*(int (__fastcall **)(int))(*(_DWORD *)v172 + 96))(v172) + 4) <= v76 || v86 ) goto LABEL_135; v84 = 1; } } if ( !v86 || !v84 ) goto LABEL_126; LABEL_135: if ( ++v73 != 9 ) continue; break; } } if ( !a1->m_playEffects ) a1->setPosition(a1, &a1->m_lastPosition); v89 = a1->m_maybeCanRunIntoBlocks; if ( a1->m_maybeCanRunIntoBlocks ) { a1->m_maybeIsColliding = !a1->m_ignoreDamage; } else { v90 = GameManager::sharedState(); v90->m_playLayer->destroyPlayer(v90->m_playLayer, a1, (GameObject *)v89); } } } } } LABEL_140: v91 = a1->m_ignoreDamage; if ( !a1->m_ignoreDamage && cocos2d::CCDictionary::count(a1->m_collisionLogLeft) && cocos2d::CCDictionary::count(a1->m_collisionLogRight) ) { v154 = cocos2d::CCDictionary::allKeys(a1->m_collisionLogLeft); while ( v91 < cocos2d::CCArray::count(v154) ) { v92 = cocos2d::CCArray::objectAtIndex(v154, v91); if ( cocos2d::CCDictionary::objectForKey(a1->m_collisionLogRight, *(_DWORD *)(v92 + 52)) ) goto LABEL_313; ++v91; } } } m_isPlatformer = (GameObject *)a1->m_isPlatformer; p_m_scaleXRelated2 = &a1->m_scaleXRelated2; if ( a1->m_isPlatformer ) { v95 = a1->m_currentSlope2; if ( v95 ) a1->m_preLastGroundObject = v95; m_isPlatformer = a1->m_preLastGroundObject; if ( a1->m_lastGroundObject && a1->m_isOnGround2 || m_isPlatformer ) { if ( !m_isPlatformer ) m_isPlatformer = a1->m_lastGroundObject; if ( m_isPlatformer->m_isNonStickX ) { m_isPlatformer = nullptr; } else { LastPosition = GameObject::getLastPosition(m_isPlatformer); cocos2d::CCPoint::CCPoint(&v175.origin, LastPosition); m_isPlatformer->getRealPosition(&v176.origin, m_isPlatformer); if ( m_isPlatformer->m_isScaleStick ) { GameObject::getScalePosDelta(&v178.origin, m_isPlatformer); v97 = v176.origin.x; v98 = v178.origin.x; if ( v97 > a1->getPosition(a1)->x ) v98 = -v98; } else { v98 = 0.0; } m_isSideways = a1->m_isSideways; if ( a1->m_isSideways ) { v100 = v175.origin.y; v101 = v176.origin.y; } else { v100 = v175.origin.x; v101 = v176.origin.x; } p_m_scaleXRelated = &a1->m_scaleXRelated; v103 = a1->setPosition; v104 = a1->getPosition; v105 = (float)((float)(v101 - v100) + v98); a1->m_scaleXRelated = v105; *p_m_scaleXRelated2 = v105; if ( m_isSideways ) { v106 = (int)v104(a1); v109 = 0.0; v111 = *p_m_scaleXRelated; v107 = v111; } else { v106 = (int)v104(a1); v107 = 0.0; v108 = *p_m_scaleXRelated; v109 = v108; } v110 = v106; cocos2d::CCPoint::CCPoint(&v177.origin, v109, v107); cocos2d::CCPoint::operator+(&v178, v110, &v177); m_isPlatformer = (GameObject *)(&dword_0 + 1); v103(a1, &v178.origin); a1->m_physDeltaRelated = a1->m_physDeltaRelated + (float)(a2 / 60.0); } } PlayerObject::performSlideCheck(a1); if ( !a1->m_isOnGround2 ) a1->m_preLastGroundObject = (GameObject *)a1->m_isOnGround2; } v112 = a1->m_lastGroundObject; if ( v112 ) { if ( a1->m_currentSlope2 ) { m_isNonStickY = nullptr; } else { m_isNonStickY = (GameObject *)v112->m_isNonStickY; if ( v112->m_isNonStickY ) { m_isNonStickY = a1->m_currentSlope2; } else { v114 = GameObject::getLastPosition(v112); cocos2d::CCPoint::CCPoint(&v176.origin, v114); ((void (__fastcall *)(cocos2d::CCRect *))a1->m_lastGroundObject->getRealPosition)(&v177); GameObject::getScalePosDelta(&v178.origin, a1->m_lastGroundObject); v115 = v177.origin.x; v116 = v176.origin.x; if ( v177.origin.x != v176.origin.x || v177.origin.y != v176.origin.y || v178.origin.y != 0.0 ) { if ( !a1->m_isSideways ) { v115 = v177.origin.y; v116 = v176.origin.y; } if ( a1->m_isUpsideDown ) m_isNonStickY = (GameObject *)(v116 < (float)(v115 - v178.origin.y)); else m_isNonStickY = (GameObject *)(v116 > (float)(v115 + v178.origin.y)); } } } } else { m_isNonStickY = nullptr; } if ( !cocos2d::CCDictionary::count(a1->m_collisionLogBottom) || m_isNonStickY ) { m_collidedObject = a1->m_lastGroundObject; a1->m_isCollidingWithSlope = 0; a1->m_lastGroundObject = nullptr; if ( m_collidedObject ) { if ( m_isNonStickY ) { v155 = 10.0; if ( !a1->m_isPlatformer ) v155 = 5.0; if ( m_collidedObject->m_isExtraSticky ) v155 = 20.0; v156 = m_collidedObject->getObjectRect(m_collidedObject); v157 = a2 * v155; cocos2d::CCRect::CCRect(&v175, v156); v158 = a1->getObjectRect(a1); cocos2d::CCRect::CCRect(&v176, v158); cocos2d::CCRect::CCRect(&v177, &v175); v159 = a1->m_isSideways; if ( a1->m_isSideways ) v177.size.width = v177.size.width + v157; else v177.size.height = v177.size.height + v157; if ( a1->m_isUpsideDown ) { if ( v159 ) { v163 = COERCE_FLOAT(cocos2d::CCRect::getMinX(&v175)); v164 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v176)); } else { v163 = COERCE_FLOAT(cocos2d::CCRect::getMinY(&v175)); v164 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(&v176)); } v162 = (float)(v163 - v164) < v157; if ( a1->m_isSideways ) v177.origin.x = v177.origin.x - v157; else v177.origin.y = v177.origin.y - v157; } else { if ( v159 ) { v160 = COERCE_FLOAT(cocos2d::CCRect::getMinX(&v176)); v161 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v175)); } else { v160 = COERCE_FLOAT(cocos2d::CCRect::getMinY(&v176)); v161 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(&v175)); } v162 = (float)(v160 - v161) < v157; } if ( (cocos2d::CCRect::intersectsRect(&v176, &v177) || (m_collidedObject = a1->m_collidedObject) != nullptr) && v162 ) { a1->m_isCollidingWithSlope = 1; cocos2d::CCRect::CCRect(&v178, &stru_AC5C70); PlayerObject::collidedWithObject(a1, 0.0, m_collidedObject, &v178, 1u); } } } } v118 = a1->m_currentSlope2; if ( v118 ) { v119 = v118->m_isNonStickY; if ( v118->m_isNonStickY ) { v119 = 0; } else { v120 = GameObject::getLastPosition(v118); cocos2d::CCPoint::CCPoint(&v177.origin, v120); ((void (__fastcall *)(cocos2d::CCRect *))a1->m_currentSlope2->getRealPosition)(&v178); if ( v178.origin.x != v177.origin.x || v178.origin.y != v177.origin.y ) { if ( a1->m_isUpsideDown ) v119 = v177.origin.y < v178.origin.y; else v119 = v177.origin.y > v178.origin.y; } } } else { v119 = 0; } if ( !cocos2d::CCDictionary::count(a1->m_collisionLogBottom) || v119 ) { v121 = a1->m_currentSlope2; a1->m_isCollidingWithSlope = 0; a1->m_currentSlope2 = nullptr; if ( v119 ) { a1->m_isCollidingWithSlope = 1; PlayerObject::collidedWithSlope(a1, 0.0, v121, 1); } } p_m_yVelocityRelated = &a1->m_yVelocityRelated; p_m_yVelocity = &a1->m_yVelocity; p_m_groundYVelocity = &a1->m_groundYVelocity; m_yVelocityRelated = a1->m_yVelocityRelated; if ( m_yVelocityRelated != 0.0 && a1->m_stateBoostX <= 0 ) { v126 = *p_m_groundYVelocity; v127 = m_yVelocityRelated - *p_m_groundYVelocity; if ( fabsf(v127) > (float)(v6 * 0.5) ) { m_isUpsideDown = a1->m_isUpsideDown; if ( !a1->m_isUpsideDown ) { if ( m_yVelocityRelated <= 5.0 || v126 >= m_yVelocityRelated ) goto LABEL_213; LABEL_202: if ( m_yVelocityRelated > 20.0 ) { m_yVelocityRelated = 20.0; } else if ( m_yVelocityRelated < -20.0 ) { m_yVelocityRelated = -20.0; } v129 = *p_m_yVelocity; *p_m_yVelocityRelated = m_yVelocityRelated; if ( m_isUpsideDown ) { if ( v129 < m_yVelocityRelated ) { LABEL_212: a1->m_currentSlope2 = nullptr; a1->m_lastGroundObject = nullptr; goto LABEL_213; } } else if ( v129 > m_yVelocityRelated ) { goto LABEL_212; } v130 = m_yVelocityRelated; PlayerObject::boostPlayer(a1, v130); goto LABEL_212; } if ( m_yVelocityRelated < -5.0 && v126 > m_yVelocityRelated ) goto LABEL_202; } } LABEL_213: if ( a1->m_isPlatformer ) { m_scaleXRelated3 = a1->m_scaleXRelated3; if ( m_scaleXRelated3 != 0.0 && !a1->m_isOnGround2 && a1->m_stateBoostY <= 0 && !m_isPlatformer && a1->m_physDeltaRelated > 0.0500000007 ) { v132 = m_scaleXRelated3 - *p_m_scaleXRelated2; if ( fabsf(v132) > (float)(v6 * 0.5) ) { v133 = m_scaleXRelated3 * 0.899999976 / a2; if ( v4 ) { if ( !a1->m_collidingBetweenSteps ) v133 = v133 * 0.5; } else if ( a1->m_collidingBetweenSteps ) { v133 = v133 + v133; } v134 = v133 + a1->m_platformerXVelocity; a1->m_platformerXVelocity = v134; if ( fabsf(v133) >= 2.0 ) { v135 = v134; a1->m_maybeHasStopped = 1; a1->m_xVelocityRelated = v135; } a1->m_scaleXRelatedTime = 0.0; } } m_scaleXRelated5 = a1->m_scaleXRelated5; if ( m_scaleXRelated5 != 0.0 && a1->m_maybeStateForce2 <= 0 ) { m_scaleXRelated4 = a1->m_scaleXRelated4; v138 = m_scaleXRelated5 - m_scaleXRelated4; if ( fabsf(v138) > (float)(v6 * 0.5) && ((m_collidingWithLeft = a1->m_collidingWithLeft) != nullptr && m_scaleXRelated5 > 5.0 && m_scaleXRelated4 < m_scaleXRelated5 || a1->m_collidingWithRight && m_scaleXRelated5 < -5.0 && m_scaleXRelated4 > m_scaleXRelated5) ) { if ( m_scaleXRelated5 > 50.0 ) { m_scaleXRelated5 = 50.0; } else if ( m_scaleXRelated5 < -50.0 ) { m_scaleXRelated5 = -50.0; } a1->m_scaleXRelated5 = m_scaleXRelated5; if ( m_collidingWithLeft && a1->m_platformerXVelocity <= m_scaleXRelated5 || a1->m_collidingWithRight && a1->m_platformerXVelocity >= m_scaleXRelated5 ) { a1->m_platformerXVelocity = m_scaleXRelated5; a1->m_affectedByForces = 1; a1->m_isAccelerating = 1; } a1->m_collidingWithLeft = nullptr; a1->m_collidingWithRight = nullptr; } } if ( !cocos2d::CCDictionary::count(a1->m_collisionLogLeft) ) a1->m_collidingWithLeft = nullptr; if ( !cocos2d::CCDictionary::count(a1->m_collisionLogRight) ) a1->m_collidingWithRight = nullptr; } v140 = *p_m_scaleXRelated2; a1->m_collidedObject = nullptr; if ( v140 != 0.0 ) a1->m_scaleXRelatedTime = a1->m_totalTime; p_m_scaleXRelated3 = &a1->m_scaleXRelated3; if ( a1->m_scaleXRelated3 == 0.0 || v140 != 0.0 ) { *p_m_scaleXRelated3 = v140; a1->m_collidingBetweenSteps = v4; } else if ( a1->m_totalTime - a1->m_scaleXRelatedTime >= 0.0333333351 ) { *p_m_scaleXRelated3 = 0.0; } v142 = *p_m_groundYVelocity; *p_m_scaleXRelated2 = 0.0; *p_m_yVelocityRelated = v142; *p_m_groundYVelocity = 0.0; a1->m_scaleXRelated5 = a1->m_scaleXRelated4; a1->m_scaleXRelated4 = 0.0; if ( !m_isPlatformer ) a1->m_physDeltaRelated = 0.0; if ( a1->m_isOnGround2 ) a1->m_maybeHasStopped = 0; p_m_fallSpeed = &a1->m_fallSpeed; if ( a1->m_isOnSlope ) goto LABEL_283; m_wasOnSlope = a1->m_wasOnSlope; if ( a1->m_wasOnSlope ) goto LABEL_283; v145 = a1->m_isUpsideDown; a1->m_collidingWithSlopeId = m_wasOnSlope; v146 = *p_m_yVelocity; if ( v145 ) { if ( v146 > 2.0 && *p_m_fallSpeed < 2.0 ) PlayerObject::gameEventTriggered(a1, 76, m_wasOnSlope); if ( *p_m_yVelocity > 7.0 && *p_m_fallSpeed < 7.0 ) PlayerObject::gameEventTriggered(a1, 77, 0); if ( *p_m_yVelocity <= 14.0 || *p_m_fallSpeed >= 14.0 ) goto LABEL_283; } else { if ( v146 < -2.0 && *p_m_fallSpeed > -2.0 ) PlayerObject::gameEventTriggered(a1, 76, 0); if ( *p_m_yVelocity < -7.0 && *p_m_fallSpeed > -7.0 ) PlayerObject::gameEventTriggered(a1, 77, 0); if ( *p_m_yVelocity >= -14.0 || *p_m_fallSpeed <= -14.0 ) goto LABEL_283; } PlayerObject::gameEventTriggered(a1, 78, 0); LABEL_283: *p_m_fallSpeed = *p_m_yVelocity; --a1->m_reverseRelated; }
GD Web Decomp Icon

GD Web Decomp

Raw Source