//
// PlayerObject::setupStreak from 0x1404e6a00 to 0x1404e6ee0 (1248 bytes)
//
// 2 xrefs:
// > PlayerObject::init @ 0x1404e5cb8
// > ??> @ 0x140929c24
//
// 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 11:33:11 +0000
//
// Hidden C++ exception states: #wind=8
void __fastcall PlayerObject::setupStreak(__int64 a1)
{
__int64 v2; // rax
int v3; // edx
cocos2d::CCString *v4; // rax
const char *CString; // rdx
float v6; // xmm0_4
float v7; // xmm2_4
cocos2d::CCMotionStreak *v8; // rax
__int64 v9; // rax
int v10; // edx
float v11; // xmm6_4
float v12; // xmm7_4
char *v13; // rax
__int64 v14; // rcx
const char *v15; // rdi
cocos2d::CCTextureCache *v16; // rax
struct cocos2d::CCTexture2D *v17; // rax
char *v18; // rax
__int64 v19; // rcx
void *v20; // [rsp+30h] [rbp-68h]
void *v21; // [rsp+30h] [rbp-68h]
void *v22; // [rsp+30h] [rbp-68h]
__int64 v23; // [rsp+38h] [rbp-60h] BYREF
char v24[32]; // [rsp+40h] [rbp-58h] BYREF
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v20 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
v3 = *(_DWORD *)(v2 + 880) - *(_DWORD *)(v2 + 884);
if ( v3 >= 7 )
{
v3 = 7;
}
else if ( v3 <= 1 )
{
v3 = 1;
}
*(_DWORD *)(a1 + 2344) = v3;
*(_BYTE *)(a1 + 1842) = *(_BYTE *)(v2 + 944);
v4 = cocos2d::CCString::createWithFormat("streak_%02d_001.png", v3);
CString = cocos2d::CCString::getCString(v4);
*(_DWORD *)(a1 + 2348) = 1092616192;
v6 = 0.30000001;
v7 = 10.0;
switch ( *(_DWORD *)(a1 + 2344) )
{
case 2:
case 7:
v7 = 14.0;
*(_BYTE *)(a1 + 2352) = 1;
*(_DWORD *)(a1 + 2348) = 1096810496;
break;
case 3:
*(_DWORD *)(a1 + 2348) = 1091043328;
v7 = 8.5;
break;
case 4:
v6 = 0.40000001;
v7 = 10.0;
break;
case 5:
*(_DWORD *)(a1 + 2348) = 1084227584;
v6 = 0.60000002;
*(_BYTE *)(a1 + 2353) = 1;
v7 = 5.0;
break;
case 6:
v6 = 1.0;
*(_BYTE *)(a1 + 2353) = 1;
*(_DWORD *)(a1 + 2348) = 1077936128;
v7 = 3.0;
break;
default:
break;
}
v8 = cocos2d::CCMotionStreak::create(v6, 5.0, v7, (const struct cocos2d::_ccColor3B *)&word_140704518, CString);
*(_QWORD *)(a1 + 1960) = v8;
if ( *(_DWORD *)(a1 + 2344) == 6 )
cocos2d::CCMotionStreak::enableRepeatMode(v8, 0.1);
*(_DWORD *)(*(_QWORD *)(a1 + 1960) + 464LL) = 1112014848;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 3120) + 456LL))(
*(_QWORD *)(a1 + 3120),
*(_QWORD *)(a1 + 1960),
4294967294LL);
v9 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v21 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v9 = qword_14090BFD0;
}
v10 = *(_DWORD *)(v9 + 892) - *(_DWORD *)(v9 + 896);
*(_DWORD *)(a1 + 2356) = v10;
if ( v10 <= 6 )
{
if ( v10 > 1 )
{
switch ( v10 )
{
case 2:
v11 = 0.063600004;
v12 = 22.0;
break;
case 3:
v11 = 0.1278;
v12 = 28.599998;
break;
case 4:
v11 = 0.105;
v12 = 28.599998;
break;
case 5:
v11 = 0.090000004;
v12 = 18.700001;
break;
default:
v11 = 0.096000001;
v12 = 27.0;
break;
}
v13 = sub_1404E4310(v24, v10, 0.0);
v15 = v13;
if ( *((_QWORD *)v13 + 3) > 0xFu )
v15 = *(const char **)v13;
v16 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v14);
v17 = cocos2d::CCTextureCache::addImage(v16, v15, 0);
*(_QWORD *)(a1 + 1968) = cocos2d::CCMotionStreak::create(
v11,
1.0,
v12,
(const struct cocos2d::_ccColor3B *)&word_140704518,
v17);
sub_14003D310((__int64)v24);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 3120) + 456LL))(
*(_QWORD *)(a1 + 3120),
*(_QWORD *)(a1 + 1968),
4294967293LL);
*(_DWORD *)(*(_QWORD *)(a1 + 1968) + 464LL) = 1112014848;
*(_BYTE *)(*(_QWORD *)(a1 + 1968) + 468LL) = 1;
(**(void (__fastcall ***)(__int64, __int64))(*(_QWORD *)(a1 + 1968) + 344LL))(
*(_QWORD *)(a1 + 1968) + 344LL,
0x100000302LL);
}
}
else
{
*(_DWORD *)(a1 + 2356) = 1;
}
v23 = 0x100000302LL;
(**(void (__fastcall ***)(__int64, __int64))(*(_QWORD *)(a1 + 1960) + 344LL))(
*(_QWORD *)(a1 + 1960) + 344LL,
0x100000302LL);
v18 = HardStreak::create();
*(_QWORD *)(a1 + 1976) = v18;
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 3120) + 456LL))(
*(_QWORD *)(a1 + 3120),
v18,
4294967293LL);
v19 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v22 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v19 = qword_14090BFD0;
}
if ( *(_DWORD *)(v19 + 844) - *(_DWORD *)(v19 + 848) != 15 || *(_BYTE *)(a1 + 2098) )
cocos2d::CCDrawNode::setBlendFunc(*(cocos2d::CCDrawNode **)(a1 + 1976), (const struct cocos2d::_ccBlendFunc *)&v23);
else
*(_BYTE *)(*(_QWORD *)(a1 + 1976) + 440LL) = 1;
cocos2d::CCMotionStreak::stopStroke(*(cocos2d::CCMotionStreak **)(a1 + 1960));
if ( *(_BYTE *)(a1 + 2432) )
{
*(_BYTE *)(a1 + 2432) = 0;
PlayerObject::fadeOutStreak2(a1);
}
}