//
// PlayerObject::playerDestroyed from 0x100413a60 to 0x100413c56 (502 bytes)
//
// 3 xrefs:
// > PlayLayer::destroyPlayer @ 0x1000ba0fd
// > PlayLayer::destroyPlayer @ 0x1000ba12c
// > LevelEditorLayer::postUpdate @ 0x1000f3532
//
// 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 __fastcall PlayerObject::playerDestroyed(PlayerObject *a1, bool a2)
{
cocos2d::CCFadeOut *v3; // r15
cocos2d::CCCallFunc *v4; // rax
cocos2d::CCSequence *v5; // r15
double *v6; // rax
double v7; // xmm0_8
PlayerFireBoostSprite *m_robotFire; // rdi
if ( a1->m_isDart && !cocos2d::CCNode::getActionByTag(a1->m_waveTrail, 8) )
{
v3 = cocos2d::CCFadeOut::create(0.2);
v4 = cocos2d::CCCallFunc::create(a1->m_waveTrail, (cocos2d::SEL_CallFunc)(unsigned __int64)HardStreak::stopStroke);
v5 = sub_1003B5760(v3, v4, 0);
((void (__fastcall *)(cocos2d::CCSequence *, __int64))v5->setTag)(v5, 8);
cocos2d::CCNode::runAction(a1->m_waveTrail, v5);
}
PlayerObject::stopDashing(a1);
a1->m_isDead = 1;
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
if ( a1->m_hasGroundParticles )
cocos2d::CCParticleSystem::stopSystem(a1->m_playerGroundParticles);
a1->m_hasGroundParticles = 0;
cocos2d::CCParticleSystem::stopSystem(a1->m_trailingParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_shipClickParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_vehicleGroundParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles);
v6 = (double *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v7 = sub_10028CC90(&a1->m_lastPosition, v6);
m_robotFire = a1->m_robotFire;
if ( m_robotFire )
{
cocos2d::CCNode::stopAllActions(m_robotFire);
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD, double))a1->m_robotFire->setVisible)(a1->m_robotFire, 0, v7);
}
PlayerObject::toggleGhostEffect(a1, (GhostType)0);
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD, double))a1->m_swingFireMiddle->setVisible)(
a1->m_swingFireMiddle,
0,
v7);
cocos2d::CCNode::stopAllActions(a1->m_swingFireMiddle);
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD))a1->m_swingFireBottom->setVisible)(a1->m_swingFireBottom, 0);
cocos2d::CCNode::stopAllActions(a1->m_swingFireBottom);
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD))a1->m_swingFireTop->setVisible)(a1->m_swingFireTop, 0);
cocos2d::CCNode::stopAllActions(a1->m_swingFireTop);
cocos2d::CCParticleSystem::stopSystem(a1->m_swingBurstParticles1);
cocos2d::CCParticleSystem::stopSystem(a1->m_swingBurstParticles2);
if ( a2 || !a1->m_playEffects || a1->m_isHidden )
((void (__fastcall *)(PlayerObject *, _QWORD))a1->setOpacity)(a1, 0);
else
PlayerObject::playDeathEffect(a1);
}