//
// PlayerObject::toggleDartMode from 0x100404d20 to 0x1004050f5 (981 bytes)
//
// 15 xrefs:
// > GJBaseGameLayer::setupLevelStart @ 0x10010148d
// > GJBaseGameLayer::setupLevelStart @ 0x1001016da
// > GJBaseGameLayer::switchToFlyMode @ 0x100101cc5
// > PlayerObject::switchedToMode @ 0x1003ffdb5
// > PlayerObject::switchedToMode @ 0x1003ffe62
// > PlayerObject::toggleFlyMode @ 0x1004031ef
// > PlayerObject::toggleBirdMode @ 0x100403cf2
// > PlayerObject::toggleSwingMode @ 0x1004043f8
// > PlayerObject::toggleRollMode @ 0x1004053bf
// > PlayerObject::toggleRobotMode @ 0x1004058a4
// > PlayerObject::toggleSpiderMode @ 0x100405d1c
// > PlayerObject::copyAttributes @ 0x1004084ca
// > MenuGameLayer::init @ 0x1004f8c1c
// > MenuGameLayer::init @ 0x1004f8c2c
// > MenuGameLayer::resetPlayer @ 0x1004f9857
//
// This function is hookable on this platform (idp: pc, 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:30:04 +0000
//
void __fastcall PlayerObject::toggleDartMode(
__int64 a1,
char a2,
unsigned __int8 a3,
double a4,
double a5,
double a6,
__m128 a7)
{
__int64 v10; // xmm0_8
double v11; // xmm0_8
int v12; // esi
__int64 v13; // rdi
__int64 v14; // r12
__int64 v15; // rax
void *v16; // rsi
__int64 v17; // r15
__int16 v18; // ax
float v19; // xmm1_4
double v20; // xmm0_8
int v21; // esi
if ( *(_BYTE *)(a1 + 2420) != a2 )
{
v10 = *(_QWORD *)(a1 + 2624);
*(_QWORD *)(a1 + 1960) = v10;
*(_BYTE *)(a1 + 2420) = a2;
if ( a2 )
{
PlayerObject::toggleFlyMode(a1, 0, 0);
PlayerObject::toggleBirdMode(a1, 0, 0, *(double *)&v10, a5, a6, a7);
if ( *(_BYTE *)(a1 + 2419) )
{
*(_QWORD *)(a1 + 1960) = *(_QWORD *)(a1 + 2624);
*(_BYTE *)(a1 + 2419) = 0;
*(_QWORD *)&v11 = *(unsigned int *)(a1 + 2472);
if ( *(float *)&v11 == 1.0 || (v12 = 0, !*(_BYTE *)(a1 + 2648)) )
v12 = *(_DWORD *)(a1 + 1560);
PlayerObject::updatePlayerFrame(a1, v12, v11);
if ( *(_BYTE *)(a1 + 2423) )
v10 = 1127481344;
else
v10 = 0;
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)a1 + 360LL))(a1, *(double *)&v10);
*(_WORD *)(a1 + 1784) = 0;
*(_BYTE *)(a1 + 1640) = 0;
*(_DWORD *)(a1 + 1776) = 0;
}
PlayerObject::toggleRobotMode(a1, 0, 0);
PlayerObject::toggleSpiderMode(a1, 0, 0);
PlayerObject::toggleSwingMode(a1, 0, 0, *(double *)&v10, a5, a6, a7);
}
*(_WORD *)(a1 + 1784) = 0;
*(_BYTE *)(a1 + 1640) = 0;
*(_DWORD *)(a1 + 1776) = 0;
*(double *)(a1 + 2392) = *(double *)(a1 + 2392) * 0.5;
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)a1 + 360LL))(a1, 0.0);
*(_BYTE *)(a1 + 2500) = 0;
*(_BYTE *)(a1 + 2425) = 0;
*(_BYTE *)(a1 + 1971) = 0;
v13 = *(_QWORD *)(a1 + 2120);
if ( v13 )
{
v14 = sub_1005DDE90(v13);
GameObject::removeGlow(v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v14 + 536LL))(v14);
cocos2d::CCObject::release(*(_QWORD *)(a1 + 2120));
*(_QWORD *)(a1 + 2120) = 0;
}
if ( *(_BYTE *)(a1 + 2420) == 1 )
{
*(_DWORD *)(a1 + 2640) = 1101004800;
*(_QWORD *)(a1 + 764) = 0x4120000041200000LL;
v15 = GameManager::sharedState();
PlayerObject::updatePlayerDartFrame(a1, (unsigned int)(*(_DWORD *)(v15 + 764) - *(_DWORD *)(v15 + 768)));
if ( !a3 )
PlayerObject::spawnPortalCircle(a1, 51455, 50.0);
PlayerObject::activateStreak(a1);
GJActionManager::stopInternalAction(*(_QWORD *)(a1 + 3032), 6);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 128LL))(a1, *(float *)(a1 + 2472));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 144LL))(a1, *(float *)(a1 + 2472));
if ( *(_BYTE *)(a1 + 1974) == 1 )
cocos2d::CCParticleSystem::stopSystem(*(_QWORD *)(a1 + 2160));
*(_BYTE *)(a1 + 1974) = 0;
v16 = &unk_100A09E10;
if ( *(_BYTE *)(a1 + 2041) )
v16 = &unk_100A09E13;
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1904) + 960LL))(*(_QWORD *)(a1 + 1904), v16);
HardStreak::reset(*(_QWORD *)(a1 + 1920));
sub_1003F05E0(a1);
if ( *(_BYTE *)(a1 + 1972) == 1
&& !*(_BYTE *)(a1 + 1969)
&& !(*(_BYTE *)(*(_QWORD *)(GameManager::sharedState() + 544) + 12605LL) | a3) )
{
v17 = CCCircleWave::create_1(0, 10.0, 60.0, 0.40000001);
v18 = *(_WORD *)(a1 + 2602);
*(_BYTE *)(v17 + 342) = *(_BYTE *)(a1 + 2604);
*(_WORD *)(v17 + 340) = v18;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 184LL))(v17, a1 + 2488);
*(_QWORD *)(v17 + 352) = 0x400000001LL;
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 3024) + 464LL))(
*(_QWORD *)(a1 + 3024),
v17,
0);
}
if ( !*(_BYTE *)(a1 + 2420) )
{
LABEL_26:
v19 = 1.0;
goto LABEL_32;
}
}
else
{
*(_QWORD *)&v20 = *(unsigned int *)(a1 + 2472);
if ( *(float *)&v20 == 1.0 || (v21 = 0, !*(_BYTE *)(a1 + 2648)) )
v21 = *(_DWORD *)(a1 + 1560);
PlayerObject::updatePlayerFrame(a1, v21, v20);
PlayerObject::resetPlayerIcon(a1);
if ( !*(_BYTE *)(a1 + 2420) )
goto LABEL_26;
}
v19 = 0.80000001;
LABEL_32:
cocos2d::CCMotionStreak::setStroke(
*(_QWORD *)(a1 + 1904),
(float)(*(float *)(a1 + 2268) * *(float *)(a1 + 2472)) * v19);
if ( a2 )
{
PlayerObject::updatePlayerArt(a1);
PlayerObject::updateDashArt(a1);
}
}
}