// // PlayerObject::spiderTestJumpX from 0x636864 to 0x637328 (2756 bytes) // // 1 xrefs: // > @ 0x4c9c8 // // 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::spiderTestJumpX(PlayerObject *a1, bool a2) { _BOOL4 v2; // w27 GJBaseGameLayer *m_gameLayer; // x23 const cocos2d::CCRect *v5; // x0 float x; // s15 float v7; // s14 float v8; // s0 cocos2d::CCArray *v9; // x21 cocos2d::ccArray *data; // x1 cocos2d::CCObject **arr; // x0 size_t num; // x1 int (*v13)(const void *, const void *); // x3 cocos2d::ccArray *v14; // x1 cocos2d::CCObject **v15; // x0 size_t v16; // x1 int (*v17)(const void *, const void *); // x3 unsigned int v18; // w23 const cocos2d::CCPoint *v19; // x0 __int64 v20; // x0 __int64 v21; // x19 cocos2d::CCRect *v22; // x0 float v23; // s0 float v24; // s8 cocos2d::CCRect *v25; // x0 float v26; // s0 __int64 v27; // x0 const cocos2d::CCPoint *v28; // x0 int v29; // w0 _BOOL4 m_playEffects; // w0 GJBaseGameLayer *v31; // x0 cocos2d::CCRect *v32; // x0 float v33; // s0 unsigned int v34; // w19 __int64 v35; // x0 const cocos2d::CCRect *v36; // x0 cocos2d::CCRect *v37; // x0 float v38; // s0 _BOOL8 m_performanceMode; // x0 cocos2d::CCScaleTo *v40; // x0 cocos2d::CCEaseElasticOut *v41; // x0 cocos2d::CCActionInterval *v42; // x1 cocos2d::CCAction *v43; // x19 cocos2d::CCSprite *v44; // x21 long double v45; // q0 unsigned int v46; // w19 GameManager *v47; // x0 void (__fastcall *setScaleX)(cocos2d::CCSprite *__hidden, float); // x23 float v49; // s8 float *v50; // x0 void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x23 cocos2d::ccColor3B *v52; // x1 cocos2d::CCArray *v53; // x0 cocos2d::CCArray *v54; // x25 cocos2d::CCSpriteFrameCache *v55; // x20 const char *v56; // x1 cocos2d::CCString *v57; // x0 const char *CString; // x0 cocos2d::CCSpriteFrame *v59; // x0 cocos2d::CCAnimation *v60; // x0 cocos2d::CCSequence *v61; // x19 cocos2d::CCFiniteTimeAction *v62; // x0 cocos2d::CCAction *v63; // x0 int v64; // w19 __int64 v65; // x0 float v66; // s0 __int64 v67; // x0 __int64 v68; // x21 cocos2d::ccColor3B *p_m_playerColor2; // x2 __int64 v70; // x4 GLubyte r; // w5 GLubyte g; // w3 PlayLayer *m_playLayer; // x0 CCCircleWaveDelegate *v74; // x0 GameManager *v75; // x0 __int64 v76; // x0 __int64 v77; // x21 cocos2d::ccColor3B *p_m_playerColor1; // x2 __int64 v79; // x4 GLubyte v80; // w5 GLubyte v81; // w3 PlayLayer *v82; // x0 CCCircleWaveDelegate *v83; // x0 GameManager *v84; // x0 __int64 v85; // x0 __int64 v86; // x21 cocos2d::ccColor3B *v87; // x2 __int64 v88; // x4 GLubyte v89; // w5 GLubyte v90; // w3 PlayLayer *v91; // x0 CCCircleWaveDelegate *v92; // x0 GameManager *v93; // x0 cocos2d::CCArray *v94[2]; // [xsp+0h] [xbp+0h] BYREF cocos2d::CCArray *v95; // [xsp+A8h] [xbp+A8h] cocos2d::CCPoint v96; // [xsp+B0h] [xbp+B0h] BYREF cocos2d::CCRect v97; // [xsp+B8h] [xbp+B8h] BYREF cocos2d::CCRect v98; // [xsp+C8h] [xbp+C8h] BYREF cocos2d::CCRect v99; // [xsp+D8h] [xbp+D8h] BYREF cocos2d::CCRect v100; // [xsp+E8h] [xbp+E8h] BYREF cocos2d::CCRect v101; // [xsp+F8h] [xbp+F8h] BYREF cocos2d::CCRect v102; // [xsp+108h] [xbp+108h] BYREF cocos2d::CCRect v103; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 cocos2d::CCRect v104; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 cocos2d::CCRect v105; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 v2 = a2; if ( !a1->m_isDead && !a1->m_isLocked && !a1->m_maybeReducedEffects ) { m_gameLayer = a1->m_gameLayer; v5 = a1->getObjectRect(a1); cocos2d::CCRect::CCRect(&v97, v5); cocos2d::CCRect::CCRect(&v98, &v97); x = a1->getPosition(a1)->x; v7 = a1->getPosition(a1)->x; if ( a1->m_isUpsideDown ) v8 = (float)(v98.size.width - 2.0) + v98.origin.x; else v8 = v98.origin.x - 2998.0; v98.origin.x = v8; v98.size.width = 3000.0; cocos2d::CCRect::CCRect(&v99, &v98); v99.size.height = v97.size.height; v99.origin.y = v97.origin.y; cocos2d::CCRect::CCRect(&v100, &v99); v99.size.height = a1->m_vehicleSize * 8.0; v98.origin.y = v98.origin.y + (float)(v97.size.height * 0.5); v99.origin.y = v99.origin.y + (float)((float)(v98.size.height - v99.size.height) * 0.5); v98.size.height = (float)(v97.size.height * 0.5) + 1.0; v100.size.height = v100.size.height + 4.0; cocos2d::CCRect::CCRect(&v102, &v98); v9 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v103, (unsigned __int8)v94 + 8); cocos2d::CCRect::CCRect(&v102, &v99); v95 = GJBaseGameLayer::damagingObjectsInRect(m_gameLayer, v104, (unsigned __int8)v94 + 8); if ( !(unsigned int)cocos2d::CCArray::count(v9) && (unsigned int)cocos2d::CCArray::count(v95) || v2 ) { v2 = 1; cocos2d::CCRect::CCRect(&v102, &v100); v9 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v105, (unsigned __int8)v94 + 8); } if ( (unsigned int)cocos2d::CCArray::count(v9) ) { data = v9->data; arr = data->arr; num = data->num; if ( a1->m_isUpsideDown ) v13 = (int (*)(const void *, const void *))boxCompMinX; else v13 = (int (*)(const void *, const void *))boxCompMaxX; qsort(arr, num, 8u, v13); } if ( (unsigned int)cocos2d::CCArray::count(v95) ) { v14 = v95->data; v15 = v14->arr; v16 = v14->num; if ( a1->m_isUpsideDown ) v17 = (int (*)(const void *, const void *))boxCompMinX; else v17 = (int (*)(const void *, const void *))boxCompMaxX; qsort(v15, v16, 8u, v17); } if ( (unsigned int)cocos2d::CCArray::count(v9) ) { v18 = 0; v19 = a1->getPosition(a1); cocos2d::CCPoint::CCPoint(&v96, v19); while ( 1 ) { if ( v18 >= (unsigned int)cocos2d::CCArray::count(v9) ) goto LABEL_64; v20 = cocos2d::CCArray::objectAtIndex(v9, v18); v21 = v20; if ( a1->m_isUpsideDown ) { v22 = (cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 1312LL))(v20); cocos2d::CCRect::getMinX(v22); v24 = v23 - (float)(v97.size.width * 0.5); } else { v32 = (cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 1312LL))(v20); cocos2d::CCRect::getMaxX(v32); v24 = v33 + (float)(v97.size.height * 0.5); } if ( a1->m_isUpsideDown ) { if ( v24 >= (float)(v96.x - 10.0) ) { LABEL_25: if ( a1->m_isGoingLeft ) goto LABEL_26; v37 = (cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 1312LL))(v21); cocos2d::CCRect::getMinY(v37); if ( v38 > v96.y ) goto LABEL_42; if ( a1->m_isGoingLeft ) { LABEL_26: v25 = (cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 1312LL))(v21); cocos2d::CCRect::getMaxY(v25); if ( v26 >= v96.y ) goto LABEL_27; LABEL_42: v34 = 0; cocos2d::CCRect::CCRect(&v101, &v97); v101.origin.x = v24 - (float)(v97.size.width * 0.5); while ( v34 < (unsigned int)cocos2d::CCArray::count(v9) ) { v35 = cocos2d::CCArray::objectAtIndex(v9, v34); if ( v18 != v34 ) { v36 = (const cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v35 + 1312LL))(v35); cocos2d::CCRect::CCRect(&v102, v36); v102.size.width = v102.size.width - 4.0; v102.origin.x = v102.origin.x + 2.0; if ( (unsigned __int8)cocos2d::CCRect::intersectsRect(&v102, &v101) ) goto LABEL_40; } ++v34; } } LABEL_27: if ( v24 == 0.0 ) goto LABEL_64; goto LABEL_28; } } else if ( v24 <= (float)(v96.x + 10.0) ) { goto LABEL_25; } LABEL_40: ++v18; } } if ( (unsigned int)cocos2d::CCArray::count(v95) ) { v65 = cocos2d::CCArray::objectAtIndex(v95, 0); (*(void (__fastcall **)(__int64))(*(_QWORD *)v65 + 1344LL))(v65); v24 = v102.origin.x; if ( v102.origin.x != 0.0 ) goto LABEL_32; v64 = 1; } else { LABEL_64: v64 = 0; } if ( a1->m_isUpsideDown ) { v24 = (float)(x + 3000.0) - (float)(v97.size.width * 0.5); if ( v64 ) goto LABEL_32; } else { v24 = (float)(v7 - 3000.0) + (float)(v97.size.width * 0.5); if ( v64 ) goto LABEL_32; } LABEL_28: if ( !(unsigned int)cocos2d::CCArray::count(v95) ) goto LABEL_32; v27 = cocos2d::CCArray::objectAtIndex(v95, 0); (*(void (__fastcall **)(__int64))(*(_QWORD *)v27 + 1344LL))(v27); if ( a1->m_isUpsideDown ) { if ( v24 <= v102.origin.x ) goto LABEL_32; } else if ( v24 >= v102.origin.x ) { goto LABEL_32; } v24 = v102.origin.x; if ( !v2 ) { PlayerObject::spiderTestJump(a1, 1); return; } LABEL_32: v28 = a1->getPosition(a1); cocos2d::CCPoint::CCPoint(&v96, v28); cocos2d::CCPoint::CCPoint(&v101.origin, v24, v96.y); a1->setPosition(a1, (const cocos2d::CCPoint *)&v101); PlayerObject::flipGravity(a1, !a1->m_isUpsideDown, 1); v29 = PlayerObject::flipMod(a1); PlayerObject::setYVelocity(a1, (double)-v29, 35); a1->m_isOnGround3 = 0; a1->m_jumpBuffered = 0; PlayerObject::resetCollisionLog(a1, 1); m_playEffects = a1->m_playEffects; a1->m_lastSpiderFlipTime = a1->m_totalTime; a1->m_position.x = v101.origin.x; if ( m_playEffects ) { if ( a1->m_isHidden ) { LABEL_34: v31 = a1->m_gameLayer; if ( v31 ) GJBaseGameLayer::checkCameraLimitAfterTeleport(v31, a1, 60.0); return; } v96.x = v96.x + (float)((float)PlayerObject::reverseMod(a1) * 7.5); v101.origin.x = v101.origin.x + (float)((float)PlayerObject::reverseMod(a1) * 7.5); m_performanceMode = GameManager::sharedState()->m_performanceMode; if ( !m_performanceMode ) { v66 = (float)(a1->m_vehicleSize * 10.0) * 1.3; v101.origin.x = v101.origin.x + 6.0; v67 = CCCircleWave::create((CCCircleWave *)m_performanceMode, v66, 1.0, 0.15, 0); v68 = v67; p_m_playerColor2 = &a1->m_playerColor2; v70 = *(_QWORD *)v67; if ( a1->m_swapColors ) p_m_playerColor2 = &a1->m_playerColor1; r = p_m_playerColor2->r; g = p_m_playerColor2->g; *(_BYTE *)(v67 + 342) = p_m_playerColor2->b; *(_BYTE *)(v67 + 340) = r; *(_BYTE *)(v67 + 341) = g; (*(void (**)(void))(v70 + 184))(); a1->m_parentLayer->addChild_0(a1->m_parentLayer, (cocos2d::CCNode *)v68, 0); m_playLayer = GameManager::sharedState()->m_playLayer; if ( m_playLayer ) v74 = &m_playLayer->CCCircleWaveDelegate; else v74 = nullptr; *(_QWORD *)(v68 + 368) = v74; v75 = GameManager::sharedState(); PlayLayer::addCircle(v75->m_playLayer, (CCCircleWave *)v68); *(_DWORD *)(v68 + 360) = 1054280254; v76 = CCCircleWave::create(nullptr, (float)(a1->m_vehicleSize * 20.0) * 1.3, 2.0, 0.25, 0); v77 = v76; p_m_playerColor1 = &a1->m_playerColor2; v79 = *(_QWORD *)v76; if ( a1->m_swapColors ) p_m_playerColor1 = &a1->m_playerColor1; v80 = p_m_playerColor1->r; v81 = p_m_playerColor1->g; *(_BYTE *)(v76 + 342) = p_m_playerColor1->b; *(_BYTE *)(v76 + 340) = v80; *(_BYTE *)(v76 + 341) = v81; (*(void (**)(void))(v79 + 184))(); a1->m_parentLayer->addChild_0(a1->m_parentLayer, (cocos2d::CCNode *)v77, 0); v82 = GameManager::sharedState()->m_playLayer; if ( v82 ) v83 = &v82->CCCircleWaveDelegate; else v83 = nullptr; *(_QWORD *)(v77 + 368) = v83; v84 = GameManager::sharedState(); PlayLayer::addCircle(v84->m_playLayer, (CCCircleWave *)v77); *(_DWORD *)(v77 + 360) = 1062668862; v85 = CCCircleWave::create(nullptr, a1->m_vehicleSize * 10.0, (float)(a1->m_vehicleSize * 30.0) * 1.5, 0.25, 0); v86 = v85; v87 = &a1->m_playerColor2; v88 = *(_QWORD *)v85; if ( a1->m_swapColors ) v87 = &a1->m_playerColor1; v89 = v87->r; v90 = v87->g; *(_BYTE *)(v85 + 342) = v87->b; *(_BYTE *)(v85 + 340) = v89; *(_BYTE *)(v85 + 341) = v90; (*(void (**)(void))(v88 + 184))(); a1->m_parentLayer->addChild_0(a1->m_parentLayer, (cocos2d::CCNode *)v86, 0); v91 = GameManager::sharedState()->m_playLayer; if ( v91 ) v92 = &v91->CCCircleWaveDelegate; else v92 = nullptr; *(_QWORD *)(v86 + 368) = v92; v93 = GameManager::sharedState(); PlayLayer::addCircle(v93->m_playLayer, (CCCircleWave *)v86); *(_DWORD *)(v86 + 352) = 1; } PlayerObject::flashPlayer(a1, 0.3, 0.05, (cocos2d::ccColor3B)&unk_FFFFFF, (cocos2d::ccColor3B)&unk_FFFFFF); cocos2d::CCNode::stopActionByTag(a1->m_spiderSprite, 10); v40 = (cocos2d::CCScaleTo *)((__int64 (__fastcall *)(GJSpiderSprite *, float))a1->m_spiderSprite->setScale)( a1->m_spiderSprite, 0.4); v41 = (cocos2d::CCEaseElasticOut *)cocos2d::CCScaleTo::create(v40, 0.45, 1.0); v43 = (cocos2d::CCAction *)cocos2d::CCEaseElasticOut::create(v41, v42, 0.35); v43->setTag(v43, 10); cocos2d::CCNode::runAction(a1->m_spiderSprite, v43); if ( a1->m_playEffects ) { v44 = cocos2d::CCSprite::createWithSpriteFrameName("spiderDash_002.png"); LODWORD(v45) = 0; if ( !a1->m_isUpsideDown ) LODWORD(v45) = 1127481344; v46 = 1; v44->setRotation(v44, v45); v47 = GameManager::sharedState(); v47->m_playLayer->m_objectLayer->addChild_0(v47->m_playLayer->m_objectLayer, v44, 40); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v44->setBlendFunc)(v44, 0x100000302LL); setScaleX = v44->setScaleX; v49 = vabds_f32(v96.x, v101.origin.x) + 30.0; v50 = (float *)v44->getContentSize(v44); setScaleX(v44, v49 / *v50); setPosition = v44->setPosition; cocos2d::CCPoint::CCPoint(&v102.origin, v96.x + (float)((float)(v101.origin.x - v96.x) * 0.5), v96.y); setPosition(v44, &v102.origin); v52 = &a1->m_playerColor2; if ( a1->m_swapColors ) v52 = &a1->m_playerColor1; v53 = (cocos2d::CCArray *)((__int64 (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor3B *))v44->setColor)( v44, v52); v54 = (cocos2d::CCArray *)cocos2d::CCArray::create(v53); do { v55 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(); v56 = (const char *)v46++; v57 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"spiderDash_%03d.png", v56); CString = cocos2d::CCString::getCString(v57); v59 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v55, CString); cocos2d::CCArray::addObject(v54, v59); } while ( v46 != 9 ); v60 = cocos2d::CCAnimation::createWithSpriteFrames(v54, 0.04); v61 = (cocos2d::CCSequence *)cocos2d::CCAnimate::create(v60); v62 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v44, 520, 1); v63 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v61, v62, 0); cocos2d::CCNode::runAction(v44, v63); } } if ( !a1->m_isHidden && (!a1->m_isSpider || !a1->m_isPlatformer) ) cocos2d::CCParticleSystem::resetSystem(a1->m_playerGroundParticles); goto LABEL_34; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source