//
// PlayerObject::setupStreak from 0x446e54 to 0x4470c8 (628 bytes)
//
// 1 xrefs:
// > PlayerObject::init @ 0x447c46
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:48:30 +0000
//
int __fastcall PlayerObject::setupStreak(PlayerObject *this)
{
GameManager *v2; // r0
int v3; // r3
_DWORD *v4; // r5
int v5; // r0
const char *v6; // r1
cocos2d::CCString *v7; // r0
int CString; // r0
int v9; // r3
cocos2d::CCMotionStreak *v10; // r0
int v11; // r3
GameManager *v12; // r0
int v13; // r0
int v14; // r3
int v15; // r0
cocos2d::CCTextureCache *SettingsForStreak; // r0
int v17; // r11
int v18; // r10
const char *v19; // r1
int v20; // r0
HardStreak *v21; // r0
int v22; // r0
GameManager *v23; // r0
int v24; // r0
cocos2d::CCTextureCache *v26; // [sp+Ch] [bp-28h]
int v27; // [sp+10h] [bp-24h] BYREF
int v28; // [sp+14h] [bp-20h] BYREF
int v29; // [sp+18h] [bp-1Ch] BYREF
int v30; // [sp+1Ch] [bp-18h]
int v31[3]; // [sp+20h] [bp-14h] BYREF
v2 = (GameManager *)GameManager::sharedState(this);
if ( *((_DWORD *)v2 + 162) - *((_DWORD *)v2 + 163) > 7
|| (v2 = (GameManager *)GameManager::sharedState(v2), *((_DWORD *)v2 + 162) - *((_DWORD *)v2 + 163) > 0) )
{
v2 = (GameManager *)GameManager::sharedState(v2);
if ( *((_DWORD *)v2 + 162) - *((_DWORD *)v2 + 163) <= 7 )
{
v2 = (GameManager *)GameManager::sharedState(v2);
v3 = *((_DWORD *)v2 + 162) - *((_DWORD *)v2 + 163);
}
else
{
v3 = 7;
}
}
else
{
v3 = 1;
}
*((_DWORD *)this + 450) = v3;
v4 = (_DWORD *)((char *)this + 1804);
v5 = GameManager::sharedState(v2);
v6 = *((const char **)this + 450);
*((_BYTE *)this + 1482) = *(_BYTE *)(v5 + 712);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"streak_%02d_001.png", v6);
CString = cocos2d::CCString::getCString(v7);
*((_DWORD *)this + 451) = 1092616192;
switch ( *((_DWORD *)this + 450) )
{
case 2:
case 7:
*v4 = 1096810496;
*((_BYTE *)this + 1808) = 1;
goto LABEL_13;
case 3:
*v4 = 1091043328;
goto LABEL_13;
case 4:
v9 = 1053609165;
goto LABEL_14;
case 5:
*v4 = 1084227584;
*((_BYTE *)this + 1809) = 1;
v9 = 1058642330;
goto LABEL_14;
case 6:
*((_BYTE *)this + 1809) = 1;
*v4 = 1077936128;
v9 = 1065353216;
goto LABEL_14;
default:
LABEL_13:
v9 = 1050253722;
LABEL_14:
v10 = (cocos2d::CCMotionStreak *)cocos2d::CCMotionStreak::create(v9, 1084227584, *v4, &word_BEBBA4, CString);
v11 = *((_DWORD *)this + 450);
*((_DWORD *)this + 386) = v10;
if ( v11 == 6 )
cocos2d::CCMotionStreak::enableRepeatMode(v10, 0.1);
*(_DWORD *)(*((_DWORD *)this + 386) + 368) = 1112014848;
v12 = (GameManager *)(*(int (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 611) + 232))(
*((_DWORD *)this + 611),
*((_DWORD *)this + 386),
-2);
v13 = GameManager::sharedState(v12);
v14 = *(_DWORD *)(v13 + 660) - *(_DWORD *)(v13 + 664);
if ( v14 > 6 )
v14 = 1;
*((_DWORD *)this + 453) = v14;
v15 = *((_DWORD *)this + 453);
if ( v15 > 1 )
{
v27 = 0;
v28 = 0;
SettingsForStreak = (cocos2d::CCTextureCache *)getSettingsForStreak(v15, 1.6, 1.0, (float *)&v27, (float *)&v28);
v17 = v27;
v18 = v28;
v26 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(SettingsForStreak);
getFrameForStreak(v31, *((_DWORD *)this + 453), 0.0);
if ( (v31[0] & 1) != 0 )
v19 = (const char *)v31[2];
else
v19 = (char *)v31 + 1;
v20 = cocos2d::CCTextureCache::addImage(v26, v19, 0);
*((_DWORD *)this + 387) = cocos2d::CCMotionStreak::create(v17, 1065353216, v18, &word_BEBBA4, v20);
std::string::~string((int)v31);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 611) + 232))(
*((_DWORD *)this + 611),
*((_DWORD *)this + 387),
-3);
*(_DWORD *)(*((_DWORD *)this + 387) + 368) = 1112014848;
*(_BYTE *)(*((_DWORD *)this + 387) + 372) = 1;
v29 = 770;
v30 = 1;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 387) + 512))(*((_DWORD *)this + 387), 770, 1);
}
v29 = 770;
v30 = 1;
v21 = (HardStreak *)(*(int (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 386) + 512))(
*((_DWORD *)this + 386),
770,
1);
v22 = HardStreak::create(v21);
*((_DWORD *)this + 388) = v22;
v23 = (GameManager *)(*(int (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 611) + 232))(
*((_DWORD *)this + 611),
v22,
-3);
v24 = GameManager::sharedState(v23);
if ( *(_DWORD *)(v24 + 612) - *(_DWORD *)(v24 + 616) != 15 || *((_BYTE *)this + 1674) )
cocos2d::CCDrawNode::setBlendFunc(*((_DWORD *)this + 388), &v29);
else
*(_BYTE *)(*((_DWORD *)this + 388) + 364) = 1;
return PlayerObject::deactivateStreak((int)this, 1);
}
}