// // PlayerObject::collidedWithObjectInternal from 0x100221800 to 0x100223134 (6452 bytes) // // 4 xrefs: // > PlayerObject::collidedWithObject @ 0x100220234 // > PlayerObject::handleRotatedCollisionInternal @ 0x1002204bc // > PlayerObject::preSlopeCollision @ 0x1002234b0 // > PlayerObject::preSlopeCollision @ 0x100223570 // // 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 // // local variable allocation has failed, the output may be wrong! bool __fastcall PlayerObject::collidedWithObjectInternal( PlayerObject *a1, float a2, GameObject *a3, cocos2d::CCRect a4, bool a5) { char v5; // w3 char v6; // w26 __int64 v7; // x23 _BOOL4 m_holdingLeft; // w10 _BOOL4 m_holdingRight; // w8 int v13; // w11 GameObject *v14; // x20 __int64 v15; // x0 double v16; // d0 _BOOL4 m_isPlatformer; // w8 double v18; // d0 double v19; // d1 int v20; // w9 double v21; // d9 _BOOL4 m_isPassable; // w27 bool v23; // zf int v24; // w9 __int64 *LastPosition; // x0 float v26; // s0 float *v27; // x8 float v28; // s10 float *v29; // x8 float v30; // s8 __int64 v31; // x22 float v32; // s11 float v33; // s0 _BOOL4 v34; // w24 int v35; // w25 int v36; // w23 float v37; // s1 float v38; // s1 float v39; // s0 double v40; // d0 float v41; // s0 float v42; // s1 double v43; // d2 double v44; // d1 _BOOL4 v45; // w8 float v46; // s0 _BOOL4 m_isSideways; // w22 float *v48; // x0 float v49; // s0 float x; // s1 float v51; // s10 float v52; // s8 float v53; // s11 float v54; // s13 float v55; // s12 float v56; // s1 bool v57; // w22 double v58; // d12 _BOOL4 v59; // w24 bool m_wasOnSlope; // w28 int v61; // w25 int v62; // w26 int v63; // w22 std::__compressed_pair, void *> *>> *p_p1; // x27 GameObject *next; // x23 __int64 v66; // x0 float v67; // s15 float *v68; // x0 float v69; // s15 double v70; // d0 double v71; // d15 _BOOL4 v72; // w0 double v73; // d0 double v74; // d10 double v75; // d13 _BOOL4 v76; // w28 double v77; // d14 __n128 v78; // q0 int v79; // w23 int v80; // w24 double v81; // d8 double v82; // d9 int v83; // w11 _BOOL4 m_isUpsideDown; // w8 double v85; // d1 bool v86; // cc double m_yVelocity; // d10 GJBaseGameLayer *m_gameLayer; // x0 __n128 v89; // q0 __n128 v90; // q1 char v91; // w25 bool v92; // w26 bool m_isSwing; // w8 bool v94; // w22 bool v95; // w23 double v96; // d8 int v97; // w22 _BOOL4 v98; // w8 int v99; // w23 double v100; // d1 int m_uniqueID; // w9 double v102; // d8 GJBaseGameLayer *v103; // x0 __n128 v104; // q0 __n128 v105; // q1 __int64 *v106; // x0 float v107; // s0 float v108; // s9 float v109; // s10 float v110; // s11 float v111; // s12 __int64 *v112; // x0 float v113; // s0 _BOOL4 v114; // w26 __int64 v115; // x0 __int64 v116; // x8 float v117; // s8 float *v118; // x9 float v119; // s13 float *v120; // x9 float v121; // s14 float v122; // s0 double v123; // d8 _BOOL4 v124; // w23 _BOOL4 v125; // w25 __n128 v126; // q0 __n128 v127; // q1 bool v128; // w8 __int64 v129; // x0 float v130; // s2 double v131; // d9 double v132; // d10 _BOOL4 v133; // w26 bool v134; // cc float v135; // s10 __n128 v136; // q1 __n128 v137; // q0 DashRingObject *m_dashRing; // x8 float v139; // s10 __n128 v140; // q1 __n128 v141; // q0 DashRingObject *v142; // x8 double m_lastFlipTime; // d0 __n128 v144; // q0 __n128 v145; // q1 float v146; // s2 float v147; // s8 double m_lastSpiderFlipTime; // d0 __n128 v150; // q0 __n128 v151; // q1 bool v152; // w8 __n128 v153; // q0 __n128 v154; // q1 bool v155; // w8 float v156; // s0 int v157; // w8 bool v158; // w9 double m_groundYVelocity; // d0 double v160; // d1 GJBaseGameLayer *v161; // x0 GameManager *v162; // x0 double v163; // d1 double v164; // d0 double v165; // d0 double v166; // d1 __n128 v167; // q0 __n128 v168; // q1 bool v169; // w8 double v170; // d1 double v171; // d0 double v172; // d0 double v173; // d1 bool v174; // w22 bool v175; // w23 double v176; // d9 double v177; // d0 double v178; // d0 double v179; // d1 GJBaseGameLayer *v180; // x0 float v181; // s10 bool m_isOnGround; // w22 bool m_isOnGround2; // w23 double m_lastLandTime; // d11 double v185; // d0 double v186; // d1 double v187; // d1 GJBaseGameLayer *v188; // x0 float v189; // s1 float v190; // s2 float v191; // s3 int v192; // [xsp+0h] [xbp-160h] _BOOL4 v193; // [xsp+4h] [xbp-15Ch] bool v194; // [xsp+8h] [xbp-158h] int v195; // [xsp+Ch] [xbp-154h] float v196; // [xsp+10h] [xbp-150h] float v197; // [xsp+14h] [xbp-14Ch] float v198; // [xsp+18h] [xbp-148h] _BOOL4 v199; // [xsp+1Ch] [xbp-144h] double v200; // [xsp+20h] [xbp-140h] float v201; // [xsp+2Ch] [xbp-134h] int v202; // [xsp+30h] [xbp-130h] float v203; // [xsp+34h] [xbp-12Ch] double v204; // [xsp+38h] [xbp-128h] bool v205; // [xsp+40h] [xbp-120h] bool v206; // [xsp+40h] [xbp-120h] char v207; // [xsp+44h] [xbp-11Ch] float v208; // [xsp+48h] [xbp-118h] float v209; // [xsp+4Ch] [xbp-114h] int v210; // [xsp+50h] [xbp-110h] float v211; // [xsp+54h] [xbp-10Ch] float v212; // [xsp+58h] [xbp-108h] float v213; // [xsp+5Ch] [xbp-104h] int v214; // [xsp+60h] [xbp-100h] float v215; // [xsp+64h] [xbp-FCh] double v216; // [xsp+68h] [xbp-F8h] double v217; // [xsp+70h] [xbp-F0h] float v218; // [xsp+78h] [xbp-E8h] float v219; // [xsp+7Ch] [xbp-E4h] __int64 v220[2]; // [xsp+80h] [xbp-E0h] BYREF __int64 v221[2]; // [xsp+90h] [xbp-D0h] BYREF __int64 v222; // [xsp+A0h] [xbp-C0h] BYREF __int64 v223; // [xsp+A8h] [xbp-B8h] BYREF float v224; // [xsp+B0h] [xbp-B0h] __int64 v225; // [xsp+B8h] [xbp-A8h] BYREF float v226; // [xsp+C0h] [xbp-A0h] float v227; // [xsp+C4h] [xbp-9Ch] cocos2d::CCRect v228; // 0:kr20_16.16 v6 = v5; v7 = a5; m_holdingLeft = a1->m_holdingLeft; m_holdingRight = a1->m_holdingRight; v13 = !m_holdingLeft && m_holdingRight; if ( m_holdingLeft && m_holdingRight ) { m_holdingLeft = a1->m_leftPressedFirst; v13 = !m_holdingLeft; } v195 = v13; v199 = m_holdingLeft; if ( sub_100022BC4((float *)a5, flt_10086CC00) ) v14 = a3; else v14 = nullptr; v15 = ((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1); v16 = sub_100022B98(&v225, v15); if ( v14 ) v7 = ((__int64 (__fastcall *)(GameObject *, double))v14->getObjectRect)(v14, v16); sub_100022B98(&v223, v7); m_isPlatformer = a1->m_isPlatformer; v18 = 10.0; if ( m_isPlatformer && !a1->m_wasOnSlope ) { v18 = 5.0; if ( a1->m_isOnSlope ) v18 = 10.0; } v19 = 15.0; if ( a1->m_stateScale <= 0 ) v19 = v18; if ( a1->m_isUpsideDown ) v20 = -1; else v20 = 1; v200 = v19; v21 = v19 * (double)v20; if ( a1->m_isShip || a1->m_isBird || a1->m_isDart ) { if ( m_isPlatformer ) goto LABEL_23; goto LABEL_22; } if ( !m_isPlatformer && a1->m_isSwing ) LABEL_22: v21 = (float)(6 * v20); LABEL_23: if ( a1->m_wasOnSlope ) v21 = v21 + a1->unk_584 * (double)v20; if ( v14 ) m_isPassable = v14->m_isPassable; else m_isPassable = 0; v23 = a2 <= 0.0 || a3 == nullptr; v24 = !v23; v210 = v24; if ( v23 ) { v34 = 0; v35 = 1; v204 = 0.0; v36 = 1; } else { LastPosition = (__int64 *)GameObject::getLastPosition(a3); v26 = sub_1000229B8(v221, LastPosition); ((void (__fastcall *)(__int64 *__return_ptr, GameObject *, float))a3->getRealPosition)(v220, a3, v26); if ( a1->m_isSideways ) v27 = (float *)v221; else v27 = (float *)v221 + 1; v28 = *v27; v29 = (float *)v220 + 1; if ( a1->m_isSideways ) v29 = (float *)v220; v30 = *v29; if ( a1->m_isSideways ) v31 = 0; else v31 = 4; v32 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + v31); if ( a1->m_isSideways ) { GameObject::getScalePosDelta(a3); v33 = *(float *)&v222; } else { GameObject::getScalePosDelta(a3); v33 = *((float *)&v222 + 1); } v37 = -v33; if ( v32 < v30 ) v37 = v33; v38 = v28 + v37; if ( v33 == 0.0 ) v39 = v28; else v39 = v38; if ( *(float *)v220 == *(float *)v221 && *((float *)v220 + 1) == *((float *)v221 + 1) ) { v34 = 0; v35 = 1; v40 = 0.0; v36 = 1; } else if ( (a1->m_isUpsideDown || v39 >= v30) && (!a1->m_isUpsideDown || v39 <= v30) ) { v34 = 0; if ( a1->m_isUpsideDown ) v45 = v39 < v30; else v45 = v39 > v30; v35 = !v45; v36 = 1; v40 = 0.0; } else { v41 = (float)(v30 - v39) / a2; v42 = fabsf(v41); v43 = v42; v34 = v42 > 5.0; v44 = 1.0; if ( a1->m_isUpsideDown ) v44 = -1.0; v21 = v21 + v43 * v44; v40 = v41; v36 = 0; if ( !a1->m_isPlatformer ) a1->m_groundYVelocity = v40; v35 = 1; } v204 = v40; LOBYTE(m_isPlatformer) = a1->m_isPlatformer; } v46 = 0.0; if ( m_isPlatformer ) v46 = 5.0; v215 = v46; v214 = (a1->m_stateHitHead > 0 || m_isPlatformer || a1->m_stateFlipGravity >= 1) && !m_isPassable; m_isSideways = a1->m_isSideways; v48 = (float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v203 = a2; if ( m_isSideways ) { v49 = *v48; x = a1->m_lastPosition.x; } else { v49 = v48[1]; x = a1->m_lastPosition.y; } v51 = v49 - x; ((void (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v52 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); v53 = v227; v54 = 1.0; if ( a1->m_isUpsideDown ) v55 = -1.0; else v55 = 1.0; v56 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); v212 = v227; v213 = v56; if ( !a1->m_isUpsideDown ) v54 = -1.0; ((void (__fastcall *)(PlayerObject *))a1->getPosition)(a1); if ( a1->m_isUpsideDown || v51 <= 0.0 ) v57 = v51 >= 0.0 || !a1->m_isUpsideDown; else v57 = 0; v196 = sub_100022C40((__int64)&v223); v201 = sub_100022C30((float *)&v223); v208 = sub_100022C48((__int64)&v223); v217 = v208; v209 = sub_100022C58((__int64)&v223); v216 = v209; v197 = v224; v198 = *(float *)&v223; if ( a1->m_isDart && a1->m_stateDartSlide < 1 ) { v80 = 0; goto LABEL_245; } v58 = (float)(v52 + (float)((float)(v53 * -0.5) * v55)); v202 = v36; v192 = v35; v193 = v34; v205 = v57; v207 = v6; v211 = v54; if ( a1->m_isOnSlope ) { v59 = m_isPassable; m_wasOnSlope = 1; LABEL_101: v61 = 0; v62 = 0; v63 = 0; p_p1 = &a1->m_potentialSlopeMap.__table_.__p1_; while ( 1 ) { p_p1 = (std::__compressed_pair, void *> *>> *)p_p1->__value_.__next_; if ( !p_p1 ) { LABEL_124: m_isPassable = v59; goto LABEL_125; } next = (GameObject *)p_p1[3].__value_.__next_; if ( !m_wasOnSlope && next != a1->m_currentSlope ) { v66 = ((__int64 (__fastcall *)(std::__hash_node_base, void *> *>::__next_pointer))next->getObjectRect)(p_p1[3].__value_.__next_); v67 = sub_100022C40(v66); if ( v67 >= *(float *)((__int64 (__fastcall *)(GameObject *))v14->getPosition)(v14) ) goto LABEL_119; v68 = (float *)((__int64 (__fastcall *)(GameObject *))next->getObjectRect)(next); v69 = sub_100022C30(v68); if ( v69 <= *(float *)((__int64 (__fastcall *)(GameObject *))v14->getPosition)(v14) ) goto LABEL_119; } ((void (__fastcall *)(__int64 *__return_ptr, GameObject *, float, float))next->getObjectRect_0)( v221, next, 1.2, 1.1); if ( !sub_100022CB0((float *)&v223, (float *)v221) ) goto LABEL_119; ((void (__fastcall *)(__int64 *__return_ptr, GameObject *, float, float))next->getObjectRect_0)( v220, next, 1.2, 1.1); if ( !sub_100022CB0((float *)&v225, (float *)v220) ) goto LABEL_119; v70 = sub_100022B98(v221, (__int64)&v223); v228.origin.x = *(float *)&v70; v228.origin.y = v189; v228.size.width = v190; v228.size.height = v191; v71 = GameObject::slopeYPos_1(next, v228); v72 = GameObject::slopeFloorTop(next); v73 = v71 + -2.0; if ( v71 + 2.0 >= v217 ) { if ( v72 ) { v63 |= a1->m_currentSlope == next; if ( v73 > v216 ) goto LABEL_118; goto LABEL_122; } v63 = 1; if ( v73 > v216 ) goto LABEL_118; LABEL_117: if ( a1->m_currentSlope != next ) goto LABEL_118; LABEL_122: v61 = 1; v62 = 1; if ( (v63 & 1) != 0 ) goto LABEL_120; } else { if ( v73 <= v216 ) { if ( v72 ) goto LABEL_122; goto LABEL_117; } LABEL_118: v61 = 1; LABEL_119: if ( (v63 & 1) != 0 ) { LABEL_120: if ( (v62 & 1) != 0 ) { v62 = 1; v63 = 1; goto LABEL_124; } } } } } if ( a1->m_wasOnSlope || a1->m_potentialSlopeMap.__table_.__p2_.__value_ ) { v59 = m_isPassable; if ( v14 ) m_wasOnSlope = a1->m_wasOnSlope; else m_wasOnSlope = 1; goto LABEL_101; } v62 = 0; v63 = 0; v61 = 0; LABEL_125: v74 = v51; v75 = v21 + v58; if ( v14 ) v76 = ((__int64 (__fastcall *)(GameObject *))v14->getType)(v14) == 21; else v76 = 0; v77 = v75 - v74; sub_100022990((float *)v221, (float)(v215 * 0.5) + *(float *)&v225, *((float *)&v225 + 1), v226 - v215, v227); if ( a1->m_isShip || a1->m_isBird ) { v194 = 0; if ( a1->m_isUpsideDown ) goto LABEL_131; } else { v194 = !a1->m_isDart && !a1->m_isSwing && !a1->m_isBall && !a1->m_isRobot && !a1->m_isSpider; if ( a1->m_isUpsideDown ) { if ( !a1->m_isDart && !a1->m_isSwing && !a1->m_isBall ) { v79 = 0; goto LABEL_132; } LABEL_131: v79 = !m_isPassable; LABEL_132: if ( v75 >= v217 || v77 >= v217 ) goto LABEL_148; LABEL_147: v80 = 0; v206 = 0; goto LABEL_152; } } v79 = 1; if ( v75 > v216 && v77 > v216 ) goto LABEL_147; LABEL_148: v206 = !v205 && a1->m_isPlatformer && v76 && !a1->m_maybeTouchedBreakableBlock; v80 = 1; LABEL_152: if ( !a1->m_isPlatformer ) goto LABEL_164; if ( a1->m_isOnSlope || a1->m_wasOnSlope ) { if ( v80 ) { if ( a1->m_maybeUpsideDownSlope ) goto LABEL_162; goto LABEL_161; } if ( a1->m_maybeUpsideDownSlope ) LABEL_161: v61 = 0; } LABEL_162: if ( (v207 & 1) == 0 && !sub_100022CB0((float *)v221, (float *)&v223) ) goto LABEL_245; LABEL_164: v81 = (float)(v213 + (float)((float)(v212 * -0.5) * v211)) - v21; v82 = v81 - v74; v83 = v214; if ( ((v79 | v214) & 1) == 0 || (!(m_isUpsideDown = a1->m_isUpsideDown) ? (v78.n128_f64[0] = v75 - v74) : (v78.n128_f64[0] = v81 - v74), !a1->m_isUpsideDown ? (v85 = v75) : (v85 = v81), v85 < v217 ? (v86 = v78.n128_f64[0] < v217) : (v86 = 0), v86) ) { v97 = 1; goto LABEL_194; } if ( a1->m_isUpsideDown && a1->m_isBird && v76 && !a1->m_isPlatformer ) { ((void (__fastcall *)(__int64 *__return_ptr, PlayerObject *, float, float))a1->getObjectRect_0)(v220, a1, 0.3, 0.3); if ( sub_100022CB0((float *)&v223, (float *)v220) ) goto LABEL_369; LABEL_446: v97 = 0; v83 = v214; goto LABEL_194; } m_yVelocity = a1->m_yVelocity; if ( (m_yVelocity <= 0.0 || a1->m_wasOnSlope || v193) && (v63 & v61 & 1) == 0 ) { if ( v80 ) { v78.n128_f64[0] = -m_yVelocity; if ( !a1->m_isUpsideDown ) v78.n128_u64[0] = *(_QWORD *)&a1->m_yVelocity; if ( v78.n128_f64[0] > 0.0 ) { m_gameLayer = a1->m_gameLayer; if ( m_gameLayer ) GJBaseGameLayer::gameEventTriggered(m_gameLayer, HitHead, 0, a1->m_uniqueID); } } v89.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *, __n128))a1->getPosition)(a1, v78); v90.n128_f32[0] = v208 + (float)(v227 * 0.5); sub_100022980(v89, v90, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); v91 = v202; v92 = v194; if ( v194 ) PlayerObject::checkSnapJumpToObject(a1, v14); if ( v79 & 1 | ((v214 & 1) == 0) ) { if ( !a1->m_isUpsideDown ) goto LABEL_191; goto LABEL_240; } a1->m_yVelocity = 0.0; goto LABEL_337; } if ( ((v202 | v80 | m_isUpsideDown) & 1) != 0 ) { if ( ((v192 | v80 & m_isUpsideDown ^ 1) & 1) != 0 ) { v97 = 0; goto LABEL_194; } v167.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *, __n128))a1->getPosition)(a1, v78); v168.n128_f32[0] = v208 + (float)(v227 * 0.5); sub_100022980(v167, v168, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); if ( a1->m_isUpsideDown ) v169 = a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing; else v169 = 0; v181 = m_yVelocity; m_isOnGround = a1->m_isOnGround; m_isOnGround2 = a1->m_isOnGround2; m_lastLandTime = a1->m_lastLandTime; PlayerObject::hitGround(a1, nullptr, v169); a1->m_isOnGround = m_isOnGround; a1->m_isOnGround2 = m_isOnGround2; a1->m_lastLandTime = m_lastLandTime; if ( !v76 && !m_isPassable ) PlayerObject::updateCollideTop(a1, v208, v14); v185 = v181; v186 = (double)(int)v181; if ( v186 != v181 ) v185 = round((v185 - v186) * 1000.0) / 1000.0 + v186; if ( v185 < a1->m_groundYVelocity + 1.0 ) v185 = a1->m_groundYVelocity + 1.0; v187 = (double)(int)v185; if ( v185 != v187 ) v185 = round((v185 - v187) * 1000.0) / 1000.0 + v187; a1->m_yVelocity = v185; PlayerObject::didHitHead(a1); if ( v206 ) { a1->m_maybeTouchedBreakableBlock = 1; v188 = a1->m_gameLayer; if ( v188 ) GJBaseGameLayer::destroyObject(v188, v14); else GameObject::destroyObject(v14); } goto LABEL_446; } v153.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *, __n128))a1->getPosition)(a1, v78); v154.n128_f32[0] = v208 + (float)(v227 * 0.5); sub_100022980(v153, v154, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); if ( a1->m_isUpsideDown ) v155 = a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing; else v155 = 0; PlayerObject::hitGround(a1, v14, v155); PlayerObject::updateCollideBottom(a1, v208, v14); v170 = v204; v83 = v214; if ( a3 ) { a1->m_lastGroundObject = a3; if ( a3->m_isDontBoostY ) a1->m_stateBoostX = 2; if ( a3->m_isDontBoostX ) a1->m_stateBoostY = 2; } a1->m_groundYVelocity = v204; v171 = (double)(int)m_yVelocity; if ( m_yVelocity != v171 ) { m_yVelocity = round((m_yVelocity - v171) * 1000.0) / 1000.0 + v171; v170 = v204; } if ( m_yVelocity >= v170 ) v172 = m_yVelocity; else v172 = v170; v173 = (double)(int)v172; if ( v172 != v173 ) v172 = round((v172 - v173) * 1000.0) / 1000.0 + v173; v97 = 0; a1->m_yVelocity = v172; LABEL_194: v98 = a1->m_isUpsideDown; if ( v98 ) v99 = 1; else v99 = (a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing || a1->m_isBall) && !m_isPassable; if ( (v97 & (v99 | v83)) != 1 ) goto LABEL_246; if ( a1->m_isUpsideDown ) v78.n128_f64[0] = v77; else v78.n128_f64[0] = v82; if ( a1->m_isUpsideDown ) v100 = v75; else v100 = v81; if ( v14 ) m_uniqueID = v14->m_uniqueID; else m_uniqueID = 0; if ( v100 <= v216 || v78.n128_f64[0] <= v216 ) { if ( v98 ) goto LABEL_225; goto LABEL_223; } if ( a1->m_isUpsideDown ) { if ( m_uniqueID != a1->m_unk50C ) goto LABEL_245; goto LABEL_225; } if ( m_uniqueID != a1->m_unk510 ) { LABEL_245: v97 = 1; goto LABEL_246; } LABEL_223: if ( a1->m_isBird && v76 && !a1->m_isPlatformer ) { ((void (__fastcall *)(__int64 *__return_ptr, PlayerObject *, float, float))a1->getObjectRect_0)(v220, a1, 0.3, 0.3); if ( sub_100022CB0((float *)&v223, (float *)v220) ) goto LABEL_369; goto LABEL_444; } LABEL_225: v102 = a1->m_yVelocity; if ( v102 >= 0.0 || a1->m_isPlatformer && (v78.n128_u64[0] = *(_QWORD *)&a1->m_yVelocityRelated, v78.n128_f64[0] > 0.0) || a1->m_wasOnSlope || v193 ) { if ( (v61 & v62 & 1) == 0 ) { if ( v80 ) { v78.n128_f64[0] = -v102; if ( !a1->m_isUpsideDown ) v78.n128_u64[0] = *(_QWORD *)&a1->m_yVelocity; if ( v78.n128_f64[0] > 0.0 ) { v103 = a1->m_gameLayer; if ( v103 ) GJBaseGameLayer::gameEventTriggered(v103, HitHead, 0, a1->m_uniqueID); } } v104.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *, __n128))a1->getPosition)(a1, v78); v105.n128_f32[0] = v209 + (float)(v227 * -0.5); sub_100022980(v104, v105, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); v92 = v194; if ( v194 ) PlayerObject::checkSnapJumpToObject(a1, v14); if ( v99 & 1 | ((v214 & 1) == 0) ) { v91 = v202; if ( a1->m_isUpsideDown ) { LABEL_191: m_isSwing = 0; if ( v80 ) { LABEL_192: v94 = a1->m_isOnGround; v95 = a1->m_isOnGround2; v96 = a1->m_lastLandTime; PlayerObject::hitGround(a1, nullptr, m_isSwing); a1->m_isOnGround = v94; a1->m_isOnGround2 = v95; a1->m_lastLandTime = v96; goto LABEL_337; } goto LABEL_244; } LABEL_240: if ( a1->m_isShip || a1->m_isBird || a1->m_isDart ) { m_isSwing = 1; if ( v80 ) goto LABEL_192; } else { m_isSwing = a1->m_isSwing; if ( v80 ) goto LABEL_192; } LABEL_244: PlayerObject::hitGround(a1, v14, m_isSwing); goto LABEL_337; } a1->m_yVelocity = 0.0; v91 = v202; LABEL_337: if ( a1->m_isUpsideDown ) { v156 = v208; if ( (((unsigned __int8)v80 ^ 1 | (v76 || m_isPassable)) & 1) != 0 ) { v208 = v209; goto LABEL_341; } } else { v156 = v209; if ( (((unsigned __int8)v80 ^ 1 | (v76 || m_isPassable)) & 1) != 0 ) { LABEL_341: if ( (v80 & 1) == 0 ) { PlayerObject::updateCollideBottom(a1, v208, v14); goto LABEL_348; } goto LABEL_344; } } PlayerObject::updateCollideTop(a1, v156, v14); if ( (v80 & 1) == 0 ) { LABEL_348: if ( a3 ) { a1->m_lastGroundObject = a3; if ( a3->m_isDontBoostY ) a1->m_stateBoostX = 2; if ( a3->m_isDontBoostX ) a1->m_stateBoostY = 2; } v157 = 0; a1->m_groundYVelocity = v204; if ( !v92 ) goto LABEL_357; goto LABEL_354; } LABEL_344: if ( a1->m_isPlatformer ) PlayerObject::exitPlatformerAnimateJump(a1); v157 = 1; if ( !v92 ) goto LABEL_357; LABEL_354: if ( a1->m_stateNoAutoJump >= 1 && a1->m_padRingRelated ) a1->m_jumpBuffered = 0; LABEL_357: v158 = !a1->m_isShip && !a1->m_isBird && !a1->m_isDart && !a1->m_isSwing; if ( !(v91 & 1 | (v158 || (v157 & 1) == 0)) ) { m_groundYVelocity = a1->m_groundYVelocity; v160 = (double)(int)m_groundYVelocity; if ( m_groundYVelocity != v160 ) m_groundYVelocity = round((m_groundYVelocity - v160) * 1000.0) / 1000.0 + v160; a1->m_yVelocity = m_groundYVelocity; } if ( v157 ) PlayerObject::didHitHead(a1); if ( !v206 ) return 1; a1->m_maybeTouchedBreakableBlock = 1; goto LABEL_369; } } if ( ((v202 | v80 | !v98) & 1) != 0 ) { if ( ((v192 | v80 ^ 1 | v98) & 1) == 0 ) { v126.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *, __n128))a1->getPosition)(a1, v78); v127.n128_f32[0] = v209 + (float)(v227 * -0.5); sub_100022980(v126, v127, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); if ( a1->m_isUpsideDown ) v128 = a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing; else v128 = 0; v174 = a1->m_isOnGround; v175 = a1->m_isOnGround2; v176 = a1->m_lastLandTime; PlayerObject::hitGround(a1, nullptr, v128); a1->m_isOnGround = v174; a1->m_isOnGround2 = v175; a1->m_lastLandTime = v176; if ( !v76 && !m_isPassable ) PlayerObject::updateCollideTop(a1, v209, v14); v177 = (double)(int)v102; if ( v102 != v177 ) v102 = round((v102 - v177) * 1000.0) / 1000.0 + v177; v178 = a1->m_groundYVelocity + -1.0; if ( v102 <= v178 ) v178 = v102; v179 = (double)(int)v178; if ( v178 != v179 ) v178 = round((v178 - v179) * 1000.0) / 1000.0 + v179; a1->m_yVelocity = v178; PlayerObject::didHitHead(a1); if ( v206 ) { a1->m_maybeTouchedBreakableBlock = 1; v180 = a1->m_gameLayer; if ( v180 ) GJBaseGameLayer::destroyObject(v180, v14); else GameObject::destroyObject(v14); } } LABEL_444: v97 = 0; goto LABEL_246; } v150.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *, __n128))a1->getPosition)(a1, v78); v151.n128_f32[0] = v209 + (float)(v227 * -0.5); sub_100022980(v150, v151, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); if ( a1->m_isUpsideDown ) v152 = a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing; else v152 = 0; PlayerObject::hitGround(a1, v14, v152); PlayerObject::updateCollideBottom(a1, v209, v14); v163 = v204; if ( a3 ) { a1->m_lastGroundObject = a3; if ( a3->m_isDontBoostY ) a1->m_stateBoostX = 2; if ( a3->m_isDontBoostX ) a1->m_stateBoostY = 2; } a1->m_groundYVelocity = v204; v164 = (double)(int)v102; if ( v102 != v164 ) { v102 = round((v102 - v164) * 1000.0) / 1000.0 + v164; v163 = v204; } if ( v102 <= v163 ) v165 = v102; else v165 = v163; v166 = (double)(int)v165; if ( v165 != v166 ) v165 = round((v165 - v166) * 1000.0) / 1000.0 + v166; v80 = 0; v97 = 0; a1->m_yVelocity = v165; LABEL_246: if ( a1->m_isPlatformer ) { v106 = (__int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v107 = sub_1000229B8(v220, v106); ((void (__fastcall *)(PlayerObject *, float))a1->getPosition)(a1, v107); ((void (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v108 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); v109 = v227; v110 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); v111 = v227; if ( v210 ) { v112 = (__int64 *)GameObject::getLastPosition(a3); v113 = sub_1000229B8(v221, v112); ((void (__fastcall *)(__int64 *__return_ptr, GameObject *, float))a3->getRealPosition)(&v222, a3, v113); v114 = a1->m_isSideways; v115 = ((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v116 = 4; if ( v114 ) v116 = 0; v117 = *(float *)(v115 + v116); v118 = (float *)v221 + 1; if ( !a1->m_isSideways ) v118 = (float *)v221; v119 = *v118; v120 = (float *)&v222 + 1; if ( !a1->m_isSideways ) v120 = (float *)&v222; v121 = *v120; if ( a1->m_isSideways ) { GameObject::getScalePosDelta(a3); v122 = v219; } else { GameObject::getScalePosDelta(a3); v122 = v218; } v124 = (float)((float)(v121 - v119) + v122) >= 0.0; v125 = (float)(v121 - v119) <= v122; if ( v117 >= v121 ) v122 = -v122; v123 = (float)((float)(v121 - (float)(v119 + v122)) / v203); } else { v123 = 0.0; v124 = 1; v125 = 1; } if ( a1->m_isOnSlope || a1->m_wasOnSlope || a1->m_totalTime - a1->m_slopeEndTime < 0.200000003 ) { v129 = ((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v130 = 1.0; if ( a1->m_isUpsideDown ) v130 = -1.0; v131 = (float)(*(float *)(v129 + 4) + (float)((float)(v227 * 0.5) * v130)); v132 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); } else { v131 = (float)(v108 + (float)(v109 * 0.5)) - v200; v132 = v200 + (float)(v110 - (float)(v111 * 0.5)); } if ( a3 ) { v133 = a1->m_collidingWithLeft == a3; LODWORD(a3) = a1->m_collidingWithRight == a3; } else { v133 = 0; } sub_100022990((float *)v221, *(float *)&v225, (float)(v215 * 0.5) + *((float *)&v225 + 1), v226, v227 - v215); if ( !m_isPassable && ((sub_100022CB0((float *)v221, (float *)&v223) | v133 | (unsigned int)a3) & 1) != 0 ) { v134 = v131 >= v217 || v131 <= v216; if ( !v134 || v132 < v217 && v132 > v216 ) { a1->m_scaleXRelated4 = v123; if ( !v133 && (*(float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) <= (float)(v198 + (float)(v197 * 0.5))) | (unsigned __int8)a3 & 1 ) { PlayerObject::updateCollideRight(a1, v196, v14); v135 = v196 + (float)(v226 * -0.5); v136.n128_u32[0] = *(_DWORD *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); v137.n128_f32[0] = v135; sub_100022980(v137, v136, &v222); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, &v222); if ( a1->m_platformerXVelocity > 0.0 && ((v195 ^ 1 | v125) & 1) != 0 ) a1->m_platformerXVelocity = 0.0; if ( a1->m_isDashing ) { m_dashRing = a1->m_dashRing; if ( !m_dashRing || !m_dashRing->m_allowCollide ) { PlayerObject::stopDashing(a1); a1->m_jumpBuffered = 0; } } if ( !a1->m_platformerMovingRight ) goto LABEL_307; LABEL_306: a1->m_maybeSlidingTime = 0; goto LABEL_307; } PlayerObject::updateCollideLeft(a1, v201, v14); v139 = v201 + (float)(v226 * 0.5); v140.n128_u32[0] = *(_DWORD *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4); v141.n128_f32[0] = v139; sub_100022980(v141, v140, &v222); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, &v222); if ( a1->m_platformerXVelocity < 0.0 && (!v199 || v124) ) a1->m_platformerXVelocity = 0.0; if ( a1->m_isDashing ) { v142 = a1->m_dashRing; if ( !v142 || !v142->m_allowCollide ) { PlayerObject::stopDashing(a1); a1->m_jumpBuffered = 0; } } if ( a1->m_platformerMovingLeft ) goto LABEL_306; } } } LABEL_307: if ( !v97 ) return 0; if ( a1->m_isPlatformer || m_isPassable ) return 0; ((void (__fastcall *)(__int64 *__return_ptr, PlayerObject *, float, float))a1->getObjectRect_0)(v221, a1, 0.3, 0.3); if ( !sub_100022CB0((float *)&v223, (float *)v221) ) return 0; if ( v80 ) { m_lastFlipTime = a1->m_lastFlipTime; if ( m_lastFlipTime != 0.0 && a1->m_totalTime - m_lastFlipTime < 0.100000001 ) { if ( a1->m_isUpsideDown ) { v144.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v145.n128_f32[0] = v227 * 0.5; v146 = v208; } else { v144.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1); v145.n128_f32[0] = v227 * -0.5; v146 = v209; } v145.n128_f32[0] = v146 + v145.n128_f32[0]; sub_100022980(v144, v145, v220); ((void (__fastcall *)(PlayerObject *, __int64 *))a1->setPosition)(a1, v220); PlayerObject::hitGround(a1, v14, 1); a1->m_isOnGround2 = 0; return 1; } } if ( a1->m_isSpider ) { v147 = sub_100022C30((float *)&v223); if ( v147 < sub_100022C30((float *)v221) ) { m_lastSpiderFlipTime = a1->m_lastSpiderFlipTime; if ( m_lastSpiderFlipTime != 0.0 && a1->m_totalTime - m_lastSpiderFlipTime < 0.0399999991 ) return 1; } } if ( v14 && ((unsigned int (__fastcall *)(GameObject *))v14->getType)(v14) == 21 ) { LABEL_369: v161 = a1->m_gameLayer; if ( v161 ) GJBaseGameLayer::destroyObject(v161, v14); else GameObject::destroyObject(v14); return 1; } if ( a1->m_maybeCanRunIntoBlocks ) { if ( a1->m_ignoreDamage ) return 0; a1->m_maybeIsColliding = 1; } else { v162 = GameManager::sharedState(); ((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v162->m_playLayer->destroyPlayer)( v162->m_playLayer, a1, 0); } return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source