//
// GJBaseGameLayer::playExitDualEffect from 0x100129860 to 0x100129cc7 (1127 bytes)
//
// 2 xrefs:
// > PlayLayer::destroyPlayer @ 0x1000ba11f
// > GJBaseGameLayer::toggleDualMode @ 0x10012412b
//
// 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 GJBaseGameLayer::playExitDualEffect(GJBaseGameLayer *a1, PlayerObject *a2)
{
__m128 v2; // xmm0
GameManager *v5; // rax
SimplePlayer *v6; // r14
GameManager *v7; // rax
int v8; // esi
SimplePlayer *v9; // rdi
IconType v10; // edx
GameManager *v11; // rax
GameManager *v12; // rax
GameManager *v13; // rax
GameManager *v14; // rax
GameManager *v15; // rax
float v16; // xmm0_4
float v17; // xmm0_4
__int64 v18; // rsi
double v19; // xmm0_8
__int64 v20; // rax
__int64 v21; // r12
cocos2d::CCMoveTo *v22; // r12
__m128 v23; // xmm0
__m128 v24; // xmm1
__m128 v25; // xmm2
unsigned int v26; // ebx
cocos2d::CCRotateBy *v27; // r13
unsigned int v28; // eax
int v29; // ecx
int v30; // r8d
int v31; // r9d
cocos2d::CCAction *v32; // rbx
GLubyte b; // r15
CCCircleWave *v34; // rbx
_BYTE v35[8]; // [rsp+0h] [rbp-70h] BYREF
cocos2d::CCFadeOut *v36; // [rsp+8h] [rbp-68h]
__m128 v37; // [rsp+10h] [rbp-60h]
__m128 v38; // [rsp+20h] [rbp-50h]
_BYTE v39[8]; // [rsp+30h] [rbp-40h] BYREF
cocos2d::CCPoint v40; // [rsp+38h] [rbp-38h] BYREF
cocos2d::ccColor3B v41[16]; // [rsp+40h] [rbp-30h] BYREF
v5 = GameManager::sharedState();
v6 = SimplePlayer::create(v5->m_playerFrame.random - v5->m_playerFrame.seed);
if ( a2->m_isBall )
{
v7 = GameManager::sharedState();
v8 = v7->m_playerBall.random - v7->m_playerBall.seed;
v9 = v6;
v10 = Ball;
}
else if ( a2->m_isShip )
{
v11 = GameManager::sharedState();
v8 = v11->m_playerShip.random - v11->m_playerShip.seed;
v9 = v6;
v10 = Ship;
}
else if ( a2->m_isBird )
{
v12 = GameManager::sharedState();
v8 = v12->m_playerBird.random - v12->m_playerBird.seed;
v9 = v6;
v10 = Ufo;
}
else if ( a2->m_isDart )
{
v13 = GameManager::sharedState();
v8 = v13->m_playerDart.random - v13->m_playerDart.seed;
v9 = v6;
v10 = Wave;
}
else if ( a2->m_isRobot )
{
v14 = GameManager::sharedState();
v8 = v14->m_playerRobot.random - v14->m_playerRobot.seed;
v9 = v6;
v10 = Robot;
}
else
{
if ( !a2->m_isSpider )
goto LABEL_14;
v15 = GameManager::sharedState();
v8 = v15->m_playerSpider.random - v15->m_playerSpider.seed;
v9 = v6;
v10 = Spider;
}
SimplePlayer::updatePlayerFrame(v9, v8, v10);
LABEL_14:
v16 = ((float (__fastcall *)(PlayerObject *))a2->getScaleX)(a2);
((void (__fastcall *)(SimplePlayer *, float))v6->setScaleX)(v6, v16 * a1->m_gameState.m_cameraZoom);
v17 = ((float (__fastcall *)(PlayerObject *))a2->getScaleY)(a2);
((void (__fastcall *)(SimplePlayer *, float))v6->setScaleY)(v6, v17 * a1->m_gameState.m_cameraZoom);
v18 = ((__int64 (__fastcall *)(PlayerObject *))a2->getPosition)(a2);
*(double *)v2.i64 = sub_10028CC60(v39);
((void (__fastcall *)(PlayerObject *, __int64, double))a2->getRotation)(a2, v18, *(double *)v2.i64);
if ( a1->m_gameState.m_unkBool10 )
{
v37 = _mm_xor_ps(v2, (__m128)xmmword_1008150B0);
v19 = ((double (__fastcall *)(SimplePlayer *))v6->getScaleX)(v6);
((void (__fastcall *)(SimplePlayer *, double))v6->setScaleX)(
v6,
COERCE_DOUBLE(*(_QWORD *)&v19 ^ 0x8000000080000000LL));
sub_10028CBE0(&v40, 150.0, 0.0);
sub_10028CCE0(v41, v39);
sub_10028CC90();
v38.i32[0] = 1123632026;
}
else
{
v38.i32[0] = -1023851622;
v37 = v2;
}
((void (__fastcall *)(GJBaseGameLayer *, SimplePlayer *, __int64))a1->addChild_0)(a1, v6, 100);
v20 = ((__int64 (__fastcall *)(PlayerObject *))a2->getColor)(a2);
((void (__fastcall *)(SimplePlayer *, __int64))v6->setColor)(v6, v20);
v41[0] = PlayerObject::getSecondColor(a2);
SimplePlayer::setSecondColor(v6, v41);
SimplePlayer::updateColors(v6);
sub_10028CD00(v41, v39, &a1->m_gameState.m_cameraPosition);
sub_10028CD40(&v40, v41, a1->m_gameState.m_cameraZoom);
((void (__fastcall *)(SimplePlayer *, cocos2d::CCPoint *))v6->setPosition)(v6, &v40);
((void (__fastcall *)(SimplePlayer *, double))v6->setRotation)(v6, *(double *)v37.i64);
v36 = cocos2d::CCFadeOut::create(0.40000001);
v21 = ((__int64 (__fastcall *)(SimplePlayer *))v6->getPosition)(v6);
sub_10028CBE0(v35, v38.f32[0], 0.0);
v37.i64[0] = (__int64)a1;
sub_10028CCE0(&v40, v21);
v22 = cocos2d::CCMoveTo::create(0.40000001, &v40);
v23.f32[0] = ((float (__fastcall *)(SimplePlayer *))v6->getScaleX)(v6);
v24 = _mm_cmplt_ss((__m128)0LL, v23);
v38 = _mm_or_ps(_mm_andnot_ps(v24, (__m128)0xBDCCCCCD), _mm_and_ps(v24, (__m128)0x3DCCCCCDu));
v23.f32[0] = ((float (__fastcall *)(SimplePlayer *))v6->getScaleY)(v6);
v25 = _mm_cmplt_ss((__m128)0LL, v23);
v26 = (unsigned int)cocos2d::CCScaleTo::create(
0.40000001,
v38.f32[0],
COERCE_FLOAT(_mm_andnot_ps(v25, (__m128)0xBDCCCCCD).u32[0] | v25.i32[0] & 0x3DCCCCCD));
v27 = cocos2d::CCRotateBy::create_1(0.40000001, 180.0);
v28 = (unsigned int)cocos2d::CCCallFunc::create(v6, (cocos2d::SEL_CallFunc)0x209uLL);
v32 = (cocos2d::CCAction *)sub_1003B5760(v26, v28, 0, v29, v30, v31);
cocos2d::CCNode::runAction(v6, v36);
cocos2d::CCNode::runAction(v6, v22);
cocos2d::CCNode::runAction(v6, v32);
cocos2d::CCNode::runAction(v6, v27);
LOWORD(v22) = *(_WORD *)&a2->m_playerColor1.r;
b = a2->m_playerColor1.b;
v34 = CCCircleWave::create_1(10.0, 30.0, 0.40000001, 0);
v34->m_color.b = b;
*(_WORD *)&v34->m_color.r = (_WORD)v22;
((void (__fastcall *)(CCCircleWave *, cocos2d::ccColor3B *))v34->setPosition)(v34, v41);
(*(void (__fastcall **)(__int64, CCCircleWave *, _QWORD))(*(_QWORD *)v37.i64[0] + 448LL))(v37.i64[0], v34, 0);
v34->m_circleMode = Outline;
CCCircleWave::followObject(v34, v6, 0);
}