//
// PlayerObject::init from 0x1003fa6d0 to 0x1003fbcd4 (5636 bytes)
//
// 1 xrefs:
// > PlayerObject::create @ 0x1003fa687
//
// 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
//
bool __fastcall PlayerObject::init(
PlayerObject *a1,
int a2,
int a3,
GJBaseGameLayer *a4,
cocos2d::CCLayer *a5,
bool a6)
{
double v6; // xmm0_8
int v7; // r15d
int v8; // r14d
GameManager *v10; // rax
GameManager *v11; // rax
GameManager *v12; // rax
int m_iconRequestID; // ecx
cocos2d::CCString *v14; // rax
const char *CString; // r15
size_t v16; // rax
size_t v17; // r14
char *v18; // r12
size_t v19; // r13
cocos2d::CCString *v20; // rax
const char *v21; // r14
size_t v22; // rax
size_t v23; // r15
char *v24; // r12
size_t v25; // r13
const char *v26; // r14
const char *v27; // rsi
cocos2d::CCNode *v28; // rax
GameManager *v29; // rax
GameManager *v30; // rax
GameManager *v31; // rax
GameStatsManager *v32; // rax
GameStatsManager *v33; // rax
GameStatsManager *v34; // rdi
cocos2d::CCArray *v35; // rax
cocos2d::CCSprite *v36; // rax
const char *v37; // r14
const char *v38; // rdi
cocos2d::CCSprite *v39; // rax
cocos2d::CCSprite *m_iconSpriteSecondary; // r15
cocos2d::CCSprite *v41; // rax
cocos2d::CCSprite *m_iconSpriteWhitener; // r14
cocos2d::CCString *v43; // rax
const char *v44; // r14
size_t v45; // rax
size_t v46; // r15
char *v47; // r12
size_t v48; // r13
cocos2d::CCString *v49; // rax
const char *v50; // r14
size_t v51; // rax
size_t v52; // r15
char *v53; // r12
size_t v54; // r13
cocos2d::CCString *v55; // rax
const char *v56; // r14
size_t v57; // rax
size_t v58; // r15
char *v59; // r12
const char *v60; // rdi
size_t v61; // r13
cocos2d::CCSprite *v62; // rax
const char *v63; // r14
const char *v64; // rdi
cocos2d::CCSprite *v65; // rax
cocos2d::CCSprite *m_vehicleSpriteSecondary; // r15
const char *v67; // rdi
cocos2d::CCSprite *v68; // rax
cocos2d::CCSprite *m_birdVehicle; // r15
cocos2d::CCSprite *v70; // rax
cocos2d::CCSprite *m_vehicleSpriteWhitener; // r14
cocos2d::CCString *v72; // rax
const char *v73; // r14
size_t v74; // rax
size_t v75; // r15
char *v76; // r12
size_t v77; // r13
GameManager *v78; // rax
PlayerFireBoostSprite *v79; // rax
GameManager *v80; // rax
PlayerFireBoostSprite *v81; // r14
PlayerFireBoostSprite *v82; // r14
PlayerFireBoostSprite *v83; // r14
PlayerFireBoostSprite *m_swingFireMiddle; // r14
PlayerFireBoostSprite *m_swingFireBottom; // r14
PlayerFireBoostSprite *m_swingFireTop; // r14
GameObject *v87; // rax
cocos2d::CCDictionary *v88; // rax
cocos2d::CCDictionary *v89; // rax
cocos2d::CCDictionary *v90; // rax
cocos2d::CCDictionary *v91; // rax
cocos2d::CCDictionary *v92; // rdi
cocos2d::CCArray *v93; // rax
GJActionManager *v94; // rax
cocos2d::CCParticleSystemQuad *v95; // rax
cocos2d::CCParticleSystemQuad *v96; // rax
cocos2d::CCParticleSystemQuad *v97; // rax
cocos2d::CCParticleSystemQuad *v98; // rax
cocos2d::CCParticleSystemQuad *v99; // rax
cocos2d::CCParticleSystemQuad *m_trailingParticles; // r14
cocos2d::CCParticleSystemQuad *v101; // rax
cocos2d::CCParticleSystemQuad *v102; // r14
float v103; // xmm0_4
cocos2d::CCParticleSystemQuad *v104; // r14
float v105; // xmm0_4
cocos2d::CCParticleSystemQuad *m_shipClickParticles; // r14
cocos2d::CCParticleSystemQuad *v107; // r14
float v108; // xmm0_4
cocos2d::CCParticleSystemQuad *v109; // r14
float v110; // xmm0_4
cocos2d::CCParticleSystemQuad *v111; // r14
float v112; // xmm0_4
cocos2d::CCParticleSystemQuad *v113; // r14
float v114; // xmm0_4
cocos2d::CCParticleSystemQuad *v115; // r14
float v116; // xmm0_4
cocos2d::CCParticleSystemQuad *v117; // rdi
cocos2d::CCParticleSystemQuad *v118; // rdi
cocos2d::CCParticleSystemQuad *v119; // rdi
cocos2d::CCParticleSystemQuad *v120; // rdi
cocos2d::CCParticleSystemQuad *v121; // r14
cocos2d::CCParticleSystemQuad *v122; // r14
cocos2d::CCParticleSystemQuad *v123; // rax
cocos2d::CCParticleSystemQuad *v124; // rax
double v125; // xmm0_8
cocos2d::CCParticleSystemQuad *v126; // rax
cocos2d::CCString *v127; // rax
const char *v128; // r14
size_t v129; // rax
size_t v130; // r15
char *v131; // r12
size_t v132; // r13
cocos2d::CCSprite *v133; // rax
cocos2d::CCSprite *m_dashSpritesContainer; // rsi
cocos2d::CCSprite *v135; // rax
cocos2d::CCSprite *m_dashFireSprite; // r14
cocos2d::CCSprite *v137; // r14
const char *v138; // rdi
cocos2d::CCSprite *v139; // rax
cocos2d::CCString *v140; // rax
const char *v141; // r14
size_t v142; // rax
size_t v143; // r15
char *v144; // r12
const char *v145; // rdi
size_t v146; // r13
cocos2d::CCSprite *v147; // rax
GameManager *v148; // rax
GameManager *v149; // rax
GameManager *v150; // rax
std::__vector_base::pointer begin; // rax
unsigned __int64 v152; // rdx
char v154; // [rsp+0h] [rbp-120h]
char v155; // [rsp+0h] [rbp-120h]
cocos2d::CCLayer *v156; // [rsp+0h] [rbp-120h]
char v157; // [rsp+0h] [rbp-120h]
char v158; // [rsp+0h] [rbp-120h]
char v159; // [rsp+0h] [rbp-120h]
char v160; // [rsp+0h] [rbp-120h]
char v161; // [rsp+0h] [rbp-120h]
__m128d v164; // [rsp+10h] [rbp-110h]
_QWORD v165[2]; // [rsp+20h] [rbp-100h] BYREF
void *__p; // [rsp+30h] [rbp-F0h]
_QWORD v167[2]; // [rsp+38h] [rbp-E8h] BYREF
void *v168; // [rsp+48h] [rbp-D8h]
int v169; // [rsp+50h] [rbp-D0h] BYREF
_QWORD __dst[2]; // [rsp+58h] [rbp-C8h] BYREF
void *v171; // [rsp+68h] [rbp-B8h]
_QWORD v172[2]; // [rsp+70h] [rbp-B0h] BYREF
void *v173; // [rsp+80h] [rbp-A0h]
_QWORD v174[2]; // [rsp+88h] [rbp-98h] BYREF
void *v175; // [rsp+98h] [rbp-88h]
_QWORD v176[2]; // [rsp+A0h] [rbp-80h] BYREF
void *v177; // [rsp+B0h] [rbp-70h]
_QWORD v178[2]; // [rsp+B8h] [rbp-68h] BYREF
void *v179; // [rsp+C8h] [rbp-58h]
int v180; // [rsp+D0h] [rbp-50h]
int v181; // [rsp+D4h] [rbp-4Ch]
__int128 v182; // [rsp+D8h] [rbp-48h] BYREF
void *v183; // [rsp+E8h] [rbp-38h]
bool v184; // [rsp+F7h] [rbp-29h]
double v185; // 0:xmm0_8.8
double v186; // 0:xmm0_8.8
double v187; // 0:xmm0_8.8
double v188; // 0:xmm0_8.8
double v189; // 0:xmm0_8.8
double v190; // 0:xmm0_8.8
double v191; // 0:xmm0_8.8
v154 = (char)a5;
v7 = 485;
if ( a2 < 485 )
v7 = a2;
if ( v7 < 2 )
v7 = 1;
v8 = 169;
if ( a3 < 169 )
v8 = a3;
if ( v8 < 2 )
v8 = 1;
v10 = GameManager::sharedState();
a1->m_iconRequestID = GameManager::getIconRequestID(v10);
v11 = GameManager::sharedState();
GameManager::loadIcon(v11, v7, 0, a1->m_iconRequestID);
v12 = GameManager::sharedState();
m_iconRequestID = a1->m_iconRequestID;
v181 = v8;
GameManager::loadIcon(v12, v8, 1, m_iconRequestID);
v180 = v7;
v14 = (cocos2d::CCString *)sub_1007AB580("player_%02d_001.png", v154);
CString = cocos2d::CCString::getCString(v14);
v16 = strlen(CString);
if ( v16 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v6);
v17 = v16;
if ( v16 >= 0x17 )
{
v19 = 26;
if ( (v16 | 7) != 0x17 )
v19 = (v16 | 7) + 1;
v18 = (char *)operator new(v19);
v171 = v18;
__dst[0] = v19 + 1;
__dst[1] = v17;
goto LABEL_16;
}
LOBYTE(__dst[0]) = 2 * v16;
v18 = (char *)__dst + 1;
if ( v16 )
LABEL_16:
memmove(v18, CString, v17);
v18[v17] = 0;
v20 = (cocos2d::CCString *)sub_1007AB580("player_%02d_2_001.png", v155);
v21 = cocos2d::CCString::getCString(v20);
v22 = strlen(v21);
if ( v22 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v6);
v23 = v22;
if ( v22 >= 0x17 )
{
v25 = 26;
if ( (v22 | 7) != 0x17 )
v25 = (v22 | 7) + 1;
v24 = (char *)operator new(v25);
v173 = v24;
v172[0] = v25 | 1;
v172[1] = v23;
goto LABEL_24;
}
LOBYTE(v172[0]) = 2 * v22;
v24 = (char *)v172 + 1;
if ( v22 )
LABEL_24:
memmove(v24, v21, v23);
v26 = (char *)__dst + 1;
v24[v23] = 0;
v27 = (char *)__dst + 1;
if ( (__dst[0] & 1) != 0 )
v27 = (const char *)v171;
v184 = GameObject::init(a1, v27);
if ( !v184 )
goto LABEL_108;
a1->m_bUnkBool2 = 0;
a1->m_bDontDraw = 1;
v28 = cocos2d::CCNode::create();
a1->m_mainLayer = v28;
((void (__fastcall *)(cocos2d::CCNode *, void *))v28->setContentSize)(v28, &unk_1009A1560);
((void (__fastcall *)(PlayerObject *, cocos2d::CCNode *))a1->addChild)(a1, a1->m_mainLayer);
std::string::assign((std::string *)&a1->m_currentRobotAnimation, "run");
v29 = GameManager::sharedState();
a1->m_switchWaveTrailColor = GameManager::getGameVariable(v29, "0096");
v30 = GameManager::sharedState();
a1->m_practiceDeathEffect = GameManager::getGameVariable(v30, "0100");
v31 = GameManager::sharedState();
a1->m_gv0123 = GameManager::getGameVariable(v31, "0123");
v32 = GameStatsManager::sharedState();
a1->m_robotAnimation1Enabled = GameStatsManager::isItemEnabled(v32, GJItem, 18);
v33 = GameStatsManager::sharedState();
a1->m_robotAnimation2Enabled = GameStatsManager::isItemEnabled(v33, GJItem, 19);
v34 = GameStatsManager::sharedState();
a1->m_spiderAnimationEnabled = GameStatsManager::isItemEnabled(v34, GJItem, 20);
a1->m_maybeSavedPlayerFrame = v180;
a1->m_ghostType = 0;
a1->m_playerSpeed = 0.89999998;
a1->m_playerSpeedAC = (float)((float)((float)rand() * 4.6566129e-10) * 10.0) + 5.0;
a1->m_gameLayer = a4;
a1->m_parentLayer = v156;
a1->m_playEffects = a6;
a1->m_maybeCanRunIntoBlocks = !a6;
v35 = (cocos2d::CCArray *)sub_10071F9E0(v34, 12);
a1->m_touchingRings = v35;
cocos2d::CCObject::retain(v35);
((void (__fastcall *)(PlayerObject *, void *))a1->setTextureRect)(a1, &unk_1009A1568);
if ( (__dst[0] & 1) != 0 )
v26 = (const char *)v171;
v36 = cocos2d::CCSprite::createWithSpriteFrameName(v26);
a1->m_iconSprite = v36;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v36,
1);
v37 = (char *)v172 + 1;
v38 = (char *)v172 + 1;
if ( (v172[0] & 1) != 0 )
v38 = (const char *)v173;
v39 = cocos2d::CCSprite::createWithSpriteFrameName(v38);
a1->m_iconSpriteSecondary = v39;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_iconSprite->addChild_0)(
a1->m_iconSprite,
v39,
0xFFFFFFFFLL);
m_iconSpriteSecondary = a1->m_iconSpriteSecondary;
*(cocos2d::CCPoint *)&v185 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v174,
(const cocos2d::CCPoint *)a1->m_iconSprite);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD *, double))m_iconSpriteSecondary->setPosition)(
m_iconSpriteSecondary,
v174,
v185);
if ( (v172[0] & 1) != 0 )
v37 = (const char *)v173;
v41 = cocos2d::CCSprite::createWithSpriteFrameName(v37);
a1->m_iconSpriteWhitener = v41;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_iconSprite->addChild_0)(
a1->m_iconSprite,
v41,
2);
m_iconSpriteWhitener = a1->m_iconSpriteWhitener;
*(cocos2d::CCPoint *)&v186 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v174,
(const cocos2d::CCPoint *)a1->m_iconSprite);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD *, double))m_iconSpriteWhitener->setPosition)(
m_iconSpriteWhitener,
v174,
v186);
v43 = (cocos2d::CCString *)sub_1007AB580("player_%02d_extra_001.png", (char)v156);
v44 = cocos2d::CCString::getCString(v43);
v45 = strlen(v44);
if ( v45 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v186);
v46 = v45;
if ( v45 >= 0x17 )
{
v48 = 26;
if ( (v45 | 7) != 0x17 )
v48 = (v45 | 7) + 1;
v47 = (char *)operator new(v48);
__p = v47;
v165[0] = v48 | 1;
v165[1] = v46;
goto LABEL_41;
}
LOBYTE(v165[0]) = 2 * v45;
v47 = (char *)v165 + 1;
if ( v45 )
LABEL_41:
memmove(v47, v44, v46);
v47[v46] = 0;
PlayerObject::updatePlayerSpriteExtra(a1, v165);
if ( (v165[0] & 1) != 0 )
operator delete(__p);
v49 = (cocos2d::CCString *)sub_1007AB580("ship_%02d_001.png", v157);
v50 = cocos2d::CCString::getCString(v49);
v51 = strlen(v50);
if ( v51 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v186);
v52 = v51;
if ( v51 >= 0x17 )
{
v54 = 26;
if ( (v51 | 7) != 0x17 )
v54 = (v51 | 7) + 1;
v53 = (char *)operator new(v54);
v175 = v53;
v174[0] = v54 | 1;
v174[1] = v52;
goto LABEL_51;
}
LOBYTE(v174[0]) = 2 * v51;
v53 = (char *)v174 + 1;
if ( v51 )
LABEL_51:
memmove(v53, v50, v52);
v53[v52] = 0;
v55 = (cocos2d::CCString *)sub_1007AB580("ship_%02d_2_001.png", v158);
v56 = cocos2d::CCString::getCString(v55);
v57 = strlen(v56);
if ( v57 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v186);
v58 = v57;
if ( v57 >= 0x17 )
{
v61 = 26;
if ( (v57 | 7) != 0x17 )
v61 = (v57 | 7) + 1;
v59 = (char *)operator new(v61);
v177 = v59;
v176[0] = v61 | 1;
v176[1] = v58;
LABEL_60:
memmove(v59, v56, v58);
v59[v58] = 0;
if ( (v174[0] & 1) != 0 )
goto LABEL_56;
goto LABEL_61;
}
LOBYTE(v176[0]) = 2 * v57;
v59 = (char *)v176 + 1;
if ( v57 )
goto LABEL_60;
BYTE1(v176[0]) = 0;
if ( (v174[0] & 1) != 0 )
{
LABEL_56:
v60 = (const char *)v175;
goto LABEL_62;
}
LABEL_61:
v60 = (char *)v174 + 1;
LABEL_62:
v62 = cocos2d::CCSprite::createWithSpriteFrameName(v60);
a1->m_vehicleSprite = v62;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v62,
2);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_vehicleSprite->setVisible)(a1->m_vehicleSprite, 0);
v63 = (char *)v176 + 1;
v64 = (char *)v176 + 1;
if ( (v176[0] & 1) != 0 )
v64 = (const char *)v177;
v65 = cocos2d::CCSprite::createWithSpriteFrameName(v64);
a1->m_vehicleSpriteSecondary = v65;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_vehicleSprite->addChild_0)(
a1->m_vehicleSprite,
v65,
0xFFFFFFFFLL);
m_vehicleSpriteSecondary = a1->m_vehicleSpriteSecondary;
*(cocos2d::CCPoint *)&v187 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v182,
(const cocos2d::CCPoint *)a1->m_vehicleSprite);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *, double))m_vehicleSpriteSecondary->setPosition)(
m_vehicleSpriteSecondary,
&v182,
v187);
v67 = (char *)v176 + 1;
if ( (v176[0] & 1) != 0 )
v67 = (const char *)v177;
v68 = cocos2d::CCSprite::createWithSpriteFrameName(v67);
a1->m_birdVehicle = v68;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_vehicleSprite->addChild_0)(
a1->m_vehicleSprite,
v68,
4294967294LL);
m_birdVehicle = a1->m_birdVehicle;
*(cocos2d::CCPoint *)&v188 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v182,
(const cocos2d::CCPoint *)a1->m_vehicleSprite);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *, double))m_birdVehicle->setPosition)(m_birdVehicle, &v182, v188);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_birdVehicle->setVisible)(a1->m_birdVehicle, 0);
if ( (v176[0] & 1) != 0 )
v63 = (const char *)v177;
v70 = cocos2d::CCSprite::createWithSpriteFrameName(v63);
a1->m_vehicleSpriteWhitener = v70;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_vehicleSprite->addChild_0)(
a1->m_vehicleSprite,
v70,
1);
m_vehicleSpriteWhitener = a1->m_vehicleSpriteWhitener;
*(cocos2d::CCPoint *)&v189 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v182,
(const cocos2d::CCPoint *)a1->m_vehicleSprite);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *, double))m_vehicleSpriteWhitener->setPosition)(
m_vehicleSpriteWhitener,
&v182,
v189);
v72 = (cocos2d::CCString *)sub_1007AB580("ship_%02d_extra_001.png", v159);
v73 = cocos2d::CCString::getCString(v72);
v74 = strlen(v73);
if ( v74 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v189);
v75 = v74;
if ( v74 >= 0x17 )
{
v77 = 26;
if ( (v74 | 7) != 0x17 )
v77 = (v74 | 7) + 1;
v76 = (char *)operator new(v77);
v168 = v76;
v167[0] = v77 | 1;
v167[1] = v75;
goto LABEL_75;
}
LOBYTE(v167[0]) = 2 * v74;
v76 = (char *)v167 + 1;
if ( v74 )
LABEL_75:
memmove(v76, v73, v75);
v76[v75] = 0;
PlayerObject::updateShipSpriteExtra(a1, v167);
if ( (v167[0] & 1) != 0 )
operator delete(v168);
v78 = GameManager::sharedState();
PlayerObject::createRobot(a1, v78->m_playerRobot.random - v78->m_playerRobot.seed);
v79 = PlayerFireBoostSprite::create();
a1->m_robotFire = v79;
((void (__fastcall *)(cocos2d::CCNode *, PlayerFireBoostSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v79,
0xFFFFFFFFLL);
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD))a1->m_robotFire->setVisible)(a1->m_robotFire, 0);
v80 = GameManager::sharedState();
PlayerObject::createSpider(a1, v80->m_playerSpider.random - v80->m_playerSpider.seed);
v81 = PlayerFireBoostSprite::create();
((void (__fastcall *)(cocos2d::CCNode *, PlayerFireBoostSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v81,
0xFFFFFFFFLL);
v81->m_size = 0.96000004;
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD))v81->setVisible)(v81, 0);
a1->m_swingFireMiddle = v81;
v82 = PlayerFireBoostSprite::create();
((void (__fastcall *)(cocos2d::CCNode *, PlayerFireBoostSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v82,
0xFFFFFFFFLL);
v82->m_size = 0.72000003;
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD))v82->setVisible)(v82, 0);
a1->m_swingFireBottom = v82;
v83 = PlayerFireBoostSprite::create();
((void (__fastcall *)(cocos2d::CCNode *, PlayerFireBoostSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v83,
0xFFFFFFFFLL);
v83->m_size = 0.72000003;
((void (__fastcall *)(PlayerFireBoostSprite *, _QWORD))v83->setVisible)(v83, 0);
a1->m_swingFireTop = v83;
((void (__fastcall *)(PlayerFireBoostSprite *, float))a1->m_swingFireMiddle->setRotation)(a1->m_swingFireMiddle, 90.0);
m_swingFireMiddle = a1->m_swingFireMiddle;
sub_10028CBE0((float *)&v182, -14.0, 0.0);
((void (__fastcall *)(PlayerFireBoostSprite *, __int128 *))m_swingFireMiddle->setPosition)(m_swingFireMiddle, &v182);
((void (__fastcall *)(PlayerFireBoostSprite *, float))a1->m_swingFireBottom->setRotation)(a1->m_swingFireBottom, 45.0);
m_swingFireBottom = a1->m_swingFireBottom;
sub_10028CBE0((float *)&v182, -9.5, -10.0);
((void (__fastcall *)(PlayerFireBoostSprite *, __int128 *))m_swingFireBottom->setPosition)(m_swingFireBottom, &v182);
((void (__fastcall *)(PlayerFireBoostSprite *, float))a1->m_swingFireTop->setRotation)(a1->m_swingFireTop, 135.0);
m_swingFireTop = a1->m_swingFireTop;
sub_10028CBE0((float *)&v182, -9.5, 10.0);
((void (__fastcall *)(PlayerFireBoostSprite *, __int128 *))m_swingFireTop->setPosition)(m_swingFireTop, &v182);
a1->m_yVelocity = 0.0;
a1->m_maybeIsBoosted = 0;
a1->m_isOnGround2 = 0;
*(_WORD *)&a1->m_isDead = 0;
a1->m_vehicleSize = 1.0;
a1->m_unkAngle1 = 30.0;
PlayerObject::updateTimeMod(a1, 0.89999998, 0);
a1->m_pendingCheckpoint = nullptr;
v87 = (GameObject *)cocos2d::CCNode::create();
a1->m_maybeLastGroundObject = v87;
cocos2d::CCObject::retain(v87);
v88 = cocos2d::CCDictionary::create();
a1->m_collisionLogTop = v88;
cocos2d::CCObject::retain(v88);
v89 = cocos2d::CCDictionary::create();
a1->m_collisionLogBottom = v89;
cocos2d::CCObject::retain(v89);
v90 = cocos2d::CCDictionary::create();
a1->m_collisionLogLeft = v90;
cocos2d::CCObject::retain(v90);
v91 = cocos2d::CCDictionary::create();
a1->m_collisionLogRight = v91;
v92 = v91;
cocos2d::CCObject::retain(v91);
v93 = (cocos2d::CCArray *)sub_10071F9E0(v92, 0);
a1->m_particleSystems = v93;
cocos2d::CCObject::retain(v93);
v94 = GJActionManager::create();
a1->m_actionManager = v94;
cocos2d::CCObject::retain(v94);
v95 = cocos2d::CCParticleSystemQuad::create("dragEffect.plist", 0);
a1->m_playerGroundParticles = v95;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v95->setPositionType)(v95, 1);
cocos2d::CCParticleSystem::stopSystem(a1->m_playerGroundParticles);
sub_10071FCD0(a1->m_particleSystems, a1->m_playerGroundParticles);
a1->m_hasGroundParticles = 0;
v96 = cocos2d::CCParticleSystemQuad::create("dashEffect.plist", 0);
a1->m_dashParticles = v96;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v96->setPositionType)(v96, 1);
cocos2d::CCParticleSystem::stopSystem(a1->m_dashParticles);
sub_10071FCD0(a1->m_particleSystems, a1->m_dashParticles);
v97 = cocos2d::CCParticleSystemQuad::create("burstEffect.plist", 0);
a1->m_ufoClickParticles = v97;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v97->setPositionType)(v97, 1);
cocos2d::CCParticleSystem::stopSystem(a1->m_ufoClickParticles);
sub_10071FCD0(a1->m_particleSystems, a1->m_ufoClickParticles);
v98 = cocos2d::CCParticleSystemQuad::create("burstEffect2.plist", 0);
a1->m_robotBurstParticles = v98;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v98->setPositionType)(v98, 1);
cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles);
sub_10071FCD0(a1->m_particleSystems, a1->m_robotBurstParticles);
v99 = cocos2d::CCParticleSystemQuad::create("dragEffect.plist", 0);
a1->m_trailingParticles = v99;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v99->setPositionType)(v99, 1);
sub_10071FCD0(a1->m_particleSystems, a1->m_trailingParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_trailingParticles);
a1->m_trailingParticleLife = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_trailingParticles->getLife)(a1->m_trailingParticles);
m_trailingParticles = a1->m_trailingParticles;
sub_10028CBE0((float *)&v182, 0.0, 2.0);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))m_trailingParticles->setPosVar)(
m_trailingParticles,
&v182);
v101 = cocos2d::CCParticleSystemQuad::create("dragEffect.plist", 0);
a1->m_shipClickParticles = v101;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v101->setPositionType)(v101, 1);
sub_10071FCD0(a1->m_particleSystems, a1->m_shipClickParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_shipClickParticles);
v102 = a1->m_trailingParticles;
v103 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v102->getSpeed)(v102);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v102->setSpeed)(v102, v103 * 0.2);
v104 = a1->m_trailingParticles;
v105 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v104->getSpeedVar)(v104);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v104->setSpeedVar)(v104, v105 * 0.2);
m_shipClickParticles = a1->m_shipClickParticles;
sub_10028CBE0((float *)&v182, 0.0, 2.0);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))m_shipClickParticles->setPosVar)(
m_shipClickParticles,
&v182);
v107 = a1->m_shipClickParticles;
v108 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v107->getSpeed)(v107);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v107->setSpeed)(v107, v108 + v108);
v109 = a1->m_shipClickParticles;
v110 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v109->getSpeedVar)(v109);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v109->setSpeedVar)(v109, v110 + v110);
v111 = a1->m_shipClickParticles;
v112 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v111->getAngleVar)(v111);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v111->setAngleVar)(v111, v112 + v112);
v113 = a1->m_shipClickParticles;
v114 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v113->getStartSize)(v113);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v113->setStartSize)(v113, v114 * 1.5);
v115 = a1->m_shipClickParticles;
v116 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v115->getStartSizeVar)(v115);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v115->setStartSizeVar)(v115, v116 * 1.5);
a1->m_hasShipParticles = 0;
v117 = a1->m_trailingParticles;
v182 = xmmword_10081B770;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v117->setStartColor)(v117, &v182);
v118 = a1->m_trailingParticles;
v164 = _mm_unpacklo_pd((__m128d)0x3F800000u, (__m128d)xmmword_1008150D0);
v182 = (__int128)v164;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v118->setEndColor)(v118, &v182);
v119 = a1->m_shipClickParticles;
v182 = xmmword_10081B780;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v119->setStartColor)(v119, &v182);
v120 = a1->m_shipClickParticles;
v182 = (__int128)v164;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v120->setEndColor)(v120, &v182);
v121 = cocos2d::CCParticleSystemQuad::create("swingBurstEffect.plist", 0);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v121->setPositionType)(v121, 2);
sub_10071FCD0(a1->m_particleSystems, v121);
cocos2d::CCParticleSystem::stopSystem(v121);
v182 = xmmword_10081B770;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v121->setStartColor)(v121, &v182);
v182 = (__int128)v164;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v121->setEndColor)(v121, &v182);
a1->m_swingBurstParticles1 = v121;
v122 = cocos2d::CCParticleSystemQuad::create("swingBurstEffect.plist", 0);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v122->setPositionType)(v122, 2);
sub_10071FCD0(a1->m_particleSystems, v122);
cocos2d::CCParticleSystem::stopSystem(v122);
v182 = xmmword_10081B770;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v122->setStartColor)(v122, &v182);
v182 = (__int128)v164;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int128 *))v122->setEndColor)(v122, &v182);
a1->m_swingBurstParticles2 = v122;
v123 = cocos2d::CCParticleSystemQuad::create("shipDragEffect.plist", 0);
a1->m_vehicleGroundParticles = v123;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v123->setPositionType)(v123, 2);
sub_10071FCD0(a1->m_particleSystems, a1->m_vehicleGroundParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_vehicleGroundParticles);
v124 = cocos2d::CCParticleSystemQuad::create("landEffect.plist", 0);
a1->m_landParticles0 = v124;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v124->setPositionType)(v124, 2);
sub_10071FCD0(a1->m_particleSystems, a1->m_landParticles0);
cocos2d::CCParticleSystem::stopSystem(a1->m_landParticles0);
a1->m_landParticlesAngle = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_landParticles0->getAngle)(a1->m_landParticles0);
*(_QWORD *)&v125 = *(unsigned int *)(((__int64 (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_landParticles0->getGravity)(a1->m_landParticles0)
+ 4);
a1->m_landParticleRelatedY = *(float *)&v125;
v126 = cocos2d::CCParticleSystemQuad::create("landEffect.plist", 0);
a1->m_landParticles1 = v126;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v126->setPositionType)(v126, 2);
sub_10071FCD0(a1->m_particleSystems, a1->m_landParticles1);
cocos2d::CCParticleSystem::stopSystem(a1->m_landParticles1);
PlayerObject::setupStreak(a1);
v127 = (cocos2d::CCString *)sub_1007AB580("player_%02d_glow_001.png", v160);
v128 = cocos2d::CCString::getCString(v127);
v129 = strlen(v128);
if ( v129 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v125);
v130 = v129;
if ( v129 >= 0x17 )
{
v132 = 26;
if ( (v129 | 7) != 0x17 )
v132 = (v129 | 7) + 1;
v131 = (char *)operator new(v132);
v183 = v131;
*(_QWORD *)&v182 = v132 | 1;
*((_QWORD *)&v182 + 1) = v130;
goto LABEL_85;
}
LOBYTE(v182) = 2 * v129;
v131 = (char *)&v182 + 1;
if ( v129 )
LABEL_85:
memmove(v131, v128, v130);
v131[v130] = 0;
v133 = cocos2d::CCSprite::create_2();
a1->m_dashSpritesContainer = v133;
((void (__fastcall *)(cocos2d::CCSprite *, void *))v133->setTextureRect)(v133, &unk_1009A1568);
m_dashSpritesContainer = a1->m_dashSpritesContainer;
m_dashSpritesContainer->m_bDontDraw = 1;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
m_dashSpritesContainer,
0xFFFFFFFFLL);
v135 = cocos2d::CCSprite::createWithSpriteFrameName("playerDash2_001.png");
a1->m_dashFireSprite = v135;
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v135->setBlendFunc)(v135, 0x100000302LL);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *))a1->m_dashSpritesContainer->addChild)(
a1->m_dashSpritesContainer,
a1->m_dashFireSprite);
m_dashFireSprite = a1->m_dashFireSprite;
sub_10028CBE0((float *)&v169, 0.0, 0.0);
*(cocos2d::CCPoint *)&v190 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v178,
(const cocos2d::CCPoint *)a1);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD *, double))m_dashFireSprite->setPosition)(
m_dashFireSprite,
v178,
v190);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_dashFireSprite->setVisible)(a1->m_dashFireSprite, 0);
v137 = cocos2d::CCSprite::createWithSpriteFrameName("playerDash2_outline_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_dashFireSprite->addChild_0)(
a1->m_dashFireSprite,
v137,
1);
*(cocos2d::CCPoint *)&v191 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v178,
(const cocos2d::CCPoint *)a1->m_dashFireSprite);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD *, double))v137->setPosition)(v137, v178, v191);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v137->setOpacity)(v137, 150);
if ( (v182 & 1) != 0 )
v138 = (const char *)v183;
else
v138 = (char *)&v182 + 1;
v139 = cocos2d::CCSprite::createWithSpriteFrameName(v138);
a1->m_iconGlow = v139;
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))v139->setVisible)(v139, 0);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_dashSpritesContainer->addChild_0)(
a1->m_dashSpritesContainer,
a1->m_iconGlow,
2);
v140 = (cocos2d::CCString *)sub_1007AB580("ship_%02d_glow_001.png", v161);
v141 = cocos2d::CCString::getCString(v140);
v142 = strlen(v141);
if ( v142 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v191);
v143 = v142;
if ( v142 >= 0x17 )
{
v146 = 26;
if ( (v142 | 7) != 0x17 )
v146 = (v142 | 7) + 1;
v144 = (char *)operator new(v146);
v179 = v144;
v178[0] = v146 | 1;
v178[1] = v143;
LABEL_97:
memmove(v144, v141, v143);
v144[v143] = 0;
if ( (v178[0] & 1) != 0 )
goto LABEL_93;
goto LABEL_98;
}
LOBYTE(v178[0]) = 2 * v142;
v144 = (char *)v178 + 1;
if ( v142 )
goto LABEL_97;
BYTE1(v178[0]) = 0;
if ( (v178[0] & 1) != 0 )
{
LABEL_93:
v145 = (const char *)v179;
goto LABEL_99;
}
LABEL_98:
v145 = (char *)v178 + 1;
LABEL_99:
v147 = cocos2d::CCSprite::createWithSpriteFrameName(v145);
a1->m_vehicleGlow = v147;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_dashSpritesContainer->addChild_0)(
a1->m_dashSpritesContainer,
v147,
4294967293LL);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_vehicleGlow->setVisible)(a1->m_vehicleGlow, 0);
*(_QWORD *)&a1->m_width = 0x41F0000041F00000LL;
a1->m_unkAngle1 = 30.0;
v148 = GameManager::sharedState();
a1->m_defaultMiniIcon = GameManager::getGameVariable(v148, "0060");
v149 = GameManager::sharedState();
a1->m_swapColors = GameManager::getGameVariable(v149, "0061");
v150 = GameManager::sharedState();
a1->m_switchDashFireColor = GameManager::getGameVariable(v150, "0062");
v169 = 0;
begin = a1->m_playerFollowFloats.__begin_;
v152 = a1->m_playerFollowFloats.__end_ - begin;
if ( v152 > 0xC7 )
{
if ( (std::__vector_base::pointer)((char *)a1->m_playerFollowFloats.__end_ - (char *)begin) != (std::__vector_base::pointer)800 )
a1->m_playerFollowFloats.__end_ = begin + 200;
}
else
{
sub_10041E1B0(&a1->m_playerFollowFloats, 200 - v152, &v169);
}
a1->m_quickCheckpointMode = 0;
if ( (v178[0] & 1) == 0 )
{
if ( (v182 & 1) == 0 )
goto LABEL_105;
LABEL_114:
operator delete(v183);
if ( (v176[0] & 1) == 0 )
{
LABEL_106:
if ( (v174[0] & 1) == 0 )
goto LABEL_108;
goto LABEL_107;
}
goto LABEL_115;
}
operator delete(v179);
if ( (v182 & 1) != 0 )
goto LABEL_114;
LABEL_105:
if ( (v176[0] & 1) == 0 )
goto LABEL_106;
LABEL_115:
operator delete(v177);
if ( (v174[0] & 1) != 0 )
LABEL_107:
operator delete(v175);
LABEL_108:
if ( (v172[0] & 1) != 0 )
operator delete(v173);
if ( (__dst[0] & 1) != 0 )
operator delete(v171);
return v184;
}