//
// PlayerObject::updateTimeMod from 0x1403a0d50 to 0x1403a10d1 (897 bytes)
//
// 10 xrefs:
// > GJBaseGameLayer::setupLevelStart @ 0x140212aa5
// > GJBaseGameLayer::setupLevelStart @ 0x140212ac0
// > GJBaseGameLayer::update @ 0x140238048
// > GJBaseGameLayer::update @ 0x140238064
// > MenuGameLayer::resetPlayer @ 0x1403332d0
// > PlayerObject::init @ 0x140387426
// > PlayerObject::resetObject @ 0x14039742b
// > PlayerObject::copyAttributes @ 0x1403a05da
// > PlayerObject::loadFromCheckpoint @ 0x1403a2b65
// > ??> @ 0x1406d6950
//
// 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
//
// Hidden C++ exception states: #wind=4
void PlayerObject::updateTimeMod(PlayerObject *a1, float a2, bool a3)
{
__int64 v4; // rax
_BYTE *v5; // r14
const char *v6; // rbx
cocos2d::CCDirector *v7; // rax
struct cocos2d::CCParticleSystemQuad *v8; // rdi
_BOOL8 v9; // rdx
cocos2d::CCParticleSystemQuad_vtbl *v10; // rbx
__int64 v11; // rcx
cocos2d::CCDirector *v12; // rax
float v13; // xmm0_4
const cocos2d::CCPoint *v14; // rax
cocos2d::CCParticleSystemQuad_vtbl *v15; // rbx
__int64 v16; // rcx
cocos2d::CCDirector *v17; // rax
float v18; // xmm0_4
const cocos2d::CCPoint *v19; // rax
double v20; // rax
cocos2d::CCMotionStreak *m_shipStreak; // rcx
void *v22; // [rsp+60h] [rbp+8h]
if ( !a1->m_maybeReducedEffects && a1->m_playEffects && !a3 && a1->m_playerSpeed != a2 )
{
v4 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v22 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v4 = qword_1406C2ED8;
}
v5 = *(_BYTE **)(v4 + 520);
if ( !*(_BYTE *)(v4 + 917) && !v5[12837] )
{
if ( a2 == 0.69999999 )
{
v6 = "speedEffect_slow.plist";
}
else if ( a2 == 1.1 )
{
v6 = "speedEffect_fast.plist";
}
else if ( a2 == 1.3 )
{
v6 = "speedEffect_vfast.plist";
}
else
{
v6 = "speedEffect_vvfast.plist";
if ( a2 != 1.6 )
v6 = "speedEffect_normal.plist";
}
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v7);
v8 = cocos2d::CCParticleSystemQuad::create(v6, 0);
v8->setPositionType(v8, kCCPositionTypeGrouped);
LOBYTE(v9) = 1;
v8->setAutoRemoveOnFinish(v8, v9);
(*(void (__fastcall **)(_BYTE *, struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)v5 + 440LL))(
v5,
v8,
100);
v10 = v8->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
v13 = cocos2d::CCDirector::getScreenRight(v12) + 10.0;
cocos2d::CCPoint::CCPoint(v13, v13);
v10->setPosition_0(v8, v14);
v15 = v8->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v17 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v16);
v18 = (float)(cocos2d::CCDirector::getScreenScaleFactorH(v17) * 320.0) * 0.5;
cocos2d::CCPoint::CCPoint(v18, 10.0);
v15->setPosVar(v8, v19);
cocos2d::CCParticleSystem::resetSystem(v8);
}
}
a1->m_playerSpeed = a2;
if ( a2 == 0.89999998 )
{
a1->m_yStart = 11.18003177642822;
a1->m_gravity = 0.9581990242004395;
LABEL_27:
v20 = 5.770001888275146;
goto LABEL_28;
}
if ( a2 == 0.69999999 )
{
a1->m_yStart = 10.620032;
a1->m_gravity = 0.940199;
v20 = 5.980002;
}
else if ( a2 == 1.1 )
{
a1->m_yStart = 11.420032;
a1->m_gravity = 0.957199;
v20 = 5.870002;
}
else
{
if ( a2 != 1.3 && a2 != 1.6 )
goto LABEL_27;
a1->m_yStart = 11.230032;
a1->m_gravity = 0.961199;
v20 = 6.000002;
}
LABEL_28:
a1->m_speedMultiplier = v20;
PlayerObject::updateRobotAnimationSpeed(a1);
if ( a1->m_isBall && !a1->m_isLocked && !a1->m_isDashing )
{
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
PlayerObject::runBallRotation(a1, 1.0);
}
m_shipStreak = a1->m_shipStreak;
if ( m_shipStreak )
sub_1403862B0(m_shipStreak, a1->m_shipStreakType, (__int64)a1);
}