//
// PlayerObject::toggleDartMode from 0x75a0f4 to 0x75a378 (644 bytes)
//
// 9 xrefs:
// > PlayerObject::switchedToMode @ 0x759544
// > PlayerObject::switchedToMode @ 0x7595a4
// > PlayerObject::switchedToMode @ 0x75960c
// > PlayerObject::copyAttributes @ 0x75d460
// > MenuGameLayer::resetPlayer @ 0x7da6f8
// > MenuGameLayer::init @ 0x7db32c
// > MenuGameLayer::init @ 0x7db33c
// > GJBaseGameLayer::switchToFlyMode @ 0x99dc74
// > ??> @ 0x90658
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:52:59 +0000
//
__int64 __fastcall PlayerObject::toggleDartMode(__int64 this, unsigned __int8 a2, unsigned __int8 a3)
{
int v3; // w20
__int64 v4; // x19
int v5; // w21
__int64 v6; // x1
__int64 v7; // x1
GameManager *v8; // x0
float v9; // s0
__int64 v10; // x0
__int64 v11; // x2
__int64 v12; // x0
__int64 v13; // x2
char v14; // w3
char v15; // w5
__int64 v16; // x21
int v17; // [xsp+38h] [xbp+38h]
v3 = a2;
v4 = this;
v5 = a3;
if ( *(unsigned __int8 *)(this + 2420) != a2 )
{
v6 = *(_QWORD *)(this + 2624);
*(_BYTE *)(this + 2420) = v3;
*(_QWORD *)(this + 1960) = v6;
if ( v3 )
PlayerObject::switchedToMode((PlayerObject *)this, 26);
PlayerObject::stopRotation((PlayerObject *)v4);
v7 = *(_QWORD *)v4;
*(double *)(v4 + 2392) = *(double *)(v4 + 2392) * 0.5;
(*(void (__fastcall **)(__int64, float))(v7 + 360))(v4, 0.0);
*(_BYTE *)(v4 + 2500) = 0;
*(_BYTE *)(v4 + 2425) = 0;
*(_BYTE *)(v4 + 1971) = 0;
PlayerObject::removePendingCheckpoint(v4);
v8 = (GameManager *)*(unsigned __int8 *)(v4 + 2420);
if ( *(_BYTE *)(v4 + 2420) )
{
*(float *)(v4 + 764) = 10.0;
*(float *)(v4 + 2640) = 20.0;
*(float *)(v4 + 768) = 10.0;
v10 = GameManager::sharedState(v8);
PlayerObject::updatePlayerDartFrame((PlayerObject *)v4, *(_DWORD *)(v10 + 764) - *(_DWORD *)(v10 + 768));
if ( !v5 )
{
LOWORD(v17) = -14081;
BYTE2(v17) = 0;
PlayerObject::spawnPortalCircle(v4, v17, 50.0);
}
PlayerObject::activateStreak((cocos2d::CCNode **)v4);
PlayerObject::updatePlayerScale((GJActionManager **)v4);
PlayerObject::deactivateParticle((cocos2d::CCParticleSystem **)v4);
v11 = *(_QWORD *)(v4 + 1904);
if ( *(_BYTE *)(v4 + 2041) )
(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)v11 + 960LL))(*(_QWORD *)(v4 + 1904), &unk_113CFA0);
else
(*(void (__fastcall **)(_QWORD, __int64 *))(*(_QWORD *)v11 + 960LL))(*(_QWORD *)(v4 + 1904), &qword_113CF98);
HardStreak::reset(*(HardStreak **)(v4 + 1920));
PlayerObject::placeStreakPoint((PlayerObject *)v4);
if ( *(_BYTE *)(v4 + 1972)
&& !*(_BYTE *)(v4 + 1969)
&& !*(_BYTE *)(*(_QWORD *)(GameManager::sharedState((GameManager *)*(unsigned __int8 *)(v4 + 1969)) + 544)
+ 12605LL)
&& !v5 )
{
v12 = CCCircleWave::create(nullptr, 10.0, 60.0, 0.4);
v13 = *(_QWORD *)v12;
v14 = *(_BYTE *)(v4 + 2604);
v15 = *(_BYTE *)(v4 + 2602);
v16 = v12;
*(_BYTE *)(v12 + 341) = *(_BYTE *)(v4 + 2603);
*(_BYTE *)(v12 + 340) = v15;
*(_BYTE *)(v12 + 342) = v14;
(*(void (__fastcall **)(__int64, __int64))(v13 + 184))(v12, v4 + 2488);
*(_DWORD *)(v16 + 352) = 1;
*(_DWORD *)(v16 + 356) = 4;
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(v4 + 3024) + 464LL))(
*(_QWORD *)(v4 + 3024),
v16,
0);
}
}
else
{
if ( *(float *)(v4 + 2472) != 1.0 && *(_BYTE *)(v4 + 2648) )
PlayerObject::updatePlayerFrame((PlayerObject *)v4, 0);
else
PlayerObject::updatePlayerFrame((PlayerObject *)v4, *(_DWORD *)(v4 + 1560));
PlayerObject::resetPlayerIcon((cocos2d::CCParticleSystem **)v4);
}
if ( *(_BYTE *)(v4 + 2420) )
v9 = 0.8;
else
v9 = 1.0;
this = cocos2d::CCMotionStreak::setStroke(
*(cocos2d::CCMotionStreak **)(v4 + 1904),
(float)(*(float *)(v4 + 2268) * *(float *)(v4 + 2472)) * v9);
if ( v3 )
return PlayerObject::modeDidChange((PlayerObject *)v4);
}
return this;
}