//
// PlayerObject::spiderTestJumpY from 0x34a260 to 0x34ab02 (2210 bytes)
//
// 0 xrefs:
//
// 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::spiderTestJumpY(PlayerObject *a1, bool a2)
{
GJBaseGameLayer *m_gameLayer; // r8
float MinPortalY; // s18
float MaxPortalY; // s19
const cocos2d::CCRect *v6; // r0
float v7; // s15
float v8; // s14
float *p_m_vehicleSize; // r10
cocos2d::CCArray *v10; // r6
cocos2d::CCArray *v11; // r7
size_t *p_num; // r3
void *v13; // r0
size_t v14; // r1
int (**v15)(const void *, const void *); // r3
size_t *v16; // r3
void *v17; // r0
size_t v18; // r1
int (**v19)(const void *, const void *); // r3
unsigned int v20; // r11
const cocos2d::CCPoint *v21; // r0
int v22; // r9
int (*v23)(void); // r3
cocos2d::CCRect *v24; // r0
float v25; // r0
float y; // s16
cocos2d::CCRect *v27; // r0
float v28; // r0
cocos2d::CCRect *v29; // r0
float v30; // r0
unsigned int i; // r9
int v32; // r0
int (__fastcall *v33)(int); // r3
const cocos2d::CCRect *v34; // r0
int v35; // r3
int v36; // r0
int v37; // r0
const cocos2d::CCPoint *v38; // r0
int v39; // r0
int v40; // r0
int v41; // r0
GameManager *v42; // r0
float v43; // r3
CCCircleWave *v44; // r0
CCCircleWave *v45; // r6
cocos2d::ccColor3B *p_m_playerColor1; // r3
GLubyte r; // r1
GLubyte g; // r2
GLubyte b; // r3
PlayLayer *m_playLayer; // r3
GameManager *v51; // r0
CCCircleWave *v52; // r0
CCCircleWave *v53; // r6
cocos2d::ccColor3B *p_m_playerColor2; // r3
GLubyte v55; // r1
GLubyte v56; // r2
GLubyte v57; // r3
PlayLayer *v58; // r3
GameManager *v59; // r0
CCCircleWave *v60; // r0
CCCircleWave *v61; // r6
cocos2d::ccColor3B *v62; // r3
GLubyte v63; // r1
GLubyte v64; // r2
GLubyte v65; // r3
PlayLayer *v66; // r3
GameManager *v67; // r0
float v68; // r2
cocos2d::CCEaseElasticOut *v69; // r0
float v70; // r2
cocos2d::CCAction *v71; // r6
cocos2d::CCSprite *v72; // r0
int v73; // r1
cocos2d::CCNode *v74; // r6
GameManager *v75; // r0
cocos2d::CCNode_vtbl *v76; // r2
void (__fastcall *setScaleX)(cocos2d::CCNode *__hidden, float); // r7
float v78; // s16
float *v79; // r0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::ccColor3B *v81; // r1
cocos2d::CCArray *v82; // r0
int v83; // r7
cocos2d::CCArray *v84; // r8
cocos2d::CCSpriteFrameCache *v85; // r0
const char *v86; // r1
cocos2d::CCSpriteFrameCache *v87; // r10
cocos2d::CCString *v88; // r0
const char *CString; // r0
cocos2d::CCSpriteFrame *v90; // r0
cocos2d::CCAnimation *v91; // r0
cocos2d::CCSequence *v92; // r7
cocos2d::CCFiniteTimeAction *v93; // r0
cocos2d::CCAction *v94; // r0
GJBaseGameLayer *v95; // r0
float v96; // r3
float v97; // [sp+0h] [bp-94h]
cocos2d::ccColor3B v98; // [sp+0h] [bp-94h]
bool v99; // [sp+4h] [bp-90h]
bool v100; // [sp+4h] [bp-90h]
bool v101; // [sp+4h] [bp-90h]
bool v102; // [sp+4h] [bp-90h]
bool v103; // [sp+4h] [bp-90h]
_BOOL4 v104; // [sp+8h] [bp-8Ch]
int v105; // [sp+Ch] [bp-88h]
cocos2d::CCPoint v106; // [sp+1Ch] [bp-78h] BYREF
cocos2d::CCPoint v107; // [sp+24h] [bp-70h] BYREF
cocos2d::CCRect v108; // [sp+2Ch] [bp-68h] BYREF
cocos2d::CCRect v109; // [sp+3Ch] [bp-58h] BYREF
cocos2d::CCRect v110; // [sp+4Ch] [bp-48h] BYREF
cocos2d::CCRect v111; // [sp+5Ch] [bp-38h] BYREF
cocos2d::CCRect v112; // [sp+6Ch] [bp-28h] BYREF
cocos2d::CCRect v113; // [sp+7Ch] [bp-18h] BYREF
cocos2d::CCRect v114; // 0:kr00_16.16
cocos2d::CCRect v115; // 0:r1.12,12:^0.4
cocos2d::CCRect v116; // 0:r1.12,12:^0.4
v104 = a2;
if ( a1->m_isDead || a1->m_isLocked || a1->m_maybeReducedEffects )
return;
m_gameLayer = a1->m_gameLayer;
MinPortalY = GJBaseGameLayer::getMinPortalY(m_gameLayer);
MaxPortalY = GJBaseGameLayer::getMaxPortalY(m_gameLayer);
if ( m_gameLayer->m_gameState.m_isFreeMode || PlayerObject::isInBasicMode(a1) )
{
MaxPortalY = 2490.0;
v105 = 1;
MinPortalY = 90.0;
}
else
{
v105 = 0;
}
v6 = a1->getObjectRect(a1);
cocos2d::CCRect::CCRect(&v108, v6);
cocos2d::CCRect::CCRect(&v109, &v108);
if ( a1->m_isUpsideDown )
{
v8 = (float)(v109.origin.y - MinPortalY) + 2.0;
v7 = MinPortalY;
}
else
{
v7 = (float)(v109.size.height - 2.0) + v109.origin.y;
v8 = MaxPortalY - v7;
}
v109.size.height = v8;
p_m_vehicleSize = &a1->m_vehicleSize;
v109.origin.y = v7;
cocos2d::CCRect::CCRect(&v110, &v109);
v110.size.width = v108.size.width;
v110.origin.x = v108.origin.x;
cocos2d::CCRect::CCRect(&v111, &v110);
v111.size.width = v111.size.width + 4.0;
v110.size.width = a1->m_vehicleSize * 8.0;
v110.origin.x = v110.origin.x + (float)((float)(v109.size.width - v110.size.width) * 0.5);
v109.size.width = (float)(v108.size.width * 0.5) + 1.0;
v109.origin.x = v109.origin.x + (float)(v108.size.width * 0.5);
cocos2d::CCRect::CCRect(&v113, &v109);
LODWORD(v114.origin.x) = &v113;
LODWORD(v114.origin.y) = 1;
v114.size.width = v96;
v114.size.height = v97;
v10 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v114, v99);
cocos2d::CCRect::CCRect(&v113, &v110);
LODWORD(v115.origin.x) = &v113;
LODWORD(v115.origin.y) = 1;
v11 = GJBaseGameLayer::damagingObjectsInRect(m_gameLayer, v115, v100);
if ( !cocos2d::CCArray::count(v10) && cocos2d::CCArray::count(v11) || v104 )
{
cocos2d::CCRect::CCRect(&v113, &v111);
LODWORD(v116.origin.x) = &v113;
LODWORD(v116.origin.y) = 1;
v104 = 1;
v10 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v116, v101);
}
if ( cocos2d::CCArray::count(v10) )
{
p_num = &v10->data->num;
v13 = (void *)p_num[3];
v14 = *p_num;
if ( a1->m_isUpsideDown )
v15 = (int (**)(const void *, const void *))&boxCompMax;
else
v15 = (int (**)(const void *, const void *))&boxCompMin;
qsort(v13, v14, 4u, *v15);
}
if ( cocos2d::CCArray::count(v11) )
{
v16 = &v11->data->num;
v17 = (void *)v16[3];
v18 = *v16;
if ( a1->m_isUpsideDown )
v19 = (int (**)(const void *, const void *))&boxCompMax;
else
v19 = (int (**)(const void *, const void *))&boxCompMin;
qsort(v17, v18, 4u, *v19);
}
if ( cocos2d::CCArray::count(v10) )
{
v20 = 0;
cocos2d::CCRect::CCRect(&v112, &v108);
v21 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v107, v21);
while ( v20 < cocos2d::CCArray::count(v10) )
{
v22 = cocos2d::CCArray::objectAtIndex(v10, v20);
v23 = *(int (**)(void))(*(_DWORD *)v22 + 656);
if ( a1->m_isUpsideDown )
{
v27 = (cocos2d::CCRect *)v23();
v28 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(v27));
y = v28 + (float)(v108.size.height * 0.5);
}
else
{
v24 = (cocos2d::CCRect *)v23();
v25 = COERCE_FLOAT(cocos2d::CCRect::getMinY(v24));
y = v25 - (float)(v108.size.height * 0.5);
}
if ( a1->m_isUpsideDown )
{
if ( y <= (float)(v107.y + 10.0) )
{
LABEL_35:
v29 = (cocos2d::CCRect *)(*(int (__fastcall **)(int))(*(_DWORD *)v22 + 656))(v22);
v30 = COERCE_FLOAT(cocos2d::CCRect::getMinX(v29));
if ( v30 > v107.x )
{
for ( i = 0; i < cocos2d::CCArray::count(v10); ++i )
{
v32 = cocos2d::CCArray::objectAtIndex(v10, i);
if ( v20 != i )
{
v33 = *(int (__fastcall **)(int))(*(_DWORD *)v32 + 656);
v112.origin.y = y - (float)(v108.size.height * 0.5);
v34 = (const cocos2d::CCRect *)v33(v32);
cocos2d::CCRect::CCRect(&v113, v34);
v113.size.height = v113.size.height - 4.0;
v113.origin.y = v113.origin.y + 2.0;
if ( cocos2d::CCRect::intersectsRect(&v113, &v112) )
goto LABEL_41;
}
}
}
if ( y != 0.0 )
goto LABEL_51;
goto LABEL_43;
}
}
else if ( y >= (float)(v107.y - 10.0) )
{
goto LABEL_35;
}
LABEL_41:
++v20;
}
goto LABEL_43;
}
if ( !cocos2d::CCArray::count(v11) )
{
LABEL_43:
v35 = 0;
goto LABEL_47;
}
v36 = cocos2d::CCArray::objectAtIndex(v11, 0);
(*(void (__fastcall **)(cocos2d::CCRect *, int))(*(_DWORD *)v36 + 672))(&v113, v36);
y = v113.origin.y;
if ( v113.origin.y != 0.0 )
goto LABEL_54;
v35 = 1;
LABEL_47:
if ( a1->m_isUpsideDown )
y = MinPortalY + (float)(v108.size.height * 0.5);
else
y = MaxPortalY - (float)(v108.size.height * 0.5);
if ( v35 )
goto LABEL_54;
LABEL_51:
if ( cocos2d::CCArray::count(v11) )
{
v37 = cocos2d::CCArray::objectAtIndex(v11, 0);
(*(void (__fastcall **)(cocos2d::CCRect *, int))(*(_DWORD *)v37 + 672))(&v113, v37);
if ( !a1->m_isUpsideDown )
{
if ( v113.origin.y >= y )
goto LABEL_54;
LABEL_92:
if ( !v104 )
{
PlayerObject::spiderTestJump(a1, 1);
return;
}
y = v113.origin.y;
goto LABEL_54;
}
if ( v113.origin.y > y )
goto LABEL_92;
}
LABEL_54:
v38 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v106, v38);
cocos2d::CCPoint::CCPoint(&v107, v106.x, y);
a1->setPosition(a1, &v107);
PlayerObject::flipGravity(a1, !a1->m_isUpsideDown, 1);
v39 = PlayerObject::flipMod(a1);
PlayerObject::setYVelocity(a1, (double)-v39, 36);
a1->m_isOnGround3 = 0;
a1->m_jumpBuffered = 0;
PlayerObject::resetCollisionLog(a1, 1);
a1->m_position.y = v107.y;
a1->m_lastSpiderFlipTime = a1->m_totalTime;
if ( a1->m_playEffects && !a1->m_isHidden )
{
v40 = PlayerObject::reverseMod(a1);
v106.x = v106.x + (float)((float)v40 * 7.5);
v41 = PlayerObject::reverseMod(a1);
v107.x = v107.x + (float)((float)v41 * 7.5);
v42 = GameManager::sharedState();
LODWORD(v43) = v42->m_performanceMode;
if ( !v42->m_performanceMode )
{
v107.x = v107.x + 6.0;
v44 = CCCircleWave::create(
COERCE_CCCIRCLEWAVE_((float)(*p_m_vehicleSize * 10.0) * 1.3),
1.0,
0.15,
v43,
SLOBYTE(v43),
v101);
v45 = v44;
if ( a1->m_swapColors )
p_m_playerColor1 = &a1->m_playerColor1;
else
p_m_playerColor1 = &a1->m_playerColor2;
r = p_m_playerColor1->r;
g = p_m_playerColor1->g;
b = p_m_playerColor1->b;
v44->m_color.r = r;
v44->m_color.g = g;
v44->m_color.b = b;
v44->setPosition(v44, &v106);
a1->m_parentLayer->addChild_0(a1->m_parentLayer, v45, 0);
m_playLayer = GameManager::sharedState()->m_playLayer;
if ( m_playLayer )
m_playLayer = (PlayLayer *)((char *)m_playLayer + 11756);
v45->m_delegate = (CCCircleWaveDelegate *)m_playLayer;
v51 = GameManager::sharedState();
PlayLayer::addCircle(v51->m_playLayer, v45);
v45->m_opacityMod = 0.42;
v52 = CCCircleWave::create(COERCE_CCCIRCLEWAVE_((float)(*p_m_vehicleSize * 20.0) * 1.3), 2.0, 0.25, 0.0, 0, v102);
v53 = v52;
if ( a1->m_swapColors )
p_m_playerColor2 = &a1->m_playerColor1;
else
p_m_playerColor2 = &a1->m_playerColor2;
v55 = p_m_playerColor2->r;
v56 = p_m_playerColor2->g;
v57 = p_m_playerColor2->b;
v52->m_color.r = v55;
v52->m_color.g = v56;
v52->m_color.b = v57;
v52->setPosition(v52, &v107);
a1->m_parentLayer->addChild_0(a1->m_parentLayer, v53, 0);
v58 = GameManager::sharedState()->m_playLayer;
if ( v58 )
v58 = (PlayLayer *)((char *)v58 + 11756);
v53->m_delegate = (CCCircleWaveDelegate *)v58;
v59 = GameManager::sharedState();
PlayLayer::addCircle(v59->m_playLayer, v53);
v53->m_opacityMod = 0.84;
v60 = CCCircleWave::create(
COERCE_CCCIRCLEWAVE_(*p_m_vehicleSize * 10.0),
(float)(*p_m_vehicleSize * 30.0) * 1.5,
0.25,
0.0,
0,
v103);
v61 = v60;
if ( a1->m_swapColors )
v62 = &a1->m_playerColor1;
else
v62 = &a1->m_playerColor2;
v63 = v62->r;
v64 = v62->g;
v65 = v62->b;
v60->m_color.r = v63;
v60->m_color.g = v64;
v60->m_color.b = v65;
v60->setPosition(v60, &v107);
a1->m_parentLayer->addChild_0(a1->m_parentLayer, v61, 0);
v66 = GameManager::sharedState()->m_playLayer;
if ( v66 )
v66 = (PlayLayer *)((char *)v66 + 11756);
v61->m_delegate = (CCCircleWaveDelegate *)v66;
v67 = GameManager::sharedState();
PlayLayer::addCircle(v67->m_playLayer, v61);
v61->m_circleMode = Outline;
}
*(_WORD *)&v98.r = -1;
v98.b = -1;
PlayerObject::flashPlayer(a1, 0.3, 0.05, (cocos2d::ccColor3B)-1, v98);
cocos2d::CCNode::stopActionByTag(a1->m_spiderSprite, 10);
((void (__fastcall *)(GJSpiderSprite *, int))a1->m_spiderSprite->setScale)(a1->m_spiderSprite, 1053609165);
v69 = (cocos2d::CCEaseElasticOut *)cocos2d::CCScaleTo::create((cocos2d::CCScaleTo *)0x3EE66666, 1.0, v68);
v71 = (cocos2d::CCAction *)cocos2d::CCEaseElasticOut::create(v69, (cocos2d::CCActionInterval *)0x3EB33333, v70);
v71->setTag(v71, 10);
cocos2d::CCNode::runAction(a1->m_spiderSprite, v71);
if ( a1->m_playEffects )
{
v72 = cocos2d::CCSprite::createWithSpriteFrameName("spiderDash_002.png");
if ( a1->m_isUpsideDown )
v73 = 1119092736;
else
v73 = -1028390912;
v74 = v72;
((void (__fastcall *)(cocos2d::CCSprite *, int))v72->setRotation)(v72, v73);
v75 = GameManager::sharedState();
v75->m_playLayer->m_objectLayer->addChild_0(v75->m_playLayer->m_objectLayer, v74, 40);
v76 = v74->__vftable;
LODWORD(v112.origin.x) = 770;
LODWORD(v112.origin.y) = 1;
((void (__fastcall *)(cocos2d::CCNode *, int, int))v76[1].setPosition)(v74, 770, 1);
setScaleX = v74->setScaleX;
v78 = fabsf(v106.y - v107.y) + 30.0;
v79 = (float *)v74->getContentSize(v74);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))setScaleX)(v74, v78 / *v79);
setPosition = v74->setPosition;
cocos2d::CCPoint::CCPoint(&v113.origin, v106.x, v106.y + (float)((float)(v107.y - v106.y) * 0.5));
setPosition(v74, &v113.origin);
if ( a1->m_swapColors )
v81 = &a1->m_playerColor1;
else
v81 = &a1->m_playerColor2;
v82 = (cocos2d::CCArray *)((int (__fastcall *)(cocos2d::CCNode *, cocos2d::ccColor3B *))v74->__vftable[1].getTag)(
v74,
v81);
v83 = 1;
v84 = (cocos2d::CCArray *)cocos2d::CCArray::create(v82);
do
{
v85 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v86 = (const char *)v83++;
v87 = v85;
v88 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"spiderDash_%03d.png", v86);
CString = cocos2d::CCString::getCString(v88);
v90 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v87, CString);
cocos2d::CCArray::addObject(v84, v90);
}
while ( v83 != 9 );
v91 = cocos2d::CCAnimation::createWithSpriteFrames(v84, 0.04);
v92 = (cocos2d::CCSequence *)cocos2d::CCAnimate::create(v91);
LODWORD(v113.origin.x) = 260;
LODWORD(v113.origin.y) = 1;
v93 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v74, 260, 1);
v94 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v92, v93, 0);
cocos2d::CCNode::runAction(v74, v94);
}
}
if ( !a1->m_isHidden && (!a1->m_isSpider || !a1->m_isPlatformer) )
cocos2d::CCParticleSystem::resetSystem(a1->m_playerGroundParticles);
if ( v105 )
{
v95 = a1->m_gameLayer;
if ( v95 )
GJBaseGameLayer::checkCameraLimitAfterTeleport(v95, a1, 60.0);
}
}