// // PlayerObject::update from 0x63f4d8 to 0x6401d4 (3324 bytes) // // 2 xrefs: // > @ 0xb4918 // > @ 0x1152708 // // 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::update(PlayerObject *a1, float a2) { double m_flashTime; // d1 double v5; // d0 double m_flashDuration; // d1 double v7; // d8 void (__fastcall *v8)(PlayerObject *__hidden, const cocos2d::ccColor3B *); // x22 float v9; // s0 float v10; // s0 double m_yVelocity; // d8 double m_platformerXVelocity; // d0 const cocos2d::CCPoint *LastPosition; // x21 const cocos2d::CCPoint *v14; // x0 float v15; // s0 float v16; // s0 float v17; // s1 _BOOL4 m_isLocked; // w0 HardStreak *m_waveTrail; // x21 _BOOL4 m_playEffects; // w0 GameManager *v21; // x0 PlayerFireBoostSprite *m_robotFire; // x0 GhostTrailEffect *m_ghostTrail; // x21 float y; // s2 float v25; // s1 GhostTrailEffect *v26; // x22 float v27; // s0 float v28; // s1 cocos2d::CCMotionStreak *m_shipStreak; // x21 void (__fastcall *setTexture)(cocos2d::CCMotionStreak *__hidden, cocos2d::CCTexture2D *); // x22 cocos2d::CCTextureCache *v31; // x23 float m_totalTime; // s0 cocos2d::CCTexture2D *v33; // x0 char *v34; // x0 DashRingObject *m_dashRing; // x0 float m_maxDuration; // s1 void (__fastcall *setColor)(PlayerObject *__hidden, const cocos2d::ccColor3B *); // x2 double v38; // d1 float v39; // s0 float v40; // s1 cocos2d::CCParticleSystemQuad *m_swingBurstParticles1; // x21 void (__fastcall *setAngle)(cocos2d::CCParticleSystem *__hidden, float); // x22 float v43; // s0 float v44; // s1 float v45; // s0 cocos2d::CCParticleSystemQuad *m_swingBurstParticles2; // x21 void (__fastcall *v47)(cocos2d::CCParticleSystem *__hidden, float); // x22 float v48; // s0 float v49; // s1 float v50; // s0 float v51; // s10 float v52; // s12 double v53; // d10 float v54; // s2 double v55; // d13 double v56; // d10 double v57; // d9 double m_dashX; // d1 double m_dashY; // d0 double v60; // d12 float v61; // s1 _BOOL4 m_isGoingLeft; // w0 double v63; // d12 double v64; // d0 double v65; // d10 void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x23 const cocos2d::CCPoint *v67; // x24 float v68; // s0 double m_maybeReverseSpeed; // d0 double v70; // d1 double v71; // d9 cocos2d::CCDirector *v72; // x0 HardStreak *v73; // x21 float v74; // s9 float x; // s10 GameManager *v76; // x0 cocos2d::CCSequence *v77; // x21 cocos2d::CCHide *v78; // x0 cocos2d::CCAction *v79; // x21 double v80; // d0 double m_accelerationOrSpeed; // d0 cocos2d::CCSequence *v82; // x21 cocos2d::CCScaleTo *v83; // x0 cocos2d::CCAction *v84; // x0 cocos2d::CCSequence *v85; // x21 cocos2d::CCFiniteTimeAction *v86; // x0 cocos2d::CCAction *v87; // x21 unsigned int *v88; // x2 int v89; // w1 double v90; // d10 double v91; // d0 float v92; // [xsp+70h] [xbp+70h] cocos2d::CCScaleTo *v93; // [xsp+70h] [xbp+70h] cocos2d::CCScaleTo *v94; // [xsp+80h] [xbp+80h] cocos2d::CCScaleTo *v95; // [xsp+88h] [xbp+88h] cocos2d::CCPoint v96; // [xsp+98h] [xbp+98h] BYREF char *v97; // [xsp+A0h] [xbp+A0h] BYREF m_flashTime = a1->m_flashTime; if ( m_flashTime >= 0.0 ) { v5 = a1->m_totalTime - m_flashTime; m_flashDuration = a1->m_flashDuration; v7 = v5 - a1->m_flashDelay; if ( v7 >= m_flashDuration ) { setColor = a1->setColor; a1->m_flashTime = -1.0; setColor(a1, &a1->m_originalMainColor); PlayerObject::setSecondColor(a1, &a1->m_originalSecondColor); } else if ( v7 > 0.0 ) { v8 = a1->setColor; v9 = v7 / m_flashDuration; *(cocos2d::ccColor3B *)&v97 = GameToolbox::multipliedColorValue( (cocos2d::ccColor3B)*(_QWORD *)&a1->m_flashMainColor.r, (cocos2d::ccColor3B)*(_QWORD *)&a1->m_originalMainColor.r, v9); v8(a1, (const cocos2d::ccColor3B *)&v97); v10 = v7 / a1->m_flashDuration; *(cocos2d::ccColor3B *)&v97 = GameToolbox::multipliedColorValue( (cocos2d::ccColor3B)*(_QWORD *)&a1->m_flashSecondColor.r, (cocos2d::ccColor3B)*(_QWORD *)&a1->m_originalSecondColor.r, v10); PlayerObject::setSecondColor(a1, (const cocos2d::ccColor3B *)&v97); } } m_yVelocity = a1->m_yVelocity; if ( m_yVelocity <= 1000.0 ) { if ( m_yVelocity < -1000.0 ) a1->m_yVelocity = -1000.0; } else { a1->m_yVelocity = 1000.0; } if ( a1->m_isPlatformer ) { m_platformerXVelocity = a1->m_platformerXVelocity; if ( m_platformerXVelocity <= 1000.0 ) { if ( m_platformerXVelocity < -1000.0 ) a1->m_platformerXVelocity = -1000.0; } else { a1->m_platformerXVelocity = 1000.0; } } if ( !a1->m_isDead ) { LastPosition = GameObject::getLastPosition(a1); v14 = a1->getPosition(a1); v15 = cocos2d::ccpDistance(LastPosition, v14); v16 = ((float (__fastcall *)(PlayerObject *, float))a1->getPosition)(a1, v15); cocos2d::CCPoint::operator=(&a1->m_lastPosition, v16, v17); m_isLocked = a1->m_isLocked; a1->m_yVelocityRelated3 = 0.0; if ( m_isLocked ) goto LABEL_17; v51 = 0.9; v52 = a2 * 0.9; PlayerObject::updateJump(a1, a2 * 0.9); if ( a1->m_stateForce <= 0 ) goto LABEL_101; if ( a1->m_isShip ) { if ( a1->m_vehicleSize == 1.0 ) v51 = 0.47; else v51 = 0.5875; } else if ( a1->m_isBird ) { if ( a1->m_vehicleSize == 1.0 ) v51 = 0.58; else v51 = 0.725; } else { if ( a1->m_isSwing ) { v51 = 0.4; } else if ( a1->m_isBall || a1->m_isSpider ) { v51 = 0.6; } else if ( !a1->m_isRobot ) { v51 = 1.0; } if ( a1->m_vehicleSize != 1.0 && a1->m_isSwing ) v51 = 0.61538; } v53 = (float)((float)(v52 * a1->m_stateForceVector.y) * v51); PlayerObject::addToYVelocity(a1, v53, 69); if ( v53 != 0.0 ) a1->m_isAccelerating = 1; if ( a1->m_isUpsideDown ) { if ( v53 >= 0.0 ) { LABEL_94: if ( !a1->m_isPlatformer ) { if ( !a1->m_isDashing ) { v55 = v52; v56 = v52 * a1->m_yVelocity; goto LABEL_104; } LABEL_143: PlayerObject::setYVelocity(a1, 0.0, 1); LABEL_102: v55 = v52; v56 = v52 * a1->m_yVelocity; if ( a1->m_isPlatformer ) PlayerObject::updateMove(a1, a2 * 0.9); LABEL_104: v57 = a2 * PlayerObject::getCurrentXVelocity(a1); if ( a1->m_isDart ) { if ( !a1->m_isDashing ) { v90 = fabs(v57) * (double)PlayerObject::flipMod(a1); if ( a1->m_jumpBuffered ) v91 = 1.0; else v91 = -1.0; v56 = v90 * v91; v60 = v57; if ( a1->m_vehicleSize != 1.0 ) v56 = v56 + v56; goto LABEL_108; } } else { v60 = v57; if ( !a1->m_isDashing ) { LABEL_108: v61 = v56; m_isGoingLeft = a1->m_isGoingLeft; a1->m_yVelocityRelated3 = v61; if ( m_isGoingLeft && !a1->m_isPlatformer ) v60 = -v60; v63 = v60 + a1->m_maybeReverseAcceleration; if ( a1->m_isSideways ) { v64 = v56; v65 = v63; v63 = v64; v61 = v65; } v92 = v61; setPosition = a1->setPosition; v67 = a1->getPosition(a1); v68 = v63; cocos2d::CCPoint::CCPoint(&v96, v68, v92); cocos2d::CCPoint::operator+(&v97, v67, &v96); setPosition(a1, (const cocos2d::CCPoint *)&v97); m_maybeReverseSpeed = a1->m_maybeReverseSpeed; a1->m_maybeReverseAcceleration = 0.0; if ( m_maybeReverseSpeed != 0.0 ) { v70 = fabs(m_maybeReverseSpeed); v71 = v57 * 0.0199999996; if ( v71 > v70 ) v71 = v70; if ( m_maybeReverseSpeed <= 0.0 ) v71 = -v71; a1->m_maybeReverseAcceleration = v71; a1->m_maybeReverseSpeed = m_maybeReverseSpeed - v71; } LABEL_17: if ( !PlayerObject::isFlying(a1) ) { if ( !a1->m_isOnGround2 || PlayerObject::levelFlipping(a1) || a1->m_isLocked || a1->m_isHidden || a1->m_isPlatformer && fabs(a1->m_platformerXVelocity) <= 2.5 ) { if ( a1->m_hasGroundParticles && !cocos2d::CCNode::getActionByTag(a1, 3) ) { v85 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(0.06); v86 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create( a1, PlayerObject::deactivateParticle, 0); v87 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v85, v86, 0); v87->setTag(v87, 3); cocos2d::CCNode::runAction(a1, v87); } } else { if ( !a1->m_hasGroundParticles ) cocos2d::CCParticleSystem::resumeSystem(a1->m_playerGroundParticles); a1->m_hasGroundParticles = 1; cocos2d::CCNode::stopActionByTag(a1, 3); } LABEL_20: m_waveTrail = a1->m_waveTrail; m_playEffects = a1->m_playEffects; m_waveTrail->m_pulseSize = (float)((float)(a1->m_audioScale - 0.1) * 2.1) + 0.4; if ( m_playEffects ) { if ( a1->m_isGoingLeft ) { v72 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(v72); v73 = a1->m_waveTrail; v74 = *(float *)&v97; x = GameManager::sharedState()->m_playLayer->m_gameState.m_cameraPosition2.x; v76 = GameManager::sharedState(); HardStreak::clearAboveXPos(v73, x + (float)(v74 / v76->m_playLayer->m_gameState.m_cameraZoom)); } else { v21 = GameManager::sharedState(); HardStreak::clearBehindXPos(m_waveTrail, v21->m_playLayer->m_gameState.m_cameraPosition2.x); } } m_robotFire = a1->m_robotFire; if ( m_robotFire ) { if ( a1->m_isRobot && a1->m_jumpBuffered && !a1->m_touchedPad && a1->m_maybeIsBoosted && (m_accelerationOrSpeed = a1->m_accelerationOrSpeed, m_accelerationOrSpeed > 0.270000011) && m_accelerationOrSpeed < 1.5 ) { if ( !m_robotFire->isVisible(m_robotFire) ) { cocos2d::CCNode::stopAllActions(a1->m_robotFire); a1->m_robotFire->setScale(a1->m_robotFire, 0.1); a1->m_robotFire->setVisible(a1->m_robotFire, 1); v82 = (cocos2d::CCSequence *)cocos2d::CCScaleTo::create(0.05, 1.44); v94 = cocos2d::CCScaleTo::create(0.05, 0.72); v93 = cocos2d::CCScaleTo::create(0.05, 1.8); v95 = cocos2d::CCScaleTo::create(0.05, 0.9); v83 = cocos2d::CCScaleTo::create(0.05, 1.8); v84 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v82, v94, v93, v95, v83, 0); cocos2d::CCNode::runAction(a1->m_robotFire, v84); cocos2d::CCParticleSystem::resumeSystem(a1->m_robotBurstParticles); } } else if ( m_robotFire->isVisible(m_robotFire) && !cocos2d::CCNode::getActionByTag(a1->m_robotFire, 9) ) { cocos2d::CCNode::stopAllActions(a1->m_robotFire); v77 = (cocos2d::CCSequence *)cocos2d::CCScaleTo::create(0.15, 0.05); v78 = cocos2d::CCHide::create(); v79 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v77, v78, 0); v79->setTag(v79, 9); cocos2d::CCNode::runAction(a1->m_robotFire, v79); cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles); } } if ( a1->m_isRobot && a1->m_jumpBuffered && !a1->m_touchedPad && a1->m_maybeIsBoosted && (v80 = a1->m_accelerationOrSpeed, v80 > 0.100000001) && v80 < 1.5 && !a1->m_isHidden ) { if ( !a1->m_robotBurstParticles->isActive(a1->m_robotBurstParticles) ) cocos2d::CCParticleSystem::resumeSystem(a1->m_robotBurstParticles); } else if ( a1->m_robotBurstParticles->isActive(a1->m_robotBurstParticles) ) { cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles); } m_ghostTrail = a1->m_ghostTrail; a1->m_maybeSpriteRelated = 0; if ( m_ghostTrail ) { if ( a1->m_isRobot ) { y = a1->m_robotSprite->m_headSprite->getPosition(a1->m_robotSprite->m_headSprite)->y; v25 = 7.0; } else { if ( !a1->m_isSpider ) { cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v97, &stru_1242030); cocos2d::CCPoint::operator=(&m_ghostTrail->m_position, v39, v40); if ( !a1->m_isDashing ) { LABEL_41: if ( !a1->m_isSwing ) { LABEL_42: PlayerObject::updateJumpVariables(a1); PlayerObject::updateStateVariables(a1); m_shipStreak = a1->m_shipStreak; if ( m_shipStreak ) { setTexture = m_shipStreak->setTexture; v31 = cocos2d::CCTextureCache::sharedTextureCache(); m_totalTime = a1->m_totalTime; getFrameForStreak(a1->m_shipStreakType, (__int64)&v97, m_totalTime); v33 = cocos2d::CCTextureCache::addImage(v31, v97, 0); setTexture(m_shipStreak, v33); v34 = v97 - 24; if ( v97 - 24 != (char *)&qword_124B6B0 ) { if ( &pthread_create ) { v88 = (unsigned int *)(v97 - 8); do v89 = __ldaxr(v88); while ( __stlxr(v89 - 1, v88) ); } else { v89 = *((_DWORD *)v97 - 2); *((_DWORD *)v97 - 2) = v89 - 1; } if ( v89 <= 0 ) operator delete(v34); } } if ( a1->m_isPlatformer && a1->m_isDashing ) { m_dashRing = a1->m_dashRing; if ( m_dashRing ) { m_maxDuration = m_dashRing->m_maxDuration; if ( m_maxDuration > 0.0 && a1->m_totalTime - a1->m_dashStartTime > m_maxDuration ) { PlayerObject::stopDashing(a1); a1->m_jumpBuffered = 0; } } } return; } LABEL_72: m_swingBurstParticles1 = a1->m_swingBurstParticles1; setAngle = m_swingBurstParticles1->setAngle; v43 = a1->getRotation(a1); v44 = 0.0; v45 = (float)(45.0 - v43) - 180.0; if ( a1->m_isGoingLeft ) v44 = 90.0; setAngle(m_swingBurstParticles1, v45 + v44); m_swingBurstParticles2 = a1->m_swingBurstParticles2; v47 = m_swingBurstParticles2->setAngle; v48 = a1->getRotation(a1); v49 = 0.0; v50 = (float)((float)-v48 - 45.0) - 180.0; if ( a1->m_isGoingLeft ) v49 = -90.0; v47(m_swingBurstParticles2, v50 + v49); goto LABEL_42; } LABEL_71: PlayerObject::updateDashAnimation(a1); if ( !a1->m_isSwing ) goto LABEL_42; goto LABEL_72; } y = a1->m_spiderSprite->m_headSprite->getPosition(a1->m_spiderSprite->m_headSprite)->y; v25 = 2.0; } cocos2d::CCPoint::CCPoint(&v96, 0.0, v25 + (float)(y * 0.4)); v26 = a1->m_ghostTrail; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v97, &v96); cocos2d::CCPoint::operator=(&v26->m_position, v27, v28); } if ( !a1->m_isDashing ) goto LABEL_41; goto LABEL_71; } if ( a1->m_isShip ) { if ( !a1->m_jumpBuffered || PlayerObject::levelFlipping(a1) || a1->m_isHidden ) { if ( a1->m_hasShipParticles ) cocos2d::CCParticleSystem::stopSystem(a1->m_shipClickParticles); a1->m_hasShipParticles = 0; } else { if ( !a1->m_hasShipParticles ) cocos2d::CCParticleSystem::resumeSystem(a1->m_shipClickParticles); a1->m_hasShipParticles = 1; } } if ( !a1->m_isDart && a1->m_isOnGround2 ) { v38 = a1->m_yVelocity; if ( a1->m_isUpsideDown ) { if ( v38 < 1.0 ) goto LABEL_60; } else if ( v38 > -1.0 ) { LABEL_60: if ( !a1->m_isLocked && !a1->m_isHidden && (!a1->m_isPlatformer || a1->m_holdingLeft || a1->m_holdingRight || a1->m_platformerMovingLeft || a1->m_platformerMovingRight) ) { cocos2d::CCParticleSystem::resumeSystem(a1->m_vehicleGroundParticles); goto LABEL_20; } } } cocos2d::CCParticleSystem::stopSystem(a1->m_vehicleGroundParticles); goto LABEL_20; } } if ( a1->m_isPlatformer ) { m_dashX = a1->m_dashX; m_dashY = a1->m_dashY; v60 = v55 * m_dashX; v56 = v55 * m_dashY; a1->m_platformerXVelocity = m_dashX; a1->m_yVelocity = m_dashY; } else { v60 = v57; v56 = v57 * a1->m_dashY; } goto LABEL_108; } v54 = a1->m_stateForceVector.x; a1->m_platformerXVelocity = a1->m_platformerXVelocity + (float)(v54 * v52); if ( v54 != 0.0 ) a1->m_affectedByForces = 1; if ( PlayerObject::isInNormalMode(a1) && !a1->m_isRotating && fabsf(a1->m_stateForceVector.x) > 0.1 ) PlayerObject::runNormalRotation(a1, 1, 1.0); LABEL_101: if ( !a1->m_isDashing ) goto LABEL_102; goto LABEL_143; } } else if ( v53 <= 0.0 ) { goto LABEL_94; } a1->m_accelerationOrSpeed = a1->m_accelerationOrSpeed + v53 / 12.9399996 * 1.5; goto LABEL_94; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source